@neat.is/core 0.10.5-dev.20261003 → 0.10.5-dev.20261005

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/cli.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  resolveNeatVersion,
9
9
  startK8sSubstratePolling,
10
10
  writeDaemonRecord
11
- } from "./chunk-TONL5O2E.js";
11
+ } from "./chunk-Q2SL2SVH.js";
12
12
  import {
13
13
  buildSearchIndex
14
14
  } from "./chunk-BC53SCT7.js";
@@ -82,7 +82,7 @@ import {
82
82
  startStalenessLoop,
83
83
  upsertConnectorEntry,
84
84
  validateConnectorEntry
85
- } from "./chunk-HHAPD6JD.js";
85
+ } from "./chunk-DVCGDMTZ.js";
86
86
  import {
87
87
  startOtelGrpcReceiver
88
88
  } from "./chunk-LXQCL4MP.js";
package/dist/index.cjs CHANGED
@@ -16552,7 +16552,7 @@ async function extractFromDirectory(graph, scanPath, opts = {}) {
16552
16552
  const phase5 = await addInfra(graph, scanPath, services);
16553
16553
  const zodPhase = await addZodShapes(graph, services);
16554
16554
  const firestoreRulesPhase = await addFirestoreRules(graph, services);
16555
- const ghostsRetired = retireExtractedEdgesByMissingFile(
16555
+ const ghostsRetired = services.length === 0 ? 0 : retireExtractedEdgesByMissingFile(
16556
16556
  graph,
16557
16557
  scanPath,
16558
16558
  services.map((s) => s.dir),
@@ -16737,15 +16737,8 @@ async function saveGraphToDisk(graph, outPath) {
16737
16737
  }
16738
16738
  await import_node_fs34.promises.rename(tmp, outPath);
16739
16739
  }
16740
- async function loadGraphFromDisk(graph, outPath) {
16741
- let raw;
16742
- try {
16743
- raw = await import_node_fs34.promises.readFile(outPath, "utf8");
16744
- } catch (err) {
16745
- if (err.code === "ENOENT") return;
16746
- throw err;
16747
- }
16748
- let payload = JSON.parse(raw);
16740
+ function migrateSnapshot(input) {
16741
+ let payload = input;
16749
16742
  if (payload.schemaVersion === 1) {
16750
16743
  payload = migrateV1ToV2(payload);
16751
16744
  }
@@ -16769,6 +16762,17 @@ async function loadGraphFromDisk(graph, outPath) {
16769
16762
  `persist: unsupported snapshot schemaVersion ${payload.schemaVersion} (expected ${SCHEMA_VERSION})`
16770
16763
  );
16771
16764
  }
16765
+ return payload;
16766
+ }
16767
+ async function loadGraphFromDisk(graph, outPath) {
16768
+ let raw;
16769
+ try {
16770
+ raw = await import_node_fs34.promises.readFile(outPath, "utf8");
16771
+ } catch (err) {
16772
+ if (err.code === "ENOENT") return;
16773
+ throw err;
16774
+ }
16775
+ const payload = migrateSnapshot(JSON.parse(raw));
16772
16776
  graph.clear();
16773
16777
  graph.import(payload.graph);
16774
16778
  }
@@ -23623,13 +23627,21 @@ function registerRoutes(scope, ctx) {
23623
23627
  return reply.code(400).send({ error: "request body must be { snapshot: <persisted-graph> }" });
23624
23628
  }
23625
23629
  const snap = body.snapshot;
23626
- if (typeof snap.schemaVersion !== "number" || snap.schemaVersion !== SCHEMA_VERSION) {
23630
+ if (typeof snap.schemaVersion !== "number") {
23631
+ return reply.code(400).send({
23632
+ error: `unsupported snapshot schemaVersion ${snap.schemaVersion} (expected ${SCHEMA_VERSION})`
23633
+ });
23634
+ }
23635
+ let migrated;
23636
+ try {
23637
+ migrated = migrateSnapshot(snap);
23638
+ } catch {
23627
23639
  return reply.code(400).send({
23628
23640
  error: `unsupported snapshot schemaVersion ${snap.schemaVersion} (expected ${SCHEMA_VERSION})`
23629
23641
  });
23630
23642
  }
23631
23643
  try {
23632
- const result = mergeSnapshot(proj.graph, snap);
23644
+ const result = mergeSnapshot(proj.graph, migrated);
23633
23645
  return {
23634
23646
  project: proj.name,
23635
23647
  nodesAdded: result.nodesAdded,