diff options
Diffstat (limited to 'node_modules/chokidar')
-rw-r--r-- | node_modules/chokidar/CHANGELOG.md | 6 | ||||
-rw-r--r-- | node_modules/chokidar/README.md | 12 | ||||
-rw-r--r-- | node_modules/chokidar/index.js | 11 | ||||
-rw-r--r-- | node_modules/chokidar/lib/fsevents-handler.js | 1 | ||||
-rw-r--r-- | node_modules/chokidar/package.json | 4 |
5 files changed, 25 insertions, 9 deletions
diff --git a/node_modules/chokidar/CHANGELOG.md b/node_modules/chokidar/CHANGELOG.md index 0874dee20..673d64ae8 100644 --- a/node_modules/chokidar/CHANGELOG.md +++ b/node_modules/chokidar/CHANGELOG.md @@ -1,3 +1,9 @@ +# Chokidar 1.7.0 (May 8, 2017) +* Add `disableGlobbing` option +* Add ability to force interval value by setting CHOKIDAR_INTERVAL env + variable +* Fix issue with `.close()` being called before `ready` + # Chokidar 1.6.0 (Jun 22, 2016) * Added ability for force `usePolling` mode by setting `CHOKIDAR_USEPOLLING` env variable diff --git a/node_modules/chokidar/README.md b/node_modules/chokidar/README.md index bcd005b0f..0d67f8302 100644 --- a/node_modules/chokidar/README.md +++ b/node_modules/chokidar/README.md @@ -61,7 +61,7 @@ Then `require` and use it in your code: var chokidar = require('chokidar'); // One-liner for current directory, ignores .dotfiles -chokidar.watch('.', {ignored: /[\/\\]\./}).on('all', (event, path) => { +chokidar.watch('.', {ignored: /(^|[\/\\])\../}).on('all', (event, path) => { console.log(event, path); }); ``` @@ -71,7 +71,7 @@ chokidar.watch('.', {ignored: /[\/\\]\./}).on('all', (event, path) => { // Initialize watcher. var watcher = chokidar.watch('file, dir, glob, or array', { - ignored: /[\/\\]\./, + ignored: /(^|[\/\\])\../, persistent: true }); @@ -120,6 +120,7 @@ chokidar.watch('file', { ignoreInitial: false, followSymlinks: true, cwd: '.', + disableGlobbing: false, usePolling: true, interval: 100, @@ -168,6 +169,8 @@ symlinks themselves will be watched for changes instead of following the link references and bubbling events through the link's path. * `cwd` (no default). The base directory from which watch `paths` are to be derived. Paths emitted with events will be relative to this. +* `disableGlobbing` (default: `false`). If set to `true` then the strings passed to `.watch()` and `.add()` are treated as +literal path names, even if they look like globs. #### Performance @@ -180,7 +183,8 @@ non-standard situations. Setting to `true` explicitly on OS X overrides the `useFsEvents` default. You may also set the CHOKIDAR_USEPOLLING env variable to true (1) or false (0) in order to override this option. * _Polling-specific settings_ (effective when `usePolling: true`) - * `interval` (default: `100`). Interval of file system polling. + * `interval` (default: `100`). Interval of file system polling. You may also + set the CHOKIDAR_INTERVAL env variable to override this option. * `binaryInterval` (default: `300`). Interval of file system polling for binary files. ([see list of binary extensions](https://github.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) @@ -196,7 +200,7 @@ already available from the underlying watch events. * `depth` (default: `undefined`). If set, limits how many levels of subdirectories will be traversed. * `awaitWriteFinish` (default: `false`). -By default, the `add` event will fire when a file first appear on disk, before +By default, the `add` event will fire when a file first appears on disk, before the entire file has been written. Furthermore, in some cases some `change` events will be emitted while the file is being written. In some cases, especially when watching for large files there will be a need to wait for the diff --git a/node_modules/chokidar/index.js b/node_modules/chokidar/index.js index e23a64377..4006e080b 100644 --- a/node_modules/chokidar/index.js +++ b/node_modules/chokidar/index.js @@ -76,6 +76,7 @@ function FSWatcher(_opts) { if (undef('ignorePermissionErrors')) opts.ignorePermissionErrors = false; if (undef('interval')) opts.interval = 100; if (undef('binaryInterval')) opts.binaryInterval = 300; + if (undef('disableGlobbing')) opts.disableGlobbing = false; this.enableBinaryInterval = opts.binaryInterval !== opts.interval; // Enable fsevents on OS X when polling isn't explicitly enabled. @@ -104,6 +105,10 @@ function FSWatcher(_opts) { opts.usePolling = !!envLower } } + var envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = parseInt(envInterval); + } // Editor atomic write normalization enabled by default with fs.watch if (undef('atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; @@ -377,7 +382,7 @@ FSWatcher.prototype._isIgnored = function(path, stats) { var replacerRe = /^\.[\/\\]/; FSWatcher.prototype._getWatchHelpers = function(path, depth) { path = path.replace(replacerRe, ''); - var watchPath = depth || !isGlob(path) ? path : globParent(path); + var watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); var fullWatchPath = sysPath.resolve(watchPath); var hasGlob = watchPath !== path; var globFilter = hasGlob ? anymatch(path) : false; @@ -465,7 +470,7 @@ FSWatcher.prototype._getWatchedDir = function(directory) { if (!(dir in this._watched)) this._watched[dir] = { _items: Object.create(null), add: function(item) { - if (item !== '.') this._items[item] = true; + if (item !== '.' && item !== '..') this._items[item] = true; }, remove: function(item) { delete this._items[item]; @@ -619,7 +624,7 @@ FSWatcher.prototype.add = function(paths, _origAdd, _internal) { }.bind(this)); }.bind(this), function(error, results) { results.forEach(function(item) { - if (!item) return; + if (!item || this.closed) return; this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); }, this); }.bind(this)); diff --git a/node_modules/chokidar/lib/fsevents-handler.js b/node_modules/chokidar/lib/fsevents-handler.js index dbf6adeed..ddda6ef81 100644 --- a/node_modules/chokidar/lib/fsevents-handler.js +++ b/node_modules/chokidar/lib/fsevents-handler.js @@ -374,6 +374,7 @@ function(path, transform, forceAdd, priorDepth) { if (this.options.persistent && forceAdd !== true) { var initWatch = function(error, realPath) { + if (this.closed) return; var closer = this._watchWithFsEvents( wh.watchPath, sysPath.resolve(realPath || wh.watchPath), diff --git a/node_modules/chokidar/package.json b/node_modules/chokidar/package.json index e871daed1..78a422d99 100644 --- a/node_modules/chokidar/package.json +++ b/node_modules/chokidar/package.json @@ -1,7 +1,7 @@ { "name": "chokidar", "description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.", - "version": "1.6.1", + "version": "1.7.0", "keywords": [ "fs", "watch", @@ -34,7 +34,7 @@ "coveralls": "^2.11.2", "graceful-fs": "4.1.4", "istanbul": "^0.3.20", - "mocha": "^2.0.0", + "mocha": "^3.0.0", "rimraf": "^2.4.3", "sinon": "^1.10.3", "sinon-chai": "^2.6.0" |