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.
- package/dist/{adapter-DVxULZiU.js → adapter-DK590Mfe.mjs} +2 -4
- package/dist/{bin.js → bin.mjs} +2 -4
- package/dist/{build-DPafU2lu.js → build-C6DvTt9a.mjs} +1 -3
- package/dist/{build-mdx-YyRh-ZGV.d.ts → build-mdx-D96HeA9c.d.mts} +1 -2
- package/dist/build-mdx-YbGh3ny7.mjs +135 -0
- package/dist/bun/{index.d.ts → index.d.mts} +2 -3
- package/dist/bun/{index.js → index.mjs} +5 -7
- package/dist/{codegen-B8EhLmbU.js → codegen-CWSx5M_o.mjs} +0 -2
- package/dist/config/{index.d.ts → index.d.mts} +1 -1
- package/dist/config/{index.js → index.mjs} +3 -29
- package/dist/{core-Wd5WdPN4.js → core-CA-_77fa.mjs} +1 -3
- package/dist/{core-C5aAAT92.d.ts → core-xVRMIMfX.d.mts} +7 -31
- package/dist/{index-BIbaPT3v.d.ts → index-BbjEFpj3.d.mts} +1 -2
- package/dist/{index-file-eVlUbKSO.js → index-file-Bay9epxY.mjs} +1 -3
- package/dist/{index.d.ts → index.d.mts} +2 -2
- package/dist/load-from-file-D0UVwCFc.mjs +2 -0
- package/dist/{load-from-file-C1DDNVwF.js → load-from-file-f1KkukxD.mjs} +3 -7
- package/dist/{loaders-ezSYYkT7.js → loaders-Bx2E0Ksu.mjs} +0 -2
- package/dist/{mdx-D2vcWdqv.js → mdx-BGXFjg1w.mjs} +2 -4
- package/dist/{meta-B6guI74I.js → meta-Bq8wKcQi.mjs} +1 -3
- package/dist/next/{index.d.ts → index.d.mts} +2 -3
- package/dist/next/{index.js → index.mjs} +9 -11
- package/dist/node/_loader.d.mts +8 -0
- package/dist/node/_loader.mjs +34 -0
- package/dist/node/index.d.mts +12 -0
- package/dist/node/index.mjs +7 -0
- package/dist/node/{loader.d.ts → loader.d.mts} +4 -2
- package/dist/node/{loader.js → loader.mjs} +7 -6
- package/dist/plugins/{index-file.d.ts → index-file.d.mts} +1 -1
- package/dist/plugins/index-file.mjs +2 -0
- package/dist/plugins/{json-schema.d.ts → json-schema.d.mts} +2 -3
- package/dist/plugins/{json-schema.js → json-schema.mjs} +0 -2
- package/dist/plugins/{last-modified.d.ts → last-modified.d.mts} +2 -3
- package/dist/plugins/{last-modified.js → last-modified.mjs} +1 -3
- package/dist/{preset-B0H8HalE.js → preset-2RxDTDuQ.mjs} +0 -2
- package/dist/{remark-include-VDoXZSBN.js → remark-include-D7W3bva3.mjs} +0 -2
- package/dist/runtime/{browser.d.ts → browser.d.mts} +4 -5
- package/dist/runtime/{browser.js → browser.mjs} +0 -2
- package/dist/runtime/{dynamic.d.ts → dynamic.d.mts} +3 -4
- package/dist/runtime/{dynamic.js → dynamic.mjs} +4 -6
- package/dist/runtime/{server.d.ts → server.d.mts} +1 -1
- package/dist/runtime/{server.js → server.mjs} +0 -2
- package/dist/runtime/{types.d.ts → types.d.mts} +1 -1
- package/dist/{types-hAduruLB.d.ts → types-DzvjnGdV.d.mts} +1 -2
- package/dist/vite/{index.d.ts → index.d.mts} +3 -4
- package/dist/vite/index.mjs +330 -0
- package/dist/webpack/mdx.d.mts +7 -0
- package/dist/webpack/{mdx.js → mdx.mjs} +7 -8
- package/dist/webpack/meta.d.mts +7 -0
- package/dist/webpack/{meta.js → meta.mjs} +7 -8
- package/dist/{webpack-CBlMzMlJ.js → webpack-FvZlu_1G.mjs} +1 -3
- package/package.json +39 -37
- package/dist/adapter-DVxULZiU.js.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/build-DPafU2lu.js.map +0 -1
- package/dist/build-mdx-82nyqL4J.js +0 -307
- package/dist/build-mdx-82nyqL4J.js.map +0 -1
- package/dist/build-mdx-YyRh-ZGV.d.ts.map +0 -1
- package/dist/bun/index.d.ts.map +0 -1
- package/dist/bun/index.js.map +0 -1
- package/dist/codegen-B8EhLmbU.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/core-C5aAAT92.d.ts.map +0 -1
- package/dist/core-Wd5WdPN4.js.map +0 -1
- package/dist/index-BIbaPT3v.d.ts.map +0 -1
- package/dist/index-file-eVlUbKSO.js.map +0 -1
- package/dist/load-from-file-C1DDNVwF.js.map +0 -1
- package/dist/loaders-ezSYYkT7.js.map +0 -1
- package/dist/mdx-D2vcWdqv.js.map +0 -1
- package/dist/meta-B6guI74I.js.map +0 -1
- package/dist/next/index.d.ts.map +0 -1
- package/dist/next/index.js.map +0 -1
- package/dist/node/loader.d.ts.map +0 -1
- package/dist/node/loader.js.map +0 -1
- package/dist/plugins/index-file.js +0 -2
- package/dist/plugins/json-schema.d.ts.map +0 -1
- package/dist/plugins/json-schema.js.map +0 -1
- package/dist/plugins/last-modified.d.ts.map +0 -1
- package/dist/plugins/last-modified.js.map +0 -1
- package/dist/preset-B0H8HalE.js.map +0 -1
- package/dist/remark-include-VDoXZSBN.js.map +0 -1
- package/dist/rolldown-runtime-CiIaOW0V.js +0 -13
- package/dist/runtime/browser.d.ts.map +0 -1
- package/dist/runtime/browser.js.map +0 -1
- package/dist/runtime/dynamic.d.ts.map +0 -1
- package/dist/runtime/dynamic.js.map +0 -1
- package/dist/runtime/server.js.map +0 -1
- package/dist/types-hAduruLB.d.ts.map +0 -1
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js +0 -82
- package/dist/vite/index.js.map +0 -1
- package/dist/webpack/mdx.d.ts +0 -8
- package/dist/webpack/mdx.d.ts.map +0 -1
- package/dist/webpack/mdx.js.map +0 -1
- package/dist/webpack/meta.d.ts +0 -8
- package/dist/webpack/meta.d.ts.map +0 -1
- package/dist/webpack/meta.js.map +0 -1
- package/dist/webpack-CBlMzMlJ.js.map +0 -1
- package/loader-mdx.cjs +0 -5
- package/loader-meta.cjs +0 -5
- /package/dist/{bin.d.ts → bin.d.mts} +0 -0
- /package/dist/{index.js → index.mjs} +0 -0
- /package/dist/runtime/{types.js → types.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as ValidationError } from "./core-
|
|
2
|
-
import { t as loadConfig } from "./load-from-file-
|
|
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
|
package/dist/{bin.js → bin.mjs}
RENAMED
|
@@ -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.
|
|
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.
|
|
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-
|
|
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
|
|
@@ -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-
|
|
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-
|
|
2
|
-
import { t as buildConfig } from "../build-
|
|
3
|
-
import { n as createCore, t as _Defaults } from "../core-
|
|
4
|
-
import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-
|
|
5
|
-
import { t as createMetaLoader } from "../meta-
|
|
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
|
|
@@ -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-
|
|
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-
|
|
2
|
-
import { t as remarkInclude } from "../remark-include-
|
|
3
|
-
import {
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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<
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ident, r as slash, t as createCodegen } from "./codegen-
|
|
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-
|
|
2
|
-
import { t as CompiledMDXProperties } from "./build-mdx-
|
|
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,8 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
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)
|
|
32
|
+
return buildConfig(await import(url.href));
|
|
35
33
|
}
|
|
36
34
|
//#endregion
|
|
37
|
-
export {
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=load-from-file-C1DDNVwF.js.map
|
|
35
|
+
export { loadConfig as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as mdxLoaderGlob } from "./loaders-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
2
|
-
import { n as createCore, t as _Defaults } from "../core-
|
|
3
|
-
import { t as loadConfig } from "../load-from-file-
|
|
4
|
-
import { t as indexFile } from "../index-file-
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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 };
|
|
@@ -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-
|
|
2
|
-
import { n as createCore, t as _Defaults } from "../core-
|
|
3
|
-
import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-
|
|
4
|
-
import { t as createMetaLoader } from "../meta-
|
|
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-
|
|
1
|
+
import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-xVRMIMfX.mjs";
|
|
2
2
|
export { IndexFilePlugin, IndexFilePluginOptions, indexFile as default };
|