forked from final-form/final-form-focus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
78 lines (76 loc) · 2.27 KB
/
package-scripts.js
File metadata and controls
78 lines (76 loc) · 2.27 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import npsUtils from 'nps-utils'
const { series, rimraf, concurrent } = npsUtils
export default {
scripts: {
test: {
default: 'jest --coverage',
update: 'jest --coverage --updateSnapshot',
watch: 'jest --watch',
codeCov:
'cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js',
size: {
description: 'check the size of the bundle',
script: 'bundlesize'
}
},
build: {
description: 'delete the dist directory and run all builds',
default: series(rimraf('dist'), 'nps build.rollup'),
rollup: {
description: 'Run all rollup builds sequentially',
default: series.nps(
'build.rollup.es',
'build.rollup.cjs',
'build.rollup.umd.main',
'build.rollup.umd.min'
),
es: {
description: 'run the build with rollup (uses rollup.config.js)',
script: 'rollup --config --environment FORMAT:es'
},
cjs: {
description: 'run rollup build with CommonJS format',
script: 'rollup --config --environment FORMAT:cjs'
},
umd: {
min: {
description:
'run the rollup build with sourcemaps for minified UMD',
script:
'rollup --config --sourcemap --environment MINIFY,FORMAT:umd'
},
main: {
description: 'run the rollup build with sourcemaps for UMD',
script: 'rollup --config --sourcemap --environment FORMAT:umd'
}
}
},
andTest: series.nps('build', 'test.size')
},
docs: {
description: 'Generates table of contents in README',
script: 'doctoc README.md'
},
prettier: {
description: 'Runs prettier on everything',
script: 'prettier --write "**/*.([jt]s*)"'
},
lint: {
description: 'lint the entire project',
default: 'eslint .',
fix: 'eslint . --fix'
},
validate: {
description:
'This runs several scripts to make sure things look good before committing or on clean install',
default: series.nps('lint', 'build.andTest', 'test')
},
clean: {
description: 'delete the dist directory',
default: rimraf('dist')
}
},
options: {
silent: false
}
}