forked from nrwl/nx-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
108 lines (105 loc) · 3.31 KB
/
Copy pathpackage-scripts.js
File metadata and controls
108 lines (105 loc) · 3.31 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
const nps = require('nps-utils');
const os = require('os');
const { join } = require('path');
function forEachApplication(command) {
return {
intellij: command.replace(/APPLICATION/g, 'intellij'),
vscode: command.replace(/APPLICATION/g, 'vscode')
};
}
function affected(affectedCommand) {
return {
'origin-master': `nx affected:${affectedCommand} --base=origin/master --parallel --silent --ci`,
'upstream-master': `nx affected:${affectedCommand} --base=upstream/master --parallel --silent --ci`
};
}
module.exports = {
scripts: {
'gen-graphql': nps.series(
'gql-gen --config ./tools/scripts/codegen-server.yml',
'gql-gen --config ./tools/scripts/codegen-client.js'
),
clean: 'shx rm -rf dist/',
prepare: {
and: {
e2e: {
up: nps.series.nps('prepare.e2e', 'e2e.up'),
headless: nps.series.nps('prepare.e2e', 'e2e.headless')
},
package: {
...forEachApplication(
nps.series.nps(
'clean',
'prepare.APPLICATION',
'install-dependencies.APPLICATION',
'package.APPLICATION'
)
)
}
},
...forEachApplication(
nps.concurrent({
server: 'ng build APPLICATION --prod --noSourceMap',
client: 'ng build angular-console --configuration=APPLICATION'
})
),
ci: {
...forEachApplication(
nps.concurrent({
server: 'ng build APPLICATION --noSourceMap',
client:
'ng build angular-console --configuration=APPLICATION --noSourceMap --optimization=false --noCommonChunk --aot=false --buildOptimizer=false'
})
)
},
dev: {
...forEachApplication(
nps.concurrent({
server: 'ng build APPLICATION --watch',
client:
'ng build angular-console --configuration=APPLICATION --watch --aot=false --buildOptimizer=false'
})
)
}
},
package: {
vscode: nps.series(
`shx rm -rf ${join('dist', 'apps', 'vscode', '**', '*-es5.js')}`,
`shx rm -rf ${join('dist', 'apps', 'vscode', '**', '*.ts')}`,
`node ${join('tools', 'scripts', 'vscode-vsce.js')}`
),
intellij: `node ${join('tools', 'scripts', 'intellij-package.js')}`
},
format: {
default: 'nx format:write',
and: {
lint: {
check: nps.concurrent.nps('format.check', 'lint')
}
},
write: 'nx format:write --base=origin/master',
check: 'nx format:check --base=origin/master'
},
lint: {
default: nps.concurrent({
nxLint: 'nx lint',
tsLint: 'npx tslint -p tsconfig.json -e **/generated/* -c tslint.json',
stylelint: 'stylelint "{apps,libs}/**/*.scss" --config .stylelintrc'
}),
fix: nps.concurrent({
tslint:
'npx tslint -p tsconfig.json -e **/generated/* -c tslint.json --fix',
stylelint:
'stylelint "{apps,libs}/**/*.scss" --config .stylelintrc --fix'
})
},
test: {
default: 'nx affected:test --all --parallel',
affected: affected('test')
},
'install-dependencies': {
vscode: `node ${join('tools', 'scripts', 'vscode-yarn.js')}`,
intellij: `node ${join('tools', 'scripts', 'intellij-yarn.js')}`
}
}
};