@fern-api/fern-api-dev 4.67.1-35-gb17435e183c → 4.67.1-37-g702136e1c88

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.
Files changed (2) hide show
  1. package/cli.cjs +60 -10
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -363248,9 +363248,9 @@ var require_diff3 = __commonJS({
363248
363248
  }
363249
363249
  });
363250
363250
 
363251
- // ../../../node_modules/.pnpm/@fern-api+replay@0.10.3/node_modules/@fern-api/replay/dist/index.cjs
363251
+ // ../../../node_modules/.pnpm/@fern-api+replay@0.10.4/node_modules/@fern-api/replay/dist/index.cjs
363252
363252
  var require_dist14 = __commonJS({
363253
- "../../../node_modules/.pnpm/@fern-api+replay@0.10.3/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
363253
+ "../../../node_modules/.pnpm/@fern-api+replay@0.10.4/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
363254
363254
  "use strict";
363255
363255
  var __defProp4 = Object.defineProperty;
363256
363256
  var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
@@ -363893,6 +363893,7 @@ var require_dist14 = __commonJS({
363893
363893
  }
363894
363894
  const log4 = await this.git.exec([
363895
363895
  "log",
363896
+ "--first-parent",
363896
363897
  "--format=%H%x00%an%x00%ae%x00%s",
363897
363898
  `${lastGen.commit_sha}..HEAD`,
363898
363899
  "--",
@@ -363908,11 +363909,20 @@ var require_dist14 = __commonJS({
363908
363909
  if (isGenerationCommit(commit)) {
363909
363910
  continue;
363910
363911
  }
363911
- const parents = await this.git.getCommitParents(commit.sha);
363912
- if (parents.length > 1) {
363912
+ if (lock.patches.find((p10) => p10.original_commit === commit.sha)) {
363913
363913
  continue;
363914
363914
  }
363915
- if (lock.patches.find((p10) => p10.original_commit === commit.sha)) {
363915
+ const parents = await this.git.getCommitParents(commit.sha);
363916
+ if (parents.length > 1) {
363917
+ const compositePatch = await this.createMergeCompositePatch({
363918
+ mergeCommit: commit,
363919
+ firstParent: parents[0],
363920
+ lastGen,
363921
+ lock
363922
+ });
363923
+ if (compositePatch) {
363924
+ newPatches.push(compositePatch);
363925
+ }
363916
363926
  continue;
363917
363927
  }
363918
363928
  let patchContent;
@@ -364011,6 +364021,46 @@ var require_dist14 = __commonJS({
364011
364021
  const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
364012
364022
  return `sha256:${(0, import_node_crypto7.createHash)("sha256").update(normalized).digest("hex")}`;
364013
364023
  }
364024
+ /**
364025
+ * Create a single composite patch for a merge commit by diffing the merge
364026
+ * commit against its first parent. This captures the net change of the
364027
+ * entire merged branch as one patch, eliminating accumulator chaining and
364028
+ * zero-net-change ghost conflicts.
364029
+ */
364030
+ async createMergeCompositePatch(input3) {
364031
+ const { mergeCommit, firstParent, lastGen, lock } = input3;
364032
+ const forgottenHashes = new Set(lock.forgotten_hashes ?? []);
364033
+ const filesOutput = await this.git.exec([
364034
+ "diff",
364035
+ "--name-only",
364036
+ firstParent,
364037
+ mergeCommit.sha
364038
+ ]);
364039
+ const files = filesOutput.trim().split("\n").filter(Boolean).filter((f10) => !INFRASTRUCTURE_FILES.has(f10)).filter((f10) => !f10.startsWith(".fern/"));
364040
+ if (files.length === 0) return null;
364041
+ const diff2 = await this.git.exec([
364042
+ "diff",
364043
+ firstParent,
364044
+ mergeCommit.sha,
364045
+ "--",
364046
+ ...files
364047
+ ]);
364048
+ if (!diff2.trim()) return null;
364049
+ const contentHash = this.computeContentHash(diff2);
364050
+ if (lock.patches.some((p10) => p10.content_hash === contentHash) || forgottenHashes.has(contentHash)) {
364051
+ return null;
364052
+ }
364053
+ return {
364054
+ id: `patch-merge-${mergeCommit.sha.slice(0, 8)}`,
364055
+ content_hash: contentHash,
364056
+ original_commit: mergeCommit.sha,
364057
+ original_message: mergeCommit.message,
364058
+ original_author: `${mergeCommit.authorName} <${mergeCommit.authorEmail}>`,
364059
+ base_generation: lastGen.commit_sha,
364060
+ files,
364061
+ patch_content: diff2
364062
+ };
364063
+ }
364014
364064
  /**
364015
364065
  * Detect patches via tree diff for non-linear history. Returns a composite patch.
364016
364066
  * Revert reconciliation is skipped here because tree-diff produces a single composite
@@ -627553,7 +627603,7 @@ var AccessTokenPosthogManager = class {
627553
627603
  properties: {
627554
627604
  ...event,
627555
627605
  ...event.properties,
627556
- version: "4.67.1-35-gb17435e183c",
627606
+ version: "4.67.1-37-g702136e1c88",
627557
627607
  usingAccessToken: true
627558
627608
  }
627559
627609
  });
@@ -627604,7 +627654,7 @@ var UserPosthogManager = class {
627604
627654
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
627605
627655
  event: "CLI",
627606
627656
  properties: {
627607
- version: "4.67.1-35-gb17435e183c",
627657
+ version: "4.67.1-37-g702136e1c88",
627608
627658
  ...event,
627609
627659
  ...event.properties,
627610
627660
  usingAccessToken: false,
@@ -843873,7 +843923,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
843873
843923
  var LOGS_FOLDER_NAME = "logs";
843874
843924
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
843875
843925
  function getCliSource() {
843876
- const version7 = "4.67.1-35-gb17435e183c";
843926
+ const version7 = "4.67.1-37-g702136e1c88";
843877
843927
  return `cli@${version7}`;
843878
843928
  }
843879
843929
  var DebugLogger = class {
@@ -855121,7 +855171,7 @@ var LegacyDocsPublisher = class {
855121
855171
  previewId,
855122
855172
  disableTemplates: void 0,
855123
855173
  skipUpload,
855124
- cliVersion: "4.67.1-35-gb17435e183c"
855174
+ cliVersion: "4.67.1-37-g702136e1c88"
855125
855175
  });
855126
855176
  if (taskContext.getResult() === TaskResult.Failure) {
855127
855177
  return { success: false };
@@ -928863,7 +928913,7 @@ var CliContext = class _CliContext {
928863
928913
  if (false) {
928864
928914
  this.logger.error("CLI_VERSION is not defined");
928865
928915
  }
928866
- return "4.67.1-35-gb17435e183c";
928916
+ return "4.67.1-37-g702136e1c88";
928867
928917
  }
928868
928918
  getCliName() {
928869
928919
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.67.1-35-gb17435e183c",
2
+ "version": "4.67.1-37-g702136e1c88",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",