fumadocs-mdx 11.2.1 → 11.2.2
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/{chunk-EVNXCXU4.js → chunk-2KEQHW7J.js} +8 -22
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/loader-mdx.js +1 -1
- package/dist/next/index.js +1 -1
- package/package.json +4 -4
|
@@ -9,34 +9,20 @@ import * as fs from "node:fs";
|
|
|
9
9
|
// src/config/load.ts
|
|
10
10
|
import * as path from "node:path";
|
|
11
11
|
import { pathToFileURL } from "node:url";
|
|
12
|
-
import {
|
|
12
|
+
import { createJiti } from "jiti";
|
|
13
13
|
function findConfigFile() {
|
|
14
14
|
return path.resolve("source.config.ts");
|
|
15
15
|
}
|
|
16
|
+
var jiti = createJiti(import.meta.url, {
|
|
17
|
+
moduleCache: false
|
|
18
|
+
});
|
|
16
19
|
async function loadConfig(configPath) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
entryPoints: [{ in: configPath, out: "source.config" }],
|
|
20
|
-
bundle: true,
|
|
21
|
-
outdir: ".source",
|
|
22
|
-
target: "node18",
|
|
23
|
-
write: true,
|
|
24
|
-
platform: "node",
|
|
25
|
-
format: "esm",
|
|
26
|
-
packages: "external",
|
|
27
|
-
outExtension: {
|
|
28
|
-
".js": ".mjs"
|
|
29
|
-
},
|
|
30
|
-
allowOverwrite: true,
|
|
31
|
-
splitting: true
|
|
20
|
+
const imported = await jiti.import(pathToFileURL(configPath).href).catch((e) => {
|
|
21
|
+
throw new Error("failed to compile configuration file", e);
|
|
32
22
|
});
|
|
33
|
-
if (transformed.errors.length > 0) {
|
|
34
|
-
throw new Error("failed to compile configuration file");
|
|
35
|
-
}
|
|
36
|
-
const url = pathToFileURL(outputPath);
|
|
37
23
|
const [err, config] = buildConfig(
|
|
38
24
|
// every call to `loadConfig` will cause the previous cache to be ignored
|
|
39
|
-
|
|
25
|
+
imported
|
|
40
26
|
);
|
|
41
27
|
if (err !== null) throw new Error(err);
|
|
42
28
|
return config;
|
|
@@ -89,7 +75,7 @@ async function loadConfigCached(configPath, hash) {
|
|
|
89
75
|
return await config;
|
|
90
76
|
}
|
|
91
77
|
async function getConfigHash(configPath) {
|
|
92
|
-
const hash = createHash("
|
|
78
|
+
const hash = createHash("md5");
|
|
93
79
|
const rs = fs.createReadStream(configPath);
|
|
94
80
|
for await (const chunk of rs) {
|
|
95
81
|
hash.update(chunk);
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import 'webpack';
|
|
|
11
11
|
|
|
12
12
|
declare function toRuntime(type: 'doc' | 'meta', file: Record<string, unknown>, info: FileInfo): unknown;
|
|
13
13
|
declare function toRuntimeAsync(frontmatter: Record<string, unknown>, load: () => Promise<Record<string, unknown>>, info: FileInfo): unknown;
|
|
14
|
-
declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta
|
|
14
|
+
declare function createMDXSource<Doc extends PageData & BaseCollectionEntry, Meta extends MetaData & BaseCollectionEntry>(docs: Doc[], meta?: Meta[]): Source<{
|
|
15
15
|
pageData: Doc;
|
|
16
16
|
metaData: Meta;
|
|
17
17
|
}>;
|
package/dist/index.js
CHANGED
package/dist/loader-mdx.js
CHANGED
package/dist/next/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-mdx",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.2",
|
|
4
4
|
"description": "The built-in source for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@mdx-js/mdx": "^3.1.0",
|
|
39
39
|
"chokidar": "^4.0.3",
|
|
40
40
|
"cross-spawn": "^7.0.6",
|
|
41
|
-
"esbuild": "^0.24.2",
|
|
42
41
|
"estree-util-value-to-estree": "^3.2.1",
|
|
43
42
|
"fast-glob": "^3.3.1",
|
|
44
43
|
"gray-matter": "^4.0.3",
|
|
44
|
+
"jiti": "^2.4.2",
|
|
45
45
|
"micromatch": "^4.0.8",
|
|
46
46
|
"unist-util-visit": "^5.0.0",
|
|
47
47
|
"zod": "^3.24.1"
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"@types/micromatch": "^4.0.9",
|
|
54
54
|
"@types/react": "^19.0.2",
|
|
55
55
|
"mdast-util-mdx-jsx": "^3.1.3",
|
|
56
|
-
"next": "^15.1.
|
|
56
|
+
"next": "^15.1.3",
|
|
57
57
|
"unified": "^11.0.5",
|
|
58
58
|
"vfile": "^6.0.3",
|
|
59
59
|
"webpack": "^5.97.1",
|
|
60
60
|
"eslint-config-custom": "0.0.0",
|
|
61
|
-
"fumadocs-core": "14.
|
|
61
|
+
"fumadocs-core": "14.7.0",
|
|
62
62
|
"tsconfig": "0.0.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|