@fern-api/generator-cli 0.9.18 → 0.9.19

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/api.d.ts CHANGED
@@ -507,10 +507,10 @@ interface ReplayInitResult {
507
507
  bootstrap: BootstrapResult;
508
508
  /** Raw lockfile YAML content, present when bootstrap succeeded and not dry-run */
509
509
  lockfileContent?: string;
510
- /** Raw replay.yml content, present only when fernignore migration created it */
511
- replayYmlContent?: string;
512
510
  /** Fernignore entries that the server should ensure exist */
513
511
  fernignoreEntries: string[];
512
+ /** Gitattributes entries the server should ensure exist (e.g. linguist-generated markers) */
513
+ gitattributesEntries: string[];
514
514
  /** Generated PR body markdown for the server to use */
515
515
  prBody?: string;
516
516
  }
@@ -523,8 +523,8 @@ interface ReplayInitResult {
523
523
  * Flow:
524
524
  * 1. Clone the SDK repo (read-only)
525
525
  * 2. Run bootstrap() to scan history and create lockfile
526
- * 3. Ensure .fernignore has replay entries
527
- * 4. Read lockfile content from disk and return it
526
+ * 3. Read lockfile content from disk
527
+ * 4. Return lockfile + fernignore/gitattributes entries for Fiddle to apply server-side
528
528
  */
529
529
  declare function replayInit(params: ReplayInitParams): Promise<ReplayInitResult>;
530
530
  interface BootstrapLogEntry {
package/dist/api.js CHANGED
@@ -10053,12 +10053,11 @@ function replayForget(params) {
10053
10053
 
10054
10054
  // src/replay/replay-init.ts
10055
10055
  var import_replay2 = require("@fern-api/replay");
10056
- var import_fs3 = require("fs");
10056
+ var import_fs2 = require("fs");
10057
10057
  var import_path4 = require("path");
10058
10058
  var import_tmp_promise2 = __toESM(require("tmp-promise"));
10059
10059
 
10060
10060
  // src/replay/fernignore.ts
10061
- var import_fs2 = require("fs");
10062
10061
  var import_promises2 = require("fs/promises");
10063
10062
  var import_path3 = require("path");
10064
10063
  var REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml", ".gitattributes"];
@@ -10093,32 +10092,6 @@ async function ensureGitattributesEntries(outputDir) {
10093
10092
  await (0, import_promises2.writeFile)(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
10094
10093
  }
10095
10094
  }
10096
- function ensureReplayFernignoreEntriesSync(outputDir) {
10097
- const fernignorePath = (0, import_path3.join)(outputDir, ".fernignore");
10098
- let content = "";
10099
- if ((0, import_fs2.existsSync)(fernignorePath)) {
10100
- content = (0, import_fs2.readFileSync)(fernignorePath, "utf-8");
10101
- }
10102
- const lines = content.split("\n");
10103
- const toAdd = REPLAY_FERNIGNORE_ENTRIES.filter((entry) => !lines.some((line) => line.trim() === entry));
10104
- if (toAdd.length > 0) {
10105
- const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
10106
- (0, import_fs2.writeFileSync)(fernignorePath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
10107
- }
10108
- }
10109
- function ensureGitattributesEntriesSync(outputDir) {
10110
- const gitattributesPath = (0, import_path3.join)(outputDir, ".gitattributes");
10111
- let content = "";
10112
- if ((0, import_fs2.existsSync)(gitattributesPath)) {
10113
- content = (0, import_fs2.readFileSync)(gitattributesPath, "utf-8");
10114
- }
10115
- const lines = content.split("\n");
10116
- const toAdd = GITATTRIBUTES_ENTRIES.filter((entry) => !lines.some((line) => line.trim() === entry));
10117
- if (toAdd.length > 0) {
10118
- const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
10119
- (0, import_fs2.writeFileSync)(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
10120
- }
10121
- }
10122
10095
 
10123
10096
  // src/replay/replay-init.ts
10124
10097
  async function replayInit(params) {
@@ -10138,22 +10111,18 @@ async function replayInit(params) {
10138
10111
  importHistory: params.importHistory
10139
10112
  });
10140
10113
  if (!bootstrapResult.generationCommit) {
10141
- return { bootstrap: bootstrapResult, fernignoreEntries: [] };
10114
+ return { bootstrap: bootstrapResult, fernignoreEntries: [], gitattributesEntries: [] };
10142
10115
  }
10143
10116
  if (dryRun) {
10144
- return { bootstrap: bootstrapResult, fernignoreEntries: [] };
10117
+ return { bootstrap: bootstrapResult, fernignoreEntries: [], gitattributesEntries: [] };
10145
10118
  }
10146
- ensureReplayFernignoreEntriesSync(repoPath);
10147
- ensureGitattributesEntriesSync(repoPath);
10148
10119
  const lockfilePath = (0, import_path4.join)(repoPath, ".fern", "replay.lock");
10149
- const lockfileContent = (0, import_fs3.existsSync)(lockfilePath) ? (0, import_fs3.readFileSync)(lockfilePath, "utf-8") : void 0;
10150
- const replayYmlPath = (0, import_path4.join)(repoPath, ".fern", "replay.yml");
10151
- const replayYmlContent = (0, import_fs3.existsSync)(replayYmlPath) ? (0, import_fs3.readFileSync)(replayYmlPath, "utf-8") : void 0;
10120
+ const lockfileContent = (0, import_fs2.existsSync)(lockfilePath) ? (0, import_fs2.readFileSync)(lockfilePath, "utf-8") : void 0;
10152
10121
  return {
10153
10122
  bootstrap: bootstrapResult,
10154
10123
  lockfileContent,
10155
- replayYmlContent,
10156
10124
  fernignoreEntries: REPLAY_FERNIGNORE_ENTRIES,
10125
+ gitattributesEntries: GITATTRIBUTES_ENTRIES,
10157
10126
  prBody: buildPrBody(bootstrapResult)
10158
10127
  };
10159
10128
  }
@@ -10274,7 +10243,7 @@ async function replayResolve(params) {
10274
10243
  // src/replay/replay-run.ts
10275
10244
  var import_replay4 = require("@fern-api/replay");
10276
10245
  var import_child_process3 = require("child_process");
10277
- var import_fs4 = require("fs");
10246
+ var import_fs3 = require("fs");
10278
10247
  var import_path5 = require("path");
10279
10248
  async function replayPrepare(params) {
10280
10249
  const {
@@ -10287,7 +10256,7 @@ async function replayPrepare(params) {
10287
10256
  logger
10288
10257
  } = params;
10289
10258
  const lockfilePath = (0, import_path5.join)(outputDir, ".fern", "replay.lock");
10290
- if (!(0, import_fs4.existsSync)(lockfilePath)) {
10259
+ if (!(0, import_fs3.existsSync)(lockfilePath)) {
10291
10260
  return null;
10292
10261
  }
10293
10262
  const baseBranchHead = gitRevParse(outputDir, "HEAD");
@@ -10485,6 +10454,7 @@ async function submitReplayInit(params) {
10485
10454
  repo,
10486
10455
  lockfileContents: initResult.lockfileContent,
10487
10456
  fernignoreEntries: initResult.fernignoreEntries,
10457
+ gitattributesEntries: initResult.gitattributesEntries,
10488
10458
  prBody: initResult.prBody
10489
10459
  })
10490
10460
  });
package/dist/cli.js CHANGED
@@ -28389,7 +28389,7 @@ function resolve(...paths) {
28389
28389
  }
28390
28390
 
28391
28391
  // src/cli.ts
28392
- var import_fs16 = __toESM(require("fs"));
28392
+ var import_fs15 = __toESM(require("fs"));
28393
28393
  var import_promises11 = require("fs/promises");
28394
28394
  var import_path18 = __toESM(require("path"));
28395
28395
 
@@ -38091,12 +38091,11 @@ function replayForget(params) {
38091
38091
 
38092
38092
  // src/replay/replay-init.ts
38093
38093
  init_dist3();
38094
- var import_fs12 = require("fs");
38094
+ var import_fs11 = require("fs");
38095
38095
  var import_path13 = require("path");
38096
38096
  var import_tmp_promise2 = __toESM(require_tmp_promise());
38097
38097
 
38098
38098
  // src/replay/fernignore.ts
38099
- var import_fs11 = require("fs");
38100
38099
  var import_promises4 = require("fs/promises");
38101
38100
  var import_path12 = require("path");
38102
38101
  var REPLAY_FERNIGNORE_ENTRIES2 = [".fern/replay.lock", ".fern/replay.yml", ".gitattributes"];
@@ -38131,32 +38130,6 @@ async function ensureGitattributesEntries2(outputDir) {
38131
38130
  await (0, import_promises4.writeFile)(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
38132
38131
  }
38133
38132
  }
38134
- function ensureReplayFernignoreEntriesSync(outputDir) {
38135
- const fernignorePath = (0, import_path12.join)(outputDir, ".fernignore");
38136
- let content = "";
38137
- if ((0, import_fs11.existsSync)(fernignorePath)) {
38138
- content = (0, import_fs11.readFileSync)(fernignorePath, "utf-8");
38139
- }
38140
- const lines = content.split("\n");
38141
- const toAdd = REPLAY_FERNIGNORE_ENTRIES2.filter((entry) => !lines.some((line) => line.trim() === entry));
38142
- if (toAdd.length > 0) {
38143
- const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
38144
- (0, import_fs11.writeFileSync)(fernignorePath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
38145
- }
38146
- }
38147
- function ensureGitattributesEntriesSync(outputDir) {
38148
- const gitattributesPath = (0, import_path12.join)(outputDir, ".gitattributes");
38149
- let content = "";
38150
- if ((0, import_fs11.existsSync)(gitattributesPath)) {
38151
- content = (0, import_fs11.readFileSync)(gitattributesPath, "utf-8");
38152
- }
38153
- const lines = content.split("\n");
38154
- const toAdd = GITATTRIBUTES_ENTRIES2.filter((entry) => !lines.some((line) => line.trim() === entry));
38155
- if (toAdd.length > 0) {
38156
- const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
38157
- (0, import_fs11.writeFileSync)(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
38158
- }
38159
- }
38160
38133
 
38161
38134
  // src/replay/replay-init.ts
38162
38135
  async function replayInit(params) {
@@ -38176,22 +38149,18 @@ async function replayInit(params) {
38176
38149
  importHistory: params.importHistory
38177
38150
  });
38178
38151
  if (!bootstrapResult.generationCommit) {
38179
- return { bootstrap: bootstrapResult, fernignoreEntries: [] };
38152
+ return { bootstrap: bootstrapResult, fernignoreEntries: [], gitattributesEntries: [] };
38180
38153
  }
38181
38154
  if (dryRun) {
38182
- return { bootstrap: bootstrapResult, fernignoreEntries: [] };
38155
+ return { bootstrap: bootstrapResult, fernignoreEntries: [], gitattributesEntries: [] };
38183
38156
  }
38184
- ensureReplayFernignoreEntriesSync(repoPath);
38185
- ensureGitattributesEntriesSync(repoPath);
38186
38157
  const lockfilePath = (0, import_path13.join)(repoPath, ".fern", "replay.lock");
38187
- const lockfileContent = (0, import_fs12.existsSync)(lockfilePath) ? (0, import_fs12.readFileSync)(lockfilePath, "utf-8") : void 0;
38188
- const replayYmlPath = (0, import_path13.join)(repoPath, ".fern", "replay.yml");
38189
- const replayYmlContent = (0, import_fs12.existsSync)(replayYmlPath) ? (0, import_fs12.readFileSync)(replayYmlPath, "utf-8") : void 0;
38158
+ const lockfileContent = (0, import_fs11.existsSync)(lockfilePath) ? (0, import_fs11.readFileSync)(lockfilePath, "utf-8") : void 0;
38190
38159
  return {
38191
38160
  bootstrap: bootstrapResult,
38192
38161
  lockfileContent,
38193
- replayYmlContent,
38194
38162
  fernignoreEntries: REPLAY_FERNIGNORE_ENTRIES2,
38163
+ gitattributesEntries: GITATTRIBUTES_ENTRIES2,
38195
38164
  prBody: buildPrBody(bootstrapResult)
38196
38165
  };
38197
38166
  }
@@ -38307,7 +38276,7 @@ init_dist3();
38307
38276
  // src/replay/replay-run.ts
38308
38277
  init_dist3();
38309
38278
  var import_child_process3 = require("child_process");
38310
- var import_fs13 = require("fs");
38279
+ var import_fs12 = require("fs");
38311
38280
  var import_path14 = require("path");
38312
38281
  async function replayPrepare(params) {
38313
38282
  const {
@@ -38320,7 +38289,7 @@ async function replayPrepare(params) {
38320
38289
  logger
38321
38290
  } = params;
38322
38291
  const lockfilePath = (0, import_path14.join)(outputDir, ".fern", "replay.lock");
38323
- if (!(0, import_fs13.existsSync)(lockfilePath)) {
38292
+ if (!(0, import_fs12.existsSync)(lockfilePath)) {
38324
38293
  return null;
38325
38294
  }
38326
38295
  const baseBranchHead = gitRevParse(outputDir, "HEAD");
@@ -38552,7 +38521,7 @@ var FERN_BOT_LOGIN2 = "fern-api[bot]";
38552
38521
 
38553
38522
  // src/pipeline/steps/AutoVersionStep.ts
38554
38523
  var import_child_process4 = require("child_process");
38555
- var import_fs15 = require("fs");
38524
+ var import_fs14 = require("fs");
38556
38525
  var import_promises9 = require("fs/promises");
38557
38526
  var import_path16 = require("path");
38558
38527
 
@@ -38612,7 +38581,7 @@ async function loggingExeca(logger, executable, args = [], { doNotPipeOutput = f
38612
38581
  }
38613
38582
 
38614
38583
  // src/autoversion/AutoVersioningService.ts
38615
- var import_fs14 = require("fs");
38584
+ var import_fs13 = require("fs");
38616
38585
  var import_promises8 = require("fs/promises");
38617
38586
  var import_path15 = require("path");
38618
38587
  var import_semver = __toESM(require_semver2());
@@ -39302,7 +39271,7 @@ var AutoVersioningService = class _AutoVersioningService {
39302
39271
  return;
39303
39272
  }
39304
39273
  const goModPath = (0, import_path15.join)(workingDirectory, "go.mod");
39305
- if (!(0, import_fs14.existsSync)(goModPath)) {
39274
+ if (!(0, import_fs13.existsSync)(goModPath)) {
39306
39275
  this.logger.debug(`No go.mod found in ${workingDirectory}, skipping Go module path update`);
39307
39276
  return;
39308
39277
  }
@@ -39841,7 +39810,7 @@ ${body}` : `${COMMIT_MARKER} ${subject}`;
39841
39810
 
39842
39811
  `;
39843
39812
  let existing = "";
39844
- if ((0, import_fs15.existsSync)(changelogPath)) {
39813
+ if ((0, import_fs14.existsSync)(changelogPath)) {
39845
39814
  existing = await (0, import_promises9.readFile)(changelogPath, "utf-8");
39846
39815
  }
39847
39816
  let output;
@@ -41384,7 +41353,7 @@ async function createWriteStreamFromFile(filepath) {
41384
41353
  if (!await doesPathExist(filepath)) {
41385
41354
  await (0, import_promises11.mkdir)(import_path18.default.dirname(filepath), { recursive: true });
41386
41355
  }
41387
- return import_fs16.default.createWriteStream(filepath);
41356
+ return import_fs15.default.createWriteStream(filepath);
41388
41357
  }
41389
41358
  /*! Bundled license information:
41390
41359
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.9.18",
3
+ "version": "0.9.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fern-api/fern.git",