@fern-api/fern-api-dev 5.2.2-5-ge17d83c7e65 → 5.2.2-7-g8752405b79b

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 +127 -11
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -544046,6 +544046,7 @@ async function loadTranslationNavigationOverlays({ translations, defaultLocale,
544046
544046
  const overlay = await parseNavigationOverlayFromDocsYml({
544047
544047
  docsYmlContent: overlayContent,
544048
544048
  langFernDir: overlayDir,
544049
+ overlayDocsYmlPath,
544049
544050
  context: context3
544050
544051
  });
544051
544052
  result[lang] = overlay;
@@ -544080,13 +544081,26 @@ function extractString(obj, key2) {
544080
544081
  }
544081
544082
  return void 0;
544082
544083
  }
544083
- async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir: overlayDir, context: context3 }) {
544084
+ async function validateOverlayNavbarLinks({ rawNavbarLinks, overlayDocsYmlPath, context: context3 }) {
544085
+ const result = [];
544086
+ for (const [index3, raw] of rawNavbarLinks.entries()) {
544087
+ try {
544088
+ const parsed = await docs_yml_exports.RawSchemas.Serializer.NavbarLink.parseOrThrow(raw);
544089
+ result.push(parsed);
544090
+ } catch (error50) {
544091
+ context3.logger.warn(`Invalid navbar-link at index ${index3} in "${overlayDocsYmlPath}": ${String(error50)}. Skipping this entry.`);
544092
+ }
544093
+ }
544094
+ return result;
544095
+ }
544096
+ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir: overlayDir, overlayDocsYmlPath, context: context3 }) {
544084
544097
  const overlay = {
544085
544098
  tabs: void 0,
544086
544099
  products: void 0,
544087
544100
  versions: void 0,
544088
544101
  announcement: void 0,
544089
- navigation: void 0
544102
+ navigation: void 0,
544103
+ navbarLinks: void 0
544090
544104
  };
544091
544105
  if (isPlainObject4(docsYmlContent.announcement)) {
544092
544106
  const message = extractString(docsYmlContent.announcement, "message");
@@ -544094,6 +544108,15 @@ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir:
544094
544108
  overlay.announcement = { message };
544095
544109
  }
544096
544110
  }
544111
+ const rawNavbarLinks = docsYmlContent["navbar-links"];
544112
+ if (Array.isArray(rawNavbarLinks)) {
544113
+ const validatedNavbarLinks = await validateOverlayNavbarLinks({
544114
+ rawNavbarLinks,
544115
+ overlayDocsYmlPath,
544116
+ context: context3
544117
+ });
544118
+ overlay.navbarLinks = convertNavbarLinks(validatedNavbarLinks, overlayDocsYmlPath) ?? [];
544119
+ }
544097
544120
  if (isPlainObject4(docsYmlContent.tabs)) {
544098
544121
  overlay.tabs = parseTabOverlays(docsYmlContent.tabs);
544099
544122
  }
@@ -622017,7 +622040,7 @@ var AccessTokenPosthogManager = class {
622017
622040
  properties: {
622018
622041
  ...event,
622019
622042
  ...event.properties,
622020
- version: "5.2.2-5-ge17d83c7e65",
622043
+ version: "5.2.2-7-g8752405b79b",
622021
622044
  usingAccessToken: true
622022
622045
  }
622023
622046
  });
@@ -622071,7 +622094,7 @@ var UserPosthogManager = class {
622071
622094
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622072
622095
  event: "CLI",
622073
622096
  properties: {
622074
- version: "5.2.2-5-ge17d83c7e65",
622097
+ version: "5.2.2-7-g8752405b79b",
622075
622098
  ...event,
622076
622099
  ...event.properties,
622077
622100
  usingAccessToken: false,
@@ -791706,7 +791729,8 @@ function applyChildOverlays(children2, parent, overlay) {
791706
791729
  products: void 0,
791707
791730
  versions: overlay.versions,
791708
791731
  announcement: productOverlay.announcement ?? overlay.announcement,
791709
- navigation: productOverlay.navigation ?? overlay.navigation
791732
+ navigation: productOverlay.navigation ?? overlay.navigation,
791733
+ navbarLinks: overlay.navbarLinks
791710
791734
  };
791711
791735
  const walked = walkAndApply(child, scopedOverlay);
791712
791736
  return applyProductOverlayToNode(walked, productOverlay);
@@ -791856,7 +791880,8 @@ function applyTabOverlayToNode(node4, overlay) {
791856
791880
  products: void 0,
791857
791881
  versions: void 0,
791858
791882
  announcement: void 0,
791859
- navigation: tabNavOverlay.layout
791883
+ navigation: tabNavOverlay.layout,
791884
+ navbarLinks: void 0
791860
791885
  };
791861
791886
  return walkAndApply(node4, scopedOverlay);
791862
791887
  }
@@ -799679,8 +799704,49 @@ async function collectFilesFromDocsConfig({ parsedDocsConfig }) {
799679
799704
  }
799680
799705
  }));
799681
799706
  }
799707
+ if (parsedDocsConfig.translationNavigationOverlays != null) {
799708
+ for (const overlay of Object.values(parsedDocsConfig.translationNavigationOverlays)) {
799709
+ await collectIconsFromNavbarLinks({
799710
+ navbarLinks: overlay.navbarLinks,
799711
+ filepaths
799712
+ });
799713
+ }
799714
+ }
799682
799715
  return filepaths;
799683
799716
  }
799717
+ async function collectIconsFromNavbarLinks({ navbarLinks, filepaths }) {
799718
+ if (navbarLinks == null) {
799719
+ return;
799720
+ }
799721
+ await Promise.all(navbarLinks.map(async (link3) => {
799722
+ if (link3.type === "github") {
799723
+ return;
799724
+ }
799725
+ if (link3.type === "dropdown") {
799726
+ await Promise.all(link3.links.map(async (nestedLink) => {
799727
+ if (nestedLink.icon != null) {
799728
+ await addIconToFilepaths({ iconPath: nestedLink.icon, filepaths });
799729
+ }
799730
+ if (nestedLink.rightIcon != null) {
799731
+ await addIconToFilepaths({ iconPath: nestedLink.rightIcon, filepaths });
799732
+ }
799733
+ }));
799734
+ if (link3.icon != null) {
799735
+ await addIconToFilepaths({ iconPath: link3.icon, filepaths });
799736
+ }
799737
+ if (link3.rightIcon != null) {
799738
+ await addIconToFilepaths({ iconPath: link3.rightIcon, filepaths });
799739
+ }
799740
+ return;
799741
+ }
799742
+ if (link3.icon != null) {
799743
+ await addIconToFilepaths({ iconPath: link3.icon, filepaths });
799744
+ }
799745
+ if (link3.rightIcon != null) {
799746
+ await addIconToFilepaths({ iconPath: link3.rightIcon, filepaths });
799747
+ }
799748
+ }));
799749
+ }
799684
799750
  async function collectIconsFromNavigation({ navigation: navigation2 }) {
799685
799751
  const filepaths = /* @__PURE__ */ new Set();
799686
799752
  switch (navigation2.type) {
@@ -800262,6 +800328,7 @@ var DocsDefinitionResolver = class {
800262
800328
  uploadedFiles.forEach((uploadedFile) => {
800263
800329
  this.collectedFileIds.set(uploadedFile.absoluteFilePath, uploadedFile.fileId);
800264
800330
  });
800331
+ this.resolveTranslationOverlayNavbarLinkIcons();
800265
800332
  this.taskContext.logger.debug("Building navigation tree...");
800266
800333
  const rootStart = performance.now();
800267
800334
  const root6 = await this.toRootNode();
@@ -801447,6 +801514,45 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
801447
801514
  }
801448
801515
  return iconPath;
801449
801516
  }
801517
+ /**
801518
+ * Walks each translation overlay's navbar-links and rewrites any
801519
+ * AbsoluteFilePath icons to `file:<fileId>` references using the icons
801520
+ * we just uploaded. Mirrors the per-link transform applied to the
801521
+ * docs-level navbar-links in `toDocsConfig`.
801522
+ */
801523
+ resolveTranslationOverlayNavbarLinkIcons() {
801524
+ const overlays = this.parsedDocsConfig.translationNavigationOverlays;
801525
+ if (overlays == null) {
801526
+ return;
801527
+ }
801528
+ for (const overlay of Object.values(overlays)) {
801529
+ if (overlay.navbarLinks == null) {
801530
+ continue;
801531
+ }
801532
+ overlay.navbarLinks = overlay.navbarLinks.map((navbarLink) => {
801533
+ if (navbarLink.type === "github") {
801534
+ return navbarLink;
801535
+ }
801536
+ if (navbarLink.type === "dropdown") {
801537
+ return {
801538
+ ...navbarLink,
801539
+ icon: this.resolveIconFileId(navbarLink.icon),
801540
+ rightIcon: this.resolveIconFileId(navbarLink.rightIcon),
801541
+ links: navbarLink.links.map((link3) => ({
801542
+ ...link3,
801543
+ icon: this.resolveIconFileId(link3.icon),
801544
+ rightIcon: this.resolveIconFileId(link3.rightIcon)
801545
+ }))
801546
+ };
801547
+ }
801548
+ return {
801549
+ ...navbarLink,
801550
+ icon: this.resolveIconFileId(navbarLink.icon),
801551
+ rightIcon: this.resolveIconFileId(navbarLink.rightIcon)
801552
+ };
801553
+ });
801554
+ }
801555
+ }
801450
801556
  convertPageActions() {
801451
801557
  if (this.parsedDocsConfig.pageActions == null) {
801452
801558
  return void 0;
@@ -834268,7 +834374,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
834268
834374
  var LOGS_FOLDER_NAME = "logs";
834269
834375
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
834270
834376
  function getCliSource() {
834271
- const version7 = "5.2.2-5-ge17d83c7e65";
834377
+ const version7 = "5.2.2-7-g8752405b79b";
834272
834378
  return `cli@${version7}`;
834273
834379
  }
834274
834380
  var DebugLogger = class {
@@ -836557,9 +836663,13 @@ async function runPreviewServer({ initialProject, reloadProject, validateProject
836557
836663
  let updatedRoot = applyTranslatedFrontmatterToNavTree(docsDefinition.config.root, localePages, context3);
836558
836664
  const localeNavOverlay = translationNavigationOverlays?.[locale];
836559
836665
  let translatedAnnouncement = docsDefinition.config.announcement;
836666
+ let translatedNavbarLinks = docsDefinition.config.navbarLinks;
836560
836667
  if (localeNavOverlay != null) {
836561
836668
  updatedRoot = applyTranslatedNavigationOverlays(updatedRoot, localeNavOverlay);
836562
836669
  translatedAnnouncement = getTranslatedAnnouncement(localeNavOverlay) ?? translatedAnnouncement;
836670
+ if (localeNavOverlay.navbarLinks != null) {
836671
+ translatedNavbarLinks = localeNavOverlay.navbarLinks;
836672
+ }
836563
836673
  }
836564
836674
  const translatedDefinition = {
836565
836675
  ...docsDefinition,
@@ -836567,7 +836677,8 @@ async function runPreviewServer({ initialProject, reloadProject, validateProject
836567
836677
  config: {
836568
836678
  ...docsDefinition.config,
836569
836679
  root: updatedRoot,
836570
- announcement: translatedAnnouncement
836680
+ announcement: translatedAnnouncement,
836681
+ navbarLinks: translatedNavbarLinks
836571
836682
  }
836572
836683
  };
836573
836684
  translations.set(locale, translatedDefinition);
@@ -845977,9 +846088,13 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
845977
846088
  );
845978
846089
  const localeNavOverlay = translationNavigationOverlays?.[locale];
845979
846090
  let translatedAnnouncement = docsDefinition.config.announcement;
846091
+ let translatedNavbarLinks = docsDefinition.config.navbarLinks;
845980
846092
  if (localeNavOverlay != null) {
845981
846093
  updatedRoot = applyTranslatedNavigationOverlays(updatedRoot, localeNavOverlay);
845982
846094
  translatedAnnouncement = getTranslatedAnnouncement(localeNavOverlay) ?? translatedAnnouncement;
846095
+ if (localeNavOverlay.navbarLinks != null) {
846096
+ translatedNavbarLinks = localeNavOverlay.navbarLinks;
846097
+ }
845983
846098
  }
845984
846099
  const translatedDefinition = {
845985
846100
  ...docsDefinition,
@@ -845987,7 +846102,8 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
845987
846102
  config: {
845988
846103
  ...docsDefinition.config,
845989
846104
  root: updatedRoot,
845990
- announcement: translatedAnnouncement
846105
+ announcement: translatedAnnouncement,
846106
+ navbarLinks: translatedNavbarLinks
845991
846107
  }
845992
846108
  };
845993
846109
  const pageCount2 = Object.keys(localePages).length;
@@ -846720,7 +846836,7 @@ var LegacyDocsPublisher = class {
846720
846836
  previewId,
846721
846837
  disableTemplates: void 0,
846722
846838
  skipUpload,
846723
- cliVersion: "5.2.2-5-ge17d83c7e65",
846839
+ cliVersion: "5.2.2-7-g8752405b79b",
846724
846840
  loginCommand: "fern auth login"
846725
846841
  });
846726
846842
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -921052,7 +921168,7 @@ var CliContext = class _CliContext {
921052
921168
  if (false) {
921053
921169
  this.logger.error("CLI_VERSION is not defined");
921054
921170
  }
921055
- return "5.2.2-5-ge17d83c7e65";
921171
+ return "5.2.2-7-g8752405b79b";
921056
921172
  }
921057
921173
  getCliName() {
921058
921174
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.2.2-5-ge17d83c7e65",
2
+ "version": "5.2.2-7-g8752405b79b",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",