@neat.is/core 0.10.5-dev.20261004 → 0.10.5-dev.20261006

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.
@@ -33,7 +33,7 @@ import {
33
33
  startStalenessLoop,
34
34
  touchLastSeen,
35
35
  writeAtomically
36
- } from "./chunk-HHAPD6JD.js";
36
+ } from "./chunk-DVCGDMTZ.js";
37
37
  import {
38
38
  assertBindAuthority,
39
39
  buildOtelReceiver,
@@ -1983,4 +1983,4 @@ export {
1983
1983
  resolveHost,
1984
1984
  startDaemon
1985
1985
  };
1986
- //# sourceMappingURL=chunk-TONL5O2E.js.map
1986
+ //# sourceMappingURL=chunk-Q2SL2SVH.js.map
package/dist/cli.cjs CHANGED
@@ -16702,7 +16702,7 @@ async function extractFromDirectory(graph, scanPath, opts = {}) {
16702
16702
  const phase5 = await addInfra(graph, scanPath, services);
16703
16703
  const zodPhase = await addZodShapes(graph, services);
16704
16704
  const firestoreRulesPhase = await addFirestoreRules(graph, services);
16705
- const ghostsRetired = retireExtractedEdgesByMissingFile(
16705
+ const ghostsRetired = services.length === 0 ? 0 : retireExtractedEdgesByMissingFile(
16706
16706
  graph,
16707
16707
  scanPath,
16708
16708
  services.map((s) => s.dir),
@@ -17564,15 +17564,8 @@ async function saveGraphToDisk(graph, outPath) {
17564
17564
  }
17565
17565
  await import_node_fs35.promises.rename(tmp, outPath);
17566
17566
  }
17567
- async function loadGraphFromDisk(graph, outPath) {
17568
- let raw;
17569
- try {
17570
- raw = await import_node_fs35.promises.readFile(outPath, "utf8");
17571
- } catch (err) {
17572
- if (err.code === "ENOENT") return;
17573
- throw err;
17574
- }
17575
- let payload = JSON.parse(raw);
17567
+ function migrateSnapshot(input) {
17568
+ let payload = input;
17576
17569
  if (payload.schemaVersion === 1) {
17577
17570
  payload = migrateV1ToV2(payload);
17578
17571
  }
@@ -17596,6 +17589,17 @@ async function loadGraphFromDisk(graph, outPath) {
17596
17589
  `persist: unsupported snapshot schemaVersion ${payload.schemaVersion} (expected ${SCHEMA_VERSION})`
17597
17590
  );
17598
17591
  }
17592
+ return payload;
17593
+ }
17594
+ async function loadGraphFromDisk(graph, outPath) {
17595
+ let raw;
17596
+ try {
17597
+ raw = await import_node_fs35.promises.readFile(outPath, "utf8");
17598
+ } catch (err) {
17599
+ if (err.code === "ENOENT") return;
17600
+ throw err;
17601
+ }
17602
+ const payload = migrateSnapshot(JSON.parse(raw));
17599
17603
  graph.clear();
17600
17604
  graph.import(payload.graph);
17601
17605
  }
@@ -24233,13 +24237,21 @@ function registerRoutes(scope, ctx) {
24233
24237
  return reply.code(400).send({ error: "request body must be { snapshot: <persisted-graph> }" });
24234
24238
  }
24235
24239
  const snap = body.snapshot;
24236
- if (typeof snap.schemaVersion !== "number" || snap.schemaVersion !== SCHEMA_VERSION) {
24240
+ if (typeof snap.schemaVersion !== "number") {
24241
+ return reply.code(400).send({
24242
+ error: `unsupported snapshot schemaVersion ${snap.schemaVersion} (expected ${SCHEMA_VERSION})`
24243
+ });
24244
+ }
24245
+ let migrated;
24246
+ try {
24247
+ migrated = migrateSnapshot(snap);
24248
+ } catch {
24237
24249
  return reply.code(400).send({
24238
24250
  error: `unsupported snapshot schemaVersion ${snap.schemaVersion} (expected ${SCHEMA_VERSION})`
24239
24251
  });
24240
24252
  }
24241
24253
  try {
24242
- const result = mergeSnapshot(proj.graph, snap);
24254
+ const result = mergeSnapshot(proj.graph, migrated);
24243
24255
  return {
24244
24256
  project: proj.name,
24245
24257
  nodesAdded: result.nodesAdded,