-
Notifications
You must be signed in to change notification settings - Fork 1
generate js client with codama and add a basic test to confirm works #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
68a95ab
55f0562
7e63017
b6f6b97
adf17c5
aab1aba
f398816
d976a07
44e827e
6c63eae
eb45059
6c02f9b
6c7149a
541bcee
4d04660
bae4326
4b8e58a
b5b0090
3190d0e
7a78d05
7005093
ba596f8
f4cf043
1f13365
af8cfd3
f733e64
0ae07e2
b924e85
0e15786
dfaba66
fa8c4d2
f746b8f
f4f065e
7012d1f
4ba1d33
c1e993b
3cb4b50
efe5ef1
ef978a8
3acbf98
49a649e
9736f86
f9f996b
1208a2a
85b4c2f
be88336
fedde4e
5434c20
5855be9
5ca9842
c9d9cb6
1d5e00f
2f2b719
55d9ccc
9c835f8
10e46cc
a4f5346
7897962
59323fd
80c5e07
9aa35ba
df15909
4859601
fa77bee
be3b072
7d4812c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| /target | ||
| proptest-regressions/ | ||
| .cargo-root/ | ||
| node_modules/ | ||
| generated/ | ||
|
|
||
| # Make sure no Solana key is uploaded by accident. | ||
| *.json | ||
| !bench-report.json | ||
| !programs/settlement/idl/** | ||
| !programs/settlement/idl/**/*.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| src/generated/ | ||
| pnpm-lock.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Same as rustfmt | ||
| printWidth: 100 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "name": "cow-solana-settlement-client", | ||
| "version": "0.3.0", | ||
| "type": "module", | ||
| "packageManager": "pnpm@11.25.0", | ||
| "description": "A library for interacting with CoW Protocol on Solana", | ||
| "license": "(MIT OR Apache-2.0)", | ||
| "main": "src/index.ts", | ||
| "files": [ | ||
| "./dist/src", | ||
| "./dist/types", | ||
| "./src/" | ||
| ], | ||
|
kaze-cow marked this conversation as resolved.
|
||
| "scripts": { | ||
| "typecheck": "tsc --noEmit", | ||
| "test": "vitest run", | ||
| "format": "prettier --write .", | ||
| "format:check": "prettier --check ." | ||
| }, | ||
| "peerDependencies": { | ||
| "@solana/kit": "^8" | ||
| }, | ||
|
Comment on lines
+20
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this a peer dependency? Peer dependencies have been a huge pain in the past, and we'll be only noticing this once the linked versions start to drift; also indirectly, through people failing to install our package in their project. I suggest getting rid of this unless there's an extremely good reason for it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the past I used peer dependencies with Cannon to moderate success. It actually helps reduce problems with downloading multiple package versions and ultimately ending up with either type or compatibility errors because you are unknowingly using distinct/separate library versions, especially when working with web applications. also the both of us are not maybe the best resources to decide on this. If it helps, I notice our own cow sdk uses multiple peer dependencies. What I do think we should do is widen the list of available versions to maybe For now I have expanded the scope of the peer dependency to accept all versions (*) be88336
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me explain the pitfalls with peer dependencies with an example. I created two packages (here) that try to import our package:
Now, you could argue "this problem is just because peer and dev deps don't match, the fix is easy!". Now, this is not really something special of this PR. The example in the Codama readme has the same peer dependency. The expectations that Codana puts on us are clear: you must update often. You must stay in sync with The reason I feel so strongly is that I had we did the same for the contracts and so, so many people were struggling installing our package because they used Ethers v6 and we're still at Ethers v5. With a dependency they could have sorted out the issue much more easily compared to a peer dependency, where instead they need to understand both the problem as well as our internals. Look at what error appears when building v6 from above! It's deep inside the imported package and there's no clue as to what's actually going wrong.Note they are all optional.
We absolutely should. And I don't think we can do better, we aren't compatible with other versions other than 8 (not 6). So
What I think it's happening here is that the package is too strict in That said, I'm not a web dev, this is just my frustration with using peer deps in JS. There's certainly another side of the coin, the dependency problem are a thing as well. That said, what next? Two options, I let you pick:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok I don't really consider myself an expert or well knowledged on any of this but it seems wrong to not use a peer dependency here based on all the information available to me so @limitofzero can help us decide
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added an issue for testing on our end that the package is good, for now let's keep it as it is and rely on the frontend to tell us if there are issues. #141 |
||
| "dependencies": { | ||
| "@solana/program-client-core": "^8" | ||
| }, | ||
|
kaze-cow marked this conversation as resolved.
|
||
| "devDependencies": { | ||
| "@solana/kit": "^8", | ||
| "@types/node": "^24", | ||
| "litesvm": "^1", | ||
| "prettier": "^3", | ||
| "typescript": "^5", | ||
| "vitest": "^3" | ||
| } | ||
| } | ||
|
kaze-cow marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.