episoda 0.2.94 → 0.2.96

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
@@ -6739,6 +6739,7 @@ async function getMigrationConflicts(options) {
6739
6739
  mainTimestampMap.set(timestamp, filePath);
6740
6740
  }
6741
6741
  }
6742
+ const latestMainTimestamp = mainFiles.map(extractMigrationTimestamp).filter((timestamp) => Boolean(timestamp)).sort().pop();
6742
6743
  const branchTimestampMap = /* @__PURE__ */ new Map();
6743
6744
  const conflicts = [];
6744
6745
  for (const filePath of addedFiles) {
@@ -6759,6 +6760,14 @@ async function getMigrationConflicts(options) {
6759
6760
  existingFile: existingMain
6760
6761
  });
6761
6762
  }
6763
+ if (latestMainTimestamp && timestamp < latestMainTimestamp && !existingMain) {
6764
+ conflicts.push({
6765
+ file: filePath,
6766
+ timestamp,
6767
+ reason: "timestamp_before_latest_main",
6768
+ latestMainTimestamp
6769
+ });
6770
+ }
6762
6771
  }
6763
6772
  for (const [timestamp, files] of branchTimestampMap.entries()) {
6764
6773
  if (files.length > 1) {
@@ -6771,7 +6780,6 @@ async function getMigrationConflicts(options) {
6771
6780
  }
6772
6781
  }
6773
6782
  }
6774
- const latestMainTimestamp = mainFiles.map(extractMigrationTimestamp).filter((timestamp) => Boolean(timestamp)).sort().pop();
6775
6783
  const latestBranchTimestamp = addedFiles.map(extractMigrationTimestamp).filter((timestamp) => Boolean(timestamp)).sort().pop();
6776
6784
  return { conflicts, latestMainTimestamp, latestBranchTimestamp };
6777
6785
  }