Repository navigation
Theme Build Tools: Declare @wordpress/theme as a peer dependency - #85388
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 8.56 MB
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Custom Completer: should allow newlines after multiple option completions in
|
f8bfc4b to
a40b66e
Compare
a40b66e to
307f106
Compare
| "vitest": "^5.0.3" | ||
| }, | ||
| "peerDependencies": { | ||
| "@wordpress/theme": "^3.0.0 || ^4.0.0", |
There was a problem hiding this comment.
307f106 to
f973420
Compare
f973420 to
48a851e
Compare
| "vitest": "^5.0.3" | ||
| }, | ||
| "peerDependencies": { | ||
| "@wordpress/theme": "^3.0.0 || ^4.0.0", |
There was a problem hiding this comment.
It looks like npm still auto-installs the theme through this package, despite the optional declarations in build and stylelint-config.
One way to fix that would be to add @wordpress/theme to peerDependenciesMeta with optional: true, WDYT ?
There was a problem hiding this comment.
Yep, I think so. It's a bit annoying how many places now have this so we'll definetely need linting/automation to catch incomplete ranges in future.
e2d569d to
4158615
Compare
71f7643 to
7cbdce2
Compare
a9e5a74 to
0b81f9c
Compare
Follow-up to #83568
What?
Closes
Declares
@wordpress/themeas a peer dependency of@wordpress/theme-build-tools(^3.0.0 || ^4.0.0) instead of a regular dependency, so consumers use the version of@wordpress/themethey've chosen, rather than getting a second pinned copy.The plugins already do nothing when theme can't be loaded, so no code changes are needed.
In #83568 I pinned the version to make CI and initial merge easier. We're between package release cycle with this (#83568) so NPM consumers never got the direct dependency version yet.
Why?
How?
Testing Instructions
Using it without
@wordpress/themein a sample project would fail to add fallbacks silently, and using different versions of@wordpress/themeworks.The ranges would need to be updated manually, which is why I'm also looking at linting peer ranges:
Use of AI Tools
yes