An open API service indexing awesome lists of open source software.

https://github.com/mattriley/node-task-library

A collection of bash scripts to support build, test, deploy and chores associated with developing and maintaining Node apps.
https://github.com/mattriley/node-task-library

automation bash3 build deploy javascript nodejs npm-package test

Last synced: 7 months ago
JSON representation

A collection of bash scripts to support build, test, deploy and chores associated with developing and maintaining Node apps.

Awesome Lists containing this project

README

          

<%- lib.renderOpening() %>

## Install

<%- await lib.renderCode('npm install task-library', 'sh', 'https://www.npmjs.com/package/task-library') %>

## Usage

```sh
npx task [TASK_NAME] [OPTIONS]
```

Try `npx task vars` and `npx task tasks` to list variables and tasks respectively.

## Overriding variable defaults

To override the default value of any variable listed by `npx task vars`, simply create a shell script named `task-vars` in the package root directory and export those variables with the desired values, e.g.

```sh
#!/bin/bash
export NODE_VERSION="20.0.0"
```

To obtain the default value for any variable, invoke a function of the same name, e.g.

```sh
#!/bin/bash
echo $(NODE_VERSION)
```

## Tasks

### install

Installs NPM packages based on inference (to be elaborated).

### update / upgrade / latest

Updates all NPM packages to the latest version regardless of semver.

### configure / config

Generates config files based on inference (to be elaborated).

### test

Runs tests using inferred test runner.

### test-watch

Runs tests in watch mode using inferred test runner.

### cov

Runs tests with code coverage using inferred test runner.

### lint

Runs lint using inferred linters.

Currently supports ESLint and Shellcheck.

### fix

Runs lint with fix option using inferred linters.

### start / run

Starts the application using inferred launcher.

Currently supports Nodemon (for console applications), Serve (for static websites) and Parcel (for single page apps).

### build / dist

Creates a build based on inference (to be elaborated).

### deploy / publish

Deploys application based on inference (to be eleborated).

Currently supports GitHub Pages, NPM packages and Serverless.

### pre-commit / pre

Runs config, code-gen, lint, cov, sloc, metrics-summary, readme (to be eleborated).

## Developer Notes

- `find -exec` does not return exit code of exec command. Workaround: Use `xargs` instead.