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] Don't install peerDependencies if the autoInstallPeers setting isn't true #4845

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions common/changes/@microsoft/rush/dmyers-4843_2024-07-22-18-37.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix an issue where peer dependencies are incorrectly installed when the `autoInstallPeers` is set to `false` and workspaces are disabled.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ export class RushInstallManager extends BaseInstallManager {
tempPackageJson.optionalDependencies = {};
}
tempPackageJson.optionalDependencies[dependency.name] = dependency.version;
} else if (dependency.dependencyType === DependencyType.Peer) {
if (
this.rushConfiguration.packageManager !== 'pnpm' ||
this.rushConfiguration.pnpmOptions.autoInstallPeers === true
) {
tempDependencies.set(dependency.name, dependency.version);
}
} else {
tempDependencies.set(dependency.name, dependency.version);
}
Expand Down
Loading