fumadocs-mdx 14.3.1 → 15.0.0

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 (103) hide show
  1. package/dist/{adapter-DB1MHK9h.js → adapter-CYY_UTJ_.mjs} +2 -4
  2. package/dist/{bin.js → bin.mjs} +2 -4
  3. package/dist/{build-DPafU2lu.js → build-B3dze-Gy.mjs} +1 -3
  4. package/dist/build-mdx-CzPhxxK5.mjs +135 -0
  5. package/dist/{build-mdx-YyRh-ZGV.d.ts → build-mdx-D96HeA9c.d.mts} +1 -2
  6. package/dist/bun/{index.d.ts → index.d.mts} +2 -3
  7. package/dist/bun/{index.js → index.mjs} +5 -7
  8. package/dist/{codegen-B8EhLmbU.js → codegen-DWIpa-dn.mjs} +0 -2
  9. package/dist/config/index.d.mts +2 -0
  10. package/dist/config/index.mjs +37 -0
  11. package/dist/{core-B0lF760L.js → core-p4b5Z4gI.mjs} +7 -3
  12. package/dist/{core-DzcubDJt.d.ts → core-xVRMIMfX.d.mts} +26 -28
  13. package/dist/{index-BIbaPT3v.d.ts → index-BbjEFpj3.d.mts} +1 -2
  14. package/dist/{index-file-eVlUbKSO.js → index-file-CwcdorGV.mjs} +1 -3
  15. package/dist/{index.d.ts → index.d.mts} +2 -2
  16. package/dist/{load-from-file-C1DDNVwF.js → load-from-file-BT-JZa0P.mjs} +3 -5
  17. package/dist/{loaders-ezSYYkT7.js → loaders-D1D2IY_F.mjs} +0 -2
  18. package/dist/{mdx-D2vcWdqv.js → mdx-DBRSrYL3.mjs} +2 -4
  19. package/dist/{meta-B6guI74I.js → meta-BB21ElqG.mjs} +1 -3
  20. package/dist/next/{index.d.ts → index.d.mts} +2 -3
  21. package/dist/next/{index.js → index.mjs} +9 -11
  22. package/dist/node/_loader.d.mts +8 -0
  23. package/dist/node/_loader.mjs +34 -0
  24. package/dist/node/index.d.mts +12 -0
  25. package/dist/node/index.mjs +7 -0
  26. package/dist/node/{loader.d.ts → loader.d.mts} +4 -2
  27. package/dist/node/{loader.js → loader.mjs} +7 -6
  28. package/dist/plugins/{index-file.d.ts → index-file.d.mts} +1 -1
  29. package/dist/plugins/index-file.mjs +2 -0
  30. package/dist/plugins/{json-schema.d.ts → json-schema.d.mts} +2 -3
  31. package/dist/plugins/{json-schema.js → json-schema.mjs} +0 -2
  32. package/dist/plugins/{last-modified.d.ts → last-modified.d.mts} +2 -3
  33. package/dist/plugins/{last-modified.js → last-modified.mjs} +1 -3
  34. package/dist/{preset-B0H8HalE.js → preset-D9gSxA4n.mjs} +0 -2
  35. package/dist/{remark-include-VDoXZSBN.js → remark-include-D7W3bva3.mjs} +0 -2
  36. package/dist/runtime/{browser.d.ts → browser.d.mts} +4 -5
  37. package/dist/runtime/{browser.js → browser.mjs} +0 -2
  38. package/dist/runtime/{dynamic.d.ts → dynamic.d.mts} +3 -4
  39. package/dist/runtime/{dynamic.js → dynamic.mjs} +4 -6
  40. package/dist/runtime/{server.d.ts → server.d.mts} +1 -1
  41. package/dist/runtime/{server.js → server.mjs} +0 -2
  42. package/dist/runtime/{types.d.ts → types.d.mts} +1 -1
  43. package/dist/{types-hAduruLB.d.ts → types-DzvjnGdV.d.mts} +1 -2
  44. package/dist/vite/{index.d.ts → index.d.mts} +3 -4
  45. package/dist/vite/{index.js → index.mjs} +8 -10
  46. package/dist/webpack/mdx.d.mts +7 -0
  47. package/dist/webpack/{mdx.js → mdx.mjs} +7 -8
  48. package/dist/webpack/meta.d.mts +7 -0
  49. package/dist/webpack/{meta.js → meta.mjs} +7 -8
  50. package/dist/{webpack-DmRbt96H.js → webpack-B40ig_De.mjs} +1 -3
  51. package/package.json +34 -35
  52. package/dist/adapter-DB1MHK9h.js.map +0 -1
  53. package/dist/bin.js.map +0 -1
  54. package/dist/build-DPafU2lu.js.map +0 -1
  55. package/dist/build-mdx-82nyqL4J.js +0 -307
  56. package/dist/build-mdx-82nyqL4J.js.map +0 -1
  57. package/dist/build-mdx-YyRh-ZGV.d.ts.map +0 -1
  58. package/dist/bun/index.d.ts.map +0 -1
  59. package/dist/bun/index.js.map +0 -1
  60. package/dist/codegen-B8EhLmbU.js.map +0 -1
  61. package/dist/config/index.d.ts +0 -2
  62. package/dist/config/index.js +0 -57
  63. package/dist/config/index.js.map +0 -1
  64. package/dist/core-B0lF760L.js.map +0 -1
  65. package/dist/core-DzcubDJt.d.ts.map +0 -1
  66. package/dist/index-BIbaPT3v.d.ts.map +0 -1
  67. package/dist/index-file-eVlUbKSO.js.map +0 -1
  68. package/dist/load-from-file-C1DDNVwF.js.map +0 -1
  69. package/dist/loaders-ezSYYkT7.js.map +0 -1
  70. package/dist/mdx-D2vcWdqv.js.map +0 -1
  71. package/dist/meta-B6guI74I.js.map +0 -1
  72. package/dist/next/index.d.ts.map +0 -1
  73. package/dist/next/index.js.map +0 -1
  74. package/dist/node/loader.d.ts.map +0 -1
  75. package/dist/node/loader.js.map +0 -1
  76. package/dist/plugins/index-file.js +0 -2
  77. package/dist/plugins/json-schema.d.ts.map +0 -1
  78. package/dist/plugins/json-schema.js.map +0 -1
  79. package/dist/plugins/last-modified.d.ts.map +0 -1
  80. package/dist/plugins/last-modified.js.map +0 -1
  81. package/dist/preset-B0H8HalE.js.map +0 -1
  82. package/dist/remark-include-VDoXZSBN.js.map +0 -1
  83. package/dist/runtime/browser.d.ts.map +0 -1
  84. package/dist/runtime/browser.js.map +0 -1
  85. package/dist/runtime/dynamic.d.ts.map +0 -1
  86. package/dist/runtime/dynamic.js.map +0 -1
  87. package/dist/runtime/server.js.map +0 -1
  88. package/dist/types-hAduruLB.d.ts.map +0 -1
  89. package/dist/vite/index.d.ts.map +0 -1
  90. package/dist/vite/index.js.map +0 -1
  91. package/dist/webpack/mdx.d.ts +0 -8
  92. package/dist/webpack/mdx.d.ts.map +0 -1
  93. package/dist/webpack/mdx.js.map +0 -1
  94. package/dist/webpack/meta.d.ts +0 -8
  95. package/dist/webpack/meta.d.ts.map +0 -1
  96. package/dist/webpack/meta.js.map +0 -1
  97. package/dist/webpack-DmRbt96H.js.map +0 -1
  98. package/loader-mdx.cjs +0 -5
  99. package/loader-meta.cjs +0 -5
  100. /package/dist/{bin.d.ts → bin.d.mts} +0 -0
  101. /package/dist/{index.js → index.mjs} +0 -0
  102. /package/dist/{rolldown-runtime-CiIaOW0V.js → rolldown-runtime-wcPFST8Q.mjs} +0 -0
  103. /package/dist/runtime/{types.js → types.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import { r as ValidationError } from "./core-B0lF760L.js";
2
- import { t as loadConfig } from "./load-from-file-C1DDNVwF.js";
1
+ import { r as ValidationError } from "./core-p4b5Z4gI.mjs";
2
+ import { t as loadConfig } from "./load-from-file-BT-JZa0P.mjs";
3
3
  import { readFileSync } from "node:fs";
4
4
  import fs from "node:fs/promises";
5
5
  import { fileURLToPath } from "node:url";
@@ -137,5 +137,3 @@ function toBun(loader) {
137
137
  }
138
138
  //#endregion
139
139
  export { createIntegratedConfigLoader as a, toWebpack as i, toNode as n, createStandaloneConfigLoader as o, toVite as r, toBun as t };
140
-
141
- //# sourceMappingURL=adapter-DB1MHK9h.js.map
@@ -4,13 +4,13 @@ import { existsSync } from "node:fs";
4
4
  async function start() {
5
5
  const [configPath, outDir] = process.argv.slice(2);
6
6
  if (existsSync("next.config.js") || existsSync("next.config.mjs") || existsSync("next.config.mts") || existsSync("next.config.ts")) {
7
- const { postInstall } = await import("./next/index.js");
7
+ const { postInstall } = await import("./next/index.mjs");
8
8
  await postInstall({
9
9
  configPath,
10
10
  outDir
11
11
  });
12
12
  } else {
13
- const { postInstall } = await import("./vite/index.js");
13
+ const { postInstall } = await import("./vite/index.mjs");
14
14
  await postInstall({
15
15
  configPath,
16
16
  outDir
@@ -20,5 +20,3 @@ async function start() {
20
20
  start();
21
21
  //#endregion
22
22
  export {};
23
-
24
- //# sourceMappingURL=bin.js.map
@@ -1,4 +1,4 @@
1
- import { t as applyMdxPreset } from "./preset-B0H8HalE.js";
1
+ import { t as applyMdxPreset } from "./preset-D9gSxA4n.mjs";
2
2
  import path from "node:path";
3
3
  import picomatch from "picomatch";
4
4
  //#region src/config/build.ts
@@ -95,5 +95,3 @@ function buildConfig(config, cwd = process.cwd()) {
95
95
  }
96
96
  //#endregion
97
97
  export { buildConfig as t };
98
-
99
- //# sourceMappingURL=build-DPafU2lu.js.map
@@ -0,0 +1,135 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
+ import { n as flattenNode, t as remarkInclude } from "./remark-include-D7W3bva3.mjs";
3
+ import { visit } from "unist-util-visit";
4
+ import { VFile } from "vfile";
5
+ import { createProcessor } from "@mdx-js/mdx";
6
+ import { valueToEstree } from "estree-util-value-to-estree";
7
+ import { removePosition } from "unist-util-remove-position";
8
+ import { remarkLLMs } from "fumadocs-core/mdx-plugins/remark-llms";
9
+ //#region src/loaders/mdx/remark-postprocess.ts
10
+ /**
11
+ * - collect references
12
+ * - write frontmatter (auto-title & description)
13
+ */
14
+ function remarkPostprocess({ includeProcessedMarkdown = false, includeMDAST = false, extractLinkReferences = false, valueToExport = [] }) {
15
+ return (tree, file) => {
16
+ const frontmatter = file.data.frontmatter ??= {};
17
+ if (!frontmatter.title) visit(tree, "heading", (node) => {
18
+ if (node.depth === 1) {
19
+ frontmatter.title = flattenNode(node);
20
+ return false;
21
+ }
22
+ });
23
+ file.data["mdx-export"] ??= [];
24
+ file.data["mdx-export"].push({
25
+ name: "frontmatter",
26
+ value: frontmatter
27
+ });
28
+ if (extractLinkReferences) {
29
+ const urls = [];
30
+ visit(tree, "link", (node) => {
31
+ urls.push({ href: node.url });
32
+ return "skip";
33
+ });
34
+ file.data["mdx-export"].push({
35
+ name: "extractedReferences",
36
+ value: urls
37
+ });
38
+ }
39
+ if (includeProcessedMarkdown) remarkLLMs.call(this, typeof includeProcessedMarkdown === "object" ? includeProcessedMarkdown : void 0)(tree, file, () => void 0);
40
+ if (includeMDAST) {
41
+ const mdast = JSON.stringify((includeMDAST === true ? {} : includeMDAST).removePosition ? removePosition(structuredClone(tree)) : tree);
42
+ file.data["mdx-export"].push({
43
+ name: "_mdast",
44
+ value: mdast
45
+ });
46
+ }
47
+ for (const { name, value } of file.data["mdx-export"]) tree.children.unshift(getMdastExport(name, value));
48
+ file.data["mdx-export"] = [];
49
+ for (const name of valueToExport) {
50
+ if (!(name in file.data)) continue;
51
+ tree.children.unshift(getMdastExport(name, file.data[name]));
52
+ }
53
+ };
54
+ }
55
+ /**
56
+ * MDX.js first converts javascript (with esm support) into mdast nodes with remark-mdx, then handle the other remark plugins
57
+ *
58
+ * Therefore, if we want to inject an export, we must convert the object into AST, then add the mdast node
59
+ */
60
+ function getMdastExport(name, value) {
61
+ return {
62
+ type: "mdxjsEsm",
63
+ value: "",
64
+ data: { estree: {
65
+ type: "Program",
66
+ sourceType: "module",
67
+ body: [{
68
+ type: "ExportNamedDeclaration",
69
+ attributes: [],
70
+ specifiers: [],
71
+ source: null,
72
+ declaration: {
73
+ type: "VariableDeclaration",
74
+ kind: "let",
75
+ declarations: [{
76
+ type: "VariableDeclarator",
77
+ id: {
78
+ type: "Identifier",
79
+ name
80
+ },
81
+ init: valueToEstree(value)
82
+ }]
83
+ }
84
+ }]
85
+ } }
86
+ };
87
+ }
88
+ //#endregion
89
+ //#region src/loaders/mdx/build-mdx.ts
90
+ var build_mdx_exports = /* @__PURE__ */ __exportAll({ buildMDX: () => buildMDX });
91
+ async function buildMDX(core, collection, { filePath, frontmatter, source, _compiler, environment, isDevelopment }) {
92
+ const mdxOptions = await core.getConfig().getMDXOptions(collection, environment);
93
+ function getProcessor(format) {
94
+ const cache = core.cache;
95
+ const key = `build-mdx:${collection?.name ?? "global"}:${format}`;
96
+ let processor = cache.get(key);
97
+ if (!processor) {
98
+ const postprocessOptions = {
99
+ _format: format,
100
+ ...collection?.postprocess
101
+ };
102
+ processor = createProcessor({
103
+ outputFormat: "program",
104
+ development: isDevelopment,
105
+ ...mdxOptions,
106
+ remarkPlugins: [
107
+ remarkInclude,
108
+ ...mdxOptions.remarkPlugins ?? [],
109
+ [remarkPostprocess, postprocessOptions]
110
+ ],
111
+ format
112
+ });
113
+ cache.set(key, processor);
114
+ }
115
+ return processor;
116
+ }
117
+ let vfile = new VFile({
118
+ value: source,
119
+ path: filePath,
120
+ cwd: collection?.cwd,
121
+ data: {
122
+ frontmatter,
123
+ _compiler,
124
+ _getProcessor: getProcessor
125
+ }
126
+ });
127
+ if (collection) vfile = await core.transformVFile({
128
+ collection,
129
+ filePath,
130
+ source
131
+ }, vfile);
132
+ return getProcessor(filePath.endsWith(".mdx") ? "mdx" : "md").process(vfile);
133
+ }
134
+ //#endregion
135
+ export { build_mdx_exports as n, buildMDX as t };
@@ -49,5 +49,4 @@ declare module 'vfile' {
49
49
  interface DataMap extends FumadocsDataMap {}
50
50
  }
51
51
  //#endregion
52
- export { CompiledMDXProperties as t };
53
- //# sourceMappingURL=build-mdx-YyRh-ZGV.d.ts.map
52
+ export { CompiledMDXProperties as t };
@@ -1,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-DzcubDJt.js";
1
+ import { r as CoreOptions } from "../core-xVRMIMfX.mjs";
2
2
  import { BunPlugin } from "bun";
3
3
 
4
4
  //#region src/bun/index.d.ts
@@ -10,5 +10,4 @@ interface MdxPluginOptions extends Partial<CoreOptions> {
10
10
  }
11
11
  declare function createMdxPlugin(options?: MdxPluginOptions): BunPlugin;
12
12
  //#endregion
13
- export { MdxPluginOptions, createMdxPlugin };
14
- //# sourceMappingURL=index.d.ts.map
13
+ export { MdxPluginOptions, createMdxPlugin };
@@ -1,8 +1,8 @@
1
- import { t as createMdxLoader } from "../mdx-D2vcWdqv.js";
2
- import { t as buildConfig } from "../build-DPafU2lu.js";
3
- import { n as createCore, t as _Defaults } from "../core-B0lF760L.js";
4
- import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-DB1MHK9h.js";
5
- import { t as createMetaLoader } from "../meta-B6guI74I.js";
1
+ import { t as createMdxLoader } from "../mdx-DBRSrYL3.mjs";
2
+ import { t as buildConfig } from "../build-B3dze-Gy.mjs";
3
+ import { n as createCore, t as _Defaults } from "../core-p4b5Z4gI.mjs";
4
+ import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-CYY_UTJ_.mjs";
5
+ import { t as createMetaLoader } from "../meta-BB21ElqG.mjs";
6
6
  import { pathToFileURL } from "node:url";
7
7
  //#region src/bun/index.ts
8
8
  function createMdxPlugin(options = {}) {
@@ -25,5 +25,3 @@ function createMdxPlugin(options = {}) {
25
25
  }
26
26
  //#endregion
27
27
  export { createMdxPlugin };
28
-
29
- //# sourceMappingURL=index.js.map
@@ -96,5 +96,3 @@ function ident(code, tab = 1) {
96
96
  }
97
97
  //#endregion
98
98
  export { ident as n, slash as r, createCodegen as t };
99
-
100
- //# sourceMappingURL=codegen-B8EhLmbU.js.map
@@ -0,0 +1,2 @@
1
+ import { A as DocCollection, B as MDXPresetOptions, D as AnyCollection, E as remarkInclude, F as defineConfig, I as defineDocs, M as GlobalConfig, N as MetaCollection, O as BaseCollection, P as defineCollections, R as PostprocessOptions, T as metaSchema, V as applyMdxPreset, j as DocsCollection, k as CollectionSchema, w as frontmatterSchema, z as DefaultMDXOptions } from "../core-xVRMIMfX.mjs";
2
+ export { AnyCollection, BaseCollection, CollectionSchema, DefaultMDXOptions, DocCollection, DocsCollection, GlobalConfig, MDXPresetOptions, MetaCollection, PostprocessOptions, applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
@@ -0,0 +1,37 @@
1
+ import { t as applyMdxPreset } from "../preset-D9gSxA4n.mjs";
2
+ import { t as remarkInclude } from "../remark-include-D7W3bva3.mjs";
3
+ import { metaSchema as metaSchema$1, pageSchema } from "fumadocs-core/source/schema";
4
+ //#region src/config/define.ts
5
+ function defineCollections(options) {
6
+ return options;
7
+ }
8
+ function defineDocs(options) {
9
+ const dir = options.dir ?? "content/docs";
10
+ return {
11
+ type: "docs",
12
+ dir,
13
+ docs: defineCollections({
14
+ type: "doc",
15
+ dir,
16
+ schema: pageSchema,
17
+ ...options?.docs
18
+ }),
19
+ meta: defineCollections({
20
+ type: "meta",
21
+ dir,
22
+ schema: metaSchema$1,
23
+ ...options?.meta
24
+ })
25
+ };
26
+ }
27
+ function defineConfig(config = {}) {
28
+ return config;
29
+ }
30
+ //#endregion
31
+ //#region src/config/index.ts
32
+ /** @deprecated import `pageSchema` from `fumadocs-core/source/schema` instead (since 16.2.3) */
33
+ const frontmatterSchema = pageSchema;
34
+ /** @deprecated import from `fumadocs-core/source/schema` instead (since 16.2.3) */
35
+ const metaSchema = metaSchema$1;
36
+ //#endregion
37
+ export { applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
@@ -1,4 +1,4 @@
1
- import { n as ident } from "./codegen-B8EhLmbU.js";
1
+ import { n as ident } from "./codegen-DWIpa-dn.mjs";
2
2
  import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  //#region src/utils/validation.ts
@@ -50,6 +50,9 @@ function createCore(options) {
50
50
  return data;
51
51
  }
52
52
  return {
53
+ /**
54
+ * Convenient cache store, reset when config changes
55
+ */
53
56
  cache: /* @__PURE__ */ new Map(),
54
57
  async init({ config: newConfig }) {
55
58
  config = await newConfig;
@@ -87,6 +90,9 @@ function createCore(options) {
87
90
  getConfig() {
88
91
  return config;
89
92
  },
93
+ /**
94
+ * The file path of compiled config file, the file may not exist (e.g. on Vite, or still compiling)
95
+ */
90
96
  getCompiledConfigPath() {
91
97
  return path.join(options.outDir, "source.config.mjs");
92
98
  },
@@ -206,5 +212,3 @@ function postprocessPlugin() {
206
212
  }
207
213
  //#endregion
208
214
  export { createCore as n, ValidationError as r, _Defaults as t };
209
-
210
- //# sourceMappingURL=core-B0lF760L.js.map
@@ -1,5 +1,7 @@
1
- import { a as MetaMethods, i as InternalTypeConfig, n as DocMethods, t as DocData } from "./types-hAduruLB.js";
2
- import { z } from "zod";
1
+ import { a as MetaMethods, i as InternalTypeConfig, n as DocMethods, t as DocData } from "./types-DzvjnGdV.mjs";
2
+ import * as _$zod from "zod";
3
+ import * as _$fumadocs_core_source_schema0 from "fumadocs-core/source/schema";
4
+ import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
3
5
  import { Pluggable, Processor, Transformer } from "unified";
4
6
  import * as Plugins from "fumadocs-core/mdx-plugins";
5
7
  import { LLMsOptions } from "fumadocs-core/mdx-plugins";
@@ -9,6 +11,7 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
9
11
  import { Root } from "mdast";
10
12
  import { FSWatcher } from "chokidar";
11
13
  import { MetaData, PageData, Source } from "fumadocs-core/source";
14
+ import * as _$zod_v4_core0 from "zod/v4/core";
12
15
 
13
16
  //#region src/config/preset.d.ts
14
17
  type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
@@ -36,30 +39,6 @@ type MDXPresetOptions = ({
36
39
  */
37
40
  declare function applyMdxPreset(options?: MDXPresetOptions): (environment: BuildEnvironment) => Promise<ProcessorOptions>;
38
41
  //#endregion
39
- //#region ../core/dist/source/schema.d.ts
40
- /**
41
- * Zod 4 schema
42
- */
43
- declare const metaSchema: z.ZodObject<{
44
- title: z.ZodOptional<z.ZodString>;
45
- pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
- description: z.ZodOptional<z.ZodString>;
47
- root: z.ZodOptional<z.ZodBoolean>;
48
- defaultOpen: z.ZodOptional<z.ZodBoolean>;
49
- collapsible: z.ZodOptional<z.ZodBoolean>;
50
- icon: z.ZodOptional<z.ZodString>;
51
- }, z.core.$strip>;
52
- /**
53
- * Zod 4 schema
54
- */
55
- declare const pageSchema: z.ZodObject<{
56
- title: z.ZodString;
57
- description: z.ZodOptional<z.ZodString>;
58
- icon: z.ZodOptional<z.ZodString>;
59
- full: z.ZodOptional<z.ZodBoolean>;
60
- _openapi: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
61
- }, z.core.$strip>;
62
- //#endregion
63
42
  //#region src/loaders/mdx/remark-postprocess.d.ts
64
43
  interface ExtractedReference {
65
44
  href: string;
@@ -195,6 +174,26 @@ interface DocsCollectionItem extends Omit<DocsCollection, 'dir' | 'meta' | 'docs
195
174
  //#region src/loaders/mdx/remark-include.d.ts
196
175
  declare function remarkInclude(this: Processor): Transformer<Root, Root>;
197
176
  //#endregion
177
+ //#region src/config/index.d.ts
178
+ /** @deprecated import `pageSchema` from `fumadocs-core/source/schema` instead (since 16.2.3) */
179
+ declare const frontmatterSchema: _$zod.ZodObject<{
180
+ title: _$zod.ZodString;
181
+ description: _$zod.ZodOptional<_$zod.ZodString>;
182
+ icon: _$zod.ZodOptional<_$zod.ZodString>;
183
+ full: _$zod.ZodOptional<_$zod.ZodBoolean>;
184
+ _openapi: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodCustom<_$fumadocs_core_source_schema0._JSONType, _$fumadocs_core_source_schema0._JSONType>>>;
185
+ }, _$zod_v4_core0.$strip>;
186
+ /** @deprecated import from `fumadocs-core/source/schema` instead (since 16.2.3) */
187
+ declare const metaSchema$1: _$zod.ZodObject<{
188
+ title: _$zod.ZodOptional<_$zod.ZodString>;
189
+ pages: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
190
+ description: _$zod.ZodOptional<_$zod.ZodString>;
191
+ root: _$zod.ZodOptional<_$zod.ZodBoolean>;
192
+ defaultOpen: _$zod.ZodOptional<_$zod.ZodBoolean>;
193
+ collapsible: _$zod.ZodOptional<_$zod.ZodBoolean>;
194
+ icon: _$zod.ZodOptional<_$zod.ZodString>;
195
+ }, _$zod_v4_core0.$strip>;
196
+ //#endregion
198
197
  //#region src/runtime/server.d.ts
199
198
  type MetaCollectionEntry<Data> = Data & MetaMethods;
200
199
  type DocCollectionEntry<Name extends string = string, Frontmatter = unknown, TC extends InternalTypeConfig = InternalTypeConfig> = DocData & DocMethods & Frontmatter & TC['DocData'][Name];
@@ -381,5 +380,4 @@ declare function createCore(options: CoreOptions): {
381
380
  };
382
381
  type Core = ReturnType<typeof createCore>;
383
382
  //#endregion
384
- export { GlobalConfig as A, MDXPresetOptions as B, toFumadocsSource as C, CollectionSchema as D, BaseCollection as E, ExtractedReference as F, PostprocessOptions as I, metaSchema as L, defineCollections as M, defineConfig as N, DocCollection as O, defineDocs as P, pageSchema as R, server as S, AnyCollection as T, applyMdxPreset as V, DocCollectionEntry as _, EmitOptions as a, ServerCreate as b, PluginContext as c, TransformOptions as d, IndexFilePlugin as f, AsyncDocsCollectionEntry as g, AsyncDocCollectionEntry as h, EmitEntry as i, MetaCollection as j, DocsCollection as k, PluginOption as l, indexFile as m, Core as n, EmitOutput as o, IndexFilePluginOptions as p, CoreOptions as r, Plugin as s, CompilationContext as t, ServerContext as u, DocsCollectionEntry as v, remarkInclude as w, ServerOptions as x, MetaCollectionEntry as y, DefaultMDXOptions as z };
385
- //# sourceMappingURL=core-DzcubDJt.d.ts.map
383
+ export { DocCollection as A, MDXPresetOptions as B, toFumadocsSource as C, AnyCollection as D, remarkInclude as E, defineConfig as F, defineDocs as I, ExtractedReference as L, GlobalConfig as M, MetaCollection as N, BaseCollection as O, defineCollections as P, PostprocessOptions as R, server as S, metaSchema$1 as T, applyMdxPreset as V, DocCollectionEntry as _, EmitOptions as a, ServerCreate as b, PluginContext as c, TransformOptions as d, IndexFilePlugin as f, AsyncDocsCollectionEntry as g, AsyncDocCollectionEntry as h, EmitEntry as i, DocsCollection as j, CollectionSchema as k, PluginOption as l, indexFile as m, Core as n, EmitOutput as o, IndexFilePluginOptions as p, CoreOptions as r, Plugin as s, CompilationContext as t, ServerContext as u, DocsCollectionEntry as v, frontmatterSchema as w, ServerOptions as x, MetaCollectionEntry as y, DefaultMDXOptions as z };
@@ -6,5 +6,4 @@ interface WebpackLoaderOptions {
6
6
  isDev: boolean;
7
7
  }
8
8
  //#endregion
9
- export { WebpackLoaderOptions as t };
10
- //# sourceMappingURL=index-BIbaPT3v.d.ts.map
9
+ export { WebpackLoaderOptions as t };
@@ -1,4 +1,4 @@
1
- import { n as ident, r as slash, t as createCodegen } from "./codegen-B8EhLmbU.js";
1
+ import { n as ident, r as slash, t as createCodegen } from "./codegen-DWIpa-dn.mjs";
2
2
  import { frontmatter } from "fumadocs-core/content/md/frontmatter";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
@@ -260,5 +260,3 @@ function generateMetaCollectionGlob({ codegen, workspace }, collection, eager =
260
260
  }
261
261
  //#endregion
262
262
  export { indexFile as t };
263
-
264
- //# sourceMappingURL=index-file-eVlUbKSO.js.map
@@ -1,3 +1,3 @@
1
- import { F as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-DzcubDJt.js";
2
- import { t as CompiledMDXProperties } from "./build-mdx-YyRh-ZGV.js";
1
+ import { L as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-xVRMIMfX.mjs";
2
+ import { t as CompiledMDXProperties } from "./build-mdx-D96HeA9c.mjs";
3
3
  export { type CompilationContext, type CompiledMDXProperties, type Core, type CoreOptions, type EmitEntry, type EmitOptions, type EmitOutput, type ExtractedReference, type Plugin, type PluginContext, type PluginOption, type ServerContext, type TransformOptions };
@@ -1,5 +1,5 @@
1
- import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { t as buildConfig } from "./build-DPafU2lu.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
+ import { t as buildConfig } from "./build-B3dze-Gy.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
  //#region src/config/load-from-file.ts
5
5
  var load_from_file_exports = /* @__PURE__ */ __exportAll({ loadConfig: () => loadConfig });
@@ -31,9 +31,7 @@ async function loadConfig(core, build = false) {
31
31
  if (build) await compileConfig(core);
32
32
  const url = pathToFileURL(core.getCompiledConfigPath());
33
33
  url.searchParams.set("hash", Date.now().toString());
34
- return await import(url.href).then((loaded) => buildConfig(loaded));
34
+ return buildConfig(await import(url.href));
35
35
  }
36
36
  //#endregion
37
37
  export { load_from_file_exports as n, loadConfig as t };
38
-
39
- //# sourceMappingURL=load-from-file-C1DDNVwF.js.map
@@ -3,5 +3,3 @@ const metaLoaderGlob = /\.(json|yaml)(\?.+?)?$/;
3
3
  const mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
4
4
  //#endregion
5
5
  export { metaLoaderGlob as n, mdxLoaderGlob as t };
6
-
7
- //# sourceMappingURL=loaders-ezSYYkT7.js.map
@@ -1,4 +1,4 @@
1
- import { t as mdxLoaderGlob } from "./loaders-ezSYYkT7.js";
1
+ import { t as mdxLoaderGlob } from "./loaders-D1D2IY_F.mjs";
2
2
  import { frontmatter } from "fumadocs-core/content/md/frontmatter";
3
3
  import { z } from "zod";
4
4
  import fs from "node:fs/promises";
@@ -58,7 +58,7 @@ function createMdxLoader({ getCore }) {
58
58
  code: `export const frontmatter = ${JSON.stringify(matter.data)}`,
59
59
  map: null
60
60
  };
61
- const { buildMDX } = await import("./build-mdx-82nyqL4J.js").then((n) => n.n);
61
+ const { buildMDX } = await import("./build-mdx-CzPhxxK5.mjs").then((n) => n.n);
62
62
  const compiled = await buildMDX(core, docCollection, {
63
63
  isDevelopment,
64
64
  source: "\n".repeat(countLines(matter.matter)) + matter.content,
@@ -86,5 +86,3 @@ function countLines(s) {
86
86
  }
87
87
  //#endregion
88
88
  export { createMdxLoader as t };
89
-
90
- //# sourceMappingURL=mdx-D2vcWdqv.js.map
@@ -1,4 +1,4 @@
1
- import { n as metaLoaderGlob } from "./loaders-ezSYYkT7.js";
1
+ import { n as metaLoaderGlob } from "./loaders-D1D2IY_F.mjs";
2
2
  import { z } from "zod";
3
3
  import { load } from "js-yaml";
4
4
  //#region src/loaders/meta.ts
@@ -76,5 +76,3 @@ function createMetaLoader({ getCore }, resolve = {}) {
76
76
  }
77
77
  //#endregion
78
78
  export { createMetaLoader as t };
79
-
80
- //# sourceMappingURL=meta-B6guI74I.js.map
@@ -1,4 +1,4 @@
1
- import { p as IndexFilePluginOptions } from "../core-DzcubDJt.js";
1
+ import { p as IndexFilePluginOptions } from "../core-xVRMIMfX.mjs";
2
2
  import { NextConfig } from "next";
3
3
 
4
4
  //#region src/next/index.d.ts
@@ -18,5 +18,4 @@ interface CreateMDXOptions {
18
18
  declare function createMDX(createOptions?: CreateMDXOptions): (nextConfig?: NextConfig) => NextConfig;
19
19
  declare function postInstall(options: CreateMDXOptions): Promise<void>;
20
20
  //#endregion
21
- export { CreateMDXOptions, createMDX, postInstall };
22
- //# sourceMappingURL=index.d.ts.map
21
+ export { CreateMDXOptions, createMDX, postInstall };
@@ -1,7 +1,7 @@
1
- import { n as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-ezSYYkT7.js";
2
- import { n as createCore, t as _Defaults } from "../core-B0lF760L.js";
3
- import { t as loadConfig } from "../load-from-file-C1DDNVwF.js";
4
- import { t as indexFile } from "../index-file-eVlUbKSO.js";
1
+ import { n as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-D1D2IY_F.mjs";
2
+ import { n as createCore, t as _Defaults } from "../core-p4b5Z4gI.mjs";
3
+ import { t as loadConfig } from "../load-from-file-BT-JZa0P.mjs";
4
+ import { t as indexFile } from "../index-file-CwcdorGV.mjs";
5
5
  import * as path$1 from "node:path";
6
6
  //#region src/next/index.ts
7
7
  const defaultPageExtensions = [
@@ -33,21 +33,21 @@ function createMDX(createOptions = {}) {
33
33
  ...nextConfig.turbopack?.rules,
34
34
  "*.{md,mdx}": {
35
35
  loaders: [{
36
- loader: "fumadocs-mdx/loader-mdx",
36
+ loader: "fumadocs-mdx/webpack/mdx",
37
37
  options: loaderOptions
38
38
  }],
39
39
  as: "*.js"
40
40
  },
41
41
  "*.json": {
42
42
  loaders: [{
43
- loader: "fumadocs-mdx/loader-meta",
43
+ loader: "fumadocs-mdx/webpack/meta",
44
44
  options: loaderOptions
45
45
  }],
46
46
  as: "*.json"
47
47
  },
48
48
  "*.yaml": {
49
49
  loaders: [{
50
- loader: "fumadocs-mdx/loader-meta",
50
+ loader: "fumadocs-mdx/webpack/meta",
51
51
  options: loaderOptions
52
52
  }],
53
53
  as: "*.js"
@@ -65,14 +65,14 @@ function createMDX(createOptions = {}) {
65
65
  config.module.rules.push({
66
66
  test: mdxLoaderGlob,
67
67
  use: [options.defaultLoaders.babel, {
68
- loader: "fumadocs-mdx/loader-mdx",
68
+ loader: "fumadocs-mdx/webpack/mdx",
69
69
  options: loaderOptions
70
70
  }]
71
71
  }, {
72
72
  test: metaLoaderGlob,
73
73
  enforce: "pre",
74
74
  use: [{
75
- loader: "fumadocs-mdx/loader-meta",
75
+ loader: "fumadocs-mdx/webpack/meta",
76
76
  options: loaderOptions
77
77
  }]
78
78
  });
@@ -143,5 +143,3 @@ function createNextCore(options) {
143
143
  }
144
144
  //#endregion
145
145
  export { createMDX, postInstall };
146
-
147
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ import { NodeLoaderOptions } from "./index.mjs";
2
+ import { InitializeHook, LoadHook } from "node:module";
3
+
4
+ //#region src/node/_loader.d.ts
5
+ declare const initialize: InitializeHook<NodeLoaderOptions>;
6
+ declare const load: LoadHook;
7
+ //#endregion
8
+ export { initialize, load };
@@ -0,0 +1,34 @@
1
+ import { t as createMdxLoader } from "../mdx-DBRSrYL3.mjs";
2
+ import { n as createCore, t as _Defaults } from "../core-p4b5Z4gI.mjs";
3
+ import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-CYY_UTJ_.mjs";
4
+ import { t as createMetaLoader } from "../meta-BB21ElqG.mjs";
5
+ //#region src/node/_loader.ts
6
+ let cachedLoaders;
7
+ const initialize = (options) => {
8
+ const configLoader = createStandaloneConfigLoader({
9
+ core: createCore({
10
+ environment: "node-loader",
11
+ ...options,
12
+ configPath: options.configPath ?? _Defaults.configPath,
13
+ outDir: options.outDir ?? _Defaults.outDir
14
+ }),
15
+ buildConfig: true,
16
+ mode: "production"
17
+ });
18
+ cachedLoaders = [toNode(createMdxLoader(configLoader))];
19
+ if (!options.disableMetaFile) cachedLoaders.push(toNode(createMetaLoader(configLoader)));
20
+ };
21
+ const load = async (url, context, nextLoad) => {
22
+ if (!cachedLoaders) throw new Error("not initialized");
23
+ const hooks = cachedLoaders;
24
+ function run(i, url, context) {
25
+ if (i >= hooks.length) return nextLoad(url, context);
26
+ return hooks[i](url, context, (url, ctx) => run(i + 1, url, {
27
+ ...context,
28
+ ...ctx
29
+ }));
30
+ }
31
+ return run(0, url, context);
32
+ };
33
+ //#endregion
34
+ export { initialize, load };
@@ -0,0 +1,12 @@
1
+ import { r as CoreOptions } from "../core-xVRMIMfX.mjs";
2
+
3
+ //#region src/node/index.d.ts
4
+ interface NodeLoaderOptions extends Partial<CoreOptions> {
5
+ /**
6
+ * Skip meta file transformation step
7
+ */
8
+ disableMetaFile?: boolean;
9
+ }
10
+ declare function register(options?: NodeLoaderOptions): void;
11
+ //#endregion
12
+ export { NodeLoaderOptions, register };
@@ -0,0 +1,7 @@
1
+ import * as module from "node:module";
2
+ //#region src/node/index.ts
3
+ function register(options = {}) {
4
+ module.register("./_loader.mjs", import.meta.url, { data: options });
5
+ }
6
+ //#endregion
7
+ export { register };
@@ -1,7 +1,9 @@
1
1
  import { LoadHook } from "node:module";
2
2
 
3
3
  //#region src/node/loader.d.ts
4
+ /**
5
+ * @deprecated use the `register()` function from `fumadocs-mdx/node` instead.
6
+ */
4
7
  declare const load: LoadHook;
5
8
  //#endregion
6
- export { load };
7
- //# sourceMappingURL=loader.d.ts.map
9
+ export { load };