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.
Files changed (160) hide show
  1. package/dist/async-cache-C47yxLCv.js +0 -2
  2. package/dist/bin.js +0 -2
  3. package/dist/{build-mdx-C8u32vDa.js → build-mdx-DjMJg3TP.js} +1 -3
  4. package/dist/bun/index.d.ts +2 -3
  5. package/dist/bun/index.js +1 -3
  6. package/dist/{bun-NahDFkhR.js → bun-qVjHRKNw.js} +0 -2
  7. package/dist/{code-generator-pLUE7Rk7.js → code-generator-DFGEY6P5.js} +12 -14
  8. package/dist/collections/data/runtime.d.ts +6 -6
  9. package/dist/collections/data/runtime.js +0 -2
  10. package/dist/collections/data.d.ts +4 -5
  11. package/dist/collections/data.js +4 -6
  12. package/dist/collections/fs.d.ts +1 -1
  13. package/dist/collections/fs.js +10 -12
  14. package/dist/collections/index.d.ts +1 -1
  15. package/dist/collections/index.js +1 -1
  16. package/dist/collections/json/loader-webpack.d.ts +2 -3
  17. package/dist/collections/json/loader-webpack.js +1 -5
  18. package/dist/collections/mdx/loader-webpack.d.ts +2 -3
  19. package/dist/collections/mdx/loader-webpack.js +1 -5
  20. package/dist/collections/mdx/react.d.ts +3 -4
  21. package/dist/collections/mdx/react.js +0 -2
  22. package/dist/collections/mdx/runtime-browser.d.ts +2 -2
  23. package/dist/collections/mdx/runtime-browser.js +0 -2
  24. package/dist/collections/mdx/runtime-dynamic.d.ts +8 -7
  25. package/dist/collections/mdx/runtime-dynamic.js +4 -7
  26. package/dist/collections/mdx/runtime.d.ts +1 -1
  27. package/dist/collections/mdx/runtime.js +0 -2
  28. package/dist/collections/mdx/vue.d.ts +7 -8
  29. package/dist/collections/mdx/vue.js +0 -2
  30. package/dist/collections/mdx.d.ts +1 -1
  31. package/dist/collections/mdx.js +3 -5
  32. package/dist/collections/obsidian.d.ts +2 -3
  33. package/dist/collections/obsidian.js +4 -7
  34. package/dist/collections/runtime/file-store.d.ts +1 -1
  35. package/dist/collections/runtime/file-store.js +0 -2
  36. package/dist/collections/runtime/store.d.ts +1 -1
  37. package/dist/collections/runtime/store.js +7 -9
  38. package/dist/collections/yaml/loader-webpack.d.ts +2 -3
  39. package/dist/collections/yaml/loader-webpack.js +1 -5
  40. package/dist/{collections-Cl-23FUa.js → collections-Bl9hpWMS.js} +4 -6
  41. package/dist/config/index.d.ts +2 -2
  42. package/dist/config/index.js +0 -2
  43. package/dist/{core-Dkl2eUwU.js → core-CrYszxmc.js} +8 -11
  44. package/dist/{core-1dkeRoD-.d.ts → core-Dmd3yqUH.d.ts} +15 -16
  45. package/dist/{dynamic-DGbONJ46.d.ts → dynamic-C15fv7uG.d.ts} +2 -3
  46. package/dist/dynamic.d.ts +1 -1
  47. package/dist/dynamic.js +1 -3
  48. package/dist/{file-store-NLjnayNa.d.ts → file-store-Bs81Afz5.d.ts} +2 -3
  49. package/dist/{flatten-m0wfHxLH.js → flatten-Db7WzTB7.js} +0 -2
  50. package/dist/{fs-C8dHWQw9.d.ts → fs-DYfoYdl-.d.ts} +3 -7
  51. package/dist/{git-W7QH8hQh.d.ts → git-C0-Uazuh.d.ts} +2 -3
  52. package/dist/{index-h97OPng4.d.ts → index-Dfg2QKTT.d.ts} +3 -4
  53. package/dist/index.d.ts +2 -3
  54. package/dist/index.js +2 -2
  55. package/dist/is-promise-like-C04ERo2r.js +0 -2
  56. package/dist/{load-from-file-C3CnD8mJ.js → load-from-file-DpW8who8.js} +0 -2
  57. package/dist/{loader-ol04zeoP.js → loader-B19JQedw.js} +0 -2
  58. package/dist/{loader-CyhM9SLt.js → loader-BTPxE-0W.js} +3 -5
  59. package/dist/{loader-e2SkeDfY.js → loader-CORy1xd9.js} +1 -3
  60. package/dist/{loader-D_sKOzDc.js → loader-DJcLC5Gg.js} +1 -3
  61. package/dist/{mdx-CBjuia2v.d.ts → mdx-0plToRQa.d.ts} +3 -4
  62. package/dist/next/index.d.ts +2 -3
  63. package/dist/next/index.js +2 -4
  64. package/dist/node/index.d.ts +1 -2
  65. package/dist/node/index.js +0 -2
  66. package/dist/node/loader.d.ts +2 -3
  67. package/dist/node/loader.js +1 -3
  68. package/dist/{node-Du4i4XDg.js → node--IKK4_8Y.js} +0 -2
  69. package/dist/plugins/git.d.ts +1 -1
  70. package/dist/plugins/git.js +1 -3
  71. package/dist/plugins/json-schema.d.ts +2 -3
  72. package/dist/plugins/json-schema.js +1 -3
  73. package/dist/plugins/loader/index.d.ts +1 -1
  74. package/dist/plugins/loader/index.js +4 -6
  75. package/dist/plugins/loader/webpack.d.ts +1 -1
  76. package/dist/plugins/loader/webpack.js +1 -3
  77. package/dist/plugins/remark/include.d.ts +1 -2
  78. package/dist/plugins/remark/include.js +4 -5
  79. package/dist/{runtime-CY1liEj_.d.ts → runtime-4S3BDs-G.d.ts} +8 -7
  80. package/dist/{runtime-browser-BqhaLAei.d.ts → runtime-browser-CXjm3FXK.d.ts} +7 -7
  81. package/dist/{store-DySTeDAM.d.ts → store-j10gHjm1.d.ts} +3 -5
  82. package/dist/utils/frontmatter.d.ts +15 -0
  83. package/dist/{fuma-matter-E30PU53R.js → utils/frontmatter.js} +3 -5
  84. package/dist/validation-Bf_v2L3p.js +0 -2
  85. package/dist/vite/index.d.ts +2 -3
  86. package/dist/vite/index.js +2 -4
  87. package/dist/{vite-DVIOnBqW.js → vite-myuLielb.js} +0 -2
  88. package/package.json +24 -20
  89. package/dist/async-cache-C47yxLCv.js.map +0 -1
  90. package/dist/bin.js.map +0 -1
  91. package/dist/build-mdx-C8u32vDa.js.map +0 -1
  92. package/dist/bun/index.d.ts.map +0 -1
  93. package/dist/bun/index.js.map +0 -1
  94. package/dist/bun-NahDFkhR.js.map +0 -1
  95. package/dist/code-generator-pLUE7Rk7.js.map +0 -1
  96. package/dist/collections/data/runtime.d.ts.map +0 -1
  97. package/dist/collections/data/runtime.js.map +0 -1
  98. package/dist/collections/data.d.ts.map +0 -1
  99. package/dist/collections/data.js.map +0 -1
  100. package/dist/collections/fs.js.map +0 -1
  101. package/dist/collections/json/loader-webpack.d.ts.map +0 -1
  102. package/dist/collections/json/loader-webpack.js.map +0 -1
  103. package/dist/collections/mdx/loader-webpack.d.ts.map +0 -1
  104. package/dist/collections/mdx/loader-webpack.js.map +0 -1
  105. package/dist/collections/mdx/react.d.ts.map +0 -1
  106. package/dist/collections/mdx/react.js.map +0 -1
  107. package/dist/collections/mdx/runtime-browser.js.map +0 -1
  108. package/dist/collections/mdx/runtime-dynamic.d.ts.map +0 -1
  109. package/dist/collections/mdx/runtime-dynamic.js.map +0 -1
  110. package/dist/collections/mdx/runtime.js.map +0 -1
  111. package/dist/collections/mdx/vue.d.ts.map +0 -1
  112. package/dist/collections/mdx/vue.js.map +0 -1
  113. package/dist/collections/mdx.js.map +0 -1
  114. package/dist/collections/obsidian.d.ts.map +0 -1
  115. package/dist/collections/obsidian.js.map +0 -1
  116. package/dist/collections/runtime/file-store.js.map +0 -1
  117. package/dist/collections/runtime/store.js.map +0 -1
  118. package/dist/collections/yaml/loader-webpack.d.ts.map +0 -1
  119. package/dist/collections/yaml/loader-webpack.js.map +0 -1
  120. package/dist/collections-Cl-23FUa.js.map +0 -1
  121. package/dist/config/index.js.map +0 -1
  122. package/dist/core-1dkeRoD-.d.ts.map +0 -1
  123. package/dist/core-Dkl2eUwU.js.map +0 -1
  124. package/dist/dynamic-DGbONJ46.d.ts.map +0 -1
  125. package/dist/dynamic.js.map +0 -1
  126. package/dist/file-store-NLjnayNa.d.ts.map +0 -1
  127. package/dist/flatten-m0wfHxLH.js.map +0 -1
  128. package/dist/fs-C8dHWQw9.d.ts.map +0 -1
  129. package/dist/fuma-matter-E30PU53R.js.map +0 -1
  130. package/dist/git-W7QH8hQh.d.ts.map +0 -1
  131. package/dist/index-h97OPng4.d.ts.map +0 -1
  132. package/dist/index.d.ts.map +0 -1
  133. package/dist/is-promise-like-C04ERo2r.js.map +0 -1
  134. package/dist/load-from-file-C3CnD8mJ.js.map +0 -1
  135. package/dist/loader-CyhM9SLt.js.map +0 -1
  136. package/dist/loader-D_sKOzDc.js.map +0 -1
  137. package/dist/loader-e2SkeDfY.js.map +0 -1
  138. package/dist/loader-ol04zeoP.js.map +0 -1
  139. package/dist/mdx-CBjuia2v.d.ts.map +0 -1
  140. package/dist/next/index.d.ts.map +0 -1
  141. package/dist/next/index.js.map +0 -1
  142. package/dist/node/index.d.ts.map +0 -1
  143. package/dist/node/index.js.map +0 -1
  144. package/dist/node/loader.d.ts.map +0 -1
  145. package/dist/node/loader.js.map +0 -1
  146. package/dist/node-Du4i4XDg.js.map +0 -1
  147. package/dist/plugins/git.js.map +0 -1
  148. package/dist/plugins/json-schema.d.ts.map +0 -1
  149. package/dist/plugins/json-schema.js.map +0 -1
  150. package/dist/plugins/loader/index.js.map +0 -1
  151. package/dist/plugins/loader/webpack.js.map +0 -1
  152. package/dist/plugins/remark/include.d.ts.map +0 -1
  153. package/dist/plugins/remark/include.js.map +0 -1
  154. package/dist/runtime-CY1liEj_.d.ts.map +0 -1
  155. package/dist/runtime-browser-BqhaLAei.d.ts.map +0 -1
  156. package/dist/store-DySTeDAM.d.ts.map +0 -1
  157. package/dist/validation-Bf_v2L3p.js.map +0 -1
  158. package/dist/vite/index.d.ts.map +0 -1
  159. package/dist/vite/index.js.map +0 -1
  160. package/dist/vite-DVIOnBqW.js.map +0 -1
@@ -1,10 +1,6 @@
1
- import "../../validation-Bf_v2L3p.js";
2
1
  import { createWebpackLoader } from "../../plugins/loader/webpack.js";
3
- import "../../loader-ol04zeoP.js";
4
- import { t as createYamlLoader } from "../../loader-D_sKOzDc.js";
2
+ import { t as createYamlLoader } from "../../loader-DJcLC5Gg.js";
5
3
  //#region src/collections/yaml/loader-webpack.ts
6
4
  var loader_webpack_default = createWebpackLoader((core) => createYamlLoader(core));
7
5
  //#endregion
8
6
  export { loader_webpack_default as default };
9
-
10
- //# sourceMappingURL=loader-webpack.js.map
@@ -54,7 +54,7 @@ function asyncPipe(steps = []) {
54
54
  //#endregion
55
55
  //#region src/collections/index.ts
56
56
  var Collection = class {
57
- pluginHooks = /* @__PURE__ */ new Map();
57
+ #pluginHooks = /* @__PURE__ */ new Map();
58
58
  name = null;
59
59
  /**
60
60
  * on config loaded/updated
@@ -68,14 +68,14 @@ var Collection = class {
68
68
  onEmit = asyncPipe();
69
69
  plugins = [];
70
70
  pluginHook(hook, options) {
71
- let created = this.pluginHooks.get(hook.id);
71
+ let created = this.#pluginHooks.get(hook.id);
72
72
  if (created) return created;
73
73
  created = hook.create(this, options);
74
- this.pluginHooks.set(hook.id, created);
74
+ this.#pluginHooks.set(hook.id, created);
75
75
  return created;
76
76
  }
77
77
  getPluginHook(hook) {
78
- return this.pluginHooks.get(hook.id);
78
+ return this.#pluginHooks.get(hook.id);
79
79
  }
80
80
  };
81
81
  function defineCollectionHook(...args) {
@@ -90,5 +90,3 @@ function defineCollectionHook(...args) {
90
90
  }
91
91
  //#endregion
92
92
  export { asyncHook as a, pipe as i, defineCollectionHook as n, hook as o, asyncPipe as r, Collection as t };
93
-
94
- //# sourceMappingURL=collections-Cl-23FUa.js.map
@@ -1,2 +1,2 @@
1
- import { A as WorkspaceConfig, O as EmitConfig, j as defineConfig, k as GlobalConfig } from "../core-1dkeRoD-.js";
2
- export { EmitConfig, GlobalConfig, WorkspaceConfig, defineConfig };
1
+ import { A as GlobalConfig, M as defineConfig, O as CollectionsPack, j as WorkspaceConfig, k as EmitConfig } from "../core-Dmd3yqUH.js";
2
+ export { CollectionsPack, EmitConfig, GlobalConfig, WorkspaceConfig, defineConfig };
@@ -4,5 +4,3 @@ function defineConfig(config = {}) {
4
4
  }
5
5
  //#endregion
6
6
  export { defineConfig };
7
-
8
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { t as Collection } from "./collections-Cl-23FUa.js";
2
- import { t as CodeGenerator } from "./code-generator-pLUE7Rk7.js";
1
+ import { t as Collection } from "./collections-Bl9hpWMS.js";
2
+ import { t as CodeGenerator } from "./code-generator-DFGEY6P5.js";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  //#region src/core.ts
@@ -200,13 +200,12 @@ var Core = class Core {
200
200
  const entries = Array.from(pendingCollections.entries());
201
201
  pendingCollections.clear();
202
202
  await Promise.all(entries.map(async ([name, collection]) => {
203
- if (collections.has(name)) throw new Error(`collection name "${name}" was taken.`);
204
- collection.name = name;
205
- collections.set(name, collection);
206
- await collection.onInit.run({
207
- core: this,
208
- pendingCollections
209
- });
203
+ if (collection instanceof Collection) {
204
+ if (collections.has(name)) throw new Error(`duplicated collection name "${name}" is not allowed.`);
205
+ collection.name = name;
206
+ collections.set(name, collection);
207
+ await collection.onInit.run({ core: this });
208
+ } else for (const [k, v] of Object.entries(collection)) pendingCollections.set(k === "index" ? name : `${name}$${k}`, v);
210
209
  }));
211
210
  }
212
211
  return {
@@ -217,5 +216,3 @@ var Core = class Core {
217
216
  };
218
217
  //#endregion
219
218
  export { Core as t };
220
-
221
- //# sourceMappingURL=core-Dkl2eUwU.js.map
@@ -4,7 +4,10 @@ import * as Vite from "vite";
4
4
  import { NextConfig } from "next";
5
5
 
6
6
  //#region src/config/index.d.ts
7
- interface GlobalConfig<Collections extends Record<string, Collection> = Record<string, Collection>> {
7
+ type CollectionsPack = {
8
+ [key: string]: Collection | CollectionsPack;
9
+ };
10
+ interface GlobalConfig<Collections extends CollectionsPack = CollectionsPack> {
8
11
  plugins?: PluginOption$1[];
9
12
  collections?: Collections;
10
13
  workspaces?: Record<string, WorkspaceConfig>;
@@ -31,12 +34,16 @@ interface WorkspaceConfig {
31
34
  default: GlobalConfig;
32
35
  };
33
36
  }
34
- declare function defineConfig<Collections extends Record<string, Collection> = Record<string, Collection>>(config?: GlobalConfig<Collections>): GlobalConfig<Collections>;
37
+ declare function defineConfig<Collections extends CollectionsPack = CollectionsPack>(config?: GlobalConfig<Collections>): GlobalConfig<Collections>;
35
38
  //#endregion
36
39
  //#region src/types.d.ts
37
- type GetCollectionConfig<Config, Name extends string> = Config extends Record<Name, Collection> ? Config[Name] : Config extends {
40
+ type OrFallback<T, Fallback> = [T] extends [never] ? Fallback : T;
41
+ type GetCollectionConfig<Config, Name extends string> = Omit<Config, "default"> extends CollectionsPack ? OrFallback<Resolve<Omit<Config, "default">, Name>, Config extends {
38
42
  default: GlobalConfig<infer Collections>;
39
- } ? Collections[Name] : never;
43
+ } ? Resolve<Collections, Name> : never> : never;
44
+ type Resolve<Map extends CollectionsPack, Name extends string> = Map[Name] extends Collection ? Map[Name] : Map[Name] extends {
45
+ index: Collection;
46
+ } ? Map[Name]["index"] : Name extends `${infer Key}$${infer Property}` ? Map[Key] extends CollectionsPack ? Resolve<Map[Key], Property> : never : never;
40
47
  type Awaitable<T> = T | PromiseLike<T>;
41
48
  //#endregion
42
49
  //#region src/utils/hook.d.ts
@@ -92,7 +99,7 @@ interface CollectionHookContext {
92
99
  core: Core;
93
100
  }
94
101
  declare class Collection {
95
- private readonly pluginHooks;
102
+ #private;
96
103
  name: string;
97
104
  /**
98
105
  * on config loaded/updated
@@ -106,12 +113,7 @@ declare class Collection {
106
113
  readonly onServer: Hook<CollectionHookContext & {
107
114
  server: ServerContext;
108
115
  }>;
109
- readonly onInit: AsyncHook<CollectionHookContext & {
110
- /**
111
- * You can add other collections to load from here
112
- */
113
- pendingCollections: Map<string, Collection>;
114
- }>;
116
+ readonly onInit: AsyncHook<CollectionHookContext>;
115
117
  readonly onEmit: AsyncPipe<EmitEntry[], EmitContext>;
116
118
  readonly plugins: PluginOption$1[];
117
119
  pluginHook<T, Options>(hook: CollectionHook<T, Options>, options: Options): T;
@@ -133,9 +135,7 @@ interface CodeGeneratorOptions extends EmitConfig {
133
135
  * Code generator (one instance per file)
134
136
  */
135
137
  declare class CodeGenerator {
136
- private readonly lines;
137
- private readonly importInfos;
138
- private eagerImportId;
138
+ #private;
139
139
  readonly options: CodeGeneratorOptions;
140
140
  constructor({
141
141
  jsExtension,
@@ -311,5 +311,4 @@ declare class Core {
311
311
  private initConfig;
312
312
  }
313
313
  //#endregion
314
- 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 };
315
- //# sourceMappingURL=core-1dkeRoD-.d.ts.map
314
+ export { GlobalConfig as A, Hook as C, GetCollectionConfig as D, Awaitable as E, defineConfig as M, CollectionsPack 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, WorkspaceConfig as j, EmitConfig 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 };
@@ -1,4 +1,4 @@
1
- import { t as Core } from "./core-1dkeRoD-.js";
1
+ import { t as Core } from "./core-Dmd3yqUH.js";
2
2
 
3
3
  //#region src/config/load-from-file.d.ts
4
4
  /**
@@ -28,5 +28,4 @@ declare function createDynamicCore({
28
28
  mode: "dev" | "production";
29
29
  }): DynamicCore;
30
30
  //#endregion
31
- export { createDynamicCore as n, DynamicCore as t };
32
- //# sourceMappingURL=dynamic-DGbONJ46.d.ts.map
31
+ export { createDynamicCore as n, DynamicCore as t };
package/dist/dynamic.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as createDynamicCore, t as DynamicCore } from "./dynamic-DGbONJ46.js";
1
+ import { n as createDynamicCore, t as DynamicCore } from "./dynamic-C15fv7uG.js";
2
2
  export { DynamicCore, createDynamicCore };
package/dist/dynamic.js CHANGED
@@ -9,7 +9,7 @@ function createDynamicCore({ core, compileMode = true, mode }) {
9
9
  })).mtime.getTime().toString();
10
10
  }
11
11
  async function init() {
12
- const { loadConfig } = await import("./load-from-file-C3CnD8mJ.js").then((n) => n.n);
12
+ const { loadConfig } = await import("./load-from-file-DpW8who8.js").then((n) => n.n);
13
13
  await core.init({ config: loadConfig(core, compileMode) });
14
14
  }
15
15
  return { async getCore() {
@@ -24,5 +24,3 @@ function createDynamicCore({ core, compileMode = true, mode }) {
24
24
  }
25
25
  //#endregion
26
26
  export { createDynamicCore };
27
-
28
- //# sourceMappingURL=dynamic.js.map
@@ -1,4 +1,4 @@
1
- import { n as MapCollectionStore } from "./store-DySTeDAM.js";
1
+ import { n as MapCollectionStore } from "./store-j10gHjm1.js";
2
2
 
3
3
  //#region src/collections/runtime/file-store.d.ts
4
4
  interface FileInfo {
@@ -16,5 +16,4 @@ declare class FileCollectionStore<V> extends MapCollectionStore<string, FileInfo
16
16
  castData<T>(_cast: (input: FileInfo & V) => FileInfo & T): FileCollectionStore<T>;
17
17
  }
18
18
  //#endregion
19
- export { FileInfo as n, FileCollectionStore as t };
20
- //# sourceMappingURL=file-store-NLjnayNa.d.ts.map
19
+ export { FileInfo as n, FileCollectionStore as t };
@@ -6,5 +6,3 @@ function flattenNode(node) {
6
6
  }
7
7
  //#endregion
8
8
  export { flattenNode as t };
9
-
10
- //# sourceMappingURL=flatten-m0wfHxLH.js.map
@@ -1,15 +1,12 @@
1
- import { m as Collection } from "./core-1dkeRoD-.js";
1
+ import { m as Collection } from "./core-Dmd3yqUH.js";
2
2
 
3
3
  //#region src/collections/fs.d.ts
4
4
  declare class FileSystemCollection extends Collection {
5
- private matcher;
5
+ #private;
6
6
  /**
7
7
  * content directory (absolute)
8
8
  */
9
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
10
  readonly supportedFileFormats: string[] | undefined;
14
11
  constructor(config: FileSystemCollectionConfig);
15
12
  isFileSupported(filePath: string): boolean;
@@ -40,5 +37,4 @@ interface FileSystemCollectionConfig {
40
37
  }
41
38
  declare function fileSystemCollection(config: FileSystemCollectionConfig): FileSystemCollection;
42
39
  //#endregion
43
- export { FileSystemCollectionConfig as n, fileSystemCollection as r, FileSystemCollection as t };
44
- //# sourceMappingURL=fs-C8dHWQw9.d.ts.map
40
+ export { FileSystemCollectionConfig as n, fileSystemCollection as r, FileSystemCollection as t };
@@ -1,4 +1,4 @@
1
- import { S as AsyncHook, h as CollectionHook, s as Plugin } from "./core-1dkeRoD-.js";
1
+ import { S as AsyncHook, h as CollectionHook, s as Plugin } from "./core-Dmd3yqUH.js";
2
2
 
3
3
  //#region src/plugins/git.d.ts
4
4
  interface GitFileData {
@@ -33,5 +33,4 @@ interface GitClient {
33
33
  }) => Promise<GitFileData>;
34
34
  }
35
35
  //#endregion
36
- export { gitHook as a, git as i, GitFileData as n, GitHook as r, GitClient as t };
37
- //# sourceMappingURL=git-W7QH8hQh.d.ts.map
36
+ export { gitHook as a, git as i, GitFileData as n, GitHook as r, GitClient as t };
@@ -1,5 +1,5 @@
1
- import { c as PluginContext, h as CollectionHook, s as Plugin } from "./core-1dkeRoD-.js";
2
- import { t as DynamicCore } from "./dynamic-DGbONJ46.js";
1
+ import { c as PluginContext, h as CollectionHook, s as Plugin } from "./core-Dmd3yqUH.js";
2
+ import { t as DynamicCore } from "./dynamic-C15fv7uG.js";
3
3
  import { NextConfig } from "next";
4
4
  import { LoaderContext } from "webpack";
5
5
 
@@ -80,5 +80,4 @@ interface LoaderHook {
80
80
  }
81
81
  declare const loaderHook: CollectionHook<LoaderHook, undefined>;
82
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-h97OPng4.d.ts.map
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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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-1dkeRoD-.js";
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-Dmd3yqUH.js";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
 
4
4
  //#region src/utils/validation.d.ts
@@ -14,5 +14,4 @@ declare function validate<Schema extends StandardSchemaV1, Context>(schema: Stan
14
14
  */
15
15
  declare function getJSONSchema(schema: StandardSchemaV1): Record<string, unknown> | undefined;
16
16
  //#endregion
17
- export { AsyncHook, AsyncPipe, Core, CoreOptions, EmitContext, EmitEntry, EmitOptions, EmitOutput, type GetCollectionConfig, Hook, Pipe, Plugin, PluginContext, PluginOption, ResolvedConfig, ResolvedCoreOptions, ServerContext, ValidationError, asyncHook, asyncPipe, getJSONSchema, hook, pipe, validate };
18
- //# sourceMappingURL=index.d.ts.map
17
+ export { AsyncHook, AsyncPipe, Core, CoreOptions, EmitContext, EmitEntry, EmitOptions, EmitOutput, type GetCollectionConfig, Hook, Pipe, Plugin, PluginContext, PluginOption, ResolvedConfig, ResolvedCoreOptions, ServerContext, ValidationError, asyncHook, asyncPipe, getJSONSchema, hook, pipe, validate };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as asyncHook, i as pipe, o as hook, r as asyncPipe } from "./collections-Cl-23FUa.js";
2
- import { t as Core } from "./core-Dkl2eUwU.js";
1
+ import { a as asyncHook, i as pipe, o as hook, r as asyncPipe } from "./collections-Bl9hpWMS.js";
2
+ import { t as Core } from "./core-CrYszxmc.js";
3
3
  import { n as getJSONSchema, r as validate, t as ValidationError } from "./validation-Bf_v2L3p.js";
4
4
  export { Core, ValidationError, asyncHook, asyncPipe, getJSONSchema, hook, pipe, validate };
@@ -4,5 +4,3 @@ function isPromiseLike(v) {
4
4
  }
5
5
  //#endregion
6
6
  export { isPromiseLike as t };
7
-
8
- //# sourceMappingURL=is-promise-like-C04ERo2r.js.map
@@ -32,5 +32,3 @@ async function loadConfig(core, compileMode) {
32
32
  }
33
33
  //#endregion
34
34
  export { load_from_file_exports as n, loadConfig as t };
35
-
36
- //# sourceMappingURL=load-from-file-C3CnD8mJ.js.map
@@ -54,5 +54,3 @@ function createDataLoader({ getCore }, parse, moduleType = "js") {
54
54
  }
55
55
  //#endregion
56
56
  export { createDataLoader as t };
57
-
58
- //# sourceMappingURL=loader-ol04zeoP.js.map
@@ -1,6 +1,6 @@
1
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-E30PU53R.js";
3
+ import { parseFrontmatter } from "./utils/frontmatter.js";
4
4
  import fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
@@ -21,7 +21,7 @@ function createMdxLoader({ getCore }) {
21
21
  return { async load({ getSource, development: isDevelopment, query, addDependency, filePath }) {
22
22
  let core = await getCore();
23
23
  const value = await getSource();
24
- const matter = fumaMatter(value);
24
+ const matter = parseFrontmatter(value);
25
25
  const { collection: collectionName, workspace, only } = querySchema.parse(query);
26
26
  if (workspace) core = core.getWorkspaces().get(workspace) ?? core;
27
27
  let after;
@@ -51,7 +51,7 @@ function createMdxLoader({ getCore }) {
51
51
  map: null
52
52
  };
53
53
  const lineOffset = isDevelopment ? countLines(matter.matter) : 0;
54
- const { buildMDX } = await import("./build-mdx-C8u32vDa.js").then((n) => n.n);
54
+ const { buildMDX } = await import("./build-mdx-DjMJg3TP.js").then((n) => n.n);
55
55
  const compiled = await buildMDX({
56
56
  core,
57
57
  collection,
@@ -84,5 +84,3 @@ function countLines(s) {
84
84
  }
85
85
  //#endregion
86
86
  export { loader_exports as n, createMdxLoader as t };
87
-
88
- //# sourceMappingURL=loader-CyhM9SLt.js.map
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { t as createDataLoader } from "./loader-ol04zeoP.js";
2
+ import { t as createDataLoader } from "./loader-B19JQedw.js";
3
3
  //#region src/collections/json/loader.ts
4
4
  var loader_exports = /* @__PURE__ */ __exportAll({ createJsonLoader: () => createJsonLoader });
5
5
  function createJsonLoader(core, resolveJson = "js") {
@@ -13,5 +13,3 @@ function createJsonLoader(core, resolveJson = "js") {
13
13
  }
14
14
  //#endregion
15
15
  export { loader_exports as n, createJsonLoader as t };
16
-
17
- //# sourceMappingURL=loader-e2SkeDfY.js.map
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { t as createDataLoader } from "./loader-ol04zeoP.js";
2
+ import { t as createDataLoader } from "./loader-B19JQedw.js";
3
3
  import { load } from "js-yaml";
4
4
  //#region src/collections/yaml/loader.ts
5
5
  var loader_exports = /* @__PURE__ */ __exportAll({ createYamlLoader: () => createYamlLoader });
@@ -14,5 +14,3 @@ function createYamlLoader(core) {
14
14
  }
15
15
  //#endregion
16
16
  export { loader_exports as n, createYamlLoader as t };
17
-
18
- //# sourceMappingURL=loader-D_sKOzDc.js.map
@@ -1,5 +1,5 @@
1
- import { E as Awaitable, m as Collection, p as CodeGenerator, t as Core, v as AsyncPipe, y as Pipe } from "./core-1dkeRoD-.js";
2
- import { n as FileSystemCollectionConfig, t as FileSystemCollection } from "./fs-C8dHWQw9.js";
1
+ import { E as Awaitable, m as Collection, p as CodeGenerator, t as Core, v as AsyncPipe, y as Pipe } from "./core-Dmd3yqUH.js";
2
+ import { n as FileSystemCollectionConfig, t as FileSystemCollection } from "./fs-DYfoYdl-.js";
3
3
  import { VFile } from "vfile";
4
4
  import { ProcessorOptions, createProcessor } from "@mdx-js/mdx";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -134,5 +134,4 @@ declare class MDXCollection<FrontmatterSchema extends StandardSchemaV1 | undefin
134
134
  }
135
135
  declare function mdxCollection<FrontmatterSchema extends StandardSchemaV1 | undefined = undefined>(config: MDXCollectionConfig<FrontmatterSchema>): MDXCollection<FrontmatterSchema>;
136
136
  //#endregion
137
- export { LinkReference as a, CompiledMDX as i, MDXCollectionConfig as n, mdxCollection as r, MDXCollection as t };
138
- //# sourceMappingURL=mdx-CBjuia2v.d.ts.map
137
+ export { LinkReference as a, CompiledMDX as i, MDXCollectionConfig as n, mdxCollection as r, MDXCollection as t };
@@ -1,4 +1,4 @@
1
- import { n as CoreOptions, t as Core } from "../core-1dkeRoD-.js";
1
+ import { n as CoreOptions, t as Core } from "../core-Dmd3yqUH.js";
2
2
  import { NextConfig } from "next";
3
3
 
4
4
  //#region src/next/index.d.ts
@@ -13,5 +13,4 @@ interface NextOptions extends Pick<CoreOptions, "cwd" | "configPath" | "outDir">
13
13
  declare function createContent(options?: NextOptions): Promise<(nextConfig?: NextConfig) => NextConfig>;
14
14
  declare function createStandaloneCore(options: NextOptions): Promise<Core>;
15
15
  //#endregion
16
- export { NextOptions, createContent, createStandaloneCore };
17
- //# sourceMappingURL=index.d.ts.map
16
+ export { NextOptions, createContent, createStandaloneCore };
@@ -1,6 +1,6 @@
1
- import { t as Core } from "../core-Dkl2eUwU.js";
1
+ import { t as Core } from "../core-CrYszxmc.js";
2
2
  import { loaderPlugin } from "../plugins/loader/index.js";
3
- import { t as loadConfig } from "../load-from-file-C3CnD8mJ.js";
3
+ import { t as loadConfig } from "../load-from-file-DpW8who8.js";
4
4
  import path from "node:path";
5
5
  //#region src/next/index.ts
6
6
  async function createContent(options = {}) {
@@ -69,5 +69,3 @@ function createNextCore({ configPath, cwd, outDir }) {
69
69
  }
70
70
  //#endregion
71
71
  export { createContent, createStandaloneCore };
72
-
73
- //# sourceMappingURL=index.js.map
@@ -3,5 +3,4 @@ import { LoaderOptions } from "./loader.js";
3
3
  //#region src/node/index.d.ts
4
4
  declare function register(options?: LoaderOptions): void;
5
5
  //#endregion
6
- export { register };
7
- //# sourceMappingURL=index.d.ts.map
6
+ export { register };
@@ -5,5 +5,3 @@ function register(options = {}) {
5
5
  }
6
6
  //#endregion
7
7
  export { register };
8
-
9
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { n as CoreOptions } from "../core-1dkeRoD-.js";
1
+ import { n as CoreOptions } from "../core-Dmd3yqUH.js";
2
2
  import { InitializeHook, LoadHook } from "node:module";
3
3
 
4
4
  //#region src/node/loader.d.ts
@@ -6,5 +6,4 @@ type LoaderOptions = Omit<CoreOptions, "plugins" | "workspace">;
6
6
  declare const initialize: InitializeHook<LoaderOptions>;
7
7
  declare const load: LoadHook;
8
8
  //#endregion
9
- export { LoaderOptions, initialize, load };
10
- //# sourceMappingURL=loader.d.ts.map
9
+ export { LoaderOptions, initialize, load };
@@ -1,5 +1,5 @@
1
1
  import { createDynamicCore } from "../dynamic.js";
2
- import { t as Core } from "../core-Dkl2eUwU.js";
2
+ import { t as Core } from "../core-CrYszxmc.js";
3
3
  import { t as createCache } from "../async-cache-C47yxLCv.js";
4
4
  import { loaderPlugin } from "../plugins/loader/index.js";
5
5
  //#region src/node/loader.ts
@@ -33,5 +33,3 @@ const load = async (url, context, nextLoad) => {
33
33
  };
34
34
  //#endregion
35
35
  export { initialize, load };
36
-
37
- //# sourceMappingURL=loader.js.map
@@ -28,5 +28,3 @@ function toNode(loaders) {
28
28
  }
29
29
  //#endregion
30
30
  export { toNode };
31
-
32
- //# sourceMappingURL=node-Du4i4XDg.js.map
@@ -1,2 +1,2 @@
1
- import { a as gitHook, i as git, n as GitFileData, r as GitHook, t as GitClient } from "../git-W7QH8hQh.js";
1
+ import { a as gitHook, i as git, n as GitFileData, r as GitHook, t as GitClient } from "../git-C0-Uazuh.js";
2
2
  export { GitClient, GitFileData, GitHook, git as default, gitHook };
@@ -1,4 +1,4 @@
1
- import { a as asyncHook, n as defineCollectionHook } from "../collections-Cl-23FUa.js";
1
+ import { a as asyncHook, n as defineCollectionHook } from "../collections-Bl9hpWMS.js";
2
2
  import { t as createCache } from "../async-cache-C47yxLCv.js";
3
3
  import path from "node:path";
4
4
  import { x } from "tinyexec";
@@ -55,5 +55,3 @@ function createGitClient(cwd) {
55
55
  }
56
56
  //#endregion
57
57
  export { git as default, gitHook };
58
-
59
- //# sourceMappingURL=git.js.map
@@ -1,4 +1,4 @@
1
- import { E as Awaitable, h as CollectionHook } from "../core-1dkeRoD-.js";
1
+ import { E as Awaitable, h as CollectionHook } from "../core-Dmd3yqUH.js";
2
2
 
3
3
  //#region src/plugins/json-schema.d.ts
4
4
  interface JSONSchemaOptions {
@@ -22,5 +22,4 @@ interface JSONSchemaHook {
22
22
  */
23
23
  declare const jsonSchemaHook: CollectionHook<JSONSchemaHook, JSONSchemaOptions>;
24
24
  //#endregion
25
- export { JSONSchemaHook, JSONSchemaOptions, jsonSchemaHook };
26
- //# sourceMappingURL=json-schema.d.ts.map
25
+ export { JSONSchemaHook, JSONSchemaOptions, jsonSchemaHook };
@@ -1,4 +1,4 @@
1
- import { n as defineCollectionHook } from "../collections-Cl-23FUa.js";
1
+ import { n as defineCollectionHook } from "../collections-Bl9hpWMS.js";
2
2
  import { FileSystemCollection } from "../collections/fs.js";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
@@ -47,5 +47,3 @@ const jsonSchemaHook = defineCollectionHook("json-schema", (collection, { insert
47
47
  });
48
48
  //#endregion
49
49
  export { jsonSchemaHook };
50
-
51
- //# sourceMappingURL=json-schema.js.map
@@ -1,2 +1,2 @@
1
- import { a as LoaderOutput, i as LoaderInput, n as LoaderConfig, o as loaderHook, r as LoaderHook, s as loaderPlugin, t as Loader } from "../../index-h97OPng4.js";
1
+ import { a as LoaderOutput, i as LoaderInput, n as LoaderConfig, o as loaderHook, r as LoaderHook, s as loaderPlugin, t as Loader } from "../../index-Dfg2QKTT.js";
2
2
  export { Loader, LoaderConfig, LoaderHook, LoaderInput, LoaderOutput, loaderHook, loaderPlugin };
@@ -1,4 +1,4 @@
1
- import { n as defineCollectionHook } from "../../collections-Cl-23FUa.js";
1
+ import { n as defineCollectionHook } from "../../collections-Bl9hpWMS.js";
2
2
  import { t as createCache } from "../../async-cache-C47yxLCv.js";
3
3
  import path from "node:path";
4
4
  //#region src/plugins/loader/index.ts
@@ -52,15 +52,15 @@ function loaderPlugin() {
52
52
  return config;
53
53
  } },
54
54
  bun: { async setup(build) {
55
- const { toBun } = await import("../../bun-NahDFkhR.js");
55
+ const { toBun } = await import("../../bun-qVjHRKNw.js");
56
56
  for (const loader of await initLoaders(this, "bun")) toBun(loader.test, loader.loader)(build);
57
57
  } },
58
58
  node: { async createLoad() {
59
- const { toNode } = await import("../../node-Du4i4XDg.js");
59
+ const { toNode } = await import("../../node--IKK4_8Y.js");
60
60
  return toNode(await initLoaders(this, "node"));
61
61
  } },
62
62
  vite: { async createPlugin() {
63
- const { toVite } = await import("../../vite-DVIOnBqW.js");
63
+ const { toVite } = await import("../../vite-myuLielb.js");
64
64
  return (await initLoaders(this, "vite")).map((loader) => {
65
65
  return toVite(`fuma-content:${loader.id}`, loader.test, loader.loader);
66
66
  });
@@ -70,5 +70,3 @@ function loaderPlugin() {
70
70
  const loaderHook = defineCollectionHook("loader", () => ({ loaders: [] }));
71
71
  //#endregion
72
72
  export { loaderHook, loaderPlugin };
73
-
74
- //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import { c as WebpackLoader, l as WebpackLoaderOptions, u as createWebpackLoader } from "../../index-h97OPng4.js";
1
+ import { c as WebpackLoader, l as WebpackLoaderOptions, u as createWebpackLoader } from "../../index-Dfg2QKTT.js";
2
2
  export { WebpackLoader, WebpackLoaderOptions, createWebpackLoader };
@@ -1,5 +1,5 @@
1
1
  import { createDynamicCore } from "../../dynamic.js";
2
- import { t as Core } from "../../core-Dkl2eUwU.js";
2
+ import { t as Core } from "../../core-CrYszxmc.js";
3
3
  import { t as ValidationError } from "../../validation-Bf_v2L3p.js";
4
4
  import path from "node:path";
5
5
  import { parse } from "node:querystring";
@@ -57,5 +57,3 @@ function createWebpackLoader(loaderFactory) {
57
57
  }
58
58
  //#endregion
59
59
  export { createWebpackLoader };
60
-
61
- //# sourceMappingURL=webpack.js.map
@@ -19,5 +19,4 @@ declare function remarkInclude(this: Processor, {
19
19
  tagName
20
20
  }?: RemarkIncludeOptions): Transformer<Root, Root>;
21
21
  //#endregion
22
- export { Params, RemarkIncludeOptions, remarkInclude };
23
- //# sourceMappingURL=include.d.ts.map
22
+ export { Params, RemarkIncludeOptions, remarkInclude };
@@ -1,5 +1,5 @@
1
- import { t as fumaMatter } from "../../fuma-matter-E30PU53R.js";
2
- import { t as flattenNode } from "../../flatten-m0wfHxLH.js";
1
+ import { parseFrontmatter } from "../../utils/frontmatter.js";
2
+ import { t as flattenNode } from "../../flatten-Db7WzTB7.js";
3
3
  import * as fs$1 from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
5
5
  import { visit } from "unist-util-visit";
@@ -145,7 +145,7 @@ function remarkInclude({ tagName = "include" } = {}) {
145
145
  data: {}
146
146
  };
147
147
  const processor = await _getProcessor(ext === ".mdx" ? "mdx" : "md");
148
- const parsed = fumaMatter(content);
148
+ const parsed = parseFrontmatter(content);
149
149
  const targetFile = new VFile({
150
150
  path: targetPath,
151
151
  value: parsed.content,
@@ -193,11 +193,10 @@ function remarkInclude({ tagName = "include" } = {}) {
193
193
  };
194
194
  }
195
195
  var Terminated = class {
196
+ value;
196
197
  constructor(value) {
197
198
  this.value = value;
198
199
  }
199
200
  };
200
201
  //#endregion
201
202
  export { remarkInclude };
202
-
203
- //# sourceMappingURL=include.js.map