0.0.2 • Published 1 year ago

@lndsld/orc v0.0.2

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

@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:

  1. Generate React components from svg icons
  2. Generate barrel file for components directory
  3. 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

  1. Define scripts in scripts section of your package.json as usual:

    /* package.json */
    {
        "scripts": {
            "generate:barrel": "node scripts/generate-barrel.js",
            "generate:icons": "node scripts/generate-icons.js",
            "build": "tsc"
        }
    }
  2. Define dependencies between scripts in orc section of package.json:

    /* package.json */
    {
        "orc": {
            "scripts": {
                "build": {
                    "dependsOn": ["generate:icons", "generate:barrel"]
                }
            }
        }
    }
  3. Run script with orc run command:

    orc run build

Without package.json

  1. 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"]
            }
        }
    }
  2. Run script with orc run command:

    orc run build

Examples

0.0.2

1 year ago

0.0.1

1 year ago