tommy-mitchell / listr-cli

Command-line task lists made pretty.
https://npm.im/listr-cli
MIT License
0 stars 0 forks source link

Support running NPM scripts #2

Open tommy-mitchell opened 1 year ago

tommy-mitchell commented 1 year ago

It would be convenient to have a shorthand for npm run my-script, like concurrently has:

concurrently "npm:watch-js" "npm:watch-css" "npm:watch-node"

I think the npm:script syntax is good as-is.

concurrently also supports wild cards and negations. matcher could possibly be used for this:

concurrently "npm:lint:*(!fix)"
tommy-mitchell commented 1 year ago

This should also support resolving pre- and post- scripts.

Ideally, this would parse all commands in order and make a task for each of them.

tommy-mitchell commented 1 year ago

If the task is unnamed, the name should come from the script:

> listr yarn:lint tests::pnpm:test 'npm:build-*'
⠼ lint
◼ tests
◼ build-ts
◼ build-scss
◼ postbuild

The documentation should also mention quoting globs to escape them.

tommy-mitchell commented 1 year ago

concurrently references: expand-npm-shortcut, expand-npm-wildcard

tommy-mitchell commented 1 year ago

Potential matcher blocker: https://github.com/sindresorhus/matcher/issues/35