fumadocs-mdx 8.2.23 → 8.2.25

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
@@ -1,13 +1,10 @@
1
- import * as next_dist_shared_lib_image_config from 'next/dist/shared/lib/image-config';
2
- import * as next_dist_lib_load_custom_routes from 'next/dist/lib/load-custom-routes';
3
- import * as next_dist_server_config_shared from 'next/dist/server/config-shared';
4
1
  import { NextConfig } from 'next';
5
2
  import { RemarkHeadingOptions, RemarkImageOptions, RehypeCodeOptions } from 'fumadocs-core/mdx-plugins';
6
3
  import { Pluggable } from 'unified';
7
- import { Configuration } from 'webpack';
8
4
  import { Options as Options$1 } from './loader-mdx.mjs';
9
5
  import { O as Options } from './search-index-plugin-rijIlRD4.mjs';
10
6
  import '@mdx-js/mdx';
7
+ import 'webpack';
11
8
 
12
9
  type MDXOptions = Omit<NonNullable<Options$1>, 'rehypePlugins' | 'remarkPlugins'> & {
13
10
  rehypePlugins?: ResolvePlugins;
@@ -42,108 +39,6 @@ interface CreateMDXOptions {
42
39
  */
43
40
  include?: string | string[];
44
41
  }
45
- declare const createMDX: ({ mdxOptions, cwd, rootMapPath, rootContentPath, buildSearchIndex, ...loadOptions }?: CreateMDXOptions) => (nextConfig?: NextConfig) => {
46
- webpack: (config: Configuration, options: next_dist_server_config_shared.WebpackConfigContext) => any;
47
- exportPathMap?: ((defaultMap: next_dist_server_config_shared.ExportPathMap, ctx: {
48
- dev: boolean;
49
- dir: string;
50
- outDir: string | null;
51
- distDir: string;
52
- buildId: string;
53
- }) => next_dist_server_config_shared.ExportPathMap | Promise<next_dist_server_config_shared.ExportPathMap>) | undefined;
54
- i18n?: next_dist_server_config_shared.I18NConfig | null | undefined;
55
- eslint?: next_dist_server_config_shared.ESLintConfig | undefined;
56
- typescript?: next_dist_server_config_shared.TypeScriptConfig | undefined;
57
- headers?: (() => Promise<next_dist_lib_load_custom_routes.Header[]>) | undefined;
58
- rewrites?: (() => Promise<next_dist_lib_load_custom_routes.Rewrite[] | {
59
- beforeFiles: next_dist_lib_load_custom_routes.Rewrite[];
60
- afterFiles: next_dist_lib_load_custom_routes.Rewrite[];
61
- fallback: next_dist_lib_load_custom_routes.Rewrite[];
62
- }>) | undefined;
63
- redirects?: (() => Promise<next_dist_lib_load_custom_routes.Redirect[]>) | undefined;
64
- excludeDefaultMomentLocales?: boolean | undefined;
65
- trailingSlash?: boolean | undefined;
66
- env?: Record<string, string | undefined> | undefined;
67
- distDir?: string | undefined;
68
- cleanDistDir?: boolean | undefined;
69
- assetPrefix?: string | undefined;
70
- cacheHandler?: string | undefined;
71
- cacheMaxMemorySize?: number | undefined;
72
- useFileSystemPublicRoutes?: boolean | undefined;
73
- generateBuildId?: (() => string | Promise<string | null> | null) | undefined;
74
- generateEtags?: boolean | undefined;
75
- pageExtensions?: string[] | undefined;
76
- compress?: boolean | undefined;
77
- analyticsId?: string | undefined;
78
- poweredByHeader?: boolean | undefined;
79
- images?: Partial<next_dist_shared_lib_image_config.ImageConfigComplete> | undefined;
80
- devIndicators?: {
81
- buildActivity?: boolean | undefined;
82
- buildActivityPosition?: "bottom-right" | "bottom-left" | "top-right" | "top-left" | undefined;
83
- } | undefined;
84
- onDemandEntries?: {
85
- maxInactiveAge?: number | undefined;
86
- pagesBufferLength?: number | undefined;
87
- } | undefined;
88
- amp?: {
89
- canonicalBase?: string | undefined;
90
- } | undefined;
91
- deploymentId?: string | undefined;
92
- basePath?: string | undefined;
93
- sassOptions?: {
94
- [key: string]: any;
95
- } | undefined;
96
- productionBrowserSourceMaps?: boolean | undefined;
97
- optimizeFonts?: boolean | undefined;
98
- reactProductionProfiling?: boolean | undefined;
99
- reactStrictMode?: boolean | null | undefined;
100
- publicRuntimeConfig?: {
101
- [key: string]: any;
102
- } | undefined;
103
- serverRuntimeConfig?: {
104
- [key: string]: any;
105
- } | undefined;
106
- httpAgentOptions?: {
107
- keepAlive?: boolean | undefined;
108
- } | undefined;
109
- outputFileTracing?: boolean | undefined;
110
- staticPageGenerationTimeout?: number | undefined;
111
- crossOrigin?: "anonymous" | "use-credentials" | undefined;
112
- swcMinify?: boolean | undefined;
113
- compiler?: {
114
- reactRemoveProperties?: boolean | {
115
- properties?: string[] | undefined;
116
- } | undefined;
117
- relay?: {
118
- src: string;
119
- artifactDirectory?: string | undefined;
120
- language?: "typescript" | "javascript" | "flow" | undefined;
121
- eagerEsModules?: boolean | undefined;
122
- } | undefined;
123
- removeConsole?: boolean | {
124
- exclude?: string[] | undefined;
125
- } | undefined;
126
- styledComponents?: boolean | next_dist_server_config_shared.StyledComponentsConfig | undefined;
127
- emotion?: boolean | next_dist_server_config_shared.EmotionConfig | undefined;
128
- styledJsx?: boolean | {
129
- useLightningcss?: boolean | undefined;
130
- } | undefined;
131
- } | undefined;
132
- output?: "standalone" | "export" | undefined;
133
- transpilePackages?: string[] | undefined;
134
- skipMiddlewareUrlNormalize?: boolean | undefined;
135
- skipTrailingSlashRedirect?: boolean | undefined;
136
- modularizeImports?: Record<string, {
137
- transform: string | Record<string, string>;
138
- preventFullImport?: boolean | undefined;
139
- skipDefaultConversion?: boolean | undefined;
140
- }> | undefined;
141
- logging?: {
142
- fetches?: {
143
- fullUrl?: boolean | undefined;
144
- } | undefined;
145
- } | undefined;
146
- experimental?: next_dist_server_config_shared.ExperimentalConfig | undefined;
147
- };
42
+ declare function createMDX({ mdxOptions, cwd, rootMapPath, rootContentPath, buildSearchIndex, ...loadOptions }?: CreateMDXOptions): (nextConfig?: NextConfig) => NextConfig;
148
43
 
149
44
  export { type CreateMDXOptions, createMDX as default };
package/dist/config.mjs CHANGED
@@ -118,7 +118,7 @@ var SearchIndexPlugin = class _SearchIndexPlugin {
118
118
  continue;
119
119
  const info = m.buildInfo.__fumadocs;
120
120
  const relativePath = path.relative(rootContentDir, info.path);
121
- if (!filter(relativePath))
121
+ if (relativePath.startsWith("../") || !filter(relativePath))
122
122
  continue;
123
123
  indexFiles.set(info.path, {
124
124
  id: info.path,
@@ -190,20 +190,22 @@ function getMDXLoaderOptions({
190
190
  rehypePlugins
191
191
  };
192
192
  }
193
- var createMDX = ({
193
+ var defaultPageExtensions = ["mdx", "md", "jsx", "js", "tsx", "ts"];
194
+ function createMDX({
194
195
  mdxOptions = {},
195
196
  cwd = process.cwd(),
196
197
  rootMapPath = "./.map.ts",
197
198
  rootContentPath = "./content",
198
199
  buildSearchIndex = false,
199
200
  ...loadOptions
200
- } = {}) => (nextConfig = {}) => {
201
+ } = {}) {
201
202
  const rootMapFile = path2.resolve(cwd, rootMapPath);
202
203
  const rootContentDir = path2.resolve(cwd, rootContentPath);
203
204
  const mdxLoaderOptions = getMDXLoaderOptions(mdxOptions);
204
- return {
205
- ...nextConfig,
206
- ...{
205
+ return (nextConfig = {}) => {
206
+ return {
207
+ ...nextConfig,
208
+ pageExtensions: nextConfig.pageExtensions ?? defaultPageExtensions,
207
209
  webpack: (config, options) => {
208
210
  config.resolve ||= {};
209
211
  const alias = config.resolve.alias;
@@ -253,9 +255,9 @@ var createMDX = ({
253
255
  );
254
256
  return nextConfig.webpack?.(config, options) ?? config;
255
257
  }
256
- }
258
+ };
257
259
  };
258
- };
260
+ }
259
261
  export {
260
262
  createMDX as default
261
263
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "8.2.23",
3
+ "version": "8.2.25",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -43,13 +43,13 @@
43
43
  "fast-glob": "^3.3.1",
44
44
  "gray-matter": "^4.0.3",
45
45
  "zod": "^3.23.8",
46
- "fumadocs-core": "11.2.1"
46
+ "fumadocs-core": "11.3.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.13",
52
- "@types/react": "^18.3.2",
52
+ "@types/react": "^18.3.3",
53
53
  "next": "^14.2.3",
54
54
  "unified": "^11.0.4",
55
55
  "webpack": "^5.90.3",