fuma-content 1.1.4 → 1.2.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-DRmFaVGm.js → async-cache-C47yxLCv.js} +4 -3
- package/dist/async-cache-C47yxLCv.js.map +1 -0
- package/dist/bin.js +2 -3
- package/dist/bin.js.map +1 -1
- package/dist/build-mdx-C8u32vDa.js +158 -0
- package/dist/build-mdx-C8u32vDa.js.map +1 -0
- package/dist/bun/index.d.ts +1 -1
- package/dist/bun/index.js +2 -3
- package/dist/bun/index.js.map +1 -1
- package/dist/{bun-Be5pgXW_.js → bun-NahDFkhR.js} +3 -4
- package/dist/{bun-Be5pgXW_.js.map → bun-NahDFkhR.js.map} +1 -1
- package/dist/{code-generator-CHcOrCeM.js → code-generator-pLUE7Rk7.js} +2 -3
- package/dist/{code-generator-CHcOrCeM.js.map → code-generator-pLUE7Rk7.js.map} +1 -1
- package/dist/collections/data/runtime.d.ts +2 -3
- package/dist/collections/data/runtime.d.ts.map +1 -1
- package/dist/collections/data/runtime.js +1 -2
- package/dist/collections/data/runtime.js.map +1 -1
- package/dist/collections/data.d.ts +3 -4
- package/dist/collections/data.d.ts.map +1 -1
- package/dist/collections/data.js +5 -6
- package/dist/collections/data.js.map +1 -1
- package/dist/collections/fs.d.ts +2 -45
- package/dist/collections/fs.js +3 -4
- package/dist/collections/fs.js.map +1 -1
- package/dist/collections/index.d.ts +2 -37
- package/dist/collections/index.js +1 -37
- package/dist/collections/json/loader-webpack.d.ts +1 -3
- package/dist/collections/json/loader-webpack.js +4 -5
- package/dist/collections/json/loader-webpack.js.map +1 -1
- package/dist/collections/mdx/loader-webpack.d.ts +1 -3
- package/dist/collections/mdx/loader-webpack.js +4 -5
- package/dist/collections/mdx/loader-webpack.js.map +1 -1
- package/dist/collections/mdx/react.d.ts +2 -3
- package/dist/collections/mdx/react.d.ts.map +1 -1
- package/dist/collections/mdx/react.js +2 -3
- package/dist/collections/mdx/react.js.map +1 -1
- package/dist/collections/mdx/runtime-browser.d.ts +3 -25
- package/dist/collections/mdx/runtime-browser.js +2 -4
- package/dist/collections/mdx/runtime-browser.js.map +1 -1
- package/dist/collections/mdx/runtime-dynamic.d.ts +4 -5
- package/dist/collections/mdx/runtime-dynamic.d.ts.map +1 -1
- package/dist/collections/mdx/runtime-dynamic.js +9 -8
- package/dist/collections/mdx/runtime-dynamic.js.map +1 -1
- package/dist/collections/mdx/runtime.d.ts +2 -26
- package/dist/collections/mdx/runtime.js +1 -2
- package/dist/collections/mdx/runtime.js.map +1 -1
- package/dist/collections/mdx/vue.d.ts +27 -0
- package/dist/collections/mdx/vue.d.ts.map +1 -0
- package/dist/collections/mdx/vue.js +34 -0
- package/dist/collections/mdx/vue.js.map +1 -0
- package/dist/collections/mdx.d.ts +2 -66
- package/dist/collections/mdx.js +16 -10
- package/dist/collections/mdx.js.map +1 -1
- package/dist/collections/obsidian.d.ts +4 -5
- package/dist/collections/obsidian.d.ts.map +1 -1
- package/dist/collections/obsidian.js +169 -128
- package/dist/collections/obsidian.js.map +1 -1
- package/dist/collections/runtime/file-store.d.ts +2 -21
- package/dist/collections/runtime/file-store.js +1 -2
- package/dist/collections/runtime/file-store.js.map +1 -1
- package/dist/collections/runtime/store.d.ts +2 -31
- package/dist/collections/runtime/store.js +1 -1
- package/dist/collections/runtime/store.js.map +1 -1
- package/dist/collections/yaml/loader-webpack.d.ts +1 -3
- package/dist/collections/yaml/loader-webpack.js +4 -5
- package/dist/collections/yaml/loader-webpack.js.map +1 -1
- package/dist/{pipe-CvCqOpXX.js → collections-BuskUhft.js} +36 -4
- package/dist/collections-BuskUhft.js.map +1 -0
- package/dist/config/index.d.ts +2 -35
- package/dist/config/index.js +1 -1
- package/dist/{core-BuUsOElL.js → core-Buwp1MPi.js} +4 -5
- package/dist/{core-BuUsOElL.js.map → core-Buwp1MPi.js.map} +1 -1
- package/dist/{core-FjA_Xoho.d.ts → core-Cd_KERZa.d.ts} +65 -4
- package/dist/core-Cd_KERZa.d.ts.map +1 -0
- package/dist/dynamic-BaUDAMS6.d.ts +32 -0
- package/dist/dynamic-BaUDAMS6.d.ts.map +1 -0
- package/dist/dynamic.d.ts +2 -25
- package/dist/dynamic.js +2 -3
- package/dist/dynamic.js.map +1 -1
- package/dist/file-store-TyqUJE3V.d.ts +20 -0
- package/dist/file-store-TyqUJE3V.d.ts.map +1 -0
- package/dist/flatten-m0wfHxLH.js +10 -0
- package/dist/flatten-m0wfHxLH.js.map +1 -0
- package/dist/fs-BHzpv9Wl.d.ts +44 -0
- package/dist/fs-BHzpv9Wl.d.ts.map +1 -0
- package/dist/{fuma-matter-B4gT09gM.js → fuma-matter-E30PU53R.js} +2 -3
- package/dist/{fuma-matter-B4gT09gM.js.map → fuma-matter-E30PU53R.js.map} +1 -1
- package/dist/git-Kdo9j47k.d.ts +37 -0
- package/dist/git-Kdo9j47k.d.ts.map +1 -0
- package/dist/index-DZkwl_pd.d.ts +84 -0
- package/dist/index-DZkwl_pd.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -5
- package/dist/{is-promise-like-DYHv0Yap.js → is-promise-like-C04ERo2r.js} +2 -2
- package/dist/{is-promise-like-DYHv0Yap.js.map → is-promise-like-C04ERo2r.js.map} +1 -1
- package/dist/{load-from-file-BhdBOcQT.js → load-from-file-C3CnD8mJ.js} +3 -4
- package/dist/{load-from-file-BhdBOcQT.js.map → load-from-file-C3CnD8mJ.js.map} +1 -1
- package/dist/{loader-BT4fwLTJ.js → loader-CyhM9SLt.js} +8 -7
- package/dist/{loader-BT4fwLTJ.js.map → loader-CyhM9SLt.js.map} +1 -1
- package/dist/{loader-Cb9kSSxT.js → loader-D_sKOzDc.js} +4 -5
- package/dist/{loader-Cb9kSSxT.js.map → loader-D_sKOzDc.js.map} +1 -1
- package/dist/{loader-BOYLUNfh.js → loader-e2SkeDfY.js} +4 -5
- package/dist/{loader-BOYLUNfh.js.map → loader-e2SkeDfY.js.map} +1 -1
- package/dist/{loader-UhlX4xbz.js → loader-ol04zeoP.js} +3 -4
- package/dist/{loader-UhlX4xbz.js.map → loader-ol04zeoP.js.map} +1 -1
- package/dist/mdx-DY0zm9lN.d.ts +138 -0
- package/dist/mdx-DY0zm9lN.d.ts.map +1 -0
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +3 -4
- package/dist/next/index.js.map +1 -1
- package/dist/node/index.d.ts +0 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -2
- package/dist/node/index.js.map +1 -1
- package/dist/node/loader.d.ts +1 -1
- package/dist/node/loader.js +3 -4
- package/dist/node/loader.js.map +1 -1
- package/dist/{node-Cu5Pqxxo.js → node-Du4i4XDg.js} +2 -3
- package/dist/{node-Cu5Pqxxo.js.map → node-Du4i4XDg.js.map} +1 -1
- package/dist/plugins/git.d.ts +2 -38
- package/dist/plugins/git.js +3 -5
- package/dist/plugins/git.js.map +1 -1
- package/dist/plugins/json-schema.d.ts +1 -2
- package/dist/plugins/json-schema.d.ts.map +1 -1
- package/dist/plugins/json-schema.js +2 -3
- package/dist/plugins/json-schema.js.map +1 -1
- package/dist/plugins/loader/index.d.ts +2 -72
- package/dist/plugins/loader/index.js +6 -7
- package/dist/plugins/loader/index.js.map +1 -1
- package/dist/plugins/loader/webpack.d.ts +2 -21
- package/dist/plugins/loader/webpack.js +3 -4
- package/dist/plugins/loader/webpack.js.map +1 -1
- package/dist/plugins/remark/include.d.ts +23 -0
- package/dist/plugins/remark/include.d.ts.map +1 -0
- package/dist/plugins/remark/include.js +203 -0
- package/dist/plugins/remark/include.js.map +1 -0
- package/dist/rolldown-runtime-CiIaOW0V.js +13 -0
- package/dist/runtime-DiDP9Ajm.d.ts +25 -0
- package/dist/runtime-DiDP9Ajm.d.ts.map +1 -0
- package/dist/runtime-browser-a0rQ1BCJ.d.ts +29 -0
- package/dist/runtime-browser-a0rQ1BCJ.d.ts.map +1 -0
- package/dist/store-C3RuJOrY.d.ts +31 -0
- package/dist/store-C3RuJOrY.d.ts.map +1 -0
- package/dist/{validation-C3kXuveD.js → validation-Bf_v2L3p.js} +2 -2
- package/dist/{validation-C3kXuveD.js.map → validation-Bf_v2L3p.js.map} +1 -1
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +3 -4
- package/dist/vite/index.js.map +1 -1
- package/dist/{vite-CoJIMNWk.js → vite-DVIOnBqW.js} +2 -3
- package/dist/{vite-CoJIMNWk.js.map → vite-DVIOnBqW.js.map} +1 -1
- package/package.json +40 -59
- package/dist/async-cache-BVuJiIDT.d.ts +0 -9
- package/dist/async-cache-BVuJiIDT.d.ts.map +0 -1
- package/dist/async-cache-DRmFaVGm.js.map +0 -1
- package/dist/build-mdx-DRqbcE1d.d.ts +0 -79
- package/dist/build-mdx-DRqbcE1d.d.ts.map +0 -1
- package/dist/build-mdx-DgzggXIL.js +0 -387
- package/dist/build-mdx-DgzggXIL.js.map +0 -1
- package/dist/collections/fs.d.ts.map +0 -1
- package/dist/collections/index.d.ts.map +0 -1
- package/dist/collections/index.js.map +0 -1
- package/dist/collections/mdx/runtime-browser.d.ts.map +0 -1
- package/dist/collections/mdx/runtime.d.ts.map +0 -1
- package/dist/collections/mdx.d.ts.map +0 -1
- package/dist/collections/runtime/file-store.d.ts.map +0 -1
- package/dist/collections/runtime/store.d.ts.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/core-FjA_Xoho.d.ts.map +0 -1
- package/dist/dynamic.d.ts.map +0 -1
- package/dist/load-from-file-CIYdu-B5.d.ts +0 -10
- package/dist/load-from-file-CIYdu-B5.d.ts.map +0 -1
- package/dist/pipe-CvCqOpXX.js.map +0 -1
- package/dist/plugins/git.d.ts.map +0 -1
- package/dist/plugins/loader/index.d.ts.map +0 -1
- package/dist/plugins/loader/webpack.d.ts.map +0 -1
- package/dist/rolldown-runtime-CjeV3_4I.js +0 -18
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
import { EmitConfig, GlobalConfig } from "./config/index.js";
|
|
2
|
-
import { Collection } from "./collections/index.js";
|
|
3
1
|
import { LoadHook } from "node:module";
|
|
4
2
|
import { FSWatcher } from "chokidar";
|
|
5
3
|
import * as Vite from "vite";
|
|
6
4
|
import { NextConfig } from "next";
|
|
7
5
|
|
|
6
|
+
//#region src/config/index.d.ts
|
|
7
|
+
interface GlobalConfig<Collections extends Record<string, Collection> = Record<string, Collection>> {
|
|
8
|
+
plugins?: PluginOption$1[];
|
|
9
|
+
collections?: Collections;
|
|
10
|
+
workspaces?: Record<string, WorkspaceConfig>;
|
|
11
|
+
/**
|
|
12
|
+
* specify a directory to access & store cache (disabled during development mode).
|
|
13
|
+
*
|
|
14
|
+
* The cache will never be updated, delete the cache folder to clean.
|
|
15
|
+
*/
|
|
16
|
+
experimentalBuildCache?: string;
|
|
17
|
+
/**
|
|
18
|
+
* configure code generation
|
|
19
|
+
*/
|
|
20
|
+
emit?: EmitConfig;
|
|
21
|
+
}
|
|
22
|
+
interface EmitConfig {
|
|
23
|
+
/**
|
|
24
|
+
* add .js extenstion to imports
|
|
25
|
+
*/
|
|
26
|
+
jsExtension?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface WorkspaceConfig {
|
|
29
|
+
dir: string;
|
|
30
|
+
config: GlobalConfig | {
|
|
31
|
+
default: GlobalConfig;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare function defineConfig<Collections extends Record<string, Collection> = Record<string, Collection>>(config?: GlobalConfig<Collections>): GlobalConfig<Collections>;
|
|
35
|
+
//#endregion
|
|
8
36
|
//#region src/types.d.ts
|
|
9
37
|
type GetCollectionConfig<Config, Name extends string> = Config extends Record<Name, Collection> ? Config[Name] : Config extends {
|
|
10
38
|
default: GlobalConfig<infer Collections>;
|
|
@@ -59,6 +87,39 @@ interface AsyncPipe<Data, Context = undefined> {
|
|
|
59
87
|
declare function pipe<Data, Context>(steps?: ((data: Data, context: Context) => Data)[]): Pipe<Data, Context>;
|
|
60
88
|
declare function asyncPipe<Data, Context>(steps?: ((data: Data, context: Context) => Awaitable<Data>)[]): AsyncPipe<Data, Context>;
|
|
61
89
|
//#endregion
|
|
90
|
+
//#region src/collections/index.d.ts
|
|
91
|
+
interface CollectionHookContext {
|
|
92
|
+
core: Core;
|
|
93
|
+
collection: Collection;
|
|
94
|
+
}
|
|
95
|
+
declare class Collection {
|
|
96
|
+
private readonly pluginHooks;
|
|
97
|
+
name: string;
|
|
98
|
+
/**
|
|
99
|
+
* on config loaded/updated
|
|
100
|
+
*/
|
|
101
|
+
readonly onConfig: Hook<CollectionHookContext & {
|
|
102
|
+
config: ResolvedConfig;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Configure watch/dev server
|
|
106
|
+
*/
|
|
107
|
+
readonly onServer: Hook<CollectionHookContext & {
|
|
108
|
+
server: ServerContext;
|
|
109
|
+
}>;
|
|
110
|
+
readonly onInit: AsyncHook<CollectionHookContext>;
|
|
111
|
+
readonly onEmit: AsyncPipe<EmitEntry[], EmitContext>;
|
|
112
|
+
readonly plugins: PluginOption$1[];
|
|
113
|
+
pluginHook<T, Options>(hook: CollectionHook<T, Options>, options: Options): T;
|
|
114
|
+
pluginHook<T>(hook: CollectionHook<T>): T;
|
|
115
|
+
getPluginHook<T>(hook: CollectionHook<T>): T | undefined;
|
|
116
|
+
}
|
|
117
|
+
interface CollectionHook<T = unknown, Options = undefined> {
|
|
118
|
+
id: symbol;
|
|
119
|
+
create: (collection: Collection, options: Options) => T;
|
|
120
|
+
}
|
|
121
|
+
declare function defineCollectionHook<T, Options = undefined>(init: (collection: Collection, options: Options) => T): CollectionHook<T, Options>;
|
|
122
|
+
//#endregion
|
|
62
123
|
//#region src/utils/code-generator.d.ts
|
|
63
124
|
interface CodeGeneratorOptions extends EmitConfig {
|
|
64
125
|
outDir: string;
|
|
@@ -245,5 +306,5 @@ declare class Core {
|
|
|
245
306
|
private initConfig;
|
|
246
307
|
}
|
|
247
308
|
//#endregion
|
|
248
|
-
export {
|
|
249
|
-
//# sourceMappingURL=core-
|
|
309
|
+
export { WorkspaceConfig as A, Hook as C, GetCollectionConfig as D, Awaitable as E, EmitConfig as O, AsyncHook as S, hook as T, defineCollectionHook as _, EmitOptions as a, asyncPipe as b, PluginContext as c, ResolvedCoreOptions as d, ServerContext as f, CollectionHookContext as g, CollectionHook as h, EmitEntry as i, defineConfig as j, GlobalConfig as k, PluginOption$1 as l, Collection as m, CoreOptions as n, EmitOutput as o, CodeGenerator as p, EmitContext as r, Plugin as s, Core as t, ResolvedConfig as u, AsyncPipe as v, asyncHook as w, pipe as x, Pipe as y };
|
|
310
|
+
//# sourceMappingURL=core-Cd_KERZa.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-Cd_KERZa.d.ts","names":[],"sources":["../src/config/index.ts","../src/types.ts","../src/utils/hook.ts","../src/utils/pipe.ts","../src/collections/index.ts","../src/utils/code-generator.ts","../src/core.ts"],"mappings":";;;;;;UAGiB,YAAA,qBACK,MAAA,SAAe,UAAA,IAAc,MAAA,SAAe,UAAA;EAEhE,OAAA,GAAU,cAAA;EACV,WAAA,GAAc,WAAA;EACd,UAAA,GAAa,MAAA,SAAe,eAAA;EALb;;;;;EAYf,sBAAA;EAXiD;;;EAgBjD,IAAA,GAAO,UAAA;AAAA;AAAA,UAGQ,UAAA;EAHE;;;EAOjB,WAAA;AAAA;AAAA,UAGe,eAAA;EACf,GAAA;EACA,MAAA,EAAQ,YAAA;IAAiB,OAAA,EAAS,YAAA;EAAA;AAAA;AAAA,iBAGpB,YAAA,qBACM,MAAA,SAAe,UAAA,IAAc,MAAA,SAAe,UAAA,EAAA,CAChE,MAAA,GAAQ,YAAA,CAAa,WAAA,IAAoB,YAAA,CAAa,WAAA;;;KCjC5C,mBAAA,gCACV,MAAA,SAAe,MAAA,CAAO,IAAA,EAAM,UAAA,IACxB,MAAA,CAAO,IAAA,IACP,MAAA;EACI,OAAA,EAAS,YAAA;AAAA,IAEX,WAAA,CAAY,IAAA;AAAA,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sIV,aAAA,CAAA,GAAa,GAAA,SAAA,IAAA;EAGb,UAAA,CAAA,GAAU,mBAAA;EAGV,SAAA,CAAA,GAAa,cAAA;EJnP6B;;;EIyP1C,qBAAA,CAAA;EAGA,UAAA,CAAW,SAAA,aAAiB,MAAA;EAW5B,cAAA,CAAe,SAAA,aAAoB,UAAA;EASnC,aAAA,CAAc,IAAA,WAAe,UAAA;EAG7B,gBAAA,CAAA,GAAoB,aAAA;EAKd,UAAA,CAAW,MAAA,EAAQ,aAAA,GAAa,OAAA;EAehC,oBAAA,CAAA,GAAoB,OAAA;EAIpB,IAAA,CAAK,WAAA,GAAa,WAAA,GAAmB,OAAA,CAAQ,UAAA;EJtSpC;;;EIyWf,cAAA,CAAe,YAAA;EAAA,QAID,UAAA;AAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { t as Core } from "./core-Cd_KERZa.js";
|
|
2
|
+
|
|
3
|
+
//#region src/config/load-from-file.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* - `true`: compile the config before loading.
|
|
6
|
+
* - `false`: import the config directly (without compiling it).
|
|
7
|
+
* - `skip`: assume the config is already compiled.
|
|
8
|
+
*/
|
|
9
|
+
type CompileMode = boolean | "skip";
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/dynamic.d.ts
|
|
12
|
+
interface DynamicCore {
|
|
13
|
+
getCore(): Core | Promise<Core>;
|
|
14
|
+
}
|
|
15
|
+
declare function createDynamicCore({
|
|
16
|
+
core,
|
|
17
|
+
compileMode,
|
|
18
|
+
mode
|
|
19
|
+
}: {
|
|
20
|
+
/**
|
|
21
|
+
* core (not initialized)
|
|
22
|
+
*/
|
|
23
|
+
core: Core;
|
|
24
|
+
compileMode?: CompileMode;
|
|
25
|
+
/**
|
|
26
|
+
* In dev mode, the config file is dynamically re-loaded when it's updated.
|
|
27
|
+
*/
|
|
28
|
+
mode: "dev" | "production";
|
|
29
|
+
}): DynamicCore;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { createDynamicCore as n, DynamicCore as t };
|
|
32
|
+
//# sourceMappingURL=dynamic-BaUDAMS6.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-BaUDAMS6.d.ts","names":[],"sources":["../src/config/load-from-file.ts","../src/dynamic.ts"],"mappings":";;;;;AAQA;;;KAAY,WAAA;;;UCJK,WAAA;EACf,OAAA,IAAW,IAAA,GAAO,OAAA,CAAQ,IAAA;AAAA;AAAA,iBAGZ,iBAAA,CAAA;EACd,IAAA;EACA,WAAA;EACA;AAAA;EDHqB;;;ECQrB,IAAA,EAAM,IAAA;EACN,WAAA,GAAc,WAAA;EAbC;;;EAiBf,IAAA;AAAA,IACE,WAAA"}
|
package/dist/dynamic.d.ts
CHANGED
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/dynamic.d.ts
|
|
5
|
-
interface DynamicCore {
|
|
6
|
-
getCore(): Core | Promise<Core>;
|
|
7
|
-
}
|
|
8
|
-
declare function createDynamicCore({
|
|
9
|
-
core,
|
|
10
|
-
compileMode,
|
|
11
|
-
mode
|
|
12
|
-
}: {
|
|
13
|
-
/**
|
|
14
|
-
* core (not initialized)
|
|
15
|
-
*/
|
|
16
|
-
core: Core;
|
|
17
|
-
compileMode?: CompileMode;
|
|
18
|
-
/**
|
|
19
|
-
* In dev mode, the config file is dynamically re-loaded when it's updated.
|
|
20
|
-
*/
|
|
21
|
-
mode: "dev" | "production";
|
|
22
|
-
}): DynamicCore;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { DynamicCore, createDynamicCore };
|
|
25
|
-
//# sourceMappingURL=dynamic.d.ts.map
|
|
1
|
+
import { n as createDynamicCore, t as DynamicCore } from "./dynamic-BaUDAMS6.js";
|
|
2
|
+
export { DynamicCore, createDynamicCore };
|
package/dist/dynamic.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
|
-
|
|
3
2
|
//#region src/dynamic.ts
|
|
4
3
|
function createDynamicCore({ core, compileMode = true, mode }) {
|
|
5
4
|
let prev;
|
|
@@ -10,7 +9,7 @@ function createDynamicCore({ core, compileMode = true, mode }) {
|
|
|
10
9
|
})).mtime.getTime().toString();
|
|
11
10
|
}
|
|
12
11
|
async function init() {
|
|
13
|
-
const { loadConfig } = await import("./load-from-file-
|
|
12
|
+
const { loadConfig } = await import("./load-from-file-C3CnD8mJ.js").then((n) => n.n);
|
|
14
13
|
await core.init({ config: loadConfig(core, compileMode) });
|
|
15
14
|
}
|
|
16
15
|
return { async getCore() {
|
|
@@ -23,7 +22,7 @@ function createDynamicCore({ core, compileMode = true, mode }) {
|
|
|
23
22
|
return core;
|
|
24
23
|
} };
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
//#endregion
|
|
28
26
|
export { createDynamicCore };
|
|
27
|
+
|
|
29
28
|
//# sourceMappingURL=dynamic.js.map
|
package/dist/dynamic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic.js","names":[],"sources":["../src/dynamic.ts"],"sourcesContent":["import type { Core } from \"@/core\";\nimport fs from \"node:fs/promises\";\nimport type { CompileMode } from \"./config/load-from-file\";\n\nexport interface DynamicCore {\n getCore(): Core | Promise<Core>;\n}\n\nexport function createDynamicCore({\n core,\n compileMode = true,\n mode,\n}: {\n /**\n * core (not initialized)\n */\n core: Core;\n compileMode?: CompileMode;\n /**\n * In dev mode, the config file is dynamically re-loaded when it's updated.\n */\n mode: \"dev\" | \"production\";\n}): DynamicCore {\n let prev:\n | {\n hash: string;\n init: Promise<void>;\n }\n | undefined;\n\n async function getConfigHash(): Promise<string> {\n if (mode === \"production\") return \"static\";\n\n const stats = await fs.stat(core.getOptions().configPath).catch(() => {\n throw new Error(\"Cannot find config file\");\n });\n\n return stats.mtime.getTime().toString();\n }\n\n async function init() {\n const { loadConfig } = await import(\"./config/load-from-file\");\n await core.init({\n config: loadConfig(core, compileMode),\n });\n }\n\n return {\n async getCore() {\n const hash = await getConfigHash();\n if (!prev || hash !== prev.hash) {\n prev = {\n hash,\n init: init(),\n };\n }\n\n await prev.init;\n return core;\n },\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic.js","names":[],"sources":["../src/dynamic.ts"],"sourcesContent":["import type { Core } from \"@/core\";\nimport fs from \"node:fs/promises\";\nimport type { CompileMode } from \"./config/load-from-file\";\n\nexport interface DynamicCore {\n getCore(): Core | Promise<Core>;\n}\n\nexport function createDynamicCore({\n core,\n compileMode = true,\n mode,\n}: {\n /**\n * core (not initialized)\n */\n core: Core;\n compileMode?: CompileMode;\n /**\n * In dev mode, the config file is dynamically re-loaded when it's updated.\n */\n mode: \"dev\" | \"production\";\n}): DynamicCore {\n let prev:\n | {\n hash: string;\n init: Promise<void>;\n }\n | undefined;\n\n async function getConfigHash(): Promise<string> {\n if (mode === \"production\") return \"static\";\n\n const stats = await fs.stat(core.getOptions().configPath).catch(() => {\n throw new Error(\"Cannot find config file\");\n });\n\n return stats.mtime.getTime().toString();\n }\n\n async function init() {\n const { loadConfig } = await import(\"./config/load-from-file\");\n await core.init({\n config: loadConfig(core, compileMode),\n });\n }\n\n return {\n async getCore() {\n const hash = await getConfigHash();\n if (!prev || hash !== prev.hash) {\n prev = {\n hash,\n init: init(),\n };\n }\n\n await prev.init;\n return core;\n },\n };\n}\n"],"mappings":";;AAQA,SAAgB,kBAAkB,EAChC,MACA,cAAc,MACd,QAWc;CACd,IAAI;CAOJ,eAAe,gBAAiC;AAC9C,MAAI,SAAS,aAAc,QAAO;AAMlC,UAJc,MAAM,GAAG,KAAK,KAAK,YAAY,CAAC,WAAW,CAAC,YAAY;AACpE,SAAM,IAAI,MAAM,0BAA0B;IAC1C,EAEW,MAAM,SAAS,CAAC,UAAU;;CAGzC,eAAe,OAAO;EACpB,MAAM,EAAE,eAAe,MAAM,OAAO,gCAAA,MAAA,MAAA,EAAA,EAAA;AACpC,QAAM,KAAK,KAAK,EACd,QAAQ,WAAW,MAAM,YAAY,EACtC,CAAC;;AAGJ,QAAO,EACL,MAAM,UAAU;EACd,MAAM,OAAO,MAAM,eAAe;AAClC,MAAI,CAAC,QAAQ,SAAS,KAAK,KACzB,QAAO;GACL;GACA,MAAM,MAAM;GACb;AAGH,QAAM,KAAK;AACX,SAAO;IAEV"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { n as MapCollectionStore } from "./store-C3RuJOrY.js";
|
|
2
|
+
|
|
3
|
+
//#region src/collections/runtime/file-store.d.ts
|
|
4
|
+
interface FileInfo {
|
|
5
|
+
/**
|
|
6
|
+
* path relative to content directory
|
|
7
|
+
*/
|
|
8
|
+
path: string;
|
|
9
|
+
/**
|
|
10
|
+
* the full file path in file system
|
|
11
|
+
*/
|
|
12
|
+
fullPath: string;
|
|
13
|
+
}
|
|
14
|
+
declare class FileCollectionStore<V> extends MapCollectionStore<string, FileInfo & V> {
|
|
15
|
+
constructor(base: string, glob: Record<string, V>);
|
|
16
|
+
castData<T>(_cast: (input: FileInfo & V) => FileInfo & T): FileCollectionStore<T>;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { FileInfo as n, FileCollectionStore as t };
|
|
20
|
+
//# sourceMappingURL=file-store-TyqUJE3V.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-store-TyqUJE3V.d.ts","names":[],"sources":["../src/collections/runtime/file-store.ts"],"mappings":";;;UAGiB,QAAA;;AAAjB;;EAIE,IAAA;EAAA;;AAgBF;EAXE,QAAA;AAAA;AAAA,cAWW,mBAAA,YAA+B,kBAAA,SAA2B,QAAA,GAAW,CAAA;cACpE,IAAA,UAAc,IAAA,EAAM,MAAA,SAAe,CAAA;EAa/C,QAAA,GAAA,CAAY,KAAA,GAAQ,KAAA,EAAO,QAAA,GAAW,CAAA,KAAM,QAAA,GAAW,CAAA,GAAI,mBAAA,CAAoB,CAAA;AAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/utils/mdast/flatten.ts
|
|
2
|
+
function flattenNode(node) {
|
|
3
|
+
if ("children" in node) return node.children.map((child) => flattenNode(child)).join("");
|
|
4
|
+
if ("value" in node) return node.value;
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { flattenNode as t };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=flatten-m0wfHxLH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatten-m0wfHxLH.js","names":[],"sources":["../src/utils/mdast/flatten.ts"],"sourcesContent":["import type { RootContent } from \"mdast\";\n\nexport function flattenNode(node: RootContent): string {\n if (\"children\" in node) return node.children.map((child) => flattenNode(child)).join(\"\");\n\n if (\"value\" in node) return node.value;\n\n return \"\";\n}\n"],"mappings":";AAEA,SAAgB,YAAY,MAA2B;AACrD,KAAI,cAAc,KAAM,QAAO,KAAK,SAAS,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC,KAAK,GAAG;AAExF,KAAI,WAAW,KAAM,QAAO,KAAK;AAEjC,QAAO"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { m as Collection } from "./core-Cd_KERZa.js";
|
|
2
|
+
|
|
3
|
+
//#region src/collections/fs.d.ts
|
|
4
|
+
declare class FileSystemCollection extends Collection {
|
|
5
|
+
private matcher;
|
|
6
|
+
/**
|
|
7
|
+
* content directory (absolute)
|
|
8
|
+
*/
|
|
9
|
+
dir: string;
|
|
10
|
+
private readonly filesCache;
|
|
11
|
+
/** the glob patterns to match files in collection, this doesn't take `supportedFormats` into account. */
|
|
12
|
+
private readonly patterns;
|
|
13
|
+
readonly supportedFileFormats: string[] | undefined;
|
|
14
|
+
constructor(config: FileSystemCollectionConfig);
|
|
15
|
+
isFileSupported(filePath: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* get all included files, relative to `dir`.
|
|
18
|
+
*
|
|
19
|
+
* the result is cached.
|
|
20
|
+
*/
|
|
21
|
+
getFiles(): Promise<string[]>;
|
|
22
|
+
hasFile(filePath: string): boolean;
|
|
23
|
+
invalidateCache(): void;
|
|
24
|
+
}
|
|
25
|
+
interface FileSystemCollectionConfig {
|
|
26
|
+
/**
|
|
27
|
+
* Directory to scan
|
|
28
|
+
*/
|
|
29
|
+
dir: string;
|
|
30
|
+
/**
|
|
31
|
+
* what files to include/exclude (glob patterns)
|
|
32
|
+
*
|
|
33
|
+
* Include all files if not specified
|
|
34
|
+
*/
|
|
35
|
+
files?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Restrict to a list of file extensions to include, e.g. `['js', 'ts']`.
|
|
38
|
+
*/
|
|
39
|
+
supportedFormats?: string[];
|
|
40
|
+
}
|
|
41
|
+
declare function fileSystemCollection(config: FileSystemCollectionConfig): FileSystemCollection;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { FileSystemCollectionConfig as n, fileSystemCollection as r, FileSystemCollection as t };
|
|
44
|
+
//# sourceMappingURL=fs-BHzpv9Wl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-BHzpv9Wl.d.ts","names":[],"sources":["../src/collections/fs.ts"],"mappings":";;;cAKa,oBAAA,SAA6B,UAAA;EAAA,QAChC,OAAA;EADG;;;EAKX,GAAA;EAAA,iBACiB,UAAA;EANuB;EAAA,iBAQvB,QAAA;EAAA,SACR,oBAAA;cAEG,MAAA,EAAQ,0BAAA;EAmBpB,eAAA,CAAgB,QAAA;EAzBhB;;;;;EAmCM,QAAA,CAAA,GAAQ,OAAA;EASd,OAAA,CAAQ,QAAA;EASR,eAAA,CAAA;AAAA;AAAA,UAKe,0BAAA;EAvBD;;;EA2Bd,GAAA;EATe;;AAKjB;;;EAWE,KAAA;EAPA;;;EAYA,gBAAA;AAAA;AAAA,iBAGc,oBAAA,CAAqB,MAAA,EAAQ,0BAAA,GAA0B,oBAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { load } from "js-yaml";
|
|
2
|
-
|
|
3
2
|
//#region src/collections/mdx/fuma-matter.ts
|
|
4
3
|
/**
|
|
5
4
|
* Inspired by https://github.com/jonschlinkert/gray-matter
|
|
@@ -21,7 +20,7 @@ function fumaMatter(input) {
|
|
|
21
20
|
output.data = load(match[1]) ?? {};
|
|
22
21
|
return output;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
24
|
export { fumaMatter as t };
|
|
27
|
-
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=fuma-matter-E30PU53R.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fuma-matter-
|
|
1
|
+
{"version":3,"file":"fuma-matter-E30PU53R.js","names":[],"sources":["../src/collections/mdx/fuma-matter.ts"],"sourcesContent":["/**\n * Inspired by https://github.com/jonschlinkert/gray-matter\n */\nimport { load } from \"js-yaml\";\n\ninterface Output {\n /**\n * The matter section, including the delimiter.\n */\n matter: string;\n content: string;\n data: unknown;\n}\n\nconst regex = /^---\\r?\\n(.+?)\\r?\\n---\\r?\\n/s;\n\n/**\n * parse frontmatter, it supports only yaml format\n */\nexport function fumaMatter(input: string): Output {\n const output: Output = { matter: \"\", data: {}, content: input };\n const match = regex.exec(input);\n if (!match) {\n return output;\n }\n\n // get the raw front-matter block\n output.matter = match[0];\n output.content = input.slice(match[0].length);\n\n const loaded = load(match[1]);\n output.data = loaded ?? {};\n\n return output;\n}\n"],"mappings":";;;;;AAcA,MAAM,QAAQ;;;;AAKd,SAAgB,WAAW,OAAuB;CAChD,MAAM,SAAiB;EAAE,QAAQ;EAAI,MAAM,EAAE;EAAE,SAAS;EAAO;CAC/D,MAAM,QAAQ,MAAM,KAAK,MAAM;AAC/B,KAAI,CAAC,MACH,QAAO;AAIT,QAAO,SAAS,MAAM;AACtB,QAAO,UAAU,MAAM,MAAM,MAAM,GAAG,OAAO;AAG7C,QAAO,OADQ,KAAK,MAAM,GAAG,IACL,EAAE;AAE1B,QAAO"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { S as AsyncHook, h as CollectionHook, s as Plugin } from "./core-Cd_KERZa.js";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/git.d.ts
|
|
4
|
+
interface GitFileData {
|
|
5
|
+
/**
|
|
6
|
+
* Last modified date of file, obtained from version control.
|
|
7
|
+
*/
|
|
8
|
+
lastModified: Date | null;
|
|
9
|
+
/**
|
|
10
|
+
* Creation date of file, obtained from version control.
|
|
11
|
+
*/
|
|
12
|
+
creationDate: Date | null;
|
|
13
|
+
}
|
|
14
|
+
interface GitHook {
|
|
15
|
+
/**
|
|
16
|
+
* receive the client.
|
|
17
|
+
*/
|
|
18
|
+
onClient: AsyncHook<{
|
|
19
|
+
client: GitClient;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
declare const gitHook: CollectionHook<GitHook, undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Add version control integration for Git.
|
|
25
|
+
* 1. Injects `creationDate` & `lastModified` properties to page exports.
|
|
26
|
+
*
|
|
27
|
+
* @remarks If you are using Vercel, please set `VERCEL_DEEP_CLONE` environment variable to `true`. This ensures the client can access the full commit history of Git.
|
|
28
|
+
*/
|
|
29
|
+
declare function git(): Plugin;
|
|
30
|
+
interface GitClient {
|
|
31
|
+
getFileData: (options: {
|
|
32
|
+
filePath: string;
|
|
33
|
+
}) => Promise<GitFileData>;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { gitHook as a, git as i, GitFileData as n, GitHook as r, GitClient as t };
|
|
37
|
+
//# sourceMappingURL=git-Kdo9j47k.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-Kdo9j47k.d.ts","names":[],"sources":["../src/plugins/git.ts"],"mappings":";;;UAOiB,WAAA;EAAA;;;EAIf,YAAA,EAAc,IAAA;EAAd;;;EAIA,YAAA,EAAc,IAAA;AAAA;AAAA,UAGC,OAAA;EAAA;;;EAIf,QAAA,EAAU,SAAA;IAAY,MAAA,EAAQ,SAAA;EAAA;AAAA;AAAA,cAGnB,OAAA,EAAO,cAAA,CAAA,OAAA;;;AAApB;;;;iBAUwB,GAAA,CAAA,GAAO,MAAA;AAAA,UAed,SAAA;EACf,WAAA,GAAc,OAAA;IAAW,QAAA;EAAA,MAAuB,OAAA,CAAQ,WAAA;AAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { c as PluginContext, h as CollectionHook, s as Plugin } from "./core-Cd_KERZa.js";
|
|
2
|
+
import { t as DynamicCore } from "./dynamic-BaUDAMS6.js";
|
|
3
|
+
import { NextConfig } from "next";
|
|
4
|
+
import { LoaderContext } from "webpack";
|
|
5
|
+
|
|
6
|
+
//#region src/plugins/loader/webpack.d.ts
|
|
7
|
+
interface WebpackLoaderOptions {
|
|
8
|
+
absoluteCompiledConfigPath: string;
|
|
9
|
+
configPath: string;
|
|
10
|
+
outDir: string;
|
|
11
|
+
isDev: boolean;
|
|
12
|
+
}
|
|
13
|
+
type WebpackLoader = (this: LoaderContext<WebpackLoaderOptions>, source: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Note: need to handle the `test` regex in Webpack config instead.
|
|
16
|
+
*/
|
|
17
|
+
declare function createWebpackLoader(loaderFactory: (core: DynamicCore) => Loader): WebpackLoader;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/plugins/loader/index.d.ts
|
|
20
|
+
type Awaitable<T> = T | Promise<T>;
|
|
21
|
+
type LoaderEnvironment = "vite" | "bun" | "node";
|
|
22
|
+
interface Loader {
|
|
23
|
+
/**
|
|
24
|
+
* Transform input into JavaScript.
|
|
25
|
+
*
|
|
26
|
+
* Returns:
|
|
27
|
+
* - `LoaderOutput`: JavaScript code & source map.
|
|
28
|
+
* - `null`: skip the loader. Fallback to default behaviour if possible, otherwise the adapter will try workarounds.
|
|
29
|
+
*/
|
|
30
|
+
load: (input: LoaderInput) => Awaitable<LoaderOutput | null>;
|
|
31
|
+
bun?: {
|
|
32
|
+
/**
|
|
33
|
+
* 1. Bun doesn't allow `null` in loaders.
|
|
34
|
+
* 2. Bun requires sync result to support dynamic require().
|
|
35
|
+
*/
|
|
36
|
+
load?: (source: string, input: LoaderInput) => Awaitable<Bun.OnLoadResult>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
interface LoaderInput {
|
|
40
|
+
development: boolean;
|
|
41
|
+
filePath: string;
|
|
42
|
+
query: Record<string, string | string[] | undefined>;
|
|
43
|
+
getSource: () => string | Promise<string>;
|
|
44
|
+
addDependency: (file: string) => void;
|
|
45
|
+
}
|
|
46
|
+
interface LoaderOutput {
|
|
47
|
+
code: string;
|
|
48
|
+
map?: unknown;
|
|
49
|
+
/**
|
|
50
|
+
* only supported on Vite 8 at the moment, specify the output module type.
|
|
51
|
+
*
|
|
52
|
+
* on unsupported environments, it will be ignored.
|
|
53
|
+
*/
|
|
54
|
+
moduleType?: "js" | "json";
|
|
55
|
+
}
|
|
56
|
+
interface NextLoaderContext extends PluginContext {
|
|
57
|
+
getLoaderOptions: () => WebpackLoaderOptions;
|
|
58
|
+
}
|
|
59
|
+
interface LoaderConfig {
|
|
60
|
+
/** unique ID for loader, used to deduplicate loaders */
|
|
61
|
+
id?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Filter file paths, the input can be either a file URL or file path.
|
|
64
|
+
*
|
|
65
|
+
* Must take resource query into consideration.
|
|
66
|
+
*/
|
|
67
|
+
test?: RegExp;
|
|
68
|
+
/**
|
|
69
|
+
* @remarks it doesn't configure automatically for Next.js, you have to define the webpack/turbopack config in `configureNext()`.
|
|
70
|
+
*/
|
|
71
|
+
createLoader: (this: PluginContext, environment: LoaderEnvironment) => Promise<Loader>;
|
|
72
|
+
configureNext?: (this: NextLoaderContext, next: NextConfig) => NextConfig;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* a light layer for implementing loaders.
|
|
76
|
+
*/
|
|
77
|
+
declare function loaderPlugin(): Plugin;
|
|
78
|
+
interface LoaderHook {
|
|
79
|
+
loaders: LoaderConfig[];
|
|
80
|
+
}
|
|
81
|
+
declare const loaderHook: CollectionHook<LoaderHook, undefined>;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { LoaderOutput as a, WebpackLoader as c, LoaderInput as i, WebpackLoaderOptions as l, LoaderConfig as n, loaderHook as o, LoaderHook as r, loaderPlugin as s, Loader as t, createWebpackLoader as u };
|
|
84
|
+
//# sourceMappingURL=index-DZkwl_pd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DZkwl_pd.d.ts","names":[],"sources":["../src/plugins/loader/webpack.ts","../src/plugins/loader/index.ts"],"mappings":";;;;;;UAQiB,oBAAA;EACf,0BAAA;EACA,UAAA;EACA,MAAA;EACA,KAAA;AAAA;AAAA,KAGU,aAAA,IAAiB,IAAA,EAAM,aAAA,CAAc,oBAAA,GAAuB,MAAA;;;;iBAqBxD,mBAAA,CAAoB,aAAA,GAAgB,IAAA,EAAM,WAAA,KAAgB,MAAA,GAAS,aAAA;;;KC7B9E,SAAA,MAAe,CAAA,GAAI,OAAA,CAAQ,CAAA;AAAA,KAE3B,iBAAA;AAAA,UAEY,MAAA;EDHA;;;;;;;ECWf,IAAA,GAAO,KAAA,EAAO,WAAA,KAAgB,SAAA,CAAU,YAAA;EAExC,GAAA;IDTK;AAGP;;;ICWI,IAAA,IAAQ,MAAA,UAAgB,KAAA,EAAO,WAAA,KAAgB,SAAA,CAAU,GAAA,CAAI,YAAA;EAAA;AAAA;AAAA,UAIhD,WAAA;EACf,WAAA;EAEA,QAAA;EACA,KAAA,EAAO,MAAA;EACP,SAAA,iBAA0B,OAAA;EAC1B,aAAA,GAAgB,IAAA;AAAA;AAAA,UAGD,YAAA;EACf,IAAA;EACA,GAAA;EDL8F;;;;;ECY9F,UAAA;AAAA;AAAA,UAGQ,iBAAA,SAA0B,aAAA;EAClC,gBAAA,QAAwB,oBAAA;AAAA;AAAA,UAGT,YAAA;;EAEf,EAAA;EAlDY;;;;;EAyDZ,IAAA,GAAO,MAAA;EAzDsB;;;EA8D7B,YAAA,GAAe,IAAA,EAAM,aAAA,EAAe,WAAA,EAAa,iBAAA,KAAsB,OAAA,CAAQ,MAAA;EAC/E,aAAA,IAAiB,IAAA,EAAM,iBAAA,EAAmB,IAAA,EAAM,UAAA,KAAe,UAAA;AAAA;;AA/DhC;;iBA2EjB,YAAA,CAAA,GAAgB,MAAA;AAAA,UAsFf,UAAA;EACf,OAAA,EAAS,YAAA;AAAA;AAAA,cAGE,UAAA,EAAU,cAAA,CAAA,UAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as GetCollectionConfig,
|
|
1
|
+
import { C as Hook, D as GetCollectionConfig, S as AsyncHook, T as hook, a as EmitOptions, b as asyncPipe, c as PluginContext, d as ResolvedCoreOptions, f as ServerContext, i as EmitEntry, l as PluginOption, n as CoreOptions, o as EmitOutput, r as EmitContext, s as Plugin, t as Core, u as ResolvedConfig, v as AsyncPipe, w as asyncHook, x as pipe, y as Pipe } from "./core-Cd_KERZa.js";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/validation.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Core } from "./core-
|
|
3
|
-
import { n as getJSONSchema, r as validate, t as ValidationError } from "./validation-
|
|
4
|
-
|
|
5
|
-
export { Core, ValidationError, asyncHook, asyncPipe, getJSONSchema, hook, pipe, validate };
|
|
1
|
+
import { a as asyncHook, i as pipe, o as hook, r as asyncPipe } from "./collections-BuskUhft.js";
|
|
2
|
+
import { t as Core } from "./core-Buwp1MPi.js";
|
|
3
|
+
import { n as getJSONSchema, r as validate, t as ValidationError } from "./validation-Bf_v2L3p.js";
|
|
4
|
+
export { Core, ValidationError, asyncHook, asyncPipe, getJSONSchema, hook, pipe, validate };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function isPromiseLike(v) {
|
|
3
3
|
return typeof v === "object" && v !== null && "then" in v && typeof v.then === "function";
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
//#endregion
|
|
7
6
|
export { isPromiseLike as t };
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=is-promise-like-C04ERo2r.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-promise-like-
|
|
1
|
+
{"version":3,"file":"is-promise-like-C04ERo2r.js","names":[],"sources":["../src/utils/is-promise-like.ts"],"sourcesContent":["export function isPromiseLike(v: unknown): v is PromiseLike<unknown> {\n return typeof v === \"object\" && v !== null && \"then\" in v && typeof v.then === \"function\";\n}\n"],"mappings":";AAAA,SAAgB,cAAc,GAAuC;AACnE,QAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,UAAU,KAAK,OAAO,EAAE,SAAS"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
|
-
|
|
4
3
|
//#region src/config/load-from-file.ts
|
|
5
4
|
var load_from_file_exports = /* @__PURE__ */ __exportAll({ loadConfig: () => loadConfig });
|
|
6
5
|
async function compileConfig(core) {
|
|
@@ -31,7 +30,7 @@ async function loadConfig(core, compileMode) {
|
|
|
31
30
|
url.searchParams.set("hash", Date.now().toString());
|
|
32
31
|
return import(url.href);
|
|
33
32
|
}
|
|
34
|
-
|
|
35
33
|
//#endregion
|
|
36
34
|
export { load_from_file_exports as n, loadConfig as t };
|
|
37
|
-
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=load-from-file-C3CnD8mJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-from-file-
|
|
1
|
+
{"version":3,"file":"load-from-file-C3CnD8mJ.js","names":[],"sources":["../src/config/load-from-file.ts"],"sourcesContent":["import { pathToFileURL } from \"node:url\";\nimport type { Core } from \"@/core\";\n\n/**\n * - `true`: compile the config before loading.\n * - `false`: import the config directly (without compiling it).\n * - `skip`: assume the config is already compiled.\n */\nexport type CompileMode = boolean | \"skip\";\n\nasync function compileConfig(core: Core) {\n const { build } = await import(\"esbuild\");\n const { configPath, outDir } = core.getOptions();\n\n const transformed = await build({\n entryPoints: [{ in: configPath, out: \"content.config\" }],\n bundle: true,\n outdir: outDir,\n target: \"node22\",\n write: true,\n platform: \"node\",\n format: \"esm\",\n packages: \"external\",\n outExtension: {\n \".js\": \".mjs\",\n },\n allowOverwrite: true,\n });\n\n if (transformed.errors.length > 0) {\n throw new Error(\"failed to compile configuration file\");\n }\n}\n\n/**\n * Load config\n */\nexport async function loadConfig(\n core: Core,\n compileMode: CompileMode,\n): Promise<Record<string, unknown>> {\n if (compileMode === true) await compileConfig(core);\n\n const url =\n compileMode === false\n ? pathToFileURL(core.getOptions().configPath)\n : pathToFileURL(core.getCompiledConfigPath());\n // always return a new config\n url.searchParams.set(\"hash\", Date.now().toString());\n\n return import(url.href);\n}\n"],"mappings":";;;;AAUA,eAAe,cAAc,MAAY;CACvC,MAAM,EAAE,UAAU,MAAM,OAAO;CAC/B,MAAM,EAAE,YAAY,WAAW,KAAK,YAAY;AAiBhD,MAfoB,MAAM,MAAM;EAC9B,aAAa,CAAC;GAAE,IAAI;GAAY,KAAK;GAAkB,CAAC;EACxD,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,UAAU;EACV,QAAQ;EACR,UAAU;EACV,cAAc,EACZ,OAAO,QACR;EACD,gBAAgB;EACjB,CAAC,EAEc,OAAO,SAAS,EAC9B,OAAM,IAAI,MAAM,uCAAuC;;;;;AAO3D,eAAsB,WACpB,MACA,aACkC;AAClC,KAAI,gBAAgB,KAAM,OAAM,cAAc,KAAK;CAEnD,MAAM,MACJ,gBAAgB,QACZ,cAAc,KAAK,YAAY,CAAC,WAAW,GAC3C,cAAc,KAAK,uBAAuB,CAAC;AAEjD,KAAI,aAAa,IAAI,QAAQ,KAAK,KAAK,CAAC,UAAU,CAAC;AAEnD,QAAO,OAAO,IAAI"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
2
|
import { MDXCollection } from "./collections/mdx.js";
|
|
3
|
-
import { t as fumaMatter } from "./fuma-matter-
|
|
3
|
+
import { t as fumaMatter } from "./fuma-matter-E30PU53R.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
|
-
|
|
9
8
|
//#region src/collections/mdx/loader.ts
|
|
10
9
|
var loader_exports = /* @__PURE__ */ __exportAll({ createMdxLoader: () => createMdxLoader });
|
|
11
10
|
const querySchema = z.object({
|
|
@@ -52,8 +51,10 @@ function createMdxLoader({ getCore }) {
|
|
|
52
51
|
map: null
|
|
53
52
|
};
|
|
54
53
|
const lineOffset = isDevelopment ? countLines(matter.matter) : 0;
|
|
55
|
-
const { buildMDX } = await import("./build-mdx-
|
|
56
|
-
const compiled = await buildMDX(
|
|
54
|
+
const { buildMDX } = await import("./build-mdx-C8u32vDa.js").then((n) => n.n);
|
|
55
|
+
const compiled = await buildMDX({
|
|
56
|
+
core,
|
|
57
|
+
collection,
|
|
57
58
|
isDevelopment,
|
|
58
59
|
source: "\n".repeat(lineOffset) + matter.content,
|
|
59
60
|
filePath,
|
|
@@ -81,7 +82,7 @@ function countLines(s) {
|
|
|
81
82
|
for (const c of s) if (c === "\n") num++;
|
|
82
83
|
return num;
|
|
83
84
|
}
|
|
84
|
-
|
|
85
85
|
//#endregion
|
|
86
86
|
export { loader_exports as n, createMdxLoader as t };
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=loader-CyhM9SLt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-
|
|
1
|
+
{"version":3,"file":"loader-CyhM9SLt.js","names":[],"sources":["../src/collections/mdx/loader.ts"],"sourcesContent":["import { fumaMatter } from \"@/collections/mdx/fuma-matter\";\nimport type { SourceMap } from \"rollup\";\nimport { z } from \"zod\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport type { Loader } from \"@/plugins/loader\";\nimport type { DynamicCore } from \"@/dynamic\";\nimport { MDXCollection } from \"../mdx\";\n\nconst querySchema = z\n .object({\n only: z.literal([\"frontmatter\", \"all\"]).default(\"all\"),\n collection: z.string().optional(),\n workspace: z.string().optional(),\n })\n .loose();\n\nconst cacheEntry = z.object({\n code: z.string(),\n map: z.any().optional(),\n hash: z.string().optional(),\n});\n\ntype CacheEntry = z.infer<typeof cacheEntry>;\n\nexport function createMdxLoader({ getCore }: DynamicCore): Loader {\n return {\n async load({ getSource, development: isDevelopment, query, addDependency, filePath }) {\n let core = await getCore();\n const value = await getSource();\n const matter = fumaMatter(value);\n const { collection: collectionName, workspace, only } = querySchema.parse(query);\n if (workspace) {\n core = core.getWorkspaces().get(workspace) ?? core;\n }\n\n let after: (() => Promise<void>) | undefined;\n\n const { experimentalBuildCache = false } = core.getConfig();\n if (!isDevelopment && experimentalBuildCache) {\n const cacheDir = experimentalBuildCache;\n const cacheKey = `${collectionName ?? \"global\"}_${generateCacheHash(filePath)}`;\n\n const cached = await fs\n .readFile(path.join(cacheDir, cacheKey))\n .then((content) => cacheEntry.parse(JSON.parse(content.toString())))\n .catch(() => null);\n\n if (cached && cached.hash === generateCacheHash(value)) return cached;\n after = async () => {\n await fs.mkdir(cacheDir, { recursive: true });\n await fs.writeFile(\n path.join(cacheDir, cacheKey),\n JSON.stringify({\n ...out,\n hash: generateCacheHash(value),\n } satisfies CacheEntry),\n );\n };\n }\n\n let collection = collectionName ? core.getCollection(collectionName) : undefined;\n if (!(collection instanceof MDXCollection)) collection = undefined;\n\n if (collection?.frontmatter) {\n matter.data = await collection.frontmatter.run(matter.data as Record<string, unknown>, {\n collection,\n filePath,\n source: value,\n });\n }\n\n if (only === \"frontmatter\") {\n return {\n code: `export const frontmatter = ${JSON.stringify(matter.data)}`,\n map: null,\n };\n }\n\n // ensure the line number is correct in dev mode\n const lineOffset = isDevelopment ? countLines(matter.matter) : 0;\n\n const { buildMDX } = await import(\"@/collections/mdx/build-mdx\");\n const compiled = await buildMDX({\n core,\n collection,\n isDevelopment,\n source: \"\\n\".repeat(lineOffset) + matter.content,\n filePath,\n frontmatter: matter.data as Record<string, unknown>,\n compiler: {\n addDependency,\n collection,\n core,\n },\n environment: \"bundler\",\n });\n\n const out = {\n code: String(compiled.value),\n map: compiled.map as SourceMap,\n };\n\n await after?.();\n return out;\n },\n };\n}\n\nfunction generateCacheHash(input: string): string {\n return createHash(\"md5\").update(input).digest(\"hex\");\n}\n\nfunction countLines(s: string) {\n let num = 0;\n\n for (const c of s) {\n if (c === \"\\n\") num++;\n }\n\n return num;\n}\n"],"mappings":";;;;;;;;;AAUA,MAAM,cAAc,EACjB,OAAO;CACN,MAAM,EAAE,QAAQ,CAAC,eAAe,MAAM,CAAC,CAAC,QAAQ,MAAM;CACtD,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,WAAW,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC,CACD,OAAO;AAEV,MAAM,aAAa,EAAE,OAAO;CAC1B,MAAM,EAAE,QAAQ;CAChB,KAAK,EAAE,KAAK,CAAC,UAAU;CACvB,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC5B,CAAC;AAIF,SAAgB,gBAAgB,EAAE,WAAgC;AAChE,QAAO,EACL,MAAM,KAAK,EAAE,WAAW,aAAa,eAAe,OAAO,eAAe,YAAY;EACpF,IAAI,OAAO,MAAM,SAAS;EAC1B,MAAM,QAAQ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Q,KAAK,OAAO,WAAW,GAAG,OAAO;GACzC;GACA,aAAa,OAAO;GACpB,UAAU;IACR;IACA;IACA;IACD;GACD,aAAa;GACd,CAAC;EAEF,MAAM,MAAM;GACV,MAAM,OAAO,SAAS,MAAM;GAC5B,KAAK,SAAS;GACf;AAED,QAAM,SAAS;AACf,SAAO;IAEV;;AAGH,SAAS,kBAAkB,OAAuB;AAChD,QAAO,WAAW,MAAM,CAAC,OAAO,MAAM,CAAC,OAAO,MAAM;;AAGtD,SAAS,WAAW,GAAW;CAC7B,IAAI,MAAM;AAEV,MAAK,MAAM,KAAK,EACd,KAAI,MAAM,KAAM;AAGlB,QAAO"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as createDataLoader } from "./loader-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
|
+
import { t as createDataLoader } from "./loader-ol04zeoP.js";
|
|
3
3
|
import { load } from "js-yaml";
|
|
4
|
-
|
|
5
4
|
//#region src/collections/yaml/loader.ts
|
|
6
5
|
var loader_exports = /* @__PURE__ */ __exportAll({ createYamlLoader: () => createYamlLoader });
|
|
7
6
|
function createYamlLoader(core) {
|
|
@@ -13,7 +12,7 @@ function createYamlLoader(core) {
|
|
|
13
12
|
}
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
16
|
export { loader_exports as n, createYamlLoader as t };
|
|
19
|
-
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=loader-D_sKOzDc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-
|
|
1
|
+
{"version":3,"file":"loader-D_sKOzDc.js","names":[],"sources":["../src/collections/yaml/loader.ts"],"sourcesContent":["import type { Loader } from \"@/plugins/loader\";\nimport { load } from \"js-yaml\";\nimport type { DynamicCore } from \"@/dynamic\";\nimport { createDataLoader } from \"../data/loader\";\n\nexport function createYamlLoader(core: DynamicCore): Loader {\n return createDataLoader(core, (filePath, source) => {\n try {\n return load(source) as Record<string, unknown>;\n } catch (e) {\n throw new Error(`invalid data in ${filePath}`, { cause: e });\n }\n });\n}\n"],"mappings":";;;;;AAKA,SAAgB,iBAAiB,MAA2B;AAC1D,QAAO,iBAAiB,OAAO,UAAU,WAAW;AAClD,MAAI;AACF,UAAO,KAAK,OAAO;WACZ,GAAG;AACV,SAAM,IAAI,MAAM,mBAAmB,YAAY,EAAE,OAAO,GAAG,CAAC;;GAE9D"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as createDataLoader } from "./loader-
|
|
3
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
|
+
import { t as createDataLoader } from "./loader-ol04zeoP.js";
|
|
4
3
|
//#region src/collections/json/loader.ts
|
|
5
4
|
var loader_exports = /* @__PURE__ */ __exportAll({ createJsonLoader: () => createJsonLoader });
|
|
6
5
|
function createJsonLoader(core, resolveJson = "js") {
|
|
@@ -12,7 +11,7 @@ function createJsonLoader(core, resolveJson = "js") {
|
|
|
12
11
|
}
|
|
13
12
|
}, resolveJson);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
//#endregion
|
|
17
15
|
export { loader_exports as n, createJsonLoader as t };
|
|
18
|
-
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=loader-e2SkeDfY.js.map
|