-
Notifications
You must be signed in to change notification settings - Fork 255
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
monorepo support #378
Comments
I think monorepos are already well supported. Works when moving between my 2 monorepos which have the node version pinned at the root.
|
@dmfenton Which directory were you in when you ran those commands? If you were in the root of each monorepo it will probably work. The issue that we have currently is that we detect the first |
odd, it works when entering a package of one monorepo, but not the other
|
I see why that was working now, the correct version was my default in the sub package where there is no Volta pinning.
Is it possible to ignore package.json files that do not contain Volta pinning and continue to traverse upwards? At least for some finite number of directories? |
@dmfenton Yeah, that’s likely going to be a part of the solution for monorepo support. We’ve got this tagged as “Needs RFC” because there are a lot of corner cases to consider, and we want to make sure that we tackle them correctly. Any input on the common use-cases for monorepos and how you would expect Volta to act would be helpful on that front. |
Wanted to chime in on this issue that this gap in support also affects the Ember eco-system, particularly in-repo addons. In-repo addons are essentially "sub-projects" in the same way as yarn workspaces, et al. The only time you would really notice this is when you might want to run an in-repo addon's tests suite independently from the host app or build/serve up the addon's "dummy" app. It seems to me, as a consumer, that volta should probably just have a config based escape hatch for pointing to the correct project root, as @chriseppstein originally suggested. |
can we use git root to determine project root? |
@runspired it's not enough to just use the "root package.json". it's reasonable for some subprojects of a monorepo to have different volta configuration(s). For instance, css-blocks has a vscode plugin that I'd really like to pin to the current version of node that electron uses, while the rest of the project should be on an older version of node for compatibility reasons. |
My personal preference would just be to traverse upwards until it finds (or doesn't find) a specified version in a package.json. |
@wagenet That's definitely a reasonable option. The only issue I see, and this would really take some discussion, is should we support "mixed" versions? That is, we currently let you specify both Perhaps we could start with that approach and then tackle any extra edge cases later so we can progressively add support for different monorepo use-cases. |
@charlespierce what about making it explicit as a first pass? "volta": {
"node": "inherit"
} If it found "inherit" it would look up the tree. It would be nice not to have to add the volta declaration to all the workspace children, but this would have the benefit of not having to specify the same versions multiple times and possibly forgetting to update one. |
Yes. Don't try to be smarter than the developer.
Please allow us to specify any json file containing As I suggested above: {
"volta": {
"extends": "../../package.json"
}
} is simple enough and it matches the syntax that is used in other projects such as If you want to simplify the common case of walking up the directory tree, then a |
I would also be fine with @chriseppstein's suggestion. |
FYI - @charlespierce posted an RFC for this yesterday: volta-cli/rfcs#43. Please review and chime in! |
Late to the party, I evaluated volta today and this is a pain. nvm correctly looks upward until it finds .nvmrc, correctly inheriting unless explicitely asked not to. With volta, I'll now have to add an unnecessary config: IMO the |
Hi @Offirmo, thanks for the feedback. I definitely agree that needing to add Part of that has to do with the fact that the data is stored in |
Thanks for the answer! Suggestion: how about supporting |
That is, as you can imagine, a non-trivial undertaking! Speaking for myself here (I have not conferred with other maintainers), I agree with the sentiment pretty strongly! In any case, #282 is the right place for further discussion of that approach specifically. |
In a monorepo I'd like a way to have a single source of truth for what versions are pinned. Can we have a way of extending notion config within a sub-project? E.g.
This would still allow for overrides on a per-project basis but simplify the common case within a monorepo.
The text was updated successfully, but these errors were encountered: