@fern-api/fern-api-dev 3.30.6 → 3.31.0-1-g09152f0d06

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 +101 -17
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1413665,7 +1413665,7 @@ var AccessTokenPosthogManager = class {
1413665
1413665
  properties: {
1413666
1413666
  ...event,
1413667
1413667
  ...event.properties,
1413668
- version: "3.30.6",
1413668
+ version: "3.31.0-1-g09152f0d06",
1413669
1413669
  usingAccessToken: true
1413670
1413670
  }
1413671
1413671
  });
@@ -1413764,7 +1413764,7 @@ var UserPosthogManager = class {
1413764
1413764
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1413765
1413765
  event: "CLI",
1413766
1413766
  properties: {
1413767
- version: "3.30.6",
1413767
+ version: "3.31.0-1-g09152f0d06",
1413768
1413768
  ...event,
1413769
1413769
  ...event.properties,
1413770
1413770
  usingAccessToken: false,
@@ -1493831,7 +1493831,7 @@ var CliContext = class {
1493831
1493831
  if (false) {
1493832
1493832
  this.logger.error("CLI_VERSION is not defined");
1493833
1493833
  }
1493834
- return "3.30.6";
1493834
+ return "3.31.0-1-g09152f0d06";
1493835
1493835
  }
1493836
1493836
  getCliName() {
1493837
1493837
  if (false) {
@@ -1588688,7 +1588688,7 @@ var import_path35 = __toESM(require("path"), 1);
1588688
1588688
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1588689
1588689
  var LOGS_FOLDER_NAME = "logs";
1588690
1588690
  function getCliSource() {
1588691
- const version6 = "3.30.6";
1588691
+ const version6 = "3.31.0-1-g09152f0d06";
1588692
1588692
  return `cli@${version6}`;
1588693
1588693
  }
1588694
1588694
  var DebugLogger = class {
@@ -1622356,6 +1622356,17 @@ var RemoteTaskHandler = class {
1622356
1622356
  _other: () => "<unknown package>"
1622357
1622357
  });
1622358
1622358
  });
1622359
+ if (remoteTask2.packages.length > 0 && this.#actualVersion == null) {
1622360
+ this.#actualVersion = remoteTask2.packages[0]?.coordinate._visit({
1622361
+ npm: (npmPackage) => npmPackage.version,
1622362
+ maven: (mavenPackage) => mavenPackage.version,
1622363
+ pypi: (pypiPackage) => pypiPackage.version,
1622364
+ ruby: (rubyGem) => rubyGem.version,
1622365
+ nuget: (nugetPackage) => nugetPackage.version,
1622366
+ crates: (cratesPackage) => cratesPackage.version,
1622367
+ _other: () => void 0
1622368
+ });
1622369
+ }
1622359
1622370
  if (this.absolutePathToPreview == null) {
1622360
1622371
  this.context.setSubtitle(coordinates.length > 0 ? coordinates.map((coordinate) => {
1622361
1622372
  return `\u25E6 ${coordinate}`;
@@ -1622363,6 +1622374,12 @@ var RemoteTaskHandler = class {
1622363
1622374
  }
1622364
1622375
  for (const newLog of remoteTask2.logs.slice(this.lengthOfLastLogs)) {
1622365
1622376
  this.context.logger.log(convertLogLevel(newLog.level), newLog.message);
1622377
+ if (this.#actualVersion == null) {
1622378
+ const tagMatch = newLog.message.match(/Tagging release (\d+\.\d+\.\d+)/);
1622379
+ if (tagMatch) {
1622380
+ this.#actualVersion = tagMatch[1];
1622381
+ }
1622382
+ }
1622366
1622383
  }
1622367
1622384
  this.lengthOfLastLogs = remoteTask2.logs.length;
1622368
1622385
  const logS3Url = (s3Url) => {
@@ -1622406,7 +1622423,8 @@ var RemoteTaskHandler = class {
1622406
1622423
  });
1622407
1622424
  return this.#isFinished ? {
1622408
1622425
  createdSnippets: this.#createdSnippets,
1622409
- snippetsS3PreSignedReadUrl: this.#snippetsS3PreSignedReadUrl
1622426
+ snippetsS3PreSignedReadUrl: this.#snippetsS3PreSignedReadUrl,
1622427
+ actualVersion: this.#actualVersion
1622410
1622428
  } : void 0;
1622411
1622429
  }
1622412
1622430
  getAbsolutePathToLocalOutput() {
@@ -1622424,6 +1622442,10 @@ var RemoteTaskHandler = class {
1622424
1622442
  get snippetsS3PreSignedReadUrl() {
1622425
1622443
  return this.#snippetsS3PreSignedReadUrl;
1622426
1622444
  }
1622445
+ #actualVersion = void 0;
1622446
+ get actualVersion() {
1622447
+ return this.#actualVersion;
1622448
+ }
1622427
1622449
  };
1622428
1622450
  async function downloadFilesForTask({ s3PreSignedReadUrl, absolutePathToLocalOutput, context: context2 }) {
1622429
1622451
  try {
@@ -1622634,7 +1622656,7 @@ var SourceUploader = class {
1622634
1622656
  };
1622635
1622657
 
1622636
1622658
  // ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
1622637
- async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version6, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, readme, fernignorePath }) {
1622659
+ async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version6, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, readme, fernignorePath, dynamicIrOnly }) {
1622638
1622660
  const fdr = createFdrService({ token: token.value });
1622639
1622661
  const packageName = generators_yml_exports.getPackageName({ generatorInvocation });
1622640
1622662
  const isPreview = absolutePathToPreview != null;
@@ -1622722,6 +1622744,41 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
1622722
1622744
  interactiveTaskContext.logger.debug("Setting IR source configuration ...");
1622723
1622745
  ir14.sourceConfig = sourceConfig;
1622724
1622746
  }
1622747
+ if (dynamicIrOnly) {
1622748
+ interactiveTaskContext.logger.info("Dynamic IR only mode: skipping SDK generation and uploading dynamic IR only");
1622749
+ if (version6 == null) {
1622750
+ interactiveTaskContext.failAndThrow("Version is required for dynamic IR only mode");
1622751
+ return void 0;
1622752
+ }
1622753
+ if (generatorInvocation.language == null) {
1622754
+ interactiveTaskContext.failAndThrow("Language is required for dynamic IR only mode");
1622755
+ return void 0;
1622756
+ }
1622757
+ if (packageName == null) {
1622758
+ interactiveTaskContext.failAndThrow("Package name is required for dynamic IR only mode");
1622759
+ return void 0;
1622760
+ }
1622761
+ try {
1622762
+ await uploadDynamicIRForSdkGeneration({
1622763
+ fdr,
1622764
+ organization,
1622765
+ version: version6,
1622766
+ language: generatorInvocation.language,
1622767
+ packageName,
1622768
+ ir: ir14,
1622769
+ smartCasing: generatorInvocation.smartCasing,
1622770
+ dynamicGeneratorConfig,
1622771
+ context: interactiveTaskContext
1622772
+ });
1622773
+ } catch (error2) {
1622774
+ interactiveTaskContext.failAndThrow(`Failed to upload dynamic IR: ${error2 instanceof Error ? error2.message : String(error2)}`);
1622775
+ }
1622776
+ return {
1622777
+ createdSnippets: false,
1622778
+ snippetsS3PreSignedReadUrl: void 0,
1622779
+ actualVersion: version6
1622780
+ };
1622781
+ }
1622725
1622782
  const job = await createAndStartJob({
1622726
1622783
  projectConfig,
1622727
1622784
  workspace,
@@ -1622761,12 +1622818,13 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
1622761
1622818
  taskId,
1622762
1622819
  context: interactiveTaskContext
1622763
1622820
  });
1622764
- if (result != null && generatorInvocation.language != null && packageName != null && resolvedVersion != null && !isPreview) {
1622821
+ const actualVersionForUpload = result?.actualVersion ?? resolvedVersion;
1622822
+ if (result != null && actualVersionForUpload != null && generatorInvocation.language != null && packageName != null && !isPreview) {
1622765
1622823
  try {
1622766
1622824
  await uploadDynamicIRForSdkGeneration({
1622767
1622825
  fdr,
1622768
1622826
  organization,
1622769
- version: resolvedVersion,
1622827
+ version: actualVersionForUpload,
1622770
1622828
  language: generatorInvocation.language,
1622771
1622829
  packageName,
1622772
1622830
  ir: ir14,
@@ -1622912,14 +1622970,14 @@ async function uploadDynamicIRForSdkGeneration({ fdr, organization, version: ver
1622912
1622970
  }
1622913
1622971
  });
1622914
1622972
  if (uploadResponse.ok) {
1622915
- context2.logger.debug(`Successfully uploaded dynamic IR for ${language}`);
1622973
+ context2.logger.debug(`Uploaded dynamic IR for ${language}:${packageName} (${version6})`);
1622916
1622974
  } else {
1622917
1622975
  context2.logger.warn(`Failed to upload dynamic IR for ${language}: ${uploadResponse.status}`);
1622918
1622976
  }
1622919
1622977
  }
1622920
1622978
 
1622921
1622979
  // ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
1622922
- async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context2, generatorGroup, version: version6, shouldLogS3Url, token, whitelabel, absolutePathToPreview, mode, fernignorePath }) {
1622980
+ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context2, generatorGroup, version: version6, shouldLogS3Url, token, whitelabel, absolutePathToPreview, mode, fernignorePath, dynamicIrOnly }) {
1622923
1622981
  if (generatorGroup.generators.length === 0) {
1622924
1622982
  context2.logger.warn("No generators specified.");
1622925
1622983
  return null;
@@ -1622963,7 +1623021,8 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
1622963
1623021
  readme: generatorInvocation.readme,
1622964
1623022
  irVersionOverride: generatorInvocation.irVersionOverride,
1622965
1623023
  absolutePathToPreview,
1622966
- fernignorePath
1623024
+ fernignorePath,
1623025
+ dynamicIrOnly
1622967
1623026
  });
1622968
1623027
  if (remoteTaskHandlerResponse != null && remoteTaskHandlerResponse.createdSnippets) {
1622969
1623028
  snippetsProducedBy.push(generatorInvocation);
@@ -1638511,7 +1638570,8 @@ async function generateWorkspace({
1638511
1638570
  runner,
1638512
1638571
  inspect: inspect4,
1638513
1638572
  lfsOverride,
1638514
- fernignorePath
1638573
+ fernignorePath,
1638574
+ dynamicIrOnly
1638515
1638575
  }) {
1638516
1638576
  if (workspace.generatorsConfiguration == null) {
1638517
1638577
  context2.logger.warn("This workspaces has no generators.yml");
@@ -1638583,7 +1638643,8 @@ async function generateWorkspace({
1638583
1638643
  whitelabel: workspace.generatorsConfiguration?.whitelabel,
1638584
1638644
  absolutePathToPreview,
1638585
1638645
  mode,
1638586
- fernignorePath
1638646
+ fernignorePath,
1638647
+ dynamicIrOnly
1638587
1638648
  });
1638588
1638649
  }
1638589
1638650
  })
@@ -1638693,7 +1638754,8 @@ async function generateAPIWorkspaces({
1638693
1638754
  runner,
1638694
1638755
  inspect: inspect4,
1638695
1638756
  lfsOverride,
1638696
- fernignorePath
1638757
+ fernignorePath,
1638758
+ dynamicIrOnly
1638697
1638759
  }) {
1638698
1638760
  let token = void 0;
1638699
1638761
  if (!useLocalDocker) {
@@ -1638770,7 +1638832,8 @@ async function generateAPIWorkspaces({
1638770
1638832
  runner,
1638771
1638833
  inspect: inspect4,
1638772
1638834
  lfsOverride,
1638773
- fernignorePath
1638835
+ fernignorePath,
1638836
+ dynamicIrOnly
1638774
1638837
  });
1638775
1638838
  });
1638776
1638839
  })
@@ -1646329,6 +1646392,10 @@ function addGenerateCommand(cli, cliContext) {
1646329
1646392
  }).option("fernignore", {
1646330
1646393
  type: "string",
1646331
1646394
  description: "Path to a custom .fernignore file to use instead of the one on the main branch (remote generation only)"
1646395
+ }).option("dynamic-ir-only", {
1646396
+ boolean: true,
1646397
+ description: "Only upload dynamic IR for specified version, skip SDK generation (remote generation only)",
1646398
+ default: false
1646332
1646399
  }),
1646333
1646400
  async (argv) => {
1646334
1646401
  if (argv.api != null && argv.docs != null) {
@@ -1646345,6 +1646412,21 @@ function addGenerateCommand(cli, cliContext) {
1646345
1646412
  "The --fernignore flag is not supported with local generation (--local or --runner). It can only be used with remote generation."
1646346
1646413
  );
1646347
1646414
  }
1646415
+ if (argv["dynamic-ir-only"] && (argv.local || argv.runner != null)) {
1646416
+ return cliContext.failWithoutThrowing(
1646417
+ "The --dynamic-ir-only flag is not supported with local generation (--local or --runner). It can only be used with remote generation."
1646418
+ );
1646419
+ }
1646420
+ if (argv["dynamic-ir-only"] && argv.version == null) {
1646421
+ return cliContext.failWithoutThrowing(
1646422
+ "The --dynamic-ir-only flag requires a version to be specified with --version."
1646423
+ );
1646424
+ }
1646425
+ if (argv["dynamic-ir-only"] && argv.docs != null) {
1646426
+ return cliContext.failWithoutThrowing(
1646427
+ "The --dynamic-ir-only flag can only be used for API generation, not docs generation."
1646428
+ );
1646429
+ }
1646348
1646430
  if (argv.api != null) {
1646349
1646431
  return await generateAPIWorkspaces({
1646350
1646432
  project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
@@ -1646363,7 +1646445,8 @@ function addGenerateCommand(cli, cliContext) {
1646363
1646445
  runner: argv.runner,
1646364
1646446
  inspect: false,
1646365
1646447
  lfsOverride: argv.lfsOverride,
1646366
- fernignorePath: argv.fernignore
1646448
+ fernignorePath: argv.fernignore,
1646449
+ dynamicIrOnly: argv["dynamic-ir-only"]
1646367
1646450
  });
1646368
1646451
  }
1646369
1646452
  if (argv.docs != null) {
@@ -1646409,7 +1646492,8 @@ function addGenerateCommand(cli, cliContext) {
1646409
1646492
  runner: argv.runner,
1646410
1646493
  inspect: false,
1646411
1646494
  lfsOverride: argv.lfsOverride,
1646412
- fernignorePath: argv.fernignore
1646495
+ fernignorePath: argv.fernignore,
1646496
+ dynamicIrOnly: argv["dynamic-ir-only"]
1646413
1646497
  });
1646414
1646498
  }
1646415
1646499
  );
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.30.6",
2
+ "version": "3.31.0-1-g09152f0d06",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",