[rush] rush add -p <package> always installs as if `--all` is specified
Closed this issue · 3 comments
Summary
Starting somewhere after rush 5.120.0
rush add -p <package>
with a workspace:*
package installs the package in all packages.
If i try installing a library in a package in rush 5.120.1
or later it installs it to just the subdirectory i'm in.
cd packageB
rush add -p packageA
Assigning the version "workspace:*" for "@packageA" because it is already used by other projects in this repo.
Updating projects to use @packageA@workspace:*
Wrote/Users/.../Documents/project/packageB/package.json
Starting from version 5.120.1
this same command acts like --all
is specified.
cd packageB
rush add -p packageA
Assigning the version "workspace:*" for "@package-a" because it is already used by other projects in this repo.
Updating projects to use @package-a@workspace:*
Wrote/Users/.../Documents/project/packageB/package.json
Wrote/Users/.../Documents/project/packageC/package.json
... many more
Repro steps
-
use any version after rush
5.120.1
-
cd into package directory (packageB)
-
rush add -p packageA
Expected result:
install packageA for just packageBActual result:
It installs package packageA to all packages as if--all
is specified.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
Question | Answer |
---|---|
rushVersion from rush.json? |
5.120.4 |
useWorkspaces from rush.json? |
default |
Operating system? | Mac |
Would you consider contributing a PR? | No |
Node.js version (node -v )? |
v18.20.1 |
I observed this same bug when using the -m
flag. When specifying -m
, I saw the dependency get added to every package in our monorepo, rather than just seeing a modification of the packages that already had the dependency.
Initially, I assumed it was just a regression in the "make consistent" functionality, and came here to file that bug. But, based on the bug above, it sounds like the issue is much more prolific than that!
I can confirm the bug as reported in 5.120.4
I ran into this, too, on rush 5.120.4
, node 20.11.0
, pnpm 7.33.6
. Downgrading rush version to 5.120.0
or manually updating package.json
and then running rush update
both seemed to be valid workarounds.