UNPKG

6.17 kBMarkdownView Raw
1# @speedy/build-tools
2[![CircleCI](https://circleci.com/gh/alan-agius4/speedy-build-tools.svg?style=shield)](https://circleci.com/gh/alan-agius4/speedy-build-tools)
3[![npm version](https://img.shields.io/npm/v/@speedy/build-tools.svg)](https://www.npmjs.com/package/@speedy/build-tools)
4[![Dependency Status](https://img.shields.io/david/alan-agius4/speedy-build-tools.svg?style=flat-square)](https://david-dm.org/alan-agius4/speedy-build-tools)
5[![devDependency Status](https://img.shields.io/david/dev/alan-agius4/speedy-build-tools.svg?style=flat-square)](https://david-dm.org/alan-agius4/speedy-build-tools?type=dev)
6
7**Currently under development.**
8
9## Getting Started
10
11### Installation
12
13```
14npm install @speedy/build-tools --save-dev
15```
16
17## NPM Scripts
18
19Instead of depending on external task runners, `speedy-build-tools` can be configured to being executed from npm scripts.
20
21```json
22"scripts": {
23 "lint-sass": "speedy-build-tools lint-sass",
24 "lint-ts": "speedy-build-tools lint-ts"
25},
26````
27
28To run the build script found in the `package.json` scripts, execute:
29
30```
31npm run lint-sass
32```
33
34## CLI
35
36You can also use the CLI tasks direcly without the need to added them as NPM scripts.
37
38```
39speedy-build-tools clean --paths **/.tmp
40
41// or shorthand
42speedy clean --paths **/.tmp
43```
44
45## Tasks
46These are all the available tasks within `speedy-build-tools` and can be added to npm scripts.
47
48
49| Task | Description |
50|-------------------|------------------------------|
51| `clean [paths..]` | Delete files and directories |
52| `lint-html` | Lint Html files |
53| `lint-sass` | Lint Sass files |
54| `lint-ts` | Lint TypeScript files |
55___
56
57### Clean
58
59```
60speedy-build-tools clean --paths .tmp/**
61speedy-build-tools clean .tmp/** .test/**
62```
63
64| Option | Description | Type |
65|-----------------|-----------------------------------------------|-------|
66| `--paths`, `-p` | Paths to be deleted - Supports glob patterns | Array |
67
68___
69
70### Lint Html
71
72```
73speedy-build-tools lint-html
74```
75
76| Option | Description | Default Value | Type |
77|---------------------|-----------------------------------------------------------------------|-------------------------|---------|
78| `--config`, `-c` | Lint rules file path | `.htmlhintrc` | string |
79| `--files`, `-f` | Files to be linted - Supports glob patterns | `src/**/*.*(html|htm)` | Array |
80| `--continueOnError` | Determines whether to exit with a non-zero status code on lint errors | `false` | boolean |
81
82#### Rules
83By 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`. This file can also be used as a base for your rules.
84
85___
86
87### Lint Sass
88
89```
90speedy-build-tools lint-sass
91```
92
93| Option | Description | Default Value | Type |
94|---------------------|-----------------------------------------------------------------------|-------------------------|---------|
95| `--config`, `-c` | Lint rules file path | `.stylelintrc` | string |
96| `--files`, `-f` | Files to be linted - Supports glob patterns | `src/**/*.*(scss|sass)` | Array |
97| `--formatter` | Formatter to use to format the linter results | `verbose` | string |
98| `--fix` | Determines whether to auto fix lint issues (which support fixing) | `false` | boolean |
99| `--continueOnError` | Determines whether to exit with a non-zero status code on lint errors | `false` | boolean |
100
101#### Rules
102By 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`. This file can also be used as a base for your rules.
103
104___
105
106### Lint TypeScript
107
108```
109speedy-build-tools lint-ts
110```
111
112| Option | Description | Default Value | Type |
113|---------------------|-----------------------------------------------------------------------|---------------|---------|
114| `--config`, `-c` | Lint rules file path | `tslint.json` | string |
115| `--files`, `-f` | Files to be linted - Supports glob patterns | `src/**/*.ts` | Array |
116| `--formatter` | Formatter to use to format the linter results | `stylish` | string |
117| `--fix` | Determines whether to auto fix lint issues (which support fixing) | `false` | boolean |
118| `--continueOnError` | Determines whether to exit with a non-zero status code on lint errors | `false` | boolean |
119
120#### Rules
121By 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`. This file can also be used as a base for your rules.
122
123___
124
125### Global Options
126| Option | Description |
127|-------------------|------------------------|
128| `--debug` | Show debug information |
129| `--help`, `-h` | Show help |
130| `--version`, `-v` | Show version number |
131
132Display general help
133
134```
135speedy-build-tools --help
136```
137
138Display help specific to a task:
139
140```
141speedy-build-tools lint-sass --help
142```
143
144To display help when running the task from a mapped npm script you should omit the `--`;
145
146```
147npm run lint-sass help
148```
149
150## Stack
151
152- [Stylelint](https://github.com/stylelint/stylelint)
153- [Stylelint SCSS](https://github.com/kristerkari/stylelint-scss)
154- [Stylefmt](https://github.com/morishitter/stylefmt)
155- [TSLint](http://palantir.github.io/tslint)
156- [HTMLHint](https://github.com/yaniswang/HTMLHint)
\No newline at end of file