diff --git a/package-lock.json b/package-lock.json index 7416072..f214324 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6662,6 +6662,7 @@ "node_modules/anymatch": { "version": "3.1.3", "license": "ISC", + "optional": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -7034,6 +7035,7 @@ "node_modules/binary-extensions": { "version": "2.3.0", "license": "MIT", + "optional": true, "engines": { "node": ">=8" }, @@ -7411,6 +7413,7 @@ "node_modules/chokidar": { "version": "3.6.0", "license": "MIT", + "optional": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -9603,6 +9606,7 @@ "node_modules/glob-parent": { "version": "5.1.2", "license": "ISC", + "optional": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -10722,6 +10726,7 @@ "node_modules/is-binary-path": { "version": "2.1.0", "license": "MIT", + "optional": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -10838,6 +10843,7 @@ "node_modules/is-extglob": { "version": "2.1.1", "license": "MIT", + "optional": true, "engines": { "node": ">=0.10.0" } @@ -10891,6 +10897,7 @@ "node_modules/is-glob": { "version": "4.0.3", "license": "MIT", + "optional": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -13250,6 +13257,7 @@ "node_modules/normalize-path": { "version": "3.0.0", "license": "MIT", + "optional": true, "engines": { "node": ">=0.10.0" } @@ -14404,6 +14412,7 @@ "node_modules/readdirp": { "version": "3.6.0", "license": "MIT", + "optional": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -17991,7 +18000,7 @@ "@slack/web-api": "^7.18.0", "@types/micromatch": "^4.0.10", "chalk": "^5.6.2", - "chokidar": "^3.5.3", + "chokidar": "^5.0.0", "commander": "^15.0.0", "ignore": "^7.0.5", "ink": "^5.1.0", @@ -18039,6 +18048,21 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "packages/autonav/node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "packages/autonav/node_modules/marked": { "version": "18.0.5", "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.5.tgz", @@ -18051,6 +18075,19 @@ "node": ">= 20" } }, + "packages/autonav/node_modules/readdirp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", + "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "packages/communication-layer": { "name": "@autonav/communication-layer", "version": "0.2.0", diff --git a/packages/autonav/package.json b/packages/autonav/package.json index 16ea20b..1a37dab 100644 --- a/packages/autonav/package.json +++ b/packages/autonav/package.json @@ -53,7 +53,7 @@ "@slack/web-api": "^7.18.0", "@types/micromatch": "^4.0.10", "chalk": "^5.6.2", - "chokidar": "^3.5.3", + "chokidar": "^5.0.0", "commander": "^15.0.0", "ignore": "^7.0.5", "ink": "^5.1.0", diff --git a/packages/autonav/src/plugins/implementations/file-watcher/index.ts b/packages/autonav/src/plugins/implementations/file-watcher/index.ts index 6c3c873..b8f1031 100644 --- a/packages/autonav/src/plugins/implementations/file-watcher/index.ts +++ b/packages/autonav/src/plugins/implementations/file-watcher/index.ts @@ -126,9 +126,15 @@ export class FileWatcherPlugin implements Plugin< } } - // Initialize watcher + // Initialize watcher. + // chokidar v4+ dropped glob support: `ignored` string matchers are now + // treated as literal paths, not globs. Convert the glob ignorePatterns to a + // match function (via micromatch) so node_modules/.git/dist keep being + // ignored during directory traversal. + const ignorePatterns = config.ignorePatterns; this.watcher = watch(config.paths, { - ignored: config.ignorePatterns, + ignored: (watchedPath: string) => + ignorePatterns.length > 0 && micromatch.isMatch(watchedPath, ignorePatterns), persistent: true, ignoreInitial: true, awaitWriteFinish: {