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

Update wordpress monorepo #37669

Merged
merged 9 commits into from
Jun 4, 2024
29 changes: 21 additions & 8 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
* @returns {object} Modified pkg.
*/
function fixDeps( pkg ) {
// Outdated dep. Already fixed upstream, just waiting on a release.
// https://github.com/Automattic/wp-calypso/pull/87350
if (
pkg.name === '@automattic/social-previews' &&
pkg.dependencies?.[ '@wordpress/components' ] === '^26.0.1'
) {
pkg.dependencies[ '@wordpress/components' ] = '>=26.0.1';
// Deps tend to get outdated due to a slow release cycle.
// So change `^` to `>=` and hope any breaking changes will not really break.
if ( pkg.name === '@automattic/social-previews' ) {
for ( const [ dep, ver ] of Object.entries( pkg.dependencies ) ) {
if ( dep.startsWith( '@wordpress/' ) && ver.startsWith( '^' ) ) {
pkg.dependencies[ dep ] = '>=' + ver.substring( 1 );
}
}
}

// Missing dep or peer dep on react.
// https://github.com/WordPress/gutenberg/issues/55171
// https://github.com/WordPress/gutenberg/issues/62250
if (
pkg.name === '@wordpress/icons' &&
( pkg.name === '@wordpress/icons' || pkg.name === '@wordpress/primitives' ) &&
! pkg.dependencies?.react &&
! pkg.peerDependencies?.react
) {
Expand Down Expand Up @@ -185,6 +187,17 @@ function afterAllResolved( lockfile ) {
"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."
);
}

// Forbid `@wordpress/dependency-extraction-webpack-plugin` v6 until WP 6.5 support is dropped.
// https://github.com/WordPress/gutenberg/issues/62202
if (
k.startsWith( '/@wordpress/dependency-extraction-webpack-plugin/' ) &&
! k.startsWith( '/@wordpress/dependency-extraction-webpack-plugin/5.' )
) {
throw new Error(
'@wordpress/dependency-extraction-webpack-plugin >= 6.0.0 is not allowed until we drop WordPress 6.5 support.\nSee https://github.com/WordPress/gutenberg/issues/62202 for details.'
);
}
}
return lockfile;
}
Expand Down
Loading
Loading