UNPKG

3.76 kBMarkdownView Raw
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<!-- toc -->
6* [@stoplight/scripts](#stoplightscripts)
7* [Usage](#usage)
8* [Commands](#commands)
9* [Overriding Configs](#overriding-configs)
10<!-- tocstop -->
11
12# Usage
13
14Create a new library:
15
16```bash
17npx @stoplight/scripts create:lib
18```
19
20# Commands
21
22<!-- commands -->
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
32Build source code
33
34```
35USAGE
36 $ sl-scripts build
37
38OPTIONS
39 --verbose moar logs
40
41EXAMPLE
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
49Bundle source code
50
51```
52USAGE
53 $ sl-scripts bundle
54
55OPTIONS
56 --minify minify output using terser
57 --verbose moar logs
58
59EXAMPLE
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
67Scaffold out a new library.
68
69```
70USAGE
71 $ sl-scripts create:lib
72
73EXAMPLE
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
81display help for sl-scripts
82
83```
84USAGE
85 $ sl-scripts help [COMMAND]
86
87ARGUMENTS
88 COMMAND command to show help for
89
90OPTIONS
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
98Publish new src or docs release.
99
100```
101USAGE
102 $ sl-scripts release
103
104OPTIONS
105 --verbose moar logs
106
107EXAMPLES
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
116Push built docs to github pages.
117
118```
119USAGE
120 $ sl-scripts release:docs
121
122OPTIONS
123 --dry-run run the release process but do not publish
124 --verbose moar logs
125
126EXAMPLE
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<!-- commandsstop -->
132
133# Overriding Configs
134
135## Jest
136
137Simply 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
141module.exports = {
142 preset: "@stoplight/scripts"
143};
144```
145
146## TS
147
148Simply 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
163Simply 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
174Simply 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```