fumadocs-mdx 8.2.13 → 8.2.15
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/config.d.mts +4 -3
- package/dist/config.mjs +22 -18
- package/package.json +2 -2
package/dist/config.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import * as next_dist_shared_lib_image_config from 'next/dist/shared/lib/image-c
|
|
|
2
2
|
import * as next_dist_lib_load_custom_routes from 'next/dist/lib/load-custom-routes';
|
|
3
3
|
import * as next_dist_server_config_shared from 'next/dist/server/config-shared';
|
|
4
4
|
import { NextConfig } from 'next';
|
|
5
|
-
import { RemarkImageOptions, RehypeCodeOptions } from 'fumadocs-core/mdx-plugins';
|
|
6
|
-
import {
|
|
5
|
+
import { RemarkHeadingOptions, RemarkImageOptions, RehypeCodeOptions } from 'fumadocs-core/mdx-plugins';
|
|
6
|
+
import { Pluggable } from 'unified';
|
|
7
7
|
import { Configuration } from 'webpack';
|
|
8
8
|
import { Options as Options$1 } from './loader-mdx.mjs';
|
|
9
9
|
import { O as Options } from './search-index-plugin-rijIlRD4.mjs';
|
|
@@ -16,10 +16,11 @@ type MDXOptions = Omit<NonNullable<Options$1>, 'rehypePlugins' | 'remarkPlugins'
|
|
|
16
16
|
* Properties to export from `vfile.data`
|
|
17
17
|
*/
|
|
18
18
|
valueToExport?: string[];
|
|
19
|
+
remarkHeadingOptions?: RemarkHeadingOptions;
|
|
19
20
|
remarkImageOptions?: RemarkImageOptions | false;
|
|
20
21
|
rehypeCodeOptions?: RehypeCodeOptions | false;
|
|
21
22
|
};
|
|
22
|
-
type ResolvePlugins =
|
|
23
|
+
type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
|
|
23
24
|
interface CreateMDXOptions {
|
|
24
25
|
cwd?: string;
|
|
25
26
|
mdxOptions?: MDXOptions;
|
package/dist/config.mjs
CHANGED
|
@@ -143,7 +143,9 @@ var SearchIndexPlugin = class _SearchIndexPlugin {
|
|
|
143
143
|
|
|
144
144
|
// src/config.ts
|
|
145
145
|
function pluginOption(def, options = []) {
|
|
146
|
-
const list = def(Array.isArray(options) ? options : [])
|
|
146
|
+
const list = def(Array.isArray(options) ? options : []).filter(
|
|
147
|
+
Boolean
|
|
148
|
+
);
|
|
147
149
|
if (typeof options === "function") {
|
|
148
150
|
return options(list);
|
|
149
151
|
}
|
|
@@ -153,6 +155,7 @@ function getMDXLoaderOptions({
|
|
|
153
155
|
valueToExport = [],
|
|
154
156
|
rehypeCodeOptions,
|
|
155
157
|
remarkImageOptions,
|
|
158
|
+
remarkHeadingOptions,
|
|
156
159
|
...mdxOptions
|
|
157
160
|
}) {
|
|
158
161
|
const mdxExports = [
|
|
@@ -162,23 +165,24 @@ function getMDXLoaderOptions({
|
|
|
162
165
|
"lastModified",
|
|
163
166
|
...valueToExport
|
|
164
167
|
];
|
|
165
|
-
const remarkPlugins = pluginOption(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
168
|
+
const remarkPlugins = pluginOption(
|
|
169
|
+
(v) => [
|
|
170
|
+
remarkGfm,
|
|
171
|
+
[remarkHeading, remarkHeadingOptions],
|
|
172
|
+
remarkImageOptions !== false && [remarkImage, remarkImageOptions],
|
|
173
|
+
...v,
|
|
174
|
+
remarkStructure,
|
|
175
|
+
[remarkMdxExport, { values: mdxExports }]
|
|
176
|
+
],
|
|
177
|
+
mdxOptions.remarkPlugins
|
|
178
|
+
);
|
|
179
|
+
const rehypePlugins = pluginOption(
|
|
180
|
+
(v) => [
|
|
181
|
+
rehypeCodeOptions !== false && [rehypeCode, rehypeCodeOptions],
|
|
182
|
+
...v
|
|
183
|
+
],
|
|
184
|
+
mdxOptions.rehypePlugins
|
|
185
|
+
);
|
|
182
186
|
return {
|
|
183
187
|
providerImportSource: "next-mdx-import-source-file",
|
|
184
188
|
...mdxOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.15",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"fast-glob": "^3.3.1",
|
|
44
44
|
"gray-matter": "^4.0.3",
|
|
45
45
|
"zod": "^3.23.4",
|
|
46
|
-
"fumadocs-core": "11.0.
|
|
46
|
+
"fumadocs-core": "11.0.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/cross-spawn": "^6.0.6",
|