fumadocs-mdx 11.8.0 → 11.8.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/build-mdx-DMe0r3s_.d.cts +44 -0
- package/dist/build-mdx-DMe0r3s_.d.ts +44 -0
- package/dist/{chunk-XZR5QXVY.js → chunk-BCOXAJMC.js} +1 -1
- package/dist/{chunk-GYWPPGFD.js → chunk-DJNS22RO.js} +18 -1
- package/dist/{chunk-XVL4ZQFK.js → chunk-S73DGUHI.js} +1 -1
- package/dist/config/index.cjs +20 -3
- package/dist/config/index.js +1 -1
- package/dist/config/zod-3.cjs +20 -3
- package/dist/config/zod-3.js +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/loader-mdx.cjs +27 -3
- package/dist/loader-mdx.js +2 -2
- package/dist/{mdx-options-3NB74EMB.js → mdx-options-ILHLYYTL.js} +1 -1
- package/dist/next/index.cjs +25 -1
- package/dist/next/index.js +2 -2
- package/dist/runtime/async.cjs +25 -1
- package/dist/runtime/async.d.cts +3 -2
- package/dist/runtime/async.d.ts +3 -2
- package/dist/runtime/async.js +1 -1
- package/dist/runtime/vite.d.cts +3 -12
- package/dist/runtime/vite.d.ts +3 -12
- package/dist/{types-BukvTPdG.d.cts → types-DvnkeVI3.d.cts} +3 -12
- package/dist/{types-B2ozVm_9.d.ts → types-zBRxlyaM.d.ts} +3 -12
- package/dist/vite/index.cjs +27 -3
- package/dist/vite/index.js +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createProcessor } from '@mdx-js/mdx';
|
|
2
|
+
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
3
|
+
import { TableOfContents } from 'fumadocs-core/server';
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
import { MDXProps } from 'mdx/types';
|
|
6
|
+
|
|
7
|
+
declare module 'vfile' {
|
|
8
|
+
interface DataMap {
|
|
9
|
+
extractedReferences: ExtractedReference[];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface ExtractedReference {
|
|
13
|
+
href: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type Processor = ReturnType<typeof createProcessor>;
|
|
17
|
+
interface CompilerOptions {
|
|
18
|
+
addDependency: (file: string) => void;
|
|
19
|
+
}
|
|
20
|
+
interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
|
|
21
|
+
frontmatter: Frontmatter;
|
|
22
|
+
structuredData: StructuredData;
|
|
23
|
+
toc: TableOfContents;
|
|
24
|
+
default: FC<MDXProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
27
|
+
*/
|
|
28
|
+
lastModified?: Date;
|
|
29
|
+
extractedReferences?: ExtractedReference[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module 'vfile' {
|
|
33
|
+
interface DataMap {
|
|
34
|
+
/**
|
|
35
|
+
* The compiler object from loader
|
|
36
|
+
*/
|
|
37
|
+
_compiler?: CompilerOptions;
|
|
38
|
+
_processor?: {
|
|
39
|
+
getProcessor: (format: 'md' | 'mdx') => Processor;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type { CompiledMDXProperties as C };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createProcessor } from '@mdx-js/mdx';
|
|
2
|
+
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
3
|
+
import { TableOfContents } from 'fumadocs-core/server';
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
import { MDXProps } from 'mdx/types';
|
|
6
|
+
|
|
7
|
+
declare module 'vfile' {
|
|
8
|
+
interface DataMap {
|
|
9
|
+
extractedReferences: ExtractedReference[];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface ExtractedReference {
|
|
13
|
+
href: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type Processor = ReturnType<typeof createProcessor>;
|
|
17
|
+
interface CompilerOptions {
|
|
18
|
+
addDependency: (file: string) => void;
|
|
19
|
+
}
|
|
20
|
+
interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
|
|
21
|
+
frontmatter: Frontmatter;
|
|
22
|
+
structuredData: StructuredData;
|
|
23
|
+
toc: TableOfContents;
|
|
24
|
+
default: FC<MDXProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Only available when `lastModifiedTime` is enabled on MDX loader
|
|
27
|
+
*/
|
|
28
|
+
lastModified?: Date;
|
|
29
|
+
extractedReferences?: ExtractedReference[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module 'vfile' {
|
|
33
|
+
interface DataMap {
|
|
34
|
+
/**
|
|
35
|
+
* The compiler object from loader
|
|
36
|
+
*/
|
|
37
|
+
_compiler?: CompilerOptions;
|
|
38
|
+
_processor?: {
|
|
39
|
+
getProcessor: (format: 'md' | 'mdx') => Processor;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type { CompiledMDXProperties as C };
|
|
@@ -6,7 +6,7 @@ import { valueToEstree } from "estree-util-value-to-estree";
|
|
|
6
6
|
function remarkMdxExport({ values }) {
|
|
7
7
|
return (tree, vfile) => {
|
|
8
8
|
for (const name of values) {
|
|
9
|
-
if (!(name in vfile.data))
|
|
9
|
+
if (!(name in vfile.data)) continue;
|
|
10
10
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -45,6 +45,21 @@ function getMdastExport(name, value) {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// src/mdx-plugins/remark-extract.ts
|
|
49
|
+
import { visit } from "unist-util-visit";
|
|
50
|
+
function remarkExtract() {
|
|
51
|
+
return (tree, file) => {
|
|
52
|
+
const urls = [];
|
|
53
|
+
visit(tree, "link", (node) => {
|
|
54
|
+
urls.push({
|
|
55
|
+
href: node.url
|
|
56
|
+
});
|
|
57
|
+
return "skip";
|
|
58
|
+
});
|
|
59
|
+
file.data.extractedReferences = urls;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
// src/utils/mdx-options.ts
|
|
49
64
|
function pluginOption(def, options = []) {
|
|
50
65
|
const list = def(Array.isArray(options) ? options : []).filter(
|
|
@@ -68,6 +83,7 @@ function getDefaultMDXOptions({
|
|
|
68
83
|
}) {
|
|
69
84
|
const mdxExports = [
|
|
70
85
|
"structuredData",
|
|
86
|
+
"extractedReferences",
|
|
71
87
|
"frontmatter",
|
|
72
88
|
"lastModified",
|
|
73
89
|
...valueToExport
|
|
@@ -95,6 +111,7 @@ function getDefaultMDXOptions({
|
|
|
95
111
|
],
|
|
96
112
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
97
113
|
...v,
|
|
114
|
+
remarkExtract,
|
|
98
115
|
remarkStructureOptions !== false && [
|
|
99
116
|
plugins.remarkStructure,
|
|
100
117
|
remarkStructureOptions
|
|
@@ -34,7 +34,7 @@ function buildConfig(config) {
|
|
|
34
34
|
const input = this.global.mdxOptions;
|
|
35
35
|
async function uncached() {
|
|
36
36
|
const options = typeof input === "function" ? await input() : input;
|
|
37
|
-
const { getDefaultMDXOptions } = await import("./mdx-options-
|
|
37
|
+
const { getDefaultMDXOptions } = await import("./mdx-options-ILHLYYTL.js");
|
|
38
38
|
if (options?.preset === "minimal") return options;
|
|
39
39
|
return getDefaultMDXOptions({
|
|
40
40
|
...options,
|
package/dist/config/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ var import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
|
98
98
|
function remarkMdxExport({ values }) {
|
|
99
99
|
return (tree, vfile) => {
|
|
100
100
|
for (const name of values) {
|
|
101
|
-
if (!(name in vfile.data))
|
|
101
|
+
if (!(name in vfile.data)) continue;
|
|
102
102
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
103
103
|
}
|
|
104
104
|
};
|
|
@@ -137,6 +137,21 @@ function getMdastExport(name, value) {
|
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
// src/mdx-plugins/remark-extract.ts
|
|
141
|
+
var import_unist_util_visit = require("unist-util-visit");
|
|
142
|
+
function remarkExtract() {
|
|
143
|
+
return (tree, file) => {
|
|
144
|
+
const urls = [];
|
|
145
|
+
(0, import_unist_util_visit.visit)(tree, "link", (node) => {
|
|
146
|
+
urls.push({
|
|
147
|
+
href: node.url
|
|
148
|
+
});
|
|
149
|
+
return "skip";
|
|
150
|
+
});
|
|
151
|
+
file.data.extractedReferences = urls;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
140
155
|
// src/utils/mdx-options.ts
|
|
141
156
|
function pluginOption(def, options = []) {
|
|
142
157
|
const list = def(Array.isArray(options) ? options : []).filter(
|
|
@@ -160,6 +175,7 @@ function getDefaultMDXOptions({
|
|
|
160
175
|
}) {
|
|
161
176
|
const mdxExports = [
|
|
162
177
|
"structuredData",
|
|
178
|
+
"extractedReferences",
|
|
163
179
|
"frontmatter",
|
|
164
180
|
"lastModified",
|
|
165
181
|
...valueToExport
|
|
@@ -187,6 +203,7 @@ function getDefaultMDXOptions({
|
|
|
187
203
|
],
|
|
188
204
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
189
205
|
...v,
|
|
206
|
+
remarkExtract,
|
|
190
207
|
remarkStructureOptions !== false && [
|
|
191
208
|
plugins.remarkStructure,
|
|
192
209
|
remarkStructureOptions
|
|
@@ -212,7 +229,7 @@ function getDefaultMDXOptions({
|
|
|
212
229
|
}
|
|
213
230
|
|
|
214
231
|
// src/mdx-plugins/remark-include.ts
|
|
215
|
-
var
|
|
232
|
+
var import_unist_util_visit2 = require("unist-util-visit");
|
|
216
233
|
var path = __toESM(require("path"), 1);
|
|
217
234
|
var fs = __toESM(require("fs/promises"), 1);
|
|
218
235
|
|
|
@@ -263,7 +280,7 @@ function remarkInclude() {
|
|
|
263
280
|
const TagName = "include";
|
|
264
281
|
async function update(tree, directory, data) {
|
|
265
282
|
const queue = [];
|
|
266
|
-
(0,
|
|
283
|
+
(0, import_unist_util_visit2.visit)(
|
|
267
284
|
tree,
|
|
268
285
|
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
269
286
|
(node, _, parent) => {
|
package/dist/config/index.js
CHANGED
package/dist/config/zod-3.cjs
CHANGED
|
@@ -99,7 +99,7 @@ var import_estree_util_value_to_estree = require("estree-util-value-to-estree");
|
|
|
99
99
|
function remarkMdxExport({ values }) {
|
|
100
100
|
return (tree, vfile) => {
|
|
101
101
|
for (const name of values) {
|
|
102
|
-
if (!(name in vfile.data))
|
|
102
|
+
if (!(name in vfile.data)) continue;
|
|
103
103
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
104
104
|
}
|
|
105
105
|
};
|
|
@@ -138,6 +138,21 @@ function getMdastExport(name, value) {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// src/mdx-plugins/remark-extract.ts
|
|
142
|
+
var import_unist_util_visit = require("unist-util-visit");
|
|
143
|
+
function remarkExtract() {
|
|
144
|
+
return (tree, file) => {
|
|
145
|
+
const urls = [];
|
|
146
|
+
(0, import_unist_util_visit.visit)(tree, "link", (node) => {
|
|
147
|
+
urls.push({
|
|
148
|
+
href: node.url
|
|
149
|
+
});
|
|
150
|
+
return "skip";
|
|
151
|
+
});
|
|
152
|
+
file.data.extractedReferences = urls;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
141
156
|
// src/utils/mdx-options.ts
|
|
142
157
|
function pluginOption(def, options = []) {
|
|
143
158
|
const list = def(Array.isArray(options) ? options : []).filter(
|
|
@@ -161,6 +176,7 @@ function getDefaultMDXOptions({
|
|
|
161
176
|
}) {
|
|
162
177
|
const mdxExports = [
|
|
163
178
|
"structuredData",
|
|
179
|
+
"extractedReferences",
|
|
164
180
|
"frontmatter",
|
|
165
181
|
"lastModified",
|
|
166
182
|
...valueToExport
|
|
@@ -188,6 +204,7 @@ function getDefaultMDXOptions({
|
|
|
188
204
|
],
|
|
189
205
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
190
206
|
...v,
|
|
207
|
+
remarkExtract,
|
|
191
208
|
remarkStructureOptions !== false && [
|
|
192
209
|
plugins.remarkStructure,
|
|
193
210
|
remarkStructureOptions
|
|
@@ -213,7 +230,7 @@ function getDefaultMDXOptions({
|
|
|
213
230
|
}
|
|
214
231
|
|
|
215
232
|
// src/mdx-plugins/remark-include.ts
|
|
216
|
-
var
|
|
233
|
+
var import_unist_util_visit2 = require("unist-util-visit");
|
|
217
234
|
var path = __toESM(require("path"), 1);
|
|
218
235
|
var fs = __toESM(require("fs/promises"), 1);
|
|
219
236
|
|
|
@@ -264,7 +281,7 @@ function remarkInclude() {
|
|
|
264
281
|
const TagName = "include";
|
|
265
282
|
async function update(tree, directory, data) {
|
|
266
283
|
const queue = [];
|
|
267
|
-
(0,
|
|
284
|
+
(0, import_unist_util_visit2.visit)(
|
|
268
285
|
tree,
|
|
269
286
|
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
270
287
|
(node, _, parent) => {
|
package/dist/config/zod-3.js
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { R as Runtime, B as BaseCollectionEntry } from './types-
|
|
2
|
+
import { R as Runtime, B as BaseCollectionEntry } from './types-DvnkeVI3.cjs';
|
|
3
3
|
import '@standard-schema/spec';
|
|
4
4
|
import './define-DnJzAZrj.cjs';
|
|
5
5
|
import 'fumadocs-core/mdx-plugins';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'unified';
|
|
8
8
|
import 'zod';
|
|
9
|
+
import './build-mdx-DMe0r3s_.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 const _runtime: Runtime;
|
|
14
15
|
declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { R as Runtime, B as BaseCollectionEntry } from './types-
|
|
2
|
+
import { R as Runtime, B as BaseCollectionEntry } from './types-zBRxlyaM.js';
|
|
3
3
|
import '@standard-schema/spec';
|
|
4
4
|
import './define-DnJzAZrj.js';
|
|
5
5
|
import 'fumadocs-core/mdx-plugins';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'unified';
|
|
8
8
|
import 'zod';
|
|
9
|
+
import './build-mdx-DMe0r3s_.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 const _runtime: Runtime;
|
|
14
15
|
declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
|
package/dist/loader-mdx.cjs
CHANGED
|
@@ -34,7 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
function remarkMdxExport({ values }) {
|
|
35
35
|
return (tree, vfile) => {
|
|
36
36
|
for (const name of values) {
|
|
37
|
-
if (!(name in vfile.data))
|
|
37
|
+
if (!(name in vfile.data)) continue;
|
|
38
38
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -80,6 +80,27 @@ var init_remark_exports = __esm({
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
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"() {
|
|
99
|
+
"use strict";
|
|
100
|
+
import_unist_util_visit = require("unist-util-visit");
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
83
104
|
// src/utils/mdx-options.ts
|
|
84
105
|
var mdx_options_exports = {};
|
|
85
106
|
__export(mdx_options_exports, {
|
|
@@ -107,6 +128,7 @@ function getDefaultMDXOptions({
|
|
|
107
128
|
}) {
|
|
108
129
|
const mdxExports = [
|
|
109
130
|
"structuredData",
|
|
131
|
+
"extractedReferences",
|
|
110
132
|
"frontmatter",
|
|
111
133
|
"lastModified",
|
|
112
134
|
...valueToExport
|
|
@@ -134,6 +156,7 @@ function getDefaultMDXOptions({
|
|
|
134
156
|
],
|
|
135
157
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
136
158
|
...v,
|
|
159
|
+
remarkExtract,
|
|
137
160
|
remarkStructureOptions !== false && [
|
|
138
161
|
plugins.remarkStructure,
|
|
139
162
|
remarkStructureOptions
|
|
@@ -163,6 +186,7 @@ var init_mdx_options = __esm({
|
|
|
163
186
|
"use strict";
|
|
164
187
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
165
188
|
init_remark_exports();
|
|
189
|
+
init_remark_extract();
|
|
166
190
|
}
|
|
167
191
|
});
|
|
168
192
|
|
|
@@ -309,7 +333,7 @@ async function getConfigHash(configPath) {
|
|
|
309
333
|
var import_mdx = require("@mdx-js/mdx");
|
|
310
334
|
|
|
311
335
|
// src/mdx-plugins/remark-include.ts
|
|
312
|
-
var
|
|
336
|
+
var import_unist_util_visit2 = require("unist-util-visit");
|
|
313
337
|
var path2 = __toESM(require("path"), 1);
|
|
314
338
|
var fs2 = __toESM(require("fs/promises"), 1);
|
|
315
339
|
|
|
@@ -360,7 +384,7 @@ function remarkInclude() {
|
|
|
360
384
|
const TagName = "include";
|
|
361
385
|
async function update(tree, directory, data) {
|
|
362
386
|
const queue = [];
|
|
363
|
-
(0,
|
|
387
|
+
(0, import_unist_util_visit2.visit)(
|
|
364
388
|
tree,
|
|
365
389
|
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
366
390
|
(node, _, parent) => {
|
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-BCOXAJMC.js";
|
|
5
5
|
import {
|
|
6
6
|
countLines
|
|
7
7
|
} from "./chunk-UCY7OBZG.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
buildMDX
|
|
15
15
|
} from "./chunk-7JFPDRW7.js";
|
|
16
16
|
import "./chunk-IGXZS2W6.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-S73DGUHI.js";
|
|
18
18
|
import {
|
|
19
19
|
fumaMatter
|
|
20
20
|
} from "./chunk-VWJKRQZR.js";
|
package/dist/next/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
function remarkMdxExport({ values }) {
|
|
35
35
|
return (tree, vfile) => {
|
|
36
36
|
for (const name of values) {
|
|
37
|
-
if (!(name in vfile.data))
|
|
37
|
+
if (!(name in vfile.data)) continue;
|
|
38
38
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -80,6 +80,27 @@ var init_remark_exports = __esm({
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
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"() {
|
|
99
|
+
"use strict";
|
|
100
|
+
import_unist_util_visit = require("unist-util-visit");
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
83
104
|
// src/utils/mdx-options.ts
|
|
84
105
|
var mdx_options_exports = {};
|
|
85
106
|
__export(mdx_options_exports, {
|
|
@@ -107,6 +128,7 @@ function getDefaultMDXOptions({
|
|
|
107
128
|
}) {
|
|
108
129
|
const mdxExports = [
|
|
109
130
|
"structuredData",
|
|
131
|
+
"extractedReferences",
|
|
110
132
|
"frontmatter",
|
|
111
133
|
"lastModified",
|
|
112
134
|
...valueToExport
|
|
@@ -134,6 +156,7 @@ function getDefaultMDXOptions({
|
|
|
134
156
|
],
|
|
135
157
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
136
158
|
...v,
|
|
159
|
+
remarkExtract,
|
|
137
160
|
remarkStructureOptions !== false && [
|
|
138
161
|
plugins.remarkStructure,
|
|
139
162
|
remarkStructureOptions
|
|
@@ -163,6 +186,7 @@ var init_mdx_options = __esm({
|
|
|
163
186
|
"use strict";
|
|
164
187
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
165
188
|
init_remark_exports();
|
|
189
|
+
init_remark_extract();
|
|
166
190
|
}
|
|
167
191
|
});
|
|
168
192
|
|
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-BCOXAJMC.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-S73DGUHI.js";
|
|
18
18
|
import {
|
|
19
19
|
fumaMatter
|
|
20
20
|
} from "../chunk-VWJKRQZR.js";
|
package/dist/runtime/async.cjs
CHANGED
|
@@ -34,7 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
function remarkMdxExport({ values }) {
|
|
35
35
|
return (tree, vfile) => {
|
|
36
36
|
for (const name of values) {
|
|
37
|
-
if (!(name in vfile.data))
|
|
37
|
+
if (!(name in vfile.data)) continue;
|
|
38
38
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -80,6 +80,27 @@ var init_remark_exports = __esm({
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
+
// src/mdx-plugins/remark-extract.ts
|
|
84
|
+
function remarkExtract() {
|
|
85
|
+
return (tree, file) => {
|
|
86
|
+
const urls = [];
|
|
87
|
+
(0, import_unist_util_visit2.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_visit2;
|
|
97
|
+
var init_remark_extract = __esm({
|
|
98
|
+
"src/mdx-plugins/remark-extract.ts"() {
|
|
99
|
+
"use strict";
|
|
100
|
+
import_unist_util_visit2 = require("unist-util-visit");
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
83
104
|
// src/utils/mdx-options.ts
|
|
84
105
|
var mdx_options_exports = {};
|
|
85
106
|
__export(mdx_options_exports, {
|
|
@@ -107,6 +128,7 @@ function getDefaultMDXOptions({
|
|
|
107
128
|
}) {
|
|
108
129
|
const mdxExports = [
|
|
109
130
|
"structuredData",
|
|
131
|
+
"extractedReferences",
|
|
110
132
|
"frontmatter",
|
|
111
133
|
"lastModified",
|
|
112
134
|
...valueToExport
|
|
@@ -134,6 +156,7 @@ function getDefaultMDXOptions({
|
|
|
134
156
|
],
|
|
135
157
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
136
158
|
...v,
|
|
159
|
+
remarkExtract,
|
|
137
160
|
remarkStructureOptions !== false && [
|
|
138
161
|
plugins.remarkStructure,
|
|
139
162
|
remarkStructureOptions
|
|
@@ -163,6 +186,7 @@ var init_mdx_options = __esm({
|
|
|
163
186
|
"use strict";
|
|
164
187
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
165
188
|
init_remark_exports();
|
|
189
|
+
init_remark_extract();
|
|
166
190
|
}
|
|
167
191
|
});
|
|
168
192
|
|
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-DvnkeVI3.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-DMe0r3s_.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-zBRxlyaM.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-DMe0r3s_.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
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-DMe0r3s_.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-DMe0r3s_.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-DMe0r3s_.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-DMe0r3s_.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;
|
package/dist/vite/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
function remarkMdxExport({ values }) {
|
|
35
35
|
return (tree, vfile) => {
|
|
36
36
|
for (const name of values) {
|
|
37
|
-
if (!(name in vfile.data))
|
|
37
|
+
if (!(name in vfile.data)) continue;
|
|
38
38
|
tree.children.unshift(getMdastExport(name, vfile.data[name]));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -80,6 +80,27 @@ var init_remark_exports = __esm({
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
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"() {
|
|
99
|
+
"use strict";
|
|
100
|
+
import_unist_util_visit = require("unist-util-visit");
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
83
104
|
// src/utils/mdx-options.ts
|
|
84
105
|
var mdx_options_exports = {};
|
|
85
106
|
__export(mdx_options_exports, {
|
|
@@ -107,6 +128,7 @@ function getDefaultMDXOptions({
|
|
|
107
128
|
}) {
|
|
108
129
|
const mdxExports = [
|
|
109
130
|
"structuredData",
|
|
131
|
+
"extractedReferences",
|
|
110
132
|
"frontmatter",
|
|
111
133
|
"lastModified",
|
|
112
134
|
...valueToExport
|
|
@@ -134,6 +156,7 @@ function getDefaultMDXOptions({
|
|
|
134
156
|
],
|
|
135
157
|
"remarkNpm" in plugins && remarkNpmOptions !== false && [plugins.remarkNpm, remarkNpmOptions],
|
|
136
158
|
...v,
|
|
159
|
+
remarkExtract,
|
|
137
160
|
remarkStructureOptions !== false && [
|
|
138
161
|
plugins.remarkStructure,
|
|
139
162
|
remarkStructureOptions
|
|
@@ -163,6 +186,7 @@ var init_mdx_options = __esm({
|
|
|
163
186
|
"use strict";
|
|
164
187
|
plugins = __toESM(require("fumadocs-core/mdx-plugins"), 1);
|
|
165
188
|
init_remark_exports();
|
|
189
|
+
init_remark_extract();
|
|
166
190
|
}
|
|
167
191
|
});
|
|
168
192
|
|
|
@@ -227,7 +251,7 @@ function buildConfig(config) {
|
|
|
227
251
|
var import_mdx = require("@mdx-js/mdx");
|
|
228
252
|
|
|
229
253
|
// src/mdx-plugins/remark-include.ts
|
|
230
|
-
var
|
|
254
|
+
var import_unist_util_visit2 = require("unist-util-visit");
|
|
231
255
|
var path = __toESM(require("path"), 1);
|
|
232
256
|
var fs = __toESM(require("fs/promises"), 1);
|
|
233
257
|
|
|
@@ -278,7 +302,7 @@ function remarkInclude() {
|
|
|
278
302
|
const TagName = "include";
|
|
279
303
|
async function update(tree, directory, data) {
|
|
280
304
|
const queue = [];
|
|
281
|
-
(0,
|
|
305
|
+
(0, import_unist_util_visit2.visit)(
|
|
282
306
|
tree,
|
|
283
307
|
["mdxJsxFlowElement", "mdxJsxTextElement"],
|
|
284
308
|
(node, _, parent) => {
|
package/dist/vite/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "11.8.
|
|
3
|
+
"version": "11.8.1",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -67,25 +67,25 @@
|
|
|
67
67
|
"tinyexec": "^1.0.1",
|
|
68
68
|
"tinyglobby": "^0.2.14",
|
|
69
69
|
"unist-util-visit": "^5.0.0",
|
|
70
|
-
"zod": "^4.0
|
|
70
|
+
"zod": "^4.1.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/js-yaml": "^4.0.9",
|
|
74
74
|
"@types/mdast": "^4.0.3",
|
|
75
75
|
"@types/mdx": "^2.0.13",
|
|
76
76
|
"@types/node": "^24.3.0",
|
|
77
|
-
"@types/react": "^19.1.
|
|
77
|
+
"@types/react": "^19.1.11",
|
|
78
78
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
79
79
|
"next": "^15.5.0",
|
|
80
80
|
"react": "^19.1.1",
|
|
81
|
-
"rollup": "^4.
|
|
81
|
+
"rollup": "^4.48.0",
|
|
82
82
|
"unified": "^11.0.5",
|
|
83
83
|
"vfile": "^6.0.3",
|
|
84
84
|
"vite": "^7.1.3",
|
|
85
85
|
"webpack": "^5.101.3",
|
|
86
86
|
"@fumadocs/mdx-remote": "1.4.0",
|
|
87
87
|
"eslint-config-custom": "0.0.0",
|
|
88
|
-
"fumadocs-core": "15.7.
|
|
88
|
+
"fumadocs-core": "15.7.3",
|
|
89
89
|
"tsconfig": "0.0.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|