Skip to content

[rush] Optimize setPreferredVersions - #5312

Merged
David Michon (dmichon-msft) merged 4 commits into
microsoft:mainfrom
dmichon-msft:tune-set-preferred-versions
Aug 22, 2025
Merged

David Michon (dmichon-msft) merged 4 commits into
microsoft:mainfrom
dmichon-msft:tune-set-preferred-versions

Conversation

@dmichon-msft

Copy link
Copy Markdown
Contributor

Summary

Optimizes the setPreferredVersions helper function that applies the preferredVersions information from common-versions.json to packages.

Details

Avoids unnecessary range parsing for values that contain protocol specifiers, as they are not valid SemVer range specifiers. Caches range parsing results and ensures that the parsed values are used as-is by the subset function.

Avoids processing of the devDependencies field for any package.json that is not part of the workspace.

How it was tested

Before:
image

After:
image

Impacted documentation

None.

Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts Outdated
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts
Comment thread libraries/rush-lib/src/logic/pnpm/PnpmfileShim.ts Outdated
@dmichon-msft
David Michon (dmichon-msft) merged commit dac8e5c into microsoft:main Aug 22, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Aug 22, 2025
@dmichon-msft
David Michon (dmichon-msft) deleted the tune-set-preferred-versions branch August 25, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants