@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.
@@ -15788,7 +15788,7 @@ async function extractFromDirectory(graph, scanPath, opts = {}) {
15788
15788
  const phase5 = await addInfra(graph, scanPath, services);
15789
15789
  const zodPhase = await addZodShapes(graph, services);
15790
15790
  const firestoreRulesPhase = await addFirestoreRules(graph, services);
15791
- const ghostsRetired = retireExtractedEdgesByMissingFile(
15791
+ const ghostsRetired = services.length === 0 ? 0 : retireExtractedEdgesByMissingFile(
15792
15792
  graph,
15793
15793
  scanPath,
15794
15794
  services.map((s) => s.dir),
@@ -16658,15 +16658,8 @@ async function saveGraphToDisk(graph, outPath) {
16658
16658
  }
16659
16659
  await fs33.rename(tmp, outPath);
16660
16660
  }
16661
- async function loadGraphFromDisk(graph, outPath) {
16662
- let raw;
16663
- try {
16664
- raw = await fs33.readFile(outPath, "utf8");
16665
- } catch (err) {
16666
- if (err.code === "ENOENT") return;
16667
- throw err;
16668
- }
16669
- let payload = JSON.parse(raw);
16661
+ function migrateSnapshot(input) {
16662
+ let payload = input;
16670
16663
  if (payload.schemaVersion === 1) {
16671
16664
  payload = migrateV1ToV2(payload);
16672
16665
  }
@@ -16690,6 +16683,17 @@ async function loadGraphFromDisk(graph, outPath) {
16690
16683
  `persist: unsupported snapshot schemaVersion ${payload.schemaVersion} (expected ${SCHEMA_VERSION})`
16691
16684
  );
16692
16685
  }
16686
+ return payload;
16687
+ }
16688
+ async function loadGraphFromDisk(graph, outPath) {
16689
+ let raw;
16690
+ try {
16691
+ raw = await fs33.readFile(outPath, "utf8");
16692
+ } catch (err) {
16693
+ if (err.code === "ENOENT") return;
16694
+ throw err;
16695
+ }
16696
+ const payload = migrateSnapshot(JSON.parse(raw));
16693
16697
  graph.clear();
16694
16698
  graph.import(payload.graph);
16695
16699
  }
@@ -23036,13 +23040,21 @@ function registerRoutes(scope, ctx) {
23036
23040
  return reply.code(400).send({ error: "request body must be { snapshot: <persisted-graph> }" });
23037
23041
  }
23038
23042
  const snap = body.snapshot;
23039
- if (typeof snap.schemaVersion !== "number" || snap.schemaVersion !== SCHEMA_VERSION) {
23043
+ if (typeof snap.schemaVersion !== "number") {
23044
+ return reply.code(400).send({
23045
+ error: `unsupported snapshot schemaVersion ${snap.schemaVersion} (expected ${SCHEMA_VERSION})`
23046
+ });
23047
+ }
23048
+ let migrated;
23049
+ try {
23050
+ migrated = migrateSnapshot(snap);
23051
+ } catch {
23040
23052
  return reply.code(400).send({
23041
23053
  error: `unsupported snapshot schemaVersion ${snap.schemaVersion} (expected ${SCHEMA_VERSION})`
23042
23054
  });
23043
23055
  }
23044
23056
  try {
23045
- const result = mergeSnapshot(proj.graph, snap);
23057
+ const result = mergeSnapshot(proj.graph, migrated);
23046
23058
  return {
23047
23059
  project: proj.name,
23048
23060
  nodesAdded: result.nodesAdded,
@@ -23605,4 +23617,4 @@ export {
23605
23617
  deprovisionConnector,
23606
23618
  buildApi
23607
23619
  };
23608
- //# sourceMappingURL=chunk-HHAPD6JD.js.map
23620
+ //# sourceMappingURL=chunk-DVCGDMTZ.js.map