fuma-content 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{async-cache-BM9Yf4Nw.js → async-cache-U87GzQTb.js} +1 -1
- package/dist/async-cache-U87GzQTb.js.map +1 -0
- package/dist/{build-mdx-C1PZsGp2.js → build-mdx-BZxE8t2a.js} +16 -11
- package/dist/build-mdx-BZxE8t2a.js.map +1 -0
- package/dist/build-mdx-LhpFasX-.js +4 -0
- package/dist/bun/index.d.ts +7 -4
- package/dist/bun/index.d.ts.map +1 -1
- package/dist/bun/index.js +25 -19
- package/dist/bun/index.js.map +1 -1
- package/dist/{bun-QKQnqgIi.js → bun-CBROq3I0.js} +3 -3
- package/dist/bun-CBROq3I0.js.map +1 -0
- package/dist/code-generator-CjC4EEXg.js +102 -0
- package/dist/code-generator-CjC4EEXg.js.map +1 -0
- package/dist/collections/data/runtime.d.ts +15 -0
- package/dist/collections/data/runtime.d.ts.map +1 -0
- package/dist/collections/{meta → data}/runtime.js +4 -4
- package/dist/collections/data/runtime.js.map +1 -0
- package/dist/collections/data.d.ts +47 -0
- package/dist/collections/data.d.ts.map +1 -0
- package/dist/collections/data.js +5 -0
- package/dist/collections/fs.d.ts +3 -0
- package/dist/collections/fs.js +3 -0
- package/dist/collections/index.d.ts +2 -2
- package/dist/collections/index.js +2 -15
- package/dist/collections/json/loader-webpack.d.ts +9 -0
- package/dist/collections/json/loader-webpack.d.ts.map +1 -0
- package/dist/collections/json/loader-webpack.js +15 -0
- package/dist/collections/json/loader-webpack.js.map +1 -0
- package/dist/collections/mdx/loader-webpack.d.ts +5 -5
- package/dist/collections/mdx/loader-webpack.d.ts.map +1 -1
- package/dist/collections/mdx/loader-webpack.js +11 -21
- package/dist/collections/mdx/loader-webpack.js.map +1 -1
- package/dist/collections/mdx/react.d.ts +22 -0
- package/dist/collections/mdx/react.d.ts.map +1 -0
- package/dist/collections/mdx/react.js +35 -0
- package/dist/collections/mdx/react.js.map +1 -0
- package/dist/collections/mdx/runtime-browser.d.ts +11 -45
- package/dist/collections/mdx/runtime-browser.js +6 -44
- package/dist/collections/mdx/runtime-browser.js.map +1 -1
- package/dist/collections/mdx/runtime-dynamic.d.ts +16 -28
- package/dist/collections/mdx/runtime-dynamic.d.ts.map +1 -1
- package/dist/collections/mdx/runtime-dynamic.js +19 -23
- package/dist/collections/mdx/runtime-dynamic.js.map +1 -1
- package/dist/collections/mdx/runtime.d.ts +10 -49
- package/dist/collections/mdx/runtime.js +2 -11
- package/dist/collections/mdx/runtime.js.map +1 -1
- package/dist/collections/mdx.d.ts +6 -2
- package/dist/collections/mdx.js +6 -246
- package/dist/collections/runtime/file-store.d.ts +4 -22
- package/dist/collections/runtime/file-store.js +15 -14
- package/dist/collections/runtime/file-store.js.map +1 -1
- package/dist/collections/runtime/store.d.ts +3 -3
- package/dist/collections/runtime/store.js +2 -2
- package/dist/collections/yaml/loader-webpack.d.ts +9 -0
- package/dist/collections/yaml/loader-webpack.d.ts.map +1 -0
- package/dist/collections/yaml/loader-webpack.js +15 -0
- package/dist/collections/yaml/loader-webpack.js.map +1 -0
- package/dist/collections-DNFRdCuB.js +98 -0
- package/dist/collections-DNFRdCuB.js.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/core-BO3b8jMg.d.ts +313 -0
- package/dist/core-BO3b8jMg.d.ts.map +1 -0
- package/dist/core-D5QHSKk6.js +223 -0
- package/dist/core-D5QHSKk6.js.map +1 -0
- package/dist/data-9h98oZwj.js +158 -0
- package/dist/data-9h98oZwj.js.map +1 -0
- package/dist/dynamic-CTYYdl7_.d.ts +33 -0
- package/dist/dynamic-CTYYdl7_.d.ts.map +1 -0
- package/dist/{dynamic-B40uAtdo.js → dynamic-DhKTOrIl.js} +8 -7
- package/dist/dynamic-DhKTOrIl.js.map +1 -0
- package/dist/dynamic.d.ts +3 -0
- package/dist/dynamic.js +3 -0
- package/dist/file-store-laO4IjvB.d.ts +21 -0
- package/dist/file-store-laO4IjvB.d.ts.map +1 -0
- package/dist/fs-D34Sztbh.d.ts +44 -0
- package/dist/fs-D34Sztbh.d.ts.map +1 -0
- package/dist/fs-WWbLA7Gx.js +66 -0
- package/dist/fs-WWbLA7Gx.js.map +1 -0
- package/dist/{fuma-matter-O4fA6nSx.js → fuma-matter-BuBO2w-p.js} +2 -2
- package/dist/fuma-matter-BuBO2w-p.js.map +1 -0
- package/dist/git-2CjUW3M5.d.ts +37 -0
- package/dist/git-2CjUW3M5.d.ts.map +1 -0
- package/dist/git-CQWA37-X.js +60 -0
- package/dist/git-CQWA37-X.js.map +1 -0
- package/dist/index-Da88Sj8w.d.ts +87 -0
- package/dist/index-Da88Sj8w.d.ts.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/load-from-file-BZxc_BhC.js +3 -0
- package/dist/{load-from-file-1f4WaHsf.js → load-from-file-irx0JI6j.js} +5 -8
- package/dist/load-from-file-irx0JI6j.js.map +1 -0
- package/dist/loader-AIEwGc2f.js +9 -0
- package/dist/loader-BhXHF8vy.js +16 -0
- package/dist/loader-BhXHF8vy.js.map +1 -0
- package/dist/loader-BuR4gkKg.js +77 -0
- package/dist/loader-BuR4gkKg.js.map +1 -0
- package/dist/loader-BzQpSBvP.js +59 -0
- package/dist/loader-BzQpSBvP.js.map +1 -0
- package/dist/{loader-CXnMFuyE.js → loader-D6StkShK.js} +8 -7
- package/dist/loader-D6StkShK.js.map +1 -0
- package/dist/loader-DCK4RwOh.js +8 -0
- package/dist/loader-DwpOcxgh.js +17 -0
- package/dist/loader-DwpOcxgh.js.map +1 -0
- package/dist/loader-zsTVgQjO.js +8 -0
- package/dist/mdx-Dt9hirUu.d.ts +144 -0
- package/dist/mdx-Dt9hirUu.d.ts.map +1 -0
- package/dist/mdx-iZ2uP27Z.js +303 -0
- package/dist/mdx-iZ2uP27Z.js.map +1 -0
- package/dist/next/index.d.ts +6 -10
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +23 -31
- package/dist/next/index.js.map +1 -1
- package/dist/node/index.d.ts +8 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +10 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/loader.d.ts +5 -2
- package/dist/node/loader.d.ts.map +1 -1
- package/dist/node/loader.js +17 -14
- package/dist/node/loader.js.map +1 -1
- package/dist/{node-CGIIJIcs.js → node-2VZOh3P9.js} +7 -5
- package/dist/node-2VZOh3P9.js.map +1 -0
- package/dist/plugins/git.d.ts +3 -2
- package/dist/plugins/git.js +2 -61
- package/dist/plugins/json-schema.d.ts +26 -2
- package/dist/plugins/json-schema.d.ts.map +1 -0
- package/dist/plugins/json-schema.js +42 -51
- package/dist/plugins/json-schema.js.map +1 -1
- package/dist/plugins/loader/index.d.ts +4 -0
- package/dist/plugins/loader/index.js +3 -0
- package/dist/plugins/loader/webpack.d.ts +4 -0
- package/dist/plugins/loader/webpack.js +60 -0
- package/dist/plugins/loader/webpack.js.map +1 -0
- package/dist/runtime-HN-HSB0Z.d.ts +31 -0
- package/dist/runtime-HN-HSB0Z.d.ts.map +1 -0
- package/dist/runtime-browser-BQEk7qjc.d.ts +29 -0
- package/dist/runtime-browser-BQEk7qjc.d.ts.map +1 -0
- package/dist/store-DiuGdV5M.d.ts +31 -0
- package/dist/store-DiuGdV5M.d.ts.map +1 -0
- package/dist/{store-0LQ2PlH6.js → store-IvpEBdxi.js} +4 -4
- package/dist/store-IvpEBdxi.js.map +1 -0
- package/dist/{validation-BOJKRAp5.js → validation-BvVvvLII.js} +11 -2
- package/dist/validation-BvVvvLII.js.map +1 -0
- package/dist/vite/index.d.ts +5 -15
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +24 -21
- package/dist/vite/index.js.map +1 -1
- package/dist/{vite-X-2Al8fq.js → vite-C1qXY47G.js} +4 -3
- package/dist/vite-C1qXY47G.js.map +1 -0
- package/package.json +51 -46
- package/dist/async-cache-BM9Yf4Nw.js.map +0 -1
- package/dist/build-D8A5ByFk.js +0 -42
- package/dist/build-D8A5ByFk.js.map +0 -1
- package/dist/build-mdx-C1PZsGp2.js.map +0 -1
- package/dist/build-mdx-DFndaVbS.js +0 -4
- package/dist/bun-QKQnqgIi.js.map +0 -1
- package/dist/code-generator-gPtrfZ6Q.js +0 -133
- package/dist/code-generator-gPtrfZ6Q.js.map +0 -1
- package/dist/collections/handlers/fs.d.ts +0 -2
- package/dist/collections/handlers/fs.js +0 -28
- package/dist/collections/handlers/fs.js.map +0 -1
- package/dist/collections/index.js.map +0 -1
- package/dist/collections/mdx/runtime-browser.d.ts.map +0 -1
- package/dist/collections/mdx/runtime.d.ts.map +0 -1
- package/dist/collections/mdx.js.map +0 -1
- package/dist/collections/meta/loader-webpack.d.ts +0 -9
- package/dist/collections/meta/loader-webpack.d.ts.map +0 -1
- package/dist/collections/meta/loader-webpack.js +0 -28
- package/dist/collections/meta/loader-webpack.js.map +0 -1
- package/dist/collections/meta/runtime.d.ts +0 -11
- package/dist/collections/meta/runtime.d.ts.map +0 -1
- package/dist/collections/meta/runtime.js.map +0 -1
- package/dist/collections/meta.d.ts +0 -2
- package/dist/collections/meta.js +0 -134
- package/dist/collections/meta.js.map +0 -1
- package/dist/collections/runtime/file-store.d.ts.map +0 -1
- package/dist/core-Bkh-SI_3.d.ts +0 -561
- package/dist/core-Bkh-SI_3.d.ts.map +0 -1
- package/dist/core-ZuoVBkeg.js +0 -170
- package/dist/core-ZuoVBkeg.js.map +0 -1
- package/dist/dynamic-B40uAtdo.js.map +0 -1
- package/dist/fuma-matter-O4fA6nSx.js.map +0 -1
- package/dist/load-from-file-1f4WaHsf.js.map +0 -1
- package/dist/load-from-file-BTNnBu6f.js +0 -3
- package/dist/loader-80abXEHx.js +0 -4
- package/dist/loader-BFhPyg3z.js +0 -4
- package/dist/loader-CXnMFuyE.js.map +0 -1
- package/dist/loader-gk94iHf5.js +0 -66
- package/dist/loader-gk94iHf5.js.map +0 -1
- package/dist/next/index.cjs +0 -502
- package/dist/node-CGIIJIcs.js.map +0 -1
- package/dist/pipe-5cnvE6KY.js +0 -31
- package/dist/pipe-5cnvE6KY.js.map +0 -1
- package/dist/plugins/git.js.map +0 -1
- package/dist/plugins/with-loader/index.d.ts +0 -2
- package/dist/plugins/with-loader/index.js +0 -28
- package/dist/plugins/with-loader/index.js.map +0 -1
- package/dist/plugins/with-loader/webpack.d.ts +0 -19
- package/dist/plugins/with-loader/webpack.d.ts.map +0 -1
- package/dist/plugins/with-loader/webpack.js +0 -43
- package/dist/plugins/with-loader/webpack.js.map +0 -1
- package/dist/store-0LQ2PlH6.js.map +0 -1
- package/dist/store-DEjYYF6a.d.ts +0 -31
- package/dist/store-DEjYYF6a.d.ts.map +0 -1
- package/dist/validation-BOJKRAp5.js.map +0 -1
- package/dist/vite-X-2Al8fq.js.map +0 -1
package/dist/collections/mdx.js
CHANGED
|
@@ -1,247 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { withLoader } from "../plugins/with-loader/index.js";
|
|
7
|
-
import path from "node:path";
|
|
1
|
+
import "../validation-BvVvvLII.js";
|
|
2
|
+
import "../loader-BuR4gkKg.js";
|
|
3
|
+
import "../fs-WWbLA7Gx.js";
|
|
4
|
+
import "../git-CQWA37-X.js";
|
|
5
|
+
import { n as mdxCollection, t as MDXCollection } from "../mdx-iZ2uP27Z.js";
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
const mdxTypeInfo = {
|
|
11
|
-
id: "mdx",
|
|
12
|
-
plugins: [plugin()]
|
|
13
|
-
};
|
|
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"
|
|
18
|
-
};
|
|
19
|
-
function defineMDX(config) {
|
|
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
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function plugin() {
|
|
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
|
-
});
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
//#endregion
|
|
246
|
-
export { defineMDX };
|
|
247
|
-
//# sourceMappingURL=mdx.js.map
|
|
7
|
+
export { MDXCollection, mdxCollection };
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import "../../core-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface FileInfo {
|
|
6
|
-
/**
|
|
7
|
-
* path relative to content directory
|
|
8
|
-
*/
|
|
9
|
-
path: string;
|
|
10
|
-
/**
|
|
11
|
-
* the full file path in file system
|
|
12
|
-
*/
|
|
13
|
-
fullPath: string;
|
|
14
|
-
}
|
|
15
|
-
declare class FileCollectionStore<V> extends SimpleCollectionStore<FileInfo & V> {
|
|
16
|
-
constructor(base: string, glob: Record<string, V>);
|
|
17
|
-
transform<T>(fn: (input: FileInfo & V) => FileInfo & T): FileCollectionStore<T>;
|
|
18
|
-
$data<T>(_cast: (input: FileInfo & V) => FileInfo & T): FileCollectionStore<T>;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { FileCollectionStore, FileInfo };
|
|
22
|
-
//# sourceMappingURL=file-store.d.ts.map
|
|
1
|
+
import "../../core-BO3b8jMg.js";
|
|
2
|
+
import "../../store-DiuGdV5M.js";
|
|
3
|
+
import { n as FileInfo, t as FileCollectionStore } from "../../file-store-laO4IjvB.js";
|
|
4
|
+
export { FileCollectionStore, FileInfo };
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as MapCollectionStore } from "../../store-IvpEBdxi.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region src/collections/runtime/file-store.ts
|
|
5
|
-
function
|
|
6
|
-
if (globKey.startsWith("./"))
|
|
7
|
-
return
|
|
8
|
-
path: globKey,
|
|
9
|
-
fullPath: path.join(base, globKey)
|
|
10
|
-
};
|
|
5
|
+
function formatGlobKey(globKey) {
|
|
6
|
+
if (globKey.startsWith("./")) return globKey.slice(2);
|
|
7
|
+
return globKey;
|
|
11
8
|
}
|
|
12
|
-
var FileCollectionStore = class extends
|
|
9
|
+
var FileCollectionStore = class extends MapCollectionStore {
|
|
13
10
|
constructor(base, glob) {
|
|
14
11
|
const data = /* @__PURE__ */ new Map();
|
|
15
|
-
for (const [key, value] of Object.entries(glob))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
for (const [key, value] of Object.entries(glob)) {
|
|
13
|
+
const filePath = formatGlobKey(key);
|
|
14
|
+
data.set(key, {
|
|
15
|
+
...value,
|
|
16
|
+
path: filePath,
|
|
17
|
+
fullPath: path.join(base, filePath)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
19
20
|
super(data);
|
|
20
21
|
}
|
|
21
22
|
transform(fn) {
|
|
22
23
|
return super.transform(fn);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
return super
|
|
25
|
+
castData(_cast) {
|
|
26
|
+
return super.castData(_cast);
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-store.js","names":[],"sources":["../../../src/collections/runtime/file-store.ts"],"sourcesContent":["import path from \"node:path\";\nimport {
|
|
1
|
+
{"version":3,"file":"file-store.js","names":[],"sources":["../../../src/collections/runtime/file-store.ts"],"sourcesContent":["import path from \"node:path\";\nimport { MapCollectionStore } from \"@/collections/runtime/store\";\n\nexport interface FileInfo {\n /**\n * path relative to content directory\n */\n path: string;\n\n /**\n * the full file path in file system\n */\n fullPath: string;\n}\n\nfunction formatGlobKey(globKey: string) {\n if (globKey.startsWith(\"./\")) {\n return globKey.slice(2);\n }\n\n return globKey;\n}\n\nexport class FileCollectionStore<V> extends MapCollectionStore<string, FileInfo & V> {\n constructor(base: string, glob: Record<string, V>) {\n const data = new Map<string, FileInfo & V>();\n for (const [key, value] of Object.entries(glob)) {\n const filePath = formatGlobKey(key);\n data.set(key, {\n ...value,\n path: filePath,\n fullPath: path.join(base, filePath),\n });\n }\n super(data);\n }\n\n transform<T>(fn: (input: FileInfo & V) => FileInfo & T): FileCollectionStore<T> {\n return super.transform(fn);\n }\n\n castData<T>(_cast: (input: FileInfo & V) => FileInfo & T): FileCollectionStore<T> {\n return super.castData(_cast);\n }\n}\n"],"mappings":";;;;AAeA,SAAS,cAAc,SAAiB;AACtC,KAAI,QAAQ,WAAW,KAAK,CAC1B,QAAO,QAAQ,MAAM,EAAE;AAGzB,QAAO;;AAGT,IAAa,sBAAb,cAA4C,mBAAyC;CACnF,YAAY,MAAc,MAAyB;EACjD,MAAM,uBAAO,IAAI,KAA2B;AAC5C,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,EAAE;GAC/C,MAAM,WAAW,cAAc,IAAI;AACnC,QAAK,IAAI,KAAK;IACZ,GAAG;IACH,MAAM;IACN,UAAU,KAAK,KAAK,MAAM,SAAS;IACpC,CAAC;;AAEJ,QAAM,KAAK;;CAGb,UAAa,IAAmE;AAC9E,SAAO,MAAM,UAAU,GAAG;;CAG5B,SAAY,OAAsE;AAChF,SAAO,MAAM,SAAS,MAAM"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../core-
|
|
2
|
-
import { n as
|
|
3
|
-
export { CollectionStore,
|
|
1
|
+
import "../../core-BO3b8jMg.js";
|
|
2
|
+
import { n as MapCollectionStore, t as CollectionStore } from "../../store-DiuGdV5M.js";
|
|
3
|
+
export { CollectionStore, MapCollectionStore };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as MapCollectionStore } from "../../store-IvpEBdxi.js";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { MapCollectionStore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../../core-BO3b8jMg.js";
|
|
2
|
+
import "../../dynamic-CTYYdl7_.js";
|
|
3
|
+
import { l as WebpackLoader } from "../../index-Da88Sj8w.js";
|
|
4
|
+
|
|
5
|
+
//#region src/collections/yaml/loader-webpack.d.ts
|
|
6
|
+
declare const _default: WebpackLoader;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _default as default };
|
|
9
|
+
//# sourceMappingURL=loader-webpack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader-webpack.d.ts","names":[],"sources":["../../../src/collections/yaml/loader-webpack.ts"],"sourcesContent":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "../../dynamic-DhKTOrIl.js";
|
|
2
|
+
import "../../validation-BvVvvLII.js";
|
|
3
|
+
import "../../loader-BuR4gkKg.js";
|
|
4
|
+
import "../../fs-WWbLA7Gx.js";
|
|
5
|
+
import "../../data-9h98oZwj.js";
|
|
6
|
+
import { createWebpackLoader } from "../../plugins/loader/webpack.js";
|
|
7
|
+
import "../../loader-BzQpSBvP.js";
|
|
8
|
+
import { t as createYamlLoader } from "../../loader-DwpOcxgh.js";
|
|
9
|
+
|
|
10
|
+
//#region src/collections/yaml/loader-webpack.ts
|
|
11
|
+
var loader_webpack_default = createWebpackLoader((core) => createYamlLoader(core));
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { loader_webpack_default as default };
|
|
15
|
+
//# sourceMappingURL=loader-webpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader-webpack.js","names":[],"sources":["../../../src/collections/yaml/loader-webpack.ts"],"sourcesContent":["import { createWebpackLoader } from \"@/plugins/loader/webpack\";\nimport { createYamlLoader } from \"./loader\";\n\nexport default createWebpackLoader((core) => createYamlLoader(core));\n"],"mappings":";;;;;;;;;;AAGA,6BAAe,qBAAqB,SAAS,iBAAiB,KAAK,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//#region src/utils/hook.ts
|
|
2
|
+
function hook(steps = []) {
|
|
3
|
+
return {
|
|
4
|
+
async run(ctx) {
|
|
5
|
+
for (const step of steps) step(ctx);
|
|
6
|
+
},
|
|
7
|
+
hook(fn) {
|
|
8
|
+
steps.push(fn);
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function asyncHook(steps = []) {
|
|
14
|
+
return {
|
|
15
|
+
async run(ctx) {
|
|
16
|
+
await Promise.all(steps.map((step) => step(ctx)));
|
|
17
|
+
},
|
|
18
|
+
hook(fn) {
|
|
19
|
+
steps.push(fn);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/utils/pipe.ts
|
|
27
|
+
function pipe(steps = []) {
|
|
28
|
+
return {
|
|
29
|
+
run(data, ctx) {
|
|
30
|
+
for (const step of steps) data = step(data, ctx);
|
|
31
|
+
return data;
|
|
32
|
+
},
|
|
33
|
+
pipe(fn) {
|
|
34
|
+
steps.push(fn);
|
|
35
|
+
return this;
|
|
36
|
+
},
|
|
37
|
+
clone() {
|
|
38
|
+
return pipe([...steps]);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function asyncPipe(steps = []) {
|
|
43
|
+
return {
|
|
44
|
+
async run(data, ctx) {
|
|
45
|
+
for (const step of steps) data = await step(data, ctx);
|
|
46
|
+
return data;
|
|
47
|
+
},
|
|
48
|
+
pipe(fn) {
|
|
49
|
+
steps.push(fn);
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
clone() {
|
|
53
|
+
return asyncPipe([...steps]);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/collections/index.ts
|
|
60
|
+
var Collection = class {
|
|
61
|
+
pluginHooks = /* @__PURE__ */ new Map();
|
|
62
|
+
name = null;
|
|
63
|
+
/**
|
|
64
|
+
* on config loaded/updated
|
|
65
|
+
*/
|
|
66
|
+
onConfig = hook();
|
|
67
|
+
/**
|
|
68
|
+
* Configure watch/dev server
|
|
69
|
+
*/
|
|
70
|
+
onServer = hook();
|
|
71
|
+
onInit = asyncHook();
|
|
72
|
+
onEmit = asyncPipe();
|
|
73
|
+
plugins = [];
|
|
74
|
+
transform(transformer) {
|
|
75
|
+
transformer(this);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
pluginHook(hook$1, options) {
|
|
79
|
+
let created = this.pluginHooks.get(hook$1.id);
|
|
80
|
+
if (created) return created;
|
|
81
|
+
created = hook$1.create(this, options);
|
|
82
|
+
this.pluginHooks.set(hook$1.id, created);
|
|
83
|
+
return created;
|
|
84
|
+
}
|
|
85
|
+
getPluginHook(hook$1) {
|
|
86
|
+
return this.pluginHooks.get(hook$1.id);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
function defineCollectionHook(init) {
|
|
90
|
+
return {
|
|
91
|
+
id: Symbol(),
|
|
92
|
+
create: init
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
export { asyncHook as a, pipe as i, defineCollectionHook as n, hook as o, asyncPipe as r, Collection as t };
|
|
98
|
+
//# sourceMappingURL=collections-DNFRdCuB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections-DNFRdCuB.js","names":["hook"],"sources":["../src/utils/hook.ts","../src/utils/pipe.ts","../src/collections/index.ts"],"sourcesContent":["import type { Awaitable } from \"@/types\";\n\nexport interface Hook<Context = undefined> {\n /**\n * add a hook\n *\n * @returns the same pipe instance\n */\n hook: (fn: (context: Context) => void) => Hook<Context>;\n run: (context: Context) => void;\n}\n\nexport interface AsyncHook<Context = undefined> {\n /**\n * add a hook\n *\n * @returns the same pipe instance\n */\n hook: (fn: (context: Context) => Awaitable<void>) => AsyncHook<Context>;\n run: (context: Context) => Awaitable<void>;\n}\n\nexport function hook<Context>(steps: ((ctx: Context) => void)[] = []): Hook<Context> {\n return {\n async run(ctx) {\n for (const step of steps) step(ctx);\n },\n hook(fn) {\n steps.push(fn);\n return this;\n },\n };\n}\n\nexport function asyncHook<Context>(\n steps: ((ctx: Context) => Awaitable<void>)[] = [],\n): AsyncHook<Context> {\n return {\n async run(ctx) {\n await Promise.all(steps.map((step) => step(ctx)));\n },\n hook(fn) {\n steps.push(fn);\n return this;\n },\n };\n}\n","import type { Awaitable } from \"@/types\";\n\nexport interface Pipe<Data, Context = undefined> {\n /**\n * add a transformation step\n *\n * @returns the same pipe instance\n */\n pipe: (fn: (data: Data, context: Context) => Data) => Pipe<Data, Context>;\n run: (data: Data, context: Context) => Data;\n clone: () => Pipe<Data, Context>;\n}\n\nexport interface AsyncPipe<Data, Context = undefined> {\n /**\n * add a transformation step\n *\n * @returns the same pipe instance\n */\n pipe: (fn: (data: Data, context: Context) => Awaitable<Data>) => AsyncPipe<Data, Context>;\n run: (data: Data, context: Context) => Awaitable<Data>;\n clone: () => AsyncPipe<Data, Context>;\n}\n\nexport function pipe<Data, Context>(\n steps: ((data: Data, context: Context) => Data)[] = [],\n): Pipe<Data, Context> {\n return {\n run(data, ctx) {\n for (const step of steps) {\n data = step(data, ctx);\n }\n return data;\n },\n pipe(fn) {\n steps.push(fn);\n return this;\n },\n clone() {\n return pipe([...steps]);\n },\n };\n}\n\nexport function asyncPipe<Data, Context>(\n steps: ((data: Data, context: Context) => Awaitable<Data>)[] = [],\n): AsyncPipe<Data, Context> {\n return {\n async run(data, ctx) {\n for (const step of steps) {\n data = await step(data, ctx);\n }\n return data;\n },\n pipe(fn) {\n steps.push(fn);\n return this;\n },\n clone() {\n return asyncPipe([...steps]);\n },\n };\n}\n","import { Core, EmitContext, EmitEntry, PluginOption, ResolvedConfig, ServerContext } from \"@/core\";\nimport { asyncHook, hook } from \"@/utils/hook\";\nimport { asyncPipe } from \"@/utils/pipe\";\n\nexport interface CollectionHookContext {\n core: Core;\n collection: Collection;\n}\n\nexport class Collection {\n private readonly pluginHooks = new Map<symbol, unknown>();\n name = null as unknown as string;\n\n /**\n * on config loaded/updated\n */\n readonly onConfig = hook<CollectionHookContext & { config: ResolvedConfig }>();\n /**\n * Configure watch/dev server\n */\n readonly onServer = hook<CollectionHookContext & { server: ServerContext }>();\n readonly onInit = asyncHook<CollectionHookContext>();\n readonly onEmit = asyncPipe<EmitEntry[], EmitContext>();\n readonly plugins: PluginOption[] = [];\n\n transform(transformer: (collection: this) => void): this {\n transformer(this);\n return this;\n }\n\n pluginHook<T, Options>(hook: CollectionHook<T, Options>, options: Options): T;\n pluginHook<T>(hook: CollectionHook<T>): T;\n\n pluginHook<T, O>(hook: CollectionHook<T, O>, options?: O): T {\n let created = this.pluginHooks.get(hook.id) as T | undefined;\n if (created) return created;\n\n created = hook.create(this, options as O);\n this.pluginHooks.set(hook.id, created);\n return created;\n }\n\n getPluginHook<T>(hook: CollectionHook<T>): T | undefined {\n return this.pluginHooks.get(hook.id) as T | undefined;\n }\n}\n\nexport interface CollectionHook<T = unknown, Options = undefined> {\n id: symbol;\n create: (collection: Collection, options: Options) => T;\n}\n\nexport function defineCollectionHook<T, Options = undefined>(\n init: (collection: Collection, options: Options) => T,\n): CollectionHook<T, Options> {\n return {\n id: Symbol(),\n create: init,\n };\n}\n"],"mappings":";AAsBA,SAAgB,KAAc,QAAoC,EAAE,EAAiB;AACnF,QAAO;EACL,MAAM,IAAI,KAAK;AACb,QAAK,MAAM,QAAQ,MAAO,MAAK,IAAI;;EAErC,KAAK,IAAI;AACP,SAAM,KAAK,GAAG;AACd,UAAO;;EAEV;;AAGH,SAAgB,UACd,QAA+C,EAAE,EAC7B;AACpB,QAAO;EACL,MAAM,IAAI,KAAK;AACb,SAAM,QAAQ,IAAI,MAAM,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC;;EAEnD,KAAK,IAAI;AACP,SAAM,KAAK,GAAG;AACd,UAAO;;EAEV;;;;;ACrBH,SAAgB,KACd,QAAoD,EAAE,EACjC;AACrB,QAAO;EACL,IAAI,MAAM,KAAK;AACb,QAAK,MAAM,QAAQ,MACjB,QAAO,KAAK,MAAM,IAAI;AAExB,UAAO;;EAET,KAAK,IAAI;AACP,SAAM,KAAK,GAAG;AACd,UAAO;;EAET,QAAQ;AACN,UAAO,KAAK,CAAC,GAAG,MAAM,CAAC;;EAE1B;;AAGH,SAAgB,UACd,QAA+D,EAAE,EACvC;AAC1B,QAAO;EACL,MAAM,IAAI,MAAM,KAAK;AACnB,QAAK,MAAM,QAAQ,MACjB,QAAO,MAAM,KAAK,MAAM,IAAI;AAE9B,UAAO;;EAET,KAAK,IAAI;AACP,SAAM,KAAK,GAAG;AACd,UAAO;;EAET,QAAQ;AACN,UAAO,UAAU,CAAC,GAAG,MAAM,CAAC;;EAE/B;;;;;ACpDH,IAAa,aAAb,MAAwB;CACtB,AAAiB,8BAAc,IAAI,KAAsB;CACzD,OAAO;;;;CAKP,AAAS,WAAW,MAA0D;;;;CAI9E,AAAS,WAAW,MAAyD;CAC7E,AAAS,SAAS,WAAkC;CACpD,AAAS,SAAS,WAAqC;CACvD,AAAS,UAA0B,EAAE;CAErC,UAAU,aAA+C;AACvD,cAAY,KAAK;AACjB,SAAO;;CAMT,WAAiB,QAA4B,SAAgB;EAC3D,IAAI,UAAU,KAAK,YAAY,IAAIA,OAAK,GAAG;AAC3C,MAAI,QAAS,QAAO;AAEpB,YAAUA,OAAK,OAAO,MAAM,QAAa;AACzC,OAAK,YAAY,IAAIA,OAAK,IAAI,QAAQ;AACtC,SAAO;;CAGT,cAAiB,QAAwC;AACvD,SAAO,KAAK,YAAY,IAAIA,OAAK,GAAG;;;AASxC,SAAgB,qBACd,MAC4B;AAC5B,QAAO;EACL,IAAI,QAAQ;EACZ,QAAQ;EACT"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as defineConfig, O as GlobalConfig, k as WorkspaceConfig } from "../core-BO3b8jMg.js";
|
|
2
2
|
export { GlobalConfig, WorkspaceConfig, defineConfig };
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import { Collection } from \"@/collections\";\nimport type { PluginOption } from \"@/core\";\n\nexport interface GlobalConfig<\n Collections extends Record<string, Collection> = Record<string, Collection>,\n> {\n plugins?: PluginOption[];\n collections?: Collections;\n workspaces?: Record<string, WorkspaceConfig>;\n\n /**\n * specify a directory to access & store cache (disabled during development mode).\n *\n * The cache will never be updated, delete the cache folder to clean.\n */\n experimentalBuildCache?: string;\n\n /**\n * configure code generation\n */\n emit?: {\n target?: \"default\" | \"vite\";\n /**\n * add .js extenstion to imports\n */\n jsExtension?: boolean;\n };\n}\n\nexport interface WorkspaceConfig {\n dir: string;\n config: GlobalConfig | { default: GlobalConfig };\n}\n\nexport function defineConfig<\n Collections extends Record<string, Collection> = Record<string, Collection>,\n>(config: GlobalConfig<Collections> = {}): GlobalConfig<Collections> {\n return config;\n}\n"],"mappings":";AAkCA,SAAgB,aAEd,SAAoC,EAAE,EAA6B;AACnE,QAAO"}
|