fumadocs-mdx 14.2.2 → 14.2.4
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/adapter-DG-viEbG.js +144 -0
- package/dist/adapter-DG-viEbG.js.map +1 -0
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +21 -12
- package/dist/bin.js.map +1 -0
- package/dist/build-BTTNEFmV.js +100 -0
- package/dist/build-BTTNEFmV.js.map +1 -0
- package/dist/build-mdx-10MrLupc.d.ts +53 -0
- package/dist/build-mdx-10MrLupc.d.ts.map +1 -0
- package/dist/build-mdx-BVeBo4jT.js +153 -0
- package/dist/build-mdx-BVeBo4jT.js.map +1 -0
- package/dist/build-mdx-ChjP7zAn.js +5 -0
- package/dist/bun/index.d.ts +10 -21
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +30 -49
- package/dist/bun/index.js.map +1 -0
- package/dist/codegen-DleOVLNr.js +101 -0
- package/dist/codegen-DleOVLNr.js.map +1 -0
- package/dist/config/index.d.ts +2 -18
- package/dist/config/index.js +50 -53
- package/dist/config/index.js.map +1 -0
- package/dist/core-DG43f_AU.d.ts +364 -0
- package/dist/core-DG43f_AU.d.ts.map +1 -0
- package/dist/core-DjldE3H9.js +212 -0
- package/dist/core-DjldE3H9.js.map +1 -0
- package/dist/fuma-matter-CHgJa_-B.js +27 -0
- package/dist/fuma-matter-CHgJa_-B.js.map +1 -0
- package/dist/index-Bc_4I1HE.d.ts +12 -0
- package/dist/index-Bc_4I1HE.d.ts.map +1 -0
- package/dist/index-file-D9HsrWU_.js +264 -0
- package/dist/index-file-D9HsrWU_.js.map +1 -0
- package/dist/index.d.ts +3 -61
- package/dist/index.js +1 -0
- package/dist/load-from-file-B7Rswy9i.js +5 -0
- package/dist/load-from-file-Doc98oEB.js +38 -0
- package/dist/load-from-file-Doc98oEB.js.map +1 -0
- package/dist/loaders-BVwYfelL.js +7 -0
- package/dist/loaders-BVwYfelL.js.map +1 -0
- package/dist/mdx-DMZ9tsAa.js +91 -0
- package/dist/mdx-DMZ9tsAa.js.map +1 -0
- package/dist/meta-DyieTM4Z.js +81 -0
- package/dist/meta-DyieTM4Z.js.map +1 -0
- package/dist/next/index.cjs +863 -1076
- package/dist/next/index.d.ts +17 -28
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +141 -170
- package/dist/next/index.js.map +1 -0
- package/dist/node/loader.d.ts +4 -2
- package/dist/node/loader.d.ts.map +1 -0
- package/dist/node/loader.js +26 -38
- package/dist/node/loader.js.map +1 -0
- package/dist/plugins/index-file.d.ts +2 -14
- package/dist/plugins/index-file.js +5 -8
- package/dist/plugins/json-schema.d.ts +14 -23
- package/dist/plugins/json-schema.d.ts.map +1 -0
- package/dist/plugins/json-schema.js +70 -78
- package/dist/plugins/json-schema.js.map +1 -0
- package/dist/plugins/last-modified.d.ts +21 -32
- package/dist/plugins/last-modified.d.ts.map +1 -0
- package/dist/plugins/last-modified.js +70 -78
- package/dist/plugins/last-modified.js.map +1 -0
- package/dist/preset-gmDZnBcg.js +61 -0
- package/dist/preset-gmDZnBcg.js.map +1 -0
- package/dist/remark-include-D3G3mAnv.js +247 -0
- package/dist/remark-include-D3G3mAnv.js.map +1 -0
- package/dist/runtime/browser.d.ts +32 -41
- package/dist/runtime/browser.d.ts.map +1 -0
- package/dist/runtime/browser.js +56 -63
- package/dist/runtime/browser.js.map +1 -0
- package/dist/runtime/dynamic.d.ts +13 -21
- package/dist/runtime/dynamic.d.ts.map +1 -0
- package/dist/runtime/dynamic.js +64 -76
- package/dist/runtime/dynamic.js.map +1 -0
- package/dist/runtime/server.d.ts +2 -14
- package/dist/runtime/server.js +111 -8
- package/dist/runtime/server.js.map +1 -0
- package/dist/runtime/types.d.ts +2 -61
- package/dist/runtime/types.js +1 -0
- package/dist/types-B6myALSk.d.ts +63 -0
- package/dist/types-B6myALSk.d.ts.map +1 -0
- package/dist/vite/index.d.ts +28 -39
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +79 -122
- package/dist/vite/index.js.map +1 -0
- package/dist/webpack/mdx.d.ts +6 -3
- package/dist/webpack/mdx.d.ts.map +1 -0
- package/dist/webpack/mdx.js +21 -34
- package/dist/webpack/mdx.js.map +1 -0
- package/dist/webpack/meta.d.ts +6 -3
- package/dist/webpack/meta.d.ts.map +1 -0
- package/dist/webpack/meta.js +23 -37
- package/dist/webpack/meta.js.map +1 -0
- package/dist/webpack--VSEE6Zp.js +15 -0
- package/dist/webpack--VSEE6Zp.js.map +1 -0
- package/loader-mdx.cjs +1 -3
- package/loader-meta.cjs +1 -3
- package/package.json +38 -38
- package/dist/build-mdx-5XLFMP5P.js +0 -8
- package/dist/chunk-257RZJEQ.js +0 -17
- package/dist/chunk-2PY3JUIC.js +0 -126
- package/dist/chunk-4EUH5CD2.js +0 -173
- package/dist/chunk-4JSFLXXT.js +0 -8
- package/dist/chunk-5OBUOALK.js +0 -141
- package/dist/chunk-DTFUANSF.js +0 -40
- package/dist/chunk-KWSETXYC.js +0 -274
- package/dist/chunk-OLD35ARB.js +0 -116
- package/dist/chunk-S7KOJHHO.js +0 -89
- package/dist/chunk-STLEUNK7.js +0 -335
- package/dist/chunk-USQZ5OLE.js +0 -116
- package/dist/chunk-VWJKRQZR.js +0 -19
- package/dist/chunk-WFDF56IJ.js +0 -290
- package/dist/chunk-WSQ23PNV.js +0 -179
- package/dist/chunk-ZAYZWFWP.js +0 -89
- package/dist/core-X5ggQtBM.d.ts +0 -350
- package/dist/index-BqkSNsGO.d.ts +0 -8
- package/dist/load-from-file-FHW724YY.js +0 -8
package/dist/vite/index.js
CHANGED
|
@@ -1,130 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "../
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
} from "../
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
} from "../chunk-ZAYZWFWP.js";
|
|
11
|
-
import {
|
|
12
|
-
createIntegratedConfigLoader,
|
|
13
|
-
toVite
|
|
14
|
-
} from "../chunk-WSQ23PNV.js";
|
|
15
|
-
import "../chunk-4JSFLXXT.js";
|
|
16
|
-
import {
|
|
17
|
-
ValidationError,
|
|
18
|
-
_Defaults,
|
|
19
|
-
createCore
|
|
20
|
-
} from "../chunk-KWSETXYC.js";
|
|
21
|
-
import {
|
|
22
|
-
indexFile
|
|
23
|
-
} from "../chunk-STLEUNK7.js";
|
|
24
|
-
import "../chunk-2PY3JUIC.js";
|
|
25
|
-
import "../chunk-VWJKRQZR.js";
|
|
26
|
-
|
|
27
|
-
// src/vite/index.ts
|
|
1
|
+
import "../fuma-matter-CHgJa_-B.js";
|
|
2
|
+
import { t as createMdxLoader } from "../mdx-DMZ9tsAa.js";
|
|
3
|
+
import "../preset-gmDZnBcg.js";
|
|
4
|
+
import { t as buildConfig } from "../build-BTTNEFmV.js";
|
|
5
|
+
import { n as createCore, r as ValidationError, t as _Defaults } from "../core-DjldE3H9.js";
|
|
6
|
+
import "../codegen-DleOVLNr.js";
|
|
7
|
+
import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-DG-viEbG.js";
|
|
8
|
+
import { t as createMetaLoader } from "../meta-DyieTM4Z.js";
|
|
9
|
+
import { t as indexFile } from "../index-file-D9HsrWU_.js";
|
|
28
10
|
import { mergeConfig } from "vite";
|
|
11
|
+
|
|
12
|
+
//#region src/vite/index.ts
|
|
29
13
|
async function mdx(config, pluginOptions = {}) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
watcher: server.watcher
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
async transform(value, id) {
|
|
77
|
-
try {
|
|
78
|
-
if (metaLoader.filter(id)) {
|
|
79
|
-
return await metaLoader.transform.call(this, value, id);
|
|
80
|
-
}
|
|
81
|
-
if (mdxLoader.filter(id)) {
|
|
82
|
-
return await mdxLoader.transform.call(this, value, id);
|
|
83
|
-
}
|
|
84
|
-
} catch (e) {
|
|
85
|
-
if (e instanceof ValidationError) {
|
|
86
|
-
throw new Error(await e.toStringFormatted());
|
|
87
|
-
}
|
|
88
|
-
throw e;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
14
|
+
const options = applyDefaults(pluginOptions);
|
|
15
|
+
const core = createViteCore(options);
|
|
16
|
+
await core.init({ config: buildConfig(config) });
|
|
17
|
+
const configLoader = createIntegratedConfigLoader(core);
|
|
18
|
+
const mdxLoader = toVite(createMdxLoader(configLoader));
|
|
19
|
+
const metaLoader = toVite(createMetaLoader(configLoader, { json: "json" }));
|
|
20
|
+
return {
|
|
21
|
+
name: "fumadocs-mdx",
|
|
22
|
+
enforce: "pre",
|
|
23
|
+
config(config$1) {
|
|
24
|
+
if (!options.updateViteConfig) return config$1;
|
|
25
|
+
return mergeConfig(config$1, { resolve: {
|
|
26
|
+
noExternal: [
|
|
27
|
+
"fumadocs-core",
|
|
28
|
+
"fumadocs-ui",
|
|
29
|
+
"fumadocs-openapi",
|
|
30
|
+
"@fumadocs/base-ui",
|
|
31
|
+
"@fumadocs/ui"
|
|
32
|
+
],
|
|
33
|
+
dedupe: [
|
|
34
|
+
"fumadocs-core",
|
|
35
|
+
"fumadocs-ui",
|
|
36
|
+
"fumadocs-openapi",
|
|
37
|
+
"@fumadocs/base-ui"
|
|
38
|
+
]
|
|
39
|
+
} });
|
|
40
|
+
},
|
|
41
|
+
async buildStart() {
|
|
42
|
+
await core.emit({ write: true });
|
|
43
|
+
},
|
|
44
|
+
async configureServer(server) {
|
|
45
|
+
await core.initServer({ watcher: server.watcher });
|
|
46
|
+
},
|
|
47
|
+
async transform(value, id) {
|
|
48
|
+
try {
|
|
49
|
+
if (metaLoader.filter(id)) return await metaLoader.transform.call(this, value, id);
|
|
50
|
+
if (mdxLoader.filter(id)) return await mdxLoader.transform.call(this, value, id);
|
|
51
|
+
} catch (e) {
|
|
52
|
+
if (e instanceof ValidationError) throw new Error(await e.toStringFormatted());
|
|
53
|
+
throw e;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
92
57
|
}
|
|
93
58
|
async function postInstall(pluginOptions = {}) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
await core.emit({ write: true });
|
|
59
|
+
const { loadConfig } = await import("../load-from-file-B7Rswy9i.js");
|
|
60
|
+
const core = createViteCore(applyDefaults(pluginOptions));
|
|
61
|
+
await core.init({ config: loadConfig(core, true) });
|
|
62
|
+
await core.emit({ write: true });
|
|
100
63
|
}
|
|
101
|
-
function createViteCore({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
index && indexFile({
|
|
113
|
-
...index,
|
|
114
|
-
target: index.target ?? "vite"
|
|
115
|
-
})
|
|
116
|
-
]
|
|
117
|
-
});
|
|
64
|
+
function createViteCore({ index, configPath, outDir }) {
|
|
65
|
+
if (index === true) index = {};
|
|
66
|
+
return createCore({
|
|
67
|
+
environment: "vite",
|
|
68
|
+
configPath,
|
|
69
|
+
outDir,
|
|
70
|
+
plugins: [index && indexFile({
|
|
71
|
+
...index,
|
|
72
|
+
target: index.target ?? "vite"
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
118
75
|
}
|
|
119
76
|
function applyDefaults(options) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
77
|
+
return {
|
|
78
|
+
updateViteConfig: options.updateViteConfig ?? true,
|
|
79
|
+
index: options.index ?? true,
|
|
80
|
+
configPath: options.configPath ?? _Defaults.configPath,
|
|
81
|
+
outDir: options.outDir ?? _Defaults.outDir
|
|
82
|
+
};
|
|
126
83
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { mdx as default, postInstall };
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["config"],"sources":["../../src/vite/index.ts"],"sourcesContent":["import { mergeConfig, type Plugin, type UserConfig } from 'vite';\nimport { buildConfig } from '@/config/build';\nimport { ValidationError } from '@/utils/validation';\nimport { createMdxLoader } from '@/loaders/mdx';\nimport { toVite } from '@/loaders/adapter';\nimport type { FSWatcher } from 'chokidar';\nimport { _Defaults, createCore } from '@/core';\nimport { createIntegratedConfigLoader } from '@/loaders/config';\nimport { createMetaLoader } from '@/loaders/meta';\nimport indexFile, { IndexFilePluginOptions } from '@/plugins/index-file';\n\nexport interface PluginOptions {\n /**\n * Generate index files for accessing content.\n *\n * @defaultValue true\n */\n index?: boolean | IndexFilePluginOptions;\n\n /**\n * @defaultValue source.config.ts\n */\n configPath?: string;\n\n /**\n * Update Vite config to fix module resolution of Fumadocs\n *\n * @defaultValue true\n */\n updateViteConfig?: boolean;\n\n /**\n * Output directory of generated files\n *\n * @defaultValue '.source'\n */\n outDir?: string;\n}\n\nexport default async function mdx(\n config: Record<string, unknown>,\n pluginOptions: PluginOptions = {},\n): Promise<Plugin> {\n const options = applyDefaults(pluginOptions);\n const core = createViteCore(options);\n await core.init({\n config: buildConfig(config),\n });\n\n const configLoader = createIntegratedConfigLoader(core);\n const mdxLoader = toVite(createMdxLoader(configLoader));\n const metaLoader = toVite(\n createMetaLoader(configLoader, {\n // vite has built-in plugin for JSON files\n json: 'json',\n }),\n );\n\n return {\n name: 'fumadocs-mdx',\n // needed, otherwise other plugins will be executed before our `transform`.\n enforce: 'pre',\n config(config) {\n if (!options.updateViteConfig) return config;\n\n return mergeConfig(config, {\n resolve: {\n noExternal: [\n 'fumadocs-core',\n 'fumadocs-ui',\n 'fumadocs-openapi',\n '@fumadocs/base-ui',\n '@fumadocs/ui',\n ],\n // only dedupe for public, non-transitive libs\n dedupe: ['fumadocs-core', 'fumadocs-ui', 'fumadocs-openapi', '@fumadocs/base-ui'],\n },\n } satisfies UserConfig);\n },\n async buildStart() {\n await core.emit({ write: true });\n },\n async configureServer(server) {\n await core.initServer({\n watcher: server.watcher as unknown as FSWatcher,\n });\n },\n async transform(value, id) {\n try {\n if (metaLoader.filter(id)) {\n return await metaLoader.transform.call(this, value, id);\n }\n\n if (mdxLoader.filter(id)) {\n return await mdxLoader.transform.call(this, value, id);\n }\n } catch (e) {\n if (e instanceof ValidationError) {\n throw new Error(await e.toStringFormatted());\n }\n\n throw e;\n }\n },\n };\n}\n\nexport async function postInstall(pluginOptions: PluginOptions = {}) {\n const { loadConfig } = await import('@/config/load-from-file');\n const core = createViteCore(applyDefaults(pluginOptions));\n await core.init({\n config: loadConfig(core, true),\n });\n await core.emit({ write: true });\n}\n\nfunction createViteCore({ index, configPath, outDir }: Required<PluginOptions>) {\n if (index === true) index = {};\n\n return createCore({\n environment: 'vite',\n configPath,\n outDir,\n plugins: [\n index &&\n indexFile({\n ...index,\n target: index.target ?? 'vite',\n }),\n ],\n });\n}\n\nfunction applyDefaults(options: PluginOptions): Required<PluginOptions> {\n return {\n updateViteConfig: options.updateViteConfig ?? true,\n index: options.index ?? true,\n configPath: options.configPath ?? _Defaults.configPath,\n outDir: options.outDir ?? _Defaults.outDir,\n };\n}\n"],"mappings":";;;;;;;;;;;;AAuCA,eAA8B,IAC5B,QACA,gBAA+B,EAAE,EAChB;CACjB,MAAM,UAAU,cAAc,cAAc;CAC5C,MAAM,OAAO,eAAe,QAAQ;AACpC,OAAM,KAAK,KAAK,EACd,QAAQ,YAAY,OAAO,EAC5B,CAAC;CAEF,MAAM,eAAe,6BAA6B,KAAK;CACvD,MAAM,YAAY,OAAO,gBAAgB,aAAa,CAAC;CACvD,MAAM,aAAa,OACjB,iBAAiB,cAAc,EAE7B,MAAM,QACP,CAAC,CACH;AAED,QAAO;EACL,MAAM;EAEN,SAAS;EACT,OAAO,UAAQ;AACb,OAAI,CAAC,QAAQ,iBAAkB,QAAOA;AAEtC,UAAO,YAAYA,UAAQ,EACzB,SAAS;IACP,YAAY;KACV;KACA;KACA;KACA;KACA;KACD;IAED,QAAQ;KAAC;KAAiB;KAAe;KAAoB;KAAoB;IAClF,EACF,CAAsB;;EAEzB,MAAM,aAAa;AACjB,SAAM,KAAK,KAAK,EAAE,OAAO,MAAM,CAAC;;EAElC,MAAM,gBAAgB,QAAQ;AAC5B,SAAM,KAAK,WAAW,EACpB,SAAS,OAAO,SACjB,CAAC;;EAEJ,MAAM,UAAU,OAAO,IAAI;AACzB,OAAI;AACF,QAAI,WAAW,OAAO,GAAG,CACvB,QAAO,MAAM,WAAW,UAAU,KAAK,MAAM,OAAO,GAAG;AAGzD,QAAI,UAAU,OAAO,GAAG,CACtB,QAAO,MAAM,UAAU,UAAU,KAAK,MAAM,OAAO,GAAG;YAEjD,GAAG;AACV,QAAI,aAAa,gBACf,OAAM,IAAI,MAAM,MAAM,EAAE,mBAAmB,CAAC;AAG9C,UAAM;;;EAGX;;AAGH,eAAsB,YAAY,gBAA+B,EAAE,EAAE;CACnE,MAAM,EAAE,eAAe,MAAM,OAAO;CACpC,MAAM,OAAO,eAAe,cAAc,cAAc,CAAC;AACzD,OAAM,KAAK,KAAK,EACd,QAAQ,WAAW,MAAM,KAAK,EAC/B,CAAC;AACF,OAAM,KAAK,KAAK,EAAE,OAAO,MAAM,CAAC;;AAGlC,SAAS,eAAe,EAAE,OAAO,YAAY,UAAmC;AAC9E,KAAI,UAAU,KAAM,SAAQ,EAAE;AAE9B,QAAO,WAAW;EAChB,aAAa;EACb;EACA;EACA,SAAS,CACP,SACE,UAAU;GACR,GAAG;GACH,QAAQ,MAAM,UAAU;GACzB,CAAC,CACL;EACF,CAAC;;AAGJ,SAAS,cAAc,SAAiD;AACtE,QAAO;EACL,kBAAkB,QAAQ,oBAAoB;EAC9C,OAAO,QAAQ,SAAS;EACxB,YAAY,QAAQ,cAAc,UAAU;EAC5C,QAAQ,QAAQ,UAAU,UAAU;EACrC"}
|
package/dist/webpack/mdx.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "../core-DG43f_AU.js";
|
|
2
|
+
import { t as WebpackLoaderOptions } from "../index-Bc_4I1HE.js";
|
|
3
|
+
import { LoaderContext } from "webpack";
|
|
3
4
|
|
|
5
|
+
//#region src/webpack/mdx.d.ts
|
|
4
6
|
declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
|
|
5
|
-
|
|
7
|
+
//#endregion
|
|
6
8
|
export { loader as default };
|
|
9
|
+
//# sourceMappingURL=mdx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","names":[],"sources":["../../src/webpack/mdx.ts"],"sourcesContent":[],"mappings":";;;;;iBAQ8B,MAAA,OACtB,cAAc,iDAEV,cAAc,oCACvB"}
|
package/dist/webpack/mdx.js
CHANGED
|
@@ -1,37 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
} from "../
|
|
7
|
-
import {
|
|
8
|
-
createStandaloneConfigLoader,
|
|
9
|
-
toWebpack
|
|
10
|
-
} from "../chunk-WSQ23PNV.js";
|
|
11
|
-
import "../chunk-4JSFLXXT.js";
|
|
12
|
-
import "../chunk-KWSETXYC.js";
|
|
13
|
-
import "../chunk-2PY3JUIC.js";
|
|
14
|
-
import "../chunk-VWJKRQZR.js";
|
|
1
|
+
import "../fuma-matter-CHgJa_-B.js";
|
|
2
|
+
import { t as createMdxLoader } from "../mdx-DMZ9tsAa.js";
|
|
3
|
+
import "../core-DjldE3H9.js";
|
|
4
|
+
import "../codegen-DleOVLNr.js";
|
|
5
|
+
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-DG-viEbG.js";
|
|
6
|
+
import { t as getCore } from "../webpack--VSEE6Zp.js";
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
//#region src/webpack/mdx.ts
|
|
9
|
+
let instance;
|
|
18
10
|
async function loader(source, callback) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
mode: options.isDev ? "dev" : "production"
|
|
29
|
-
})
|
|
30
|
-
)
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
await instance.call(this, source, callback);
|
|
11
|
+
const options = this.getOptions();
|
|
12
|
+
this.cacheable(true);
|
|
13
|
+
this.addDependency(options.absoluteCompiledConfigPath);
|
|
14
|
+
if (!instance) instance = toWebpack(createMdxLoader(createStandaloneConfigLoader({
|
|
15
|
+
core: getCore(options),
|
|
16
|
+
buildConfig: false,
|
|
17
|
+
mode: options.isDev ? "dev" : "production"
|
|
18
|
+
})));
|
|
19
|
+
await instance.call(this, source, callback);
|
|
34
20
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { loader as default };
|
|
24
|
+
//# sourceMappingURL=mdx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.js","names":["instance: WebpackLoader | undefined"],"sources":["../../src/webpack/mdx.ts"],"sourcesContent":["import { type LoaderContext } from 'webpack';\nimport { createMdxLoader } from '@/loaders/mdx';\nimport { toWebpack, type WebpackLoader } from '@/loaders/adapter';\nimport { createStandaloneConfigLoader } from '@/loaders/config';\nimport { getCore, type WebpackLoaderOptions } from '@/webpack';\n\nlet instance: WebpackLoader | undefined;\n\nexport default async function loader(\n this: LoaderContext<WebpackLoaderOptions>,\n source: string,\n callback: LoaderContext<WebpackLoaderOptions>['callback'],\n): Promise<void> {\n const options = this.getOptions();\n this.cacheable(true);\n this.addDependency(options.absoluteCompiledConfigPath);\n\n if (!instance) {\n instance = toWebpack(\n createMdxLoader(\n createStandaloneConfigLoader({\n core: getCore(options),\n buildConfig: false,\n mode: options.isDev ? 'dev' : 'production',\n }),\n ),\n );\n }\n\n await instance.call(this, source, callback);\n}\n"],"mappings":";;;;;;;;AAMA,IAAIA;AAEJ,eAA8B,OAE5B,QACA,UACe;CACf,MAAM,UAAU,KAAK,YAAY;AACjC,MAAK,UAAU,KAAK;AACpB,MAAK,cAAc,QAAQ,2BAA2B;AAEtD,KAAI,CAAC,SACH,YAAW,UACT,gBACE,6BAA6B;EAC3B,MAAM,QAAQ,QAAQ;EACtB,aAAa;EACb,MAAM,QAAQ,QAAQ,QAAQ;EAC/B,CAAC,CACH,CACF;AAGH,OAAM,SAAS,KAAK,MAAM,QAAQ,SAAS"}
|
package/dist/webpack/meta.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "../core-DG43f_AU.js";
|
|
2
|
+
import { t as WebpackLoaderOptions } from "../index-Bc_4I1HE.js";
|
|
3
|
+
import { LoaderContext } from "webpack";
|
|
3
4
|
|
|
5
|
+
//#region src/webpack/meta.d.ts
|
|
4
6
|
declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
|
|
5
|
-
|
|
7
|
+
//#endregion
|
|
6
8
|
export { loader as default };
|
|
9
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","names":[],"sources":["../../src/webpack/meta.ts"],"sourcesContent":[],"mappings":";;;;;iBAQ8B,MAAA,OACtB,cAAc,iDAEV,cAAc,oCACvB"}
|
package/dist/webpack/meta.js
CHANGED
|
@@ -1,40 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
} from "../
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
} from "../chunk-ZAYZWFWP.js";
|
|
7
|
-
import {
|
|
8
|
-
createStandaloneConfigLoader,
|
|
9
|
-
toWebpack
|
|
10
|
-
} from "../chunk-WSQ23PNV.js";
|
|
11
|
-
import "../chunk-4JSFLXXT.js";
|
|
12
|
-
import "../chunk-KWSETXYC.js";
|
|
13
|
-
import "../chunk-2PY3JUIC.js";
|
|
1
|
+
import "../core-DjldE3H9.js";
|
|
2
|
+
import "../codegen-DleOVLNr.js";
|
|
3
|
+
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-DG-viEbG.js";
|
|
4
|
+
import { t as createMetaLoader } from "../meta-DyieTM4Z.js";
|
|
5
|
+
import { t as getCore } from "../webpack--VSEE6Zp.js";
|
|
14
6
|
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
//#region src/webpack/meta.ts
|
|
8
|
+
let instance;
|
|
17
9
|
async function loader(source, callback) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
json: "json",
|
|
31
|
-
yaml: "js"
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
await instance.call(this, source, callback);
|
|
10
|
+
const options = this.getOptions();
|
|
11
|
+
this.cacheable(true);
|
|
12
|
+
this.addDependency(options.absoluteCompiledConfigPath);
|
|
13
|
+
if (!instance) instance = toWebpack(createMetaLoader(createStandaloneConfigLoader({
|
|
14
|
+
core: getCore(options),
|
|
15
|
+
buildConfig: false,
|
|
16
|
+
mode: options.isDev ? "dev" : "production"
|
|
17
|
+
}), {
|
|
18
|
+
json: "json",
|
|
19
|
+
yaml: "js"
|
|
20
|
+
}));
|
|
21
|
+
await instance.call(this, source, callback);
|
|
37
22
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { loader as default };
|
|
26
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","names":["instance: WebpackLoader | undefined"],"sources":["../../src/webpack/meta.ts"],"sourcesContent":["import { type LoaderContext } from 'webpack';\nimport { toWebpack, type WebpackLoader } from '@/loaders/adapter';\nimport { createStandaloneConfigLoader } from '@/loaders/config';\nimport { createMetaLoader } from '@/loaders/meta';\nimport { getCore, type WebpackLoaderOptions } from '@/webpack';\n\nlet instance: WebpackLoader | undefined;\n\nexport default async function loader(\n this: LoaderContext<WebpackLoaderOptions>,\n source: string,\n callback: LoaderContext<WebpackLoaderOptions>['callback'],\n): Promise<void> {\n const options = this.getOptions();\n this.cacheable(true);\n this.addDependency(options.absoluteCompiledConfigPath);\n\n if (!instance) {\n instance = toWebpack(\n createMetaLoader(\n createStandaloneConfigLoader({\n core: getCore(options),\n buildConfig: false,\n mode: options.isDev ? 'dev' : 'production',\n }),\n {\n json: 'json',\n yaml: 'js',\n },\n ),\n );\n }\n\n await instance.call(this, source, callback);\n}\n"],"mappings":";;;;;;;AAMA,IAAIA;AAEJ,eAA8B,OAE5B,QACA,UACe;CACf,MAAM,UAAU,KAAK,YAAY;AACjC,MAAK,UAAU,KAAK;AACpB,MAAK,cAAc,QAAQ,2BAA2B;AAEtD,KAAI,CAAC,SACH,YAAW,UACT,iBACE,6BAA6B;EAC3B,MAAM,QAAQ,QAAQ;EACtB,aAAa;EACb,MAAM,QAAQ,QAAQ,QAAQ;EAC/B,CAAC,EACF;EACE,MAAM;EACN,MAAM;EACP,CACF,CACF;AAGH,OAAM,SAAS,KAAK,MAAM,QAAQ,SAAS"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { n as createCore } from "./core-DjldE3H9.js";
|
|
2
|
+
|
|
3
|
+
//#region src/webpack/index.ts
|
|
4
|
+
let core;
|
|
5
|
+
function getCore(options) {
|
|
6
|
+
return core ??= createCore({
|
|
7
|
+
environment: "webpack",
|
|
8
|
+
outDir: options.outDir,
|
|
9
|
+
configPath: options.configPath
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getCore as t };
|
|
15
|
+
//# sourceMappingURL=webpack--VSEE6Zp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack--VSEE6Zp.js","names":["core: Core"],"sources":["../src/webpack/index.ts"],"sourcesContent":["import { type Core, createCore } from '@/core';\n\nexport interface WebpackLoaderOptions {\n absoluteCompiledConfigPath: string;\n configPath: string;\n outDir: string;\n isDev: boolean;\n}\n\nlet core: Core;\n\nexport function getCore(options: WebpackLoaderOptions) {\n return (core ??= createCore({\n environment: 'webpack',\n outDir: options.outDir,\n configPath: options.configPath,\n }));\n}\n"],"mappings":";;;AASA,IAAIA;AAEJ,SAAgB,QAAQ,SAA+B;AACrD,QAAQ,SAAS,WAAW;EAC1B,aAAa;EACb,QAAQ,QAAQ;EAChB,YAAY,QAAQ;EACrB,CAAC"}
|
package/loader-mdx.cjs
CHANGED
package/loader-meta.cjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
module.exports = function loader(code) {
|
|
2
2
|
const callback = this.async();
|
|
3
3
|
|
|
4
|
-
import('./dist/webpack/meta.js').then((mod) =>
|
|
5
|
-
mod.default.call(this, code, callback),
|
|
6
|
-
);
|
|
4
|
+
import('./dist/webpack/meta.js').then((mod) => mod.default.call(this, code, callback));
|
|
7
5
|
};
|
package/package.json
CHANGED
|
@@ -1,61 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.4",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"Docs",
|
|
7
|
+
"NextJs"
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://fumadocs.dev",
|
|
10
|
-
"repository": "github:fuma-nama/fumadocs",
|
|
11
10
|
"license": "MIT",
|
|
12
11
|
"author": "Fuma Nama",
|
|
12
|
+
"repository": "github:fuma-nama/fumadocs",
|
|
13
|
+
"bin": "./dist/bin.js",
|
|
14
|
+
"files": [
|
|
15
|
+
"loader-mdx.cjs",
|
|
16
|
+
"loader-meta.cjs",
|
|
17
|
+
"dist/*"
|
|
18
|
+
],
|
|
13
19
|
"type": "module",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
14
22
|
"exports": {
|
|
15
23
|
"./loader-mdx": "./loader-mdx.cjs",
|
|
16
24
|
"./loader-meta": "./loader-meta.cjs",
|
|
17
25
|
"./config": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
26
|
+
"types": "./dist/config/index.d.ts",
|
|
27
|
+
"import": "./dist/config/index.js"
|
|
20
28
|
},
|
|
21
29
|
"./next": {
|
|
22
|
-
"import": "./dist/next/index.js",
|
|
23
30
|
"types": "./dist/next/index.d.ts",
|
|
31
|
+
"import": "./dist/next/index.js",
|
|
24
32
|
"require": "./dist/next/index.cjs"
|
|
25
33
|
},
|
|
26
34
|
"./vite": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
35
|
+
"types": "./dist/vite/index.d.ts",
|
|
36
|
+
"import": "./dist/vite/index.js"
|
|
29
37
|
},
|
|
30
38
|
".": {
|
|
31
|
-
"
|
|
32
|
-
"
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.js"
|
|
33
41
|
},
|
|
34
42
|
"./runtime/*": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
43
|
+
"types": "./dist/runtime/*.d.ts",
|
|
44
|
+
"import": "./dist/runtime/*.js"
|
|
37
45
|
},
|
|
38
46
|
"./node/loader": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
47
|
+
"types": "./dist/node/loader.d.ts",
|
|
48
|
+
"import": "./dist/node/loader.js"
|
|
41
49
|
},
|
|
42
50
|
"./bun": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
51
|
+
"types": "./dist/bun/index.d.ts",
|
|
52
|
+
"import": "./dist/bun/index.js"
|
|
45
53
|
},
|
|
46
54
|
"./plugins/*": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
55
|
+
"types": "./dist/plugins/*.d.ts",
|
|
56
|
+
"import": "./dist/plugins/*.js"
|
|
49
57
|
}
|
|
50
58
|
},
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"files": [
|
|
55
|
-
"dist/*",
|
|
56
|
-
"loader-mdx.cjs",
|
|
57
|
-
"loader-meta.cjs"
|
|
58
|
-
],
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
59
62
|
"dependencies": {
|
|
60
63
|
"@mdx-js/mdx": "^3.1.1",
|
|
61
64
|
"@standard-schema/spec": "^1.1.0",
|
|
@@ -83,28 +86,28 @@
|
|
|
83
86
|
"@types/node": "^24.10.2",
|
|
84
87
|
"@types/picomatch": "^4.0.2",
|
|
85
88
|
"@types/react": "^19.2.7",
|
|
86
|
-
"astro": "^5.16.6",
|
|
87
89
|
"mdast-util-directive": "^3.1.0",
|
|
88
90
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
89
|
-
"next": "16.1.
|
|
91
|
+
"next": "16.1.1",
|
|
90
92
|
"react": "^19.2.3",
|
|
91
93
|
"remark": "^15.0.1",
|
|
92
94
|
"remark-directive": "^4.0.0",
|
|
93
95
|
"remark-stringify": "^11.0.0",
|
|
94
|
-
"rollup": "^4.
|
|
96
|
+
"rollup": "^4.54.0",
|
|
97
|
+
"tsdown": "^0.18.3",
|
|
95
98
|
"vite": "^7.3.0",
|
|
96
99
|
"webpack": "^5.104.1",
|
|
97
|
-
"@fumadocs/mdx-remote": "1.4.
|
|
100
|
+
"@fumadocs/mdx-remote": "1.4.4",
|
|
98
101
|
"eslint-config-custom": "0.0.0",
|
|
99
|
-
"fumadocs-core": "16.
|
|
102
|
+
"fumadocs-core": "16.4.2",
|
|
100
103
|
"tsconfig": "0.0.0"
|
|
101
104
|
},
|
|
102
105
|
"peerDependencies": {
|
|
103
106
|
"@fumadocs/mdx-remote": "^1.4.0",
|
|
107
|
+
"@types/react": "*",
|
|
104
108
|
"fumadocs-core": "^15.0.0 || ^16.0.0",
|
|
105
109
|
"next": "^15.3.0 || ^16.0.0",
|
|
106
110
|
"react": "*",
|
|
107
|
-
"@types/react": "*",
|
|
108
111
|
"vite": "6.x.x || 7.x.x"
|
|
109
112
|
},
|
|
110
113
|
"peerDependenciesMeta": {
|
|
@@ -124,13 +127,10 @@
|
|
|
124
127
|
"optional": true
|
|
125
128
|
}
|
|
126
129
|
},
|
|
127
|
-
"publishConfig": {
|
|
128
|
-
"access": "public"
|
|
129
|
-
},
|
|
130
130
|
"scripts": {
|
|
131
|
-
"build": "
|
|
131
|
+
"build": "tsdown",
|
|
132
132
|
"clean": "rimraf dist",
|
|
133
|
-
"dev": "
|
|
133
|
+
"dev": "tsdown --watch",
|
|
134
134
|
"lint": "eslint .",
|
|
135
135
|
"types:check": "tsc --noEmit"
|
|
136
136
|
}
|
package/dist/chunk-257RZJEQ.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createCore
|
|
3
|
-
} from "./chunk-KWSETXYC.js";
|
|
4
|
-
|
|
5
|
-
// src/webpack/index.ts
|
|
6
|
-
var core;
|
|
7
|
-
function getCore(options) {
|
|
8
|
-
return core ??= createCore({
|
|
9
|
-
environment: "webpack",
|
|
10
|
-
outDir: options.outDir,
|
|
11
|
-
configPath: options.configPath
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
getCore
|
|
17
|
-
};
|