-
Notifications
You must be signed in to change notification settings - Fork 3
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
build: add dependencies for subpackages #87
Conversation
"@agoric/rpc": "^0.9.0", | ||
"@agoric/web-components": "^0.15.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're either dependencies
or peerDependencies
but not both.
peer has less burden on the consumer, so if that works go with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they should be dependencies
because they're imported and used directly in this package: https://github.com/Agoric/ui-kit/blob/main/packages/react-components/src/lib/context/AgoricProviderLite.tsx#L10-L18
It's possible the consumer doesn't directly use the exposed chainStorageWatcher
or walletConnection
types from the context so I think it would be more burden to require them to add these as dependencies on their own.
However, if the client is using those types elsewhere, I figured it would make sense to put them in peerDependencies
as well to avoid conflicts. Am I thinking about this wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah then they're dependencies
.
I see your motivation to constrain the peerDependencies
as well, but I don't think it's warranted.
@@ -30,14 +30,15 @@ | |||
"lit": "2.0.2" | |||
}, | |||
"devDependencies": { | |||
"@agoric/rpc": "^0.9.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this is a new dependency as of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I figured it was a dependency at first but then realized it was just using any
for the chainStorageWatcher type, but left this in since that should be fixed anyway.
@@ -52,6 +52,7 @@ describe('makeAgoricWalletConnection', () => { | |||
|
|||
// Don't bother faking keplr, just expect it to try to enable and fail. | |||
await expect(() => | |||
// @ts-expect-error fake partial watcher implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could cast the watcher
so you don't have to ignore at each site. up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Casting requires stubbing out more of the functions than the test uses, or else I'm getting type errors. Unless you mean casting to any
, but I think the expect-error with explanation would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to put the one ts-expect-error
at the cast site. then it will let you lie about what the type is.
i agree that any expect-error should have an explanation
.github/workflows/trunk.yml
Outdated
@@ -21,7 +21,7 @@ jobs: | |||
cache-dependency-path: yarn.lock | |||
|
|||
- run: yarn install --frozen-lockfile | |||
|
|||
- run: yarn workspaces run prepack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be necessary. lerna publish
will pack along the way. I suppose you had it here for debugging? please either remove or add a comment explaining why this redundant command is included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to be safe because the lerna publish
wasn't prepacking in the correct order and failing as seen in https://github.com/Agoric/ui-kit/actions/runs/8053306725/job/21995398192
I read that lerna would pack in the correct order if we explicitly added the dependencies in the package.jsons
, but added this to be safe because I noticed MAINTAINERS.md includes an explicit prepack step as well. Just took this back out though so we can be sure if it's needed, but worst case we'll have to do another PR to add it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I leave the outstanding items to your judgement
"@agoric/rpc": "^0.9.0", | ||
"@agoric/web-components": "^0.15.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah then they're dependencies
.
I see your motivation to constrain the peerDependencies
as well, but I don't think it's warranted.
@@ -52,6 +52,7 @@ describe('makeAgoricWalletConnection', () => { | |||
|
|||
// Don't bother faking keplr, just expect it to try to enable and fail. | |||
await expect(() => | |||
// @ts-expect-error fake partial watcher implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to put the one ts-expect-error
at the cast site. then it will let you lie about what the type is.
i agree that any expect-error should have an explanation
.github/workflows/trunk.yml
Outdated
@@ -21,7 +21,6 @@ jobs: | |||
cache-dependency-path: yarn.lock | |||
|
|||
- run: yarn install --frozen-lockfile | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignorable nit: removing this newline makes the comment a little harder to read
The publish NPM workflow is failing https://github.com/Agoric/ui-kit/actions/runs/8053306725/job/21995398192
It seems like it's not building and linking the packages in the order according to
ui-kit/package.json
Lines 5 to 9 in 2ae3e21
@agoric/react-components
fails to build because@agoric/web-components
isn't built yet. It seems like the way to fix this is to declare the dependencies on other sub-packages in theirpackage.jsons
, which seems to be whatagoric-sdk
does for its sub-packages, but we'll see what happens when the workflow runs.I also replaced an
any
type with the properChainStorageWatcher
type in@agoric/web-components
, now that the dependency is included.