fumapress 0.0.1 → 0.0.3
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/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +9 -92
- package/dist/config/content.d.ts +31 -0
- package/dist/config/content.d.ts.map +1 -0
- package/dist/config/content.js +22 -0
- package/dist/config/global.d.ts +12 -0
- package/dist/config/global.d.ts.map +1 -0
- package/dist/config/global.js +6 -0
- package/dist/config/routes.d.ts +25 -0
- package/dist/config/routes.d.ts.map +1 -0
- package/dist/config/routes.js +3 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +3 -0
- package/dist/entry.browser.d.ts +2 -0
- package/dist/entry.browser.d.ts.map +1 -0
- package/dist/entry.browser.js +26 -0
- package/dist/entry.rsc.d.ts +2 -0
- package/dist/entry.rsc.d.ts.map +1 -0
- package/dist/entry.rsc.js +32 -0
- package/dist/entry.ssr.d.ts +2 -0
- package/dist/entry.ssr.d.ts.map +1 -0
- package/dist/entry.ssr.js +25 -0
- package/dist/index.d.ts +3 -36
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -13
- package/dist/lib/find-file.d.ts +2 -0
- package/dist/lib/find-file.d.ts.map +1 -0
- package/dist/lib/find-file.js +12 -0
- package/dist/lib/layout.shared.d.ts +3 -0
- package/dist/lib/layout.shared.d.ts.map +1 -0
- package/dist/lib/layout.shared.js +7 -0
- package/dist/lib/source.d.ts +68 -0
- package/dist/lib/source.d.ts.map +1 -0
- package/dist/lib/source.js +23 -0
- package/dist/routes/config.d.ts +2 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +25 -0
- package/dist/routes/docs/page.d.ts +4 -0
- package/dist/routes/docs/page.d.ts.map +1 -0
- package/dist/routes/docs/page.js +25 -0
- package/dist/routes/docs/search.d.ts +3 -0
- package/dist/routes/docs/search.d.ts.map +1 -0
- package/dist/routes/docs/search.js +8 -0
- package/dist/routes/root/client.d.ts +5 -0
- package/dist/routes/root/client.d.ts.map +1 -0
- package/dist/routes/root/client.js +17 -0
- package/dist/routes/root/index.d.ts +6 -0
- package/dist/routes/root/index.d.ts.map +1 -0
- package/dist/routes/root/index.js +10 -0
- package/dist/vite/build.d.ts +16 -0
- package/dist/vite/build.d.ts.map +1 -0
- package/dist/vite/build.js +43 -0
- package/dist/vite/dev.d.ts +16 -0
- package/dist/vite/dev.d.ts.map +1 -0
- package/dist/vite/dev.js +13 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +63 -0
- package/package.json +52 -23
- package/dist/chunk-KMVUUT6X.js +0 -10
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/vite.d.ts +0 -5
- package/dist/vite.js +0 -124
- package/src/cli/index.ts +0 -18
- package/src/config/content.ts +0 -7
- package/src/config/global.ts +0 -16
- package/src/config/routes.ts +0 -29
- package/src/constants.ts +0 -7
- package/src/entry.browser.tsx +0 -52
- package/src/entry.rsc.tsx +0 -46
- package/src/entry.ssr.tsx +0 -38
- package/src/index.ts +0 -2
- package/src/lib/find-file.ts +0 -12
- package/src/lib/get-config.ts +0 -42
- package/src/lib/layout.shared.tsx +0 -9
- package/src/lib/root-layout.tsx +0 -26
- package/src/lib/source.ts +0 -35
- package/src/routes/config.ts +0 -28
- package/src/routes/docs/page.tsx +0 -36
- package/src/routes/docs/search.ts +0 -11
- package/src/routes/home.tsx +0 -24
- package/src/routes/root/client.tsx +0 -50
- package/src/routes/root/index.tsx +0 -12
- package/src/vite/build.ts +0 -69
- package/src/vite/dev.ts +0 -41
- package/src/vite/index.ts +0 -62
- package/src/vite-env.d.ts +0 -6
package/dist/cli/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,97 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// src/vite/build.ts
|
|
8
|
-
import { createBuilder } from "vite";
|
|
9
|
-
async function viteBuild({
|
|
10
|
-
assetsInlineLimit,
|
|
11
|
-
clearScreen,
|
|
12
|
-
config: configFile,
|
|
13
|
-
emptyOutDir,
|
|
14
|
-
force,
|
|
15
|
-
logLevel,
|
|
16
|
-
minify,
|
|
17
|
-
mode,
|
|
18
|
-
sourcemapClient,
|
|
19
|
-
sourcemapServer
|
|
20
|
-
} = {}) {
|
|
21
|
-
try {
|
|
22
|
-
const builder = await createBuilder({
|
|
23
|
-
mode,
|
|
24
|
-
configFile,
|
|
25
|
-
build: {
|
|
26
|
-
assetsInlineLimit,
|
|
27
|
-
emptyOutDir,
|
|
28
|
-
minify
|
|
29
|
-
},
|
|
30
|
-
optimizeDeps: { force },
|
|
31
|
-
clearScreen,
|
|
32
|
-
logLevel,
|
|
33
|
-
plugins: [
|
|
34
|
-
{
|
|
35
|
-
name: "fumapress:cli-config",
|
|
36
|
-
configEnvironment(name) {
|
|
37
|
-
if (sourcemapClient && name === "client") {
|
|
38
|
-
return {
|
|
39
|
-
build: {
|
|
40
|
-
sourcemap: sourcemapClient
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if (sourcemapServer && name !== "client") {
|
|
45
|
-
return {
|
|
46
|
-
build: {
|
|
47
|
-
sourcemap: sourcemapServer
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
await builder.buildApp();
|
|
56
|
-
console.log("Build completed successfully");
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.error("Build failed:", error);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/vite/dev.ts
|
|
63
|
-
import { createServer } from "vite";
|
|
64
|
-
async function dev({
|
|
65
|
-
clearScreen,
|
|
66
|
-
config: configFile,
|
|
67
|
-
cors,
|
|
68
|
-
force,
|
|
69
|
-
host,
|
|
70
|
-
logLevel,
|
|
71
|
-
mode,
|
|
72
|
-
open,
|
|
73
|
-
port,
|
|
74
|
-
strictPort
|
|
75
|
-
} = {}) {
|
|
76
|
-
const server = await createServer({
|
|
77
|
-
mode,
|
|
78
|
-
configFile,
|
|
79
|
-
server: { open, cors, host, port, strictPort },
|
|
80
|
-
optimizeDeps: { force },
|
|
81
|
-
clearScreen,
|
|
82
|
-
logLevel
|
|
83
|
-
});
|
|
84
|
-
await server.listen();
|
|
85
|
-
server.printUrls();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// src/cli/index.ts
|
|
89
|
-
program.command("build").action(async () => {
|
|
90
|
-
await viteBuild();
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import { viteBuild } from "../vite/build.js";
|
|
4
|
+
import { dev } from "../vite/dev.js";
|
|
5
|
+
program.command('build').action(async () => {
|
|
6
|
+
await viteBuild();
|
|
91
7
|
});
|
|
92
|
-
program.command(
|
|
93
|
-
|
|
8
|
+
program.command('dev').action(async () => {
|
|
9
|
+
await dev();
|
|
94
10
|
});
|
|
95
|
-
program.command(
|
|
11
|
+
program.command('typegen').action(async () => {
|
|
12
|
+
// TODO: typegen content shapes
|
|
96
13
|
});
|
|
97
14
|
void program.parseAsync(process.argv);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DefaultMDXOptions } from 'fumadocs-mdx/config';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { FumapressConfig } from "./global.js";
|
|
4
|
+
import type { ProcessorOptions } from '@mdx-js/mdx';
|
|
5
|
+
export interface ContentConfig {
|
|
6
|
+
mdx?: ({
|
|
7
|
+
preset?: 'fumadocs';
|
|
8
|
+
} & DefaultMDXOptions) | ({
|
|
9
|
+
preset: 'minimal';
|
|
10
|
+
} & ProcessorOptions);
|
|
11
|
+
}
|
|
12
|
+
export declare function createContentConfig(config: FumapressConfig): Promise<{
|
|
13
|
+
docs: import("fumadocs-mdx/config").DocsCollection<z.ZodObject<{
|
|
14
|
+
title: z.ZodString;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
17
|
+
full: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
_openapi: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
19
|
+
layout: z.ZodDefault<z.ZodString>;
|
|
20
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
21
|
+
title: z.ZodOptional<z.ZodString>;
|
|
22
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
root: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$loose>, false>;
|
|
28
|
+
default: import("fumadocs-mdx/config").GlobalConfig;
|
|
29
|
+
}>;
|
|
30
|
+
export type FumadocsMDXConfig = Awaited<ReturnType<typeof createContentConfig>>;
|
|
31
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/config/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAO7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAiB;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EACA,CAAC;QACC,MAAM,CAAC,EAAE,UAAU,CAAC;KACrB,GAAG,iBAAiB,CAAC,GACtB,CAAC;QACC,MAAM,EAAE,SAAS,CAAC;KACnB,GAAG,gBAAgB,CAAC,CAAC;CAC3B;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,eAAe;;;;;;;;;;;;;;;;;GAmBhE;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineConfig, defineDocs, frontmatterSchema, metaSchema, } from 'fumadocs-mdx/config';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export async function createContentConfig(config) {
|
|
4
|
+
return {
|
|
5
|
+
docs: defineDocs({
|
|
6
|
+
dir: 'content',
|
|
7
|
+
docs: {
|
|
8
|
+
schema: frontmatterSchema
|
|
9
|
+
.extend({
|
|
10
|
+
layout: z.string().default('docs'),
|
|
11
|
+
})
|
|
12
|
+
.loose(),
|
|
13
|
+
},
|
|
14
|
+
meta: {
|
|
15
|
+
schema: metaSchema.loose(),
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
default: defineConfig({
|
|
19
|
+
mdxOptions: config.content?.mdx,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ContentConfig } from "./content.js";
|
|
2
|
+
export interface FumapressConfig {
|
|
3
|
+
/**
|
|
4
|
+
* the directory for app files (relative to project root)
|
|
5
|
+
*
|
|
6
|
+
* @defaultValue './app'
|
|
7
|
+
*/
|
|
8
|
+
appDir: string;
|
|
9
|
+
content?: ContentConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare function defineConfig(config: Partial<FumapressConfig>): FumapressConfig;
|
|
12
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/config/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAkB;AAE/C,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAC/B,eAAe,CAKjB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { unstable_RSCRouteConfigEntry as RSCRouteConfigEntry } from 'react-router';
|
|
2
|
+
type RouteConfigParentEntry = Exclude<RSCRouteConfigEntry, {
|
|
3
|
+
index: true;
|
|
4
|
+
}>;
|
|
5
|
+
export interface RoutesConfig {
|
|
6
|
+
/**
|
|
7
|
+
* the root entry
|
|
8
|
+
*/
|
|
9
|
+
root?: RouteConfigParentEntry;
|
|
10
|
+
/**
|
|
11
|
+
* Layout name -> layout entry
|
|
12
|
+
*/
|
|
13
|
+
layouts?: Record<string, RouteConfigParentEntry>;
|
|
14
|
+
/**
|
|
15
|
+
* entry for content pages
|
|
16
|
+
*/
|
|
17
|
+
page?: RSCRouteConfigEntry;
|
|
18
|
+
/**
|
|
19
|
+
* Add additional entries
|
|
20
|
+
*/
|
|
21
|
+
extends?: RSCRouteConfigEntry;
|
|
22
|
+
}
|
|
23
|
+
export declare function defineRoutes(config: RoutesConfig): RoutesConfig;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/config/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,IAAI,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExF,KAAK,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,EAAE;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAE5E,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAE9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAEjD;;OAEG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAE/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,QAGnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.browser.d.ts","sourceRoot":"","sources":["../src/entry.browser.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFromReadableStream, createTemporaryReferenceSet, encodeReply, setServerCallback, } from '@vitejs/plugin-rsc/browser';
|
|
3
|
+
import { startTransition, StrictMode } from 'react';
|
|
4
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
5
|
+
import { unstable_createCallServer as createCallServer, unstable_getRSCStream as getRSCStream, unstable_RSCHydratedRouter as RSCHydratedRouter, } from 'react-router';
|
|
6
|
+
// Create and set the callServer function to support post-hydration server actions.
|
|
7
|
+
setServerCallback(createCallServer({
|
|
8
|
+
createFromReadableStream,
|
|
9
|
+
createTemporaryReferenceSet,
|
|
10
|
+
encodeReply,
|
|
11
|
+
}));
|
|
12
|
+
// Get and decode the initial server payload
|
|
13
|
+
createFromReadableStream(getRSCStream()).then((payload) => {
|
|
14
|
+
startTransition(async () => {
|
|
15
|
+
const formState = payload.type === 'render' ? await payload.formState : undefined;
|
|
16
|
+
hydrateRoot(document, _jsx(StrictMode, { children: _jsx(RSCHydratedRouter, { createFromReadableStream: createFromReadableStream, payload: payload }) }), {
|
|
17
|
+
// @ts-expect-error - no types for this yet
|
|
18
|
+
formState,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
if (import.meta.hot) {
|
|
23
|
+
import.meta.hot.on('rsc:update', () => {
|
|
24
|
+
window.__router.revalidate();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.rsc.d.ts","sourceRoot":"","sources":["../src/entry.rsc.tsx"],"names":[],"mappings":"AAkCA,wBAA8B,OAAO,CAAC,OAAO,EAAE,OAAO,qBAOrD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, loadServerAction, renderToReadableStream, } from '@vitejs/plugin-rsc/rsc';
|
|
2
|
+
import { unstable_matchRSCServerRequest as matchRSCServerRequest } from 'react-router';
|
|
3
|
+
import { routes } from "./routes/config.js";
|
|
4
|
+
async function fetchServer(request) {
|
|
5
|
+
return matchRSCServerRequest({
|
|
6
|
+
// Provide the React Server touchpoints.
|
|
7
|
+
createTemporaryReferenceSet,
|
|
8
|
+
decodeAction,
|
|
9
|
+
decodeFormState,
|
|
10
|
+
decodeReply,
|
|
11
|
+
loadServerAction,
|
|
12
|
+
// The incoming request.
|
|
13
|
+
request,
|
|
14
|
+
// The app routes.
|
|
15
|
+
routes: await routes(),
|
|
16
|
+
// Encode the match with the React Server implementation.
|
|
17
|
+
generateResponse(match, options) {
|
|
18
|
+
return new Response(renderToReadableStream(match.payload, options), {
|
|
19
|
+
status: match.statusCode,
|
|
20
|
+
headers: match.headers,
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export default async function handler(request) {
|
|
26
|
+
// Import the generateHTML function from the client environment
|
|
27
|
+
const ssr = await import.meta.viteRsc.loadModule('ssr', 'index');
|
|
28
|
+
return ssr.generateHTML(request, fetchServer);
|
|
29
|
+
}
|
|
30
|
+
if (import.meta.hot) {
|
|
31
|
+
import.meta.hot.accept();
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.ssr.d.ts","sourceRoot":"","sources":["../src/entry.ssr.tsx"],"names":[],"mappings":"AAOA,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,GACnD,OAAO,CAAC,QAAQ,CAAC,CA2BnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFromReadableStream } from '@vitejs/plugin-rsc/ssr';
|
|
3
|
+
import { renderToReadableStream as renderHTMLToReadableStream } from 'react-dom/server.edge';
|
|
4
|
+
import { unstable_routeRSCServerRequest as routeRSCServerRequest, unstable_RSCStaticRouter as RSCStaticRouter, } from 'react-router';
|
|
5
|
+
export async function generateHTML(request, fetchServer) {
|
|
6
|
+
return await routeRSCServerRequest({
|
|
7
|
+
// The incoming request.
|
|
8
|
+
request,
|
|
9
|
+
// How to call the React Server.
|
|
10
|
+
fetchServer,
|
|
11
|
+
// Provide the React Server touchpoints.
|
|
12
|
+
createFromReadableStream,
|
|
13
|
+
// Render the router to HTML.
|
|
14
|
+
async renderHTML(getPayload) {
|
|
15
|
+
const payload = await getPayload();
|
|
16
|
+
const formState = payload.type === 'render' ? await payload.formState : undefined;
|
|
17
|
+
const bootstrapScriptContent = await import.meta.viteRsc.loadBootstrapScriptContent('index');
|
|
18
|
+
return await renderHTMLToReadableStream(_jsx(RSCStaticRouter, { getPayload: getPayload }), {
|
|
19
|
+
bootstrapScriptContent,
|
|
20
|
+
// @ts-expect-error - no types for this yet
|
|
21
|
+
formState,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
index: true;
|
|
5
|
-
}>;
|
|
6
|
-
interface RoutesConfig {
|
|
7
|
-
/**
|
|
8
|
-
* the root entry
|
|
9
|
-
*/
|
|
10
|
-
root?: RouteConfigParentEntry;
|
|
11
|
-
/**
|
|
12
|
-
* Layout name -> layout entry
|
|
13
|
-
*/
|
|
14
|
-
layouts?: Record<string, RouteConfigParentEntry>;
|
|
15
|
-
/**
|
|
16
|
-
* entry for content pages
|
|
17
|
-
*/
|
|
18
|
-
page?: unstable_RSCRouteConfigEntry;
|
|
19
|
-
/**
|
|
20
|
-
* Add additional entries
|
|
21
|
-
*/
|
|
22
|
-
extends?: unstable_RSCRouteConfigEntry;
|
|
23
|
-
}
|
|
24
|
-
declare function defineRoutes(config: RoutesConfig): RoutesConfig;
|
|
25
|
-
|
|
26
|
-
interface FumapressConfig {
|
|
27
|
-
/**
|
|
28
|
-
* the directory for app files (relative to project root)
|
|
29
|
-
*
|
|
30
|
-
* @defaultValue './app'
|
|
31
|
-
*/
|
|
32
|
-
appDir: string;
|
|
33
|
-
}
|
|
34
|
-
declare function defineConfig(config: Partial<FumapressConfig>): FumapressConfig;
|
|
35
|
-
|
|
36
|
-
export { type FumapressConfig, type RoutesConfig, defineConfig, defineRoutes };
|
|
1
|
+
export * from "./config/routes.js";
|
|
2
|
+
export * from "./config/global.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,mCAAmC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
} from "./chunk-KMVUUT6X.js";
|
|
4
|
-
import "./chunk-MLKGABMK.js";
|
|
5
|
-
|
|
6
|
-
// src/config/routes.ts
|
|
7
|
-
function defineRoutes(config) {
|
|
8
|
-
return config;
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
defineConfig,
|
|
12
|
-
defineRoutes
|
|
13
|
-
};
|
|
1
|
+
export * from "./config/routes.js";
|
|
2
|
+
export * from "./config/global.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-file.d.ts","sourceRoot":"","sources":["../../src/lib/find-file.ts"],"names":[],"mappings":"AAEA,wBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAS3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.shared.d.ts","sourceRoot":"","sources":["../../src/lib/layout.shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,WAAW,IAAI,eAAe,CAM7C"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type InferPageType } from 'fumadocs-core/source';
|
|
2
|
+
export declare const create: import("fumadocs-mdx/runtime/vite").ServerCreate<{
|
|
3
|
+
docs: import("fumadocs-mdx/config").DocsCollection<import("zod").ZodObject<{
|
|
4
|
+
title: import("zod").ZodString;
|
|
5
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
icon: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
full: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
8
|
+
_openapi: import("zod").ZodOptional<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
|
|
9
|
+
layout: import("zod").ZodDefault<import("zod").ZodString>;
|
|
10
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{
|
|
11
|
+
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
+
pages: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
14
|
+
root: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
15
|
+
defaultOpen: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
16
|
+
icon: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
}, import("zod/v4/core").$loose>, false>;
|
|
18
|
+
default: import("fumadocs-mdx/config").GlobalConfig;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const docs: {
|
|
21
|
+
doc: import("fumadocs-mdx/runtime/vite").DocMap<{
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
title: string;
|
|
24
|
+
layout: string;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
icon?: string | undefined;
|
|
27
|
+
full?: boolean | undefined;
|
|
28
|
+
_openapi?: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
} | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
meta: import("fumadocs-mdx/runtime/vite").MetaMap<{
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
title?: string | undefined;
|
|
35
|
+
pages?: string[] | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
root?: boolean | undefined;
|
|
38
|
+
defaultOpen?: boolean | undefined;
|
|
39
|
+
icon?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
export declare const source: import("fumadocs-core/source").LoaderOutput<{
|
|
43
|
+
source: {
|
|
44
|
+
pageData: import("fumadocs-mdx").DocCollectionEntry<{
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
title: string;
|
|
47
|
+
layout: string;
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
icon?: string | undefined;
|
|
50
|
+
full?: boolean | undefined;
|
|
51
|
+
_openapi?: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
} | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
metaData: import("fumadocs-mdx").MetaCollectionEntry<{
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
pages?: string[] | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
root?: boolean | undefined;
|
|
61
|
+
defaultOpen?: boolean | undefined;
|
|
62
|
+
icon?: string | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
i18n: undefined;
|
|
66
|
+
}>;
|
|
67
|
+
export type Page = InferPageType<typeof source>;
|
|
68
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/lib/source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,sBAAsB,CAAC;AAIlE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;EAAkC,CAAC;AAEtD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;CAsBhB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EAGjB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="fumadocs-mdx" />
|
|
2
|
+
import { loader } from 'fumadocs-core/source';
|
|
3
|
+
import { fromConfig } from 'fumadocs-mdx/runtime/vite';
|
|
4
|
+
export const create = fromConfig();
|
|
5
|
+
export const docs = {
|
|
6
|
+
doc: create.doc('docs', './content', import.meta.glob(['./**/*.{mdx,md}'], {
|
|
7
|
+
base: '/content',
|
|
8
|
+
query: {
|
|
9
|
+
collection: 'docs',
|
|
10
|
+
},
|
|
11
|
+
})),
|
|
12
|
+
meta: create.meta('docs', './content', import.meta.glob(['./**/*.{json,yaml}'], {
|
|
13
|
+
import: 'default',
|
|
14
|
+
base: '/content',
|
|
15
|
+
query: {
|
|
16
|
+
collection: 'docs',
|
|
17
|
+
},
|
|
18
|
+
})),
|
|
19
|
+
};
|
|
20
|
+
export const source = loader({
|
|
21
|
+
source: await create.sourceAsync(docs.doc, docs.meta),
|
|
22
|
+
baseUrl: '/',
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/routes/config.ts"],"names":[],"mappings":"AAGA,wBAAsB,MAAM,mBAwB3B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import config from 'virtual:app/routes';
|
|
2
|
+
export async function routes() {
|
|
3
|
+
const root = config.root ?? {
|
|
4
|
+
id: 'root',
|
|
5
|
+
path: '',
|
|
6
|
+
lazy: () => import("./root/index.js"),
|
|
7
|
+
};
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
...root,
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
id: 'docs',
|
|
14
|
+
path: '*?',
|
|
15
|
+
lazy: () => import("./docs/page.js"),
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'api/search',
|
|
19
|
+
path: 'api/search',
|
|
20
|
+
lazy: () => import("./docs/search.js"),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/routes/docs/page.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,MAAM,GACP,EAAE;IACD,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACzC,2CAkBA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
|
3
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle, } from 'fumadocs-ui/page';
|
|
4
|
+
import { source } from "../../lib/source.js";
|
|
5
|
+
import { baseOptions } from '../../lib/layout.shared';
|
|
6
|
+
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
7
|
+
import { HomeLayout } from 'fumadocs-ui/layouts/home';
|
|
8
|
+
export default function ServerComponent({ params, }) {
|
|
9
|
+
const slugs = params['*']?.split('/').filter((v) => v.length > 0) ?? [];
|
|
10
|
+
const page = source.getPage(slugs);
|
|
11
|
+
if (!page)
|
|
12
|
+
throw new Response('Not found', { status: 404 });
|
|
13
|
+
const { body: MDX } = page.data;
|
|
14
|
+
return (_jsxs(Layout, { page: page, children: [_jsx("title", { children: page.data.title }), _jsx("meta", { name: "description", content: page.data.description }), _jsx(DocsTitle, { children: page.data.title }), _jsx(DocsDescription, { children: page.data.description }), _jsx(DocsBody, { children: _jsx(MDX, { components: { ...defaultMdxComponents } }) })] }));
|
|
15
|
+
}
|
|
16
|
+
function Layout({ page, children }) {
|
|
17
|
+
const layout = page.data.layout;
|
|
18
|
+
if (layout === 'docs') {
|
|
19
|
+
return (_jsx(DocsLayout, { ...baseOptions(), tree: source.pageTree, children: _jsx(DocsPage, { toc: page.data.toc, children: children }) }));
|
|
20
|
+
}
|
|
21
|
+
if (layout === 'home') {
|
|
22
|
+
return (_jsx(HomeLayout, { ...baseOptions(), children: _jsx("div", { className: "w-full max-w-fd-container mx-auto p-4", children: children }) }));
|
|
23
|
+
}
|
|
24
|
+
return children;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/routes/docs/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAOvD,wBAAsB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,qBAE3D"}
|