UNPKG

3.7 kBMarkdownView Raw
1# CLI
2
3## Table of Contents
4* [NPM](#npm)
5* [Commands](#commands)
6 * [help](#help)
7 * [start](#start)
8 * [lint](#lint)
9 * [build](#build)
10 * [release](#release)
11 * [profile](#profile)
12 * [test](#test)
13
14## NPM
15> NPM requires `--` between the command and options
16```bash
17npm run <command> -- <options>
18```
19
20## Commands
21
22### `help`
23Show help menu for all CLI options.
24
25### `start`
26Start the development server and watches for file changes. Hot-reloading is enabled for React projects. Angular projects hot reload CSS only.
27
28#### options
29
30##### `--dry-run`
31Start the development server using production settings. **Example:**
32
33`npm start -- --dry-run`
34
35### `lint`
36Lint project files using EsLint.
37
38#### options
39
40##### `--include`
41Include additional glob patterns for linting.
42
43##### `--ignore-git-untracked`
44Ignore files that are not indexed by git.
45
46##### `--disable-linter`
47Disable linter when creating bundles for production or staging.
48
49### `build`
50- Cleans up `/dist` folder
51- Bundles project assets into the `/dist` folder
52
53### `release`
54- Prompts the user for a version
55- Cleans up `/dist` folder
56- Bundles project assets into the `/dist` folder
57- Tags the version in Git
58
59#### NODE_ENV
60
61##### `production`
62Minifies the javascript assets.
63
64##### `staging`
65No minification is done on javascript assets
66
67#### options
68
69##### `--dry-run`
70- Disables committing files to git
71- Disables creating a git tag
72
73Skipped tasks will print a message in the console
74```bash
75ℹ [ Dry Run ] Skipping version bump
76```
77
78### `profile`
79Analyze Webpack bundles and find what is contributing their sizes. This command generates an html graphical chart that automatically opens in the browser as well as a text summary report in the console.
80
81![profile](./docs/profile.png)
82
83```
84› Webpack profile:
85
86react-dom: 533.24 KB (39.1%)
87availity-uikit: 242.86 KB (17.8%)
88reactstrap: 152.56 KB (11.2%)
89react: 130.38 KB (9.56%)
90react-select: 89.44 KB (6.56%)
91tether: 55.04 KB (4.03%)
92buffer: 47.47 KB (3.48%)
93lodash.omit: 36.87 KB (2.70%)
94fbjs: 30.45 KB (2.23%)
95style-loader: 11.25 KB (0.824%)
96process: 5.17 KB (0.379%)
97react-input-autosize: 4.54 KB (0.333%)
98react-hot-loader: 3.95 KB (0.289%)
99lodash.tonumber: 3.91 KB (0.286%)
100base64-js: 3.4 KB (0.249%)
101css-loader: 2.14 KB (0.157%)
102<self>: 11.71 KB (0.859%)
103```
104
105
106### `test`
107Run the tests for your project. The behavior of the test are determined by the plugin used in the workflow engine. The engine supports `availity-workflow-react` (Jest) and `availity-workflow-angular` (Karma and Chrome|Firefox|IE) plugins.
108
109#### options
110
111##### `--coverage`
112Indicates that test coverage information should be collected and reported in the output. React project leverage the `--coverage` option from Jest. Angular projects use Instanbul to collect coverage metrics. Angular projects output coverage statistics to the console as well as html files in the `{workspaces}/coverage` folder.
113
114```bash
115› Started testing
116Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 3 of 3 SUCCESS (0.706 secs / 0.082 secs)
117
118=============================== Coverage summary ===============================
119Statements : 27.69% ( 8620/31134 )
120Branches : 9.81% ( 1980/20189 )
121Functions : 22.15% ( 1381/6235 )
122Lines : 27.23% ( 7955/29217 )
123================================================================================
124✔ Finished testing
125```
126
127### `about`
128Awesomeness.
129
130
131## Disclaimer
132
133Open source software components distributed or made available in the Availity Materials are licensed to Company under the terms of the applicable open source license agreements, which may be found in text files included in the Availity Materials.
134
135## License
136[MIT](../../LICENSE)
137
138
139
140
141