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.
- package/dist/async-cache-BM9Yf4Nw.js +29 -0
- package/dist/async-cache-BM9Yf4Nw.js.map +1 -0
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +21 -14
- package/dist/bin.js.map +1 -0
- package/dist/build-D8A5ByFk.js +42 -0
- package/dist/build-D8A5ByFk.js.map +1 -0
- package/dist/build-mdx-C1PZsGp2.js +395 -0
- package/dist/build-mdx-C1PZsGp2.js.map +1 -0
- package/dist/build-mdx-DFndaVbS.js +4 -0
- package/dist/bun/index.d.ts +6 -13
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +23 -34
- package/dist/bun/index.js.map +1 -0
- package/dist/bun-QKQnqgIi.js +35 -0
- package/dist/bun-QKQnqgIi.js.map +1 -0
- package/dist/code-generator-gPtrfZ6Q.js +133 -0
- package/dist/code-generator-gPtrfZ6Q.js.map +1 -0
- package/dist/collections/handlers/fs.d.ts +2 -10
- package/dist/collections/handlers/fs.js +28 -6
- package/dist/collections/handlers/fs.js.map +1 -0
- package/dist/collections/index.d.ts +2 -10
- package/dist/collections/index.js +16 -6
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/mdx/loader-webpack.d.ts +6 -14
- package/dist/collections/mdx/loader-webpack.d.ts.map +1 -0
- package/dist/collections/mdx/loader-webpack.js +23 -36
- package/dist/collections/mdx/loader-webpack.js.map +1 -0
- package/dist/collections/mdx/runtime-browser.d.ts +27 -37
- package/dist/collections/mdx/runtime-browser.d.ts.map +1 -0
- package/dist/collections/mdx/runtime-browser.js +57 -70
- package/dist/collections/mdx/runtime-browser.js.map +1 -0
- package/dist/collections/mdx/runtime-dynamic.d.ts +22 -30
- package/dist/collections/mdx/runtime-dynamic.d.ts.map +1 -0
- package/dist/collections/mdx/runtime-dynamic.js +63 -85
- package/dist/collections/mdx/runtime-dynamic.js.map +1 -0
- package/dist/collections/mdx/runtime.d.ts +31 -52
- package/dist/collections/mdx/runtime.d.ts.map +1 -0
- package/dist/collections/mdx/runtime.js +24 -34
- package/dist/collections/mdx/runtime.js.map +1 -0
- package/dist/collections/mdx.d.ts +2 -10
- package/dist/collections/mdx.js +240 -284
- package/dist/collections/mdx.js.map +1 -0
- package/dist/collections/meta/loader-webpack.d.ts +6 -14
- package/dist/collections/meta/loader-webpack.d.ts.map +1 -0
- package/dist/collections/meta/loader-webpack.js +25 -39
- package/dist/collections/meta/loader-webpack.js.map +1 -0
- package/dist/collections/meta/runtime.d.ts +7 -15
- package/dist/collections/meta/runtime.d.ts.map +1 -0
- package/dist/collections/meta/runtime.js +9 -15
- package/dist/collections/meta/runtime.js.map +1 -0
- package/dist/collections/meta.d.ts +2 -10
- package/dist/collections/meta.js +128 -164
- package/dist/collections/meta.js.map +1 -0
- package/dist/collections/runtime/file-store.d.ts +17 -14
- package/dist/collections/runtime/file-store.d.ts.map +1 -0
- package/dist/collections/runtime/file-store.js +30 -6
- package/dist/collections/runtime/file-store.js.map +1 -0
- package/dist/collections/runtime/store.d.ts +3 -28
- package/dist/collections/runtime/store.js +3 -6
- package/dist/config/index.d.ts +2 -10
- package/dist/config/index.js +6 -5
- package/dist/config/index.js.map +1 -0
- package/dist/core-Bkh-SI_3.d.ts +561 -0
- package/dist/core-Bkh-SI_3.d.ts.map +1 -0
- package/dist/core-ZuoVBkeg.js +170 -0
- package/dist/core-ZuoVBkeg.js.map +1 -0
- package/dist/dynamic-B40uAtdo.js +28 -0
- package/dist/dynamic-B40uAtdo.js.map +1 -0
- package/dist/fuma-matter-O4fA6nSx.js +27 -0
- package/dist/fuma-matter-O4fA6nSx.js.map +1 -0
- package/dist/index.d.ts +13 -16
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -8
- package/dist/load-from-file-1f4WaHsf.js +38 -0
- package/dist/load-from-file-1f4WaHsf.js.map +1 -0
- package/dist/load-from-file-BTNnBu6f.js +3 -0
- package/dist/loader-80abXEHx.js +4 -0
- package/dist/loader-BFhPyg3z.js +4 -0
- package/dist/loader-CXnMFuyE.js +80 -0
- package/dist/loader-CXnMFuyE.js.map +1 -0
- package/dist/loader-gk94iHf5.js +66 -0
- package/dist/loader-gk94iHf5.js.map +1 -0
- package/dist/next/index.cjs +459 -551
- package/dist/next/index.d.ts +16 -22
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +71 -89
- package/dist/next/index.js.map +1 -0
- package/dist/node/loader.d.ts +4 -2
- package/dist/node/loader.d.ts.map +1 -0
- package/dist/node/loader.js +32 -44
- package/dist/node/loader.js.map +1 -0
- package/dist/node-CGIIJIcs.js +31 -0
- package/dist/node-CGIIJIcs.js.map +1 -0
- package/dist/pipe-5cnvE6KY.js +31 -0
- package/dist/pipe-5cnvE6KY.js.map +1 -0
- package/dist/plugins/git.d.ts +2 -10
- package/dist/plugins/git.js +57 -65
- package/dist/plugins/git.js.map +1 -0
- package/dist/plugins/json-schema.d.ts +2 -10
- package/dist/plugins/json-schema.js +60 -58
- package/dist/plugins/json-schema.js.map +1 -0
- package/dist/plugins/with-loader/index.d.ts +2 -61
- package/dist/plugins/with-loader/index.js +28 -6
- package/dist/plugins/with-loader/index.js.map +1 -0
- package/dist/plugins/with-loader/webpack.d.ts +10 -18
- package/dist/plugins/with-loader/webpack.d.ts.map +1 -0
- package/dist/plugins/with-loader/webpack.js +43 -12
- package/dist/plugins/with-loader/webpack.js.map +1 -0
- package/dist/store-0LQ2PlH6.js +37 -0
- package/dist/store-0LQ2PlH6.js.map +1 -0
- package/dist/store-DEjYYF6a.d.ts +31 -0
- package/dist/store-DEjYYF6a.d.ts.map +1 -0
- package/dist/validation-BOJKRAp5.js +28 -0
- package/dist/validation-BOJKRAp5.js.map +1 -0
- package/dist/vite/index.d.ts +22 -28
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +37 -52
- package/dist/vite/index.js.map +1 -0
- package/dist/vite-X-2Al8fq.js +32 -0
- package/dist/vite-X-2Al8fq.js.map +1 -0
- package/package.json +7 -6
- package/dist/build-mdx-I4NROXCF.js +0 -8
- package/dist/bun-DMNX4PBC.js +0 -40
- package/dist/chunk-3VQS3KSP.js +0 -39
- package/dist/chunk-BTRE6MOX.js +0 -16
- package/dist/chunk-E4HRKSP4.js +0 -24
- package/dist/chunk-ERBMAQYP.js +0 -33
- package/dist/chunk-GGL4EF6H.js +0 -38
- package/dist/chunk-JBZTQ55D.js +0 -30
- package/dist/chunk-KH5GT2Y5.js +0 -104
- package/dist/chunk-LUM7SIZN.js +0 -40
- package/dist/chunk-MT7RY65Y.js +0 -167
- package/dist/chunk-NRZ4GE5O.js +0 -207
- package/dist/chunk-OQQNA7L7.js +0 -412
- package/dist/chunk-OUJENWQ4.js +0 -45
- package/dist/chunk-RMSV4HP6.js +0 -85
- package/dist/chunk-RXR7OL76.js +0 -37
- package/dist/chunk-VWJKRQZR.js +0 -19
- package/dist/chunk-W6HENTK7.js +0 -44
- package/dist/chunk-XR5N6ZXJ.js +0 -50
- package/dist/core-Bo8KaWQz.d.ts +0 -411
- package/dist/load-from-file-HL2VEY3M.js +0 -7
- package/dist/loader-NFSL6P5I.js +0 -7
- package/dist/loader-T756NSCS.js +0 -7
- package/dist/node-DCMYL4DL.js +0 -34
- package/dist/vite-QCUPZHHB.js +0 -32
package/dist/collections/mdx.js
CHANGED
|
@@ -1,291 +1,247 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "../
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
} from "../
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
plugins: [plugin()]
|
|
9
|
+
//#region src/collections/mdx.ts
|
|
10
|
+
const mdxTypeInfo = {
|
|
11
|
+
id: "mdx",
|
|
12
|
+
plugins: [plugin()]
|
|
20
13
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
|
|
290
|
-
|
|
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,MAAM,MAAM,EAAE,eAA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;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
|
|
2
|
-
import { WebpackLoaderOptions } from
|
|
3
|
-
import
|
|
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"}
|