Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Fix filtered installs in pnpm@8 #4344

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix filtered installs in pnpm@8.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
4 changes: 2 additions & 2 deletions libraries/rush-lib/src/api/RushConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ export class RushConfiguration {
public readonly currentVariantJsonFilename: string;

/**
* The version of the locally installed NPM tool. (Example: "1.2.3")
* The version of the locally package manager tool. (Example: "1.2.3")
*/
public readonly packageManagerToolVersion: string;

/**
* The absolute path to the locally installed NPM tool. If "rush install" has not
* The absolute path to the locally package manager tool. If "rush install" has not
* been run, then this file may not exist yet.
* Example: `C:\MyRepo\common\temp\npm-local\node_modules\.bin\npm`
*/
Expand Down
8 changes: 8 additions & 0 deletions libraries/rush-lib/src/logic/base/BaseInstallManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,14 @@ ${gitLfsHookHandling}

if (experiments.usePnpmFrozenLockfileForRushInstall && !options.allowShrinkwrapUpdates) {
args.push('--frozen-lockfile');

if (
options.pnpmFilterArguments.length > 0 &&
Number.parseInt(this.rushConfiguration.packageManagerToolVersion, 10) >= 8 // PNPM Major version 8+
) {
// On pnpm@8, disable the "dedupe-peer-dependents" feature when doing a filtered CI install so that filters take effect.
args.push('--config.dedupe-peer-dependents=false');
}
} else if (experiments.usePnpmPreferFrozenLockfileForRushUpdate) {
// In workspaces, we want to avoid unnecessary lockfile churn
args.push('--prefer-frozen-lockfile');
Expand Down
Loading