fumadocs-mdx 8.0.0 → 8.0.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/config.d.mts +3 -3
- package/dist/config.mjs +7 -9
- package/dist/loader-mdx.d.mts +1 -10
- package/package.json +3 -3
package/dist/config.d.mts
CHANGED
|
@@ -19,7 +19,7 @@ type MDXOptions = Omit<NonNullable<Options>, 'rehypePlugins' | 'remarkPlugins'>
|
|
|
19
19
|
rehypeCodeOptions?: RehypeCodeOptions;
|
|
20
20
|
};
|
|
21
21
|
type ResolvePlugins = PluggableList | ((v: PluggableList) => PluggableList);
|
|
22
|
-
interface
|
|
22
|
+
interface CreateMDXOptions {
|
|
23
23
|
cwd?: string;
|
|
24
24
|
mdxOptions?: MDXOptions;
|
|
25
25
|
/**
|
|
@@ -35,7 +35,7 @@ interface NextDocsMDXOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
rootContentPath?: string;
|
|
37
37
|
}
|
|
38
|
-
declare const
|
|
38
|
+
declare const createMDX: ({ mdxOptions, cwd, rootMapPath, rootContentPath, }?: CreateMDXOptions) => (nextConfig?: NextConfig) => {
|
|
39
39
|
webpack: (config: Configuration, options: next_dist_server_config_shared.WebpackConfigContext) => any;
|
|
40
40
|
exportPathMap?: ((defaultMap: next_dist_server_config_shared.ExportPathMap, ctx: {
|
|
41
41
|
dev: boolean;
|
|
@@ -135,4 +135,4 @@ declare const createNextDocs: ({ mdxOptions, cwd, rootMapPath, rootContentPath,
|
|
|
135
135
|
experimental?: next_dist_server_config_shared.ExperimentalConfig | undefined;
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
export {
|
|
138
|
+
export { type CreateMDXOptions, createMDX as default };
|
package/dist/config.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
remarkImage
|
|
14
14
|
} from "fumadocs-core/mdx-plugins";
|
|
15
15
|
|
|
16
|
-
// src/webpack-plugins/
|
|
16
|
+
// src/webpack-plugins/map-plugin.ts
|
|
17
17
|
import fs from "fs";
|
|
18
18
|
var firstLoad = true;
|
|
19
19
|
var content = `
|
|
@@ -22,13 +22,13 @@ declare const map: Record<string, unknown>
|
|
|
22
22
|
|
|
23
23
|
export { map }
|
|
24
24
|
`.trim();
|
|
25
|
-
var
|
|
25
|
+
var MapWebpackPlugin = class _MapWebpackPlugin {
|
|
26
26
|
constructor(options) {
|
|
27
27
|
this.options = options;
|
|
28
28
|
}
|
|
29
29
|
apply(compiler) {
|
|
30
|
-
const logger = compiler.getInfrastructureLogger(
|
|
31
|
-
compiler.hooks.beforeCompile.tap(
|
|
30
|
+
const logger = compiler.getInfrastructureLogger(_MapWebpackPlugin.name);
|
|
31
|
+
compiler.hooks.beforeCompile.tap(_MapWebpackPlugin.name, () => {
|
|
32
32
|
if (firstLoad && !fs.existsSync(this.options.rootMapFile)) {
|
|
33
33
|
fs.writeFileSync(this.options.rootMapFile, content);
|
|
34
34
|
logger.info("Created map.ts file for you automatically");
|
|
@@ -93,7 +93,7 @@ function pluginOption(def, options = []) {
|
|
|
93
93
|
}
|
|
94
94
|
return list;
|
|
95
95
|
}
|
|
96
|
-
var
|
|
96
|
+
var createMDX = ({
|
|
97
97
|
mdxOptions = {},
|
|
98
98
|
cwd = process.cwd(),
|
|
99
99
|
rootMapPath = "./.map.ts",
|
|
@@ -164,13 +164,11 @@ var createNextDocs = ({
|
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
166
|
config.plugins || (config.plugins = []);
|
|
167
|
-
config.plugins.push(
|
|
168
|
-
new NextDocsWebpackPlugin({ rootMapFile: _mapPath })
|
|
169
|
-
);
|
|
167
|
+
config.plugins.push(new MapWebpackPlugin({ rootMapFile: _mapPath }));
|
|
170
168
|
return (_c = (_b = nextConfig.webpack) == null ? void 0 : _b.call(nextConfig, config, options)) != null ? _c : config;
|
|
171
169
|
}
|
|
172
170
|
});
|
|
173
171
|
};
|
|
174
172
|
export {
|
|
175
|
-
|
|
173
|
+
createMDX as default
|
|
176
174
|
};
|
package/dist/loader-mdx.d.mts
CHANGED
|
@@ -8,15 +8,6 @@ interface Options extends ProcessorOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
lastModifiedTime?: 'git' | 'none';
|
|
10
10
|
}
|
|
11
|
-
interface NextDocsBuildInfo {
|
|
12
|
-
__next_docs?: {
|
|
13
|
-
path: string;
|
|
14
|
-
/**
|
|
15
|
-
* `vfile.data` parsed from file
|
|
16
|
-
*/
|
|
17
|
-
data: unknown;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
11
|
/**
|
|
21
12
|
* Load MDX/markdown files
|
|
22
13
|
*
|
|
@@ -24,4 +15,4 @@ interface NextDocsBuildInfo {
|
|
|
24
15
|
*/
|
|
25
16
|
declare function loader(this: LoaderContext<Options>, source: string, callback: LoaderContext<Options>['callback']): Promise<void>;
|
|
26
17
|
|
|
27
|
-
export { type
|
|
18
|
+
export { type Options, loader as default };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
7
7
|
"Docs"
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://fumadocs.vercel.app",
|
|
10
|
-
"repository": "github:fuma-nama/
|
|
10
|
+
"repository": "github:fuma-nama/fumadocs",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "Fuma Nama",
|
|
13
13
|
"exports": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"fast-glob": "^3.3.1",
|
|
44
44
|
"gray-matter": "^4.0.3",
|
|
45
45
|
"zod": "^3.22.4",
|
|
46
|
-
"fumadocs-core": "8.
|
|
46
|
+
"fumadocs-core": "8.1.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/cross-spawn": "^6.0.4",
|