@fern-api/fern-api-dev 5.27.3 → 5.27.5

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 +48 -31
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -667965,7 +667965,7 @@ var AccessTokenPosthogManager = class {
667965
667965
  properties: {
667966
667966
  ...event,
667967
667967
  ...event.properties,
667968
- version: "5.27.3",
667968
+ version: "5.27.5",
667969
667969
  usingAccessToken: true,
667970
667970
  ...getRunIdProperties()
667971
667971
  }
@@ -668029,7 +668029,7 @@ var UserPosthogManager = class {
668029
668029
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
668030
668030
  event: "CLI",
668031
668031
  properties: {
668032
- version: "5.27.3",
668032
+ version: "5.27.5",
668033
668033
  ...event,
668034
668034
  ...event.properties,
668035
668035
  usingAccessToken: false,
@@ -823710,17 +823710,24 @@ var DocsDefinitionResolver = class {
823710
823710
  this.taskContext.logger.debug("Replacing image paths and URLs in markdown...");
823711
823711
  const replaceStart = performance.now();
823712
823712
  for (const [relativePath, markdown] of Object.entries(this.parsedDocsConfig.pages)) {
823713
- this.parsedDocsConfig.pages[RelativeFilePath2.of(relativePath)] = replaceImagePathsAndUrls(
823714
- markdown,
823715
- this.collectedFileIds,
823716
- // convert slugs to full URL pathnames
823717
- markdownFilesToPathName,
823718
- {
823719
- absolutePathToMarkdownFile: this.resolveFilepath(relativePath),
823720
- absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath
823721
- },
823722
- this.taskContext
823723
- );
823713
+ try {
823714
+ this.parsedDocsConfig.pages[RelativeFilePath2.of(relativePath)] = replaceImagePathsAndUrls(
823715
+ markdown,
823716
+ this.collectedFileIds,
823717
+ // convert slugs to full URL pathnames
823718
+ markdownFilesToPathName,
823719
+ {
823720
+ absolutePathToMarkdownFile: this.resolveFilepath(relativePath),
823721
+ absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath
823722
+ },
823723
+ this.taskContext
823724
+ );
823725
+ } catch (error50) {
823726
+ throw new CliError({
823727
+ message: `Failed to replace image paths in markdown file ${relativePath}: ${extractErrorMessage(error50)}`,
823728
+ code: CliError.Code.ParseError
823729
+ });
823730
+ }
823724
823731
  }
823725
823732
  const replaceTime = performance.now() - replaceStart;
823726
823733
  this.taskContext.logger.debug(`Replaced image paths in ${replaceTime.toFixed(0)}ms`);
@@ -859601,7 +859608,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
859601
859608
  var LOGS_FOLDER_NAME = "logs";
859602
859609
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
859603
859610
  function getCliSource() {
859604
- const version7 = "5.27.3";
859611
+ const version7 = "5.27.5";
859605
859612
  return `cli@${version7}`;
859606
859613
  }
859607
859614
  var DebugLogger = class {
@@ -860693,17 +860700,25 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
860693
860700
  fileIdsMap.set(filepath, fileId);
860694
860701
  }
860695
860702
  }
860696
- const finalMarkdown = replaceImagePathsAndUrls(
860697
- markdownWithAbsPaths,
860698
- fileIdsMap,
860699
- {},
860700
- // markdownFilesToPathName - empty object since we don't need it for images
860701
- {
860702
- absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
860703
- absolutePathToMarkdownFile: absoluteFilePath
860704
- },
860705
- context3
860706
- );
860703
+ let finalMarkdown;
860704
+ try {
860705
+ finalMarkdown = replaceImagePathsAndUrls(
860706
+ markdownWithAbsPaths,
860707
+ fileIdsMap,
860708
+ {},
860709
+ // markdownFilesToPathName - empty object since we don't need it for images
860710
+ {
860711
+ absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
860712
+ absolutePathToMarkdownFile: absoluteFilePath
860713
+ },
860714
+ context3
860715
+ );
860716
+ } catch (error50) {
860717
+ throw new CliError({
860718
+ message: `Failed to replace image paths in ${absoluteFilePath}: ${extractErrorMessage(error50)}`,
860719
+ code: CliError.Code.ParseError
860720
+ });
860721
+ }
860707
860722
  previousDocsDefinition.pages[pageId] = {
860708
860723
  markdown: stripMdxComments(finalMarkdown),
860709
860724
  editThisPageUrl: previousValue?.editThisPageUrl,
@@ -861730,7 +861745,7 @@ ${err.stack}`);
861730
861745
  try {
861731
861746
  await startNextJsServer();
861732
861747
  } catch (err) {
861733
- context3.failAndThrow(`Docs preview server failed to start: ${extractErrorMessage(err)}. Run with --log-level debug for more details.`, void 0, { code: CliError.Code.InternalError });
861748
+ context3.failAndThrow(`Docs preview server failed to start: ${extractErrorMessage(err)}. Run with --log-level debug for more details.`, void 0, { code: CliError.Code.EnvironmentError });
861734
861749
  }
861735
861750
  watcher.on("all", async (event, targetPath, _targetPathNext) => {
861736
861751
  if (targetPath.includes(".fern/logs/") || targetPath.includes(".fern\\logs\\")) {
@@ -870924,7 +870939,7 @@ async function retryWithRateLimit({ fn: fn10, retryRateLimited, logger: logger4,
870924
870939
  }
870925
870940
  throw new CliError({
870926
870941
  message: "Exceeded maximum retries for 429 Too Many Requests.",
870927
- code: CliError.Code.InternalError
870942
+ code: CliError.Code.NetworkError
870928
870943
  });
870929
870944
  }
870930
870945
 
@@ -872326,7 +872341,9 @@ async function generateOne({ generatorInvocation, interactiveTaskContext, projec
872326
872341
  generatorsYmlAbsolutePath,
872327
872342
  generatorsYmlLineNumber: lineNumber
872328
872343
  });
872329
- interactiveTaskContext.failWithoutThrowing(message);
872344
+ interactiveTaskContext.failWithoutThrowing(message, error50, {
872345
+ code: resolveErrorCode(error50)
872346
+ });
872330
872347
  }
872331
872348
  }
872332
872349
 
@@ -873591,7 +873608,7 @@ var LegacyDocsPublisher = class {
873591
873608
  previewId,
873592
873609
  disableTemplates: void 0,
873593
873610
  skipUpload,
873594
- cliVersion: "5.27.3",
873611
+ cliVersion: "5.27.5",
873595
873612
  loginCommand: "fern auth login"
873596
873613
  });
873597
873614
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -947996,7 +948013,7 @@ function getAutomationContextFromEnv() {
947996
948013
  config_branch: process.env.FERN_CONFIG_BRANCH,
947997
948014
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
947998
948015
  trigger: process.env.GITHUB_EVENT_NAME,
947999
- cli_version: "5.27.3"
948016
+ cli_version: "5.27.5"
948000
948017
  };
948001
948018
  }
948002
948019
  function isAutomationMode() {
@@ -948822,7 +948839,7 @@ var CliContext = class _CliContext {
948822
948839
  if (false) {
948823
948840
  this.logger.error("CLI_VERSION is not defined");
948824
948841
  }
948825
- return "5.27.3";
948842
+ return "5.27.5";
948826
948843
  }
948827
948844
  getCliName() {
948828
948845
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.27.3",
2
+ "version": "5.27.5",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",