f
handleWatchEvent(): void
config: Config,
extensions: string[],
event: string,
filePath: string,
onEventFunc: () => unknown,
event: string,
file: string
onFinishFunc: (() => void) | null | undefined
path: string,
event: string
Routes a file-system event to fsTree mutation and optional rebuild trigger.
unlinkDir bypasses the extension filter so deleted directories always clean up fsTree.
f
mutateFSTree(): void
fsTree: FSTree,
event: string,
path: string
Mutates fsTree in place based on a chokidar file-system event.
f
setupFileWatchers(): { fileWatchers: Record<string, FSWatcher>; killFileWatchers: () => Record<string, FSWatcher>; }
testFileLookupPaths: string[],
config: Config,
onEventFunc: () => unknown,
event: string,
file: string
onFinishFunc: (() => void) | null | undefined
path: string,
event: string
Starts fs.watch watchers for each lookup path and calls onEventFunc on JS/TS file changes, debounced via a flag.
Uses config.fsTree to distinguish unlink (tracked file) from unlinkDir (directory) on deletion.
Usage
import * as mod from "lib/setup/file-watcher.ts";