Fix: workspace support in several commands#4654
Conversation
Executes "fetchRequestFromCwd" in actual cwd, which ensures "outdated" and "upgrade" commands in workspace packages operate on the correct dependencies and preserve unrelated lockfile entries.
|
This change will increase the build size from 9.91 MB to 9.92 MB, an increase of 11.57 KB (0%)
|
|
Thanks for your work on this, we just started using yarn workspaces recently and this will make our lives a lot easier. |
Then how does it work if A and B both depend on C@~1.0.0, and you run |
No, it will only upgrade C in A, and the lockfile will now have two entries for C. If you run This is a choice that was initially dictated by the complexity of implementing it the way you described it (where it upgrades C in both A and B when you run the command from just one workspace). There were a couple of issues to deal with here:
Then I thought about |
arcanis
left a comment
There was a problem hiding this comment.
Oh I see .. I was being confused between upgrade altering the package.json or not. Ok, yeah, it makes sense :) Let's do it this way.
|
awesome work, thanks |
|
I just tested #4469 with v1.2.0 and it works now! 👏 |
|
@jgoz Awesome work on this PR. Such a life saver and it's been working flawlessly! |
* Use lockfileFolder for CLI check * Make "upgrade" work inside workspace packages Executes "fetchRequestFromCwd" in actual cwd, which ensures "outdated" and "upgrade" commands in workspace packages operate on the correct dependencies and preserve unrelated lockfile entries. * Support workspaces in outdated and upgrade-interactive

Summary
Fixes #4334
Fixes #4328
Fixes #4348
(Follow-up to #4630, #4583).
This gets several commands working when used in a workspace-enabled solution:
outdated:remove:upgrade:upgrade-interactive:This is slightly different from how @arcanis described in #4630, specifically with
upgrade. I thought it would be less confusing/frustrating for users, especially if child workspaces have conflicting versions of the same dependency. Rather than forcing them all to the same version, this allows for fine-grained control while offering a whole-workspace upgrade option withupgrade-interactive.Test plan
outdatedwith "Workspace" column:upgrade-interactivewith "workspace" column: