google / wireit

Wireit upgrades your npm/pnpm/yarn scripts to make them smarter and more efficient.
Apache License 2.0
5.41k stars 95 forks source link

Concise scripts #647

Open bennypowers opened 1 year ago

bennypowers commented 1 year ago

Allow users to define scripts like so:

"wireit": {
  "patch": "patch-package",
  "husky": "npx husky install",
  "postinstall": {
    "dependencies": [
      "patch",
      "husky"
    ]
  }
}

equivalent to

"wireit": {
  "patch": {
    "command": "patch-package"
  },
  "husky": {
    "command": "npx husky install"
  },
  "postinstall": {
    "dependencies": [
      "patch",
      "husky"
    ]
  }
}
aomarks commented 1 year ago

In these cases the one-liners could just be regular npm scripts, since there is nothing added by wireit to their behavior. (Note that wireit scripts can reference regular npm scripts as dependencies).

bennypowers commented 1 year ago

with wireit-only scripts (#653) landed, this could be useful to provide simple scripts without creating an 'entrypoint'