Comparing version 0.9.0 to 0.10.0
@@ -8,3 +8,2 @@ 'use strict'; | ||
var map = require('./lib/map-deps'); | ||
var session = require('./lib/session'); | ||
var flowFactory = require('./lib/flow'); | ||
@@ -26,7 +25,2 @@ var Emitter = require('component-emitter'); | ||
utils.define(this, '_appname', name || 'composer'); | ||
utils.define(this, 'currentTask', { | ||
get: function() { | ||
return session(this._appname).get('task'); | ||
} | ||
}); | ||
utils.define(this, 'buildHistory', { | ||
@@ -98,3 +92,2 @@ get: function() { | ||
fn: fn, | ||
session: session(this._appname), | ||
app: this | ||
@@ -101,0 +94,0 @@ }); |
@@ -5,3 +5,2 @@ 'use strict'; | ||
var flowFactory = require('./flow'); | ||
var session = require('./session'); | ||
var noop = require('./noop'); | ||
@@ -37,3 +36,2 @@ var Run = require('./run'); | ||
this.name = task.name; | ||
this.session = task.session || session(this.name); | ||
this.options = task.options || {}; | ||
@@ -107,26 +105,23 @@ this.deps = task.deps || this.options.deps || []; | ||
var results; | ||
self.session.run(function() { | ||
self.session.set('task', self); | ||
try { | ||
results = self.fn.call(self, done); | ||
} catch (err) { | ||
return done(err); | ||
} | ||
try { | ||
results = self.fn.call(self, done); | ||
} catch (err) { | ||
return done(err); | ||
} | ||
// needed to capture when the actual task is finished running | ||
if (typeof results !== 'undefined') { | ||
if (typeof results.on === 'function') { | ||
results.on('error', done); | ||
results.on('end', done); | ||
results.resume(); | ||
return; | ||
} | ||
if (typeof results.then === 'function') { | ||
results.then(function(result) { | ||
return done(null, result); | ||
}, done); | ||
return; | ||
} | ||
// needed to capture when the actual task is finished running | ||
if (typeof results !== 'undefined') { | ||
if (typeof results.on === 'function') { | ||
results.on('error', done); | ||
results.on('end', done); | ||
results.resume(); | ||
return; | ||
} | ||
}); | ||
if (typeof results.then === 'function') { | ||
results.then(function(result) { | ||
return done(null, result); | ||
}, done); | ||
return; | ||
} | ||
} | ||
}); | ||
@@ -133,0 +128,0 @@ }; |
@@ -29,3 +29,2 @@ 'use strict'; | ||
require('extend-shallow', 'extend'); | ||
require('session-cache', 'session'); | ||
require('array-unique', 'unique'); | ||
@@ -32,0 +31,0 @@ require('nanoseconds', 'nano'); |
{ | ||
"name": "composer", | ||
"description": "API-first task runner with three methods: task, run and watch.", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"homepage": "https://github.com/jonschlinkert/composer", | ||
@@ -36,11 +36,10 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"lazy-cache": "^1.0.3", | ||
"nanoseconds": "^0.1.0", | ||
"session-cache": "^0.2.0" | ||
"nanoseconds": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"assemble-loader": "^0.2.6", | ||
"assemble-loader": "^0.3.0", | ||
"assemble-render-file": "^0.3.1", | ||
"assemble-streams": "^0.3.0", | ||
"async": "^1.5.1", | ||
"bluebird": "^3.1.1", | ||
"assemble-streams": "^0.4.0", | ||
"async": "^1.5.2", | ||
"bluebird": "^3.1.5", | ||
"composer-runtimes": "^0.7.0", | ||
@@ -51,8 +50,8 @@ "engine-handlebars": "^0.8.0", | ||
"gulp-extname": "^0.2.2", | ||
"gulp-format-md": "^0.1.4", | ||
"gulp-format-md": "^0.1.5", | ||
"gulp-istanbul": "^0.10.3", | ||
"gulp-mocha": "^2.2.0", | ||
"mocha": "^2.3.4", | ||
"mocha": "^2.4.2", | ||
"parser-front-matter": "^1.3.0", | ||
"templates": "^0.9.5", | ||
"templates": "^0.11.0", | ||
"through2": "^2.0.0", | ||
@@ -59,0 +58,0 @@ "write": "^0.2.1" |
@@ -21,3 +21,3 @@ # composer [![NPM version](https://img.shields.io/npm/v/composer.svg)](https://www.npmjs.com/package/composer) [![Build Status](https://img.shields.io/travis/jonschlinkert/composer.svg)](https://travis-ci.org/jonschlinkert/composer) | ||
### [.task](index.js#L68) | ||
### [.task](index.js#L62) | ||
@@ -49,3 +49,3 @@ Register a new task with it's options and dependencies. To return the task object of an already registered task, pass the name of the task without any additional parameters. | ||
### [.build](index.js#L125) | ||
### [.build](index.js#L118) | ||
@@ -68,3 +68,3 @@ Build a task or array of tasks. | ||
### [.series](index.js#L185) | ||
### [.series](index.js#L178) | ||
@@ -100,3 +100,3 @@ Compose task or list of tasks into a single function that runs the tasks in series. | ||
### [.parallel](index.js#L217) | ||
### [.parallel](index.js#L210) | ||
@@ -134,3 +134,3 @@ Compose task or list of tasks into a single function that runs the tasks in parallel. | ||
### [.watch](index.js#L234) | ||
### [.watch](index.js#L227) | ||
@@ -275,2 +275,2 @@ Watch a file, directory, or glob pattern for changes and build a task or list of tasks when changes are made. Watch is powered by [chokidar](https://github.com/paulmillr/chokidar) so arguments can be anything supported by [chokidar.watch](https://github.com/paulmillr/chokidar#api). | ||
_This file was generated by [verb](https://github.com/verbose/verb) on January 26, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb) on January 27, 2016._ |
9
27780
11
555
- Removedsession-cache@^0.2.0
- Removedasync-listener@0.6.10(transitive)
- Removedcontinuation-local-storage@3.2.1(transitive)
- Removedemitter-listener@1.1.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsession-cache@0.2.0(transitive)
- Removedshimmer@1.2.1(transitive)