Open atomicpages opened 1 year ago
Open to it.
Hi there. I was looking to see if this was something I could do. There is already an --max-parallel <number>
option. @atomicpages, is your suggestion different from that?
Slightly! My suggestion was to read from an environment variable if --max-parallel
can't be used. In my case I have a complex monorepo that uses npm-run-all
at the root and in packages so something like:
{
"scripts": {
"build": "pnpm --filter '@internal' build --if-present"
}
}
triggers a bunch of npm-run-all
scripts to get executed as well.
If you want to add an ENV lookup where the flag is read, it probably wouldn't be hard to add (hopefully). Maybe call it RUN_P_MAX_PARALLE
just so it's a bit more scoped.
@atomicpages The better solution would be to add workspace support to npm-run-all2
, right? https://github.com/bcomnes/npm-run-all2/issues/60 Although that's easier said than done so I can see the need for a stopgap measure like this – either within this module itself or through some other mechanism
CI systems generally have restricted resources so it'd be great to limit the number of parallel processes via env var. I envision something like this:
a more verbose example with gitlab CI might look like:
I'd be happy to make a MR for this if the community is interested. LMK! 🙏