@fapost/jig-ui 0.1.0-next.15 → 0.1.0-next.17

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.
@@ -21,11 +21,17 @@ export function watchTree(dir, { ignore, onChange, quietMs = 1_000, maxWaitMs =
21
21
  watcher?.close();
22
22
  watcher = undefined;
23
23
  };
24
- // Linux's recursive watch does not throw for a missing directory, macOS's does: ask first.
24
+ // Node 24.16-24.21 on Linux do not throw for a missing directory (24.0-24.15, 24.22 and macOS do): ask first.
25
25
  if (!existsSync(dir))
26
26
  return { open: false, close };
27
27
  try {
28
28
  watcher = watch(dir, { recursive: true }, (_event, file) => {
29
+ // Linux keeps watching a removed directory's inode and never says it is gone: close, so the owner watches it again.
30
+ if (!existsSync(dir)) {
31
+ close();
32
+ onChange();
33
+ return;
34
+ }
29
35
  // Some systems name no file; that is still a change.
30
36
  if (file !== null && ignore(file.replaceAll('\\', '/')))
31
37
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fapost/jig-ui",
3
- "version": "0.1.0-next.15",
3
+ "version": "0.1.0-next.17",
4
4
  "description": "A local web interface for Jig, the agent SDLC framework.",
5
5
  "license": "MIT",
6
6
  "type": "module",