fumadocs-core 16.19.0 → 16.19.1

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 (47) hide show
  1. package/dist/{algolia-BU6WTadf.d.ts → algolia-CQ_t21WZ.d.ts} +1 -1
  2. package/dist/{client-D5_Oxm3d.d.ts → client-Ca0pBjkk.d.ts} +2 -2
  3. package/dist/content/mdx/preset-bundler.d.ts +1 -1
  4. package/dist/content/mdx/preset-runtime.d.ts +1 -1
  5. package/dist/framework/plugin.d.ts +1 -1
  6. package/dist/{index--VTdzHy3.d.ts → index-DKOSCE6a.d.ts} +1 -1
  7. package/dist/{index-xpLrpK8K.d.ts → index-DqVvRMMI.d.ts} +25 -2
  8. package/dist/mcp.d.ts +2 -2
  9. package/dist/mcp.js +1 -9
  10. package/dist/mdx-plugins/index.d.ts +2 -2
  11. package/dist/mdx-plugins/remark-gfm.d.ts +1 -1
  12. package/dist/mdx-plugins/remark-image.js +7 -7
  13. package/dist/mdx-plugins/remark-include.js +4 -4
  14. package/dist/{meilisearch-C4oclDaO.d.ts → meilisearch-BngEnZgG.d.ts} +1 -1
  15. package/dist/{mixedbread-8oiVgbAM.d.ts → mixedbread-d8e8wgqx.d.ts} +2 -2
  16. package/dist/remark-gfm-chhuRhmk.d.ts +2 -0
  17. package/dist/search/algolia.d.ts +1 -1
  18. package/dist/search/client/algolia.d.ts +1 -1
  19. package/dist/search/client/docs-search.d.ts +1 -1
  20. package/dist/search/client/fetch.d.ts +1 -1
  21. package/dist/search/client/flexsearch-static.d.ts +1 -1
  22. package/dist/search/client/meilisearch.d.ts +1 -1
  23. package/dist/search/client/mixedbread.d.ts +2 -2
  24. package/dist/search/client/orama-cloud-legacy.d.ts +1 -1
  25. package/dist/search/client/orama-cloud.d.ts +1 -1
  26. package/dist/search/client/orama-static.d.ts +1 -1
  27. package/dist/search/client/orama-static.js +3 -3
  28. package/dist/search/client.d.ts +1 -1
  29. package/dist/search/flexsearch.d.ts +2 -2
  30. package/dist/search/meilisearch.d.ts +1 -1
  31. package/dist/search/mixedbread.d.ts +2 -2
  32. package/dist/search/orama-cloud-legacy.d.ts +1 -1
  33. package/dist/search/orama-cloud.d.ts +2 -2
  34. package/dist/search/server.d.ts +1 -1
  35. package/dist/{server-CazrloBV.d.ts → server-BJlZvi0B.d.ts} +1 -1
  36. package/dist/server.d.ts +1 -1
  37. package/dist/server.js +26 -15
  38. package/dist/source/dynamic.d.ts +1 -1
  39. package/dist/source/index.d.ts +1 -1
  40. package/dist/source/llms.d.ts +1 -1
  41. package/dist/source/llms.js +93 -13
  42. package/dist/source/plugins/lucide-icons.d.ts +1 -1
  43. package/dist/source/plugins/slugs.d.ts +1 -1
  44. package/dist/source/plugins/slugs.js +5 -5
  45. package/dist/source/plugins/status-badges.d.ts +1 -1
  46. package/package.json +6 -6
  47. package/dist/remark-gfm-DpVfAX1x.d.ts +0 -2
@@ -1,5 +1,5 @@
1
1
  import { n as StructuredData } from "./remark-structure-CV606E7e.js";
2
- import { D as LoaderOutput, T as LoaderConfig } from "./index-xpLrpK8K.js";
2
+ import { D as LoaderOutput, T as LoaderConfig } from "./index-DqVvRMMI.js";
3
3
  import { t as Awaitable } from "./types-Dvkw0Kd0.js";
4
4
  import { Algoliasearch } from "algoliasearch";
5
5
  interface DocumentRecord {
@@ -1,7 +1,7 @@
1
1
  import { r as SortedResult } from "./index-BlFx9iJj.js";
2
2
  import { t as Awaitable } from "./types-Dvkw0Kd0.js";
3
- import { t as BaseIndex } from "./algolia-BU6WTadf.js";
4
- import "./mixedbread-8oiVgbAM.js";
3
+ import { t as BaseIndex } from "./algolia-CQ_t21WZ.js";
4
+ import "./mixedbread-d8e8wgqx.js";
5
5
  import { DependencyList } from "react";
6
6
  import { AnyZBSearch, SearchParams } from "zbsearch";
7
7
  import { Root } from "hast";
@@ -4,7 +4,7 @@ import { t as StructureOptions } from "../../remark-structure-CV606E7e.js";
4
4
  import { t as RemarkHeadingOptions } from "../../remark-heading-BfD2dpns.js";
5
5
  import { t as RemarkCodeTabOptions } from "../../remark-code-tab-Bp3EItqr.js";
6
6
  import { t as RemarkNpmOptions } from "../../remark-npm-IH35Vls_.js";
7
- import "../../index--VTdzHy3.js";
7
+ import "../../index-DKOSCE6a.js";
8
8
  import { t as ResolvePlugins } from "../../util-YfkucgkA.js";
9
9
  import { Pluggable } from "unified";
10
10
  import { ProcessorOptions } from "@mdx-js/mdx";
@@ -4,7 +4,7 @@ import { t as StructureOptions } from "../../remark-structure-CV606E7e.js";
4
4
  import { t as RemarkHeadingOptions } from "../../remark-heading-BfD2dpns.js";
5
5
  import { t as RemarkCodeTabOptions } from "../../remark-code-tab-Bp3EItqr.js";
6
6
  import { t as RemarkNpmOptions } from "../../remark-npm-IH35Vls_.js";
7
- import "../../index--VTdzHy3.js";
7
+ import "../../index-DKOSCE6a.js";
8
8
  import { t as ResolvePlugins } from "../../util-YfkucgkA.js";
9
9
  import { ProcessorOptions } from "@mdx-js/mdx";
10
10
  export type MDXRuntimePresetOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins'> & {
@@ -1,6 +1,6 @@
1
1
  import { i as TranslationExtension } from "../index-DFrWGSeW.js";
2
2
  import { n as StructuredData } from "../remark-structure-CV606E7e.js";
3
- import { D as LoaderOutput, E as LoaderOptions, T as LoaderConfig, k as LoaderPluginOption } from "../index-xpLrpK8K.js";
3
+ import { D as LoaderOutput, E as LoaderOptions, T as LoaderConfig, k as LoaderPluginOption } from "../index-DqVvRMMI.js";
4
4
  import { c as TOCItemType } from "../toc-BuHOTlzj.js";
5
5
  import { ReactNode } from "react";
6
6
  type Awaitable<T> = T | Promise<T>;
@@ -1,4 +1,4 @@
1
- import "./remark-gfm-DpVfAX1x.js";
1
+ import "./remark-gfm-chhuRhmk.js";
2
2
  import "./rehype-code-Czh_8L5z.js";
3
3
  import "./remark-image-BwyGdFld.js";
4
4
  import "./remark-include-D_FmDdtI.js";
@@ -3,7 +3,7 @@ import { n as I18nConfig } from "./index-DFrWGSeW.js";
3
3
  import { n as StructuredData } from "./remark-structure-CV606E7e.js";
4
4
  import { a as Separator, i as Root, n as Item, r as Node, t as Folder } from "./definitions-BQVehOBz.js";
5
5
  import { n as SerializedPageTree } from "./index-B2EN5xn0.js";
6
- import "./index--VTdzHy3.js";
6
+ import "./index-DKOSCE6a.js";
7
7
  import "./index-DMxrC6WS.js";
8
8
  import { ReactNode } from "react";
9
9
  /**
@@ -549,11 +549,18 @@ interface LLMsConfig<Page = unknown> {
549
549
  TAB?: string;
550
550
  renderName?: (item: Node | Root, ctx: Context) => string;
551
551
  renderDescription?: (item: Root | Item | Folder, ctx: Context) => string;
552
+ /**
553
+ * The URL of a link, in files `item.url` is the path of the file it links to, like the `.md` file of a page.
554
+ */
552
555
  renderUrl?: (item: Item, ctx: Context) => string;
553
556
  /**
554
- * Render a page as Markdown, required by `page()` and `full()`.
557
+ * Render a page as Markdown, required by `page()`, `full()` and the files.
555
558
  */
556
559
  renderPage?: (page: Page) => Awaitable<string>;
560
+ /**
561
+ * The pages in `full()` and the files, every page by default.
562
+ */
563
+ filter?: (page: Page) => boolean;
557
564
  }
558
565
  interface LLMs<IndexOutput extends Awaitable<string> = Awaitable<string>> {
559
566
  /**
@@ -576,6 +583,22 @@ interface LLMsWithPages<Page, IndexOutput extends Awaitable<string> = Awaitable<
576
583
  * generate `llms-full.txt` content: every page rendered with `renderPage`.
577
584
  */
578
585
  full: (lang?: string) => Promise<string>;
586
+ /**
587
+ * The paths of the files for agents, for static output:
588
+ *
589
+ * - `/llms.txt` and `/llms-full.txt`: every page, linked to its `.md` file, and the `llms-full.txt` of directories.
590
+ * - `<dir>/llms-full.txt`: the pages under a URL directory with two or more pages, like `/docs/guide`.
591
+ * - `<page>.md`: a page, `/index.md` for `/`.
592
+ *
593
+ * @param lang - only the pages of a language, required when URLs don't have the locale (`hideLocale: 'always'`)
594
+ */
595
+ files: (lang?: string) => Promise<string[]>;
596
+ /**
597
+ * Respond with the file at a path, `undefined` when there's none.
598
+ *
599
+ * @param lang - only the pages of a language, see `files()`
600
+ */
601
+ serve: (path: string, lang?: string) => Promise<Response | undefined>;
579
602
  }
580
603
  declare function llms<C extends LoaderConfig = LoaderConfig>(input: LoaderOutput<C>, config: LLMsConfig<C['page']> & {
581
604
  renderPage: (page: C['page']) => Awaitable<string>;
package/dist/mcp.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as SearchServer } from "./server-CazrloBV.js";
2
- import { D as LoaderOutput, T as LoaderConfig, r as LLMsWithPages } from "./index-xpLrpK8K.js";
1
+ import { r as SearchServer } from "./server-BJlZvi0B.js";
2
+ import { D as LoaderOutput, T as LoaderConfig, r as LLMsWithPages } from "./index-DqVvRMMI.js";
3
3
  import { t as Awaitable } from "./types-Dvkw0Kd0.js";
4
4
  import { McpServer } from "@modelcontextprotocol/server";
5
5
  /**
package/dist/mcp.js CHANGED
@@ -33,7 +33,7 @@ function registerSourceTools(mcp, source, llms) {
33
33
  description: "Get the Markdown content of a docs page by its pathname (URL)",
34
34
  inputSchema: z.object({ url: z.string() })
35
35
  }, async ({ url }) => {
36
- const page = findPage(typeof source === "function" ? await source() : source, url);
36
+ const page = (typeof source === "function" ? await source() : source).getPageByUrl(url.replace(/[?#].*$/, ""));
37
37
  if (!page) return {
38
38
  content: [{
39
39
  type: "text",
@@ -47,12 +47,4 @@ function registerSourceTools(mcp, source, llms) {
47
47
  }] };
48
48
  });
49
49
  }
50
- /** URLs are unique across languages, an i18n loader looks them up per language */
51
- function findPage(loader, url) {
52
- if (!loader._i18n) return loader.getPageByUrl(url);
53
- for (const language of loader._i18n.languages) {
54
- const page = loader.getPageByUrl(url, language);
55
- if (page) return page;
56
- }
57
- }
58
50
  export { registerSearchTool, registerSourceTools };
@@ -1,4 +1,4 @@
1
- import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-DpVfAX1x.js";
1
+ import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-chhuRhmk.js";
2
2
  import { o as transformerTab } from "../rehype-code.core-BeCtKe7K.js";
3
3
  import { r as transformerIcon, t as CodeBlockIcon } from "../transformer-icon-Bi4LROAz.js";
4
4
  import { n as rehypeCode, r as rehypeCodeDefaultOptions, t as RehypeCodeOptions } from "../rehype-code-Czh_8L5z.js";
@@ -18,5 +18,5 @@ import { n as remarkMdxMermaid, t as RemarkMdxMermaidOptions } from "../remark-m
18
18
  import { n as RemarkFeedbackBlockOptions, r as remarkFeedbackBlock, t as FeedbackBlockProps } from "../remark-feedback-block-2Ei4IDr4.js";
19
19
  import { t as remarkShow } from "../remark-show-uR9rtiVe.js";
20
20
  import { t as LLMsOptions } from "../remark-llms-BCyfmS02.js";
21
- import "../index--VTdzHy3.js";
21
+ import "../index-DKOSCE6a.js";
22
22
  export { CodeBlockAttributes, type CodeBlockIcon, CodeBlockTabsOptions, FeedbackBlockProps, type LLMsOptions, RehypeCodeOptions, RehypeTOCItemType, RehypeTocOptions, RemarkAdmonitionOptions, RemarkCodeTabOptions, RemarkDirectiveAdmonitionOptions, RemarkFeedbackBlockOptions, type RemarkGfmOptions, RemarkHeadingOptions, RemarkImageOptions, RemarkIncludeOptions, type RemarkMdxFilesOptions, RemarkMdxMermaidOptions, RemarkNpmOptions, RemarkStepsOptions, StructureOptions, StructuredData, StructuredDataContent, extractCodeRegion, generateCodeBlockTabs, parseCodeBlockAttributes, rehypeCode, rehypeCodeDefaultOptions, rehypeHeading, rehypeToc, remarkAdmonition, remarkCodeTab, remarkDirectiveAdmonition, remarkFeedbackBlock, remarkGfm, remarkHeading, remarkImage, remarkInclude, remarkMdxFiles, remarkMdxMermaid, remarkNpm, remarkShow, remarkSteps, remarkStructure, remarkStructureDefaultOptions, structure, transformerIcon, transformerTab };
@@ -1,2 +1,2 @@
1
- import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-DpVfAX1x.js";
1
+ import { n as remarkGfm, t as RemarkGfmOptions } from "../remark-gfm-chhuRhmk.js";
2
2
  export { type RemarkGfmOptions, remarkGfm };
@@ -1,6 +1,6 @@
1
1
  import { replaceSource } from "./stringifier.js";
2
2
  import { u as walk } from "../utils-DfA1qEJN.js";
3
- import * as path$1 from "node:path";
3
+ import * as path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  // src/mdx-plugins/remark-image.ts
6
6
  const VALID_BLUR_EXT = [
@@ -14,7 +14,7 @@ const EXTERNAL_URL_REGEX = /^https?:\/\//;
14
14
  /**
15
15
  * Turn images into Next.js Image compatible usage.
16
16
  */
17
- function remarkImage({ placeholder = "none", external = true, useImport = true, onError = "error", publicDir = path$1.join(process.cwd(), "public") } = {}) {
17
+ function remarkImage({ placeholder = "none", external = true, useImport = true, onError = "error", publicDir = path.join(process.cwd(), "public") } = {}) {
18
18
  return async (tree, file) => {
19
19
  const importsToInject = [];
20
20
  const promises = [];
@@ -150,9 +150,9 @@ function importedUrl(name) {
150
150
  };
151
151
  }
152
152
  function getImportPath(file, dir) {
153
- const relative = path$1.relative(dir, file);
154
- const posix = relative.replaceAll(path$1.sep, "/");
155
- if (path$1.isAbsolute(relative) || posix.startsWith("../")) return posix;
153
+ const relative = path.relative(dir, file);
154
+ const posix = relative.replaceAll(path.sep, "/");
155
+ if (path.isAbsolute(relative) || posix.startsWith("../")) return posix;
156
156
  return `./${posix}`;
157
157
  }
158
158
  /**
@@ -180,7 +180,7 @@ function parseSrc(src, publicDir, dir) {
180
180
  }
181
181
  return {
182
182
  type: "file",
183
- file: path$1.join(publicDir, src)
183
+ file: path.join(publicDir, src)
184
184
  };
185
185
  }
186
186
  if (!dir) {
@@ -189,7 +189,7 @@ function parseSrc(src, publicDir, dir) {
189
189
  }
190
190
  return {
191
191
  type: "file",
192
- file: path$1.join(dir, src)
192
+ file: path.join(dir, src)
193
193
  };
194
194
  }
195
195
  async function getImageSize(src, onExternal) {
@@ -3,7 +3,7 @@ import { n as headingIdRegex } from "../heading-id-DV5jeAL8.js";
3
3
  import { embedSource, replaceSource } from "./stringifier.js";
4
4
  import { r as flattenNode, u as walk } from "../utils-DfA1qEJN.js";
5
5
  import Slugger from "github-slugger";
6
- import * as path$1 from "node:path";
6
+ import * as path from "node:path";
7
7
  import * as fs from "node:fs/promises";
8
8
  // src/mdx-plugins/remark-include.ts
9
9
  const elementLikeTypes = /* @__PURE__ */ new Set([
@@ -30,7 +30,7 @@ function remarkInclude({ getProcessor = () => this } = {}) {
30
30
  if (!specifier) return "skip";
31
31
  const attributes = parseElementAttributes(node);
32
32
  const idx = specifier.lastIndexOf("#");
33
- const targetPath = path$1.resolve("cwd" in attributes ? file.cwd : dir, idx === -1 ? specifier : specifier.slice(0, idx));
33
+ const targetPath = path.resolve("cwd" in attributes ? file.cwd : dir, idx === -1 ? specifier : specifier.slice(0, idx));
34
34
  const section = idx === -1 ? void 0 : specifier.slice(idx + 1);
35
35
  const host = parent;
36
36
  const target = host?.type === "paragraph" ? host : node;
@@ -52,7 +52,7 @@ function remarkInclude({ getProcessor = () => this } = {}) {
52
52
  } catch (e) {
53
53
  throw new Error(`failed to read file ${targetPath}\n${e instanceof Error ? e.message : String(e)}`, { cause: e });
54
54
  }
55
- const ext = path$1.extname(targetPath);
55
+ const ext = path.extname(targetPath);
56
56
  if (attributes.lang || ext !== ".md" && ext !== ".mdx") {
57
57
  const lang = attributes.lang ?? ext.slice(1);
58
58
  const value = section ? extractCodeRegion(content, section) : content.replace(/\r?\n$/, "");
@@ -76,7 +76,7 @@ function remarkInclude({ getProcessor = () => this } = {}) {
76
76
  tree.children = children;
77
77
  }
78
78
  embedSource(file, target, source, tree.children);
79
- await update(tree, path$1.dirname(targetPath), file, [...stack, targetPath]);
79
+ await update(tree, path.dirname(targetPath), file, [...stack, targetPath]);
80
80
  return tree;
81
81
  }
82
82
  return (tree, file) => update(tree, file.dirname ?? file.cwd, file, []);
@@ -1,5 +1,5 @@
1
1
  import { n as StructuredData } from "./remark-structure-CV606E7e.js";
2
- import { D as LoaderOutput, T as LoaderConfig } from "./index-xpLrpK8K.js";
2
+ import { D as LoaderOutput, T as LoaderConfig } from "./index-DqVvRMMI.js";
3
3
  import { t as Awaitable } from "./types-Dvkw0Kd0.js";
4
4
  import { Meilisearch } from "meilisearch";
5
5
  interface DocumentRecord {
@@ -1,6 +1,6 @@
1
1
  import { r as SortedResult } from "./index-BlFx9iJj.js";
2
- import { n as SearchAPI } from "./server-CazrloBV.js";
3
- import { t as DocumentRecord } from "./meilisearch-C4oclDaO.js";
2
+ import { n as SearchAPI } from "./server-BJlZvi0B.js";
3
+ import { t as DocumentRecord } from "./meilisearch-BngEnZgG.js";
4
4
  import Mixedbread from "@mixedbread/sdk";
5
5
  import { ScoredTextInputChunk } from "@mixedbread/sdk/resources/stores";
6
6
  /**
@@ -0,0 +1,2 @@
1
+ import remarkGfm, { Options as RemarkGfmOptions } from "remark-gfm";
2
+ export { remarkGfm as n, RemarkGfmOptions as t };
@@ -1,2 +1,2 @@
1
- import { a as sync, i as setIndexSettings, n as DocumentRecord, o as toDocuments, r as SyncOptions, s as updateDocuments, t as BaseIndex } from "../algolia-BU6WTadf.js";
1
+ import { a as sync, i as setIndexSettings, n as DocumentRecord, o as toDocuments, r as SyncOptions, s as updateDocuments, t as BaseIndex } from "../algolia-CQ_t21WZ.js";
2
2
  export { BaseIndex, DocumentRecord, SyncOptions, setIndexSettings, sync, toDocuments, updateDocuments };
@@ -1,2 +1,2 @@
1
- import { b as useAlgoliaSearch, v as AlgoliaOptions, y as algoliaClient } from "../../client-D5_Oxm3d.js";
1
+ import { b as useAlgoliaSearch, v as AlgoliaOptions, y as algoliaClient } from "../../client-Ca0pBjkk.js";
2
2
  export { AlgoliaOptions, algoliaClient, useAlgoliaSearch };
@@ -1,2 +1,2 @@
1
- import { n as SearchClient, r as useDocsSearch, t as ClientPreset } from "../../client-D5_Oxm3d.js";
1
+ import { n as SearchClient, r as useDocsSearch, t as ClientPreset } from "../../client-Ca0pBjkk.js";
2
2
  export { ClientPreset, SearchClient, useDocsSearch };
@@ -1,2 +1,2 @@
1
- import { D as useFetchSearch, E as fetchClient, T as FetchOptions } from "../../client-D5_Oxm3d.js";
1
+ import { D as useFetchSearch, E as fetchClient, T as FetchOptions } from "../../client-Ca0pBjkk.js";
2
2
  export { FetchOptions, fetchClient, useFetchSearch };
@@ -1,2 +1,2 @@
1
- import { a as flexsearchStaticClient, i as FlexsearchStaticOptions, o as useFlexsearchStatic } from "../../client-D5_Oxm3d.js";
1
+ import { a as flexsearchStaticClient, i as FlexsearchStaticOptions, o as useFlexsearchStatic } from "../../client-Ca0pBjkk.js";
2
2
  export { FlexsearchStaticOptions, flexsearchStaticClient, useFlexsearchStatic };
@@ -1,2 +1,2 @@
1
- import { f as MeilisearchOptions, m as useMeilisearch, p as meilisearchClient } from "../../client-D5_Oxm3d.js";
1
+ import { f as MeilisearchOptions, m as useMeilisearch, p as meilisearchClient } from "../../client-Ca0pBjkk.js";
2
2
  export { MeilisearchOptions, meilisearchClient, useMeilisearch };
@@ -1,3 +1,3 @@
1
- import { c as mixedbreadClient, s as MixedbreadOptions } from "../../client-D5_Oxm3d.js";
2
- import { n as SearchMetadata } from "../../mixedbread-8oiVgbAM.js";
1
+ import { c as mixedbreadClient, s as MixedbreadOptions } from "../../client-Ca0pBjkk.js";
2
+ import { n as SearchMetadata } from "../../mixedbread-d8e8wgqx.js";
3
3
  export { MixedbreadOptions, type SearchMetadata, mixedbreadClient };
@@ -1,2 +1,2 @@
1
- import { d as useOramaCloudLegacySearch, l as OramaCloudLegacyOptions, u as oramaCloudLegacyClient } from "../../client-D5_Oxm3d.js";
1
+ import { d as useOramaCloudLegacySearch, l as OramaCloudLegacyOptions, u as oramaCloudLegacyClient } from "../../client-Ca0pBjkk.js";
2
2
  export { OramaCloudLegacyOptions, oramaCloudLegacyClient, useOramaCloudLegacySearch };
@@ -1,2 +1,2 @@
1
- import { _ as useOramaCloudSearch, g as oramaCloudClient, h as OramaCloudOptions } from "../../client-D5_Oxm3d.js";
1
+ import { _ as useOramaCloudSearch, g as oramaCloudClient, h as OramaCloudOptions } from "../../client-Ca0pBjkk.js";
2
2
  export { OramaCloudOptions, oramaCloudClient, useOramaCloudSearch };
@@ -1,2 +1,2 @@
1
- import { C as staticClient, S as oramaStaticClient, w as useStaticSearch, x as StaticOptions } from "../../client-D5_Oxm3d.js";
1
+ import { C as staticClient, S as oramaStaticClient, w as useStaticSearch, x as StaticOptions } from "../../client-Ca0pBjkk.js";
2
2
  export { StaticOptions, oramaStaticClient, staticClient, useStaticSearch };
@@ -4,7 +4,7 @@ import { n as join, t as BASE_PATH } from "../../url-BF81yL4m.js";
4
4
  import { useCallback, useRef } from "react";
5
5
  import { create, load } from "zbsearch";
6
6
  // src/search/client/orama-static.ts
7
- const cache$1 = /* @__PURE__ */ new Map();
7
+ const cache = /* @__PURE__ */ new Map();
8
8
  async function loadDB(from, initDB = () => create({ schema: { _: "string" } })) {
9
9
  const res = await fetch(from);
10
10
  if (!res.ok) throw new Error(`failed to fetch exported search indexes from ${from}, make sure the search database is exported and available for client.`);
@@ -39,10 +39,10 @@ async function loadDB(from, initDB = () => create({ schema: { _: "string" } }))
39
39
  }
40
40
  function getDBCached({ from = join(BASE_PATH, "/api/search"), initDB, initOrama }) {
41
41
  const cacheKey = from;
42
- const cached = cache$1.get(cacheKey);
42
+ const cached = cache.get(cacheKey);
43
43
  if (cached) return cached;
44
44
  const result = loadDB(from, initDB ?? initOrama);
45
- cache$1.set(cacheKey, result);
45
+ cache.set(cacheKey, result);
46
46
  return result;
47
47
  }
48
48
  async function searchStatic(options, query) {
@@ -1,2 +1,2 @@
1
- import { A as SearchResultRecord, D as useFetchSearch, F as useSearch, M as UseSearchOptions, N as UseSearchReturn, O as SearchResult, P as useHighlightQuery, T as FetchOptions, _ as useOramaCloudSearch, b as useAlgoliaSearch, f as MeilisearchOptions, h as OramaCloudOptions, j as SearchResultTable, k as SearchResultItem, m as useMeilisearch, n as SearchClient, r as useDocsSearch, t as ClientPreset, v as AlgoliaOptions, w as useStaticSearch, x as StaticOptions } from "../client-D5_Oxm3d.js";
1
+ import { A as SearchResultRecord, D as useFetchSearch, F as useSearch, M as UseSearchOptions, N as UseSearchReturn, O as SearchResult, P as useHighlightQuery, T as FetchOptions, _ as useOramaCloudSearch, b as useAlgoliaSearch, f as MeilisearchOptions, h as OramaCloudOptions, j as SearchResultTable, k as SearchResultItem, m as useMeilisearch, n as SearchClient, r as useDocsSearch, t as ClientPreset, v as AlgoliaOptions, w as useStaticSearch, x as StaticOptions } from "../client-Ca0pBjkk.js";
2
2
  export { type AlgoliaOptions, type ClientPreset, type FetchOptions, type MeilisearchOptions, type OramaCloudOptions, type SearchClient, type SearchResult, type SearchResultItem, type SearchResultRecord, type SearchResultTable, type StaticOptions, type UseSearchOptions, type UseSearchReturn, useSearch as experimental_useSearch, useAlgoliaSearch, useDocsSearch, useFetchSearch, useHighlightQuery, useMeilisearch, useOramaCloudSearch, useStaticSearch };
@@ -1,5 +1,5 @@
1
- import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-CazrloBV.js";
2
- import { D as LoaderOutput, T as LoaderConfig } from "../index-xpLrpK8K.js";
1
+ import { m as SharedIndex, n as SearchAPI, t as QueryOptions } from "../server-BJlZvi0B.js";
2
+ import { D as LoaderOutput, T as LoaderConfig } from "../index-DqVvRMMI.js";
3
3
  import { t as Awaitable } from "../types-Dvkw0Kd0.js";
4
4
  import { n as I18nConfig } from "../index-DFrWGSeW.js";
5
5
  import "../index-BlFx9iJj.js";
@@ -1,2 +1,2 @@
1
- import { a as toDocuments, i as sync, n as MeilisearchDocument, r as SyncOptions, t as DocumentRecord } from "../meilisearch-C4oclDaO.js";
1
+ import { a as toDocuments, i as sync, n as MeilisearchDocument, r as SyncOptions, t as DocumentRecord } from "../meilisearch-BngEnZgG.js";
2
2
  export { DocumentRecord, MeilisearchDocument, SyncOptions, sync, toDocuments };
@@ -1,3 +1,3 @@
1
- import { a as toDocuments, t as DocumentRecord } from "../meilisearch-C4oclDaO.js";
2
- import { a as sync, i as createMixedbreadSearchAPI, n as SearchMetadata, r as SyncOptions, t as MixedbreadSearchOptions } from "../mixedbread-8oiVgbAM.js";
1
+ import { a as toDocuments, t as DocumentRecord } from "../meilisearch-BngEnZgG.js";
2
+ import { a as sync, i as createMixedbreadSearchAPI, n as SearchMetadata, r as SyncOptions, t as MixedbreadSearchOptions } from "../mixedbread-d8e8wgqx.js";
3
3
  export { type DocumentRecord, MixedbreadSearchOptions, SearchMetadata, SyncOptions, createMixedbreadSearchAPI, sync, toDocuments };
@@ -1,5 +1,5 @@
1
1
  import { n as StructuredData } from "../remark-structure-CV606E7e.js";
2
- import "../index--VTdzHy3.js";
2
+ import "../index-DKOSCE6a.js";
3
3
  import { CloudManager } from "@oramacloud/client";
4
4
  export interface SyncOptions {
5
5
  /**
@@ -1,6 +1,6 @@
1
- import "../index--VTdzHy3.js";
1
+ import "../index-DKOSCE6a.js";
2
2
  import { n as StructuredData } from "../remark-structure-CV606E7e.js";
3
- import { D as LoaderOutput, T as LoaderConfig } from "../index-xpLrpK8K.js";
3
+ import { D as LoaderOutput, T as LoaderConfig } from "../index-DqVvRMMI.js";
4
4
  import { t as Awaitable } from "../types-Dvkw0Kd0.js";
5
5
  import { OramaCloud } from "@orama/core";
6
6
  export interface SyncOptions {
@@ -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-CazrloBV.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-BJlZvi0B.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 I18nConfig } from "./index-DFrWGSeW.js";
2
- import { D as LoaderOutput, T as LoaderConfig } from "./index-xpLrpK8K.js";
2
+ import { D as LoaderOutput, T as LoaderConfig } from "./index-DqVvRMMI.js";
3
3
  import { n as StructuredData } from "./remark-structure-CV606E7e.js";
4
4
  import { t as Awaitable } from "./types-Dvkw0Kd0.js";
5
5
  import { r as SortedResult } from "./index-BlFx9iJj.js";
package/dist/server.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare function renderToMarkdown(node: ReactNode, { target }?: {
17
17
  export declare function renderRoute(element: ReactElement): Promise<string | undefined>;
18
18
  /**
19
19
  * Resolve the MDX components of a generated Markdown component (`remarkLLMs` with `output: 'function'`):
20
- * a missing component becomes a stub that `renderToMarkdown` serializes as JSX syntax.
20
+ * a missing component is serialized as JSX syntax by `renderToMarkdown`.
21
21
  */
22
22
  export declare function jsxComponents(components: Record<string, ElementType> | undefined): Record<string, ElementType>;
23
23
  export type MarkdownTag = (strings: TemplateStringsArray, ...values: ReactNode[]) => Promise<string>;
package/dist/server.js CHANGED
@@ -43,16 +43,25 @@ async function renderRoute(element) {
43
43
  if (result !== NOT_OPTED_IN) return renderToMarkdown(result);
44
44
  }
45
45
  /**
46
+ * The element types of `jsxComponents()`, each stands for a component under its MDX tag: a component kept as JSX is
47
+ * named after its tag, as function names are minified in production builds and a component can have several tags.
48
+ */
49
+ const tagged = /* @__PURE__ */ new WeakMap();
50
+ /**
46
51
  * Resolve the MDX components of a generated Markdown component (`remarkLLMs` with `output: 'function'`):
47
- * a missing component becomes a stub that `renderToMarkdown` serializes as JSX syntax.
52
+ * a missing component is serialized as JSX syntax by `renderToMarkdown`.
48
53
  */
49
54
  function jsxComponents(components) {
50
- return new Proxy(components ?? {}, { get(target, key) {
51
- const value = target[key];
52
- if (value !== void 0 || typeof key !== "string") return value;
53
- const stub = () => null;
54
- stub.displayName = key;
55
- return stub;
55
+ return new Proxy({}, { get(_, key) {
56
+ if (typeof key !== "string") return;
57
+ const type = components?.[key] ?? (() => null);
58
+ if (typeof type === "string") return type;
59
+ const element = () => null;
60
+ tagged.set(element, {
61
+ tag: key,
62
+ type
63
+ });
64
+ return element;
56
65
  } });
57
66
  }
58
67
  /**
@@ -144,24 +153,26 @@ async function walk(node, state) {
144
153
  if (typeof node === "object" && Symbol.iterator in node) return (await Promise.all(Array.from(node, (child) => walk(child, state)))).join("");
145
154
  return "";
146
155
  }
147
- async function element(type, props, state) {
156
+ async function element(type, props, state, tag) {
157
+ const entry = tagged.get(type);
158
+ if (entry) return element(entry.type, props, state, entry.tag);
148
159
  if (typeof type === "string") return host(type, props, state);
149
- if (isClientReference(type)) return jsx(clientReferenceName(type.$$id), props, state);
150
- if (typeof type === "function") return component(type, props, state);
160
+ if (isClientReference(type)) return jsx(tag ?? clientReferenceName(type.$$id), props, state);
161
+ if (typeof type === "function") return component(type, props, state, tag);
151
162
  if (typeof type === "symbol") return walk(props.children, state);
152
163
  if (typeof type === "object" && type !== null) {
153
164
  const special = type;
154
165
  switch (special.$$typeof) {
155
- case REACT_LAZY: return element(await resolveLazy(special), props, state);
156
- case REACT_MEMO: return element(special.type, props, state);
157
- case REACT_FORWARD_REF: return component(special.render, props, state);
166
+ case REACT_LAZY: return element(await resolveLazy(special), props, state, tag);
167
+ case REACT_MEMO: return element(special.type, props, state, tag);
168
+ case REACT_FORWARD_REF: return component(special.render, props, state, tag);
158
169
  }
159
170
  }
160
171
  return "";
161
172
  }
162
- async function component(fn, props, state) {
173
+ async function component(fn, props, state, tag) {
163
174
  const result = await optIn(fn, props, state.target);
164
- if (result === NOT_OPTED_IN) return jsx(componentName(fn), props, state);
175
+ if (result === NOT_OPTED_IN) return jsx(tag ?? componentName(fn), props, state);
165
176
  return walk(result, state);
166
177
  }
167
178
  function componentName(fn) {
@@ -1,2 +1,2 @@
1
- import { b as DynamicLoaderConfig, x as dynamicLoader, y as DynamicLoader } from "../index-xpLrpK8K.js";
1
+ import { b as DynamicLoaderConfig, x as dynamicLoader, y as DynamicLoader } from "../index-DqVvRMMI.js";
2
2
  export { DynamicLoader, DynamicLoaderConfig, dynamicLoader };
@@ -1,2 +1,2 @@
1
- import { A as Meta, C as InferMetaType, D as LoaderOutput, E as LoaderOptions, F as types_d_exports, G as ContentStorage, H as PageTreeBuilderContext, J as FileSystem, K as ContentStorageMetaFile, M as ResolvedLoaderConfig, N as createGetUrl, O as LoaderPlugin, P as loader, R as getSlugs, S as GetPageOptions, T as LoaderConfig, U as PageTreeOptions, V as PageTreeBuilder, W as PageTreeTransformer, _ as multiple, a as StaticParamsOptions, b as DynamicLoaderConfig, c as path_d_exports, d as PageData, f as Params, g as VirtualFile, h as StaticSource, i as llms, j as Page, k as LoaderPluginOption, l as DynamicSource, m as SourceUnion, n as LLMsConfig, o as getStaticParams, p as Source, q as ContentStoragePageFile, r as LLMsWithPages, s as isDynamicPath, t as LLMs, u as MetaData, v as update, w as InferPageType, x as dynamicLoader, y as DynamicLoader } from "../index-xpLrpK8K.js";
1
+ import { A as Meta, C as InferMetaType, D as LoaderOutput, E as LoaderOptions, F as types_d_exports, G as ContentStorage, H as PageTreeBuilderContext, J as FileSystem, K as ContentStorageMetaFile, M as ResolvedLoaderConfig, N as createGetUrl, O as LoaderPlugin, P as loader, R as getSlugs, S as GetPageOptions, T as LoaderConfig, U as PageTreeOptions, V as PageTreeBuilder, W as PageTreeTransformer, _ as multiple, a as StaticParamsOptions, b as DynamicLoaderConfig, c as path_d_exports, d as PageData, f as Params, g as VirtualFile, h as StaticSource, i as llms, j as Page, k as LoaderPluginOption, l as DynamicSource, m as SourceUnion, n as LLMsConfig, o as getStaticParams, p as Source, q as ContentStoragePageFile, r as LLMsWithPages, s as isDynamicPath, t as LLMs, u as MetaData, v as update, w as InferPageType, x as dynamicLoader, y as DynamicLoader } from "../index-DqVvRMMI.js";
2
2
  export { type ContentStorage, type ContentStorageMetaFile, type ContentStoragePageFile, type DynamicLoader, type DynamicLoaderConfig, type DynamicSource, FileSystem, GetPageOptions, InferMetaType, InferPageType, LLMs, LLMsConfig, LLMsWithPages, LoaderConfig, LoaderOptions, LoaderOutput, LoaderPlugin, LoaderPluginOption, Meta, type MetaData, Page, type PageData, type PageTreeBuilder, type PageTreeBuilderContext, type PageTreeOptions, type PageTreeTransformer, type Params, path_d_exports as PathUtils, ResolvedLoaderConfig, type Source, type SourceUnion, type StaticParamsOptions, type StaticSource, type VirtualFile, type types_d_exports as _Internal, createGetUrl, dynamicLoader, getSlugs, getStaticParams, isDynamicPath, llms, loader, multiple, update };
@@ -1,2 +1,2 @@
1
- import { i as llms, n as LLMsConfig, r as LLMsWithPages, t as LLMs } from "../index-xpLrpK8K.js";
1
+ import { i as llms, n as LLMsConfig, r as LLMsWithPages, t as LLMs } from "../index-DqVvRMMI.js";
2
2
  export { LLMs, LLMsConfig, LLMsWithPages, llms };
@@ -1,6 +1,6 @@
1
1
  // src/source/llms.ts
2
2
  function llms(input, config = {}) {
3
- const { TAB = " " } = config;
3
+ const { TAB = " ", filter = () => true } = config;
4
4
  function renderName(node, ctx) {
5
5
  if (config.renderName) return config.renderName(node, ctx);
6
6
  if (node.type === "page") {
@@ -31,7 +31,14 @@ function llms(input, config = {}) {
31
31
  }
32
32
  function formatNode(node, indent, ctx) {
33
33
  switch (node.type) {
34
- case "page": return formatListItem(formatMarkdownLink(renderName(node, ctx), config.renderUrl?.(node, ctx) ?? node.url), renderDescription(node, ctx), indent);
34
+ case "page": {
35
+ const page = ctx.markdown && ctx.loader.getNodePage(node, ctx.lang);
36
+ if (page && filter(page)) node = {
37
+ ...node,
38
+ url: markdownPath(page.url)
39
+ };
40
+ return formatListItem(formatMarkdownLink(renderName(node, ctx), config.renderUrl?.(node, ctx) ?? node.url), renderDescription(node, ctx), indent);
41
+ }
35
42
  case "folder": {
36
43
  const out = [];
37
44
  out.push(formatListItem(renderName(node, ctx), renderDescription(node, ctx), indent));
@@ -42,16 +49,16 @@ function llms(input, config = {}) {
42
49
  case "separator": return "\n" + formatListItem(`**${renderName(node, ctx) || "Separator"}**`, "", indent);
43
50
  }
44
51
  }
45
- function formatIndex(loader, lang) {
52
+ function formatIndex(ctx) {
53
+ const { loader, lang } = ctx;
46
54
  if (loader._i18n && lang === void 0) {
47
55
  const out = [];
48
- for (const language of loader._i18n.languages) out.push(formatIndex(loader, language));
56
+ for (const language of loader._i18n.languages) out.push(formatIndex({
57
+ ...ctx,
58
+ lang: language
59
+ }));
49
60
  return out.join("\n\n");
50
61
  }
51
- const ctx = {
52
- lang,
53
- loader
54
- };
55
62
  const pageTree = loader.getPageTree(lang);
56
63
  const out = [];
57
64
  out.push(`# ${renderName(pageTree, ctx)}`, "");
@@ -64,12 +71,50 @@ function llms(input, config = {}) {
64
71
  if (!config.renderPage) throw new Error("`renderPage` is required by `page()` and `full()`, see llms() options.");
65
72
  return config.renderPage(page);
66
73
  }
74
+ async function renderPages(pages) {
75
+ return (await Promise.all(pages.map(renderPage))).join("\n\n");
76
+ }
77
+ const getPages = (loader, lang) => loader.getPages(lang).filter(filter);
67
78
  function withLoader(render) {
68
79
  if (typeof input === "function") return Promise.resolve(input()).then(render);
69
80
  return render(input);
70
81
  }
82
+ async function renderFile(loader, path, lang) {
83
+ if (path === "/llms.txt") {
84
+ let text = formatIndex({
85
+ loader,
86
+ lang,
87
+ markdown: true
88
+ });
89
+ const dirs = sections(getPages(loader, lang));
90
+ if (dirs.size > 0) text += "\n\n## Sections\n";
91
+ for (const dir of dirs.keys()) {
92
+ const item = {
93
+ type: "page",
94
+ name: dir,
95
+ url: `${dir}/llms-full.txt`
96
+ };
97
+ text += `\n- ${formatMarkdownLink(dir, config.renderUrl?.(item, { lang }) ?? item.url)}`;
98
+ }
99
+ return text;
100
+ }
101
+ if (path === "/llms-full.txt") return renderPages(getPages(loader, lang));
102
+ if (path.endsWith("/llms-full.txt")) {
103
+ const dirPages = sections(getPages(loader, lang)).get(path.slice(0, -14));
104
+ return dirPages && renderPages(dirPages);
105
+ }
106
+ if (path.endsWith(".md")) {
107
+ let url = path.slice(0, -3).replace(/(.)\/$/, "$1");
108
+ if (url === "/index") url = "/";
109
+ const page = loader.getPageByUrl(url, lang) ?? loader.getPageByUrl(`${url}/`, lang);
110
+ if (page && filter(page)) return renderPage(page);
111
+ }
112
+ }
71
113
  return {
72
- index: (lang) => withLoader((loader) => formatIndex(loader, lang)),
114
+ index: (lang) => withLoader((loader) => formatIndex({
115
+ loader,
116
+ lang
117
+ })),
73
118
  indexNode: (node, lang) => withLoader((loader) => formatNode(node, 0, {
74
119
  lang,
75
120
  loader
@@ -78,13 +123,48 @@ function llms(input, config = {}) {
78
123
  return renderPage(page);
79
124
  },
80
125
  async full(lang) {
81
- const loader = typeof input === "function" ? await input() : input;
82
- const rendered = [];
83
- for (const page of loader.getPages(lang)) rendered.push(renderPage(page));
84
- return (await Promise.all(rendered)).join("\n\n");
126
+ return withLoader((loader) => renderPages(getPages(loader, lang)));
127
+ },
128
+ async files(lang) {
129
+ return withLoader((loader) => {
130
+ const pages = getPages(loader, lang);
131
+ const out = /* @__PURE__ */ new Set(["/llms.txt", "/llms-full.txt"]);
132
+ for (const page of pages) out.add(markdownPath(page.url));
133
+ for (const dir of sections(pages).keys()) out.add(`${dir}/llms-full.txt`);
134
+ return Array.from(out);
135
+ });
136
+ },
137
+ async serve(path, lang) {
138
+ if (!/\.(md|txt)$/.test(path)) return;
139
+ return withLoader(async (loader) => {
140
+ const encoded = encodeURI(path);
141
+ const text = await renderFile(loader, path, lang) ?? (encoded === path ? void 0 : await renderFile(loader, encoded, lang));
142
+ if (text === void 0) return;
143
+ return new Response(text, { headers: { "Content-Type": `${path.endsWith(".md") ? "text/markdown" : "text/plain"}; charset=utf-8` } });
144
+ });
85
145
  }
86
146
  };
87
147
  }
148
+ /** the URL directories with two or more pages, and their pages */
149
+ function sections(pages) {
150
+ const dirs = /* @__PURE__ */ new Map();
151
+ for (const page of pages) {
152
+ const url = page.url.replace(/\/$/, "");
153
+ if (!url.startsWith("/")) continue;
154
+ for (let end = url.length; end > 0; end = url.lastIndexOf("/", end - 1)) {
155
+ const dir = url.slice(0, end);
156
+ const list = dirs.get(dir);
157
+ if (list) list.push(page);
158
+ else dirs.set(dir, [page]);
159
+ }
160
+ }
161
+ for (const [dir, list] of dirs) if (list.length < 2) dirs.delete(dir);
162
+ return dirs;
163
+ }
164
+ /** the path of the `.md` file of a page: `<page>.md`, `/index.md` for `/` */
165
+ function markdownPath(url) {
166
+ return url === "/" ? "/index.md" : `${url.replace(/\/$/, "")}.md`;
167
+ }
88
168
  function formatMarkdownLink(title, url) {
89
169
  return `[${title.replace(/([[\]])/g, "\\$1")}](${url.replace(/([()])/g, "\\$1")})`;
90
170
  }
@@ -1,4 +1,4 @@
1
- import { O as LoaderPlugin } from "../../index-xpLrpK8K.js";
1
+ import { O as LoaderPlugin } from "../../index-DqVvRMMI.js";
2
2
  import { icons } from "lucide-react";
3
3
  /**
4
4
  * Convert icon names into Lucide Icons, requires `lucide-react` to be installed.
@@ -1,2 +1,2 @@
1
- import { B as slugsPlugin, I as SlugFn, L as SlugsPluginOptions, R as getSlugs, z as slugsFromData } from "../../index-xpLrpK8K.js";
1
+ import { B as slugsPlugin, I as SlugFn, L as SlugsPluginOptions, R as getSlugs, z as slugsFromData } from "../../index-DqVvRMMI.js";
2
2
  export { SlugFn, SlugsPluginOptions, getSlugs, slugsFromData, slugsPlugin };
@@ -15,7 +15,7 @@ function slugsPlugin(optsOrFn = {}) {
15
15
  name: "fumadocs:slugs",
16
16
  transformStorage({ storage }) {
17
17
  const indexFiles = [];
18
- const taken = /* @__PURE__ */ new Set();
18
+ const taken = /* @__PURE__ */ new Map();
19
19
  for (const [path, file] of storage.files) {
20
20
  if (file.format !== "page") continue;
21
21
  if (file.slugs) {
@@ -31,8 +31,8 @@ function slugsPlugin(optsOrFn = {}) {
31
31
  }
32
32
  file.slugs = generateSlugs(path, file);
33
33
  const key = file.slugs.join("/");
34
- if (taken.has(key)) throw new Error(`Duplicated slugs: ${key}`);
35
- taken.add(key);
34
+ if (taken.has(key)) throw new Error(`Duplicated slugs "${key}" of ${taken.get(key)} and ${path}`);
35
+ taken.set(key, path);
36
36
  }
37
37
  for (const path of indexFiles) {
38
38
  const file = storage.read(path);
@@ -40,8 +40,8 @@ function slugsPlugin(optsOrFn = {}) {
40
40
  file.slugs = generateSlugs(path, file);
41
41
  if (taken.has(file.slugs.join("/"))) file.slugs = [...file.slugs, "index"];
42
42
  const key = file.slugs.join("/");
43
- if (taken.has(key)) throw new Error(`Duplicated slugs: ${key}`);
44
- taken.add(key);
43
+ if (taken.has(key)) throw new Error(`Duplicated slugs "${key}" of ${taken.get(key)} and ${path}`);
44
+ taken.set(key, path);
45
45
  }
46
46
  }
47
47
  };
@@ -1,4 +1,4 @@
1
- import { O as LoaderPlugin } from "../../index-xpLrpK8K.js";
1
+ import { O as LoaderPlugin } from "../../index-DqVvRMMI.js";
2
2
  import { a as Separator$1, n as Item$1, t as Folder$1 } from "../../definitions-BQVehOBz.js";
3
3
  import { ReactNode } from "react";
4
4
  export interface Item extends Item$1 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.19.0",
3
+ "version": "16.19.1",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",
@@ -147,7 +147,7 @@
147
147
  "@modelcontextprotocol/server": "2.4.0",
148
148
  "@orama/core": "^1.2.19",
149
149
  "@oramacloud/client": "^2.1.4",
150
- "@pierre/highlights": "^0.4.0",
150
+ "@pierre/highlights": "^0.5.0",
151
151
  "@shikijs/transformers": "^4.6.0",
152
152
  "@tanstack/react-router": "1.170.46",
153
153
  "@types/estree-jsx": "^1.0.5",
@@ -156,12 +156,12 @@
156
156
  "@types/node": "26.6.6",
157
157
  "@types/react": "^19.3.0",
158
158
  "@types/react-dom": "^19.3.0",
159
- "algoliasearch": "5.61.0",
159
+ "algoliasearch": "5.64.0",
160
160
  "flexsearch": "^0.8.212",
161
161
  "hast-util-to-jsx-runtime": "^2.3.7",
162
- "lucide-react": "^1.70.0",
163
- "meilisearch": "0.62.0",
164
- "next": "16.4.5",
162
+ "lucide-react": "^1.71.0",
163
+ "meilisearch": "0.63.0",
164
+ "next": "16.4.6",
165
165
  "path-to-regexp": "^9.0.0",
166
166
  "react-router": "^8.5.1",
167
167
  "rehype-raw": "^7.0.0",
@@ -1,2 +0,0 @@
1
- import remarkGfm$1, { Options as RemarkGfmOptions } from "remark-gfm";
2
- export { remarkGfm$1 as n, RemarkGfmOptions as t };