-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-scripts.js
43 lines (41 loc) · 1.21 KB
/
package-scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const npsUtils = require('nps-utils')
const series = npsUtils.series
const concurrent = npsUtils.concurrent
const rimraf = npsUtils.rimraf
const crossEnv = npsUtils.crossEnv
module.exports = {
scripts: {
test: {
default: crossEnv('NODE_ENV=test jest --coverage'),
update: crossEnv('NODE_ENV=test jest --coverage --updateSnapshot'),
watch: crossEnv('NODE_ENV=test jest --watch'),
},
build: {
description: 'delete the dist directory and run all builds',
default: series(rimraf('dist'), 'rollup -c'),
watch: 'rollup -c -w',
},
lint: {
default: 'eslint .',
fix: 'eslint . --fix',
},
format: {
description: 'format the entire project',
script:
"prettier --trailing-comma es5 --single-quote --write 'src/*/*.js' 'stories/*/*.js'",
},
validate: {
description:
'This runs several scripts to make sure things look good before committing or on clean install',
default: concurrent.nps('lint', 'test'),
},
storybook: {
description: 'launch storybook in local',
default: 'start-storybook -p 9001 -c .storybook',
deploy: 'storybook-to-ghpages',
},
},
options: {
silent: false,
},
}