fumadocs-mdx 15.6.2 → 15.6.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-DUcfPohH.js → adapter-DJT55ieR.js} +9 -4
- package/dist/{build-TiTOkhq4.js → build-Dc0aOaCg.js} +8 -1
- package/dist/bun/index.d.ts +5 -3
- package/dist/bun/index.js +14 -20
- package/dist/{codegen-BAuFQ5Ew.js → codegen-uHLSduG-.js} +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/{core-ikvOVBe5.d.ts → core-OVmyAj82.d.ts} +1 -1
- package/dist/{core-CJjfu3ju.js → core-r1WHKfaI.js} +1 -1
- package/dist/{eval-DAaN7Bq9.js → eval-Ch9sPj_e.js} +21 -7
- package/dist/{index-tRoEcGRV.d.ts → index-CCVoEC9e.d.ts} +1 -1
- package/dist/{index-file-BZgXUjEx.js → index-file-DHU9QZX_.js} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/{load-from-file-gZlf7m88.js → load-from-file-Bt3g8VEm.js} +1 -1
- package/dist/macro/index.d.ts +1 -1
- package/dist/{mdx-Bn5bb2TQ.js → mdx-oiwGpmIR.js} +2 -2
- package/dist/{meta-DRB7wcYE.js → meta-CsSsB7_T.js} +1 -1
- package/dist/next/index.d.ts +2 -2
- package/dist/next/index.js +6 -6
- package/dist/node/_loader.js +9 -12
- package/dist/node/index.d.ts +2 -2
- package/dist/node/loader.js +4 -4
- package/dist/options-DZSjmVhY.js +42 -0
- package/dist/{options-BCId5Url.d.ts → options-aTvMSrKg.d.ts} +1 -5
- package/dist/{page-BVmw5SER.js → page-DI7o9MOD.js} +4 -3
- package/dist/plugins/index-file.d.ts +1 -1
- package/dist/plugins/index-file.js +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 +2 -4
- package/dist/rolldown/index.js +11 -14
- package/dist/runtime/browser.d.ts +1 -1
- package/dist/runtime/browser.js +1 -1
- package/dist/runtime/dynamic.d.ts +1 -1
- package/dist/runtime/dynamic.js +2 -2
- package/dist/runtime/macro.js +1 -1
- package/dist/runtime/server.d.ts +1 -1
- package/dist/runtime/server.js +7 -6
- package/dist/{transform-D7pyKPqb.js → transform-CAcchC26.js} +3 -3
- package/dist/vite/index.d.ts +2 -5
- package/dist/vite/index.js +12 -13
- package/dist/webpack/macro.d.ts +1 -1
- package/dist/webpack/macro.js +2 -2
- package/dist/webpack/mdx.d.ts +1 -1
- package/dist/webpack/mdx.js +3 -3
- package/dist/webpack/meta.d.ts +1 -1
- package/dist/webpack/meta.js +3 -3
- package/dist/{webpack-BoqJZRKf.js → webpack-BXq21GfV.js} +2 -2
- package/package.json +3 -3
- package/dist/options-B2o-zV4A.js +0 -36
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as buildConfig } from "./build-
|
|
2
|
-
import { n as ValidationError } from "./core-
|
|
3
|
-
import { t as loadConfig } from "./load-from-file-
|
|
1
|
+
import { r as buildConfig } from "./build-Dc0aOaCg.js";
|
|
2
|
+
import { n as ValidationError } from "./core-r1WHKfaI.js";
|
|
3
|
+
import { t as loadConfig } from "./load-from-file-Bt3g8VEm.js";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -105,7 +105,12 @@ function toWebpack(loader) {
|
|
|
105
105
|
compiler: this
|
|
106
106
|
});
|
|
107
107
|
if (result === null) callback(void 0, source);
|
|
108
|
-
else callback(void 0, result.code, result.map
|
|
108
|
+
else callback(void 0, result.code, result.map ?? {
|
|
109
|
+
version: 3,
|
|
110
|
+
sources: [],
|
|
111
|
+
names: [],
|
|
112
|
+
mappings: ""
|
|
113
|
+
});
|
|
109
114
|
} catch (error) {
|
|
110
115
|
if (error instanceof ValidationError) return callback(new Error(await error.toStringFormatted()));
|
|
111
116
|
if (!(error instanceof Error)) throw error;
|
|
@@ -54,7 +54,14 @@ function buildPrimitiveCollection(name, config, cwd) {
|
|
|
54
54
|
if (!this.isFileSupported(filePath)) return false;
|
|
55
55
|
const relativePath = path.relative(this.dir, filePath);
|
|
56
56
|
if (relativePath.startsWith(`..${path.sep}`)) return false;
|
|
57
|
-
|
|
57
|
+
if (!matcher) {
|
|
58
|
+
const include = [];
|
|
59
|
+
const ignore = [];
|
|
60
|
+
for (const pattern of patterns) if (pattern.startsWith("!")) ignore.push(pattern.slice(1));
|
|
61
|
+
else include.push(pattern);
|
|
62
|
+
matcher = picomatch(include, { ignore });
|
|
63
|
+
}
|
|
64
|
+
return matcher(relativePath);
|
|
58
65
|
}
|
|
59
66
|
};
|
|
60
67
|
}
|
package/dist/bun/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as CoreOptions } from "../core-
|
|
2
|
-
import {
|
|
1
|
+
import { r as CoreOptions } from "../core-OVmyAj82.js";
|
|
2
|
+
import { t as MacroPluginOption } from "../options-aTvMSrKg.js";
|
|
3
3
|
import { BunPlugin } from "bun";
|
|
4
4
|
export interface MdxPluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
|
5
5
|
/**
|
|
@@ -12,7 +12,9 @@ export interface MdxPluginOptions extends Pick<CoreOptions, 'configPath' | 'outD
|
|
|
12
12
|
disableMetaFile?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
+
* JS/TS modules outside of `node_modules`, with an optional import query.
|
|
16
|
+
*
|
|
15
17
|
* @internal
|
|
16
18
|
*/
|
|
17
|
-
export declare
|
|
19
|
+
export declare const macroFilter: RegExp;
|
|
18
20
|
export declare function createMdxPlugin(options?: MdxPluginOptions): BunPlugin;
|
package/dist/bun/index.js
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import { t as createMdxLoader } from "../mdx-
|
|
2
|
-
import { r as buildConfig } from "../build-
|
|
3
|
-
import { t as createCore } from "../core-
|
|
4
|
-
import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-
|
|
5
|
-
import { t as createMetaLoader } from "../meta-
|
|
1
|
+
import { t as createMdxLoader } from "../mdx-oiwGpmIR.js";
|
|
2
|
+
import { r as buildConfig } from "../build-Dc0aOaCg.js";
|
|
3
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
4
|
+
import { a as createIntegratedConfigLoader, t as toBun } from "../adapter-DJT55ieR.js";
|
|
5
|
+
import { t as createMetaLoader } from "../meta-CsSsB7_T.js";
|
|
6
6
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
7
|
-
import {
|
|
8
|
-
import { r as slash } from "../codegen-BAuFQ5Ew.js";
|
|
7
|
+
import { i as resolveMacroOptions, n as NodeModulesRegex, r as createMacroMatcher } from "../options-DZSjmVhY.js";
|
|
9
8
|
import fs from "node:fs/promises";
|
|
10
|
-
import path from "node:path";
|
|
11
9
|
import { randomUUID } from "node:crypto";
|
|
12
|
-
import picomatch from "picomatch";
|
|
13
10
|
import { pathToFileURL } from "node:url";
|
|
14
11
|
// src/bun/index.ts
|
|
15
12
|
const EvalQueryKey = "fd-macro-eval";
|
|
16
13
|
/**
|
|
14
|
+
* JS/TS modules outside of `node_modules`, with an optional import query.
|
|
15
|
+
*
|
|
17
16
|
* @internal
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
const toSource = (pattern) => picomatch.makeRe(slash(path.resolve(root, pattern)), { dot: true }).source;
|
|
21
|
-
const included = include.map((pattern) => `(?:${toSource(pattern).replace(/\$$/, String.raw`(?:\?.*)?$`)})`).join("|");
|
|
22
|
-
const excluded = exclude.map((pattern) => `(?:${toSource(pattern)})`).join("|");
|
|
23
|
-
return new RegExp(`^(?!${excluded})(?:${included})`);
|
|
24
|
-
}
|
|
18
|
+
const macroFilter = new RegExp(String.raw`^(?!.*${NodeModulesRegex.source}).*\.(?:[cm]?[jt]s|[jt]sx)(?:\?.*)?$`);
|
|
25
19
|
function bunLoader(file) {
|
|
26
20
|
if (file.endsWith(".tsx")) return "tsx";
|
|
27
21
|
if (file.endsWith(".jsx")) return "jsx";
|
|
@@ -45,7 +39,7 @@ function createMdxPlugin(options = {}) {
|
|
|
45
39
|
await core.init({ config: buildConfig(configExports, process.cwd()) });
|
|
46
40
|
if (macroOptions) {
|
|
47
41
|
const root = process.cwd();
|
|
48
|
-
const { MacroCollector } = await import("../eval-
|
|
42
|
+
const { MacroCollector } = await import("../eval-Ch9sPj_e.js").then((n) => n.r);
|
|
49
43
|
const pendingEvals = /* @__PURE__ */ new Map();
|
|
50
44
|
core.macro = new MacroCollector({
|
|
51
45
|
root,
|
|
@@ -62,12 +56,12 @@ function createMdxPlugin(options = {}) {
|
|
|
62
56
|
return { inputs: [entry] };
|
|
63
57
|
}
|
|
64
58
|
});
|
|
65
|
-
const
|
|
66
|
-
build.onLoad({ filter }, async (args) => {
|
|
59
|
+
const matcher = createMacroMatcher(root, macroOptions);
|
|
60
|
+
build.onLoad({ filter: macroFilter }, async (args) => {
|
|
67
61
|
const [file, query = ""] = args.path.split("?", 2);
|
|
68
62
|
const loader = bunLoader(file);
|
|
69
63
|
const source = await Bun.file(file).text();
|
|
70
|
-
if (!source.includes("fumadocs-mdx/macro")) return {
|
|
64
|
+
if (!matcher(file) || !source.includes("fumadocs-mdx/macro")) return {
|
|
71
65
|
contents: source,
|
|
72
66
|
loader
|
|
73
67
|
};
|
|
@@ -77,7 +71,7 @@ function createMdxPlugin(options = {}) {
|
|
|
77
71
|
contents: await transform(source, file) ?? source,
|
|
78
72
|
loader
|
|
79
73
|
};
|
|
80
|
-
const { transformMacroModule } = await import("../transform-
|
|
74
|
+
const { transformMacroModule } = await import("../transform-CAcchC26.js").then((n) => n.i);
|
|
81
75
|
return {
|
|
82
76
|
contents: (await transformMacroModule({
|
|
83
77
|
code: source,
|
|
@@ -92,6 +92,7 @@ function stringifyQuery(query = {}) {
|
|
|
92
92
|
* convert into POSIX & relative file paths, such that Vite can accept it.
|
|
93
93
|
*/
|
|
94
94
|
function normalizeViteGlobPath(file) {
|
|
95
|
+
if (file.startsWith("!")) return `!${normalizeViteGlobPath(file.slice(1))}`;
|
|
95
96
|
file = slash(file);
|
|
96
97
|
if (file.startsWith("./")) return file;
|
|
97
98
|
if (file.startsWith("/")) return `.${file}`;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-OVmyAj82.js";
|
|
2
2
|
import { remarkInclude } from "fumadocs-core/mdx-plugins/remark-include";
|
|
3
3
|
/** @deprecated import `pageSchema` from `fumadocs-core/source/schema` instead (since 16.2.3) */
|
|
4
4
|
export declare const frontmatterSchema: import("zod").ZodObject<{
|
|
@@ -25,7 +25,7 @@ type DefaultMDXOptions = Omit<NonNullable<ProcessorOptions>, 'rehypePlugins' | '
|
|
|
25
25
|
remarkImageOptions?: Plugins.RemarkImageOptions | false;
|
|
26
26
|
remarkCodeTabOptions?: Plugins.RemarkCodeTabOptions | false;
|
|
27
27
|
remarkNpmOptions?: Plugins.RemarkNpmOptions | false;
|
|
28
|
-
rehypeCodeOptions?: Plugins.RehypeCodeOptions | false;
|
|
28
|
+
rehypeCodeOptions?: Partial<Plugins.RehypeCodeOptions> | false;
|
|
29
29
|
};
|
|
30
30
|
type MDXPresetOptions = ({
|
|
31
31
|
preset?: 'fumadocs';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.js";
|
|
2
|
-
import { n as transformMacroConfigModule, t as parseMacroId } from "./transform-
|
|
3
|
-
import { n as buildCollection } from "./build-
|
|
2
|
+
import { n as transformMacroConfigModule, t as parseMacroId } from "./transform-CAcchC26.js";
|
|
3
|
+
import { n as buildCollection } from "./build-Dc0aOaCg.js";
|
|
4
4
|
import { r as defineDocs } from "./define-C2jwQBlt.js";
|
|
5
|
-
import { r as slash } from "./codegen-
|
|
5
|
+
import { r as slash } from "./codegen-uHLSduG-.js";
|
|
6
|
+
import { n as NodeModulesRegex } from "./options-DZSjmVhY.js";
|
|
6
7
|
import fs from "node:fs/promises";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import { randomUUID } from "node:crypto";
|
|
9
10
|
import { pathToFileURL } from "node:url";
|
|
10
11
|
// src/macro/eval.ts
|
|
11
12
|
var eval_exports = /* @__PURE__ */ __exportAll({ MacroCollector: () => MacroCollector });
|
|
13
|
+
const Resolving = {};
|
|
12
14
|
function esbuildLoader(file) {
|
|
13
15
|
if (file.endsWith(".tsx")) return "tsx";
|
|
14
16
|
if (file.endsWith(".jsx")) return "jsx";
|
|
@@ -31,7 +33,7 @@ function createNodeEvaluator(env) {
|
|
|
31
33
|
platform: "node",
|
|
32
34
|
format: "esm",
|
|
33
35
|
target: "node22",
|
|
34
|
-
|
|
36
|
+
conditions: [],
|
|
35
37
|
jsx: "automatic",
|
|
36
38
|
outfile,
|
|
37
39
|
write: true,
|
|
@@ -41,6 +43,20 @@ function createNodeEvaluator(env) {
|
|
|
41
43
|
plugins: [{
|
|
42
44
|
name: "fumadocs-mdx:macro-config",
|
|
43
45
|
setup(b) {
|
|
46
|
+
b.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
47
|
+
if (args.pluginData === Resolving) return;
|
|
48
|
+
const { path: file } = await b.resolve(args.path, {
|
|
49
|
+
kind: args.kind,
|
|
50
|
+
importer: args.importer,
|
|
51
|
+
resolveDir: args.resolveDir,
|
|
52
|
+
pluginData: Resolving
|
|
53
|
+
});
|
|
54
|
+
if (!NodeModulesRegex.test(file)) return;
|
|
55
|
+
return {
|
|
56
|
+
path: pathToFileURL(file).href,
|
|
57
|
+
external: true
|
|
58
|
+
};
|
|
59
|
+
});
|
|
44
60
|
b.onLoad({ filter: /\.(?:[cm]?[jt]s|[jt]sx)$/ }, async (args) => {
|
|
45
61
|
const contents = await transform(await fs.readFile(args.path, "utf-8"), args.path);
|
|
46
62
|
if (contents === null) return;
|
|
@@ -88,9 +104,7 @@ var MacroCollector = class {
|
|
|
88
104
|
const parsed = parseMacroId(id);
|
|
89
105
|
if (!parsed) throw new Error(`[MDX] invalid macro id "${id}".`);
|
|
90
106
|
const { cfg, name } = parsed;
|
|
91
|
-
const
|
|
92
|
-
if (path.isAbsolute(cfg) || slash(path.relative(this.root, abs)).startsWith("..")) throw new Error(`[MDX] macro id "${id}" points outside of the project root.`);
|
|
93
|
-
const mod = await this.load(abs);
|
|
107
|
+
const mod = await this.load(path.resolve(this.root, cfg));
|
|
94
108
|
const collection = mod.collections.get(id);
|
|
95
109
|
if (!collection) throw new Error(`[MDX] cannot find macro collection \`${name}\` in "${cfg}", make sure it is declared as a top-level \`const\`.`);
|
|
96
110
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as ident, r as slash, t as createCodegen } from "./codegen-
|
|
1
|
+
import { n as ident, r as slash, t as createCodegen } from "./codegen-uHLSduG-.js";
|
|
2
2
|
import { n as resolveFrontmatter, t as frontmatterCode } from "./code-BWwFhg-7.js";
|
|
3
|
-
import { n as readStaticParams } from "./meta-
|
|
3
|
+
import { n as readStaticParams } from "./meta-CsSsB7_T.js";
|
|
4
4
|
import { frontmatter } from "fumadocs-core/content/md/frontmatter";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
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-OVmyAj82.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-OVmyAj82.js";
|
|
2
2
|
import { MacroAsyncDocCollection, MacroAsyncDocsCollection, MacroDocCollection, MacroDocsCollection, MacroMetaCollection } from "../runtime/macro.js";
|
|
3
3
|
import { MetaData, PageData } from "fumadocs-core/source";
|
|
4
4
|
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as slash } from "./codegen-
|
|
1
|
+
import { r as slash } from "./codegen-uHLSduG-.js";
|
|
2
2
|
import { n as resolveFrontmatter, t as frontmatterCode } from "./code-BWwFhg-7.js";
|
|
3
|
-
import { n as readStaticParams } from "./meta-
|
|
3
|
+
import { n as readStaticParams } from "./meta-CsSsB7_T.js";
|
|
4
4
|
import { frontmatter } from "fumadocs-core/content/md/frontmatter";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as metaModule, r as runModule } from "./code-BWwFhg-7.js";
|
|
2
|
-
import { r as slash } from "./codegen-
|
|
2
|
+
import { r as slash } from "./codegen-uHLSduG-.js";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import path from "node:path";
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as IndexFilePluginOptions, r as CoreOptions } from "../core-
|
|
2
|
-
import { t as MacroPluginOption } from "../options-
|
|
1
|
+
import { p as IndexFilePluginOptions, r as CoreOptions } from "../core-OVmyAj82.js";
|
|
2
|
+
import { t as MacroPluginOption } from "../options-aTvMSrKg.js";
|
|
3
3
|
import { NextConfig } from "next";
|
|
4
4
|
export interface CreateMDXOptions extends Pick<CoreOptions, 'configPath' | 'outDir'> {
|
|
5
5
|
/**
|
package/dist/next/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as loadConfig } from "../load-from-file-
|
|
2
|
-
import { t as createCore } from "../core-
|
|
1
|
+
import { t as loadConfig } from "../load-from-file-Bt3g8VEm.js";
|
|
2
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
3
3
|
import { i as metaLoaderQueryGlob, n as metaLoaderFileGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
4
|
-
import { t as indexFile } from "../index-file-
|
|
5
|
-
import {
|
|
4
|
+
import { t as indexFile } from "../index-file-DHU9QZX_.js";
|
|
5
|
+
import { i as resolveMacroOptions, r as createMacroMatcher } from "../options-DZSjmVhY.js";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
// src/next/index.ts
|
|
8
8
|
const defaultPageExtensions = [
|
|
@@ -91,9 +91,9 @@ function createMDX(options = {}) {
|
|
|
91
91
|
config.module.rules ||= [];
|
|
92
92
|
const loaderOptions = onLoaderOptions("webpack");
|
|
93
93
|
if (macro) {
|
|
94
|
-
const matcher = createMacroMatcher(macro);
|
|
94
|
+
const matcher = createMacroMatcher(process.cwd(), macro);
|
|
95
95
|
config.module.rules.push({
|
|
96
|
-
test:
|
|
96
|
+
test: matcher,
|
|
97
97
|
enforce: "pre",
|
|
98
98
|
use: [{
|
|
99
99
|
loader: "fumadocs-mdx/webpack/macro",
|
package/dist/node/_loader.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { t as createCore } from "../core-
|
|
2
|
-
import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-
|
|
3
|
-
import { t as createMdxLoader } from "../mdx-
|
|
4
|
-
import { t as createMetaLoader } from "../meta-
|
|
1
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
2
|
+
import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-DJT55ieR.js";
|
|
3
|
+
import { t as createMdxLoader } from "../mdx-oiwGpmIR.js";
|
|
4
|
+
import { t as createMetaLoader } from "../meta-CsSsB7_T.js";
|
|
5
5
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
6
|
-
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-
|
|
7
|
-
import {
|
|
8
|
-
import { r as slash } from "../codegen-BAuFQ5Ew.js";
|
|
9
|
-
import path from "node:path";
|
|
6
|
+
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-Ch9sPj_e.js";
|
|
7
|
+
import { i as resolveMacroOptions, r as createMacroMatcher } from "../options-DZSjmVhY.js";
|
|
10
8
|
import { fileURLToPath } from "node:url";
|
|
11
9
|
// src/node/_loader.ts
|
|
12
10
|
let cachedLoaders;
|
|
13
11
|
function toNodeMacro(options, root) {
|
|
14
|
-
const matcher = createMacroMatcher(options);
|
|
12
|
+
const matcher = createMacroMatcher(root, options);
|
|
15
13
|
return async (url, context, nextLoad) => {
|
|
16
14
|
if (!url.startsWith("file:///")) return nextLoad(url, context);
|
|
17
15
|
const file = fileURLToPath(new URL(url));
|
|
18
|
-
|
|
19
|
-
if (rel.startsWith("..") || !matcher(rel)) return nextLoad(url, context);
|
|
16
|
+
if (!matcher(file)) return nextLoad(url, context);
|
|
20
17
|
const loaded = await nextLoad(url, context);
|
|
21
18
|
const code = loaded.source?.toString();
|
|
22
19
|
if (!code || !code.includes("fumadocs-mdx/macro")) return loaded;
|
|
23
|
-
const { transformMacroModule } = await import("../transform-
|
|
20
|
+
const { transformMacroModule } = await import("../transform-CAcchC26.js").then((n) => n.i);
|
|
24
21
|
const result = await transformMacroModule({
|
|
25
22
|
code,
|
|
26
23
|
file,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as CoreOptions } from "../core-
|
|
2
|
-
import { t as MacroPluginOption } from "../options-
|
|
1
|
+
import { r as CoreOptions } from "../core-OVmyAj82.js";
|
|
2
|
+
import { t as MacroPluginOption } from "../options-aTvMSrKg.js";
|
|
3
3
|
export interface NodeLoaderOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
|
4
4
|
/**
|
|
5
5
|
* Configure the macro API (`fumadocs-mdx/macro`), or `false` to disable it.
|
package/dist/node/loader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createCore } from "../core-
|
|
2
|
-
import { t as createMdxLoader } from "../mdx-
|
|
3
|
-
import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-
|
|
4
|
-
import { t as createMetaLoader } from "../meta-
|
|
1
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
2
|
+
import { t as createMdxLoader } from "../mdx-oiwGpmIR.js";
|
|
3
|
+
import { n as toNode, o as createStandaloneConfigLoader } from "../adapter-DJT55ieR.js";
|
|
4
|
+
import { t as createMetaLoader } from "../meta-CsSsB7_T.js";
|
|
5
5
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
6
6
|
// src/node/loader.ts
|
|
7
7
|
const core = createCore({ environment: "node" });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { r as slash } from "./codegen-uHLSduG-.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import picomatch from "picomatch";
|
|
4
|
+
// src/macro/options.ts
|
|
5
|
+
const MacroModuleId = "fumadocs-mdx/macro";
|
|
6
|
+
/**
|
|
7
|
+
* Modules in `node_modules` never use the macro API.
|
|
8
|
+
*/
|
|
9
|
+
const NodeModulesRegex = /[\\/]node_modules[\\/]/;
|
|
10
|
+
/**
|
|
11
|
+
* One pattern per extension: brace expansion (`*.{js,ts}`) isn't understood by every glob engine
|
|
12
|
+
* these are handed to (Turbopack rule keys in particular).
|
|
13
|
+
*/
|
|
14
|
+
const DefaultInclude = [
|
|
15
|
+
"**/*.js",
|
|
16
|
+
"**/*.jsx",
|
|
17
|
+
"**/*.mjs",
|
|
18
|
+
"**/*.ts",
|
|
19
|
+
"**/*.tsx",
|
|
20
|
+
"**/*.mts"
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Match absolute paths of modules, including those outside of root (e.g. workspace packages).
|
|
24
|
+
*
|
|
25
|
+
* @param root - project root, `include` patterns are relative to it
|
|
26
|
+
*/
|
|
27
|
+
function createMacroMatcher(root, { include }) {
|
|
28
|
+
const isIncluded = picomatch(include, {
|
|
29
|
+
basename: true,
|
|
30
|
+
windows: true
|
|
31
|
+
});
|
|
32
|
+
return (file) => !NodeModulesRegex.test(file) && isIncluded(slash(path.relative(root, file)));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @returns `undefined` when the macro API is disabled.
|
|
36
|
+
*/
|
|
37
|
+
function resolveMacroOptions(option) {
|
|
38
|
+
if (option === false) return;
|
|
39
|
+
const { include = DefaultInclude } = option ?? {};
|
|
40
|
+
return { include: typeof include === "string" ? [include] : include };
|
|
41
|
+
}
|
|
42
|
+
export { resolveMacroOptions as i, NodeModulesRegex as n, createMacroMatcher as r, MacroModuleId as t };
|
|
@@ -11,8 +11,4 @@ interface MacroOptions {
|
|
|
11
11
|
* `false` disables the macro API.
|
|
12
12
|
*/
|
|
13
13
|
type MacroPluginOption = MacroOptions | false;
|
|
14
|
-
|
|
15
|
-
include: string[];
|
|
16
|
-
exclude: string[];
|
|
17
|
-
}
|
|
18
|
-
export { ResolvedMacroOptions as n, MacroPluginOption as t };
|
|
14
|
+
export { MacroPluginOption as t };
|
|
@@ -41,8 +41,9 @@ async function renderStructuredData(records, props) {
|
|
|
41
41
|
});
|
|
42
42
|
return toStructuredData(list, await Promise.all(list.map((record) => typeof record.content === "string" ? record.content : renderToMarkdown(record.content, { target: "search" }))));
|
|
43
43
|
}
|
|
44
|
-
/** every MDX component is the
|
|
45
|
-
const
|
|
44
|
+
/** the type of every MDX component is named after its tag, and has the ones of its member tags like `<Tabs.Tab>` */
|
|
45
|
+
const tag = (name) => new Proxy({}, { get: (_, key) => key === "displayName" ? name : tag(`${name}.${String(key)}`) });
|
|
46
|
+
const tags = new Proxy({}, { get: (_, key) => tag(String(key)) });
|
|
46
47
|
/**
|
|
47
48
|
* Read the structured data of a page for its props without rendering it: components don't run, they stay as HTML tags
|
|
48
49
|
* like search dialogs show them.
|
|
@@ -67,7 +68,7 @@ function toText(node) {
|
|
|
67
68
|
const inner = toText(props.children);
|
|
68
69
|
const { type } = node;
|
|
69
70
|
const name = typeof type === "string" ? type : type.displayName ?? type.name;
|
|
70
|
-
if (!name || /^[a-z]
|
|
71
|
+
if (!name || /^[a-z][^.]*$/.test(name)) return inner;
|
|
71
72
|
return toHtmlTag(name, props, inner);
|
|
72
73
|
}
|
|
73
74
|
// src/utils/page.ts
|
|
@@ -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-OVmyAj82.js";
|
|
2
2
|
export { IndexFilePlugin, IndexFilePluginOptions, indexFile as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as default } from "../index-file-
|
|
1
|
+
export { t as default } from "../index-file-DHU9QZX_.js";
|
package/dist/rolldown/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { r as CoreOptions } from "../core-
|
|
2
|
-
import { t as MacroPluginOption } from "../options-
|
|
1
|
+
import { r as CoreOptions } from "../core-OVmyAj82.js";
|
|
2
|
+
import { t as MacroPluginOption } from "../options-aTvMSrKg.js";
|
|
3
3
|
import { RolldownPlugin } from "rolldown";
|
|
4
4
|
export interface PluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
|
5
5
|
/**
|
|
6
6
|
* Configure the macro API (`fumadocs-mdx/macro`), or `false` to disable it.
|
|
7
|
-
*
|
|
8
|
-
* `macro.include` (relative to cwd) is passed to the `id` filter of the transform hook.
|
|
9
7
|
*/
|
|
10
8
|
macro?: MacroPluginOption;
|
|
11
9
|
/**
|
package/dist/rolldown/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { r as buildConfig } from "../build-
|
|
2
|
-
import { t as createCore } from "../core-
|
|
1
|
+
import { r as buildConfig } from "../build-Dc0aOaCg.js";
|
|
2
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
3
3
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
4
|
-
import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-
|
|
5
|
-
import { t as createMdxLoader } from "../mdx-
|
|
6
|
-
import { t as createMetaLoader } from "../meta-
|
|
7
|
-
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-
|
|
8
|
-
import {
|
|
9
|
-
import { r as slash } from "../codegen-BAuFQ5Ew.js";
|
|
4
|
+
import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-DJT55ieR.js";
|
|
5
|
+
import { t as createMdxLoader } from "../mdx-oiwGpmIR.js";
|
|
6
|
+
import { t as createMetaLoader } from "../meta-CsSsB7_T.js";
|
|
7
|
+
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-Ch9sPj_e.js";
|
|
8
|
+
import { i as resolveMacroOptions, n as NodeModulesRegex, r as createMacroMatcher, t as MacroModuleId } from "../options-DZSjmVhY.js";
|
|
10
9
|
import fs from "node:fs/promises";
|
|
11
|
-
import path from "node:path";
|
|
12
10
|
// src/rolldown/index.ts
|
|
13
11
|
async function mdx(config = {}, options) {
|
|
14
12
|
const root = process.cwd();
|
|
@@ -31,19 +29,18 @@ async function mdx(config = {}, options) {
|
|
|
31
29
|
outDir: core.outDir
|
|
32
30
|
})
|
|
33
31
|
});
|
|
32
|
+
const matcher = createMacroMatcher(root, macroOptions);
|
|
34
33
|
plugins.push({
|
|
35
34
|
name: "fumadocs-mdx:macro",
|
|
36
35
|
transform: {
|
|
37
36
|
filter: {
|
|
38
|
-
id: {
|
|
39
|
-
include: macroOptions.include.map((pattern) => slash(path.resolve(root, pattern))),
|
|
40
|
-
exclude: macroOptions.exclude
|
|
41
|
-
},
|
|
37
|
+
id: { exclude: NodeModulesRegex },
|
|
42
38
|
code: MacroModuleId
|
|
43
39
|
},
|
|
44
40
|
async handler(code, id) {
|
|
45
41
|
const [file] = id.split("?", 2);
|
|
46
|
-
|
|
42
|
+
if (!matcher(file)) return;
|
|
43
|
+
const { transformMacroModule } = await import("../transform-CAcchC26.js").then((n) => n.i);
|
|
47
44
|
const result = await transformMacroModule({
|
|
48
45
|
code,
|
|
49
46
|
file,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as DocsCollection, N as ExtractedReference, j as CompiledMDXProperties, y as DocCollection } from "../core-
|
|
1
|
+
import { C as DocsCollection, N as ExtractedReference, j as CompiledMDXProperties, y as DocCollection } from "../core-OVmyAj82.js";
|
|
2
2
|
import { a as InternalTypeConfig } from "../types-DfxNhkVk.js";
|
|
3
3
|
import { FC, ReactNode } from "react";
|
|
4
4
|
import { Params } from "fumadocs-core/source";
|
package/dist/runtime/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../config/index.js";
|
|
2
2
|
import { AsyncDocCollectionEntry, AsyncDocsCollectionEntry } from "./server.js";
|
|
3
|
-
import { C as DocsCollection, r as CoreOptions, y as DocCollection } from "../core-
|
|
3
|
+
import { C as DocsCollection, r as CoreOptions, y as DocCollection } from "../core-OVmyAj82.js";
|
|
4
4
|
import { a as InternalTypeConfig, r as FileInfo } from "../types-DfxNhkVk.js";
|
|
5
5
|
export interface LazyEntry<Data = unknown> {
|
|
6
6
|
info: FileInfo;
|
package/dist/runtime/dynamic.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as buildConfig } from "../build-
|
|
1
|
+
import { r as buildConfig } from "../build-Dc0aOaCg.js";
|
|
2
2
|
import { t as buildMDX } from "../build-ClrPX9Ea.js";
|
|
3
3
|
import { t as frontmatterCode } from "../code-BWwFhg-7.js";
|
|
4
4
|
import { server } from "./server.js";
|
|
5
|
-
import { t as createCore } from "../core-
|
|
5
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
6
6
|
import { frontmatter } from "fumadocs-core/content/md/frontmatter";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
8
8
|
import { pathToFileURL } from "node:url";
|
package/dist/runtime/macro.js
CHANGED
package/dist/runtime/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as DocsCollection, T as MetaCollection, y as DocCollection } from "../core-
|
|
1
|
+
import { C as DocsCollection, T as MetaCollection, y as DocCollection } from "../core-OVmyAj82.js";
|
|
2
2
|
import "../config/index.js";
|
|
3
3
|
import { a as InternalTypeConfig, n as DocMethods, o as MetaMethods, t as DocData } from "../types-DfxNhkVk.js";
|
|
4
4
|
import { MetaData, PageData, Params, Source } from "fumadocs-core/source";
|
package/dist/runtime/server.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as merge, n as browserMethods, o as track, r as defineOutputs, s as renderStructuredData, t as bind } from "../page-
|
|
1
|
+
import { i as merge, n as browserMethods, o as track, r as defineOutputs, s as renderStructuredData, t as bind } from "../page-DI7o9MOD.js";
|
|
2
2
|
import { createElement } from "react";
|
|
3
|
-
import { PathUtils } from "fumadocs-core/source";
|
|
4
3
|
// src/runtime/server.ts
|
|
5
4
|
function server() {
|
|
6
5
|
function fileInfo(file, base) {
|
|
@@ -59,11 +58,10 @@ function server() {
|
|
|
59
58
|
};
|
|
60
59
|
}
|
|
61
60
|
function toFumadocsSource(pages, metas, options) {
|
|
62
|
-
const baseDir = options?.baseDir;
|
|
63
61
|
const files = [];
|
|
64
62
|
for (const entry of pages) files.push({
|
|
65
63
|
type: "page",
|
|
66
|
-
path:
|
|
64
|
+
path: entry.info.path,
|
|
67
65
|
absolutePath: entry.info.fullPath,
|
|
68
66
|
data: entry,
|
|
69
67
|
dataAt: (params, custom) => custom ? createDocAt(entry, {
|
|
@@ -73,12 +71,15 @@ function toFumadocsSource(pages, metas, options) {
|
|
|
73
71
|
});
|
|
74
72
|
for (const entry of metas) files.push({
|
|
75
73
|
type: "meta",
|
|
76
|
-
path:
|
|
74
|
+
path: entry.info.path,
|
|
77
75
|
absolutePath: entry.info.fullPath,
|
|
78
76
|
data: entry,
|
|
79
77
|
dataAt: metaAt(entry)
|
|
80
78
|
});
|
|
81
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
files,
|
|
81
|
+
baseDir: options?.baseDir
|
|
82
|
+
};
|
|
82
83
|
}
|
|
83
84
|
/** the data of a meta file in each folder of its params, see the meta loader */
|
|
84
85
|
function metaAt(meta) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.js";
|
|
2
|
-
import { r as slash, t as createCodegen } from "./codegen-
|
|
3
|
-
import { t as MacroModuleId } from "./options-
|
|
4
|
-
import { t as SupportedPatterns } from "./build-
|
|
2
|
+
import { r as slash, t as createCodegen } from "./codegen-uHLSduG-.js";
|
|
3
|
+
import { t as MacroModuleId } from "./options-DZSjmVhY.js";
|
|
4
|
+
import { t as SupportedPatterns } from "./build-Dc0aOaCg.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import MagicString from "magic-string";
|
|
7
7
|
// src/macro/transform.ts
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { p as IndexFilePluginOptions, r as CoreOptions, w as GlobalConfig } from "../core-
|
|
2
|
-
import { t as MacroPluginOption } from "../options-
|
|
1
|
+
import { p as IndexFilePluginOptions, r as CoreOptions, w as GlobalConfig } from "../core-OVmyAj82.js";
|
|
2
|
+
import { t as MacroPluginOption } from "../options-aTvMSrKg.js";
|
|
3
3
|
import "../config/index.js";
|
|
4
4
|
import { Plugin } from "vite";
|
|
5
5
|
export interface PluginOptions extends Pick<CoreOptions, 'configPath' | 'outDir' | 'plugins'> {
|
|
6
6
|
/**
|
|
7
7
|
* Configure the macro API (`fumadocs-mdx/macro`), or `false` to disable it.
|
|
8
|
-
*
|
|
9
|
-
* `macro.include` is passed to the
|
|
10
|
-
* [`id` filter](https://vite.dev/guide/api-plugin#hook-filters) of the transform hook.
|
|
11
8
|
*/
|
|
12
9
|
macro?: MacroPluginOption;
|
|
13
10
|
/**
|
package/dist/vite/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as buildConfig } from "../build-
|
|
2
|
-
import { t as createMdxLoader } from "../mdx-
|
|
3
|
-
import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-
|
|
4
|
-
import { t as createCore } from "../core-
|
|
5
|
-
import { t as createMetaLoader } from "../meta-
|
|
6
|
-
import { t as indexFile } from "../index-file-
|
|
1
|
+
import { r as buildConfig } from "../build-Dc0aOaCg.js";
|
|
2
|
+
import { t as createMdxLoader } from "../mdx-oiwGpmIR.js";
|
|
3
|
+
import { a as createIntegratedConfigLoader, r as toVite } from "../adapter-DJT55ieR.js";
|
|
4
|
+
import { t as createCore } from "../core-r1WHKfaI.js";
|
|
5
|
+
import { t as createMetaLoader } from "../meta-CsSsB7_T.js";
|
|
6
|
+
import { t as indexFile } from "../index-file-DHU9QZX_.js";
|
|
7
7
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
8
|
-
import {
|
|
8
|
+
import { i as resolveMacroOptions, n as NodeModulesRegex, r as createMacroMatcher, t as MacroModuleId } from "../options-DZSjmVhY.js";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { runnerImport } from "vite";
|
|
@@ -53,7 +53,7 @@ function mdx(forcedConfig, pluginOptions = {}) {
|
|
|
53
53
|
const core = managed.core;
|
|
54
54
|
const macroOptions = resolveMacroOptions(pluginOptions.macro);
|
|
55
55
|
if (macroOptions) {
|
|
56
|
-
const { MacroCollector } = await import("../eval-
|
|
56
|
+
const { MacroCollector } = await import("../eval-Ch9sPj_e.js").then((n) => n.r);
|
|
57
57
|
core.macro = new MacroCollector({
|
|
58
58
|
root: core.root,
|
|
59
59
|
outDir: core.outDir,
|
|
@@ -84,18 +84,17 @@ function mdx(forcedConfig, pluginOptions = {}) {
|
|
|
84
84
|
};
|
|
85
85
|
if (macroOptions) {
|
|
86
86
|
const root = core.root;
|
|
87
|
+
const matcher = createMacroMatcher(root, macroOptions);
|
|
87
88
|
macroPlugin.transform = {
|
|
88
89
|
order: "pre",
|
|
89
90
|
filter: {
|
|
90
|
-
id: {
|
|
91
|
-
include: macroOptions.include,
|
|
92
|
-
exclude: macroOptions.exclude
|
|
93
|
-
},
|
|
91
|
+
id: { exclude: NodeModulesRegex },
|
|
94
92
|
code: MacroModuleId
|
|
95
93
|
},
|
|
96
94
|
async handler(code, id) {
|
|
97
95
|
const [file] = id.split("?", 2);
|
|
98
|
-
|
|
96
|
+
if (!matcher(file)) return;
|
|
97
|
+
const { transformMacroModule } = await import("../transform-CAcchC26.js").then((n) => n.i);
|
|
99
98
|
const result = await transformMacroModule({
|
|
100
99
|
code,
|
|
101
100
|
file,
|
package/dist/webpack/macro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as WebpackLoaderOptions } from "../index-
|
|
1
|
+
import { t as WebpackLoaderOptions } from "../index-CCVoEC9e.js";
|
|
2
2
|
import { LoaderDefinitionFunction } from "webpack";
|
|
3
3
|
/**
|
|
4
4
|
* Expand macro calls (`fumadocs-mdx/macro`) into static imports of content files.
|
package/dist/webpack/macro.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as transformMacroModule } from "../transform-
|
|
2
|
-
import "../options-
|
|
1
|
+
import { r as transformMacroModule } from "../transform-CAcchC26.js";
|
|
2
|
+
import "../options-DZSjmVhY.js";
|
|
3
3
|
// src/webpack/macro.ts
|
|
4
4
|
/**
|
|
5
5
|
* Expand macro calls (`fumadocs-mdx/macro`) into static imports of content files.
|
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-CCVoEC9e.js";
|
|
2
2
|
import { LoaderDefinitionFunction } from "webpack";
|
|
3
3
|
declare const loader: LoaderDefinitionFunction<WebpackLoaderOptions>;
|
|
4
4
|
export { loader as default };
|
package/dist/webpack/mdx.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as createMdxLoader } from "../mdx-
|
|
2
|
-
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-
|
|
3
|
-
import { t as getCore } from "../webpack-
|
|
1
|
+
import { t as createMdxLoader } from "../mdx-oiwGpmIR.js";
|
|
2
|
+
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-DJT55ieR.js";
|
|
3
|
+
import { t as getCore } from "../webpack-BXq21GfV.js";
|
|
4
4
|
// src/webpack/mdx.ts
|
|
5
5
|
let instance;
|
|
6
6
|
const loader = function loader(source) {
|
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-CCVoEC9e.js";
|
|
2
2
|
import { LoaderDefinitionFunction } from "webpack";
|
|
3
3
|
declare const loader: LoaderDefinitionFunction<WebpackLoaderOptions>;
|
|
4
4
|
export { loader as default };
|
package/dist/webpack/meta.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-
|
|
2
|
-
import { t as createMetaLoader } from "../meta-
|
|
3
|
-
import { t as getCore } from "../webpack-
|
|
1
|
+
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-DJT55ieR.js";
|
|
2
|
+
import { t as createMetaLoader } from "../meta-CsSsB7_T.js";
|
|
3
|
+
import { t as getCore } from "../webpack-BXq21GfV.js";
|
|
4
4
|
// src/webpack/meta.ts
|
|
5
5
|
const instances = /* @__PURE__ */ new Map();
|
|
6
6
|
const loader = function(source) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as createCore } from "./core-
|
|
2
|
-
import { n as createNodeEvaluator, t as MacroCollector } from "./eval-
|
|
1
|
+
import { t as createCore } from "./core-r1WHKfaI.js";
|
|
2
|
+
import { n as createNodeEvaluator, t as MacroCollector } from "./eval-Ch9sPj_e.js";
|
|
3
3
|
// src/webpack/index.ts
|
|
4
4
|
let core;
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "15.6.
|
|
3
|
+
"version": "15.6.4",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"zod": "^4.6.7"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@fumadocs/satteri": "0.8.
|
|
82
|
+
"@fumadocs/satteri": "0.8.4",
|
|
83
83
|
"@fumadocs/vite": "0.1.0",
|
|
84
84
|
"@types/bun": "^1.4.4",
|
|
85
85
|
"@types/mdast": "^4.0.4",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@types/picomatch": "^4.0.3",
|
|
89
89
|
"@types/react": "^19.3.0",
|
|
90
90
|
"@vitejs/plugin-rsc": "^0.5.39",
|
|
91
|
-
"fumadocs-core": "16.19.
|
|
91
|
+
"fumadocs-core": "16.19.5",
|
|
92
92
|
"mdast-util-directive": "^3.2.0",
|
|
93
93
|
"next": "^16.4.6",
|
|
94
94
|
"react": "^19.3.1",
|
package/dist/options-B2o-zV4A.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import picomatch from "picomatch";
|
|
2
|
-
// src/macro/options.ts
|
|
3
|
-
const MacroModuleId = "fumadocs-mdx/macro";
|
|
4
|
-
/**
|
|
5
|
-
* One pattern per extension: brace expansion (`*.{js,ts}`) isn't understood by every glob engine
|
|
6
|
-
* these are handed to (Turbopack rule keys in particular).
|
|
7
|
-
*/
|
|
8
|
-
const DefaultInclude = [
|
|
9
|
-
"**/*.js",
|
|
10
|
-
"**/*.jsx",
|
|
11
|
-
"**/*.mjs",
|
|
12
|
-
"**/*.ts",
|
|
13
|
-
"**/*.tsx",
|
|
14
|
-
"**/*.mts"
|
|
15
|
-
];
|
|
16
|
-
const DefaultExclude = ["**/node_modules/**"];
|
|
17
|
-
function createMacroMatcher({ include, exclude }) {
|
|
18
|
-
const isIncluded = picomatch(include, {
|
|
19
|
-
basename: true,
|
|
20
|
-
windows: true
|
|
21
|
-
});
|
|
22
|
-
const isExcluded = picomatch(exclude, { windows: true });
|
|
23
|
-
return (path) => !isExcluded(path) && isIncluded(path);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @returns `undefined` when the macro API is disabled.
|
|
27
|
-
*/
|
|
28
|
-
function resolveMacroOptions(option) {
|
|
29
|
-
if (option === false) return;
|
|
30
|
-
const { include = DefaultInclude } = option ?? {};
|
|
31
|
-
return {
|
|
32
|
-
include: typeof include === "string" ? [include] : include,
|
|
33
|
-
exclude: DefaultExclude
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export { createMacroMatcher as n, resolveMacroOptions as r, MacroModuleId as t };
|