Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack/watchpack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8d839e8b6edb87f9cd8a1ff97028060c4ecc9bee
Choose a base ref
...
head repository: webpack/watchpack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d5b9c58c323c5aac4d5ab3ba0be87721b75070e8
Choose a head ref

Commits on Mar 23, 2020

  1. Update Chokidar to the new minor version that fixes the prototype pol…

    …lution vulnerability through minimist: https://npmjs.com/advisories/1179
    mjziolko authored and sokra committed Mar 23, 2020
    1
    Copy the full SHA
    1549c44 View commit details
  2. Copy the full SHA
    4ea9ed2 View commit details

Commits on Mar 24, 2020

  1. Merge pull request #151 from webpack/ci/node-version

    remove outdated node.js version, add latest ones
    sokra authored Mar 24, 2020
    Copy the full SHA
    669aaa1 View commit details
  2. Merge pull request #148 from mjziolko/chokidar-vuln

    Update Chokidar to the new minor version that fixes the prototype pollution vulnerability through minmimist
    sokra authored Mar 24, 2020
    Copy the full SHA
    31500fb View commit details

Commits on Mar 26, 2020

  1. add lockfile

    sokra committed Mar 26, 2020
    Copy the full SHA
    4fd09bc View commit details
  2. 1.6.1

    sokra committed Mar 26, 2020
    Copy the full SHA
    4097e48 View commit details

Commits on Apr 25, 2020

  1. Copy the full SHA
    0e6a867 View commit details
  2. Merge pull request #154 from webpack/ci/fix

    fix CI in webpack 1
    sokra authored Apr 25, 2020
    Copy the full SHA
    c5a3346 View commit details

Commits on Apr 26, 2020

  1. run appveyor with yarn too

    sokra committed Apr 26, 2020
    Copy the full SHA
    1403402 View commit details
  2. Merge pull request #155 from webpack/ci/appveyor-yarn

    run appveyor with yarn too
    sokra authored Apr 26, 2020
    Copy the full SHA
    88e13a6 View commit details
  3. Update chokidar to 3.3.0

    coreyward authored and sokra committed Apr 26, 2020
    Copy the full SHA
    7dd76d9 View commit details
  4. enforce readdirp@3.4.0

    sokra committed Apr 26, 2020
    Copy the full SHA
    9efbb97 View commit details
  5. catch errors on closing

    sokra committed Apr 26, 2020
    Copy the full SHA
    da8c244 View commit details
  6. log out watching errors

    sokra committed Apr 26, 2020
    Copy the full SHA
    f6d5f77 View commit details
  7. Copy the full SHA
    11caedf View commit details
  8. Update chokidar to 3.4.0

    sokra committed Apr 26, 2020
    Copy the full SHA
    e27a81f View commit details
  9. Copy the full SHA
    e95336f View commit details
  10. run CI with node.js 14

    sokra committed Apr 26, 2020
    Copy the full SHA
    f53f6c7 View commit details

Commits on May 16, 2020

  1. Merge pull request #153 from coreyward/update-chokidar

    Update chokidar to 3.3.0
    sokra authored May 16, 2020
    Copy the full SHA
    59a4990 View commit details
  2. 1.7.0

    sokra committed May 16, 2020
    Copy the full SHA
    2db42a7 View commit details
  3. Copy the full SHA
    1cacc77 View commit details
  4. 1.7.1

    sokra committed May 16, 2020
    Copy the full SHA
    d5b9c58 View commit details
Showing with 2,663 additions and 11 deletions.
  1. +3 −1 .travis.yml
  2. +6 −3 appveyor.yml
  3. +1 −0 chokidar2/index.js
  4. +11 −0 chokidar2/package.json
  5. +5 −3 lib/DirectoryWatcher.js
  6. +22 −0 lib/chokidar.js
  7. +7 −3 package.json
  8. +34 −1 test/Assumption.js
  9. +2,574 −0 yarn.lock
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -4,9 +4,11 @@ os:
- linux
- osx
node_js:
- "14"
- "12"
- "10"
- "8"
- "6"
- "4"

script: npm run travis

9 changes: 6 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -7,17 +7,20 @@ init:
# what combinations to test
environment:
matrix:
- nodejs_version: 14
- nodejs_version: 12
- nodejs_version: 10
- nodejs_version: 8
- nodejs_version: 6
- nodejs_version: 4

install:
- ps: Install-Product node $env:nodejs_version x64
- npm install
- yarn --frozen-lockfile

build: off

test_script:
- node --version
- npm --version
- cmd: npm test
- yarn --version
- cmd: yarn test
1 change: 1 addition & 0 deletions chokidar2/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("chokidar");
11 changes: 11 additions & 0 deletions chokidar2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "chokidar2",
"version": "2.0.0",
"private": true,
"engines": {
"node": "<8.10.0"
},
"dependencies": {
"chokidar": "^2.1.8"
}
}
8 changes: 5 additions & 3 deletions lib/DirectoryWatcher.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

var EventEmitter = require("events").EventEmitter;
var async = require("neo-async");
var chokidar = require("chokidar");
var chokidar = require("./chokidar");
var fs = require("graceful-fs");
var path = require("path");

@@ -282,7 +282,8 @@ DirectoryWatcher.prototype.onDirectoryUnlinked = function onDirectoryUnlinked(di
}
};

DirectoryWatcher.prototype.onWatcherError = function onWatcherError(/* err */) {
DirectoryWatcher.prototype.onWatcherError = function onWatcherError(err) {
console.warn("Error from chokidar (" + this.path + "): " + err);
};

DirectoryWatcher.prototype.doInitialScan = function doInitialScan() {
@@ -356,7 +357,8 @@ DirectoryWatcher.prototype.getTimes = function() {

DirectoryWatcher.prototype.close = function() {
this.initialScan = false;
this.watcher.close();
var p = this.watcher.close();
if(p && p.catch) p.catch(this.onWatcherError.bind(this));
if(this.nestedWatching) {
Object.keys(this.directories).forEach(function(dir) {
this.directories[dir].close();
22 changes: 22 additions & 0 deletions lib/chokidar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var v3Err;
try {
module.exports = require("chokidar");
return;
} catch(e) {
v3Err = e;
}

var v2Err;
try {
module.exports = require("chokidar2");
return;
} catch(e) {
v2Err = e;
}

throw new Error(
"No version of chokidar is available. Tried chokidar@2 and chokidar@3.\n" +
"You could try to manually install any chokidar version.\n" +
"chokidar@3: " + v3Err + "\n" +
"chokidar@2: " + v2Err + "\n"
)
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "watchpack",
"version": "1.6.0",
"version": "1.7.1",
"description": "",
"main": "./lib/watchpack.js",
"directories": {
"test": "test"
},
"files": [
"lib/"
"lib/",
"chokidar2"
],
"scripts": {
"pretest": "npm run lint",
@@ -36,8 +37,11 @@
"rimraf": "^2.6.2",
"should": "^8.3.1"
},
"optionalDependencies": {
"chokidar": "^3.4.0",
"chokidar2": "file:./chokidar2"
},
"dependencies": {
"chokidar": "^2.0.2",
"graceful-fs": "^4.1.2",
"neo-async": "^2.5.0"
}
35 changes: 34 additions & 1 deletion test/Assumption.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
require("should");
var path = require("path");
var fs = require("fs");
var chokidar = require("chokidar");
var chokidar = require("../lib/chokidar");
var TestHelper = require("./helpers/TestHelper");
var Watchpack = require("../lib/watchpack");

@@ -188,4 +188,37 @@ describe("Assumption", function() {
});
});
});

[1, 10, 20, 50, 100, 200, 300, 400, 500].reverse().forEach(function(delay) {
it("should not fire events after watcher has been closed after " + delay + "ms delay", function(done) {
var watcher = watcherToClose = chokidar.watch(fixtures, {
ignoreInitial: true,
persistent: true,
followSymlinks: false,
depth: 0,
atomic: false,
alwaysStat: true,
ignorePermissionErrors: true
});
watcher.on("add", function(arg) {
done(new Error("should not be emitted " + arg));
done = function() {};
});
watcher.on("change", function(arg) {
done(new Error("should not be emitted " + arg));
done = function() {};
});
watcher.on("error", function(err) {
done(err);
done = function() {};
});
testHelper.tick(delay, function() {
watcher.close();
testHelper.file("watch-test-file-close");
testHelper.tick(500, function() {
done();
});
});
});
});
});
Loading