fumadocs-mdx 13.0.8 → 14.0.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/bin.cjs +924 -901
- package/dist/bin.js +3 -3
- package/dist/build-mdx-6UAK5FF5.js +8 -0
- package/dist/bun/index.cjs +578 -471
- package/dist/bun/index.d.cts +3 -2
- package/dist/bun/index.d.ts +3 -2
- package/dist/bun/index.js +12 -12
- package/dist/chunk-4JSFLXXT.js +8 -0
- package/dist/chunk-5UMZCWKV.js +17 -0
- package/dist/chunk-5YXP7JLN.js +138 -0
- package/dist/{chunk-2E2JCOSO.js → chunk-6NISOLQ6.js} +16 -44
- package/dist/chunk-7L2KNF6B.js +180 -0
- package/dist/chunk-E5DJTSIM.js +86 -0
- package/dist/{chunk-K5ZLPEIQ.js → chunk-FBLMK4RS.js} +9 -6
- package/dist/{chunk-QXHN25N3.js → chunk-OXSRIWQW.js} +7 -8
- package/dist/chunk-PKI7ZDA5.js +29 -0
- package/dist/{chunk-3J3WL7WN.js → chunk-SLY7WXTX.js} +71 -58
- package/dist/{chunk-5FTSWCB4.js → chunk-SRSRFOVI.js} +8 -10
- package/dist/chunk-TYJDYTKH.js +85 -0
- package/dist/chunk-XHJCLBZ4.js +406 -0
- package/dist/{chunk-2HXTGJBI.js → chunk-ZY6UZ7NH.js} +22 -19
- package/dist/config/index.cjs +79 -71
- package/dist/config/index.d.cts +2 -1
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.js +5 -5
- package/dist/index-BlVBvy-z.d.ts +8 -0
- package/dist/{core-DB7TdlyC.d.cts → index-D7JdSMpp.d.cts} +99 -61
- package/dist/{core-DB7TdlyC.d.ts → index-D7JdSMpp.d.ts} +99 -61
- package/dist/index-P2NNUkHn.d.cts +8 -0
- package/dist/index.d.cts +3 -74
- package/dist/index.d.ts +3 -74
- package/dist/load-from-file-I3ALLIVB.js +8 -0
- package/dist/next/index.cjs +698 -476
- package/dist/next/index.d.cts +11 -1
- package/dist/next/index.d.ts +11 -1
- package/dist/next/index.js +78 -281
- package/dist/node/loader.cjs +704 -602
- package/dist/node/loader.js +10 -11
- package/dist/plugins/index-file.cjs +471 -0
- package/dist/plugins/index-file.d.cts +29 -0
- package/dist/plugins/index-file.d.ts +29 -0
- package/dist/plugins/index-file.js +8 -0
- package/dist/plugins/json-schema.d.cts +3 -2
- package/dist/plugins/json-schema.d.ts +3 -2
- package/dist/plugins/last-modified.cjs +75 -0
- package/dist/plugins/last-modified.d.cts +27 -0
- package/dist/plugins/last-modified.d.ts +27 -0
- package/dist/plugins/last-modified.js +44 -0
- package/dist/runtime/{vite/browser.cjs → browser.cjs} +40 -53
- package/dist/runtime/browser.d.cts +50 -0
- package/dist/runtime/browser.d.ts +50 -0
- package/dist/runtime/browser.js +68 -0
- package/dist/runtime/dynamic.cjs +985 -0
- package/dist/runtime/dynamic.d.cts +27 -0
- package/dist/runtime/dynamic.d.ts +27 -0
- package/dist/runtime/dynamic.js +78 -0
- package/dist/runtime/server.cjs +173 -0
- package/dist/runtime/server.d.cts +161 -0
- package/dist/runtime/server.d.ts +161 -0
- package/dist/runtime/server.js +8 -0
- package/dist/vite/index.cjs +934 -638
- package/dist/vite/index.d.cts +12 -22
- package/dist/vite/index.d.ts +12 -22
- package/dist/vite/index.js +30 -221
- package/dist/webpack/mdx.cjs +613 -515
- package/dist/webpack/mdx.d.cts +9 -1
- package/dist/webpack/mdx.d.ts +9 -1
- package/dist/webpack/mdx.js +12 -17
- package/dist/webpack/meta.cjs +327 -233
- package/dist/webpack/meta.d.cts +9 -1
- package/dist/webpack/meta.d.ts +9 -1
- package/dist/webpack/meta.js +13 -15
- package/package.json +15 -32
- package/dist/build-mdx-BjXOmv0b.d.cts +0 -53
- package/dist/build-mdx-CY5UldCO.d.ts +0 -53
- package/dist/chunk-2AQRQXSO.js +0 -119
- package/dist/chunk-CXA4JO4Z.js +0 -45
- package/dist/chunk-DMJ6I4C3.js +0 -76
- package/dist/chunk-FSZMKRVH.js +0 -80
- package/dist/chunk-II3H5ZVZ.js +0 -77
- package/dist/chunk-KILFIBVW.js +0 -75
- package/dist/chunk-NVRDCY6Z.js +0 -30
- package/dist/chunk-VUEZTR2H.js +0 -26
- package/dist/index-D7s7kCc2.d.cts +0 -7
- package/dist/index-D7s7kCc2.d.ts +0 -7
- package/dist/load-from-file-AVYOFOI7.js +0 -7
- package/dist/preset-ZMP6U62C.js +0 -6
- package/dist/runtime/next/async.cjs +0 -760
- package/dist/runtime/next/async.d.cts +0 -19
- package/dist/runtime/next/async.d.ts +0 -19
- package/dist/runtime/next/async.js +0 -86
- package/dist/runtime/next/index.cjs +0 -136
- package/dist/runtime/next/index.d.cts +0 -33
- package/dist/runtime/next/index.d.ts +0 -33
- package/dist/runtime/next/index.js +0 -11
- package/dist/runtime/vite/browser.d.cts +0 -59
- package/dist/runtime/vite/browser.d.ts +0 -59
- package/dist/runtime/vite/browser.js +0 -11
- package/dist/runtime/vite/server.cjs +0 -243
- package/dist/runtime/vite/server.d.cts +0 -30
- package/dist/runtime/vite/server.d.ts +0 -30
- package/dist/runtime/vite/server.js +0 -111
- package/dist/types-Bnh9n7mj.d.cts +0 -45
- package/dist/types-ey1AZqrg.d.ts +0 -45
package/dist/chunk-KILFIBVW.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createDocMethods
|
|
3
|
-
} from "./chunk-NVRDCY6Z.js";
|
|
4
|
-
|
|
5
|
-
// src/runtime/next/index.ts
|
|
6
|
-
var _runtime = {
|
|
7
|
-
doc(files) {
|
|
8
|
-
return files.map((file) => {
|
|
9
|
-
const data = file.data;
|
|
10
|
-
return {
|
|
11
|
-
_exports: data,
|
|
12
|
-
body: data.default,
|
|
13
|
-
lastModified: data.lastModified,
|
|
14
|
-
toc: data.toc,
|
|
15
|
-
structuredData: data.structuredData,
|
|
16
|
-
extractedReferences: data.extractedReferences,
|
|
17
|
-
...data.frontmatter,
|
|
18
|
-
...createDocMethods(file.info, () => Promise.resolve(data))
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
},
|
|
22
|
-
meta(files) {
|
|
23
|
-
return files.map((file) => {
|
|
24
|
-
return {
|
|
25
|
-
info: file.info,
|
|
26
|
-
...file.data
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
docs(docs, metas) {
|
|
31
|
-
const parsedDocs = this.doc(docs);
|
|
32
|
-
const parsedMetas = this.meta(metas);
|
|
33
|
-
return {
|
|
34
|
-
docs: parsedDocs,
|
|
35
|
-
meta: parsedMetas,
|
|
36
|
-
toFumadocsSource() {
|
|
37
|
-
return createMDXSource(parsedDocs, parsedMetas);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
function createMDXSource(docs, meta = []) {
|
|
43
|
-
return {
|
|
44
|
-
files: resolveFiles({
|
|
45
|
-
docs,
|
|
46
|
-
meta
|
|
47
|
-
})
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function resolveFiles({ docs, meta }) {
|
|
51
|
-
const outputs = [];
|
|
52
|
-
for (const entry of docs) {
|
|
53
|
-
outputs.push({
|
|
54
|
-
type: "page",
|
|
55
|
-
absolutePath: entry.info.fullPath,
|
|
56
|
-
path: entry.info.path,
|
|
57
|
-
data: entry
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
for (const entry of meta) {
|
|
61
|
-
outputs.push({
|
|
62
|
-
type: "meta",
|
|
63
|
-
absolutePath: entry.info.fullPath,
|
|
64
|
-
path: entry.info.path,
|
|
65
|
-
data: entry
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return outputs;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export {
|
|
72
|
-
_runtime,
|
|
73
|
-
createMDXSource,
|
|
74
|
-
resolveFiles
|
|
75
|
-
};
|
package/dist/chunk-NVRDCY6Z.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// src/runtime/shared.ts
|
|
2
|
-
import fs from "fs/promises";
|
|
3
|
-
function createDocMethods(info, load) {
|
|
4
|
-
return {
|
|
5
|
-
info,
|
|
6
|
-
async getText(type) {
|
|
7
|
-
if (type === "raw") {
|
|
8
|
-
return (await fs.readFile(info.fullPath)).toString();
|
|
9
|
-
}
|
|
10
|
-
const data = await load();
|
|
11
|
-
if (typeof data._markdown !== "string")
|
|
12
|
-
throw new Error(
|
|
13
|
-
"getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config."
|
|
14
|
-
);
|
|
15
|
-
return data._markdown;
|
|
16
|
-
},
|
|
17
|
-
async getMDAST() {
|
|
18
|
-
const data = await load();
|
|
19
|
-
if (!data._mdast)
|
|
20
|
-
throw new Error(
|
|
21
|
-
"getMDAST() requires `includeMDAST` to be enabled in your collection config."
|
|
22
|
-
);
|
|
23
|
-
return JSON.parse(data._mdast);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
createDocMethods
|
|
30
|
-
};
|
package/dist/chunk-VUEZTR2H.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/utils/git-timestamp.ts
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { x } from "tinyexec";
|
|
4
|
-
var cache = /* @__PURE__ */ new Map();
|
|
5
|
-
async function getGitTimestamp(file) {
|
|
6
|
-
const cached = cache.get(file);
|
|
7
|
-
if (cached) return cached;
|
|
8
|
-
try {
|
|
9
|
-
const out = await x(
|
|
10
|
-
"git",
|
|
11
|
-
["log", "-1", '--pretty="%ai"', path.relative(process.cwd(), file)],
|
|
12
|
-
{
|
|
13
|
-
throwOnError: true
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
const time = new Date(out.stdout);
|
|
17
|
-
cache.set(file, time);
|
|
18
|
-
return time;
|
|
19
|
-
} catch {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
getGitTimestamp
|
|
26
|
-
};
|
package/dist/index-D7s7kCc2.d.ts
DELETED