@fern-api/fern-api-dev 5.23.3-102-g841ad568de0 → 5.23.3-110-gf8b65448baf

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 +72 -33
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -587451,7 +587451,18 @@ async function getVersionedNavigationConfiguration({ versions, absolutePathToFer
587451
587451
  const versionedNavbars = [];
587452
587452
  for (const version7 of versions) {
587453
587453
  const absoluteFilepathToVersionFile = resolve6(absolutePathToFernFolder, version7.path);
587454
- const versionContent = jsYaml.load((await (0, import_promises14.readFile)(absoluteFilepathToVersionFile)).toString());
587454
+ let versionContent;
587455
+ try {
587456
+ versionContent = jsYaml.load((await (0, import_promises14.readFile)(absoluteFilepathToVersionFile)).toString());
587457
+ } catch (error50) {
587458
+ if (error50 instanceof jsYaml.YAMLException) {
587459
+ throw new CliError({
587460
+ message: `Failed to parse version file ${version7.path}: ${error50.message}`,
587461
+ code: CliError.Code.ParseError
587462
+ });
587463
+ }
587464
+ throw error50;
587465
+ }
587455
587466
  const removedPaths = [];
587456
587467
  const sanitizedVersionContent = sanitizeNullValues(versionContent, [], removedPaths);
587457
587468
  if (removedPaths.length > 0) {
@@ -587501,7 +587512,18 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
587501
587512
  if ("path" in product) {
587502
587513
  let navigation3;
587503
587514
  const absoluteFilepathToProductFile = resolve6(absolutePathToFernFolder, product.path);
587504
- const content5 = jsYaml.load((await (0, import_promises14.readFile)(absoluteFilepathToProductFile)).toString());
587515
+ let content5;
587516
+ try {
587517
+ content5 = jsYaml.load((await (0, import_promises14.readFile)(absoluteFilepathToProductFile)).toString());
587518
+ } catch (error50) {
587519
+ if (error50 instanceof jsYaml.YAMLException) {
587520
+ throw new CliError({
587521
+ message: `Failed to parse product file ${product.path}: ${error50.message}`,
587522
+ code: CliError.Code.ParseError
587523
+ });
587524
+ }
587525
+ throw error50;
587526
+ }
587505
587527
  const removedPaths = [];
587506
587528
  const sanitizedContent = sanitizeNullValues(content5, [], removedPaths);
587507
587529
  if (removedPaths.length > 0) {
@@ -667943,7 +667965,7 @@ var AccessTokenPosthogManager = class {
667943
667965
  properties: {
667944
667966
  ...event,
667945
667967
  ...event.properties,
667946
- version: "5.23.3-102-g841ad568de0",
667968
+ version: "5.23.3-110-gf8b65448baf",
667947
667969
  usingAccessToken: true,
667948
667970
  ...getRunIdProperties()
667949
667971
  }
@@ -668007,7 +668029,7 @@ var UserPosthogManager = class {
668007
668029
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
668008
668030
  event: "CLI",
668009
668031
  properties: {
668010
- version: "5.23.3-102-g841ad568de0",
668032
+ version: "5.23.3-110-gf8b65448baf",
668011
668033
  ...event,
668012
668034
  ...event.properties,
668013
668035
  usingAccessToken: false,
@@ -823688,17 +823710,24 @@ var DocsDefinitionResolver = class {
823688
823710
  this.taskContext.logger.debug("Replacing image paths and URLs in markdown...");
823689
823711
  const replaceStart = performance.now();
823690
823712
  for (const [relativePath, markdown] of Object.entries(this.parsedDocsConfig.pages)) {
823691
- this.parsedDocsConfig.pages[RelativeFilePath2.of(relativePath)] = replaceImagePathsAndUrls(
823692
- markdown,
823693
- this.collectedFileIds,
823694
- // convert slugs to full URL pathnames
823695
- markdownFilesToPathName,
823696
- {
823697
- absolutePathToMarkdownFile: this.resolveFilepath(relativePath),
823698
- absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath
823699
- },
823700
- this.taskContext
823701
- );
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
+ }
823702
823731
  }
823703
823732
  const replaceTime = performance.now() - replaceStart;
823704
823733
  this.taskContext.logger.debug(`Replaced image paths in ${replaceTime.toFixed(0)}ms`);
@@ -859579,7 +859608,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
859579
859608
  var LOGS_FOLDER_NAME = "logs";
859580
859609
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
859581
859610
  function getCliSource() {
859582
- const version7 = "5.23.3-102-g841ad568de0";
859611
+ const version7 = "5.23.3-110-gf8b65448baf";
859583
859612
  return `cli@${version7}`;
859584
859613
  }
859585
859614
  var DebugLogger = class {
@@ -860671,17 +860700,25 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
860671
860700
  fileIdsMap.set(filepath, fileId);
860672
860701
  }
860673
860702
  }
860674
- const finalMarkdown = replaceImagePathsAndUrls(
860675
- markdownWithAbsPaths,
860676
- fileIdsMap,
860677
- {},
860678
- // markdownFilesToPathName - empty object since we don't need it for images
860679
- {
860680
- absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
860681
- absolutePathToMarkdownFile: absoluteFilePath
860682
- },
860683
- context3
860684
- );
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
+ }
860685
860722
  previousDocsDefinition.pages[pageId] = {
860686
860723
  markdown: stripMdxComments(finalMarkdown),
860687
860724
  editThisPageUrl: previousValue?.editThisPageUrl,
@@ -861708,7 +861745,7 @@ ${err.stack}`);
861708
861745
  try {
861709
861746
  await startNextJsServer();
861710
861747
  } catch (err) {
861711
- 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 });
861712
861749
  }
861713
861750
  watcher.on("all", async (event, targetPath, _targetPathNext) => {
861714
861751
  if (targetPath.includes(".fern/logs/") || targetPath.includes(".fern\\logs\\")) {
@@ -870902,7 +870939,7 @@ async function retryWithRateLimit({ fn: fn10, retryRateLimited, logger: logger4,
870902
870939
  }
870903
870940
  throw new CliError({
870904
870941
  message: "Exceeded maximum retries for 429 Too Many Requests.",
870905
- code: CliError.Code.InternalError
870942
+ code: CliError.Code.NetworkError
870906
870943
  });
870907
870944
  }
870908
870945
 
@@ -872304,7 +872341,9 @@ async function generateOne({ generatorInvocation, interactiveTaskContext, projec
872304
872341
  generatorsYmlAbsolutePath,
872305
872342
  generatorsYmlLineNumber: lineNumber
872306
872343
  });
872307
- interactiveTaskContext.failWithoutThrowing(message);
872344
+ interactiveTaskContext.failWithoutThrowing(message, error50, {
872345
+ code: resolveErrorCode(error50)
872346
+ });
872308
872347
  }
872309
872348
  }
872310
872349
 
@@ -873569,7 +873608,7 @@ var LegacyDocsPublisher = class {
873569
873608
  previewId,
873570
873609
  disableTemplates: void 0,
873571
873610
  skipUpload,
873572
- cliVersion: "5.23.3-102-g841ad568de0",
873611
+ cliVersion: "5.23.3-110-gf8b65448baf",
873573
873612
  loginCommand: "fern auth login"
873574
873613
  });
873575
873614
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -947974,7 +948013,7 @@ function getAutomationContextFromEnv() {
947974
948013
  config_branch: process.env.FERN_CONFIG_BRANCH,
947975
948014
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
947976
948015
  trigger: process.env.GITHUB_EVENT_NAME,
947977
- cli_version: "5.23.3-102-g841ad568de0"
948016
+ cli_version: "5.23.3-110-gf8b65448baf"
947978
948017
  };
947979
948018
  }
947980
948019
  function isAutomationMode() {
@@ -948800,7 +948839,7 @@ var CliContext = class _CliContext {
948800
948839
  if (false) {
948801
948840
  this.logger.error("CLI_VERSION is not defined");
948802
948841
  }
948803
- return "5.23.3-102-g841ad568de0";
948842
+ return "5.23.3-110-gf8b65448baf";
948804
948843
  }
948805
948844
  getCliName() {
948806
948845
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.23.3-102-g841ad568de0",
2
+ "version": "5.23.3-110-gf8b65448baf",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",