Skip to content

Commit

Permalink
Update pnpm to v9.15.0 [SECURITY] (#40560)
Browse files Browse the repository at this point in the history
* Update pnpm to v9.15.0 [SECURITY]
* Bring back pnpmfile hack for pnpm/pnpm#3935, which regressed in 9.12.0

---------

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Brandon Kraft <[email protected]>
Co-authored-by: Brad Jorsch <[email protected]>
  • Loading branch information
4 people authored Dec 20, 2024
1 parent c6b2c65 commit b414852
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PHP_VERSION=8.2
COMPOSER_VERSION=2.8.3
NODE_VERSION=22.9.0
PNPM_VERSION=9.3.0
PNPM_VERSION=9.15.0

# Other useful version numbers.
MIN_PHP_VERSION=7.2
Expand Down
10 changes: 10 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@ function afterAllResolved( lockfile ) {
return lockfile;
}

for ( const [ k, v ] of Object.entries( lockfile.packages ) ) {
// Forbid installing webpack without webpack-cli. It results in lots of spurious lockfile changes.
// https://github.com/pnpm/pnpm/issues/3935
if ( k.startsWith( 'webpack@' ) && ! v.optionalDependencies?.[ 'webpack-cli' ] ) {
throw new Error(
"Something you've done is trying to add a dependency on webpack without webpack-cli.\nThis is not allowed, as it tends to result in pnpm lockfile flip-flopping.\nSee https://github.com/pnpm/pnpm/issues/3935 for the upstream bug report.\n"
);
}
}

return lockfile;
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"engines": {
"node": "^22.9.0",
"pnpm": "^9.3.0 <9.12.0"
"pnpm": "^9.15.0"
},
"packageManager": "pnpm@9.3.0",
"packageManager": "pnpm@9.15.0",
"pnpm": {
"patchedDependencies": {
"@wordpress/[email protected]": ".pnpm-patches/@[email protected]"
Expand Down
Loading

0 comments on commit b414852

Please sign in to comment.