fuma-content 1.0.1 → 1.0.2

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 (147) hide show
  1. package/dist/async-cache-BM9Yf4Nw.js +29 -0
  2. package/dist/async-cache-BM9Yf4Nw.js.map +1 -0
  3. package/dist/bin.d.ts +1 -1
  4. package/dist/bin.js +21 -14
  5. package/dist/bin.js.map +1 -0
  6. package/dist/build-D8A5ByFk.js +42 -0
  7. package/dist/build-D8A5ByFk.js.map +1 -0
  8. package/dist/build-mdx-C1PZsGp2.js +395 -0
  9. package/dist/build-mdx-C1PZsGp2.js.map +1 -0
  10. package/dist/build-mdx-DFndaVbS.js +4 -0
  11. package/dist/bun/index.d.ts +6 -13
  12. package/dist/bun/index.d.ts.map +1 -0
  13. package/dist/bun/index.js +23 -34
  14. package/dist/bun/index.js.map +1 -0
  15. package/dist/bun-QKQnqgIi.js +35 -0
  16. package/dist/bun-QKQnqgIi.js.map +1 -0
  17. package/dist/code-generator-gPtrfZ6Q.js +133 -0
  18. package/dist/code-generator-gPtrfZ6Q.js.map +1 -0
  19. package/dist/collections/handlers/fs.d.ts +2 -10
  20. package/dist/collections/handlers/fs.js +28 -6
  21. package/dist/collections/handlers/fs.js.map +1 -0
  22. package/dist/collections/index.d.ts +2 -10
  23. package/dist/collections/index.js +16 -6
  24. package/dist/collections/index.js.map +1 -0
  25. package/dist/collections/mdx/loader-webpack.d.ts +6 -14
  26. package/dist/collections/mdx/loader-webpack.d.ts.map +1 -0
  27. package/dist/collections/mdx/loader-webpack.js +23 -36
  28. package/dist/collections/mdx/loader-webpack.js.map +1 -0
  29. package/dist/collections/mdx/runtime-browser.d.ts +27 -37
  30. package/dist/collections/mdx/runtime-browser.d.ts.map +1 -0
  31. package/dist/collections/mdx/runtime-browser.js +57 -70
  32. package/dist/collections/mdx/runtime-browser.js.map +1 -0
  33. package/dist/collections/mdx/runtime-dynamic.d.ts +22 -30
  34. package/dist/collections/mdx/runtime-dynamic.d.ts.map +1 -0
  35. package/dist/collections/mdx/runtime-dynamic.js +63 -85
  36. package/dist/collections/mdx/runtime-dynamic.js.map +1 -0
  37. package/dist/collections/mdx/runtime.d.ts +31 -52
  38. package/dist/collections/mdx/runtime.d.ts.map +1 -0
  39. package/dist/collections/mdx/runtime.js +24 -34
  40. package/dist/collections/mdx/runtime.js.map +1 -0
  41. package/dist/collections/mdx.d.ts +2 -10
  42. package/dist/collections/mdx.js +240 -284
  43. package/dist/collections/mdx.js.map +1 -0
  44. package/dist/collections/meta/loader-webpack.d.ts +6 -14
  45. package/dist/collections/meta/loader-webpack.d.ts.map +1 -0
  46. package/dist/collections/meta/loader-webpack.js +25 -39
  47. package/dist/collections/meta/loader-webpack.js.map +1 -0
  48. package/dist/collections/meta/runtime.d.ts +7 -15
  49. package/dist/collections/meta/runtime.d.ts.map +1 -0
  50. package/dist/collections/meta/runtime.js +9 -15
  51. package/dist/collections/meta/runtime.js.map +1 -0
  52. package/dist/collections/meta.d.ts +2 -10
  53. package/dist/collections/meta.js +128 -164
  54. package/dist/collections/meta.js.map +1 -0
  55. package/dist/collections/runtime/file-store.d.ts +17 -14
  56. package/dist/collections/runtime/file-store.d.ts.map +1 -0
  57. package/dist/collections/runtime/file-store.js +30 -6
  58. package/dist/collections/runtime/file-store.js.map +1 -0
  59. package/dist/collections/runtime/store.d.ts +3 -28
  60. package/dist/collections/runtime/store.js +3 -6
  61. package/dist/config/index.d.ts +2 -10
  62. package/dist/config/index.js +6 -5
  63. package/dist/config/index.js.map +1 -0
  64. package/dist/core-Bkh-SI_3.d.ts +561 -0
  65. package/dist/core-Bkh-SI_3.d.ts.map +1 -0
  66. package/dist/core-ZuoVBkeg.js +170 -0
  67. package/dist/core-ZuoVBkeg.js.map +1 -0
  68. package/dist/dynamic-B40uAtdo.js +28 -0
  69. package/dist/dynamic-B40uAtdo.js.map +1 -0
  70. package/dist/fuma-matter-O4fA6nSx.js +27 -0
  71. package/dist/fuma-matter-O4fA6nSx.js.map +1 -0
  72. package/dist/index.d.ts +13 -16
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +6 -8
  75. package/dist/load-from-file-1f4WaHsf.js +38 -0
  76. package/dist/load-from-file-1f4WaHsf.js.map +1 -0
  77. package/dist/load-from-file-BTNnBu6f.js +3 -0
  78. package/dist/loader-80abXEHx.js +4 -0
  79. package/dist/loader-BFhPyg3z.js +4 -0
  80. package/dist/loader-CXnMFuyE.js +80 -0
  81. package/dist/loader-CXnMFuyE.js.map +1 -0
  82. package/dist/loader-gk94iHf5.js +66 -0
  83. package/dist/loader-gk94iHf5.js.map +1 -0
  84. package/dist/next/index.cjs +459 -551
  85. package/dist/next/index.d.ts +16 -22
  86. package/dist/next/index.d.ts.map +1 -0
  87. package/dist/next/index.js +71 -89
  88. package/dist/next/index.js.map +1 -0
  89. package/dist/node/loader.d.ts +4 -2
  90. package/dist/node/loader.d.ts.map +1 -0
  91. package/dist/node/loader.js +32 -44
  92. package/dist/node/loader.js.map +1 -0
  93. package/dist/node-CGIIJIcs.js +31 -0
  94. package/dist/node-CGIIJIcs.js.map +1 -0
  95. package/dist/pipe-5cnvE6KY.js +31 -0
  96. package/dist/pipe-5cnvE6KY.js.map +1 -0
  97. package/dist/plugins/git.d.ts +2 -10
  98. package/dist/plugins/git.js +57 -65
  99. package/dist/plugins/git.js.map +1 -0
  100. package/dist/plugins/json-schema.d.ts +2 -10
  101. package/dist/plugins/json-schema.js +60 -58
  102. package/dist/plugins/json-schema.js.map +1 -0
  103. package/dist/plugins/with-loader/index.d.ts +2 -61
  104. package/dist/plugins/with-loader/index.js +28 -6
  105. package/dist/plugins/with-loader/index.js.map +1 -0
  106. package/dist/plugins/with-loader/webpack.d.ts +10 -18
  107. package/dist/plugins/with-loader/webpack.d.ts.map +1 -0
  108. package/dist/plugins/with-loader/webpack.js +43 -12
  109. package/dist/plugins/with-loader/webpack.js.map +1 -0
  110. package/dist/store-0LQ2PlH6.js +37 -0
  111. package/dist/store-0LQ2PlH6.js.map +1 -0
  112. package/dist/store-DEjYYF6a.d.ts +31 -0
  113. package/dist/store-DEjYYF6a.d.ts.map +1 -0
  114. package/dist/validation-BOJKRAp5.js +28 -0
  115. package/dist/validation-BOJKRAp5.js.map +1 -0
  116. package/dist/vite/index.d.ts +22 -28
  117. package/dist/vite/index.d.ts.map +1 -0
  118. package/dist/vite/index.js +37 -52
  119. package/dist/vite/index.js.map +1 -0
  120. package/dist/vite-X-2Al8fq.js +32 -0
  121. package/dist/vite-X-2Al8fq.js.map +1 -0
  122. package/package.json +7 -6
  123. package/dist/build-mdx-I4NROXCF.js +0 -8
  124. package/dist/bun-DMNX4PBC.js +0 -40
  125. package/dist/chunk-3VQS3KSP.js +0 -39
  126. package/dist/chunk-BTRE6MOX.js +0 -16
  127. package/dist/chunk-E4HRKSP4.js +0 -24
  128. package/dist/chunk-ERBMAQYP.js +0 -33
  129. package/dist/chunk-GGL4EF6H.js +0 -38
  130. package/dist/chunk-JBZTQ55D.js +0 -30
  131. package/dist/chunk-KH5GT2Y5.js +0 -104
  132. package/dist/chunk-LUM7SIZN.js +0 -40
  133. package/dist/chunk-MT7RY65Y.js +0 -167
  134. package/dist/chunk-NRZ4GE5O.js +0 -207
  135. package/dist/chunk-OQQNA7L7.js +0 -412
  136. package/dist/chunk-OUJENWQ4.js +0 -45
  137. package/dist/chunk-RMSV4HP6.js +0 -85
  138. package/dist/chunk-RXR7OL76.js +0 -37
  139. package/dist/chunk-VWJKRQZR.js +0 -19
  140. package/dist/chunk-W6HENTK7.js +0 -44
  141. package/dist/chunk-XR5N6ZXJ.js +0 -50
  142. package/dist/core-Bo8KaWQz.d.ts +0 -411
  143. package/dist/load-from-file-HL2VEY3M.js +0 -7
  144. package/dist/loader-NFSL6P5I.js +0 -7
  145. package/dist/loader-T756NSCS.js +0 -7
  146. package/dist/node-DCMYL4DL.js +0 -34
  147. package/dist/vite-QCUPZHHB.js +0 -32
@@ -1,291 +1,247 @@
1
- import {
2
- withLoader
3
- } from "../chunk-ERBMAQYP.js";
4
- import {
5
- buildFileHandler
6
- } from "../chunk-E4HRKSP4.js";
7
- import {
8
- createCollection
9
- } from "../chunk-BTRE6MOX.js";
10
- import {
11
- slash
12
- } from "../chunk-MT7RY65Y.js";
13
- import "../chunk-JBZTQ55D.js";
1
+ import { n as slash } from "../code-generator-gPtrfZ6Q.js";
2
+ import { n as pipe, t as asyncPipe } from "../pipe-5cnvE6KY.js";
3
+ import { n as validate } from "../validation-BOJKRAp5.js";
4
+ import { createCollection } from "./index.js";
5
+ import { initFileCollection } from "./handlers/fs.js";
6
+ import { withLoader } from "../plugins/with-loader/index.js";
7
+ import path from "node:path";
14
8
 
15
- // src/collections/mdx.ts
16
- import path from "path";
17
- var mdxTypeInfo = {
18
- id: "mdx",
19
- plugins: [plugin()]
9
+ //#region src/collections/mdx.ts
10
+ const mdxTypeInfo = {
11
+ id: "mdx",
12
+ plugins: [plugin()]
20
13
  };
21
- var RuntimePaths = {
22
- browser: "fuma-content/collections/mdx/runtime-browser",
23
- dynamic: "fuma-content/collections/mdx/runtime-dynamic",
24
- server: "fuma-content/collections/mdx/runtime"
14
+ const RuntimePaths = {
15
+ browser: "fuma-content/collections/mdx/runtime-browser",
16
+ dynamic: "fuma-content/collections/mdx/runtime-dynamic",
17
+ server: "fuma-content/collections/mdx/runtime"
25
18
  };
26
19
  function defineMDX(config) {
27
- const { lazy = false, dynamic = false } = config;
28
- return createCollection(mdxTypeInfo, (collection, options) => {
29
- collection.handlers.fs = buildFileHandler(options, config, ["mdx", "md"]);
30
- collection.handlers.mdx = {
31
- cwd: options.workspace ? path.resolve(options.workspace.dir) : process.cwd(),
32
- postprocess: config.postprocess,
33
- getMDXOptions: config.options,
34
- dynamic,
35
- lazy,
36
- onGenerateStore(initializer) {
37
- const mdxHandler = collection.handlers.mdx;
38
- if (mdxHandler?.postprocess?.extractLinkReferences) {
39
- this.codegen.addNamedImport(
40
- ["$extractedReferences"],
41
- RuntimePaths[this.environment]
42
- );
43
- initializer += ".$data($extractedReferences())";
44
- }
45
- return initializer;
46
- }
47
- };
48
- collection.handlers["version-control"] = {
49
- client({ client }) {
50
- const mdxHandler = collection.handlers.mdx;
51
- if (!mdxHandler) return;
52
- const { onGenerateStore, vfile } = mdxHandler;
53
- mdxHandler.onGenerateStore = function(initializer) {
54
- this.codegen.addNamedImport(
55
- ["$versionControl"],
56
- RuntimePaths[this.environment]
57
- );
58
- initializer += ".$data($versionControl())";
59
- return onGenerateStore?.call(this, initializer) ?? initializer;
60
- };
61
- mdxHandler.vfile = async function(file) {
62
- const vcData = await client.getFileData({ filePath: file.path });
63
- file.data["mdx-export"] ??= [];
64
- file.data["mdx-export"].push(
65
- {
66
- name: "lastModified",
67
- value: vcData.lastModified
68
- },
69
- {
70
- name: "creationDate",
71
- value: vcData.creationDate
72
- }
73
- );
74
- if (vfile) return vfile?.call(this, file);
75
- return file;
76
- };
77
- }
78
- };
79
- });
20
+ const { lazy = false, dynamic = false } = config;
21
+ return createCollection(mdxTypeInfo, (collection, options) => {
22
+ initFileCollection(collection, options, {
23
+ supportedFormats: ["mdx", "md"],
24
+ ...config
25
+ });
26
+ const mdxHandler = collection.handlers.mdx = {
27
+ cwd: options.workspace ? path.resolve(options.workspace.dir) : process.cwd(),
28
+ postprocess: config.postprocess,
29
+ getMDXOptions: config.options,
30
+ dynamic,
31
+ lazy,
32
+ vfile: asyncPipe(),
33
+ frontmatter: asyncPipe(),
34
+ storeInitializer: pipe()
35
+ };
36
+ if (config.frontmatter) {
37
+ const frontmatter = config.frontmatter;
38
+ mdxHandler.frontmatter.pipe((data, { filePath }) => {
39
+ return validate(frontmatter, data, void 0, `invalid frontmatter in ${filePath}`);
40
+ });
41
+ }
42
+ if (mdxHandler.postprocess?.extractLinkReferences) mdxHandler.storeInitializer.pipe((initializer, { codegen, environment }) => {
43
+ codegen.addNamedImport(["$extractedReferences"], RuntimePaths[environment]);
44
+ return `${initializer}.$data($extractedReferences())`;
45
+ });
46
+ collection.handlers["version-control"] = { client({ client }) {
47
+ const mdxHandler$1 = collection.handlers.mdx;
48
+ if (!mdxHandler$1) return;
49
+ mdxHandler$1.storeInitializer.pipe((initializer, { codegen, environment }) => {
50
+ codegen.addNamedImport(["$versionControl"], RuntimePaths[environment]);
51
+ return `${initializer}.$data($versionControl())`;
52
+ });
53
+ mdxHandler$1.vfile.pipe(async (file) => {
54
+ const vcData = await client.getFileData({ filePath: file.path });
55
+ file.data["mdx-export"] ??= [];
56
+ file.data["mdx-export"].push({
57
+ name: "lastModified",
58
+ value: vcData.lastModified
59
+ }, {
60
+ name: "creationDate",
61
+ value: vcData.creationDate
62
+ });
63
+ return file;
64
+ });
65
+ } };
66
+ });
80
67
  }
81
68
  function plugin() {
82
- const mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
83
- function generateDocCollectionFrontmatterGlob(context, collection, eager = false) {
84
- const handler = collection.handlers.fs;
85
- if (!handler) return "";
86
- return context.codegen.generateGlobImport(handler.patterns, {
87
- query: {
88
- collection: collection.name,
89
- only: "frontmatter",
90
- workspace: context.workspace
91
- },
92
- import: "frontmatter",
93
- base: handler.dir,
94
- eager
95
- });
96
- }
97
- function generateDocCollectionGlob(context, collection, eager = false) {
98
- const handler = collection.handlers.fs;
99
- if (!handler) return "";
100
- return context.codegen.generateGlobImport(handler.patterns, {
101
- query: {
102
- collection: collection.name,
103
- workspace: context.workspace
104
- },
105
- base: handler.dir,
106
- eager
107
- });
108
- }
109
- async function generateCollectionStoreServer(context, collection) {
110
- const mdxHandler = collection.handlers.mdx;
111
- const fsHandler = collection.handlers.fs;
112
- if (!fsHandler || !mdxHandler) return;
113
- const { core, codegen } = context;
114
- const runtimePath = RuntimePaths.server;
115
- const base2 = slash(path.relative(process.cwd(), fsHandler.dir));
116
- let initializer;
117
- codegen.addNamespaceImport(
118
- "Config",
119
- codegen.formatImportPath(core.getOptions().configPath),
120
- true
121
- );
122
- if (mdxHandler.lazy) {
123
- codegen.addNamedImport(["mdxStoreLazy"], runtimePath);
124
- const [headGlob, bodyGlob] = await Promise.all([
125
- generateDocCollectionFrontmatterGlob(context, collection, true),
126
- generateDocCollectionGlob(context, collection)
127
- ]);
128
- initializer = `mdxStoreLazy<typeof Config, "${collection.name}">("${collection.name}", "${base2}", { head: ${headGlob}, body: ${bodyGlob} })`;
129
- } else {
130
- codegen.addNamedImport(["mdxStore"], runtimePath);
131
- initializer = `mdxStore<typeof Config, "${collection.name}">("${collection.name}", "${base2}", ${await generateDocCollectionGlob(context, collection, true)})`;
132
- }
133
- initializer = mdxHandler.onGenerateStore?.call(
134
- { ...context, environment: "server" },
135
- initializer
136
- ) ?? initializer;
137
- codegen.push(`export const ${collection.name} = ${initializer};`);
138
- }
139
- async function generateCollectionStoreBrowser(context, collection) {
140
- const mdxHandler = collection.handlers.mdx;
141
- const fsHandler = collection.handlers.fs;
142
- if (!fsHandler || !mdxHandler) return;
143
- const { core, codegen } = context;
144
- const runtimePath = RuntimePaths.browser;
145
- codegen.addNamedImport(["mdxStoreBrowser"], runtimePath);
146
- codegen.addNamespaceImport(
147
- "Config",
148
- codegen.formatImportPath(core.getOptions().configPath),
149
- true
150
- );
151
- let initializer = `mdxStoreBrowser<typeof Config, "${collection.name}">("${collection.name}", ${await generateDocCollectionGlob(context, collection)})`;
152
- initializer = mdxHandler.onGenerateStore?.call(
153
- { ...context, environment: "browser" },
154
- initializer
155
- ) ?? initializer;
156
- codegen.push(`export const ${collection.name} = ${initializer};`);
157
- }
158
- async function generateCollectionStoreDynamic(context, collection) {
159
- const mdxHandler = collection.handlers.mdx;
160
- const fsHandler = collection.handlers.fs;
161
- if (!fsHandler || !mdxHandler || !mdxHandler.dynamic) return;
162
- const { core, codegen } = context;
163
- const { configPath, workspace, outDir } = core.getOptions();
164
- const runtimePath = RuntimePaths.dynamic;
165
- const base2 = slash(path.relative(process.cwd(), fsHandler.dir));
166
- codegen.addNamespaceImport(
167
- "Config",
168
- codegen.formatImportPath(core.getOptions().configPath)
169
- );
170
- codegen.addNamedImport(["mdxStoreDynamic"], runtimePath);
171
- const coreOptions = {
172
- configPath,
173
- workspace,
174
- outDir
175
- };
176
- let initializer = `mdxStoreDynamic<typeof Config, "${collection.name}">(Config, ${JSON.stringify(
177
- coreOptions
178
- )}, "${collection.name}", "${base2}", ${await generateDocCollectionFrontmatterGlob(context, collection, true)})`;
179
- initializer = mdxHandler.onGenerateStore?.call(
180
- { ...context, environment: "dynamic" },
181
- initializer
182
- ) ?? initializer;
183
- codegen.push(`export const ${collection.name} = ${initializer};`);
184
- }
185
- const base = {
186
- name: "mdx",
187
- configureServer(server) {
188
- if (!server.watcher) return;
189
- server.watcher.on("all", async (event, file) => {
190
- const updatedCollection = this.core.getCollections().find((collection) => {
191
- const handlers = collection.handlers;
192
- if (!handlers.mdx || !handlers.fs) return false;
193
- if (event === "change" && !handlers.mdx.dynamic) return false;
194
- return handlers.fs.hasFile(file);
195
- });
196
- if (!updatedCollection) return;
197
- await this.core.emit({
198
- filterPlugin: (plugin2) => plugin2.name === base.name,
199
- filterWorkspace: () => false,
200
- write: true
201
- });
202
- });
203
- },
204
- emit() {
205
- return Promise.all([
206
- this.createCodeGenerator("mdx.ts", async (ctx) => {
207
- for (const collection of this.core.getCollections()) {
208
- await generateCollectionStoreServer(ctx, collection);
209
- }
210
- }),
211
- this.createCodeGenerator("mdx-browser.ts", async (ctx) => {
212
- for (const collection of this.core.getCollections()) {
213
- await generateCollectionStoreBrowser(ctx, collection);
214
- }
215
- ctx.codegen.push(
216
- `export { useRenderer } from "${RuntimePaths.browser}";`
217
- );
218
- }),
219
- this.createCodeGenerator("mdx-dynamic.ts", async (ctx) => {
220
- for (const collection of this.core.getCollections()) {
221
- await generateCollectionStoreDynamic(ctx, collection);
222
- }
223
- })
224
- ]);
225
- },
226
- next: {
227
- config(nextConfig) {
228
- const { configPath, outDir } = this.core.getOptions();
229
- const loaderPath = "fuma-content/collections/mdx/loader-webpack";
230
- const loaderOptions = {
231
- configPath,
232
- outDir,
233
- absoluteCompiledConfigPath: path.resolve(
234
- this.core.getCompiledConfigPath()
235
- ),
236
- isDev: process.env.NODE_ENV === "development"
237
- };
238
- return {
239
- ...nextConfig,
240
- turbopack: {
241
- ...nextConfig.turbopack,
242
- rules: {
243
- ...nextConfig.turbopack?.rules,
244
- "*.{md,mdx}": {
245
- loaders: [
246
- {
247
- loader: loaderPath,
248
- options: loaderOptions
249
- }
250
- ],
251
- as: "*.js"
252
- }
253
- }
254
- },
255
- pageExtensions: [
256
- ...nextConfig.pageExtensions ?? ["js", "jsx", "tsx", "ts"],
257
- "mdx",
258
- "md"
259
- ],
260
- webpack(config, options) {
261
- config.module ||= {};
262
- config.module.rules ||= [];
263
- config.module.rules.push({
264
- test: mdxLoaderGlob,
265
- use: [
266
- options.defaultLoaders.babel,
267
- {
268
- loader: loaderPath,
269
- options: loaderOptions
270
- }
271
- ]
272
- });
273
- return nextConfig.webpack?.(config, options) ?? config;
274
- }
275
- };
276
- }
277
- }
278
- };
279
- return withLoader(base, {
280
- test: mdxLoaderGlob,
281
- async createLoader() {
282
- const { createMdxLoader } = await import("../loader-NFSL6P5I.js");
283
- return createMdxLoader({
284
- getCore: () => this.core
285
- });
286
- }
287
- });
69
+ const mdxLoaderGlob = /\.mdx?(\?.+?)?$/;
70
+ function generateDocCollectionFrontmatterGlob(context, collection, eager = false) {
71
+ const handler = collection.handlers.fs;
72
+ if (!handler) return "";
73
+ return context.codegen.generateGlobImport(handler.patterns, {
74
+ query: {
75
+ collection: collection.name,
76
+ only: "frontmatter",
77
+ workspace: context.workspace
78
+ },
79
+ import: "frontmatter",
80
+ base: handler.dir,
81
+ eager
82
+ });
83
+ }
84
+ function generateDocCollectionGlob(context, collection, eager = false) {
85
+ const handler = collection.handlers.fs;
86
+ if (!handler) return "";
87
+ return context.codegen.generateGlobImport(handler.patterns, {
88
+ query: {
89
+ collection: collection.name,
90
+ workspace: context.workspace
91
+ },
92
+ base: handler.dir,
93
+ eager
94
+ });
95
+ }
96
+ async function generateCollectionStoreServer(context, collection) {
97
+ const mdxHandler = collection.handlers.mdx;
98
+ const fsHandler = collection.handlers.fs;
99
+ if (!fsHandler || !mdxHandler) return;
100
+ const { core, codegen } = context;
101
+ const runtimePath = RuntimePaths.server;
102
+ const base$1 = slash(path.relative(process.cwd(), fsHandler.dir));
103
+ let initializer;
104
+ codegen.addNamespaceImport("Config", codegen.formatImportPath(core.getOptions().configPath), true);
105
+ if (mdxHandler.lazy) {
106
+ codegen.addNamedImport(["mdxStoreLazy"], runtimePath);
107
+ const [headGlob, bodyGlob] = await Promise.all([generateDocCollectionFrontmatterGlob(context, collection, true), generateDocCollectionGlob(context, collection)]);
108
+ initializer = `mdxStoreLazy<typeof Config, "${collection.name}">("${collection.name}", "${base$1}", { head: ${headGlob}, body: ${bodyGlob} })`;
109
+ } else {
110
+ codegen.addNamedImport(["mdxStore"], runtimePath);
111
+ initializer = `mdxStore<typeof Config, "${collection.name}">("${collection.name}", "${base$1}", ${await generateDocCollectionGlob(context, collection, true)})`;
112
+ }
113
+ initializer = mdxHandler.storeInitializer.run(initializer, {
114
+ ...context,
115
+ environment: "server"
116
+ });
117
+ codegen.push(`export const ${collection.name} = ${initializer};`);
118
+ }
119
+ async function generateCollectionStoreBrowser(context, collection) {
120
+ const mdxHandler = collection.handlers.mdx;
121
+ if (!collection.handlers.fs || !mdxHandler) return;
122
+ const { core, codegen } = context;
123
+ const runtimePath = RuntimePaths.browser;
124
+ codegen.addNamedImport(["mdxStoreBrowser"], runtimePath);
125
+ codegen.addNamespaceImport("Config", codegen.formatImportPath(core.getOptions().configPath), true);
126
+ let initializer = `mdxStoreBrowser<typeof Config, "${collection.name}">("${collection.name}", ${await generateDocCollectionGlob(context, collection)})`;
127
+ initializer = mdxHandler.storeInitializer.run(initializer, {
128
+ ...context,
129
+ environment: "browser"
130
+ });
131
+ codegen.push(`export const ${collection.name} = ${initializer};`);
132
+ }
133
+ async function generateCollectionStoreDynamic(context, collection) {
134
+ const mdxHandler = collection.handlers.mdx;
135
+ const fsHandler = collection.handlers.fs;
136
+ if (!fsHandler || !mdxHandler || !mdxHandler.dynamic) return;
137
+ const { core, codegen } = context;
138
+ const { configPath, workspace, outDir } = core.getOptions();
139
+ const runtimePath = RuntimePaths.dynamic;
140
+ const base$1 = slash(path.relative(process.cwd(), fsHandler.dir));
141
+ codegen.addNamespaceImport("Config", codegen.formatImportPath(core.getOptions().configPath));
142
+ codegen.addNamedImport(["mdxStoreDynamic"], runtimePath);
143
+ const coreOptions = {
144
+ configPath,
145
+ workspace,
146
+ outDir
147
+ };
148
+ let initializer = `mdxStoreDynamic<typeof Config, "${collection.name}">(Config, ${JSON.stringify(coreOptions)}, "${collection.name}", "${base$1}", ${await generateDocCollectionFrontmatterGlob(context, collection, true)})`;
149
+ initializer = mdxHandler.storeInitializer.run(initializer, {
150
+ ...context,
151
+ environment: "dynamic"
152
+ });
153
+ codegen.push(`export const ${collection.name} = ${initializer};`);
154
+ }
155
+ const base = {
156
+ name: "mdx",
157
+ configureServer(server) {
158
+ if (!server.watcher) return;
159
+ server.watcher.on("all", async (event, file) => {
160
+ if (!this.core.getCollections().find((collection) => {
161
+ const handlers = collection.handlers;
162
+ if (!handlers.mdx || !handlers.fs) return false;
163
+ if (event === "change" && !handlers.mdx.dynamic) return false;
164
+ return handlers.fs.hasFile(file);
165
+ })) return;
166
+ await this.core.emit({
167
+ filterPlugin: (plugin$1) => plugin$1.name === base.name,
168
+ filterWorkspace: () => false,
169
+ write: true
170
+ });
171
+ });
172
+ },
173
+ emit() {
174
+ return Promise.all([
175
+ this.createCodeGenerator("mdx.ts", async (ctx) => {
176
+ for (const collection of this.core.getCollections()) await generateCollectionStoreServer(ctx, collection);
177
+ }),
178
+ this.createCodeGenerator("mdx-browser.ts", async (ctx) => {
179
+ for (const collection of this.core.getCollections()) await generateCollectionStoreBrowser(ctx, collection);
180
+ ctx.codegen.push(`export { useRenderer } from "${RuntimePaths.browser}";`);
181
+ }),
182
+ this.createCodeGenerator("mdx-dynamic.ts", async (ctx) => {
183
+ for (const collection of this.core.getCollections()) await generateCollectionStoreDynamic(ctx, collection);
184
+ })
185
+ ]);
186
+ },
187
+ next: { config(nextConfig) {
188
+ const { configPath, outDir } = this.core.getOptions();
189
+ const loaderPath = "fuma-content/collections/mdx/loader-webpack";
190
+ const loaderOptions = {
191
+ configPath,
192
+ outDir,
193
+ absoluteCompiledConfigPath: path.resolve(this.core.getCompiledConfigPath()),
194
+ isDev: process.env.NODE_ENV === "development"
195
+ };
196
+ return {
197
+ ...nextConfig,
198
+ turbopack: {
199
+ ...nextConfig.turbopack,
200
+ rules: {
201
+ ...nextConfig.turbopack?.rules,
202
+ "*.{md,mdx}": {
203
+ loaders: [{
204
+ loader: loaderPath,
205
+ options: loaderOptions
206
+ }],
207
+ as: "*.js"
208
+ }
209
+ }
210
+ },
211
+ pageExtensions: [
212
+ ...nextConfig.pageExtensions ?? [
213
+ "js",
214
+ "jsx",
215
+ "tsx",
216
+ "ts"
217
+ ],
218
+ "mdx",
219
+ "md"
220
+ ],
221
+ webpack(config, options) {
222
+ config.module ||= {};
223
+ config.module.rules ||= [];
224
+ config.module.rules.push({
225
+ test: mdxLoaderGlob,
226
+ use: [options.defaultLoaders.babel, {
227
+ loader: loaderPath,
228
+ options: loaderOptions
229
+ }]
230
+ });
231
+ return nextConfig.webpack?.(config, options) ?? config;
232
+ }
233
+ };
234
+ } }
235
+ };
236
+ return withLoader(base, {
237
+ test: mdxLoaderGlob,
238
+ async createLoader() {
239
+ const { createMdxLoader } = await import("../loader-80abXEHx.js");
240
+ return createMdxLoader({ getCore: () => this.core });
241
+ }
242
+ });
288
243
  }
289
- export {
290
- defineMDX
291
- };
244
+
245
+ //#endregion
246
+ export { defineMDX };
247
+ //# sourceMappingURL=mdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.js","names":["mdxTypeInfo: CollectionTypeInfo","mdxHandler","base","initializer: string","coreOptions: CoreOptions","base: Plugin","plugin","loaderOptions: WebpackLoaderOptions"],"sources":["../../src/collections/mdx.ts"],"sourcesContent":["import {\n type Collection,\n type CollectionTypeInfo,\n createCollection,\n} from \"@/collections\";\nimport {\n type FileHandlerConfig,\n initFileCollection,\n} from \"@/collections/handlers/fs\";\nimport type { PostprocessOptions } from \"@/collections/mdx/remark-postprocess\";\nimport type { CoreOptions, EmitCodeGeneratorContext, Plugin } from \"@/core\";\nimport type { ProcessorOptions } from \"@mdx-js/mdx\";\nimport path from \"node:path\";\nimport type { VFile } from \"vfile\";\nimport type { TurbopackLoaderOptions } from \"next/dist/server/config-shared\";\nimport type { Configuration } from \"webpack\";\nimport type { WebpackLoaderOptions } from \"@/plugins/with-loader/webpack\";\nimport { withLoader } from \"@/plugins/with-loader\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { PreprocessOptions } from \"@/collections/mdx/remark-preprocess\";\nimport { slash } from \"@/utils/code-generator\";\nimport { validate } from \"@/utils/validation\";\nimport type { Awaitable } from \"@/types\";\nimport { type AsyncPipe, asyncPipe, type Pipe, pipe } from \"@/utils/pipe\";\n\ninterface CompilationContext {\n collection: Collection;\n filePath: string;\n source: string;\n}\n\nexport interface MDXCollectionHandler {\n readonly cwd: string;\n readonly dynamic: boolean;\n readonly lazy: boolean;\n\n preprocess?: PreprocessOptions;\n postprocess?: Partial<PostprocessOptions>;\n getMDXOptions?: (\n environment: \"bundler\" | \"runtime\",\n ) => Awaitable<ProcessorOptions>;\n\n /**\n * Transform & validate frontmatter\n */\n frontmatter: AsyncPipe<\n Record<string, unknown> | undefined,\n CompilationContext\n >;\n\n /**\n * Transform `vfile` on compilation stage\n */\n vfile: AsyncPipe<VFile, CompilationContext>;\n\n /**\n * Transform the initializer code (TypeScript) for collection store\n */\n storeInitializer: Pipe<\n string,\n EmitCodeGeneratorContext & {\n environment: \"browser\" | \"server\" | \"dynamic\";\n }\n >;\n}\n\nexport interface MDXCollectionConfig<\n FrontmatterSchema extends StandardSchemaV1 | undefined = undefined,\n> extends FileHandlerConfig {\n postprocess?: Partial<PostprocessOptions>;\n frontmatter?: FrontmatterSchema;\n options?: (environment: \"bundler\" | \"runtime\") => Awaitable<ProcessorOptions>;\n lazy?: boolean;\n dynamic?: boolean;\n}\n\nexport interface MDXCollection<Frontmatter> extends Collection {\n _frontmatter?: Frontmatter;\n}\n\nconst mdxTypeInfo: CollectionTypeInfo = {\n id: \"mdx\",\n plugins: [plugin()],\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\nexport function defineMDX<\n FrontmatterSchema extends StandardSchemaV1 | undefined = undefined,\n>(\n config: MDXCollectionConfig<FrontmatterSchema>,\n): MDXCollection<\n FrontmatterSchema extends StandardSchemaV1\n ? StandardSchemaV1.InferOutput<FrontmatterSchema>\n : Record<string, unknown>\n> {\n const { lazy = false, dynamic = false } = config;\n return createCollection(mdxTypeInfo, (collection, options) => {\n initFileCollection(collection, options, {\n supportedFormats: [\"mdx\", \"md\"],\n ...config,\n });\n const mdxHandler = (collection.handlers.mdx = {\n cwd: options.workspace\n ? path.resolve(options.workspace.dir)\n : process.cwd(),\n postprocess: config.postprocess,\n getMDXOptions: config.options,\n dynamic,\n lazy: lazy,\n vfile: asyncPipe(),\n frontmatter: asyncPipe(),\n storeInitializer: pipe(),\n });\n\n if (config.frontmatter) {\n const frontmatter = config.frontmatter;\n mdxHandler.frontmatter.pipe((data, { filePath }) => {\n return validate(\n frontmatter,\n data,\n undefined,\n `invalid frontmatter in ${filePath}`,\n ) as Promise<Record<string, unknown>>;\n });\n }\n\n if (mdxHandler.postprocess?.extractLinkReferences) {\n mdxHandler.storeInitializer.pipe(\n (initializer, { codegen, environment }) => {\n codegen.addNamedImport(\n [\"$extractedReferences\"],\n RuntimePaths[environment],\n );\n return `${initializer}.$data($extractedReferences())`;\n },\n );\n }\n\n collection.handlers[\"version-control\"] = {\n client({ client }) {\n const mdxHandler = collection.handlers.mdx;\n if (!mdxHandler) return;\n\n mdxHandler.storeInitializer.pipe(\n (initializer, { codegen, environment }) => {\n codegen.addNamedImport(\n [\"$versionControl\"],\n RuntimePaths[environment],\n );\n return `${initializer}.$data($versionControl())`;\n },\n );\n\n mdxHandler.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 });\n}\n\nfunction plugin(): Plugin {\n const mdxLoaderGlob = /\\.mdx?(\\?.+?)?$/;\n\n function generateDocCollectionFrontmatterGlob(\n context: EmitCodeGeneratorContext,\n collection: Collection,\n eager = false,\n ) {\n const handler = collection.handlers.fs;\n if (!handler) return \"\";\n return context.codegen.generateGlobImport(handler.patterns, {\n query: {\n collection: collection.name,\n only: \"frontmatter\",\n workspace: context.workspace,\n },\n import: \"frontmatter\",\n base: handler.dir,\n eager,\n });\n }\n\n function generateDocCollectionGlob(\n context: EmitCodeGeneratorContext,\n collection: Collection,\n eager = false,\n ) {\n const handler = collection.handlers.fs;\n if (!handler) return \"\";\n return context.codegen.generateGlobImport(handler.patterns, {\n query: {\n collection: collection.name,\n workspace: context.workspace,\n },\n base: handler.dir,\n eager,\n });\n }\n\n async function generateCollectionStoreServer(\n context: EmitCodeGeneratorContext,\n collection: Collection,\n ) {\n const mdxHandler = collection.handlers.mdx;\n const fsHandler = collection.handlers.fs;\n if (!fsHandler || !mdxHandler) return;\n const { core, codegen } = context;\n const runtimePath = RuntimePaths.server;\n const base = slash(path.relative(process.cwd(), fsHandler.dir));\n let initializer: string;\n codegen.addNamespaceImport(\n \"Config\",\n codegen.formatImportPath(core.getOptions().configPath),\n true,\n );\n\n if (mdxHandler.lazy) {\n codegen.addNamedImport([\"mdxStoreLazy\"], runtimePath);\n const [headGlob, bodyGlob] = await Promise.all([\n generateDocCollectionFrontmatterGlob(context, collection, true),\n generateDocCollectionGlob(context, collection),\n ]);\n\n initializer = `mdxStoreLazy<typeof Config, \"${collection.name}\">(\"${collection.name}\", \"${base}\", { head: ${headGlob}, body: ${bodyGlob} })`;\n } else {\n codegen.addNamedImport([\"mdxStore\"], runtimePath);\n initializer = `mdxStore<typeof Config, \"${collection.name}\">(\"${collection.name}\", \"${base}\", ${await generateDocCollectionGlob(context, collection, true)})`;\n }\n\n initializer = mdxHandler.storeInitializer.run(initializer, {\n ...context,\n environment: \"server\",\n });\n codegen.push(`export const ${collection.name} = ${initializer};`);\n }\n\n async function generateCollectionStoreBrowser(\n context: EmitCodeGeneratorContext,\n collection: Collection,\n ) {\n const mdxHandler = collection.handlers.mdx;\n const fsHandler = collection.handlers.fs;\n if (!fsHandler || !mdxHandler) return;\n const { core, codegen } = context;\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 initializer = `mdxStoreBrowser<typeof Config, \"${collection.name}\">(\"${collection.name}\", ${await generateDocCollectionGlob(context, collection)})`;\n\n initializer = mdxHandler.storeInitializer.run(initializer, {\n ...context,\n environment: \"browser\",\n });\n codegen.push(`export const ${collection.name} = ${initializer};`);\n }\n\n async function generateCollectionStoreDynamic(\n context: EmitCodeGeneratorContext,\n collection: Collection,\n ) {\n const mdxHandler = collection.handlers.mdx;\n const fsHandler = collection.handlers.fs;\n if (!fsHandler || !mdxHandler || !mdxHandler.dynamic) return;\n const { core, codegen } = context;\n const { configPath, workspace, outDir } = core.getOptions();\n const runtimePath = RuntimePaths.dynamic;\n const base = slash(path.relative(process.cwd(), fsHandler.dir));\n codegen.addNamespaceImport(\n \"Config\",\n codegen.formatImportPath(core.getOptions().configPath),\n );\n codegen.addNamedImport([\"mdxStoreDynamic\"], runtimePath);\n\n const coreOptions: CoreOptions = {\n configPath,\n workspace,\n outDir,\n };\n let initializer = `mdxStoreDynamic<typeof Config, \"${collection.name}\">(Config, ${JSON.stringify(\n coreOptions,\n )}, \"${collection.name}\", \"${base}\", ${await generateDocCollectionFrontmatterGlob(context, collection, true)})`;\n\n initializer = mdxHandler.storeInitializer.run(initializer, {\n ...context,\n environment: \"dynamic\",\n });\n codegen.push(`export const ${collection.name} = ${initializer};`);\n }\n\n const base: Plugin = {\n name: \"mdx\",\n configureServer(server) {\n if (!server.watcher) return;\n\n server.watcher.on(\"all\", async (event, file) => {\n const updatedCollection = this.core\n .getCollections()\n .find((collection) => {\n const handlers = collection.handlers;\n if (!handlers.mdx || !handlers.fs) return false;\n if (event === \"change\" && !handlers.mdx.dynamic) return false;\n return handlers.fs.hasFile(file);\n });\n\n if (!updatedCollection) return;\n await this.core.emit({\n filterPlugin: (plugin) => plugin.name === base.name,\n filterWorkspace: () => false,\n write: true,\n });\n });\n },\n emit() {\n return Promise.all([\n this.createCodeGenerator(\"mdx.ts\", async (ctx) => {\n for (const collection of this.core.getCollections()) {\n await generateCollectionStoreServer(ctx, collection);\n }\n }),\n\n this.createCodeGenerator(\"mdx-browser.ts\", async (ctx) => {\n for (const collection of this.core.getCollections()) {\n await generateCollectionStoreBrowser(ctx, collection);\n }\n\n ctx.codegen.push(\n `export { useRenderer } from \"${RuntimePaths.browser}\";`,\n );\n }),\n\n this.createCodeGenerator(\"mdx-dynamic.ts\", async (ctx) => {\n for (const collection of this.core.getCollections()) {\n await generateCollectionStoreDynamic(ctx, collection);\n }\n }),\n ]);\n },\n next: {\n config(nextConfig) {\n const { configPath, outDir } = this.core.getOptions();\n const loaderPath = \"fuma-content/collections/mdx/loader-webpack\";\n const loaderOptions: WebpackLoaderOptions = {\n configPath,\n outDir,\n absoluteCompiledConfigPath: path.resolve(\n this.core.getCompiledConfigPath(),\n ),\n isDev: process.env.NODE_ENV === \"development\",\n };\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: [\n ...(nextConfig.pageExtensions ?? [\"js\", \"jsx\", \"tsx\", \"ts\"]),\n \"mdx\",\n \"md\",\n ],\n webpack(config: Configuration, options) {\n config.module ||= {};\n config.module.rules ||= [];\n config.module.rules.push({\n test: mdxLoaderGlob,\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 },\n };\n\n return withLoader(base, {\n test: mdxLoaderGlob,\n async createLoader() {\n const { createMdxLoader } = await import(\"./mdx/loader\");\n return createMdxLoader({\n getCore: () => this.core,\n });\n },\n });\n}\n\nexport type { ExtractedReference } from \"@/collections/mdx/remark-postprocess\";\nexport type { CompiledMDXData, CompiledMDX } from \"@/collections/mdx/build-mdx\";\n"],"mappings":";;;;;;;;;AAgFA,MAAMA,cAAkC;CACtC,IAAI;CACJ,SAAS,CAAC,QAAQ,CAAC;CACpB;AAED,MAAM,eAAe;CACnB,SAAS;CACT,SAAS;CACT,QAAQ;CACT;AAED,SAAgB,UAGd,QAKA;CACA,MAAM,EAAE,OAAO,OAAO,UAAU,UAAU;AAC1C,QAAO,iBAAiB,cAAc,YAAY,YAAY;AAC5D,qBAAmB,YAAY,SAAS;GACtC,kBAAkB,CAAC,OAAO,KAAK;GAC/B,GAAG;GACJ,CAAC;EACF,MAAM,aAAc,WAAW,SAAS,MAAM;GAC5C,KAAK,QAAQ,YACT,KAAK,QAAQ,QAAQ,UAAU,IAAI,GACnC,QAAQ,KAAK;GACjB,aAAa,OAAO;GACpB,eAAe,OAAO;GACtB;GACM;GACN,OAAO,WAAW;GAClB,aAAa,WAAW;GACxB,kBAAkB,MAAM;GACzB;AAED,MAAI,OAAO,aAAa;GACtB,MAAM,cAAc,OAAO;AAC3B,cAAW,YAAY,M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tC,YAAO,WAAW,EAAE;AACpB,YAAO,OAAO,UAAU,EAAE;AAC1B,YAAO,OAAO,MAAM,KAAK;MACvB,MAAM;MACN,KAAK,CACH,QAAQ,eAAe,OACvB;OACE,QAAQ;OACR,SAAS;OACV,CACF;MACF,CAAC;AAEF,YAAO,WAAW,UAAU,QAAQ,QAAQ,IAAI;;IAEnD;KAEJ;EACF;AAED,QAAO,WAAW,MAAM;EACtB,MAAM;EACN,MAAM,eAAe;GACnB,MAAM,EAAE,oBAAoB,MAAM,OAAO;AACzC,UAAO,gBAAgB,EACrB,eAAe,KAAK,MACrB,CAAC;;EAEL,CAAC"}
@@ -1,17 +1,9 @@
1
- import { LoaderContext } from 'webpack';
2
- import { WebpackLoaderOptions } from '../../plugins/with-loader/webpack.js';
3
- import '../../plugins/with-loader/index.js';
4
- import '../../core-Bo8KaWQz.js';
5
- import 'chokidar';
6
- import '@mdx-js/mdx';
7
- import 'vfile';
8
- import '@standard-schema/spec';
9
- import 'unified';
10
- import 'mdast';
11
- import 'vite';
12
- import 'next';
13
- import 'node:module';
1
+ import "../../core-Bkh-SI_3.js";
2
+ import { WebpackLoaderOptions } from "../../plugins/with-loader/webpack.js";
3
+ import { LoaderContext } from "webpack";
14
4
 
5
+ //#region src/collections/meta/loader-webpack.d.ts
15
6
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string): Promise<void>;
16
-
7
+ //#endregion
17
8
  export { loader as default };
9
+ //# sourceMappingURL=loader-webpack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader-webpack.d.ts","names":[],"sources":["../../../src/collections/meta/loader-webpack.ts"],"sourcesContent":[],"mappings":";;;;;iBAY8B,MAAA,OACtB,cAAc,wCAEnB"}