Skip to content

Commit

Permalink
Ensure the GulpProxy class is assignable to Gulp, which was causing l…
Browse files Browse the repository at this point in the history
…ots of downstream issues. (#1)
  • Loading branch information
nick-pape authored and dzearing committed Oct 1, 2016
1 parent 5e4afe2 commit 19a8c6c
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions gulp-core-build/src/GulpProxy.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
import gulp = require('gulp');
import Orchestrator = require('orchestrator');

/* tslint:disable:max-line-length */
export class GulpProxy {
export class GulpProxy extends Orchestrator implements gulp.Gulp {
public src: gulp.SrcMethod;
public dest: gulp.DestMethod;
public watch: gulp.WatchMethod;

private _gulp: gulp.Gulp;

constructor(gulpInstance: gulp.Gulp) {
super();
this._gulp = gulpInstance;
this.src = gulpInstance.src;
this.dest = gulpInstance.dest;
this.watch = gulpInstance.watch;
}

public task(): void {
/* tslint:disable-next-line:no-any */
public task(): any {
throw new Error(
'You should not define gulp tasks, but instead subclass the GulpTask and override the executeTask method.'
);
}

public src(glob: string | string[], opt?: gulp.SrcOptions): NodeJS.ReadWriteStream {
return this._gulp.src(glob, opt);
}

public dest(outFolder: string | ((file: string) => string),
opt?: gulp.DestOptions): NodeJS.ReadWriteStream {
return this._gulp.dest(outFolder, opt);
}

public watch(glob: string | string[], fn: (gulp.WatchCallback | string)): NodeJS.EventEmitter {
return this._gulp.watch(glob, fn);
}
}

0 comments on commit 19a8c6c

Please sign in to comment.