node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

@speedy/build-tools

@speedy/build-tools

CircleCI npm version Dependency Status devDependency Status

Node CLI/API for build tools and utilities such as linting (html, sass, ts), clean, compile, etc... in order to simplify building libraries and applications.

Currently under development.

Getting Started

Installation

npm install @speedy/build-tools --save-dev

NPM Scripts

Instead of depending on external task runners, speedy-build-tools can be configured to run from npm scripts in package.json.

"scripts"{
    "lint-sass": "speedy-build-tools lint-sass",
    "lint-ts": "speedy-build-tools lint-ts"
},

Run NPM script as following

npm run lint-sass

CLI

CLI can also be used directly without being added to NPM scripts.

speedy-build-tools clean --paths **/.tmp

// or shorthand
speedy clean --paths **/.tmp

Tasks

Available tasks within speedy-build-tools which can be used via CLI.

Task Description
clean [paths...] Delete files and directories
lint-html Lint Html files
lint-sass Lint Sass files
lint-ts Lint TypeScript files

Clean

speedy-build-tools clean --paths .tmp/**
speedy-build-tools clean .tmp/** .test/**
Option Description Type
--paths, -p Paths to be deleted - Supports glob patterns Array

Lint Html

speedy-build-tools lint-html
Option Description Default Value Type
--config, -c Lint rules file path .htmlhintrc string
--files, -f Files to be linted - Supports glob patterns src/**/*.*(html\|htm) Array
--continueOnError Determines whether to exit with a non-zero status code on lint errors false boolean

Rules

By default, it will try to locate the .htmlhintrc file in the root of your project folder.

If the file is not found it will fallback to an internal .htmlhintrc found in config folder.


Lint Sass

speedy-build-tools lint-sass
Option Description Default Value Type
--config, -c Lint rules file path .stylelintrc string
--files, -f Files to be linted - Supports glob patterns src/**/*.*(scss\|sass) Array
--formatter Formatter to use to format the linter results verbose json \| verbose \| string
--fix Determines whether to auto fix lint issues (which support fixing) false boolean
--continueOnError Determines whether to exit with a non-zero status code on lint errors false boolean

Rules

By default, it will try to locate the .stylelintrc file in the root of your project folder.

If the file is not found it will fallback to an internal .stylelintrc found in config folder. This file can also be used as a base for your rules.


Lint TypeScript

speedy-build-tools lint-ts
Option Description Default Value Type
--config, -c Lint rules file path tslint.json string
--files, -f Files to be linted - Supports glob patterns src/**/*.ts Array
--formatter Formatter to use to format the linter results stylish vso \| verbose \| prose \| stylish \| pmd \| json \| msbuild \| fileList \| codeFrame \| checkstyle
--fix Determines whether to auto fix lint issues (which support fixing) false boolean
--continueOnError Determines whether to exit with a non-zero status code on lint errors false boolean

Rules

By default, it will try to locate the tslint.json file in the root of your project folder.

If the file is not found it will fallback to an internal tslint.json found in config folder. This file can also be used as a base for your rules.


Global Options

Option Description
--debug Show debug information
--help, -h Show help
--version, -v Show version number

Display general help

speedy-build-tools --help

Display help specific to a task:

speedy-build-tools lint-sass --help

To display help when running the task from a mapped npm script you should omit the --;

npm run lint-sass help

Stack