[FEATURE] run-script with workspaces should short-circuit on script error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 777
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
run-script with the --workspaces flag will run all workspace scripts, regardless if one script exits with exit code 1. Please see the "Steps to Reproduce" section.
Expected Behavior
I would expect that run-script would short-circuit and not run the other scripts if one fails. Alternatively, a new flag (e.g. --short-circuit) could be introduced to run-script in order to maintain backwards compatibility.
Steps To Reproduce
Consider the following scenario:
- A root
package.jsonfile has"workspaces": ["a", "b", "c"] a/package.jsonhas the script"build": "exit 1"- Both
b/package.jsonandc/package.jsonhave the the script"build": "exit 0"
Run npm run build --workspaces and note that all scripts are run.
Environment
- OS: Windows 10
- Node: 16.10.0
- npm: 7.24.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files or tests are named. Start by reproducing the described workspace setup with npm run build --workspaces, then read the npm CLI run-script workspace behavior and the comment discussion to resolve whether short-circuiting or a new flag is intended. Done means the chosen behavior is specified and verified for both failing and successful workspace scripts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100