Changes
This commit is contained in:
10
node_modules/chokidar/README.md
generated
vendored
10
node_modules/chokidar/README.md
generated
vendored
@@ -253,9 +253,9 @@ 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)`: **async** Stop watching files, directories, or glob patterns.
|
||||
* `.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()`: Removes all listeners from watched files. Asynchronous, returns Promise.
|
||||
* `.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
|
||||
@@ -295,6 +295,12 @@ For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md
|
||||
- **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.
|
||||
|
||||
24
node_modules/chokidar/index.js
generated
vendored
24
node_modules/chokidar/index.js
generated
vendored
@@ -34,6 +34,7 @@ const {
|
||||
REPLACER_RE,
|
||||
|
||||
SLASH,
|
||||
SLASH_SLASH,
|
||||
BRACE_START,
|
||||
BANG,
|
||||
ONE_DOT,
|
||||
@@ -96,11 +97,20 @@ const unifyPaths = (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;
|
||||
};
|
||||
|
||||
@@ -876,16 +886,24 @@ _remove(directory, item, isDirectory) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 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);
|
||||
const dir = sysPath.dirname(path);
|
||||
this._getWatchedDir(dir).remove(sysPath.basename(path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
2
node_modules/chokidar/lib/constants.js
generated
vendored
2
node_modules/chokidar/lib/constants.js
generated
vendored
@@ -41,6 +41,7 @@ exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
||||
exports.REPLACER_RE = /^\.[/\\]/;
|
||||
|
||||
exports.SLASH = '/';
|
||||
exports.SLASH_SLASH = '//';
|
||||
exports.BRACE_START = '{';
|
||||
exports.BANG = '!';
|
||||
exports.ONE_DOT = '.';
|
||||
@@ -59,3 +60,4 @@ exports.IDENTITY_FN = val => val;
|
||||
|
||||
exports.isWindows = platform === 'win32';
|
||||
exports.isMacos = platform === 'darwin';
|
||||
exports.isLinux = platform === 'linux';
|
||||
|
||||
8
node_modules/chokidar/lib/fsevents-handler.js
generated
vendored
8
node_modules/chokidar/lib/fsevents-handler.js
generated
vendored
@@ -103,7 +103,7 @@ const createFSEventsInstance = (path, callback) => {
|
||||
* @param {Function} rawEmitter - passes data to listeners of the 'raw' event
|
||||
* @returns {Function} closer
|
||||
*/
|
||||
function setFSEventsListener(path, realPath, listener, rawEmitter, fsw) {
|
||||
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);
|
||||
@@ -146,7 +146,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter, fsw) {
|
||||
listeners: new Set([filteredListener]),
|
||||
rawEmitter,
|
||||
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
|
||||
if (fsw.closed) return;
|
||||
if (!cont.listeners.size) return;
|
||||
const info = fsevents.getInfo(fullPath, flags);
|
||||
cont.listeners.forEach(list => {
|
||||
list(fullPath, flags, info);
|
||||
@@ -242,7 +242,6 @@ async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts
|
||||
try {
|
||||
const stats = await stat(path)
|
||||
if (this.fsw.closed) return;
|
||||
if (this.fsw.closed) return;
|
||||
if (sameTypes(info, stats)) {
|
||||
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
} else {
|
||||
@@ -353,8 +352,7 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
||||
watchPath,
|
||||
realPath,
|
||||
watchCallback,
|
||||
this.fsw._emitRaw,
|
||||
this.fsw
|
||||
this.fsw._emitRaw
|
||||
);
|
||||
|
||||
this.fsw._emitReady();
|
||||
|
||||
18
node_modules/chokidar/lib/nodefs-handler.js
generated
vendored
18
node_modules/chokidar/lib/nodefs-handler.js
generated
vendored
@@ -6,6 +6,7 @@ const { promisify } = require('util');
|
||||
const isBinaryPath = require('is-binary-path');
|
||||
const {
|
||||
isWindows,
|
||||
isLinux,
|
||||
EMPTY_FN,
|
||||
EMPTY_STR,
|
||||
KEY_LISTENERS,
|
||||
@@ -356,8 +357,7 @@ _handleFile(file, stats, initialAdd) {
|
||||
// if the file is already being watched, do nothing
|
||||
if (parent.has(basename)) return;
|
||||
|
||||
// kick off the watcher
|
||||
const closer = this._watchWithNodeFs(file, async (path, newStats) => {
|
||||
const listener = async (path, newStats) => {
|
||||
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
|
||||
if (!newStats || newStats.mtimeMs === 0) {
|
||||
try {
|
||||
@@ -369,12 +369,18 @@ _handleFile(file, stats, initialAdd) {
|
||||
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
||||
this.fsw._emit(EV_CHANGE, file, newStats);
|
||||
}
|
||||
prevStats = 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
|
||||
// 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;
|
||||
@@ -384,7 +390,9 @@ _handleFile(file, stats, initialAdd) {
|
||||
}
|
||||
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)) {
|
||||
|
||||
124
node_modules/chokidar/package.json
generated
vendored
124
node_modules/chokidar/package.json
generated
vendored
@@ -1,61 +1,34 @@
|
||||
{
|
||||
"_from": "chokidar@^3.2.2",
|
||||
"_id": "chokidar@3.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==",
|
||||
"_location": "/chokidar",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "chokidar@^3.2.2",
|
||||
"name": "chokidar",
|
||||
"escapedName": "chokidar",
|
||||
"rawSpec": "^3.2.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.2.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nodemon"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz",
|
||||
"_shasum": "b30611423ce376357c765b9b8f904b9fba3c0be8",
|
||||
"_spec": "chokidar@^3.2.2",
|
||||
"_where": "D:\\WORK\\Menui\\menui_backend\\node_modules\\nodemon",
|
||||
"author": {
|
||||
"name": "Paul Miller",
|
||||
"url": "https://paulmillr.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/paulmillr/chokidar/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"name": "chokidar",
|
||||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.",
|
||||
"version": "3.4.2",
|
||||
"homepage": "https://github.com/paulmillr/chokidar",
|
||||
"author": "Paul Miller (https://paulmillr.com)",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Paul Miller",
|
||||
"url": "https://paulmillr.com"
|
||||
},
|
||||
{
|
||||
"name": "Elan Shanker"
|
||||
}
|
||||
"Paul Miller (https://paulmillr.com)",
|
||||
"Elan Shanker"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"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.4.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.",
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^13",
|
||||
"@types/node": "^14",
|
||||
"chai": "^4.2",
|
||||
"dtslint": "^3.3.0",
|
||||
"eslint": "^6.6.0",
|
||||
"eslint": "^7.0.0",
|
||||
"mocha": "^7.0.0",
|
||||
"nyc": "^15.0.0",
|
||||
"rimraf": "^3.0.0",
|
||||
@@ -63,9 +36,35 @@
|
||||
"sinon-chai": "^3.3.0",
|
||||
"upath": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/*.js",
|
||||
"types/index.d.ts"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/paulmillr/chokidar.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/paulmillr/chokidar/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"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"
|
||||
},
|
||||
"keywords": [
|
||||
"fs",
|
||||
"watch",
|
||||
"watchFile",
|
||||
"watcher",
|
||||
"watching",
|
||||
"file",
|
||||
"fsevents"
|
||||
],
|
||||
"types": "./types/index.d.ts",
|
||||
"eslintConfig": {
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
@@ -116,24 +115,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"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",
|
||||
@@ -143,20 +124,5 @@
|
||||
"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.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user