Skip to content
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

Add volta configuration for managing node versions #19705

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,9 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
"node": "14.16.0",
"yarn": "1.22.10"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not really "minor". It doesn't change the code at all, it's just configuring a dev tool.

Suggested change
Significance: minor
Significance: patch

Same in your other changelog files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Type: added

Added volta configuration to package.json to pin node version
3 changes: 3 additions & 0 deletions projects/packages/connection-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
"extends": "../../../package.json"
}
}
4 changes: 4 additions & 0 deletions projects/packages/jitm/changelog/add-volta-pin-node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added volta configuration to package.json to pin node version
3 changes: 3 additions & 0 deletions projects/packages/jitm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we'd want to extend here (and for the other packages), since the JITM package is also available standalone, in a situation where there is nothing to extend:
https://github.com/Automattic/jetpack-jitm/blob/master/package.json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nothing else, we could copy the configuration and use a script (run from precommit and CI) to ensure that the copies remain in sync and are in sync with .nvmrc. We could also verify that the "engines" are in sync everywhere too, and that the versions are compatible.

Or we could wait for volta to resolve volta-cli/volta#282 so we could just drop a .voltarc or whatever in the monorepo root.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we'd want to extend here (and for the other packages), since the JITM package is also available standalone...

Makes sense! I'd forgotten about the mirror repos. I've updated the PR so that each package.json has the version info rather than extending the root, except for projects/plugins/jetpack/tests/e2e/package.json, which now extends projects/plugins/jetpack/package.json.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also verify that the "engines" are in sync everywhere too, and that the versions [in .nvmrc versus package.json "engines.node"] are compatible.

FYI, I pushed #19748 to ensure that engines in package.json is in sync everywhere, and #19750 to check that the version in .nvmrc satisfies that called for by package.json.

Once those are merged, it should be straightforward to do the same for the volta blocks.

"extends": "../../../package.json"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added volta configuration to package.json to pin node version
3 changes: 3 additions & 0 deletions projects/packages/lazy-images/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
"extends": "../../../package.json"
}
}
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/add-volta-pin-node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Added volta configuration to package.json to pin node version
3 changes: 3 additions & 0 deletions projects/plugins/jetpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,8 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
"extends": "../../../package.json"
}
}
3 changes: 3 additions & 0 deletions projects/plugins/jetpack/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
"extends": "../../../../../package.json"
}
}
3 changes: 3 additions & 0 deletions tools/cli/skeletons/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"engines": {
"node": "^14.16.0",
"yarn": "^1.3.2"
},
"volta": {
"extends": "../../../../package.json"
}
}