fumadocs-mdx 15.3.1 → 15.4.0
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/bun/index.d.ts +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/{core-BmvJhZxm.d.ts → core-ZgBVAQdE.d.ts} +4 -1
- package/dist/{index-BN7EkING.d.ts → index-BMgfRjXO.d.ts} +1 -1
- package/dist/{index-vs1fd5_x.d.ts → index-CCzEIOob.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/macro/index.d.ts +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/plugins/index-file.d.ts +1 -1
- package/dist/plugins/json-schema.d.ts +1 -1
- package/dist/plugins/last-modified.d.ts +1 -1
- package/dist/rolldown/index.d.ts +1 -1
- package/dist/runtime/browser.d.ts +2 -2
- package/dist/runtime/dynamic.d.ts +3 -3
- package/dist/runtime/dynamic.js +3 -0
- package/dist/runtime/macro.d.ts +1 -1
- package/dist/runtime/server.d.ts +3 -3
- package/dist/runtime/server.js +8 -3
- package/dist/runtime/types.d.ts +2 -2
- package/dist/{types-DWoea9Sq.d.ts → types-1n7Fk5Dl.d.ts} +9 -3
- package/dist/vite/index.d.ts +2 -2
- package/dist/webpack/macro.d.ts +1 -1
- package/dist/webpack/mdx.d.ts +1 -1
- package/dist/webpack/meta.d.ts +1 -1
- package/package.json +16 -16
package/dist/bun/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CoreOptions } from "../core-
|
|
1
|
+
import { r as CoreOptions } from "../core-ZgBVAQdE.js";
|
|
2
2
|
import { n as ResolvedMacroOptions, t as MacroPluginOption } from "../options-aB6xV-d7.js";
|
|
3
3
|
import { BunPlugin } from "bun";
|
|
4
4
|
//#region src/bun/index.d.ts
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as DocsCollection, D as defineCollections, E as SatteriPresetOptions, F as DefaultMDXOptions, I as MDXPresetOptions, L as applyMdxPreset, O as defineConfig, P as PostprocessOptions, S as DocCollectionSatteri, T as MetaCollection, _ as BaseCollection, b as DocCollectionBase, g as AnyCollection, k as defineDocs, v as CollectionSchema, w as GlobalConfig, x as DocCollectionMdx, y as DocCollection } from "../core-
|
|
2
|
-
import { n as metaSchema, r as remarkInclude, t as frontmatterSchema } from "../index-
|
|
1
|
+
import { C as DocsCollection, D as defineCollections, E as SatteriPresetOptions, F as DefaultMDXOptions, I as MDXPresetOptions, L as applyMdxPreset, O as defineConfig, P as PostprocessOptions, S as DocCollectionSatteri, T as MetaCollection, _ as BaseCollection, b as DocCollectionBase, g as AnyCollection, k as defineDocs, v as CollectionSchema, w as GlobalConfig, x as DocCollectionMdx, y as DocCollection } from "../core-ZgBVAQdE.js";
|
|
2
|
+
import { n as metaSchema, r as remarkInclude, t as frontmatterSchema } from "../index-BMgfRjXO.js";
|
|
3
3
|
export { AnyCollection, BaseCollection, CollectionSchema, DefaultMDXOptions, DocCollection, DocCollectionBase, DocCollectionMdx, DocCollectionSatteri, DocsCollection, GlobalConfig, MDXPresetOptions, MetaCollection, type PostprocessOptions, type SatteriPresetOptions, applyMdxPreset, defineCollections, defineConfig, defineDocs, frontmatterSchema, metaSchema, remarkInclude };
|
|
@@ -79,8 +79,11 @@ interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
|
|
|
79
79
|
default: FC<MDXProps>;
|
|
80
80
|
/**
|
|
81
81
|
* Enable from `postprocess` option.
|
|
82
|
+
*
|
|
83
|
+
* A component with `output: 'function'` in `includeProcessedMarkdown`,
|
|
84
|
+
* render it with `renderToMarkdown` from `fumadocs-core/server`.
|
|
82
85
|
*/
|
|
83
|
-
_markdown?: string
|
|
86
|
+
_markdown?: string | FC<MDXProps>;
|
|
84
87
|
/**
|
|
85
88
|
* Enable from `postprocess` option.
|
|
86
89
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { N as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, j as CompiledMDXProperties, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-
|
|
1
|
+
import { N as ExtractedReference, a as EmitOptions, c as PluginContext, d as TransformOptions, i as EmitEntry, j as CompiledMDXProperties, l as PluginOption, n as Core, o as EmitOutput, r as CoreOptions, s as Plugin, t as CompilationContext, u as ServerContext } from "./core-ZgBVAQdE.js";
|
|
2
2
|
export type { CompilationContext, CompiledMDXProperties, Core, CoreOptions, EmitEntry, EmitOptions, EmitOutput, ExtractedReference, Plugin, PluginContext, PluginOption, ServerContext, TransformOptions };
|
package/dist/macro/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as SatteriOptionsInput, N as ExtractedReference, P as PostprocessOptions, h as BuildEnvironment, v as CollectionSchema } from "../core-
|
|
1
|
+
import { A as SatteriOptionsInput, N as ExtractedReference, P as PostprocessOptions, h as BuildEnvironment, v as CollectionSchema } from "../core-ZgBVAQdE.js";
|
|
2
2
|
import { MacroAsyncDocCollection, MacroAsyncDocsCollection, MacroDocCollection, MacroDocsCollection, MacroMetaCollection } from "../runtime/macro.js";
|
|
3
3
|
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
4
4
|
import { MetaData, PageData } from "fumadocs-core/source";
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as IndexFilePluginOptions, r as CoreOptions } from "../core-
|
|
1
|
+
import { p as IndexFilePluginOptions, r as CoreOptions } from "../core-ZgBVAQdE.js";
|
|
2
2
|
import { t as MacroPluginOption } from "../options-aB6xV-d7.js";
|
|
3
3
|
import { NextConfig } from "next";
|
|
4
4
|
//#region src/next/index.d.ts
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CoreOptions } from "../core-
|
|
1
|
+
import { r as CoreOptions } from "../core-ZgBVAQdE.js";
|
|
2
2
|
import { t as MacroPluginOption } from "../options-aB6xV-d7.js";
|
|
3
3
|
//#region src/node/index.d.ts
|
|
4
4
|
interface NodeLoaderOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-
|
|
1
|
+
import { f as IndexFilePlugin, m as indexFile, p as IndexFilePluginOptions } from "../core-ZgBVAQdE.js";
|
|
2
2
|
export { IndexFilePlugin, IndexFilePluginOptions, indexFile as default };
|
package/dist/rolldown/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as DocsCollection, j as CompiledMDXProperties, y as DocCollection } from "../core-
|
|
2
|
-
import {
|
|
1
|
+
import { C as DocsCollection, j as CompiledMDXProperties, y as DocCollection } from "../core-ZgBVAQdE.js";
|
|
2
|
+
import { a as InternalTypeConfig } from "../types-1n7Fk5Dl.js";
|
|
3
3
|
import { FC, ReactNode } from "react";
|
|
4
4
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
//#region src/runtime/browser.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as DocsCollection, r as CoreOptions, y as DocCollection } from "../core-
|
|
2
|
-
import "../index-
|
|
3
|
-
import {
|
|
1
|
+
import { C as DocsCollection, r as CoreOptions, y as DocCollection } from "../core-ZgBVAQdE.js";
|
|
2
|
+
import "../index-BMgfRjXO.js";
|
|
3
|
+
import { a as InternalTypeConfig, r as FileInfo } from "../types-1n7Fk5Dl.js";
|
|
4
4
|
import { AsyncDocCollectionEntry, AsyncDocsCollectionEntry } from "./server.js";
|
|
5
5
|
//#region src/runtime/dynamic.d.ts
|
|
6
6
|
interface LazyEntry<Data = unknown> {
|
package/dist/runtime/dynamic.js
CHANGED
|
@@ -5,6 +5,7 @@ import { frontmatter } from "fumadocs-core/content/md/frontmatter";
|
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import jsxRuntimeDefault from "react/jsx-runtime";
|
|
8
|
+
import { asMarkdown, jsxComponents } from "fumadocs-core/server";
|
|
8
9
|
//#region src/runtime/dynamic.ts
|
|
9
10
|
const AsyncFunction = Object.getPrototypeOf(executeMdx).constructor;
|
|
10
11
|
/** we always assume the input code is safe and execute it directly */
|
|
@@ -14,6 +15,8 @@ async function executeMdx(compiled, options = {}) {
|
|
|
14
15
|
opts: {
|
|
15
16
|
...scopeOpts,
|
|
16
17
|
...options.jsxRuntime ?? jsxRuntimeDefault,
|
|
18
|
+
asMarkdown,
|
|
19
|
+
jsxComponents,
|
|
17
20
|
baseUrl: options.baseUrl
|
|
18
21
|
},
|
|
19
22
|
...scope
|
package/dist/runtime/macro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as DocMethods, o as MetaMethods, t as DocData } from "../types-1n7Fk5Dl.js";
|
|
2
2
|
import { MetaData, PageData, Source } from "fumadocs-core/source";
|
|
3
3
|
import { MDXContent } from "mdx/types";
|
|
4
4
|
import { StructuredData } from "fumadocs-core/mdx-plugins/remark-structure";
|
package/dist/runtime/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as DocsCollection, T as MetaCollection, y as DocCollection } from "../core-
|
|
2
|
-
import "../index-
|
|
3
|
-
import { a as
|
|
1
|
+
import { C as DocsCollection, T as MetaCollection, y as DocCollection } from "../core-ZgBVAQdE.js";
|
|
2
|
+
import "../index-BMgfRjXO.js";
|
|
3
|
+
import { a as InternalTypeConfig, n as DocMethods, o as MetaMethods, t as DocData } from "../types-1n7Fk5Dl.js";
|
|
4
4
|
import { MetaData, PageData, Source } from "fumadocs-core/source";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
import { StructuredData } from "fumadocs-core/mdx-plugins/remark-structure";
|
package/dist/runtime/server.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
1
2
|
import { PathUtils } from "fumadocs-core/source";
|
|
2
3
|
//#region src/runtime/server.ts
|
|
3
4
|
function server() {
|
|
@@ -94,12 +95,16 @@ function toFumadocsSource(pages, metas, options) {
|
|
|
94
95
|
function createDocMethods(info, load) {
|
|
95
96
|
return {
|
|
96
97
|
info,
|
|
97
|
-
async getText(type) {
|
|
98
|
+
async getText(type, options) {
|
|
98
99
|
if (type === "raw") return await (await import("node:fs/promises")).readFile(info.fullPath, "utf-8");
|
|
99
100
|
const data = await load();
|
|
100
101
|
const markdown = data._markdown ?? data._exports?._markdown;
|
|
101
|
-
if (typeof markdown
|
|
102
|
-
|
|
102
|
+
if (typeof markdown === "string") return markdown;
|
|
103
|
+
if (markdown) {
|
|
104
|
+
const { renderToMarkdown } = await import("fumadocs-core/server");
|
|
105
|
+
return renderToMarkdown(createElement(markdown, { components: options?.components }));
|
|
106
|
+
}
|
|
107
|
+
throw new Error("getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config.");
|
|
103
108
|
},
|
|
104
109
|
async getMDAST() {
|
|
105
110
|
const data = await load();
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { DocData, DocMethods, FileInfo, InternalTypeConfig, MetaMethods };
|
|
1
|
+
import { a as InternalTypeConfig, i as GetTextOptions, n as DocMethods, o as MetaMethods, r as FileInfo, t as DocData } from "../types-1n7Fk5Dl.js";
|
|
2
|
+
export { DocData, DocMethods, FileInfo, GetTextOptions, InternalTypeConfig, MetaMethods };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Root } from "mdast";
|
|
2
2
|
import { TOCItemType } from "fumadocs-core/toc";
|
|
3
|
-
import { MDXContent } from "mdx/types";
|
|
3
|
+
import { MDXComponents, MDXContent } from "mdx/types";
|
|
4
4
|
import { StructuredData } from "fumadocs-core/mdx-plugins/remark-structure";
|
|
5
5
|
//#region src/runtime/types.d.ts
|
|
6
6
|
interface DocData {
|
|
@@ -31,6 +31,12 @@ interface FileInfo {
|
|
|
31
31
|
*/
|
|
32
32
|
fullPath: string;
|
|
33
33
|
}
|
|
34
|
+
interface GetTextOptions {
|
|
35
|
+
/**
|
|
36
|
+
* MDX components for JSX elements in the output, only available with `output: 'function'` in `includeProcessedMarkdown`.
|
|
37
|
+
*/
|
|
38
|
+
components?: MDXComponents;
|
|
39
|
+
}
|
|
34
40
|
interface DocMethods {
|
|
35
41
|
/**
|
|
36
42
|
* file info
|
|
@@ -42,7 +48,7 @@ interface DocMethods {
|
|
|
42
48
|
* - `type: raw` - read the original content from file system.
|
|
43
49
|
* - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
|
|
44
50
|
*/
|
|
45
|
-
getText: (type: 'raw' | 'processed') => Promise<string>;
|
|
51
|
+
getText: (type: 'raw' | 'processed', options?: GetTextOptions) => Promise<string>;
|
|
46
52
|
getMDAST: () => Promise<Root>;
|
|
47
53
|
}
|
|
48
54
|
interface MetaMethods {
|
|
@@ -58,4 +64,4 @@ interface InternalTypeConfig {
|
|
|
58
64
|
DocData: Record<string, unknown>;
|
|
59
65
|
}
|
|
60
66
|
//#endregion
|
|
61
|
-
export {
|
|
67
|
+
export { InternalTypeConfig as a, GetTextOptions as i, DocMethods as n, MetaMethods as o, FileInfo as r, DocData as t };
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as IndexFilePluginOptions, r as CoreOptions, w as GlobalConfig } from "../core-
|
|
1
|
+
import { p as IndexFilePluginOptions, r as CoreOptions, w as GlobalConfig } from "../core-ZgBVAQdE.js";
|
|
2
2
|
import { t as MacroPluginOption } from "../options-aB6xV-d7.js";
|
|
3
|
-
import "../index-
|
|
3
|
+
import "../index-BMgfRjXO.js";
|
|
4
4
|
import { Plugin } from "vite";
|
|
5
5
|
//#region src/vite/index.d.ts
|
|
6
6
|
interface PluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
package/dist/webpack/macro.d.ts
CHANGED
package/dist/webpack/mdx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as WebpackLoaderOptions } from "../index-
|
|
1
|
+
import { t as WebpackLoaderOptions } from "../index-CCzEIOob.js";
|
|
2
2
|
import { LoaderDefinitionFunction } from "webpack";
|
|
3
3
|
//#region src/webpack/mdx.d.ts
|
|
4
4
|
declare const loader: LoaderDefinitionFunction<WebpackLoaderOptions>;
|
package/dist/webpack/meta.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as WebpackLoaderOptions } from "../index-
|
|
1
|
+
import { t as WebpackLoaderOptions } from "../index-CCzEIOob.js";
|
|
2
2
|
import { LoaderDefinitionFunction } from "webpack";
|
|
3
3
|
//#region src/webpack/meta.d.ts
|
|
4
4
|
declare const loader: LoaderDefinitionFunction<WebpackLoaderOptions>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.4.0",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"esbuild": "^0.28.2",
|
|
60
60
|
"estree-util-value-to-estree": "^3.5.0",
|
|
61
61
|
"github-slugger": "^2.0.0",
|
|
62
|
-
"magic-string": "^1.
|
|
62
|
+
"magic-string": "^1.2.2",
|
|
63
63
|
"mdast-util-mdx": "^3.0.0",
|
|
64
64
|
"picocolors": "^1.1.1",
|
|
65
|
-
"picomatch": "^4.0.
|
|
65
|
+
"picomatch": "^4.0.7",
|
|
66
66
|
"tinyexec": "^1.3.0",
|
|
67
67
|
"tinyglobby": "^0.2.17",
|
|
68
68
|
"unified": "^11.0.5",
|
|
@@ -70,43 +70,43 @@
|
|
|
70
70
|
"unist-util-visit": "^5.1.0",
|
|
71
71
|
"vfile": "^6.0.3",
|
|
72
72
|
"yaml": "^2.9.0",
|
|
73
|
-
"yuku-analyzer": "^0.
|
|
73
|
+
"yuku-analyzer": "^0.9.1",
|
|
74
74
|
"zod": "^4.4.3"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@types/bun": "^1.
|
|
77
|
+
"@types/bun": "^1.4.0",
|
|
78
78
|
"@types/mdast": "^4.0.4",
|
|
79
79
|
"@types/mdx": "^2.0.14",
|
|
80
|
-
"@types/node": "^26.
|
|
80
|
+
"@types/node": "^26.3.0",
|
|
81
81
|
"@types/picomatch": "^4.0.3",
|
|
82
82
|
"@types/react": "^19.2.18",
|
|
83
83
|
"mdast-util-directive": "^3.1.0",
|
|
84
|
-
"next": "^16.3.
|
|
84
|
+
"next": "^16.3.2",
|
|
85
85
|
"react": "^19.2.8",
|
|
86
86
|
"remark": "^15.0.1",
|
|
87
87
|
"remark-directive": "^4.0.0",
|
|
88
88
|
"remark-mdx": "^3.1.1",
|
|
89
|
-
"rolldown": "^1.2.
|
|
90
|
-
"satteri": "^0.10.
|
|
89
|
+
"rolldown": "^1.2.5",
|
|
90
|
+
"satteri": "^0.10.5",
|
|
91
91
|
"tsdown": "0.22.14",
|
|
92
|
-
"vite": "^8.2.
|
|
92
|
+
"vite": "^8.2.2",
|
|
93
93
|
"webpack": "^5.109.2",
|
|
94
|
-
"@fumadocs/
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
94
|
+
"@fumadocs/satteri": "0.5.0",
|
|
95
|
+
"fumadocs-core": "16.15.3",
|
|
96
|
+
"tsconfig": "0.0.0",
|
|
97
|
+
"@fumadocs/vite": "0.1.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@fumadocs/satteri": "0.x.x",
|
|
101
101
|
"@types/mdast": "*",
|
|
102
102
|
"@types/mdx": "*",
|
|
103
103
|
"@types/react": "*",
|
|
104
|
-
"fumadocs-core": "^16.
|
|
104
|
+
"fumadocs-core": "^16.15.3",
|
|
105
105
|
"mdast-util-directive": "*",
|
|
106
106
|
"next": "^15.3.0 || ^16.0.0",
|
|
107
107
|
"react": "^19.2.0",
|
|
108
108
|
"rolldown": "*",
|
|
109
|
-
"satteri": "^0.10.
|
|
109
|
+
"satteri": "^0.10.5",
|
|
110
110
|
"vite": "7.x.x || 8.x.x"
|
|
111
111
|
},
|
|
112
112
|
"peerDependenciesMeta": {
|