fumadocs-core 16.7.9 → 16.7.11

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.
@@ -1,4 +1,4 @@
1
- import { i as Root, r as Node } from "./definitions-Cb3qV_RZ.js";
1
+ import { i as Root, r as Node, t as Folder } from "./definitions-j1YD3oZE.js";
2
2
  import { ReactNode } from "react";
3
3
 
4
4
  //#region src/breadcrumb.d.ts
@@ -31,9 +31,9 @@ interface BreadcrumbOptions {
31
31
  */
32
32
  includeSeparator?: boolean;
33
33
  }
34
- declare function useBreadcrumb(url: string, tree: Root, options?: BreadcrumbOptions): BreadcrumbItem[];
35
- declare function getBreadcrumbItems(url: string, tree: Root, options?: BreadcrumbOptions): BreadcrumbItem[];
36
- declare function getBreadcrumbItemsFromPath(tree: Root, path: Node[], options: BreadcrumbOptions): BreadcrumbItem[];
34
+ declare function useBreadcrumb(url: string, tree: Root | Folder, options?: BreadcrumbOptions): BreadcrumbItem[];
35
+ declare function getBreadcrumbItems(url: string, tree: Root | Folder, options?: BreadcrumbOptions): BreadcrumbItem[];
36
+ declare function getBreadcrumbItemsFromPath(tree: Root | Folder, path: Node[], options: BreadcrumbOptions): BreadcrumbItem[];
37
37
  /**
38
38
  * Search the path of a node in the tree by a specified url
39
39
  *
@@ -1,5 +1,5 @@
1
1
  import { t as normalizeUrl } from "./normalize-url-J3kqKlu4.js";
2
- import { r as findPath } from "./utils-6GexS7iX.js";
2
+ import { r as findPath } from "./utils-BFW0mEx9.js";
3
3
  import { useMemo } from "react";
4
4
  //#region src/breadcrumb.tsx
5
5
  function useBreadcrumb(url, tree, options) {
@@ -1,4 +1,4 @@
1
- import { r as findPath } from "./utils-6GexS7iX.js";
1
+ import { r as findPath } from "./utils-BFW0mEx9.js";
2
2
  import { r as extname, t as basename } from "./path-CL7hf0GY.js";
3
3
  //#region src/search/server/build-index.ts
4
4
  async function buildIndexDefault(page) {
@@ -8,7 +8,13 @@ interface ID {
8
8
  $id?: string;
9
9
  }
10
10
  interface Root extends ID {
11
+ /**
12
+ * @internal meta file path
13
+ */
14
+ $ref?: string;
15
+ type?: 'root';
11
16
  name: ReactNode;
17
+ description?: ReactNode;
12
18
  children: Node[];
13
19
  /**
14
20
  * Another page tree that won't be displayed unless being opened.
@@ -18,11 +24,9 @@ interface Root extends ID {
18
24
  type Node = Item | Separator | Folder;
19
25
  interface Item extends ID {
20
26
  /**
21
- * @internal
27
+ * @internal page file path
22
28
  */
23
- $ref?: {
24
- file: string;
25
- };
29
+ $ref?: string;
26
30
  type: 'page';
27
31
  name: ReactNode;
28
32
  url: string;
@@ -42,11 +46,9 @@ interface Separator extends ID {
42
46
  }
43
47
  interface Folder extends ID {
44
48
  /**
45
- * @internal
49
+ * @internal meta file path
46
50
  */
47
- $ref?: {
48
- metaFile?: string;
49
- };
51
+ $ref?: string;
50
52
  type: 'folder';
51
53
  name: ReactNode;
52
54
  description?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { i as Root } from "./definitions-Cb3qV_RZ.js";
1
+ import { i as Root } from "./definitions-j1YD3oZE.js";
2
2
  //#region src/source/client/index.d.ts
3
3
  interface SerializedPageTree {
4
4
  $fumadocs_loader: 'page-tree';
@@ -1,4 +1,4 @@
1
- import { i as Root, n as Item, r as Node, t as Folder } from "./definitions-Cb3qV_RZ.js";
1
+ import { i as Root, n as Item, r as Node, t as Folder } from "./definitions-j1YD3oZE.js";
2
2
 
3
3
  //#region src/page-tree/utils.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-Cb3qV_RZ.js";
1
+ import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-j1YD3oZE.js";
2
2
  import { t as I18nConfig } from "./index-DAzunKMp.js";
3
- import { n as SerializedPageTree } from "./index-XxTU-Mr22.js";
3
+ import { n as SerializedPageTree } from "./index-Ca0YkTYK2.js";
4
4
  import { ReactNode } from "react";
5
5
 
6
6
  //#region src/source/source.d.ts
@@ -230,13 +230,19 @@ interface Context {
230
230
  interface LLMsConfig {
231
231
  TAB?: string;
232
232
  renderName?: (item: Node | Root, ctx: Context) => string;
233
- renderDescription?: (item: Item | Folder, ctx: Context) => string;
233
+ renderDescription?: (item: Root | Item | Folder, ctx: Context) => string;
234
234
  }
235
235
  declare function llms<C extends LoaderConfig>(loader: LoaderOutput<C>, config?: LLMsConfig): {
236
236
  /**
237
237
  * generate `llms.txt` content in Markdown format.
238
+ *
239
+ * use `indexNode(node)` instead for more control (e.g. add extra sections to output).
238
240
  */
239
241
  index: (lang?: string) => string;
242
+ /**
243
+ * generate `llms.txt` content for a single page tree node.
244
+ */
245
+ indexNode(node: Node, lang?: string): string;
240
246
  };
241
247
  //#endregion
242
248
  //#region src/source/loader.d.ts
@@ -335,7 +341,7 @@ interface LoaderOutput<Config extends LoaderConfig> {
335
341
  */
336
342
  getPage: (slugs: string[] | undefined, language?: string) => Page<Config['source']['pageData']> | undefined;
337
343
  getNodePage: (node: Item, language?: string) => Page<Config['source']['pageData']> | undefined;
338
- getNodeMeta: (node: Folder, language?: string) => Meta<Config['source']['metaData']> | undefined;
344
+ getNodeMeta: (node: Folder | Root, language?: string) => Meta<Config['source']['metaData']> | undefined;
339
345
  /**
340
346
  * generate static params for Next.js SSG
341
347
  *
@@ -1,3 +1,3 @@
1
- import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "../definitions-Cb3qV_RZ.js";
2
- import { a as flattenTree, c as visit, i as findSiblings, n as findParent, o as getPageTreePeers, r as findPath, s as getPageTreeRoots, t as findNeighbour } from "../index-DCiVcIWs.js";
1
+ import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "../definitions-j1YD3oZE.js";
2
+ import { a as flattenTree, c as visit, i as findSiblings, n as findParent, o as getPageTreePeers, r as findPath, s as getPageTreeRoots, t as findNeighbour } from "../index-D2XxhP9t.js";
3
3
  export { Folder, Item, Node, Root, Separator, findNeighbour, findParent, findPath, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
@@ -1,2 +1,2 @@
1
- import { a as flattenTree, c as visit, i as findSiblings, n as findParent, o as getPageTreePeers, r as findPath, s as getPageTreeRoots, t as findNeighbour } from "../utils-6GexS7iX.js";
1
+ import { a as flattenTree, c as visit, i as findSiblings, n as findParent, o as getPageTreePeers, r as findPath, s as getPageTreeRoots, t as findNeighbour } from "../utils-BFW0mEx9.js";
2
2
  export { findNeighbour, findParent, findPath, findSiblings, flattenTree, getPageTreePeers, getPageTreeRoots, visit };
@@ -1,7 +1,7 @@
1
1
  import { t as Awaitable } from "../types-Dr0HqbXP.js";
2
2
  import { t as I18nConfig } from "../index-DAzunKMp.js";
3
- import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-C0CA6LXW.js";
4
- import { i as LoaderConfig, o as LoaderOutput, u as Page } from "../index-ins6zSWO.js";
3
+ import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-B89IM_4v.js";
4
+ import { i as LoaderConfig, o as LoaderOutput, u as Page } from "../index-DkqXqEn8.js";
5
5
  import { DocumentData, DocumentOptions } from "flexsearch";
6
6
 
7
7
  //#region src/search/server/build-doc.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as createEndpoint } from "../endpoint-Bs6bqGYq.js";
2
- import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-B5-DlWgs.js";
2
+ import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-CRrL6r30.js";
3
3
  import { n as search, t as createDocument } from "../utils-D_KDPEof.js";
4
4
  import Search from "flexsearch";
5
5
  //#region src/search/flexsearch.ts
@@ -1,5 +1,5 @@
1
1
  import { r as SortedResult } from "../index-CQ5TBOzH.js";
2
- import { n as SearchAPI } from "../server-C0CA6LXW.js";
2
+ import { n as SearchAPI } from "../server-B89IM_4v.js";
3
3
  import Mixedbread from "@mixedbread/sdk";
4
4
  import { StoreSearchResponse } from "@mixedbread/sdk/resources/stores";
5
5
 
@@ -1,2 +1,2 @@
1
- import { a as AdvancedOptions, c as SimpleOptions, d as createSearchAPI, f as initAdvancedSearch, i as AdvancedIndex, l as createFromSource, n as SearchAPI, o as ExportedData, p as initSimpleSearch, r as SearchServer, s as Index, t as QueryOptions, u as createI18nSearchAPI } from "../server-C0CA6LXW.js";
1
+ import { a as AdvancedOptions, c as SimpleOptions, d as createSearchAPI, f as initAdvancedSearch, i as AdvancedIndex, l as createFromSource, n as SearchAPI, o as ExportedData, p as initSimpleSearch, r as SearchServer, s as Index, t as QueryOptions, u as createI18nSearchAPI } from "../server-B89IM_4v.js";
2
2
  export { AdvancedIndex, AdvancedOptions, ExportedData, Index, QueryOptions, SearchAPI, SearchServer, SimpleOptions, createFromSource, createI18nSearchAPI, createSearchAPI, initAdvancedSearch, initSimpleSearch };
@@ -1,5 +1,5 @@
1
1
  import { n as defaultReadOptions, t as createEndpoint } from "../endpoint-Bs6bqGYq.js";
2
- import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-B5-DlWgs.js";
2
+ import { n as buildBreadcrumbs, r as buildIndexDefault, t as buildDocuments } from "../build-doc-CRrL6r30.js";
3
3
  import { n as searchSimple, t as searchAdvanced } from "../advanced-B6xijHpk.js";
4
4
  import { create, insertMultiple, save } from "@orama/orama";
5
5
  //#region src/search/orama/_stemmers.ts
@@ -2,7 +2,7 @@ import { t as Awaitable } from "./types-Dr0HqbXP.js";
2
2
  import { i as StructuredData } from "./remark-structure-c-gm2PCy.js";
3
3
  import { t as I18nConfig } from "./index-DAzunKMp.js";
4
4
  import { r as SortedResult } from "./index-CQ5TBOzH.js";
5
- import { i as LoaderConfig, o as LoaderOutput, u as Page } from "./index-ins6zSWO.js";
5
+ import { i as LoaderConfig, o as LoaderOutput, u as Page } from "./index-DkqXqEn8.js";
6
6
  import { Language, Orama, RawData, SearchParams, TypedDocument, create } from "@orama/orama";
7
7
 
8
8
  //#region src/search/orama/create-db.d.ts
@@ -1,2 +1,2 @@
1
- import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-XxTU-Mr22.js";
1
+ import { i as useFumadocsLoader, n as SerializedPageTree, r as deserializePageTree, t as Serialized } from "../../index-Ca0YkTYK2.js";
2
2
  export { Serialized, SerializedPageTree, deserializePageTree, useFumadocsLoader };
@@ -1,4 +1,4 @@
1
- import { c as visit } from "../../utils-6GexS7iX.js";
1
+ import { c as visit } from "../../utils-BFW0mEx9.js";
2
2
  import { useMemo } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region src/source/client/index.tsx
@@ -1,2 +1,2 @@
1
- import { A as PageData, C as PageTreeTransformer, D as ContentStoragePageFile, E as ContentStorageMetaFile, F as _SourceUpdate_, I as multiple, L as source, M as SourceConfig, N as VirtualFile, O as FileSystem, P as _ConfigUnion_, R as update, S as PageTreeOptions, T as ContentStorageFile, _ as getSlugs, a as LoaderOptions, b as PageTreeBuilder, c as LoaderPluginOption, d as ResolvedLoaderConfig, f as createGetUrl, h as llms, i as LoaderConfig, j as Source, k as MetaData, l as Meta, m as LLMsConfig, n as InferMetaType, o as LoaderOutput, p as loader, r as InferPageType, s as LoaderPlugin, t as path_d_exports, u as Page, w as ContentStorage, x as PageTreeBuilderContext } from "../index-ins6zSWO.js";
1
+ import { A as PageData, C as PageTreeTransformer, D as ContentStoragePageFile, E as ContentStorageMetaFile, F as _SourceUpdate_, I as multiple, L as source, M as SourceConfig, N as VirtualFile, O as FileSystem, P as _ConfigUnion_, R as update, S as PageTreeOptions, T as ContentStorageFile, _ as getSlugs, a as LoaderOptions, b as PageTreeBuilder, c as LoaderPluginOption, d as ResolvedLoaderConfig, f as createGetUrl, h as llms, i as LoaderConfig, j as Source, k as MetaData, l as Meta, m as LLMsConfig, n as InferMetaType, o as LoaderOutput, p as loader, r as InferPageType, s as LoaderPlugin, t as path_d_exports, u as Page, w as ContentStorage, x as PageTreeBuilderContext } from "../index-DkqXqEn8.js";
2
2
  export { ContentStorage, ContentStorageFile, ContentStorageMetaFile, ContentStoragePageFile, FileSystem, InferMetaType, InferPageType, LLMsConfig, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, MetaData, Page, PageData, PageTreeBuilder, PageTreeBuilderContext, PageTreeOptions, PageTreeTransformer, path_d_exports as PathUtils, ResolvedLoaderConfig, Source, SourceConfig, VirtualFile, _ConfigUnion_, _SourceUpdate_, createGetUrl, getSlugs, llms, loader, multiple, source, update };
@@ -1,5 +1,5 @@
1
1
  import { t as normalizeUrl } from "../normalize-url-J3kqKlu4.js";
2
- import { c as visit } from "../utils-6GexS7iX.js";
2
+ import { c as visit } from "../utils-BFW0mEx9.js";
3
3
  import { a as path_exports, i as joinPath, n as dirname, o as slash, r as extname, s as splitPath, t as basename } from "../path-CL7hf0GY.js";
4
4
  import { getSlugs, slugsPlugin } from "./plugins/slugs.js";
5
5
  import { t as iconPlugin } from "../icon-CfEtMzdP.js";
@@ -436,7 +436,7 @@ var PageTreeBuilder = class {
436
436
  collapsible: metadata.collapsible,
437
437
  children: [],
438
438
  $id: this.generateId(folderPath),
439
- $ref: !this.ctx.noRef && meta ? { metaFile: metaPath } : void 0
439
+ $ref: !this.ctx.noRef && meta ? metaPath : void 0
440
440
  };
441
441
  this.pathToNode.set(folderPath, node);
442
442
  this.unfinished.add(node);
@@ -486,7 +486,7 @@ var PageTreeBuilder = class {
486
486
  description,
487
487
  icon,
488
488
  url: this.ctx.getUrl(page.slugs, this.ctx.locale),
489
- $ref: !this.ctx.noRef ? { file: path } : void 0
489
+ $ref: !this.ctx.noRef ? path : void 0
490
490
  };
491
491
  for (const transformer of this.transformers) {
492
492
  if (!transformer.file) continue;
@@ -498,8 +498,11 @@ var PageTreeBuilder = class {
498
498
  root(id = "root", path = "") {
499
499
  const folder = this.folder(path);
500
500
  let root = {
501
+ type: "root",
502
+ $ref: folder?.$ref,
501
503
  $id: this.generateId(id),
502
504
  name: folder?.name || "Docs",
505
+ description: folder?.description,
503
506
  children: folder ? folder.children : []
504
507
  };
505
508
  for (const transformer of this.transformers) {
@@ -525,20 +528,43 @@ function pathToName(name) {
525
528
  //#region src/source/loader/llms.ts
526
529
  function llms(loader, config = {}) {
527
530
  const { TAB = " ", renderName = (node, ctx) => {
528
- if (typeof node.name === "string") return node.name;
529
- if ("type" in node && node.type === "page") {
531
+ if (node.type === "page") {
530
532
  const page = loader.getNodePage(node, ctx.lang);
531
- if (page) return page.data.title ?? "";
533
+ if (page?.data.title) return page.data.title;
534
+ } else if (node.type !== "separator") {
535
+ const meta = loader.getNodeMeta(node, ctx.lang);
536
+ if (meta?.data.title) return meta.data.title;
532
537
  }
533
- return String(node.name);
538
+ return typeof node.name === "string" ? node.name : "";
534
539
  }, renderDescription = (node, ctx) => {
535
- if (typeof node.description === "string") return node.description;
536
- if ("type" in node && node.type === "page") {
540
+ if (node.type === "page") {
537
541
  const page = loader.getNodePage(node, ctx.lang);
538
- if (page) return page.data.description ?? "";
542
+ if (page?.data.description) return page.data.description;
543
+ } else {
544
+ const meta = loader.getNodeMeta(node, ctx.lang);
545
+ if (meta?.data.description) return meta.data.description;
539
546
  }
540
- return String(node.description);
547
+ return typeof node.description === "string" ? node.description : "";
541
548
  } } = config;
549
+ function formatListItem(name, description, indent) {
550
+ const prefix = TAB.repeat(indent);
551
+ description = description.trim();
552
+ if (description.length > 0) return `${prefix}- ${name}: ${description}`;
553
+ return `${prefix}- ${name}`;
554
+ }
555
+ function formatNode(node, indent, ctx) {
556
+ switch (node.type) {
557
+ case "page": return formatListItem(formatMarkdownLink(renderName(node, ctx), node.url), renderDescription(node, ctx), indent);
558
+ case "folder": {
559
+ const out = [];
560
+ out.push(formatListItem(renderName(node, ctx), renderDescription(node, ctx), indent));
561
+ if (node.index) out.push(formatNode(node.index, indent + 1, ctx));
562
+ for (const child of node.children) out.push(formatNode(child, indent + 1, ctx));
563
+ return out.join("\n");
564
+ }
565
+ case "separator": return "\n" + formatListItem(`**${renderName(node, ctx) || "Separator"}**`, "", indent);
566
+ }
567
+ }
542
568
  function index(lang) {
543
569
  if (loader._i18n && lang === void 0) {
544
570
  const { languages } = loader._i18n;
@@ -547,34 +573,18 @@ function llms(loader, config = {}) {
547
573
  const pageTree = loader.getPageTree(lang);
548
574
  const out = [];
549
575
  const ctx = { lang };
550
- out.push(`# ${renderName(pageTree, ctx)}`);
551
- out.push("");
552
- function item(name, description, indent) {
553
- const prefix = TAB.repeat(indent);
554
- description = description.trim();
555
- if (description.length > 0) return `${prefix}- ${name}: ${description}`;
556
- return `${prefix}- ${name}`;
557
- }
558
- function onNode(node, indent) {
559
- switch (node.type) {
560
- case "page":
561
- out.push(item(formatMarkdownLink(renderName(node, ctx), node.url), renderDescription(node, ctx), indent));
562
- break;
563
- case "folder":
564
- out.push(item(renderName(node, ctx), renderDescription(node, ctx), indent));
565
- if (node.index) onNode(node.index, indent + 1);
566
- for (const child of node.children) onNode(child, indent + 1);
567
- break;
568
- case "separator":
569
- if (node.name) out.push(item(`**${renderName(node, ctx)}**`, "", indent));
570
- out.push("");
571
- break;
572
- }
573
- }
574
- for (const child of pageTree.children) onNode(child, 0);
576
+ out.push(`# ${renderName(pageTree, ctx)}`, "");
577
+ const description = renderDescription(pageTree, ctx);
578
+ if (description) out.push(`> ${description}`, "");
579
+ for (const child of pageTree.children) out.push(formatNode(child, 0, ctx));
575
580
  return out.join("\n");
576
581
  }
577
- return { index };
582
+ return {
583
+ index,
584
+ indexNode(node, lang) {
585
+ return formatNode(node, 0, { lang });
586
+ }
587
+ };
578
588
  }
579
589
  function formatMarkdownLink(title, url) {
580
590
  return `[${title.replace(/([[\]])/g, "\\$1")}](${url.replace(/([()])/g, "\\$1")})`;
@@ -679,7 +689,7 @@ function loader(...args) {
679
689
  getPageByHref(href, { dir = "", language = i18n?.defaultLanguage } = {}) {
680
690
  const [value, hash] = href.split("#", 2);
681
691
  let target;
682
- if (value.startsWith("./")) {
692
+ if (value.startsWith("./") || value.startsWith("../")) {
683
693
  const path = joinPath(dir, value);
684
694
  target = indexer.getPage(path, language);
685
695
  } else target = this.getPages(language).find((item) => item.url === value);
@@ -689,7 +699,7 @@ function loader(...args) {
689
699
  };
690
700
  },
691
701
  resolveHref(href, parent) {
692
- if (href.startsWith("./")) {
702
+ if (href.startsWith("./") || href.startsWith("../")) {
693
703
  const target = this.getPageByHref(href, {
694
704
  dir: path.dirname(parent.path),
695
705
  language: parent.locale
@@ -714,12 +724,12 @@ function loader(...args) {
714
724
  return indexer.getPageBySlugs(slugs, language);
715
725
  },
716
726
  getNodeMeta(node, language = i18n?.defaultLanguage) {
717
- const ref = node.$ref?.metaFile;
727
+ const ref = node.$ref;
718
728
  if (!ref) return;
719
729
  return indexer.getMeta(ref, language);
720
730
  },
721
731
  getNodePage(node, language = i18n?.defaultLanguage) {
722
- const ref = node.$ref?.file;
732
+ const ref = node.$ref;
723
733
  if (!ref) return;
724
734
  return indexer.getPage(ref, language);
725
735
  },
@@ -1,4 +1,4 @@
1
- import { s as LoaderPlugin } from "../../index-ins6zSWO.js";
1
+ import { s as LoaderPlugin } from "../../index-DkqXqEn8.js";
2
2
  import { icons } from "lucide-react";
3
3
 
4
4
  //#region src/source/plugins/lucide-icons.d.ts
@@ -1,2 +1,2 @@
1
- import { _ as getSlugs, g as SlugFn, v as slugsFromData, y as slugsPlugin } from "../../index-ins6zSWO.js";
1
+ import { _ as getSlugs, g as SlugFn, v as slugsFromData, y as slugsPlugin } from "../../index-DkqXqEn8.js";
2
2
  export { SlugFn, getSlugs, slugsFromData, slugsPlugin };
@@ -1,5 +1,5 @@
1
- import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-Cb3qV_RZ.js";
2
- import { s as LoaderPlugin } from "../../index-ins6zSWO.js";
1
+ import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-j1YD3oZE.js";
2
+ import { s as LoaderPlugin } from "../../index-DkqXqEn8.js";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/source/plugins/status-badges.d.ts
@@ -35,7 +35,7 @@ function getPageTreeRoots(pageTree) {
35
35
  if (child.root) roots.push(child);
36
36
  return roots;
37
37
  });
38
- if (!("type" in pageTree)) result.push(pageTree);
38
+ if (!pageTree.type || pageTree.type === "root") result.push(pageTree);
39
39
  return result;
40
40
  }
41
41
  /**
@@ -64,7 +64,7 @@ function findSiblings(treeOrTrees, url) {
64
64
  function findParent(from, url) {
65
65
  let result;
66
66
  visit(from, (node, parent) => {
67
- if ("type" in node && node.type === "page" && node.url === url) {
67
+ if (node.type === "page" && node.url === url) {
68
68
  result = parent;
69
69
  return "break";
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.7.9",
3
+ "version": "16.7.11",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",
@@ -129,13 +129,13 @@
129
129
  "mdast-util-to-markdown": "^2.1.2",
130
130
  "negotiator": "^1.0.0",
131
131
  "npm-to-yarn": "^3.0.1",
132
- "path-to-regexp": "^8.4.0",
132
+ "path-to-regexp": "^8.4.2",
133
133
  "remark": "^15.0.1",
134
134
  "remark-gfm": "^4.0.1",
135
135
  "remark-rehype": "^11.1.2",
136
136
  "scroll-into-view-if-needed": "^3.1.0",
137
137
  "shiki": "^4.0.2",
138
- "tinyglobby": "^0.2.15",
138
+ "tinyglobby": "^0.2.16",
139
139
  "unified": "^11.0.5",
140
140
  "unist-util-visit": "^5.1.0",
141
141
  "vfile": "^6.0.3"
@@ -145,23 +145,23 @@
145
145
  "@mixedbread/sdk": "^0.61.0",
146
146
  "@orama/core": "^1.2.19",
147
147
  "@oramacloud/client": "^2.1.4",
148
- "@tanstack/react-router": "1.168.7",
148
+ "@tanstack/react-router": "1.168.10",
149
149
  "@types/estree-jsx": "^1.0.5",
150
150
  "@types/hast": "^3.0.4",
151
151
  "@types/mdast": "^4.0.4",
152
152
  "@types/negotiator": "^0.6.4",
153
- "@types/node": "25.5.0",
153
+ "@types/node": "25.5.2",
154
154
  "@types/react": "^19.2.14",
155
155
  "@types/react-dom": "^19.2.3",
156
- "algoliasearch": "5.50.0",
156
+ "algoliasearch": "5.50.1",
157
157
  "flexsearch": "^0.8.212",
158
158
  "lucide-react": "^1.7.0",
159
- "next": "16.2.1",
160
- "react-router": "^7.13.2",
159
+ "next": "16.2.2",
160
+ "react-router": "^7.14.0",
161
161
  "remark-directive": "^4.0.0",
162
162
  "remark-mdx": "^3.1.1",
163
163
  "remove-markdown": "^0.6.3",
164
- "tsdown": "0.21.6",
164
+ "tsdown": "0.21.7",
165
165
  "typescript": "^6.0.2",
166
166
  "waku": "1.0.0-alpha.6",
167
167
  "zod": "^4.3.6",