-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
47 lines (39 loc) · 1.39 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
let gulp = require('gulp');
let typedoc = require("gulp-typedoc");
let ts = require('gulp-typescript');
let merge_stream = require('merge2');
let fs = require('fs');
let tsSources = ['src/**/*.ts'];
let tsProject = ts.createProject('tsconfig.json');
gulp.task("scripts",function(){
let tsResult = gulp.src(tsSources).pipe(tsProject());
return merge_stream([ // Merge the two output streams, so this task is finished when the IO of both operations is done.
tsResult.dts.pipe(gulp.dest('./dist')),
tsResult.js.pipe(gulp.dest('./dist'))
]);
});
gulp.task("typedoc", function() {
return gulp.src(tsSources)
.pipe(typedoc({
out: "./docs",
// json: "output/to/file.json",
// TypeDoc options (see typedoc docs)
// name: "my-project",
// theme: "/path/to/my/theme",
// plugins: ["my", "plugins"],
// module: "commonjs",
// target: "es6",
// ignoreCompilerErrors: false,
version: true,
}));
});
gulp.task('docs', gulp.series('typedoc', async function(cb) {
fs.writeFileSync('docs/.nojekyll',cb);
}));
gulp.task('watch', gulp.series('scripts', async function() {
gulp.watch(tsSources, gulp.series('scripts'));
}));
gulp.task('build', gulp.parallel('scripts', 'docs'));
gulp.task('default', gulp.parallel('build'));
// TODO: Create a 'release' script to do:
// ['docs','scripts'], bump version, commit and tag, then npm publish