feat: support multiple node versions in workspaces#6724
feat: support multiple node versions in workspaces#6724mark-omarov wants to merge 4 commits intopnpm:mainfrom
Conversation
|
I guess the implementation would become easier with the setting placed inside Maybe we could place useNodeVersion there instead {
"pnpm": {
"useNodeVersion": "18.0.0"
}
}If we decide to proceed with |
|
Thanks @zkochan Manifests are available in the Memoization of the |
29de498 to
07b9b4d
Compare
|
Tests are needed. Also, what about running install scripts of projects on |
Thanks @zkochan ! It's not complete yet. I still need to figure out tests randomly failing on CI (likely timeout related). I'll try to add some tests as well. As Just a note - I can only work on this a few a week tops. Next month I might get more time for this, I really look forward getting it done though. |
|
Sorry, not happening anytime soon. Closing to declutter for now. |
Close #6720
This PR implements the support for specifying multiple Node.js versions in a workspace environment for multiple packages. This feature is handy in multi-package workspace environments, enabling seamless version switching for each package - more details in the linked issue.
The version for each package can be specified using the
pnpmconfig in thepackage.jsonof each project in a workspace.Notes
I kept
use-node-versionsupport for.npmrcfor backward compatibility. Only root-level is supported, and if set - it will be applied to all packages. The per-package version must be assigned in thepackage.json'spnpmconfig of the desired package. I can see a case when.npmrcalready exists withuse-node-versionset to default for all packages, but some might opt-in to use thepnpmconfig to select another version to use.I tested it with multiple configurations, including nested calls.
It would be easier to implement if the
pnpm/src/main.tswere executed on every script separately with the correct path to each package, but I am unsure of complications that will occur, and it's too much of a change.