fumadocs-mdx 14.0.1 → 14.0.3

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.
Files changed (72) hide show
  1. package/dist/{build-mdx-6UAK5FF5.js → build-mdx-W3233QBZ.js} +1 -1
  2. package/dist/bun/index.d.ts +1 -1
  3. package/dist/bun/index.js +8 -8
  4. package/dist/{chunk-ZY6UZ7NH.js → chunk-6RPNS75C.js} +1 -1
  5. package/dist/{chunk-7UKSZSPY.js → chunk-DKA3EWZH.js} +6 -7
  6. package/dist/{chunk-BEBCWQC7.js → chunk-GB4W3YCZ.js} +1 -1
  7. package/dist/{chunk-SLY7WXTX.js → chunk-KOPLIEVQ.js} +5 -6
  8. package/dist/{chunk-MTTISKQJ.js → chunk-LPX7ZO66.js} +1 -1
  9. package/dist/{chunk-K6HCOGOX.js → chunk-OLL7FM7W.js} +2 -2
  10. package/dist/{chunk-IQGEFL2B.js → chunk-Q5OSGLJL.js} +1 -1
  11. package/dist/{chunk-E5DJTSIM.js → chunk-S7KOJHHO.js} +4 -1
  12. package/dist/{chunk-6NISOLQ6.js → chunk-USWQVJWR.js} +1 -1
  13. package/dist/config/index.d.ts +1 -1
  14. package/dist/config/index.js +1 -1
  15. package/dist/{core-B9ZoS6sA.d.ts → core-C3QZSdEx.d.ts} +1 -1
  16. package/dist/{index-BD8Woo4m.d.cts → index-DG1I0CwF.d.ts} +2 -2
  17. package/dist/index.d.ts +1 -1
  18. package/dist/load-from-file-OZ5N7DXU.js +8 -0
  19. package/dist/next/index.cjs +10 -8
  20. package/dist/next/index.d.ts +1 -1
  21. package/dist/next/index.js +8 -8
  22. package/dist/node/loader.js +4 -4
  23. package/dist/plugins/index-file.d.ts +1 -1
  24. package/dist/plugins/index-file.js +2 -2
  25. package/dist/plugins/json-schema.d.ts +1 -1
  26. package/dist/plugins/last-modified.d.ts +5 -2
  27. package/dist/plugins/last-modified.js +10 -3
  28. package/dist/runtime/browser.d.ts +1 -1
  29. package/dist/runtime/dynamic.d.ts +1 -1
  30. package/dist/runtime/dynamic.js +5 -5
  31. package/dist/runtime/server.d.ts +1 -1
  32. package/dist/vite/index.d.ts +1 -1
  33. package/dist/vite/index.js +10 -10
  34. package/dist/webpack/mdx.d.ts +2 -2
  35. package/dist/webpack/mdx.js +6 -6
  36. package/dist/webpack/meta.d.ts +2 -2
  37. package/dist/webpack/meta.js +4 -4
  38. package/package.json +4 -6
  39. package/dist/bin.cjs +0 -1958
  40. package/dist/bin.d.cts +0 -1
  41. package/dist/bun/index.cjs +0 -1147
  42. package/dist/bun/index.d.cts +0 -25
  43. package/dist/config/index.cjs +0 -400
  44. package/dist/config/index.d.cts +0 -18
  45. package/dist/core-DTuP23zu.d.cts +0 -341
  46. package/dist/index-CNOvhtOn.d.ts +0 -8
  47. package/dist/index.cjs +0 -18
  48. package/dist/index.d.cts +0 -61
  49. package/dist/load-from-file-5HUQN36V.js +0 -8
  50. package/dist/next/index.d.cts +0 -33
  51. package/dist/node/loader.cjs +0 -1200
  52. package/dist/node/loader.d.cts +0 -5
  53. package/dist/plugins/index-file.cjs +0 -495
  54. package/dist/plugins/index-file.d.cts +0 -14
  55. package/dist/plugins/json-schema.cjs +0 -114
  56. package/dist/plugins/json-schema.d.cts +0 -31
  57. package/dist/plugins/last-modified.cjs +0 -110
  58. package/dist/plugins/last-modified.d.cts +0 -37
  59. package/dist/runtime/browser.cjs +0 -93
  60. package/dist/runtime/browser.d.cts +0 -53
  61. package/dist/runtime/dynamic.cjs +0 -1023
  62. package/dist/runtime/dynamic.d.cts +0 -27
  63. package/dist/runtime/server.cjs +0 -176
  64. package/dist/runtime/server.d.cts +0 -14
  65. package/dist/runtime/types.cjs +0 -18
  66. package/dist/runtime/types.d.cts +0 -61
  67. package/dist/vite/index.cjs +0 -1687
  68. package/dist/vite/index.d.cts +0 -44
  69. package/dist/webpack/mdx.cjs +0 -1124
  70. package/dist/webpack/mdx.d.cts +0 -20
  71. package/dist/webpack/meta.cjs +0 -684
  72. package/dist/webpack/meta.d.cts +0 -20
@@ -1,341 +0,0 @@
1
- import { ProcessorOptions } from '@mdx-js/mdx';
2
- import { StandardSchemaV1 } from '@standard-schema/spec';
3
- import { Pluggable } from 'unified';
4
- import * as Plugins from 'fumadocs-core/mdx-plugins';
5
- import { z } from 'zod';
6
- import { FSWatcher } from 'chokidar';
7
- import { VFile } from 'vfile';
8
- import { PageData, MetaData, Source } from 'fumadocs-core/source';
9
- import { InternalTypeConfig, DocData, DocMethods, MetaMethods } from './runtime/types.cjs';
10
-
11
- type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
12
- type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | 'remarkPlugins' | '_ctx'> & {
13
- rehypePlugins?: ResolvePlugins;
14
- remarkPlugins?: ResolvePlugins;
15
- /**
16
- * Properties to export from `vfile.data`
17
- */
18
- valueToExport?: string[];
19
- remarkStructureOptions?: Plugins.StructureOptions | false;
20
- remarkHeadingOptions?: Plugins.RemarkHeadingOptions;
21
- remarkImageOptions?: Plugins.RemarkImageOptions | false;
22
- remarkCodeTabOptions?: Plugins.RemarkCodeTabOptions | false;
23
- remarkNpmOptions?: Plugins.RemarkNpmOptions | false;
24
- rehypeCodeOptions?: Plugins.RehypeCodeOptions | false;
25
- };
26
- type MDXPresetOptions = ({
27
- preset?: 'fumadocs';
28
- } & DefaultMDXOptions) | ({
29
- preset: 'minimal';
30
- } & ProcessorOptions);
31
- /**
32
- * apply MDX processor presets
33
- */
34
- declare function applyMdxPreset(options?: MDXPresetOptions): (environment: BuildEnvironment) => Promise<ProcessorOptions>;
35
-
36
- /**
37
- * Zod 4 schema
38
- */
39
- declare const metaSchema: z.ZodObject<{
40
- title: z.ZodOptional<z.ZodString>;
41
- pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
- description: z.ZodOptional<z.ZodString>;
43
- root: z.ZodOptional<z.ZodBoolean>;
44
- defaultOpen: z.ZodOptional<z.ZodBoolean>;
45
- icon: z.ZodOptional<z.ZodString>;
46
- }, z.core.$strip>;
47
- /**
48
- * Zod 4 schema
49
- */
50
- declare const frontmatterSchema: z.ZodObject<{
51
- title: z.ZodString;
52
- description: z.ZodOptional<z.ZodString>;
53
- icon: z.ZodOptional<z.ZodString>;
54
- full: z.ZodOptional<z.ZodBoolean>;
55
- _openapi: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
56
- }, z.core.$strip>;
57
-
58
- interface ExtractedReference {
59
- href: string;
60
- }
61
- interface PostprocessOptions {
62
- _format: 'md' | 'mdx';
63
- /**
64
- * Properties to export from `vfile.data`
65
- */
66
- valueToExport?: string[];
67
- /**
68
- * stringify MDAST and export via `_markdown`.
69
- */
70
- includeProcessedMarkdown?: boolean;
71
- /**
72
- * extract link references, export via `extractedReferences`.
73
- */
74
- extractLinkReferences?: boolean;
75
- /**
76
- * store MDAST and export via `_mdast`.
77
- */
78
- includeMDAST?: boolean | {
79
- removePosition?: boolean;
80
- };
81
- }
82
-
83
- type CollectionSchema<Schema extends StandardSchemaV1, Context> = Schema | ((ctx: Context) => Schema);
84
- type AnyCollection = DocsCollection | DocCollection | MetaCollection;
85
- interface BaseCollection {
86
- /**
87
- * Directory to scan
88
- */
89
- dir: string;
90
- /**
91
- * what files to include/exclude (glob patterns)
92
- *
93
- * Include all files if not specified
94
- */
95
- files?: string[];
96
- }
97
- interface MetaCollection<Schema extends StandardSchemaV1 = StandardSchemaV1> extends BaseCollection {
98
- type: 'meta';
99
- schema?: CollectionSchema<Schema, {
100
- path: string;
101
- source: string;
102
- }>;
103
- }
104
- interface DocCollection<Schema extends StandardSchemaV1 = StandardSchemaV1> extends BaseCollection {
105
- type: 'doc';
106
- postprocess?: Partial<PostprocessOptions>;
107
- mdxOptions?: ProcessorOptions | ((environment: BuildEnvironment) => Promise<ProcessorOptions>);
108
- /**
109
- * Load files with async
110
- */
111
- async?: boolean;
112
- /**
113
- * Compile files on-demand
114
- */
115
- dynamic?: boolean;
116
- schema?: CollectionSchema<Schema, {
117
- path: string;
118
- source: string;
119
- }>;
120
- }
121
- interface DocsCollection<DocSchema extends StandardSchemaV1 = StandardSchemaV1, MetaSchema extends StandardSchemaV1 = StandardSchemaV1> {
122
- type: 'docs';
123
- dir: string;
124
- docs: DocCollection<DocSchema>;
125
- meta: MetaCollection<MetaSchema>;
126
- }
127
- interface GlobalConfig {
128
- plugins?: PluginOption[];
129
- /**
130
- * Configure global MDX options
131
- *
132
- * @remarks `MDXPresetOptions`
133
- */
134
- mdxOptions?: MDXPresetOptions | (() => Promise<MDXPresetOptions>);
135
- /**
136
- * specify a directory to access & store cache (disabled during development mode).
137
- *
138
- * The cache will never be updated, delete the cache folder to clean.
139
- */
140
- experimentalBuildCache?: string;
141
- }
142
- declare function defineCollections<Schema extends StandardSchemaV1 = StandardSchemaV1>(options: DocCollection<Schema>): DocCollection<Schema>;
143
- declare function defineCollections<Schema extends StandardSchemaV1 = StandardSchemaV1>(options: MetaCollection<Schema>): MetaCollection<Schema>;
144
- declare function defineDocs<DocSchema extends StandardSchemaV1 = typeof frontmatterSchema, MetaSchema extends StandardSchemaV1 = typeof metaSchema>(options: {
145
- /**
146
- * The content directory to scan files
147
- *
148
- * @defaultValue 'content/docs'
149
- */
150
- dir?: string;
151
- docs?: Omit<DocCollection<DocSchema>, 'dir' | 'type'>;
152
- meta?: Omit<MetaCollection<MetaSchema>, 'dir' | 'type'>;
153
- }): DocsCollection<DocSchema, MetaSchema>;
154
- declare function defineConfig(config?: GlobalConfig): GlobalConfig;
155
-
156
- type BuildEnvironment = 'bundler' | 'runtime';
157
- interface LoadedConfig {
158
- collectionList: CollectionItem[];
159
- getCollection(name: string): CollectionItem | undefined;
160
- global: GlobalConfig;
161
- getMDXOptions(collection?: DocCollectionItem, environment?: BuildEnvironment): ProcessorOptions | Promise<ProcessorOptions>;
162
- }
163
- type CollectionItem = MetaCollectionItem | DocCollectionItem | DocsCollectionItem;
164
- type PrimitiveCollectionItem<T extends DocCollection | MetaCollection> = Omit<T, 'files'> & {
165
- name: string;
166
- hasFile: (filePath: string) => boolean;
167
- isFileSupported: (filePath: string) => boolean;
168
- patterns: string[];
169
- };
170
- type MetaCollectionItem = PrimitiveCollectionItem<MetaCollection>;
171
- type DocCollectionItem = PrimitiveCollectionItem<DocCollection>;
172
- interface DocsCollectionItem extends DocsCollection {
173
- name: string;
174
- meta: MetaCollectionItem;
175
- docs: DocCollectionItem;
176
- hasFile: (filePath: string) => boolean;
177
- }
178
-
179
- type MetaCollectionEntry<Data> = Data & MetaMethods;
180
- type DocCollectionEntry<Name extends string = string, Frontmatter = unknown, TC extends InternalTypeConfig = InternalTypeConfig> = DocData & DocMethods & Frontmatter & TC['DocData'][Name];
181
- type AsyncDocCollectionEntry<Name extends string = string, Frontmatter = unknown, TC extends InternalTypeConfig = InternalTypeConfig> = {
182
- load: () => Promise<DocData & TC['DocData'][Name]>;
183
- } & DocMethods & Frontmatter;
184
- interface DocsCollectionEntry<Name extends string = string, Frontmatter extends PageData = PageData, Meta extends MetaData = MetaData, TC extends InternalTypeConfig = InternalTypeConfig> {
185
- docs: DocCollectionEntry<Name, Frontmatter, TC>[];
186
- meta: MetaCollectionEntry<Meta>[];
187
- toFumadocsSource: () => Source<{
188
- pageData: DocCollectionEntry<Name, Frontmatter, TC>;
189
- metaData: MetaCollectionEntry<Meta>;
190
- }>;
191
- }
192
- interface AsyncDocsCollectionEntry<Name extends string = string, Frontmatter extends PageData = PageData, Meta extends MetaData = MetaData, TC extends InternalTypeConfig = InternalTypeConfig> {
193
- docs: AsyncDocCollectionEntry<Name, Frontmatter, TC>[];
194
- meta: MetaCollectionEntry<Meta>[];
195
- toFumadocsSource: () => Source<{
196
- pageData: AsyncDocCollectionEntry<Name, Frontmatter, TC>;
197
- metaData: MetaCollectionEntry<Meta>;
198
- }>;
199
- }
200
- type AwaitableGlobEntries<T> = Record<string, T | (() => Promise<T>)>;
201
- type ServerCreate<Config, TC extends InternalTypeConfig = InternalTypeConfig> = ReturnType<typeof server<Config, TC>>;
202
- interface ServerOptions {
203
- doc?: {
204
- passthroughs?: string[];
205
- };
206
- }
207
- declare function server<Config, TC extends InternalTypeConfig>(options?: ServerOptions): {
208
- doc<Name extends keyof Config & string>(_name: Name, base: string, glob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends DocCollection<infer Schema extends StandardSchemaV1<unknown, unknown>> | DocsCollection<infer Schema extends StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>> ? DocCollectionEntry<Name, StandardSchemaV1.InferOutput<Schema>, TC>[] : never>;
209
- docLazy<Name extends keyof Config & string>(_name: Name, base: string, head: AwaitableGlobEntries<unknown>, body: Record<string, () => Promise<unknown>>): Promise<Config[Name] extends DocCollection<infer Schema extends StandardSchemaV1<unknown, unknown>> | DocsCollection<infer Schema extends StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>> ? AsyncDocCollectionEntry<Name, StandardSchemaV1.InferOutput<Schema>, TC>[] : never>;
210
- meta<Name extends keyof Config & string>(_name: Name, base: string, glob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends MetaCollection<infer Schema extends StandardSchemaV1<unknown, unknown>> | DocsCollection<StandardSchemaV1<unknown, unknown>, infer Schema extends StandardSchemaV1<unknown, unknown>> ? MetaCollectionEntry<StandardSchemaV1.InferOutput<Schema>>[] : never>;
211
- docs<Name extends keyof Config & string>(name: Name, base: string, metaGlob: AwaitableGlobEntries<unknown>, docGlob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends DocsCollection<infer Page extends StandardSchemaV1<unknown, unknown>, infer Meta extends StandardSchemaV1<unknown, unknown>> ? StandardSchemaV1.InferOutput<Page> extends PageData ? StandardSchemaV1.InferOutput<Meta> extends MetaData ? DocsCollectionEntry<Name, StandardSchemaV1.InferOutput<Page>, StandardSchemaV1.InferOutput<Meta>, TC> : never : never : never>;
212
- docsLazy<Name extends keyof Config & string>(name: Name, base: string, metaGlob: AwaitableGlobEntries<unknown>, docHeadGlob: AwaitableGlobEntries<unknown>, docBodyGlob: Record<string, () => Promise<unknown>>): Promise<Config[Name] extends DocsCollection<infer Page extends StandardSchemaV1<unknown, unknown>, infer Meta extends StandardSchemaV1<unknown, unknown>> ? StandardSchemaV1.InferOutput<Page> extends PageData ? StandardSchemaV1.InferOutput<Meta> extends MetaData ? AsyncDocsCollectionEntry<Name, StandardSchemaV1.InferOutput<Page>, StandardSchemaV1.InferOutput<Meta>, TC> : never : never : never>;
213
- };
214
- declare function toFumadocsSource<Page extends DocMethods & PageData, Meta extends MetaMethods & MetaData>(pages: Page[], metas: Meta[]): Source<{
215
- pageData: Page;
216
- metaData: Meta;
217
- }>;
218
-
219
- interface IndexFilePluginOptions {
220
- target?: 'default' | 'vite';
221
- /**
222
- * add `.js` extensions to imports, needed for ESM without bundler resolution
223
- */
224
- addJsExtension?: boolean;
225
- /**
226
- * Generate entry point for browser
227
- * @defaultValue true
228
- */
229
- browser?: boolean;
230
- /**
231
- * Generate entry point for dynamic compilation
232
- * @defaultValue true
233
- */
234
- dynamic?: boolean;
235
- }
236
- interface IndexFilePlugin {
237
- ['index-file']?: {
238
- generateTypeConfig?: (this: PluginContext) => string | void;
239
- serverOptions?: (this: PluginContext, options: ServerOptions) => void;
240
- };
241
- }
242
- declare function indexFile(options?: IndexFilePluginOptions): Plugin;
243
-
244
- type Awaitable<T> = T | Promise<T>;
245
- interface EmitEntry {
246
- /**
247
- * path relative to output directory
248
- */
249
- path: string;
250
- content: string;
251
- }
252
- interface PluginContext extends CoreOptions {
253
- core: Core;
254
- }
255
- type CompilationContext<Collection> = PluginContext & TransformOptions<Collection>;
256
- interface TransformOptions<Collection> {
257
- collection: Collection;
258
- filePath: string;
259
- source: string;
260
- }
261
- interface Plugin extends IndexFilePlugin {
262
- name?: string;
263
- /**
264
- * on config loaded/updated
265
- */
266
- config?: (this: PluginContext, config: LoadedConfig) => Awaitable<void | LoadedConfig>;
267
- /**
268
- * Generate files (e.g. types, index file, or JSON schemas)
269
- */
270
- emit?: (this: PluginContext) => Awaitable<EmitEntry[]>;
271
- /**
272
- * Configure Fumadocs dev server
273
- */
274
- configureServer?: (this: PluginContext, server: ServerContext) => Awaitable<void>;
275
- meta?: {
276
- /**
277
- * Transform metadata
278
- */
279
- transform?: (this: CompilationContext<MetaCollectionItem>, data: unknown) => Awaitable<unknown | void>;
280
- };
281
- doc?: {
282
- /**
283
- * Transform frontmatter
284
- */
285
- frontmatter?: (this: CompilationContext<DocCollectionItem>, data: Record<string, unknown>) => Awaitable<Record<string, unknown> | void>;
286
- /**
287
- * Transform `vfile` on compilation stage
288
- */
289
- vfile?: (this: CompilationContext<DocCollectionItem>, file: VFile) => Awaitable<VFile | void>;
290
- };
291
- }
292
- type PluginOption = Awaitable<Plugin | PluginOption[] | false>;
293
- interface ServerContext {
294
- /**
295
- * the file watcher, by default all content files are watched, along with other files.
296
- *
297
- * make sure to filter when listening to events
298
- */
299
- watcher?: FSWatcher;
300
- }
301
- interface CoreOptions {
302
- environment: string;
303
- configPath: string;
304
- outDir: string;
305
- }
306
- interface EmitOptions {
307
- /**
308
- * filter the plugins to run emit
309
- */
310
- filterPlugin?: (plugin: Plugin) => boolean;
311
- }
312
- declare const _Defaults: {
313
- configPath: string;
314
- outDir: string;
315
- };
316
- declare function createCore(options: CoreOptions, defaultPlugins?: PluginOption[]): {
317
- /**
318
- * Convenient cache store, reset when config changes
319
- */
320
- cache: Map<string, unknown>;
321
- init({ config: newConfig }: {
322
- config: Awaitable<LoadedConfig>;
323
- }): Promise<void>;
324
- getOptions(): CoreOptions;
325
- getConfig(): LoadedConfig;
326
- /**
327
- * The file path of compiled config file, the file may not exist (e.g. on Vite, or still compiling)
328
- */
329
- getCompiledConfigPath(): string;
330
- getPlugins(): Plugin[];
331
- getPluginContext(): PluginContext;
332
- initServer(server: ServerContext): Promise<void>;
333
- emit({ filterPlugin }?: EmitOptions): Promise<EmitEntry[]>;
334
- emitAndWrite(emitOptions?: EmitOptions): Promise<void>;
335
- transformMeta(options: TransformOptions<MetaCollectionItem>, data: unknown): Promise<unknown>;
336
- transformFrontmatter(options: TransformOptions<DocCollectionItem>, data: Record<string, unknown>): Promise<Record<string, unknown>>;
337
- transformVFile(options: TransformOptions<DocCollectionItem>, file: VFile): Promise<VFile>;
338
- };
339
- type Core = ReturnType<typeof createCore>;
340
-
341
- export { type AnyCollection as A, type BaseCollection as B, type CollectionSchema as C, type DocCollection as D, type ExtractedReference as E, toFumadocsSource as F, type GlobalConfig as G, indexFile as H, type IndexFilePluginOptions as I, type IndexFilePlugin as J, type MetaCollection as M, type PostprocessOptions as P, type ServerOptions as S, type TransformOptions as T, _Defaults as _, type DocsCollection as a, defineDocs as b, defineConfig as c, defineCollections as d, type DefaultMDXOptions as e, type MDXPresetOptions as f, applyMdxPreset as g, frontmatterSchema as h, type CoreOptions as i, type Plugin as j, type AsyncDocCollectionEntry as k, type AsyncDocsCollectionEntry as l, metaSchema as m, type EmitEntry as n, type PluginContext as o, type CompilationContext as p, type PluginOption as q, type ServerContext as r, type EmitOptions as s, createCore as t, type Core as u, type MetaCollectionEntry as v, type DocCollectionEntry as w, type DocsCollectionEntry as x, type ServerCreate as y, server as z };
@@ -1,8 +0,0 @@
1
- import { i as CoreOptions } from './core-B9ZoS6sA.js';
2
-
3
- interface WebpackLoaderOptions extends CoreOptions {
4
- compiledConfigPath: string;
5
- isDev: boolean;
6
- }
7
-
8
- export type { WebpackLoaderOptions as W };
package/dist/index.cjs DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/index.ts
17
- var index_exports = {};
18
- module.exports = __toCommonJS(index_exports);
package/dist/index.d.cts DELETED
@@ -1,61 +0,0 @@
1
- export { p as CompilationContext, u as Core, i as CoreOptions, n as EmitEntry, s as EmitOptions, E as ExtractedReference, j as Plugin, o as PluginContext, q as PluginOption, r as ServerContext, T as TransformOptions, _ as _Defaults, t as createCore } from './core-DTuP23zu.cjs';
2
- import { createProcessor } from '@mdx-js/mdx';
3
- import { StructuredData } from 'fumadocs-core/mdx-plugins';
4
- import { TOCItemType } from 'fumadocs-core/toc';
5
- import { FC } from 'react';
6
- import { MDXProps } from 'mdx/types';
7
- import '@standard-schema/spec';
8
- import 'unified';
9
- import 'zod';
10
- import 'chokidar';
11
- import 'vfile';
12
- import 'fumadocs-core/source';
13
- import './runtime/types.cjs';
14
- import 'fumadocs-core/mdx-plugins/remark-structure';
15
- import 'mdast';
16
-
17
- type Processor = ReturnType<typeof createProcessor>;
18
- interface CompilerOptions {
19
- addDependency: (file: string) => void;
20
- }
21
- interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
22
- frontmatter: Frontmatter;
23
- structuredData: StructuredData;
24
- toc: TOCItemType[];
25
- default: FC<MDXProps>;
26
- /**
27
- * Enable from `postprocess` option.
28
- */
29
- _markdown?: string;
30
- /**
31
- * Enable from `postprocess` option.
32
- */
33
- _mdast?: string;
34
- }
35
- interface FumadocsDataMap {
36
- /**
37
- * [Fumadocs MDX] raw frontmatter, you can modify it
38
- */
39
- frontmatter?: Record<string, unknown>;
40
- /**
41
- * [Fumadocs MDX] additional ESM exports to write
42
- */
43
- 'mdx-export'?: {
44
- name: string;
45
- value: unknown;
46
- }[];
47
- /**
48
- * [Fumadocs MDX] The compiler object from loader
49
- */
50
- _compiler?: CompilerOptions;
51
- /**
52
- * [Fumadocs MDX] get internal processor, do not use this on user land.
53
- */
54
- _getProcessor?: (format: 'md' | 'mdx') => Processor;
55
- }
56
- declare module 'vfile' {
57
- interface DataMap extends FumadocsDataMap {
58
- }
59
- }
60
-
61
- export type { CompiledMDXProperties };
@@ -1,8 +0,0 @@
1
- import {
2
- loadConfig
3
- } from "./chunk-MTTISKQJ.js";
4
- import "./chunk-ZY6UZ7NH.js";
5
- import "./chunk-E5DJTSIM.js";
6
- export {
7
- loadConfig
8
- };
@@ -1,33 +0,0 @@
1
- import { NextConfig } from 'next';
2
- import { I as IndexFilePluginOptions } from '../core-DTuP23zu.cjs';
3
- import '@mdx-js/mdx';
4
- import '@standard-schema/spec';
5
- import 'unified';
6
- import 'fumadocs-core/mdx-plugins';
7
- import 'zod';
8
- import 'chokidar';
9
- import 'vfile';
10
- import 'fumadocs-core/source';
11
- import '../runtime/types.cjs';
12
- import 'fumadocs-core/mdx-plugins/remark-structure';
13
- import 'fumadocs-core/toc';
14
- import 'mdast';
15
- import 'mdx/types';
16
-
17
- interface CreateMDXOptions {
18
- /**
19
- * Path to source configuration file
20
- */
21
- configPath?: string;
22
- /**
23
- * Directory for output files
24
- *
25
- * @defaultValue '.source'
26
- */
27
- outDir?: string;
28
- index?: IndexFilePluginOptions | false;
29
- }
30
- declare function createMDX(createOptions?: CreateMDXOptions): (nextConfig?: NextConfig) => NextConfig;
31
- declare function postInstall(options: CreateMDXOptions): Promise<void>;
32
-
33
- export { type CreateMDXOptions, createMDX, postInstall };