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
chore(swingset-vat): declare deps of testing tools #5232
Conversation
Makes sense to me, though I think |
Yes, I think splitting it out would be better. I think it should go in a general However let's not let perfect be the enemy of the good. This is an improvement that is already done and just needs approval. |
Splitting these tools into their own package has a definite appeal. However, much of what they do is closely coupled to SwingSet internals (specifically, liveslots and how it sets up the relationship between the various bits of virtual object and stores machinery and liveslots' own GC machinery) since what they are doing is mocking the kernel side of liveslots and the database. If we were to make the tools their own package we'd have a package that depended heavily on deep imports from SwingSet, introducing some non-local dependencies that I think would not be good, or would require SwingSet to export stuff that under normal circumstances should not be exposed. |
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'm not a requested reviewer, nor have I touched this part of swingset before, but I believe this specific change is safe to land.
Yeah, I think it's fine. |
0ef7a35
to
7a6c796
Compare
#5244 is a new ticket we can use to discuss design and priority. |
I’d be happy to stamp this if I understood |
https://nodejs.org/es/blog/npm/peer-dependencies/ is a good primer. In this case, if Ava 3 were in |
That’s funny because I was working closely with Domenic on Q when he published that article. I didn’t understand it then or now, but I think you’ve hinted at the difference: With a Based on your note, I’ve filed endojs/endo#1177 Peer dependencies will be opaque to our bundler until we close that. It sounds like it’s just a matter of merging |
I think the term "peer dependency" is major part of the confusion, as it's not so much a dependency as a declaration of an invariant. I interpret what it means as "do not comingle me with alien versions of X". |
That's my understanding. |
in pursuit of #5201
Description
The
ava
and@endo/ses-ava
deps of@agoric/swingset-vat
weren't declared in its package.json. In projects that imported that package and usedtools/prepare-test-env-ava.js
, they would get errors like this on test:I think this was due to a misconception about
devDependencies
. It doesn't mean dependencies used only for development; it means dependencies only for development of this package and not needed by any consumers of this package.tools
files are exported by this package (and consumed in dapps) so for those modules to work the dependencies have to be available too.This uses
peerDependencies
to ensure that the test environment has the right deps and that they're compatible with those at the package parent scope.Security Considerations
--
Documentation Considerations
Some guidance around which kind of dep to use?
Maybe an audit of Eslint suppressions to see which are legitimate. Those that aren't we might disable.
Testing Considerations
CI