summaryrefslogtreecommitdiffstats
path: root/node_modules/watchpack
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/watchpack')
-rw-r--r--node_modules/watchpack/LICENSE20
-rw-r--r--node_modules/watchpack/README.md72
-rw-r--r--node_modules/watchpack/lib/DirectoryWatcher.js379
-rw-r--r--node_modules/watchpack/lib/chokidar.js22
-rw-r--r--node_modules/watchpack/lib/watcherManager.js35
-rw-r--r--node_modules/watchpack/lib/watchpack.js145
-rw-r--r--node_modules/watchpack/node_modules/anymatch/LICENSE15
-rw-r--r--node_modules/watchpack/node_modules/anymatch/README.md87
-rw-r--r--node_modules/watchpack/node_modules/anymatch/index.d.ts19
-rw-r--r--node_modules/watchpack/node_modules/anymatch/index.js102
-rw-r--r--node_modules/watchpack/node_modules/anymatch/package.json76
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json256
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json.d.ts3
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/index.d.ts14
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/index.js1
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/license9
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/package.json70
-rw-r--r--node_modules/watchpack/node_modules/binary-extensions/readme.md41
-rw-r--r--node_modules/watchpack/node_modules/chokidar/LICENSE21
-rw-r--r--node_modules/watchpack/node_modules/chokidar/README.md306
-rw-r--r--node_modules/watchpack/node_modules/chokidar/index.js958
-rw-r--r--node_modules/watchpack/node_modules/chokidar/lib/constants.js63
-rw-r--r--node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js524
-rw-r--r--node_modules/watchpack/node_modules/chokidar/lib/nodefs-handler.js645
-rw-r--r--node_modules/watchpack/node_modules/chokidar/package.json162
-rw-r--r--node_modules/watchpack/node_modules/chokidar/types/index.d.ts187
-rw-r--r--node_modules/watchpack/node_modules/is-binary-path/index.d.ts17
-rw-r--r--node_modules/watchpack/node_modules/is-binary-path/index.js7
-rw-r--r--node_modules/watchpack/node_modules/is-binary-path/license9
-rw-r--r--node_modules/watchpack/node_modules/is-binary-path/package.json72
-rw-r--r--node_modules/watchpack/node_modules/is-binary-path/readme.md34
-rw-r--r--node_modules/watchpack/node_modules/readdirp/LICENSE21
-rw-r--r--node_modules/watchpack/node_modules/readdirp/README.md122
-rw-r--r--node_modules/watchpack/node_modules/readdirp/index.d.ts43
-rw-r--r--node_modules/watchpack/node_modules/readdirp/index.js282
-rw-r--r--node_modules/watchpack/node_modules/readdirp/package.json158
-rw-r--r--node_modules/watchpack/package.json82
37 files changed, 0 insertions, 5079 deletions
diff --git a/node_modules/watchpack/LICENSE b/node_modules/watchpack/LICENSE
deleted file mode 100644
index 8c11fc7..0000000
--- a/node_modules/watchpack/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright JS Foundation and other contributors
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/watchpack/README.md b/node_modules/watchpack/README.md
deleted file mode 100644
index b1b8107..0000000
--- a/node_modules/watchpack/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-# watchpack
-
-Wrapper library for directory and file watching.
-
-[![Build Status](https://travis-ci.org/webpack/watchpack.svg?branch=master)](https://travis-ci.org/webpack/watchpack) [![Build status](https://ci.appveyor.com/api/projects/status/e5u2qvmugtv0r647/branch/master?svg=true)](https://ci.appveyor.com/project/sokra/watchpack/branch/master) [![Test coverage][coveralls-image]][coveralls-url]
-
-## Concept
-
-watchpack high level API doesn't map directly to watchers. Instead a three level architecture ensures that for each directory only a single watcher exists.
-
-* The high level API requests `DirectoryWatchers` from a `WatcherManager`, which ensures that only a single `DirectoryWatcher` per directory is created.
-* A user-faced `Watcher` can be obtained from a `DirectoryWatcher` and provides a filtered view on the `DirectoryWatcher`.
-* Reference-counting is used on the `DirectoryWatcher` and `Watcher` to decide when to close them.
-* The real watchers (currently chokidar) are created by the `DirectoryWatcher`.
-* Files are never watched directly. This should keep the watcher count low.
-* Watching can be started in the past. This way watching can start after file reading.
-* Symlinks are not followed, instead the symlink is watched.
-
-## API
-
-``` javascript
-var Watchpack = require("watchpack");
-
-var wp = new Watchpack({
- // options:
- aggregateTimeout: 1000
- // fire "aggregated" event when after a change for 1000ms no additional change occurred
- // aggregated defaults to undefined, which doesn't fire an "aggregated" event
-
- poll: true
- // poll: true - use polling with the default interval
- // poll: 10000 - use polling with an interval of 10s
- // poll defaults to undefined, which prefer native watching methods
- // Note: enable polling when watching on a network path
-
- ignored: /node_modules/,
- // anymatch-compatible definition of files/paths to be ignored
- // see https://github.com/paulmillr/chokidar#path-filtering
-});
-
-// Watchpack.prototype.watch(string[] files, string[] directories, [number startTime])
-wp.watch(listOfFiles, listOfDirectories, Date.now() - 10000);
-// starts watching these files and directories
-// calling this again will override the files and directories
-
-wp.on("change", function(filePath, mtime) {
- // filePath: the changed file
- // mtime: last modified time for the changed file
-});
-
-wp.on("aggregated", function(changes) {
- // changes: an array of all changed files
-});
-
-// Watchpack.prototype.pause()
-wp.pause();
-// stops emitting events, but keeps watchers open
-// next "watch" call can reuse the watchers
-
-// Watchpack.prototype.close()
-wp.close();
-// stops emitting events and closes all watchers
-
-// Watchpack.prototype.getTimes()
-var fileTimes = wp.getTimes();
-// returns an object with all know change times for files
-// this include timestamps from files not directly watched
-// key: absolute path, value: timestamp as number
-```
-
-[coveralls-url]: https://coveralls.io/r/webpack/watchpack/
-[coveralls-image]: https://img.shields.io/coveralls/webpack/watchpack.svg
diff --git a/node_modules/watchpack/lib/DirectoryWatcher.js b/node_modules/watchpack/lib/DirectoryWatcher.js
deleted file mode 100644
index 78888f6..0000000
--- a/node_modules/watchpack/lib/DirectoryWatcher.js
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-"use strict";
-
-var EventEmitter = require("events").EventEmitter;
-var async = require("neo-async");
-var chokidar = require("./chokidar");
-var fs = require("graceful-fs");
-var path = require("path");
-
-var watcherManager = require("./watcherManager");
-
-var FS_ACCURACY = 1000;
-
-
-function withoutCase(str) {
- return str.toLowerCase();
-}
-
-
-function Watcher(directoryWatcher, filePath, startTime) {
- EventEmitter.call(this);
- this.directoryWatcher = directoryWatcher;
- this.path = filePath;
- this.startTime = startTime && +startTime;
- // TODO this.data seem to be only read, weird
- this.data = 0;
-}
-
-Watcher.prototype = Object.create(EventEmitter.prototype);
-Watcher.prototype.constructor = Watcher;
-
-Watcher.prototype.checkStartTime = function checkStartTime(mtime, initial) {
- if(typeof this.startTime !== "number") return !initial;
- var startTime = this.startTime;
- return startTime <= mtime;
-};
-
-Watcher.prototype.close = function close() {
- this.emit("closed");
-};
-
-
-function DirectoryWatcher(directoryPath, options) {
- EventEmitter.call(this);
- this.options = options;
- this.path = directoryPath;
- this.files = Object.create(null);
- this.directories = Object.create(null);
- var interval = typeof options.poll === "number" ? options.poll : undefined;
- this.watcher = chokidar.watch(directoryPath, {
- ignoreInitial: true,
- persistent: true,
- followSymlinks: false,
- depth: 0,
- atomic: false,
- alwaysStat: true,
- ignorePermissionErrors: true,
- ignored: options.ignored,
- usePolling: options.poll ? true : undefined,
- interval: interval,
- binaryInterval: interval,
- disableGlobbing: true
- });
- this.watcher.on("add", this.onFileAdded.bind(this));
- this.watcher.on("addDir", this.onDirectoryAdded.bind(this));
- this.watcher.on("change", this.onChange.bind(this));
- this.watcher.on("unlink", this.onFileUnlinked.bind(this));
- this.watcher.on("unlinkDir", this.onDirectoryUnlinked.bind(this));
- this.watcher.on("error", this.onWatcherError.bind(this));
- this.initialScan = true;
- this.nestedWatching = false;
- this.initialScanRemoved = [];
- this.doInitialScan();
- this.watchers = Object.create(null);
- this.parentWatcher = null;
- this.refs = 0;
-}
-module.exports = DirectoryWatcher;
-
-DirectoryWatcher.prototype = Object.create(EventEmitter.prototype);
-DirectoryWatcher.prototype.constructor = DirectoryWatcher;
-
-DirectoryWatcher.prototype.setFileTime = function setFileTime(filePath, mtime, initial, type) {
- var now = Date.now();
- var old = this.files[filePath];
-
- this.files[filePath] = [initial ? Math.min(now, mtime) : now, mtime];
-
- // we add the fs accuracy to reach the maximum possible mtime
- if(mtime)
- mtime = mtime + FS_ACCURACY;
-
- if(!old) {
- if(mtime) {
- if(this.watchers[withoutCase(filePath)]) {
- this.watchers[withoutCase(filePath)].forEach(function(w) {
- if(!initial || w.checkStartTime(mtime, initial)) {
- w.emit("change", mtime, initial ? "initial" : type);
- }
- });
- }
- }
- } else if(!initial && mtime) {
- if(this.watchers[withoutCase(filePath)]) {
- this.watchers[withoutCase(filePath)].forEach(function(w) {
- w.emit("change", mtime, type);
- });
- }
- } else if(!initial && !mtime) {
- if(this.watchers[withoutCase(filePath)]) {
- this.watchers[withoutCase(filePath)].forEach(function(w) {
- w.emit("remove", type);
- });
- }
- }
- if(this.watchers[withoutCase(this.path)]) {
- this.watchers[withoutCase(this.path)].forEach(function(w) {
- if(!initial || w.checkStartTime(mtime, initial)) {
- w.emit("change", filePath, mtime, initial ? "initial" : type);
- }
- });
- }
-};
-
-DirectoryWatcher.prototype.setDirectory = function setDirectory(directoryPath, exist, initial, type) {
- if(directoryPath === this.path) {
- if(!initial && this.watchers[withoutCase(this.path)]) {
- this.watchers[withoutCase(this.path)].forEach(function(w) {
- w.emit("change", directoryPath, w.data, initial ? "initial" : type);
- });
- }
- } else {
- var old = this.directories[directoryPath];
- if(!old) {
- if(exist) {
- if(this.nestedWatching) {
- this.createNestedWatcher(directoryPath);
- } else {
- this.directories[directoryPath] = true;
- }
- if(!initial && this.watchers[withoutCase(this.path)]) {
- this.watchers[withoutCase(this.path)].forEach(function(w) {
- w.emit("change", directoryPath, w.data, initial ? "initial" : type);
- });
- }
- if(this.watchers[withoutCase(directoryPath) + "#directory"]) {
- this.watchers[withoutCase(directoryPath) + "#directory"].forEach(function(w) {
- w.emit("change", w.data, initial ? "initial" : type);
- });
- }
- }
- } else {
- if(!exist) {
- if(this.nestedWatching)
- this.directories[directoryPath].close();
- delete this.directories[directoryPath];
- if(!initial && this.watchers[withoutCase(this.path)]) {
- this.watchers[withoutCase(this.path)].forEach(function(w) {
- w.emit("change", directoryPath, w.data, initial ? "initial" : type);
- });
- }
- if(this.watchers[withoutCase(directoryPath) + "#directory"]) {
- this.watchers[withoutCase(directoryPath) + "#directory"].forEach(function(w) {
- w.emit("change", directoryPath, w.data, initial ? "initial" : type);
- });
- }
- }
- }
- }
-};
-
-DirectoryWatcher.prototype.createNestedWatcher = function(directoryPath) {
- this.directories[directoryPath] = watcherManager.watchDirectory(directoryPath, this.options, 1);
- this.directories[directoryPath].on("change", function(filePath, mtime, type) {
- if(this.watchers[withoutCase(this.path)]) {
- this.watchers[withoutCase(this.path)].forEach(function(w) {
- if(w.checkStartTime(mtime, false)) {
- w.emit("change", filePath, mtime, type);
- }
- });
- }
- }.bind(this));
-};
-
-DirectoryWatcher.prototype.setNestedWatching = function(flag) {
- if(this.nestedWatching !== !!flag) {
- this.nestedWatching = !!flag;
- if(this.nestedWatching) {
- Object.keys(this.directories).forEach(function(directory) {
- this.createNestedWatcher(directory);
- }, this);
- } else {
- Object.keys(this.directories).forEach(function(directory) {
- this.directories[directory].close();
- this.directories[directory] = true;
- }, this);
- }
- }
-};
-
-DirectoryWatcher.prototype.watch = function watch(filePath, startTime) {
- this.watchers[withoutCase(filePath)] = this.watchers[withoutCase(filePath)] || [];
- this.refs++;
- var watcher = new Watcher(this, filePath, startTime);
- watcher.on("closed", function() {
- var idx = this.watchers[withoutCase(filePath)].indexOf(watcher);
- this.watchers[withoutCase(filePath)].splice(idx, 1);
- if(this.watchers[withoutCase(filePath)].length === 0) {
- delete this.watchers[withoutCase(filePath)];
- if(this.path === filePath)
- this.setNestedWatching(false);
- }
- if(--this.refs <= 0)
- this.close();
- }.bind(this));
- this.watchers[withoutCase(filePath)].push(watcher);
- var data;
- if(filePath === this.path) {
- this.setNestedWatching(true);
- data = false;
- Object.keys(this.files).forEach(function(file) {
- var d = this.files[file];
- if(!data)
- data = d;
- else
- data = [Math.max(data[0], d[0]), Math.max(data[1], d[1])];
- }, this);
- } else {
- data = this.files[filePath];
- }
- process.nextTick(function() {
- if(data) {
- var ts = data[0] === data[1] ? data[0] + FS_ACCURACY : data[0];
- if(ts >= startTime)
- watcher.emit("change", data[1]);
- } else if(this.initialScan && this.initialScanRemoved.indexOf(filePath) >= 0) {
- watcher.emit("remove");
- }
- }.bind(this));
- return watcher;
-};
-
-DirectoryWatcher.prototype.onFileAdded = function onFileAdded(filePath, stat) {
- if(filePath.indexOf(this.path) !== 0) return;
- if(/[\\\/]/.test(filePath.substr(this.path.length + 1))) return;
-
- this.setFileTime(filePath, +stat.mtime || +stat.ctime || 1, false, "add");
-};
-
-DirectoryWatcher.prototype.onDirectoryAdded = function onDirectoryAdded(directoryPath /*, stat */) {
- if(directoryPath.indexOf(this.path) !== 0) return;
- if(/[\\\/]/.test(directoryPath.substr(this.path.length + 1))) return;
- this.setDirectory(directoryPath, true, false, "add");
-};
-
-DirectoryWatcher.prototype.onChange = function onChange(filePath, stat) {
- if(filePath.indexOf(this.path) !== 0) return;
- if(/[\\\/]/.test(filePath.substr(this.path.length + 1))) return;
- var mtime = +stat.mtime || +stat.ctime || 1;
- ensureFsAccuracy(mtime);
- this.setFileTime(filePath, mtime, false, "change");
-};
-
-DirectoryWatcher.prototype.onFileUnlinked = function onFileUnlinked(filePath) {
- if(filePath.indexOf(this.path) !== 0) return;
- if(/[\\\/]/.test(filePath.substr(this.path.length + 1))) return;
- this.setFileTime(filePath, null, false, "unlink");
- if(this.initialScan) {
- this.initialScanRemoved.push(filePath);
- }
-};
-
-DirectoryWatcher.prototype.onDirectoryUnlinked = function onDirectoryUnlinked(directoryPath) {
- if(directoryPath.indexOf(this.path) !== 0) return;
- if(/[\\\/]/.test(directoryPath.substr(this.path.length + 1))) return;
- this.setDirectory(directoryPath, false, false, "unlink");
- if(this.initialScan) {
- this.initialScanRemoved.push(directoryPath);
- }
-};
-
-DirectoryWatcher.prototype.onWatcherError = function onWatcherError(err) {
- console.warn("Error from chokidar (" + this.path + "): " + err);
-};
-
-DirectoryWatcher.prototype.doInitialScan = function doInitialScan() {
- fs.readdir(this.path, function(err, items) {
- if(err) {
- this.parentWatcher = watcherManager.watchFile(this.path + "#directory", this.options, 1);
- this.parentWatcher.on("change", function(mtime, type) {
- if(this.watchers[withoutCase(this.path)]) {
- this.watchers[withoutCase(this.path)].forEach(function(w) {
- w.emit("change", this.path, mtime, type);
- }, this);
- }
- }.bind(this));
- this.initialScan = false;
- return;
- }
- async.forEach(items, function(item, callback) {
- var itemPath = path.join(this.path, item);
- fs.stat(itemPath, function(err2, stat) {
- if(!this.initialScan) return;
- if(err2) {
- callback();
- return;
- }
- if(stat.isFile()) {
- if(!this.files[itemPath])
- this.setFileTime(itemPath, +stat.mtime || +stat.ctime || 1, true);
- } else if(stat.isDirectory()) {
- if(!this.directories[itemPath])
- this.setDirectory(itemPath, true, true);
- }
- callback();
- }.bind(this));
- }.bind(this), function() {
- this.initialScan = false;
- this.initialScanRemoved = null;
- }.bind(this));
- }.bind(this));
-};
-
-DirectoryWatcher.prototype.getTimes = function() {
- var obj = Object.create(null);
- var selfTime = 0;
- Object.keys(this.files).forEach(function(file) {
- var data = this.files[file];
- var time;
- if(data[1]) {
- time = Math.max(data[0], data[1] + FS_ACCURACY);
- } else {
- time = data[0];
- }
- obj[file] = time;
- if(time > selfTime)
- selfTime = time;
- }, this);
- if(this.nestedWatching) {
- Object.keys(this.directories).forEach(function(dir) {
- var w = this.directories[dir];
- var times = w.directoryWatcher.getTimes();
- Object.keys(times).forEach(function(file) {
- var time = times[file];
- obj[file] = time;
- if(time > selfTime)
- selfTime = time;
- });
- }, this);
- obj[this.path] = selfTime;
- }
- return obj;
-};
-
-DirectoryWatcher.prototype.close = function() {
- this.initialScan = false;
- 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();
- }, this);
- }
- if(this.parentWatcher) this.parentWatcher.close();
- this.emit("closed");
-};
-
-function ensureFsAccuracy(mtime) {
- if(!mtime) return;
- if(FS_ACCURACY > 1 && mtime % 1 !== 0)
- FS_ACCURACY = 1;
- else if(FS_ACCURACY > 10 && mtime % 10 !== 0)
- FS_ACCURACY = 10;
- else if(FS_ACCURACY > 100 && mtime % 100 !== 0)
- FS_ACCURACY = 100;
-}
diff --git a/node_modules/watchpack/lib/chokidar.js b/node_modules/watchpack/lib/chokidar.js
deleted file mode 100644
index fa65e26..0000000
--- a/node_modules/watchpack/lib/chokidar.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var v3Err;
-try {
- module.exports = require("chokidar");
- return;
-} catch(e) {
- v3Err = e;
-}
-
-var v2Err;
-try {
- module.exports = require("watchpack-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"
-)
diff --git a/node_modules/watchpack/lib/watcherManager.js b/node_modules/watchpack/lib/watcherManager.js
deleted file mode 100644
index 88a5f5e..0000000
--- a/node_modules/watchpack/lib/watcherManager.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-"use strict";
-
-var path = require("path");
-
-function WatcherManager() {
- this.directoryWatchers = {};
-}
-
-WatcherManager.prototype.getDirectoryWatcher = function(directory, options) {
- var DirectoryWatcher = require("./DirectoryWatcher");
- options = options || {};
- var key = directory + " " + JSON.stringify(options);
- if(!this.directoryWatchers[key]) {
- this.directoryWatchers[key] = new DirectoryWatcher(directory, options);
- this.directoryWatchers[key].on("closed", function() {
- delete this.directoryWatchers[key];
- }.bind(this));
- }
- return this.directoryWatchers[key];
-};
-
-WatcherManager.prototype.watchFile = function watchFile(p, options, startTime) {
- var directory = path.dirname(p);
- return this.getDirectoryWatcher(directory, options).watch(p, startTime);
-};
-
-WatcherManager.prototype.watchDirectory = function watchDirectory(directory, options, startTime) {
- return this.getDirectoryWatcher(directory, options).watch(directory, startTime);
-};
-
-module.exports = new WatcherManager();
diff --git a/node_modules/watchpack/lib/watchpack.js b/node_modules/watchpack/lib/watchpack.js
deleted file mode 100644
index cccbf02..0000000
--- a/node_modules/watchpack/lib/watchpack.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-"use strict";
-
-var watcherManager = require("./watcherManager");
-var EventEmitter = require("events").EventEmitter;
-
-function Watchpack(options) {
- EventEmitter.call(this);
- if(!options) options = {};
- if(!options.aggregateTimeout) options.aggregateTimeout = 200;
- this.options = options;
- this.watcherOptions = {
- ignored: options.ignored,
- poll: options.poll
- };
- this.fileWatchers = [];
- this.dirWatchers = [];
- this.mtimes = Object.create(null);
- this.paused = false;
- this.aggregatedChanges = [];
- this.aggregatedRemovals = [];
- this.aggregateTimeout = 0;
- this._onTimeout = this._onTimeout.bind(this);
-}
-
-module.exports = Watchpack;
-
-Watchpack.prototype = Object.create(EventEmitter.prototype);
-
-Watchpack.prototype.watch = function watch(files, directories, startTime) {
- this.paused = false;
- var oldFileWatchers = this.fileWatchers;
- var oldDirWatchers = this.dirWatchers;
- this.fileWatchers = files.map(function(file) {
- return this._fileWatcher(file, watcherManager.watchFile(file, this.watcherOptions, startTime));
- }, this);
- this.dirWatchers = directories.map(function(dir) {
- return this._dirWatcher(dir, watcherManager.watchDirectory(dir, this.watcherOptions, startTime));
- }, this);
- oldFileWatchers.forEach(function(w) {
- w.close();
- }, this);
- oldDirWatchers.forEach(function(w) {
- w.close();
- }, this);
-};
-
-Watchpack.prototype.close = function resume() {
- this.paused = true;
- if(this.aggregateTimeout)
- clearTimeout(this.aggregateTimeout);
- this.fileWatchers.forEach(function(w) {
- w.close();
- }, this);
- this.dirWatchers.forEach(function(w) {
- w.close();
- }, this);
- this.fileWatchers.length = 0;
- this.dirWatchers.length = 0;
-};
-
-Watchpack.prototype.pause = function pause() {
- this.paused = true;
- if(this.aggregateTimeout)
- clearTimeout(this.aggregateTimeout);
-};
-
-function addWatchersToArray(watchers, array) {
- watchers.forEach(function(w) {
- if(array.indexOf(w.directoryWatcher) < 0) {
- array.push(w.directoryWatcher);
- addWatchersToArray(Object.keys(w.directoryWatcher.directories).reduce(function(a, dir) {
- if(w.directoryWatcher.directories[dir] !== true)
- a.push(w.directoryWatcher.directories[dir]);
- return a;
- }, []), array);
- }
- });
-}
-
-Watchpack.prototype.getTimes = function() {
- var directoryWatchers = [];
- addWatchersToArray(this.fileWatchers.concat(this.dirWatchers), directoryWatchers);
- var obj = Object.create(null);
- directoryWatchers.forEach(function(w) {
- var times = w.getTimes();
- Object.keys(times).forEach(function(file) {
- obj[file] = times[file];
- });
- });
- return obj;
-};
-
-Watchpack.prototype._fileWatcher = function _fileWatcher(file, watcher) {
- watcher.on("change", function(mtime, type) {
- this._onChange(file, mtime, file, type);
- }.bind(this));
- watcher.on("remove", function(type) {
- this._onRemove(file, file, type);
- }.bind(this));
- return watcher;
-};
-
-Watchpack.prototype._dirWatcher = function _dirWatcher(item, watcher) {
- watcher.on("change", function(file, mtime, type) {
- this._onChange(item, mtime, file, type);
- }.bind(this));
- return watcher;
-};
-
-Watchpack.prototype._onChange = function _onChange(item, mtime, file) {
- file = file || item;
- this.mtimes[file] = mtime;
- if(this.paused) return;
- this.emit("change", file, mtime);
- if(this.aggregateTimeout)
- clearTimeout(this.aggregateTimeout);
- if(this.aggregatedChanges.indexOf(item) < 0)
- this.aggregatedChanges.push(item);
- this.aggregateTimeout = setTimeout(this._onTimeout, this.options.aggregateTimeout);
-};
-
-Watchpack.prototype._onRemove = function _onRemove(item, file) {
- file = file || item;
- delete this.mtimes[item];
- if(this.paused) return;
- this.emit("remove", item);
- if(this.aggregateTimeout)
- clearTimeout(this.aggregateTimeout);
- if(this.aggregatedRemovals.indexOf(item) < 0)
- this.aggregatedRemovals.push(item);
- this.aggregateTimeout = setTimeout(this._onTimeout, this.options.aggregateTimeout);
-};
-
-Watchpack.prototype._onTimeout = function _onTimeout() {
- this.aggregateTimeout = 0;
- var changes = this.aggregatedChanges;
- var removals = this.aggregatedRemovals;
- this.aggregatedChanges = [];
- this.aggregatedRemovals = [];
- this.emit("aggregated", changes, removals);
-};
diff --git a/node_modules/watchpack/node_modules/anymatch/LICENSE b/node_modules/watchpack/node_modules/anymatch/LICENSE
deleted file mode 100644
index 491766c..0000000
--- a/node_modules/watchpack/node_modules/anymatch/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/watchpack/node_modules/anymatch/README.md b/node_modules/watchpack/node_modules/anymatch/README.md
deleted file mode 100644
index 1dd67f5..0000000
--- a/node_modules/watchpack/node_modules/anymatch/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-anymatch [![Build Status](https://travis-ci.org/micromatch/anymatch.svg?branch=master)](https://travis-ci.org/micromatch/anymatch) [![Coverage Status](https://img.shields.io/coveralls/micromatch/anymatch.svg?branch=master)](https://coveralls.io/r/micromatch/anymatch?branch=master)
-======
-Javascript module to match a string against a regular expression, glob, string,
-or function that takes the string as an argument and returns a truthy or falsy
-value. The matcher can also be an array of any or all of these. Useful for
-allowing a very flexible user-defined config to define things like file paths.
-
-__Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.__
-
-
-Usage
------
-```sh
-npm install anymatch
-```
-
-#### anymatch(matchers, testString, [returnIndex], [options])
-* __matchers__: (_Array|String|RegExp|Function_)
-String to be directly matched, string with glob patterns, regular expression
-test, function that takes the testString as an argument and returns a truthy
-value if it should be matched, or an array of any number and mix of these types.
-* __testString__: (_String|Array_) The string to test against the matchers. If
-passed as an array, the first element of the array will be used as the
-`testString` for non-function matchers, while the entire array will be applied
-as the arguments for function matchers.
-* __options__: (_Object_ [optional]_) Any of the [picomatch](https://github.com/micromatch/picomatch#options) options.
- * __returnIndex__: (_Boolean [optional]_) If true, return the array index of
-the first matcher that that testString matched, or -1 if no match, instead of a
-boolean result.
-
-```js
-const anymatch = require('anymatch');
-
-const matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', /foo.js$/, string => string.includes('bar') && string.length > 10 ] ;
-
-anymatch(matchers, 'path/to/file.js'); // true
-anymatch(matchers, 'path/anyjs/baz.js'); // true
-anymatch(matchers, 'path/to/foo.js'); // true
-anymatch(matchers, 'path/to/bar.js'); // true
-anymatch(matchers, 'bar.js'); // false
-
-// returnIndex = true
-anymatch(matchers, 'foo.js', {returnIndex: true}); // 2
-anymatch(matchers, 'path/anyjs/foo.js', {returnIndex: true}); // 1
-
-// any picomatc
-
-// using globs to match directories and their children
-anymatch('node_modules', 'node_modules'); // true
-anymatch('node_modules', 'node_modules/somelib/index.js'); // false
-anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true
-anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false
-anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
-
-const matcher = anymatch(matchers);
-['foo.js', 'bar.js'].filter(matcher); // [ 'foo.js' ]
-anymatch master* ❯
-
-```
-
-#### anymatch(matchers)
-You can also pass in only your matcher(s) to get a curried function that has
-already been bound to the provided matching criteria. This can be used as an
-`Array#filter` callback.
-
-```js
-var matcher = anymatch(matchers);
-
-matcher('path/to/file.js'); // true
-matcher('path/anyjs/baz.js', true); // 1
-
-['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
-```
-
-Changelog
-----------
-[See release notes page on GitHub](https://github.com/micromatch/anymatch/releases)
-
-- **v3.0:** Removed `startIndex` and `endIndex` arguments. Node 8.x-only.
-- **v2.0:** [micromatch](https://github.com/jonschlinkert/micromatch) moves away from minimatch-parity and inline with Bash. This includes handling backslashes differently (see https://github.com/micromatch/micromatch#backslashes for more information).
-- **v1.2:** anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch)
-for glob pattern matching. Issues with glob pattern matching should be
-reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues).
-
-License
--------
-[ISC](https://raw.github.com/micromatch/anymatch/master/LICENSE)
diff --git a/node_modules/watchpack/node_modules/anymatch/index.d.ts b/node_modules/watchpack/node_modules/anymatch/index.d.ts
deleted file mode 100644
index 196d061..0000000
--- a/node_modules/watchpack/node_modules/anymatch/index.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-type AnymatchFn = (testString: string) => boolean;
-type AnymatchPattern = string|RegExp|AnymatchFn;
-type AnymatchMatcher = AnymatchPattern|AnymatchPattern[]
-type AnymatchTester = {
- (testString: string|any[], returnIndex: true): number;
- (testString: string|any[]): boolean;
-}
-
-type PicomatchOptions = {dot: boolean};
-
-declare const anymatch: {
- (matchers: AnymatchMatcher): AnymatchTester;
- (matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number;
- (matchers: AnymatchMatcher, testString: string|any[]): boolean;
-}
-
-export {AnymatchMatcher as Matcher}
-export {AnymatchTester as Tester}
-export default anymatch
diff --git a/node_modules/watchpack/node_modules/anymatch/index.js b/node_modules/watchpack/node_modules/anymatch/index.js
deleted file mode 100644
index 24529c8..0000000
--- a/node_modules/watchpack/node_modules/anymatch/index.js
+++ /dev/null
@@ -1,102 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, "__esModule", { value: true });
-
-const picomatch = require('picomatch');
-const normalizePath = require('normalize-path');
-
-/**
- * @typedef {(testString: string) => boolean} AnymatchFn
- * @typedef {string|RegExp|AnymatchFn} AnymatchPattern
- * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher
- */
-const BANG = '!';
-const DEFAULT_OPTIONS = {returnIndex: false};
-const arrify = (item) => Array.isArray(item) ? item : [item];
-
-/**
- * @param {AnymatchPattern} matcher
- * @param {object} options
- * @returns {AnymatchFn}
- */
-const createPattern = (matcher, options) => {
- if (typeof matcher === 'function') {
- return matcher;
- }
- if (typeof matcher === 'string') {
- const glob = picomatch(matcher, options);
- return (string) => matcher === string || glob(string);
- }
- if (matcher instanceof RegExp) {
- return (string) => matcher.test(string);
- }
- return (string) => false;
-};
-
-/**
- * @param {Array<Function>} patterns
- * @param {Array<Function>} negPatterns
- * @param {String|Array} args
- * @param {Boolean} returnIndex
- * @returns {boolean|number}
- */
-const matchPatterns = (patterns, negPatterns, args, returnIndex) => {
- const isList = Array.isArray(args);
- const _path = isList ? args[0] : args;
- if (!isList && typeof _path !== 'string') {
- throw new TypeError('anymatch: second argument must be a string: got ' +
- Object.prototype.toString.call(_path))
- }
- const path = normalizePath(_path);
-
- for (let index = 0; index < negPatterns.length; index++) {
- const nglob = negPatterns[index];
- if (nglob(path)) {
- return returnIndex ? -1 : false;
- }
- }
-
- const applied = isList && [path].concat(args.slice(1));
- for (let index = 0; index < patterns.length; index++) {
- const pattern = patterns[index];
- if (isList ? pattern(...applied) : pattern(path)) {
- return returnIndex ? index : true;
- }
- }
-
- return returnIndex ? -1 : false;
-};
-
-/**
- * @param {AnymatchMatcher} matchers
- * @param {Array|string} testString
- * @param {object} options
- * @returns {boolean|number|Function}
- */
-const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
- if (matchers == null) {
- throw new TypeError('anymatch: specify first argument');
- }
- const opts = typeof options === 'boolean' ? {returnIndex: options} : options;
- const returnIndex = opts.returnIndex || false;
-
- // Early cache for matchers.
- const mtchers = arrify(matchers);
- const negatedGlobs = mtchers
- .filter(item => typeof item === 'string' && item.charAt(0) === BANG)
- .map(item => item.slice(1))
- .map(item => picomatch(item, opts));
- const patterns = mtchers.map(matcher => createPattern(matcher, opts));
-
- if (testString == null) {
- return (testString, ri = false) => {
- const returnIndex = typeof ri === 'boolean' ? ri : false;
- return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
- }
- }
-
- return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
-};
-
-anymatch.default = anymatch;
-module.exports = anymatch;
diff --git a/node_modules/watchpack/node_modules/anymatch/package.json b/node_modules/watchpack/node_modules/anymatch/package.json
deleted file mode 100644
index e86d722..0000000
--- a/node_modules/watchpack/node_modules/anymatch/package.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "_from": "anymatch@~3.1.1",
- "_id": "anymatch@3.1.1",
- "_inBundle": false,
- "_integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==",
- "_location": "/watchpack/anymatch",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "anymatch@~3.1.1",
- "name": "anymatch",
- "escapedName": "anymatch",
- "rawSpec": "~3.1.1",
- "saveSpec": null,
- "fetchSpec": "~3.1.1"
- },
- "_requiredBy": [
- "/watchpack/chokidar"
- ],
- "_resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
- "_shasum": "c55ecf02185e2469259399310c173ce31233b142",
- "_spec": "anymatch@~3.1.1",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/watchpack/node_modules/chokidar",
- "author": {
- "name": "Elan Shanker",
- "url": "https://github.com/es128"
- },
- "bugs": {
- "url": "https://github.com/micromatch/anymatch/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "normalize-path": "^3.0.0",
- "picomatch": "^2.0.4"
- },
- "deprecated": false,
- "description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
- "devDependencies": {
- "mocha": "^6.1.3",
- "nyc": "^14.0.0"
- },
- "engines": {
- "node": ">= 8"
- },
- "files": [
- "index.js",
- "index.d.ts"
- ],
- "homepage": "https://github.com/micromatch/anymatch",
- "keywords": [
- "match",
- "any",
- "string",
- "file",
- "fs",
- "list",
- "glob",
- "regex",
- "regexp",
- "regular",
- "expression",
- "function"
- ],
- "license": "ISC",
- "name": "anymatch",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/micromatch/anymatch.git"
- },
- "scripts": {
- "mocha": "mocha",
- "test": "nyc mocha"
- },
- "version": "3.1.1"
-}
diff --git a/node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json b/node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json
deleted file mode 100644
index b33eac3..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json
+++ /dev/null
@@ -1,256 +0,0 @@
-[
- "3dm",
- "3ds",
- "3g2",
- "3gp",
- "7z",
- "a",
- "aac",
- "adp",
- "ai",
- "aif",
- "aiff",
- "alz",
- "ape",
- "apk",
- "appimage",
- "ar",
- "arj",
- "asf",
- "au",
- "avi",
- "bak",
- "baml",
- "bh",
- "bin",
- "bk",
- "bmp",
- "btif",
- "bz2",
- "bzip2",
- "cab",
- "caf",
- "cgm",
- "class",
- "cmx",
- "cpio",
- "cr2",
- "cur",
- "dat",
- "dcm",
- "deb",
- "dex",
- "djvu",
- "dll",
- "dmg",
- "dng",
- "doc",
- "docm",
- "docx",
- "dot",
- "dotm",
- "dra",
- "DS_Store",
- "dsk",
- "dts",
- "dtshd",
- "dvb",
- "dwg",
- "dxf",
- "ecelp4800",
- "ecelp7470",
- "ecelp9600",
- "egg",
- "eol",
- "eot",
- "epub",
- "exe",
- "f4v",
- "fbs",
- "fh",
- "fla",
- "flac",
- "flatpak",
- "fli",
- "flv",
- "fpx",
- "fst",
- "fvt",
- "g3",
- "gh",
- "gif",
- "graffle",
- "gz",
- "gzip",
- "h261",
- "h263",
- "h264",
- "icns",
- "ico",
- "ief",
- "img",
- "ipa",
- "iso",
- "jar",
- "jpeg",
- "jpg",
- "jpgv",
- "jpm",
- "jxr",
- "key",
- "ktx",
- "lha",
- "lib",
- "lvp",
- "lz",
- "lzh",
- "lzma",
- "lzo",
- "m3u",
- "m4a",
- "m4v",
- "mar",
- "mdi",
- "mht",
- "mid",
- "midi",
- "mj2",
- "mka",
- "mkv",
- "mmr",
- "mng",
- "mobi",
- "mov",
- "movie",
- "mp3",
- "mp4",
- "mp4a",
- "mpeg",
- "mpg",
- "mpga",
- "mxu",
- "nef",
- "npx",
- "numbers",
- "nupkg",
- "o",
- "oga",
- "ogg",
- "ogv",
- "otf",
- "pages",
- "pbm",
- "pcx",
- "pdb",
- "pdf",
- "pea",
- "pgm",
- "pic",
- "png",
- "pnm",
- "pot",
- "potm",
- "potx",
- "ppa",
- "ppam",
- "ppm",
- "pps",
- "ppsm",
- "ppsx",
- "ppt",
- "pptm",
- "pptx",
- "psd",
- "pya",
- "pyc",
- "pyo",
- "pyv",
- "qt",
- "rar",
- "ras",
- "raw",
- "resources",
- "rgb",
- "rip",
- "rlc",
- "rmf",
- "rmvb",
- "rpm",
- "rtf",
- "rz",
- "s3m",
- "s7z",
- "scpt",
- "sgi",
- "shar",
- "snap",
- "sil",
- "sketch",
- "slk",
- "smv",
- "snk",
- "so",
- "stl",
- "suo",
- "sub",
- "swf",
- "tar",
- "tbz",
- "tbz2",
- "tga",
- "tgz",
- "thmx",
- "tif",
- "tiff",
- "tlz",
- "ttc",
- "ttf",
- "txz",
- "udf",
- "uvh",
- "uvi",
- "uvm",
- "uvp",
- "uvs",
- "uvu",
- "viv",
- "vob",
- "war",
- "wav",
- "wax",
- "wbmp",
- "wdp",
- "weba",
- "webm",
- "webp",
- "whl",
- "wim",
- "wm",
- "wma",
- "wmv",
- "wmx",
- "woff",
- "woff2",
- "wrm",
- "wvx",
- "xbm",
- "xif",
- "xla",
- "xlam",
- "xls",
- "xlsb",
- "xlsm",
- "xlsx",
- "xlt",
- "xltm",
- "xltx",
- "xm",
- "xmind",
- "xpi",
- "xpm",
- "xwd",
- "xz",
- "z",
- "zip",
- "zipx"
-]
diff --git a/node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json.d.ts b/node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json.d.ts
deleted file mode 100644
index 94a248c..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/binary-extensions.json.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-declare const binaryExtensionsJson: readonly string[];
-
-export = binaryExtensionsJson;
diff --git a/node_modules/watchpack/node_modules/binary-extensions/index.d.ts b/node_modules/watchpack/node_modules/binary-extensions/index.d.ts
deleted file mode 100644
index f469ac5..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
-List of binary file extensions.
-
-@example
-```
-import binaryExtensions = require('binary-extensions');
-
-console.log(binaryExtensions);
-//=> ['3ds', '3g2', …]
-```
-*/
-declare const binaryExtensions: readonly string[];
-
-export = binaryExtensions;
diff --git a/node_modules/watchpack/node_modules/binary-extensions/index.js b/node_modules/watchpack/node_modules/binary-extensions/index.js
deleted file mode 100644
index d46e468..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./binary-extensions.json');
diff --git a/node_modules/watchpack/node_modules/binary-extensions/license b/node_modules/watchpack/node_modules/binary-extensions/license
deleted file mode 100644
index 401b1c7..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/watchpack/node_modules/binary-extensions/package.json b/node_modules/watchpack/node_modules/binary-extensions/package.json
deleted file mode 100644
index b7ccbc1..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/package.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "_from": "binary-extensions@^2.0.0",
- "_id": "binary-extensions@2.1.0",
- "_inBundle": false,
- "_integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
- "_location": "/watchpack/binary-extensions",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "binary-extensions@^2.0.0",
- "name": "binary-extensions",
- "escapedName": "binary-extensions",
- "rawSpec": "^2.0.0",
- "saveSpec": null,
- "fetchSpec": "^2.0.0"
- },
- "_requiredBy": [
- "/watchpack/is-binary-path"
- ],
- "_resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz",
- "_shasum": "30fa40c9e7fe07dbc895678cd287024dea241dd9",
- "_spec": "binary-extensions@^2.0.0",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/watchpack/node_modules/is-binary-path",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "bugs": {
- "url": "https://github.com/sindresorhus/binary-extensions/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "List of binary file extensions",
- "devDependencies": {
- "ava": "^1.4.1",
- "tsd": "^0.7.2",
- "xo": "^0.24.0"
- },
- "engines": {
- "node": ">=8"
- },
- "files": [
- "index.js",
- "index.d.ts",
- "binary-extensions.json",
- "binary-extensions.json.d.ts"
- ],
- "homepage": "https://github.com/sindresorhus/binary-extensions#readme",
- "keywords": [
- "binary",
- "extensions",
- "extension",
- "file",
- "json",
- "list",
- "array"
- ],
- "license": "MIT",
- "name": "binary-extensions",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sindresorhus/binary-extensions.git"
- },
- "scripts": {
- "test": "xo && ava && tsd"
- },
- "version": "2.1.0"
-}
diff --git a/node_modules/watchpack/node_modules/binary-extensions/readme.md b/node_modules/watchpack/node_modules/binary-extensions/readme.md
deleted file mode 100644
index 344c52c..0000000
--- a/node_modules/watchpack/node_modules/binary-extensions/readme.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# binary-extensions [![Build Status](https://travis-ci.org/sindresorhus/binary-extensions.svg?branch=master)](https://travis-ci.org/sindresorhus/binary-extensions)
-
-> List of binary file extensions
-
-The list is just a [JSON file](binary-extensions.json) and can be used anywhere.
-
-
-## Install
-
-```
-$ npm install binary-extensions
-```
-
-
-## Usage
-
-```js
-const binaryExtensions = require('binary-extensions');
-
-console.log(binaryExtensions);
-//=> ['3ds', '3g2', …]
-```
-
-
-## Related
-
-- [is-binary-path](https://github.com/sindresorhus/is-binary-path) - Check if a filepath is a binary file
-- [text-extensions](https://github.com/sindresorhus/text-extensions) - List of text file extensions
-
-
----
-
-<div align="center">
- <b>
- <a href="https://tidelift.com/subscription/pkg/npm-binary-extensions?utm_source=npm-binary-extensions&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
- </b>
- <br>
- <sub>
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
- </sub>
-</div>
diff --git a/node_modules/watchpack/node_modules/chokidar/LICENSE b/node_modules/watchpack/node_modules/chokidar/LICENSE
deleted file mode 100644
index fa9162b..0000000
--- a/node_modules/watchpack/node_modules/chokidar/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the “Software”), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/watchpack/node_modules/chokidar/README.md b/node_modules/watchpack/node_modules/chokidar/README.md
deleted file mode 100644
index 1ad775f..0000000
--- a/node_modules/watchpack/node_modules/chokidar/README.md
+++ /dev/null
@@ -1,306 +0,0 @@
-# Chokidar [![Weekly downloads](https://img.shields.io/npm/dw/chokidar.svg)](https://github.com/paulmillr/chokidar) [![Yearly downloads](https://img.shields.io/npm/dy/chokidar.svg)](https://github.com/paulmillr/chokidar)
-
-> A neat wrapper around Node.js fs.watch / fs.watchFile / FSEvents.
-
-[![NPM](https://nodei.co/npm/chokidar.png)](https://www.npmjs.com/package/chokidar)
-
-Version 3 is out! Check out our blog post about it: [Chokidar 3: How to save 32TB of traffic every week](https://paulmillr.com/posts/chokidar-3-save-32tb-of-traffic/)
-
-## Why?
-
-Node.js `fs.watch`:
-
-* Doesn't report filenames on MacOS.
-* Doesn't report events at all when using editors like Sublime on MacOS.
-* Often reports events twice.
-* Emits most changes as `rename`.
-* Does not provide an easy way to recursively watch file trees.
-
-Node.js `fs.watchFile`:
-
-* Almost as bad at event handling.
-* Also does not provide any recursive watching.
-* Results in high CPU utilization.
-
-Chokidar resolves these problems.
-
-Initially made for **[Brunch](https://brunch.io/)** (an ultra-swift web app build tool), it is now used in
-[Microsoft's Visual Studio Code](https://github.com/microsoft/vscode),
-[gulp](https://github.com/gulpjs/gulp/),
-[karma](https://karma-runner.github.io/),
-[PM2](https://github.com/Unitech/PM2),
-[browserify](http://browserify.org/),
-[webpack](https://webpack.github.io/),
-[BrowserSync](https://www.browsersync.io/),
-and [many others](https://www.npmjs.com/browse/depended/chokidar).
-It has proven itself in production environments.
-
-## How?
-
-Chokidar does still rely on the Node.js core `fs` module, but when using
-`fs.watch` and `fs.watchFile` for watching, it normalizes the events it
-receives, often checking for truth by getting file stats and/or dir contents.
-
-On MacOS, chokidar by default uses a native extension exposing the Darwin
-`FSEvents` API. This provides very efficient recursive watching compared with
-implementations like `kqueue` available on most \*nix platforms. Chokidar still
-does have to do some work to normalize the events received that way as well.
-
-On other platforms, the `fs.watch`-based implementation is the default, which
-avoids polling and keeps CPU usage down. Be advised that chokidar will initiate
-watchers recursively for everything within scope of the paths that have been
-specified, so be judicious about not wasting system resources by watching much
-more than needed.
-
-## Getting started
-
-Install with npm:
-
-```sh
-npm install chokidar
-```
-
-Then `require` and use it in your code:
-
-```javascript
-const chokidar = require('chokidar');
-
-// One-liner for current directory
-chokidar.watch('.').on('all', (event, path) => {
- console.log(event, path);
-});
-```
-
-## API
-
-```javascript
-// Example of a more typical implementation structure:
-
-// Initialize watcher.
-const watcher = chokidar.watch('file, dir, glob, or array', {
- ignored: /(^|[\/\\])\../, // ignore dotfiles
- persistent: true
-});
-
-// Something to use when events are received.
-const log = console.log.bind(console);
-// Add event listeners.
-watcher
- .on('add', path => log(`File ${path} has been added`))
- .on('change', path => log(`File ${path} has been changed`))
- .on('unlink', path => log(`File ${path} has been removed`));
-
-// More possible events.
-watcher
- .on('addDir', path => log(`Directory ${path} has been added`))
- .on('unlinkDir', path => log(`Directory ${path} has been removed`))
- .on('error', error => log(`Watcher error: ${error}`))
- .on('ready', () => log('Initial scan complete. Ready for changes'))
- .on('raw', (event, path, details) => { // internal
- log('Raw event info:', event, path, details);
- });
-
-// 'add', 'addDir' and 'change' events also receive stat() results as second
-// argument when available: https://nodejs.org/api/fs.html#fs_class_fs_stats
-watcher.on('change', (path, stats) => {
- if (stats) console.log(`File ${path} changed size to ${stats.size}`);
-});
-
-// Watch new files.
-watcher.add('new-file');
-watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);
-
-// Get list of actual paths being watched on the filesystem
-var watchedPaths = watcher.getWatched();
-
-// Un-watch some files.
-await watcher.unwatch('new-file*');
-
-// Stop watching.
-// The method is async!
-watcher.close().then(() => console.log('closed'));
-
-// Full list of options. See below for descriptions.
-// Do not use this example!
-chokidar.watch('file', {
- persistent: true,
-
- ignored: '*.txt',
- ignoreInitial: false,
- followSymlinks: true,
- cwd: '.',
- disableGlobbing: false,
-
- usePolling: false,
- interval: 100,
- binaryInterval: 300,
- alwaysStat: false,
- depth: 99,
- awaitWriteFinish: {
- stabilityThreshold: 2000,
- pollInterval: 100
- },
-
- ignorePermissionErrors: false,
- atomic: true // or a custom 'atomicity delay', in milliseconds (default 100)
-});
-
-```
-
-`chokidar.watch(paths, [options])`
-
-* `paths` (string or array of strings). Paths to files, dirs to be watched
-recursively, or glob patterns.
- - Note: globs must not contain windows separators (`\`),
- because that's how they work by the standard —
- you'll need to replace them with forward slashes (`/`).
- - Note 2: for additional glob documentation, check out low-level
- library: [picomatch](https://github.com/micromatch/picomatch).
-* `options` (object) Options object as defined below:
-
-#### Persistence
-
-* `persistent` (default: `true`). Indicates whether the process
-should continue to run as long as files are being watched. If set to
-`false` when using `fsevents` to watch, no more events will be emitted
-after `ready`, even if the process continues to run.
-
-#### Path filtering
-
-* `ignored` ([anymatch](https://github.com/es128/anymatch)-compatible definition)
-Defines files/paths to be ignored. The whole relative or absolute path is
-tested, not just filename. If a function with two arguments is provided, it
-gets called twice per path - once with a single argument (the path), second
-time with two arguments (the path and the
-[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)
-object of that path).
-* `ignoreInitial` (default: `false`). If set to `false` then `add`/`addDir` events are also emitted for matching paths while
-instantiating the watching as chokidar discovers these file paths (before the `ready` event).
-* `followSymlinks` (default: `true`). When `false`, only the
-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
-
-* `usePolling` (default: `false`).
-Whether to use fs.watchFile (backed by polling), or fs.watch. If polling
-leads to high CPU utilization, consider setting this to `false`. It is
-typically necessary to **set this to `true` to successfully watch files over
-a network**, and it may be necessary to successfully watch files in other
-non-standard situations. Setting to `true` explicitly on MacOS 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, in milliseconds. 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))
-* `useFsEvents` (default: `true` on MacOS). Whether to use the
-`fsevents` watching interface if available. When set to `true` explicitly
-and `fsevents` is available this supercedes the `usePolling` setting. When
-set to `false` on MacOS, `usePolling: true` becomes the default.
-* `alwaysStat` (default: `false`). If relying upon the
-[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)
-object that may get passed with `add`, `addDir`, and `change` events, set
-this to `true` to ensure it is provided even in cases where it wasn't
-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 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
-write operation to finish before responding to a file creation or modification.
-Setting `awaitWriteFinish` to `true` (or a truthy value) will poll file size,
-holding its `add` and `change` events until the size does not change for a
-configurable amount of time. The appropriate duration setting is heavily
-dependent on the OS and hardware. For accurate detection this parameter should
-be relatively high, making file watching much less responsive.
-Use with caution.
- * *`options.awaitWriteFinish` can be set to an object in order to adjust
- timing params:*
- * `awaitWriteFinish.stabilityThreshold` (default: 2000). Amount of time in
- milliseconds for a file size to remain constant before emitting its event.
- * `awaitWriteFinish.pollInterval` (default: 100). File size polling interval, in milliseconds.
-
-#### Errors
-
-* `ignorePermissionErrors` (default: `false`). Indicates whether to watch files
-that don't have read permissions if possible. If watching fails due to `EPERM`
-or `EACCES` with this set to `true`, the errors will be suppressed silently.
-* `atomic` (default: `true` if `useFsEvents` and `usePolling` are `false`).
-Automatically filters out artifacts that occur when using editors that use
-"atomic writes" instead of writing directly to the source file. If a file is
-re-added within 100 ms of being deleted, Chokidar emits a `change` event
-rather than `unlink` then `add`. If the default of 100 ms does not work well
-for you, you can override it by setting `atomic` to a custom value, in
-milliseconds.
-
-### Methods & Events
-
-`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:
-
-* `.add(path / paths)`: Add files, directories, or glob patterns for tracking.
-Takes an array of strings or just one string.
-* `.on(event, callback)`: Listen for an FS event.
-Available events: `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `ready`,
-`raw`, `error`.
-Additionally `all` is available which gets emitted with the underlying event
-name and path for every event other than `ready`, `raw`, and `error`. `raw` is internal, use it carefully.
-* `.unwatch(path / paths)`: Stop watching files, directories, or glob patterns.
-Takes an array of strings or just one string. Use with `await` to ensure bugs don't happen.
-* `.close()`: **async** Removes all listeners from watched files. Asynchronous, returns Promise.
-* `.getWatched()`: Returns an object representing all the paths on the file
-system being watched by this `FSWatcher` instance. The object's keys are all the
-directories (using absolute paths unless the `cwd` option was used), and the
-values are arrays of the names of the items contained in each directory.
-
-## CLI
-
-If you need a CLI interface for your file watching, check out
-[chokidar-cli](https://github.com/kimmobrunfeldt/chokidar-cli), allowing you to
-execute a command on each change, or get a stdio stream of change events.
-
-## Install Troubleshooting
-
-* `npm WARN optional dep failed, continuing fsevents@n.n.n`
- * This message is normal part of how `npm` handles optional dependencies and is
- not indicative of a problem. Even if accompanied by other related error messages,
- Chokidar should function properly.
-
-* `TypeError: fsevents is not a constructor`
- * Update chokidar by doing `rm -rf node_modules package-lock.json yarn.lock && npm install`, or update your dependency that uses chokidar.
-
-* Chokidar is producing `ENOSP` error on Linux, like this:
- * `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell`
- `Error: watch /home/ ENOSPC`
- * This means Chokidar ran out of file handles and you'll need to increase their count by executing the following command in Terminal:
- `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
-
-## Changelog
-
-For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md).
-- **v3.4 (Apr 26, 2020):** Support for directory-based symlinks. Macos file replacement fixes.
-- **v3.3 (Nov 2, 2019):** `FSWatcher#close()` method became async. That fixes IO race conditions related to close method.
-- **v3.2 (Oct 1, 2019):** Improve Linux RAM usage by 50%. Race condition fixes. Windows glob fixes. Improve stability by using tight range of dependency versions.
-- **v3.1 (Sep 16, 2019):** dotfiles are no longer filtered out by default. Use `ignored` option if needed. Improve initial Linux scan time by 50%.
-- **v3 (Apr 30, 2019):** massive CPU & RAM consumption improvements; reduces deps / package size by a factor of 17x and bumps Node.js requirement to v8.16 and higher.
-- **v2 (Dec 29, 2017):** Globs are now posix-style-only; without windows support. Tons of bugfixes.
-- **v1 (Apr 7, 2015):** Glob support, symlink support, tons of bugfixes. Node 0.8+ is supported
-- **v0.1 (Apr 20, 2012):** Initial release, extracted from [Brunch](https://github.com/brunch/brunch/blob/9847a065aea300da99bd0753f90354cde9de1261/src/helpers.coffee#L66)
-
-## Also
-
-Why was chokidar named this way? What's the meaning behind it?
-
->Chowkidar is a transliteration of a Hindi word meaning 'watchman, gatekeeper', चौकीदार. This ultimately comes from Sanskrit _ चतुष्क_ (crossway, quadrangle, consisting-of-four).
-
-## License
-
-MIT (c) Paul Miller (<https://paulmillr.com>), see [LICENSE](LICENSE) file.
diff --git a/node_modules/watchpack/node_modules/chokidar/index.js b/node_modules/watchpack/node_modules/chokidar/index.js
deleted file mode 100644
index 71259c0..0000000
--- a/node_modules/watchpack/node_modules/chokidar/index.js
+++ /dev/null
@@ -1,958 +0,0 @@
-'use strict';
-
-const { EventEmitter } = require('events');
-const fs = require('fs');
-const sysPath = require('path');
-const { promisify } = require('util');
-const readdirp = require('readdirp');
-const anymatch = require('anymatch').default;
-const globParent = require('glob-parent');
-const isGlob = require('is-glob');
-const braces = require('braces');
-const normalizePath = require('normalize-path');
-
-const NodeFsHandler = require('./lib/nodefs-handler');
-const FsEventsHandler = require('./lib/fsevents-handler');
-const {
- EV_ALL,
- EV_READY,
- EV_ADD,
- EV_CHANGE,
- EV_UNLINK,
- EV_ADD_DIR,
- EV_UNLINK_DIR,
- EV_RAW,
- EV_ERROR,
-
- STR_CLOSE,
- STR_END,
-
- BACK_SLASH_RE,
- DOUBLE_SLASH_RE,
- SLASH_OR_BACK_SLASH_RE,
- DOT_RE,
- REPLACER_RE,
-
- SLASH,
- SLASH_SLASH,
- BRACE_START,
- BANG,
- ONE_DOT,
- TWO_DOTS,
- GLOBSTAR,
- SLASH_GLOBSTAR,
- ANYMATCH_OPTS,
- STRING_TYPE,
- FUNCTION_TYPE,
- EMPTY_STR,
- EMPTY_FN,
-
- isWindows,
- isMacos
-} = require('./lib/constants');
-
-const stat = promisify(fs.stat);
-const readdir = promisify(fs.readdir);
-
-/**
- * @typedef {String} Path
- * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName
- * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType
- */
-
-/**
- *
- * @typedef {Object} WatchHelpers
- * @property {Boolean} followSymlinks
- * @property {'stat'|'lstat'} statMethod
- * @property {Path} path
- * @property {Path} watchPath
- * @property {Function} entryPath
- * @property {Boolean} hasGlob
- * @property {Object} globFilter
- * @property {Function} filterPath
- * @property {Function} filterDir
- */
-
-const arrify = (value = []) => Array.isArray(value) ? value : [value];
-const flatten = (list, result = []) => {
- list.forEach(item => {
- if (Array.isArray(item)) {
- flatten(item, result);
- } else {
- result.push(item);
- }
- });
- return result;
-};
-
-const unifyPaths = (paths_) => {
- /**
- * @type {Array<String>}
- */
- const paths = flatten(arrify(paths_));
- if (!paths.every(p => typeof p === STRING_TYPE)) {
- throw new TypeError(`Non-string provided as watch path: ${paths}`);
- }
- return paths.map(normalizePathToUnix);
-};
-
-// If SLASH_SLASH occurs at the beginning of path, it is not replaced
-// because "//StoragePC/DrivePool/Movies" is a valid network path
-const toUnix = (string) => {
- let str = string.replace(BACK_SLASH_RE, SLASH);
- let prepend = false;
- if (str.startsWith(SLASH_SLASH)) {
- prepend = true;
- }
- while (str.match(DOUBLE_SLASH_RE)) {
- str = str.replace(DOUBLE_SLASH_RE, SLASH);
- }
- if (prepend) {
- str = SLASH + str;
- }
- return str;
-};
-
-// Our version of upath.normalize
-// TODO: this is not equal to path-normalize module - investigate why
-const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
-
-const normalizeIgnored = (cwd = EMPTY_STR) => (path) => {
- if (typeof path !== STRING_TYPE) return path;
- return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
-};
-
-const getAbsolutePath = (path, cwd) => {
- if (sysPath.isAbsolute(path)) {
- return path;
- }
- if (path.startsWith(BANG)) {
- return BANG + sysPath.join(cwd, path.slice(1));
- }
- return sysPath.join(cwd, path);
-};
-
-const undef = (opts, key) => opts[key] === undefined;
-
-/**
- * Directory entry.
- * @property {Path} path
- * @property {Set<Path>} items
- */
-class DirEntry {
- /**
- * @param {Path} dir
- * @param {Function} removeWatcher
- */
- constructor(dir, removeWatcher) {
- this.path = dir;
- this._removeWatcher = removeWatcher;
- /** @type {Set<Path>} */
- this.items = new Set();
- }
-
- add(item) {
- const {items} = this;
- if (!items) return;
- if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
- }
-
- async remove(item) {
- const {items} = this;
- if (!items) return;
- items.delete(item);
- if (items.size > 0) return;
-
- const dir = this.path;
- try {
- await readdir(dir);
- } catch (err) {
- if (this._removeWatcher) {
- this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
- }
- }
- }
-
- has(item) {
- const {items} = this;
- if (!items) return;
- return items.has(item);
- }
-
- /**
- * @returns {Array<String>}
- */
- getChildren() {
- const {items} = this;
- if (!items) return;
- return [...items.values()];
- }
-
- dispose() {
- this.items.clear();
- delete this.path;
- delete this._removeWatcher;
- delete this.items;
- Object.freeze(this);
- }
-}
-
-const STAT_METHOD_F = 'stat';
-const STAT_METHOD_L = 'lstat';
-class WatchHelper {
- constructor(path, watchPath, follow, fsw) {
- this.fsw = fsw;
- this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
- this.watchPath = watchPath;
- this.fullWatchPath = sysPath.resolve(watchPath);
- this.hasGlob = watchPath !== path;
- /** @type {object|boolean} */
- if (path === EMPTY_STR) this.hasGlob = false;
- this.globSymlink = this.hasGlob && follow ? undefined : false;
- this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false;
- this.dirParts = this.getDirParts(path);
- this.dirParts.forEach((parts) => {
- if (parts.length > 1) parts.pop();
- });
- this.followSymlinks = follow;
- this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
- }
-
- checkGlobSymlink(entry) {
- // only need to resolve once
- // first entry should always have entry.parentDir === EMPTY_STR
- if (this.globSymlink === undefined) {
- this.globSymlink = entry.fullParentDir === this.fullWatchPath ?
- false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath};
- }
-
- if (this.globSymlink) {
- return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
- }
-
- return entry.fullPath;
- }
-
- entryPath(entry) {
- return sysPath.join(this.watchPath,
- sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
- );
- }
-
- filterPath(entry) {
- const {stats} = entry;
- if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
- const resolvedPath = this.entryPath(entry);
- const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ?
- this.globFilter(resolvedPath) : true;
- return matchesGlob &&
- this.fsw._isntIgnored(resolvedPath, stats) &&
- this.fsw._hasReadPermissions(stats);
- }
-
- getDirParts(path) {
- if (!this.hasGlob) return [];
- const parts = [];
- const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
- expandedPath.forEach((path) => {
- parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
- });
- return parts;
- }
-
- filterDir(entry) {
- if (this.hasGlob) {
- const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
- let globstar = false;
- this.unmatchedGlob = !this.dirParts.some((parts) => {
- return parts.every((part, i) => {
- if (part === GLOBSTAR) globstar = true;
- return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
- });
- });
- }
- return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
- }
-}
-
-/**
- * Watches files & directories for changes. Emitted events:
- * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
- *
- * new FSWatcher()
- * .add(directories)
- * .on('add', path => log('File', path, 'was added'))
- */
-class FSWatcher extends EventEmitter {
-// Not indenting methods for history sake; for now.
-constructor(_opts) {
- super();
-
- const opts = {};
- if (_opts) Object.assign(opts, _opts); // for frozen objects
-
- /** @type {Map<String, DirEntry>} */
- this._watched = new Map();
- /** @type {Map<String, Array>} */
- this._closers = new Map();
- /** @type {Set<String>} */
- this._ignoredPaths = new Set();
-
- /** @type {Map<ThrottleType, Map>} */
- this._throttled = new Map();
-
- /** @type {Map<Path, String|Boolean>} */
- this._symlinkPaths = new Map();
-
- this._streams = new Set();
- this.closed = false;
-
- // Set up default options.
- if (undef(opts, 'persistent')) opts.persistent = true;
- if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false;
- if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false;
- if (undef(opts, 'interval')) opts.interval = 100;
- if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300;
- if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false;
- opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
-
- // Enable fsevents on OS X when polling isn't explicitly enabled.
- if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;
-
- // If we can't use fsevents, ensure the options reflect it's disabled.
- const canUseFsEvents = FsEventsHandler.canUse();
- if (!canUseFsEvents) opts.useFsEvents = false;
-
- // Use polling on Mac if not using fsevents.
- // Other platforms use non-polling fs_watch.
- if (undef(opts, 'usePolling') && !opts.useFsEvents) {
- opts.usePolling = isMacos;
- }
-
- // Global override (useful for end-developers that need to force polling for all
- // instances of chokidar, regardless of usage/dependency depth)
- const envPoll = process.env.CHOKIDAR_USEPOLLING;
- if (envPoll !== undefined) {
- const envLower = envPoll.toLowerCase();
-
- if (envLower === 'false' || envLower === '0') {
- opts.usePolling = false;
- } else if (envLower === 'true' || envLower === '1') {
- opts.usePolling = true;
- } else {
- opts.usePolling = !!envLower;
- }
- }
- const envInterval = process.env.CHOKIDAR_INTERVAL;
- if (envInterval) {
- opts.interval = Number.parseInt(envInterval, 10);
- }
-
- // Editor atomic write normalization enabled by default with fs.watch
- if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents;
- if (opts.atomic) this._pendingUnlinks = new Map();
-
- if (undef(opts, 'followSymlinks')) opts.followSymlinks = true;
-
- if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false;
- if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
- const awf = opts.awaitWriteFinish;
- if (awf) {
- if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000;
- if (!awf.pollInterval) awf.pollInterval = 100;
- this._pendingWrites = new Map();
- }
- if (opts.ignored) opts.ignored = arrify(opts.ignored);
-
- let readyCalls = 0;
- this._emitReady = () => {
- readyCalls++;
- if (readyCalls >= this._readyCount) {
- this._emitReady = EMPTY_FN;
- this._readyEmitted = true;
- // use process.nextTick to allow time for listener to be bound
- process.nextTick(() => this.emit(EV_READY));
- }
- };
- this._emitRaw = (...args) => this.emit(EV_RAW, ...args);
- this._readyEmitted = false;
- this.options = opts;
-
- // Initialize with proper watcher.
- if (opts.useFsEvents) {
- this._fsEventsHandler = new FsEventsHandler(this);
- } else {
- this._nodeFsHandler = new NodeFsHandler(this);
- }
-
- // You’re frozen when your heart’s not open.
- Object.freeze(opts);
-}
-
-// Public methods
-
-/**
- * Adds paths to be watched on an existing FSWatcher instance
- * @param {Path|Array<Path>} paths_
- * @param {String=} _origAdd private; for handling non-existent paths to be watched
- * @param {Boolean=} _internal private; indicates a non-user add
- * @returns {FSWatcher} for chaining
- */
-add(paths_, _origAdd, _internal) {
- const {cwd, disableGlobbing} = this.options;
- this.closed = false;
- let paths = unifyPaths(paths_);
- if (cwd) {
- paths = paths.map((path) => {
- const absPath = getAbsolutePath(path, cwd);
-
- // Check `path` instead of `absPath` because the cwd portion can't be a glob
- if (disableGlobbing || !isGlob(path)) {
- return absPath;
- }
- return normalizePath(absPath);
- });
- }
-
- // set aside negated glob strings
- paths = paths.filter((path) => {
- if (path.startsWith(BANG)) {
- this._ignoredPaths.add(path.slice(1));
- return false;
- }
-
- // if a path is being added that was previously ignored, stop ignoring it
- this._ignoredPaths.delete(path);
- this._ignoredPaths.delete(path + SLASH_GLOBSTAR);
-
- // reset the cached userIgnored anymatch fn
- // to make ignoredPaths changes effective
- this._userIgnored = undefined;
-
- return true;
- });
-
- if (this.options.useFsEvents && this._fsEventsHandler) {
- if (!this._readyCount) this._readyCount = paths.length;
- if (this.options.persistent) this._readyCount *= 2;
- paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path));
- } else {
- if (!this._readyCount) this._readyCount = 0;
- this._readyCount += paths.length;
- Promise.all(
- paths.map(async path => {
- const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd);
- if (res) this._emitReady();
- return res;
- })
- ).then(results => {
- if (this.closed) return;
- results.filter(item => item).forEach(item => {
- this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
- });
- });
- }
-
- return this;
-}
-
-/**
- * Close watchers or start ignoring events from specified paths.
- * @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs
- * @returns {FSWatcher} for chaining
-*/
-unwatch(paths_) {
- if (this.closed) return this;
- const paths = unifyPaths(paths_);
- const {cwd} = this.options;
-
- paths.forEach((path) => {
- // convert to absolute path unless relative path already matches
- if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
- if (cwd) path = sysPath.join(cwd, path);
- path = sysPath.resolve(path);
- }
-
- this._closePath(path);
-
- this._ignoredPaths.add(path);
- if (this._watched.has(path)) {
- this._ignoredPaths.add(path + SLASH_GLOBSTAR);
- }
-
- // reset the cached userIgnored anymatch fn
- // to make ignoredPaths changes effective
- this._userIgnored = undefined;
- });
-
- return this;
-}
-
-/**
- * Close watchers and remove all listeners from watched paths.
- * @returns {Promise<void>}.
-*/
-close() {
- if (this.closed) return this._closePromise;
- this.closed = true;
-
- // Memory management.
- this.removeAllListeners();
- const closers = [];
- this._closers.forEach(closerList => closerList.forEach(closer => {
- const promise = closer();
- if (promise instanceof Promise) closers.push(promise);
- }));
- this._streams.forEach(stream => stream.destroy());
- this._userIgnored = undefined;
- this._readyCount = 0;
- this._readyEmitted = false;
- this._watched.forEach(dirent => dirent.dispose());
- ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => {
- this[`_${key}`].clear();
- });
-
- this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve();
- return this._closePromise;
-}
-
-/**
- * Expose list of watched paths
- * @returns {Object} for chaining
-*/
-getWatched() {
- const watchList = {};
- this._watched.forEach((entry, dir) => {
- const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
- watchList[key || ONE_DOT] = entry.getChildren().sort();
- });
- return watchList;
-}
-
-emitWithAll(event, args) {
- this.emit(...args);
- if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
-}
-
-// Common helpers
-// --------------
-
-/**
- * Normalize and emit events.
- * Calling _emit DOES NOT MEAN emit() would be called!
- * @param {EventName} event Type of event
- * @param {Path} path File or directory path
- * @param {*=} val1 arguments to be passed with event
- * @param {*=} val2
- * @param {*=} val3
- * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
- */
-async _emit(event, path, val1, val2, val3) {
- if (this.closed) return;
-
- const opts = this.options;
- if (isWindows) path = sysPath.normalize(path);
- if (opts.cwd) path = sysPath.relative(opts.cwd, path);
- /** @type Array<any> */
- const args = [event, path];
- if (val3 !== undefined) args.push(val1, val2, val3);
- else if (val2 !== undefined) args.push(val1, val2);
- else if (val1 !== undefined) args.push(val1);
-
- const awf = opts.awaitWriteFinish;
- let pw;
- if (awf && (pw = this._pendingWrites.get(path))) {
- pw.lastChange = new Date();
- return this;
- }
-
- if (opts.atomic) {
- if (event === EV_UNLINK) {
- this._pendingUnlinks.set(path, args);
- setTimeout(() => {
- this._pendingUnlinks.forEach((entry, path) => {
- this.emit(...entry);
- this.emit(EV_ALL, ...entry);
- this._pendingUnlinks.delete(path);
- });
- }, typeof opts.atomic === 'number' ? opts.atomic : 100);
- return this;
- }
- if (event === EV_ADD && this._pendingUnlinks.has(path)) {
- event = args[0] = EV_CHANGE;
- this._pendingUnlinks.delete(path);
- }
- }
-
- if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
- const awfEmit = (err, stats) => {
- if (err) {
- event = args[0] = EV_ERROR;
- args[1] = err;
- this.emitWithAll(event, args);
- } else if (stats) {
- // if stats doesn't exist the file must have been deleted
- if (args.length > 2) {
- args[2] = stats;
- } else {
- args.push(stats);
- }
- this.emitWithAll(event, args);
- }
- };
-
- this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
- return this;
- }
-
- if (event === EV_CHANGE) {
- const isThrottled = !this._throttle(EV_CHANGE, path, 50);
- if (isThrottled) return this;
- }
-
- if (opts.alwaysStat && val1 === undefined &&
- (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)
- ) {
- const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
- let stats;
- try {
- stats = await stat(fullPath);
- } catch (err) {}
- // Suppress event when fs_stat fails, to avoid sending undefined 'stat'
- if (!stats || this.closed) return;
- args.push(stats);
- }
- this.emitWithAll(event, args);
-
- return this;
-}
-
-/**
- * Common handler for errors
- * @param {Error} error
- * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
- */
-_handleError(error) {
- const code = error && error.code;
- if (error && code !== 'ENOENT' && code !== 'ENOTDIR' &&
- (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))
- ) {
- this.emit(EV_ERROR, error);
- }
- return error || this.closed;
-}
-
-/**
- * Helper utility for throttling
- * @param {ThrottleType} actionType type being throttled
- * @param {Path} path being acted upon
- * @param {Number} timeout duration of time to suppress duplicate actions
- * @returns {Object|false} tracking object or false if action should be suppressed
- */
-_throttle(actionType, path, timeout) {
- if (!this._throttled.has(actionType)) {
- this._throttled.set(actionType, new Map());
- }
-
- /** @type {Map<Path, Object>} */
- const action = this._throttled.get(actionType);
- /** @type {Object} */
- const actionPath = action.get(path);
-
- if (actionPath) {
- actionPath.count++;
- return false;
- }
-
- let timeoutObject;
- const clear = () => {
- const item = action.get(path);
- const count = item ? item.count : 0;
- action.delete(path);
- clearTimeout(timeoutObject);
- if (item) clearTimeout(item.timeoutObject);
- return count;
- };
- timeoutObject = setTimeout(clear, timeout);
- const thr = {timeoutObject, clear, count: 0};
- action.set(path, thr);
- return thr;
-}
-
-_incrReadyCount() {
- return this._readyCount++;
-}
-
-/**
- * Awaits write operation to finish.
- * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
- * @param {Path} path being acted upon
- * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
- * @param {EventName} event
- * @param {Function} awfEmit Callback to be called when ready for event to be emitted.
- */
-_awaitWriteFinish(path, threshold, event, awfEmit) {
- let timeoutHandler;
-
- let fullPath = path;
- if (this.options.cwd && !sysPath.isAbsolute(path)) {
- fullPath = sysPath.join(this.options.cwd, path);
- }
-
- const now = new Date();
-
- const awaitWriteFinish = (prevStat) => {
- fs.stat(fullPath, (err, curStat) => {
- if (err || !this._pendingWrites.has(path)) {
- if (err && err.code !== 'ENOENT') awfEmit(err);
- return;
- }
-
- const now = Number(new Date());
-
- if (prevStat && curStat.size !== prevStat.size) {
- this._pendingWrites.get(path).lastChange = now;
- }
- const pw = this._pendingWrites.get(path);
- const df = now - pw.lastChange;
-
- if (df >= threshold) {
- this._pendingWrites.delete(path);
- awfEmit(undefined, curStat);
- } else {
- timeoutHandler = setTimeout(
- awaitWriteFinish,
- this.options.awaitWriteFinish.pollInterval,
- curStat
- );
- }
- });
- };
-
- if (!this._pendingWrites.has(path)) {
- this._pendingWrites.set(path, {
- lastChange: now,
- cancelWait: () => {
- this._pendingWrites.delete(path);
- clearTimeout(timeoutHandler);
- return event;
- }
- });
- timeoutHandler = setTimeout(
- awaitWriteFinish,
- this.options.awaitWriteFinish.pollInterval
- );
- }
-}
-
-_getGlobIgnored() {
- return [...this._ignoredPaths.values()];
-}
-
-/**
- * Determines whether user has asked to ignore this path.
- * @param {Path} path filepath or dir
- * @param {fs.Stats=} stats result of fs.stat
- * @returns {Boolean}
- */
-_isIgnored(path, stats) {
- if (this.options.atomic && DOT_RE.test(path)) return true;
- if (!this._userIgnored) {
- const {cwd} = this.options;
- const ign = this.options.ignored;
-
- const ignored = ign && ign.map(normalizeIgnored(cwd));
- const paths = arrify(ignored)
- .filter((path) => typeof path === STRING_TYPE && !isGlob(path))
- .map((path) => path + SLASH_GLOBSTAR);
- const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
- this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS);
- }
-
- return this._userIgnored([path, stats]);
-}
-
-_isntIgnored(path, stat) {
- return !this._isIgnored(path, stat);
-}
-
-/**
- * Provides a set of common helpers and properties relating to symlink and glob handling.
- * @param {Path} path file, directory, or glob pattern being watched
- * @param {Number=} depth at any depth > 0, this isn't a glob
- * @returns {WatchHelper} object containing helpers for this path
- */
-_getWatchHelpers(path, depth) {
- const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
- const follow = this.options.followSymlinks;
-
- return new WatchHelper(path, watchPath, follow, this);
-}
-
-// Directory helpers
-// -----------------
-
-/**
- * Provides directory tracking objects
- * @param {String} directory path of the directory
- * @returns {DirEntry} the directory's tracking object
- */
-_getWatchedDir(directory) {
- if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
- const dir = sysPath.resolve(directory);
- if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
- return this._watched.get(dir);
-}
-
-// File helpers
-// ------------
-
-/**
- * Check for read permissions.
- * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405
- * @param {fs.Stats} stats - object, result of fs_stat
- * @returns {Boolean} indicates whether the file can be read
-*/
-_hasReadPermissions(stats) {
- if (this.options.ignorePermissionErrors) return true;
-
- // stats.mode may be bigint
- const md = stats && Number.parseInt(stats.mode, 10);
- const st = md & 0o777;
- const it = Number.parseInt(st.toString(8)[0], 10);
- return Boolean(4 & it);
-}
-
-/**
- * Handles emitting unlink events for
- * files and directories, and via recursion, for
- * files and directories within directories that are unlinked
- * @param {String} directory within which the following item is located
- * @param {String} item base path of item/directory
- * @returns {void}
-*/
-_remove(directory, item, isDirectory) {
- // if what is being deleted is a directory, get that directory's paths
- // for recursive deleting and cleaning of watched object
- // if it is not a directory, nestedDirectoryChildren will be empty array
- const path = sysPath.join(directory, item);
- const fullPath = sysPath.resolve(path);
- isDirectory = isDirectory != null
- ? isDirectory
- : this._watched.has(path) || this._watched.has(fullPath);
-
- // prevent duplicate handling in case of arriving here nearly simultaneously
- // via multiple paths (such as _handleFile and _handleDir)
- if (!this._throttle('remove', path, 100)) return;
-
- // if the only watched file is removed, watch for its return
- if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) {
- this.add(directory, item, true);
- }
-
- // This will create a new entry in the watched object in either case
- // so we got to do the directory check beforehand
- const wp = this._getWatchedDir(path);
- const nestedDirectoryChildren = wp.getChildren();
-
- // Recursively remove children directories / files.
- nestedDirectoryChildren.forEach(nested => this._remove(path, nested));
-
- // Check if item was on the watched list and remove it
- const parent = this._getWatchedDir(directory);
- const wasTracked = parent.has(item);
- parent.remove(item);
-
- // If we wait for this file to be fully written, cancel the wait.
- let relPath = path;
- if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
- if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
- const event = this._pendingWrites.get(relPath).cancelWait();
- if (event === EV_ADD) return;
- }
-
- // The Entry will either be a directory that just got removed
- // or a bogus entry to a file, in either case we have to remove it
- this._watched.delete(path);
- this._watched.delete(fullPath);
- const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
- if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
-
- // Avoid conflicts if we later create another file with the same name
- if (!this.options.useFsEvents) {
- this._closePath(path);
- }
-}
-
-/**
- * Closes all watchers for a path
- * @param {Path} path
- */
-_closePath(path) {
- this._closeFile(path)
- const dir = sysPath.dirname(path);
- this._getWatchedDir(dir).remove(sysPath.basename(path));
-}
-
-/**
- * Closes only file-specific watchers
- * @param {Path} path
- */
-_closeFile(path) {
- const closers = this._closers.get(path);
- if (!closers) return;
- closers.forEach(closer => closer());
- this._closers.delete(path);
-}
-
-/**
- *
- * @param {Path} path
- * @param {Function} closer
- */
-_addPathCloser(path, closer) {
- if (!closer) return;
- let list = this._closers.get(path);
- if (!list) {
- list = [];
- this._closers.set(path, list);
- }
- list.push(closer);
-}
-
-_readdirp(root, opts) {
- if (this.closed) return;
- const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts};
- let stream = readdirp(root, options);
- this._streams.add(stream);
- stream.once(STR_CLOSE, () => {
- stream = undefined;
- });
- stream.once(STR_END, () => {
- if (stream) {
- this._streams.delete(stream);
- stream = undefined;
- }
- });
- return stream;
-}
-
-}
-
-// Export FSWatcher class
-exports.FSWatcher = FSWatcher;
-
-/**
- * Instantiates watcher with paths to be tracked.
- * @param {String|Array<String>} paths file/directory paths and/or globs
- * @param {Object=} options chokidar opts
- * @returns an instance of FSWatcher for chaining.
- */
-const watch = (paths, options) => {
- const watcher = new FSWatcher(options);
- watcher.add(paths);
- return watcher;
-};
-
-exports.watch = watch;
diff --git a/node_modules/watchpack/node_modules/chokidar/lib/constants.js b/node_modules/watchpack/node_modules/chokidar/lib/constants.js
deleted file mode 100644
index 84c2d98..0000000
--- a/node_modules/watchpack/node_modules/chokidar/lib/constants.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict';
-
-const {sep} = require('path');
-const {platform} = process;
-
-exports.EV_ALL = 'all';
-exports.EV_READY = 'ready';
-exports.EV_ADD = 'add';
-exports.EV_CHANGE = 'change';
-exports.EV_ADD_DIR = 'addDir';
-exports.EV_UNLINK = 'unlink';
-exports.EV_UNLINK_DIR = 'unlinkDir';
-exports.EV_RAW = 'raw';
-exports.EV_ERROR = 'error';
-
-exports.STR_DATA = 'data';
-exports.STR_END = 'end';
-exports.STR_CLOSE = 'close';
-
-exports.FSEVENT_CREATED = 'created';
-exports.FSEVENT_MODIFIED = 'modified';
-exports.FSEVENT_DELETED = 'deleted';
-exports.FSEVENT_MOVED = 'moved';
-exports.FSEVENT_CLONED = 'cloned';
-exports.FSEVENT_UNKNOWN = 'unknown';
-exports.FSEVENT_TYPE_FILE = 'file';
-exports.FSEVENT_TYPE_DIRECTORY = 'directory';
-exports.FSEVENT_TYPE_SYMLINK = 'symlink';
-
-exports.KEY_LISTENERS = 'listeners';
-exports.KEY_ERR = 'errHandlers';
-exports.KEY_RAW = 'rawEmitters';
-exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW];
-
-exports.DOT_SLASH = `.${sep}`;
-
-exports.BACK_SLASH_RE = /\\/g;
-exports.DOUBLE_SLASH_RE = /\/\//;
-exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
-exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
-exports.REPLACER_RE = /^\.[/\\]/;
-
-exports.SLASH = '/';
-exports.SLASH_SLASH = '//';
-exports.BRACE_START = '{';
-exports.BANG = '!';
-exports.ONE_DOT = '.';
-exports.TWO_DOTS = '..';
-exports.STAR = '*';
-exports.GLOBSTAR = '**';
-exports.ROOT_GLOBSTAR = '/**/*';
-exports.SLASH_GLOBSTAR = '/**';
-exports.DIR_SUFFIX = 'Dir';
-exports.ANYMATCH_OPTS = {dot: true};
-exports.STRING_TYPE = 'string';
-exports.FUNCTION_TYPE = 'function';
-exports.EMPTY_STR = '';
-exports.EMPTY_FN = () => {};
-exports.IDENTITY_FN = val => val;
-
-exports.isWindows = platform === 'win32';
-exports.isMacos = platform === 'darwin';
-exports.isLinux = platform === 'linux';
diff --git a/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js
deleted file mode 100644
index c5af1a1..0000000
--- a/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js
+++ /dev/null
@@ -1,524 +0,0 @@
-'use strict';
-
-const fs = require('fs');
-const sysPath = require('path');
-const { promisify } = require('util');
-
-let fsevents;
-try {
- fsevents = require('fsevents');
-} catch (error) {
- if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
-}
-
-if (fsevents) {
- // TODO: real check
- const mtch = process.version.match(/v(\d+)\.(\d+)/);
- if (mtch && mtch[1] && mtch[2]) {
- const maj = Number.parseInt(mtch[1], 10);
- const min = Number.parseInt(mtch[2], 10);
- if (maj === 8 && min < 16) {
- fsevents = undefined;
- }
- }
-}
-
-const {
- EV_ADD,
- EV_CHANGE,
- EV_ADD_DIR,
- EV_UNLINK,
- EV_ERROR,
- STR_DATA,
- STR_END,
- FSEVENT_CREATED,
- FSEVENT_MODIFIED,
- FSEVENT_DELETED,
- FSEVENT_MOVED,
- // FSEVENT_CLONED,
- FSEVENT_UNKNOWN,
- FSEVENT_TYPE_FILE,
- FSEVENT_TYPE_DIRECTORY,
- FSEVENT_TYPE_SYMLINK,
-
- ROOT_GLOBSTAR,
- DIR_SUFFIX,
- DOT_SLASH,
- FUNCTION_TYPE,
- EMPTY_FN,
- IDENTITY_FN
-} = require('./constants');
-
-const Depth = (value) => isNaN(value) ? {} : {depth: value};
-
-const stat = promisify(fs.stat);
-const lstat = promisify(fs.lstat);
-const realpath = promisify(fs.realpath);
-
-const statMethods = { stat, lstat };
-
-/**
- * @typedef {String} Path
- */
-
-/**
- * @typedef {Object} FsEventsWatchContainer
- * @property {Set<Function>} listeners
- * @property {Function} rawEmitter
- * @property {{stop: Function}} watcher
- */
-
-// fsevents instance helper functions
-/**
- * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances)
- * @type {Map<Path,FsEventsWatchContainer>}
- */
-const FSEventsWatchers = new Map();
-
-// Threshold of duplicate path prefixes at which to start
-// consolidating going forward
-const consolidateThreshhold = 10;
-
-const wrongEventFlags = new Set([
- 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912
-]);
-
-/**
- * Instantiates the fsevents interface
- * @param {Path} path path to be watched
- * @param {Function} callback called when fsevents is bound and ready
- * @returns {{stop: Function}} new fsevents instance
- */
-const createFSEventsInstance = (path, callback) => {
- const stop = fsevents.watch(path, callback);
- return {stop};
-};
-
-/**
- * Instantiates the fsevents interface or binds listeners to an existing one covering
- * the same file tree.
- * @param {Path} path - to be watched
- * @param {Path} realPath - real path for symlinks
- * @param {Function} listener - called when fsevents emits events
- * @param {Function} rawEmitter - passes data to listeners of the 'raw' event
- * @returns {Function} closer
- */
-function setFSEventsListener(path, realPath, listener, rawEmitter) {
- let watchPath = sysPath.extname(path) ? sysPath.dirname(path) : path;
- const parentPath = sysPath.dirname(watchPath);
- let cont = FSEventsWatchers.get(watchPath);
-
- // If we've accumulated a substantial number of paths that
- // could have been consolidated by watching one directory
- // above the current one, create a watcher on the parent
- // path instead, so that we do consolidate going forward.
- if (couldConsolidate(parentPath)) {
- watchPath = parentPath;
- }
-
- const resolvedPath = sysPath.resolve(path);
- const hasSymlink = resolvedPath !== realPath;
-
- const filteredListener = (fullPath, flags, info) => {
- if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
- if (
- fullPath === resolvedPath ||
- !fullPath.indexOf(resolvedPath + sysPath.sep)
- ) listener(fullPath, flags, info);
- };
-
- // check if there is already a watcher on a parent path
- // modifies `watchPath` to the parent path when it finds a match
- let watchedParent = false;
- for (const watchedPath of FSEventsWatchers.keys()) {
- if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) {
- watchPath = watchedPath;
- cont = FSEventsWatchers.get(watchPath);
- watchedParent = true;
- break;
- }
- }
-
- if (cont || watchedParent) {
- cont.listeners.add(filteredListener);
- } else {
- cont = {
- listeners: new Set([filteredListener]),
- rawEmitter,
- watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
- if (!cont.listeners.size) return;
- const info = fsevents.getInfo(fullPath, flags);
- cont.listeners.forEach(list => {
- list(fullPath, flags, info);
- });
-
- cont.rawEmitter(info.event, fullPath, info);
- })
- };
- FSEventsWatchers.set(watchPath, cont);
- }
-
- // removes this instance's listeners and closes the underlying fsevents
- // instance if there are no more listeners left
- return () => {
- const lst = cont.listeners;
-
- lst.delete(filteredListener);
- if (!lst.size) {
- FSEventsWatchers.delete(watchPath);
- if (cont.watcher) return cont.watcher.stop().then(() => {
- cont.rawEmitter = cont.watcher = undefined;
- Object.freeze(cont);
- });
- }
- };
-}
-
-// Decide whether or not we should start a new higher-level
-// parent watcher
-const couldConsolidate = (path) => {
- let count = 0;
- for (const watchPath of FSEventsWatchers.keys()) {
- if (watchPath.indexOf(path) === 0) {
- count++;
- if (count >= consolidateThreshhold) {
- return true;
- }
- }
- }
-
- return false;
-};
-
-// returns boolean indicating whether fsevents can be used
-const canUse = () => fsevents && FSEventsWatchers.size < 128;
-
-// determines subdirectory traversal levels from root to path
-const calcDepth = (path, root) => {
- let i = 0;
- while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++;
- return i;
-};
-
-// returns boolean indicating whether the fsevents' event info has the same type
-// as the one returned by fs.stat
-const sameTypes = (info, stats) => (
- info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() ||
- info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() ||
- info.type === FSEVENT_TYPE_FILE && stats.isFile()
-)
-
-/**
- * @mixin
- */
-class FsEventsHandler {
-
-/**
- * @param {import('../index').FSWatcher} fsw
- */
-constructor(fsw) {
- this.fsw = fsw;
-}
-checkIgnored(path, stats) {
- const ipaths = this.fsw._ignoredPaths;
- if (this.fsw._isIgnored(path, stats)) {
- ipaths.add(path);
- if (stats && stats.isDirectory()) {
- ipaths.add(path + ROOT_GLOBSTAR);
- }
- return true;
- }
-
- ipaths.delete(path);
- ipaths.delete(path + ROOT_GLOBSTAR);
-}
-
-addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
- const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
- this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts);
-}
-
-async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
- try {
- const stats = await stat(path)
- if (this.fsw.closed) return;
- if (sameTypes(info, stats)) {
- this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
- } else {
- this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
- }
- } catch (error) {
- if (error.code === 'EACCES') {
- this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
- } else {
- this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
- }
- }
-}
-
-handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) {
- if (this.fsw.closed || this.checkIgnored(path)) return;
-
- if (event === EV_UNLINK) {
- const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY
- // suppress unlink events on never before seen files
- if (isDirectory || watchedDir.has(item)) {
- this.fsw._remove(parent, item, isDirectory);
- }
- } else {
- if (event === EV_ADD) {
- // track new directories
- if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path);
-
- if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
- // push symlinks back to the top of the stack to get handled
- const curDepth = opts.depth === undefined ?
- undefined : calcDepth(fullPath, realPath) + 1;
- return this._addToFsEvents(path, false, true, curDepth);
- }
-
- // track new paths
- // (other than symlinks being followed, which will be tracked soon)
- this.fsw._getWatchedDir(parent).add(item);
- }
- /**
- * @type {'add'|'addDir'|'unlink'|'unlinkDir'}
- */
- const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
- this.fsw._emit(eventName, path);
- if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true);
- }
-}
-
-/**
- * Handle symlinks encountered during directory scan
- * @param {String} watchPath - file/dir path to be watched with fsevents
- * @param {String} realPath - real path (in case of symlinks)
- * @param {Function} transform - path transformer
- * @param {Function} globFilter - path filter in case a glob pattern was provided
- * @returns {Function} closer for the watcher instance
-*/
-_watchWithFsEvents(watchPath, realPath, transform, globFilter) {
- if (this.fsw.closed) return;
- if (this.fsw._isIgnored(watchPath)) return;
- const opts = this.fsw.options;
- const watchCallback = async (fullPath, flags, info) => {
- if (this.fsw.closed) return;
- if (
- opts.depth !== undefined &&
- calcDepth(fullPath, realPath) > opts.depth
- ) return;
- const path = transform(sysPath.join(
- watchPath, sysPath.relative(watchPath, fullPath)
- ));
- if (globFilter && !globFilter(path)) return;
- // ensure directories are tracked
- const parent = sysPath.dirname(path);
- const item = sysPath.basename(path);
- const watchedDir = this.fsw._getWatchedDir(
- info.type === FSEVENT_TYPE_DIRECTORY ? path : parent
- );
-
- // correct for wrong events emitted
- if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
- if (typeof opts.ignored === FUNCTION_TYPE) {
- let stats;
- try {
- stats = await stat(path);
- } catch (error) {}
- if (this.fsw.closed) return;
- if (this.checkIgnored(path, stats)) return;
- if (sameTypes(info, stats)) {
- this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
- } else {
- this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
- }
- } else {
- this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
- }
- } else {
- switch (info.event) {
- case FSEVENT_CREATED:
- case FSEVENT_MODIFIED:
- return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
- case FSEVENT_DELETED:
- case FSEVENT_MOVED:
- return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
- }
- }
- };
-
- const closer = setFSEventsListener(
- watchPath,
- realPath,
- watchCallback,
- this.fsw._emitRaw
- );
-
- this.fsw._emitReady();
- return closer;
-}
-
-/**
- * Handle symlinks encountered during directory scan
- * @param {String} linkPath path to symlink
- * @param {String} fullPath absolute path to the symlink
- * @param {Function} transform pre-existing path transformer
- * @param {Number} curDepth level of subdirectories traversed to where symlink is
- * @returns {Promise<void>}
- */
-async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
- // don't follow the same symlink more than once
- if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return;
-
- this.fsw._symlinkPaths.set(fullPath, true);
- this.fsw._incrReadyCount();
-
- try {
- const linkTarget = await realpath(linkPath);
- if (this.fsw.closed) return;
- if (this.fsw._isIgnored(linkTarget)) {
- return this.fsw._emitReady();
- }
-
- this.fsw._incrReadyCount();
-
- // add the linkTarget for watching with a wrapper for transform
- // that causes emitted paths to incorporate the link's path
- this._addToFsEvents(linkTarget || linkPath, (path) => {
- let aliasedPath = linkPath;
- if (linkTarget && linkTarget !== DOT_SLASH) {
- aliasedPath = path.replace(linkTarget, linkPath);
- } else if (path !== DOT_SLASH) {
- aliasedPath = sysPath.join(linkPath, path);
- }
- return transform(aliasedPath);
- }, false, curDepth);
- } catch(error) {
- if (this.fsw._handleError(error)) {
- return this.fsw._emitReady();
- }
- }
-}
-
-/**
- *
- * @param {Path} newPath
- * @param {fs.Stats} stats
- */
-emitAdd(newPath, stats, processPath, opts, forceAdd) {
- const pp = processPath(newPath);
- const isDir = stats.isDirectory();
- const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
- const base = sysPath.basename(pp);
-
- // ensure empty dirs get tracked
- if (isDir) this.fsw._getWatchedDir(pp);
- if (dirObj.has(base)) return;
- dirObj.add(base);
-
- if (!opts.ignoreInitial || forceAdd === true) {
- this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
- }
-}
-
-initWatch(realPath, path, wh, processPath) {
- if (this.fsw.closed) return;
- const closer = this._watchWithFsEvents(
- wh.watchPath,
- sysPath.resolve(realPath || wh.watchPath),
- processPath,
- wh.globFilter
- );
- this.fsw._addPathCloser(path, closer);
-}
-
-/**
- * Handle added path with fsevents
- * @param {String} path file/dir path or glob pattern
- * @param {Function|Boolean=} transform converts working path to what the user expects
- * @param {Boolean=} forceAdd ensure add is emitted
- * @param {Number=} priorDepth Level of subdirectories already traversed.
- * @returns {Promise<void>}
- */
-async _addToFsEvents(path, transform, forceAdd, priorDepth) {
- if (this.fsw.closed) {
- return;
- }
- const opts = this.fsw.options;
- const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
-
- const wh = this.fsw._getWatchHelpers(path);
-
- // evaluate what is at the path we're being asked to watch
- try {
- const stats = await statMethods[wh.statMethod](wh.watchPath);
- if (this.fsw.closed) return;
- if (this.fsw._isIgnored(wh.watchPath, stats)) {
- throw null;
- }
- if (stats.isDirectory()) {
- // emit addDir unless this is a glob parent
- if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd);
-
- // don't recurse further if it would exceed depth setting
- if (priorDepth && priorDepth > opts.depth) return;
-
- // scan the contents of the dir
- this.fsw._readdirp(wh.watchPath, {
- fileFilter: entry => wh.filterPath(entry),
- directoryFilter: entry => wh.filterDir(entry),
- ...Depth(opts.depth - (priorDepth || 0))
- }).on(STR_DATA, (entry) => {
- // need to check filterPath on dirs b/c filterDir is less restrictive
- if (this.fsw.closed) {
- return;
- }
- if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
-
- const joinedPath = sysPath.join(wh.watchPath, entry.path);
- const {fullPath} = entry;
-
- if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
- // preserve the current depth here since it can't be derived from
- // real paths past the symlink
- const curDepth = opts.depth === undefined ?
- undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
-
- this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
- } else {
- this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd);
- }
- }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => {
- this.fsw._emitReady();
- });
- } else {
- this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd);
- this.fsw._emitReady();
- }
- } catch (error) {
- if (!error || this.fsw._handleError(error)) {
- // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__-
- this.fsw._emitReady();
- this.fsw._emitReady();
- }
- }
-
- if (opts.persistent && forceAdd !== true) {
- if (typeof transform === FUNCTION_TYPE) {
- // realpath has already been resolved
- this.initWatch(undefined, path, wh, processPath);
- } else {
- let realPath;
- try {
- realPath = await realpath(wh.watchPath);
- } catch (e) {}
- this.initWatch(realPath, path, wh, processPath);
- }
- }
-}
-
-}
-
-module.exports = FsEventsHandler;
-module.exports.canUse = canUse;
diff --git a/node_modules/watchpack/node_modules/chokidar/lib/nodefs-handler.js b/node_modules/watchpack/node_modules/chokidar/lib/nodefs-handler.js
deleted file mode 100644
index 3d32475..0000000
--- a/node_modules/watchpack/node_modules/chokidar/lib/nodefs-handler.js
+++ /dev/null
@@ -1,645 +0,0 @@
-'use strict';
-
-const fs = require('fs');
-const sysPath = require('path');
-const { promisify } = require('util');
-const isBinaryPath = require('is-binary-path');
-const {
- isWindows,
- isLinux,
- EMPTY_FN,
- EMPTY_STR,
- KEY_LISTENERS,
- KEY_ERR,
- KEY_RAW,
- HANDLER_KEYS,
- EV_CHANGE,
- EV_ADD,
- EV_ADD_DIR,
- EV_ERROR,
- STR_DATA,
- STR_END,
- BRACE_START,
- STAR
-} = require('./constants');
-
-const THROTTLE_MODE_WATCH = 'watch';
-
-const open = promisify(fs.open);
-const stat = promisify(fs.stat);
-const lstat = promisify(fs.lstat);
-const close = promisify(fs.close);
-const fsrealpath = promisify(fs.realpath);
-
-const statMethods = { lstat, stat };
-
-// TODO: emit errors properly. Example: EMFILE on Macos.
-const foreach = (val, fn) => {
- if (val instanceof Set) {
- val.forEach(fn);
- } else {
- fn(val);
- }
-};
-
-const addAndConvert = (main, prop, item) => {
- let container = main[prop];
- if (!(container instanceof Set)) {
- main[prop] = container = new Set([container]);
- }
- container.add(item);
-};
-
-const clearItem = cont => key => {
- const set = cont[key];
- if (set instanceof Set) {
- set.clear();
- } else {
- delete cont[key];
- }
-};
-
-const delFromSet = (main, prop, item) => {
- const container = main[prop];
- if (container instanceof Set) {
- container.delete(item);
- } else if (container === item) {
- delete main[prop];
- }
-};
-
-const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
-
-/**
- * @typedef {String} Path
- */
-
-// fs_watch helpers
-
-// object to hold per-process fs_watch instances
-// (may be shared across chokidar FSWatcher instances)
-
-/**
- * @typedef {Object} FsWatchContainer
- * @property {Set} listeners
- * @property {Set} errHandlers
- * @property {Set} rawEmitters
- * @property {fs.FSWatcher=} watcher
- * @property {Boolean=} watcherUnusable
- */
-
-/**
- * @type {Map<String,FsWatchContainer>}
- */
-const FsWatchInstances = new Map();
-
-/**
- * Instantiates the fs_watch interface
- * @param {String} path to be watched
- * @param {Object} options to be passed to fs_watch
- * @param {Function} listener main event handler
- * @param {Function} errHandler emits info about errors
- * @param {Function} emitRaw emits raw event data
- * @returns {fs.FSWatcher} new fsevents instance
- */
-function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
- const handleEvent = (rawEvent, evPath) => {
- listener(path);
- emitRaw(rawEvent, evPath, {watchedPath: path});
-
- // emit based on events occurring for files from a directory's watcher in
- // case the file's watcher misses it (and rely on throttling to de-dupe)
- if (evPath && path !== evPath) {
- fsWatchBroadcast(
- sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath)
- );
- }
- };
- try {
- return fs.watch(path, options, handleEvent);
- } catch (error) {
- errHandler(error);
- }
-}
-
-/**
- * Helper for passing fs_watch event data to a collection of listeners
- * @param {Path} fullPath absolute path bound to fs_watch instance
- * @param {String} type listener type
- * @param {*=} val1 arguments to be passed to listeners
- * @param {*=} val2
- * @param {*=} val3
- */
-const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => {
- const cont = FsWatchInstances.get(fullPath);
- if (!cont) return;
- foreach(cont[type], (listener) => {
- listener(val1, val2, val3);
- });
-};
-
-/**
- * Instantiates the fs_watch interface or binds listeners
- * to an existing one covering the same file system entry
- * @param {String} path
- * @param {String} fullPath absolute path
- * @param {Object} options to be passed to fs_watch
- * @param {Object} handlers container for event listener functions
- */
-const setFsWatchListener = (path, fullPath, options, handlers) => {
- const {listener, errHandler, rawEmitter} = handlers;
- let cont = FsWatchInstances.get(fullPath);
-
- /** @type {fs.FSWatcher=} */
- let watcher;
- if (!options.persistent) {
- watcher = createFsWatchInstance(
- path, options, listener, errHandler, rawEmitter
- );
- return watcher.close.bind(watcher);
- }
- if (cont) {
- addAndConvert(cont, KEY_LISTENERS, listener);
- addAndConvert(cont, KEY_ERR, errHandler);
- addAndConvert(cont, KEY_RAW, rawEmitter);
- } else {
- watcher = createFsWatchInstance(
- path,
- options,
- fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
- errHandler, // no need to use broadcast here
- fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
- );
- if (!watcher) return;
- watcher.on(EV_ERROR, async (error) => {
- const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
- cont.watcherUnusable = true; // documented since Node 10.4.1
- // Workaround for https://github.com/joyent/node/issues/4337
- if (isWindows && error.code === 'EPERM') {
- try {
- const fd = await open(path, 'r');
- await close(fd);
- broadcastErr(error);
- } catch (err) {}
- } else {
- broadcastErr(error);
- }
- });
- cont = {
- listeners: listener,
- errHandlers: errHandler,
- rawEmitters: rawEmitter,
- watcher
- };
- FsWatchInstances.set(fullPath, cont);
- }
- // const index = cont.listeners.indexOf(listener);
-
- // removes this instance's listeners and closes the underlying fs_watch
- // instance if there are no more listeners left
- return () => {
- delFromSet(cont, KEY_LISTENERS, listener);
- delFromSet(cont, KEY_ERR, errHandler);
- delFromSet(cont, KEY_RAW, rawEmitter);
- if (isEmptySet(cont.listeners)) {
- // Check to protect against issue gh-730.
- // if (cont.watcherUnusable) {
- cont.watcher.close();
- // }
- FsWatchInstances.delete(fullPath);
- HANDLER_KEYS.forEach(clearItem(cont));
- cont.watcher = undefined;
- Object.freeze(cont);
- }
- };
-};
-
-// fs_watchFile helpers
-
-// object to hold per-process fs_watchFile instances
-// (may be shared across chokidar FSWatcher instances)
-const FsWatchFileInstances = new Map();
-
-/**
- * Instantiates the fs_watchFile interface or binds listeners
- * to an existing one covering the same file system entry
- * @param {String} path to be watched
- * @param {String} fullPath absolute path
- * @param {Object} options options to be passed to fs_watchFile
- * @param {Object} handlers container for event listener functions
- * @returns {Function} closer
- */
-const setFsWatchFileListener = (path, fullPath, options, handlers) => {
- const {listener, rawEmitter} = handlers;
- let cont = FsWatchFileInstances.get(fullPath);
-
- /* eslint-disable no-unused-vars, prefer-destructuring */
- let listeners = new Set();
- let rawEmitters = new Set();
-
- const copts = cont && cont.options;
- if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
- // "Upgrade" the watcher to persistence or a quicker interval.
- // This creates some unlikely edge case issues if the user mixes
- // settings in a very weird way, but solving for those cases
- // doesn't seem worthwhile for the added complexity.
- listeners = cont.listeners;
- rawEmitters = cont.rawEmitters;
- fs.unwatchFile(fullPath);
- cont = undefined;
- }
-
- /* eslint-enable no-unused-vars, prefer-destructuring */
-
- if (cont) {
- addAndConvert(cont, KEY_LISTENERS, listener);
- addAndConvert(cont, KEY_RAW, rawEmitter);
- } else {
- // TODO
- // listeners.add(listener);
- // rawEmitters.add(rawEmitter);
- cont = {
- listeners: listener,
- rawEmitters: rawEmitter,
- options,
- watcher: fs.watchFile(fullPath, options, (curr, prev) => {
- foreach(cont.rawEmitters, (rawEmitter) => {
- rawEmitter(EV_CHANGE, fullPath, {curr, prev});
- });
- const currmtime = curr.mtimeMs;
- if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
- foreach(cont.listeners, (listener) => listener(path, curr));
- }
- })
- };
- FsWatchFileInstances.set(fullPath, cont);
- }
- // const index = cont.listeners.indexOf(listener);
-
- // Removes this instance's listeners and closes the underlying fs_watchFile
- // instance if there are no more listeners left.
- return () => {
- delFromSet(cont, KEY_LISTENERS, listener);
- delFromSet(cont, KEY_RAW, rawEmitter);
- if (isEmptySet(cont.listeners)) {
- FsWatchFileInstances.delete(fullPath);
- fs.unwatchFile(fullPath);
- cont.options = cont.watcher = undefined;
- Object.freeze(cont);
- }
- };
-};
-
-/**
- * @mixin
- */
-class NodeFsHandler {
-
-/**
- * @param {import("../index").FSWatcher} fsW
- */
-constructor(fsW) {
- this.fsw = fsW;
- this._boundHandleError = (error) => fsW._handleError(error);
-}
-
-/**
- * Watch file for changes with fs_watchFile or fs_watch.
- * @param {String} path to file or dir
- * @param {Function} listener on fs change
- * @returns {Function} closer for the watcher instance
- */
-_watchWithNodeFs(path, listener) {
- const opts = this.fsw.options;
- const directory = sysPath.dirname(path);
- const basename = sysPath.basename(path);
- const parent = this.fsw._getWatchedDir(directory);
- parent.add(basename);
- const absolutePath = sysPath.resolve(path);
- const options = {persistent: opts.persistent};
- if (!listener) listener = EMPTY_FN;
-
- let closer;
- if (opts.usePolling) {
- options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ?
- opts.binaryInterval : opts.interval;
- closer = setFsWatchFileListener(path, absolutePath, options, {
- listener,
- rawEmitter: this.fsw._emitRaw
- });
- } else {
- closer = setFsWatchListener(path, absolutePath, options, {
- listener,
- errHandler: this._boundHandleError,
- rawEmitter: this.fsw._emitRaw
- });
- }
- return closer;
-}
-
-/**
- * Watch a file and emit add event if warranted.
- * @param {Path} file Path
- * @param {fs.Stats} stats result of fs_stat
- * @param {Boolean} initialAdd was the file added at watch instantiation?
- * @returns {Function} closer for the watcher instance
- */
-_handleFile(file, stats, initialAdd) {
- if (this.fsw.closed) {
- return;
- }
- const dirname = sysPath.dirname(file);
- const basename = sysPath.basename(file);
- const parent = this.fsw._getWatchedDir(dirname);
- // stats is always present
- let prevStats = stats;
-
- // if the file is already being watched, do nothing
- if (parent.has(basename)) return;
-
- const listener = async (path, newStats) => {
- if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
- if (!newStats || newStats.mtimeMs === 0) {
- try {
- const newStats = await stat(file);
- if (this.fsw.closed) return;
- // Check that change event was not fired because of changed only accessTime.
- const at = newStats.atimeMs;
- const mt = newStats.mtimeMs;
- if (!at || at <= mt || mt !== prevStats.mtimeMs) {
- this.fsw._emit(EV_CHANGE, file, newStats);
- }
- if (isLinux && prevStats.ino !== newStats.ino) {
- this.fsw._closeFile(path)
- prevStats = newStats;
- this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener));
- } else {
- prevStats = newStats;
- }
- } catch (error) {
- // Fix issues where mtime is null but file is still present
- this.fsw._remove(dirname, basename);
- }
- // add is about to be emitted if file not already tracked in parent
- } else if (parent.has(basename)) {
- // Check that change event was not fired because of changed only accessTime.
- const at = newStats.atimeMs;
- const mt = newStats.mtimeMs;
- if (!at || at <= mt || mt !== prevStats.mtimeMs) {
- this.fsw._emit(EV_CHANGE, file, newStats);
- }
- prevStats = newStats;
- }
- }
- // kick off the watcher
- const closer = this._watchWithNodeFs(file, listener);
-
- // emit an add event if we're supposed to
- if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
- if (!this.fsw._throttle(EV_ADD, file, 0)) return;
- this.fsw._emit(EV_ADD, file, stats);
- }
-
- return closer;
-}
-
-/**
- * Handle symlinks encountered while reading a dir.
- * @param {Object} entry returned by readdirp
- * @param {String} directory path of dir being read
- * @param {String} path of this item
- * @param {String} item basename of this item
- * @returns {Promise<Boolean>} true if no more processing is needed for this entry.
- */
-async _handleSymlink(entry, directory, path, item) {
- if (this.fsw.closed) {
- return;
- }
- const full = entry.fullPath;
- const dir = this.fsw._getWatchedDir(directory);
-
- if (!this.fsw.options.followSymlinks) {
- // watch symlink directly (don't follow) and detect changes
- this.fsw._incrReadyCount();
- const linkPath = await fsrealpath(path);
- if (this.fsw.closed) return;
- if (dir.has(item)) {
- if (this.fsw._symlinkPaths.get(full) !== linkPath) {
- this.fsw._symlinkPaths.set(full, linkPath);
- this.fsw._emit(EV_CHANGE, path, entry.stats);
- }
- } else {
- dir.add(item);
- this.fsw._symlinkPaths.set(full, linkPath);
- this.fsw._emit(EV_ADD, path, entry.stats);
- }
- this.fsw._emitReady();
- return true;
- }
-
- // don't follow the same symlink more than once
- if (this.fsw._symlinkPaths.has(full)) {
- return true;
- }
-
- this.fsw._symlinkPaths.set(full, true);
-}
-
-_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
- // Normalize the directory name on Windows
- directory = sysPath.join(directory, EMPTY_STR);
-
- if (!wh.hasGlob) {
- throttler = this.fsw._throttle('readdir', directory, 1000);
- if (!throttler) return;
- }
-
- const previous = this.fsw._getWatchedDir(wh.path);
- const current = new Set();
-
- let stream = this.fsw._readdirp(directory, {
- fileFilter: entry => wh.filterPath(entry),
- directoryFilter: entry => wh.filterDir(entry),
- depth: 0
- }).on(STR_DATA, async (entry) => {
- if (this.fsw.closed) {
- stream = undefined;
- return;
- }
- const item = entry.path;
- let path = sysPath.join(directory, item);
- current.add(item);
-
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) {
- return;
- }
-
- if (this.fsw.closed) {
- stream = undefined;
- return;
- }
- // Files that present in current directory snapshot
- // but absent in previous are added to watch list and
- // emit `add` event.
- if (item === target || !target && !previous.has(item)) {
- this.fsw._incrReadyCount();
-
- // ensure relativeness of path is preserved in case of watcher reuse
- path = sysPath.join(dir, sysPath.relative(dir, path));
-
- this._addToNodeFs(path, initialAdd, wh, depth + 1);
- }
- }).on(EV_ERROR, this._boundHandleError);
-
- return new Promise(resolve =>
- stream.once(STR_END, () => {
- if (this.fsw.closed) {
- stream = undefined;
- return;
- }
- const wasThrottled = throttler ? throttler.clear() : false;
-
- resolve();
-
- // Files that absent in current directory snapshot
- // but present in previous emit `remove` event
- // and are removed from @watched[directory].
- previous.getChildren().filter((item) => {
- return item !== directory &&
- !current.has(item) &&
- // in case of intersecting globs;
- // a path may have been filtered out of this readdir, but
- // shouldn't be removed because it matches a different glob
- (!wh.hasGlob || wh.filterPath({
- fullPath: sysPath.resolve(directory, item)
- }));
- }).forEach((item) => {
- this.fsw._remove(directory, item);
- });
-
- stream = undefined;
-
- // one more time for any missed in case changes came in extremely quickly
- if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
- })
- );
-}
-
-/**
- * Read directory to add / remove files from `@watched` list and re-read it on change.
- * @param {String} dir fs path
- * @param {fs.Stats} stats
- * @param {Boolean} initialAdd
- * @param {Number} depth relative to user-supplied path
- * @param {String} target child path targeted for watch
- * @param {Object} wh Common watch helpers for this path
- * @param {String} realpath
- * @returns {Promise<Function>} closer for the watcher instance.
- */
-async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
- const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
- const tracked = parentDir.has(sysPath.basename(dir));
- if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
- if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
- }
-
- // ensure dir is tracked (harmless if redundant)
- parentDir.add(sysPath.basename(dir));
- this.fsw._getWatchedDir(dir);
- let throttler;
- let closer;
-
- const oDepth = this.fsw.options.depth;
- if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
- if (!target) {
- await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
- if (this.fsw.closed) return;
- }
-
- closer = this._watchWithNodeFs(dir, (dirPath, stats) => {
- // if current directory is removed, do nothing
- if (stats && stats.mtimeMs === 0) return;
-
- this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
- });
- }
- return closer;
-}
-
-/**
- * Handle added file, directory, or glob pattern.
- * Delegates call to _handleFile / _handleDir after checks.
- * @param {String} path to file or ir
- * @param {Boolean} initialAdd was the file added at watch instantiation?
- * @param {Object} priorWh depth relative to user-supplied path
- * @param {Number} depth Child path actually targeted for watch
- * @param {String=} target Child path actually targeted for watch
- * @returns {Promise}
- */
-async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
- const ready = this.fsw._emitReady;
- if (this.fsw._isIgnored(path) || this.fsw.closed) {
- ready();
- return false;
- }
-
- const wh = this.fsw._getWatchHelpers(path, depth);
- if (!wh.hasGlob && priorWh) {
- wh.hasGlob = priorWh.hasGlob;
- wh.globFilter = priorWh.globFilter;
- wh.filterPath = entry => priorWh.filterPath(entry);
- wh.filterDir = entry => priorWh.filterDir(entry);
- }
-
- // evaluate what is at the path we're being asked to watch
- try {
- const stats = await statMethods[wh.statMethod](wh.watchPath);
- if (this.fsw.closed) return;
- if (this.fsw._isIgnored(wh.watchPath, stats)) {
- ready();
- return false;
- }
-
- const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START);
- let closer;
- if (stats.isDirectory()) {
- const targetPath = follow ? await fsrealpath(path) : path;
- if (this.fsw.closed) return;
- closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
- if (this.fsw.closed) return;
- // preserve this symlink's target path
- if (path !== targetPath && targetPath !== undefined) {
- this.fsw._symlinkPaths.set(targetPath, true);
- }
- } else if (stats.isSymbolicLink()) {
- const targetPath = follow ? await fsrealpath(path) : path;
- if (this.fsw.closed) return;
- const parent = sysPath.dirname(wh.watchPath);
- this.fsw._getWatchedDir(parent).add(wh.watchPath);
- this.fsw._emit(EV_ADD, wh.watchPath, stats);
- closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
- if (this.fsw.closed) return;
-
- // preserve this symlink's target path
- if (targetPath !== undefined) {
- this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
- }
- } else {
- closer = this._handleFile(wh.watchPath, stats, initialAdd);
- }
- ready();
-
- this.fsw._addPathCloser(path, closer);
- return false;
-
- } catch (error) {
- if (this.fsw._handleError(error)) {
- ready();
- return path;
- }
- }
-}
-
-}
-
-module.exports = NodeFsHandler;
diff --git a/node_modules/watchpack/node_modules/chokidar/package.json b/node_modules/watchpack/node_modules/chokidar/package.json
deleted file mode 100644
index db6773e..0000000
--- a/node_modules/watchpack/node_modules/chokidar/package.json
+++ /dev/null
@@ -1,162 +0,0 @@
-{
- "_from": "chokidar@^3.4.1",
- "_id": "chokidar@3.4.3",
- "_inBundle": false,
- "_integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==",
- "_location": "/watchpack/chokidar",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "chokidar@^3.4.1",
- "name": "chokidar",
- "escapedName": "chokidar",
- "rawSpec": "^3.4.1",
- "saveSpec": null,
- "fetchSpec": "^3.4.1"
- },
- "_requiredBy": [
- "/watchpack"
- ],
- "_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz",
- "_shasum": "c1df38231448e45ca4ac588e6c79573ba6a57d5b",
- "_spec": "chokidar@^3.4.1",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/watchpack",
- "author": {
- "name": "Paul Miller",
- "url": "https://paulmillr.com"
- },
- "bugs": {
- "url": "https://github.com/paulmillr/chokidar/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Paul Miller",
- "url": "https://paulmillr.com"
- },
- {
- "name": "Elan Shanker"
- }
- ],
- "dependencies": {
- "anymatch": "~3.1.1",
- "braces": "~3.0.2",
- "fsevents": "~2.1.2",
- "glob-parent": "~5.1.0",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.5.0"
- },
- "deprecated": false,
- "description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.",
- "devDependencies": {
- "@types/node": "^14",
- "chai": "^4.2",
- "dtslint": "^3.3.0",
- "eslint": "^7.0.0",
- "mocha": "^7.0.0",
- "nyc": "^15.0.0",
- "rimraf": "^3.0.0",
- "sinon": "^9.0.1",
- "sinon-chai": "^3.3.0",
- "upath": "^1.2.0"
- },
- "engines": {
- "node": ">= 8.10.0"
- },
- "eslintConfig": {
- "extends": "eslint:recommended",
- "parserOptions": {
- "ecmaVersion": 9,
- "sourceType": "script"
- },
- "env": {
- "node": true,
- "es6": true
- },
- "rules": {
- "array-callback-return": "error",
- "no-empty": [
- "error",
- {
- "allowEmptyCatch": true
- }
- ],
- "no-lonely-if": "error",
- "no-var": "error",
- "object-shorthand": "error",
- "prefer-arrow-callback": [
- "error",
- {
- "allowNamedFunctions": true
- }
- ],
- "prefer-const": [
- "error",
- {
- "ignoreReadBeforeAssign": true
- }
- ],
- "prefer-destructuring": [
- "error",
- {
- "object": true,
- "array": false
- }
- ],
- "prefer-spread": "error",
- "prefer-template": "error",
- "radix": "error",
- "strict": "error",
- "quotes": [
- "error",
- "single"
- ]
- }
- },
- "files": [
- "index.js",
- "lib/*.js",
- "types/index.d.ts"
- ],
- "homepage": "https://github.com/paulmillr/chokidar",
- "keywords": [
- "fs",
- "watch",
- "watchFile",
- "watcher",
- "watching",
- "file",
- "fsevents"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "chokidar",
- "nyc": {
- "include": [
- "index.js",
- "lib/*.js"
- ],
- "reporter": [
- "html",
- "text"
- ]
- },
- "optionalDependencies": {
- "fsevents": "~2.1.2"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paulmillr/chokidar.git"
- },
- "scripts": {
- "dtslint": "dtslint types",
- "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .",
- "mocha": "mocha --exit --timeout 60000",
- "test": "npm run lint && npm run mocha"
- },
- "types": "./types/index.d.ts",
- "version": "3.4.3"
-}
diff --git a/node_modules/watchpack/node_modules/chokidar/types/index.d.ts b/node_modules/watchpack/node_modules/chokidar/types/index.d.ts
deleted file mode 100644
index af0b558..0000000
--- a/node_modules/watchpack/node_modules/chokidar/types/index.d.ts
+++ /dev/null
@@ -1,187 +0,0 @@
-// TypeScript Version: 3.0
-
-/// <reference types="node" />
-
-import * as fs from "fs";
-import { EventEmitter } from "events";
-
-export class FSWatcher extends EventEmitter implements fs.FSWatcher {
- options: WatchOptions;
-
- /**
- * Constructs a new FSWatcher instance with optional WatchOptions parameter.
- */
- constructor(options?: WatchOptions);
-
- /**
- * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
- * string.
- */
- add(paths: string | ReadonlyArray<string>): void;
-
- /**
- * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
- * string.
- */
- unwatch(paths: string | ReadonlyArray<string>): void;
-
- /**
- * Returns an object representing all the paths on the file system being watched by this
- * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
- * the `cwd` option was used), and the values are arrays of the names of the items contained in
- * each directory.
- */
- getWatched(): {
- [directory: string]: string[];
- };
-
- /**
- * Removes all listeners from watched files.
- */
- close(): Promise<void>;
-
- on(event: 'add'|'addDir'|'change', listener: (path: string, stats?: fs.Stats) => void): this;
-
- on(event: 'all', listener: (eventName: 'add'|'addDir'|'change'|'unlink'|'unlinkDir', path: string, stats?: fs.Stats) => void): this;
-
- /**
- * Error occurred
- */
- on(event: 'error', listener: (error: Error) => void): this;
-
- /**
- * Exposes the native Node `fs.FSWatcher events`
- */
- on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
-
- /**
- * Fires when the initial scan is complete
- */
- on(event: 'ready', listener: () => void): this;
-
- on(event: 'unlink'|'unlinkDir', listener: (path: string) => void): this;
-
- on(event: string, listener: (...args: any[]) => void): this;
-}
-
-export interface WatchOptions {
- /**
- * Indicates whether the process should continue to run as long as files are being watched. If
- * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
- * even if the process continues to run.
- */
- persistent?: boolean;
-
- /**
- * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
- * be ignored. The whole relative or absolute path is tested, not just filename. If a function
- * with two arguments is provided, it gets called twice per path - once with a single argument
- * (the path), second time with two arguments (the path and the
- * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
- */
- ignored?: any;
-
- /**
- * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
- * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
- */
- ignoreInitial?: boolean;
-
- /**
- * When `false`, only the symlinks themselves will be watched for changes instead of following
- * the link references and bubbling events through the link's path.
- */
- followSymlinks?: boolean;
-
- /**
- * The base directory from which watch `paths` are to be derived. Paths emitted with events will
- * be relative to this.
- */
- cwd?: string;
-
- /**
- * If set to true then the strings passed to .watch() and .add() are treated as literal path
- * names, even if they look like globs. Default: false.
- */
- disableGlobbing?: boolean;
-
- /**
- * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
- * utilization, consider setting this to `false`. It is typically necessary to **set this to
- * `true` to successfully watch files over a network**, and it may be necessary to successfully
- * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
- * the `useFsEvents` default.
- */
- usePolling?: boolean;
-
- /**
- * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
- * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on
- * OS X, `usePolling: true` becomes the default.
- */
- useFsEvents?: boolean;
-
- /**
- * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
- * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
- * provided even in cases where it wasn't already available from the underlying watch events.
- */
- alwaysStat?: boolean;
-
- /**
- * If set, limits how many levels of subdirectories will be traversed.
- */
- depth?: number;
-
- /**
- * Interval of file system polling.
- */
- interval?: number;
-
- /**
- * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
- * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
- */
- binaryInterval?: number;
-
- /**
- * Indicates whether to watch files that don't have read permissions if possible. If watching
- * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
- * silently.
- */
- ignorePermissionErrors?: boolean;
-
- /**
- * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts
- * that occur when using editors that use "atomic writes" instead of writing directly to the
- * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
- * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
- * you can override it by setting `atomic` to a custom value, in milliseconds.
- */
- atomic?: boolean | number;
-
- /**
- * can be set to an object in order to adjust timing params:
- */
- awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
-}
-
-export interface AwaitWriteFinishOptions {
- /**
- * Amount of time in milliseconds for a file size to remain constant before emitting its event.
- */
- stabilityThreshold?: number;
-
- /**
- * File size polling interval.
- */
- pollInterval?: number;
-}
-
-/**
- * produces an instance of `FSWatcher`.
- */
-export function watch(
- paths: string | ReadonlyArray<string>,
- options?: WatchOptions
-): FSWatcher;
diff --git a/node_modules/watchpack/node_modules/is-binary-path/index.d.ts b/node_modules/watchpack/node_modules/is-binary-path/index.d.ts
deleted file mode 100644
index 19dcd43..0000000
--- a/node_modules/watchpack/node_modules/is-binary-path/index.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
-Check if a file path is a binary file.
-
-@example
-```
-import isBinaryPath = require('is-binary-path');
-
-isBinaryPath('source/unicorn.png');
-//=> true
-
-isBinaryPath('source/unicorn.txt');
-//=> false
-```
-*/
-declare function isBinaryPath(filePath: string): boolean;
-
-export = isBinaryPath;
diff --git a/node_modules/watchpack/node_modules/is-binary-path/index.js b/node_modules/watchpack/node_modules/is-binary-path/index.js
deleted file mode 100644
index ef7548c..0000000
--- a/node_modules/watchpack/node_modules/is-binary-path/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-const path = require('path');
-const binaryExtensions = require('binary-extensions');
-
-const extensions = new Set(binaryExtensions);
-
-module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase());
diff --git a/node_modules/watchpack/node_modules/is-binary-path/license b/node_modules/watchpack/node_modules/is-binary-path/license
deleted file mode 100644
index 401b1c7..0000000
--- a/node_modules/watchpack/node_modules/is-binary-path/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/watchpack/node_modules/is-binary-path/package.json b/node_modules/watchpack/node_modules/is-binary-path/package.json
deleted file mode 100644
index e546eb9..0000000
--- a/node_modules/watchpack/node_modules/is-binary-path/package.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "_from": "is-binary-path@~2.1.0",
- "_id": "is-binary-path@2.1.0",
- "_inBundle": false,
- "_integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
- "_location": "/watchpack/is-binary-path",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "is-binary-path@~2.1.0",
- "name": "is-binary-path",
- "escapedName": "is-binary-path",
- "rawSpec": "~2.1.0",
- "saveSpec": null,
- "fetchSpec": "~2.1.0"
- },
- "_requiredBy": [
- "/watchpack/chokidar"
- ],
- "_resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
- "_shasum": "ea1f7f3b80f064236e83470f86c09c254fb45b09",
- "_spec": "is-binary-path@~2.1.0",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/watchpack/node_modules/chokidar",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "bugs": {
- "url": "https://github.com/sindresorhus/is-binary-path/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "binary-extensions": "^2.0.0"
- },
- "deprecated": false,
- "description": "Check if a file path is a binary file",
- "devDependencies": {
- "ava": "^1.4.1",
- "tsd": "^0.7.2",
- "xo": "^0.24.0"
- },
- "engines": {
- "node": ">=8"
- },
- "files": [
- "index.js",
- "index.d.ts"
- ],
- "homepage": "https://github.com/sindresorhus/is-binary-path#readme",
- "keywords": [
- "binary",
- "extensions",
- "extension",
- "file",
- "path",
- "check",
- "detect",
- "is"
- ],
- "license": "MIT",
- "name": "is-binary-path",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sindresorhus/is-binary-path.git"
- },
- "scripts": {
- "test": "xo && ava && tsd"
- },
- "version": "2.1.0"
-}
diff --git a/node_modules/watchpack/node_modules/is-binary-path/readme.md b/node_modules/watchpack/node_modules/is-binary-path/readme.md
deleted file mode 100644
index b4ab025..0000000
--- a/node_modules/watchpack/node_modules/is-binary-path/readme.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path)
-
-> Check if a file path is a binary file
-
-
-## Install
-
-```
-$ npm install is-binary-path
-```
-
-
-## Usage
-
-```js
-const isBinaryPath = require('is-binary-path');
-
-isBinaryPath('source/unicorn.png');
-//=> true
-
-isBinaryPath('source/unicorn.txt');
-//=> false
-```
-
-
-## Related
-
-- [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions
-- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file
-
-
-## License
-
-MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.com)
diff --git a/node_modules/watchpack/node_modules/readdirp/LICENSE b/node_modules/watchpack/node_modules/readdirp/LICENSE
deleted file mode 100644
index 037cbb4..0000000
--- a/node_modules/watchpack/node_modules/readdirp/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/node_modules/watchpack/node_modules/readdirp/README.md b/node_modules/watchpack/node_modules/readdirp/README.md
deleted file mode 100644
index 465593c..0000000
--- a/node_modules/watchpack/node_modules/readdirp/README.md
+++ /dev/null
@@ -1,122 +0,0 @@
-# readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp)
-
-Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**.
-
-
-```sh
-npm install readdirp
-```
-
-```javascript
-const readdirp = require('readdirp');
-
-// Use streams to achieve small RAM & CPU footprint.
-// 1) Streams example with for-await.
-for await (const entry of readdirp('.')) {
- const {path} = entry;
- console.log(`${JSON.stringify({path})}`);
-}
-
-// 2) Streams example, non for-await.
-// Print out all JS files along with their size within the current folder & subfolders.
-readdirp('.', {fileFilter: '*.js', alwaysStat: true})
- .on('data', (entry) => {
- const {path, stats: {size}} = entry;
- console.log(`${JSON.stringify({path, size})}`);
- })
- // Optionally call stream.destroy() in `warn()` in order to abort and cause 'close' to be emitted
- .on('warn', error => console.error('non-fatal error', error))
- .on('error', error => console.error('fatal error', error))
- .on('end', () => console.log('done'));
-
-// 3) Promise example. More RAM and CPU than streams / for-await.
-const files = await readdirp.promise('.');
-console.log(files.map(file => file.path));
-
-// Other options.
-readdirp('test', {
- fileFilter: '*.js',
- directoryFilter: ['!.git', '!*modules']
- // directoryFilter: (di) => di.basename.length === 9
- type: 'files_directories',
- depth: 1
-});
-```
-
-For more examples, check out `examples` directory.
-
-## API
-
-`const stream = readdirp(root[, options])` — **Stream API**
-
-- Reads given root recursively and returns a `stream` of [entry infos](#entryinfo)
-- Optionally can be used like `for await (const entry of stream)` with node.js 10+ (`asyncIterator`).
-- `on('data', (entry) => {})` [entry info](#entryinfo) for every file / dir.
-- `on('warn', (error) => {})` non-fatal `Error` that prevents a file / dir from being processed. Example: inaccessible to the user.
-- `on('error', (error) => {})` fatal `Error` which also ends the stream. Example: illegal options where passed.
-- `on('end')` — we are done. Called when all entries were found and no more will be emitted.
-- `on('close')` — stream is destroyed via `stream.destroy()`.
- Could be useful if you want to manually abort even on a non fatal error.
- At that point the stream is no longer `readable` and no more entries, warning or errors are emitted
-- To learn more about streams, consult the very detailed [nodejs streams documentation](https://nodejs.org/api/stream.html)
- or the [stream-handbook](https://github.com/substack/stream-handbook)
-
-`const entries = await readdirp.promise(root[, options])` — **Promise API**. Returns a list of [entry infos](#entryinfo).
-
-First argument is awalys `root`, path in which to start reading and recursing into subdirectories.
-
-### options
-
-- `fileFilter: ["*.js"]`: filter to include or exclude files. A `Function`, Glob string or Array of glob strings.
- - **Function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry
- - **Glob string**: a string (e.g., `*.js`) which is matched using [picomatch](https://github.com/micromatch/picomatch), so go there for more
- information. Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense. Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files.
- - **Array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown.
- `['*.json', '*.js']` includes all JavaScript and Json files.
- `['!.git', '!node_modules']` includes all directories except the '.git' and 'node_modules'.
- - Directories that do not pass a filter will not be recursed into.
-- `directoryFilter: ['!.git']`: filter to include/exclude directories found and to recurse into. Directories that do not pass a filter will not be recursed into.
-- `depth: 5`: depth at which to stop recursing even if more subdirectories are found
-- `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes.
-- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0.
-- `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat`
-
-### `EntryInfo`
-
-Has the following properties:
-
-- `path: 'assets/javascripts/react.js'`: path to the file/directory (relative to given root)
-- `fullPath: '/Users/dev/projects/app/assets/javascripts/react.js'`: full path to the file/directory found
-- `basename: 'react.js'`: name of the file/directory
-- `dirent: fs.Dirent`: built-in [dir entry object](https://nodejs.org/api/fs.html#fs_class_fs_dirent) - only with `alwaysStat: false`
-- `stats: fs.Stats`: built in [stat object](https://nodejs.org/api/fs.html#fs_class_fs_stats) - only with `alwaysStat: true`
-
-## Changelog
-
-- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks.
- Before, it could have entered infinite loop.
-- 3.4 (Mar 19, 2020) adds support for directory-based symlinks.
-- 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping.
-- 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic.
-- 3.1 (Jul 7, 2019) brings `bigint` support to `stat` output on Windows. This is backwards-incompatible for some cases. Be careful. It you use it incorrectly, you'll see "TypeError: Cannot mix BigInt and other types, use explicit conversions".
-- 3.0 brings huge performance improvements and stream backpressure support.
-- Upgrading 2.x to 3.x:
- - Signature changed from `readdirp(options)` to `readdirp(root, options)`
- - Replaced callback API with promise API.
- - Renamed `entryType` option to `type`
- - Renamed `entryType: 'both'` to `'files_directories'`
- - `EntryInfo`
- - Renamed `stat` to `stats`
- - Emitted only when `alwaysStat: true`
- - `dirent` is emitted instead of `stats` by default with `alwaysStat: false`
- - Renamed `name` to `basename`
- - Removed `parentDir` and `fullParentDir` properties
-- Supported node.js versions:
- - 3.x: node 8+
- - 2.x: node 0.6+
-
-## License
-
-Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (<https://paulmillr.com>)
-
-MIT License, see [LICENSE](LICENSE) file.
diff --git a/node_modules/watchpack/node_modules/readdirp/index.d.ts b/node_modules/watchpack/node_modules/readdirp/index.d.ts
deleted file mode 100644
index cbbd76c..0000000
--- a/node_modules/watchpack/node_modules/readdirp/index.d.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-// TypeScript Version: 3.2
-
-/// <reference types="node" lib="esnext" />
-
-import * as fs from 'fs';
-import { Readable } from 'stream';
-
-declare namespace readdir {
- interface EntryInfo {
- path: string;
- fullPath: string;
- basename: string;
- stats?: fs.Stats;
- dirent?: fs.Dirent;
- }
-
- interface ReaddirpOptions {
- root?: string;
- fileFilter?: string | string[] | ((entry: EntryInfo) => boolean);
- directoryFilter?: string | string[] | ((entry: EntryInfo) => boolean);
- type?: 'files' | 'directories' | 'files_directories' | 'all';
- lstat?: boolean;
- depth?: number;
- alwaysStat?: boolean;
- }
-
- interface ReaddirpStream extends Readable, AsyncIterable<EntryInfo> {
- read(): EntryInfo;
- [Symbol.asyncIterator](): AsyncIterableIterator<EntryInfo>;
- }
-
- function promise(
- root: string,
- options?: ReaddirpOptions
- ): Promise<EntryInfo[]>;
-}
-
-declare function readdir(
- root: string,
- options?: readdir.ReaddirpOptions
-): readdir.ReaddirpStream;
-
-export = readdir;
diff --git a/node_modules/watchpack/node_modules/readdirp/index.js b/node_modules/watchpack/node_modules/readdirp/index.js
deleted file mode 100644
index 30df947..0000000
--- a/node_modules/watchpack/node_modules/readdirp/index.js
+++ /dev/null
@@ -1,282 +0,0 @@
-'use strict';
-
-const fs = require('fs');
-const { Readable } = require('stream');
-const sysPath = require('path');
-const { promisify } = require('util');
-const picomatch = require('picomatch');
-
-const readdir = promisify(fs.readdir);
-const stat = promisify(fs.stat);
-const lstat = promisify(fs.lstat);
-const realpath = promisify(fs.realpath);
-
-/**
- * @typedef {Object} EntryInfo
- * @property {String} path
- * @property {String} fullPath
- * @property {fs.Stats=} stats
- * @property {fs.Dirent=} dirent
- * @property {String} basename
- */
-
-const BANG = '!';
-const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP']);
-const FILE_TYPE = 'files';
-const DIR_TYPE = 'directories';
-const FILE_DIR_TYPE = 'files_directories';
-const EVERYTHING_TYPE = 'all';
-const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
-
-const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code);
-
-const normalizeFilter = filter => {
- if (filter === undefined) return;
- if (typeof filter === 'function') return filter;
-
- if (typeof filter === 'string') {
- const glob = picomatch(filter.trim());
- return entry => glob(entry.basename);
- }
-
- if (Array.isArray(filter)) {
- const positive = [];
- const negative = [];
- for (const item of filter) {
- const trimmed = item.trim();
- if (trimmed.charAt(0) === BANG) {
- negative.push(picomatch(trimmed.slice(1)));
- } else {
- positive.push(picomatch(trimmed));
- }
- }
-
- if (negative.length > 0) {
- if (positive.length > 0) {
- return entry =>
- positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename));
- }
- return entry => !negative.some(f => f(entry.basename));
- }
- return entry => positive.some(f => f(entry.basename));
- }
-};
-
-class ReaddirpStream extends Readable {
- static get defaultOptions() {
- return {
- root: '.',
- /* eslint-disable no-unused-vars */
- fileFilter: (path) => true,
- directoryFilter: (path) => true,
- /* eslint-enable no-unused-vars */
- type: FILE_TYPE,
- lstat: false,
- depth: 2147483648,
- alwaysStat: false
- };
- }
-
- constructor(options = {}) {
- super({
- objectMode: true,
- autoDestroy: true,
- highWaterMark: options.highWaterMark || 4096
- });
- const opts = { ...ReaddirpStream.defaultOptions, ...options };
- const { root, type } = opts;
-
- this._fileFilter = normalizeFilter(opts.fileFilter);
- this._directoryFilter = normalizeFilter(opts.directoryFilter);
-
- const statMethod = opts.lstat ? lstat : stat;
- // Use bigint stats if it's windows and stat() supports options (node 10+).
- if (process.platform === 'win32' && stat.length === 3) {
- this._stat = path => statMethod(path, { bigint: true });
- } else {
- this._stat = statMethod;
- }
-
- this._maxDepth = opts.depth;
- this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
- this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
- this._wantsEverything = type === EVERYTHING_TYPE;
- this._root = sysPath.resolve(root);
- this._isDirent = ('Dirent' in fs) && !opts.alwaysStat;
- this._statsProp = this._isDirent ? 'dirent' : 'stats';
- this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
-
- // Launch stream with one parent, the root dir.
- this.parents = [this._exploreDir(root, 1)];
- this.reading = false;
- this.parent = undefined;
- }
-
- async _read(batch) {
- if (this.reading) return;
- this.reading = true;
-
- try {
- while (!this.destroyed && batch > 0) {
- const { path, depth, files = [] } = this.parent || {};
-
- if (files.length > 0) {
- const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path));
- for (const entry of await Promise.all(slice)) {
- if (this.destroyed) return;
-
- const entryType = await this._getEntryType(entry);
- if (entryType === 'directory' && this._directoryFilter(entry)) {
- if (depth <= this._maxDepth) {
- this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
- }
-
- if (this._wantsDir) {
- this.push(entry);
- batch--;
- }
- } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) {
- if (this._wantsFile) {
- this.push(entry);
- batch--;
- }
- }
- }
- } else {
- const parent = this.parents.pop();
- if (!parent) {
- this.push(null);
- break;
- }
- this.parent = await parent;
- if (this.destroyed) return;
- }
- }
- } catch (error) {
- this.destroy(error);
- } finally {
- this.reading = false;
- }
- }
-
- async _exploreDir(path, depth) {
- let files;
- try {
- files = await readdir(path, this._rdOptions);
- } catch (error) {
- this._onError(error);
- }
- return {files, depth, path};
- }
-
- async _formatEntry(dirent, path) {
- let entry;
- try {
- const basename = this._isDirent ? dirent.name : dirent;
- const fullPath = sysPath.resolve(sysPath.join(path, basename));
- entry = {path: sysPath.relative(this._root, fullPath), fullPath, basename};
- entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
- } catch (err) {
- this._onError(err);
- }
- return entry;
- }
-
- _onError(err) {
- if (isNormalFlowError(err) && !this.destroyed) {
- this.emit('warn', err);
- } else {
- this.destroy(err);
- }
- }
-
- async _getEntryType(entry) {
- // entry may be undefined, because a warning or an error were emitted
- // and the statsProp is undefined
- const stats = entry && entry[this._statsProp];
- if (!stats) {
- return;
- }
- if (stats.isFile()) {
- return 'file';
- }
- if (stats.isDirectory()) {
- return 'directory';
- }
- if (stats && stats.isSymbolicLink()) {
- const full = entry.fullPath;
- try {
- const entryRealPath = await realpath(full);
- const entryRealPathStats = await lstat(entryRealPath);
- if (entryRealPathStats.isFile()) {
- return 'file';
- }
- if (entryRealPathStats.isDirectory()) {
- const len = entryRealPath.length;
- if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
- return this._onError(new Error(
- `Circular symlink detected: "${full}" points to "${entryRealPath}"`
- ));
- }
- return 'directory';
- }
- } catch (error) {
- this._onError(error);
- }
- }
- }
-
- _includeAsFile(entry) {
- const stats = entry && entry[this._statsProp];
-
- return stats && this._wantsEverything && !stats.isDirectory();
- }
-}
-
-/**
- * @typedef {Object} ReaddirpArguments
- * @property {Function=} fileFilter
- * @property {Function=} directoryFilter
- * @property {String=} type
- * @property {Number=} depth
- * @property {String=} root
- * @property {Boolean=} lstat
- * @property {Boolean=} bigint
- */
-
-/**
- * Main function which ends up calling readdirRec and reads all files and directories in given root recursively.
- * @param {String} root Root directory
- * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth
- */
-const readdirp = (root, options = {}) => {
- let type = options.entryType || options.type;
- if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility
- if (type) options.type = type;
- if (!root) {
- throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
- } else if (typeof root !== 'string') {
- throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
- } else if (type && !ALL_TYPES.includes(type)) {
- throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
- }
-
- options.root = root;
- return new ReaddirpStream(options);
-};
-
-const readdirpPromise = (root, options = {}) => {
- return new Promise((resolve, reject) => {
- const files = [];
- readdirp(root, options)
- .on('data', entry => files.push(entry))
- .on('end', () => resolve(files))
- .on('error', error => reject(error));
- });
-};
-
-readdirp.promise = readdirpPromise;
-readdirp.ReaddirpStream = ReaddirpStream;
-readdirp.default = readdirp;
-
-module.exports = readdirp;
diff --git a/node_modules/watchpack/node_modules/readdirp/package.json b/node_modules/watchpack/node_modules/readdirp/package.json
deleted file mode 100644
index 2c94e0b..0000000
--- a/node_modules/watchpack/node_modules/readdirp/package.json
+++ /dev/null
@@ -1,158 +0,0 @@
-{
- "_from": "readdirp@~3.5.0",
- "_id": "readdirp@3.5.0",
- "_inBundle": false,
- "_integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==",
- "_location": "/watchpack/readdirp",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "readdirp@~3.5.0",
- "name": "readdirp",
- "escapedName": "readdirp",
- "rawSpec": "~3.5.0",
- "saveSpec": null,
- "fetchSpec": "~3.5.0"
- },
- "_requiredBy": [
- "/watchpack/chokidar"
- ],
- "_resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz",
- "_shasum": "9ba74c019b15d365278d2e91bb8c48d7b4d42c9e",
- "_spec": "readdirp@~3.5.0",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/watchpack/node_modules/chokidar",
- "author": {
- "name": "Thorsten Lorenz",
- "email": "thlorenz@gmx.de",
- "url": "thlorenz.com"
- },
- "bugs": {
- "url": "https://github.com/paulmillr/readdirp/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Thorsten Lorenz",
- "email": "thlorenz@gmx.de",
- "url": "thlorenz.com"
- },
- {
- "name": "Paul Miller",
- "url": "https://paulmillr.com"
- }
- ],
- "dependencies": {
- "picomatch": "^2.2.1"
- },
- "deprecated": false,
- "description": "Recursive version of fs.readdir with streaming API.",
- "devDependencies": {
- "@types/node": "^14",
- "chai": "^4.2",
- "chai-subset": "^1.6",
- "dtslint": "^3.3.0",
- "eslint": "^7.0.0",
- "mocha": "^7.1.1",
- "nyc": "^15.0.0",
- "rimraf": "^3.0.0",
- "typescript": "^4.0.3"
- },
- "engines": {
- "node": ">=8.10.0"
- },
- "eslintConfig": {
- "root": true,
- "extends": "eslint:recommended",
- "parserOptions": {
- "ecmaVersion": 9,
- "sourceType": "script"
- },
- "env": {
- "node": true,
- "es6": true
- },
- "rules": {
- "array-callback-return": "error",
- "no-empty": [
- "error",
- {
- "allowEmptyCatch": true
- }
- ],
- "no-else-return": [
- "error",
- {
- "allowElseIf": false
- }
- ],
- "no-lonely-if": "error",
- "no-var": "error",
- "object-shorthand": "error",
- "prefer-arrow-callback": [
- "error",
- {
- "allowNamedFunctions": true
- }
- ],
- "prefer-const": [
- "error",
- {
- "ignoreReadBeforeAssign": true
- }
- ],
- "prefer-destructuring": [
- "error",
- {
- "object": true,
- "array": false
- }
- ],
- "prefer-spread": "error",
- "prefer-template": "error",
- "radix": "error",
- "semi": "error",
- "strict": "error",
- "quotes": [
- "error",
- "single"
- ]
- }
- },
- "files": [
- "index.js",
- "index.d.ts"
- ],
- "homepage": "https://github.com/paulmillr/readdirp",
- "keywords": [
- "recursive",
- "fs",
- "stream",
- "streams",
- "readdir",
- "filesystem",
- "find",
- "filter"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "readdirp",
- "nyc": {
- "reporter": [
- "html",
- "text"
- ]
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/paulmillr/readdirp.git"
- },
- "scripts": {
- "dtslint": "dtslint",
- "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .",
- "mocha": "mocha --exit",
- "nyc": "nyc",
- "test": "npm run lint && nyc npm run mocha"
- },
- "version": "3.5.0"
-}
diff --git a/node_modules/watchpack/package.json b/node_modules/watchpack/package.json
deleted file mode 100644
index 935cc03..0000000
--- a/node_modules/watchpack/package.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "_from": "watchpack@^1.7.4",
- "_id": "watchpack@1.7.5",
- "_inBundle": false,
- "_integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==",
- "_location": "/watchpack",
- "_phantomChildren": {
- "braces": "3.0.2",
- "glob-parent": "5.1.1",
- "is-glob": "4.0.1",
- "normalize-path": "3.0.0",
- "picomatch": "2.2.2"
- },
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "watchpack@^1.7.4",
- "name": "watchpack",
- "escapedName": "watchpack",
- "rawSpec": "^1.7.4",
- "saveSpec": null,
- "fetchSpec": "^1.7.4"
- },
- "_requiredBy": [
- "/webpack"
- ],
- "_resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",
- "_shasum": "1267e6c55e0b9b5be44c2023aed5437a2c26c453",
- "_spec": "watchpack@^1.7.4",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/webpack",
- "author": {
- "name": "Tobias Koppers @sokra"
- },
- "bugs": {
- "url": "https://github.com/webpack/watchpack/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "chokidar": "^3.4.1",
- "graceful-fs": "^4.1.2",
- "neo-async": "^2.5.0",
- "watchpack-chokidar2": "^2.0.1"
- },
- "deprecated": false,
- "description": "Wrapper library for directory and file watching.",
- "devDependencies": {
- "codecov.io": "^0.1.6",
- "coveralls": "^3.0.0",
- "eslint": "^4.18.1",
- "istanbul": "^0.4.3",
- "mocha": "^5.0.1",
- "rimraf": "^2.6.2",
- "should": "^8.3.1"
- },
- "directories": {
- "test": "test"
- },
- "files": [
- "lib/"
- ],
- "homepage": "https://github.com/webpack/watchpack",
- "license": "MIT",
- "main": "./lib/watchpack.js",
- "name": "watchpack",
- "optionalDependencies": {
- "chokidar": "^3.4.1",
- "watchpack-chokidar2": "^2.0.1"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/webpack/watchpack.git"
- },
- "scripts": {
- "cover": "istanbul cover node_modules/mocha/bin/_mocha",
- "lint": "eslint lib",
- "precover": "npm run lint",
- "pretest": "npm run lint",
- "test": "mocha",
- "travis": "npm run cover -- --report lcovonly"
- },
- "version": "1.7.5"
-}