0.0.2 • Published 3 years ago
@lndsld/orc v0.0.2
@lndsld/orc
Minimalistic orchestrator for NPM-scripts and anything else.
Installation
npm install -g @lndsld/orcUsage
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
componentsdirectory - 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
scriptssection of yourpackage.jsonas 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
orcsection ofpackage.json:/* package.json */ { "orc": { "scripts": { "build": { "dependsOn": ["generate:icons", "generate:barrel"] } } } }Run script with
orc runcommand:orc run build
Without package.json
Create
orc.config.jsonand 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 runcommand:orc run build