1 | # @stoplight/scripts
|
2 |
|
3 | [![Maintainability](https://api.codeclimate.com/v1/badges/2628d0fe95cf3abae711/maintainability)](https://codeclimate.com/github/stoplightio/scripts/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/2628d0fe95cf3abae711/test_coverage)](https://codeclimate.com/github/stoplightio/scripts/test_coverage)
|
4 |
|
5 |
|
6 | * [@stoplight/scripts](#stoplightscripts)
|
7 | * [Usage](#usage)
|
8 | * [Commands](#commands)
|
9 | * [Overriding Configs](#overriding-configs)
|
10 |
|
11 |
|
12 | # Usage
|
13 |
|
14 | Create a new library:
|
15 |
|
16 | ```bash
|
17 | npx @stoplight/scripts create:lib
|
18 | ```
|
19 |
|
20 | # Commands
|
21 |
|
22 |
|
23 | * [`sl-scripts build`](#sl-scripts-build)
|
24 | * [`sl-scripts bundle`](#sl-scripts-bundle)
|
25 | * [`sl-scripts create:lib`](#sl-scripts-createlib)
|
26 | * [`sl-scripts help [COMMAND]`](#sl-scripts-help-command)
|
27 | * [`sl-scripts release`](#sl-scripts-release)
|
28 | * [`sl-scripts release:docs`](#sl-scripts-releasedocs)
|
29 |
|
30 | ## `sl-scripts build`
|
31 |
|
32 | Build source code
|
33 |
|
34 | ```
|
35 | USAGE
|
36 | $ sl-scripts build
|
37 |
|
38 | OPTIONS
|
39 | --verbose moar logs
|
40 |
|
41 | EXAMPLE
|
42 | $ sl-scripts build
|
43 | ```
|
44 |
|
45 | _See code: [dist/commands/build/index.ts](https://github.com/stoplightio/scripts/blob/v9.0.5/dist/commands/build/index.ts)_
|
46 |
|
47 | ## `sl-scripts bundle`
|
48 |
|
49 | Bundle source code
|
50 |
|
51 | ```
|
52 | USAGE
|
53 | $ sl-scripts bundle
|
54 |
|
55 | OPTIONS
|
56 | --minify minify output using terser
|
57 | --verbose moar logs
|
58 |
|
59 | EXAMPLE
|
60 | $ sl-scripts bundle
|
61 | ```
|
62 |
|
63 | _See code: [dist/commands/bundle/index.ts](https://github.com/stoplightio/scripts/blob/v9.0.5/dist/commands/bundle/index.ts)_
|
64 |
|
65 | ## `sl-scripts create:lib`
|
66 |
|
67 | Scaffold out a new library.
|
68 |
|
69 | ```
|
70 | USAGE
|
71 | $ sl-scripts create:lib
|
72 |
|
73 | EXAMPLE
|
74 | $ sl-scripts create:lib
|
75 | ```
|
76 |
|
77 | _See code: [dist/commands/create/lib.ts](https://github.com/stoplightio/scripts/blob/v9.0.5/dist/commands/create/lib.ts)_
|
78 |
|
79 | ## `sl-scripts help [COMMAND]`
|
80 |
|
81 | display help for sl-scripts
|
82 |
|
83 | ```
|
84 | USAGE
|
85 | $ sl-scripts help [COMMAND]
|
86 |
|
87 | ARGUMENTS
|
88 | COMMAND command to show help for
|
89 |
|
90 | OPTIONS
|
91 | --all see all commands in CLI
|
92 | ```
|
93 |
|
94 | _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.3/src/commands/help.ts)_
|
95 |
|
96 | ## `sl-scripts release`
|
97 |
|
98 | Publish new src or docs release.
|
99 |
|
100 | ```
|
101 | USAGE
|
102 | $ sl-scripts release
|
103 |
|
104 | OPTIONS
|
105 | --verbose moar logs
|
106 |
|
107 | EXAMPLES
|
108 | $ sl-scripts release
|
109 | $ sl-scripts release:docs
|
110 | ```
|
111 |
|
112 | _See code: [dist/commands/release/index.ts](https://github.com/stoplightio/scripts/blob/v9.0.5/dist/commands/release/index.ts)_
|
113 |
|
114 | ## `sl-scripts release:docs`
|
115 |
|
116 | Push built docs to github pages.
|
117 |
|
118 | ```
|
119 | USAGE
|
120 | $ sl-scripts release:docs
|
121 |
|
122 | OPTIONS
|
123 | --dry-run run the release process but do not publish
|
124 | --verbose moar logs
|
125 |
|
126 | EXAMPLE
|
127 | $ sl-scripts release:docs
|
128 | ```
|
129 |
|
130 | _See code: [dist/commands/release/docs.ts](https://github.com/stoplightio/scripts/blob/v9.0.5/dist/commands/release/docs.ts)_
|
131 |
|
132 |
|
133 | # Overriding Configs
|
134 |
|
135 | ## Jest
|
136 |
|
137 | Simply create a `jest.config.js` file in the root of your project, and extend the default config. For example:
|
138 |
|
139 | ```js
|
140 | // ./jest.config.js
|
141 | module.exports = {
|
142 | preset: "@stoplight/scripts"
|
143 | };
|
144 | ```
|
145 |
|
146 | ## TS
|
147 |
|
148 | Simply create a `tsconfig.json` file in the root of your project, and extend the default config. For example:
|
149 |
|
150 | ```json
|
151 | // ./tsconfig.json
|
152 | {
|
153 | "extends": "@stoplight/scripts/tsconfig.json",
|
154 | "include": ["src"],
|
155 | "compilerOptions": {
|
156 | "outDir": "dist"
|
157 | }
|
158 | }
|
159 | ```
|
160 |
|
161 | ## TSLint
|
162 |
|
163 | Simply create a `tslint.json` file in the root of your project, and extend the default config. For example:
|
164 |
|
165 | ```json
|
166 | // ./tslint.json
|
167 | {
|
168 | "extends": ["@stoplight/scripts/tslint.json"]
|
169 | }
|
170 | ```
|
171 |
|
172 | ## Semantic Release
|
173 |
|
174 | Simply add a `release` property to your `package.json` file. For example:
|
175 |
|
176 | ```json
|
177 | // ./package.json
|
178 | {
|
179 | // ... props
|
180 | "release": {
|
181 | "pkgRoot": "dist",
|
182 | "plugins": [
|
183 | "@semantic-release/commit-analyzer",
|
184 | "@semantic-release/release-notes-generator"
|
185 | ]
|
186 | }
|
187 | // ... props
|
188 | }
|
189 | ```
|