@lndsld/orc
v0.0.2
Published
Minimalistic orchestrator for NPM-scripts and anything else.
Downloads
6
Readme
@lndsld/orc
Minimalistic orchestrator for NPM-scripts and anything else.
Installation
npm install -g @lndsld/orc
Usage
Imagine React UI library with svg icons and some autogenerated code.
Build pipeline for it will consist of these stages:
- Generate React components from svg icons
- Generate barrel file for
components
directory - Build whole library with
tsc
Stages (1) and (2) here are independent, so it could be safely parallelized to reduce total build time.
Orc will do all this work if you specify dependencies between scripts.
In package.json
Define scripts in
scripts
section of yourpackage.json
as usual:/* package.json */ { "scripts": { "generate:barrel": "node scripts/generate-barrel.js", "generate:icons": "node scripts/generate-icons.js", "build": "tsc" } }
Define dependencies between scripts in
orc
section ofpackage.json
:/* package.json */ { "orc": { "scripts": { "build": { "dependsOn": ["generate:icons", "generate:barrel"] } } } }
Run script with
orc run
command:orc run build
Without package.json
Create
orc.config.json
and define scripts:/* orc.config.json */ { "scripts": { "generate:barrel": { "command": "node scripts/generate-barrel.js" }, "generate:icons": { "command": "node scripts/generate-icons.js" }, "build": { "command": "tsc", "dependsOn": ["generate:icons", "generate:barrel"] } } }
Run script with
orc run
command:orc run build