-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathgulpfile.js
58 lines (52 loc) · 1.7 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
var ts = require('gulp-typescript');
var gulp = require('gulp');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
var merge = require('merge2');
var insert = require('gulp-insert');
var sourcemaps = require('gulp-sourcemaps');
var tsProject = ts.createProject({
declarationFiles: true,
noExternalResolve: false,
sortOutput: true,
target: 'ES5',
module: 'amd',
});
gulp.task('watch', ['js'], function() {
gulp.watch('jupyterdrive/ts/*.ts', ['js']);
gulp.watch('jupyterdrive/js/*.js', ['js']);
gulp.watch('typings/*/*.ts', ['js']);
gulp.watch('gulpfile.js', ['js']);
});
gulp.task('js', function() {
console.log('=========== Rebuilding JS ===========')
var tsResult = gulp.src([
'jupyterdrive/ts/*.ts',
'typings/*.d.ts',
'typings/*/**.d.ts',
])
.pipe(sourcemaps.init())
.pipe(ts(tsProject));
return merge([
tsResult.dts.pipe(gulp.dest('jupyterdrive/gdrive')),
tsResult.js
.pipe(insert.prepend('// AUTOMATICALY GENERATED FILE, see cooresponding .ts file\n'))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('jupyterdrive/gdrive'))
]);
});
var typedoc = require('gulp-typedoc');
gulp.task('docs', function() {
return gulp.src(['./jupyterdrive/ts/*.ts',
'typings/requirejs/*',
//'typings/ipython/*',
//'typings/jquery/*',
'typings/es6-promise/*',])
.pipe(typedoc({
module: "commonjs",
out: './docs',
name: 'Jupyter drive',
target: 'ES5',
mode: 'file',
includeDeclarations: true }));
});