@fern-api/fern-api-dev 4.80.1 → 4.80.2-3-g9f3967f2c31

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 +19 -112
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -614282,7 +614282,7 @@ var AccessTokenPosthogManager = class {
614282
614282
  properties: {
614283
614283
  ...event,
614284
614284
  ...event.properties,
614285
- version: "4.80.1",
614285
+ version: "4.80.2-3-g9f3967f2c31",
614286
614286
  usingAccessToken: true
614287
614287
  }
614288
614288
  });
@@ -614336,7 +614336,7 @@ var UserPosthogManager = class {
614336
614336
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
614337
614337
  event: "CLI",
614338
614338
  properties: {
614339
- version: "4.80.1",
614339
+ version: "4.80.2-3-g9f3967f2c31",
614340
614340
  ...event,
614341
614341
  ...event.properties,
614342
614342
  usingAccessToken: false,
@@ -831617,7 +831617,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
831617
831617
  var LOGS_FOLDER_NAME = "logs";
831618
831618
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
831619
831619
  function getCliSource() {
831620
- const version7 = "4.80.1";
831620
+ const version7 = "4.80.2-3-g9f3967f2c31";
831621
831621
  return `cli@${version7}`;
831622
831622
  }
831623
831623
  var DebugLogger = class {
@@ -843131,7 +843131,7 @@ var LegacyDocsPublisher = class {
843131
843131
  previewId,
843132
843132
  disableTemplates: void 0,
843133
843133
  skipUpload,
843134
- cliVersion: "4.80.1"
843134
+ cliVersion: "4.80.2-3-g9f3967f2c31"
843135
843135
  });
843136
843136
  if (taskContext.getResult() === TaskResult.Failure) {
843137
843137
  return { success: false };
@@ -880541,6 +880541,7 @@ var Module_ = class _Module_ extends AstNode6 {
880541
880541
  writer2.newLine();
880542
880542
  }
880543
880543
  });
880544
+ writer2.writeNewLineIfLastLineNot();
880544
880545
  writer2.dedent();
880545
880546
  writer2.write("end");
880546
880547
  } else {
@@ -880982,11 +880983,7 @@ var TypeLiteral3 = class _TypeLiteral extends AstNode6 {
880982
880983
  switch (this.internalType.type) {
880983
880984
  case "str": {
880984
880985
  const value2 = this.internalType.value.replaceAll("\r\n", "\n");
880985
- if (value2.includes('"') && !value2.includes("'") && !value2.includes("#")) {
880986
- writer2.write(`'${value2}'`);
880987
- } else {
880988
- writer2.write(`"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`);
880989
- }
880986
+ writer2.write(`"${value2.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`);
880990
880987
  break;
880991
880988
  }
880992
880989
  case "int": {
@@ -896591,6 +896588,7 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
896591
896588
  generatorInvocation,
896592
896589
  org: organization.ok ? organization.body : void 0,
896593
896590
  version: version7,
896591
+ userProvidedVersion,
896594
896592
  packageName,
896595
896593
  context: interactiveTaskContext
896596
896594
  });
@@ -896771,7 +896769,7 @@ async function getWorkspaceTempDir() {
896771
896769
  prefix: "fern"
896772
896770
  });
896773
896771
  }
896774
- function getPublishConfig2({ generatorInvocation, org, version: version7, packageName, context: context3 }) {
896772
+ function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3 }) {
896775
896773
  if (generatorInvocation.raw?.github != null && isGithubSelfhosted2(generatorInvocation.raw.github)) {
896776
896774
  const parsed = parseRepository(generatorInvocation.raw.github.uri);
896777
896775
  const irMode = generatorInvocation.raw.github.mode === "pull-request" ? "pull-request" : void 0;
@@ -896793,6 +896791,16 @@ function getPublishConfig2({ generatorInvocation, org, version: version7, packag
896793
896791
  packageName
896794
896792
  });
896795
896793
  context3.logger.debug(`Created PyPiPublishTarget: version ${version7} package name: ${packageName}`);
896794
+ } else if (generatorInvocation.language === "typescript") {
896795
+ if (userProvidedVersion != null) {
896796
+ const tsPackageName = packageName ?? (typeof generatorInvocation.raw?.config === "object" && generatorInvocation.raw?.config !== null ? generatorInvocation.raw.config.packageJson?.name : void 0);
896797
+ publishTarget = PublishTarget.npm({
896798
+ version: userProvidedVersion,
896799
+ packageName: tsPackageName,
896800
+ tokenEnvironmentVariable: ""
896801
+ });
896802
+ context3.logger.debug(`Created NpmPublishTarget: version ${userProvidedVersion} package name: ${tsPackageName}`);
896803
+ }
896796
896804
  } else if (generatorInvocation.language === "rust") {
896797
896805
  publishTarget = PublishTarget.crates({
896798
896806
  version: version7,
@@ -918212,7 +918220,7 @@ var CliContext = class _CliContext {
918212
918220
  if (false) {
918213
918221
  this.logger.error("CLI_VERSION is not defined");
918214
918222
  }
918215
- return "4.80.1";
918223
+ return "4.80.2-3-g9f3967f2c31";
918216
918224
  }
918217
918225
  getCliName() {
918218
918226
  if (false) {
@@ -919798,66 +919806,6 @@ async function addGeneratorToWorkspaces({
919798
919806
  );
919799
919807
  }
919800
919808
 
919801
- // src/commands/generate/shouldSkipGenerator.ts
919802
- function shouldSkipGenerator({
919803
- generator,
919804
- rootAutorelease
919805
- }) {
919806
- if (!generator.automation.generate) {
919807
- return true;
919808
- }
919809
- if (generator.absolutePathToLocalOutput != null) {
919810
- return true;
919811
- }
919812
- if (generator.raw?.autorelease === false) {
919813
- return true;
919814
- }
919815
- if (generator.raw?.autorelease == null && rootAutorelease === false) {
919816
- return true;
919817
- }
919818
- return false;
919819
- }
919820
-
919821
- // src/commands/automations/listGenerateCommands.ts
919822
- function listGenerateCommands({
919823
- workspaces,
919824
- groupFilter,
919825
- version: version7,
919826
- autoMerge
919827
- }) {
919828
- const commands = [];
919829
- for (const workspace of workspaces) {
919830
- const generatorsConfiguration = workspace.generatorsConfiguration;
919831
- const groups2 = generatorsConfiguration?.groups ?? [];
919832
- const rootAutorelease = generatorsConfiguration?.rawConfiguration.autorelease;
919833
- for (const group of groups2) {
919834
- if (groupFilter != null && group.groupName !== groupFilter) {
919835
- continue;
919836
- }
919837
- for (let i9 = 0; i9 < group.generators.length; i9++) {
919838
- const generator = group.generators[i9];
919839
- if (generator == null || shouldSkipGenerator({ generator, rootAutorelease })) {
919840
- continue;
919841
- }
919842
- const parts = ["fern", "automations", "generate"];
919843
- if (workspace.workspaceName != null) {
919844
- parts.push("--api", workspace.workspaceName);
919845
- }
919846
- parts.push("--group", group.groupName);
919847
- parts.push("--generator", String(i9));
919848
- if (version7 != null) {
919849
- parts.push("--version", version7);
919850
- }
919851
- if (autoMerge) {
919852
- parts.push("--auto-merge");
919853
- }
919854
- commands.push(parts.join(" "));
919855
- }
919856
- }
919857
- }
919858
- return commands;
919859
- }
919860
-
919861
919809
  // src/commands/sdk-preview/overrideOutputForPreview.ts
919862
919810
  var PREVIEW_REGISTRY_URL = process.env.FERN_PREVIEW_REGISTRY_URL ?? "https://npm.buildwithfern.com";
919863
919811
  var SUPPORTED_TYPESCRIPT_GENERATORS = /* @__PURE__ */ new Set([
@@ -938733,52 +938681,11 @@ function addSdkCommand2(cli, cliContext) {
938733
938681
  }
938734
938682
  function addAutomationsCommand(cli, cliContext) {
938735
938683
  cli.command("automations", false, (yargs) => {
938736
- addAutomationsListCommand(yargs, cliContext);
938737
938684
  addAutomationsGenerateCommand(yargs, cliContext);
938738
938685
  addAutomationsPreviewCommand(yargs, cliContext);
938739
938686
  return yargs.demandCommand();
938740
938687
  });
938741
938688
  }
938742
- function addAutomationsListCommand(cli, cliContext) {
938743
- cli.command("list", false, (yargs) => {
938744
- addAutomationsListGenerateCommand(yargs, cliContext);
938745
- return yargs.demandCommand();
938746
- });
938747
- }
938748
- function addAutomationsListGenerateCommand(cli, cliContext) {
938749
- cli.command(
938750
- "generate",
938751
- false,
938752
- // hidden
938753
- (yargs) => yargs.option("group", {
938754
- type: "string",
938755
- description: "Filter to a specific generator group (e.g. 'sdk'). Omit to list all groups."
938756
- }).option("api", {
938757
- type: "string",
938758
- description: "Filter to a specific API in a multi-API repo (e.g. 'foo' for fern/apis/foo/). Omit to list all APIs."
938759
- }).option("version", {
938760
- type: "string",
938761
- description: "Version string to include in generated commands (e.g. 'AUTO' for AI-based versioning)"
938762
- }).option("auto-merge", {
938763
- boolean: true,
938764
- default: false,
938765
- description: "Include --auto-merge flag in generated commands"
938766
- }),
938767
- async (argv) => {
938768
- const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
938769
- commandLineApiWorkspace: argv.api,
938770
- defaultToAllApiWorkspaces: true
938771
- });
938772
- const commands = listGenerateCommands({
938773
- workspaces: project.apiWorkspaces,
938774
- groupFilter: argv.group,
938775
- version: argv.version,
938776
- autoMerge: argv["auto-merge"]
938777
- });
938778
- process.stdout.write(JSON.stringify(commands));
938779
- }
938780
- );
938781
- }
938782
938689
  function addAutomationsPreviewCommand(cli, cliContext) {
938783
938690
  cli.command(
938784
938691
  "preview",
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.80.1",
2
+ "version": "4.80.2-3-g9f3967f2c31",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",