@emeryld/rrroutes-export 1.0.22 → 1.0.24

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.
@@ -32,6 +32,7 @@ type CommitSnapshot = {
32
32
  commit: ChangelogCommit;
33
33
  routesByKey: Record<string, RouteSnapshot>;
34
34
  sourceObjectsById: Record<string, SourceObjectSnapshot>;
35
+ missing?: boolean;
35
36
  unresolvedModule?: boolean;
36
37
  fallbackReason?: 'module_unresolved' | 'snapshot_error';
37
38
  fallbackError?: string;
package/dist/index.cjs CHANGED
@@ -2204,6 +2204,7 @@ async function createSnapshot(repoRoot, moduleCandidates, exportName, commit, te
2204
2204
  commit,
2205
2205
  routesByKey: {},
2206
2206
  sourceObjectsById: {},
2207
+ missing: true,
2207
2208
  fallbackReason: "snapshot_error",
2208
2209
  fallbackError: message
2209
2210
  };
@@ -2495,14 +2496,23 @@ async function exportFinalizedLeavesChangelog(options) {
2495
2496
  }
2496
2497
  const routeEvents = [];
2497
2498
  const sourceEvents = [];
2498
- log("[changelog] diffing adjacent snapshots");
2499
- for (let i = 1; i < snapshots.length; i += 1) {
2499
+ log("[changelog] diffing successful snapshots");
2500
+ let previousSnapshot;
2501
+ for (const snapshot of snapshots) {
2502
+ if (snapshot.missing) {
2503
+ continue;
2504
+ }
2505
+ if (!previousSnapshot) {
2506
+ previousSnapshot = snapshot;
2507
+ continue;
2508
+ }
2500
2509
  const { routeEvents: nextRouteEvents, sourceEvents: nextSourceEvents } = diffSnapshots(
2501
- snapshots[i - 1],
2502
- snapshots[i]
2510
+ previousSnapshot,
2511
+ snapshot
2503
2512
  );
2504
2513
  routeEvents.push(...nextRouteEvents);
2505
2514
  sourceEvents.push(...nextSourceEvents);
2515
+ previousSnapshot = snapshot;
2506
2516
  }
2507
2517
  log(
2508
2518
  `[changelog] diff complete: route events=${routeEvents.length}, source events=${sourceEvents.length}`