Code Monkey home page Code Monkey logo

rungex's Introduction

yarn-plugin-rungex

All Contributors

Release

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.js

Usage

yarn rungex [-c,--ci] [-p,--parallel] [-sw,--starts-with] [-ew,--ends-with] <scriptMatcher>
yarn rungex --help

Examples

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 rungex command 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 -c or the --ci option.

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-with

Run 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-with

Other 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-with

Run 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 --parallel

Uninstall

yarn plugin remove @yarnpkg/plugin-rungex

Contributors โœจ

Krishan Patel
Krishan Patel

๐Ÿš‡ ๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.