[rush-lib] Fix filtered install behavior when there are dependencies on other subspaces #5019
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
Fix install all projects of all subspaces in a monorepo
Details
What happened?
We have a project which depends on ALL of the rest of the local packages of different subspaces.
When we run
rush install -t P1
, all subspaces except the current, are ignored with the message: "No projects matched the filters in XXX".In other words, NO dependencies are installed (node_modules folders are empty) for the cross-subspaces that the project requires.
Subspace S1 is installed, but S2 and S3 are not! Both S2 and S3 will show the message "No projects matched the filters in XXX".
What I expected to happen?
All related cross-subspaces should be properly installed. I would expect no message: "No projects matched the filters in XXX" to be shown.
The solution
After diagnosing the
pnpm install
command during a subspace installation, we discovered a package filtering parameter for the current project (e.g.--filter P1
), which fails to exist on any cross-subspace dependency. PNPM will then skip each cross-subspace installation.This filter should NOT exist when Rush wants to install all projects of all subspaces.
How it was tested
rush install -t <project_of_default>
The message "No projects matched the filters in XXX" during s1 installation.