@absolutejs/absolute 0.20.0-beta.152 → 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.
package/dist/index.js CHANGED
@@ -28899,7 +28899,65 @@ var safeRemoveFromGraph = (graph, fullPath) => {
28899
28899
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
28900
28900
  setupWatcher(absolutePath, isStylesDir, state, onFileChange);
28901
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);
28902
28959
  }, startFileWatching = (state, config, onFileChange) => {
28960
+ watchRootDependencies(state, onFileChange);
28903
28961
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
28904
28962
  const stylesDir = state.resolvedPaths?.stylesDir;
28905
28963
  watchPaths.forEach((path) => {
@@ -44094,5 +44152,5 @@ export {
44094
44152
  wrapPageHandlerWithStreamingSlots
44095
44153
  };
44096
44154
 
44097
- //# debugId=53E8323896285D5364756E2164756E21
44155
+ //# debugId=51267B9DE2A109B864756E2164756E21
44098
44156
  //# sourceMappingURL=index.js.map