Skip to content

[rush] Relocate remaining pnpm settings to pnpm-workspace.yaml for pnpm 11#5882

Open
iclanton wants to merge 7 commits into
microsoft:mainfrom
iclanton:more-install-helpers-cleanup2
Open

[rush] Relocate remaining pnpm settings to pnpm-workspace.yaml for pnpm 11#5882
iclanton wants to merge 7 commits into
microsoft:mainfrom
iclanton:more-install-helpers-cleanup2

Conversation

@iclanton

Copy link
Copy Markdown
Member

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 into common/temp/pnpm-workspace.yaml.

Details

  • Relocate the remaining pnpm settings for pnpm 11. ignoredOptionalDependencies, trustPolicy, trustPolicyExclude, and trustPolicyIgnoreAfterMinutes were still being written to the pnpm field of package.json, which pnpm 11 ignores — so they were silently dropped. They now go to pnpm-workspace.yaml (added to the PnpmWorkspaceFile schema), matching the other relocated settings. For pnpm < 11 they continue to be written to the pnpm field of package.json.
  • Omit the pnpm field entirely for pnpm 11. Since every known setting is now relocated, the generated package.json no longer emits an empty pnpm: {} object under pnpm 11.
  • PnpmWorkspaceFile.tryLoadAsync. Renamed loadAsynctryLoadAsync, which now returns undefined (instead of throwing) when pnpm-workspace.yaml doesn't exist; the rush-pnpm patch-commit/patch-remove and approve-builds callers were updated accordingly.

neverBuiltDependencies/onlyBuiltDependencies are intentionally unchanged: pnpm 11 removed them entirely, and Rush already warns and translates them into allowBuilds in pnpm-workspace.yaml. The unsupportedPackageJsonSettings escape hatch is also unchanged, since it is explicitly scoped to package.json.

How it was tested

  • heft test for rush-lib (707 tests passing), including new coverage that the four settings are written to pnpm-workspace.yaml and that no pnpm field is generated for pnpm 11.

iclanton added 5 commits July 17, 2026 20:13
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant