@fierst/c7t 0.0.0-stage → 1.0.0-beta.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +62 -2
- package/bin/c7t.d.mts +1 -0
- package/bin/c7t.mjs +107 -0
- package/bin/create.d.mts +9 -0
- package/bin/create.mjs +337 -0
- package/dist/adapters/bun.d.mts +40 -0
- package/dist/adapters/bun.mjs +114 -0
- package/dist/adapters/cloudflare.d.mts +29 -0
- package/dist/adapters/cloudflare.mjs +28 -0
- package/dist/adapters/node.d.mts +31 -0
- package/dist/adapters/node.mjs +139 -0
- package/dist/adapters/static.d.mts +34 -0
- package/dist/adapters/static.mjs +53 -0
- package/dist/adapters/vercel.d.mts +40 -0
- package/dist/adapters/vercel.mjs +79 -0
- package/dist/client.d.mts +78 -0
- package/dist/client.mjs +181 -0
- package/dist/head-CUiNFY7Q.mjs +142 -0
- package/dist/index.d.mts +77 -0
- package/dist/index.mjs +25 -0
- package/dist/multipart-CwqTb3AQ.mjs +72 -0
- package/dist/protocol-B6QOAMGj.d.mts +115 -0
- package/dist/protocol-CZANZJ5x.mjs +126 -0
- package/dist/router-19ZZ3woS.d.mts +148 -0
- package/dist/router-B50LekA_.mjs +680 -0
- package/dist/router.d.mts +2 -0
- package/dist/router.mjs +1 -0
- package/dist/search-params-C03mU47i.mjs +79 -0
- package/dist/server.d.mts +146 -0
- package/dist/server.mjs +850 -0
- package/dist/ssg-DFBgqaob.d.mts +40 -0
- package/dist/ssg.d.mts +2 -0
- package/dist/ssg.mjs +179 -0
- package/dist/vite.d.mts +95 -0
- package/dist/vite.mjs +920 -0
- package/docs/README.md +26 -0
- package/docs/guides/01-getting-started.md +164 -0
- package/docs/guides/02-data-fetching-and-mutations.md +258 -0
- package/docs/guides/03-streaming-and-workflows.md +198 -0
- package/docs/guides/04-routing-layouts-and-state.md +236 -0
- package/docs/guides/05-auth-sessions-and-security.md +179 -0
- package/docs/guides/06-ssg-and-deployment.md +247 -0
- package/docs/guides/07-databases-and-drizzle.md +200 -0
- package/docs/reference.md +112 -0
- package/llms.txt +1627 -0
- package/package.json +122 -4
- package/template/gitignore +11 -0
- package/template/package.json +22 -0
- package/template/src/routes/404.tsx +16 -0
- package/template/src/routes/about.tsx +22 -0
- package/template/src/routes/index.tsx +41 -0
- package/template/src/routes/layout.tsx +14 -0
- package/template/src/styles.css +39 -0
- package/template/tsconfig.json +18 -0
- package/template/vite.config.ts +16 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { m as RouteModuleEntry } from "./router-19ZZ3woS.mjs";
|
|
2
|
+
type PrerenderParamRecord = Record<string, string>;
|
|
3
|
+
type PrerenderEntry = string | PrerenderParamRecord;
|
|
4
|
+
interface PrerenderOptions {
|
|
5
|
+
/** Hono server instance returned by `createServer()` */
|
|
6
|
+
app: {
|
|
7
|
+
request(input: RequestInfo | URL, requestInit?: RequestInit): Response | Promise<Response>;
|
|
8
|
+
};
|
|
9
|
+
/** Route entries (supports pages, layouts, and HTTP `GET` API endpoints) */
|
|
10
|
+
routes: readonly RouteModuleEntry[];
|
|
11
|
+
/** Target output directory (e.g. `'dist/client'`) */
|
|
12
|
+
outDir: string;
|
|
13
|
+
/**
|
|
14
|
+
* `'marked'` (default): prerenders routes exporting `prerender = true` or `prerender = () => [...]`.
|
|
15
|
+
* `'all'`: prerenders every static & crawled route in the application for 100% serverless static hosting!
|
|
16
|
+
*/
|
|
17
|
+
mode?: "marked" | "all";
|
|
18
|
+
/** Automatically crawl internal `<a href="/...">` links in rendered HTML (default: `true`) */
|
|
19
|
+
crawl?: boolean;
|
|
20
|
+
/** Additional seed URL paths to prerender (e.g. `['/']`) */
|
|
21
|
+
entries?: readonly string[];
|
|
22
|
+
/** Action when a crawled internal link returns HTTP 404 (default: `'error'`) */
|
|
23
|
+
onBrokenLink?: "error" | "warn" | "ignore";
|
|
24
|
+
/** Synthetic origin used for build-time Request URLs (default: `'http://prerender.local'`) */
|
|
25
|
+
origin?: string;
|
|
26
|
+
}
|
|
27
|
+
interface PrerenderResult {
|
|
28
|
+
/** URL paths written as static HTML pages */
|
|
29
|
+
readonly pages: readonly string[];
|
|
30
|
+
/** URL paths written as `__c7t.json` static receipt sidecars */
|
|
31
|
+
readonly sidecars: readonly string[];
|
|
32
|
+
/** Non-HTML static assets written (e.g. `/sitemap.xml`, `/rss.xml`) */
|
|
33
|
+
readonly assets: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
declare function getSidecarPathname(routePath: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Prerender static & hybrid routes to disk (`index.html`, `__c7t.json` receipt sidecars, and non-HTML endpoints).
|
|
38
|
+
*/
|
|
39
|
+
declare function prerenderApp(options: PrerenderOptions): Promise<PrerenderResult>;
|
|
40
|
+
export { getSidecarPathname as a, PrerenderResult as i, PrerenderOptions as n, prerenderApp as o, PrerenderParamRecord as r, PrerenderEntry as t };
|
package/dist/ssg.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as getSidecarPathname, i as PrerenderResult, n as PrerenderOptions, o as prerenderApp, r as PrerenderParamRecord, t as PrerenderEntry } from "./ssg-DFBgqaob.mjs";
|
|
2
|
+
export { PrerenderEntry, PrerenderOptions, PrerenderParamRecord, PrerenderResult, getSidecarPathname, prerenderApp };
|
package/dist/ssg.mjs
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { c as matchNestedRoutes, i as buildRoutes } from "./router-B50LekA_.mjs";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
// src/ssg.ts
|
|
5
|
+
function getSidecarPathname(routePath) {
|
|
6
|
+
const clean = routePath.split("?")[0].split("#")[0] || "/";
|
|
7
|
+
if (clean === "/") return "/__c7t.json";
|
|
8
|
+
return `${clean.replace(/\/+$/, "")}/__c7t.json`;
|
|
9
|
+
}
|
|
10
|
+
function interpolateRoutePattern(pattern, params) {
|
|
11
|
+
if (pattern === "/") return "/";
|
|
12
|
+
return "/" + pattern.split("/").filter(Boolean).map((seg) => {
|
|
13
|
+
if (seg.startsWith(":")) {
|
|
14
|
+
const key = seg.slice(1);
|
|
15
|
+
const val = params[key];
|
|
16
|
+
if (val === void 0) throw new Error(`[c7t SSG] Missing param "${key}" when prerendering pattern "${pattern}".`);
|
|
17
|
+
return encodeURIComponent(val);
|
|
18
|
+
}
|
|
19
|
+
if (seg === "*") return (Object.values(params)[0] ?? "").split("/").map((p) => encodeURIComponent(p)).join("/");
|
|
20
|
+
return seg;
|
|
21
|
+
}).join("/");
|
|
22
|
+
}
|
|
23
|
+
function extractInternalLinks(html, origin) {
|
|
24
|
+
const links = [];
|
|
25
|
+
const tagRegex = /<a\b([^>]*?)>/gi;
|
|
26
|
+
let tagMatch;
|
|
27
|
+
while ((tagMatch = tagRegex.exec(html)) !== null) {
|
|
28
|
+
const attrs = tagMatch[1];
|
|
29
|
+
if (/\bdownload\b/i.test(attrs) || /\bdata-c7t-reload\b/i.test(attrs)) continue;
|
|
30
|
+
if (/\btarget\s*=\s*["']?_blank/i.test(attrs)) continue;
|
|
31
|
+
const hrefMatch = /\bhref\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(attrs);
|
|
32
|
+
if (!hrefMatch) continue;
|
|
33
|
+
const rawHref = (hrefMatch[1] ?? hrefMatch[2] ?? hrefMatch[3] ?? "").trim();
|
|
34
|
+
if (!rawHref || rawHref.startsWith("#") || rawHref.startsWith("//")) continue;
|
|
35
|
+
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(rawHref)) {
|
|
36
|
+
try {
|
|
37
|
+
const parsed = new URL(rawHref);
|
|
38
|
+
if (parsed.origin !== origin) continue;
|
|
39
|
+
links.push(parsed.pathname || "/");
|
|
40
|
+
} catch {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (rawHref.startsWith("/")) {
|
|
46
|
+
const cleanPath = rawHref.split("?")[0].split("#")[0] || "/";
|
|
47
|
+
links.push(cleanPath);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return links;
|
|
51
|
+
}
|
|
52
|
+
function extractEmbeddedReceiptJson(html) {
|
|
53
|
+
const match = /<script\b[^>]*\bid="__C7T_RECEIPTS__"[^>]*>([\s\S]*?)<\/script>/i.exec(html);
|
|
54
|
+
if (!match) return {
|
|
55
|
+
p: [],
|
|
56
|
+
r: {}
|
|
57
|
+
};
|
|
58
|
+
const scriptBody = match[1].trim();
|
|
59
|
+
if (!scriptBody.startsWith("window.__C7T_R=")) return {
|
|
60
|
+
p: [],
|
|
61
|
+
r: {}
|
|
62
|
+
};
|
|
63
|
+
const rawJson = scriptBody.slice(15).replace(/;$/, "");
|
|
64
|
+
try {
|
|
65
|
+
return JSON.parse(rawJson);
|
|
66
|
+
} catch {
|
|
67
|
+
return {
|
|
68
|
+
p: [],
|
|
69
|
+
r: {}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function routeFileToUrlPattern(file) {
|
|
74
|
+
const parts = file.replace(/\\/g, "/").replace(/^\/+/, "").replace(/^src\/routes\//, "").replace(/^routes\//, "").replace(/\.(tsx|ts|jsx|js)$/, "").split("/").filter((seg) => Boolean(seg) && !/^\([^/]+\)$/.test(seg));
|
|
75
|
+
if (parts.at(-1) === "index") parts.pop();
|
|
76
|
+
const isDynamic = parts.some((p) => p.startsWith("[") || p.startsWith(":"));
|
|
77
|
+
const urlSegs = parts.map((p) => {
|
|
78
|
+
if (/^\[\.\.\.([A-Za-z_]\w*)\]$/.exec(p)) return "*";
|
|
79
|
+
const dyn = /^\[([A-Za-z_]\w*)\]$/.exec(p);
|
|
80
|
+
if (dyn) return `:${dyn[1]}`;
|
|
81
|
+
return p;
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
pattern: urlSegs.length === 0 ? "/" : "/" + urlSegs.join("/"),
|
|
85
|
+
isDynamic
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Prerender static & hybrid routes to disk (`index.html`, `__c7t.json` receipt sidecars, and non-HTML endpoints).
|
|
90
|
+
*/
|
|
91
|
+
async function prerenderApp(options) {
|
|
92
|
+
const mode = options.mode ?? "marked";
|
|
93
|
+
const crawl = options.crawl ?? true;
|
|
94
|
+
const onBrokenLink = options.onBrokenLink ?? "error";
|
|
95
|
+
const origin = (options.origin ?? "http://prerender.local").replace(/\/$/, "");
|
|
96
|
+
const defaultPrerender = mode === "all";
|
|
97
|
+
const pageEntries = options.routes.filter((r) => Boolean(r.component));
|
|
98
|
+
const compiledPages = buildRoutes(pageEntries, { prerender: defaultPrerender });
|
|
99
|
+
const compiledByPattern = /* @__PURE__ */ new Map();
|
|
100
|
+
for (const cp of compiledPages) compiledByPattern.set(cp.pattern, cp);
|
|
101
|
+
const queue = [];
|
|
102
|
+
const enqueued = /* @__PURE__ */ new Set();
|
|
103
|
+
const pushPath = (pathname, referrer) => {
|
|
104
|
+
const norm = pathname === "/" ? "/" : pathname.replace(/\/+$/, "") || "/";
|
|
105
|
+
if (enqueued.has(norm)) return;
|
|
106
|
+
enqueued.add(norm);
|
|
107
|
+
queue.push({
|
|
108
|
+
pathname: norm,
|
|
109
|
+
referrer
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
for (const seed of options.entries ?? []) pushPath(seed);
|
|
113
|
+
for (const entry of options.routes) {
|
|
114
|
+
const base = entry.file.replace(/\\/g, "/").split("/").at(-1)?.replace(/\.(tsx|ts|jsx|js)$/, "");
|
|
115
|
+
if (base === "layout" || base === "_layout" || base === "404" || base === "_404" || base === "error" || base === "_error") continue;
|
|
116
|
+
if (!entry.component && !entry.handlers?.GET) continue;
|
|
117
|
+
const { pattern, isDynamic } = routeFileToUrlPattern(entry.file);
|
|
118
|
+
const compiledPage = entry.component ? compiledByPattern.get(pattern) : void 0;
|
|
119
|
+
if (!(compiledPage ? compiledPage.prerender : entry.prerender !== void 0 ? Boolean(entry.prerender) : defaultPrerender)) continue;
|
|
120
|
+
if (typeof entry.prerender === "function") {
|
|
121
|
+
const generated = await entry.prerender();
|
|
122
|
+
for (const item of generated) if (typeof item === "string") pushPath(item);
|
|
123
|
+
else pushPath(interpolateRoutePattern(pattern, item));
|
|
124
|
+
} else if (!isDynamic) pushPath(pattern);
|
|
125
|
+
}
|
|
126
|
+
const pages = [];
|
|
127
|
+
const sidecars = [];
|
|
128
|
+
const assets = [];
|
|
129
|
+
while (queue.length > 0) {
|
|
130
|
+
const { pathname, referrer } = queue.shift();
|
|
131
|
+
if (referrer) {
|
|
132
|
+
const matchedPage = matchNestedRoutes(compiledPages, pathname);
|
|
133
|
+
if (matchedPage && !matchedPage.prerender) continue;
|
|
134
|
+
}
|
|
135
|
+
const res = await options.app.request(`${origin}${pathname}`, {
|
|
136
|
+
method: "GET",
|
|
137
|
+
headers: { "X-C7T-Prerender": "1" }
|
|
138
|
+
});
|
|
139
|
+
if (res.status === 404) {
|
|
140
|
+
const msg = `[c7t SSG] Broken route "${pathname}"${referrer ? ` (linked from "${referrer}")` : ""} returned HTTP 404.`;
|
|
141
|
+
if (onBrokenLink === "error") throw new Error(msg);
|
|
142
|
+
if (onBrokenLink === "warn") console.warn(msg);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (res.status >= 300 && res.status < 400) {
|
|
146
|
+
const loc = res.headers.get("location");
|
|
147
|
+
if (loc && loc.startsWith("/") && !loc.startsWith("//") && crawl) pushPath(loc, pathname);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (res.status !== 200) throw new Error(`[c7t SSG] Prerendering "${pathname}" failed with HTTP ${res.status}.`);
|
|
151
|
+
if ((res.headers.get("content-type") ?? "").includes("text/html")) {
|
|
152
|
+
const html = await res.text();
|
|
153
|
+
const htmlFile = pathname === "/" ? join(options.outDir, "index.html") : join(options.outDir, pathname.slice(1), "index.html");
|
|
154
|
+
await mkdir(dirname(htmlFile), { recursive: true });
|
|
155
|
+
await writeFile(htmlFile, html, "utf-8");
|
|
156
|
+
pages.push(pathname);
|
|
157
|
+
const receiptStore = extractEmbeddedReceiptJson(html);
|
|
158
|
+
const sidecarRel = getSidecarPathname(pathname);
|
|
159
|
+
const sidecarFile = join(options.outDir, sidecarRel.slice(1));
|
|
160
|
+
await mkdir(dirname(sidecarFile), { recursive: true });
|
|
161
|
+
await writeFile(sidecarFile, JSON.stringify(receiptStore), "utf-8");
|
|
162
|
+
sidecars.push(sidecarRel);
|
|
163
|
+
if (crawl) for (const discovered of extractInternalLinks(html, origin)) pushPath(discovered, pathname);
|
|
164
|
+
} else {
|
|
165
|
+
const bytes = new Uint8Array(await res.arrayBuffer());
|
|
166
|
+
const targetRel = pathname === "/" ? "index" : pathname.slice(1);
|
|
167
|
+
const assetFile = join(options.outDir, targetRel);
|
|
168
|
+
await mkdir(dirname(assetFile), { recursive: true });
|
|
169
|
+
await writeFile(assetFile, bytes);
|
|
170
|
+
assets.push(pathname);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
pages,
|
|
175
|
+
sidecars,
|
|
176
|
+
assets
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
export { getSidecarPathname, prerenderApp };
|
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { s as CsrMode } from "./router-19ZZ3woS.mjs";
|
|
2
|
+
import { i as PrerenderResult } from "./ssg-DFBgqaob.mjs";
|
|
3
|
+
import { BlokdPluginOptions } from "@fierst/blokd/vite";
|
|
4
|
+
interface BuildAppOptions {
|
|
5
|
+
/** Project root directory (default: `process.cwd()`) */
|
|
6
|
+
root?: string;
|
|
7
|
+
/** Override deployment adapter (`'node'`, `'cloudflare'`, `'vercel'`, `'bun'`, `'static'`, or preset object) */
|
|
8
|
+
adapter?: C7tAdapterOption;
|
|
9
|
+
/** Override static prerender mode (`true` / `'marked'`, `'all'`, or `false`) */
|
|
10
|
+
prerender?: boolean | "marked" | "all";
|
|
11
|
+
/** Vite log level (default: `'info'`) */
|
|
12
|
+
logLevel?: "info" | "warn" | "error" | "silent";
|
|
13
|
+
}
|
|
14
|
+
interface BuildAppResult {
|
|
15
|
+
readonly adapter: "node" | "cloudflare" | "vercel" | "bun" | "static";
|
|
16
|
+
readonly clientDir: string;
|
|
17
|
+
readonly serverDir: string | null;
|
|
18
|
+
readonly entryFile: string | null;
|
|
19
|
+
readonly manifest: Record<string, string>;
|
|
20
|
+
readonly styles: readonly string[];
|
|
21
|
+
readonly prerendered: PrerenderResult | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Execute the full 3-stage `c7t` production build:
|
|
25
|
+
* 1. Client asset + island bundle (`dist/client` + `c7t-manifest.json` + hashed CSS)
|
|
26
|
+
* 2. Self-contained SSR & RPC bundle (`dist/server/entry.mjs` with inline manifest + zero-FOUC `<link>` styles)
|
|
27
|
+
* 3. Hybrid/Static prerendering (`__c7t.json` sidecars) + target adapter output (`node`, `cloudflare`, `vercel`, `bun`, `static`)
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildApp(options?: BuildAppOptions): Promise<BuildAppResult>;
|
|
30
|
+
export interface CompileC7tOptions {
|
|
31
|
+
/** Module path relative to project root (e.g. '/src/routes/projects/[id].tsx') */
|
|
32
|
+
moduleUrl: string;
|
|
33
|
+
/** True when compiling for SSR / Node / Edge server; false when compiling for Browser */
|
|
34
|
+
ssr: boolean;
|
|
35
|
+
/** Hash RPC IDs with SHA-256 instead of readable paths (default: true in production builds) */
|
|
36
|
+
hashIds?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface DiscoveredRpc {
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly isStream: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface CompileC7tResult {
|
|
44
|
+
readonly code: string;
|
|
45
|
+
readonly rpcs: readonly DiscoveredRpc[];
|
|
46
|
+
}
|
|
47
|
+
export declare function computeRpcId(moduleUrl: string, exportName: string, index: number, hashIds?: boolean): string;
|
|
48
|
+
/**
|
|
49
|
+
* Compile a `*.server.ts` module or a `.tsx`/`.ts` module containing colocated `server(...)` calls.
|
|
50
|
+
* Returns `null` if no transformation is required.
|
|
51
|
+
*/
|
|
52
|
+
export declare function compileC7tModule(code: string, options: CompileC7tOptions): CompileC7tResult | null;
|
|
53
|
+
export type C7tAdapterOption = "node" | "cloudflare" | "vercel" | "bun" | "static" | {
|
|
54
|
+
readonly name: "node" | "cloudflare" | "vercel" | "bun" | "static";
|
|
55
|
+
readonly options?: Record<string, any>;
|
|
56
|
+
};
|
|
57
|
+
export interface C7tPluginOptions {
|
|
58
|
+
/** Directory containing file-system routes relative to Vite root (default: 'src/routes') */
|
|
59
|
+
routesDir?: string;
|
|
60
|
+
/** Server Hono entry module relative to Vite root for `vp dev` & `c7t build` (e.g. 'src/server.ts') */
|
|
61
|
+
serverEntry?: string;
|
|
62
|
+
/** Hash RPC IDs in production builds (default: true when `command === 'build'`) */
|
|
63
|
+
hashIds?: boolean;
|
|
64
|
+
/** Target deployment adapter for `c7t build` (default: `'node'`) */
|
|
65
|
+
adapter?: C7tAdapterOption;
|
|
66
|
+
/**
|
|
67
|
+
* Static prerender policy:
|
|
68
|
+
* - `'marked'` (default on server adapters): prerenders routes/layouts exporting `prerender = true | fn`.
|
|
69
|
+
* - `true` or `'all'` (default on `staticAdapter()`): prerenders all static routes unless opted out via `export const prerender = false`.
|
|
70
|
+
* - `false`: disables build-time prerendering.
|
|
71
|
+
*/
|
|
72
|
+
prerender?: boolean | "marked" | "all";
|
|
73
|
+
/**
|
|
74
|
+
* Default client-side JavaScript mode inherited by routes (`'auto'` by default):
|
|
75
|
+
* - `'auto'`: 0 `<script>` tags when 0 islands render; lazy revival + SPA router when 1+ islands render.
|
|
76
|
+
* - `'islands'`: 0 `<script>` tags when 0 islands render; islands-only loader (no SPA router) when 1+ islands render.
|
|
77
|
+
* - `true` | `false`: force SPA router + revival on or force strict 0-JS HTML.
|
|
78
|
+
*/
|
|
79
|
+
csr?: CsrMode;
|
|
80
|
+
/** Forwarded options to `@fierst/blokd/vite` */
|
|
81
|
+
blokd?: BlokdPluginOptions;
|
|
82
|
+
}
|
|
83
|
+
export interface C7tBuildManifestFile {
|
|
84
|
+
manifest: Record<string, string>;
|
|
85
|
+
styles: string[];
|
|
86
|
+
}
|
|
87
|
+
interface ActiveSsrBuildContext {
|
|
88
|
+
manifest: Record<string, string>;
|
|
89
|
+
styles: readonly string[];
|
|
90
|
+
adapterName: "node" | "cloudflare" | "vercel" | "bun" | "static";
|
|
91
|
+
}
|
|
92
|
+
/** @internal Used by `buildApp()` to pass Stage 1 client manifest & adapter target into Stage 2 SSR build. */
|
|
93
|
+
export declare function _setActiveSsrBuildContext(ctx: ActiveSsrBuildContext | null): void;
|
|
94
|
+
export declare function c7t(options?: C7tPluginOptions): any[];
|
|
95
|
+
export { type BuildAppOptions, type BuildAppResult, c7t as default };
|