UNPKG

4.32 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### `init <projectName>`
26
27#### Positionals
28`projectName` Required. The name of the project you want to create.
29
30#### Options
31- `--version`, `-v`: Specify which version of the plugin project you want. [default: "latest"]
32- `--current-dir`, `-c`: If you want the project to be created in the current directory
33- `--template`, `-t`: The template you want to initialize the projec with
34#### Examples
35- `npx @availity/workflow init my-package-name`
36- `npx @availity/workflow init my-package-name --template https://github.com/Availity/availity-starter-angular`
37- `npx @availity/workflow init my-package-name --version 4.0.0-alpha.4`
38
39### `start`
40Start the development server and watches for file changes. Hot-reloading is enabled for React projects. Angular projects hot reload CSS only.
41
42#### options
43
44##### `--dry-run`
45Start the development server using production settings. **Example:**
46
47`npm start -- --dry-run`
48
49### `lint`
50Lint project files using EsLint.
51
52#### options
53
54##### `--include`
55Include additional glob patterns for linting.
56
57##### `--ignore-git-untracked`
58Ignore files that are not indexed by git.
59
60##### `--disable-linter`
61Disable linter when creating bundles for production or staging.
62
63### `build`
64- Cleans up `/dist` folder
65- Bundles project assets into the `/dist` folder
66
67### `release`
68- Prompts the user for a version
69- Cleans up `/dist` folder
70- Bundles project assets into the `/dist` folder
71- Tags the version in Git
72
73#### NODE_ENV
74
75##### `production`
76Minifies the javascript assets.
77
78##### `staging`
79No minification is done on javascript assets
80
81#### options
82
83##### `--dry-run`
84- Disables committing files to git
85- Disables creating a git tag
86
87Skipped tasks will print a message in the console
88```bash
89ℹ [ Dry Run ] Skipping version bump
90```
91
92### `profile`
93Analyze 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.
94
95```
96› Webpack profile:
97
98react-dom: 533.24 KB (39.1%)
99availity-uikit: 242.86 KB (17.8%)
100reactstrap: 152.56 KB (11.2%)
101react: 130.38 KB (9.56%)
102react-select: 89.44 KB (6.56%)
103tether: 55.04 KB (4.03%)
104buffer: 47.47 KB (3.48%)
105lodash.omit: 36.87 KB (2.70%)
106fbjs: 30.45 KB (2.23%)
107style-loader: 11.25 KB (0.824%)
108process: 5.17 KB (0.379%)
109react-input-autosize: 4.54 KB (0.333%)
110react-hot-loader: 3.95 KB (0.289%)
111lodash.tonumber: 3.91 KB (0.286%)
112base64-js: 3.4 KB (0.249%)
113css-loader: 2.14 KB (0.157%)
114<self>: 11.71 KB (0.859%)
115```
116
117
118### `test`
119Run 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-plugin-react` (Jest) and `@availity/workflow-plugin-angular` (Karma and Chrome|Firefox|IE) plugins.
120
121#### options
122
123##### `--coverage`
124Indicates 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.
125
126```bash
127› Started testing
128Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 3 of 3 SUCCESS (0.706 secs / 0.082 secs)
129
130=============================== Coverage summary ===============================
131Statements : 27.69% ( 8620/31134 )
132Branches : 9.81% ( 1980/20189 )
133Functions : 22.15% ( 1381/6235 )
134Lines : 27.23% ( 7955/29217 )
135================================================================================
136✔ Finished testing
137```
138
139### `about`
140Awesomeness.
141
142
143## Disclaimer
144
145Open 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.
146
147## License
148[MIT](../../LICENSE)
149
150
151
152
153