ztrank / azimuth-pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

post-install-scripts

Provides utility scripts for Running Post Install actions.

Installation

npm install --save @trankzachary/post-install-scripts

Use

Create a file that will handle running the pipeline. I recommend:

<project-root>/scripts/post.install.ts

This file needs to create a new instance of any of the Utils that the pipeline script requires, then running the pipeline.

Example

import 'reflect-metadata'; // Important!
import { SetJsonDefaults, Bind } from '@trankzachary/post-install-scripts';
import { Container } from 'inversify';
import { AppConfigDefaults, WebConfigDefaults, MachineConfigDefaults } from '../path/to/defaults';

const container = new Container();
Bind(container)
    .register(container, SetJsonDefaults, AppConfigDefaults, false, 'app.config.json')
    .register(container, SetJsonDefaults, WebConfigDefaults, false, 'web.config.json')
    .register(container, SetJsonDefaults, MachineConfigDefaults, false, 'machine.config.json')
    .run(container)
    .subscribe(() => {});

tsconfig.json

Add the file, or files, for your scripts to your project's include value.

    ...
    "include": [
        "src/**/*.ts",
        "scripts/**/*.ts"
    ],
    ...

package.json

Add the script in the scripts section.

    ...
    "scripts": {
        ...
        "postinstall": "node ./dist/scripts/post.install.js",
        ...
    }

About

License:MIT License


Languages

Language:TypeScript 99.2%Language:JavaScript 0.8%