fumadocs-mdx 13.0.0 → 13.0.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/bin.cjs +294 -257
- package/dist/{build-mdx-CzrQDBRZ.d.ts → build-mdx-CCNr86q6.d.ts} +1 -1
- package/dist/{build-mdx-BHG-_uxo.d.cts → build-mdx-D-r3_eQL.d.cts} +1 -1
- package/dist/bun/index.cjs +114 -34
- package/dist/bun/index.d.cts +8 -3
- package/dist/bun/index.d.ts +8 -3
- package/dist/bun/index.js +20 -10
- package/dist/{chunk-6Y5JDZHD.js → chunk-CXA4JO4Z.js} +1 -21
- package/dist/chunk-EELYB2XC.js +207 -0
- package/dist/{chunk-CEA6MYJU.js → chunk-XQ5O7IPO.js} +29 -27
- package/dist/chunk-XZY2AWJI.js +81 -0
- package/dist/{chunk-XV5Z4BFL.js → chunk-YVCR6FUH.js} +1 -1
- package/dist/config/index.d.cts +2 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/{define-BCNh3n4O.d.cts → core-B6j6Fxse.d.cts} +101 -38
- package/dist/{define-bck_EB4t.d.ts → core-B6j6Fxse.d.ts} +101 -38
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/next/index.cjs +195 -163
- package/dist/next/index.js +79 -71
- package/dist/node/loader.cjs +120 -35
- package/dist/node/loader.js +10 -5
- package/dist/plugins/json-schema.cjs +103 -2
- package/dist/plugins/json-schema.d.cts +12 -4
- package/dist/plugins/json-schema.d.ts +12 -4
- package/dist/plugins/json-schema.js +40 -2
- package/dist/runtime/next/async.d.cts +4 -4
- package/dist/runtime/next/async.d.ts +4 -4
- package/dist/runtime/next/async.js +3 -3
- package/dist/runtime/next/index.d.cts +5 -5
- package/dist/runtime/next/index.d.ts +5 -5
- package/dist/runtime/vite/browser.d.cts +3 -3
- package/dist/runtime/vite/browser.d.ts +3 -3
- package/dist/runtime/vite/server.d.cts +3 -3
- package/dist/runtime/vite/server.d.ts +3 -3
- package/dist/{types-1cCFEzWt.d.ts → types-AGzTfBmf.d.ts} +1 -1
- package/dist/{types-D5NhXTJY.d.cts → types-DKGMoay5.d.cts} +1 -1
- package/dist/vite/index.cjs +145 -108
- package/dist/vite/index.js +53 -45
- package/dist/{loader-mdx.cjs → webpack/index.cjs} +151 -58
- package/dist/webpack/index.js +44 -0
- package/loader-mdx.cjs +1 -1
- package/package.json +4 -3
- package/dist/chunk-4MAYA5QX.js +0 -44
- package/dist/chunk-HI62EXSB.js +0 -127
- package/dist/loader-mdx.js +0 -39
- package/dist/plugins/index.cjs +0 -78
- package/dist/plugins/index.d.cts +0 -7
- package/dist/plugins/index.d.ts +0 -7
- package/dist/plugins/index.js +0 -6
- package/dist/remark-postprocess-K233ZVBK.d.cts +0 -22
- package/dist/remark-postprocess-K233ZVBK.d.ts +0 -22
- package/dist/watcher-WXJDWRZY.js +0 -22
- /package/dist/{loader-mdx.d.cts → webpack/index.d.cts} +0 -0
- /package/dist/{loader-mdx.d.ts → webpack/index.d.ts} +0 -0
|
@@ -1,16 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCollectionMatcher
|
|
3
|
+
} from "../chunk-XZY2AWJI.js";
|
|
4
|
+
|
|
1
5
|
// src/plugins/json-schema.ts
|
|
2
6
|
import { z } from "zod";
|
|
3
|
-
|
|
7
|
+
import fs from "fs/promises";
|
|
8
|
+
import path from "path";
|
|
9
|
+
function jsonSchema({
|
|
10
|
+
insert = false
|
|
11
|
+
} = {}) {
|
|
4
12
|
let config;
|
|
13
|
+
function getSchemaPath(name) {
|
|
14
|
+
return `json-schema/${name}.json`;
|
|
15
|
+
}
|
|
5
16
|
return {
|
|
6
17
|
config(v) {
|
|
7
18
|
config = v;
|
|
8
19
|
},
|
|
20
|
+
configureServer(server) {
|
|
21
|
+
if (!server.watcher || !insert) return;
|
|
22
|
+
const matcher = createCollectionMatcher(this.core);
|
|
23
|
+
server.watcher.on("add", async (file) => {
|
|
24
|
+
const match = matcher.getFileCollection(file);
|
|
25
|
+
if (!match || match.collection.type !== "meta") return;
|
|
26
|
+
const { name } = match;
|
|
27
|
+
const parent = config.collections.get(name);
|
|
28
|
+
let obj;
|
|
29
|
+
try {
|
|
30
|
+
const content = (await fs.readFile(file)).toString();
|
|
31
|
+
obj = content.length > 0 ? JSON.parse(content) : {};
|
|
32
|
+
} catch {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if ("$schema" in obj) return;
|
|
36
|
+
const schemaPath = path.join(
|
|
37
|
+
this.outDir,
|
|
38
|
+
getSchemaPath(parent?.type === "docs" ? `${name}.meta` : name)
|
|
39
|
+
);
|
|
40
|
+
const updated = {
|
|
41
|
+
$schema: path.relative(path.dirname(file), schemaPath),
|
|
42
|
+
...obj
|
|
43
|
+
};
|
|
44
|
+
await fs.writeFile(file, JSON.stringify(updated, null, 2));
|
|
45
|
+
});
|
|
46
|
+
},
|
|
9
47
|
emit() {
|
|
10
48
|
const files = [];
|
|
11
49
|
function onSchema(name, schema) {
|
|
12
50
|
files.push({
|
|
13
|
-
path:
|
|
51
|
+
path: getSchemaPath(name),
|
|
14
52
|
content: JSON.stringify(
|
|
15
53
|
z.toJSONSchema(schema, {
|
|
16
54
|
io: "input",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { c as RuntimeAsync } from '../../types-
|
|
2
|
-
import { L as LoadedConfig } from '../../
|
|
1
|
+
import { c as RuntimeAsync } from '../../types-DKGMoay5.cjs';
|
|
2
|
+
import { L as LoadedConfig } from '../../core-B6j6Fxse.cjs';
|
|
3
3
|
import '@standard-schema/spec';
|
|
4
4
|
import 'fumadocs-core/source';
|
|
5
5
|
import '../../index.cjs';
|
|
6
6
|
import 'fumadocs-core/mdx-plugins';
|
|
7
7
|
import 'fumadocs-core/toc';
|
|
8
8
|
import 'mdx/types';
|
|
9
|
-
import '../../remark-postprocess-K233ZVBK.cjs';
|
|
10
9
|
import 'mdast';
|
|
11
|
-
import '../../build-mdx-
|
|
10
|
+
import '../../build-mdx-D-r3_eQL.cjs';
|
|
12
11
|
import '@mdx-js/mdx';
|
|
13
12
|
import 'react';
|
|
14
13
|
import 'unified';
|
|
15
14
|
import 'zod';
|
|
15
|
+
import 'chokidar';
|
|
16
16
|
|
|
17
17
|
declare function buildConfig(config: Record<string, unknown>): LoadedConfig;
|
|
18
18
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { c as RuntimeAsync } from '../../types-
|
|
2
|
-
import { L as LoadedConfig } from '../../
|
|
1
|
+
import { c as RuntimeAsync } from '../../types-AGzTfBmf.js';
|
|
2
|
+
import { L as LoadedConfig } from '../../core-B6j6Fxse.js';
|
|
3
3
|
import '@standard-schema/spec';
|
|
4
4
|
import 'fumadocs-core/source';
|
|
5
5
|
import '../../index.js';
|
|
6
6
|
import 'fumadocs-core/mdx-plugins';
|
|
7
7
|
import 'fumadocs-core/toc';
|
|
8
8
|
import 'mdx/types';
|
|
9
|
-
import '../../remark-postprocess-K233ZVBK.js';
|
|
10
9
|
import 'mdast';
|
|
11
|
-
import '../../build-mdx-
|
|
10
|
+
import '../../build-mdx-CCNr86q6.js';
|
|
12
11
|
import '@mdx-js/mdx';
|
|
13
12
|
import 'react';
|
|
14
13
|
import 'unified';
|
|
15
14
|
import 'zod';
|
|
15
|
+
import 'chokidar';
|
|
16
16
|
|
|
17
17
|
declare function buildConfig(config: Record<string, unknown>): LoadedConfig;
|
|
18
18
|
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
createDocMethods
|
|
7
7
|
} from "../../chunk-NVRDCY6Z.js";
|
|
8
|
+
import {
|
|
9
|
+
buildConfig
|
|
10
|
+
} from "../../chunk-U4MQ44TS.js";
|
|
8
11
|
import {
|
|
9
12
|
buildMDX
|
|
10
13
|
} from "../../chunk-3J3WL7WN.js";
|
|
11
14
|
import "../../chunk-K5ZLPEIQ.js";
|
|
12
|
-
import {
|
|
13
|
-
buildConfig
|
|
14
|
-
} from "../../chunk-U4MQ44TS.js";
|
|
15
15
|
import {
|
|
16
16
|
fumaMatter
|
|
17
17
|
} from "../../chunk-VWJKRQZR.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { R as Runtime } from '../../types-
|
|
3
|
-
export { b as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, c as RuntimeAsync, a as RuntimeFile } from '../../types-
|
|
2
|
+
import { R as Runtime } from '../../types-DKGMoay5.cjs';
|
|
3
|
+
export { b as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, c as RuntimeAsync, a as RuntimeFile } from '../../types-DKGMoay5.cjs';
|
|
4
4
|
import { FileInfo } from '../../index.cjs';
|
|
5
5
|
import '@standard-schema/spec';
|
|
6
|
-
import '../../
|
|
6
|
+
import '../../core-B6j6Fxse.cjs';
|
|
7
7
|
import 'fumadocs-core/mdx-plugins';
|
|
8
8
|
import '@mdx-js/mdx';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
|
-
import '
|
|
11
|
+
import 'chokidar';
|
|
12
12
|
import 'fumadocs-core/toc';
|
|
13
13
|
import 'mdx/types';
|
|
14
14
|
import 'mdast';
|
|
15
|
-
import '../../build-mdx-
|
|
15
|
+
import '../../build-mdx-D-r3_eQL.cjs';
|
|
16
16
|
import 'react';
|
|
17
17
|
|
|
18
18
|
declare const _runtime: Runtime;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { R as Runtime } from '../../types-
|
|
3
|
-
export { b as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, c as RuntimeAsync, a as RuntimeFile } from '../../types-
|
|
2
|
+
import { R as Runtime } from '../../types-AGzTfBmf.js';
|
|
3
|
+
export { b as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, c as RuntimeAsync, a as RuntimeFile } from '../../types-AGzTfBmf.js';
|
|
4
4
|
import { FileInfo } from '../../index.js';
|
|
5
5
|
import '@standard-schema/spec';
|
|
6
|
-
import '../../
|
|
6
|
+
import '../../core-B6j6Fxse.js';
|
|
7
7
|
import 'fumadocs-core/mdx-plugins';
|
|
8
8
|
import '@mdx-js/mdx';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
|
-
import '
|
|
11
|
+
import 'chokidar';
|
|
12
12
|
import 'fumadocs-core/toc';
|
|
13
13
|
import 'mdx/types';
|
|
14
14
|
import 'mdast';
|
|
15
|
-
import '../../build-mdx-
|
|
15
|
+
import '../../build-mdx-CCNr86q6.js';
|
|
16
16
|
import 'react';
|
|
17
17
|
|
|
18
18
|
declare const _runtime: Runtime;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as DocCollection, c as DocsCollection, M as MetaCollection } from '../../core-B6j6Fxse.cjs';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
|
-
import { C as CompiledMDXProperties } from '../../build-mdx-
|
|
3
|
+
import { C as CompiledMDXProperties } from '../../build-mdx-D-r3_eQL.cjs';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
5
|
import 'fumadocs-core/mdx-plugins';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'unified';
|
|
8
8
|
import 'zod';
|
|
9
|
-
import '
|
|
9
|
+
import 'chokidar';
|
|
10
10
|
import 'fumadocs-core/toc';
|
|
11
11
|
import 'mdx/types';
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as DocCollection, c as DocsCollection, M as MetaCollection } from '../../core-B6j6Fxse.js';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
|
-
import { C as CompiledMDXProperties } from '../../build-mdx-
|
|
3
|
+
import { C as CompiledMDXProperties } from '../../build-mdx-CCNr86q6.js';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
5
|
import 'fumadocs-core/mdx-plugins';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'unified';
|
|
8
8
|
import 'zod';
|
|
9
|
-
import '
|
|
9
|
+
import 'chokidar';
|
|
10
10
|
import 'fumadocs-core/toc';
|
|
11
11
|
import 'mdx/types';
|
|
12
12
|
|
|
@@ -2,14 +2,14 @@ import { PageData, MetaData, Source } from 'fumadocs-core/source';
|
|
|
2
2
|
import { BaseCreate, DocMap, MetaMap, LazyDocMap } from './browser.cjs';
|
|
3
3
|
export { ClientLoader, ClientLoaderOptions, CompiledMDXFile, createClientLoader, fromConfig as fromConfigBase, toClientRenderer } from './browser.cjs';
|
|
4
4
|
import { DocCollectionEntry, MetaCollectionEntry, AsyncDocCollectionEntry } from '../../index.cjs';
|
|
5
|
-
import '../../
|
|
5
|
+
import '../../core-B6j6Fxse.cjs';
|
|
6
6
|
import '@standard-schema/spec';
|
|
7
7
|
import 'fumadocs-core/mdx-plugins';
|
|
8
8
|
import '@mdx-js/mdx';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
|
-
import '
|
|
12
|
-
import '../../build-mdx-
|
|
11
|
+
import 'chokidar';
|
|
12
|
+
import '../../build-mdx-D-r3_eQL.cjs';
|
|
13
13
|
import 'fumadocs-core/toc';
|
|
14
14
|
import 'react';
|
|
15
15
|
import 'mdx/types';
|
|
@@ -2,14 +2,14 @@ import { PageData, MetaData, Source } from 'fumadocs-core/source';
|
|
|
2
2
|
import { BaseCreate, DocMap, MetaMap, LazyDocMap } from './browser.js';
|
|
3
3
|
export { ClientLoader, ClientLoaderOptions, CompiledMDXFile, createClientLoader, fromConfig as fromConfigBase, toClientRenderer } from './browser.js';
|
|
4
4
|
import { DocCollectionEntry, MetaCollectionEntry, AsyncDocCollectionEntry } from '../../index.js';
|
|
5
|
-
import '../../
|
|
5
|
+
import '../../core-B6j6Fxse.js';
|
|
6
6
|
import '@standard-schema/spec';
|
|
7
7
|
import 'fumadocs-core/mdx-plugins';
|
|
8
8
|
import '@mdx-js/mdx';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
|
-
import '
|
|
12
|
-
import '../../build-mdx-
|
|
11
|
+
import 'chokidar';
|
|
12
|
+
import '../../build-mdx-CCNr86q6.js';
|
|
13
13
|
import 'fumadocs-core/toc';
|
|
14
14
|
import 'react';
|
|
15
15
|
import 'mdx/types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
import { Source, PageData, MetaData } from 'fumadocs-core/source';
|
|
3
|
-
import { L as LoadedConfig,
|
|
3
|
+
import { L as LoadedConfig, b as DocCollection, c as DocsCollection, M as MetaCollection } from './core-B6j6Fxse.js';
|
|
4
4
|
import { FileInfo, AsyncDocCollectionEntry, MetaCollectionEntry, DocCollectionEntry } from './index.js';
|
|
5
5
|
|
|
6
6
|
interface RuntimeFile {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
import { Source, PageData, MetaData } from 'fumadocs-core/source';
|
|
3
|
-
import { L as LoadedConfig,
|
|
3
|
+
import { L as LoadedConfig, b as DocCollection, c as DocsCollection, M as MetaCollection } from './core-B6j6Fxse.cjs';
|
|
4
4
|
import { FileInfo, AsyncDocCollectionEntry, MetaCollectionEntry, DocCollectionEntry } from './index.cjs';
|
|
5
5
|
|
|
6
6
|
interface RuntimeFile {
|