-
Notifications
You must be signed in to change notification settings - Fork 24
/
package-scripts.js
43 lines (42 loc) · 1.33 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { concurrent } = require('nps-utils')
const FIXTURES = {
CYPRESS: {
LOCAL: 'cypress/cypress-local.json',
PROD: 'cypress/cypress-PROD.json',
},
}
const e2e = config => cmd => `cypress ${cmd} --config-file ${config}`
const localE2E = e2e(FIXTURES.CYPRESS.LOCAL)
const prodE2E = e2e(FIXTURES.CYPRESS.PROD)
module.exports = {
scripts: {
dev: 'next dev',
build: 'next build',
start: 'next start',
lint: {
clean: 'next lint',
fix: 'next lint --fix',
script: 'nps lint.clean lint.dry',
dry: 'twly --boring --lines 3 -t .trc',
},
care: concurrent.nps('build', 'lint'),
dx: concurrent.nps('build', 'lint', 'meta.dependencies'),
meta: {
dependencies: {
build: `depcruise -c .dependency-cruiser.js -T dot components pages apiClient data definitions hooks public styles utils --progress -x node_modules definitions | dot -T svg > dependency-graph.svg`,
interactive: `cat dependency-graph.svg | depcruise-wrap-stream-in-html > dependency-graph.html`,
script: 'nps meta.dep.build meta.dep.interactive',
},
},
test: {
integration: {
dev: {
script: localE2E(`run`),
debug: localE2E(`open`),
},
script: prodE2E(`run`),
},
},
},
}