fumadocs-mdx 15.5.2 → 15.5.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.
- package/dist/{adapter-C30pL0Cs.js → adapter-C04Ekc4W.js} +2 -2
- package/dist/bun/index.js +6 -6
- package/dist/{codegen-COHeuzzn.js → codegen-BAuFQ5Ew.js} +2 -7
- package/dist/{core-BITOWTcu.js → core-CJjfu3ju.js} +1 -1
- package/dist/{eval-DNSTLHS_.js → eval-DAaN7Bq9.js} +2 -2
- package/dist/{index-file-DLzuhwuF.js → index-file-BKxOSG_x.js} +2 -3
- package/dist/{mdx-BDszS448.js → mdx-VmqU5Oaj.js} +2 -2
- package/dist/next/index.js +2 -2
- package/dist/node/_loader.js +6 -6
- package/dist/node/loader.js +3 -3
- package/dist/plugins/index-file.js +1 -1
- package/dist/rolldown/index.js +6 -6
- package/dist/runtime/dynamic.js +1 -1
- package/dist/{transform-6dcWqSld.js → transform-D7pyKPqb.js} +11 -9
- package/dist/vite/index.js +6 -6
- package/dist/webpack/macro.js +1 -1
- package/dist/webpack/mdx.js +3 -3
- package/dist/webpack/meta.js +2 -2
- package/dist/{webpack-Yu3bafVW.js → webpack-BoqJZRKf.js} +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as slash } from "./codegen-BAuFQ5Ew.js";
|
|
2
2
|
import { n as runModule } from "./code-BF5OS485.js";
|
|
3
3
|
import { r as buildConfig } from "./build-TiTOkhq4.js";
|
|
4
|
-
import { n as ValidationError } from "./core-
|
|
4
|
+
import { n as ValidationError } from "./core-CJjfu3ju.js";
|
|
5
5
|
import { t as loadConfig } from "./load-from-file-gZlf7m88.js";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import { z } from "zod";
|
package/dist/bun/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as createMdxLoader } from "../mdx-
|
|
1
|
+
import { t as createMdxLoader } from "../mdx-VmqU5Oaj.js";
|
|
2
2
|
import { r as buildConfig } from "../build-TiTOkhq4.js";
|
|
3
|
-
import { t as createCore } from "../core-
|
|
4
|
-
import { a as createIntegratedConfigLoader, s as createMetaLoader, t as toBun } from "../adapter-
|
|
3
|
+
import { t as createCore } from "../core-CJjfu3ju.js";
|
|
4
|
+
import { a as createIntegratedConfigLoader, s as createMetaLoader, t as toBun } from "../adapter-C04Ekc4W.js";
|
|
5
5
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
6
6
|
import { r as resolveMacroOptions } from "../options-B2o-zV4A.js";
|
|
7
|
-
import {
|
|
7
|
+
import { r as slash } from "../codegen-BAuFQ5Ew.js";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
@@ -44,7 +44,7 @@ function createMdxPlugin(options = {}) {
|
|
|
44
44
|
await core.init({ config: buildConfig(configExports, process.cwd()) });
|
|
45
45
|
if (macroOptions) {
|
|
46
46
|
const root = process.cwd();
|
|
47
|
-
const { MacroCollector } = await import("../eval-
|
|
47
|
+
const { MacroCollector } = await import("../eval-DAaN7Bq9.js").then((n) => n.r);
|
|
48
48
|
const pendingEvals = /* @__PURE__ */ new Map();
|
|
49
49
|
core.macro = new MacroCollector({
|
|
50
50
|
root,
|
|
@@ -76,7 +76,7 @@ function createMdxPlugin(options = {}) {
|
|
|
76
76
|
contents: await transform(source, file) ?? source,
|
|
77
77
|
loader
|
|
78
78
|
};
|
|
79
|
-
const { transformMacroModule } = await import("../transform-
|
|
79
|
+
const { transformMacroModule } = await import("../transform-D7pyKPqb.js").then((n) => n.i);
|
|
80
80
|
return {
|
|
81
81
|
contents: (await transformMacroModule({
|
|
82
82
|
code: source,
|
|
@@ -83,15 +83,10 @@ function createCodegen({ target = "default", outDir = "", jsExtension = false, g
|
|
|
83
83
|
/**
|
|
84
84
|
* Serialize a query object into a `?`-prefixed, percent-encoded string.
|
|
85
85
|
*/
|
|
86
|
-
/**
|
|
87
|
-
* The meta loader outputs JavaScript, for meta files in code too. Vite's `lang.*` flag tells it the language of a module
|
|
88
|
-
* with a query, the language of `meta.ts?macro_id=app%2Fsource.ts%23docs` isn't detected otherwise.
|
|
89
|
-
*/
|
|
90
|
-
const metaLang = { "lang.js": "" };
|
|
91
86
|
function stringifyQuery(query = {}) {
|
|
92
87
|
const searchParams = new URLSearchParams();
|
|
93
88
|
for (const [k, v] of Object.entries(query)) if (v !== void 0) searchParams.set(k, v);
|
|
94
|
-
return searchParams.size > 0 ? `?${searchParams.toString().replaceAll(
|
|
89
|
+
return searchParams.size > 0 ? `?${searchParams.toString().replaceAll(".", "%2E")}` : "";
|
|
95
90
|
}
|
|
96
91
|
/**
|
|
97
92
|
* convert into POSIX & relative file paths, such that Vite can accept it.
|
|
@@ -109,4 +104,4 @@ function slash(path) {
|
|
|
109
104
|
function ident(code, tab = 1) {
|
|
110
105
|
return code.split("\n").map((v) => " ".repeat(tab) + v).join("\n");
|
|
111
106
|
}
|
|
112
|
-
export {
|
|
107
|
+
export { ident as n, slash as r, createCodegen as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.js";
|
|
2
|
-
import { n as transformMacroConfigModule, t as parseMacroId } from "./transform-
|
|
2
|
+
import { n as transformMacroConfigModule, t as parseMacroId } from "./transform-D7pyKPqb.js";
|
|
3
3
|
import { n as buildCollection } from "./build-TiTOkhq4.js";
|
|
4
4
|
import { r as defineDocs } from "./define-C2jwQBlt.js";
|
|
5
|
-
import {
|
|
5
|
+
import { r as slash } from "./codegen-BAuFQ5Ew.js";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ident, r as slash, t as createCodegen } from "./codegen-BAuFQ5Ew.js";
|
|
2
2
|
import { t as frontmatterCode } from "./code-BF5OS485.js";
|
|
3
3
|
import { frontmatter } from "fumadocs-core/content/md/frontmatter";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
@@ -264,8 +264,7 @@ function generateMetaCollectionGlob({ codegen, workspace }, collection, eager =
|
|
|
264
264
|
return codegen.generateGlobImport(collection.patterns, {
|
|
265
265
|
query: {
|
|
266
266
|
collection: collection.name,
|
|
267
|
-
workspace
|
|
268
|
-
...metaLang
|
|
267
|
+
workspace
|
|
269
268
|
},
|
|
270
269
|
import: "default",
|
|
271
270
|
base: collection.dir,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as slash } from "./codegen-BAuFQ5Ew.js";
|
|
2
2
|
import { t as frontmatterCode } from "./code-BF5OS485.js";
|
|
3
|
-
import { c as readStaticParams } from "./adapter-
|
|
3
|
+
import { c as readStaticParams } from "./adapter-C04Ekc4W.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";
|
package/dist/next/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as loadConfig } from "../load-from-file-gZlf7m88.js";
|
|
2
|
-
import { t as createCore } from "../core-
|
|
2
|
+
import { t as createCore } from "../core-CJjfu3ju.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-
|
|
4
|
+
import { t as indexFile } from "../index-file-BKxOSG_x.js";
|
|
5
5
|
import { n as createMacroMatcher, r as resolveMacroOptions } from "../options-B2o-zV4A.js";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
// src/next/index.ts
|
package/dist/node/_loader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as createCore } from "../core-
|
|
2
|
-
import { n as toNode, o as createStandaloneConfigLoader, s as createMetaLoader } from "../adapter-
|
|
3
|
-
import { t as createMdxLoader } from "../mdx-
|
|
1
|
+
import { t as createCore } from "../core-CJjfu3ju.js";
|
|
2
|
+
import { n as toNode, o as createStandaloneConfigLoader, s as createMetaLoader } from "../adapter-C04Ekc4W.js";
|
|
3
|
+
import { t as createMdxLoader } from "../mdx-VmqU5Oaj.js";
|
|
4
4
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
5
|
-
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-
|
|
5
|
+
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-DAaN7Bq9.js";
|
|
6
6
|
import { n as createMacroMatcher, r as resolveMacroOptions } from "../options-B2o-zV4A.js";
|
|
7
|
-
import {
|
|
7
|
+
import { r as slash } from "../codegen-BAuFQ5Ew.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
// src/node/_loader.ts
|
|
@@ -19,7 +19,7 @@ function toNodeMacro(options, root) {
|
|
|
19
19
|
const loaded = await nextLoad(url, context);
|
|
20
20
|
const code = loaded.source?.toString();
|
|
21
21
|
if (!code || !code.includes("fumadocs-mdx/macro")) return loaded;
|
|
22
|
-
const { transformMacroModule } = await import("../transform-
|
|
22
|
+
const { transformMacroModule } = await import("../transform-D7pyKPqb.js").then((n) => n.i);
|
|
23
23
|
const result = await transformMacroModule({
|
|
24
24
|
code,
|
|
25
25
|
file,
|
package/dist/node/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as createCore } from "../core-
|
|
2
|
-
import { t as createMdxLoader } from "../mdx-
|
|
3
|
-
import { n as toNode, o as createStandaloneConfigLoader, s as createMetaLoader } from "../adapter-
|
|
1
|
+
import { t as createCore } from "../core-CJjfu3ju.js";
|
|
2
|
+
import { t as createMdxLoader } from "../mdx-VmqU5Oaj.js";
|
|
3
|
+
import { n as toNode, o as createStandaloneConfigLoader, s as createMetaLoader } from "../adapter-C04Ekc4W.js";
|
|
4
4
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
5
5
|
// src/node/loader.ts
|
|
6
6
|
const core = createCore({ environment: "node" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as default } from "../index-file-
|
|
1
|
+
export { t as default } from "../index-file-BKxOSG_x.js";
|
package/dist/rolldown/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as buildConfig } from "../build-TiTOkhq4.js";
|
|
2
|
-
import { t as createCore } from "../core-
|
|
2
|
+
import { t as createCore } from "../core-CJjfu3ju.js";
|
|
3
3
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
4
|
-
import { a as createIntegratedConfigLoader, r as toVite, s as createMetaLoader } from "../adapter-
|
|
5
|
-
import { t as createMdxLoader } from "../mdx-
|
|
6
|
-
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-
|
|
4
|
+
import { a as createIntegratedConfigLoader, r as toVite, s as createMetaLoader } from "../adapter-C04Ekc4W.js";
|
|
5
|
+
import { t as createMdxLoader } from "../mdx-VmqU5Oaj.js";
|
|
6
|
+
import { n as createNodeEvaluator, t as MacroCollector } from "../eval-DAaN7Bq9.js";
|
|
7
7
|
import { r as resolveMacroOptions, t as MacroModuleId } from "../options-B2o-zV4A.js";
|
|
8
|
-
import {
|
|
8
|
+
import { r as slash } from "../codegen-BAuFQ5Ew.js";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
// src/rolldown/index.ts
|
|
@@ -42,7 +42,7 @@ async function mdx(config = {}, options) {
|
|
|
42
42
|
},
|
|
43
43
|
async handler(code, id) {
|
|
44
44
|
const [file] = id.split("?", 2);
|
|
45
|
-
const { transformMacroModule } = await import("../transform-
|
|
45
|
+
const { transformMacroModule } = await import("../transform-D7pyKPqb.js").then((n) => n.i);
|
|
46
46
|
const result = await transformMacroModule({
|
|
47
47
|
code,
|
|
48
48
|
file,
|
package/dist/runtime/dynamic.js
CHANGED
|
@@ -2,7 +2,7 @@ import { r as buildConfig } from "../build-TiTOkhq4.js";
|
|
|
2
2
|
import { t as buildMDX } from "../build-Bnz9TOnv.js";
|
|
3
3
|
import { t as frontmatterCode } from "../code-BF5OS485.js";
|
|
4
4
|
import { server } from "./server.js";
|
|
5
|
-
import { t as createCore } from "../core-
|
|
5
|
+
import { t as createCore } from "../core-CJjfu3ju.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.js";
|
|
2
|
-
import {
|
|
2
|
+
import { r as slash, t as createCodegen } from "./codegen-BAuFQ5Ew.js";
|
|
3
3
|
import { t as MacroModuleId } from "./options-B2o-zV4A.js";
|
|
4
4
|
import { t as SupportedPatterns } from "./build-TiTOkhq4.js";
|
|
5
5
|
import path from "node:path";
|
|
@@ -125,10 +125,6 @@ function propertyKey(property) {
|
|
|
125
125
|
if (key.type === "Identifier") return key.name;
|
|
126
126
|
if (key.type === "Literal" && typeof key.value === "string") return key.value;
|
|
127
127
|
}
|
|
128
|
-
function getProperty(object, name) {
|
|
129
|
-
if (!object || object.type !== "ObjectExpression") return;
|
|
130
|
-
for (const property of object.properties) if (propertyKey(property) === name) return property.value;
|
|
131
|
-
}
|
|
132
128
|
function requireStatic(ctx, node, name, check, expected) {
|
|
133
129
|
if (!node) return;
|
|
134
130
|
const result = staticValue(node);
|
|
@@ -254,6 +250,15 @@ async function transformMacroModule({ code, file, root, target }) {
|
|
|
254
250
|
file,
|
|
255
251
|
code
|
|
256
252
|
};
|
|
253
|
+
function getProperty(object, name) {
|
|
254
|
+
if (!object || object.type !== "ObjectExpression") return;
|
|
255
|
+
const properties = object.properties;
|
|
256
|
+
for (let i = properties.length - 1; i >= 0; i--) {
|
|
257
|
+
const property = properties[i];
|
|
258
|
+
if (property.type === "SpreadElement") throw new MacroTransformError(file, code, property.start, `the options of a macro cannot be spread, since its \`${name}\` option affects how content files are bundled.`);
|
|
259
|
+
if (propertyKey(property) === name) return property.value;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
257
262
|
const cfg = slash(path.relative(root, file));
|
|
258
263
|
const moduleDir = path.dirname(file);
|
|
259
264
|
const codegen = createCodegen({
|
|
@@ -308,10 +313,7 @@ async function transformMacroModule({ code, file, root, target }) {
|
|
|
308
313
|
base,
|
|
309
314
|
eager: true,
|
|
310
315
|
import: "default",
|
|
311
|
-
query
|
|
312
|
-
...query,
|
|
313
|
-
...metaLang
|
|
314
|
-
}
|
|
316
|
+
query
|
|
315
317
|
})}`;
|
|
316
318
|
}
|
|
317
319
|
let replacement;
|
package/dist/vite/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as buildConfig } from "../build-TiTOkhq4.js";
|
|
2
|
-
import { t as createMdxLoader } from "../mdx-
|
|
3
|
-
import { a as createIntegratedConfigLoader, r as toVite, s as createMetaLoader } from "../adapter-
|
|
4
|
-
import { t as createCore } from "../core-
|
|
5
|
-
import { t as indexFile } from "../index-file-
|
|
2
|
+
import { t as createMdxLoader } from "../mdx-VmqU5Oaj.js";
|
|
3
|
+
import { a as createIntegratedConfigLoader, r as toVite, s as createMetaLoader } from "../adapter-C04Ekc4W.js";
|
|
4
|
+
import { t as createCore } from "../core-CJjfu3ju.js";
|
|
5
|
+
import { t as indexFile } from "../index-file-BKxOSG_x.js";
|
|
6
6
|
import { r as metaLoaderGlob, t as mdxLoaderGlob } from "../loaders-3R0gLmlP.js";
|
|
7
7
|
import { r as resolveMacroOptions, t as MacroModuleId } from "../options-B2o-zV4A.js";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
@@ -52,7 +52,7 @@ function mdx(forcedConfig, pluginOptions = {}) {
|
|
|
52
52
|
const core = managed.core;
|
|
53
53
|
const macroOptions = resolveMacroOptions(pluginOptions.macro);
|
|
54
54
|
if (macroOptions) {
|
|
55
|
-
const { MacroCollector } = await import("../eval-
|
|
55
|
+
const { MacroCollector } = await import("../eval-DAaN7Bq9.js").then((n) => n.r);
|
|
56
56
|
core.macro = new MacroCollector({
|
|
57
57
|
root: core.root,
|
|
58
58
|
outDir: core.outDir,
|
|
@@ -94,7 +94,7 @@ function mdx(forcedConfig, pluginOptions = {}) {
|
|
|
94
94
|
},
|
|
95
95
|
async handler(code, id) {
|
|
96
96
|
const [file] = id.split("?", 2);
|
|
97
|
-
const { transformMacroModule } = await import("../transform-
|
|
97
|
+
const { transformMacroModule } = await import("../transform-D7pyKPqb.js").then((n) => n.i);
|
|
98
98
|
const result = await transformMacroModule({
|
|
99
99
|
code,
|
|
100
100
|
file,
|
package/dist/webpack/macro.js
CHANGED
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-VmqU5Oaj.js";
|
|
2
|
+
import { i as toWebpack, o as createStandaloneConfigLoader } from "../adapter-C04Ekc4W.js";
|
|
3
|
+
import { t as getCore } from "../webpack-BoqJZRKf.js";
|
|
4
4
|
// src/webpack/mdx.ts
|
|
5
5
|
let instance;
|
|
6
6
|
const loader = function loader(source) {
|
package/dist/webpack/meta.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as toWebpack, o as createStandaloneConfigLoader, s as createMetaLoader } from "../adapter-
|
|
2
|
-
import { t as getCore } from "../webpack-
|
|
1
|
+
import { i as toWebpack, o as createStandaloneConfigLoader, s as createMetaLoader } from "../adapter-C04Ekc4W.js";
|
|
2
|
+
import { t as getCore } from "../webpack-BoqJZRKf.js";
|
|
3
3
|
// src/webpack/meta.ts
|
|
4
4
|
const instances = /* @__PURE__ */ new Map();
|
|
5
5
|
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-CJjfu3ju.js";
|
|
2
|
+
import { n as createNodeEvaluator, t as MacroCollector } from "./eval-DAaN7Bq9.js";
|
|
3
3
|
// src/webpack/index.ts
|
|
4
4
|
let core;
|
|
5
5
|
/**
|