-
Notifications
You must be signed in to change notification settings - Fork 11
/
package-scripts.js
71 lines (69 loc) · 1.91 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
61
62
63
64
65
66
67
68
69
70
71
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable prefer-destructuring */
const npsUtils = require('nps-utils');
const concurrent = npsUtils.concurrent;
const rimraf = npsUtils.rimraf;
const series = npsUtils.series;
module.exports = {
scripts: {
commit: {
description: 'Commit changes using commitizen',
script: 'git-cz',
},
contributors: {
add: {
description: 'When new people contribute to the project, run this',
script: 'all-contributors add',
},
generate: {
description: 'Update the badge and contributors table',
script: 'all-contributors generate',
},
},
build: {
default: {
description: 'Delete the dist directory and run babel to build the files',
script: series(rimraf('dist'), 'rollup -c'),
},
watch: {
description: 'Watch and rebuild dist',
script: 'rollup -c -w',
},
},
dev: {
description: 'Watch build files and run dev server',
script: concurrent.nps('build.watch', 'demo'),
},
demo: {
default: {
description: 'Run demo dev server',
script: 'webpack-dev-server --mode development',
},
prod: {
description: 'Build demo and publish to github pages',
script: series('webpack --mode production', 'gh-pages -d demo'),
},
},
lint: {
description: 'lint the entire project with eslint',
script: 'eslint ./src/*.js',
},
test: {
default: {
description: 'Collect code coverage',
script: 'jest --coverage',
},
watch: {
description: 'Run test in interactive watch mode',
script: 'jest --watch',
},
},
validate: {
description: 'Run validation to make sure everything is up to standard',
script: concurrent.nps('lint', 'build', 'test'),
},
},
options: {
logLevel: 'warn',
},
};