Skip to content

Commit 37dd755

Browse files
nickpape-msftdzearing
authored andcommitted
Ensure the GulpProxy class is assignable to Gulp, which was causing lots of downstream issues. (microsoft#1)
1 parent 4cee381 commit 37dd755

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

gulp-core-build/src/GulpProxy.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
import gulp = require('gulp');
2+
import Orchestrator = require('orchestrator');
23

34
/* tslint:disable:max-line-length */
4-
export class GulpProxy {
5+
export class GulpProxy extends Orchestrator implements gulp.Gulp {
6+
public src: gulp.SrcMethod;
7+
public dest: gulp.DestMethod;
8+
public watch: gulp.WatchMethod;
9+
510
private _gulp: gulp.Gulp;
611

712
constructor(gulpInstance: gulp.Gulp) {
13+
super();
814
this._gulp = gulpInstance;
15+
this.src = gulpInstance.src;
16+
this.dest = gulpInstance.dest;
17+
this.watch = gulpInstance.watch;
918
}
1019

11-
public task(): void {
20+
/* tslint:disable-next-line:no-any */
21+
public task(): any {
1222
throw new Error(
1323
'You should not define gulp tasks, but instead subclass the GulpTask and override the executeTask method.'
1424
);
1525
}
16-
17-
public src(glob: string | string[], opt?: gulp.SrcOptions): NodeJS.ReadWriteStream {
18-
return this._gulp.src(glob, opt);
19-
}
20-
21-
public dest(outFolder: string | ((file: string) => string),
22-
opt?: gulp.DestOptions): NodeJS.ReadWriteStream {
23-
return this._gulp.dest(outFolder, opt);
24-
}
25-
26-
public watch(glob: string | string[], fn: (gulp.WatchCallback | string)): NodeJS.EventEmitter {
27-
return this._gulp.watch(glob, fn);
28-
}
2926
}

0 commit comments

Comments
 (0)