Skip to content

Commit

Permalink
Breaking: Replace Orchestrator with Undertaker
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 31, 2017
1 parent f0942aa commit 9fda7b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 199 deletions.
44 changes: 4 additions & 40 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
'use strict';

var util = require('util');
var Orchestrator = require('orchestrator');
var gutil = require('gulp-util');
var deprecated = require('deprecated');
var Undertaker = require('undertaker');
var vfs = require('vinyl-fs');

function Gulp() {
Orchestrator.call(this);
Undertaker.call(this);
}
util.inherits(Gulp, Orchestrator);

Gulp.prototype.task = Gulp.prototype.add;
Gulp.prototype.run = function() {
// `run()` is deprecated as of 3.5 and will be removed in 4.0
// Use task dependencies instead

// Impose our opinion of "default" tasks onto orchestrator
var tasks = arguments.length ? arguments : ['default'];

this.start.apply(this, tasks);
};
util.inherits(Gulp, Undertaker);

Gulp.prototype.src = vfs.src;
Gulp.prototype.dest = vfs.dest;
Expand All @@ -30,34 +17,11 @@ Gulp.prototype.watch = function(glob, opt, fn) {
opt = null;
}

// Array of tasks given
if (Array.isArray(fn)) {
return vfs.watch(glob, opt, function() {
this.start.apply(this, fn);
}.bind(this));
}

return vfs.watch(glob, opt, fn);
return vfs.watch(glob, opt, this.parallel(fn));
};

// Let people use this class from our instance
Gulp.prototype.Gulp = Gulp;

// Deprecations
deprecated.field('gulp.env has been deprecated. ' +
'Use your own CLI parser instead. ' +
'We recommend using yargs or minimist.',
console.warn,
Gulp.prototype,
'env',
gutil.env
);

Gulp.prototype.run = deprecated.method('gulp.run() has been deprecated. ' +
'Use task dependencies or gulp.watch task triggering instead.',
console.warn,
Gulp.prototype.run
);

var inst = new Gulp();
module.exports = inst;
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
},
"man": "gulp.1",
"dependencies": {
"deprecated": "^0.0.1",
"gulp-cli": "^0.1.3",
"gulp-util": "^3.0.0",
"orchestrator": "^0.3.0",
"undertaker": "^0.1.0",
"vinyl-fs": "^0.3.0"
},
"devDependencies": {
Expand Down
157 changes: 0 additions & 157 deletions test/tasks.js

This file was deleted.

0 comments on commit 9fda7b4

Please sign in to comment.