yarn-plugin-rungex v1.3.0
yarn-plugin-rungex
A Yarn Berry plugin that can be used to run multiple package.json scripts with Regex.
Install
yarn plugin import https://raw.githubusercontent.com/krshnpatel/rungex/main/bundles/@yarnpkg/plugin-rungex.jsUsage
yarn rungex [-c,--ci] [-p,--parallel] [-sw,--starts-with] [-ew,--ends-with] <scriptMatcher>yarn rungex --helpExamples
The following part of a package.json file will be used as a reference for all examples in this section:
{
// ... other fields
"scripts": {
"build:dev": "build app dev",
"build:prod": "build app prod",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"start": "start app",
"start:dev": "start app dev",
"taste": "run taste",
"test:e2e": "run e2e tests",
"test:integration": "run integration tests",
"test:unit": "run unit tests",
"update:local": "update local app"
}
// ... more fields
}NOTE: By default, the
rungexcommand will always prompt the user whether they want to run the matched scripts or not. However, the prompt can be skipped by passing in the-cor the--cioption.
Matching scripts
Run all scripts matching the Regex: "lint.*". The following command will match the "lint" and "lint:fix" scripts in the package.json above.
yarn rungex "lint.*"Run all scripts that start with "test". The following commands will match the "test:unit", "test:integration", and "test:e2e" scripts.
yarn rungex "test" -sw
# OR
yarn rungex "test" --starts-withRun all scripts that end with "dev". The following commands will match the "build:dev" and "start:dev" scripts.
yarn rungex "dev" -ew
# OR
yarn rungex "dev" --ends-withOther options
NOTE: The following options can be used as standalone options or they can be combined with other options.
Run all matching scripts in parallel that start with "test". The following commands will match the "test:unit", "test:integration", and "test:e2e" scripts and then run them in parallel to each other if the user chooses to run the scripts.
yarn rungex "test" -p -sw
# OR
yarn rungex "test" --parallel --starts-withRun all scripts in parallel without prompting the user for any input. The following commands will match the "build:dev" and "build:prod" scripts. Both of those scripts will be run in parallel without any user prompt.
yarn rungex "build" -c -p
# OR
yarn rungex "build" --ci --parallelUninstall
yarn plugin remove @yarnpkg/plugin-rungexContributors ✨
This project follows the all-contributors specification. Contributions of any kind welcome!