This repository has been archived by the owner on Dec 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
70 lines (56 loc) · 1.61 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
// #region Configuration area
// output folder
const destFolder = "out";
// #endregion
// #region Gulp script
const gulp = require("gulp");
gulp.task("compile", () => {
const gruntTypeScript = require("gulp-typescript");
const tsProject = gruntTypeScript.createProject("tsconfig.json");
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest(destFolder));
});
gulp.task("necessary-copying", () => {
return Promise.all([
gulp
.src([
"package{,-lock}.json",
"src/**/*.*",
"!src/**/*.{ts,md}",
"!src/**/.git/*",
"docker/{.,}[Dd]ocker*{,.*}"
])
.pipe(gulp.dest(`${destFolder}/`)),
gulp
.src([
"docker/images/db/**/*{,.*}"
])
.pipe(gulp.dest(`${destFolder}/.docker/db/`)),
gulp
.src([
"docker/images/bot/Dockerfile"
])
.pipe(gulp.dest(`${destFolder}/`))
]);
});
gulp.task("build", gulp.series([
"compile",
"necessary-copying"
]));
gulp.task("lint", () => {
const gulpTslint = require("gulp-tslint");
const tslint = require("tslint");
const program = tslint.Linter.createProgram("tsconfig.json");
return gulp.src("src/**/*.ts", { base: '.' })
.pipe(gulpTslint({
formatter: "prose",
program
}))
.pipe(gulpTslint.report({
allowWarnings: true,
summarizeFailureOutput: true
}));
});
gulp.task("default", gulp.series(["lint", "build"]));
// #endregion