fumadocs-mdx 13.0.0 → 13.0.1
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 +272 -240
- 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 +123 -91
- package/dist/vite/index.js +30 -27
- 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
package/dist/loader-mdx.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
toWebpack
|
|
3
|
-
} from "./chunk-XV5Z4BFL.js";
|
|
4
|
-
import {
|
|
5
|
-
createMdxLoader
|
|
6
|
-
} from "./chunk-CEA6MYJU.js";
|
|
7
|
-
import "./chunk-3J3WL7WN.js";
|
|
8
|
-
import "./chunk-K5ZLPEIQ.js";
|
|
9
|
-
import {
|
|
10
|
-
dynamicConfig,
|
|
11
|
-
staticConfig
|
|
12
|
-
} from "./chunk-HI62EXSB.js";
|
|
13
|
-
import "./chunk-VWJKRQZR.js";
|
|
14
|
-
|
|
15
|
-
// src/loader-mdx.ts
|
|
16
|
-
var instance;
|
|
17
|
-
async function loader(source, callback) {
|
|
18
|
-
const { isDev, outDir, configPath } = this.getOptions();
|
|
19
|
-
this.cacheable(true);
|
|
20
|
-
this.addDependency(configPath);
|
|
21
|
-
instance ??= toWebpack(
|
|
22
|
-
createMdxLoader(
|
|
23
|
-
// the config is built on dev server
|
|
24
|
-
isDev ? dynamicConfig({
|
|
25
|
-
outDir,
|
|
26
|
-
configPath,
|
|
27
|
-
buildConfig: false
|
|
28
|
-
}) : staticConfig({
|
|
29
|
-
outDir,
|
|
30
|
-
configPath,
|
|
31
|
-
buildConfig: false
|
|
32
|
-
})
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
await instance.call(this, source, callback);
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
loader as default
|
|
39
|
-
};
|
package/dist/plugins/index.cjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/plugins/index.ts
|
|
31
|
-
var plugins_exports = {};
|
|
32
|
-
__export(plugins_exports, {
|
|
33
|
-
createPluginHandler: () => createPluginHandler
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(plugins_exports);
|
|
36
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
37
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
38
|
-
function createPluginHandler(context, defaultPlugins = []) {
|
|
39
|
-
const plugins = [];
|
|
40
|
-
async function write(entry) {
|
|
41
|
-
const file = import_node_path.default.join(context.outDir, entry.path);
|
|
42
|
-
await import_promises.default.mkdir(import_node_path.default.dirname(file), { recursive: true });
|
|
43
|
-
await import_promises.default.writeFile(file, entry.content);
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
async init(config) {
|
|
47
|
-
if (config.global.plugins) {
|
|
48
|
-
defaultPlugins.push(...config.global.plugins);
|
|
49
|
-
}
|
|
50
|
-
for await (const option of defaultPlugins) {
|
|
51
|
-
if (!option) continue;
|
|
52
|
-
if (Array.isArray(option)) plugins.push(...option);
|
|
53
|
-
else plugins.push(option);
|
|
54
|
-
}
|
|
55
|
-
for (const plugin of plugins) {
|
|
56
|
-
const out = await plugin.config?.call(context, config);
|
|
57
|
-
if (out) config = out;
|
|
58
|
-
}
|
|
59
|
-
return config;
|
|
60
|
-
},
|
|
61
|
-
async emit() {
|
|
62
|
-
const out = await Promise.all(
|
|
63
|
-
plugins.map((plugin) => {
|
|
64
|
-
return plugin.emit?.call(context) ?? [];
|
|
65
|
-
})
|
|
66
|
-
);
|
|
67
|
-
return out.flat();
|
|
68
|
-
},
|
|
69
|
-
async emitAndWrite() {
|
|
70
|
-
const entries = await this.emit();
|
|
71
|
-
await Promise.all(entries.map(write));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
-
0 && (module.exports = {
|
|
77
|
-
createPluginHandler
|
|
78
|
-
});
|
package/dist/plugins/index.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { E as EmitEntry, P as Plugin, h as PluginContext, i as PluginOption, j as createPluginHandler } from '../define-BCNh3n4O.cjs';
|
|
2
|
-
import '@standard-schema/spec';
|
|
3
|
-
import 'fumadocs-core/mdx-plugins';
|
|
4
|
-
import '@mdx-js/mdx';
|
|
5
|
-
import 'unified';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '../remark-postprocess-K233ZVBK.cjs';
|
package/dist/plugins/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { E as EmitEntry, P as Plugin, h as PluginContext, i as PluginOption, j as createPluginHandler } from '../define-bck_EB4t.js';
|
|
2
|
-
import '@standard-schema/spec';
|
|
3
|
-
import 'fumadocs-core/mdx-plugins';
|
|
4
|
-
import '@mdx-js/mdx';
|
|
5
|
-
import 'unified';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '../remark-postprocess-K233ZVBK.js';
|
package/dist/plugins/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface ExtractedReference {
|
|
2
|
-
href: string;
|
|
3
|
-
}
|
|
4
|
-
interface PostprocessOptions {
|
|
5
|
-
_format: 'md' | 'mdx';
|
|
6
|
-
/**
|
|
7
|
-
* Properties to export from `vfile.data`
|
|
8
|
-
*/
|
|
9
|
-
valueToExport?: string[];
|
|
10
|
-
/**
|
|
11
|
-
* stringify MDAST and export via `_markdown`.
|
|
12
|
-
*/
|
|
13
|
-
includeProcessedMarkdown?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* store MDAST and export via `_mdast`.
|
|
16
|
-
*/
|
|
17
|
-
includeMDAST?: boolean | {
|
|
18
|
-
removePosition?: boolean;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type { ExtractedReference as E, PostprocessOptions as P };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface ExtractedReference {
|
|
2
|
-
href: string;
|
|
3
|
-
}
|
|
4
|
-
interface PostprocessOptions {
|
|
5
|
-
_format: 'md' | 'mdx';
|
|
6
|
-
/**
|
|
7
|
-
* Properties to export from `vfile.data`
|
|
8
|
-
*/
|
|
9
|
-
valueToExport?: string[];
|
|
10
|
-
/**
|
|
11
|
-
* stringify MDAST and export via `_markdown`.
|
|
12
|
-
*/
|
|
13
|
-
includeProcessedMarkdown?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* store MDAST and export via `_mdast`.
|
|
16
|
-
*/
|
|
17
|
-
includeMDAST?: boolean | {
|
|
18
|
-
removePosition?: boolean;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type { ExtractedReference as E, PostprocessOptions as P };
|
package/dist/watcher-WXJDWRZY.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/next/watcher.ts
|
|
2
|
-
import { FSWatcher } from "chokidar";
|
|
3
|
-
function watcher(configPath, config, ignored) {
|
|
4
|
-
const watcher2 = new FSWatcher({
|
|
5
|
-
ignoreInitial: true,
|
|
6
|
-
persistent: true,
|
|
7
|
-
ignored
|
|
8
|
-
});
|
|
9
|
-
watcher2.add(configPath);
|
|
10
|
-
for (const collection of config.collections.values()) {
|
|
11
|
-
if (collection.type === "docs") {
|
|
12
|
-
watcher2.add(collection.docs.dir);
|
|
13
|
-
watcher2.add(collection.meta.dir);
|
|
14
|
-
} else {
|
|
15
|
-
watcher2.add(collection.dir);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return watcher2;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
watcher
|
|
22
|
-
};
|
|
File without changes
|
|
File without changes
|