[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817
Draft
Copilot wants to merge 2 commits into
Draft
[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix compatibility issue between Rush 5.175.1 and pnpm 11.1.1
[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnpm 11 removed support for the
pnpmfield inpackage.json(includingonlyBuiltDependencies/neverBuiltDependencies) and replaced it withallowBuilds: Record<string, boolean>inpnpm-workspace.yaml. Rush was still writing the old fields, causing[ERR_PNPM_IGNORED_BUILDS]on every install, andrush-pnpm approve-buildswould run but never update any config files.Changes
New
globalAllowBuildsconfig field (pnpm 11+)globalAllowBuilds?: Record<string, boolean>topnpm-config.jsonschema andPnpmOptionsConfigurationallowBuildsin the generatedpnpm-workspace.yamlduring installationtrue= package allowed to run build scripts;false= explicitly deniedBackward compatibility
When using pnpm 11 with the old
globalOnlyBuiltDependencies/globalNeverBuiltDependenciesfields, Rush automatically converts them toallowBuildsformat (entries becometrue/falserespectively) and emits a deprecation warning directing users to migrate toglobalAllowBuilds.InstallHelpers.tsFor pnpm ≥ 11.0.0, skips writing
neverBuiltDependencies/onlyBuiltDependenciestocommon/temp/package.json(pnpm 11 ignores thepnpmfield entirely).approve-buildscommandFor pnpm ≥ 11.0.0,
rush-pnpm approve-buildsnow correctly reads the updatedallowBuildsmap frompnpm-workspace.yaml(written bypnpm approve-builds) and persists it back topnpm-config.jsonasglobalAllowBuilds, then re-runsrush update. Previously this was reading frompackage.jsonwhich pnpm 11 no longer updates.