# run-scripts

[![npm version](https://badge.fury.io/js/%40credsimple%2Frun-scripts.svg)](https://badge.fury.io/js/%40credsimple%2Frun-scripts) [![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/credsimple/CredSimple%2Frun-scripts%2Frun-scripts-publish?branch=master&key=eyJhbGciOiJIUzI1NiJ9.NWE4YjY1NTA5YjdkM2YwMDAxMTkzODVk.M94tx2_osyNPtER4FnkWIOdiO-DXaj5HDTfnRypN-HY&type=cf-1)]( https://g.codefresh.io/repositories/CredSimple/run-scripts/builds?filter=trigger:build;branch:master;service:5b6dcde6aedcd0185fccbddb~run-scripts-publish)

A collection of [runjs](https://github.com/pawelgalazka/runjs) scripts. This repo was initially a fork of [@jmorganson/run-scripts](https://github.com/jasonmorganson/run-scripts).

According to @jmorganson, this is why we are using run-scripts:
https://hackernoon.com/simple-build-tools-npm-scripts-vs-makefile-vs-runjs-31e578278162

This repo is used in production for the following projects:
* [data-extracts-api](https://github.com/CredSimple/data-extracts-api)
* [data-extracts-job](https://github.com/CredSimple/data-extracts-job)
* ...and maybe more, I haven't done a full audit.

## Usage

In the JS/TS repo where you want to include these run-scripts:

1. Install
```
npm i -D runjs @credsimple/run-scripts
```

2. Commit changes to `package.json`, `runfile.js`, and `tsconfig.json`

3. Run with either npm or run scripts
Like this:
```
run test
```
Or this works like normal:
```
npm test
```

## Publishing

The repo will be published by a pipeline when a PR is merged into master. The PR build will
always check that the version in package.json doesn't already exist in the npm registry, so
no reason to worry there. If you are curious what the pipelines do, check the codefresh
directory for their definitions.
