Upgrade and unify @types/node version#77900
Conversation
d4d06c4 to
6e5fb4d
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.87 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 8bf7358. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25312269514
|
c66eb63 to
18462a5
Compare
18462a5 to
403bd63
Compare
Is there a need to move this to the latest 20.x version? It does seem good to be consistent with the version used across the Gutenberg repository, but it doesn't seem necessary to require consumers to use the latest 20.x node version. In fact, this seems like it may encourage this duplication in consumers who are not very careful to avoid it by forcing a package upgrade that isn't essential. It seems preferable to relax and widen the declared dependency. Consistency is good, but perhaps It does seem valuable to update this package in our lockfile to the latest 20.x version and ensure that it is not duplicated there. |
Good catch. Thanks. I will revert the change for e2e utils peer-dependency. |
Add @types/node to devDependencies for local type support in packages/e2e-test-utils-playwright, and relax/pin the peerDependency for @types/node to ^20.17.10 to maintain compatibility with downstream consumers.
|
Updated. Thanks |
|
All the package.json files are still upgrading the dependency. My comment was that they should align, but not necessarily upgrade to the latest version. I still see this in the diff: -"@types/node": "^20.19.0",
+"@types/node": "^20.19.39",I think these could either all target the previous minimum version range -"@types/node": "^20.19.0",
+"@types/node": "^20.17.10",or -"@types/node": "^20.17.10",
+"@types/node": "^20.19.0", |
But those are all |
My mistake, you're right, thanks. |
sirreal
left a comment
There was a problem hiding this comment.
Looks good, nice cleanup. Having duplicated types versions like this can be problematic so thanks for addressing it.
|
I'm not an expert of Would there be value in such a check? |
There is a very popular tool for that - Syncpack. We could set it up with some rules to ensure we have consistency across the monorepo. |
|
I have created #77950 to add Syncpack to ensure the dependencies are consistent. |
What?
Upgrade and unify the
@types/nodeversion across all workspaces, and add the dependency to workspaces that were missing it.Extracted out of #75814.
Why?
The
@types/nodeversion was inconsistent across the repo:^20.17.10packages/core-datawas on^20.19.0test/e2e,test/storybook-playwright, etc.) were missing the dependency entirely, relying on whatever version got hoistedInconsistent versions across workspaces can result in multiple copies of
@types/nodebeing installed, which leads to type conflicts (e.g. duplicated/incompatible Node global declarations) and unpredictable type-checking behavior depending on hoisting order.How?
@types/nodeentry to^20.19.39(latest in the20.xline), including the rootpackage.json@types/node: ^20.19.39as adevDependencytotest/e2eandtest/storybook-playwright, which were previously missing itpackage-lock.jsonaccordinglyNo production code changes —
devDependency/peerDependencyupdates only.Testing Instructions
npm run clean:package-types && npm run buildTesting Instructions for Keyboard
N/A — no UI changes.
Screenshots or screencast
N/A — dependency-only change.
Use of AI Tools
The PR description was drafted with assistance from Claude Code.