fumadocs-mdx 8.2.3 → 8.2.5
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
CHANGED
|
@@ -6,7 +6,7 @@ import { RemarkImageOptions, RehypeCodeOptions } from 'fumadocs-core/mdx-plugins
|
|
|
6
6
|
import { PluggableList } from 'unified';
|
|
7
7
|
import { Configuration } from 'webpack';
|
|
8
8
|
import { Options as Options$1 } from './loader-mdx.mjs';
|
|
9
|
-
import { O as Options } from './search-index-plugin-
|
|
9
|
+
import { O as Options } from './search-index-plugin-rijIlRD4.mjs';
|
|
10
10
|
import '@mdx-js/mdx';
|
|
11
11
|
|
|
12
12
|
type MDXOptions = Omit<NonNullable<Options$1>, 'rehypePlugins' | 'remarkPlugins'> & {
|
|
@@ -36,8 +36,12 @@ interface CreateMDXOptions {
|
|
|
36
36
|
* @defaultValue `'./content'`
|
|
37
37
|
*/
|
|
38
38
|
rootContentPath?: string;
|
|
39
|
+
/**
|
|
40
|
+
* {@link LoaderOptions.include}
|
|
41
|
+
*/
|
|
42
|
+
include?: string | string[];
|
|
39
43
|
}
|
|
40
|
-
declare const createMDX: ({ mdxOptions, cwd, rootMapPath, rootContentPath, buildSearchIndex, }?: CreateMDXOptions) => (nextConfig?: NextConfig) => {
|
|
44
|
+
declare const createMDX: ({ mdxOptions, cwd, rootMapPath, rootContentPath, buildSearchIndex, ...loadOptions }?: CreateMDXOptions) => (nextConfig?: NextConfig) => {
|
|
41
45
|
webpack: (config: Configuration, options: next_dist_server_config_shared.WebpackConfigContext) => any;
|
|
42
46
|
exportPathMap?: ((defaultMap: next_dist_server_config_shared.ExportPathMap, ctx: {
|
|
43
47
|
dev: boolean;
|
|
@@ -83,6 +87,7 @@ declare const createMDX: ({ mdxOptions, cwd, rootMapPath, rootContentPath, build
|
|
|
83
87
|
amp?: {
|
|
84
88
|
canonicalBase?: string | undefined;
|
|
85
89
|
} | undefined;
|
|
90
|
+
deploymentId?: string | undefined;
|
|
86
91
|
basePath?: string | undefined;
|
|
87
92
|
sassOptions?: {
|
|
88
93
|
[key: string]: any;
|
|
@@ -111,7 +116,7 @@ declare const createMDX: ({ mdxOptions, cwd, rootMapPath, rootContentPath, build
|
|
|
111
116
|
relay?: {
|
|
112
117
|
src: string;
|
|
113
118
|
artifactDirectory?: string | undefined;
|
|
114
|
-
language?: "
|
|
119
|
+
language?: "typescript" | "javascript" | "flow" | undefined;
|
|
115
120
|
eagerEsModules?: boolean | undefined;
|
|
116
121
|
} | undefined;
|
|
117
122
|
removeConsole?: boolean | {
|
package/dist/config.mjs
CHANGED
|
@@ -162,24 +162,23 @@ function getMDXLoaderOptions({
|
|
|
162
162
|
"lastModified",
|
|
163
163
|
...valueToExport
|
|
164
164
|
];
|
|
165
|
-
const remarkPlugins = pluginOption(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
);
|
|
165
|
+
const remarkPlugins = pluginOption((v) => {
|
|
166
|
+
const plugins = [remarkGfm, remarkHeading];
|
|
167
|
+
if (remarkImageOptions !== false)
|
|
168
|
+
plugins.push([remarkImage, remarkImageOptions]);
|
|
169
|
+
plugins.push(...v, remarkStructure, [
|
|
170
|
+
remarkMdxExport,
|
|
171
|
+
{ values: mdxExports }
|
|
172
|
+
]);
|
|
173
|
+
return plugins;
|
|
174
|
+
}, mdxOptions.remarkPlugins);
|
|
175
|
+
const rehypePlugins = pluginOption((v) => {
|
|
176
|
+
const plugins = [...v];
|
|
177
|
+
if (rehypeCodeOptions !== false) {
|
|
178
|
+
plugins.unshift([rehypeCode, rehypeCodeOptions]);
|
|
179
|
+
}
|
|
180
|
+
return plugins;
|
|
181
|
+
}, mdxOptions.rehypePlugins);
|
|
183
182
|
return {
|
|
184
183
|
providerImportSource: "next-mdx-import-source-file",
|
|
185
184
|
...mdxOptions,
|
|
@@ -192,7 +191,8 @@ var createMDX = ({
|
|
|
192
191
|
cwd = process.cwd(),
|
|
193
192
|
rootMapPath = "./.map.ts",
|
|
194
193
|
rootContentPath = "./content",
|
|
195
|
-
buildSearchIndex = false
|
|
194
|
+
buildSearchIndex = false,
|
|
195
|
+
...loadOptions
|
|
196
196
|
} = {}) => (nextConfig = {}) => {
|
|
197
197
|
const rootMapFile = path2.resolve(cwd, rootMapPath);
|
|
198
198
|
const rootContentDir = path2.resolve(cwd, rootContentPath);
|
|
@@ -227,7 +227,8 @@ var createMDX = ({
|
|
|
227
227
|
loader: "fumadocs-mdx/loader",
|
|
228
228
|
options: {
|
|
229
229
|
rootContentDir,
|
|
230
|
-
rootMapFile
|
|
230
|
+
rootMapFile,
|
|
231
|
+
...loadOptions
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { MDXProps } from 'mdx/types';
|
|
4
4
|
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
5
5
|
import { TableOfContents } from 'fumadocs-core/server';
|
|
6
|
-
export { S as SearchIndex } from './search-index-plugin-
|
|
6
|
+
export { S as SearchIndex } from './search-index-plugin-rijIlRD4.mjs';
|
|
7
7
|
|
|
8
8
|
declare const defaultSchemas: {
|
|
9
9
|
frontmatter: z.ZodObject<{
|
|
@@ -53,7 +53,7 @@ type SourceFile<Meta extends MetaData, Fronmatter extends PageData> = {
|
|
|
53
53
|
* Defalt MDX properties
|
|
54
54
|
*/
|
|
55
55
|
interface MDXExport<Frontmatter = PageData> {
|
|
56
|
-
default: (props: MDXProps) =>
|
|
56
|
+
default: (props: MDXProps) => React.ReactElement;
|
|
57
57
|
frontmatter: Frontmatter;
|
|
58
58
|
lastModified: number | undefined;
|
|
59
59
|
toc: TableOfContents;
|
package/dist/loader.d.mts
CHANGED
|
@@ -3,6 +3,12 @@ import { LoaderContext } from 'webpack';
|
|
|
3
3
|
interface LoaderOptions {
|
|
4
4
|
rootContentDir: string;
|
|
5
5
|
rootMapFile: string;
|
|
6
|
+
/**
|
|
7
|
+
* Included files in the map file
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue './**/*.{md,mdx,json}'
|
|
10
|
+
*/
|
|
11
|
+
include?: string | string[];
|
|
6
12
|
}
|
|
7
13
|
/**
|
|
8
14
|
* Load the root `.map.ts` file
|
package/dist/loader.mjs
CHANGED
|
@@ -7,9 +7,13 @@ function loader(_source, callback) {
|
|
|
7
7
|
this.addContextDependency(options.rootContentDir);
|
|
8
8
|
callback(null, buildMap(options));
|
|
9
9
|
}
|
|
10
|
-
function buildMap({
|
|
10
|
+
function buildMap({
|
|
11
|
+
rootContentDir,
|
|
12
|
+
rootMapFile,
|
|
13
|
+
include = ["./**/*.{md,mdx,json}"]
|
|
14
|
+
}) {
|
|
11
15
|
const mapDir = path.dirname(rootMapFile);
|
|
12
|
-
const files = fg.sync(
|
|
16
|
+
const files = fg.sync(include, {
|
|
13
17
|
cwd: rootContentDir
|
|
14
18
|
});
|
|
15
19
|
const imports = [];
|
|
@@ -19,7 +23,7 @@ function buildMap({ rootContentDir, rootMapFile }) {
|
|
|
19
23
|
if (!importPath.startsWith(".")) {
|
|
20
24
|
importPath = `./${importPath}`;
|
|
21
25
|
}
|
|
22
|
-
const name = `file_${i}`;
|
|
26
|
+
const name = `file_${i.toString()}`;
|
|
23
27
|
imports.push(`import * as ${name} from ${JSON.stringify(importPath)};`);
|
|
24
28
|
entries.push(`${JSON.stringify(file)}: ${name}`);
|
|
25
29
|
});
|
|
@@ -8,17 +8,14 @@ interface SearchIndex {
|
|
|
8
8
|
structuredData: StructuredData;
|
|
9
9
|
}
|
|
10
10
|
interface Options {
|
|
11
|
+
rootContentDir: string;
|
|
12
|
+
rootMapFile: string;
|
|
11
13
|
/**
|
|
12
14
|
* Only build search indexes in production builds
|
|
13
15
|
*
|
|
14
16
|
* @defaultValue true
|
|
15
17
|
*/
|
|
16
18
|
productionOnly?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Absolute path of root content directory
|
|
19
|
-
*/
|
|
20
|
-
rootContentDir: string;
|
|
21
|
-
rootMapFile: string;
|
|
22
19
|
/**
|
|
23
20
|
* @param path - MDX file path relative to root content dir
|
|
24
21
|
* @returns page URL
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.5",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"fast-glob": "^3.3.1",
|
|
44
44
|
"gray-matter": "^4.0.3",
|
|
45
45
|
"zod": "^3.22.4",
|
|
46
|
-
"fumadocs-core": "10.0
|
|
46
|
+
"fumadocs-core": "10.1.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/cross-spawn": "^6.0.6",
|
|
50
50
|
"@types/mdast": "^4.0.3",
|
|
51
51
|
"@types/mdx": "^2.0.11",
|
|
52
|
-
"@types/react": "^18.2.
|
|
53
|
-
"next": "^14.1.
|
|
52
|
+
"@types/react": "^18.2.67",
|
|
53
|
+
"next": "^14.1.4",
|
|
54
54
|
"unified": "^11.0.4",
|
|
55
55
|
"webpack": "^5.90.3",
|
|
56
56
|
"eslint-config-custom": "0.0.0",
|