@fern-api/fern-api-dev 5.14.1 → 5.15.0

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 +70 -15
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -310912,6 +310912,8 @@ var require_buildReplayTelemetryProps = __commonJS({
310912
310912
  executed: replay?.executed ?? false,
310913
310913
  flow: replay?.flow ?? null,
310914
310914
  replay_crashed: replay?.replayCrashed === true,
310915
+ auto_bootstrapped: replay?.autoBootstrapped === true,
310916
+ bootstrap_attempted: replay?.bootstrapAttempted === true,
310915
310917
  pipeline_success: pipelineResult.success,
310916
310918
  pipeline_warnings_count: pipelineResult.warnings?.length ?? 0,
310917
310919
  replay_warnings_count: replay?.warnings?.length ?? 0,
@@ -322399,11 +322401,39 @@ var require_replay_run = __commonJS({
322399
322401
  var fs_1 = require("fs");
322400
322402
  var path_1 = require("path");
322401
322403
  var fernignore_1 = require_fernignore();
322402
- async function replayPrepare(params2) {
322404
+ async function replayPrepare(params2, state) {
322403
322405
  const { outputDir, cliVersion, generatorVersions, stageOnly = false, generatorName, skipApplication, logger: logger4 } = params2;
322404
322406
  const lockfilePath = (0, path_1.join)(outputDir, ".fern", "replay.lock");
322407
+ let autoBootstrapped = false;
322408
+ let bootstrapAttempted = false;
322405
322409
  if (!(0, fs_1.existsSync)(lockfilePath)) {
322406
- return null;
322410
+ if (process.env.FERN_DISABLE_AUTO_BOOTSTRAP === "true" || process.env.FERN_DISABLE_AUTO_BOOTSTRAP === "1") {
322411
+ return null;
322412
+ }
322413
+ bootstrapAttempted = true;
322414
+ if (state) {
322415
+ state.bootstrapAttempted = true;
322416
+ }
322417
+ try {
322418
+ const bootstrapResult = await (0, replay_1.bootstrap)(outputDir, {
322419
+ fernignoreAction: "skip",
322420
+ force: false,
322421
+ importHistory: false
322422
+ });
322423
+ if (bootstrapResult.generationCommit == null) {
322424
+ return null;
322425
+ }
322426
+ autoBootstrapped = true;
322427
+ } catch (error50) {
322428
+ logger4?.warn("Replay auto-bootstrap failed, continuing without replay: " + String(error50));
322429
+ try {
322430
+ if ((0, fs_1.existsSync)(lockfilePath)) {
322431
+ (0, fs_1.unlinkSync)(lockfilePath);
322432
+ }
322433
+ } catch {
322434
+ }
322435
+ return null;
322436
+ }
322407
322437
  }
322408
322438
  const baseBranchHead = gitRevParse(outputDir, "HEAD");
322409
322439
  let previousGenerationSha = null;
@@ -322477,7 +322507,9 @@ var require_replay_run = __commonJS({
322477
322507
  flow: preparation.flow,
322478
322508
  previousGenerationSha,
322479
322509
  currentGenerationSha: preparation.currentGenerationSha,
322480
- baseBranchHead
322510
+ baseBranchHead,
322511
+ autoBootstrapped,
322512
+ bootstrapAttempted
322481
322513
  };
322482
322514
  }
322483
322515
  async function replayApply(prepared, params2 = {}) {
@@ -322493,6 +322525,8 @@ var require_replay_run = __commonJS({
322493
322525
  previousGenerationSha: prepared.previousGenerationSha,
322494
322526
  currentGenerationSha: prepared.currentGenerationSha,
322495
322527
  baseBranchHead: prepared.baseBranchHead,
322528
+ autoBootstrapped: prepared.autoBootstrapped,
322529
+ bootstrapAttempted: prepared.bootstrapAttempted,
322496
322530
  failureReason: String(error50)
322497
322531
  };
322498
322532
  }
@@ -322515,13 +322549,16 @@ var require_replay_run = __commonJS({
322515
322549
  fernignoreUpdated,
322516
322550
  previousGenerationSha: prepared.previousGenerationSha,
322517
322551
  currentGenerationSha: prepared.currentGenerationSha,
322518
- baseBranchHead: resolvedBaseBranchHead
322552
+ baseBranchHead: resolvedBaseBranchHead,
322553
+ autoBootstrapped: prepared.autoBootstrapped,
322554
+ bootstrapAttempted: prepared.bootstrapAttempted
322519
322555
  };
322520
322556
  }
322521
322557
  async function replayRun(params2) {
322558
+ const prepareState = { bootstrapAttempted: false };
322522
322559
  let prepared;
322523
322560
  try {
322524
- prepared = await replayPrepare(params2);
322561
+ prepared = await replayPrepare(params2, prepareState);
322525
322562
  } catch (error50) {
322526
322563
  return {
322527
322564
  report: null,
@@ -322529,6 +322566,8 @@ var require_replay_run = __commonJS({
322529
322566
  previousGenerationSha: null,
322530
322567
  currentGenerationSha: null,
322531
322568
  baseBranchHead: null,
322569
+ autoBootstrapped: false,
322570
+ bootstrapAttempted: prepareState.bootstrapAttempted,
322532
322571
  failureReason: error50 instanceof ReplayPrepareError ? error50.reason : String(error50)
322533
322572
  };
322534
322573
  }
@@ -322538,7 +322577,9 @@ var require_replay_run = __commonJS({
322538
322577
  fernignoreUpdated: false,
322539
322578
  previousGenerationSha: null,
322540
322579
  currentGenerationSha: null,
322541
- baseBranchHead: null
322580
+ baseBranchHead: null,
322581
+ autoBootstrapped: false,
322582
+ bootstrapAttempted: prepareState.bootstrapAttempted
322542
322583
  };
322543
322584
  }
322544
322585
  return replayApply(prepared, { stageOnly: params2.stageOnly, logger: params2.logger });
@@ -322630,6 +322671,7 @@ var require_GenerationCommitStep = __commonJS({
322630
322671
  }
322631
322672
  async execute(_context) {
322632
322673
  const headBeforePrepare = tryRevParse(this.outputDir, "HEAD");
322674
+ const prepareState = { bootstrapAttempted: false };
322633
322675
  let prepared;
322634
322676
  try {
322635
322677
  prepared = await (0, replay_run_1.replayPrepare)({
@@ -322639,7 +322681,7 @@ var require_GenerationCommitStep = __commonJS({
322639
322681
  generatorName: this.generatorName,
322640
322682
  skipApplication: this.config.skipApplication,
322641
322683
  logger: this.logger
322642
- });
322684
+ }, prepareState);
322643
322685
  } catch (error50) {
322644
322686
  const reason = error50 instanceof replay_run_1.ReplayPrepareError ? error50.reason : String(error50);
322645
322687
  if (headBeforePrepare != null) {
@@ -322655,14 +322697,16 @@ var require_GenerationCommitStep = __commonJS({
322655
322697
  executed: true,
322656
322698
  success: true,
322657
322699
  errorMessage: reason,
322658
- preparedReplay: null
322700
+ preparedReplay: null,
322701
+ bootstrapAttempted: prepareState.bootstrapAttempted
322659
322702
  };
322660
322703
  }
322661
322704
  if (prepared == null) {
322662
322705
  return {
322663
322706
  executed: true,
322664
322707
  success: true,
322665
- preparedReplay: null
322708
+ preparedReplay: null,
322709
+ bootstrapAttempted: prepareState.bootstrapAttempted
322666
322710
  };
322667
322711
  }
322668
322712
  return {
@@ -322672,7 +322716,8 @@ var require_GenerationCommitStep = __commonJS({
322672
322716
  previousGenerationSha: prepared.previousGenerationSha ?? void 0,
322673
322717
  currentGenerationSha: prepared.currentGenerationSha,
322674
322718
  baseBranchHead: prepared.baseBranchHead ?? void 0,
322675
- flow: prepared.flow
322719
+ flow: prepared.flow,
322720
+ bootstrapAttempted: prepareState.bootstrapAttempted
322676
322721
  };
322677
322722
  }
322678
322723
  };
@@ -327338,6 +327383,8 @@ var require_ReplayStep = __commonJS({
327338
327383
  success: true,
327339
327384
  replayCrashed: true,
327340
327385
  errorMessage: generationCommit.errorMessage,
327386
+ autoBootstrapped: false,
327387
+ bootstrapAttempted: generationCommit.bootstrapAttempted === true,
327341
327388
  flow: "normal-regeneration",
327342
327389
  patchesDetected: 0,
327343
327390
  patchesApplied: 0,
@@ -327348,6 +327395,8 @@ var require_ReplayStep = __commonJS({
327348
327395
  return {
327349
327396
  executed: true,
327350
327397
  success: true,
327398
+ autoBootstrapped: false,
327399
+ bootstrapAttempted: generationCommit.bootstrapAttempted === true,
327351
327400
  flow: "first-generation",
327352
327401
  patchesDetected: 0,
327353
327402
  patchesApplied: 0,
@@ -327375,6 +327424,8 @@ var require_ReplayStep = __commonJS({
327375
327424
  previousGenerationSha: result.previousGenerationSha ?? void 0,
327376
327425
  currentGenerationSha: result.currentGenerationSha ?? void 0,
327377
327426
  baseBranchHead: result.baseBranchHead ?? void 0,
327427
+ autoBootstrapped: result.autoBootstrapped,
327428
+ bootstrapAttempted: result.bootstrapAttempted,
327378
327429
  flow: "normal-regeneration",
327379
327430
  patchesDetected: 0,
327380
327431
  patchesApplied: 0,
@@ -327388,6 +327439,8 @@ var require_ReplayStep = __commonJS({
327388
327439
  previousGenerationSha: result.previousGenerationSha ?? void 0,
327389
327440
  currentGenerationSha: result.currentGenerationSha ?? void 0,
327390
327441
  baseBranchHead: result.baseBranchHead ?? void 0,
327442
+ autoBootstrapped: result.autoBootstrapped,
327443
+ bootstrapAttempted: result.bootstrapAttempted,
327391
327444
  flow: "first-generation",
327392
327445
  patchesDetected: 0,
327393
327446
  patchesApplied: 0,
@@ -327401,6 +327454,8 @@ var require_ReplayStep = __commonJS({
327401
327454
  previousGenerationSha: result.previousGenerationSha ?? void 0,
327402
327455
  currentGenerationSha: result.currentGenerationSha ?? void 0,
327403
327456
  baseBranchHead: result.baseBranchHead ?? void 0,
327457
+ autoBootstrapped: result.autoBootstrapped,
327458
+ bootstrapAttempted: result.bootstrapAttempted,
327404
327459
  flow: report.flow,
327405
327460
  patchesDetected: report.patchesDetected,
327406
327461
  patchesApplied: report.patchesApplied,
@@ -623478,7 +623533,7 @@ var AccessTokenPosthogManager = class {
623478
623533
  properties: {
623479
623534
  ...event,
623480
623535
  ...event.properties,
623481
- version: "5.14.1",
623536
+ version: "5.15.0",
623482
623537
  usingAccessToken: true
623483
623538
  }
623484
623539
  });
@@ -623532,7 +623587,7 @@ var UserPosthogManager = class {
623532
623587
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
623533
623588
  event: "CLI",
623534
623589
  properties: {
623535
- version: "5.14.1",
623590
+ version: "5.15.0",
623536
623591
  ...event,
623537
623592
  ...event.properties,
623538
623593
  usingAccessToken: false,
@@ -848520,7 +848575,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
848520
848575
  var LOGS_FOLDER_NAME = "logs";
848521
848576
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
848522
848577
  function getCliSource() {
848523
- const version7 = "5.14.1";
848578
+ const version7 = "5.15.0";
848524
848579
  return `cli@${version7}`;
848525
848580
  }
848526
848581
  var DebugLogger = class {
@@ -861319,7 +861374,7 @@ var LegacyDocsPublisher = class {
861319
861374
  previewId,
861320
861375
  disableTemplates: void 0,
861321
861376
  skipUpload,
861322
- cliVersion: "5.14.1",
861377
+ cliVersion: "5.15.0",
861323
861378
  loginCommand: "fern auth login"
861324
861379
  });
861325
861380
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -935840,7 +935895,7 @@ var CliContext = class _CliContext {
935840
935895
  if (false) {
935841
935896
  this.logger.error("CLI_VERSION is not defined");
935842
935897
  }
935843
- return "5.14.1";
935898
+ return "5.15.0";
935844
935899
  }
935845
935900
  getCliName() {
935846
935901
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.14.1",
2
+ "version": "5.15.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",