@hanzo/docs-mdx 14.1.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/LICENSE +21 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +16 -0
- package/dist/build-mdx-LN7FEKIP.js +8 -0
- package/dist/build-mdx-RXJZQXGA.js +8 -0
- package/dist/bun/index.d.ts +25 -0
- package/dist/bun/index.js +52 -0
- package/dist/chunk-4JSFLXXT.js +8 -0
- package/dist/chunk-5OBUOALK.js +141 -0
- package/dist/chunk-72JS4QVZ.js +17 -0
- package/dist/chunk-7I4W7XGI.js +179 -0
- package/dist/chunk-7W73RILB.js +173 -0
- package/dist/chunk-A3YIGE7S.js +334 -0
- package/dist/chunk-AOTZP2TV.js +152 -0
- package/dist/chunk-AXJB5MGS.js +173 -0
- package/dist/chunk-DMIIE3XZ.js +179 -0
- package/dist/chunk-DTFUANSF.js +40 -0
- package/dist/chunk-JWZR25CW.js +116 -0
- package/dist/chunk-K7N6GD4M.js +17 -0
- package/dist/chunk-LXB7WYAF.js +334 -0
- package/dist/chunk-MYAVS2LD.js +116 -0
- package/dist/chunk-OLD35ARB.js +116 -0
- package/dist/chunk-PW2AZGGD.js +125 -0
- package/dist/chunk-RGBNABKS.js +334 -0
- package/dist/chunk-RPUM7REY.js +40 -0
- package/dist/chunk-RR2X6AE6.js +274 -0
- package/dist/chunk-S7KOJHHO.js +89 -0
- package/dist/chunk-STUCUTJQ.js +334 -0
- package/dist/chunk-T6G5VOED.js +116 -0
- package/dist/chunk-U5YPLCO5.js +89 -0
- package/dist/chunk-UB55AMXC.js +274 -0
- package/dist/chunk-VITVHHR6.js +334 -0
- package/dist/chunk-VKSHE52K.js +274 -0
- package/dist/chunk-VWJKRQZR.js +19 -0
- package/dist/chunk-WAAWFNDX.js +179 -0
- package/dist/chunk-WGXYJGSZ.js +141 -0
- package/dist/chunk-WLJ6EKOZ.js +17 -0
- package/dist/chunk-WMYYALAS.js +334 -0
- package/dist/chunk-Y7ISNZ7X.js +216 -0
- package/dist/chunk-YKRCQ42E.js +216 -0
- package/dist/chunk-ZAYZWFWP.js +89 -0
- package/dist/config/index.d.ts +18 -0
- package/dist/config/index.js +63 -0
- package/dist/core-BQcKaqmC.d.ts +350 -0
- package/dist/core-BhWOtait.d.ts +350 -0
- package/dist/core-CV8uFMUa.d.ts +350 -0
- package/dist/core-DAQ64Hkq.d.ts +350 -0
- package/dist/core-DZtRjhds.d.ts +350 -0
- package/dist/core-De5K4ixv.d.ts +350 -0
- package/dist/core-X5ggQtBM.d.ts +350 -0
- package/dist/index-BqkSNsGO.d.ts +8 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +0 -0
- package/dist/load-from-file-FHW724YY.js +8 -0
- package/dist/load-from-file-S5CQ4H6T.js +8 -0
- package/dist/next/index.cjs +1165 -0
- package/dist/next/index.d.ts +33 -0
- package/dist/next/index.js +181 -0
- package/dist/node/loader.d.ts +5 -0
- package/dist/node/loader.js +41 -0
- package/dist/plugins/index-file.d.ts +14 -0
- package/dist/plugins/index-file.js +8 -0
- package/dist/plugins/json-schema.d.ts +31 -0
- package/dist/plugins/json-schema.js +80 -0
- package/dist/plugins/last-modified.d.ts +40 -0
- package/dist/plugins/last-modified.js +89 -0
- package/dist/runtime/browser.d.ts +53 -0
- package/dist/runtime/browser.js +67 -0
- package/dist/runtime/dynamic.d.ts +27 -0
- package/dist/runtime/dynamic.js +79 -0
- package/dist/runtime/server.d.ts +14 -0
- package/dist/runtime/server.js +8 -0
- package/dist/runtime/types.d.ts +61 -0
- package/dist/runtime/types.js +0 -0
- package/dist/vite/index.d.ts +44 -0
- package/dist/vite/index.js +122 -0
- package/dist/webpack/mdx.d.ts +6 -0
- package/dist/webpack/mdx.js +37 -0
- package/dist/webpack/meta.d.ts +6 -0
- package/dist/webpack/meta.js +40 -0
- package/loader-mdx.cjs +7 -0
- package/loader-meta.cjs +7 -0
- package/package.json +137 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildMDX
|
|
3
|
+
} from "../chunk-AXJB5MGS.js";
|
|
4
|
+
import {
|
|
5
|
+
server
|
|
6
|
+
} from "../chunk-WGXYJGSZ.js";
|
|
7
|
+
import "../chunk-YKRCQ42E.js";
|
|
8
|
+
import {
|
|
9
|
+
buildConfig
|
|
10
|
+
} from "../chunk-MYAVS2LD.js";
|
|
11
|
+
import "../chunk-U5YPLCO5.js";
|
|
12
|
+
import {
|
|
13
|
+
createCore
|
|
14
|
+
} from "../chunk-RR2X6AE6.js";
|
|
15
|
+
import "../chunk-PW2AZGGD.js";
|
|
16
|
+
import {
|
|
17
|
+
fumaMatter
|
|
18
|
+
} from "../chunk-VWJKRQZR.js";
|
|
19
|
+
|
|
20
|
+
// src/runtime/dynamic.ts
|
|
21
|
+
import { executeMdx } from "@hanzo/docs-mdx-remote/client";
|
|
22
|
+
import { pathToFileURL } from "url";
|
|
23
|
+
import fs from "fs/promises";
|
|
24
|
+
async function dynamic(configExports, coreOptions, serverOptions) {
|
|
25
|
+
const core = createCore(coreOptions);
|
|
26
|
+
await core.init({
|
|
27
|
+
config: buildConfig(configExports)
|
|
28
|
+
});
|
|
29
|
+
const create = server(serverOptions);
|
|
30
|
+
function getDocCollection(name) {
|
|
31
|
+
const collection = core.getCollection(name);
|
|
32
|
+
if (!collection) return;
|
|
33
|
+
if (collection.type === "docs") return collection.docs;
|
|
34
|
+
else if (collection.type === "doc") return collection;
|
|
35
|
+
}
|
|
36
|
+
function convertLazyEntries(collection, entries) {
|
|
37
|
+
const head = {};
|
|
38
|
+
const body = {};
|
|
39
|
+
async function compile({ info, data }) {
|
|
40
|
+
let content = (await fs.readFile(info.fullPath)).toString();
|
|
41
|
+
content = fumaMatter(content).content;
|
|
42
|
+
const compiled = await buildMDX(core, collection, {
|
|
43
|
+
filePath: info.fullPath,
|
|
44
|
+
source: content,
|
|
45
|
+
frontmatter: data,
|
|
46
|
+
isDevelopment: false,
|
|
47
|
+
environment: "runtime"
|
|
48
|
+
});
|
|
49
|
+
return await executeMdx(String(compiled.value), {
|
|
50
|
+
baseUrl: pathToFileURL(info.fullPath)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
for (const entry of entries) {
|
|
54
|
+
head[entry.info.path] = () => entry.data;
|
|
55
|
+
let cachedResult;
|
|
56
|
+
body[entry.info.path] = () => cachedResult ??= compile(entry);
|
|
57
|
+
}
|
|
58
|
+
return { head, body };
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
async doc(name, base, entries) {
|
|
62
|
+
const collection = getDocCollection(name);
|
|
63
|
+
if (!collection)
|
|
64
|
+
throw new Error(`the doc collection ${name} doesn't exist.`);
|
|
65
|
+
const { head, body } = convertLazyEntries(collection, entries);
|
|
66
|
+
return create.docLazy(name, base, head, body);
|
|
67
|
+
},
|
|
68
|
+
async docs(name, base, meta, entries) {
|
|
69
|
+
const collection = getDocCollection(name);
|
|
70
|
+
if (!collection)
|
|
71
|
+
throw new Error(`the doc collection ${name} doesn't exist.`);
|
|
72
|
+
const docs = convertLazyEntries(collection, entries);
|
|
73
|
+
return create.docsLazy(name, base, meta, docs.head, docs.body);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
dynamic
|
|
79
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '@hanzo/docs-core/source';
|
|
2
|
+
export { i as AsyncDocCollectionEntry, j as AsyncDocsCollectionEntry, v as DocCollectionEntry, w as DocsCollectionEntry, u as MetaCollectionEntry, x as ServerCreate, S as ServerOptions, y as server, z as toDocsSource } from '../core-BhWOtait.js';
|
|
3
|
+
import '@standard-schema/spec';
|
|
4
|
+
import './types.js';
|
|
5
|
+
import '@mdx-js/mdx';
|
|
6
|
+
import 'unified';
|
|
7
|
+
import '@hanzo/docs-core/mdx-plugins';
|
|
8
|
+
import '@hanzo/docs-core/source/schema';
|
|
9
|
+
import 'chokidar';
|
|
10
|
+
import 'vfile';
|
|
11
|
+
import '@hanzo/docs-core/mdx-plugins/remark-structure';
|
|
12
|
+
import '@hanzo/docs-core/toc';
|
|
13
|
+
import 'mdast';
|
|
14
|
+
import 'mdx/types';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { StructuredData } from '@hanzo/docs-core/mdx-plugins/remark-structure';
|
|
2
|
+
import { TOCItemType } from '@hanzo/docs-core/toc';
|
|
3
|
+
import { Root } from 'mdast';
|
|
4
|
+
import { MDXContent } from 'mdx/types';
|
|
5
|
+
|
|
6
|
+
interface DocData {
|
|
7
|
+
/**
|
|
8
|
+
* Compiled MDX content (as component)
|
|
9
|
+
*/
|
|
10
|
+
body: MDXContent;
|
|
11
|
+
/**
|
|
12
|
+
* table of contents generated from content.
|
|
13
|
+
*/
|
|
14
|
+
toc: TOCItemType[];
|
|
15
|
+
/**
|
|
16
|
+
* structured data for document search indexing.
|
|
17
|
+
*/
|
|
18
|
+
structuredData: StructuredData;
|
|
19
|
+
/**
|
|
20
|
+
* Raw exports from the compiled MDX file.
|
|
21
|
+
*/
|
|
22
|
+
_exports: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
interface FileInfo {
|
|
25
|
+
/**
|
|
26
|
+
* virtualized path for Source API
|
|
27
|
+
*/
|
|
28
|
+
path: string;
|
|
29
|
+
/**
|
|
30
|
+
* the file path in file system
|
|
31
|
+
*/
|
|
32
|
+
fullPath: string;
|
|
33
|
+
}
|
|
34
|
+
interface DocMethods {
|
|
35
|
+
/**
|
|
36
|
+
* file info
|
|
37
|
+
*/
|
|
38
|
+
info: FileInfo;
|
|
39
|
+
/**
|
|
40
|
+
* get document as text.
|
|
41
|
+
*
|
|
42
|
+
* - `type: raw` - read the original content from file system.
|
|
43
|
+
* - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
|
|
44
|
+
*/
|
|
45
|
+
getText: (type: 'raw' | 'processed') => Promise<string>;
|
|
46
|
+
getMDAST: () => Promise<Root>;
|
|
47
|
+
}
|
|
48
|
+
interface MetaMethods {
|
|
49
|
+
/**
|
|
50
|
+
* file info
|
|
51
|
+
*/
|
|
52
|
+
info: FileInfo;
|
|
53
|
+
}
|
|
54
|
+
interface InternalTypeConfig {
|
|
55
|
+
/**
|
|
56
|
+
* collection name -> collection properties
|
|
57
|
+
*/
|
|
58
|
+
DocData: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type { DocData, DocMethods, FileInfo, InternalTypeConfig, MetaMethods };
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { I as IndexFilePluginOptions } from '../core-BhWOtait.js';
|
|
3
|
+
import '@mdx-js/mdx';
|
|
4
|
+
import '@standard-schema/spec';
|
|
5
|
+
import 'unified';
|
|
6
|
+
import '@hanzo/docs-core/mdx-plugins';
|
|
7
|
+
import '@hanzo/docs-core/source/schema';
|
|
8
|
+
import 'chokidar';
|
|
9
|
+
import 'vfile';
|
|
10
|
+
import '@hanzo/docs-core/source';
|
|
11
|
+
import '../runtime/types.js';
|
|
12
|
+
import '@hanzo/docs-core/mdx-plugins/remark-structure';
|
|
13
|
+
import '@hanzo/docs-core/toc';
|
|
14
|
+
import 'mdast';
|
|
15
|
+
import 'mdx/types';
|
|
16
|
+
|
|
17
|
+
interface PluginOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Generate index files for accessing content.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue true
|
|
22
|
+
*/
|
|
23
|
+
index?: boolean | IndexFilePluginOptions;
|
|
24
|
+
/**
|
|
25
|
+
* @defaultValue source.config.ts
|
|
26
|
+
*/
|
|
27
|
+
configPath?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Update Vite config to fix module resolution of Fumadocs
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue true
|
|
32
|
+
*/
|
|
33
|
+
updateViteConfig?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Output directory of generated files
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue '.source'
|
|
38
|
+
*/
|
|
39
|
+
outDir?: string;
|
|
40
|
+
}
|
|
41
|
+
declare function mdx(config: Record<string, unknown>, pluginOptions?: PluginOptions): Promise<Plugin>;
|
|
42
|
+
declare function postInstall(pluginOptions?: PluginOptions): Promise<void>;
|
|
43
|
+
|
|
44
|
+
export { type PluginOptions, mdx as default, postInstall };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
indexFile
|
|
3
|
+
} from "../chunk-A3YIGE7S.js";
|
|
4
|
+
import {
|
|
5
|
+
createMdxLoader
|
|
6
|
+
} from "../chunk-JWZR25CW.js";
|
|
7
|
+
import {
|
|
8
|
+
createMetaLoader
|
|
9
|
+
} from "../chunk-ZAYZWFWP.js";
|
|
10
|
+
import {
|
|
11
|
+
createIntegratedConfigLoader,
|
|
12
|
+
toVite
|
|
13
|
+
} from "../chunk-DMIIE3XZ.js";
|
|
14
|
+
import "../chunk-4JSFLXXT.js";
|
|
15
|
+
import {
|
|
16
|
+
buildConfig
|
|
17
|
+
} from "../chunk-MYAVS2LD.js";
|
|
18
|
+
import "../chunk-U5YPLCO5.js";
|
|
19
|
+
import {
|
|
20
|
+
ValidationError,
|
|
21
|
+
_Defaults,
|
|
22
|
+
createCore
|
|
23
|
+
} from "../chunk-RR2X6AE6.js";
|
|
24
|
+
import "../chunk-PW2AZGGD.js";
|
|
25
|
+
import "../chunk-VWJKRQZR.js";
|
|
26
|
+
|
|
27
|
+
// src/vite/index.ts
|
|
28
|
+
import { mergeConfig } from "vite";
|
|
29
|
+
var FumadocsDeps = ["@hanzo/docs-core", "@hanzo/docs-ui", "@hanzo/docs-openapi"];
|
|
30
|
+
async function mdx(config, pluginOptions = {}) {
|
|
31
|
+
const options = applyDefaults(pluginOptions);
|
|
32
|
+
const core = createViteCore(options);
|
|
33
|
+
await core.init({
|
|
34
|
+
config: buildConfig(config)
|
|
35
|
+
});
|
|
36
|
+
const configLoader = createIntegratedConfigLoader(core);
|
|
37
|
+
const mdxLoader = toVite(createMdxLoader(configLoader));
|
|
38
|
+
const metaLoader = toVite(
|
|
39
|
+
createMetaLoader(configLoader, {
|
|
40
|
+
// vite has built-in plugin for JSON files
|
|
41
|
+
json: "json"
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
return {
|
|
45
|
+
name: "@hanzo/docs-mdx",
|
|
46
|
+
// needed, otherwise other plugins will be executed before our `transform`.
|
|
47
|
+
enforce: "pre",
|
|
48
|
+
config(config2) {
|
|
49
|
+
if (!options.updateViteConfig) return config2;
|
|
50
|
+
return mergeConfig(config2, {
|
|
51
|
+
optimizeDeps: {
|
|
52
|
+
exclude: FumadocsDeps
|
|
53
|
+
},
|
|
54
|
+
resolve: {
|
|
55
|
+
noExternal: FumadocsDeps,
|
|
56
|
+
dedupe: FumadocsDeps
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
async buildStart() {
|
|
61
|
+
await core.emit({ write: true });
|
|
62
|
+
},
|
|
63
|
+
async configureServer(server) {
|
|
64
|
+
await core.initServer({
|
|
65
|
+
watcher: server.watcher
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
async transform(value, id) {
|
|
69
|
+
try {
|
|
70
|
+
if (metaLoader.filter(id)) {
|
|
71
|
+
return await metaLoader.transform.call(this, value, id);
|
|
72
|
+
}
|
|
73
|
+
if (mdxLoader.filter(id)) {
|
|
74
|
+
return await mdxLoader.transform.call(this, value, id);
|
|
75
|
+
}
|
|
76
|
+
} catch (e) {
|
|
77
|
+
if (e instanceof ValidationError) {
|
|
78
|
+
throw new Error(await e.toStringFormatted());
|
|
79
|
+
}
|
|
80
|
+
throw e;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async function postInstall(pluginOptions = {}) {
|
|
86
|
+
const { loadConfig } = await import("../load-from-file-S5CQ4H6T.js");
|
|
87
|
+
const core = createViteCore(applyDefaults(pluginOptions));
|
|
88
|
+
await core.init({
|
|
89
|
+
config: loadConfig(core, true)
|
|
90
|
+
});
|
|
91
|
+
await core.emit({ write: true });
|
|
92
|
+
}
|
|
93
|
+
function createViteCore({
|
|
94
|
+
index,
|
|
95
|
+
configPath,
|
|
96
|
+
outDir
|
|
97
|
+
}) {
|
|
98
|
+
if (index === true) index = {};
|
|
99
|
+
return createCore({
|
|
100
|
+
environment: "vite",
|
|
101
|
+
configPath,
|
|
102
|
+
outDir,
|
|
103
|
+
plugins: [
|
|
104
|
+
index && indexFile({
|
|
105
|
+
...index,
|
|
106
|
+
target: index.target ?? "vite"
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function applyDefaults(options) {
|
|
112
|
+
return {
|
|
113
|
+
updateViteConfig: options.updateViteConfig ?? true,
|
|
114
|
+
index: options.index ?? true,
|
|
115
|
+
configPath: options.configPath ?? _Defaults.configPath,
|
|
116
|
+
outDir: options.outDir ?? _Defaults.outDir
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
mdx as default,
|
|
121
|
+
postInstall
|
|
122
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LoaderContext } from 'webpack';
|
|
2
|
+
import { W as WebpackLoaderOptions } from '../index-BqkSNsGO.js';
|
|
3
|
+
|
|
4
|
+
declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
|
|
5
|
+
|
|
6
|
+
export { loader as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCore
|
|
3
|
+
} from "../chunk-WLJ6EKOZ.js";
|
|
4
|
+
import {
|
|
5
|
+
createMdxLoader
|
|
6
|
+
} from "../chunk-JWZR25CW.js";
|
|
7
|
+
import {
|
|
8
|
+
createStandaloneConfigLoader,
|
|
9
|
+
toWebpack
|
|
10
|
+
} from "../chunk-DMIIE3XZ.js";
|
|
11
|
+
import "../chunk-4JSFLXXT.js";
|
|
12
|
+
import "../chunk-RR2X6AE6.js";
|
|
13
|
+
import "../chunk-PW2AZGGD.js";
|
|
14
|
+
import "../chunk-VWJKRQZR.js";
|
|
15
|
+
|
|
16
|
+
// src/webpack/mdx.ts
|
|
17
|
+
var instance;
|
|
18
|
+
async function loader(source, callback) {
|
|
19
|
+
const options = this.getOptions();
|
|
20
|
+
this.cacheable(true);
|
|
21
|
+
this.addDependency(options.absoluteCompiledConfigPath);
|
|
22
|
+
if (!instance) {
|
|
23
|
+
instance = toWebpack(
|
|
24
|
+
createMdxLoader(
|
|
25
|
+
createStandaloneConfigLoader({
|
|
26
|
+
core: getCore(options),
|
|
27
|
+
buildConfig: false,
|
|
28
|
+
mode: options.isDev ? "dev" : "production"
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
await instance.call(this, source, callback);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
loader as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LoaderContext } from 'webpack';
|
|
2
|
+
import { W as WebpackLoaderOptions } from '../index-BqkSNsGO.js';
|
|
3
|
+
|
|
4
|
+
declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
|
|
5
|
+
|
|
6
|
+
export { loader as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCore
|
|
3
|
+
} from "../chunk-WLJ6EKOZ.js";
|
|
4
|
+
import {
|
|
5
|
+
createMetaLoader
|
|
6
|
+
} from "../chunk-ZAYZWFWP.js";
|
|
7
|
+
import {
|
|
8
|
+
createStandaloneConfigLoader,
|
|
9
|
+
toWebpack
|
|
10
|
+
} from "../chunk-DMIIE3XZ.js";
|
|
11
|
+
import "../chunk-4JSFLXXT.js";
|
|
12
|
+
import "../chunk-RR2X6AE6.js";
|
|
13
|
+
import "../chunk-PW2AZGGD.js";
|
|
14
|
+
|
|
15
|
+
// src/webpack/meta.ts
|
|
16
|
+
var instance;
|
|
17
|
+
async function loader(source, callback) {
|
|
18
|
+
const options = this.getOptions();
|
|
19
|
+
this.cacheable(true);
|
|
20
|
+
this.addDependency(options.absoluteCompiledConfigPath);
|
|
21
|
+
if (!instance) {
|
|
22
|
+
instance = toWebpack(
|
|
23
|
+
createMetaLoader(
|
|
24
|
+
createStandaloneConfigLoader({
|
|
25
|
+
core: getCore(options),
|
|
26
|
+
buildConfig: false,
|
|
27
|
+
mode: options.isDev ? "dev" : "production"
|
|
28
|
+
}),
|
|
29
|
+
{
|
|
30
|
+
json: "json",
|
|
31
|
+
yaml: "js"
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
await instance.call(this, source, callback);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
loader as default
|
|
40
|
+
};
|
package/loader-mdx.cjs
ADDED
package/loader-meta.cjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hanzo/docs-mdx",
|
|
3
|
+
"version": "14.1.0",
|
|
4
|
+
"description": "The built-in MDX source for Hanzo Docs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Hanzo",
|
|
7
|
+
"Docs",
|
|
8
|
+
"MDX"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://hanzo.ai/docs",
|
|
11
|
+
"repository": "github:hanzoai/docs",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Fuma Nama",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./loader-mdx": "./loader-mdx.cjs",
|
|
17
|
+
"./loader-meta": "./loader-meta.cjs",
|
|
18
|
+
"./config": {
|
|
19
|
+
"import": "./dist/config/index.js",
|
|
20
|
+
"types": "./dist/config/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./next": {
|
|
23
|
+
"import": "./dist/next/index.js",
|
|
24
|
+
"types": "./dist/next/index.d.ts",
|
|
25
|
+
"require": "./dist/next/index.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./vite": {
|
|
28
|
+
"import": "./dist/vite/index.js",
|
|
29
|
+
"types": "./dist/vite/index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"types": "./dist/index.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./runtime/*": {
|
|
36
|
+
"import": "./dist/runtime/*.js",
|
|
37
|
+
"types": "./dist/runtime/*.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./node/loader": {
|
|
40
|
+
"import": "./dist/node/loader.js",
|
|
41
|
+
"types": "./dist/node/loader.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./bun": {
|
|
44
|
+
"import": "./dist/bun/index.js",
|
|
45
|
+
"types": "./dist/bun/index.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./plugins/*": {
|
|
48
|
+
"import": "./dist/plugins/*.js",
|
|
49
|
+
"types": "./dist/plugins/*.d.ts"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"main": "./dist/index.js",
|
|
53
|
+
"types": "./dist/index.d.ts",
|
|
54
|
+
"bin": {
|
|
55
|
+
"hanzo-docs": "./dist/bin.js",
|
|
56
|
+
"fumadocs-mdx": "./dist/bin.js"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist/*",
|
|
60
|
+
"loader-mdx.cjs",
|
|
61
|
+
"loader-meta.cjs"
|
|
62
|
+
],
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@mdx-js/mdx": "^3.1.1",
|
|
65
|
+
"@standard-schema/spec": "^1.0.0",
|
|
66
|
+
"chokidar": "^5.0.0",
|
|
67
|
+
"esbuild": "^0.27.1",
|
|
68
|
+
"estree-util-value-to-estree": "^3.5.0",
|
|
69
|
+
"js-yaml": "^4.1.1",
|
|
70
|
+
"mdast-util-to-markdown": "^2.1.2",
|
|
71
|
+
"picocolors": "^1.1.1",
|
|
72
|
+
"picomatch": "^4.0.3",
|
|
73
|
+
"remark-mdx": "^3.1.1",
|
|
74
|
+
"tinyexec": "^1.0.2",
|
|
75
|
+
"tinyglobby": "^0.2.15",
|
|
76
|
+
"unified": "^11.0.5",
|
|
77
|
+
"unist-util-remove-position": "^5.0.0",
|
|
78
|
+
"unist-util-visit": "^5.0.0",
|
|
79
|
+
"vfile": "^6.0.3",
|
|
80
|
+
"zod": "^4.1.13"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@types/bun": "^1.3.4",
|
|
84
|
+
"@types/js-yaml": "^4.0.9",
|
|
85
|
+
"@types/mdast": "^4.0.4",
|
|
86
|
+
"@types/mdx": "^2.0.13",
|
|
87
|
+
"@types/node": "^24.10.2",
|
|
88
|
+
"@types/picomatch": "^4.0.2",
|
|
89
|
+
"@types/react": "^19.2.7",
|
|
90
|
+
"astro": "^5.16.5",
|
|
91
|
+
"mdast-util-directive": "^3.1.0",
|
|
92
|
+
"mdast-util-mdx-jsx": "^3.2.0",
|
|
93
|
+
"next": "16.0.10",
|
|
94
|
+
"react": "^19.2.3",
|
|
95
|
+
"remark": "^15.0.1",
|
|
96
|
+
"remark-directive": "^4.0.0",
|
|
97
|
+
"remark-stringify": "^11.0.0",
|
|
98
|
+
"rollup": "^4.53.3",
|
|
99
|
+
"vite": "^7.2.7",
|
|
100
|
+
"webpack": "^5.103.0",
|
|
101
|
+
"eslint-config-custom": "0.0.0",
|
|
102
|
+
"@hanzo/docs-mdx-remote": "1.4.3",
|
|
103
|
+
"@hanzo/docs-core": "16.2.5",
|
|
104
|
+
"tsconfig": "0.0.0"
|
|
105
|
+
},
|
|
106
|
+
"peerDependencies": {
|
|
107
|
+
"@hanzo/docs-mdx-remote": "^1.4.0",
|
|
108
|
+
"@hanzo/docs-core": "^15.0.0 || ^16.0.0",
|
|
109
|
+
"next": "^15.3.0 || ^16.0.0",
|
|
110
|
+
"react": "*",
|
|
111
|
+
"vite": "6.x.x || 7.x.x"
|
|
112
|
+
},
|
|
113
|
+
"peerDependenciesMeta": {
|
|
114
|
+
"react": {
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
117
|
+
"next": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"vite": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"@hanzo/docs-mdx-remote": {
|
|
124
|
+
"optional": true
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"publishConfig": {
|
|
128
|
+
"access": "public"
|
|
129
|
+
},
|
|
130
|
+
"scripts": {
|
|
131
|
+
"build": "tsup",
|
|
132
|
+
"clean": "rimraf dist",
|
|
133
|
+
"dev": "tsup --watch",
|
|
134
|
+
"lint": "eslint .",
|
|
135
|
+
"types:check": "tsc --noEmit"
|
|
136
|
+
}
|
|
137
|
+
}
|