-
Notifications
You must be signed in to change notification settings - Fork 27
/
gulpfile.js
48 lines (39 loc) · 1.35 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
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var shell = require('gulp-shell')
var bump = require('gulp-bump')
var git = require('gulp-git');
var tag_version = require('gulp-tag-version');
var serverFiles = {
src: 'server/src/**/*.ts'
};
var clientFiles = {
src: './src/**/*.ts'
}
function bumpVersion(ver) {
return gulp.src(['./package.json'])
.pipe(bump({ type: ver }))
.pipe(gulp.dest('./'))
.pipe(git.commit('Bump package version'))
.pipe(tag_version());
}
gulp.task('compileClient', shell.task([
'npm run vscode:prepublish'
]));
gulp.task('compileServer', shell.task([
'cd server && npm install && npm run compile'
]));
gulp.task('tslint', function () {
return gulp.src([serverFiles.src, clientFiles.src])
.pipe(tslint({
formatter: "verbose"
}))
.pipe(tslint.report())
});
gulp.task('build', gulp.series('compileClient', 'compileServer'))
gulp.task('buildAndLint', gulp.series('tslint', 'build'))
const buildAndLint = gulp.task('buildAndLint')
gulp.task('patch', gulp.series(buildAndLint, function () { return bumpVersion('patch'); }));
gulp.task('minor', gulp.series(buildAndLint, function () { return bumpVersion('minor'); }));
gulp.task('major', gulp.series(buildAndLint, function () { return bumpVersion('major'); }));
gulp.task('default', buildAndLint)