yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.38k stars 1.11k forks source link

[Feature] `workspaces foreach` should provide a `--kill-others` flag #6507

Open FezVrasta opened 2 weeks ago

FezVrasta commented 2 weeks ago

Describe the user story

I have a single root-level dev script that uses workspaces foreach to run the dev script on several workspaces. If one of the dev scripts exits unexpectedly the other commands will keep running and it is not always obvious why the development environment stopped working.

Describe the solution you'd like

If the workspaces foreach script provided a --kill-others flag just like the one provided by the npm concurrently script, we could kill all the other scripts when one of them fails.

Describe the drawbacks of your solution

I'm not sure on how the foreach script works, but considering concurrently provides this functionality I wouldn't expect an implementation to be too problematic.

Describe alternatives you've considered

I thought an alternative solution would be to use the Yarn SDK to extract the list of scripts the foreach command would run, and then use the concurrently JS API to write a custom script that runs them. But I couldn't find an API exposed by Yarn to make this happen.

kumavis commented 14 hours ago

alternate name --bail