fumadocs-mdx 14.1.0 → 14.2.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/{build-mdx-RXJZQXGA.js → build-mdx-5XLFMP5P.js} +2 -2
- package/dist/bun/index.js +4 -4
- package/dist/{chunk-K7N6GD4M.js → chunk-257RZJEQ.js} +1 -1
- package/dist/{chunk-PW2AZGGD.js → chunk-2PY3JUIC.js} +1 -0
- package/dist/{chunk-7W73RILB.js → chunk-4EUH5CD2.js} +1 -1
- package/dist/{chunk-VKSHE52K.js → chunk-KWSETXYC.js} +1 -1
- package/dist/{chunk-VITVHHR6.js → chunk-STLEUNK7.js} +4 -3
- package/dist/{chunk-T6G5VOED.js → chunk-USQZ5OLE.js} +1 -1
- package/dist/{chunk-Y7ISNZ7X.js → chunk-WFDF56IJ.js} +75 -1
- package/dist/{chunk-WAAWFNDX.js → chunk-WSQ23PNV.js} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.js +3 -3
- package/dist/node/loader.js +4 -4
- package/dist/plugins/index-file.js +2 -2
- package/dist/plugins/last-modified.js +1 -1
- package/dist/runtime/dynamic.js +4 -4
- package/dist/vite/index.js +11 -6
- package/dist/webpack/mdx.js +5 -5
- package/dist/webpack/meta.js +4 -4
- package/package.json +13 -13
package/dist/bun/index.js
CHANGED
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import "../chunk-S7KOJHHO.js";
|
|
5
5
|
import {
|
|
6
6
|
createMdxLoader
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-USQZ5OLE.js";
|
|
8
8
|
import {
|
|
9
9
|
createMetaLoader
|
|
10
10
|
} from "../chunk-ZAYZWFWP.js";
|
|
11
11
|
import {
|
|
12
12
|
createIntegratedConfigLoader,
|
|
13
13
|
toBun
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-WSQ23PNV.js";
|
|
15
15
|
import "../chunk-4JSFLXXT.js";
|
|
16
16
|
import {
|
|
17
17
|
_Defaults,
|
|
18
18
|
createCore
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-KWSETXYC.js";
|
|
20
|
+
import "../chunk-2PY3JUIC.js";
|
|
21
21
|
import "../chunk-VWJKRQZR.js";
|
|
22
22
|
|
|
23
23
|
// src/bun/index.ts
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCodegen,
|
|
3
|
-
ident
|
|
4
|
-
|
|
3
|
+
ident,
|
|
4
|
+
slash
|
|
5
|
+
} from "./chunk-2PY3JUIC.js";
|
|
5
6
|
import {
|
|
6
7
|
fumaMatter
|
|
7
8
|
} from "./chunk-VWJKRQZR.js";
|
|
@@ -293,7 +294,7 @@ async function generateBrowserIndexFile(ctx) {
|
|
|
293
294
|
codegen.lines.push("};", "export default browserCollections;");
|
|
294
295
|
}
|
|
295
296
|
function getBase(collection) {
|
|
296
|
-
return path2.relative(process.cwd(), collection.dir);
|
|
297
|
+
return slash(path2.relative(process.cwd(), collection.dir));
|
|
297
298
|
}
|
|
298
299
|
function generateDocCollectionFrontmatterGlob({ codegen, workspace }, collection, eager = false) {
|
|
299
300
|
return codegen.generateGlobImport(collection.patterns, {
|
|
@@ -82,7 +82,7 @@ function createMdxLoader({ getCore }) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
const lineOffset = isDevelopment ? countLines(matter.matter) : 0;
|
|
85
|
-
const { buildMDX } = await import("./build-mdx-
|
|
85
|
+
const { buildMDX } = await import("./build-mdx-5XLFMP5P.js");
|
|
86
86
|
const compiled = await buildMDX(core, docCollection, {
|
|
87
87
|
isDevelopment,
|
|
88
88
|
source: "\n".repeat(lineOffset) + matter.content,
|
|
@@ -63,6 +63,76 @@ function flattenNode(node) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// src/loaders/mdx/remark-include.ts
|
|
66
|
+
var REGION_MARKERS = [
|
|
67
|
+
{
|
|
68
|
+
start: /^\s*\/\/\s*#?region\b\s*(.*?)\s*$/,
|
|
69
|
+
end: /^\s*\/\/\s*#?endregion\b\s*(.*?)\s*$/
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
start: /^\s*<!--\s*#?region\b\s*(.*?)\s*-->/,
|
|
73
|
+
end: /^\s*<!--\s*#?endregion\b\s*(.*?)\s*-->/
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
start: /^\s*\/\*\s*#region\b\s*(.*?)\s*\*\//,
|
|
77
|
+
end: /^\s*\/\*\s*#endregion\b\s*(.*?)\s*\*\//
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
start: /^\s*#[rR]egion\b\s*(.*?)\s*$/,
|
|
81
|
+
end: /^\s*#[eE]nd ?[rR]egion\b\s*(.*?)\s*$/
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
start: /^\s*#\s*#?region\b\s*(.*?)\s*$/,
|
|
85
|
+
end: /^\s*#\s*#?endregion\b\s*(.*?)\s*$/
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
start: /^\s*(?:--|::|@?REM)\s*#region\b\s*(.*?)\s*$/,
|
|
89
|
+
end: /^\s*(?:--|::|@?REM)\s*#endregion\b\s*(.*?)\s*$/
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
start: /^\s*#pragma\s+region\b\s*(.*?)\s*$/,
|
|
93
|
+
end: /^\s*#pragma\s+endregion\b\s*(.*?)\s*$/
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
start: /^\s*\(\*\s*#region\b\s*(.*?)\s*\*\)/,
|
|
97
|
+
end: /^\s*\(\*\s*#endregion\b\s*(.*?)\s*\*\)/
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
function dedent(lines) {
|
|
101
|
+
const minIndent = lines.reduce((min, line) => {
|
|
102
|
+
const match = line.match(/^(\s*)\S/);
|
|
103
|
+
return match ? Math.min(min, match[1].length) : min;
|
|
104
|
+
}, Infinity);
|
|
105
|
+
return minIndent === Infinity ? lines.join("\n") : lines.map((l) => l.slice(minIndent)).join("\n");
|
|
106
|
+
}
|
|
107
|
+
function extractCodeRegion(content, regionName) {
|
|
108
|
+
const lines = content.split("\n");
|
|
109
|
+
for (let i = 0; i < lines.length; i++) {
|
|
110
|
+
for (const re of REGION_MARKERS) {
|
|
111
|
+
let match = re.start.exec(lines[i]);
|
|
112
|
+
if (match?.[1] !== regionName) continue;
|
|
113
|
+
let depth = 1;
|
|
114
|
+
const extractedLines = [];
|
|
115
|
+
for (let j = i + 1; j < lines.length; j++) {
|
|
116
|
+
match = re.start.exec(lines[j]);
|
|
117
|
+
if (match) {
|
|
118
|
+
depth++;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
match = re.end.exec(lines[j]);
|
|
122
|
+
if (match) {
|
|
123
|
+
if (match[1] === regionName) depth = 0;
|
|
124
|
+
else if (match[1] === "") depth--;
|
|
125
|
+
else continue;
|
|
126
|
+
if (depth > 0) continue;
|
|
127
|
+
return dedent(extractedLines);
|
|
128
|
+
} else {
|
|
129
|
+
extractedLines.push(lines[j]);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
throw new Error(`Region "${regionName}" not found`);
|
|
135
|
+
}
|
|
66
136
|
var ElementLikeTypes = [
|
|
67
137
|
"mdxJsxFlowElement",
|
|
68
138
|
"mdxJsxTextElement",
|
|
@@ -144,11 +214,15 @@ ${e instanceof Error ? e.message : String(e)}`,
|
|
|
144
214
|
_compiler?.addDependency(targetPath);
|
|
145
215
|
if (params.lang || ext !== ".md" && ext !== ".mdx") {
|
|
146
216
|
const lang = params.lang ?? ext.slice(1);
|
|
217
|
+
let value = content;
|
|
218
|
+
if (heading) {
|
|
219
|
+
value = extractCodeRegion(content, heading.trim());
|
|
220
|
+
}
|
|
147
221
|
return {
|
|
148
222
|
type: "code",
|
|
149
223
|
lang,
|
|
150
224
|
meta: params.meta,
|
|
151
|
-
value
|
|
225
|
+
value,
|
|
152
226
|
data: {}
|
|
153
227
|
};
|
|
154
228
|
}
|
package/dist/config/index.js
CHANGED
package/dist/next/index.cjs
CHANGED
|
@@ -965,7 +965,7 @@ async function generateBrowserIndexFile(ctx) {
|
|
|
965
965
|
codegen.lines.push("};", "export default browserCollections;");
|
|
966
966
|
}
|
|
967
967
|
function getBase(collection) {
|
|
968
|
-
return import_path.default.relative(process.cwd(), collection.dir);
|
|
968
|
+
return slash(import_path.default.relative(process.cwd(), collection.dir));
|
|
969
969
|
}
|
|
970
970
|
function generateDocCollectionFrontmatterGlob({ codegen, workspace }, collection, eager = false) {
|
|
971
971
|
return codegen.generateGlobImport(collection.patterns, {
|
package/dist/next/index.js
CHANGED
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
_Defaults,
|
|
12
12
|
createCore
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-KWSETXYC.js";
|
|
14
14
|
import {
|
|
15
15
|
indexFile
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-STLEUNK7.js";
|
|
17
|
+
import "../chunk-2PY3JUIC.js";
|
|
18
18
|
import "../chunk-VWJKRQZR.js";
|
|
19
19
|
|
|
20
20
|
// src/next/index.ts
|
package/dist/node/loader.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMdxLoader
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-USQZ5OLE.js";
|
|
4
4
|
import {
|
|
5
5
|
createMetaLoader
|
|
6
6
|
} from "../chunk-ZAYZWFWP.js";
|
|
7
7
|
import {
|
|
8
8
|
createStandaloneConfigLoader,
|
|
9
9
|
toNode
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-WSQ23PNV.js";
|
|
11
11
|
import "../chunk-4JSFLXXT.js";
|
|
12
12
|
import {
|
|
13
13
|
_Defaults,
|
|
14
14
|
createCore
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-KWSETXYC.js";
|
|
16
|
+
import "../chunk-2PY3JUIC.js";
|
|
17
17
|
import "../chunk-VWJKRQZR.js";
|
|
18
18
|
|
|
19
19
|
// src/node/loader.ts
|
package/dist/runtime/dynamic.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildMDX
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-4EUH5CD2.js";
|
|
4
4
|
import {
|
|
5
5
|
server
|
|
6
6
|
} from "../chunk-5OBUOALK.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-WFDF56IJ.js";
|
|
8
8
|
import {
|
|
9
9
|
buildConfig
|
|
10
10
|
} from "../chunk-OLD35ARB.js";
|
|
11
11
|
import "../chunk-S7KOJHHO.js";
|
|
12
12
|
import {
|
|
13
13
|
createCore
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-KWSETXYC.js";
|
|
15
|
+
import "../chunk-2PY3JUIC.js";
|
|
16
16
|
import {
|
|
17
17
|
fumaMatter
|
|
18
18
|
} from "../chunk-VWJKRQZR.js";
|
package/dist/vite/index.js
CHANGED
|
@@ -4,29 +4,34 @@ import {
|
|
|
4
4
|
import "../chunk-S7KOJHHO.js";
|
|
5
5
|
import {
|
|
6
6
|
createMdxLoader
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-USQZ5OLE.js";
|
|
8
8
|
import {
|
|
9
9
|
createMetaLoader
|
|
10
10
|
} from "../chunk-ZAYZWFWP.js";
|
|
11
11
|
import {
|
|
12
12
|
createIntegratedConfigLoader,
|
|
13
13
|
toVite
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-WSQ23PNV.js";
|
|
15
15
|
import "../chunk-4JSFLXXT.js";
|
|
16
16
|
import {
|
|
17
17
|
ValidationError,
|
|
18
18
|
_Defaults,
|
|
19
19
|
createCore
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-KWSETXYC.js";
|
|
21
21
|
import {
|
|
22
22
|
indexFile
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
23
|
+
} from "../chunk-STLEUNK7.js";
|
|
24
|
+
import "../chunk-2PY3JUIC.js";
|
|
25
25
|
import "../chunk-VWJKRQZR.js";
|
|
26
26
|
|
|
27
27
|
// src/vite/index.ts
|
|
28
28
|
import { mergeConfig } from "vite";
|
|
29
|
-
var FumadocsDeps = [
|
|
29
|
+
var FumadocsDeps = [
|
|
30
|
+
"fumadocs-core",
|
|
31
|
+
"fumadocs-ui",
|
|
32
|
+
"fumadocs-openapi",
|
|
33
|
+
"@fumadocs/base-ui"
|
|
34
|
+
];
|
|
30
35
|
async function mdx(config, pluginOptions = {}) {
|
|
31
36
|
const options = applyDefaults(pluginOptions);
|
|
32
37
|
const core = createViteCore(options);
|
package/dist/webpack/mdx.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-257RZJEQ.js";
|
|
4
4
|
import {
|
|
5
5
|
createMdxLoader
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-USQZ5OLE.js";
|
|
7
7
|
import {
|
|
8
8
|
createStandaloneConfigLoader,
|
|
9
9
|
toWebpack
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-WSQ23PNV.js";
|
|
11
11
|
import "../chunk-4JSFLXXT.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-KWSETXYC.js";
|
|
13
|
+
import "../chunk-2PY3JUIC.js";
|
|
14
14
|
import "../chunk-VWJKRQZR.js";
|
|
15
15
|
|
|
16
16
|
// src/webpack/mdx.ts
|
package/dist/webpack/meta.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-257RZJEQ.js";
|
|
4
4
|
import {
|
|
5
5
|
createMetaLoader
|
|
6
6
|
} from "../chunk-ZAYZWFWP.js";
|
|
7
7
|
import {
|
|
8
8
|
createStandaloneConfigLoader,
|
|
9
9
|
toWebpack
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-WSQ23PNV.js";
|
|
11
11
|
import "../chunk-4JSFLXXT.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-KWSETXYC.js";
|
|
13
|
+
import "../chunk-2PY3JUIC.js";
|
|
14
14
|
|
|
15
15
|
// src/webpack/meta.ts
|
|
16
16
|
var instance;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@mdx-js/mdx": "^3.1.1",
|
|
61
|
-
"@standard-schema/spec": "^1.
|
|
61
|
+
"@standard-schema/spec": "^1.1.0",
|
|
62
62
|
"chokidar": "^5.0.0",
|
|
63
|
-
"esbuild": "^0.27.
|
|
63
|
+
"esbuild": "^0.27.2",
|
|
64
64
|
"estree-util-value-to-estree": "^3.5.0",
|
|
65
65
|
"js-yaml": "^4.1.1",
|
|
66
66
|
"mdast-util-to-markdown": "^2.1.2",
|
|
@@ -73,30 +73,30 @@
|
|
|
73
73
|
"unist-util-remove-position": "^5.0.0",
|
|
74
74
|
"unist-util-visit": "^5.0.0",
|
|
75
75
|
"vfile": "^6.0.3",
|
|
76
|
-
"zod": "^4.1
|
|
76
|
+
"zod": "^4.2.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@types/bun": "^1.3.
|
|
79
|
+
"@types/bun": "^1.3.5",
|
|
80
80
|
"@types/js-yaml": "^4.0.9",
|
|
81
81
|
"@types/mdast": "^4.0.4",
|
|
82
82
|
"@types/mdx": "^2.0.13",
|
|
83
|
-
"@types/node": "^24.10.
|
|
83
|
+
"@types/node": "^24.10.2",
|
|
84
84
|
"@types/picomatch": "^4.0.2",
|
|
85
85
|
"@types/react": "^19.2.7",
|
|
86
|
-
"astro": "^5.16.
|
|
86
|
+
"astro": "^5.16.6",
|
|
87
87
|
"mdast-util-directive": "^3.1.0",
|
|
88
88
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
89
|
-
"next": "16.0
|
|
90
|
-
"react": "^19.2.
|
|
89
|
+
"next": "16.1.0",
|
|
90
|
+
"react": "^19.2.3",
|
|
91
91
|
"remark": "^15.0.1",
|
|
92
92
|
"remark-directive": "^4.0.0",
|
|
93
93
|
"remark-stringify": "^11.0.0",
|
|
94
|
-
"rollup": "^4.53.
|
|
95
|
-
"vite": "^7.
|
|
96
|
-
"webpack": "^5.
|
|
94
|
+
"rollup": "^4.53.5",
|
|
95
|
+
"vite": "^7.3.0",
|
|
96
|
+
"webpack": "^5.104.1",
|
|
97
97
|
"@fumadocs/mdx-remote": "1.4.3",
|
|
98
98
|
"eslint-config-custom": "0.0.0",
|
|
99
|
-
"fumadocs-core": "16.
|
|
99
|
+
"fumadocs-core": "16.3.1",
|
|
100
100
|
"tsconfig": "0.0.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|