forked from linterhub/schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
150 lines (135 loc) · 2.78 KB
/
gulpfile.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
'use strict';
// Set global shared core
const lhcore = require('./script/gulp/index.js');
global.lhcore = lhcore;
// External modules as aliases
const gulp = lhcore.amd.gulp;
const hubRegistry = lhcore.amd.hubRegistry;
const gulpHelpDoc = lhcore.amd.gulpHelpDoc;
// Load tasks into the registry of gulp
hubRegistry([
'script/gulp/**/task.*.js',
]);
/**
* Validate all schemas
*
* @task {validate}
*/
gulp.task('validate', gulp.series('validate:all'));
/**
* Check all files via linting
*
* @task {lint}
*/
gulp.task('lint', gulp.series('lint:all'));
/**
* Clean node_modules folder and install all npm package
*
* @task {packages:reinstall}
*/
gulp.task('packages:reinstall', gulp.series(
'clean:node',
'packages:install'
));
/**
* Clean following folders: build, release and node modules
*
* @task {clean}
*/
gulp.task('clean', gulp.parallel(
'packages:reinstall',
'clean:build',
'clean:release'
));
/**
* Import licenses and languages
*
* @task {import}
*/
gulp.task('import', gulp.series('pull:submodules', 'import:all'));
/**
* Create build and run tests for core schemas in `build` folder
*
* @task {build}
*/
gulp.task('build', gulp.series(
'lint',
'validate',
'clean:build',
'build:bundle',
'build:create',
'build:typings'
));
/**
* Create a pull for git submodules and repository
*
* @task {pull}
*/
gulp.task('pull', gulp.parallel('pull:all'));
/**
* The created release of core schemas with next version of release and
* include all static files, put it's to `release` folder,
* and run tests for core schemas after that
*
* @task {release}
* @arg {nextRelease} [optional] version of next release. By default: 0.9.0
*/
gulp.task('release', gulp.series(
'test:source',
'build',
'test:build',
'clean:release',
'release:all'
));
/**
* Run test for core schemas
*
* @task {test}
*/
gulp.task('test', gulp.series(
'test:source',
'build',
'test:build',
'clean:release',
'release:all',
'test:release'
));
/**
* Publish last release to gh-pages
*
* @task {deploy}
* @arg {gitUserName} [optional] set a git user name
* @arg {gitUserEmail} [optional] set a git user email
*/
gulp.task('deploy', gulp.series(
'clean:release',
'packages:personal',
'deploy:copy',
'release:copy',
'deploy:publish'
));
/**
* Print help
*
* @task {default}
*/
gulp.task('default', () => {
return gulpHelpDoc(gulp);
});
/**
* The test deploy of core schemas with next version of release
*
* @task {release}
* @arg {nextRelease} [optional] version of next release. By default: 0.9.0
*/
gulp.task('test:deploy', gulp.series(
'clean',
'build',
'test:build',
'release:all',
'test:release',
'npm:pack',
'packages:local',
'clean:release',
'deploy:copy'
));