fumadocs-mdx 13.0.5 → 13.0.7
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 +162 -131
- package/dist/{build-mdx-BjXOmv0b.d.cts → build-mdx-BnJhW5O1.d.cts} +1 -1
- package/dist/{build-mdx-CY5UldCO.d.ts → build-mdx-DNzfRRlY.d.ts} +1 -1
- package/dist/bun/index.cjs +156 -132
- package/dist/bun/index.d.cts +7 -2
- package/dist/bun/index.d.ts +7 -2
- package/dist/bun/index.js +8 -11
- package/dist/{chunk-TZ5EQBFW.js → chunk-2AQRQXSO.js} +7 -1
- package/dist/chunk-2E2JCOSO.js +135 -0
- package/dist/chunk-4757L6ST.js +77 -0
- package/dist/{chunk-ZNVPB2IR.js → chunk-ETIN2W7C.js} +49 -41
- package/dist/config/index.d.cts +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/{core-DB7TdlyC.d.cts → core-HkAVGq_a.d.cts} +1 -1
- package/dist/{core-DB7TdlyC.d.ts → core-HkAVGq_a.d.ts} +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/next/index.js +2 -4
- package/dist/node/loader.cjs +146 -119
- package/dist/node/loader.js +6 -10
- package/dist/plugins/json-schema.d.cts +1 -1
- package/dist/plugins/json-schema.d.ts +1 -1
- package/dist/runtime/next/async.d.cts +3 -3
- package/dist/runtime/next/async.d.ts +3 -3
- package/dist/runtime/next/index.d.cts +4 -4
- package/dist/runtime/next/index.d.ts +4 -4
- package/dist/runtime/vite/browser.d.cts +2 -2
- package/dist/runtime/vite/browser.d.ts +2 -2
- package/dist/runtime/vite/server.d.cts +2 -2
- package/dist/runtime/vite/server.d.ts +2 -2
- package/dist/{types-Bnh9n7mj.d.cts → types-By6wKOnT.d.cts} +1 -1
- package/dist/{types-ey1AZqrg.d.ts → types-DgD5Omj2.d.ts} +1 -1
- package/dist/vite/index.cjs +166 -134
- package/dist/vite/index.js +8 -14
- package/dist/webpack/mdx.cjs +86 -75
- package/dist/webpack/mdx.js +3 -3
- package/dist/webpack/meta.cjs +64 -37
- package/dist/webpack/meta.js +3 -3
- package/package.json +7 -7
- package/dist/chunk-4JSFLXXT.js +0 -8
- package/dist/chunk-XYGORKQA.js +0 -130
- package/dist/chunk-YAIPHUCZ.js +0 -56
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PageData, MetaData, Source, VirtualFile } from 'fumadocs-core/source';
|
|
2
|
-
import { a as Runtime } from '../../types-
|
|
3
|
-
export { c as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, R as RuntimeAsync, b as RuntimeFile } from '../../types-
|
|
2
|
+
import { a as Runtime } from '../../types-DgD5Omj2.js';
|
|
3
|
+
export { c as AsyncDocOut, A as AsyncRuntimeFile, D as DocOut, M as MetaOut, R as RuntimeAsync, b as RuntimeFile } from '../../types-DgD5Omj2.js';
|
|
4
4
|
import { FileInfo } from '../../index.js';
|
|
5
5
|
import '@standard-schema/spec';
|
|
6
|
-
import '../../core-
|
|
6
|
+
import '../../core-HkAVGq_a.js';
|
|
7
7
|
import '@mdx-js/mdx';
|
|
8
8
|
import 'fumadocs-core/mdx-plugins';
|
|
9
9
|
import 'unified';
|
|
@@ -12,7 +12,7 @@ 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-DNzfRRlY.js';
|
|
16
16
|
import 'react';
|
|
17
17
|
|
|
18
18
|
declare const _runtime: Runtime;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as DocCollection, b as DocsCollection, M as MetaCollection } from '../../core-HkAVGq_a.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-BnJhW5O1.cjs';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
5
|
import '@mdx-js/mdx';
|
|
6
6
|
import 'fumadocs-core/mdx-plugins';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as DocCollection, b as DocsCollection, M as MetaCollection } from '../../core-HkAVGq_a.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-DNzfRRlY.js';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
5
|
import '@mdx-js/mdx';
|
|
6
6
|
import 'fumadocs-core/mdx-plugins';
|
|
@@ -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 '../../core-
|
|
5
|
+
import '../../core-HkAVGq_a.cjs';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import '@standard-schema/spec';
|
|
8
8
|
import 'fumadocs-core/mdx-plugins';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'chokidar';
|
|
12
|
-
import '../../build-mdx-
|
|
12
|
+
import '../../build-mdx-BnJhW5O1.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 '../../core-
|
|
5
|
+
import '../../core-HkAVGq_a.js';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import '@standard-schema/spec';
|
|
8
8
|
import 'fumadocs-core/mdx-plugins';
|
|
9
9
|
import 'unified';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'chokidar';
|
|
12
|
-
import '../../build-mdx-
|
|
12
|
+
import '../../build-mdx-DNzfRRlY.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, a as DocCollection, b as DocsCollection, M as MetaCollection } from './core-HkAVGq_a.cjs';
|
|
4
4
|
import { FileInfo, AsyncDocCollectionEntry, MetaCollectionEntry, DocCollectionEntry } from './index.cjs';
|
|
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, a as DocCollection, b as DocsCollection, M as MetaCollection } from './core-HkAVGq_a.js';
|
|
4
4
|
import { FileInfo, AsyncDocCollectionEntry, MetaCollectionEntry, DocCollectionEntry } from './index.js';
|
|
5
5
|
|
|
6
6
|
interface RuntimeFile {
|
package/dist/vite/index.cjs
CHANGED
|
@@ -710,6 +710,12 @@ var import_zod = require("zod");
|
|
|
710
710
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
711
711
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
712
712
|
var import_node_crypto = require("crypto");
|
|
713
|
+
|
|
714
|
+
// src/loaders/index.ts
|
|
715
|
+
var metaLoaderGlob = /\.(json|yaml)(\?.+?)?$/;
|
|
716
|
+
var mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
|
|
717
|
+
|
|
718
|
+
// src/loaders/mdx/index.ts
|
|
713
719
|
var querySchema = import_zod.z.object({
|
|
714
720
|
only: import_zod.z.literal(["frontmatter", "all"]).default("all"),
|
|
715
721
|
collection: import_zod.z.string().optional()
|
|
@@ -720,84 +726,88 @@ var cacheEntry = import_zod.z.object({
|
|
|
720
726
|
hash: import_zod.z.string().optional()
|
|
721
727
|
});
|
|
722
728
|
function createMdxLoader(configLoader) {
|
|
723
|
-
return
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
await import_promises.default.
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
729
|
+
return {
|
|
730
|
+
test: mdxLoaderGlob,
|
|
731
|
+
async load({
|
|
732
|
+
getSource,
|
|
733
|
+
development: isDevelopment,
|
|
734
|
+
query,
|
|
735
|
+
compiler,
|
|
736
|
+
filePath
|
|
737
|
+
}) {
|
|
738
|
+
const value = await getSource();
|
|
739
|
+
const matter = fumaMatter(value);
|
|
740
|
+
const parsed = querySchema.parse(query);
|
|
741
|
+
const config = await configLoader.getConfig();
|
|
742
|
+
let after;
|
|
743
|
+
if (!isDevelopment && config.global.experimentalBuildCache) {
|
|
744
|
+
const cacheDir = config.global.experimentalBuildCache;
|
|
745
|
+
const cacheKey = `${parsed.hash}_${parsed.collection ?? "global"}_${generateCacheHash(filePath)}`;
|
|
746
|
+
const cached = await import_promises.default.readFile(import_node_path2.default.join(cacheDir, cacheKey)).then((content) => cacheEntry.parse(JSON.parse(content.toString()))).catch(() => null);
|
|
747
|
+
if (cached && cached.hash === generateCacheHash(value)) return cached;
|
|
748
|
+
after = async () => {
|
|
749
|
+
await import_promises.default.mkdir(cacheDir, { recursive: true });
|
|
750
|
+
await import_promises.default.writeFile(
|
|
751
|
+
import_node_path2.default.join(cacheDir, cacheKey),
|
|
752
|
+
JSON.stringify({
|
|
753
|
+
...out,
|
|
754
|
+
hash: generateCacheHash(value)
|
|
755
|
+
})
|
|
756
|
+
);
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
const collection = parsed.collection ? config.getCollection(parsed.collection) : void 0;
|
|
760
|
+
let docCollection;
|
|
761
|
+
switch (collection?.type) {
|
|
762
|
+
case "doc":
|
|
763
|
+
docCollection = collection;
|
|
764
|
+
break;
|
|
765
|
+
case "docs":
|
|
766
|
+
docCollection = collection.docs;
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
if (docCollection?.schema) {
|
|
770
|
+
matter.data = await validate(
|
|
771
|
+
docCollection.schema,
|
|
772
|
+
matter.data,
|
|
773
|
+
{
|
|
774
|
+
source: value,
|
|
775
|
+
path: filePath
|
|
776
|
+
},
|
|
777
|
+
`invalid frontmatter in ${filePath}`
|
|
747
778
|
);
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
matter.data,
|
|
779
|
+
}
|
|
780
|
+
if (parsed.only === "frontmatter") {
|
|
781
|
+
return {
|
|
782
|
+
code: `export const frontmatter = ${JSON.stringify(matter.data)}`,
|
|
783
|
+
map: null
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
const data = {};
|
|
787
|
+
if (config.global.lastModifiedTime === "git") {
|
|
788
|
+
data.lastModified = (await getGitTimestamp(filePath))?.getTime();
|
|
789
|
+
}
|
|
790
|
+
const lineOffset = isDevelopment ? countLines(matter.matter) : 0;
|
|
791
|
+
const compiled = await buildMDX(
|
|
792
|
+
`${getConfigHash(config)}:${parsed.collection ?? "global"}`,
|
|
793
|
+
"\n".repeat(lineOffset) + matter.content,
|
|
764
794
|
{
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
795
|
+
development: isDevelopment,
|
|
796
|
+
...docCollection?.mdxOptions ?? await config.getDefaultMDXOptions(),
|
|
797
|
+
postprocess: docCollection?.postprocess,
|
|
798
|
+
data,
|
|
799
|
+
filePath,
|
|
800
|
+
frontmatter: matter.data,
|
|
801
|
+
_compiler: compiler
|
|
802
|
+
}
|
|
769
803
|
);
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
code: `export const frontmatter = ${JSON.stringify(matter.data)}`,
|
|
774
|
-
map: null
|
|
804
|
+
const out = {
|
|
805
|
+
code: String(compiled.value),
|
|
806
|
+
map: compiled.map
|
|
775
807
|
};
|
|
808
|
+
await after?.();
|
|
809
|
+
return out;
|
|
776
810
|
}
|
|
777
|
-
const data = {};
|
|
778
|
-
if (config.global.lastModifiedTime === "git") {
|
|
779
|
-
data.lastModified = (await getGitTimestamp(filePath))?.getTime();
|
|
780
|
-
}
|
|
781
|
-
const lineOffset = isDevelopment ? countLines(matter.matter) : 0;
|
|
782
|
-
const compiled = await buildMDX(
|
|
783
|
-
`${getConfigHash(config)}:${parsed.collection ?? "global"}`,
|
|
784
|
-
"\n".repeat(lineOffset) + matter.content,
|
|
785
|
-
{
|
|
786
|
-
development: isDevelopment,
|
|
787
|
-
...docCollection?.mdxOptions ?? await config.getDefaultMDXOptions(),
|
|
788
|
-
postprocess: docCollection?.postprocess,
|
|
789
|
-
data,
|
|
790
|
-
filePath,
|
|
791
|
-
frontmatter: matter.data,
|
|
792
|
-
_compiler: compiler
|
|
793
|
-
}
|
|
794
|
-
);
|
|
795
|
-
const out = {
|
|
796
|
-
code: String(compiled.value),
|
|
797
|
-
map: compiled.map
|
|
798
|
-
};
|
|
799
|
-
await after?.();
|
|
800
|
-
return out;
|
|
801
811
|
};
|
|
802
812
|
}
|
|
803
813
|
var hashes = /* @__PURE__ */ new WeakMap();
|
|
@@ -825,23 +835,31 @@ var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
|
825
835
|
var import_node_querystring = require("querystring");
|
|
826
836
|
var import_node_path3 = __toESM(require("path"), 1);
|
|
827
837
|
function toVite(loader) {
|
|
828
|
-
return
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
838
|
+
return {
|
|
839
|
+
filter(id) {
|
|
840
|
+
return !loader.test || loader.test.test(id);
|
|
841
|
+
},
|
|
842
|
+
async transform(value, id) {
|
|
843
|
+
const [file, query = ""] = id.split("?", 2);
|
|
844
|
+
const result = await loader.load({
|
|
845
|
+
filePath: file,
|
|
846
|
+
query: (0, import_node_querystring.parse)(query),
|
|
847
|
+
getSource() {
|
|
848
|
+
return value;
|
|
849
|
+
},
|
|
850
|
+
development: this.environment.mode === "dev",
|
|
851
|
+
compiler: {
|
|
852
|
+
addDependency: (file2) => {
|
|
853
|
+
this.addWatchFile(file2);
|
|
854
|
+
}
|
|
837
855
|
}
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
}
|
|
856
|
+
});
|
|
857
|
+
if (result === null) return null;
|
|
858
|
+
return {
|
|
859
|
+
code: result.code,
|
|
860
|
+
map: result.map
|
|
861
|
+
};
|
|
862
|
+
}
|
|
845
863
|
};
|
|
846
864
|
}
|
|
847
865
|
|
|
@@ -1149,51 +1167,67 @@ var querySchema2 = import_zod2.z.object({
|
|
|
1149
1167
|
}).loose();
|
|
1150
1168
|
function createMetaLoader(configLoader, resolve3 = {}) {
|
|
1151
1169
|
const { json: resolveJson = "js", yaml: resolveYaml = "js" } = resolve3;
|
|
1152
|
-
|
|
1153
|
-
const isJson = filePath.endsWith(".json");
|
|
1154
|
-
const parsed = querySchema2.parse(query);
|
|
1155
|
-
const collection = parsed.collection ? (await configLoader.getConfig()).getCollection(parsed.collection) : void 0;
|
|
1156
|
-
if (!collection) return null;
|
|
1157
|
-
let data;
|
|
1158
|
-
try {
|
|
1159
|
-
data = isJson ? JSON.parse(source) : (0, import_js_yaml2.load)(source);
|
|
1160
|
-
} catch (e) {
|
|
1161
|
-
throw new Error(`invalid data in ${filePath}`, { cause: e });
|
|
1162
|
-
}
|
|
1163
|
-
let schema;
|
|
1164
|
-
switch (collection?.type) {
|
|
1165
|
-
case "meta":
|
|
1166
|
-
schema = collection.schema;
|
|
1167
|
-
break;
|
|
1168
|
-
case "docs":
|
|
1169
|
-
schema = collection.meta.schema;
|
|
1170
|
-
break;
|
|
1171
|
-
}
|
|
1172
|
-
if (schema) {
|
|
1173
|
-
data = await validate(
|
|
1174
|
-
schema,
|
|
1175
|
-
data,
|
|
1176
|
-
{ path: filePath, source },
|
|
1177
|
-
`invalid data in ${filePath}`
|
|
1178
|
-
);
|
|
1179
|
-
}
|
|
1180
|
-
let code;
|
|
1170
|
+
function stringifyOutput(isJson, data) {
|
|
1181
1171
|
if (isJson) {
|
|
1182
|
-
|
|
1172
|
+
return resolveJson === "json" ? JSON.stringify(data) : `export default ${JSON.stringify(data)}`;
|
|
1183
1173
|
} else {
|
|
1184
|
-
|
|
1174
|
+
return resolveYaml === "yaml" ? (0, import_js_yaml2.dump)(data) : `export default ${JSON.stringify(data)}`;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
return {
|
|
1178
|
+
test: metaLoaderGlob,
|
|
1179
|
+
async load({ filePath, query, getSource }) {
|
|
1180
|
+
const parsed = querySchema2.parse(query);
|
|
1181
|
+
const collection = parsed.collection ? (await configLoader.getConfig()).getCollection(parsed.collection) : void 0;
|
|
1182
|
+
if (!collection) return null;
|
|
1183
|
+
const isJson = filePath.endsWith(".json");
|
|
1184
|
+
const source = await getSource();
|
|
1185
|
+
let data;
|
|
1186
|
+
try {
|
|
1187
|
+
data = isJson ? JSON.parse(source) : (0, import_js_yaml2.load)(source);
|
|
1188
|
+
} catch (e) {
|
|
1189
|
+
throw new Error(`invalid data in ${filePath}`, { cause: e });
|
|
1190
|
+
}
|
|
1191
|
+
let schema;
|
|
1192
|
+
switch (collection?.type) {
|
|
1193
|
+
case "meta":
|
|
1194
|
+
schema = collection.schema;
|
|
1195
|
+
break;
|
|
1196
|
+
case "docs":
|
|
1197
|
+
schema = collection.meta.schema;
|
|
1198
|
+
break;
|
|
1199
|
+
}
|
|
1200
|
+
if (schema) {
|
|
1201
|
+
data = await validate(
|
|
1202
|
+
schema,
|
|
1203
|
+
data,
|
|
1204
|
+
{ path: filePath, source },
|
|
1205
|
+
`invalid data in ${filePath}`
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
return {
|
|
1209
|
+
code: stringifyOutput(isJson, data)
|
|
1210
|
+
};
|
|
1211
|
+
},
|
|
1212
|
+
bun: {
|
|
1213
|
+
async fallback({ getSource, filePath }) {
|
|
1214
|
+
const source = await getSource();
|
|
1215
|
+
const isJson = filePath.endsWith(".json");
|
|
1216
|
+
let data;
|
|
1217
|
+
try {
|
|
1218
|
+
data = isJson ? JSON.parse(source) : (0, import_js_yaml2.load)(source);
|
|
1219
|
+
} catch (e) {
|
|
1220
|
+
throw new Error(`invalid data in ${filePath}`, { cause: e });
|
|
1221
|
+
}
|
|
1222
|
+
return {
|
|
1223
|
+
loader: "object",
|
|
1224
|
+
exports: data
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1185
1227
|
}
|
|
1186
|
-
return {
|
|
1187
|
-
code,
|
|
1188
|
-
map: null
|
|
1189
|
-
};
|
|
1190
1228
|
};
|
|
1191
1229
|
}
|
|
1192
1230
|
|
|
1193
|
-
// src/loaders/index.ts
|
|
1194
|
-
var metaLoaderGlob = /\.(json|yaml)(\?.+?)?$/;
|
|
1195
|
-
var mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
|
|
1196
|
-
|
|
1197
1231
|
// src/vite/index.ts
|
|
1198
1232
|
var FumadocsDeps = ["fumadocs-core", "fumadocs-ui", "fumadocs-openapi"];
|
|
1199
1233
|
async function mdx(config, pluginOptions = {}) {
|
|
@@ -1235,13 +1269,11 @@ async function mdx(config, pluginOptions = {}) {
|
|
|
1235
1269
|
},
|
|
1236
1270
|
async transform(value, id) {
|
|
1237
1271
|
try {
|
|
1238
|
-
if (
|
|
1239
|
-
|
|
1240
|
-
return await metaLoader.call(this, file, query, value);
|
|
1272
|
+
if (metaLoader.filter(id)) {
|
|
1273
|
+
return await metaLoader.transform.call(this, value, id);
|
|
1241
1274
|
}
|
|
1242
|
-
if (
|
|
1243
|
-
|
|
1244
|
-
return await mdxLoader.call(this, file, query, value);
|
|
1275
|
+
if (mdxLoader.filter(id)) {
|
|
1276
|
+
return await mdxLoader.transform.call(this, value, id);
|
|
1245
1277
|
}
|
|
1246
1278
|
} catch (e) {
|
|
1247
1279
|
if (e instanceof ValidationError) {
|
package/dist/vite/index.js
CHANGED
|
@@ -7,26 +7,22 @@ import {
|
|
|
7
7
|
} from "../chunk-2HXTGJBI.js";
|
|
8
8
|
import {
|
|
9
9
|
createMdxLoader
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-2E2JCOSO.js";
|
|
11
11
|
import {
|
|
12
12
|
createMetaLoader
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-4757L6ST.js";
|
|
14
14
|
import {
|
|
15
15
|
createIntegratedConfigLoader,
|
|
16
16
|
toVite
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-ETIN2W7C.js";
|
|
18
18
|
import "../chunk-3J3WL7WN.js";
|
|
19
19
|
import "../chunk-K5ZLPEIQ.js";
|
|
20
|
-
import {
|
|
21
|
-
mdxLoaderGlob,
|
|
22
|
-
metaLoaderGlob
|
|
23
|
-
} from "../chunk-4JSFLXXT.js";
|
|
24
20
|
import "../chunk-VUEZTR2H.js";
|
|
25
21
|
import {
|
|
26
22
|
ValidationError,
|
|
27
23
|
createCore,
|
|
28
24
|
findConfigFile
|
|
29
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-2AQRQXSO.js";
|
|
30
26
|
import "../chunk-VWJKRQZR.js";
|
|
31
27
|
|
|
32
28
|
// src/vite/index.ts
|
|
@@ -263,13 +259,11 @@ async function mdx(config, pluginOptions = {}) {
|
|
|
263
259
|
},
|
|
264
260
|
async transform(value, id) {
|
|
265
261
|
try {
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
return await metaLoader.call(this, file, query, value);
|
|
262
|
+
if (metaLoader.filter(id)) {
|
|
263
|
+
return await metaLoader.transform.call(this, value, id);
|
|
269
264
|
}
|
|
270
|
-
if (
|
|
271
|
-
|
|
272
|
-
return await mdxLoader.call(this, file, query, value);
|
|
265
|
+
if (mdxLoader.filter(id)) {
|
|
266
|
+
return await mdxLoader.transform.call(this, value, id);
|
|
273
267
|
}
|
|
274
268
|
} catch (e) {
|
|
275
269
|
if (e instanceof ValidationError) {
|