@fern-api/fern-api-dev 5.51.0 → 5.51.1

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 +27 -21
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -562574,9 +562574,9 @@ var require_VersionUtils = __commonJS({
562574
562574
  Object.defineProperty(exports2, "__esModule", { value: true });
562575
562575
  exports2.VersionBump = exports2.MAX_RAW_DIFF_BYTES = exports2.MAX_CHUNKS = exports2.MAX_AI_DIFF_BYTES = exports2.MAGIC_VERSION_PYTHON = exports2.MAGIC_VERSION = exports2.AUTO_VERSION = void 0;
562576
562576
  exports2.extractLanguageFromGeneratorName = extractLanguageFromGeneratorName2;
562577
- exports2.mapMagicVersionForLanguage = mapMagicVersionForLanguage2;
562577
+ exports2.mapMagicVersionForLanguage = mapMagicVersionForLanguage3;
562578
562578
  exports2.maxVersionBump = maxVersionBump3;
562579
- exports2.isAutoVersion = isAutoVersion4;
562579
+ exports2.isAutoVersion = isAutoVersion5;
562580
562580
  exports2.isValidSemver = isValidSemver;
562581
562581
  exports2.incrementVersion = incrementVersion;
562582
562582
  exports2.extractPreviousVersionFromDiffLine = extractPreviousVersionFromDiffLine;
@@ -562619,7 +562619,7 @@ var require_VersionUtils = __commonJS({
562619
562619
  exports2.AUTO_VERSION = "AUTO";
562620
562620
  exports2.MAGIC_VERSION = "0.0.0-fern-placeholder";
562621
562621
  exports2.MAGIC_VERSION_PYTHON = "0.0.0.dev0";
562622
- function mapMagicVersionForLanguage2(magicVersion, language) {
562622
+ function mapMagicVersionForLanguage3(magicVersion, language) {
562623
562623
  if (magicVersion !== exports2.MAGIC_VERSION) {
562624
562624
  return magicVersion;
562625
562625
  }
@@ -562651,7 +562651,7 @@ var require_VersionUtils = __commonJS({
562651
562651
  return (VERSION_BUMP_RANK[a3] ?? 0) >= (VERSION_BUMP_RANK[b5] ?? 0) ? a3 : b5;
562652
562652
  }
562653
562653
  var SEMVER_PATTERN = /^(v)?(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+([\w.-]+))?$/;
562654
- function isAutoVersion4(version7) {
562654
+ function isAutoVersion5(version7) {
562655
562655
  return exports2.AUTO_VERSION.toLowerCase() === version7.toLowerCase();
562656
562656
  }
562657
562657
  function isValidSemver(version7) {
@@ -686381,7 +686381,7 @@ var AccessTokenPosthogManager = class {
686381
686381
  properties: {
686382
686382
  ...event,
686383
686383
  ...event.properties,
686384
- version: "5.51.0",
686384
+ version: "5.51.1",
686385
686385
  usingAccessToken: true,
686386
686386
  ...getRunIdProperties()
686387
686387
  }
@@ -686447,7 +686447,7 @@ var UserPosthogManager = class {
686447
686447
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
686448
686448
  event: "CLI",
686449
686449
  properties: {
686450
- version: "5.51.0",
686450
+ version: "5.51.1",
686451
686451
  ...event,
686452
686452
  ...event.properties,
686453
686453
  usingAccessToken: false,
@@ -867509,7 +867509,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
867509
867509
  var LOGS_FOLDER_NAME = "logs";
867510
867510
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
867511
867511
  function getCliSource() {
867512
- const version7 = "5.51.0";
867512
+ const version7 = "5.51.1";
867513
867513
  return `cli@${version7}`;
867514
867514
  }
867515
867515
  var DebugLogger = class {
@@ -899697,7 +899697,7 @@ var LegacyDocsPublisher = class {
899697
899697
  previewId,
899698
899698
  disableTemplates: void 0,
899699
899699
  skipUpload,
899700
- cliVersion: "5.51.0",
899700
+ cliVersion: "5.51.1",
899701
899701
  loginCommand: "fern auth login"
899702
899702
  });
899703
899703
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -952529,7 +952529,8 @@ var LocalTaskHandler = class {
952529
952529
  autoVersioningVersionBumpReason: void 0
952530
952530
  };
952531
952531
  }
952532
- await autoVersioningService.replaceMagicVersion(this.absolutePathToLocalOutput, this.version, autoVersionResult.version);
952532
+ const mappedMagicVersion = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
952533
+ await autoVersioningService.replaceMagicVersion(this.absolutePathToLocalOutput, mappedMagicVersion, autoVersionResult.version);
952533
952534
  if (this.generatorLanguage === "go") {
952534
952535
  this.context.logger.info("Adding Go major version suffix to module paths");
952535
952536
  await autoVersioningService.addGoMajorVersionSuffix(this.absolutePathToLocalOutput, autoVersionResult.version);
@@ -952554,6 +952555,7 @@ var LocalTaskHandler = class {
952554
952555
  async handleAutoVersioning(priorChangelog) {
952555
952556
  const autoVersioningService = new import_autoversion2.AutoVersioningService({ logger: this.context.logger });
952556
952557
  let diffFile;
952558
+ const mappedMagicVersion = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
952557
952559
  try {
952558
952560
  this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
952559
952561
  diffFile = await this.generateDiffFile();
@@ -952570,7 +952572,7 @@ var LocalTaskHandler = class {
952570
952572
  }
952571
952573
  let previousVersion;
952572
952574
  try {
952573
- previousVersion = autoVersioningService.extractPreviousVersion(diffContent, this.version);
952575
+ previousVersion = autoVersioningService.extractPreviousVersion(diffContent, mappedMagicVersion);
952574
952576
  } catch (e2) {
952575
952577
  if (!(e2 instanceof import_autoversion2.AutoVersioningException) || !e2.magicVersionAbsent) {
952576
952578
  throw e2;
@@ -952583,7 +952585,7 @@ var LocalTaskHandler = class {
952583
952585
  }
952584
952586
  if (previousVersion == null) {
952585
952587
  this.context.logger.info("No git tags found \u2014 treating as new SDK repository");
952586
- const initialVersion = this.version?.startsWith("v") ? "v0.0.1" : "0.0.1";
952588
+ const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
952587
952589
  const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
952588
952590
  return {
952589
952591
  version: initialVersion,
@@ -952592,7 +952594,7 @@ var LocalTaskHandler = class {
952592
952594
  }
952593
952595
  this.context.logger.debug(`Previous version from fallback: ${previousVersion}`);
952594
952596
  }
952595
- const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent, this.version);
952597
+ const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent, mappedMagicVersion);
952596
952598
  const rawDiffSizeKB = (0, import_autoversion2.formatSizeKB)(diffContent.length);
952597
952599
  const cleanedDiffSizeKB = (0, import_autoversion2.formatSizeKB)(cleanedDiff.length);
952598
952600
  const rawFileCount = (0, import_autoversion2.countFilesInDiff)(diffContent);
@@ -952611,7 +952613,7 @@ var LocalTaskHandler = class {
952611
952613
  }
952612
952614
  if (previousVersion == null) {
952613
952615
  this.context.logger.info("No previous version found (new SDK repository). Using 0.0.1 as initial version.");
952614
- const initialVersion = this.version?.startsWith("v") ? "v0.0.1" : "0.0.1";
952616
+ const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
952615
952617
  const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
952616
952618
  return {
952617
952619
  version: initialVersion,
@@ -952747,7 +952749,7 @@ var LocalTaskHandler = class {
952747
952749
  } catch (error50) {
952748
952750
  if (error50 instanceof import_autoversion2.AutoVersioningException) {
952749
952751
  this.context.logger.warn(`AUTO versioning could not extract previous version: ${error50.message}. Falling back to initial version 0.0.1.`);
952750
- const initialVersion = this.version?.startsWith("v") ? "v0.0.1" : "0.0.1";
952752
+ const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
952751
952753
  const commitMessage = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
952752
952754
  return {
952753
952755
  version: initialVersion,
@@ -952874,8 +952876,8 @@ var LocalTaskHandler = class {
952874
952876
  }
952875
952877
  /**
952876
952878
  * Normalizes a version string's `v` prefix to match the convention used by
952877
- * the magic version (`this.version`). Git tags may use `v1.2.3` while the
952878
- * magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
952879
+ * the magic version for this generator's language. Git tags may use `v1.2.3`
952880
+ * while the magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
952879
952881
  * Without normalization the mismatch propagates into `replaceMagicVersion`
952880
952882
  * and can produce invalid versions in package manifests (e.g. `v1.3.0` in
952881
952883
  * a `package.json` that expects bare semver).
@@ -952884,8 +952886,9 @@ var LocalTaskHandler = class {
952884
952886
  if (version7 == null) {
952885
952887
  return void 0;
952886
952888
  }
952889
+ const mapped = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
952887
952890
  const stripped = version7.startsWith("v") ? version7.slice(1) : version7;
952888
- if (this.version?.startsWith("v")) {
952891
+ if (mapped.startsWith("v")) {
952889
952892
  return `v${stripped}`;
952890
952893
  }
952891
952894
  return stripped;
@@ -953453,6 +953456,8 @@ function extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig) {
953453
953456
  return void 0;
953454
953457
  }
953455
953458
  async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFernConfig, workspace, generatorInvocation, absolutePathToLocalOutput, absolutePathToLocalSnippetJSON, absolutePathToLocalSnippetTemplateJSON, audiences, version: version7, workspaceTempDir, keepDocker, context: context3, irVersionOverride, outputVersionOverride, writeUnitTests, generateOauthClients, generatePaginatedClients, includeOptionalRequestPropertyExamples, inspect: inspect6, executionEnvironment, runner, whiteLabel, publishToRegistry, ir: ir3, ai: ai2, autoVersioningCache, absolutePathToSpecRepo, skipFernignore, disableTelemetry, rawApiSpecs }) {
953459
+ const irVersion = version7 ?? outputVersionOverride;
953460
+ const effectiveIrVersion = irVersion != null && (0, import_autoversion3.isAutoVersion)(irVersion) ? import_autoversion3.MAGIC_VERSION : irVersion;
953456
953461
  const { latest: latest2, migrated } = await getIntermediateRepresentation({
953457
953462
  workspace,
953458
953463
  audiences,
@@ -953460,7 +953465,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
953460
953465
  context: context3,
953461
953466
  irVersionOverride,
953462
953467
  packageName: generators_yml_exports.getPackageName({ generatorInvocation }),
953463
- version: version7 ?? outputVersionOverride,
953468
+ version: effectiveIrVersion,
953464
953469
  sourceConfig: getSourceConfig(workspace, executionEnvironment?.usesContainerPaths ?? true),
953465
953470
  includeOptionalRequestPropertyExamples,
953466
953471
  ir: ir3
@@ -953515,7 +953520,8 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
953515
953520
  };
953516
953521
  const generatorLanguage = generatorInvocation.language ?? (0, import_autoversion3.extractLanguageFromGeneratorName)(generatorInvocation.name);
953517
953522
  const mappedVersion = version7 != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(version7, generatorLanguage) : version7;
953518
- const mappedOutputVersionOverride = outputVersionOverride != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(outputVersionOverride, generatorLanguage) : outputVersionOverride;
953523
+ const effectiveOutputVersion = outputVersionOverride != null && (0, import_autoversion3.isAutoVersion)(outputVersionOverride) ? import_autoversion3.MAGIC_VERSION : outputVersionOverride;
953524
+ const mappedOutputVersionOverride = effectiveOutputVersion != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(effectiveOutputVersion, generatorLanguage) : effectiveOutputVersion;
953519
953525
  const config5 = getGeneratorConfig({
953520
953526
  generatorInvocation,
953521
953527
  customConfig: generatorInvocation.config,
@@ -965832,7 +965838,7 @@ function getAutomationContextFromEnv() {
965832
965838
  config_branch: process.env.FERN_CONFIG_BRANCH,
965833
965839
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
965834
965840
  trigger: process.env.GITHUB_EVENT_NAME,
965835
- cli_version: "5.51.0"
965841
+ cli_version: "5.51.1"
965836
965842
  };
965837
965843
  }
965838
965844
  function isAutomationMode() {
@@ -966664,7 +966670,7 @@ var CliContext = class _CliContext {
966664
966670
  if (false) {
966665
966671
  this.logger.error("CLI_VERSION is not defined");
966666
966672
  }
966667
- return "5.51.0";
966673
+ return "5.51.1";
966668
966674
  }
966669
966675
  getCliName() {
966670
966676
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.51.0",
2
+ "version": "5.51.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",