@absolutejs/absolute 0.20.0-beta.152 → 0.20.0-beta.154

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) => {
@@ -32085,7 +32143,13 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
32085
32143
  return { status: "entry" };
32086
32144
  if (!moduleRecord(path) || !isHotManaged(path))
32087
32145
  return { status: "unmanaged" };
32088
- const source = readFileSync43(path, "utf-8");
32146
+ let source;
32147
+ try {
32148
+ source = readFileSync43(path, "utf-8");
32149
+ } catch (error) {
32150
+ reportFailure(path, error);
32151
+ return { error, status: "failed" };
32152
+ }
32089
32153
  if (moduleRecord(path)?.source === source)
32090
32154
  return { status: "unchanged" };
32091
32155
  const analysis = await analyzeSource(path, source);
@@ -44094,5 +44158,5 @@ export {
44094
44158
  wrapPageHandlerWithStreamingSlots
44095
44159
  };
44096
44160
 
44097
- //# debugId=53E8323896285D5364756E2164756E21
44161
+ //# debugId=A88F7960F78DEE6B64756E2164756E21
44098
44162
  //# sourceMappingURL=index.js.map