fuma-content 1.2.2 → 1.3.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/dist/async-cache-C47yxLCv.js +0 -2
- package/dist/bin.js +0 -2
- package/dist/{build-mdx-C8u32vDa.js → build-mdx-DjMJg3TP.js} +1 -3
- package/dist/bun/index.d.ts +2 -3
- package/dist/bun/index.js +1 -3
- package/dist/{bun-NahDFkhR.js → bun-qVjHRKNw.js} +0 -2
- package/dist/{code-generator-pLUE7Rk7.js → code-generator-DFGEY6P5.js} +12 -14
- package/dist/collections/data/runtime.d.ts +6 -6
- package/dist/collections/data/runtime.js +0 -2
- package/dist/collections/data.d.ts +4 -5
- package/dist/collections/data.js +4 -6
- package/dist/collections/fs.d.ts +1 -1
- package/dist/collections/fs.js +10 -12
- package/dist/collections/index.d.ts +1 -1
- package/dist/collections/index.js +1 -1
- package/dist/collections/json/loader-webpack.d.ts +2 -3
- package/dist/collections/json/loader-webpack.js +1 -5
- package/dist/collections/mdx/loader-webpack.d.ts +2 -3
- package/dist/collections/mdx/loader-webpack.js +1 -5
- package/dist/collections/mdx/react.d.ts +3 -4
- package/dist/collections/mdx/react.js +0 -2
- package/dist/collections/mdx/runtime-browser.d.ts +2 -2
- package/dist/collections/mdx/runtime-browser.js +0 -2
- package/dist/collections/mdx/runtime-dynamic.d.ts +8 -7
- package/dist/collections/mdx/runtime-dynamic.js +4 -7
- package/dist/collections/mdx/runtime.d.ts +1 -1
- package/dist/collections/mdx/runtime.js +0 -2
- package/dist/collections/mdx/vue.d.ts +7 -8
- package/dist/collections/mdx/vue.js +0 -2
- package/dist/collections/mdx.d.ts +1 -1
- package/dist/collections/mdx.js +3 -5
- package/dist/collections/obsidian.d.ts +2 -3
- package/dist/collections/obsidian.js +4 -7
- package/dist/collections/runtime/file-store.d.ts +1 -1
- package/dist/collections/runtime/file-store.js +0 -2
- package/dist/collections/runtime/store.d.ts +1 -1
- package/dist/collections/runtime/store.js +7 -9
- package/dist/collections/yaml/loader-webpack.d.ts +2 -3
- package/dist/collections/yaml/loader-webpack.js +1 -5
- package/dist/{collections-Cl-23FUa.js → collections-Bl9hpWMS.js} +4 -6
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +0 -2
- package/dist/{core-Dkl2eUwU.js → core-CrYszxmc.js} +8 -11
- package/dist/{core-1dkeRoD-.d.ts → core-Dmd3yqUH.d.ts} +15 -16
- package/dist/{dynamic-DGbONJ46.d.ts → dynamic-C15fv7uG.d.ts} +2 -3
- package/dist/dynamic.d.ts +1 -1
- package/dist/dynamic.js +1 -3
- package/dist/{file-store-NLjnayNa.d.ts → file-store-Bs81Afz5.d.ts} +2 -3
- package/dist/{flatten-m0wfHxLH.js → flatten-Db7WzTB7.js} +0 -2
- package/dist/{fs-C8dHWQw9.d.ts → fs-DYfoYdl-.d.ts} +3 -7
- package/dist/{git-W7QH8hQh.d.ts → git-C0-Uazuh.d.ts} +2 -3
- package/dist/{index-h97OPng4.d.ts → index-Dfg2QKTT.d.ts} +3 -4
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -2
- package/dist/is-promise-like-C04ERo2r.js +0 -2
- package/dist/{load-from-file-C3CnD8mJ.js → load-from-file-DpW8who8.js} +0 -2
- package/dist/{loader-ol04zeoP.js → loader-B19JQedw.js} +0 -2
- package/dist/{loader-CyhM9SLt.js → loader-BTPxE-0W.js} +3 -5
- package/dist/{loader-e2SkeDfY.js → loader-CORy1xd9.js} +1 -3
- package/dist/{loader-D_sKOzDc.js → loader-DJcLC5Gg.js} +1 -3
- package/dist/{mdx-CBjuia2v.d.ts → mdx-0plToRQa.d.ts} +3 -4
- package/dist/next/index.d.ts +2 -3
- package/dist/next/index.js +2 -4
- package/dist/node/index.d.ts +1 -2
- package/dist/node/index.js +0 -2
- package/dist/node/loader.d.ts +2 -3
- package/dist/node/loader.js +1 -3
- package/dist/{node-Du4i4XDg.js → node--IKK4_8Y.js} +0 -2
- package/dist/plugins/git.d.ts +1 -1
- package/dist/plugins/git.js +1 -3
- package/dist/plugins/json-schema.d.ts +2 -3
- package/dist/plugins/json-schema.js +1 -3
- package/dist/plugins/loader/index.d.ts +1 -1
- package/dist/plugins/loader/index.js +4 -6
- package/dist/plugins/loader/webpack.d.ts +1 -1
- package/dist/plugins/loader/webpack.js +1 -3
- package/dist/plugins/remark/include.d.ts +1 -2
- package/dist/plugins/remark/include.js +4 -5
- package/dist/{runtime-CY1liEj_.d.ts → runtime-4S3BDs-G.d.ts} +8 -7
- package/dist/{runtime-browser-BqhaLAei.d.ts → runtime-browser-CXjm3FXK.d.ts} +7 -7
- package/dist/{store-DySTeDAM.d.ts → store-j10gHjm1.d.ts} +3 -5
- package/dist/utils/frontmatter.d.ts +15 -0
- package/dist/{fuma-matter-E30PU53R.js → utils/frontmatter.js} +3 -5
- package/dist/validation-Bf_v2L3p.js +0 -2
- package/dist/vite/index.d.ts +2 -3
- package/dist/vite/index.js +2 -4
- package/dist/{vite-DVIOnBqW.js → vite-myuLielb.js} +0 -2
- package/package.json +24 -20
- package/dist/async-cache-C47yxLCv.js.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/build-mdx-C8u32vDa.js.map +0 -1
- package/dist/bun/index.d.ts.map +0 -1
- package/dist/bun/index.js.map +0 -1
- package/dist/bun-NahDFkhR.js.map +0 -1
- package/dist/code-generator-pLUE7Rk7.js.map +0 -1
- package/dist/collections/data/runtime.d.ts.map +0 -1
- package/dist/collections/data/runtime.js.map +0 -1
- package/dist/collections/data.d.ts.map +0 -1
- package/dist/collections/data.js.map +0 -1
- package/dist/collections/fs.js.map +0 -1
- package/dist/collections/json/loader-webpack.d.ts.map +0 -1
- package/dist/collections/json/loader-webpack.js.map +0 -1
- package/dist/collections/mdx/loader-webpack.d.ts.map +0 -1
- package/dist/collections/mdx/loader-webpack.js.map +0 -1
- package/dist/collections/mdx/react.d.ts.map +0 -1
- package/dist/collections/mdx/react.js.map +0 -1
- package/dist/collections/mdx/runtime-browser.js.map +0 -1
- package/dist/collections/mdx/runtime-dynamic.d.ts.map +0 -1
- package/dist/collections/mdx/runtime-dynamic.js.map +0 -1
- package/dist/collections/mdx/runtime.js.map +0 -1
- package/dist/collections/mdx/vue.d.ts.map +0 -1
- package/dist/collections/mdx/vue.js.map +0 -1
- package/dist/collections/mdx.js.map +0 -1
- package/dist/collections/obsidian.d.ts.map +0 -1
- package/dist/collections/obsidian.js.map +0 -1
- package/dist/collections/runtime/file-store.js.map +0 -1
- package/dist/collections/runtime/store.js.map +0 -1
- package/dist/collections/yaml/loader-webpack.d.ts.map +0 -1
- package/dist/collections/yaml/loader-webpack.js.map +0 -1
- package/dist/collections-Cl-23FUa.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/core-1dkeRoD-.d.ts.map +0 -1
- package/dist/core-Dkl2eUwU.js.map +0 -1
- package/dist/dynamic-DGbONJ46.d.ts.map +0 -1
- package/dist/dynamic.js.map +0 -1
- package/dist/file-store-NLjnayNa.d.ts.map +0 -1
- package/dist/flatten-m0wfHxLH.js.map +0 -1
- package/dist/fs-C8dHWQw9.d.ts.map +0 -1
- package/dist/fuma-matter-E30PU53R.js.map +0 -1
- package/dist/git-W7QH8hQh.d.ts.map +0 -1
- package/dist/index-h97OPng4.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/is-promise-like-C04ERo2r.js.map +0 -1
- package/dist/load-from-file-C3CnD8mJ.js.map +0 -1
- package/dist/loader-CyhM9SLt.js.map +0 -1
- package/dist/loader-D_sKOzDc.js.map +0 -1
- package/dist/loader-e2SkeDfY.js.map +0 -1
- package/dist/loader-ol04zeoP.js.map +0 -1
- package/dist/mdx-CBjuia2v.d.ts.map +0 -1
- package/dist/next/index.d.ts.map +0 -1
- package/dist/next/index.js.map +0 -1
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js.map +0 -1
- package/dist/node/loader.d.ts.map +0 -1
- package/dist/node/loader.js.map +0 -1
- package/dist/node-Du4i4XDg.js.map +0 -1
- package/dist/plugins/git.js.map +0 -1
- package/dist/plugins/json-schema.d.ts.map +0 -1
- package/dist/plugins/json-schema.js.map +0 -1
- package/dist/plugins/loader/index.js.map +0 -1
- package/dist/plugins/loader/webpack.js.map +0 -1
- package/dist/plugins/remark/include.d.ts.map +0 -1
- package/dist/plugins/remark/include.js.map +0 -1
- package/dist/runtime-CY1liEj_.d.ts.map +0 -1
- package/dist/runtime-browser-BqhaLAei.d.ts.map +0 -1
- package/dist/store-DySTeDAM.d.ts.map +0 -1
- package/dist/validation-Bf_v2L3p.js.map +0 -1
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js.map +0 -1
- package/dist/vite-DVIOnBqW.js.map +0 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { D as GetCollectionConfig } from "./core-
|
|
2
|
-
import { t as FileCollectionStore } from "./file-store-
|
|
3
|
-
import { i as CompiledMDX
|
|
4
|
-
import { n as GitFileData } from "./git-
|
|
1
|
+
import { D as GetCollectionConfig } from "./core-Dmd3yqUH.js";
|
|
2
|
+
import { t as FileCollectionStore } from "./file-store-Bs81Afz5.js";
|
|
3
|
+
import { i as CompiledMDX } from "./mdx-0plToRQa.js";
|
|
4
|
+
import { n as GitFileData } from "./git-C0-Uazuh.js";
|
|
5
5
|
|
|
6
6
|
//#region src/collections/mdx/runtime.d.ts
|
|
7
7
|
interface MDXStoreData<Frontmatter, Attached = unknown> {
|
|
8
8
|
id: string;
|
|
9
9
|
compiled: CompiledMDX<Frontmatter> & Attached;
|
|
10
10
|
}
|
|
11
|
-
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends
|
|
11
|
+
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends {
|
|
12
|
+
$inferFrontmatter: unknown;
|
|
13
|
+
} ? GetCollectionConfig<Config, Name>["$inferFrontmatter"] : never;
|
|
12
14
|
declare function mdxStore<Config, Name extends string, Attached>(_name: Name, base: string, _input: Record<string, unknown>): FileCollectionStore<MDXStoreData<GetFrontmatter<Config, Name>, Attached>>;
|
|
13
15
|
interface MDXStoreLazyData<Frontmatter, Attached> {
|
|
14
16
|
id: string;
|
|
@@ -21,5 +23,4 @@ declare function mdxStoreLazy<Config, Name extends string, Attached>(_name: Name
|
|
|
21
23
|
}): FileCollectionStore<MDXStoreLazyData<GetFrontmatter<Config, Name>, Attached>>;
|
|
22
24
|
type WithGit = GitFileData;
|
|
23
25
|
//#endregion
|
|
24
|
-
export { mdxStoreLazy as a, mdxStore as i, MDXStoreLazyData as n, WithGit as r, MDXStoreData as t };
|
|
25
|
-
//# sourceMappingURL=runtime-CY1liEj_.d.ts.map
|
|
26
|
+
export { mdxStoreLazy as a, mdxStore as i, MDXStoreLazyData as n, WithGit as r, MDXStoreData as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { D as GetCollectionConfig, E as Awaitable } from "./core-
|
|
2
|
-
import { n as MapCollectionStore } from "./store-
|
|
3
|
-
import { i as CompiledMDX
|
|
4
|
-
|
|
1
|
+
import { D as GetCollectionConfig, E as Awaitable } from "./core-Dmd3yqUH.js";
|
|
2
|
+
import { n as MapCollectionStore } from "./store-j10gHjm1.js";
|
|
3
|
+
import { i as CompiledMDX } from "./mdx-0plToRQa.js";
|
|
5
4
|
//#region src/utils/async-cache.d.ts
|
|
6
5
|
interface AsyncCache<V> {
|
|
7
6
|
cached: (key: string, fn: () => Awaitable<V>) => V | PromiseLike<V>;
|
|
@@ -21,9 +20,10 @@ interface StoreContext {
|
|
|
21
20
|
interface StoreData {
|
|
22
21
|
preloaded: AsyncCache<CompiledMDX>;
|
|
23
22
|
}
|
|
24
|
-
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends
|
|
23
|
+
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends {
|
|
24
|
+
$inferFrontmatter: unknown;
|
|
25
|
+
} ? GetCollectionConfig<Config, Name>["$inferFrontmatter"] : never;
|
|
25
26
|
declare const _internal_data: Map<string, StoreData>;
|
|
26
27
|
declare function mdxStoreBrowser<Config, Name extends string, Attached>(name: Name, _input: Record<string, () => Promise<unknown>>): MapCollectionStore<string, MDXStoreBrowserData<GetFrontmatter<Config, Name>, Attached>>;
|
|
27
28
|
//#endregion
|
|
28
|
-
export { _internal_data as n, mdxStoreBrowser as r, MDXStoreBrowserData as t };
|
|
29
|
-
//# sourceMappingURL=runtime-browser-BqhaLAei.d.ts.map
|
|
29
|
+
export { _internal_data as n, mdxStoreBrowser as r, MDXStoreBrowserData as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Awaitable } from "./core-
|
|
1
|
+
import { E as Awaitable } from "./core-Dmd3yqUH.js";
|
|
2
2
|
|
|
3
3
|
//#region src/collections/runtime/store.d.ts
|
|
4
4
|
interface CollectionStore<Id, Data> {
|
|
@@ -14,8 +14,7 @@ interface CollectionStore<Id, Data> {
|
|
|
14
14
|
$inferData: Data;
|
|
15
15
|
}
|
|
16
16
|
declare class MapCollectionStore<Id, Data> implements CollectionStore<Id, Data> {
|
|
17
|
-
private
|
|
18
|
-
private readonly dataList;
|
|
17
|
+
#private;
|
|
19
18
|
constructor(input: Map<Id, Data>);
|
|
20
19
|
get(id: Id): Data | undefined;
|
|
21
20
|
list(): Data[];
|
|
@@ -27,5 +26,4 @@ declare class MapCollectionStore<Id, Data> implements CollectionStore<Id, Data>
|
|
|
27
26
|
get $inferData(): Data;
|
|
28
27
|
}
|
|
29
28
|
//#endregion
|
|
30
|
-
export { MapCollectionStore as n, CollectionStore as t };
|
|
31
|
-
//# sourceMappingURL=store-DySTeDAM.d.ts.map
|
|
29
|
+
export { MapCollectionStore as n, CollectionStore as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/utils/frontmatter.d.ts
|
|
2
|
+
interface Output {
|
|
3
|
+
/**
|
|
4
|
+
* The matter section, including the delimiter.
|
|
5
|
+
*/
|
|
6
|
+
matter: string;
|
|
7
|
+
content: string;
|
|
8
|
+
data: unknown;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* parse frontmatter, it supports only yaml format
|
|
12
|
+
*/
|
|
13
|
+
declare function parseFrontmatter(input: string): Output;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { parseFrontmatter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { load } from "js-yaml";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/utils/frontmatter.ts
|
|
3
3
|
/**
|
|
4
4
|
* Inspired by https://github.com/jonschlinkert/gray-matter
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ const regex = /^---\r?\n(.+?)\r?\n---\r?\n/s;
|
|
|
7
7
|
/**
|
|
8
8
|
* parse frontmatter, it supports only yaml format
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
10
|
+
function parseFrontmatter(input) {
|
|
11
11
|
const output = {
|
|
12
12
|
matter: "",
|
|
13
13
|
data: {},
|
|
@@ -21,6 +21,4 @@ function fumaMatter(input) {
|
|
|
21
21
|
return output;
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
-
export {
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=fuma-matter-E30PU53R.js.map
|
|
24
|
+
export { parseFrontmatter };
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as CoreOptions, t as Core } from "../core-
|
|
1
|
+
import { n as CoreOptions, t as Core } from "../core-Dmd3yqUH.js";
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/vite/index.d.ts
|
|
@@ -13,5 +13,4 @@ interface PluginOptions extends Pick<CoreOptions, "configPath" | "cwd" | "outDir
|
|
|
13
13
|
declare function content(config: Record<string, unknown>, pluginOpitons?: PluginOptions): Promise<PluginOption[]>;
|
|
14
14
|
declare function createStandaloneCore(pluginOptions?: PluginOptions): Promise<Core>;
|
|
15
15
|
//#endregion
|
|
16
|
-
export { PluginOptions, createStandaloneCore, content as default };
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
|
16
|
+
export { PluginOptions, createStandaloneCore, content as default };
|
package/dist/vite/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Core } from "../core-
|
|
1
|
+
import { t as Core } from "../core-CrYszxmc.js";
|
|
2
2
|
import { loaderPlugin } from "../plugins/loader/index.js";
|
|
3
3
|
//#region src/vite/index.ts
|
|
4
4
|
async function content(config, pluginOpitons = {}) {
|
|
@@ -26,12 +26,10 @@ function createViteCore({ configPath, outDir, cwd }) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
async function createStandaloneCore(pluginOptions = {}) {
|
|
29
|
-
const { loadConfig } = await import("../load-from-file-
|
|
29
|
+
const { loadConfig } = await import("../load-from-file-DpW8who8.js").then((n) => n.n);
|
|
30
30
|
const core = createViteCore(pluginOptions);
|
|
31
31
|
await core.init({ config: loadConfig(core, true) });
|
|
32
32
|
return core;
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
35
|
export { createStandaloneCore, content as default };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuma-content",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The content processing layer for your app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Content",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "Fuma Nama",
|
|
12
12
|
"repository": "github:fuma-nama/fuma-content",
|
|
13
|
-
"bin":
|
|
13
|
+
"bin": {
|
|
14
|
+
"fuma-content": "./dist/bin.js"
|
|
15
|
+
},
|
|
14
16
|
"files": [
|
|
15
17
|
"dist/*"
|
|
16
18
|
],
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
"./plugins/loader": "./dist/plugins/loader/index.js",
|
|
46
48
|
"./plugins/loader/webpack": "./dist/plugins/loader/webpack.js",
|
|
47
49
|
"./plugins/remark/include": "./dist/plugins/remark/include.js",
|
|
50
|
+
"./utils/frontmatter": "./dist/utils/frontmatter.js",
|
|
48
51
|
"./vite": "./dist/vite/index.js",
|
|
49
52
|
"./package.json": "./package.json"
|
|
50
53
|
},
|
|
@@ -55,47 +58,48 @@
|
|
|
55
58
|
"@mdx-js/mdx": "^3.1.1",
|
|
56
59
|
"@standard-schema/spec": "^1.1.0",
|
|
57
60
|
"chokidar": "^5.0.0",
|
|
58
|
-
"esbuild": "^0.
|
|
61
|
+
"esbuild": "^0.28.0",
|
|
59
62
|
"estree-util-value-to-estree": "^3.5.0",
|
|
60
63
|
"github-slugger": "^2.0.0",
|
|
61
64
|
"js-yaml": "^4.1.1",
|
|
62
65
|
"mdast-util-mdx": "^3.0.0",
|
|
63
66
|
"mdast-util-to-markdown": "^2.1.2",
|
|
64
67
|
"picocolors": "^1.1.1",
|
|
65
|
-
"picomatch": "^4.0.
|
|
66
|
-
"tinyexec": "^1.
|
|
67
|
-
"tinyglobby": "^0.2.
|
|
68
|
+
"picomatch": "^4.0.4",
|
|
69
|
+
"tinyexec": "^1.1.2",
|
|
70
|
+
"tinyglobby": "^0.2.16",
|
|
68
71
|
"unified": "^11.0.5",
|
|
69
72
|
"unist-util-remove-position": "^5.0.0",
|
|
70
73
|
"unist-util-visit": "^5.1.0",
|
|
71
74
|
"vfile": "^6.0.3",
|
|
72
|
-
"zod": "^4.3
|
|
75
|
+
"zod": "^4.4.3"
|
|
73
76
|
},
|
|
74
77
|
"devDependencies": {
|
|
75
|
-
"@types/bun": "^1.3.
|
|
78
|
+
"@types/bun": "^1.3.13",
|
|
76
79
|
"@types/js-yaml": "^4.0.9",
|
|
77
80
|
"@types/mdast": "^4.0.4",
|
|
78
81
|
"@types/mdx": "^2.0.13",
|
|
79
|
-
"@types/node": "^25.
|
|
80
|
-
"@types/picomatch": "^4.0.
|
|
82
|
+
"@types/node": "^25.6.2",
|
|
83
|
+
"@types/picomatch": "^4.0.3",
|
|
81
84
|
"@types/react": "^19.2.14",
|
|
85
|
+
"fumadocs-core": "16.8.9",
|
|
82
86
|
"mdast-util-directive": "^3.1.0",
|
|
83
87
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
84
88
|
"micromark-util-types": "^2.0.2",
|
|
85
|
-
"next": "16.
|
|
86
|
-
"react": "^19.2.
|
|
89
|
+
"next": "^16.2.6",
|
|
90
|
+
"react": "^19.2.6",
|
|
87
91
|
"remark": "^15.0.1",
|
|
88
92
|
"remark-directive": "^4.0.0",
|
|
89
93
|
"remark-mdx": "^3.1.1",
|
|
90
94
|
"remark-stringify": "^11.0.0",
|
|
91
|
-
"rollup": "^4.
|
|
92
|
-
"tsdown": "^0.
|
|
93
|
-
"typescript": "^
|
|
94
|
-
"unplugin-vue": "^7.
|
|
95
|
-
"vite": "^8.0.
|
|
96
|
-
"vue": "
|
|
97
|
-
"vue-tsc": "^3.2.
|
|
98
|
-
"webpack": "^5.
|
|
95
|
+
"rollup": "^4.60.3",
|
|
96
|
+
"tsdown": "^0.22.0",
|
|
97
|
+
"typescript": "^6.0.3",
|
|
98
|
+
"unplugin-vue": "^7.2.0",
|
|
99
|
+
"vite": "^8.0.12",
|
|
100
|
+
"vue": "3.5.34",
|
|
101
|
+
"vue-tsc": "^3.2.8",
|
|
102
|
+
"webpack": "^5.106.2",
|
|
99
103
|
"typescript-config": "0.0.0"
|
|
100
104
|
},
|
|
101
105
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-cache-C47yxLCv.js","names":[],"sources":["../src/utils/async-cache.ts"],"sourcesContent":["import { Awaitable } from \"@/types\";\nimport { isPromiseLike } from \"./is-promise-like\";\n\nexport interface AsyncCache<V> {\n cached: (key: string, fn: () => Awaitable<V>) => V | PromiseLike<V>;\n $value: <T>() => AsyncCache<T>;\n invalidate: (key: string) => void;\n}\n\n/**\n * cache for async resources, finished promises will be resolved into original value, otherwise wrapped with a promise.\n */\nexport function createCache<V>(store = new Map<string, V | PromiseLike<V>>()): AsyncCache<V> {\n return {\n cached(key, fn) {\n let cached = store.get(key);\n if (cached) return cached;\n\n cached = fn();\n if (isPromiseLike(cached)) {\n cached = cached.then((out) => {\n // replace with resolved if still exists\n if (store.has(key)) {\n store.set(key, out);\n }\n\n return out;\n });\n }\n store.set(key, cached);\n return cached;\n },\n invalidate(key) {\n store.delete(key);\n },\n $value<T>() {\n return this as unknown as AsyncCache<T>;\n },\n };\n}\n"],"mappings":";;;;;AAYA,SAAgB,YAAe,wBAAQ,IAAI,KAAiC,EAAiB;AAC3F,QAAO;EACL,OAAO,KAAK,IAAI;GACd,IAAI,SAAS,MAAM,IAAI,IAAI;AAC3B,OAAI,OAAQ,QAAO;AAEnB,YAAS,IAAI;AACb,OAAI,cAAc,OAAO,CACvB,UAAS,OAAO,MAAM,QAAQ;AAE5B,QAAI,MAAM,IAAI,IAAI,CAChB,OAAM,IAAI,KAAK,IAAI;AAGrB,WAAO;KACP;AAEJ,SAAM,IAAI,KAAK,OAAO;AACtB,UAAO;;EAET,WAAW,KAAK;AACd,SAAM,OAAO,IAAI;;EAEnB,SAAY;AACV,UAAO;;EAEV"}
|
package/dist/bin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { existsSync } from \"node:fs\";\n\nasync function start() {\n const [configPath, outDir] = process.argv.slice(2);\n const isNext =\n existsSync(\"next.config.js\") ||\n existsSync(\"next.config.mjs\") ||\n existsSync(\"next.config.mts\") ||\n existsSync(\"next.config.ts\");\n\n if (isNext) {\n const { createStandaloneCore } = await import(\"./next\");\n const core = await createStandaloneCore({ configPath, outDir });\n await core.emit({ write: true });\n } else {\n const { createStandaloneCore } = await import(\"./vite\");\n const core = await createStandaloneCore({ configPath, outDir });\n await core.emit({ write: true });\n }\n}\n\nvoid start();\n"],"mappings":";;;AAIA,eAAe,QAAQ;CACrB,MAAM,CAAC,YAAY,UAAU,QAAQ,KAAK,MAAM,EAAE;AAOlD,KALE,WAAW,iBAAiB,IAC5B,WAAW,kBAAkB,IAC7B,WAAW,kBAAkB,IAC7B,WAAW,iBAAiB,EAElB;EACV,MAAM,EAAE,yBAAyB,MAAM,OAAO;AAE9C,SADa,MAAM,qBAAqB;GAAE;GAAY;GAAQ,CAAC,EACpD,KAAK,EAAE,OAAO,MAAM,CAAC;QAC3B;EACL,MAAM,EAAE,yBAAyB,MAAM,OAAO;AAE9C,SADa,MAAM,qBAAqB;GAAE;GAAY;GAAQ,CAAC,EACpD,KAAK,EAAE,OAAO,MAAM,CAAC;;;AAI/B,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-mdx-C8u32vDa.js","names":[],"sources":["../src/collections/mdx/remark-postprocess.ts","../src/utils/unified/pluggable.ts","../src/collections/mdx/build-mdx.ts"],"sourcesContent":["import type { Processor, Transformer } from \"unified\";\nimport type { Heading, Root, RootContent } from \"mdast\";\nimport { visit } from \"unist-util-visit\";\nimport { toMarkdown } from \"mdast-util-to-markdown\";\nimport { valueToEstree } from \"estree-util-value-to-estree\";\nimport { removePosition } from \"unist-util-remove-position\";\nimport { flattenNode } from \"@/utils/mdast/flatten\";\nimport { mdxToMarkdown } from \"mdast-util-mdx\";\n\nexport interface LinkReference {\n href: string;\n}\n\nexport interface PostprocessOptions {\n _format: \"md\" | \"mdx\";\n\n /**\n * Properties to export from `vfile.data`\n */\n valueToExport?: string[];\n\n /**\n * stringify MDAST and export via `_markdown`.\n */\n processedMarkdown?:\n | boolean\n | {\n as?: string;\n /**\n * include heading IDs into the processed markdown.\n */\n headingIds?: boolean;\n };\n\n /**\n * extract link references, export via `_linkReferences`.\n */\n linkReferences?:\n | boolean\n | {\n as?: string;\n };\n\n /**\n * store MDAST and export via `_mdast`.\n */\n mdast?:\n | boolean\n | {\n as?: string;\n removePosition?: boolean;\n };\n}\n\n/**\n * - collect references\n * - write frontmatter (auto-title & description)\n */\nexport function remarkPostprocess(\n this: Processor,\n {\n _format,\n processedMarkdown = false,\n mdast = false,\n linkReferences = false,\n valueToExport = [],\n }: PostprocessOptions,\n): Transformer<Root, Root> {\n return (tree, file) => {\n const frontmatter = (file.data.frontmatter ??= {});\n if (!frontmatter.title) {\n visit(tree, \"heading\", (node) => {\n if (node.depth === 1) {\n frontmatter.title = flattenNode(node);\n return false;\n }\n });\n }\n\n file.data[\"mdx-export\"] ??= [];\n file.data[\"mdx-export\"].push({\n name: \"frontmatter\",\n value: frontmatter,\n });\n\n if (linkReferences) {\n const { as = \"_linkReferences\" } = linkReferences === true ? {} : linkReferences;\n const urls: LinkReference[] = [];\n\n visit(tree, \"link\", (node) => {\n urls.push({\n href: node.url,\n });\n return \"skip\";\n });\n\n file.data[\"mdx-export\"].push({\n name: as,\n value: urls,\n });\n }\n\n if (processedMarkdown) {\n const { as = \"_markdown\", headingIds = true } =\n processedMarkdown === true ? {} : processedMarkdown;\n const extensions = this.data(\"toMarkdownExtensions\") ?? [];\n\n const markdown = toMarkdown(tree, {\n ...this.data(\"settings\"),\n extensions: _format === \"md\" ? [...extensions, mdxToMarkdown()] : extensions,\n handlers: {\n heading(node: Heading) {\n const id = node.data?.hProperties?.id;\n const content = flattenNode(node);\n return headingIds && id ? `${content} [#${id}]` : content;\n },\n },\n });\n\n file.data[\"mdx-export\"].push({\n name: as,\n value: markdown,\n });\n }\n\n if (mdast) {\n const { as = \"_mdast\", removePosition: shouldRemovePosition = false } =\n mdast === true ? {} : mdast;\n const stringified = JSON.stringify(\n shouldRemovePosition ? removePosition(structuredClone(tree)) : tree,\n );\n\n file.data[\"mdx-export\"].push({\n name: as,\n value: stringified,\n });\n }\n\n for (const { name, value } of file.data[\"mdx-export\"]) {\n tree.children.unshift(getMdastExport(name, value));\n }\n\n // reset the data to reduce memory usage\n file.data[\"mdx-export\"] = [];\n\n for (const name of valueToExport) {\n if (!(name in file.data)) continue;\n\n tree.children.unshift(getMdastExport(name, file.data[name]));\n }\n };\n}\n\n/**\n * MDX.js first converts javascript (with esm support) into mdast nodes with remark-mdx, then handle the other remark plugins\n *\n * Therefore, if we want to inject an export, we must convert the object into AST, then add the mdast node\n */\nfunction getMdastExport(name: string, value: unknown): RootContent {\n return {\n type: \"mdxjsEsm\",\n value: \"\",\n data: {\n estree: {\n type: \"Program\",\n sourceType: \"module\",\n body: [\n {\n type: \"ExportNamedDeclaration\",\n specifiers: [],\n attributes: [],\n source: null,\n declaration: {\n type: \"VariableDeclaration\",\n kind: \"let\",\n declarations: [\n {\n type: \"VariableDeclarator\",\n id: {\n type: \"Identifier\",\n name,\n },\n init: valueToEstree(value),\n },\n ],\n },\n },\n ],\n },\n },\n };\n}\n","import type { Pluggable, Plugin } from \"unified\";\n\nexport function pluggable<PluginParameters extends unknown[]>(\n plugin: Plugin<PluginParameters, any, any>,\n ...params: PluginParameters\n): Pluggable {\n return [plugin, ...params];\n}\n","import { createProcessor, type ProcessorOptions } from \"@mdx-js/mdx\";\nimport { VFile } from \"vfile\";\nimport { remarkPostprocess } from \"@/collections/mdx/remark-postprocess\";\nimport type { Core } from \"@/core\";\nimport { createCache } from \"@/utils/async-cache\";\nimport type { MDXContent } from \"mdx/types\";\nimport { MDXCollection } from \"../mdx\";\nimport type { PluggableList } from \"unified\";\nimport type { Awaitable } from \"@/types\";\nimport { pluggable } from \"@/utils/unified/pluggable\";\n\ntype MDXProcessor = ReturnType<typeof createProcessor>;\n\ninterface MDXCompilerContext {\n addDependency: (file: string) => void;\n collection: MDXCollection | undefined;\n core: Core;\n}\n\ninterface BuildMDXOptions {\n core: Core;\n collection: MDXCollection | undefined;\n /**\n * Specify a file path for source\n */\n filePath: string;\n source: string;\n frontmatter?: Record<string, unknown>;\n\n environment: \"bundler\" | \"runtime\";\n isDevelopment: boolean;\n compiler: MDXCompilerContext;\n}\n\nexport interface FumaContentProcessorOptions extends Omit<ProcessorOptions, \"remarkPlugins\"> {\n remarkPlugins?:\n | PluggableList\n | ((plugins: { preprocess: PluggableList; postprocess: PluggableList }) => PluggableList)\n | null\n | undefined;\n}\n\nexport interface FumaContentDataMap {\n /**\n * [Fuma Content] raw frontmatter, you can modify it\n */\n frontmatter?: Record<string, unknown>;\n\n /**\n * [Fuma Content] additional ESM exports to write\n */\n \"mdx-export\"?: { name: string; value: unknown }[];\n\n /**\n * [Fuma Content] The internal compiler info\n */\n _compiler?: MDXCompilerContext;\n\n /**\n * [Fuma Content] get internal processor, do not use this on user land.\n */\n _getProcessor?: (format: \"md\" | \"mdx\") => Awaitable<MDXProcessor>;\n}\n\ndeclare module \"vfile\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extend data map\n interface DataMap extends FumaContentDataMap {}\n}\n\nexport interface CompiledMDX<Frontmatter = Record<string, unknown>> extends Record<\n string,\n unknown\n> {\n frontmatter: Frontmatter;\n default: MDXContent;\n}\n\nexport async function buildMDX({\n core,\n collection,\n filePath,\n frontmatter,\n source,\n compiler,\n environment,\n isDevelopment,\n}: BuildMDXOptions): Promise<VFile> {\n const processorCache = createCache(core.cache).$value<MDXProcessor>();\n\n function getProcessor(format: \"md\" | \"mdx\") {\n const key = `build-mdx:${collection?.name ?? \"global\"}:${format}`;\n\n return processorCache.cached(key, async () => {\n const mdxOptions = await collection?.getMDXOptions?.(environment);\n const postprocess = [\n pluggable(remarkPostprocess, {\n _format: format,\n ...collection?.postprocess,\n }),\n ];\n\n return createProcessor({\n outputFormat: \"program\",\n development: isDevelopment,\n ...mdxOptions,\n remarkPlugins:\n typeof mdxOptions?.remarkPlugins === \"function\"\n ? mdxOptions.remarkPlugins({\n preprocess: [],\n postprocess,\n })\n : [...(mdxOptions?.remarkPlugins ?? []), ...postprocess],\n format,\n });\n });\n }\n\n let vfile = new VFile({\n value: source,\n path: filePath,\n cwd: core.getOptions().cwd,\n data: {\n frontmatter,\n _compiler: compiler,\n _getProcessor: getProcessor,\n },\n });\n\n if (collection && collection) {\n vfile = await collection.vfile.run(vfile, {\n collection,\n filePath,\n source,\n });\n }\n\n return (await getProcessor(filePath.endsWith(\".mdx\") ? \"mdx\" : \"md\")).process(vfile);\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0DA,SAAgB,kBAEd,EACE,SACA,oBAAoB,OACpB,QAAQ,OACR,iBAAiB,OACjB,gBAAgB,EAAE,IAEK;AACzB,SAAQ,MAAM,SAAS;EACrB,MAAM,cAAe,KAAK,KAAK,gBAAgB,EAAE;AACjD,MAAI,CAAC,YAAY,MACf,OAAM,MAAM,YAAY,SAAS;AAC/B,OAAI,KAAK,UAAU,GAAG;AACpB,gBAAY,QAAQ,YAAY,KAAK;AACrC,WAAO;;IAET;AAGJ,OAAK,KAAK,kBAAkB,EAAE;AAC9B,OAAK,KAAK,cAAc,KAAK;GAC3B,MAAM;GACN,OAAO;GACR,CAAC;AAEF,MAAI,gBAAgB;GAClB,MAAM,EAAE,KAAK,sBAAsB,mBAAmB,OAAO,EAAE,GAAG;GAClE,MAAM,OAAwB,EAAE;AAEhC,SAAM,MAAM,SAAS,SAAS;AAC5B,SAAK,KAAK,EACR,MAAM,KAAK,KACZ,CAAC;AACF,WAAO;KACP;AAEF,QAAK,KAAK,cAAc,KAAK;IAC3B,MAAM;IACN,OAAO;IACR,CAAC;;AAGJ,MAAI,mBAAmB;GACrB,MAAM,EAAE,KAAK,aAAa,aAAa,SACrC,sBAAsB,OAAO,EAAE,GAAG;GACpC,MAAM,aAAa,KAAK,KAAK,uBAAuB,IAAI,EAAE;GAE1D,MAAM,WAAW,WAAW,MAAM;IAChC,GAAG,KAAK,KAAK,WAAW;IACxB,YAAY,YAAY,OAAO,CAAC,GAAG,YAAY,eAAe,CAAC,GAAG;IAClE,UAAU,EACR,QAAQ,MAAe;KACrB,MAAM,KAAK,KAAK,MAAM,aAAa;KACnC,MAAM,UAAU,YAAY,KAAK;AACjC,YAAO,cAAc,KAAK,GAAG,QAAQ,KAAK,GA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SAAO,eAAe,OAAO,KAAK,YAAY;GAC5C,MAAM,aAAa,MAAM,YAAY,gBAAgB,YAAY;GACjE,MAAM,cAAc,CAClB,UAAU,mBAAmB;IAC3B,SAAS;IACT,GAAG,YAAY;IAChB,CAAC,CACH;AAED,UAAO,gBAAgB;IACrB,cAAc;IACd,aAAa;IACb,GAAG;IACH,eACE,OAAO,YAAY,kBAAkB,aACjC,WAAW,cAAc;KACvB,YAAY,EAAE;KACd;KACD,CAAC,GACF,CAAC,GAAI,YAAY,iBAAiB,EAAE,EAAG,GAAG,YAAY;IAC5D;IACD,CAAC;IACF;;CAGJ,IAAI,QAAQ,IAAI,MAAM;EACpB,OAAO;EACP,MAAM;EACN,KAAK,KAAK,YAAY,CAAC;EACvB,MAAM;GACJ;GACA,WAAW;GACX,eAAe;GAChB;EACF,CAAC;AAEF,KAAI,cAAc,WAChB,SAAQ,MAAM,WAAW,MAAM,IAAI,OAAO;EACxC;EACA;EACA;EACD,CAAC;AAGJ,SAAQ,MAAM,aAAa,SAAS,SAAS,OAAO,GAAG,QAAQ,KAAK,EAAE,QAAQ,MAAM"}
|
package/dist/bun/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/bun/index.ts"],"mappings":";;;;KAKY,UAAA,GAAa,IAAA,CAAK,WAAA;AAAA,iBAER,aAAA,CAAc,OAAA,GAAS,UAAA,GAAkB,OAAA,CAAQ,OAAA;AAAA,cAa1D,OAAA,SAAgB,IAAA;EAC3B,eAAA,CAAA,GAAmB,SAAA;AAAA"}
|
package/dist/bun/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/bun/index.ts"],"sourcesContent":["import type { BunPlugin } from \"bun\";\nimport { pathToFileURL } from \"node:url\";\nimport { type CoreOptions, Core } from \"@/core\";\nimport { loaderPlugin } from \"@/plugins/loader\";\n\nexport type BunOptions = Omit<CoreOptions, \"plugins\" | \"workspace\">;\n\nexport async function createContent(options: BunOptions = {}): Promise<BunCore> {\n const core = new BunCore({\n ...options,\n plugins: [loaderPlugin()],\n });\n const importPath = pathToFileURL(core.getOptions().configPath).href;\n\n await core.init({\n config: await import(importPath),\n });\n return core;\n}\n\nexport class BunCore extends Core {\n createBunPlugin(): BunPlugin {\n return {\n name: \"fuma-content\",\n setup: async (build) => {\n const ctx = this.getPluginContext();\n\n for (const plugin of this.getPlugins(true)) {\n const setup = plugin.bun?.setup;\n if (setup) await setup.call(ctx, build);\n }\n },\n };\n }\n}\n"],"mappings":";;;;AAOA,eAAsB,cAAc,UAAsB,EAAE,EAAoB;CAC9E,MAAM,OAAO,IAAI,QAAQ;EACvB,GAAG;EACH,SAAS,CAAC,cAAc,CAAC;EAC1B,CAAC;CACF,MAAM,aAAa,cAAc,KAAK,YAAY,CAAC,WAAW,CAAC;AAE/D,OAAM,KAAK,KAAK,EACd,QAAQ,MAAM,OAAO,aACtB,CAAC;AACF,QAAO;;AAGT,IAAa,UAAb,cAA6B,KAAK;CAChC,kBAA6B;AAC3B,SAAO;GACL,MAAM;GACN,OAAO,OAAO,UAAU;IACtB,MAAM,MAAM,KAAK,kBAAkB;AAEnC,SAAK,MAAM,UAAU,KAAK,WAAW,KAAK,EAAE;KAC1C,MAAM,QAAQ,OAAO,KAAK;AAC1B,SAAI,MAAO,OAAM,MAAM,KAAK,KAAK,MAAM;;;GAG5C"}
|
package/dist/bun-NahDFkhR.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bun-NahDFkhR.js","names":[],"sources":["../src/plugins/loader/bun.ts"],"sourcesContent":["import { parse } from \"node:querystring\";\nimport { readFileSync } from \"node:fs\";\nimport type { LoaderInput, Loader, LoaderOutput } from \"@/plugins/loader\";\nimport { isPromiseLike } from \"@/utils/is-promise-like\";\n\nexport function toBun(test: RegExp = /.+/, loader: Loader) {\n function toResult(output: LoaderOutput | null): Bun.OnLoadResult {\n // it errors, treat this as an exception\n if (!output) return;\n\n return {\n contents: output.code,\n loader: output.moduleType ?? \"js\",\n };\n }\n\n return (build: Bun.PluginBuilder): void => {\n // avoid using async here, because it will cause dynamic require() to fail\n build.onLoad({ filter: test }, (args) => {\n const [filePath, query = \"\"] = args.path.split(\"?\", 2);\n const input: LoaderInput = {\n async getSource() {\n return Bun.file(filePath).text();\n },\n query: parse(query),\n filePath,\n development: false,\n addDependency() {},\n };\n\n if (loader.bun?.load) {\n return loader.bun.load(readFileSync(filePath).toString(), input);\n }\n\n const result = loader.load(input);\n if (isPromiseLike(result)) {\n return result.then(toResult);\n }\n return toResult(result);\n });\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,MAAM,OAAe,MAAM,QAAgB;CACzD,SAAS,SAAS,QAA+C;AAE/D,MAAI,CAAC,OAAQ;AAEb,SAAO;GACL,UAAU,OAAO;GACjB,QAAQ,OAAO,cAAc;GAC9B;;AAGH,SAAQ,UAAmC;AAEzC,QAAM,OAAO,EAAE,QAAQ,MAAM,GAAG,SAAS;GACvC,MAAM,CAAC,UAAU,QAAQ,MAAM,KAAK,KAAK,MAAM,KAAK,EAAE;GACtD,MAAM,QAAqB;IACzB,MAAM,YAAY;AAChB,YAAO,IAAI,KAAK,SAAS,CAAC,MAAM;;IAElC,OAAO,MAAM,MAAM;IACnB;IACA,aAAa;IACb,gBAAgB;IACjB;AAED,OAAI,OAAO,KAAK,KACd,QAAO,OAAO,IAAI,KAAK,aAAa,SAAS,CAAC,UAAU,EAAE,MAAM;GAGlE,MAAM,SAAS,OAAO,KAAK,MAAM;AACjC,OAAI,cAAc,OAAO,CACvB,QAAO,OAAO,KAAK,SAAS;AAE9B,UAAO,SAAS,OAAO;IACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-generator-pLUE7Rk7.js","names":[],"sources":["../src/utils/code-generator.ts"],"sourcesContent":["import type { EmitConfig } from \"@/config\";\nimport path from \"node:path\";\nimport { URLSearchParams } from \"node:url\";\n\nexport interface CodeGeneratorOptions extends EmitConfig {\n outDir: string;\n}\n\ninterface ImportInfo {\n /**\n * import name -> member name\n */\n named?: Map<string, string>;\n namespaces?: Set<string>;\n /**\n * a set of import names, the import is type-only if its name is missing in this set.\n */\n isUsed?: Set<string>;\n}\n\n/**\n * Code generator (one instance per file)\n */\nexport class CodeGenerator {\n private readonly lines: string[] = [];\n // specifier -> imported members/info\n private readonly importInfos = new Map<string, ImportInfo>();\n private eagerImportId = 0;\n\n readonly options: CodeGeneratorOptions;\n constructor({ jsExtension = false, outDir = \"\" }: Partial<CodeGeneratorOptions>) {\n this.options = {\n jsExtension,\n outDir,\n };\n }\n\n addNamespaceImport(namespace: string, specifier: string, typeOnly = false) {\n const info = this.importInfos.get(specifier) ?? {};\n this.importInfos.set(specifier, info);\n if (!typeOnly) {\n info.isUsed ??= new Set();\n info.isUsed.add(namespace);\n }\n\n info.namespaces ??= new Set();\n info.namespaces.add(namespace);\n }\n\n addNamedImport(names: string[], specifier: string, typeOnly = false) {\n const info = this.importInfos.get(specifier) ?? {};\n this.importInfos.set(specifier, info);\n info.named ??= new Map();\n\n for (const name of names) {\n const [memberName, importName = memberName] = name.split(/\\s+as\\s+/, 2);\n info.named.set(importName, memberName);\n if (!typeOnly) {\n info.isUsed ??= new Set();\n info.isUsed.add(importName);\n }\n }\n }\n\n push(...insert: string[]) {\n this.lines.push(...insert);\n }\n\n async pushAsync(insert: Promise<string | undefined>[]) {\n for (const line of await Promise.all(insert)) {\n if (line === undefined) continue;\n\n this.lines.push(line);\n }\n }\n\n /** generate a random import name that is unique in file. */\n generateImportName(): string {\n return `__${this.eagerImportId++}`;\n }\n\n formatDynamicImport(specifier: string, mod?: string): string {\n let s = `import(\"${specifier}\")`;\n if (mod) s += `.then(mod => mod.${mod})`;\n return s;\n }\n\n formatQuery(query: Record<string, string | undefined>) {\n const params = new URLSearchParams();\n for (const k in query) {\n const value = query[k];\n if (typeof value === \"string\") params.set(k, value);\n }\n return params.toString();\n }\n\n formatImportPath(file: string) {\n const ext = path.extname(file);\n let filename: string;\n\n switch (ext) {\n case \".ts\":\n case \".tsx\":\n filename = file.substring(0, file.length - ext.length);\n if (this.options.jsExtension) filename += \".js\";\n break;\n default:\n filename = file;\n }\n\n const importPath = slash(path.relative(this.options.outDir, filename));\n return importPath.startsWith(\"../\") ? importPath : `./${importPath}`;\n }\n\n toString() {\n const final: string[] = [\"// @ts-nocheck\"];\n\n for (const [specifier, { namespaces, isUsed, named }] of this.importInfos) {\n if (namespaces)\n for (const namespace of namespaces) {\n final.push(\n isUsed?.has(namespace)\n ? `import * as ${namespace} from \"${specifier}\";`\n : `import type * as ${namespace} from \"${specifier}\";`,\n );\n }\n\n if (named && named.size > 0) {\n const namedImports: string[] = [];\n\n for (const [importName, memberName] of named) {\n const item = importName === memberName ? importName : `${memberName} as ${importName}`;\n\n namedImports.push(isUsed?.has(importName) ? item : `type ${item}`);\n }\n\n final.push(`import { ${namedImports.join(\", \")} } from \"${specifier}\";`);\n }\n }\n\n final.push(...this.lines);\n return final.join(\"\\n\");\n }\n}\n\nexport function slash(path: string): string {\n const isExtendedLengthPath = path.startsWith(\"\\\\\\\\?\\\\\");\n\n if (isExtendedLengthPath) {\n return path;\n }\n\n return path.replaceAll(\"\\\\\", \"/\");\n}\n\nexport function ident(code: string, tab: number = 1) {\n return code\n .split(\"\\n\")\n .map((v) => \" \".repeat(tab) + v)\n .join(\"\\n\");\n}\n"],"mappings":";;;;;;AAuBA,IAAa,gBAAb,MAA2B;CACzB,QAAmC,EAAE;CAErC,8BAA+B,IAAI,KAAyB;CAC5D,gBAAwB;CAExB;CACA,YAAY,EAAE,cAAc,OAAO,SAAS,MAAqC;AAC/E,OAAK,UAAU;GACb;GACA;GACD;;CAGH,mBAAmB,WAAmB,WAAmB,WAAW,OAAO;EACzE,MAAM,OAAO,KAAK,YAAY,IAAI,UAAU,IAAI,EAAE;AAClD,OAAK,YAAY,IAAI,WAAW,KAAK;AACrC,MAAI,CAAC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-1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":[],"sources":["../../../src/collections/data/runtime.ts"],"sourcesContent":["import type { GetCollectionConfig } from \"@/types\";\nimport { FileCollectionStore } from \"@/collections/runtime/file-store\";\nimport type { DataCollection } from \"@/collections/data\";\n\nexport function dataStore<Config, Name extends string>(\n _name: Name,\n base: string,\n input: Record<string, unknown>,\n): FileCollectionStore<{\n data: GetCollectionConfig<Config, Name> extends DataCollection\n ? GetCollectionConfig<Config, Name>[\"$inferOutput\"]\n : never;\n}> {\n type Data =\n GetCollectionConfig<Config, Name> extends DataCollection\n ? GetCollectionConfig<Config, Name>[\"$inferOutput\"]\n : never;\n const merged: Record<\n string,\n {\n data: Data;\n }\n > = {};\n\n for (const [key, value] of Object.entries(input)) {\n merged[key] = {\n data: value as Data,\n };\n }\n\n return new FileCollectionStore(base, merged);\n}\n"],"mappings":";;AAIA,SAAgB,UACd,OACA,MACA,OAKC;CAKD,MAAM,SAKF,EAAE;AAEN,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,QAAO,OAAO,EACZ,MAAM,OACP;AAGH,QAAO,IAAI,oBAAoB,MAAM,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","names":[],"sources":["../../src/collections/data.ts"],"mappings":";;;;;;UASiB,yBAAA;EACf,IAAA;EACA,MAAA;AAAA;AAAA,UAGQ,aAAA;EACR,IAAA;EACA,IAAA;EACA,MAAA,GAAS,MAAA,SAAe,YAAA;AAAA;AAAA,UAGT,oBAAA,gBAAoC,gBAAA,sBAAsC,IAAA,CACzF,0BAAA;EAGA,MAAA,GAAS,MAAA;;;;;;EAMT,OAAA,GAAU,aAAA;AAAA;AAAA,cAGC,cAAA,gBACI,gBAAA,eAA+B,gBAAA,sBACtC,oBAAA;EAAA;EACR,MAAA,GAAS,MAAA;EAhB0B;;;EAAA,SAoB1B,MAAA,EAAM,SAAA,UAAA,yBAAA;EACf,WAAA,EAAa,MAAA,SAAe,gBAAA,GAAmB,gBAAA,CAAiB,UAAA,CAAW,MAAA;EAE3E,YAAA,EAAc,MAAA,SAAe,gBAAA,GAAmB,gBAAA,CAAiB,WAAA,CAAY,MAAA;;IAG/D,GAAA;IAAK,KAAA;IAAO,OAAA,EAAS,cAAA;IAAqB;EAAA,GAAU,oBAAA,CAAqB,MAAA;AAAA;AAAA,iBA8DzE,cAAA,gBAA8B,gBAAA,yBAAA,CAC5C,MAAA,EAAQ,oBAAA,CAAqB,MAAA,IAAO,cAAA,CAAA,MAAA;AAAA,iBAKtB,UAAA,CAAA,GAAc,YAAA;AAAA,iBAuDd,UAAA,CAAA,GAAc,YAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","names":["#onEmitHandler"],"sources":["../../src/collections/data.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { Configuration } from \"webpack\";\nimport { LoaderConfig, loaderHook } from \"@/plugins/loader\";\nimport type { TurbopackLoaderOptions } from \"next/dist/server/config-shared\";\nimport { asyncPipe } from \"@/utils/pipe\";\nimport { slash } from \"@/utils/code-generator\";\nimport { FileSystemCollection, FileSystemCollectionConfig } from \"./fs\";\nimport path from \"node:path\";\n\nexport interface DataTransformationContext {\n path: string;\n source: string;\n}\n\ninterface LoadersConfig {\n json?: boolean;\n yaml?: boolean;\n custom?: Record<string, LoaderConfig>;\n}\n\nexport interface DataCollectionConfig<Schema extends StandardSchemaV1 | undefined> extends Omit<\n FileSystemCollectionConfig,\n \"supportedFormats\"\n> {\n schema?: Schema;\n /**\n * Configurations for loaders to parse data files.\n *\n * By default, JSON and YAML are enabled.\n * */\n loaders?: LoadersConfig;\n}\n\nexport class DataCollection<\n Schema extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined,\n> extends FileSystemCollection {\n schema?: Schema;\n /**\n * Transform data\n */\n readonly onLoad = asyncPipe<unknown, DataTransformationContext>();\n $inferInput: Schema extends StandardSchemaV1 ? StandardSchemaV1.InferInput<Schema> : unknown =\n undefined as never;\n $inferOutput: Schema extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<Schema> : unknown =\n undefined as never;\n\n constructor({ dir, files, loaders: _loadersConfig = {}, schema }: DataCollectionConfig<Schema>) {\n const loadersConfig: Record<string, LoaderConfig> = {\n ..._loadersConfig.custom,\n };\n if (_loadersConfig.json !== false) loadersConfig.json = jsonLoader();\n if (_loadersConfig.yaml !== false) loadersConfig.yaml = yamlLoader();\n\n super({ dir, files, supportedFormats: Object.keys(loadersConfig) });\n this.schema = schema;\n this.onServer.hook(({ core, server }) => {\n if (!server.watcher) return;\n\n server.watcher.on(\"all\", async (event, file) => {\n if (event === \"change\" || !this.hasFile(file)) return;\n\n await core.emit({\n filterCollection: (collection) => collection === this,\n filterWorkspace: () => false,\n write: true,\n });\n });\n });\n this.onEmit.pipe(this.#onEmitHandler.bind(this));\n this.pluginHook(loaderHook).loaders.push(...Object.values(loadersConfig));\n }\n\n #onEmitHandler: (typeof this)[\"onEmit\"][\"$inferHandler\"] = async (\n entries,\n { core, createCodeGenerator },\n ) => {\n entries.push(\n await createCodeGenerator(`${this.name}.ts`, async ({ codegen }) => {\n codegen.addNamedImport([\"dataStore\"], \"fuma-content/collections/data/runtime\");\n codegen.addNamespaceImport(\n \"Config\",\n codegen.formatImportPath(core.getOptions().configPath),\n true,\n );\n const base = slash(core._toRuntimePath(this.dir));\n let records = \"{\";\n const query = codegen.formatQuery({\n collection: this.name,\n workspace: core.getWorkspace()?.name,\n });\n\n for (const file of await this.getFiles()) {\n const fullPath = path.join(this.dir, file);\n const specifier = `${codegen.formatImportPath(fullPath)}?${query}`;\n const name = codegen.generateImportName();\n codegen.addNamedImport([`default as ${name}`], specifier);\n records += `\"${slash(file)}\": ${name},`;\n }\n records += \"}\";\n codegen.push(\n `export const ${this.name} = dataStore<typeof Config, \"${this.name}\">(\"${this.name}\", \"${base}\", ${records});`,\n );\n }),\n );\n return entries;\n };\n}\n\nexport function dataCollection<Schema extends StandardSchemaV1 | undefined = undefined>(\n config: DataCollectionConfig<Schema>,\n) {\n return new DataCollection(config);\n}\n\nexport function yamlLoader(): LoaderConfig {\n const test = /\\.yaml(\\?.+?)?$/;\n\n return {\n id: \"yaml\",\n test,\n configureNext(nextConfig) {\n const loaderPath = \"fuma-content/collections/yaml/loader-webpack\";\n const loaderOptions = this.getLoaderOptions();\n\n return {\n ...nextConfig,\n turbopack: {\n ...nextConfig.turbopack,\n rules: {\n ...nextConfig.turbopack?.rules,\n \"*.yaml\": {\n loaders: [\n {\n loader: loaderPath,\n options: loaderOptions as unknown as TurbopackLoaderOptions,\n },\n ],\n as: \"*.js\",\n },\n },\n },\n webpack(config: Configuration, options) {\n config.module ||= {};\n config.module.rules ||= [];\n config.module.rules.push({\n test,\n enforce: \"pre\",\n use: [\n {\n loader: loaderPath,\n options: loaderOptions,\n },\n ],\n });\n\n return nextConfig.webpack?.(config, options) ?? config;\n },\n };\n },\n async createLoader() {\n const { createYamlLoader } = await import(\"./yaml/loader\");\n const core = this.core;\n return createYamlLoader({\n getCore: () => core,\n });\n },\n };\n}\n\nexport function jsonLoader(): LoaderConfig {\n const test = /\\.json(\\?.+?)?$/;\n\n return {\n id: \"json\",\n test,\n configureNext(nextConfig) {\n const loaderPath = \"fuma-content/collections/json/loader-webpack\";\n const loaderOptions = this.getLoaderOptions();\n\n return {\n ...nextConfig,\n turbopack: {\n ...nextConfig.turbopack,\n rules: {\n ...nextConfig.turbopack?.rules,\n \"*.json\": {\n loaders: [\n {\n loader: loaderPath,\n options: loaderOptions as unknown as TurbopackLoaderOptions,\n },\n ],\n as: \"*.json\",\n },\n },\n },\n webpack(config: Configuration, options) {\n config.module ||= {};\n config.module.rules ||= [];\n config.module.rules.push({\n test,\n enforce: \"pre\",\n use: [\n {\n loader: loaderPath,\n options: loaderOptions,\n },\n ],\n });\n\n return nextConfig.webpack?.(config, options) ?? config;\n },\n };\n },\n async createLoader(environment) {\n const { createJsonLoader } = await import(\"./json/loader\");\n const core = this.core;\n return createJsonLoader(\n {\n getCore: () => core,\n },\n environment === \"vite\" ? \"json\" : \"js\",\n );\n },\n };\n}\n"],"mappings":";;;;;;AAiCA,IAAa,iBAAb,cAEU,qBAAqB;CAC7B;;;;CAIA,SAAkB,WAA+C;CACjE,cACE,KAAA;CACF,eACE,KAAA;CAEF,YAAY,EAAE,KAAK,OAAO,SAAS,iBAAiB,EAAE,EAAE,UAAwC;EAC9F,MAAM,gBAA8C,EAClD,GAAG,eAAe,QACnB;AACD,MAAI,eAAe,SAAS,MAAO,eAAc,OAAO,YAAY;AACpE,MAAI,eAAe,SAAS,MAAO,eAAc,OAAO,YAAY;AAEpE,QAAM;GAAE;GAAK;GAAO,kBAAkB,OAAO,KAAK,cAAc;GAAE,CAAC;AACnE,OAAK,SAAS;AACd,OAAK,SAAS,MAAM,EAAE,MAAM,aAAa;AACvC,OAAI,CAAC,OAAO,QAAS;AAErB,UAAO,QAAQ,GAAG,OAAO,OAAO,OAAO,SAAS;AAC9C,QAAI,UAAU,YAAY,CAAC,KAAK,QAAQ,KAAK,CAAE;AAE/C,UAAM,KAAK,KAAK;KACd,mBAAmB,eAAe,eAAe;KACjD,uBAAuB;KACvB,OAAO;KACR,CAAC;KACF;IACF;AACF,OAAK,OAAO,KAAK,MAAA,cAAoB,KAAK,KAAK,CAAC;AAChD,OAAK,WAAW,WAAW,CAAC,QAAQ,KAAK,GAAG,OAAO,OAAO,cAAc,CAAC;;CAG3E,iBAA2D,OACzD,SACA,EAAE,MAAM,0BACL;AACH,UAAQ,KACN,MAAM,oBAAoB,GAAG,KAAK,KAAK,MAAM,OAAO,EAAE,cAAc;AAClE,WAAQ,eAAe,CAAC,YAAY,EAAE,wCAAwC;AAC9E,WAAQ,mBACN,UACA,QAAQ,iBAAiB,KAAK,YAAY,CAAC,WAAW,EACtD,KACD;GACD,MAAM,OAAO,MAAM,KAAK,eAAe,KAAK,IAAI,CAAC;GACjD,IAAI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AAM,OAAO,KAAK;AAClB,UAAO,iBAAiB,EACtB,eAAe,MAChB,CAAC;;EAEL;;AAGH,SAAgB,aAA2B;CACzC,MAAM,OAAO;AAEb,QAAO;EACL,IAAI;EACJ;EACA,cAAc,YAAY;GACxB,MAAM,aAAa;GACnB,MAAM,gBAAgB,KAAK,kBAAkB;AAE7C,UAAO;IACL,GAAG;IACH,WAAW;KACT,GAAG,WAAW;KACd,OAAO;MACL,GAAG,WAAW,WAAW;MACzB,UAAU;OACR,SAAS,CACP;QACE,QAAQ;QACR,SAAS;QACV,CACF;OACD,IAAI;OACL;MACF;KACF;IACD,QAAQ,QAAuB,SAAS;AACtC,YAAO,WAAW,EAAE;AACpB,YAAO,OAAO,UAAU,EAAE;AAC1B,YAAO,OAAO,MAAM,KAAK;MACvB;MACA,SAAS;MACT,KAAK,CACH;OACE,QAAQ;OACR,SAAS;OACV,CACF;MACF,CAAC;AAEF,YAAO,WAAW,UAAU,QAAQ,QAAQ,IAAI;;IAEnD;;EAEH,MAAM,aAAa,aAAa;GAC9B,MAAM,EAAE,qBAAqB,MAAM,OAAO,yBAAA,MAAA,MAAA,EAAA,EAAA;GAC1C,MAAM,OAAO,KAAK;AAClB,UAAO,iBACL,EACE,eAAe,MAChB,EACD,gBAAgB,SAAS,SAAS,KACnC;;EAEJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","names":[],"sources":["../../src/collections/fs.ts"],"sourcesContent":["import picomatch from \"picomatch\";\nimport path from \"node:path\";\nimport { Collection } from \".\";\nimport { createCache } from \"@/utils/async-cache\";\n\nexport class FileSystemCollection extends Collection {\n private matcher: picomatch.Matcher | undefined;\n /**\n * content directory (absolute)\n */\n dir: string;\n private readonly filesCache = createCache<string[]>();\n /** the glob patterns to match files in collection, this doesn't take `supportedFormats` into account. */\n private readonly patterns: string[];\n readonly supportedFileFormats: string[] | undefined;\n\n constructor(config: FileSystemCollectionConfig) {\n super();\n const { files, supportedFormats } = config;\n this.dir = config.dir;\n this.patterns = files ?? [supportedFormats ? `**/*.{${supportedFormats.join(\",\")}}` : `**/*`];\n this.supportedFileFormats = supportedFormats;\n this.onInit.hook(({ core }) => {\n this.dir = path.resolve(core.getOptions().cwd, this.dir);\n });\n this.onServer.hook(({ server }) => {\n if (!server.watcher) return;\n server.watcher.add(this.dir);\n server.watcher.on(\"all\", (event, file) => {\n if (event === \"change\" || !this.hasFile(file)) return;\n this.filesCache.invalidate(\"\");\n });\n });\n }\n\n isFileSupported(filePath: string) {\n if (!this.supportedFileFormats) return true;\n return this.supportedFileFormats.some((format) => filePath.endsWith(`.${format}`));\n }\n\n /**\n * get all included files, relative to `dir`.\n *\n * the result is cached.\n */\n async getFiles() {\n return this.filesCache.cached(\"\", async () => {\n const { glob } = await import(\"tinyglobby\");\n\n const out = await glob(this.patterns, { cwd: this.dir });\n return out.filter((v) => this.isFileSupported(v));\n });\n }\n\n hasFile(filePath: string) {\n if (!this.isFileSupported(filePath)) return false;\n\n const relativePath = path.relative(this.dir, filePath);\n if (relativePath.startsWith(`..${path.sep}`)) return false;\n\n return (this.matcher ??= picomatch(this.patterns))(relativePath);\n }\n\n invalidateCache() {\n this.filesCache.invalidate(\"\");\n }\n}\n\nexport interface FileSystemCollectionConfig {\n /**\n * Directory to scan\n */\n dir: string;\n\n /**\n * what files to include/exclude (glob patterns)\n *\n * Include all files if not specified\n */\n files?: string[];\n\n /**\n * Restrict to a list of file extensions to include, e.g. `['js', 'ts']`.\n */\n supportedFormats?: string[];\n}\n\nexport function fileSystemCollection(config: FileSystemCollectionConfig) {\n return new FileSystemCollection(config);\n}\n"],"mappings":";;;;;AAKA,IAAa,uBAAb,cAA0C,WAAW;CACnD;;;;CAIA;CACA,aAA8B,aAAuB;;CAErD;CACA;CAEA,YAAY,QAAoC;AAC9C,SAAO;EACP,MAAM,EAAE,OAAO,qBAAqB;AACpC,OAAK,MAAM,OAAO;AAClB,OAAK,WAAW,SAAS,CAAC,mBAAmB,SAAS,iBAAiB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1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader-webpack.js","names":[],"sources":["../../../src/collections/json/loader-webpack.ts"],"sourcesContent":["import { createWebpackLoader } from \"@/plugins/loader/webpack\";\nimport { createJsonLoader } from \"./loader\";\n\nexport default createWebpackLoader((core) => createJsonLoader(core, \"json\"));\n"],"mappings":";;;;;AAGA,IAAA,yBAAe,qBAAqB,SAAS,iBAAiB,MAAM,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader-webpack.d.ts","names":[],"sources":["../../../src/collections/mdx/loader-webpack.ts"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader-webpack.js","names":[],"sources":["../../../src/collections/mdx/loader-webpack.ts"],"sourcesContent":["import { createMdxLoader } from \"@/collections/mdx/loader\";\nimport { createWebpackLoader } from \"@/plugins/loader/webpack\";\n\nexport default createWebpackLoader(createMdxLoader);\n"],"mappings":";;;;;AAGA,IAAA,yBAAe,oBAAoB,gBAAgB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","names":[],"sources":["../../../src/collections/mdx/react.ts"],"mappings":";;;;;;;;;;iBAkBgB,WAAA,uBAAA,CACd,KAAA,EAAO,mBAAA,CAAoB,WAAA,EAAa,QAAA,eACxC,QAAA,GAAW,IAAA,EAAM,WAAA,CAAY,WAAA,IAAe,QAAA,KAAa,SAAA,GACxD,SAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":[],"sources":["../../../src/collections/mdx/react.ts"],"sourcesContent":["import { ReactNode, lazy, createElement } from \"react\";\nimport { CompiledMDX } from \"./build-mdx\";\nimport { MDXStoreBrowserData } from \"./runtime-browser\";\nimport { isPromiseLike } from \"@/utils/is-promise-like\";\n\nconst renderMap = new Map<\n string,\n {\n renderJSX: () => ReactNode;\n forceOnDemand: boolean;\n }\n>();\n\n/**\n * Renders content (loaded lazily).\n *\n * It is recommended to use with `<Suspense />`.\n */\nexport function useRenderer<Frontmatter, Attached>(\n entry: MDXStoreBrowserData<Frontmatter, Attached> | undefined,\n renderFn: (data: CompiledMDX<Frontmatter> & Attached) => ReactNode,\n): ReactNode {\n if (!entry) return null;\n const renderKey = `${entry._store.storeId}:${entry.id}`;\n let renderInfo = renderMap.get(renderKey);\n\n if (!renderInfo) {\n const OnDemand = lazy(async () => {\n const loaded = await entry.preload();\n return { default: () => renderFn(loaded) };\n });\n\n renderInfo = {\n forceOnDemand: false,\n renderJSX() {\n const v = entry.preload();\n if (!isPromiseLike(v) && !this.forceOnDemand) {\n return renderFn(v);\n }\n\n // ensure it won't unmount React lazy during re-renders\n this.forceOnDemand = true;\n return createElement(OnDemand);\n },\n };\n renderMap.set(renderKey, renderInfo);\n }\n\n return renderInfo.renderJSX();\n}\n"],"mappings":";;;AAKA,MAAM,4BAAY,IAAI,KAMnB;;;;;;AAOH,SAAgB,YACd,OACA,UACW;AACX,KAAI,CAAC,MAAO,QAAO;CACnB,MAAM,YAAY,GAAG,MAAM,OAAO,QAAQ,GAAG,MAAM;CACnD,IAAI,aAAa,UAAU,IAAI,UAAU;AAEzC,KAAI,CAAC,YAAY;EACf,MAAM,WAAW,KAAK,YAAY;GAChC,MAAM,SAAS,MAAM,MAAM,SAAS;AACpC,UAAO,EAAE,eAAe,SAAS,OAAO,EAAE;IAC1C;AAEF,eAAa;GACX,eAAe;GACf,YAAY;IACV,MAAM,IAAI,MAAM,SAAS;AACzB,QAAI,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,cAC7B,QAAO,SAAS,EAAE;AAIpB,SAAK,gBAAgB;AACrB,WAAO,cAAc,SAAS;;GAEjC;AACD,YAAU,IAAI,WAAW,WAAW;;AAGtC,QAAO,WAAW,WAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-browser.js","names":[],"sources":["../../../src/collections/mdx/runtime-browser.ts"],"sourcesContent":["\"use client\";\n\nimport type { Awaitable, GetCollectionConfig } from \"@/types\";\nimport { MapCollectionStore } from \"@/collections/runtime/store\";\nimport { type AsyncCache, createCache } from \"@/utils/async-cache\";\nimport type { CompiledMDX } from \"@/collections/mdx/build-mdx\";\nimport type { MDXCollection } from \"../mdx\";\n\nexport interface MDXStoreBrowserData<Frontmatter, Attached = unknown> {\n id: string;\n preload: () => Awaitable<CompiledMDX<Frontmatter> & Attached>;\n _store: StoreContext;\n}\n\ninterface StoreContext {\n storeId: string;\n}\n\ninterface StoreData {\n preloaded: AsyncCache<CompiledMDX>;\n}\n\ntype GetFrontmatter<Config, Name extends string> =\n GetCollectionConfig<Config, Name> extends MDXCollection\n ? GetCollectionConfig<Config, Name>[\"$inferFrontmatter\"]\n : never;\n\nexport const _internal_data = new Map<string, StoreData>();\n\nexport function mdxStoreBrowser<Config, Name extends string, Attached>(\n name: Name,\n _input: Record<string, () => Promise<unknown>>,\n): MapCollectionStore<string, MDXStoreBrowserData<GetFrontmatter<Config, Name>, Attached>> {\n const input = _input as Record<\n string,\n () => Promise<CompiledMDX<GetFrontmatter<Config, Name>> & Attached>\n >;\n const merged = new Map<string, MDXStoreBrowserData<GetFrontmatter<Config, Name>, Attached>>();\n function getStoreData(): StoreData {\n let store = _internal_data.get(name);\n if (store) return store;\n\n store = {\n preloaded: createCache(),\n };\n _internal_data.set(name, store);\n return store;\n }\n\n const context: StoreContext = {\n storeId: name,\n };\n\n for (const [key, value] of Object.entries(input)) {\n merged.set(key, {\n id: key,\n preload() {\n return getStoreData()\n .preloaded.$value<CompiledMDX<GetFrontmatter<Config, Name>> & Attached>()\n .cached(key, value);\n },\n _store: context,\n });\n }\n\n return new MapCollectionStore(merged);\n}\n\nexport type { WithGit } from \"./runtime\";\n"],"mappings":";;;;AA2BA,MAAa,iCAAiB,IAAI,KAAwB;AAE1D,SAAgB,gBACd,MACA,QACyF;CACzF,MAAM,QAAQ;CAId,MAAM,yBAAS,IAAI,KAA0E;CAC7F,SAAS,eAA0B;EACjC,IAAI,QAAQ,eAAe,IAAI,KAAK;AACpC,MAAI,MAAO,QAAO;AAElB,UAAQ,EACN,WAAW,aAAa,EACzB;AACD,iBAAe,IAAI,MAAM,MAAM;AAC/B,SAAO;;CAGT,MAAM,UAAwB,EAC5B,SAAS,MACV;AAED,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,QAAO,IAAI,KAAK;EACd,IAAI;EACJ,UAAU;AACR,UAAO,cAAc,CAClB,UAAU,QAA8D,CACxE,OAAO,KAAK,MAAM;;EAEvB,QAAQ;EACT,CAAC;AAGJ,QAAO,IAAI,mBAAmB,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-dynamic.d.ts","names":[],"sources":["../../../src/collections/mdx/runtime-dynamic.ts"],"mappings":";;;;;;;UAYiB,mBAAA;EACf,EAAA;EACA,WAAA,EAAa,WAAA;EACb,OAAA,QAAe,OAAA,CAAQ,WAAA,CAAY,WAAA,IAAe,QAAA;AAAA;AAAA,KAK/C,cAAA,gCACH,mBAAA,CAAoB,MAAA,EAAQ,IAAA,UAAc,aAAA,GACtC,mBAAA,CAAoB,MAAA,EAAQ,IAAA;AAAA,iBAGZ,eAAA,uCAAA,CACpB,MAAA,EAAQ,MAAA,EACR,WAAA,EAAa,WAAA,EACb,IAAA,EAAM,IAAA,EACN,IAAA,UACA,YAAA,EAAc,MAAA,mBACd,UAAA,YACC,OAAA,CAAQ,mBAAA,CAAoB,mBAAA,CAAoB,cAAA,CAAe,MAAA,EAAQ,IAAA,GAAO,QAAA;AAAA,KAsDrE,UAAA,GAAa,UAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-dynamic.js","names":[],"sources":["../../../src/collections/mdx/runtime-dynamic.ts"],"sourcesContent":["import { buildMDX, type CompiledMDX } from \"@/collections/mdx/build-mdx\";\nimport { pathToFileURL } from \"node:url\";\nimport { fumaMatter } from \"@/collections/mdx/fuma-matter\";\nimport fs from \"node:fs/promises\";\nimport { type CoreOptions, Core } from \"@/core\";\nimport type { MDXContent } from \"mdx/types\";\nimport { FileCollectionStore } from \"@/collections/runtime/file-store\";\nimport type { GetCollectionConfig } from \"@/types\";\nimport { MDXCollection } from \"@/collections/mdx\";\nimport path from \"node:path\";\nimport { createCache } from \"@/utils/async-cache\";\n\nexport interface MDXStoreDynamicData<Frontmatter, Attached = unknown> {\n id: string;\n frontmatter: Frontmatter;\n compile: () => Promise<CompiledMDX<Frontmatter> & Attached>;\n}\n\nlet corePromise: Promise<Core>;\n\ntype GetFrontmatter<Config, Name extends string> =\n GetCollectionConfig<Config, Name> extends MDXCollection\n ? GetCollectionConfig<Config, Name>[\"$inferFrontmatter\"]\n : never;\n\nexport async function mdxStoreDynamic<Config, Name extends string, Attached>(\n config: Config,\n coreOptions: CoreOptions,\n name: Name,\n base: string,\n _frontmatter: Record<string, unknown>,\n jsxRuntime: unknown,\n): Promise<FileCollectionStore<MDXStoreDynamicData<GetFrontmatter<Config, Name>, Attached>>> {\n corePromise ??= (async () => {\n const core = new Core(coreOptions);\n await core.init({\n config: config as Record<string, unknown>,\n });\n return core;\n })();\n const core = await corePromise;\n const frontmatter = _frontmatter as Record<string, GetFrontmatter<Config, Name>>;\n const collection = core.getCollection(name);\n if (!collection || !(collection instanceof MDXCollection))\n throw new Error(\"invalid collection name\");\n\n const merged: Record<string, MDXStoreDynamicData<GetFrontmatter<Config, Name>, Attached>> = {};\n const cache = createCache<CompiledMDX<GetFrontmatter<Config, Name>> & Attached>();\n\n for (const [k, v] of Object.entries(frontmatter)) {\n merged[k] = {\n id: k,\n frontmatter: v,\n async compile() {\n return cache.cached(k, async () => {\n const filePath = path.join(base, k);\n let content = (await fs.readFile(filePath)).toString();\n content = fumaMatter(content).content;\n\n const compiled = await buildMDX({\n core,\n collection,\n filePath,\n source: content,\n frontmatter: v as unknown as Record<string, unknown>,\n isDevelopment: false,\n environment: \"runtime\",\n compiler: {\n collection,\n core,\n addDependency() {},\n },\n });\n\n return (await executeMdx(String(compiled.value), {\n baseUrl: pathToFileURL(filePath),\n jsxRuntime,\n })) as CompiledMDX<GetFrontmatter<Config, Name>> & Attached;\n });\n },\n };\n }\n\n return new FileCollectionStore(base, merged);\n}\n\nexport type MdxContent = MDXContent;\n\ninterface Options {\n scope?: Record<string, unknown>;\n baseUrl?: string | URL;\n jsxRuntime?: unknown;\n}\n\nconst AsyncFunction: new (...args: string[]) => (...args: unknown[]) => Promise<unknown> =\n Object.getPrototypeOf(executeMdx).constructor;\n\nasync function executeMdx(compiled: string, options: Options = {}) {\n const { opts: scopeOpts, ...scope } = options.scope ?? {};\n const fullScope = {\n opts: {\n ...(scopeOpts as object),\n ...(options.jsxRuntime as object),\n baseUrl: options.baseUrl,\n },\n ...scope,\n };\n\n const hydrateFn = new AsyncFunction(...Object.keys(fullScope), compiled);\n return (await hydrateFn.apply(hydrateFn, Object.values(fullScope))) as {\n default: MdxContent;\n };\n}\n\nexport type { WithGit } from \"./runtime\";\n"],"mappings":";;;;;;;;;;;AAkBA,IAAI;AAOJ,eAAsB,gBACpB,QACA,aACA,MACA,MACA,cACA,YAC2F;AAC3F,kBAAiB,YAAY;EAC3B,MAAM,OAAO,IAAI,KAAK,YAAY;AAClC,QAAM,KAAK,KAAK,EACN,QACT,CAAC;AACF,SAAO;KACL;CACJ,MAAM,OAAO,MAAM;CACnB,MAAM,cAAc;CACpB,MAAM,aAAa,KAAK,cAAc,KAAK;AAC3C,KAAI,CAAC,cAAc,EAAE,sBAAsB,eACzC,OAAM,IAAI,MAAM,0BAA0B;CAE5C,MAAM,SAAsF,EAAE;CAC9F,MAAM,QAAQ,aAAmE;AAEjF,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,YAAY,CAC9C,QAAO,KAAK;EACV,IAAI;EACJ,aAAa;EACb,MAAM,UAAU;AACd,UAAO,MAAM,OAAO,GAAG,YAAY;IACjC,MAAM,WAAW,KAAK,KAAK,MAAM,EAAE;IACnC,IAAI,WAAW,MAAM,GAAG,SAAS,SAAS,EAAE,UAAU;AACtD,cAAU,WAAW,QAAQ,CAAC;IAE9B,MAAM,WAAW,MAAM,SAAS;KAC9B;KACA;KACA;KACA,QAAQ;KACR,aAAa;KACb,eAAe;KACf,aAAa;KACb,UAAU;MACR;MACA;MACA,gBAAgB;MACjB;KACF,CAAC;AAEF,WAAQ,MAAM,WAAW,OAAO,SAAS,MAAM,EAAE;KAC/C,SAAS,cAAc,SAAS;KAChC;KACD,CAAC;KACF;;EAEL;AAGH,QAAO,IAAI,oBAAoB,MAAM,OAAO;;AAW9C,MAAM,gBACJ,OAAO,eAAe,WAAW,CAAC;AAEpC,eAAe,WAAW,UAAkB,UAAmB,EAAE,EAAE;CACjE,MAAM,EAAE,MAAM,WAAW,GAAG,UAAU,QAAQ,SAAS,EAAE;CACzD,MAAM,YAAY;EAChB,MAAM;GACJ,GAAI;GACJ,GAAI,QAAQ;GACZ,SAAS,QAAQ;GAClB;EACD,GAAG;EACJ;CAED,MAAM,YAAY,IAAI,cAAc,GAAG,OAAO,KAAK,UAAU,EAAE,SAAS;AACxE,QAAQ,MAAM,UAAU,MAAM,WAAW,OAAO,OAAO,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":[],"sources":["../../../src/collections/mdx/runtime.ts"],"sourcesContent":["import type { GetCollectionConfig } from \"@/types\";\nimport type { MDXCollection } from \"@/collections/mdx\";\nimport { FileCollectionStore } from \"@/collections/runtime/file-store\";\nimport type { LinkReference } from \"@/collections/mdx/remark-postprocess\";\nimport type { GitFileData } from \"@/plugins/git\";\nimport type { CompiledMDX } from \"@/collections/mdx/build-mdx\";\n\nexport interface MDXStoreData<Frontmatter, Attached = unknown> {\n id: string;\n compiled: CompiledMDX<Frontmatter> & Attached;\n}\n\ntype GetFrontmatter<Config, Name extends string> =\n GetCollectionConfig<Config, Name> extends MDXCollection\n ? GetCollectionConfig<Config, Name>[\"$inferFrontmatter\"]\n : never;\n\nexport function mdxStore<Config, Name extends string, Attached>(\n _name: Name,\n base: string,\n _input: Record<string, unknown>,\n): FileCollectionStore<MDXStoreData<GetFrontmatter<Config, Name>, Attached>> {\n const input = _input as Record<string, CompiledMDX<GetFrontmatter<Config, Name>> & Attached>;\n const merged: Record<string, MDXStoreData<GetFrontmatter<Config, Name>, Attached>> = {};\n\n for (const [key, value] of Object.entries(input)) {\n merged[key] = {\n id: key,\n compiled: value,\n };\n }\n\n return new FileCollectionStore(base, merged);\n}\n\nexport interface MDXStoreLazyData<Frontmatter, Attached> {\n id: string;\n frontmatter: Frontmatter;\n load: () => Promise<CompiledMDX<Frontmatter> & Attached>;\n}\n\nexport function mdxStoreLazy<Config, Name extends string, Attached>(\n _name: Name,\n base: string,\n _input: {\n head: Record<string, unknown>;\n body: Record<string, () => Promise<unknown>>;\n },\n): FileCollectionStore<MDXStoreLazyData<GetFrontmatter<Config, Name>, Attached>> {\n const input = _input as {\n head: Record<string, GetFrontmatter<Config, Name>>;\n body: Record<string, () => Promise<CompiledMDX<GetFrontmatter<Config, Name>> & Attached>>;\n };\n const merged: Record<string, MDXStoreLazyData<GetFrontmatter<Config, Name>, Attached>> = {};\n\n for (const [key, value] of Object.entries(input.head)) {\n merged[key] = {\n id: key,\n frontmatter: value,\n load: input.body[key],\n };\n }\n\n return new FileCollectionStore(base, merged);\n}\n\nexport type WithGit = GitFileData;\n"],"mappings":";;AAiBA,SAAgB,SACd,OACA,MACA,QAC2E;CAC3E,MAAM,QAAQ;CACd,MAAM,SAA+E,EAAE;AAEvF,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,QAAO,OAAO;EACZ,IAAI;EACJ,UAAU;EACX;AAGH,QAAO,IAAI,oBAAoB,MAAM,OAAO;;AAS9C,SAAgB,aACd,OACA,MACA,QAI+E;CAC/E,MAAM,QAAQ;CAId,MAAM,SAAmF,EAAE;AAE3F,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,KAAK,CACnD,QAAO,OAAO;EACZ,IAAI;EACJ,aAAa;EACb,MAAM,MAAM,KAAK;EAClB;AAGH,QAAO,IAAI,oBAAoB,MAAM,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.ts","names":[],"sources":["../../../src/collections/mdx/vue.vue"],"mappings":";;;;;cA0DM,YAAA,oCACL,WAAA,EAAa,WAAA,CAAY,OAAA,QAAe,WAAA,aACxC,SAAA,GAAY,mBAAA,CAAoB,IAAA,CAAK,WAAA,CAAY,OAAA,QAAe,WAAA,kCAChE,aAAA,GAAgB,WAAA,CAAY,OAAA,QAAe,WAAA,cAC3C,WAAA,GAAA,OAAA;SAD2B,GAAA,CAwEN,WAAA,GAAc,mBAAA;YAjE1B,mBAAA,CAAoB,WAAA,EAAa,QAAA;EAAA,aAiE0C,UAAA;IAAqB,oBAAA;EAAA,IAAkC,CAAA;WAClI,OAAA;;;cA7DE,KAAA;MAAS,IAAA,EAAM,WAAA,CAAY,WAAA,IAAe,QAAA;IAAA;EAAA;;OAXrD,GAAA,CA8EyB,KAAA;EAAU,KAAA,GAAQ,OAAA,QAAe,WAAA;AAAA;AAAA,cAAW,QAAA,SAC1C,YAAA;AAAA,KACvB,mBAAA,OAA0B,CAAA,6BAA8B,CAAA,GAAI,CAAA,CAAE,CAAA,oBAAsB,CAAA,IAAK,CAAA,GAAI,CAAA,CAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.js","names":[],"sources":["../../../src/collections/mdx/vue.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Frontmatter, Attached = unknown\">\nimport { defineAsyncComponent, computed, markRaw, ref } from \"vue\";\nimport type { Component } from \"vue\";\nimport type { CompiledMDX } from \"./build-mdx\";\nimport type { MDXStoreBrowserData } from \"./runtime-browser\";\nimport { isPromiseLike } from \"@/utils/is-promise-like\";\n\ndefineOptions({\n name: \"Renderer\",\n});\n\nconst props = defineProps<{\n entry?: MDXStoreBrowserData<Frontmatter, Attached>;\n}>();\n\nconst slots = defineSlots<{\n default: (scope: { data: CompiledMDX<Frontmatter> & Attached }) => any;\n}>();\nlet dynamicComponent: Component | null = null;\n\nif (props.entry) {\n const entry = props.entry;\n const forceAsync = ref(false);\n\n const asyncComponent = defineAsyncComponent(async () => {\n const loaded = await entry.preload();\n return markRaw({\n render: () => slots.default?.({ data: loaded }) ?? null,\n });\n });\n\n dynamicComponent = computed(() => {\n const v = entry.preload();\n\n if (!isPromiseLike(v) && !forceAsync.value) {\n return markRaw({\n render: () => slots.default({ data: v }),\n });\n }\n\n forceAsync.value = true;\n return asyncComponent;\n });\n}\n</script>\n\n<template>\n <component :is=\"dynamicComponent\" />\n</template>\n"],"mappings":";;;;;;;;EAWA,MAAM,QAAQ;EAId,MAAM,QAAQ,UAEV;EACJ,IAAI,mBAAqC;AAEzC,MAAI,MAAM,OAAO;GACf,MAAM,QAAQ,MAAM;GACpB,MAAM,aAAa,IAAI,MAAM;GAE7B,MAAM,iBAAiB,qBAAqB,YAAY;IACtD,MAAM,SAAS,MAAM,MAAM,SAAS;AACpC,WAAO,QAAQ,EACb,cAAc,MAAM,UAAU,EAAE,MAAM,QAAQ,CAAC,IAAI,MACpD,CAAC;KACF;AAEF,sBAAmB,eAAe;IAChC,MAAM,IAAI,MAAM,SAAS;AAEzB,QAAI,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,MACnC,QAAO,QAAQ,EACb,cAAc,MAAM,QAAQ,EAAE,MAAM,GAAG,CAAC,EACzC,CAAC;AAGJ,eAAW,QAAQ;AACnB,WAAO;KACP;;;uBAKF,YAAoC,wBAApB,MAAA,iBAAgB,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.js","names":["#mdxOptions","#mdxOptionsCache","#onFrontmatter","#onServerHandler","#onEmitHandler","#onGitHandler"],"sources":["../../src/collections/mdx.ts"],"sourcesContent":["import type { Collection } from \"@/collections\";\nimport type { PostprocessOptions } from \"@/collections/mdx/remark-postprocess\";\nimport type { Core, CoreOptions } from \"@/core\";\nimport type { VFile } from \"vfile\";\nimport type { TurbopackLoaderOptions } from \"next/dist/server/config-shared\";\nimport type { Configuration } from \"webpack\";\nimport { LoaderConfig, loaderHook } from \"@/plugins/loader\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { CodeGenerator, slash } from \"@/utils/code-generator\";\nimport { validate } from \"@/utils/validation\";\nimport type { Awaitable } from \"@/types\";\nimport { asyncPipe, pipe } from \"@/utils/pipe\";\nimport { FileSystemCollection, FileSystemCollectionConfig } from \"./fs\";\nimport { GitHook, gitHook } from \"@/plugins/git\";\nimport path from \"node:path\";\nimport type { FumaContentProcessorOptions } from \"@/collections/mdx/build-mdx\";\nimport { type AsyncCache, createCache } from \"@/utils/async-cache\";\n\ninterface CompilationContext {\n collection: Collection;\n filePath: string;\n source: string;\n}\n\nexport interface MDXCollectionConfig<\n FrontmatterSchema extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined,\n> extends Omit<FileSystemCollectionConfig, \"supportedFormats\"> {\n postprocess?: Partial<PostprocessOptions>;\n frontmatter?: FrontmatterSchema;\n options?:\n | FumaContentProcessorOptions\n | ((environment: \"bundler\" | \"runtime\") => Awaitable<FumaContentProcessorOptions>);\n lazy?: boolean;\n dynamic?: boolean;\n}\n\nconst RuntimePaths = {\n browser: \"fuma-content/collections/mdx/runtime-browser\",\n dynamic: \"fuma-content/collections/mdx/runtime-dynamic\",\n server: \"fuma-content/collections/mdx/runtime\",\n};\n\ninterface InitializerCode {\n fn: string;\n typeParams: [config: string, name: string, attached: string];\n params: string[];\n}\n\nfunction formatInitializer(code: InitializerCode) {\n return `${code.fn}<${code.typeParams.join()}>(${code.params.join()})`;\n}\n\nexport class MDXCollection<\n FrontmatterSchema extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined,\n> extends FileSystemCollection {\n readonly dynamic: boolean;\n readonly lazy: boolean;\n readonly postprocess?: Partial<PostprocessOptions>;\n\n #mdxOptions?: MDXCollectionConfig[\"options\"];\n #mdxOptionsCache?: AsyncCache<FumaContentProcessorOptions>;\n async getMDXOptions(environment: \"bundler\" | \"runtime\"): Promise<FumaContentProcessorOptions> {\n const options = this.#mdxOptions;\n if (!options) return {};\n if (typeof options !== \"function\") return options;\n\n this.#mdxOptionsCache ??= createCache();\n return this.#mdxOptionsCache.cached(environment, () => options(environment));\n }\n /**\n * Frontmatter schema\n */\n frontmatterSchema?: FrontmatterSchema;\n /**\n * Transform & validate frontmatter\n */\n frontmatter = asyncPipe<Record<string, unknown> | undefined, CompilationContext>();\n /**\n * Transform `vfile` on compilation stage\n */\n vfile = asyncPipe<VFile, CompilationContext>();\n /**\n * Transform the generated initializer code (TypeScript) for collection store\n */\n storeInitializer = pipe<\n InitializerCode,\n {\n codegen: CodeGenerator;\n environment: \"browser\" | \"server\" | \"dynamic\";\n }\n >();\n\n $inferFrontmatter: FrontmatterSchema extends StandardSchemaV1\n ? StandardSchemaV1.InferOutput<FrontmatterSchema>\n : Record<string, unknown> = undefined as never;\n\n constructor(config: MDXCollectionConfig<FrontmatterSchema>) {\n super({\n dir: config.dir,\n files: config.files,\n supportedFormats: [\"md\", \"mdx\"],\n });\n this.postprocess = config.postprocess;\n this.#mdxOptions = config.options;\n this.dynamic = config.dynamic ?? false;\n this.lazy = config.lazy ?? false;\n this.frontmatterSchema = config.frontmatter;\n this.frontmatter.pipe(this.#onFrontmatter.bind(this));\n this.onServer.hook(this.#onServerHandler.bind(this));\n this.onEmit.pipe(this.#onEmitHandler.bind(this));\n this.pluginHook(loaderHook).loaders.push(mdxLoader());\n this.pluginHook(gitHook).onClient.hook(this.#onGitHandler.bind(this));\n\n const { processedMarkdown, linkReferences, mdast } = this.postprocess ?? {};\n\n if (processedMarkdown) {\n const { as = \"_markdown\" } = processedMarkdown === true ? {} : processedMarkdown;\n\n this.storeInitializer.pipe((code) => {\n code.typeParams[2] += ` & { /** Processed Markdown */ ${as}: string; }`;\n return code;\n });\n }\n\n if (mdast) {\n const { as = \"_mdast\" } = mdast === true ? {} : mdast;\n\n this.storeInitializer.pipe((code) => {\n code.typeParams[2] += ` & { /** MDAST (as JSON string) */ ${as}: string; }`;\n return code;\n });\n }\n\n if (linkReferences) {\n const { as = \"_linkReferences\" } = linkReferences === true ? {} : linkReferences;\n\n this.storeInitializer.pipe((code, { codegen }) => {\n codegen.addNamedImport([\"LinkReference\"], \"fuma-content/collections/mdx\", true);\n code.typeParams[2] += ` & { /** extracted link references (e.g. hrefs, paths), useful for analyzing relationships between pages. */ ${as}: LinkReference[] }`;\n return code;\n });\n }\n }\n\n #onFrontmatter: (typeof this.frontmatter)[\"$inferHandler\"] = (data, { filePath }) => {\n if (!this.frontmatterSchema) return data;\n\n return validate(\n this.frontmatterSchema,\n data,\n undefined,\n `invalid frontmatter in ${filePath}`,\n ) as Promise<Record<string, unknown>>;\n };\n\n #onServerHandler: (typeof this.onServer)[\"$inferHandler\"] = ({ server, core }) => {\n if (!server.watcher) return;\n\n server.watcher.on(\"all\", async (event, file) => {\n if (event === \"change\" && !this.dynamic) return;\n if (!this.hasFile(file)) return;\n\n await core.emit({\n filterCollection: (item) => item === this,\n filterWorkspace: () => false,\n write: true,\n });\n });\n };\n\n #onEmitHandler: (typeof this.onEmit)[\"$inferHandler\"] = async (\n entries,\n { core, createCodeGenerator },\n ) => {\n entries.push(\n await createCodeGenerator(`${this.name}.ts`, async ({ codegen }) => {\n const runtimePath = RuntimePaths.server;\n const base = slash(core._toRuntimePath(this.dir));\n let code: InitializerCode;\n codegen.addNamespaceImport(\n \"Config\",\n codegen.formatImportPath(core.getOptions().configPath),\n true,\n );\n\n if (this.lazy) {\n codegen.addNamedImport([\"mdxStoreLazy\"], runtimePath);\n const headGlob = await this.generateDocCollectionFrontmatterGlob(core, codegen, true);\n const bodyGlob = await this.generateDocCollectionGlob(core, codegen);\n\n code = {\n fn: \"mdxStoreLazy\",\n typeParams: [\"typeof Config\", `\"${this.name}\"`, \"unknown\"],\n params: [`\"${this.name}\"`, `\"${base}\"`, `{ head: ${headGlob}, body: ${bodyGlob} }`],\n };\n } else {\n codegen.addNamedImport([\"mdxStore\"], runtimePath);\n code = {\n fn: \"mdxStore\",\n typeParams: [\"typeof Config\", `\"${this.name}\"`, \"unknown\"],\n params: [\n `\"${this.name}\"`,\n `\"${base}\"`,\n await this.generateDocCollectionGlob(core, codegen, true),\n ],\n };\n }\n\n code = this.storeInitializer.run(code, {\n codegen,\n environment: \"server\",\n });\n codegen.push(`export const ${this.name} = ${formatInitializer(code)};`);\n }),\n await createCodeGenerator(`${this.name}.browser.ts`, async ({ codegen }) => {\n const runtimePath = RuntimePaths.browser;\n codegen.addNamedImport([\"mdxStoreBrowser\"], runtimePath);\n codegen.addNamespaceImport(\n \"Config\",\n codegen.formatImportPath(core.getOptions().configPath),\n true,\n );\n\n let code: InitializerCode = {\n fn: `mdxStoreBrowser`,\n typeParams: [\"typeof Config\", `\"${this.name}\"`, \"unknown\"],\n params: [`\"${this.name}\"`, await this.generateDocCollectionGlob(core, codegen)],\n };\n code = this.storeInitializer.run(code, {\n codegen,\n environment: \"browser\",\n });\n codegen.push(`export const ${this.name} = ${formatInitializer(code)};`);\n }),\n );\n if (this.dynamic)\n entries.push(\n await createCodeGenerator(`${this.name}.dynamic.ts`, async ({ codegen }) => {\n const coreOptions = core.getOptions();\n const runtimePath = RuntimePaths.dynamic;\n const base = slash(core._toRuntimePath(this.dir));\n codegen.addNamespaceImport(\"Config\", codegen.formatImportPath(coreOptions.configPath));\n codegen.addNamedImport([\"mdxStoreDynamic\"], runtimePath);\n\n const serializableCoreOptions: CoreOptions = {\n configPath: core._toRuntimePath(coreOptions.configPath),\n outDir: core._toRuntimePath(coreOptions.outDir),\n cwd: core._toRuntimePath(coreOptions.cwd),\n };\n\n const jsxImportSource =\n (await this.getMDXOptions?.(\"runtime\"))?.jsxImportSource ?? \"react\";\n if (!jsxImportSource)\n throw new Error(\n `[Fuma Content] \"jsxImportSource\" is required for dynamic MDX collection \"${this.name}\".`,\n );\n codegen.addNamespaceImport(\"_jsx_runtime\", `${jsxImportSource}/jsx-runtime`);\n\n let code: InitializerCode = {\n fn: \"mdxStoreDynamic\",\n typeParams: [\"typeof Config\", `\"${this.name}\"`, \"unknown\"],\n params: [\n \"Config\",\n JSON.stringify(serializableCoreOptions),\n `\"${this.name}\"`,\n `\"${base}\"`,\n await this.generateDocCollectionFrontmatterGlob(core, codegen, true),\n \"_jsx_runtime\",\n ],\n };\n\n code = this.storeInitializer.run(code, {\n codegen,\n environment: \"dynamic\",\n });\n codegen.push(`export const ${this.name} = ${formatInitializer(code)};`);\n }),\n );\n return entries;\n };\n\n #onGitHandler: GitHook[\"onClient\"][\"$inferHandler\"] = async ({ client }) => {\n this.storeInitializer.pipe((code, { codegen, environment }) => {\n codegen.addNamedImport([\"WithGit\"], RuntimePaths[environment], true);\n code.typeParams[2] += \" & WithGit\";\n return code;\n });\n\n this.vfile.pipe(async (file) => {\n const vcData = await client.getFileData({ filePath: file.path });\n file.data[\"mdx-export\"] ??= [];\n file.data[\"mdx-export\"].push(\n {\n name: \"lastModified\",\n value: vcData.lastModified,\n },\n {\n name: \"creationDate\",\n value: vcData.creationDate,\n },\n );\n return file;\n });\n };\n\n private async generateDocCollectionFrontmatterGlob(\n core: Core,\n codegen: CodeGenerator,\n eager = false,\n ) {\n let s = `{`;\n const files = await this.getFiles();\n const query = codegen.formatQuery({\n collection: this.name,\n only: \"frontmatter\",\n workspace: core.getWorkspace()?.name,\n });\n for (const file of files) {\n const fullPath = path.join(this.dir, file);\n const specifier = `${codegen.formatImportPath(fullPath)}?${query}`;\n if (eager) {\n const name = codegen.generateImportName();\n codegen.addNamedImport([`frontmatter as ${name}`], specifier);\n s += `\"${slash(file)}\": ${name},`;\n } else {\n s += `\"${slash(file)}\": () => ${codegen.formatDynamicImport(specifier, \"frontmatter\")},`;\n }\n }\n s += \"}\";\n return s;\n }\n\n private async generateDocCollectionGlob(core: Core, codegen: CodeGenerator, eager = false) {\n let s = `{`;\n const files = await this.getFiles();\n const query = codegen.formatQuery({\n collection: this.name,\n workspace: core.getWorkspace()?.name,\n });\n for (const file of files) {\n const fullPath = path.join(this.dir, file);\n const specifier = `${codegen.formatImportPath(fullPath)}?${query}`;\n if (eager) {\n const name = codegen.generateImportName();\n codegen.addNamespaceImport(name, specifier);\n s += `\"${slash(file)}\": ${name},`;\n } else {\n s += `\"${slash(file)}\": () => ${codegen.formatDynamicImport(specifier)},`;\n }\n }\n s += \"}\";\n return s;\n }\n}\n\nexport function mdxCollection<FrontmatterSchema extends StandardSchemaV1 | undefined = undefined>(\n config: MDXCollectionConfig<FrontmatterSchema>,\n) {\n return new MDXCollection(config);\n}\n\nfunction mdxLoader(): LoaderConfig {\n const test = /\\.mdx?(\\?.+?)?$/;\n\n return {\n id: \"mdx\",\n test,\n configureNext(nextConfig) {\n const loaderPath = \"fuma-content/collections/mdx/loader-webpack\";\n const loaderOptions = this.getLoaderOptions();\n\n return {\n ...nextConfig,\n turbopack: {\n ...nextConfig.turbopack,\n rules: {\n ...nextConfig.turbopack?.rules,\n \"*.{md,mdx}\": {\n loaders: [\n {\n loader: loaderPath,\n options: loaderOptions as unknown as TurbopackLoaderOptions,\n },\n ],\n as: \"*.js\",\n },\n },\n },\n pageExtensions: [...(nextConfig.pageExtensions ?? [\"js\", \"jsx\", \"tsx\", \"ts\"]), \"mdx\", \"md\"],\n webpack(config: Configuration, options) {\n config.module ||= {};\n config.module.rules ||= [];\n config.module.rules.push({\n test,\n use: [\n options.defaultLoaders.babel,\n {\n loader: loaderPath,\n options: loaderOptions,\n },\n ],\n });\n\n return nextConfig.webpack?.(config, options) ?? config;\n },\n };\n },\n async createLoader() {\n const { createMdxLoader } = await import(\"./mdx/loader\");\n return createMdxLoader({\n getCore: () => this.core,\n });\n },\n };\n}\n\nexport type { LinkReference } from \"@/collections/mdx/remark-postprocess\";\nexport type { CompiledMDX } from \"@/collections/m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