[rush] Consolidate pnpm options handling into InstallHelpers.resolvePnpmSettings#5880
Merged
Merged
Conversation
…npmSettings Read the pnpm options in a single place that derives both the common package.json "pnpm" field and a populated PnpmWorkspaceFile, removing the duplicated pnpm-version gating between generateCommonPackageJsonAsync and WorkspaceInstallManager.prepareCommonTempAsync.
Replace the per-field loadPatchedDependenciesAsync/loadAllowBuildsAsync helpers with a single loadAsync that parses the file once and returns a populated PnpmWorkspaceFile, and use it from the rush-pnpm patch-commit and approve-builds commands.
iclanton
requested review from
apostolisms,
bmiddha,
dmichon-msft,
jxanthony and
octogonz
as code owners
July 17, 2026 20:48
iclanton
commented
Jul 17, 2026
iclanton
enabled auto-merge (squash)
July 17, 2026 22:25
TheLarkInn
approved these changes
Jul 17, 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
Consolidates how Rush interprets the pnpm options when generating the install files, so the options are read and version-gated in a single place instead of being duplicated across the install managers. This is intended to be a behavior-preserving refactor.
Details
InstallHelpers.resolvePnpmSettings(...)— the single place that reads a subspace's pnpm options, emits the version-compatibility warnings, and derives both:pnpmfield written tocommon/temp/package.json, andPnpmWorkspaceFile(common/temp/pnpm-workspace.yaml) populated with the version-gated settings (overrides,packageExtensions,peerDependencyRules,allowedDeprecatedVersions,patchedDependencies,allowBuilds,catalogs,minimumReleaseAge, etc.).generateCommonPackageJsonAsyncnow just consumes the resolved settings rather than re-reading and re-gating the pnpm options itself.WorkspaceInstallManagerandRushInstallManagerboth route throughresolvePnpmSettings, removing the duplicated pnpm 11 gating logic that previously lived in two places.RushConstants.pnpmWorkspaceFileNameconstant and replaces the hard-coded'pnpm-workspace.yaml'strings.PnpmWorkspaceFile.loadAsync(...), which reads and parsespnpm-workspace.yamlonce and returns a populated instance. Therush-pnpmpatch-commit/patch-removeandapprove-buildscommands now use it, replacing the previous per-field loaders / inline YAML parsing.How it was tested
heft testforrush-lib(703 tests passing).rush-libAPI report (common/reviews/api/rush-lib.api.md) is updated accordingly.