fumadocs-mdx 14.3.2 → 15.0.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 (103) hide show
  1. package/dist/{adapter-DVxULZiU.js → adapter-DK590Mfe.mjs} +2 -4
  2. package/dist/{bin.js → bin.mjs} +2 -4
  3. package/dist/{build-DPafU2lu.js → build-C6DvTt9a.mjs} +1 -3
  4. package/dist/{build-mdx-YyRh-ZGV.d.ts → build-mdx-D96HeA9c.d.mts} +1 -2
  5. package/dist/build-mdx-YbGh3ny7.mjs +135 -0
  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-CWSx5M_o.mjs} +0 -2
  9. package/dist/config/{index.d.ts → index.d.mts} +1 -1
  10. package/dist/config/{index.js → index.mjs} +3 -29
  11. package/dist/{core-Wd5WdPN4.js → core-CA-_77fa.mjs} +1 -3
  12. package/dist/{core-C5aAAT92.d.ts → core-xVRMIMfX.d.mts} +7 -31
  13. package/dist/{index-BIbaPT3v.d.ts → index-BbjEFpj3.d.mts} +1 -2
  14. package/dist/{index-file-eVlUbKSO.js → index-file-Bay9epxY.mjs} +1 -3
  15. package/dist/{index.d.ts → index.d.mts} +2 -2
  16. package/dist/load-from-file-D0UVwCFc.mjs +2 -0
  17. package/dist/{load-from-file-C1DDNVwF.js → load-from-file-f1KkukxD.mjs} +3 -7
  18. package/dist/{loaders-ezSYYkT7.js → loaders-Bx2E0Ksu.mjs} +0 -2
  19. package/dist/{mdx-D2vcWdqv.js → mdx-BGXFjg1w.mjs} +2 -4
  20. package/dist/{meta-B6guI74I.js → meta-Bq8wKcQi.mjs} +1 -3
  21. package/dist/next/{index.d.ts → index.d.mts} +2 -3
  22. package/dist/next/{index.js → index.mjs} +9 -11
  23. package/dist/node/_loader.d.mts +8 -0
  24. package/dist/node/_loader.mjs +34 -0
  25. package/dist/node/index.d.mts +12 -0
  26. package/dist/node/index.mjs +7 -0
  27. package/dist/node/{loader.d.ts → loader.d.mts} +4 -2
  28. package/dist/node/{loader.js → loader.mjs} +7 -6
  29. package/dist/plugins/{index-file.d.ts → index-file.d.mts} +1 -1
  30. package/dist/plugins/index-file.mjs +2 -0
  31. package/dist/plugins/{json-schema.d.ts → json-schema.d.mts} +2 -3
  32. package/dist/plugins/{json-schema.js → json-schema.mjs} +0 -2
  33. package/dist/plugins/{last-modified.d.ts → last-modified.d.mts} +2 -3
  34. package/dist/plugins/{last-modified.js → last-modified.mjs} +1 -3
  35. package/dist/{preset-B0H8HalE.js → preset-2RxDTDuQ.mjs} +0 -2
  36. package/dist/{remark-include-VDoXZSBN.js → remark-include-D7W3bva3.mjs} +0 -2
  37. package/dist/runtime/{browser.d.ts → browser.d.mts} +4 -5
  38. package/dist/runtime/{browser.js → browser.mjs} +0 -2
  39. package/dist/runtime/{dynamic.d.ts → dynamic.d.mts} +3 -4
  40. package/dist/runtime/{dynamic.js → dynamic.mjs} +4 -6
  41. package/dist/runtime/{server.d.ts → server.d.mts} +1 -1
  42. package/dist/runtime/{server.js → server.mjs} +0 -2
  43. package/dist/runtime/{types.d.ts → types.d.mts} +1 -1
  44. package/dist/{types-hAduruLB.d.ts → types-DzvjnGdV.d.mts} +1 -2
  45. package/dist/vite/{index.d.ts → index.d.mts} +3 -4
  46. package/dist/vite/index.mjs +330 -0
  47. package/dist/webpack/mdx.d.mts +7 -0
  48. package/dist/webpack/{mdx.js → mdx.mjs} +7 -8
  49. package/dist/webpack/meta.d.mts +7 -0
  50. package/dist/webpack/{meta.js → meta.mjs} +7 -8
  51. package/dist/{webpack-CBlMzMlJ.js → webpack-FvZlu_1G.mjs} +1 -3
  52. package/package.json +39 -37
  53. package/dist/adapter-DVxULZiU.js.map +0 -1
  54. package/dist/bin.js.map +0 -1
  55. package/dist/build-DPafU2lu.js.map +0 -1
  56. package/dist/build-mdx-82nyqL4J.js +0 -307
  57. package/dist/build-mdx-82nyqL4J.js.map +0 -1
  58. package/dist/build-mdx-YyRh-ZGV.d.ts.map +0 -1
  59. package/dist/bun/index.d.ts.map +0 -1
  60. package/dist/bun/index.js.map +0 -1
  61. package/dist/codegen-B8EhLmbU.js.map +0 -1
  62. package/dist/config/index.js.map +0 -1
  63. package/dist/core-C5aAAT92.d.ts.map +0 -1
  64. package/dist/core-Wd5WdPN4.js.map +0 -1
  65. package/dist/index-BIbaPT3v.d.ts.map +0 -1
  66. package/dist/index-file-eVlUbKSO.js.map +0 -1
  67. package/dist/load-from-file-C1DDNVwF.js.map +0 -1
  68. package/dist/loaders-ezSYYkT7.js.map +0 -1
  69. package/dist/mdx-D2vcWdqv.js.map +0 -1
  70. package/dist/meta-B6guI74I.js.map +0 -1
  71. package/dist/next/index.d.ts.map +0 -1
  72. package/dist/next/index.js.map +0 -1
  73. package/dist/node/loader.d.ts.map +0 -1
  74. package/dist/node/loader.js.map +0 -1
  75. package/dist/plugins/index-file.js +0 -2
  76. package/dist/plugins/json-schema.d.ts.map +0 -1
  77. package/dist/plugins/json-schema.js.map +0 -1
  78. package/dist/plugins/last-modified.d.ts.map +0 -1
  79. package/dist/plugins/last-modified.js.map +0 -1
  80. package/dist/preset-B0H8HalE.js.map +0 -1
  81. package/dist/remark-include-VDoXZSBN.js.map +0 -1
  82. package/dist/rolldown-runtime-CiIaOW0V.js +0 -13
  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 +0 -82
  91. package/dist/vite/index.js.map +0 -1
  92. package/dist/webpack/mdx.d.ts +0 -8
  93. package/dist/webpack/mdx.d.ts.map +0 -1
  94. package/dist/webpack/mdx.js.map +0 -1
  95. package/dist/webpack/meta.d.ts +0 -8
  96. package/dist/webpack/meta.d.ts.map +0 -1
  97. package/dist/webpack/meta.js.map +0 -1
  98. package/dist/webpack-CBlMzMlJ.js.map +0 -1
  99. package/loader-mdx.cjs +0 -5
  100. package/loader-meta.cjs +0 -5
  101. /package/dist/{bin.d.ts → bin.d.mts} +0 -0
  102. /package/dist/{index.js → index.mjs} +0 -0
  103. /package/dist/runtime/{types.js → types.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import { r as ValidationError } from "./core-Wd5WdPN4.js";
2
- import { t as loadConfig } from "./load-from-file-C1DDNVwF.js";
1
+ import { r as ValidationError } from "./core-CA-_77fa.mjs";
2
+ import { t as loadConfig } from "./load-from-file-f1KkukxD.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-DVxULZiU.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-2RxDTDuQ.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
@@ -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 };
@@ -0,0 +1,135 @@
1
+ import { n as flattenNode, t as remarkInclude } from "./remark-include-D7W3bva3.mjs";
2
+ import { t as __exportAll } from "./vite/index.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 };
@@ -1,4 +1,4 @@
1
- import { r as CoreOptions } from "../core-C5aAAT92.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-Wd5WdPN4.js";
4
- import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-DVxULZiU.js";
5
- import { t as createMetaLoader } from "../meta-B6guI74I.js";
1
+ import { t as createMdxLoader } from "../mdx-BGXFjg1w.mjs";
2
+ import { t as buildConfig } from "../build-C6DvTt9a.mjs";
3
+ import { n as createCore, t as _Defaults } from "../core-CA-_77fa.mjs";
4
+ import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-DK590Mfe.mjs";
5
+ import { t as createMetaLoader } from "../meta-Bq8wKcQi.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
@@ -1,2 +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-C5aAAT92.js";
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
2
  export { AnyCollection, BaseCollection, CollectionSchema, DefaultMDXOptions, DocCollection, DocsCollection, GlobalConfig, MDXPresetOptions, MetaCollection, PostprocessOptions, applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
@@ -1,30 +1,6 @@
1
- import { t as applyMdxPreset } from "../preset-B0H8HalE.js";
2
- import { t as remarkInclude } from "../remark-include-VDoXZSBN.js";
3
- import { z } from "zod";
4
- //#region ../core/dist/source/schema.js
5
- /**
6
- * Zod 4 schema
7
- */
8
- const metaSchema$1 = z.object({
9
- title: z.string().optional(),
10
- pages: z.array(z.string()).optional(),
11
- description: z.string().optional(),
12
- root: z.boolean().optional(),
13
- defaultOpen: z.boolean().optional(),
14
- collapsible: z.boolean().optional(),
15
- icon: z.string().optional()
16
- });
17
- /**
18
- * Zod 4 schema
19
- */
20
- const pageSchema = z.object({
21
- title: z.string(),
22
- description: z.string().optional(),
23
- icon: z.string().optional(),
24
- full: z.boolean().optional(),
25
- _openapi: z.record(z.string(), z.custom()).optional()
26
- });
27
- //#endregion
1
+ import { t as applyMdxPreset } from "../preset-2RxDTDuQ.mjs";
2
+ import { t as remarkInclude } from "../remark-include-D7W3bva3.mjs";
3
+ import { metaSchema as metaSchema$1, pageSchema } from "fumadocs-core/source/schema";
28
4
  //#region src/config/define.ts
29
5
  function defineCollections(options) {
30
6
  return options;
@@ -59,5 +35,3 @@ const frontmatterSchema = pageSchema;
59
35
  const metaSchema = metaSchema$1;
60
36
  //#endregion
61
37
  export { applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
62
-
63
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { n as ident } from "./codegen-B8EhLmbU.js";
1
+ import { n as ident } from "./codegen-CWSx5M_o.mjs";
2
2
  import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  //#region src/utils/validation.ts
@@ -212,5 +212,3 @@ function postprocessPlugin() {
212
212
  }
213
213
  //#endregion
214
214
  export { createCore as n, ValidationError as r, _Defaults as t };
215
-
216
- //# sourceMappingURL=core-Wd5WdPN4.js.map
@@ -1,6 +1,7 @@
1
- import { a as MetaMethods, i as InternalTypeConfig, n as DocMethods, t as DocData } from "./types-hAduruLB.js";
1
+ import { a as MetaMethods, i as InternalTypeConfig, n as DocMethods, t as DocData } from "./types-DzvjnGdV.mjs";
2
2
  import * as _$zod from "zod";
3
- import { z } from "zod";
3
+ import * as _$fumadocs_core_source_schema0 from "fumadocs-core/source/schema";
4
+ import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
4
5
  import { Pluggable, Processor, Transformer } from "unified";
5
6
  import * as Plugins from "fumadocs-core/mdx-plugins";
6
7
  import { LLMsOptions } from "fumadocs-core/mdx-plugins";
@@ -38,30 +39,6 @@ type MDXPresetOptions = ({
38
39
  */
39
40
  declare function applyMdxPreset(options?: MDXPresetOptions): (environment: BuildEnvironment) => Promise<ProcessorOptions>;
40
41
  //#endregion
41
- //#region ../core/dist/source/schema.d.ts
42
- /**
43
- * Zod 4 schema
44
- */
45
- declare const metaSchema$1: z.ZodObject<{
46
- title: z.ZodOptional<z.ZodString>;
47
- pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
- description: z.ZodOptional<z.ZodString>;
49
- root: z.ZodOptional<z.ZodBoolean>;
50
- defaultOpen: z.ZodOptional<z.ZodBoolean>;
51
- collapsible: z.ZodOptional<z.ZodBoolean>;
52
- icon: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strip>;
54
- /**
55
- * Zod 4 schema
56
- */
57
- declare const pageSchema: z.ZodObject<{
58
- title: z.ZodString;
59
- description: z.ZodOptional<z.ZodString>;
60
- icon: z.ZodOptional<z.ZodString>;
61
- full: z.ZodOptional<z.ZodBoolean>;
62
- _openapi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<any, any>>>;
63
- }, z.core.$strip>;
64
- //#endregion
65
42
  //#region src/loaders/mdx/remark-postprocess.d.ts
66
43
  interface ExtractedReference {
67
44
  href: string;
@@ -152,7 +129,7 @@ interface GlobalConfig {
152
129
  }
153
130
  declare function defineCollections<Schema extends StandardSchemaV1 = StandardSchemaV1>(options: DocCollection<Schema>): DocCollection<Schema>;
154
131
  declare function defineCollections<Schema extends StandardSchemaV1 = StandardSchemaV1>(options: MetaCollection<Schema>): MetaCollection<Schema>;
155
- declare function defineDocs<DocSchema extends StandardSchemaV1 = typeof pageSchema, MetaSchema extends StandardSchemaV1 = typeof metaSchema$1>(options: {
132
+ declare function defineDocs<DocSchema extends StandardSchemaV1 = typeof pageSchema, MetaSchema extends StandardSchemaV1 = typeof metaSchema>(options: {
156
133
  /**
157
134
  * The content directory to scan files
158
135
  *
@@ -204,10 +181,10 @@ declare const frontmatterSchema: _$zod.ZodObject<{
204
181
  description: _$zod.ZodOptional<_$zod.ZodString>;
205
182
  icon: _$zod.ZodOptional<_$zod.ZodString>;
206
183
  full: _$zod.ZodOptional<_$zod.ZodBoolean>;
207
- _openapi: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodCustom<undefined, undefined>>>;
184
+ _openapi: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodCustom<_$fumadocs_core_source_schema0._JSONType, _$fumadocs_core_source_schema0._JSONType>>>;
208
185
  }, _$zod_v4_core0.$strip>;
209
186
  /** @deprecated import from `fumadocs-core/source/schema` instead (since 16.2.3) */
210
- declare const metaSchema: _$zod.ZodObject<{
187
+ declare const metaSchema$1: _$zod.ZodObject<{
211
188
  title: _$zod.ZodOptional<_$zod.ZodString>;
212
189
  pages: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
213
190
  description: _$zod.ZodOptional<_$zod.ZodString>;
@@ -403,5 +380,4 @@ declare function createCore(options: CoreOptions): {
403
380
  };
404
381
  type Core = ReturnType<typeof createCore>;
405
382
  //#endregion
406
- 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 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 };
407
- //# sourceMappingURL=core-C5aAAT92.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-CWSx5M_o.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 { 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-C5aAAT92.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 };
@@ -0,0 +1,2 @@
1
+ import { t as loadConfig } from "./load-from-file-f1KkukxD.mjs";
2
+ export { loadConfig };
@@ -1,8 +1,6 @@
1
- import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { t as buildConfig } from "./build-DPafU2lu.js";
1
+ import { t as buildConfig } from "./build-C6DvTt9a.mjs";
3
2
  import { pathToFileURL } from "node:url";
4
3
  //#region src/config/load-from-file.ts
5
- var load_from_file_exports = /* @__PURE__ */ __exportAll({ loadConfig: () => loadConfig });
6
4
  async function compileConfig(core) {
7
5
  const { build } = await import("esbuild");
8
6
  const { configPath, outDir } = core.getOptions();
@@ -31,9 +29,7 @@ async function loadConfig(core, build = false) {
31
29
  if (build) await compileConfig(core);
32
30
  const url = pathToFileURL(core.getCompiledConfigPath());
33
31
  url.searchParams.set("hash", Date.now().toString());
34
- return await import(url.href).then((loaded) => buildConfig(loaded));
32
+ return buildConfig(await import(url.href));
35
33
  }
36
34
  //#endregion
37
- export { load_from_file_exports as n, loadConfig as t };
38
-
39
- //# sourceMappingURL=load-from-file-C1DDNVwF.js.map
35
+ export { loadConfig as t };
@@ -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-Bx2E0Ksu.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-YbGh3ny7.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-Bx2E0Ksu.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-C5aAAT92.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-Wd5WdPN4.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-Bx2E0Ksu.mjs";
2
+ import { n as createCore, t as _Defaults } from "../core-CA-_77fa.mjs";
3
+ import { t as loadConfig } from "../load-from-file-f1KkukxD.mjs";
4
+ import { t as indexFile } from "../index-file-Bay9epxY.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-BGXFjg1w.mjs";
2
+ import { n as createCore, t as _Defaults } from "../core-CA-_77fa.mjs";
3
+ import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-DK590Mfe.mjs";
4
+ import { t as createMetaLoader } from "../meta-Bq8wKcQi.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 };
@@ -1,7 +1,7 @@
1
- import { t as createMdxLoader } from "../mdx-D2vcWdqv.js";
2
- import { n as createCore, t as _Defaults } from "../core-Wd5WdPN4.js";
3
- import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-DVxULZiU.js";
4
- import { t as createMetaLoader } from "../meta-B6guI74I.js";
1
+ import { t as createMdxLoader } from "../mdx-BGXFjg1w.mjs";
2
+ import { n as createCore, t as _Defaults } from "../core-CA-_77fa.mjs";
3
+ import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-DK590Mfe.mjs";
4
+ import { t as createMetaLoader } from "../meta-Bq8wKcQi.mjs";
5
5
  //#region src/node/loader.ts
6
6
  const configLoader = createStandaloneConfigLoader({
7
7
  core: createCore({
@@ -14,6 +14,9 @@ const configLoader = createStandaloneConfigLoader({
14
14
  });
15
15
  const mdxLoader = toNode(createMdxLoader(configLoader));
16
16
  const metaLoader = toNode(createMetaLoader(configLoader));
17
+ /**
18
+ * @deprecated use the `register()` function from `fumadocs-mdx/node` instead.
19
+ */
17
20
  const load = (url, context, nextLoad) => {
18
21
  return mdxLoader(url, context, (v, ctx) => metaLoader(v, {
19
22
  ...context,
@@ -22,5 +25,3 @@ const load = (url, context, nextLoad) => {
22
25
  };
23
26
  //#endregion
24
27
  export { load };
25
-
26
- //# sourceMappingURL=loader.js.map
@@ -1,2 +1,2 @@
1
- import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-C5aAAT92.js";
1
+ import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-xVRMIMfX.mjs";
2
2
  export { IndexFilePlugin, IndexFilePluginOptions, indexFile as default };
@@ -0,0 +1,2 @@
1
+ import { t as indexFile } from "../index-file-Bay9epxY.mjs";
2
+ export { indexFile as default };