@teyik0/furin 0.2.0-alpha.4 → 0.3.0-alpha.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/README.md +2 -3
- package/dist/adapter/bun.d.ts +17 -1
- package/dist/adapter/package.d.ts +26 -0
- package/dist/adapter/static.d.ts +1 -1
- package/dist/build/bun-build.d.ts +3 -0
- package/dist/build/client.d.ts +1 -1
- package/dist/build/compile-entry.d.ts +3 -3
- package/dist/build/compile-entry.ts +88 -83
- package/dist/build/entry-template.d.ts +37 -9
- package/dist/build/entry-template.ts +109 -56
- package/dist/build/hydrate.d.ts +2 -2
- package/dist/build/index.js +6817 -4544
- package/dist/build/production-instrumentation.d.ts +1 -0
- package/dist/build/route-types.d.ts +1 -1
- package/dist/build/scan-server.d.ts +10 -4
- package/dist/build/server-routes-entry.d.ts +3 -3
- package/dist/build/server-routes-entry.ts +5 -11
- package/dist/build/ssg-cache.d.ts +1 -1
- package/dist/build/types.d.ts +37 -1
- package/dist/cli/config.d.ts +6 -1
- package/dist/cli/index.js +6854 -4549
- package/dist/client/boundaries.d.ts +4 -4
- package/dist/client/internal/runtime-types.d.ts +30 -0
- package/dist/client/link.d.ts +2 -1
- package/dist/client/link.js +712 -338
- package/dist/client/router/boundary-tree.d.ts +1 -1
- package/dist/client/router/index.d.ts +1 -1
- package/dist/client/router/link-utils.d.ts +5 -1
- package/dist/client/router/sync-catch-up.d.ts +4 -4
- package/dist/client/router/types.d.ts +2 -2
- package/dist/client-only.d.ts +1 -0
- package/dist/client-only.js +1 -0
- package/dist/client.d.ts +108 -111
- package/dist/client.js +16 -17
- package/dist/config.d.ts +11 -2
- package/dist/config.js +7 -3
- package/dist/devtools/devtools-element.d.ts +1 -0
- package/dist/devtools/protocol.d.ts +119 -0
- package/dist/furin.d.ts +40 -21
- package/dist/furin.js +7198 -3518
- package/dist/isomorphic.d.ts +18 -0
- package/dist/plugin/binding-scope.d.ts +2 -0
- package/dist/plugin/dead-code-elimination.d.ts +3 -0
- package/dist/plugin/index.js +933 -423
- package/dist/plugin/transform-client.d.ts +0 -2
- package/dist/plugin/transform-isomorphic.d.ts +9 -0
- package/dist/rsc/build/environment.d.ts +2 -0
- package/dist/rsc/build/index.d.ts +15 -0
- package/dist/rsc/client-codec.d.ts +1 -0
- package/dist/rsc/codec.d.ts +4 -0
- package/dist/rsc/flight-drain.d.ts +11 -0
- package/dist/rsc/render-error.d.ts +17 -0
- package/dist/rsc/server-codec.d.ts +2 -0
- package/dist/rsc/server-codec.js +24 -0
- package/dist/rsc/shared.d.ts +30 -0
- package/dist/rsc/symbols.d.ts +2 -0
- package/dist/rsc/transport-benchmark.d.ts +13 -0
- package/dist/rsc/version.d.ts +7 -0
- package/dist/rsc-client.d.ts +4 -0
- package/dist/rsc-client.js +166 -0
- package/dist/rsc-server.d.ts +11 -0
- package/dist/rsc.d.ts +11 -0
- package/dist/rsc.js +353 -0
- package/dist/server/auto-invalidate/registry.d.ts +8 -1
- package/dist/server/cache/dev-loader.d.ts +3 -2
- package/dist/server/cache/index.d.ts +2 -2
- package/dist/server/cache/invalidation.d.ts +20 -2
- package/dist/server/cache/isr-ssg.d.ts +5 -1
- package/dist/server/cache/isr.d.ts +15 -2
- package/dist/server/cache/registry.d.ts +3 -3
- package/dist/server/cache/route-cache.d.ts +10 -8
- package/dist/server/cache/ssg.d.ts +6 -2
- package/dist/server/cache/store-view.d.ts +11 -0
- package/dist/server/dev-page-plugin.d.ts +4 -0
- package/dist/server/devtools/hub.d.ts +11 -0
- package/dist/server/devtools/instrumentation.d.ts +22 -0
- package/dist/server/devtools/instrumentation.production.d.ts +44 -0
- package/dist/server/devtools/plugin.d.ts +3 -0
- package/dist/server/devtools/request-context.d.ts +6 -0
- package/dist/server/instance.d.ts +86 -0
- package/dist/server/internal.d.ts +18 -1
- package/dist/server/internal.js +74 -7
- package/dist/server/lang-detect.d.ts +1 -0
- package/dist/server/render/assemble.d.ts +4 -0
- package/dist/server/render/element.d.ts +1 -1
- package/dist/server/render/index.d.ts +2 -2
- package/dist/server/render/index.ts +6 -2
- package/dist/server/render/loaders.d.ts +8 -0
- package/dist/server/render/not-found.d.ts +1 -1
- package/dist/server/render/ppr-route.d.ts +8 -0
- package/dist/server/render/route-frame-transport.d.ts +2 -0
- package/dist/server/render/shell.ts +0 -1
- package/dist/server/render/ssr.d.ts +2 -3
- package/dist/server/render/template.d.ts +3 -2
- package/dist/server/router/discovery.d.ts +1 -1
- package/dist/server/router/hmr.d.ts +1 -1
- package/dist/server/router/index.d.ts +2 -1
- package/dist/server/router/index.js +23 -23
- package/dist/server/router/index.ts +1 -1
- package/dist/server/router/patterns.d.ts +1 -1
- package/dist/server/router/plugin.d.ts +4 -7
- package/dist/server/router/schema-merge.d.ts +3 -0
- package/dist/server/router/schemas.d.ts +12 -7
- package/dist/server/router/types.d.ts +1 -1
- package/dist/server/runtime-env.js +2 -2
- package/dist/server/sync/adapter.d.ts +45 -26
- package/dist/server/sync/config.d.ts +9 -2
- package/dist/server/sync/fingerprint.d.ts +2 -1
- package/dist/server/sync/index.d.ts +15 -4
- package/dist/server/sync/index.js +2868 -0
- package/dist/server/sync/notifier.d.ts +18 -0
- package/dist/server/sync/plugin.d.ts +53 -54
- package/dist/server/sync/postgres/index.d.ts +19 -0
- package/dist/server/sync/postgres/index.js +252 -0
- package/dist/server/sync/postgres/migrate.d.ts +2 -0
- package/dist/server/sync/postgres/migrate.js +16 -0
- package/dist/server/sync/postgres/migration.sql +66 -0
- package/dist/server/sync/redis/index.d.ts +30 -0
- package/dist/server/sync/redis/index.js +336 -0
- package/dist/server/sync/redis/scripts.d.ts +4 -0
- package/dist/server/sync/response.d.ts +10 -1
- package/dist/server/sync/runtime.d.ts +6 -0
- package/dist/server/sync/sqlite/index.d.ts +20 -0
- package/dist/server/sync/sqlite/index.js +250 -0
- package/dist/server/sync/stream.d.ts +12 -4
- package/dist/server-only.d.ts +1 -0
- package/dist/server-only.js +1 -0
- package/dist/shared/parser.d.ts +2 -0
- package/dist/shared/prefix.d.ts +15 -0
- package/dist/shared/route-frame.d.ts +49 -0
- package/dist/shared/utils/index.d.ts +1 -1
- package/package.json +59 -12
- package/src/adapter/bun.ts +175 -55
- package/src/adapter/package.ts +208 -0
- package/src/adapter/static.ts +94 -48
- package/src/build/bun-build.ts +11 -0
- package/src/build/client.ts +31 -27
- package/src/build/compile-entry.ts +88 -83
- package/src/build/entry-template.ts +109 -56
- package/src/build/hydrate.ts +37 -10
- package/src/build/index.ts +111 -28
- package/src/build/production-instrumentation.ts +14 -0
- package/src/build/route-types.ts +7 -8
- package/src/build/scan-server.ts +26 -9
- package/src/build/server-routes-entry.ts +5 -11
- package/src/build/ssg-cache.ts +13 -4
- package/src/build/types.ts +38 -1
- package/src/cli/config.ts +9 -3
- package/src/cli/index.ts +73 -24
- package/src/client/boundaries.tsx +42 -18
- package/src/client/default-screens.tsx +4 -4
- package/src/client/internal/runtime-types.ts +31 -0
- package/src/client/link.tsx +35 -37
- package/src/client/router/boundary-tree.tsx +2 -2
- package/src/client/router/context.ts +13 -9
- package/src/client/router/index.ts +3 -0
- package/src/client/router/link-utils.ts +66 -3
- package/src/client/router/navigation.ts +9 -15
- package/src/client/router/provider.tsx +74 -52
- package/src/client/router/search/index.ts +5 -7
- package/src/client/router/search-store.ts +5 -1
- package/src/client/router/spa-response.ts +3 -4
- package/src/client/router/sync-catch-up.ts +9 -8
- package/src/client/router/types.ts +2 -2
- package/src/client/sync.ts +3 -2
- package/src/client-only.ts +1 -0
- package/src/client.ts +221 -174
- package/src/config.ts +14 -1
- package/src/devtools/devtools-element.js +884 -0
- package/src/devtools/protocol.ts +139 -0
- package/src/furin.ts +414 -171
- package/src/isomorphic.ts +66 -0
- package/src/plugin/binding-scope.ts +158 -0
- package/src/plugin/dead-code-elimination.ts +202 -0
- package/src/plugin/index.ts +14 -18
- package/src/plugin/transform-client.ts +237 -273
- package/src/plugin/transform-isomorphic.ts +464 -0
- package/src/rsc/build/environment.ts +30 -0
- package/src/rsc/build/index.ts +94 -0
- package/src/rsc/client-codec.ts +11 -0
- package/src/rsc/codec.ts +85 -0
- package/src/rsc/flight-drain.ts +68 -0
- package/src/rsc/react-server-dom-webpack.d.ts +23 -0
- package/src/rsc/render-error.ts +120 -0
- package/src/rsc/server-codec.ts +25 -0
- package/src/rsc/shared.tsx +113 -0
- package/src/rsc/symbols.ts +2 -0
- package/src/rsc/transport-benchmark.ts +73 -0
- package/src/rsc/version.ts +57 -0
- package/src/rsc-client.ts +12 -0
- package/src/rsc-server.tsx +91 -0
- package/src/rsc.tsx +75 -0
- package/src/server/auto-invalidate/registry.ts +23 -1
- package/src/server/auto-invalidate/runtime.ts +58 -7
- package/src/server/cache/dev-loader.ts +143 -44
- package/src/server/cache/index.ts +7 -3
- package/src/server/cache/invalidation.ts +100 -41
- package/src/server/cache/isr-ssg.ts +12 -3
- package/src/server/cache/isr.ts +95 -5
- package/src/server/cache/registry.ts +17 -20
- package/src/server/cache/route-cache.ts +49 -36
- package/src/server/cache/ssg.ts +19 -4
- package/src/server/cache/store-view.ts +30 -0
- package/src/server/context-logger.ts +7 -7
- package/src/server/dev-page-plugin.ts +8 -6
- package/src/server/devtools/hub.ts +64 -0
- package/src/server/devtools/instrumentation.production.ts +80 -0
- package/src/server/devtools/instrumentation.ts +72 -0
- package/src/server/devtools/plugin.ts +267 -0
- package/src/server/devtools/request-context.ts +76 -0
- package/src/server/instance.ts +252 -0
- package/src/server/internal.ts +102 -5
- package/src/server/lang-detect.ts +14 -10
- package/src/server/render/assemble.ts +73 -10
- package/src/server/render/element.tsx +11 -8
- package/src/server/render/index.ts +6 -2
- package/src/server/render/isr.ts +154 -110
- package/src/server/render/loaders.ts +259 -45
- package/src/server/render/not-found.ts +18 -17
- package/src/server/render/ppr-route.ts +146 -0
- package/src/server/render/route-frame-transport.ts +62 -0
- package/src/server/render/shell.ts +0 -1
- package/src/server/render/ssg.ts +6 -5
- package/src/server/render/ssr.ts +170 -70
- package/src/server/render/template.ts +59 -25
- package/src/server/router/discovery.ts +39 -22
- package/src/server/router/hmr.ts +15 -13
- package/src/server/router/index.ts +1 -1
- package/src/server/router/patterns.ts +16 -15
- package/src/server/router/plugin.ts +151 -158
- package/src/server/router/schema-merge.ts +52 -0
- package/src/server/router/schemas.ts +55 -73
- package/src/server/router/types.ts +1 -1
- package/src/server/sync/adapter.ts +44 -28
- package/src/server/sync/config.ts +22 -9
- package/src/server/sync/fingerprint.ts +8 -3
- package/src/server/sync/index.ts +37 -13
- package/src/server/sync/notifier.ts +109 -0
- package/src/server/sync/plugin.ts +184 -90
- package/src/server/sync/postgres/index.ts +301 -0
- package/src/server/sync/postgres/migrate.ts +15 -0
- package/src/server/sync/postgres/migration.sql +66 -0
- package/src/server/sync/redis/index.ts +342 -0
- package/src/server/sync/redis/scripts.ts +74 -0
- package/src/server/sync/response.ts +141 -16
- package/src/server/sync/runtime.ts +27 -0
- package/src/server/sync/sql.d.ts +4 -0
- package/src/server/sync/sqlite/index.ts +337 -0
- package/src/server/sync/sqlite/migration.sql +70 -0
- package/src/server/sync/stream.ts +136 -70
- package/src/server-only.ts +1 -0
- package/src/shared/await.tsx +4 -4
- package/src/shared/deferred-ndjson.ts +34 -6
- package/src/shared/digest.ts +2 -2
- package/src/shared/parser.ts +5 -0
- package/src/shared/prefix.ts +38 -0
- package/src/shared/route-frame.ts +429 -0
- package/src/shared/search-params.ts +7 -7
- package/src/shared/utils/index.ts +5 -3
- package/dist/server/dev-inspector.d.ts +0 -89
- package/dist/server/sync/memory-adapter.d.ts +0 -17
- package/src/server/dev-inspector.ts +0 -60
- package/src/server/sync/memory-adapter.ts +0 -196
package/README.md
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
<a href="https://www.npmjs.com/package/@teyik0/furin"><img src="https://img.shields.io/npm/v/%40teyik0%2Ffurin?style=flat-square&logo=npm&color=orange" alt="npm version" /></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@teyik0/furin"><img src="https://img.shields.io/npm/dm/%40teyik0%2Ffurin?style=flat-square&color=orange" alt="npm downloads" /></a>
|
|
8
8
|
<a href="https://github.com/teyik0/furin/blob/main/LICENSE"><img src="https://img.shields.io/github/license/teyik0/furin?style=flat-square" alt="License" /></a>
|
|
9
|
-
<a href="https://bun.sh"><img src="https://img.shields.io/badge/bun-%3E%3D1.
|
|
9
|
+
<a href="https://bun.sh"><img src="https://img.shields.io/badge/bun-%3E%3D1.4.0-f5d147?style=flat-square&logo=bun&logoColor=black" alt="Bun" /></a>
|
|
10
10
|
<a href="https://www.typescriptlang.org"><img src="https://img.shields.io/badge/TypeScript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" /></a>
|
|
11
|
-
<a href="https://react.review/repo/Teyik0/furin"><img src="https://react.review/api/badge/Teyik0/furin" alt="React Review" /></a>
|
|
12
11
|
</div>
|
|
13
12
|
|
|
14
13
|
---
|
|
@@ -34,4 +33,4 @@ Full API reference, rendering modes, routing, and deployment guides at **[teyik0
|
|
|
34
33
|
|
|
35
34
|
## Replayable mutations
|
|
36
35
|
|
|
37
|
-
Install `furinSync()` on an Elysia API plugin to make mutations idempotent and replayable by default
|
|
36
|
+
Install `furinSync(sync)` on an Elysia API plugin to make mutations idempotent and replayable by default, and pass the same explicit runtime to `furin({ sync })`. Send an `Idempotency-Key` on every mutation handled by `furinSync()`; routes using `sync: false` or `furinInvalidate()` without `furinSync()` do not require one. Use `sync: false` for payments, uploads, streams, and other non-replayable effects. SQLite `:memory:` is available for development and tests but rejected in production. Use file-backed SQLite for one host, or PostgreSQL/Redis for multi-host replicas. Adapters ship as isolated `@teyik0/furin/sync/*` subpaths.
|
package/dist/adapter/bun.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
import type { BuildAppOptions, TargetBuildManifest } from "../build/types.ts";
|
|
2
2
|
import type { ResolvedRoute, RootLayout } from "../server/router/index.ts";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Deterministic build-ID input covering everything that can change rendered
|
|
5
|
+
* output: client chunks, route shape, route/root/error/not-found source
|
|
6
|
+
* contents and the framework's own render pipeline sources. Shared with the
|
|
7
|
+
* package target so packaged apps get the same stale-deploy detection —
|
|
8
|
+
* SSR-only changes (loader/page code that never reaches the client bundle)
|
|
9
|
+
* must still produce a new build ID.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createBuildFingerprint(entryChunk: string, cssChunks: string[], routes: ResolvedRoute[], root: RootLayout, serverEntry: string | null): Promise<string>;
|
|
12
|
+
/** One mounted app's build input (root + routes scanned from its pagesDir). */
|
|
13
|
+
export interface BunTargetApp {
|
|
14
|
+
pagesDir: string;
|
|
15
|
+
prefix: string;
|
|
16
|
+
root: RootLayout;
|
|
17
|
+
routes: ResolvedRoute[];
|
|
18
|
+
}
|
|
19
|
+
export declare function buildBunTarget(apps: BunTargetApp[], rootDir: string, buildRoot: string, serverEntry: string | null, options: BuildAppOptions): Promise<TargetBuildManifest>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type BunTargetApp } from "../adapter/bun.ts";
|
|
2
|
+
import type { BuildAppOptions, PackageTargetBuildManifest } from "../build/types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* `--target package` — builds a furin app as a PUBLISHABLE Elysia plugin
|
|
5
|
+
* instead of a bootable server. Output (`.furin/build/package/`):
|
|
6
|
+
*
|
|
7
|
+
* - `client/` content-hashed chunks + index.html SSR template
|
|
8
|
+
* - `register.js` side-effect module registering the app's CompileContext;
|
|
9
|
+
* page modules are bundled in, but everything from
|
|
10
|
+
* node_modules (incl. @teyik0/furin itself) stays external so
|
|
11
|
+
* the host and the register module share ONE furin runtime
|
|
12
|
+
* - `index.js` `createFurinApp()` factory the host `.use()`es
|
|
13
|
+
* - `index.d.ts` minimal typings for the factory
|
|
14
|
+
*
|
|
15
|
+
* The host composes it like any Elysia plugin:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { createFurinApp as admin } from "@org/admin/furin";
|
|
19
|
+
* new Elysia().use(await furin({...})).use(await admin()).listen(3000)
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* In a monorepo the baked relative `pagesDir` still points at real sources,
|
|
23
|
+
* so the same factory works under `bun --hot` (dev scans live). A published
|
|
24
|
+
* package without sources is production-only; its context is found by prefix.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildPackageTarget(app: BunTargetApp, rootDir: string, buildRoot: string, options: BuildAppOptions): Promise<PackageTargetBuildManifest>;
|
package/dist/adapter/static.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BuildAppOptions, StaticTargetBuildManifest } from "../build/types.ts";
|
|
2
|
-
import {
|
|
2
|
+
import type { ResolvedRoute, RootLayout } from "../server/router/types.ts";
|
|
3
3
|
export declare function buildStaticTarget(routes: ResolvedRoute[], rootDir: string, buildRoot: string, root: RootLayout, options: BuildAppOptions): Promise<StaticTargetBuildManifest>;
|
package/dist/build/client.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export interface BuildClientResult {
|
|
|
22
22
|
* it as an SSR template, injects the pre-rendered React HTML into
|
|
23
23
|
* <!--ssr-outlet-->, and sends the complete page.
|
|
24
24
|
*/
|
|
25
|
-
export declare function buildClient(routes: ResolvedRoute[], { outDir, rootLayout, plugins, publicPath, basePath, clientLogging }: BuildClientOptions): Promise<BuildClientResult>;
|
|
25
|
+
export declare function buildClient(routes: ResolvedRoute[], { outDir, rootLayout, plugins, publicPath, basePath, clientLogging, clientDirName }: BuildClientOptions): Promise<BuildClientResult>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type BuildEntryOptions } from "./entry-template";
|
|
2
2
|
/**
|
|
3
3
|
* Generates a single `_compile-entry.ts` that:
|
|
4
|
-
* 1. Statically imports every page module so Bun bundles them
|
|
4
|
+
* 1. Statically imports every page module of every app so Bun bundles them
|
|
5
5
|
* 2. Optionally embeds client assets via `with { type: "file" }` (embed mode)
|
|
6
|
-
* 3. Sets production mode and registers
|
|
7
|
-
* 4. Dynamically imports server.ts to boot the app
|
|
6
|
+
* 3. Sets production mode and registers one CompileContext PER APP
|
|
7
|
+
* 4. Dynamically imports server.ts to boot the composed app
|
|
8
8
|
*/
|
|
9
9
|
export declare function generateCompileEntry(options: BuildEntryOptions): string;
|
|
@@ -1,106 +1,111 @@
|
|
|
1
1
|
import { existsSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join, relative } from "node:path";
|
|
3
|
-
import { buildEntrySource, type BuildEntryOptions } from "./entry-template";
|
|
3
|
+
import { buildEntrySource, type BuildEntryOptions, type EntryAppContext } from "./entry-template";
|
|
4
4
|
import { collectFilesRecursive, ensureDir, toPosixPath } from "./shared";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* 3. Sets production mode and registers everything in a single CompileContext
|
|
11
|
-
* 4. Dynamically imports server.ts to boot the app
|
|
7
|
+
* Builds one app's embedded-asset import lines + `embedded:` context block.
|
|
8
|
+
* Asset keys stay UNPREFIXED (`/_client/...`) — the instance's Elysia prefix
|
|
9
|
+
* strips the mount path before lookup at runtime.
|
|
12
10
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = options;
|
|
26
|
-
ensureDir(outDir);
|
|
27
|
-
|
|
28
|
-
// Build embedded asset imports if embed mode
|
|
11
|
+
function buildEmbeddedAssets(
|
|
12
|
+
outDir: string,
|
|
13
|
+
clientDir: string,
|
|
14
|
+
publicDir: string | undefined,
|
|
15
|
+
varPrefix: string
|
|
16
|
+
): { extraContext: string[]; extraImports: string[] } {
|
|
17
|
+
if (!existsSync(clientDir)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`[furin] Client directory not found: ${clientDir}. Run the client build first.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const clientFiles = collectFilesRecursive(clientDir).filter((file) => !file.endsWith(".map"));
|
|
29
23
|
const assetImports: string[] = [];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
24
|
+
const assetEntries: string[] = [];
|
|
25
|
+
let templateVarName: string | null = null;
|
|
26
|
+
|
|
27
|
+
let assetIndex = 0;
|
|
28
|
+
const importAsset = (file: string): string => {
|
|
29
|
+
const varName = `${varPrefix}asset${assetIndex++}`;
|
|
30
|
+
const relPath = toPosixPath(relative(outDir, file));
|
|
31
|
+
const importPath = relPath.startsWith(".") ? relPath : `./${relPath}`;
|
|
32
|
+
assetImports.push(
|
|
33
|
+
`import ${varName} from ${JSON.stringify(importPath)} with { type: "file" };`
|
|
39
34
|
);
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
return varName;
|
|
36
|
+
};
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
for (const file of clientFiles) {
|
|
39
|
+
const varName = importAsset(file);
|
|
40
|
+
const clientRelativePath = toPosixPath(relative(clientDir, file));
|
|
41
|
+
if (clientRelativePath === "index.html") {
|
|
42
|
+
templateVarName = varName;
|
|
43
|
+
} else {
|
|
44
|
+
assetEntries.push(` ${JSON.stringify(`/_client/${clientRelativePath}`)}: ${varName},`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)
|
|
48
|
+
if (templateVarName === null) {
|
|
49
|
+
throw new Error(
|
|
50
|
+
`[furin] Embed mode requires a client index.html at ${join(clientDir, "index.html")}. Run the client build first.`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
54
|
+
if (publicDir && existsSync(publicDir)) {
|
|
55
|
+
const publicFiles = collectFilesRecursive(publicDir);
|
|
56
|
+
for (const file of publicFiles) {
|
|
57
|
+
const varName = importAsset(file);
|
|
58
|
+
const publicRelativePath = toPosixPath(relative(publicDir, file));
|
|
59
|
+
assetEntries.push(` ${JSON.stringify(`/public/${publicRelativePath}`)}: ${varName},`);
|
|
59
60
|
}
|
|
61
|
+
}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
const extraContext = [
|
|
64
|
+
" embedded: {",
|
|
65
|
+
` template: ${templateVarName},`,
|
|
66
|
+
" assets: {",
|
|
67
|
+
...assetEntries,
|
|
68
|
+
" },",
|
|
69
|
+
" },",
|
|
70
|
+
];
|
|
66
71
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
for (const file of publicFiles) {
|
|
70
|
-
const varName = `_asset${assetIndex++}`;
|
|
71
|
-
const relPath = toPosixPath(relative(outDir, file));
|
|
72
|
-
const importPath = relPath.startsWith(".") ? relPath : `./${relPath}`;
|
|
72
|
+
return { extraContext, extraImports: assetImports };
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Generates a single `_compile-entry.ts` that:
|
|
77
|
+
* 1. Statically imports every page module of every app so Bun bundles them
|
|
78
|
+
* 2. Optionally embeds client assets via `with { type: "file" }` (embed mode)
|
|
79
|
+
* 3. Sets production mode and registers one CompileContext PER APP
|
|
80
|
+
* 4. Dynamically imports server.ts to boot the composed app
|
|
81
|
+
*/
|
|
82
|
+
export function generateCompileEntry(options: BuildEntryOptions): string {
|
|
83
|
+
const { apps, outDir, serverEntry, publicDir } = options;
|
|
84
|
+
ensureDir(outDir);
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
const preparedApps: EntryAppContext[] = apps.map((app, appIndex) => {
|
|
87
|
+
const { embed, ...context } = app;
|
|
88
|
+
if (!embed) {
|
|
89
|
+
return context;
|
|
81
90
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
const varPrefix = apps.length === 1 ? "_" : `_a${appIndex}_`;
|
|
92
|
+
// Every app gets the project-level public/ dir: each instance serves only
|
|
93
|
+
// from its own `embedded.assets`, so `/public/*` (and `/favicon.ico`) would
|
|
94
|
+
// 404 on non-first apps otherwise. This only duplicates the string keys —
|
|
95
|
+
// each app imports the same file via the same relative path, and Bun
|
|
96
|
+
// dedupes identical `with { type: "file" }` modules into one embedded blob.
|
|
97
|
+
const embedded = buildEmbeddedAssets(outDir, embed.clientDir, publicDir, varPrefix);
|
|
98
|
+
return {
|
|
99
|
+
...context,
|
|
100
|
+
extraContext: [...(context.extraContext ?? []), ...embedded.extraContext],
|
|
101
|
+
extraImports: [...(context.extraImports ?? []), ...embedded.extraImports],
|
|
102
|
+
};
|
|
103
|
+
});
|
|
92
104
|
|
|
93
105
|
const source = buildEntrySource({
|
|
94
|
-
|
|
95
|
-
headerComment: "// Auto-generated by furin compile — do not edit",
|
|
96
|
-
rootPath,
|
|
97
|
-
routes,
|
|
106
|
+
apps: preparedApps,
|
|
107
|
+
headerComment: options.headerComment ?? "// Auto-generated by furin compile — do not edit",
|
|
98
108
|
serverEntry,
|
|
99
|
-
extraImports: assetImports,
|
|
100
|
-
extraContext: embeddedBlock,
|
|
101
|
-
rootConventions,
|
|
102
|
-
routeMetadata,
|
|
103
|
-
ssgCache,
|
|
104
109
|
});
|
|
105
110
|
|
|
106
111
|
const entryPath = join(outDir, "_compile-entry.ts");
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { SsgCacheEntry } from "../server/cache/index.ts";
|
|
2
|
-
|
|
2
|
+
/** One app's compile context payload — the generated entry can carry several. */
|
|
3
|
+
export interface EntryAppContext {
|
|
3
4
|
buildId?: string;
|
|
5
|
+
/** Whether the emitted hydration client sends browser log batches. */
|
|
6
|
+
clientLogging?: boolean;
|
|
7
|
+
/** Extra lines injected inside this app's `__setCompileContext({...})` call. */
|
|
4
8
|
extraContext?: string[];
|
|
9
|
+
/** Extra import lines this app needs (embedded asset imports). */
|
|
5
10
|
extraImports?: string[];
|
|
6
|
-
|
|
11
|
+
/** Mount prefix baked into the context for runtime lookup (`""` = root). */
|
|
12
|
+
prefix?: string;
|
|
7
13
|
rootConventions?: {
|
|
8
14
|
errorPath?: string;
|
|
9
15
|
notFoundPath?: string;
|
|
@@ -22,17 +28,39 @@ export interface EntryTemplateOptions {
|
|
|
22
28
|
path: string;
|
|
23
29
|
pattern: string;
|
|
24
30
|
}>;
|
|
25
|
-
serverEntry: string;
|
|
26
31
|
ssgCache?: Record<string, SsgCacheEntry>;
|
|
27
32
|
}
|
|
33
|
+
export interface EntryTemplateOptions {
|
|
34
|
+
apps: EntryAppContext[];
|
|
35
|
+
headerComment: string;
|
|
36
|
+
/**
|
|
37
|
+
* - "boot" (default): forces production mode and dynamically imports the
|
|
38
|
+
* server entry after registering contexts — the whole app's entrypoint.
|
|
39
|
+
* - "register": ONLY registers contexts. Emitted by `--target package` as a
|
|
40
|
+
* side-effect module the HOST app imports; it must not touch dev mode or
|
|
41
|
+
* NODE_ENV (the host decides), and it imports furin internals via the
|
|
42
|
+
* package specifier so the host and the register module share ONE copy of
|
|
43
|
+
* the context registry (`packages: "external"` keeps it unbundled).
|
|
44
|
+
*/
|
|
45
|
+
mode?: "boot" | "register";
|
|
46
|
+
/**
|
|
47
|
+
* Server entry to boot after context registration. Omitted in package
|
|
48
|
+
* (register-module) mode where the entry only registers contexts.
|
|
49
|
+
*/
|
|
50
|
+
serverEntry?: string;
|
|
51
|
+
}
|
|
28
52
|
/** Unified options for generating a build entry (compile or disk-based). */
|
|
29
|
-
export interface BuildEntryOptions
|
|
30
|
-
|
|
53
|
+
export interface BuildEntryOptions {
|
|
54
|
+
apps: Array<EntryAppContext & {
|
|
55
|
+
/** Embed mode: bundles this app's client assets via `with { type: "file" }`. */
|
|
56
|
+
embed?: {
|
|
57
|
+
clientDir: string;
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
31
60
|
headerComment?: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
clientDir: string;
|
|
35
|
-
};
|
|
61
|
+
outDir: string;
|
|
62
|
+
/** Project-level public/ dir — embedded into EVERY app's assets (keys only; Bun dedupes the file payloads). */
|
|
36
63
|
publicDir?: string;
|
|
64
|
+
serverEntry?: string;
|
|
37
65
|
}
|
|
38
66
|
export declare function buildEntrySource(options: EntryTemplateOptions): string;
|
|
@@ -17,11 +17,17 @@ const _ext = _pkgSrcDir.endsWith("/src") ? ".ts" : ".js";
|
|
|
17
17
|
const INTERNAL_MODULE_PATH = `${_pkgSrcDir}/server/internal${_ext}`;
|
|
18
18
|
const RUNTIME_ENV_MODULE_PATH = `${_pkgSrcDir}/server/runtime-env${_ext}`;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
/** One app's compile context payload — the generated entry can carry several. */
|
|
21
|
+
export interface EntryAppContext {
|
|
21
22
|
buildId?: string;
|
|
23
|
+
/** Whether the emitted hydration client sends browser log batches. */
|
|
24
|
+
clientLogging?: boolean;
|
|
25
|
+
/** Extra lines injected inside this app's `__setCompileContext({...})` call. */
|
|
22
26
|
extraContext?: string[];
|
|
27
|
+
/** Extra import lines this app needs (embedded asset imports). */
|
|
23
28
|
extraImports?: string[];
|
|
24
|
-
|
|
29
|
+
/** Mount prefix baked into the context for runtime lookup (`""` = root). */
|
|
30
|
+
prefix?: string;
|
|
25
31
|
rootConventions?: { errorPath?: string; notFoundPath?: string };
|
|
26
32
|
rootPath: string;
|
|
27
33
|
routeMetadata?: Record<
|
|
@@ -36,22 +42,47 @@ export interface EntryTemplateOptions {
|
|
|
36
42
|
}
|
|
37
43
|
>;
|
|
38
44
|
routes: Array<{ mode: "ssr" | "ssg" | "isr"; path: string; pattern: string }>;
|
|
39
|
-
serverEntry: string;
|
|
40
45
|
ssgCache?: Record<string, SsgCacheEntry>;
|
|
41
46
|
}
|
|
42
47
|
|
|
48
|
+
export interface EntryTemplateOptions {
|
|
49
|
+
apps: EntryAppContext[];
|
|
50
|
+
headerComment: string;
|
|
51
|
+
/**
|
|
52
|
+
* - "boot" (default): forces production mode and dynamically imports the
|
|
53
|
+
* server entry after registering contexts — the whole app's entrypoint.
|
|
54
|
+
* - "register": ONLY registers contexts. Emitted by `--target package` as a
|
|
55
|
+
* side-effect module the HOST app imports; it must not touch dev mode or
|
|
56
|
+
* NODE_ENV (the host decides), and it imports furin internals via the
|
|
57
|
+
* package specifier so the host and the register module share ONE copy of
|
|
58
|
+
* the context registry (`packages: "external"` keeps it unbundled).
|
|
59
|
+
*/
|
|
60
|
+
mode?: "boot" | "register";
|
|
61
|
+
/**
|
|
62
|
+
* Server entry to boot after context registration. Omitted in package
|
|
63
|
+
* (register-module) mode where the entry only registers contexts.
|
|
64
|
+
*/
|
|
65
|
+
serverEntry?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
43
68
|
/** Unified options for generating a build entry (compile or disk-based). */
|
|
44
|
-
export interface BuildEntryOptions
|
|
45
|
-
|
|
69
|
+
export interface BuildEntryOptions {
|
|
70
|
+
apps: Array<
|
|
71
|
+
EntryAppContext & {
|
|
72
|
+
/** Embed mode: bundles this app's client assets via `with { type: "file" }`. */
|
|
73
|
+
embed?: { clientDir: string };
|
|
74
|
+
}
|
|
75
|
+
>;
|
|
46
76
|
headerComment?: string;
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
outDir: string;
|
|
78
|
+
/** Project-level public/ dir — embedded into EVERY app's assets (keys only; Bun dedupes the file payloads). */
|
|
49
79
|
publicDir?: string;
|
|
80
|
+
serverEntry?: string;
|
|
50
81
|
}
|
|
51
82
|
|
|
52
83
|
function collectConventionPaths(
|
|
53
|
-
rootConventions:
|
|
54
|
-
routeMetadata:
|
|
84
|
+
rootConventions: EntryAppContext["rootConventions"],
|
|
85
|
+
routeMetadata: EntryAppContext["routeMetadata"]
|
|
55
86
|
): string[] {
|
|
56
87
|
const paths: string[] = [];
|
|
57
88
|
if (rootConventions?.errorPath) {
|
|
@@ -75,67 +106,45 @@ function collectConventionPaths(
|
|
|
75
106
|
return [...new Set(paths)];
|
|
76
107
|
}
|
|
77
108
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
routes,
|
|
84
|
-
serverEntry,
|
|
85
|
-
rootConventions,
|
|
86
|
-
routeMetadata,
|
|
87
|
-
ssgCache,
|
|
88
|
-
} = options;
|
|
89
|
-
let { extraImports, extraContext } = options;
|
|
90
|
-
if (extraImports === undefined) {
|
|
91
|
-
extraImports = [];
|
|
92
|
-
}
|
|
93
|
-
if (extraContext === undefined) {
|
|
94
|
-
extraContext = [];
|
|
95
|
-
}
|
|
96
|
-
|
|
109
|
+
/** Emits one app's module imports + `__setCompileContext({...})` call. */
|
|
110
|
+
function buildAppContextBlock(
|
|
111
|
+
app: EntryAppContext,
|
|
112
|
+
varPrefix: string
|
|
113
|
+
): { contextLines: string[]; importLines: string[] } {
|
|
97
114
|
const allModulePaths = [
|
|
98
|
-
rootPath,
|
|
99
|
-
...routes.map((r) => r.path),
|
|
100
|
-
...collectConventionPaths(rootConventions, routeMetadata),
|
|
115
|
+
app.rootPath,
|
|
116
|
+
...app.routes.map((r) => r.path),
|
|
117
|
+
...collectConventionPaths(app.rootConventions, app.routeMetadata),
|
|
101
118
|
];
|
|
102
|
-
const
|
|
119
|
+
const importLines: string[] = [];
|
|
103
120
|
const moduleEntries: string[] = [];
|
|
104
121
|
|
|
105
122
|
for (let i = 0; i < allModulePaths.length; i++) {
|
|
106
123
|
const absPath = (allModulePaths[i] as string).replace(/\\/g, "/");
|
|
107
|
-
const varName =
|
|
108
|
-
|
|
124
|
+
const varName = `${varPrefix}mod${i}`;
|
|
125
|
+
importLines.push(`import * as ${varName} from ${JSON.stringify(absPath)};`);
|
|
109
126
|
moduleEntries.push(` ${JSON.stringify(absPath)}: ${varName},`);
|
|
110
127
|
}
|
|
111
128
|
|
|
112
|
-
const routeEntries = routes.map(
|
|
129
|
+
const routeEntries = app.routes.map(
|
|
113
130
|
(r) =>
|
|
114
131
|
` { pattern: ${JSON.stringify(r.pattern)}, path: ${JSON.stringify(r.path.replace(/\\/g, "/"))}, mode: ${JSON.stringify(r.mode)} },`
|
|
115
132
|
);
|
|
116
133
|
|
|
117
|
-
const rootConventionsLine = rootConventions
|
|
118
|
-
? ` rootConventions: ${JSON.stringify(rootConventions)},`
|
|
134
|
+
const rootConventionsLine = app.rootConventions
|
|
135
|
+
? ` rootConventions: ${JSON.stringify(app.rootConventions)},`
|
|
119
136
|
: "";
|
|
120
|
-
const routeMetadataLine = routeMetadata
|
|
121
|
-
? ` routeMetadata: ${JSON.stringify(routeMetadata)},`
|
|
137
|
+
const routeMetadataLine = app.routeMetadata
|
|
138
|
+
? ` routeMetadata: ${JSON.stringify(app.routeMetadata)},`
|
|
122
139
|
: "";
|
|
123
|
-
const ssgCacheLine = ssgCache ? ` ssgCache: ${JSON.stringify(ssgCache)},` : "";
|
|
140
|
+
const ssgCacheLine = app.ssgCache ? ` ssgCache: ${JSON.stringify(app.ssgCache)},` : "";
|
|
124
141
|
|
|
125
|
-
const
|
|
126
|
-
headerComment,
|
|
127
|
-
`import { __setCompileContext } from ${JSON.stringify(INTERNAL_MODULE_PATH)};`,
|
|
128
|
-
`import { __setDevMode } from ${JSON.stringify(RUNTIME_ENV_MODULE_PATH)};`,
|
|
129
|
-
...moduleImports,
|
|
130
|
-
...(extraImports.length > 0 ? ["", ...extraImports] : []),
|
|
131
|
-
"",
|
|
132
|
-
"// Force production mode — Bun may inline process.env.NODE_ENV at bundle time.",
|
|
133
|
-
"__setDevMode(false);",
|
|
134
|
-
'process.env.NODE_ENV = "production";',
|
|
135
|
-
"",
|
|
142
|
+
const contextLines = [
|
|
136
143
|
"__setCompileContext({",
|
|
137
|
-
` buildId: ${JSON.stringify(buildId ?? "")},`,
|
|
138
|
-
`
|
|
144
|
+
` buildId: ${JSON.stringify(app.buildId ?? "")},`,
|
|
145
|
+
` clientLogging: ${JSON.stringify(app.clientLogging ?? false)},`,
|
|
146
|
+
` prefix: ${JSON.stringify(app.prefix ?? "")},`,
|
|
147
|
+
` rootPath: ${JSON.stringify(app.rootPath.replace(/\\/g, "/"))},`,
|
|
139
148
|
rootConventionsLine,
|
|
140
149
|
" modules: {",
|
|
141
150
|
...moduleEntries,
|
|
@@ -145,11 +154,55 @@ export function buildEntrySource(options: EntryTemplateOptions): string {
|
|
|
145
154
|
" ],",
|
|
146
155
|
routeMetadataLine,
|
|
147
156
|
ssgCacheLine,
|
|
148
|
-
...extraContext,
|
|
157
|
+
...(app.extraContext ?? []),
|
|
149
158
|
"});",
|
|
159
|
+
];
|
|
160
|
+
|
|
161
|
+
return { contextLines, importLines };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function buildEntrySource(options: EntryTemplateOptions): string {
|
|
165
|
+
const { apps, headerComment, serverEntry } = options;
|
|
166
|
+
const mode = options.mode ?? "boot";
|
|
167
|
+
const internalSpecifier =
|
|
168
|
+
mode === "register" ? "@teyik0/furin/internal" : INTERNAL_MODULE_PATH;
|
|
169
|
+
|
|
170
|
+
const importLines: string[] = [];
|
|
171
|
+
const contextBlocks: string[] = [];
|
|
172
|
+
|
|
173
|
+
for (let appIndex = 0; appIndex < apps.length; appIndex++) {
|
|
174
|
+
const app = apps[appIndex] as EntryAppContext;
|
|
175
|
+
// Per-app variable namespace so several apps' module/asset imports never
|
|
176
|
+
// collide inside the single generated entry.
|
|
177
|
+
const varPrefix = apps.length === 1 ? "_" : `_a${appIndex}_`;
|
|
178
|
+
const block = buildAppContextBlock(app, varPrefix);
|
|
179
|
+
importLines.push(...block.importLines);
|
|
180
|
+
if (app.extraImports && app.extraImports.length > 0) {
|
|
181
|
+
importLines.push("", ...app.extraImports);
|
|
182
|
+
}
|
|
183
|
+
contextBlocks.push("", ...block.contextLines);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const lines = [
|
|
187
|
+
headerComment,
|
|
188
|
+
`import { __setCompileContext } from ${JSON.stringify(internalSpecifier)};`,
|
|
189
|
+
...(mode === "boot"
|
|
190
|
+
? [`import { __setDevMode } from ${JSON.stringify(RUNTIME_ENV_MODULE_PATH)};`]
|
|
191
|
+
: []),
|
|
192
|
+
...importLines,
|
|
193
|
+
...(mode === "boot"
|
|
194
|
+
? [
|
|
195
|
+
"",
|
|
196
|
+
"// Force production mode — Bun may inline process.env.NODE_ENV at bundle time.",
|
|
197
|
+
"__setDevMode(false);",
|
|
198
|
+
'process.env.NODE_ENV = "production";',
|
|
199
|
+
]
|
|
200
|
+
: []),
|
|
201
|
+
...contextBlocks,
|
|
150
202
|
"",
|
|
151
|
-
|
|
152
|
-
|
|
203
|
+
...(serverEntry
|
|
204
|
+
? [`await import(${JSON.stringify(serverEntry.replace(/\\/g, "/"))});`, ""]
|
|
205
|
+
: []),
|
|
153
206
|
];
|
|
154
207
|
|
|
155
208
|
return lines.join("\n");
|
package/dist/build/hydrate.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResolvedRoute } from "../server/router/
|
|
1
|
+
import type { ResolvedRoute } from "../server/router/types.ts";
|
|
2
2
|
import type { BuildClientOptions } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Generates the client hydration entry.
|
|
@@ -21,4 +21,4 @@ export declare function generateHydrateEntry(routes: ResolvedRoute[], rootLayout
|
|
|
21
21
|
* Only rewrites a file when its content has actually changed so Bun's --hot
|
|
22
22
|
* watcher does not trigger a spurious reload on every server restart.
|
|
23
23
|
*/
|
|
24
|
-
export declare function writeDevFiles(routes: ResolvedRoute[], { outDir, rootLayout, basePath, clientLogging }: BuildClientOptions, projectRoot: string): void;
|
|
24
|
+
export declare function writeDevFiles(routes: ResolvedRoute[], { outDir, rootLayout, basePath, clientLogging, skipRouteTypes }: BuildClientOptions, projectRoot: string): void;
|