@fern-api/generator-cli 0.9.42 → 0.9.43

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 +48 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -40448,7 +40448,7 @@ var consolePipelineLogger = {
40448
40448
  };
40449
40449
 
40450
40450
  // src/pipeline/PostGenerationPipeline.ts
40451
- var import_child_process6 = require("child_process");
40451
+ var import_child_process7 = require("child_process");
40452
40452
 
40453
40453
  // src/pipeline/github/constants.ts
40454
40454
  var FERN_BOT_NAME2 = "fern-api";
@@ -43119,6 +43119,7 @@ function resolveBranchAction({
43119
43119
  }
43120
43120
 
43121
43121
  // src/pipeline/steps/ReplayStep.ts
43122
+ var import_child_process6 = require("child_process");
43122
43123
  var ReplayStep = class extends BaseStep {
43123
43124
  constructor(outputDir, logger, config, cliVersion, generatorVersions) {
43124
43125
  super(outputDir, logger);
@@ -43159,17 +43160,21 @@ var ReplayStep = class extends BaseStep {
43159
43160
  patchesWithConflicts: 0
43160
43161
  };
43161
43162
  }
43163
+ const stageOnly = this.config.stageOnly ?? false;
43162
43164
  const result = prepared != null ? await replayApply(prepared, {
43163
- stageOnly: this.config.stageOnly ?? false,
43165
+ stageOnly,
43164
43166
  logger: this.logger
43165
43167
  }) : await replayRun({
43166
43168
  outputDir: this.outputDir,
43167
43169
  cliVersion: this.cliVersion,
43168
43170
  generatorVersions: this.generatorVersions,
43169
- stageOnly: this.config.stageOnly ?? false,
43171
+ stageOnly,
43170
43172
  skipApplication: this.config.skipApplication,
43171
43173
  logger: this.logger
43172
43174
  });
43175
+ if (!stageOnly) {
43176
+ this.commitLockfileIfUncommitted();
43177
+ }
43173
43178
  if (result.failureReason != null) {
43174
43179
  return {
43175
43180
  executed: true,
@@ -43233,6 +43238,44 @@ var ReplayStep = class extends BaseStep {
43233
43238
  warnings: report.warnings
43234
43239
  };
43235
43240
  }
43241
+ /**
43242
+ * Commits `.fern/replay.lock` when replay saved the lockfile to disk but
43243
+ * didn't create a `[fern-replay]` commit (e.g. no-patches flow with zero
43244
+ * new patches). Without this, `skipCommit = true` in GithubStep drops the
43245
+ * lockfile advance, freezing `previousGenerationSha` across runs.
43246
+ */
43247
+ commitLockfileIfUncommitted() {
43248
+ try {
43249
+ const status2 = (0, import_child_process6.execFileSync)("git", ["status", "--porcelain", "--", ".fern/replay.lock"], {
43250
+ cwd: this.outputDir,
43251
+ encoding: "utf-8",
43252
+ stdio: ["pipe", "pipe", "pipe"]
43253
+ }).trim();
43254
+ if (status2.length === 0) {
43255
+ return;
43256
+ }
43257
+ (0, import_child_process6.execFileSync)("git", ["add", "--", ".fern/replay.lock"], {
43258
+ cwd: this.outputDir,
43259
+ stdio: "pipe"
43260
+ });
43261
+ (0, import_child_process6.execFileSync)(
43262
+ "git",
43263
+ [
43264
+ "-c",
43265
+ `user.name=${FERN_BOT_NAME2}`,
43266
+ "-c",
43267
+ `user.email=${FERN_BOT_EMAIL2}`,
43268
+ "commit",
43269
+ "-m",
43270
+ "[fern-replay] advance lockfile"
43271
+ ],
43272
+ { cwd: this.outputDir, stdio: "pipe" }
43273
+ );
43274
+ this.logger.debug("ReplayStep: committed uncommitted lockfile advance.");
43275
+ } catch (error) {
43276
+ this.logger.debug("ReplayStep: failed to commit lockfile advance: " + String(error));
43277
+ }
43278
+ }
43236
43279
  };
43237
43280
 
43238
43281
  // ../cli/generation/local-generation/docker-utils/lib/runDocker.js
@@ -43567,8 +43610,8 @@ var PostGenerationPipeline = class {
43567
43610
  async run() {
43568
43611
  if (this.config.github?.enabled) {
43569
43612
  try {
43570
- (0, import_child_process6.execFileSync)("git", ["config", "user.name", FERN_BOT_NAME2], { cwd: this.config.outputDir });
43571
- (0, import_child_process6.execFileSync)("git", ["config", "user.email", FERN_BOT_EMAIL2], { cwd: this.config.outputDir });
43613
+ (0, import_child_process7.execFileSync)("git", ["config", "user.name", FERN_BOT_NAME2], { cwd: this.config.outputDir });
43614
+ (0, import_child_process7.execFileSync)("git", ["config", "user.email", FERN_BOT_EMAIL2], { cwd: this.config.outputDir });
43572
43615
  } catch {
43573
43616
  }
43574
43617
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.9.42",
3
+ "version": "0.9.43",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fern-api/fern.git",