Comparing version 1.7.0 to 2.0.0
@@ -0,1 +1,9 @@ | ||
# Chokidar 2.0.0 (Dec 29, 2017) | ||
* Breaking: Upgrade globbing dependencies which require globs to be more strict and always use POSIX-style slashes because Windows-style slashes are used as escape sequences | ||
* Update tests to work with upgraded globbing dependencies | ||
* Add ability to log FSEvents require error by setting `CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR` env | ||
* Fix for handling braces in globs | ||
* Add node 8 & 9 to CI configs | ||
* Allow node 0.10 failures on Windows | ||
# Chokidar 1.7.0 (May 8, 2017) | ||
@@ -2,0 +10,0 @@ * Add `disableGlobbing` option |
37
index.js
@@ -11,2 +11,4 @@ 'use strict'; | ||
var inherits = require('inherits'); | ||
var braces = require('braces'); | ||
var normalizePath = require('normalize-path') | ||
@@ -427,3 +429,7 @@ var NodeFsHandler = require('./lib/nodefs-handler'); | ||
if (!hasGlob) return false; | ||
var parts = sysPath.relative(watchPath, path).split(/[\/\\]/); | ||
var parts = []; | ||
var expandedPath = braces.expand(path); | ||
expandedPath.forEach(function(path) { | ||
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/)); | ||
}); | ||
return parts; | ||
@@ -433,3 +439,7 @@ }; | ||
var dirParts = getDirParts(path); | ||
if (dirParts && dirParts.length > 1) dirParts.pop(); | ||
if (dirParts) { | ||
dirParts.forEach(function(parts) { | ||
if (parts.length > 1) parts.pop(); | ||
}); | ||
} | ||
var unmatchedGlob; | ||
@@ -441,5 +451,7 @@ | ||
var globstar = false; | ||
unmatchedGlob = !dirParts.every(function(part, i) { | ||
if (part === '**') globstar = true; | ||
return globstar || !entryParts[i] || anymatch(part, entryParts[i]); | ||
unmatchedGlob = !dirParts.some(function(parts) { | ||
return parts.every(function(part, i) { | ||
if (part === '**') globstar = true; | ||
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i]); | ||
}); | ||
}); | ||
@@ -582,2 +594,3 @@ } | ||
FSWatcher.prototype.add = function(paths, _origAdd, _internal) { | ||
var disableGlobbing = this.options.disableGlobbing; | ||
var cwd = this.options.cwd; | ||
@@ -592,9 +605,17 @@ this.closed = false; | ||
if (cwd) paths = paths.map(function(path) { | ||
var absPath; | ||
if (isAbsolute(path)) { | ||
return path; | ||
absPath = path; | ||
} else if (path[0] === '!') { | ||
return '!' + sysPath.join(cwd, path.substring(1)); | ||
absPath = '!' + sysPath.join(cwd, path.substring(1)); | ||
} else { | ||
return sysPath.join(cwd, path); | ||
absPath = sysPath.join(cwd, path); | ||
} | ||
// Check `path` instead of `absPath` because the cwd portion can't be a glob | ||
if (disableGlobbing || !isGlob(path)) { | ||
return absPath; | ||
} else { | ||
return normalizePath(absPath); | ||
} | ||
}); | ||
@@ -601,0 +622,0 @@ |
@@ -7,3 +7,5 @@ 'use strict'; | ||
var fsevents; | ||
try { fsevents = require('fsevents'); } catch (error) {} | ||
try { fsevents = require('fsevents'); } catch (error) { | ||
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error) | ||
} | ||
@@ -10,0 +12,0 @@ // fsevents instance helper functions |
{ | ||
"name": "chokidar", | ||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.", | ||
"version": "1.7.0", | ||
"version": "2.0.0", | ||
"keywords": [ | ||
@@ -26,3 +26,4 @@ "fs", | ||
"test": "istanbul test node_modules/mocha/bin/_mocha", | ||
"ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls" | ||
"ci-test": "istanbul cover _mocha", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls" | ||
}, | ||
@@ -41,3 +42,4 @@ "files": [ | ||
"sinon": "^1.10.3", | ||
"sinon-chai": "^2.6.0" | ||
"sinon-chai": "^2.6.0", | ||
"upath": "1.0.0" | ||
}, | ||
@@ -48,8 +50,10 @@ "optionalDependencies": { | ||
"dependencies": { | ||
"anymatch": "^1.3.0", | ||
"anymatch": "^2.0.0", | ||
"async-each": "^1.0.0", | ||
"glob-parent": "^2.0.0", | ||
"braces": "^2.3.0", | ||
"glob-parent": "^3.1.0", | ||
"inherits": "^2.0.1", | ||
"is-binary-path": "^1.0.0", | ||
"is-glob": "^2.0.0", | ||
"is-glob": "^4.0.0", | ||
"normalize-path": "^2.1.1", | ||
"path-is-absolute": "^1.0.0", | ||
@@ -56,0 +60,0 @@ "readdirp": "^2.0.0" |
@@ -1,2 +0,2 @@ | ||
# Chokidar [![Mac/Linux Build Status](https://img.shields.io/travis/paulmillr/chokidar/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/paulmillr/chokidar) [![Windows Build status](https://img.shields.io/appveyor/ci/es128/chokidar/master.svg?label=Windows)](https://ci.appveyor.com/project/es128/chokidar/branch/master) [![Coverage Status](https://coveralls.io/repos/paulmillr/chokidar/badge.svg)](https://coveralls.io/r/paulmillr/chokidar) [![Join the chat at https://gitter.im/paulmillr/chokidar](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/paulmillr/chokidar?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
# Chokidar [![Mac/Linux Build Status](https://img.shields.io/travis/paulmillr/chokidar/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/paulmillr/chokidar) [![Windows Build status](https://img.shields.io/appveyor/ci/paulmillr/chokidar/master.svg?label=Windows)](https://ci.appveyor.com/project/paulmillr/chokidar/branch/master) [![Coverage Status](https://coveralls.io/repos/paulmillr/chokidar/badge.svg)](https://coveralls.io/r/paulmillr/chokidar) [![Join the chat at https://gitter.im/paulmillr/chokidar](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/paulmillr/chokidar?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
@@ -3,0 +3,0 @@ > A neat wrapper around node.js fs.watch / fs.watchFile / fsevents. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
78621
1399
11
9
7
+ Addedbraces@^2.3.0
+ Addednormalize-path@^2.1.1
+ Addedanymatch@2.0.0(transitive)
+ Addedglob-parent@3.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@3.1.04.0.3(transitive)
+ Addedpath-dirname@1.0.2(transitive)
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.0(transitive)
- Removedarray-unique@0.2.1(transitive)
- Removedbraces@1.8.5(transitive)
- Removedexpand-brackets@0.1.5(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextglob@0.3.2(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.4(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.04.0.0(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.11(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedregex-cache@0.4.4(transitive)
Updatedanymatch@^2.0.0
Updatedglob-parent@^3.1.0
Updatedis-glob@^4.0.0