[rush] Relocate remaining pnpm settings to pnpm-workspace.yaml for pnpm 11#5882
Open
iclanton wants to merge 7 commits into
Open
[rush] Relocate remaining pnpm settings to pnpm-workspace.yaml for pnpm 11#5882iclanton wants to merge 7 commits into
iclanton wants to merge 7 commits into
Conversation
…ce file is missing Rename loadAsync to tryLoadAsync so it returns undefined (instead of throwing) when pnpm-workspace.yaml does not exist, and update the rush-pnpm patch-commit and approve-builds callers accordingly.
…to pnpm-workspace.yaml for pnpm 11 For pnpm 11, these settings were written to the "pnpm" field of the generated common/temp/package.json, which pnpm 11 no longer reads, so they were silently ignored. They now go to common/temp/pnpm-workspace.yaml, matching the other relocated pnpm settings.
Since pnpm 11 relocates every setting to pnpm-workspace.yaml, the generated package.json "pnpm" field was always empty; don't emit it at all for pnpm 11.
iclanton
requested review from
apostolisms,
bmiddha,
dmichon-msft,
jxanthony and
octogonz
as code owners
July 18, 2026 00:43
iclanton
enabled auto-merge (squash)
July 18, 2026 00:50
iclanton
commented
Jul 18, 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.
Summary
Follow-up to #5880 that finishes moving pnpm settings out of the generated
common/temp/package.json"pnpm" field (which pnpm 11 no longer reads) and intocommon/temp/pnpm-workspace.yaml.Details
ignoredOptionalDependencies,trustPolicy,trustPolicyExclude, andtrustPolicyIgnoreAfterMinuteswere still being written to thepnpmfield ofpackage.json, which pnpm 11 ignores — so they were silently dropped. They now go topnpm-workspace.yaml(added to thePnpmWorkspaceFileschema), matching the other relocated settings. For pnpm < 11 they continue to be written to thepnpmfield ofpackage.json.pnpmfield entirely for pnpm 11. Since every known setting is now relocated, the generatedpackage.jsonno longer emits an emptypnpm: {}object under pnpm 11.PnpmWorkspaceFile.tryLoadAsync. RenamedloadAsync→tryLoadAsync, which now returnsundefined(instead of throwing) whenpnpm-workspace.yamldoesn't exist; therush-pnpmpatch-commit/patch-removeandapprove-buildscallers were updated accordingly.neverBuiltDependencies/onlyBuiltDependenciesare intentionally unchanged: pnpm 11 removed them entirely, and Rush already warns and translates them intoallowBuildsinpnpm-workspace.yaml. TheunsupportedPackageJsonSettingsescape hatch is also unchanged, since it is explicitly scoped topackage.json.How it was tested
heft testforrush-lib(707 tests passing), including new coverage that the four settings are written topnpm-workspace.yamland that nopnpmfield is generated for pnpm 11.