-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] Add option to build dependencies of workspace when using the --since option #4391
Comments
The berry/packages/plugin-workspace-tools/sources/commands/foreach.ts Lines 149 to 155 in 20612e8
|
Yeah and that is exactly the problem I am trying to bring forward. Oftentimes (like in the CI) you would wanna build dependencies before your changed workspace. On the other hand, the current behavior is perfect for some other tasks, like So maybe additional flag? |
Yeah, the flags are pretty confusing. #3591 highlights this same issue and suggests that it's been resolved, but I'm not sure where. |
@seansfkelley didn't find anything that would resolve this issue either. Maybe #3591 should be edited to mark this as not done yet? However, I don't see the need for a new flag. The current flags It took me a while to find out why What is the reason that |
No idea. That behavior was in place before I opened any PRs against this plugin, though I think it could be simpler (and v4 a good time to make such a change) by replacing I think the conceptual complexity stems from the fact that a workspace is related to (1) other workspaces mentioned in its package.json and (2) nested workspaces. |
How I though yarn workspaces foreach works: (disclaimer, this cannot be seen as documentation) use However, it seems there is
So by writing this, it does start to make sense to use |
Is there any updates on this? The newest source code at
--since and -R .
|
Describe the user story
Using the
foreach
with the topological flag causes certain command for all workspaces to be executed in a proper dependency order.Together with the
--since
flag, the command will be executed starting with the changed workspace only.This is often enough, but not always - sometimes we'd need to execute the command for all the dependencies of the changed workspace.
Use case: build command.
Executing:
yarn workspaces foreach -tvA --since=main run build
For the following workspaces structure:
Will effectively execute:
yarn workspace lib-b run build
yarn workspace lib-c run build
And will omit:
yarn workspace lib-a run build
yarn workspace lib-d run build
(as expected)Since
lib-a
was not built, the likelihood oflib-b
orlib-c
failing is quite large.Describe the solution you'd like
Additional flag/option to force building all dependencies and dependents of the changed workspace.
From the example above, what we'd need is the option to build
lib-a
beforelib-b
, resulting in:yarn workspace lib-a run build
yarn workspace lib-b run build
yarn workspace lib-c run build
While omitting:
yarn workspace lib-d run build
(as expected)The text was updated successfully, but these errors were encountered: