@fern-api/fern-api-dev 3.50.1 → 3.50.2-3-gbe65382b57d

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 +194 -115
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1430941,7 +1430941,7 @@ var AccessTokenPosthogManager = class {
1430941
1430941
  properties: {
1430942
1430942
  ...event,
1430943
1430943
  ...event.properties,
1430944
- version: "3.50.1",
1430944
+ version: "3.50.2-3-gbe65382b57d",
1430945
1430945
  usingAccessToken: true
1430946
1430946
  }
1430947
1430947
  });
@@ -1431040,7 +1431040,7 @@ var UserPosthogManager = class {
1431040
1431040
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1431041
1431041
  event: "CLI",
1431042
1431042
  properties: {
1431043
- version: "3.50.1",
1431043
+ version: "3.50.2-3-gbe65382b57d",
1431044
1431044
  ...event,
1431045
1431045
  ...event.properties,
1431046
1431046
  usingAccessToken: false,
@@ -1510475,7 +1510475,7 @@ var CliContext = class {
1510475
1510475
  if (false) {
1510476
1510476
  this.logger.error("CLI_VERSION is not defined");
1510477
1510477
  }
1510478
- return "3.50.1";
1510478
+ return "3.50.2-3-gbe65382b57d";
1510479
1510479
  }
1510480
1510480
  getCliName() {
1510481
1510481
  if (false) {
@@ -1601813,7 +1601813,8 @@ var DocsDefinitionResolver = class {
1601813
1601813
  uploadFiles;
1601814
1601814
  registerApi;
1601815
1601815
  targetAudiences;
1601816
- constructor({ domain: domain3, docsWorkspace, ossWorkspaces, apiWorkspaces, taskContext, editThisPage, uploadFiles: uploadFiles2 = defaultUploadFiles, registerApi: registerApi2 = defaultRegisterApi, targetAudiences }) {
1601816
+ pythonDocsSectionHandler;
1601817
+ constructor({ domain: domain3, docsWorkspace, ossWorkspaces, apiWorkspaces, taskContext, editThisPage, uploadFiles: uploadFiles2 = defaultUploadFiles, registerApi: registerApi2 = defaultRegisterApi, targetAudiences, pythonDocsSectionHandler }) {
1601817
1601818
  this.domain = domain3;
1601818
1601819
  this.docsWorkspace = docsWorkspace;
1601819
1601820
  this.ossWorkspaces = ossWorkspaces;
@@ -1601823,6 +1601824,7 @@ var DocsDefinitionResolver = class {
1601823
1601824
  this.uploadFiles = uploadFiles2;
1601824
1601825
  this.registerApi = registerApi2;
1601825
1601826
  this.targetAudiences = targetAudiences;
1601827
+ this.pythonDocsSectionHandler = pythonDocsSectionHandler;
1601826
1601828
  }
1601827
1601829
  #idgen = NodeIdGenerator2.init();
1601828
1601830
  /**
@@ -1602512,7 +1602514,8 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
1602512
1602514
  }
1602513
1602515
  async toSidebarRootNode(prefix2, items, parentSlug) {
1602514
1602516
  const id2 = this.#idgen.get(`${prefix2}/root`);
1602515
- const children2 = await Promise.all(items.map((item) => this.toNavigationChild({ prefix: id2, item, parentSlug })));
1602517
+ const childrenWithNulls = await Promise.all(items.map((item) => this.toNavigationChild({ prefix: id2, item, parentSlug })));
1602518
+ const children2 = childrenWithNulls.filter((child) => child != null);
1602516
1602519
  const grouped = [];
1602517
1602520
  children2.forEach((child) => {
1602518
1602521
  if (child.type === "apiReference") {
@@ -1602563,7 +1602566,8 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
1602563
1602566
  urlSlug: item.slug ?? kebabCase_default(item.title),
1602564
1602567
  skipUrlSlug: item.skipUrlSlug
1602565
1602568
  });
1602566
- const children2 = await Promise.all(item.layout.map((item2) => this.toVariantChild(item2, id2, variantSlug)));
1602569
+ const childrenWithNulls = await Promise.all(item.layout.map((item2) => this.toVariantChild(item2, id2, variantSlug)));
1602570
+ const children2 = childrenWithNulls.filter((child) => child != null);
1602567
1602571
  return {
1602568
1602572
  type: "variant",
1602569
1602573
  id: id2,
@@ -1602590,8 +1602594,9 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
1602590
1602594
  section: async (value) => this.toSectionNode({ prefix: prefix2, item: value, parentSlug }),
1602591
1602595
  link: async (value) => this.toLinkNode(value),
1602592
1602596
  changelog: async (value) => this.toChangelogNode(value, parentSlug),
1602593
- // Library sections are handled by FDR during registration, returning placeholder
1602594
- pythonDocsSection: async (value) => this.toPythonDocsSectionPlaceholder(value, parentSlug)
1602597
+ // Library sections are handled by FDR during registration
1602598
+ // If handler provided (dev mode), create placeholder; otherwise skip (FDR adds generated docs)
1602599
+ pythonDocsSection: async (value) => this.handlePythonDocsSection(value, parentSlug)
1602595
1602600
  });
1602596
1602601
  }
1602597
1602602
  async toNavigationChild({ prefix: prefix2, item, parentSlug, hideChildren, parentAvailability }) {
@@ -1602601,8 +1602606,9 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
1602601
1602606
  section: async (value) => this.toSectionNode({ prefix: prefix2, item: value, parentSlug, hideChildren, parentAvailability }),
1602602
1602607
  link: async (value) => this.toLinkNode(value),
1602603
1602608
  changelog: async (value) => this.toChangelogNode(value, parentSlug, hideChildren),
1602604
- // Library sections are handled by FDR during registration, returning placeholder
1602605
- pythonDocsSection: async (value) => this.toPythonDocsSectionPlaceholder(value, parentSlug)
1602609
+ // Library sections are handled by FDR during registration
1602610
+ // If handler provided (dev mode), create placeholder; otherwise skip (FDR adds generated docs)
1602611
+ pythonDocsSection: async (value) => this.handlePythonDocsSection(value, parentSlug)
1602606
1602612
  });
1602607
1602613
  }
1602608
1602614
  async toApiSectionNode({ item, parentSlug, hideChildren, parentAvailability }) {
@@ -1602723,77 +1602729,19 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
1602723
1602729
  };
1602724
1602730
  }
1602725
1602731
  /**
1602726
- * Python docs sections are handled by FDR during finishDocsRegister.
1602727
- * The CLI starts the generation job, polls for completion, and passes the jobId to FDR.
1602728
- * FDR then merges the generated Python docs into the navigation.
1602729
- *
1602730
- * In dev mode (fern docs dev), this placeholder returns a visible page with helpful content
1602731
- * explaining that Python library docs are only generated during `fern generate --docs`.
1602732
- *
1602733
- * In production mode, FDR replaces/augments this with the actual generated documentation.
1602732
+ * Handles pythonDocsSection navigation items by delegating to the handler if provided.
1602733
+ * If no handler is provided, returns null (skips the section - FDR adds generated docs during publish).
1602734
1602734
  */
1602735
- toPythonDocsSectionPlaceholder(item, parentSlug) {
1602736
- const title5 = item.title ?? "Python Reference";
1602737
- const urlSlug = item.slug ?? "python-docs";
1602738
- const slug = parentSlug.apply({ urlSlug });
1602739
- const syntheticPageId = `__python-docs-placeholder-${urlSlug}__.mdx`;
1602740
- const pageId = navigation_exports2.PageId(syntheticPageId);
1602741
- const placeholderMarkdown = `---
1602742
- title: ${title5}
1602743
- ---
1602744
-
1602745
- <Warning>
1602746
- Python library documentation is not yet supported with \`fern docs dev\`. This feature will be added in a future release. To view the generated documentation, run \`fern generate --docs --preview\`.
1602747
- </Warning>
1602748
-
1602749
- ## About Python Library Docs
1602750
-
1602751
- When you publish your documentation using \`fern generate --docs\`, Fern will:
1602752
-
1602753
- 1. Clone and analyze your Python repository from: \`${item.githubUrl}\`
1602754
- 2. Parse the Python source code to extract docstrings and type information
1602755
- 3. Generate comprehensive API reference documentation
1602756
- 4. Integrate the generated docs into your documentation site
1602757
-
1602758
- ## How to Generate
1602759
-
1602760
- To generate the full Python library documentation, run:
1602761
-
1602762
- \`\`\`bash
1602763
- fern generate --docs
1602764
- \`\`\`
1602765
-
1602766
- Or to preview without publishing:
1602767
-
1602768
- \`\`\`bash
1602769
- fern generate --docs --preview
1602770
- \`\`\`
1602771
-
1602772
- The generated documentation will replace this placeholder page with complete API reference content including:
1602773
-
1602774
- - Module and package documentation
1602775
- - Class and function references
1602776
- - Type annotations and signatures
1602777
- - Docstring content
1602778
- `;
1602779
- this.parsedDocsConfig.pages[RelativeFilePath2.of(syntheticPageId)] = placeholderMarkdown;
1602780
- const id2 = this.#idgen.get(pageId);
1602781
- return {
1602782
- id: id2,
1602783
- type: "page",
1602784
- slug: slug.get(),
1602785
- title: title5,
1602786
- icon: void 0,
1602787
- hidden: false,
1602788
- viewers: void 0,
1602789
- orphaned: void 0,
1602790
- pageId,
1602791
- authed: void 0,
1602792
- noindex: true,
1602793
- // Don't index placeholder pages
1602794
- featureFlags: void 0,
1602795
- availability: void 0
1602796
- };
1602735
+ handlePythonDocsSection(item, parentSlug) {
1602736
+ if (this.pythonDocsSectionHandler == null) {
1602737
+ return null;
1602738
+ }
1602739
+ return this.pythonDocsSectionHandler(item, parentSlug, {
1602740
+ addPage: (pageId, markdown) => {
1602741
+ this.parsedDocsConfig.pages[RelativeFilePath2.of(pageId)] = markdown;
1602742
+ },
1602743
+ generateId: (key) => this.#idgen.get(key)
1602744
+ });
1602797
1602745
  }
1602798
1602746
  async toPageNode({ item, parentSlug, hideChildren, parentAvailability }) {
1602799
1602747
  const pageId = navigation_exports2.PageId(this.toRelativeFilepath(item.absolutePath));
@@ -1602836,8 +1602784,9 @@ The generated documentation will replace this placeholder page with complete API
1602836
1602784
  hideChildren: hiddenSection,
1602837
1602785
  parentAvailability: item.availability ?? parentAvailability
1602838
1602786
  })));
1602787
+ const filteredChildren = children2.filter((child) => child != null);
1602839
1602788
  if (pageId == null) {
1602840
- const flattenedApiRef = children2.find((child) => child.type === "apiReference" && child.hideTitle === true && child.overviewPageId != null);
1602789
+ const flattenedApiRef = filteredChildren.find((child) => child.type === "apiReference" && child.hideTitle === true && child.overviewPageId != null);
1602841
1602790
  if (flattenedApiRef != null) {
1602842
1602791
  pageId = flattenedApiRef.overviewPageId;
1602843
1602792
  }
@@ -1602853,7 +1602802,7 @@ The generated documentation will replace this placeholder page with complete API
1602853
1602802
  hidden: hiddenSection,
1602854
1602803
  viewers: item.viewers,
1602855
1602804
  orphaned: item.orphaned,
1602856
- children: children2,
1602805
+ children: filteredChildren,
1602857
1602806
  authed: void 0,
1602858
1602807
  pointsTo: void 0,
1602859
1602808
  noindex,
@@ -1603129,6 +1603078,67 @@ function convertAvailability5(availability) {
1603129
1603078
  assertNever(availability);
1603130
1603079
  }
1603131
1603080
  }
1603081
+ function createPythonDocsSectionPlaceholder(item, parentSlug, context2) {
1603082
+ const title5 = item.title ?? "Python Reference";
1603083
+ const urlSlug = item.slug ?? "python-docs";
1603084
+ const slug = parentSlug.apply({ urlSlug });
1603085
+ const syntheticPageId = `__python-docs-placeholder-${urlSlug}__.mdx`;
1603086
+ const pageId = navigation_exports2.PageId(syntheticPageId);
1603087
+ const placeholderMarkdown = `---
1603088
+ title: ${title5}
1603089
+ ---
1603090
+
1603091
+ <Warning>
1603092
+ Python library documentation is not yet supported with \`fern docs dev\`. This feature will be added in a future release. To view the generated documentation, run \`fern generate --docs --preview\`.
1603093
+ </Warning>
1603094
+
1603095
+ ## About Python Library Docs
1603096
+
1603097
+ When you publish your documentation using \`fern generate --docs\`, Fern will:
1603098
+
1603099
+ 1. Clone and analyze your Python repository from: \`${item.githubUrl}\`
1603100
+ 2. Parse the Python source code to extract docstrings and type information
1603101
+ 3. Generate comprehensive API reference documentation
1603102
+ 4. Integrate the generated docs into your documentation site
1603103
+
1603104
+ ## How to Generate
1603105
+
1603106
+ To generate the full Python library documentation, run:
1603107
+
1603108
+ \`\`\`bash
1603109
+ fern generate --docs
1603110
+ \`\`\`
1603111
+
1603112
+ Or to preview without publishing:
1603113
+
1603114
+ \`\`\`bash
1603115
+ fern generate --docs --preview
1603116
+ \`\`\`
1603117
+
1603118
+ The generated documentation will replace this placeholder page with complete API reference content including:
1603119
+
1603120
+ - Module and package documentation
1603121
+ - Class and function references
1603122
+ - Type annotations and signatures
1603123
+ - Docstring content
1603124
+ `;
1603125
+ context2.addPage(syntheticPageId, placeholderMarkdown);
1603126
+ return {
1603127
+ id: context2.generateId(pageId),
1603128
+ type: "page",
1603129
+ slug: slug.get(),
1603130
+ title: title5,
1603131
+ icon: void 0,
1603132
+ hidden: false,
1603133
+ viewers: void 0,
1603134
+ orphaned: void 0,
1603135
+ pageId,
1603136
+ authed: void 0,
1603137
+ noindex: true,
1603138
+ featureFlags: void 0,
1603139
+ availability: void 0
1603140
+ };
1603141
+ }
1603132
1603142
 
1603133
1603143
  // ../docs-resolver/lib/utils/filterOssWorkspaces.js
1603134
1603144
  async function filterOssWorkspaces(project) {
@@ -1611573,7 +1611583,7 @@ var import_path40 = __toESM(require("path"), 1);
1611573
1611583
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1611574
1611584
  var LOGS_FOLDER_NAME = "logs";
1611575
1611585
  function getCliSource() {
1611576
- const version7 = "3.50.1";
1611586
+ const version7 = "3.50.2-3-gbe65382b57d";
1611577
1611587
  return `cli@${version7}`;
1611578
1611588
  }
1611579
1611589
  var DebugLogger = class {
@@ -1613390,7 +1613400,8 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
1613390
1613400
  };
1613391
1613401
  }),
1613392
1613402
  registerApi: async (opts) => apiCollector.addReferencedAPI(opts),
1613393
- targetAudiences: void 0
1613403
+ targetAudiences: void 0,
1613404
+ pythonDocsSectionHandler: createPythonDocsSectionPlaceholder
1613394
1613405
  });
1613395
1613406
  const writeDocsDefinition = await resolver2.resolve();
1613396
1613407
  const dbDocsDefinition = convertDocsDefinitionToDb({
@@ -1646915,7 +1646926,7 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
1646915
1646926
  return context2.failAndThrow("Failed to publish docs.", "Docs registration ID is missing.");
1646916
1646927
  }
1646917
1646928
  let libraryDocsConfig;
1646918
- const pythonDocsSection = extractPythonDocsSectionFromConfig(docsWorkspace.config);
1646929
+ const pythonDocsSection = await extractPythonDocsSectionFromConfig(docsWorkspace.config, docsWorkspace.absoluteFilePath);
1646919
1646930
  if (pythonDocsSection != null) {
1646920
1646931
  const githubUrl = pythonDocsSection.pythonDocs;
1646921
1646932
  context2.logger.info(`Generating Python documentation from ${githubUrl}...`);
@@ -1647458,13 +1647469,30 @@ function extractErrorDetails(error49) {
1647458
1647469
  rawError: error49
1647459
1647470
  };
1647460
1647471
  }
1647461
- function extractPythonDocsSectionFromConfig(config3) {
1647462
- const navigation = config3.navigation;
1647463
- if (navigation == null) {
1647464
- return void 0;
1647465
- }
1647472
+ async function extractPythonDocsSectionFromConfig(config3, absolutePathToFernFolder) {
1647466
1647473
  const isPythonDocsConfig = (item) => {
1647467
- return item != null && typeof item === "object" && "pythonDocs" in item && typeof item.pythonDocs === "string";
1647474
+ if (item == null || typeof item !== "object") {
1647475
+ return false;
1647476
+ }
1647477
+ const obj = item;
1647478
+ return typeof obj.pythonDocs === "string" || typeof obj["python-docs"] === "string";
1647479
+ };
1647480
+ const normalizePythonDocsConfig = (item) => {
1647481
+ if (item == null || typeof item !== "object") {
1647482
+ return void 0;
1647483
+ }
1647484
+ const obj = item;
1647485
+ if (typeof obj.pythonDocs === "string") {
1647486
+ return item;
1647487
+ }
1647488
+ if (typeof obj["python-docs"] === "string") {
1647489
+ return {
1647490
+ pythonDocs: obj["python-docs"],
1647491
+ title: typeof obj.title === "string" ? obj.title : void 0,
1647492
+ slug: typeof obj.slug === "string" ? obj.slug : void 0
1647493
+ };
1647494
+ }
1647495
+ return void 0;
1647468
1647496
  };
1647469
1647497
  const findPythonDocsSectionInItems = (items) => {
1647470
1647498
  if (items == null) {
@@ -1647472,7 +1647500,7 @@ function extractPythonDocsSectionFromConfig(config3) {
1647472
1647500
  }
1647473
1647501
  for (const item of items) {
1647474
1647502
  if (isPythonDocsConfig(item)) {
1647475
- return item;
1647503
+ return normalizePythonDocsConfig(item);
1647476
1647504
  }
1647477
1647505
  if (item != null && typeof item === "object" && "section" in item) {
1647478
1647506
  const sectionItem = item;
@@ -1647495,37 +1647523,88 @@ function extractPythonDocsSectionFromConfig(config3) {
1647495
1647523
  }
1647496
1647524
  return void 0;
1647497
1647525
  };
1647498
- const nav = navigation;
1647499
- if (Array.isArray(nav)) {
1647500
- return findPythonDocsSectionInItems(nav);
1647501
- }
1647502
- if (nav != null && typeof nav === "object") {
1647503
- const navObj = nav;
1647504
- if (Array.isArray(navObj.tabs)) {
1647505
- for (const tab2 of navObj.tabs) {
1647506
- if (tab2 != null && typeof tab2 === "object") {
1647507
- const tabObj = tab2;
1647508
- if (Array.isArray(tabObj.layout)) {
1647509
- const found = findPythonDocsSectionInItems(tabObj.layout);
1647510
- if (found) {
1647511
- return found;
1647526
+ const findInNavigationConfig = (navigation) => {
1647527
+ if (navigation == null) {
1647528
+ return void 0;
1647529
+ }
1647530
+ if (Array.isArray(navigation)) {
1647531
+ return findPythonDocsSectionInItems(navigation);
1647532
+ }
1647533
+ if (navigation != null && typeof navigation === "object") {
1647534
+ const navObj = navigation;
1647535
+ if (Array.isArray(navObj.tabs)) {
1647536
+ for (const tab2 of navObj.tabs) {
1647537
+ if (tab2 != null && typeof tab2 === "object") {
1647538
+ const tabObj = tab2;
1647539
+ if (Array.isArray(tabObj.layout)) {
1647540
+ const found = findPythonDocsSectionInItems(tabObj.layout);
1647541
+ if (found) {
1647542
+ return found;
1647543
+ }
1647512
1647544
  }
1647513
1647545
  }
1647514
1647546
  }
1647515
1647547
  }
1647516
1647548
  }
1647517
- if (Array.isArray(navObj.versions)) {
1647518
- for (const version7 of navObj.versions) {
1647519
- if (version7 != null && typeof version7 === "object") {
1647520
- const versionObj = version7;
1647521
- if (Array.isArray(versionObj.navigation)) {
1647522
- const found = findPythonDocsSectionInItems(versionObj.navigation);
1647523
- if (found) {
1647524
- return found;
1647525
- }
1647549
+ return void 0;
1647550
+ };
1647551
+ const searchVersionFile = async (versionPath) => {
1647552
+ try {
1647553
+ const absoluteFilepathToVersionFile = resolve5(absolutePathToFernFolder, RelativeFilePath2.of(versionPath));
1647554
+ const content5 = jsYaml.load((await (0, import_promises99.readFile)(absoluteFilepathToVersionFile)).toString());
1647555
+ if (content5 != null && typeof content5 === "object") {
1647556
+ const versionContent = content5;
1647557
+ return findInNavigationConfig(versionContent.navigation);
1647558
+ }
1647559
+ } catch {
1647560
+ }
1647561
+ return void 0;
1647562
+ };
1647563
+ const searchProductFile = async (productPath, productVersions) => {
1647564
+ try {
1647565
+ const absoluteFilepathToProductFile = resolve5(absolutePathToFernFolder, RelativeFilePath2.of(productPath));
1647566
+ const content5 = jsYaml.load((await (0, import_promises99.readFile)(absoluteFilepathToProductFile)).toString());
1647567
+ if (content5 != null && typeof content5 === "object") {
1647568
+ const productContent = content5;
1647569
+ const found = findInNavigationConfig(productContent.navigation);
1647570
+ if (found) {
1647571
+ return found;
1647572
+ }
1647573
+ }
1647574
+ if (productVersions != null && productVersions.length > 0) {
1647575
+ for (const version7 of productVersions) {
1647576
+ const found = await searchVersionFile(version7.path);
1647577
+ if (found) {
1647578
+ return found;
1647526
1647579
  }
1647527
1647580
  }
1647528
1647581
  }
1647582
+ } catch {
1647583
+ }
1647584
+ return void 0;
1647585
+ };
1647586
+ if (config3.navigation != null) {
1647587
+ const found = findInNavigationConfig(config3.navigation);
1647588
+ if (found) {
1647589
+ return found;
1647590
+ }
1647591
+ }
1647592
+ if (config3.versions != null && config3.versions.length > 0) {
1647593
+ for (const version7 of config3.versions) {
1647594
+ const found = await searchVersionFile(version7.path);
1647595
+ if (found) {
1647596
+ return found;
1647597
+ }
1647598
+ }
1647599
+ }
1647600
+ if (config3.products != null && config3.products.length > 0) {
1647601
+ for (const product of config3.products) {
1647602
+ if ("path" in product && product.path != null) {
1647603
+ const found = await searchProductFile(product.path, product.versions);
1647604
+ if (found) {
1647605
+ return found;
1647606
+ }
1647607
+ }
1647529
1647608
  }
1647530
1647609
  }
1647531
1647610
  return void 0;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.50.1",
2
+ "version": "3.50.2-3-gbe65382b57d",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",