-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage-scripts.js
60 lines (59 loc) · 1.9 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const transpile = 'babel --copy-files --out-dir dist --ignore *.test.js,fixtures src'
const cleanDist = 'rimraf dist'
const validate = ['build.andValidate', 'test', 'lint']
module.exports = {
scripts: {
commit: {
description: 'This uses commitizen to help us generate beautifully formatted commit messages',
script: 'git-cz',
},
test: {
default: 'jest src/ --coverage',
watch: 'jest src/ --watch',
cli: {
default: 'jest cli-test/',
watch: 'jest cli-test/ --watch',
},
},
build: {
default: {
description: 'deletes the `dist` directory and transpiles all relevant `src` to the `dist`',
script: [cleanDist, transpile].join('&&'),
},
watch: {
script: [cleanDist, `${transpile} --watch`].join('&&'),
},
andValidate: {
description: 'Runs the normal build first, then validates the CLI',
script: 'nps build,test.cli',
},
},
lint: {
description: 'lint the code with eslint',
script: 'eslint .',
},
reportCoverage: {
description: 'Report coverage stats to codecov. This should be run after the `cover` script and only on travis',
script: 'codecov',
},
release: {
description: 'We automate releases with semantic-release. This should only be run on travis',
script: 'semantic-release pre && npm publish && semantic-release post',
},
validate: {
description: 'This runs several scripts to make sure things look good before committing or on clean install',
script: `nps -p ${validate.join(',')}`,
},
addContributor: {
description: 'When new people contribute to the project, run this',
script: 'all-contributors add',
},
generateContributors: {
description: 'Update the badge and contributors table',
script: 'all-contributors generate',
},
},
options: {
silent: false,
},
}