@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,20 @@
|
|
|
1
|
+
import type { ResolvedRoute } from "../router";
|
|
2
|
+
/** @internal Exported for unit testing only. */
|
|
3
|
+
export declare function patternToTypeString(pattern: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Converts a runtime TypeBox/JSON Schema object to a TypeScript type string.
|
|
6
|
+
* Handles the common cases found in Elysia query schemas (string, number, boolean,
|
|
7
|
+
* optional fields, nullable via anyOf).
|
|
8
|
+
*
|
|
9
|
+
* @internal Exported for unit testing only.
|
|
10
|
+
*/
|
|
11
|
+
export declare function schemaToTypeString(schema: unknown): string;
|
|
12
|
+
/**
|
|
13
|
+
* Generates .furin/routes.d.ts — augments RouteManifest in furin/link
|
|
14
|
+
* so that <Link to="..."> has type-safe autocompletion and <Link search={...}>
|
|
15
|
+
* is typed per-route from the route's query schema.
|
|
16
|
+
*
|
|
17
|
+
* Users must add ".furin/routes.d.ts" to their tsconfig.json "include" array once.
|
|
18
|
+
*/
|
|
19
|
+
/** @internal Exported for unit testing only. */
|
|
20
|
+
export declare function writeRouteTypes(routes: ResolvedRoute[], outDir: string): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statically scans a server entry file and returns all `pagesDir` string
|
|
3
|
+
* literal values found inside `furin({ pagesDir: "..." })` call expressions.
|
|
4
|
+
*
|
|
5
|
+
* Dynamic paths (template literals, variables) are silently ignored.
|
|
6
|
+
* Returns an empty array when nothing is detected.
|
|
7
|
+
*/
|
|
8
|
+
export declare function scanFurinInstances(serverEntryPath: string): string[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ServerRoutesEntryOptions {
|
|
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
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates `server.ts` — an intermediate entry used to produce `server.js`.
|
|
13
|
+
*
|
|
14
|
+
* Equivalent to `_compile-entry.ts` but for disk (non-binary) production builds:
|
|
15
|
+
* 1. Statically imports every page module so Bun bundles them into server.js
|
|
16
|
+
* 2. Sets production mode and registers everything in a single CompileContext
|
|
17
|
+
* 3. Imports server.ts to boot the app
|
|
18
|
+
*
|
|
19
|
+
* This file is intermediate: `adapter/bun.ts` runs `Bun.build()` on it to produce
|
|
20
|
+
* the self-contained `server.js` bundle, then deletes this file.
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateServerRoutesEntry(options: ServerRoutesEntryOptions): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BuildTarget } from "../config";
|
|
2
|
+
import type { ResolvedRoute } from "../router";
|
|
3
|
+
import type { BuildRouteManifestEntry, TargetBuildManifest } from "./types";
|
|
4
|
+
export declare const CLIENT_MODULE_PATH: string;
|
|
5
|
+
export declare const LINK_MODULE_PATH: string;
|
|
6
|
+
export declare function ensureDir(path: string): void;
|
|
7
|
+
export declare function toPosixPath(path: string): string;
|
|
8
|
+
export declare function collectFilesRecursive(dir: string): string[];
|
|
9
|
+
export declare function copyDirRecursive(sourceDir: string, targetDir: string): void;
|
|
10
|
+
export declare function toBuildRouteManifestEntry(route: ResolvedRoute, rootDir: string): BuildRouteManifestEntry;
|
|
11
|
+
export declare function buildTargetManifest(rootDir: string, buildRoot: string, target: BuildTarget, serverEntry: string | null): TargetBuildManifest;
|
|
12
|
+
export declare function writeTargetManifest(targetDir: string, targetManifest: TargetBuildManifest): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BuildTarget } from "../config";
|
|
2
|
+
import type { ResolvedRoute } from "../router";
|
|
3
|
+
export interface BuildClientOptions {
|
|
4
|
+
outDir: string;
|
|
5
|
+
pagesDir?: string;
|
|
6
|
+
plugins?: Bun.BunPlugin[];
|
|
7
|
+
rootLayout: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BuildRouteManifestEntry {
|
|
10
|
+
hasLayout: boolean;
|
|
11
|
+
hasStaticParams: boolean;
|
|
12
|
+
mode: ResolvedRoute["mode"];
|
|
13
|
+
pagePath: string;
|
|
14
|
+
pattern: string;
|
|
15
|
+
revalidate: number | null;
|
|
16
|
+
}
|
|
17
|
+
export interface TargetBuildManifest {
|
|
18
|
+
clientDir: string;
|
|
19
|
+
generatedAt: string;
|
|
20
|
+
manifestPath: string;
|
|
21
|
+
serverEntry: string | null;
|
|
22
|
+
serverPath: string | null;
|
|
23
|
+
targetDir: string;
|
|
24
|
+
templatePath: string;
|
|
25
|
+
}
|
|
26
|
+
export interface BuildManifest {
|
|
27
|
+
generatedAt: string;
|
|
28
|
+
pagesDir: string;
|
|
29
|
+
rootDir: string;
|
|
30
|
+
rootPath: string;
|
|
31
|
+
routes: BuildRouteManifestEntry[];
|
|
32
|
+
serverEntry: string | null;
|
|
33
|
+
targets: Partial<Record<BuildTarget, TargetBuildManifest>>;
|
|
34
|
+
version: 1;
|
|
35
|
+
}
|
|
36
|
+
export interface BuildAppOptions {
|
|
37
|
+
compile?: "server" | "embed";
|
|
38
|
+
pagesDir?: string;
|
|
39
|
+
plugins?: Bun.BunPlugin[];
|
|
40
|
+
rootDir?: string;
|
|
41
|
+
serverEntry?: string;
|
|
42
|
+
target: BuildTarget | "all";
|
|
43
|
+
}
|
|
44
|
+
export interface BuildAppResult {
|
|
45
|
+
manifest: BuildManifest;
|
|
46
|
+
targets: Partial<Record<BuildTarget, TargetBuildManifest>>;
|
|
47
|
+
}
|
|
48
|
+
export type BunBuildAliasConfig = Bun.BuildConfig & {
|
|
49
|
+
alias?: Record<string, string>;
|
|
50
|
+
outfile?: string;
|
|
51
|
+
packages?: "bundle" | "external";
|
|
52
|
+
write?: boolean;
|
|
53
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FurinConfig } from "../config.ts";
|
|
2
|
+
interface ResolvedCliConfig extends FurinConfig {
|
|
3
|
+
configPath: string | null;
|
|
4
|
+
pagesDir: string;
|
|
5
|
+
plugins?: Bun.BunPlugin[];
|
|
6
|
+
rootDir: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function loadCliConfig(cwd: string, explicitConfigPath?: string): Promise<ResolvedCliConfig>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|