@testver/testver 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +33 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45064,34 +45064,44 @@ var init_project_scanner = __esm({
|
|
|
45064
45064
|
import { relative as relative6 } from "path";
|
|
45065
45065
|
async function createFileWatcher(projectPath2, wss, scanner) {
|
|
45066
45066
|
const { watch: watch2 } = await import("chokidar");
|
|
45067
|
+
const IGNORED_DIRS = /* @__PURE__ */ new Set([
|
|
45068
|
+
"node_modules",
|
|
45069
|
+
"dist",
|
|
45070
|
+
"build",
|
|
45071
|
+
".git",
|
|
45072
|
+
"coverage",
|
|
45073
|
+
"__pycache__",
|
|
45074
|
+
"target",
|
|
45075
|
+
".next",
|
|
45076
|
+
".nuxt",
|
|
45077
|
+
"out",
|
|
45078
|
+
".tox",
|
|
45079
|
+
".mypy_cache",
|
|
45080
|
+
// Internal/tooling dirs — noise in the Recent Activity feed and rescans.
|
|
45081
|
+
// `.testver/` is where we write activity.json itself, so not ignoring it
|
|
45082
|
+
// would cause a self-triggering loop.
|
|
45083
|
+
".testver",
|
|
45084
|
+
".pytest_cache",
|
|
45085
|
+
".turbo",
|
|
45086
|
+
".cache",
|
|
45087
|
+
".vscode",
|
|
45088
|
+
".idea"
|
|
45089
|
+
]);
|
|
45090
|
+
const ignored = (p) => {
|
|
45091
|
+
const rel = relative6(projectPath2, p);
|
|
45092
|
+
if (!rel || rel.startsWith("..")) return false;
|
|
45093
|
+
return rel.split(/[\\/]/).some((seg) => IGNORED_DIRS.has(seg));
|
|
45094
|
+
};
|
|
45067
45095
|
const watcher = watch2(projectPath2, {
|
|
45068
|
-
ignored
|
|
45069
|
-
"**/node_modules/**",
|
|
45070
|
-
"**/dist/**",
|
|
45071
|
-
"**/build/**",
|
|
45072
|
-
"**/.git/**",
|
|
45073
|
-
"**/coverage/**",
|
|
45074
|
-
"**/__pycache__/**",
|
|
45075
|
-
"**/target/**",
|
|
45076
|
-
"**/.next/**",
|
|
45077
|
-
"**/.nuxt/**",
|
|
45078
|
-
"**/out/**",
|
|
45079
|
-
"**/.tox/**",
|
|
45080
|
-
"**/.mypy_cache/**",
|
|
45081
|
-
// Internal/tooling dirs — noise in the Recent Activity feed and
|
|
45082
|
-
// rescans. `.testver/` is where we write activity.json itself, so
|
|
45083
|
-
// not ignoring it would cause a self-triggering loop.
|
|
45084
|
-
"**/.testver/**",
|
|
45085
|
-
"**/.pytest_cache/**",
|
|
45086
|
-
"**/.turbo/**",
|
|
45087
|
-
"**/.cache/**",
|
|
45088
|
-
"**/.vscode/**",
|
|
45089
|
-
"**/.idea/**"
|
|
45090
|
-
],
|
|
45096
|
+
ignored,
|
|
45091
45097
|
persistent: true,
|
|
45092
45098
|
ignoreInitial: true,
|
|
45093
45099
|
awaitWriteFinish: { stabilityThreshold: 300, pollInterval: 100 }
|
|
45094
45100
|
});
|
|
45101
|
+
watcher.on("error", (err4) => {
|
|
45102
|
+
const msg = err4?.message || String(err4);
|
|
45103
|
+
console.warn(`[testver] file watcher error (non-fatal, continuing): ${msg}`);
|
|
45104
|
+
});
|
|
45095
45105
|
let rescanTimer = null;
|
|
45096
45106
|
const scheduleRescan = () => {
|
|
45097
45107
|
if (rescanTimer) clearTimeout(rescanTimer);
|