[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817
Merged
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
iclanton
marked this pull request as ready for review
June 6, 2026 22:34
iclanton
requested review from
apostolisms,
bmiddha,
dmichon-msft,
jxanthony and
octogonz
as code owners
June 6, 2026 22:34
iclanton
enabled auto-merge (squash)
June 6, 2026 22:34
octogonz
reviewed
Jun 6, 2026
octogonz
reviewed
Jun 6, 2026
octogonz
reviewed
Jun 6, 2026
octogonz
approved these changes
Jun 6, 2026
iclanton
disabled auto-merge
June 6, 2026 23:18
Member
|
@copilot - take a look at the comments on the PR and respond and address them. |
… exclusion error, fix PNPM capitalization
iclanton
enabled auto-merge (squash)
June 6, 2026 23:47
Member
|
@copilot - the build failed. The API report file needs to be updated. |
Contributor
Author
Fixed in the latest commit. Updated |
This was referenced Jun 18, 2026
iclanton
added a commit
that referenced
this pull request
Jul 16, 2026
* [rush] Write pnpm global settings to pnpm-workspace.yaml for pnpm 11 pnpm 11 no longer reads the "pnpm" field of package.json, so the settings Rush serialized there were silently ignored. Relocate globalOverrides, globalPackageExtensions, globalPeerDependencyRules, globalAllowedDeprecatedVersions, and globalPatchedDependencies to the generated common/temp/pnpm-workspace.yaml for pnpm >= 11.0.0, mirroring the allowBuilds relocation from #5817. Behavior for older pnpm is unchanged. Fixes #5837 * [rush] Add change file for pnpm 11 settings relocation Co-references #5837 * [rush] Fix rush-pnpm patch-commit for pnpm 11 and add coverage Two fixes from adversarial review of the pnpm 11 settings relocation: 1. rush-pnpm patch-commit / patch-remove read patchedDependencies from common/temp/package.json, which pnpm 11 no longer populates. They now read patchedDependencies from common/temp/pnpm-workspace.yaml for pnpm >= 11 (mirroring the approve-builds allowBuilds path), preserving the package.json path for pnpm < 11 and the existing subspace + patches-folder logic. 2. Added integration coverage: - InstallHelpers.generateCommonPackageJson omits the relocated settings from package.json for pnpm 11 and still writes them for pnpm < 11. - RushPnpmCommandLineParser reads patchedDependencies from pnpm-workspace.yaml for pnpm 11 and from package.json for pnpm < 11. Refs #5837 * [rush] Revert unrelated formatter changes * [rush] Remove unecessary checks * [rush] Move patch dependencies and yaml handling to PnpmWorkspaceFile as a helper * [rush] Remove unecessary test setup --------- Co-authored-by: Bruno Paulino <brunojppb@users.noreply.github.com> Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
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.