Wireit

Upgrade your npm scripts to make them smarter and more efficient

README

wireit

_Wireit upgrades your npm scripts to make them smarter and more efficient._
Published on npm Build Status


Features


- 🙂 Use the npm run commands you already know
- ⛓️ Automatically run dependencies between npm scripts in parallel
- 👀 Watch any script and continuously re-run on changes
- 🥬 Skip scripts that are already fresh
- ♻️ Cache output locally and remotely on GitHub Actions for free
- 🛠️ Works with single packages, npm workspaces, and other monorepos

Contents


  - ESLint

Install


  1. ```sh
  2. npm i -D wireit
  3. ```

Setup


Wireit works _with_ npm run, it doesn't replace it. To configure an NPM script
for Wireit, move the command into a new wireit section of your package.json,
and replace the original script with the wireit command.

BeforeAfter
{
  "scripts": {
    "build": "tsc"
  }
}
{
  "scripts": {
    "build": "wireit"
  },
  "wireit": {
    "build": {
      "command": "tsc"
    }
  }
}

Now when you run npm run build, Wireit upgrades the script to be smarter and
more efficient. Wireit works with yarn
(both 1.X "Classic" and its successor "Berry")
and pnpm, too.

You should also add .wireit to your .gitignore file. Wireit uses the
.wireit directory to store caches and other data for your scripts.

  1. ```sh
  2. echo .wireit >> .gitignore
  3. ```

VSCode Extension


If you use VSCode, consider installing the google.wireit extension. It adds documentation on hover, autocomplete, can diagnose a number of common mistakes, and even suggest a refactoring to convert an npm script to use wireit.

Install it from the marketplace or on the command line like:

  1. ```
  2. code --install-extension google.wireit
  3. ```

Dependencies


To declare a dependency between two scripts, edit the
`wireit.