Changeset 79a0317 for imaps-frontend/node_modules/chokidar
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- Location:
- imaps-frontend/node_modules/chokidar
- Files:
-
- 8 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/chokidar/README.md
r0c6b92a r79a0317 113 113 114 114 awaitWriteFinish: true, // emit single event when chunked writes are completed 115 atomic: true // emit proper events when "atomic writes" (mv _tmp file) are used115 atomic: true, // emit proper events when "atomic writes" (mv _tmp file) are used 116 116 117 117 // The options also allow specifying custom intervals in ms … … 121 121 // }, 122 122 // atomic: 100, 123 123 124 interval: 100, 124 125 binaryInterval: 300, … … 236 237 values are arrays of the names of the items contained in each directory. 237 238 238 ## CLI 239 240 If you need a CLI interface for your file watching, check out 241 third party [chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), allowing you to 242 execute a command on each change, or get a stdio stream of change events. 239 ### CLI 240 241 Check out third party [chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), 242 which allows to execute a command on each change, or get a stdio stream of change events. 243 243 244 244 ## Troubleshooting 245 245 246 * On Linux, sometimes there's `ENOSP` error: 247 * `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell` 248 `Error: watch /home/ ENOSPC` 249 * This means Chokidar ran out of file handles and you'll need to increase their count by executing the following command in Terminal: 250 `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p` 251 * If using 3.x, upgrade to latest chokidar to prevent fsevents-related issues: 252 * `npm WARN optional dep failed, continuing fsevents@n.n.n` 253 * `TypeError: fsevents is not a constructor` 246 Sometimes, Chokidar runs out of file handles, causing `EMFILE` and `ENOSP` errors: 247 248 * `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell` 249 * `Error: watch /home/ ENOSPC` 250 251 There are two things that can cause it. 252 253 1. Exhausted file handles for generic fs operations 254 - Can be solved by using [graceful-fs](https://www.npmjs.com/package/graceful-fs), 255 which can monkey-patch native `fs` module used by chokidar: `let fs = require('fs'); let grfs = require('graceful-fs'); grfs.gracefulify(fs);` 256 - Can also be solved by tuning OS: `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`. 257 2. Exhausted file handles for `fs.watch` 258 - Can't seem to be solved by graceful-fs or OS tuning 259 - It's possible to start using `usePolling: true`, which will switch backend to resource-intensive `fs.watchFile` 260 261 All fsevents-related issues (`WARN optional dep failed`, `fsevents is not a constructor`) are solved by upgrading to v4+. 254 262 255 263 ## Changelog … … 278 286 // other way 279 287 import { glob } from 'node:fs/promises'; 280 const watcher = watch(await glob('**/*.js'));288 const watcher = watch(await Array.fromAsync(glob('**/*.js'))); 281 289 282 290 // unwatching -
imaps-frontend/node_modules/chokidar/esm/handler.d.ts
r0c6b92a r79a0317 11 11 export declare const isMacos: boolean; 12 12 export declare const isLinux: boolean; 13 export declare const isFreeBSD: boolean; 13 14 export declare const isIBMi: boolean; 14 15 export declare const EVENTS: { … … 88 89 _addToNodeFs(path: string, initialAdd: boolean, priorWh: WatchHelper | undefined, depth: number, target?: string): Promise<string | false | undefined>; 89 90 } 90 //# sourceMappingURL=handler.d.ts.map -
imaps-frontend/node_modules/chokidar/esm/handler.js
r0c6b92a r79a0317 12 12 export const isMacos = pl === 'darwin'; 13 13 export const isLinux = pl === 'linux'; 14 export const isFreeBSD = pl === 'freebsd'; 14 15 export const isIBMi = osType() === 'OS400'; 15 16 export const EVENTS = { … … 360 361 this.fsw._emit(EV.CHANGE, file, newStats); 361 362 } 362 if ((isMacos || isLinux ) && prevStats.ino !== newStats.ino) {363 if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats.ino) { 363 364 this.fsw._closeFile(path); 364 365 prevStats = newStats; … … 627 628 } 628 629 } 629 //# sourceMappingURL=handler.js.map -
imaps-frontend/node_modules/chokidar/esm/index.d.ts
r0c6b92a r79a0317 1 /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */ 1 2 import { Stats } from 'fs'; 2 3 import { EventEmitter } from 'events'; 3 4 import { ReaddirpStream, ReaddirpOptions, EntryInfo } from 'readdirp'; 4 import { NodeFsHandler, EventName, Path } from './handler.js';5 import { NodeFsHandler, EventName, Path, EVENTS as EV, WatchHandlers } from './handler.js'; 5 6 type AWF = { 6 7 stabilityThreshold: number; … … 34 35 }; 35 36 export type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change'; 36 export type EmitArgs = [EventName, Path | Error, any?, any?, any?]; 37 export type EmitArgs = [path: Path, stats?: Stats]; 38 export type EmitErrorArgs = [error: Error, stats?: Stats]; 39 export type EmitArgsWithName = [event: EventName, ...EmitArgs]; 37 40 export type MatchFunction = (val: string, stats?: Stats) => boolean; 38 41 export interface MatcherObject { … … 68 71 filterDir(entry: EntryInfo): boolean; 69 72 } 73 export interface FSWatcherKnownEventMap { 74 [EV.READY]: []; 75 [EV.RAW]: Parameters<WatchHandlers['rawEmitter']>; 76 [EV.ERROR]: Parameters<WatchHandlers['errHandler']>; 77 [EV.ALL]: [event: EventName, ...EmitArgs]; 78 } 79 export type FSWatcherEventMap = FSWatcherKnownEventMap & { 80 [k in Exclude<EventName, keyof FSWatcherKnownEventMap>]: EmitArgs; 81 }; 70 82 /** 71 83 * Watches files & directories for changes. Emitted events: … … 76 88 * .on('add', path => log('File', path, 'was added')) 77 89 */ 78 export declare class FSWatcher extends EventEmitter {90 export declare class FSWatcher extends EventEmitter<FSWatcherEventMap> { 79 91 closed: boolean; 80 92 options: FSWInstanceOptions; … … 86 98 _watched: Map<string, DirEntry>; 87 99 _pendingWrites: Map<string, any>; 88 _pendingUnlinks: Map<string, EmitArgs >;100 _pendingUnlinks: Map<string, EmitArgsWithName>; 89 101 _readyCount: number; 90 102 _emitReady: () => void; … … 92 104 _userIgnored?: MatchFunction; 93 105 _readyEmitted: boolean; 94 _emitRaw: () => void;106 _emitRaw: WatchHandlers['rawEmitter']; 95 107 _boundRemove: (dir: string, item: string) => void; 96 108 _nodeFsHandler: NodeFsHandler; … … 202 214 }; 203 215 export default _default; 204 //# sourceMappingURL=index.d.ts.map -
imaps-frontend/node_modules/chokidar/esm/index.js
r0c6b92a r79a0317 1 /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */ 1 2 import { stat as statcb } from 'fs'; 2 3 import { stat, readdir } from 'fs/promises'; … … 428 429 } 429 430 emitWithAll(event, args) { 430 this.emit( ...args);431 this.emit(event, ...args); 431 432 if (event !== EV.ERROR) 432 this.emit(EV.ALL, ...args);433 this.emit(EV.ALL, event, ...args); 433 434 } 434 435 // Common helpers … … 450 451 if (opts.cwd) 451 452 path = sysPath.relative(opts.cwd, path); 452 const args = [ event,path];453 const args = [path]; 453 454 if (stats != null) 454 455 args.push(stats); … … 461 462 if (opts.atomic) { 462 463 if (event === EV.UNLINK) { 463 this._pendingUnlinks.set(path, args);464 this._pendingUnlinks.set(path, [event, ...args]); 464 465 setTimeout(() => { 465 466 this._pendingUnlinks.forEach((entry, path) => { … … 472 473 } 473 474 if (event === EV.ADD && this._pendingUnlinks.has(path)) { 474 event = args[0] =EV.CHANGE;475 event = EV.CHANGE; 475 476 this._pendingUnlinks.delete(path); 476 477 } … … 479 480 const awfEmit = (err, stats) => { 480 481 if (err) { 481 event = args[0] =EV.ERROR;482 args[ 1] = err;482 event = EV.ERROR; 483 args[0] = err; 483 484 this.emitWithAll(event, args); 484 485 } 485 486 else if (stats) { 486 487 // if stats doesn't exist the file must have been deleted 487 if (args.length > 2) {488 args[ 2] = stats;488 if (args.length > 1) { 489 args[1] = stats; 489 490 } 490 491 else { … … 796 797 } 797 798 export default { watch, FSWatcher }; 798 //# sourceMappingURL=index.js.map -
imaps-frontend/node_modules/chokidar/handler.d.ts
r0c6b92a r79a0317 11 11 export declare const isMacos: boolean; 12 12 export declare const isLinux: boolean; 13 export declare const isFreeBSD: boolean; 13 14 export declare const isIBMi: boolean; 14 15 export declare const EVENTS: { … … 88 89 _addToNodeFs(path: string, initialAdd: boolean, priorWh: WatchHelper | undefined, depth: number, target?: string): Promise<string | false | undefined>; 89 90 } 90 //# sourceMappingURL=handler.d.ts.map -
imaps-frontend/node_modules/chokidar/handler.js
r0c6b92a r79a0317 1 1 "use strict"; 2 2 Object.defineProperty(exports, "__esModule", { value: true }); 3 exports.NodeFsHandler = exports.EVENTS = exports.isIBMi = exports.is Linux = exports.isMacos = exports.isWindows = exports.IDENTITY_FN = exports.EMPTY_FN = exports.STR_CLOSE = exports.STR_END = exports.STR_DATA = void 0;3 exports.NodeFsHandler = exports.EVENTS = exports.isIBMi = exports.isFreeBSD = exports.isLinux = exports.isMacos = exports.isWindows = exports.IDENTITY_FN = exports.EMPTY_FN = exports.STR_CLOSE = exports.STR_END = exports.STR_DATA = void 0; 4 4 const fs_1 = require("fs"); 5 5 const promises_1 = require("fs/promises"); … … 17 17 exports.isMacos = pl === 'darwin'; 18 18 exports.isLinux = pl === 'linux'; 19 exports.isFreeBSD = pl === 'freebsd'; 19 20 exports.isIBMi = (0, os_1.type)() === 'OS400'; 20 21 exports.EVENTS = { … … 365 366 this.fsw._emit(EV.CHANGE, file, newStats); 366 367 } 367 if ((exports.isMacos || exports.isLinux ) && prevStats.ino !== newStats.ino) {368 if ((exports.isMacos || exports.isLinux || exports.isFreeBSD) && prevStats.ino !== newStats.ino) { 368 369 this.fsw._closeFile(path); 369 370 prevStats = newStats; … … 633 634 } 634 635 exports.NodeFsHandler = NodeFsHandler; 635 //# sourceMappingURL=handler.js.map -
imaps-frontend/node_modules/chokidar/index.d.ts
r0c6b92a r79a0317 1 /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */ 1 2 import { Stats } from 'fs'; 2 3 import { EventEmitter } from 'events'; 3 4 import { ReaddirpStream, ReaddirpOptions, EntryInfo } from 'readdirp'; 4 import { NodeFsHandler, EventName, Path } from './handler.js';5 import { NodeFsHandler, EventName, Path, EVENTS as EV, WatchHandlers } from './handler.js'; 5 6 type AWF = { 6 7 stabilityThreshold: number; … … 34 35 }; 35 36 export type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change'; 36 export type EmitArgs = [EventName, Path | Error, any?, any?, any?]; 37 export type EmitArgs = [path: Path, stats?: Stats]; 38 export type EmitErrorArgs = [error: Error, stats?: Stats]; 39 export type EmitArgsWithName = [event: EventName, ...EmitArgs]; 37 40 export type MatchFunction = (val: string, stats?: Stats) => boolean; 38 41 export interface MatcherObject { … … 68 71 filterDir(entry: EntryInfo): boolean; 69 72 } 73 export interface FSWatcherKnownEventMap { 74 [EV.READY]: []; 75 [EV.RAW]: Parameters<WatchHandlers['rawEmitter']>; 76 [EV.ERROR]: Parameters<WatchHandlers['errHandler']>; 77 [EV.ALL]: [event: EventName, ...EmitArgs]; 78 } 79 export type FSWatcherEventMap = FSWatcherKnownEventMap & { 80 [k in Exclude<EventName, keyof FSWatcherKnownEventMap>]: EmitArgs; 81 }; 70 82 /** 71 83 * Watches files & directories for changes. Emitted events: … … 76 88 * .on('add', path => log('File', path, 'was added')) 77 89 */ 78 export declare class FSWatcher extends EventEmitter {90 export declare class FSWatcher extends EventEmitter<FSWatcherEventMap> { 79 91 closed: boolean; 80 92 options: FSWInstanceOptions; … … 86 98 _watched: Map<string, DirEntry>; 87 99 _pendingWrites: Map<string, any>; 88 _pendingUnlinks: Map<string, EmitArgs >;100 _pendingUnlinks: Map<string, EmitArgsWithName>; 89 101 _readyCount: number; 90 102 _emitReady: () => void; … … 92 104 _userIgnored?: MatchFunction; 93 105 _readyEmitted: boolean; 94 _emitRaw: () => void;106 _emitRaw: WatchHandlers['rawEmitter']; 95 107 _boundRemove: (dir: string, item: string) => void; 96 108 _nodeFsHandler: NodeFsHandler; … … 202 214 }; 203 215 export default _default; 204 //# sourceMappingURL=index.d.ts.map -
imaps-frontend/node_modules/chokidar/index.js
r0c6b92a r79a0317 3 3 exports.FSWatcher = exports.WatchHelper = void 0; 4 4 exports.watch = watch; 5 /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */ 5 6 const fs_1 = require("fs"); 6 7 const promises_1 = require("fs/promises"); … … 433 434 } 434 435 emitWithAll(event, args) { 435 this.emit( ...args);436 this.emit(event, ...args); 436 437 if (event !== handler_js_1.EVENTS.ERROR) 437 this.emit(handler_js_1.EVENTS.ALL, ...args);438 this.emit(handler_js_1.EVENTS.ALL, event, ...args); 438 439 } 439 440 // Common helpers … … 455 456 if (opts.cwd) 456 457 path = sysPath.relative(opts.cwd, path); 457 const args = [ event,path];458 const args = [path]; 458 459 if (stats != null) 459 460 args.push(stats); … … 466 467 if (opts.atomic) { 467 468 if (event === handler_js_1.EVENTS.UNLINK) { 468 this._pendingUnlinks.set(path, args);469 this._pendingUnlinks.set(path, [event, ...args]); 469 470 setTimeout(() => { 470 471 this._pendingUnlinks.forEach((entry, path) => { … … 477 478 } 478 479 if (event === handler_js_1.EVENTS.ADD && this._pendingUnlinks.has(path)) { 479 event = args[0] =handler_js_1.EVENTS.CHANGE;480 event = handler_js_1.EVENTS.CHANGE; 480 481 this._pendingUnlinks.delete(path); 481 482 } … … 484 485 const awfEmit = (err, stats) => { 485 486 if (err) { 486 event = args[0] =handler_js_1.EVENTS.ERROR;487 args[ 1] = err;487 event = handler_js_1.EVENTS.ERROR; 488 args[0] = err; 488 489 this.emitWithAll(event, args); 489 490 } 490 491 else if (stats) { 491 492 // if stats doesn't exist the file must have been deleted 492 if (args.length > 2) {493 args[ 2] = stats;493 if (args.length > 1) { 494 args[1] = stats; 494 495 } 495 496 else { … … 802 803 } 803 804 exports.default = { watch, FSWatcher }; 804 //# sourceMappingURL=index.js.map -
imaps-frontend/node_modules/chokidar/package.json
r0c6b92a r79a0317 1 1 { 2 "name": "chokidar", 3 "description": "Minimal and efficient cross-platform file watching library", 4 "version": "4.0.1", 5 "homepage": "https://github.com/paulmillr/chokidar", 6 "author": "Paul Miller (https://paulmillr.com)", 7 "files": [ 8 "index.js", 9 "index.d.ts", 10 "index.d.ts.map", 11 "index.js.map", 12 "handler.js", 13 "handler.d.ts", 14 "handler.d.ts.map", 15 "handler.js.map", 16 "esm" 2 "_from": "chokidar@4.0.3", 3 "_id": "chokidar@4.0.3", 4 "_inBundle": false, 5 "_integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", 6 "_location": "/chokidar", 7 "_phantomChildren": {}, 8 "_requested": { 9 "type": "version", 10 "registry": true, 11 "raw": "chokidar@4.0.3", 12 "name": "chokidar", 13 "escapedName": "chokidar", 14 "rawSpec": "4.0.3", 15 "saveSpec": null, 16 "fetchSpec": "4.0.3" 17 }, 18 "_requiredBy": [ 19 "/sass" 17 20 ], 18 "main": "./index.js", 19 "module": "./esm/index.js", 20 "types": "./index.d.ts", 21 "exports": { 22 ".": { 23 "import": "./esm/index.js", 24 "require": "./index.js" 25 }, 26 "./handler.js": { 27 "import": "./esm/handler.js", 28 "require": "./handler.js" 29 } 21 "_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", 22 "_shasum": "7be37a4c03c9aee1ecfe862a4a23b2c70c205d30", 23 "_spec": "chokidar@4.0.3", 24 "_where": "/home/stevetosak/Proekt/IMaps/imaps-frontend/node_modules/sass", 25 "author": { 26 "name": "Paul Miller", 27 "url": "https://paulmillr.com" 30 28 }, 29 "bugs": { 30 "url": "https://github.com/paulmillr/chokidar/issues" 31 }, 32 "bundleDependencies": false, 31 33 "dependencies": { 32 34 "readdirp": "^4.0.1" 33 35 }, 36 "deprecated": false, 37 "description": "Minimal and efficient cross-platform file watching library", 34 38 "devDependencies": { 35 39 "@paulmillr/jsbt": "0.2.1", … … 43 47 "upath": "2.0.1" 44 48 }, 45 "sideEffects": false,46 49 "engines": { 47 50 "node": ">= 14.16.0" 48 51 }, 49 "repository": { 50 "type": "git", 51 "url": "git+https://github.com/paulmillr/chokidar.git" 52 "exports": { 53 ".": { 54 "import": "./esm/index.js", 55 "require": "./index.js" 56 }, 57 "./handler.js": { 58 "import": "./esm/handler.js", 59 "require": "./handler.js" 60 } 52 61 }, 53 "bugs": { 54 "url": "https://github.com/paulmillr/chokidar/issues" 55 }, 56 "license": "MIT", 57 "scripts": { 58 "build": "tsc && tsc -p tsconfig.esm.json", 59 "lint": "prettier --check src", 60 "format": "prettier --write src", 61 "test": "node --test" 62 }, 62 "files": [ 63 "index.js", 64 "index.d.ts", 65 "handler.js", 66 "handler.d.ts", 67 "esm" 68 ], 69 "funding": "https://paulmillr.com/funding/", 70 "homepage": "https://github.com/paulmillr/chokidar", 63 71 "keywords": [ 64 72 "fs", … … 70 78 "fsevents" 71 79 ], 72 "funding": "https://paulmillr.com/funding/" 80 "license": "MIT", 81 "main": "./index.js", 82 "module": "./esm/index.js", 83 "name": "chokidar", 84 "repository": { 85 "type": "git", 86 "url": "git+https://github.com/paulmillr/chokidar.git" 87 }, 88 "scripts": { 89 "build": "tsc && tsc -p tsconfig.esm.json", 90 "format": "prettier --write src", 91 "lint": "prettier --check src", 92 "test": "node --test" 93 }, 94 "sideEffects": false, 95 "types": "./index.d.ts", 96 "version": "4.0.3" 73 97 }
Note:
See TracChangeset
for help on using the changeset viewer.