fuma-content 1.0.0 → 1.0.1
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/{build-mdx-Q4RMDWYK.js → build-mdx-I4NROXCF.js} +2 -2
- package/dist/bun/index.d.ts +1 -1
- package/dist/bun/index.js +4 -3
- package/dist/{chunk-LDBQ66H3.js → chunk-GGL4EF6H.js} +1 -1
- package/dist/{chunk-6XDQG2GV.js → chunk-JBZTQ55D.js} +14 -1
- package/dist/{chunk-PNA5UGSL.js → chunk-KH5GT2Y5.js} +1 -1
- package/dist/{chunk-M72VQL5M.js → chunk-LUM7SIZN.js} +1 -1
- package/dist/chunk-MT7RY65Y.js +167 -0
- package/dist/chunk-NRZ4GE5O.js +207 -0
- package/dist/{chunk-AMBGM4OK.js → chunk-OQQNA7L7.js} +1 -1
- package/dist/{chunk-IGLM4N4P.js → chunk-W6HENTK7.js} +11 -1
- package/dist/{chunk-4RMSJCK2.js → chunk-XR5N6ZXJ.js} +1 -1
- package/dist/collections/handlers/fs.d.ts +1 -1
- package/dist/collections/index.d.ts +1 -1
- package/dist/collections/mdx/loader-webpack.d.ts +1 -1
- package/dist/collections/mdx/loader-webpack.js +6 -5
- package/dist/collections/mdx/runtime-browser.d.ts +21 -10
- package/dist/collections/mdx/runtime-browser.js +29 -21
- package/dist/collections/mdx/runtime-dynamic.d.ts +3 -2
- package/dist/collections/mdx/runtime-dynamic.js +10 -8
- package/dist/collections/mdx/runtime.d.ts +4 -3
- package/dist/collections/mdx.d.ts +1 -1
- package/dist/collections/mdx.js +14 -10
- package/dist/collections/meta/loader-webpack.d.ts +1 -1
- package/dist/collections/meta/loader-webpack.js +5 -4
- package/dist/collections/meta/runtime.d.ts +1 -1
- package/dist/collections/meta.d.ts +1 -1
- package/dist/collections/meta.js +6 -2
- package/dist/config/index.d.ts +1 -1
- package/dist/{core-DxnSmTRe.d.ts → core-Bo8KaWQz.d.ts} +3 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +8 -0
- package/dist/load-from-file-HL2VEY3M.js +7 -0
- package/dist/{loader-VGDLYG4T.js → loader-NFSL6P5I.js} +1 -1
- package/dist/next/index.cjs +25 -2
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +5 -4
- package/dist/node/loader.js +4 -3
- package/dist/plugins/git.d.ts +1 -1
- package/dist/plugins/git.js +1 -1
- package/dist/plugins/json-schema.d.ts +1 -1
- package/dist/plugins/with-loader/index.d.ts +1 -1
- package/dist/plugins/with-loader/webpack.d.ts +1 -1
- package/dist/plugins/with-loader/webpack.js +4 -3
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +5 -4
- package/package.json +11 -10
- package/dist/chunk-Z7KHD7MS.js +0 -368
- package/dist/load-from-file-MLL4WQ5J.js +0 -7
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SimpleCollectionStore
|
|
4
4
|
} from "../../chunk-3VQS3KSP.js";
|
|
5
|
+
import {
|
|
6
|
+
createCache
|
|
7
|
+
} from "../../chunk-JBZTQ55D.js";
|
|
5
8
|
|
|
6
9
|
// src/collections/mdx/runtime-browser.ts
|
|
7
10
|
import { lazy, createElement } from "react";
|
|
@@ -10,50 +13,55 @@ function mdxStoreBrowser(name, _input) {
|
|
|
10
13
|
const input = _input;
|
|
11
14
|
const merged = /* @__PURE__ */ new Map();
|
|
12
15
|
function getStoreData() {
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
let store = _internal_data.get(name);
|
|
17
|
+
if (store) return store;
|
|
18
|
+
store = {
|
|
19
|
+
preloaded: createCache()
|
|
15
20
|
};
|
|
16
21
|
_internal_data.set(name, store);
|
|
17
22
|
return store;
|
|
18
23
|
}
|
|
24
|
+
const _renderer = {
|
|
25
|
+
storeId: name,
|
|
26
|
+
renderers: /* @__PURE__ */ new Map()
|
|
27
|
+
};
|
|
19
28
|
for (const [key, value] of Object.entries(input)) {
|
|
20
29
|
merged.set(key, {
|
|
30
|
+
id: key,
|
|
21
31
|
preload() {
|
|
22
|
-
|
|
23
|
-
const loaded = value();
|
|
24
|
-
data.preloaded.set(key, loaded);
|
|
25
|
-
return loaded;
|
|
32
|
+
return getStoreData().preloaded.$value().cached(key, value);
|
|
26
33
|
},
|
|
27
|
-
_renderer
|
|
28
|
-
id: key,
|
|
29
|
-
getStoreData
|
|
30
|
-
}
|
|
34
|
+
_renderer
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
37
|
return new SimpleCollectionStore(merged);
|
|
34
38
|
}
|
|
35
39
|
function useRenderer(entry, renderFn) {
|
|
36
40
|
if (!entry) return null;
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
const {
|
|
42
|
+
id,
|
|
43
|
+
_renderer: { renderers }
|
|
44
|
+
} = entry;
|
|
39
45
|
let renderer = renderers.get(id);
|
|
40
46
|
if (!renderer) {
|
|
41
47
|
const OnDemand = lazy(async () => {
|
|
42
48
|
const loaded = await entry.preload();
|
|
43
49
|
return { default: () => renderFn(loaded) };
|
|
44
50
|
});
|
|
45
|
-
renderer =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
renderer = {
|
|
52
|
+
forceOnDemand: false,
|
|
53
|
+
fn() {
|
|
54
|
+
const v = entry.preload();
|
|
55
|
+
if (!(v instanceof Promise) && !this.forceOnDemand) {
|
|
56
|
+
return renderFn(v);
|
|
57
|
+
}
|
|
58
|
+
this.forceOnDemand = true;
|
|
59
|
+
return createElement(OnDemand);
|
|
60
|
+
}
|
|
53
61
|
};
|
|
54
62
|
renderers.set(id, renderer);
|
|
55
63
|
}
|
|
56
|
-
return
|
|
64
|
+
return renderer.fn();
|
|
57
65
|
}
|
|
58
66
|
function $attachCompiled() {
|
|
59
67
|
return (data) => data;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CoreOptions,
|
|
1
|
+
import { C as CoreOptions, M as MDXCollection, E as ExtractedReference, V as VersionControlFileData } from '../../core-Bo8KaWQz.js';
|
|
2
2
|
import { MDXComponents } from 'mdx/types';
|
|
3
3
|
import { FC } from 'react';
|
|
4
4
|
import { FileCollectionStore } from '../runtime/file-store.js';
|
|
@@ -20,7 +20,8 @@ interface MDXStoreDynamicData<Frontmatter> {
|
|
|
20
20
|
frontmatter: Frontmatter;
|
|
21
21
|
compile: () => Promise<CompiledMDXProperties<Frontmatter>>;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends MDXCollection<infer _Frontmatter> ? _Frontmatter : never;
|
|
24
|
+
declare function mdxStoreDynamic<Config, Name extends string>(config: Config, coreOptions: CoreOptions, name: Name, base: string, _frontmatter: Record<string, unknown>): Promise<FileCollectionStore<MDXStoreDynamicData<GetFrontmatter<Config, Name>>>>;
|
|
24
25
|
type MdxContent = FC<{
|
|
25
26
|
components?: MDXComponents;
|
|
26
27
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildMDX
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-OQQNA7L7.js";
|
|
4
4
|
import {
|
|
5
5
|
FileCollectionStore
|
|
6
6
|
} from "../../chunk-RXR7OL76.js";
|
|
@@ -10,30 +10,32 @@ import {
|
|
|
10
10
|
import "../../chunk-3VQS3KSP.js";
|
|
11
11
|
import {
|
|
12
12
|
buildConfig
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-W6HENTK7.js";
|
|
14
14
|
import {
|
|
15
15
|
Core
|
|
16
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-NRZ4GE5O.js";
|
|
17
|
+
import "../../chunk-MT7RY65Y.js";
|
|
17
18
|
import {
|
|
18
19
|
createCache
|
|
19
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-JBZTQ55D.js";
|
|
20
21
|
|
|
21
22
|
// src/collections/mdx/runtime-dynamic.ts
|
|
22
23
|
import { pathToFileURL } from "url";
|
|
23
24
|
import fs from "fs/promises";
|
|
24
25
|
import jsxRuntimeDefault from "react/jsx-runtime";
|
|
25
26
|
import path from "path";
|
|
26
|
-
var
|
|
27
|
+
var corePromise;
|
|
27
28
|
async function mdxStoreDynamic(config, coreOptions, name, base, _frontmatter) {
|
|
28
|
-
|
|
29
|
+
corePromise ??= (async () => {
|
|
29
30
|
const core2 = new Core(coreOptions);
|
|
30
31
|
await core2.init({
|
|
31
32
|
config: buildConfig(config)
|
|
32
33
|
});
|
|
33
34
|
return core2;
|
|
34
35
|
})();
|
|
36
|
+
const core = await corePromise;
|
|
35
37
|
const frontmatter = _frontmatter;
|
|
36
|
-
const collection =
|
|
38
|
+
const collection = core.getCollection(name);
|
|
37
39
|
if (!collection || !collection.handlers.mdx)
|
|
38
40
|
throw new Error("invalid collection name");
|
|
39
41
|
const merged = {};
|
|
@@ -47,7 +49,7 @@ async function mdxStoreDynamic(config, coreOptions, name, base, _frontmatter) {
|
|
|
47
49
|
const filePath = path.join(base, k);
|
|
48
50
|
let content = (await fs.readFile(filePath)).toString();
|
|
49
51
|
content = fumaMatter(content).content;
|
|
50
|
-
const compiled = await buildMDX(
|
|
52
|
+
const compiled = await buildMDX(core, collection, {
|
|
51
53
|
filePath,
|
|
52
54
|
source: content,
|
|
53
55
|
frontmatter: v,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetCollectionConfig } from '../../index.js';
|
|
2
|
-
import { M as MDXCollection, E as ExtractedReference, V as VersionControlFileData } from '../../core-
|
|
2
|
+
import { M as MDXCollection, E as ExtractedReference, V as VersionControlFileData } from '../../core-Bo8KaWQz.js';
|
|
3
3
|
import { FileCollectionStore } from '../runtime/file-store.js';
|
|
4
4
|
import { FC } from 'react';
|
|
5
5
|
import { MDXProps } from 'mdx/types';
|
|
@@ -30,7 +30,8 @@ interface MDXStoreData<Frontmatter> {
|
|
|
30
30
|
id: string;
|
|
31
31
|
compiled: CompiledMDXProperties<Frontmatter>;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends MDXCollection<infer _Frontmatter> ? _Frontmatter : never;
|
|
34
|
+
declare function mdxStore<Config, Name extends string>(_name: Name, base: string, _input: Record<string, unknown>): FileCollectionStore<MDXStoreData<GetFrontmatter<Config, Name>>>;
|
|
34
35
|
interface MDXStoreLazyData<Frontmatter> {
|
|
35
36
|
id: string;
|
|
36
37
|
frontmatter: Frontmatter;
|
|
@@ -39,7 +40,7 @@ interface MDXStoreLazyData<Frontmatter> {
|
|
|
39
40
|
declare function mdxStoreLazy<Config, Name extends string>(_name: Name, base: string, _input: {
|
|
40
41
|
head: Record<string, unknown>;
|
|
41
42
|
body: Record<string, () => Promise<unknown>>;
|
|
42
|
-
}): FileCollectionStore<MDXStoreLazyData<
|
|
43
|
+
}): FileCollectionStore<MDXStoreLazyData<GetFrontmatter<Config, Name>>>;
|
|
43
44
|
declare function $attachCompiled<Add>(): <T>(data: T) => T extends MDXStoreData<unknown> ? T & {
|
|
44
45
|
compiled: Add;
|
|
45
46
|
} : T extends MDXStoreLazyData<unknown> ? T & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { M as MDXCollection,
|
|
1
|
+
export { E as ExtractedReference, M as MDXCollection, p as MDXCollectionConfig, o as MDXCollectionHandler, q as defineMDX } from '../core-Bo8KaWQz.js';
|
|
2
2
|
import '@mdx-js/mdx';
|
|
3
3
|
import 'vfile';
|
|
4
4
|
import '@standard-schema/spec';
|
package/dist/collections/mdx.js
CHANGED
|
@@ -7,6 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
createCollection
|
|
9
9
|
} from "../chunk-BTRE6MOX.js";
|
|
10
|
+
import {
|
|
11
|
+
slash
|
|
12
|
+
} from "../chunk-MT7RY65Y.js";
|
|
13
|
+
import "../chunk-JBZTQ55D.js";
|
|
10
14
|
|
|
11
15
|
// src/collections/mdx.ts
|
|
12
16
|
import path from "path";
|
|
@@ -108,10 +112,10 @@ function plugin() {
|
|
|
108
112
|
if (!fsHandler || !mdxHandler) return;
|
|
109
113
|
const { core, codegen } = context;
|
|
110
114
|
const runtimePath = RuntimePaths.server;
|
|
111
|
-
const base2 = path.relative(process.cwd(), fsHandler.dir);
|
|
115
|
+
const base2 = slash(path.relative(process.cwd(), fsHandler.dir));
|
|
112
116
|
let initializer;
|
|
113
|
-
codegen.
|
|
114
|
-
|
|
117
|
+
codegen.addNamespaceImport(
|
|
118
|
+
"Config",
|
|
115
119
|
codegen.formatImportPath(core.getOptions().configPath),
|
|
116
120
|
true
|
|
117
121
|
);
|
|
@@ -139,8 +143,8 @@ function plugin() {
|
|
|
139
143
|
const { core, codegen } = context;
|
|
140
144
|
const runtimePath = RuntimePaths.browser;
|
|
141
145
|
codegen.addNamedImport(["mdxStoreBrowser"], runtimePath);
|
|
142
|
-
codegen.
|
|
143
|
-
|
|
146
|
+
codegen.addNamespaceImport(
|
|
147
|
+
"Config",
|
|
144
148
|
codegen.formatImportPath(core.getOptions().configPath),
|
|
145
149
|
true
|
|
146
150
|
);
|
|
@@ -158,10 +162,10 @@ function plugin() {
|
|
|
158
162
|
const { core, codegen } = context;
|
|
159
163
|
const { configPath, workspace, outDir } = core.getOptions();
|
|
160
164
|
const runtimePath = RuntimePaths.dynamic;
|
|
161
|
-
const base2 = path.relative(process.cwd(), fsHandler.dir);
|
|
162
|
-
codegen.
|
|
163
|
-
|
|
164
|
-
codegen.formatImportPath(configPath)
|
|
165
|
+
const base2 = slash(path.relative(process.cwd(), fsHandler.dir));
|
|
166
|
+
codegen.addNamespaceImport(
|
|
167
|
+
"Config",
|
|
168
|
+
codegen.formatImportPath(core.getOptions().configPath)
|
|
165
169
|
);
|
|
166
170
|
codegen.addNamedImport(["mdxStoreDynamic"], runtimePath);
|
|
167
171
|
const coreOptions = {
|
|
@@ -275,7 +279,7 @@ function plugin() {
|
|
|
275
279
|
return withLoader(base, {
|
|
276
280
|
test: mdxLoaderGlob,
|
|
277
281
|
async createLoader() {
|
|
278
|
-
const { createMdxLoader } = await import("../loader-
|
|
282
|
+
const { createMdxLoader } = await import("../loader-NFSL6P5I.js");
|
|
279
283
|
return createMdxLoader({
|
|
280
284
|
getCore: () => this.core
|
|
281
285
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LoaderContext } from 'webpack';
|
|
2
2
|
import { WebpackLoaderOptions } from '../../plugins/with-loader/webpack.js';
|
|
3
3
|
import '../../plugins/with-loader/index.js';
|
|
4
|
-
import '../../core-
|
|
4
|
+
import '../../core-Bo8KaWQz.js';
|
|
5
5
|
import 'chokidar';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
7
7
|
import 'vfile';
|
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getCore,
|
|
6
6
|
toWebpack
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-XR5N6ZXJ.js";
|
|
8
8
|
import "../../chunk-OUJENWQ4.js";
|
|
9
9
|
import {
|
|
10
10
|
createDynamicCore
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-GGL4EF6H.js";
|
|
12
|
+
import "../../chunk-NRZ4GE5O.js";
|
|
13
|
+
import "../../chunk-MT7RY65Y.js";
|
|
14
|
+
import "../../chunk-JBZTQ55D.js";
|
|
14
15
|
|
|
15
16
|
// src/collections/meta/loader-webpack.ts
|
|
16
17
|
var instance;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetCollectionConfig } from '../../index.js';
|
|
2
2
|
import { FileCollectionStore } from '../runtime/file-store.js';
|
|
3
|
-
import {
|
|
3
|
+
import { b as MetaCollection } from '../../core-Bo8KaWQz.js';
|
|
4
4
|
import '../runtime/store.js';
|
|
5
5
|
import 'chokidar';
|
|
6
6
|
import '@mdx-js/mdx';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { b as MetaCollection, t as MetaCollectionConfig, s as MetaCollectionHandler, r as MetaContext, u as defineMeta } from '../core-Bo8KaWQz.js';
|
|
2
2
|
import '@standard-schema/spec';
|
|
3
3
|
import 'chokidar';
|
|
4
4
|
import '@mdx-js/mdx';
|
package/dist/collections/meta.js
CHANGED
|
@@ -29,6 +29,10 @@ function defineMeta(config) {
|
|
|
29
29
|
io: "input",
|
|
30
30
|
unrepresentable: "any"
|
|
31
31
|
});
|
|
32
|
+
else
|
|
33
|
+
return config.schema["~standard"]?.jsonSchema.input({
|
|
34
|
+
target: "draft-2020-12"
|
|
35
|
+
});
|
|
32
36
|
}
|
|
33
37
|
};
|
|
34
38
|
});
|
|
@@ -43,8 +47,8 @@ function plugin() {
|
|
|
43
47
|
["metaStore"],
|
|
44
48
|
"fuma-content/collections/meta/runtime"
|
|
45
49
|
);
|
|
46
|
-
codegen.
|
|
47
|
-
|
|
50
|
+
codegen.addNamespaceImport(
|
|
51
|
+
"Config",
|
|
48
52
|
codegen.formatImportPath(core.getOptions().configPath),
|
|
49
53
|
true
|
|
50
54
|
);
|
package/dist/config/index.d.ts
CHANGED
|
@@ -130,10 +130,10 @@ interface MetaCollectionHandler {
|
|
|
130
130
|
* Transform metadata
|
|
131
131
|
*/
|
|
132
132
|
transform?: (this: MetaContext, data: unknown) => Awaitable$1<unknown | undefined>;
|
|
133
|
-
schema?: StandardSchemaV1
|
|
133
|
+
schema?: StandardSchemaV1;
|
|
134
134
|
}
|
|
135
135
|
interface MetaCollectionConfig<Schema extends StandardSchemaV1> extends FileHandlerConfig {
|
|
136
|
-
schema?: Schema
|
|
136
|
+
schema?: Schema;
|
|
137
137
|
}
|
|
138
138
|
type MetaCollection<_Data> = Collection & {
|
|
139
139
|
_type?: _Data;
|
|
@@ -408,4 +408,4 @@ declare class Core {
|
|
|
408
408
|
emit(emitOptions?: EmitOptions): Promise<EmitOutput>;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
-
export { type CollectionHandlers as A, createCollection as B, type CoreOptions as C, defineConfig as D, type ExtractedReference as E, type FileHandlerConfig as F, type GlobalConfig as G, type InitOptions as I, type JSONSchemaOptions as J, type MDXCollection as M, type PluginContext as P, type ServerContext as S, type VersionControlFileData as V, type WorkspaceConfig as W, Core as a, type
|
|
411
|
+
export { type CollectionHandlers as A, createCollection as B, type CoreOptions as C, defineConfig as D, type ExtractedReference as E, type FileHandlerConfig as F, type GlobalConfig as G, type InitOptions as I, type JSONSchemaOptions as J, type MDXCollection as M, type PluginContext as P, type ServerContext as S, type VersionControlFileData as V, type WorkspaceConfig as W, Core as a, type MetaCollection as b, type Plugin as c, type Collection as d, type EmitEntry as e, type EmitContext as f, type EmitCodeGeneratorContext as g, type PluginOption as h, type EmitOptions as i, type EmitOutput as j, jsonSchema as k, type JSONSchemaHandler as l, type FIleCollectionHandler as m, buildFileHandler as n, type MDXCollectionHandler as o, type MDXCollectionConfig as p, defineMDX as q, type MetaContext as r, type MetaCollectionHandler as s, type MetaCollectionConfig as t, defineMeta as u, git as v, type VersionControlHandler as w, type GitPluginOptions as x, type VersionControlClient as y, type CollectionTypeInfo as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GlobalConfig } from './core-
|
|
2
|
-
export { a as Core, C as CoreOptions, g as EmitCodeGeneratorContext, f as EmitContext, e as EmitEntry, i as EmitOptions, j as EmitOutput,
|
|
1
|
+
import { d as Collection, G as GlobalConfig } from './core-Bo8KaWQz.js';
|
|
2
|
+
export { a as Core, C as CoreOptions, g as EmitCodeGeneratorContext, f as EmitContext, e as EmitEntry, i as EmitOptions, j as EmitOutput, c as Plugin, P as PluginContext, h as PluginOption, S as ServerContext } from './core-Bo8KaWQz.js';
|
|
3
3
|
import 'chokidar';
|
|
4
4
|
import '@mdx-js/mdx';
|
|
5
5
|
import 'vfile';
|
|
@@ -10,6 +10,8 @@ import 'vite';
|
|
|
10
10
|
import 'next';
|
|
11
11
|
import 'node:module';
|
|
12
12
|
|
|
13
|
-
type GetCollectionConfig<Config, Name extends string> = Config extends
|
|
13
|
+
type GetCollectionConfig<Config, Name extends string> = Config extends Record<Name, Collection> ? Config[Name] : Config extends {
|
|
14
|
+
default: GlobalConfig<infer Collections>;
|
|
15
|
+
} ? Collections[Name] : never;
|
|
14
16
|
|
|
15
17
|
export type { GetCollectionConfig };
|
package/dist/index.js
CHANGED
package/dist/next/index.cjs
CHANGED
|
@@ -43,7 +43,17 @@ var import_node_url = require("url");
|
|
|
43
43
|
function buildConfig(config, workspace) {
|
|
44
44
|
const collections = /* @__PURE__ */ new Map();
|
|
45
45
|
const loaded = {};
|
|
46
|
-
|
|
46
|
+
let globalConfig;
|
|
47
|
+
if ("default" in config) {
|
|
48
|
+
globalConfig = config.default;
|
|
49
|
+
for (const [k, v] of Object.entries(config)) {
|
|
50
|
+
if (k === "default") continue;
|
|
51
|
+
globalConfig.collections ??= {};
|
|
52
|
+
globalConfig.collections[k] = v;
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
globalConfig = config;
|
|
56
|
+
}
|
|
47
57
|
if (globalConfig.collections) {
|
|
48
58
|
for (const [name, collection] of Object.entries(globalConfig.collections)) {
|
|
49
59
|
collection.init?.({ name, workspace });
|
|
@@ -113,13 +123,26 @@ var import_tinyglobby = require("tinyglobby");
|
|
|
113
123
|
// src/utils/async-cache.ts
|
|
114
124
|
function createCache(store = /* @__PURE__ */ new Map()) {
|
|
115
125
|
return {
|
|
116
|
-
store,
|
|
117
126
|
cached(key, fn) {
|
|
118
127
|
let cached = store.get(key);
|
|
119
128
|
if (cached) return cached;
|
|
120
129
|
cached = fn();
|
|
130
|
+
if (cached instanceof Promise) {
|
|
131
|
+
cached = cached.then((out) => {
|
|
132
|
+
if (store.has(key)) {
|
|
133
|
+
store.set(key, out);
|
|
134
|
+
}
|
|
135
|
+
return out;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
121
138
|
store.set(key, cached);
|
|
122
139
|
return cached;
|
|
140
|
+
},
|
|
141
|
+
invalidate(key) {
|
|
142
|
+
store.delete(key);
|
|
143
|
+
},
|
|
144
|
+
$value() {
|
|
145
|
+
return this;
|
|
123
146
|
}
|
|
124
147
|
};
|
|
125
148
|
}
|
package/dist/next/index.d.ts
CHANGED
package/dist/next/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadConfig
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-LUM7SIZN.js";
|
|
4
|
+
import "../chunk-W6HENTK7.js";
|
|
5
5
|
import {
|
|
6
6
|
Core
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-NRZ4GE5O.js";
|
|
8
|
+
import "../chunk-MT7RY65Y.js";
|
|
9
|
+
import "../chunk-JBZTQ55D.js";
|
|
9
10
|
|
|
10
11
|
// src/next/index.ts
|
|
11
12
|
import * as path from "path";
|
package/dist/node/loader.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDynamicCore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-GGL4EF6H.js";
|
|
4
4
|
import {
|
|
5
5
|
Core
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-NRZ4GE5O.js";
|
|
7
|
+
import "../chunk-MT7RY65Y.js";
|
|
7
8
|
import {
|
|
8
9
|
createCache
|
|
9
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-JBZTQ55D.js";
|
|
10
11
|
|
|
11
12
|
// src/node/loader.ts
|
|
12
13
|
var configLoader = createDynamicCore({
|
package/dist/plugins/git.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { x as GitPluginOptions, y as VersionControlClient, V as VersionControlFileData, w as VersionControlHandler, v as default } from '../core-Bo8KaWQz.js';
|
|
2
2
|
import 'chokidar';
|
|
3
3
|
import '@mdx-js/mdx';
|
|
4
4
|
import 'vfile';
|
package/dist/plugins/git.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCore,
|
|
3
3
|
toWebpack
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-XR5N6ZXJ.js";
|
|
5
5
|
import "../../chunk-OUJENWQ4.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-NRZ4GE5O.js";
|
|
7
|
+
import "../../chunk-MT7RY65Y.js";
|
|
8
|
+
import "../../chunk-JBZTQ55D.js";
|
|
8
9
|
export {
|
|
9
10
|
getCore,
|
|
10
11
|
toWebpack
|
package/dist/vite/index.d.ts
CHANGED
package/dist/vite/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildConfig
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-W6HENTK7.js";
|
|
4
4
|
import {
|
|
5
5
|
Core
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-NRZ4GE5O.js";
|
|
7
|
+
import "../chunk-MT7RY65Y.js";
|
|
8
|
+
import "../chunk-JBZTQ55D.js";
|
|
8
9
|
|
|
9
10
|
// src/vite/index.ts
|
|
10
11
|
async function content(config, pluginOptions = {}) {
|
|
@@ -30,7 +31,7 @@ async function content(config, pluginOptions = {}) {
|
|
|
30
31
|
];
|
|
31
32
|
}
|
|
32
33
|
async function createStandaloneCore(pluginOptions = {}) {
|
|
33
|
-
const { loadConfig } = await import("../load-from-file-
|
|
34
|
+
const { loadConfig } = await import("../load-from-file-HL2VEY3M.js");
|
|
34
35
|
const core = createViteCore(applyDefaults(pluginOptions));
|
|
35
36
|
await core.init({
|
|
36
37
|
config: loadConfig(core, true)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuma-content",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The content processing layer for your app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@mdx-js/mdx": "^3.1.1",
|
|
68
|
-
"@standard-schema/spec": "^1.
|
|
68
|
+
"@standard-schema/spec": "^1.1.0",
|
|
69
69
|
"chokidar": "^5.0.0",
|
|
70
|
-
"esbuild": "^0.27.
|
|
70
|
+
"esbuild": "^0.27.2",
|
|
71
71
|
"estree-util-value-to-estree": "^3.5.0",
|
|
72
72
|
"js-yaml": "^4.1.1",
|
|
73
73
|
"mdast-util-to-markdown": "^2.1.2",
|
|
@@ -80,27 +80,28 @@
|
|
|
80
80
|
"unist-util-remove-position": "^5.0.0",
|
|
81
81
|
"unist-util-visit": "^5.0.0",
|
|
82
82
|
"vfile": "^6.0.3",
|
|
83
|
-
"zod": "^4.1
|
|
83
|
+
"zod": "^4.2.1"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@types/bun": "^1.3.
|
|
86
|
+
"@types/bun": "^1.3.5",
|
|
87
87
|
"@types/js-yaml": "^4.0.9",
|
|
88
88
|
"@types/mdast": "^4.0.4",
|
|
89
89
|
"@types/mdx": "^2.0.13",
|
|
90
90
|
"@types/node": "^24.10.2",
|
|
91
91
|
"@types/picomatch": "^4.0.2",
|
|
92
92
|
"@types/react": "^19.2.7",
|
|
93
|
-
"fumadocs-core": "^16.
|
|
93
|
+
"fumadocs-core": "^16.3.0",
|
|
94
94
|
"mdast-util-directive": "^3.1.0",
|
|
95
95
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
96
|
-
"next": "16.0
|
|
96
|
+
"next": "16.1.0",
|
|
97
97
|
"react": "^19.2.3",
|
|
98
98
|
"remark": "^15.0.1",
|
|
99
99
|
"remark-directive": "^4.0.0",
|
|
100
100
|
"remark-stringify": "^11.0.0",
|
|
101
|
-
"rollup": "^4.53.
|
|
102
|
-
"
|
|
103
|
-
"
|
|
101
|
+
"rollup": "^4.53.5",
|
|
102
|
+
"typescript": "^5.9.3",
|
|
103
|
+
"vite": "^7.3.0",
|
|
104
|
+
"webpack": "^5.104.1",
|
|
104
105
|
"typescript-config": "0.0.0"
|
|
105
106
|
},
|
|
106
107
|
"peerDependencies": {
|