Closed fregante closed 1 year ago
I really like this idea.
I'd like to propose using something other than &
mainly for the double-meaning it has in bash-like terminals.
We have a bash script we use that essentially takes arguments like this:
run-p 'test:*' 'lint' --exec 'tsc' --exec 'echo "another shell command"'
To me, the intentions are more clear and is similar to the pattern used in options like --parallel
and --serial
. Just throwing out what we do as an implementation option!
You’re right about &
, but $tsc
or $ tsc
would also make sense.
The latter can already be added if you have an npm script named $
with command bash -s
(or something like that)
Aye, with this run script:
"$": "npm run --",
you can then do
run-p "test:*" "$ tsc"
I believe that adding new mystery syntax to npm-run-all would be an out-of-scope complication.
What if npm-run-all
simply had a default $
script? I think that would be easy to implement and explain.
The point here would be to avoid adding further scripts to your own package-json
Would be nice to support this:
"clean": "rm -rf build coverage",
"clean:all": "npm run clean && rm -rf node_modules package-lock.json"
"lint": "tsc && eslint . '**/*.{js,jsx,ts,tsx}'"
Concurrently supports it:
"clean": "rm -rf build coverage",
"clean:all": "concurrently npm:clean 'rm -rf node_modules package-lock.json'"
"lint": "concurrently tsc \"eslint . '**/*.{js,jsx,ts,tsx}'\""
I switched to concurrently for this use case
I use
npm-run-all
to run multiple commands in parallel, but currently the commands can only be npm scripts. This is usually fine if you need these commands directly accessible (e.g.npm run test:style
) but sometimes I just wish I could run simple commands directly: