Skip to content

Pin ws so npm release packing succeeds#3769

Merged
adamziel merged 1 commit into
trunkfrom
adamziel/fix-npm-release-ws-override
Jun 8, 2026
Merged

Pin ws so npm release packing succeeds#3769
adamziel merged 1 commit into
trunkfrom
adamziel/fix-npm-release-ws-override

Conversation

@adamziel

@adamziel adamziel commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

What it does

Prevents the npm release from failing when a publishable package declares a dependency that is also listed in root overrides.

Fixes the npm release failure introduced in #3745:

npm 11 rejected packing @wp-playground/mcp:
Override for ws@8.21.0 conflicts with direct dependency

For @wp-playground/mcp, ws is now pinned to the same exact version as the root override:

"ws": "8.21.0"

Rationale

The failed npm release reached lerna publish, built dist/packages/playground/mcp/package.json, then npm 11 rejected packing it:

Override for ws@8.21.0 conflicts with direct dependency

The source package used ^8.21.0, but the release build writes resolved dependency versions into dist manifests. That produced a direct ws@8.21.0 dependency next to a root ws@^8.21.0 override, which npm 11 treats as a conflict even though the range resolves correctly.

Implementation

Adds tools/scripts/check-publish-package-overrides.mjs. The script scans publishable workspace packages and fails when:

  1. a package directly depends on a root-overridden dependency, and
  2. either the package dependency or the root override does not exactly match the lockfile's resolved version.

The check now runs in:

  • test-built-npm-packages, so PRs catch this before merge
  • publish-npm-packages.yml, so the release fails before lerna publish mutates versions or tags

Testing instructions

Run the guard:

node tools/scripts/check-publish-package-overrides.mjs

Expected result with this PR:

Publish package override validation passed.

I also temporarily reverted ws in the root override and MCP package back to ^8.21.0; the new guard failed with the expected release-conflict message.

@adamziel adamziel requested review from a team, ashfame and Copilot June 8, 2026 15:10

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Pins the ws version to an exact 8.21.0 to avoid npm 11 EOVERRIDE conflicts during Lerna packing for @wp-playground/mcp.

Changes:

  • Pin ws as an exact version in @wp-playground/mcp dependencies.
  • Pin the root ws override to the same exact version.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
packages/playground/mcp/package.json Pins ws dependency to 8.21.0 to align with root overrides and prevent packing conflicts.
package.json Pins the ws override to 8.21.0 to match the workspace direct dependency and satisfy npm 11 packing rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamziel adamziel force-pushed the adamziel/fix-npm-release-ws-override branch 2 times, most recently from 69ad303 to c063fb6 Compare June 8, 2026 20:14
@adamziel adamziel changed the title [GitHub Actions] Pin ws so npm release packing succeeds Pin ws so npm release packing succeeds Jun 8, 2026
@adamziel adamziel force-pushed the adamziel/fix-npm-release-ws-override branch from c063fb6 to 2b71914 Compare June 8, 2026 22:14
@adamziel adamziel merged commit d4aaef1 into trunk Jun 8, 2026
53 checks passed
@adamziel adamziel deleted the adamziel/fix-npm-release-ws-override branch June 8, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants