-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
74 lines (66 loc) · 1.69 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
const gulp = require('gulp');
const jest = require('gulp-jest').default;
const nodemon = require('gulp-nodemon')
const ts = require('gulp-typescript');
const tslint = require('gulp-tslint');
const spellcheck = require('gulp-ts-spellcheck').default;
gulp.task('jest', (done) => {
return gulp.src('')
.on('error', function (err) { done(err); })
.pipe(jest({ runInBand: true }));
});
gulp.task('tslint', (done) => {
return gulp.src('src/**/*.ts')
.on('error', function (err) { done(err); })
.pipe(tslint({
formatter: 'prose'
}))
.pipe(tslint.report());
});
gulp.task('tsc', function (done) {
const tsProject = ts.createProject('tsconfig.json');
return tsProject.src()
.pipe(tsProject())
.on('error', function (err) { done(err); })
.js
.pipe(gulp.dest('build'));
});
gulp.task('spellcheck', function (done) {
return gulp.src('src/**/*.ts')
.on('error', function (err) {
done(err);
})
.pipe(spellcheck({
dictionary: require('./speller-dictionary.js')
}))
.pipe(spellcheck.report({}));
});
gulp.task('start-driver', function (done) {
nodemon({
watch: ['src'],
ignore: ['src/**/*.test.ts'],
exec: 'ts-node ./src/driver/index.ts',
ext: 'ts',
done: done
})
})
gulp.task('start-rider', function (done) {
nodemon({
watch: ['src'],
ignore: ['src/**/*.test.ts'],
exec: 'ts-node ./src/rider/index.ts',
ext: 'ts',
done: done
})
})
gulp.task('start-ops', function (done) {
nodemon({
watch: ['src'],
ignore: ['src/**/*.test.ts'],
exec: 'ts-node ./src/owner/index.ts',
ext: 'ts',
done: done
})
})
gulp.task('compile', ['tslint', 'tsc']);
gulp.task('test', ['compile', 'jest']);