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.
- package/dist/{adapter-DB1MHK9h.js → adapter-CYY_UTJ_.mjs} +2 -4
- package/dist/{bin.js → bin.mjs} +2 -4
- package/dist/{build-DPafU2lu.js → build-B3dze-Gy.mjs} +1 -3
- package/dist/build-mdx-CzPhxxK5.mjs +135 -0
- package/dist/{build-mdx-YyRh-ZGV.d.ts → build-mdx-D96HeA9c.d.mts} +1 -2
- 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-DWIpa-dn.mjs} +0 -2
- package/dist/config/index.d.mts +2 -0
- package/dist/config/index.mjs +37 -0
- package/dist/{core-B0lF760L.js → core-p4b5Z4gI.mjs} +7 -3
- package/dist/{core-DzcubDJt.d.ts → core-xVRMIMfX.d.mts} +26 -28
- package/dist/{index-BIbaPT3v.d.ts → index-BbjEFpj3.d.mts} +1 -2
- package/dist/{index-file-eVlUbKSO.js → index-file-CwcdorGV.mjs} +1 -3
- package/dist/{index.d.ts → index.d.mts} +2 -2
- package/dist/{load-from-file-C1DDNVwF.js → load-from-file-BT-JZa0P.mjs} +3 -5
- package/dist/{loaders-ezSYYkT7.js → loaders-D1D2IY_F.mjs} +0 -2
- package/dist/{mdx-D2vcWdqv.js → mdx-DBRSrYL3.mjs} +2 -4
- package/dist/{meta-B6guI74I.js → meta-BB21ElqG.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-D9gSxA4n.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.js → index.mjs} +8 -10
- 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-DmRbt96H.js → webpack-B40ig_De.mjs} +1 -3
- package/package.json +34 -35
- package/dist/adapter-DB1MHK9h.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.d.ts +0 -2
- package/dist/config/index.js +0 -57
- package/dist/config/index.js.map +0 -1
- package/dist/core-B0lF760L.js.map +0 -1
- package/dist/core-DzcubDJt.d.ts.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/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.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-DmRbt96H.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/{rolldown-runtime-CiIaOW0V.js → rolldown-runtime-wcPFST8Q.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-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
|
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-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 };
|
|
@@ -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-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
|
|
@@ -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-
|
|
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-
|
|
2
|
-
import
|
|
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 {
|
|
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 };
|
|
@@ -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-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 {
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as buildConfig } from "./build-
|
|
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)
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as mdxLoaderGlob } from "./loaders-
|
|
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-
|
|
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-
|
|
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-
|
|
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-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/
|
|
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-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 };
|
|
@@ -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 };
|