@fern-api/generator-cli 0.9.29 → 0.9.30

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/dist/cli.js +4 -66
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -22126,7 +22126,7 @@ var init_diff3 = __esm({
22126
22126
  }
22127
22127
  });
22128
22128
 
22129
- // ../../node_modules/.pnpm/@fern-api+replay@0.15.1/node_modules/@fern-api/replay/dist/index.js
22129
+ // ../../node_modules/.pnpm/@fern-api+replay@0.15.2/node_modules/@fern-api/replay/dist/index.js
22130
22130
  var dist_exports = {};
22131
22131
  __export(dist_exports, {
22132
22132
  CREDENTIAL_PATTERNS: () => CREDENTIAL_PATTERNS,
@@ -23934,7 +23934,7 @@ function status(outputDir) {
23934
23934
  }
23935
23935
  var import_promises3, import_os, import_path7, import_fs6, import_path8, import_yaml, import_crypto, import_path9, import_promises4, import_os2, import_path10, import_promises5, import_path11, import_promises6, import_path12, import_fs7, import_promises7, import_path13, import_promises8, import_os3, import_path14, import_child_process3, import_crypto2, import_fs8, import_path15, import_yaml2, import_crypto3, import_fs9, import_path16, import_fs10, import_promises9, import_path17, __defProp3, __getOwnPropNames3, __esm3, __export3, GitClient_exports, GitClient, init_GitClient, HybridReconstruction_exports, init_HybridReconstruction, PatchApplyTheirs_exports, init_PatchApplyTheirs, CREDENTIAL_PATTERNS, SENSITIVE_FILE_PATTERNS, FERN_BOT_NAME, FERN_BOT_EMAIL, FERN_BOT_LOGIN, FERN_SUPPORT_NAMES, LOCKFILE_HEADER, LockfileNotFoundError, LockfileManager, BINARY_EXTENSIONS, INFRASTRUCTURE_FILES, ReplayDetector, MergeAccumulator, CONFLICT_OPENER, CONFLICT_SEPARATOR, CONFLICT_CLOSER, ReplayApplicator, ReplayCommitter, FileOwnership, FirstGenerationFlow, SkipApplicationFlow, NoPatchesFlow, NormalRegenerationFlow, ReplayService, FernignoreMigrator, REPLAY_FERNIGNORE_ENTRIES, GITATTRIBUTES_ENTRIES, EMPTY_RESULT;
23936
23936
  var init_dist3 = __esm({
23937
- "../../node_modules/.pnpm/@fern-api+replay@0.15.1/node_modules/@fern-api/replay/dist/index.js"() {
23937
+ "../../node_modules/.pnpm/@fern-api+replay@0.15.2/node_modules/@fern-api/replay/dist/index.js"() {
23938
23938
  "use strict";
23939
23939
  init_esm4();
23940
23940
  import_promises3 = require("fs/promises");
@@ -24481,7 +24481,7 @@ var init_dist3 = __esm({
24481
24481
  async detectPatchesInRange(rangeStart, lastGen, lock) {
24482
24482
  const log = await this.git.exec([
24483
24483
  "log",
24484
- "--first-parent",
24484
+ "--no-merges",
24485
24485
  "--format=%H%x00%an%x00%ae%x00%s",
24486
24486
  `${rangeStart}..HEAD`,
24487
24487
  "--",
@@ -24501,18 +24501,6 @@ var init_dist3 = __esm({
24501
24501
  continue;
24502
24502
  }
24503
24503
  const parents = await this.git.getCommitParents(commit.sha);
24504
- if (parents.length > 1) {
24505
- const compositePatch = await this.createMergeCompositePatch({
24506
- mergeCommit: commit,
24507
- firstParent: parents[0],
24508
- lastGen,
24509
- lock
24510
- });
24511
- if (compositePatch) {
24512
- newPatches.push(compositePatch);
24513
- }
24514
- continue;
24515
- }
24516
24504
  let patchContent;
24517
24505
  try {
24518
24506
  patchContent = await this.git.formatPatch(commit.sha);
@@ -24650,9 +24638,7 @@ var init_dist3 = __esm({
24650
24638
  * within the current linear detection window, and are absent from
24651
24639
  * HEAD at the end of the window.
24652
24640
  *
24653
- * Rationale: on a merge commit, createMergeCompositePatch already diffs
24654
- * firstParent..mergeCommit so net-zero files never enter the composite. On
24655
- * linear history each commit becomes its own patch, so a file that was
24641
+ * Rationale: each commit becomes its own patch, so a file that was
24656
24642
  * briefly added and later removed survives as a create+delete pair whose
24657
24643
  * cumulative diff is empty. We drop such patches before they reach the
24658
24644
  * lockfile.
@@ -24719,54 +24705,6 @@ var init_dist3 = __esm({
24719
24705
  return /* @__PURE__ */ new Set();
24720
24706
  }
24721
24707
  }
24722
- /**
24723
- * Create a single composite patch for a merge commit by diffing the merge
24724
- * commit against its first parent. This captures the net change of the
24725
- * entire merged branch as one patch, eliminating accumulator chaining and
24726
- * zero-net-change ghost conflicts.
24727
- */
24728
- async createMergeCompositePatch(input) {
24729
- const { mergeCommit, firstParent, lastGen, lock } = input;
24730
- const forgottenHashes = new Set(lock.forgotten_hashes ?? []);
24731
- const filesOutput = await this.git.exec([
24732
- "diff",
24733
- "--name-only",
24734
- firstParent,
24735
- mergeCommit.sha
24736
- ]);
24737
- const { files, sensitiveFiles } = filterInfrastructureAndSensitiveFiles(filesOutput);
24738
- if (sensitiveFiles.length > 0) {
24739
- this.warnings.push(
24740
- `Sensitive file(s) excluded from merge patch for commit ${mergeCommit.sha.slice(0, 7)}: ${sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
24741
- );
24742
- }
24743
- if (files.length === 0) return null;
24744
- const diff = await this.git.exec([
24745
- "diff",
24746
- firstParent,
24747
- mergeCommit.sha,
24748
- "--",
24749
- ...files
24750
- ]);
24751
- if (!diff.trim()) return null;
24752
- const contentHash = this.computeContentHash(diff);
24753
- if (lock.patches.some((p2) => p2.content_hash === contentHash) || forgottenHashes.has(contentHash)) {
24754
- return null;
24755
- }
24756
- const theirsSnapshot = await capturePatchSnapshot(this.git, files, mergeCommit.sha);
24757
- return {
24758
- id: `patch-merge-${mergeCommit.sha.slice(0, 8)}`,
24759
- content_hash: contentHash,
24760
- original_commit: mergeCommit.sha,
24761
- original_message: mergeCommit.message,
24762
- original_author: `${mergeCommit.authorName} <${mergeCommit.authorEmail}>`,
24763
- base_generation: lastGen.commit_sha,
24764
- files,
24765
- patch_content: diff,
24766
- ...Object.keys(theirsSnapshot).length > 0 ? { theirs_snapshot: theirsSnapshot } : {},
24767
- ...this.isCreationOnlyPatch(diff) ? { user_owned: true } : {}
24768
- };
24769
- }
24770
24708
  /**
24771
24709
  * Detect patches via tree diff for non-linear history. Returns a composite patch.
24772
24710
  * Revert reconciliation is skipped here because tree-diff produces a single composite
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.9.29",
3
+ "version": "0.9.30",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fern-api/fern.git",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@boundaryml/baml": "^0.219.0",
26
- "@fern-api/replay": "0.15.1",
26
+ "@fern-api/replay": "0.15.2",
27
27
  "@octokit/rest": "^22.0.1",
28
28
  "es-toolkit": "^1.45.1",
29
29
  "semver": "^7.6.3",