wp-build: Widen optional peer dependency ranges#77568
Conversation
|
Size Change: 0 B Total Size: 7.76 MB ℹ️ View Unchanged
|
|
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. |
|
Flaky tests detected in 161e2f3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24830806966
|
|
@Adi-ty mind testing this to confirm things work as desired downstream in WordPress/ai#455? |
Yes, this works! 🚀 To test it downstream in WordPress/ai#455, I temporarily added an npm override in package.json to mimic this exact peer dependency range ("@wordpress/theme": ">=0.8.0 <1.0.0"). The build also compiles successfully. |
|
@mirka is this fix worthwhile / ok to backport to 7.0? |
|
This is a build tool, and the changes here shouldn't affect the output, so there's nothing really to backport. If you need a |
What?
Reported in WordPress/ai#451 (comment)
Updates the optional
@wordpress/boot,@wordpress/route, and@wordpress/themepeer dependency ranges in@wordpress/buildto avoid blocking newer compatible package versions.Also the floor for
@wordpress/themewas 0.3.0 when it actually required the build plugins added in 0.8.0. This is also fixed.Why?
The published peer dependency metadata was still capped to older
0.xranges, which can cause npm dependency resolution failures when consumers install newer compatible versions alongside@wordpress/build.Important
The gotcha here is that semver for
0.xranges (i.e. before a 1.0.0 release) means that every minor release is considered potentially breaking. So^0.1.0actually only goes up to0.1.x, not0.x.x.How?
This widens the optional peer dependency ranges for
@wordpress/boot,@wordpress/route, and@wordpress/themeto<1.0.0, while preserving their existing minimum supported versions.Testing Instructions
@wordpress/buildpackage.npm install <packed-tarball> @wordpress/ui@0.11.0 @wordpress/boot@0.11.0 @wordpress/route@0.10.0 --ignore-scripts.@wordpress/buildpeer dependency resolution errors for those packages.(Might be worth having a CI check similar to this to prevent issues moving forward… Out of scope for this PR though.)