folke / ultra-runner

🏃⛰ Ultra fast monorepo script runner and build tool
https://www.npmjs.com/package/ultra-runner
Apache License 2.0
1.2k stars 32 forks source link

Question: Can you run multiple root and recursive packages/commands selectively? #181

Closed JosephScript closed 3 years ago

JosephScript commented 3 years ago

Hi thanks for the awesome work on Ultra! I'm trying to figure something out and I was hoping to get advice (I searched and read a lot of issues and through the code but couldn't find a solution).

I have a Lerna monorepo with something like this:

web/
  - app/
  - www/
  - blog/
services/
  - proxy/
  - api1/
  - api2/

I want to selectively run certain web apps but all services. Currently I have a root yarn watch script in my root package.json that uses lerna to trigger all the services and set up scripts like "watch": "yarn ./services/setup.ts; lerna run --parallel watch'" in one terminal with ultra watch, and then I just run one web apps "start": "concurrently --kill-others \"yarn:build:watch\" \"yarn:tsc:watch\"" command at a time with ultra -r --filter "@scope/app" start in (a)other terminal(s). I some times need to run two or more from web.

Questions are: 1) can I selectively run a root script such as watch and a recursive filtered script? 2) can I run more than one recursive filtered script at a time or more than one scoped package some how? 3) Can I combine these all into one command?

Thanks a bunch in advance.

JosephScript commented 3 years ago

I found a much better solution simply using the start scripts within the services folder to run the preload script per service before running it's start up command. Then I simply using ultra -r --filter "whatever" start to selectively start what I want to. Works like a charm!