Open runspired opened 2 years ago
Btw, you can use monorepos right now without duplicating volta configuration by adding
"volta": {
"extends": "../../package.json"
}
to each child package package.json
file. (You might need to adjust the path depending on the layout of your monorepo.)
@Royston-Shufflebotham-i2 I'm aware (hence noting it in the description). I brought up with @chriskrycho thar Volta doesn't need to do this since there's a spec it can follow instead, but it was a private convo months ago and I didn't want the knowledge to get forgotten.
We're willing to work on this, would you review/accept a PR implementing this if we sent one?
@SBoudrias definitely!
An implementation note: we should not require it but should support it. As a bit of an open design question, we may also want to think about giving users a way to opt into that behavior, since it will otherwise be a change to the semantics of existing projects.
@chriskrycho I wasn't quite sure about the directory
approach per se. But I'd have in mind something akin to
package.json
package.json
with a volta config to useThat'd reduce boilerplate inside monorepos a lot.
I guess it would however change the behaviour seen today, where it'll use the machine global version instead of the defined one. But do you think that's an expected behaviour we should maintain? To me this feels like a case where the user might not have realize the versions aren't pinned (but think they are.)
This prevents needing to have unique volta configs or re-exports in every package.json file, as long as the package.json file is correctly using the spec for specifying respository volta can easily and safely determine where the root is.
cc @chriskrycho