This repository has been archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.ts
104 lines (85 loc) · 2.12 KB
/
gulpfile.ts
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
import { parallel, series } from 'gulp';
import { doRun, generateTestTask, lint, task } from './gulpfile.functions';
const modules = ['server', 'web', 'gulp'];
const artifactModules = ['server', 'web'];
modules.forEach((it) => {
const cwd = it === 'gulp' ? '.' : it;
task({
name: `${it}:lint`,
fct: lint(cwd, false),
desc: `Lints ${it}`
});
task({
name: `${it}:format`,
alias: `${it[0]}f`, // e.g. 'wf' === 'web:format'
fct: lint(cwd, true),
desc: `Formats (force --fix for linting) ${it}`
});
task({
name: `${it}:install`,
alias: `${it[0]}i`, // e.g. 'wi' === 'web:install'
fct: doRun('npm install', { cwd }),
desc: `Runs 'npm install' on ${it}`
});
// task({
// name: `${it}:audit`,
// fct: doRun('npm audit fix', { cwd }),
// desc: `Runs 'npm audit fix' on ${it}`,
// });
});
artifactModules.forEach((it) => {
task({
name: `${it}:pre-build`,
fct: series(`${it}:lint`),
desc: `Lints ${it}`
});
generateTestTask(it, 'unit', 'src');
generateTestTask(it, 'architecture');
});
// tslint:disable:no-var-requires
require('./gulpfile.web');
require('./gulpfile.server');
// tslint:enable:no-var-requires
/**
* "All" Tasks
*/
task({
name: 'testAll',
fct: series('server:exec-unit-test', 'web:exec-unit-test')
});
task({
name: 'testArch',
fct: series('server:exec-architecture-test')
});
task({
name: 'lintAll',
fct: parallel(modules.map((it) => `${it}:lint`))
});
task({
name: 'formatAll',
alias: 'fa',
fct: parallel(modules.map((it) => `${it}:format`))
});
task({
name: 'installAll',
alias: 'ia',
fct: parallel(modules.map((it) => `${it}:install`)),
desc: "runs 'npm install' on all submodules"
});
// task({
// name: 'auditAll',
// fct: parallel(modules.map((it) => `${it}:audit`)),
// desc: "runs 'npm audit fix' on all submodules",
// });
task({
name: 'compileAll',
fct: parallel(artifactModules.map((it) => `${it}:compile`))
});
task({
name: 'buildAll',
fct: parallel(artifactModules.map((it) => `${it}:build`))
});
task({
name: 'buildAllProd',
fct: parallel(artifactModules.map((it) => `${it}:buildProd`))
});