Skip to content

Build: Check workspace peer ranges with syncpack - #86612

Closed
simison wants to merge 1 commit into
trunkfrom
simison/syncpack-peer-range-check
Closed

simison wants to merge 1 commit into
trunkfrom
simison/syncpack-peer-range-check

Conversation

@simison

@simison simison commented Nov 10, 2026

Copy link
Copy Markdown
Member

Alternative to #85386

What?

Adds a version group so a peer range on a workspace package must admit the workspace version, checked by the existing lint:deps step.

Follow-up to manual range-widening changes:

Fails when a workspace peer range excludes the peer's current version. Does not include the next breaking version once its changelog announces breaking changes as done in #85386 — that could still be a separate script if we need it.

Why?

The major version of @wordpress/theme gets bumped via tooling, but the peer dependency range of @wordpress/wp-build kept the old range. That causes issues with plugins using the build tool package.

Packages where peer deps need updating accordingly:

  • wp-build
  • stylelint-config
  • theme-build-tools

To avoid missing updates, we should automate or lint it. I resorted in linting to leave bumping up to folks doing the updates for now.

How?

The existing lint:deps step will validate peer ranges.

Testing Instructions

Testing Instructions for Keyboard

Use of AI Tools

Claude

Adds a version group so a peer range on a workspace package must admit the workspace version, checked by the existing lint:deps step.
@simison simison added the [Type] Build Tooling Issues or PRs related to build tooling label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: simison <simison@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.63 MB

90c4d89 Run

Comment thread syncpack.config.mjs
Comment on lines +4 to +9
{
label: 'Peer ranges on workspace packages must admit the workspace version.',
dependencies: [ '@wordpress/**' ],
dependencyTypes: [ 'peer', 'local' ],
policy: 'sameRange',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced SameRangeMismatch with Syncpack 15.3.1 for 4.0.0-next.v.… against ^3.0.0 || ^4.0.0, while stable 4.0.0 passes. Could we handle or exclude this prerelease case for wp/next, where lint:deps also runs?

@ciampo ciampo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to #85386, the tradeoff seems to be that breaking-change PRs can now pass while peer ranges still exclude the upcoming major. lint:deps only catches this after the package versions change, and the release flow doesn't currently run it between versioning and publishing.

Could we run it on the versioned manifests before publishing? That would keep the Syncpack approach and prevent these stale ranges from reaching npm, though detection would move from the breaking-change PR to the release process.

@simison

simison commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

though detection would move from the breaking-change PR to the release process.

With your experience with the release; do you think it's good to add to the release process, or rather let everyone handle breaking change updates directly in PRs? Less work for the person doing the release, but I don't see the cons/pros super clearly without knowing more about that process.

@simison

simison commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Moving on with scripts instead for now, see conversation in #85386 (review)

@simison simison closed this Nov 11, 2026
@simison
simison deleted the simison/syncpack-peer-range-check branch November 11, 2026 09:07
@ciampo

ciampo commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

though detection would move from the breaking-change PR to the release process.

With your experience with the release; do you think it's good to add to the release process, or rather let everyone handle breaking change updates directly in PRs? Less work for the person doing the release, but I don't see the cons/pros super clearly without knowing more about that process.

Moving on with scripts instead for now, see conversation in #85386 (review)

I'd prefer handling peer-range updates in the breaking-change PRs, where the author can assess compatibility, rather than leaving that work to the release manager. I'd go with #85386 for that reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants