NUEVA BUSQUEDA DE DATOS SRI
This commit is contained in:
28
node_modules/chokidar/README.md
generated
vendored
28
node_modules/chokidar/README.md
generated
vendored
@@ -1,11 +1,9 @@
|
||||
# Chokidar [](https://github.com/paulmillr/chokidar) [](https://github.com/paulmillr/chokidar)
|
||||
|
||||
> A neat wrapper around Node.js fs.watch / fs.watchFile / FSEvents.
|
||||
> Minimal and efficient cross-platform file watching library
|
||||
|
||||
[](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`:
|
||||
@@ -15,6 +13,7 @@ Node.js `fs.watch`:
|
||||
* Often reports events twice.
|
||||
* Emits most changes as `rename`.
|
||||
* Does not provide an easy way to recursively watch file trees.
|
||||
* Does not support recursive watching on Linux.
|
||||
|
||||
Node.js `fs.watchFile`:
|
||||
|
||||
@@ -35,6 +34,8 @@ Initially made for **[Brunch](https://brunch.io/)** (an ultra-swift web app buil
|
||||
and [many others](https://www.npmjs.com/browse/depended/chokidar).
|
||||
It has proven itself in production environments.
|
||||
|
||||
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/)
|
||||
|
||||
## How?
|
||||
|
||||
Chokidar does still rely on the Node.js core `fs` module, but when using
|
||||
@@ -46,7 +47,7 @@ On MacOS, chokidar by default uses a native extension exposing the Darwin
|
||||
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
|
||||
On most 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
|
||||
@@ -74,7 +75,7 @@ chokidar.watch('.').on('all', (event, path) => {
|
||||
## API
|
||||
|
||||
```javascript
|
||||
// Example of a more typical implementation structure:
|
||||
// Example of a more typical implementation structure
|
||||
|
||||
// Initialize watcher.
|
||||
const watcher = chokidar.watch('file, dir, glob, or array', {
|
||||
@@ -114,7 +115,7 @@ watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);
|
||||
var watchedPaths = watcher.getWatched();
|
||||
|
||||
// Un-watch some files.
|
||||
watcher.unwatch('new-file*');
|
||||
await watcher.unwatch('new-file*');
|
||||
|
||||
// Stop watching.
|
||||
// The method is async!
|
||||
@@ -255,7 +256,7 @@ 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.
|
||||
* `.close()`: Removes all listeners from watched files. Asynchronous, returns Promise.
|
||||
* `.close()`: **async** Removes all listeners from watched files. Asynchronous, returns Promise. Use with `await` to ensure bugs don't happen.
|
||||
* `.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
|
||||
@@ -264,7 +265,7 @@ 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
|
||||
[chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), allowing you to
|
||||
execute a command on each change, or get a stdio stream of change events.
|
||||
|
||||
## Install Troubleshooting
|
||||
@@ -286,8 +287,9 @@ execute a command on each change, or get a stdio stream of change events.
|
||||
## Changelog
|
||||
|
||||
For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md).
|
||||
|
||||
- **v3.3 (Nov 2, 2019):** `FSWatcher#close()` method became async.
|
||||
- **v3.5 (Jan 6, 2021):** Support for ARM Macs with Apple Silicon. Fixes for deleted symlinks.
|
||||
- **v3.4 (Apr 26, 2020):** Support for directory-based symlinks. Fixes for macos file replacement.
|
||||
- **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.
|
||||
@@ -295,6 +297,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.
|
||||
|
||||
77
node_modules/chokidar/index.js
generated
vendored
77
node_modules/chokidar/index.js
generated
vendored
@@ -34,6 +34,7 @@ const {
|
||||
REPLACER_RE,
|
||||
|
||||
SLASH,
|
||||
SLASH_SLASH,
|
||||
BRACE_START,
|
||||
BANG,
|
||||
ONE_DOT,
|
||||
@@ -47,7 +48,8 @@ const {
|
||||
EMPTY_FN,
|
||||
|
||||
isWindows,
|
||||
isMacos
|
||||
isMacos,
|
||||
isIBMi
|
||||
} = require('./lib/constants');
|
||||
|
||||
const stat = promisify(fs.stat);
|
||||
@@ -96,11 +98,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;
|
||||
};
|
||||
|
||||
@@ -152,12 +163,13 @@ class DirEntry {
|
||||
const {items} = this;
|
||||
if (!items) return;
|
||||
items.delete(item);
|
||||
if (items.size > 0) return;
|
||||
|
||||
if (!items.size) {
|
||||
const dir = this.path;
|
||||
try {
|
||||
await readdir(dir);
|
||||
} catch (err) {
|
||||
const dir = this.path;
|
||||
try {
|
||||
await readdir(dir);
|
||||
} catch (err) {
|
||||
if (this._removeWatcher) {
|
||||
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
|
||||
}
|
||||
}
|
||||
@@ -319,6 +331,11 @@ constructor(_opts) {
|
||||
opts.usePolling = isMacos;
|
||||
}
|
||||
|
||||
// Always default to polling on IBM i because fs.watch() is not available on IBM i.
|
||||
if(isIBMi) {
|
||||
opts.usePolling = true;
|
||||
}
|
||||
|
||||
// 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;
|
||||
@@ -483,7 +500,7 @@ unwatch(paths_) {
|
||||
* @returns {Promise<void>}.
|
||||
*/
|
||||
close() {
|
||||
if (this.closed) return this;
|
||||
if (this.closed) return this._closePromise;
|
||||
this.closed = true;
|
||||
|
||||
// Memory management.
|
||||
@@ -501,7 +518,9 @@ close() {
|
||||
['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => {
|
||||
this[`_${key}`].clear();
|
||||
});
|
||||
return closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve();
|
||||
|
||||
this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve();
|
||||
return this._closePromise;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -602,16 +621,15 @@ async _emit(event, path, val1, val2, val3) {
|
||||
(event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)
|
||||
) {
|
||||
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
|
||||
let stats;
|
||||
try {
|
||||
const stats = await stat(fullPath);
|
||||
// Suppress event when fs_stat fails, to avoid sending undefined 'stat'
|
||||
if (!stats) return;
|
||||
args.push(stats);
|
||||
this.emitWithAll(event, args);
|
||||
stats = await stat(fullPath);
|
||||
} catch (err) {}
|
||||
} else {
|
||||
this.emitWithAll(event, args);
|
||||
// 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;
|
||||
}
|
||||
@@ -820,13 +838,15 @@ _hasReadPermissions(stats) {
|
||||
* @param {String} item base path of item/directory
|
||||
* @returns {void}
|
||||
*/
|
||||
_remove(directory, item) {
|
||||
_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);
|
||||
const isDirectory = this._watched.has(path) || this._watched.has(fullPath);
|
||||
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)
|
||||
@@ -850,6 +870,15 @@ _remove(directory, item) {
|
||||
const wasTracked = parent.has(item);
|
||||
parent.remove(item);
|
||||
|
||||
// Fixes issue #1042 -> Relative paths were detected and added as symlinks
|
||||
// (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),
|
||||
// but never removed from the map in case the path was deleted.
|
||||
// This leads to an incorrect state if the path was recreated:
|
||||
// https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553
|
||||
if (this._symlinkPaths.has(fullPath)) {
|
||||
this._symlinkPaths.delete(fullPath);
|
||||
}
|
||||
|
||||
// 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);
|
||||
@@ -872,16 +901,24 @@ _remove(directory, item) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
5
node_modules/chokidar/lib/constants.js
generated
vendored
5
node_modules/chokidar/lib/constants.js
generated
vendored
@@ -2,6 +2,7 @@
|
||||
|
||||
const {sep} = require('path');
|
||||
const {platform} = process;
|
||||
const os = require('os');
|
||||
|
||||
exports.EV_ALL = 'all';
|
||||
exports.EV_READY = 'ready';
|
||||
@@ -23,6 +24,7 @@ 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';
|
||||
|
||||
@@ -40,6 +42,7 @@ exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
||||
exports.REPLACER_RE = /^\.[/\\]/;
|
||||
|
||||
exports.SLASH = '/';
|
||||
exports.SLASH_SLASH = '//';
|
||||
exports.BRACE_START = '{';
|
||||
exports.BANG = '!';
|
||||
exports.ONE_DOT = '.';
|
||||
@@ -58,3 +61,5 @@ exports.IDENTITY_FN = val => val;
|
||||
|
||||
exports.isWindows = platform === 'win32';
|
||||
exports.isMacos = platform === 'darwin';
|
||||
exports.isLinux = platform === 'linux';
|
||||
exports.isIBMi = os.type() === 'OS400';
|
||||
|
||||
48
node_modules/chokidar/lib/fsevents-handler.js
generated
vendored
48
node_modules/chokidar/lib/fsevents-handler.js
generated
vendored
@@ -37,6 +37,7 @@ const {
|
||||
FSEVENT_MOVED,
|
||||
// FSEVENT_CLONED,
|
||||
FSEVENT_UNKNOWN,
|
||||
FSEVENT_TYPE_FILE,
|
||||
FSEVENT_TYPE_DIRECTORY,
|
||||
FSEVENT_TYPE_SYMLINK,
|
||||
|
||||
@@ -47,13 +48,10 @@ const {
|
||||
EMPTY_FN,
|
||||
IDENTITY_FN
|
||||
} = require('./constants');
|
||||
const FS_MODE_READ = 'r';
|
||||
|
||||
const Depth = (value) => isNaN(value) ? {} : {depth: value};
|
||||
|
||||
const stat = promisify(fs.stat);
|
||||
const open = promisify(fs.open);
|
||||
const close = promisify(fs.close);
|
||||
const lstat = promisify(fs.lstat);
|
||||
const realpath = promisify(fs.realpath);
|
||||
|
||||
@@ -105,8 +103,9 @@ 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) {
|
||||
let watchPath = sysPath.extname(path) ? sysPath.dirname(path) : path;
|
||||
function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
||||
let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
|
||||
|
||||
const parentPath = sysPath.dirname(watchPath);
|
||||
let cont = FSEventsWatchers.get(watchPath);
|
||||
|
||||
@@ -148,7 +147,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);
|
||||
@@ -202,6 +201,14 @@ const calcDepth = (path, root) => {
|
||||
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
|
||||
*/
|
||||
@@ -232,13 +239,15 @@ addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
||||
this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
|
||||
async checkFd(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
||||
async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
||||
try {
|
||||
const fd = await open(path, FS_MODE_READ);
|
||||
const stats = await stat(path)
|
||||
if (this.fsw.closed) return;
|
||||
await close(fd);
|
||||
if (this.fsw.closed) return;
|
||||
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
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);
|
||||
@@ -252,9 +261,10 @@ handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opt
|
||||
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 (info.type === FSEVENT_TYPE_DIRECTORY || watchedDir.has(item)) {
|
||||
this.fsw._remove(parent, item);
|
||||
if (isDirectory || watchedDir.has(item)) {
|
||||
this.fsw._remove(parent, item, isDirectory);
|
||||
}
|
||||
} else {
|
||||
if (event === EV_ADD) {
|
||||
@@ -290,8 +300,7 @@ handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opt
|
||||
* @returns {Function} closer for the watcher instance
|
||||
*/
|
||||
_watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
||||
if (this.fsw.closed) return;
|
||||
if (this.fsw._isIgnored(watchPath)) return;
|
||||
if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return;
|
||||
const opts = this.fsw.options;
|
||||
const watchCallback = async (fullPath, flags, info) => {
|
||||
if (this.fsw.closed) return;
|
||||
@@ -319,13 +328,13 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
||||
} catch (error) {}
|
||||
if (this.fsw.closed) return;
|
||||
if (this.checkIgnored(path, stats)) return;
|
||||
if (stats) {
|
||||
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.checkFd(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
} else {
|
||||
switch (info.event) {
|
||||
@@ -334,7 +343,7 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
||||
return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
case FSEVENT_DELETED:
|
||||
case FSEVENT_MOVED:
|
||||
return this.checkFd(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -343,8 +352,7 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
||||
watchPath,
|
||||
realPath,
|
||||
watchCallback,
|
||||
this.fsw._emitRaw,
|
||||
this.fsw
|
||||
this.fsw._emitRaw
|
||||
);
|
||||
|
||||
this.fsw._emitReady();
|
||||
|
||||
33
node_modules/chokidar/lib/nodefs-handler.js
generated
vendored
33
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)) {
|
||||
@@ -413,7 +421,15 @@ async _handleSymlink(entry, directory, path, item) {
|
||||
if (!this.fsw.options.followSymlinks) {
|
||||
// watch symlink directly (don't follow) and detect changes
|
||||
this.fsw._incrReadyCount();
|
||||
const linkPath = await fsrealpath(path);
|
||||
|
||||
let linkPath;
|
||||
try {
|
||||
linkPath = await fsrealpath(path);
|
||||
} catch (e) {
|
||||
this.fsw._emitReady();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.fsw.closed) return;
|
||||
if (dir.has(item)) {
|
||||
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
||||
@@ -595,13 +611,14 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
||||
const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START);
|
||||
let closer;
|
||||
if (stats.isDirectory()) {
|
||||
const absPath = sysPath.resolve(path);
|
||||
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);
|
||||
if (absPath !== targetPath && targetPath !== undefined) {
|
||||
this.fsw._symlinkPaths.set(absPath, targetPath);
|
||||
}
|
||||
} else if (stats.isSymbolicLink()) {
|
||||
const targetPath = follow ? await fsrealpath(path) : path;
|
||||
|
||||
221
node_modules/chokidar/package.json
generated
vendored
221
node_modules/chokidar/package.json
generated
vendored
@@ -1,168 +1,71 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"chokidar@^3.2.2",
|
||||
"/home/pablinux/Projects/Node/app_sigma/node_modules/nodemon"
|
||||
]
|
||||
"name": "chokidar",
|
||||
"description": "Minimal and efficient cross-platform file watching library",
|
||||
"version": "3.5.3",
|
||||
"homepage": "https://github.com/paulmillr/chokidar",
|
||||
"author": "Paul Miller (https://paulmillr.com)",
|
||||
"contributors": [
|
||||
"Paul Miller (https://paulmillr.com)",
|
||||
"Elan Shanker"
|
||||
],
|
||||
"_from": "chokidar@>=3.2.2 <4.0.0",
|
||||
"_hasShrinkwrap": false,
|
||||
"_id": "chokidar@3.3.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/chokidar",
|
||||
"_nodeVersion": "13.2.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/chokidar_3.3.1_1576434724275_0.9223256192495166"
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "paul@paulmillr.com",
|
||||
"name": "paulmillr"
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"anymatch": "~3.1.2",
|
||||
"braces": "~3.0.2",
|
||||
"glob-parent": "~5.1.2",
|
||||
"is-binary-path": "~2.1.0",
|
||||
"is-glob": "~4.0.1",
|
||||
"normalize-path": "~3.0.0",
|
||||
"readdirp": "~3.6.0"
|
||||
},
|
||||
"_npmVersion": "6.13.4",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "chokidar",
|
||||
"raw": "chokidar@^3.2.2",
|
||||
"rawSpec": "^3.2.2",
|
||||
"scope": null,
|
||||
"spec": ">=3.2.2 <4.0.0",
|
||||
"type": "range"
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nodemon"
|
||||
"devDependencies": {
|
||||
"@types/node": "^14",
|
||||
"chai": "^4.3",
|
||||
"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",
|
||||
"typescript": "~4.4.3",
|
||||
"upath": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/*.js",
|
||||
"types/index.d.ts"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz",
|
||||
"_shasum": "c84e5b3d18d9a4d77558fef466b1bf16bbeb3450",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "chokidar@^3.2.2",
|
||||
"_where": "/home/pablinux/Projects/Node/app_sigma/node_modules/nodemon",
|
||||
"author": {
|
||||
"name": "Paul Miller",
|
||||
"url": "https://paulmillr.com"
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/paulmillr/chokidar.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/paulmillr/chokidar/issues"
|
||||
},
|
||||
"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.3.0"
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dtslint": "dtslint types",
|
||||
"lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .",
|
||||
"mocha": "mocha --exit --timeout 90000",
|
||||
"test": "npm run lint && npm run mocha"
|
||||
},
|
||||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12",
|
||||
"chai": "^4.2",
|
||||
"dtslint": "^2.0.0",
|
||||
"eslint": "^6.6.0",
|
||||
"mocha": "^6.2.2",
|
||||
"nyc": "^14.1.1",
|
||||
"rimraf": "^3.0.0",
|
||||
"sinon": "^7.5.0",
|
||||
"sinon-chai": "^3.3.0",
|
||||
"upath": "^1.2.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"fileCount": 8,
|
||||
"integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==",
|
||||
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd9nwkCRA9TVsSAnZWagAAWecQAJTV/2rFLSfg7hu6hPAJ\n05dq/71D1/SiO/auUV1NUK/txOj3cCEZ+7j5oj9/Qa+GjUPPRbpmY53GGp9G\nFQ1tXPHPganu3XLM8PX+DpsJOJAOHgE/EH5ODLZuOISidHvLJ9DQu/EJsrjo\nTlmC+pIABvJfGDdNFntwq+tES37vsWo9+fnYiJr8GqNeaWHEn4rpqU76MTeB\noYFxzhSRES1pqgqYU9dN9KMoOSFwVVOPTgY4hTgjWYAZfioDfiWHhpK5dpnI\nq4NFoUjTSeQU1smhklpqFqsd9P4M1tvWq+abBCrcb9mSOozjpF/EJmnPSjiH\necFyXBy17nDtZ1zUsJE+4Rubatv+6Xp//45xt0ATjGsJ91mGU+f15pPrztQv\ntQKX+dQ7/FYjzQCmQuO1rgcboCQ2Tzes8Gigr52UTsInggDjZ7sst30jybby\nu51TatZ7eip3MgkGROJuMQj4swJy1xQ+PmLVZ4b+gn3rNuxqSd+qCjR/HC8g\nBRhbNrZk7wLPHQcqlqnWxP/X8zVSykpgkwVbtVulTUV8Nxtcf2TW6ZGe62zr\nV5ifkXvVTW5d1lfjmrY4Pa2N2Gtdkn1IeYFfBWOivjUNPT0uOf5CTFGED80H\nICYQVZK6FtMB65K1r+pcoHjnfeaP1SGEevK4ddRRt6wkyeBgvenwYBWn05tW\nd93I\r\n=pIg2\r\n-----END PGP SIGNATURE-----\r\n",
|
||||
"shasum": "c84e5b3d18d9a4d77558fef466b1bf16bbeb3450",
|
||||
"tarball": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz",
|
||||
"unpackedSize": 88037
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 9,
|
||||
"sourceType": "script"
|
||||
},
|
||||
"rules": {
|
||||
"array-callback-return": "error",
|
||||
"no-empty": [
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
},
|
||||
"error"
|
||||
],
|
||||
"no-lonely-if": "error",
|
||||
"no-var": "error",
|
||||
"object-shorthand": "error",
|
||||
"prefer-arrow-callback": [
|
||||
{
|
||||
"allowNamedFunctions": true
|
||||
},
|
||||
"error"
|
||||
],
|
||||
"prefer-const": [
|
||||
{
|
||||
"ignoreReadBeforeAssign": true
|
||||
},
|
||||
"error"
|
||||
],
|
||||
"prefer-destructuring": [
|
||||
{
|
||||
"object": true,
|
||||
"array": false
|
||||
},
|
||||
"error"
|
||||
],
|
||||
"prefer-spread": "error",
|
||||
"prefer-template": "error",
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"radix": "error",
|
||||
"strict": "error"
|
||||
}
|
||||
},
|
||||
"gitHead": "1cbbef6bf8d382433011ef295ccfaf52da6038ed",
|
||||
"homepage": "https://github.com/paulmillr/chokidar",
|
||||
"keywords": [
|
||||
"file",
|
||||
"fs",
|
||||
"fsevents",
|
||||
"watch",
|
||||
"watchFile",
|
||||
"watcher",
|
||||
"watching"
|
||||
"watching",
|
||||
"file",
|
||||
"fsevents"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "es128",
|
||||
"email": "elan.shanker+npm@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "paulmillr",
|
||||
"email": "paul@paulmillr.com"
|
||||
}
|
||||
],
|
||||
"name": "chokidar",
|
||||
"types": "./types/index.d.ts",
|
||||
"nyc": {
|
||||
"include": [
|
||||
"index.js",
|
||||
@@ -173,20 +76,10 @@
|
||||
"text"
|
||||
]
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.1.2"
|
||||
},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"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.3.1"
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
7
node_modules/chokidar/types/index.d.ts
generated
vendored
7
node_modules/chokidar/types/index.d.ts
generated
vendored
@@ -4,6 +4,7 @@
|
||||
|
||||
import * as fs from "fs";
|
||||
import { EventEmitter } from "events";
|
||||
import { Matcher } from 'anymatch';
|
||||
|
||||
export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
options: WatchOptions;
|
||||
@@ -17,13 +18,13 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
|
||||
* string.
|
||||
*/
|
||||
add(paths: string | ReadonlyArray<string>): void;
|
||||
add(paths: string | ReadonlyArray<string>): this;
|
||||
|
||||
/**
|
||||
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
|
||||
* string.
|
||||
*/
|
||||
unwatch(paths: string | ReadonlyArray<string>): void;
|
||||
unwatch(paths: string | ReadonlyArray<string>): this;
|
||||
|
||||
/**
|
||||
* Returns an object representing all the paths on the file system being watched by this
|
||||
@@ -79,7 +80,7 @@ export interface WatchOptions {
|
||||
* (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;
|
||||
ignored?: Matcher;
|
||||
|
||||
/**
|
||||
* If set to `false` then `add`/`addDir` events are also emitted for matching paths while
|
||||
|
||||
Reference in New Issue
Block a user