ultra-runner icon indicating copy to clipboard operation
ultra-runner copied to clipboard

Better support for running watches in related workspaces

Open jpa00 opened this issue 4 years ago • 1 comments

Not sure if the title is super clear, but what I mean is running "start" or "watch" commands on multiple related workspaces with recursion. Currently this is problematic, because these commands don't finish in the normal sense, so they shouldn't be waited for. But they also can't be run fully parallel, because that ends in failures when workspace dependencies haven't yet been built.

So I'd suggest something similar to wsrun's "--done-criteria" option, that would watch the output of each running workspace and once the output matches a regex, continue on to dependent workspaces.

jpa00 avatar Sep 01 '20 07:09 jpa00

This works correctly for my own projects where I'm using ultra, just make sure not to use the --build option.

For every package in my monorepo, I will either have a dev:build target for a library or a dev:start script target for an app. (or nothing at all if the package is a tool).

I then start the libs and apps with:

  • ultra -r dev:build
  • ultra -r dev:start

Since I'm not using the --build option here, initial builds of some packages will likely fail, but eventually their dependents will have successfully built and they will build successfully as well.

If you want to avoid the initial failures, simly run a ultra -r build before starting the watchers.

folke avatar Nov 23 '20 18:11 folke