@teyik0/furin 0.1.0-alpha.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/adapter/bun.d.ts +3 -0
- package/dist/build/client.d.ts +14 -0
- package/dist/build/compile-entry.d.ts +22 -0
- package/dist/build/entry-template.d.ts +13 -0
- package/dist/build/hydrate.d.ts +20 -0
- package/dist/build/index.d.ts +7 -0
- package/dist/build/index.js +2212 -0
- package/dist/build/route-types.d.ts +20 -0
- package/dist/build/scan-server.d.ts +8 -0
- package/dist/build/server-routes-entry.d.ts +22 -0
- package/dist/build/shared.d.ts +12 -0
- package/dist/build/types.d.ts +53 -0
- package/dist/cli/config.d.ts +9 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +2240 -0
- package/dist/client.d.ts +158 -0
- package/dist/client.js +20 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.js +23 -0
- package/dist/furin.d.ts +45 -0
- package/dist/furin.js +937 -0
- package/dist/internal.d.ts +18 -0
- package/dist/link.d.ts +119 -0
- package/dist/link.js +281 -0
- package/dist/plugin/index.d.ts +20 -0
- package/dist/plugin/index.js +1408 -0
- package/dist/plugin/transform-client.d.ts +9 -0
- package/dist/render/assemble.d.ts +13 -0
- package/dist/render/cache.d.ts +7 -0
- package/dist/render/element.d.ts +4 -0
- package/dist/render/index.d.ts +26 -0
- package/dist/render/loaders.d.ts +12 -0
- package/dist/render/shell.d.ts +17 -0
- package/dist/render/template.d.ts +4 -0
- package/dist/router.d.ts +32 -0
- package/dist/router.js +575 -0
- package/dist/runtime-env.d.ts +3 -0
- package/dist/tsconfig.dts.tsbuildinfo +1 -0
- package/dist/utils.d.ts +6 -0
- package/package.json +74 -0
- package/src/adapter/README.md +13 -0
- package/src/adapter/bun.ts +119 -0
- package/src/build/client.ts +110 -0
- package/src/build/compile-entry.ts +99 -0
- package/src/build/entry-template.ts +62 -0
- package/src/build/hydrate.ts +106 -0
- package/src/build/index.ts +120 -0
- package/src/build/route-types.ts +88 -0
- package/src/build/scan-server.ts +88 -0
- package/src/build/server-routes-entry.ts +38 -0
- package/src/build/shared.ts +80 -0
- package/src/build/types.ts +60 -0
- package/src/cli/config.ts +68 -0
- package/src/cli/index.ts +106 -0
- package/src/client.ts +237 -0
- package/src/config.ts +31 -0
- package/src/furin.ts +251 -0
- package/src/internal.ts +36 -0
- package/src/link.tsx +480 -0
- package/src/plugin/index.ts +80 -0
- package/src/plugin/transform-client.ts +372 -0
- package/src/render/assemble.ts +57 -0
- package/src/render/cache.ts +9 -0
- package/src/render/element.tsx +28 -0
- package/src/render/index.ts +312 -0
- package/src/render/loaders.ts +67 -0
- package/src/render/shell.ts +128 -0
- package/src/render/template.ts +54 -0
- package/src/router.ts +234 -0
- package/src/runtime-env.ts +6 -0
- package/src/utils.ts +68 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BuildAppOptions, TargetBuildManifest } from "../build/types.ts";
|
|
2
|
+
import type { ResolvedRoute } from "../router.ts";
|
|
3
|
+
export declare function buildBunTarget(routes: ResolvedRoute[], rootDir: string, buildRoot: string, rootPath: string, serverEntry: string | null, options: BuildAppOptions): Promise<TargetBuildManifest>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedRoute } from "../router";
|
|
2
|
+
import type { BuildClientOptions } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the production client bundle via Bun.build() using the generated
|
|
5
|
+
* index.html as the HTML entrypoint. Bun produces:
|
|
6
|
+
* <outDir>/client/index.html — processed template with hashed chunk paths
|
|
7
|
+
* <outDir>/client/chunk-*.js — code-split bundles
|
|
8
|
+
* <outDir>/client/styles.css — CSS (if imported)
|
|
9
|
+
*
|
|
10
|
+
* The output index.html is NOT served to browsers directly. The server reads
|
|
11
|
+
* it as an SSR template, injects the pre-rendered React HTML into
|
|
12
|
+
* <!--ssr-outlet-->, and sends the complete page.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildClient(routes: ResolvedRoute[], { outDir, rootLayout, plugins }: BuildClientOptions): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface CompileEntryOptions {
|
|
2
|
+
outDir: string;
|
|
3
|
+
rootPath: string;
|
|
4
|
+
routes: Array<{
|
|
5
|
+
mode: "ssr" | "ssg" | "isr";
|
|
6
|
+
path: string;
|
|
7
|
+
pattern: string;
|
|
8
|
+
}>;
|
|
9
|
+
serverEntry: string;
|
|
10
|
+
embed?: {
|
|
11
|
+
clientDir: string;
|
|
12
|
+
};
|
|
13
|
+
publicDir?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generates a single `_compile-entry.ts` that:
|
|
17
|
+
* 1. Statically imports every page module so Bun bundles them into the binary
|
|
18
|
+
* 2. Optionally embeds client assets via `with { type: "file" }` (embed mode)
|
|
19
|
+
* 3. Sets production mode and registers everything in a single CompileContext
|
|
20
|
+
* 4. Dynamically imports server.ts to boot the app
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateCompileEntry(options: CompileEntryOptions): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface EntryTemplateOptions {
|
|
2
|
+
headerComment: string;
|
|
3
|
+
rootPath: string;
|
|
4
|
+
routes: Array<{
|
|
5
|
+
mode: "ssr" | "ssg" | "isr";
|
|
6
|
+
path: string;
|
|
7
|
+
pattern: string;
|
|
8
|
+
}>;
|
|
9
|
+
serverEntry: string;
|
|
10
|
+
extraImports?: string[];
|
|
11
|
+
extraContext?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function buildEntrySource(options: EntryTemplateOptions): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ResolvedRoute } from "../router";
|
|
2
|
+
import type { BuildClientOptions } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Generates the client hydration entry.
|
|
5
|
+
*
|
|
6
|
+
* Renders into <div id="root"> (the SSR outlet element) and retains the React
|
|
7
|
+
* root across hot reloads via import.meta.hot.data.root so React Fast Refresh
|
|
8
|
+
* applies in-place instead of remounting.
|
|
9
|
+
*
|
|
10
|
+
* @param routes - Resolved routes to include in the hydration manifest.
|
|
11
|
+
* @param rootLayout - Absolute path to the root layout module.
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateHydrateEntry(routes: ResolvedRoute[], rootLayout: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Writes _hydrate.tsx + index.html to outDir for dev (Bun HMR) mode.
|
|
16
|
+
*
|
|
17
|
+
* Only rewrites a file when its content has actually changed so Bun's --hot
|
|
18
|
+
* watcher does not trigger a spurious reload on every server restart.
|
|
19
|
+
*/
|
|
20
|
+
export declare function writeDevFiles(routes: ResolvedRoute[], { outDir, rootLayout }: BuildClientOptions): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BuildAppOptions, BuildAppResult } from "./types";
|
|
2
|
+
export type { BuildAppOptions, BuildAppResult, BuildClientOptions, BuildManifest, BuildRouteManifestEntry, TargetBuildManifest, } from "./types";
|
|
3
|
+
export { buildClient } from "./client";
|
|
4
|
+
export { writeDevFiles } from "./hydrate";
|
|
5
|
+
export { patternToTypeString, schemaToTypeString, writeRouteTypes } from "./route-types";
|
|
6
|
+
export declare const BUILD_OUTPUT_DIR = ".furin/build";
|
|
7
|
+
export declare function buildApp(options: BuildAppOptions): Promise<BuildAppResult>;
|