From 8685c7c3ac707786c9d0a0388306d2bb08515e4a Mon Sep 17 00:00:00 2001 From: Pedro Gomes <37028775+pedro-gomes-92@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:15:20 +0800 Subject: [PATCH] [rush-lib] Fix filtered install behavior when there are dependencies on other subspaces (#5019) * [rush] Fix install all projects in monorepo * [rush] Update changelogs * Update common/changes/@microsoft/rush/pedrogomes-fix-install-all-projects_2024-11-26-04-35.json Co-authored-by: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> --------- Co-authored-by: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> --- ...omes-fix-install-all-projects_2024-11-26-04-35.json | 10 ++++++++++ .../rush-lib/src/cli/actions/BaseInstallAction.ts | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 common/changes/@microsoft/rush/pedrogomes-fix-install-all-projects_2024-11-26-04-35.json diff --git a/common/changes/@microsoft/rush/pedrogomes-fix-install-all-projects_2024-11-26-04-35.json b/common/changes/@microsoft/rush/pedrogomes-fix-install-all-projects_2024-11-26-04-35.json new file mode 100644 index 00000000000..230d52e85cf --- /dev/null +++ b/common/changes/@microsoft/rush/pedrogomes-fix-install-all-projects_2024-11-26-04-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix an issue where filtered installs neglected to install dependencies from other subspaces", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts b/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts index 82865908a69..45b9507d710 100644 --- a/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts +++ b/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts @@ -244,6 +244,7 @@ export abstract class BaseInstallAction extends BaseRushAction { console.log(Colorize.green(`Installing for subspace: ${subspace.subspaceName}`)); let installManagerOptionsForInstall: IInstallManagerOptions; if (subspaceInstallationData) { + // This will install the selected of projects in the subspace const { selectedProjects, pnpmFilterArgumentValues } = subspaceInstallationData; installManagerOptionsForInstall = { ...installManagerOptions, @@ -262,8 +263,10 @@ export abstract class BaseInstallAction extends BaseRushAction { subspace }; } else { + // This will install all projects in the subspace installManagerOptionsForInstall = { ...installManagerOptions, + pnpmFilterArgumentValues: [], subspace }; }