Comparing version 0.10.0 to 0.11.0
54
index.js
@@ -213,56 +213,2 @@ 'use strict'; | ||
/** | ||
* 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][] | ||
* so arguments can be anything supported by [chokidar.watch](https://github.com/paulmillr/chokidar#api). | ||
* | ||
* ```js | ||
* var watcher = app.watch('templates/pages/*.hbs', ['site']); | ||
* ``` | ||
* @param {String|Array} `glob` Filename, Directory name, or glob pattern to watch | ||
* @param {Object} `options` Additional options to be passed to [chokidar][] | ||
* @param {String|Array|Function} `tasks` Tasks that are passed to `.build` when files in the glob are changed. | ||
* @return {Object} Returns an instance of `FSWatcher` from [chokidar][] | ||
* @api public | ||
*/ | ||
Composer.prototype.watch = function(glob, options/*, fns/tasks */) { | ||
var self = this; | ||
var len = arguments.length - 1, i = 0; | ||
var args = new Array(len + 1); | ||
while (len--) args[i] = arguments[++i]; | ||
args[i] = done; | ||
var opts = {}; | ||
if (typeof options === 'object' && !Array.isArray(options)) { | ||
args.shift(); | ||
opts = utils.extend(opts, options); | ||
} | ||
var building = true; | ||
function done(err) { | ||
building = false; | ||
if (err) console.error(err); | ||
} | ||
var watch = utils.chokidar.watch(glob, opts); | ||
// only contains our `done` function | ||
if (args.length === 1) { | ||
return watch; | ||
} | ||
watch | ||
.on('ready', function() { | ||
building = false; | ||
}) | ||
.on('all', function() { | ||
if (building) return; | ||
building = true; | ||
self.build.apply(self, args); | ||
}); | ||
return watch; | ||
}; | ||
/** | ||
* Expose Composer | ||
@@ -269,0 +215,0 @@ */ |
@@ -28,7 +28,5 @@ 'use strict'; | ||
require('define-property', 'define'); | ||
require('extend-shallow', 'extend'); | ||
require('array-unique', 'unique'); | ||
require('nanoseconds', 'nano'); | ||
require('isobject'); | ||
require('chokidar'); | ||
require('bach'); | ||
@@ -35,0 +33,0 @@ |
{ | ||
"name": "composer", | ||
"description": "API-first task runner with three methods: task, run and watch.", | ||
"version": "0.10.0", | ||
"homepage": "https://github.com/jonschlinkert/composer", | ||
"version": "0.11.0", | ||
"homepage": "https://github.com/doowb/composer", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
@@ -11,5 +11,5 @@ "contributors": [ | ||
], | ||
"repository": "jonschlinkert/composer", | ||
"repository": "doowb/composer", | ||
"bugs": { | ||
"url": "https://github.com/jonschlinkert/composer/issues" | ||
"url": "https://github.com/doowb/composer/issues" | ||
}, | ||
@@ -31,3 +31,2 @@ "license": "MIT", | ||
"bach": "^0.4.1", | ||
"chokidar": "^1.4.2", | ||
"component-emitter": "^1.2.0", | ||
@@ -74,2 +73,5 @@ "define-property": "^0.2.5", | ||
"assemble", | ||
"base", | ||
"base-tasks", | ||
"composer", | ||
"generate", | ||
@@ -81,6 +83,2 @@ "templates", | ||
}, | ||
"reflinks": [ | ||
"chokidar", | ||
"composer" | ||
], | ||
"plugins": [ | ||
@@ -87,0 +85,0 @@ "gulp-format-md" |
@@ -1,5 +0,7 @@ | ||
# 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) | ||
# composer [![NPM version](https://img.shields.io/npm/v/composer.svg)](https://www.npmjs.com/package/composer) [![Build Status](https://img.shields.io/travis/doowb/composer.svg)](https://travis-ci.org/doowb/composer) | ||
> API-first task runner with three methods: task, run and watch. | ||
**Heads up** `.watch` has been removed as of version `0.11.0`. If you need watch functionality, use [base-tasks](https://github.com/jonschlinkert/base-tasks) and [base-watch](https://github.com/node-base/base-watch). | ||
## Install | ||
@@ -130,19 +132,2 @@ | ||
### [.watch](index.js#L227) | ||
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). | ||
**Params** | ||
* `glob` **{String|Array}**: Filename, Directory name, or glob pattern to watch | ||
* `options` **{Object}**: Additional options to be passed to [chokidar](https://github.com/paulmillr/chokidar) | ||
* `tasks` **{String|Array|Function}**: Tasks that are passed to `.build` when files in the glob are changed. | ||
* `returns` **{Object}**: Returns an instance of `FSWatcher` from [chokidar](https://github.com/paulmillr/chokidar) | ||
**Example** | ||
```js | ||
var watcher = app.watch('templates/pages/*.hbs', ['site']); | ||
``` | ||
## Events | ||
@@ -240,2 +225,4 @@ | ||
* [assemble](https://www.npmjs.com/package/assemble): Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… [more](https://www.npmjs.com/package/assemble) | [homepage](https://github.com/assemble/assemble) | ||
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base) | [homepage](https://github.com/node-base/base) | ||
* [base-tasks](https://www.npmjs.com/package/base-tasks): base-methods plugin that provides a very thin wrapper around [https://github.com/jonschlinkert/composer](https://github.com/jonschlinkert/composer) for adding task methods to… [more](https://www.npmjs.com/package/base-tasks) | [homepage](https://github.com/jonschlinkert/base-tasks) | ||
* [generate](https://www.npmjs.com/package/generate): Fast, composable, highly extendable project generator with a user-friendly and expressive API. | [homepage](https://github.com/generate/generate) | ||
@@ -272,2 +259,2 @@ * [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine.… [more](https://www.npmjs.com/package/templates) | [homepage](https://github.com/jonschlinkert/templates) | ||
_This file was generated by [verb](https://github.com/verbose/verb) on January 27, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb) on January 28, 2016._ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8
26107
507
257
- Removedchokidar@^1.4.2
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.04.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbinary-extensions@1.13.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbraces@1.8.52.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedchokidar@1.7.0(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@1.0.02.0.2(transitive)
- Removedexpand-brackets@0.1.52.1.4(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@3.0.2(transitive)
- Removedextglob@0.3.22.0.4(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.44.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfsevents@1.2.13(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-binary-path@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-descriptor@1.0.3(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@1.0.1(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.03.0.04.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisobject@3.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.113.1.10(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.22.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)