@absolutejs/absolute 0.20.0-beta.151 → 0.20.0-beta.153

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.
@@ -639,21 +639,23 @@ var collectPositiveWatchRoots = (config, resolved) => {
639
639
  if (existsSync2(abs) && !roots.includes(abs))
640
640
  roots.push(abs);
641
641
  }
642
- try {
643
- const entries = readdirSync(cwd, { withFileTypes: true });
644
- for (const entry of entries) {
645
- if (!entry.isDirectory())
646
- continue;
647
- if (entry.name.startsWith("."))
648
- continue;
649
- const abs = normalizePath(resolve3(cwd, entry.name));
650
- if (roots.includes(abs))
651
- continue;
652
- if (shouldIgnorePath(abs, resolved))
653
- continue;
654
- roots.push(abs);
655
- }
656
- } catch {}
642
+ if (config.dev?.autoWatchDirectories !== false) {
643
+ try {
644
+ const entries = readdirSync(cwd, { withFileTypes: true });
645
+ for (const entry of entries) {
646
+ if (!entry.isDirectory())
647
+ continue;
648
+ if (entry.name.startsWith("."))
649
+ continue;
650
+ const abs = normalizePath(resolve3(cwd, entry.name));
651
+ if (roots.includes(abs))
652
+ continue;
653
+ if (shouldIgnorePath(abs, resolved))
654
+ continue;
655
+ roots.push(abs);
656
+ }
657
+ } catch {}
658
+ }
657
659
  const extraDirs = config.dev?.watchDirs ?? [];
658
660
  for (const dir of extraDirs)
659
661
  push(dir);
package/dist/cli/index.js CHANGED
@@ -54,7 +54,7 @@ if (command === "dev") {
54
54
  }
55
55
  const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
56
56
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
57
- const { dev } = await import("./dev-ngcawkgx.js");
57
+ const { dev } = await import("./dev-7ep6b81g.js");
58
58
  await dev(serverEntry, configPath, {
59
59
  androidDevice,
60
60
  eager: args.includes("--eager"),
package/dist/index.js CHANGED
@@ -28643,21 +28643,23 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28643
28643
  if (existsSync41(abs) && !roots.includes(abs))
28644
28644
  roots.push(abs);
28645
28645
  }
28646
- try {
28647
- const entries = readdirSync8(cwd, { withFileTypes: true });
28648
- for (const entry of entries) {
28649
- if (!entry.isDirectory())
28650
- continue;
28651
- if (entry.name.startsWith("."))
28652
- continue;
28653
- const abs = normalizePath2(resolve44(cwd, entry.name));
28654
- if (roots.includes(abs))
28655
- continue;
28656
- if (shouldIgnorePath(abs, resolved))
28657
- continue;
28658
- roots.push(abs);
28659
- }
28660
- } catch {}
28646
+ if (config.dev?.autoWatchDirectories !== false) {
28647
+ try {
28648
+ const entries = readdirSync8(cwd, { withFileTypes: true });
28649
+ for (const entry of entries) {
28650
+ if (!entry.isDirectory())
28651
+ continue;
28652
+ if (entry.name.startsWith("."))
28653
+ continue;
28654
+ const abs = normalizePath2(resolve44(cwd, entry.name));
28655
+ if (roots.includes(abs))
28656
+ continue;
28657
+ if (shouldIgnorePath(abs, resolved))
28658
+ continue;
28659
+ roots.push(abs);
28660
+ }
28661
+ } catch {}
28662
+ }
28661
28663
  const extraDirs = config.dev?.watchDirs ?? [];
28662
28664
  for (const dir of extraDirs)
28663
28665
  push(dir);
@@ -28897,7 +28899,65 @@ var safeRemoveFromGraph = (graph, fullPath) => {
28897
28899
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
28898
28900
  setupWatcher(absolutePath, isStylesDir, state, onFileChange);
28899
28901
  });
28902
+ }, watchRootDependencies = (state, onFileChange) => {
28903
+ const root = process.cwd();
28904
+ const names = [
28905
+ "package.json",
28906
+ "bun.lock",
28907
+ "bun.lockb",
28908
+ "package-lock.json",
28909
+ "pnpm-lock.yaml",
28910
+ "yarn.lock"
28911
+ ];
28912
+ const fingerprint = (name) => {
28913
+ try {
28914
+ const value = statSync6(join56(root, name));
28915
+ return value.isFile() ? `${value.ino}:${value.size}:${value.mtimeMs}:${value.ctimeMs}` : null;
28916
+ } catch {
28917
+ return null;
28918
+ }
28919
+ };
28920
+ const previous = new Map(names.map((name) => [name, fingerprint(name)]));
28921
+ const scan = () => {
28922
+ for (const name of names) {
28923
+ const next = fingerprint(name);
28924
+ if (next === previous.get(name))
28925
+ continue;
28926
+ previous.set(name, next);
28927
+ onFileChange(join56(root, name).replace(/\\/g, "/"));
28928
+ }
28929
+ };
28930
+ const timers = new Map;
28931
+ const recover = (delay) => {
28932
+ if (timers.has(delay))
28933
+ return;
28934
+ const timer = setTimeout(() => {
28935
+ timers.delete(delay);
28936
+ scan();
28937
+ }, delay);
28938
+ timers.set(delay, timer);
28939
+ unrefTimer(timer);
28940
+ };
28941
+ const watcher = watch(root, { recursive: false }, (event, filename) => {
28942
+ if (!filename) {
28943
+ scan();
28944
+ return;
28945
+ }
28946
+ if (names.includes(filename))
28947
+ scan();
28948
+ if (event === "rename") {
28949
+ recover(25);
28950
+ recover(100);
28951
+ }
28952
+ });
28953
+ watcher.once("close", () => {
28954
+ for (const timer of timers.values())
28955
+ clearTimeout(timer);
28956
+ timers.clear();
28957
+ });
28958
+ state.watchers.push(watcher);
28900
28959
  }, startFileWatching = (state, config, onFileChange) => {
28960
+ watchRootDependencies(state, onFileChange);
28901
28961
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
28902
28962
  const stylesDir = state.resolvedPaths?.stylesDir;
28903
28963
  watchPaths.forEach((path) => {
@@ -44092,5 +44152,5 @@ export {
44092
44152
  wrapPageHandlerWithStreamingSlots
44093
44153
  };
44094
44154
 
44095
- //# debugId=1B81D7E186BD673B64756E2164756E21
44155
+ //# debugId=51267B9DE2A109B864756E2164756E21
44096
44156
  //# sourceMappingURL=index.js.map