fumadocs-mdx 11.8.0 → 11.8.2
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/build-mdx-DnC1jKvn.d.cts +46 -0
- package/dist/build-mdx-DnC1jKvn.d.ts +46 -0
- package/dist/{chunk-XZR5QXVY.js → chunk-BWRDVK5L.js} +1 -1
- package/dist/{chunk-7JFPDRW7.js → chunk-QQWCBFFE.js} +2 -4
- package/dist/{chunk-XVL4ZQFK.js → chunk-QVZ7JH4H.js} +1 -1
- package/dist/{chunk-GYWPPGFD.js → chunk-SMSNZ6N5.js} +38 -7
- package/dist/chunk-SVTXMVLQ.js +139 -0
- package/dist/config/index.cjs +121 -70
- package/dist/config/index.d.cts +5 -1
- package/dist/config/index.d.ts +5 -1
- package/dist/config/index.js +2 -2
- package/dist/config/zod-3.cjs +121 -70
- package/dist/config/zod-3.d.cts +1 -1
- package/dist/config/zod-3.d.ts +1 -1
- package/dist/config/zod-3.js +2 -2
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/loader-mdx.cjs +130 -81
- package/dist/loader-mdx.js +8 -8
- package/dist/{mdx-options-3NB74EMB.js → mdx-options-T73E4LQB.js} +1 -1
- package/dist/next/index.cjs +42 -11
- package/dist/next/index.js +2 -2
- package/dist/runtime/async.cjs +122 -73
- package/dist/runtime/async.d.cts +3 -2
- package/dist/runtime/async.d.ts +3 -2
- package/dist/runtime/async.js +3 -3
- package/dist/runtime/vite.d.cts +3 -12
- package/dist/runtime/vite.d.ts +3 -12
- package/dist/{types-BukvTPdG.d.cts → types-BmVgoqsr.d.cts} +3 -12
- package/dist/{types-B2ozVm_9.d.ts → types-WSHJKA8L.d.ts} +3 -12
- package/dist/vite/index.cjs +126 -77
- package/dist/vite/index.js +3 -3
- package/package.json +9 -7
- package/dist/chunk-IGXZS2W6.js +0 -119
package/dist/loader-mdx.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfigHash,
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BWRDVK5L.js";
|
|
5
5
|
import {
|
|
6
6
|
countLines
|
|
7
7
|
} from "./chunk-UCY7OBZG.js";
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
} from "./chunk-GX3THK2Q.js";
|
|
13
13
|
import {
|
|
14
14
|
buildMDX
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-QQWCBFFE.js";
|
|
16
|
+
import "./chunk-SVTXMVLQ.js";
|
|
17
|
+
import "./chunk-QVZ7JH4H.js";
|
|
18
18
|
import {
|
|
19
19
|
fumaMatter
|
|
20
20
|
} from "./chunk-VWJKRQZR.js";
|
|
@@ -38,13 +38,13 @@ async function loader(source, callback) {
|
|
|
38
38
|
if (collection && collection.type !== "doc") {
|
|
39
39
|
collection = void 0;
|
|
40
40
|
}
|
|
41
|
-
let
|
|
41
|
+
let frontmatter = matter.data;
|
|
42
42
|
const mdxOptions = collection?.mdxOptions ?? await config.getDefaultMDXOptions();
|
|
43
43
|
if (collection?.schema) {
|
|
44
44
|
try {
|
|
45
|
-
|
|
45
|
+
frontmatter = await validate(
|
|
46
46
|
collection.schema,
|
|
47
|
-
|
|
47
|
+
frontmatter,
|
|
48
48
|
{
|
|
49
49
|
source,
|
|
50
50
|
path: filePath
|
|
@@ -73,7 +73,7 @@ async function loader(source, callback) {
|
|
|
73
73
|
development: this.mode === "development",
|
|
74
74
|
...mdxOptions,
|
|
75
75
|
filePath,
|
|
76
|
-
frontmatter
|
|
76
|
+
frontmatter,
|
|
77
77
|
data: {
|
|
78
78
|
lastModified: timestamp
|
|
79
79
|
},
|
package/dist/next/index.cjs
CHANGED
|
@@ -30,15 +30,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// src/mdx-plugins/remark-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
// src/mdx-plugins/remark-postprocess.ts
|
|
34
|
+
function remarkPostprocess({
|
|
35
|
+
injectExports
|
|
36
|
+
}) {
|
|
37
|
+
return (tree, file) => {
|
|
38
|
+
let title;
|
|
39
|
+
const urls = [];
|
|
40
|
+
(0, import_unist_util_visit.visit)(tree, ["heading", "link"], (node) => {
|
|
41
|
+
if (node.type === "heading" && node.depth === 1) {
|
|
42
|
+
title = flattenNode(node);
|
|
43
|
+
}
|
|
44
|
+
if (node.type !== "link") return;
|
|
45
|
+
urls.push({
|
|
46
|
+
href: node.url
|
|
47
|
+
});
|
|
48
|
+
return "skip";
|
|
49
|
+
});
|
|
50
|
+
if (title) {
|
|
51
|
+
file.data.frontmatter ??= {};
|
|
52
|
+
if (!file.data.frontmatter.title) file.data.frontmatter.title = title;
|
|
53
|
+
}
|
|
54
|
+
file.data.extractedReferences = urls;
|
|
55
|
+
for (const name of injectExports) {
|
|
56
|
+
if (!(name in file.data)) continue;
|
|
57
|
+
tree.children.unshift(getMdastExport(name, file.data[name]));
|
|
39
58
|
}
|
|
40
59
|
};
|
|
41
60
|
}
|
|
61
|
+
function flattenNode(node) {
|
|
62
|
+
if ("children" in node)
|
|
63
|
+
return node.children.map((child) => flattenNode(child)).join("");
|
|
64
|
+
if ("value" in node) return node.value;
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
42
67
|
function getMdastExport(name, value) {
|
|
43
68
|
return {
|
|
44
69
|
type: "mdxjsEsm",
|
|
@@ -50,6 +75,7 @@ function getMdastExport(name, value) {
|
|
|
50
75
|
body: [
|
|
51
76
|
{
|
|
52
77
|
type: "ExportNamedDeclaration",
|
|
78
|
+
attributes: [],
|
|
53
79
|
specifiers: [],
|
|
54
80
|
source: null,
|
|
55
81
|
declaration: {
|
|
@@ -72,10 +98,11 @@ function getMdastExport(name, value) {
|
|
|
72
98
|
}
|
|
73
99
|
};
|
|
74
100
|
}
|
|
75
|
-
var import_estree_util_value_to_estree;
|
|
76
|
-
var
|
|
77
|
-
"src/mdx-plugins/remark-
|
|
101
|
+
var import_unist_util_visit, import_estree_util_value_to_estree;
|
|
102
|
+
var init_remark_postprocess = __esm({
|
|
103
|
+
"src/mdx-plugins/remark-postprocess.ts"() {
|
|
78
104
|
"use strict";
|
|
105
|
+
import_unist_util_visit = require("unist-util-visit");
|
|
79
106
|
import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
80
107
|
}
|
|
81
108
|
});
|
|
@@ -107,6 +134,7 @@ function getDefaultMDXOptions({
|
|
|
107
134
|
}) {
|
|
108
135
|
const mdxExports = [
|
|
109
136
|
"structuredData",
|
|
137
|
+
"extractedReferences",
|
|
110
138
|
"frontmatter",
|
|
111
139
|
"lastModified",
|
|
112
140
|
...valueToExport
|
|
@@ -138,7 +166,10 @@ function getDefaultMDXOptions({
|
|
|
138
166
|
plugins.remarkStructure,
|
|
139
167
|
remarkStructureOptions
|
|
140
168
|
],
|
|
141
|
-
[
|
|
169
|
+
[
|
|
170
|
+
remarkPostprocess,
|
|
171
|
+
{ injectExports: mdxExports }
|
|
172
|
+
]
|
|
142
173
|
],
|
|
143
174
|
mdxOptions.remarkPlugins
|
|
144
175
|
);
|
|
@@ -162,7 +193,7 @@ var init_mdx_options = __esm({
|
|
|
162
193
|
"src/utils/mdx-options.ts"() {
|
|
163
194
|
"use strict";
|
|
164
195
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
165
|
-
|
|
196
|
+
init_remark_postprocess();
|
|
166
197
|
}
|
|
167
198
|
});
|
|
168
199
|
|
package/dist/next/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
findConfigFile,
|
|
3
3
|
getConfigHash,
|
|
4
4
|
loadConfig
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-BWRDVK5L.js";
|
|
6
6
|
import {
|
|
7
7
|
getGlobPatterns,
|
|
8
8
|
getImportCode,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getGitTimestamp,
|
|
15
15
|
validate
|
|
16
16
|
} from "../chunk-GX3THK2Q.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-QVZ7JH4H.js";
|
|
18
18
|
import {
|
|
19
19
|
fumaMatter
|
|
20
20
|
} from "../chunk-VWJKRQZR.js";
|
package/dist/runtime/async.cjs
CHANGED
|
@@ -30,15 +30,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// src/mdx-plugins/remark-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
// src/mdx-plugins/remark-postprocess.ts
|
|
34
|
+
function remarkPostprocess({
|
|
35
|
+
injectExports
|
|
36
|
+
}) {
|
|
37
|
+
return (tree, file) => {
|
|
38
|
+
let title;
|
|
39
|
+
const urls = [];
|
|
40
|
+
(0, import_unist_util_visit2.visit)(tree, ["heading", "link"], (node) => {
|
|
41
|
+
if (node.type === "heading" && node.depth === 1) {
|
|
42
|
+
title = flattenNode2(node);
|
|
43
|
+
}
|
|
44
|
+
if (node.type !== "link") return;
|
|
45
|
+
urls.push({
|
|
46
|
+
href: node.url
|
|
47
|
+
});
|
|
48
|
+
return "skip";
|
|
49
|
+
});
|
|
50
|
+
if (title) {
|
|
51
|
+
file.data.frontmatter ??= {};
|
|
52
|
+
if (!file.data.frontmatter.title) file.data.frontmatter.title = title;
|
|
53
|
+
}
|
|
54
|
+
file.data.extractedReferences = urls;
|
|
55
|
+
for (const name of injectExports) {
|
|
56
|
+
if (!(name in file.data)) continue;
|
|
57
|
+
tree.children.unshift(getMdastExport(name, file.data[name]));
|
|
39
58
|
}
|
|
40
59
|
};
|
|
41
60
|
}
|
|
61
|
+
function flattenNode2(node) {
|
|
62
|
+
if ("children" in node)
|
|
63
|
+
return node.children.map((child) => flattenNode2(child)).join("");
|
|
64
|
+
if ("value" in node) return node.value;
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
42
67
|
function getMdastExport(name, value) {
|
|
43
68
|
return {
|
|
44
69
|
type: "mdxjsEsm",
|
|
@@ -50,6 +75,7 @@ function getMdastExport(name, value) {
|
|
|
50
75
|
body: [
|
|
51
76
|
{
|
|
52
77
|
type: "ExportNamedDeclaration",
|
|
78
|
+
attributes: [],
|
|
53
79
|
specifiers: [],
|
|
54
80
|
source: null,
|
|
55
81
|
declaration: {
|
|
@@ -72,10 +98,11 @@ function getMdastExport(name, value) {
|
|
|
72
98
|
}
|
|
73
99
|
};
|
|
74
100
|
}
|
|
75
|
-
var import_estree_util_value_to_estree;
|
|
76
|
-
var
|
|
77
|
-
"src/mdx-plugins/remark-
|
|
101
|
+
var import_unist_util_visit2, import_estree_util_value_to_estree;
|
|
102
|
+
var init_remark_postprocess = __esm({
|
|
103
|
+
"src/mdx-plugins/remark-postprocess.ts"() {
|
|
78
104
|
"use strict";
|
|
105
|
+
import_unist_util_visit2 = require("unist-util-visit");
|
|
79
106
|
import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
80
107
|
}
|
|
81
108
|
});
|
|
@@ -107,6 +134,7 @@ function getDefaultMDXOptions({
|
|
|
107
134
|
}) {
|
|
108
135
|
const mdxExports = [
|
|
109
136
|
"structuredData",
|
|
137
|
+
"extractedReferences",
|
|
110
138
|
"frontmatter",
|
|
111
139
|
"lastModified",
|
|
112
140
|
...valueToExport
|
|
@@ -138,7 +166,10 @@ function getDefaultMDXOptions({
|
|
|
138
166
|
plugins.remarkStructure,
|
|
139
167
|
remarkStructureOptions
|
|
140
168
|
],
|
|
141
|
-
[
|
|
169
|
+
[
|
|
170
|
+
remarkPostprocess,
|
|
171
|
+
{ injectExports: mdxExports }
|
|
172
|
+
]
|
|
142
173
|
],
|
|
143
174
|
mdxOptions.remarkPlugins
|
|
144
175
|
);
|
|
@@ -162,7 +193,7 @@ var init_mdx_options = __esm({
|
|
|
162
193
|
"src/utils/mdx-options.ts"() {
|
|
163
194
|
"use strict";
|
|
164
195
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
165
|
-
|
|
196
|
+
init_remark_postprocess();
|
|
166
197
|
}
|
|
167
198
|
});
|
|
168
199
|
|
|
@@ -251,6 +282,7 @@ function resolveFiles({ docs, meta }) {
|
|
|
251
282
|
var import_mdx = require("@mdx-js/mdx");
|
|
252
283
|
|
|
253
284
|
// src/mdx-plugins/remark-include.ts
|
|
285
|
+
var import_unified = require("unified");
|
|
254
286
|
var import_unist_util_visit = require("unist-util-visit");
|
|
255
287
|
var path = __toESM(require("path"), 1);
|
|
256
288
|
var fs2 = __toESM(require("fs/promises"), 1);
|
|
@@ -272,6 +304,10 @@ function fumaMatter(input) {
|
|
|
272
304
|
}
|
|
273
305
|
|
|
274
306
|
// src/mdx-plugins/remark-include.ts
|
|
307
|
+
var import_remark_parse = __toESM(require("remark-parse"), 1);
|
|
308
|
+
var import_remark_mdx = __toESM(require("remark-mdx"), 1);
|
|
309
|
+
var import_mdx_plugins = require("fumadocs-core/mdx-plugins");
|
|
310
|
+
var baseProcessor = (0, import_unified.unified)().use(import_mdx_plugins.remarkHeading);
|
|
275
311
|
function flattenNode(node) {
|
|
276
312
|
if ("children" in node)
|
|
277
313
|
return node.children.map((child) => flattenNode(child)).join("");
|
|
@@ -287,86 +323,96 @@ function parseSpecifier(specifier) {
|
|
|
287
323
|
};
|
|
288
324
|
}
|
|
289
325
|
function extractSection(root, section) {
|
|
326
|
+
let nodes;
|
|
290
327
|
for (const node of root.children) {
|
|
291
328
|
if (node.type === "mdxJsxFlowElement" && node.name === "section" && node.attributes.some(
|
|
292
329
|
(attr) => attr.type === "mdxJsxAttribute" && attr.name === "id" && attr.value === section
|
|
293
330
|
)) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
331
|
+
nodes = node.children;
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
if (node.type === "heading" && node.data?.hProperties?.id === section) {
|
|
335
|
+
nodes = [node];
|
|
336
|
+
continue;
|
|
298
337
|
}
|
|
338
|
+
if (!nodes) continue;
|
|
339
|
+
if (node.type === "heading") break;
|
|
340
|
+
nodes.push(node);
|
|
299
341
|
}
|
|
342
|
+
if (nodes)
|
|
343
|
+
return {
|
|
344
|
+
type: "root",
|
|
345
|
+
children: nodes
|
|
346
|
+
};
|
|
300
347
|
}
|
|
301
348
|
function remarkInclude() {
|
|
302
349
|
const TagName = "include";
|
|
350
|
+
async function embedContent(file, heading, params, data) {
|
|
351
|
+
let content;
|
|
352
|
+
try {
|
|
353
|
+
content = (await fs2.readFile(file)).toString();
|
|
354
|
+
} catch (e) {
|
|
355
|
+
throw new Error(
|
|
356
|
+
`failed to read file ${file}
|
|
357
|
+
${e instanceof Error ? e.message : String(e)}`,
|
|
358
|
+
{ cause: e }
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
const ext = path.extname(file);
|
|
362
|
+
data._compiler?.addDependency(file);
|
|
363
|
+
if (params.lang || ext !== ".md" && ext !== ".mdx") {
|
|
364
|
+
const lang = params.lang ?? ext.slice(1);
|
|
365
|
+
return {
|
|
366
|
+
type: "code",
|
|
367
|
+
lang,
|
|
368
|
+
meta: params.meta,
|
|
369
|
+
value: content,
|
|
370
|
+
data: {}
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
const processor = (data._getProcessor ?? getDefaultProcessor)(
|
|
374
|
+
ext === ".mdx" ? "mdx" : "md"
|
|
375
|
+
);
|
|
376
|
+
let parsed = await baseProcessor.run(
|
|
377
|
+
processor.parse(fumaMatter(content).content)
|
|
378
|
+
);
|
|
379
|
+
if (heading) {
|
|
380
|
+
const extracted = extractSection(parsed, heading);
|
|
381
|
+
if (!extracted)
|
|
382
|
+
throw new Error(
|
|
383
|
+
`Cannot find section ${heading} in ${file}, make sure you have encapsulated the section in a <section id="${heading}"> tag.`
|
|
384
|
+
);
|
|
385
|
+
parsed = extracted;
|
|
386
|
+
}
|
|
387
|
+
await update(parsed, path.dirname(file), data);
|
|
388
|
+
return parsed;
|
|
389
|
+
}
|
|
303
390
|
async function update(tree, directory, data) {
|
|
304
391
|
const queue = [];
|
|
305
392
|
(0, import_unist_util_visit.visit)(
|
|
306
393
|
tree,
|
|
307
394
|
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
308
|
-
(
|
|
309
|
-
|
|
395
|
+
(_node, _, parent) => {
|
|
396
|
+
const node = _node;
|
|
397
|
+
if (node.name !== TagName) return;
|
|
310
398
|
const params = {};
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
params[attr.name] = attr.value;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
specifier = value;
|
|
399
|
+
const specifier = flattenNode(node);
|
|
400
|
+
if (specifier.length === 0) return "skip";
|
|
401
|
+
for (const attr of node.attributes) {
|
|
402
|
+
if (attr.type === "mdxJsxAttribute" && (typeof attr.value === "string" || attr.value === null)) {
|
|
403
|
+
params[attr.name] = attr.value;
|
|
320
404
|
}
|
|
321
405
|
}
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
const targetPath = path.resolve(
|
|
406
|
+
const { file: relativePath, section } = parseSpecifier(specifier);
|
|
407
|
+
const file = path.resolve(
|
|
325
408
|
"cwd" in params ? process.cwd() : directory,
|
|
326
|
-
|
|
409
|
+
relativePath
|
|
327
410
|
);
|
|
328
|
-
const asCode = params.lang || !file.endsWith(".md") && !file.endsWith(".mdx");
|
|
329
411
|
queue.push(
|
|
330
|
-
|
|
331
|
-
data._compiler?.addDependency(targetPath);
|
|
332
|
-
if (asCode) {
|
|
333
|
-
const lang = params.lang ?? path.extname(file).slice(1);
|
|
334
|
-
Object.assign(node, {
|
|
335
|
-
type: "code",
|
|
336
|
-
lang,
|
|
337
|
-
meta: params.meta,
|
|
338
|
-
value: content,
|
|
339
|
-
data: {}
|
|
340
|
-
});
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const processor = data._processor ? data._processor.getProcessor(
|
|
344
|
-
targetPath.endsWith(".md") ? "md" : "mdx"
|
|
345
|
-
) : this;
|
|
346
|
-
let parsed = processor.parse(fumaMatter(content).content);
|
|
347
|
-
if (section) {
|
|
348
|
-
const extracted = extractSection(parsed, section);
|
|
349
|
-
if (!extracted)
|
|
350
|
-
throw new Error(
|
|
351
|
-
`Cannot find section ${section} in ${file}, make sure you have encapsulated the section in a <section id="${section}"> tag`
|
|
352
|
-
);
|
|
353
|
-
parsed = extracted;
|
|
354
|
-
}
|
|
355
|
-
await update.call(
|
|
356
|
-
processor,
|
|
357
|
-
parsed,
|
|
358
|
-
path.dirname(targetPath),
|
|
359
|
-
data
|
|
360
|
-
);
|
|
412
|
+
embedContent(file, section, params, data).then((replace) => {
|
|
361
413
|
Object.assign(
|
|
362
414
|
parent && parent.type === "paragraph" ? parent : node,
|
|
363
|
-
|
|
364
|
-
);
|
|
365
|
-
}).catch((e) => {
|
|
366
|
-
throw new Error(
|
|
367
|
-
`failed to read file ${targetPath}
|
|
368
|
-
${e instanceof Error ? e.message : String(e)}`,
|
|
369
|
-
{ cause: e }
|
|
415
|
+
replace
|
|
370
416
|
);
|
|
371
417
|
})
|
|
372
418
|
);
|
|
@@ -376,9 +422,14 @@ ${e instanceof Error ? e.message : String(e)}`,
|
|
|
376
422
|
await Promise.all(queue);
|
|
377
423
|
}
|
|
378
424
|
return async (tree, file) => {
|
|
379
|
-
await update
|
|
425
|
+
await update(tree, path.dirname(file.path), file.data);
|
|
380
426
|
};
|
|
381
427
|
}
|
|
428
|
+
function getDefaultProcessor(format) {
|
|
429
|
+
const mdProcessor = (0, import_unified.unified)().use(import_remark_parse.default);
|
|
430
|
+
if (format === "md") return mdProcessor;
|
|
431
|
+
return mdProcessor.use(import_remark_mdx.default);
|
|
432
|
+
}
|
|
382
433
|
|
|
383
434
|
// src/utils/build-mdx.ts
|
|
384
435
|
var cache2 = /* @__PURE__ */ new Map();
|
|
@@ -407,9 +458,7 @@ async function buildMDX(cacheKey, source, options) {
|
|
|
407
458
|
...data,
|
|
408
459
|
frontmatter,
|
|
409
460
|
_compiler,
|
|
410
|
-
|
|
411
|
-
getProcessor
|
|
412
|
-
}
|
|
461
|
+
_getProcessor: getProcessor
|
|
413
462
|
}
|
|
414
463
|
});
|
|
415
464
|
}
|
package/dist/runtime/async.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoadedConfig, a as RuntimeAsync } from '../types-
|
|
1
|
+
import { L as LoadedConfig, a as RuntimeAsync } from '../types-BmVgoqsr.cjs';
|
|
2
2
|
import '@standard-schema/spec';
|
|
3
3
|
import 'fumadocs-core/source';
|
|
4
4
|
import '../define-DnJzAZrj.cjs';
|
|
@@ -6,9 +6,10 @@ import 'fumadocs-core/mdx-plugins';
|
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'unified';
|
|
8
8
|
import 'zod';
|
|
9
|
+
import '../build-mdx-DnC1jKvn.cjs';
|
|
10
|
+
import 'fumadocs-core/server';
|
|
9
11
|
import 'react';
|
|
10
12
|
import 'mdx/types';
|
|
11
|
-
import 'fumadocs-core/server';
|
|
12
13
|
|
|
13
14
|
declare function buildConfig(config: Record<string, unknown>): LoadedConfig;
|
|
14
15
|
|
package/dist/runtime/async.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LoadedConfig, a as RuntimeAsync } from '../types-
|
|
1
|
+
import { L as LoadedConfig, a as RuntimeAsync } from '../types-WSHJKA8L.js';
|
|
2
2
|
import '@standard-schema/spec';
|
|
3
3
|
import 'fumadocs-core/source';
|
|
4
4
|
import '../define-DnJzAZrj.js';
|
|
@@ -6,9 +6,10 @@ import 'fumadocs-core/mdx-plugins';
|
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'unified';
|
|
8
8
|
import 'zod';
|
|
9
|
+
import '../build-mdx-DnC1jKvn.js';
|
|
10
|
+
import 'fumadocs-core/server';
|
|
9
11
|
import 'react';
|
|
10
12
|
import 'mdx/types';
|
|
11
|
-
import 'fumadocs-core/server';
|
|
12
13
|
|
|
13
14
|
declare function buildConfig(config: Record<string, unknown>): LoadedConfig;
|
|
14
15
|
|
package/dist/runtime/async.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "../chunk-NUDEC6C5.js";
|
|
5
5
|
import {
|
|
6
6
|
buildMDX
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-QQWCBFFE.js";
|
|
8
|
+
import "../chunk-SVTXMVLQ.js";
|
|
9
9
|
import {
|
|
10
10
|
buildConfig
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-QVZ7JH4H.js";
|
|
12
12
|
import "../chunk-VWJKRQZR.js";
|
|
13
13
|
|
|
14
14
|
// src/runtime/async.ts
|
package/dist/runtime/vite.d.cts
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { TableOfContents } from 'fumadocs-core/server';
|
|
2
1
|
import { FC, ReactNode } from 'react';
|
|
3
2
|
import { MDXProps } from 'mdx/types';
|
|
4
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
3
|
import { a as DocCollection, b as DocsCollection, M as MetaCollection } from '../define-DnJzAZrj.cjs';
|
|
6
4
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
5
|
import { PageData, MetaData, Source } from 'fumadocs-core/source';
|
|
6
|
+
import { C as CompiledMDXProperties } from '../build-mdx-DnC1jKvn.cjs';
|
|
7
|
+
import 'fumadocs-core/mdx-plugins';
|
|
8
8
|
import '@mdx-js/mdx';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
|
+
import 'fumadocs-core/server';
|
|
11
12
|
|
|
12
|
-
interface CompiledMDXProperties<Frontmatter> {
|
|
13
|
-
frontmatter: Frontmatter;
|
|
14
|
-
structuredData: StructuredData;
|
|
15
|
-
toc: TableOfContents;
|
|
16
|
-
default: FC<MDXProps>;
|
|
17
|
-
/**
|
|
18
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
19
|
-
*/
|
|
20
|
-
lastModified?: Date;
|
|
21
|
-
}
|
|
22
13
|
type CompiledMDXFile<Frontmatter> = CompiledMDXProperties<Frontmatter> & Record<string, unknown>;
|
|
23
14
|
type Override<A, B> = Omit<A, keyof B> & B;
|
|
24
15
|
type MDXFileToPageData<Frontmatter> = Override<Omit<CompiledMDXProperties<Frontmatter>, 'frontmatter' | 'default'>, Frontmatter & {
|
package/dist/runtime/vite.d.ts
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { TableOfContents } from 'fumadocs-core/server';
|
|
2
1
|
import { FC, ReactNode } from 'react';
|
|
3
2
|
import { MDXProps } from 'mdx/types';
|
|
4
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
3
|
import { a as DocCollection, b as DocsCollection, M as MetaCollection } from '../define-DnJzAZrj.js';
|
|
6
4
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
5
|
import { PageData, MetaData, Source } from 'fumadocs-core/source';
|
|
6
|
+
import { C as CompiledMDXProperties } from '../build-mdx-DnC1jKvn.js';
|
|
7
|
+
import 'fumadocs-core/mdx-plugins';
|
|
8
8
|
import '@mdx-js/mdx';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
|
+
import 'fumadocs-core/server';
|
|
11
12
|
|
|
12
|
-
interface CompiledMDXProperties<Frontmatter> {
|
|
13
|
-
frontmatter: Frontmatter;
|
|
14
|
-
structuredData: StructuredData;
|
|
15
|
-
toc: TableOfContents;
|
|
16
|
-
default: FC<MDXProps>;
|
|
17
|
-
/**
|
|
18
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
19
|
-
*/
|
|
20
|
-
lastModified?: Date;
|
|
21
|
-
}
|
|
22
13
|
type CompiledMDXFile<Frontmatter> = CompiledMDXProperties<Frontmatter> & Record<string, unknown>;
|
|
23
14
|
type Override<A, B> = Omit<A, keyof B> & B;
|
|
24
15
|
type MDXFileToPageData<Frontmatter> = Override<Omit<CompiledMDXProperties<Frontmatter>, 'frontmatter' | 'default'>, Frontmatter & {
|
|
@@ -2,10 +2,7 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
2
2
|
import { Source, PageData, MetaData } from 'fumadocs-core/source';
|
|
3
3
|
import { a as DocCollection, M as MetaCollection, b as DocsCollection, G as GlobalConfig } from './define-DnJzAZrj.cjs';
|
|
4
4
|
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
|
-
import {
|
|
6
|
-
import { MDXProps } from 'mdx/types';
|
|
7
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
8
|
-
import { TableOfContents } from 'fumadocs-core/server';
|
|
5
|
+
import { C as CompiledMDXProperties } from './build-mdx-DnC1jKvn.cjs';
|
|
9
6
|
|
|
10
7
|
interface LoadedConfig {
|
|
11
8
|
collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
|
|
@@ -23,14 +20,8 @@ interface FileInfo {
|
|
|
23
20
|
path: string;
|
|
24
21
|
absolutePath: string;
|
|
25
22
|
}
|
|
26
|
-
interface MarkdownProps {
|
|
27
|
-
body:
|
|
28
|
-
structuredData: StructuredData;
|
|
29
|
-
toc: TableOfContents;
|
|
30
|
-
/**
|
|
31
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
32
|
-
*/
|
|
33
|
-
lastModified?: Date;
|
|
23
|
+
interface MarkdownProps extends Omit<CompiledMDXProperties, 'frontmatter' | 'default'> {
|
|
24
|
+
body: CompiledMDXProperties['default'];
|
|
34
25
|
}
|
|
35
26
|
interface RuntimeFile {
|
|
36
27
|
info: FileInfo;
|
|
@@ -2,10 +2,7 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
2
2
|
import { Source, PageData, MetaData } from 'fumadocs-core/source';
|
|
3
3
|
import { a as DocCollection, M as MetaCollection, b as DocsCollection, G as GlobalConfig } from './define-DnJzAZrj.js';
|
|
4
4
|
import { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
|
-
import {
|
|
6
|
-
import { MDXProps } from 'mdx/types';
|
|
7
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
8
|
-
import { TableOfContents } from 'fumadocs-core/server';
|
|
5
|
+
import { C as CompiledMDXProperties } from './build-mdx-DnC1jKvn.js';
|
|
9
6
|
|
|
10
7
|
interface LoadedConfig {
|
|
11
8
|
collections: Map<string, DocCollection | MetaCollection | DocsCollection>;
|
|
@@ -23,14 +20,8 @@ interface FileInfo {
|
|
|
23
20
|
path: string;
|
|
24
21
|
absolutePath: string;
|
|
25
22
|
}
|
|
26
|
-
interface MarkdownProps {
|
|
27
|
-
body:
|
|
28
|
-
structuredData: StructuredData;
|
|
29
|
-
toc: TableOfContents;
|
|
30
|
-
/**
|
|
31
|
-
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
32
|
-
*/
|
|
33
|
-
lastModified?: Date;
|
|
23
|
+
interface MarkdownProps extends Omit<CompiledMDXProperties, 'frontmatter' | 'default'> {
|
|
24
|
+
body: CompiledMDXProperties['default'];
|
|
34
25
|
}
|
|
35
26
|
interface RuntimeFile {
|
|
36
27
|
info: FileInfo;
|