fumadocs-mdx 11.8.1 → 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-DMe0r3s_.d.cts → build-mdx-DnC1jKvn.d.cts} +6 -4
- package/dist/{build-mdx-DMe0r3s_.d.ts → build-mdx-DnC1jKvn.d.ts} +6 -4
- package/dist/{chunk-BCOXAJMC.js → chunk-BWRDVK5L.js} +1 -1
- package/dist/{chunk-7JFPDRW7.js → chunk-QQWCBFFE.js} +2 -4
- package/dist/{chunk-S73DGUHI.js → chunk-QVZ7JH4H.js} +1 -1
- package/dist/{chunk-DJNS22RO.js → chunk-SMSNZ6N5.js} +37 -23
- package/dist/chunk-SVTXMVLQ.js +139 -0
- package/dist/config/index.cjs +118 -84
- 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 +118 -84
- 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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/loader-mdx.cjs +127 -102
- package/dist/loader-mdx.js +8 -8
- package/dist/{mdx-options-ILHLYYTL.js → mdx-options-T73E4LQB.js} +1 -1
- package/dist/next/index.cjs +41 -34
- package/dist/next/index.js +2 -2
- package/dist/runtime/async.cjs +121 -96
- package/dist/runtime/async.d.cts +2 -2
- package/dist/runtime/async.d.ts +2 -2
- package/dist/runtime/async.js +3 -3
- package/dist/runtime/vite.d.cts +1 -1
- package/dist/runtime/vite.d.ts +1 -1
- package/dist/{types-DvnkeVI3.d.cts → types-BmVgoqsr.d.cts} +1 -1
- package/dist/{types-zBRxlyaM.d.ts → types-WSHJKA8L.d.ts} +1 -1
- package/dist/vite/index.cjs +123 -98
- package/dist/vite/index.js +3 -3
- package/package.json +9 -7
- package/dist/chunk-IGXZS2W6.js +0 -119
package/dist/loader-mdx.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,32 +98,12 @@ 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-
|
|
78
|
-
"use strict";
|
|
79
|
-
import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// src/mdx-plugins/remark-extract.ts
|
|
84
|
-
function remarkExtract() {
|
|
85
|
-
return (tree, file) => {
|
|
86
|
-
const urls = [];
|
|
87
|
-
(0, import_unist_util_visit.visit)(tree, "link", (node) => {
|
|
88
|
-
urls.push({
|
|
89
|
-
href: node.url
|
|
90
|
-
});
|
|
91
|
-
return "skip";
|
|
92
|
-
});
|
|
93
|
-
file.data.extractedReferences = urls;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
var import_unist_util_visit;
|
|
97
|
-
var init_remark_extract = __esm({
|
|
98
|
-
"src/mdx-plugins/remark-extract.ts"() {
|
|
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"() {
|
|
99
104
|
"use strict";
|
|
100
105
|
import_unist_util_visit = require("unist-util-visit");
|
|
106
|
+
import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
101
107
|
}
|
|
102
108
|
});
|
|
103
109
|
|
|
@@ -156,12 +162,14 @@ function getDefaultMDXOptions({
|
|
|
156
162
|
],
|
|
157
163
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
158
164
|
...v,
|
|
159
|
-
remarkExtract,
|
|
160
165
|
remarkStructureOptions !== false && [
|
|
161
166
|
plugins.remarkStructure,
|
|
162
167
|
remarkStructureOptions
|
|
163
168
|
],
|
|
164
|
-
[
|
|
169
|
+
[
|
|
170
|
+
remarkPostprocess,
|
|
171
|
+
{ injectExports: mdxExports }
|
|
172
|
+
]
|
|
165
173
|
],
|
|
166
174
|
mdxOptions.remarkPlugins
|
|
167
175
|
);
|
|
@@ -185,8 +193,7 @@ var init_mdx_options = __esm({
|
|
|
185
193
|
"src/utils/mdx-options.ts"() {
|
|
186
194
|
"use strict";
|
|
187
195
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
188
|
-
|
|
189
|
-
init_remark_extract();
|
|
196
|
+
init_remark_postprocess();
|
|
190
197
|
}
|
|
191
198
|
});
|
|
192
199
|
|
|
@@ -333,6 +340,7 @@ async function getConfigHash(configPath) {
|
|
|
333
340
|
var import_mdx = require("@mdx-js/mdx");
|
|
334
341
|
|
|
335
342
|
// src/mdx-plugins/remark-include.ts
|
|
343
|
+
var import_unified = require("unified");
|
|
336
344
|
var import_unist_util_visit2 = require("unist-util-visit");
|
|
337
345
|
var path2 = __toESM(require("path"), 1);
|
|
338
346
|
var fs2 = __toESM(require("fs/promises"), 1);
|
|
@@ -354,9 +362,13 @@ function fumaMatter(input) {
|
|
|
354
362
|
}
|
|
355
363
|
|
|
356
364
|
// src/mdx-plugins/remark-include.ts
|
|
357
|
-
|
|
365
|
+
var import_remark_parse = __toESM(require("remark-parse"), 1);
|
|
366
|
+
var import_remark_mdx = __toESM(require("remark-mdx"), 1);
|
|
367
|
+
var import_mdx_plugins = require("fumadocs-core/mdx-plugins");
|
|
368
|
+
var baseProcessor = (0, import_unified.unified)().use(import_mdx_plugins.remarkHeading);
|
|
369
|
+
function flattenNode2(node) {
|
|
358
370
|
if ("children" in node)
|
|
359
|
-
return node.children.map((child) =>
|
|
371
|
+
return node.children.map((child) => flattenNode2(child)).join("");
|
|
360
372
|
if ("value" in node) return node.value;
|
|
361
373
|
return "";
|
|
362
374
|
}
|
|
@@ -369,86 +381,96 @@ function parseSpecifier(specifier) {
|
|
|
369
381
|
};
|
|
370
382
|
}
|
|
371
383
|
function extractSection(root, section) {
|
|
384
|
+
let nodes;
|
|
372
385
|
for (const node of root.children) {
|
|
373
386
|
if (node.type === "mdxJsxFlowElement" && node.name === "section" && node.attributes.some(
|
|
374
387
|
(attr) => attr.type === "mdxJsxAttribute" && attr.name === "id" && attr.value === section
|
|
375
388
|
)) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
children: node.children
|
|
379
|
-
};
|
|
389
|
+
nodes = node.children;
|
|
390
|
+
break;
|
|
380
391
|
}
|
|
392
|
+
if (node.type === "heading" && node.data?.hProperties?.id === section) {
|
|
393
|
+
nodes = [node];
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
if (!nodes) continue;
|
|
397
|
+
if (node.type === "heading") break;
|
|
398
|
+
nodes.push(node);
|
|
381
399
|
}
|
|
400
|
+
if (nodes)
|
|
401
|
+
return {
|
|
402
|
+
type: "root",
|
|
403
|
+
children: nodes
|
|
404
|
+
};
|
|
382
405
|
}
|
|
383
406
|
function remarkInclude() {
|
|
384
407
|
const TagName = "include";
|
|
408
|
+
async function embedContent(file, heading, params, data) {
|
|
409
|
+
let content;
|
|
410
|
+
try {
|
|
411
|
+
content = (await fs2.readFile(file)).toString();
|
|
412
|
+
} catch (e) {
|
|
413
|
+
throw new Error(
|
|
414
|
+
`failed to read file ${file}
|
|
415
|
+
${e instanceof Error ? e.message : String(e)}`,
|
|
416
|
+
{ cause: e }
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
const ext = path2.extname(file);
|
|
420
|
+
data._compiler?.addDependency(file);
|
|
421
|
+
if (params.lang || ext !== ".md" && ext !== ".mdx") {
|
|
422
|
+
const lang = params.lang ?? ext.slice(1);
|
|
423
|
+
return {
|
|
424
|
+
type: "code",
|
|
425
|
+
lang,
|
|
426
|
+
meta: params.meta,
|
|
427
|
+
value: content,
|
|
428
|
+
data: {}
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
const processor = (data._getProcessor ?? getDefaultProcessor)(
|
|
432
|
+
ext === ".mdx" ? "mdx" : "md"
|
|
433
|
+
);
|
|
434
|
+
let parsed = await baseProcessor.run(
|
|
435
|
+
processor.parse(fumaMatter(content).content)
|
|
436
|
+
);
|
|
437
|
+
if (heading) {
|
|
438
|
+
const extracted = extractSection(parsed, heading);
|
|
439
|
+
if (!extracted)
|
|
440
|
+
throw new Error(
|
|
441
|
+
`Cannot find section ${heading} in ${file}, make sure you have encapsulated the section in a <section id="${heading}"> tag.`
|
|
442
|
+
);
|
|
443
|
+
parsed = extracted;
|
|
444
|
+
}
|
|
445
|
+
await update(parsed, path2.dirname(file), data);
|
|
446
|
+
return parsed;
|
|
447
|
+
}
|
|
385
448
|
async function update(tree, directory, data) {
|
|
386
449
|
const queue = [];
|
|
387
450
|
(0, import_unist_util_visit2.visit)(
|
|
388
451
|
tree,
|
|
389
452
|
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
390
|
-
(
|
|
391
|
-
|
|
453
|
+
(_node, _, parent) => {
|
|
454
|
+
const node = _node;
|
|
455
|
+
if (node.name !== TagName) return;
|
|
392
456
|
const params = {};
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
params[attr.name] = attr.value;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
specifier = value;
|
|
457
|
+
const specifier = flattenNode2(node);
|
|
458
|
+
if (specifier.length === 0) return "skip";
|
|
459
|
+
for (const attr of node.attributes) {
|
|
460
|
+
if (attr.type === "mdxJsxAttribute" && (typeof attr.value === "string" || attr.value === null)) {
|
|
461
|
+
params[attr.name] = attr.value;
|
|
402
462
|
}
|
|
403
463
|
}
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
const targetPath = path2.resolve(
|
|
464
|
+
const { file: relativePath, section } = parseSpecifier(specifier);
|
|
465
|
+
const file = path2.resolve(
|
|
407
466
|
"cwd" in params ? process.cwd() : directory,
|
|
408
|
-
|
|
467
|
+
relativePath
|
|
409
468
|
);
|
|
410
|
-
const asCode = params.lang || !file.endsWith(".md") && !file.endsWith(".mdx");
|
|
411
469
|
queue.push(
|
|
412
|
-
|
|
413
|
-
data._compiler?.addDependency(targetPath);
|
|
414
|
-
if (asCode) {
|
|
415
|
-
const lang = params.lang ?? path2.extname(file).slice(1);
|
|
416
|
-
Object.assign(node, {
|
|
417
|
-
type: "code",
|
|
418
|
-
lang,
|
|
419
|
-
meta: params.meta,
|
|
420
|
-
value: content,
|
|
421
|
-
data: {}
|
|
422
|
-
});
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
const processor = data._processor ? data._processor.getProcessor(
|
|
426
|
-
targetPath.endsWith(".md") ? "md" : "mdx"
|
|
427
|
-
) : this;
|
|
428
|
-
let parsed = processor.parse(fumaMatter(content).content);
|
|
429
|
-
if (section) {
|
|
430
|
-
const extracted = extractSection(parsed, section);
|
|
431
|
-
if (!extracted)
|
|
432
|
-
throw new Error(
|
|
433
|
-
`Cannot find section ${section} in ${file}, make sure you have encapsulated the section in a <section id="${section}"> tag`
|
|
434
|
-
);
|
|
435
|
-
parsed = extracted;
|
|
436
|
-
}
|
|
437
|
-
await update.call(
|
|
438
|
-
processor,
|
|
439
|
-
parsed,
|
|
440
|
-
path2.dirname(targetPath),
|
|
441
|
-
data
|
|
442
|
-
);
|
|
470
|
+
embedContent(file, section, params, data).then((replace) => {
|
|
443
471
|
Object.assign(
|
|
444
472
|
parent && parent.type === "paragraph" ? parent : node,
|
|
445
|
-
|
|
446
|
-
);
|
|
447
|
-
}).catch((e) => {
|
|
448
|
-
throw new Error(
|
|
449
|
-
`failed to read file ${targetPath}
|
|
450
|
-
${e instanceof Error ? e.message : String(e)}`,
|
|
451
|
-
{ cause: e }
|
|
473
|
+
replace
|
|
452
474
|
);
|
|
453
475
|
})
|
|
454
476
|
);
|
|
@@ -458,9 +480,14 @@ ${e instanceof Error ? e.message : String(e)}`,
|
|
|
458
480
|
await Promise.all(queue);
|
|
459
481
|
}
|
|
460
482
|
return async (tree, file) => {
|
|
461
|
-
await update
|
|
483
|
+
await update(tree, path2.dirname(file.path), file.data);
|
|
462
484
|
};
|
|
463
485
|
}
|
|
486
|
+
function getDefaultProcessor(format) {
|
|
487
|
+
const mdProcessor = (0, import_unified.unified)().use(import_remark_parse.default);
|
|
488
|
+
if (format === "md") return mdProcessor;
|
|
489
|
+
return mdProcessor.use(import_remark_mdx.default);
|
|
490
|
+
}
|
|
464
491
|
|
|
465
492
|
// src/utils/build-mdx.ts
|
|
466
493
|
var cache2 = /* @__PURE__ */ new Map();
|
|
@@ -489,9 +516,7 @@ async function buildMDX(cacheKey, source, options) {
|
|
|
489
516
|
...data,
|
|
490
517
|
frontmatter,
|
|
491
518
|
_compiler,
|
|
492
|
-
|
|
493
|
-
getProcessor
|
|
494
|
-
}
|
|
519
|
+
_getProcessor: getProcessor
|
|
495
520
|
}
|
|
496
521
|
});
|
|
497
522
|
}
|
|
@@ -583,13 +608,13 @@ async function loader(source, callback) {
|
|
|
583
608
|
if (collection && collection.type !== "doc") {
|
|
584
609
|
collection = void 0;
|
|
585
610
|
}
|
|
586
|
-
let
|
|
611
|
+
let frontmatter = matter.data;
|
|
587
612
|
const mdxOptions = collection?.mdxOptions ?? await config.getDefaultMDXOptions();
|
|
588
613
|
if (collection?.schema) {
|
|
589
614
|
try {
|
|
590
|
-
|
|
615
|
+
frontmatter = await validate(
|
|
591
616
|
collection.schema,
|
|
592
|
-
|
|
617
|
+
frontmatter,
|
|
593
618
|
{
|
|
594
619
|
source,
|
|
595
620
|
path: filePath
|
|
@@ -618,7 +643,7 @@ async function loader(source, callback) {
|
|
|
618
643
|
development: this.mode === "development",
|
|
619
644
|
...mdxOptions,
|
|
620
645
|
filePath,
|
|
621
|
-
frontmatter
|
|
646
|
+
frontmatter,
|
|
622
647
|
data: {
|
|
623
648
|
lastModified: timestamp
|
|
624
649
|
},
|
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,32 +98,12 @@ 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-
|
|
78
|
-
"use strict";
|
|
79
|
-
import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// src/mdx-plugins/remark-extract.ts
|
|
84
|
-
function remarkExtract() {
|
|
85
|
-
return (tree, file) => {
|
|
86
|
-
const urls = [];
|
|
87
|
-
(0, import_unist_util_visit.visit)(tree, "link", (node) => {
|
|
88
|
-
urls.push({
|
|
89
|
-
href: node.url
|
|
90
|
-
});
|
|
91
|
-
return "skip";
|
|
92
|
-
});
|
|
93
|
-
file.data.extractedReferences = urls;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
var import_unist_util_visit;
|
|
97
|
-
var init_remark_extract = __esm({
|
|
98
|
-
"src/mdx-plugins/remark-extract.ts"() {
|
|
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"() {
|
|
99
104
|
"use strict";
|
|
100
105
|
import_unist_util_visit = require("unist-util-visit");
|
|
106
|
+
import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
101
107
|
}
|
|
102
108
|
});
|
|
103
109
|
|
|
@@ -156,12 +162,14 @@ function getDefaultMDXOptions({
|
|
|
156
162
|
],
|
|
157
163
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
158
164
|
...v,
|
|
159
|
-
remarkExtract,
|
|
160
165
|
remarkStructureOptions !== false && [
|
|
161
166
|
plugins.remarkStructure,
|
|
162
167
|
remarkStructureOptions
|
|
163
168
|
],
|
|
164
|
-
[
|
|
169
|
+
[
|
|
170
|
+
remarkPostprocess,
|
|
171
|
+
{ injectExports: mdxExports }
|
|
172
|
+
]
|
|
165
173
|
],
|
|
166
174
|
mdxOptions.remarkPlugins
|
|
167
175
|
);
|
|
@@ -185,8 +193,7 @@ var init_mdx_options = __esm({
|
|
|
185
193
|
"src/utils/mdx-options.ts"() {
|
|
186
194
|
"use strict";
|
|
187
195
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
188
|
-
|
|
189
|
-
init_remark_extract();
|
|
196
|
+
init_remark_postprocess();
|
|
190
197
|
}
|
|
191
198
|
});
|
|
192
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";
|