@teyik0/furin 0.1.0-alpha.10
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/adapter/static.d.ts +3 -0
- package/dist/build/client.d.ts +25 -0
- package/dist/build/compile-entry.d.ts +35 -0
- package/dist/build/entry-template.d.ts +26 -0
- package/dist/build/hydrate.d.ts +24 -0
- package/dist/build/index.d.ts +7 -0
- package/dist/build/index.js +4716 -0
- package/dist/build/route-types.d.ts +21 -0
- package/dist/build/scan-server.d.ts +8 -0
- package/dist/build/server-routes-entry.d.ts +35 -0
- package/dist/build/shared.d.ts +11 -0
- package/dist/build/types.d.ts +76 -0
- package/dist/cli/config.d.ts +9 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +4751 -0
- package/dist/client.d.ts +195 -0
- package/dist/client.js +20 -0
- package/dist/config.d.ts +50 -0
- package/dist/config.js +28 -0
- package/dist/context-logger.d.ts +28 -0
- package/dist/dev-page-plugin.d.ts +109 -0
- package/dist/error.d.ts +23 -0
- package/dist/furin.d.ts +52 -0
- package/dist/furin.js +3948 -0
- package/dist/internal.d.ts +33 -0
- package/dist/link.d.ts +454 -0
- package/dist/link.js +1790 -0
- package/dist/not-found.d.ts +19 -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 +15 -0
- package/dist/render/boundaries.d.ts +79 -0
- package/dist/render/cache.d.ts +96 -0
- package/dist/render/default-screens.d.ts +11 -0
- package/dist/render/digest.d.ts +16 -0
- package/dist/render/element.d.ts +8 -0
- package/dist/render/index.d.ts +53 -0
- package/dist/render/loaders.d.ts +21 -0
- package/dist/render/shell.d.ts +29 -0
- package/dist/render/template.d.ts +6 -0
- package/dist/router.d.ts +96 -0
- package/dist/router.js +2693 -0
- package/dist/runtime-env.d.ts +3 -0
- package/dist/utils.d.ts +6 -0
- package/package.json +77 -0
- package/src/adapter/README.md +13 -0
- package/src/adapter/bun.ts +239 -0
- package/src/adapter/static.ts +341 -0
- package/src/build/client.ts +153 -0
- package/src/build/compile-entry.ts +129 -0
- package/src/build/entry-template.ts +126 -0
- package/src/build/hydrate.ts +250 -0
- package/src/build/index.ts +151 -0
- package/src/build/route-types.ts +89 -0
- package/src/build/scan-server.ts +110 -0
- package/src/build/server-routes-entry.ts +55 -0
- package/src/build/shared.ts +78 -0
- package/src/build/types.ts +85 -0
- package/src/cli/config.ts +68 -0
- package/src/cli/index.ts +115 -0
- package/src/client.ts +278 -0
- package/src/config.ts +66 -0
- package/src/context-logger.ts +74 -0
- package/src/dev-page-plugin.ts +434 -0
- package/src/env.d.ts +49 -0
- package/src/error.ts +32 -0
- package/src/furin.ts +383 -0
- package/src/internal.ts +51 -0
- package/src/link.tsx +1578 -0
- package/src/not-found.ts +40 -0
- package/src/plugin/index.ts +80 -0
- package/src/plugin/transform-client.ts +372 -0
- package/src/render/assemble.ts +66 -0
- package/src/render/boundaries.tsx +176 -0
- package/src/render/cache.ts +251 -0
- package/src/render/default-screens.tsx +299 -0
- package/src/render/digest.ts +71 -0
- package/src/render/element.tsx +119 -0
- package/src/render/index.ts +867 -0
- package/src/render/loaders.ts +127 -0
- package/src/render/shell.ts +187 -0
- package/src/render/template.ts +55 -0
- package/src/router.ts +779 -0
- package/src/runtime-env.ts +6 -0
- package/src/utils.ts +68 -0
|
@@ -0,0 +1,21 @@
|
|
|
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-env.d.ts at the project root — augments RouteManifest
|
|
14
|
+
* in furin/link so that <Link to="..."> has type-safe autocompletion and
|
|
15
|
+
* <Link search={...}> is typed per-route from the route's query schema.
|
|
16
|
+
*
|
|
17
|
+
* Written to the project root (like Next.js's next-env.d.ts) so it is
|
|
18
|
+
* committed to git and always available in CI without a build step.
|
|
19
|
+
*/
|
|
20
|
+
/** @internal Exported for unit testing only. */
|
|
21
|
+
export declare function writeRouteTypes(routes: ResolvedRoute[], projectRoot: 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,35 @@
|
|
|
1
|
+
export interface ServerRoutesEntryOptions {
|
|
2
|
+
buildId?: string;
|
|
3
|
+
outDir: string;
|
|
4
|
+
rootConventions?: {
|
|
5
|
+
errorPath?: string;
|
|
6
|
+
notFoundPath?: string;
|
|
7
|
+
};
|
|
8
|
+
rootPath: string;
|
|
9
|
+
routeMetadata?: Record<string, {
|
|
10
|
+
segmentBoundaries: Array<{
|
|
11
|
+
depth: number;
|
|
12
|
+
path: string;
|
|
13
|
+
errorPath?: string;
|
|
14
|
+
notFoundPath?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}>;
|
|
17
|
+
routes: Array<{
|
|
18
|
+
mode: "ssr" | "ssg" | "isr";
|
|
19
|
+
path: string;
|
|
20
|
+
pattern: string;
|
|
21
|
+
}>;
|
|
22
|
+
serverEntry: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Generates `server.ts` — an intermediate entry used to produce `server.js`.
|
|
26
|
+
*
|
|
27
|
+
* Equivalent to `_compile-entry.ts` but for disk (non-binary) production builds:
|
|
28
|
+
* 1. Statically imports every page module so Bun bundles them into server.js
|
|
29
|
+
* 2. Sets production mode and registers everything in a single CompileContext
|
|
30
|
+
* 3. Imports server.ts to boot the app
|
|
31
|
+
*
|
|
32
|
+
* This file is intermediate: `adapter/bun.ts` runs `Bun.build()` on it to produce
|
|
33
|
+
* the self-contained `server.js` bundle, then deletes this file.
|
|
34
|
+
*/
|
|
35
|
+
export declare function generateServerRoutesEntry(options: ServerRoutesEntryOptions): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { BuildTarget, StaticExportConfig } from "../config";
|
|
2
|
+
import type { ResolvedRoute } from "../router";
|
|
3
|
+
export interface BuildClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Sub-path prefix for the deployment (e.g. "/furin" for GitHub Pages).
|
|
6
|
+
* Passed through to the generated hydrate entry so SPA navigation uses
|
|
7
|
+
* correct physical URLs. Pass "" for root deployments.
|
|
8
|
+
*/
|
|
9
|
+
basePath: string;
|
|
10
|
+
outDir: string;
|
|
11
|
+
pagesDir?: string;
|
|
12
|
+
plugins?: Bun.BunPlugin[];
|
|
13
|
+
/**
|
|
14
|
+
* Public path prefix for all emitted JS/CSS chunks.
|
|
15
|
+
* Pass "/_client/" for root deployments; override for basePath deployments,
|
|
16
|
+
* e.g. "/furin/_client/".
|
|
17
|
+
*/
|
|
18
|
+
publicPath: string;
|
|
19
|
+
rootLayout: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BuildRouteManifestEntry {
|
|
22
|
+
hasLayout: boolean;
|
|
23
|
+
hasStaticParams: boolean;
|
|
24
|
+
mode: ResolvedRoute["mode"];
|
|
25
|
+
pagePath: string;
|
|
26
|
+
pattern: string;
|
|
27
|
+
revalidate: number | null;
|
|
28
|
+
}
|
|
29
|
+
export interface TargetBuildManifest {
|
|
30
|
+
buildId: string;
|
|
31
|
+
clientDir: string | null;
|
|
32
|
+
generatedAt: string;
|
|
33
|
+
serverEntry: string | null;
|
|
34
|
+
serverPath: string | null;
|
|
35
|
+
targetDir: string;
|
|
36
|
+
templatePath: string | null;
|
|
37
|
+
}
|
|
38
|
+
export type AnyTargetManifest = TargetBuildManifest | StaticTargetBuildManifest;
|
|
39
|
+
export interface BuildManifest {
|
|
40
|
+
generatedAt: string;
|
|
41
|
+
pagesDir: string;
|
|
42
|
+
rootDir: string;
|
|
43
|
+
rootPath: string;
|
|
44
|
+
routes: BuildRouteManifestEntry[];
|
|
45
|
+
serverEntry: string | null;
|
|
46
|
+
targets: Partial<Record<BuildTarget, AnyTargetManifest>>;
|
|
47
|
+
version: 1;
|
|
48
|
+
}
|
|
49
|
+
export interface BuildAppOptions {
|
|
50
|
+
compile?: "server" | "embed";
|
|
51
|
+
pagesDir?: string;
|
|
52
|
+
plugins?: Bun.BunPlugin[];
|
|
53
|
+
rootDir?: string;
|
|
54
|
+
serverEntry?: string;
|
|
55
|
+
/** Configuration for the `static` build target. */
|
|
56
|
+
staticConfig?: StaticExportConfig;
|
|
57
|
+
target: BuildTarget | "all";
|
|
58
|
+
}
|
|
59
|
+
/** Build manifest entry produced by the `static` adapter. */
|
|
60
|
+
export interface StaticTargetBuildManifest {
|
|
61
|
+
basePath: string;
|
|
62
|
+
generatedAt: string;
|
|
63
|
+
outDir: string;
|
|
64
|
+
renderedRoutes: string[];
|
|
65
|
+
skippedRoutes: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface BuildAppResult {
|
|
68
|
+
manifest: BuildManifest;
|
|
69
|
+
targets: Partial<Record<BuildTarget, AnyTargetManifest>>;
|
|
70
|
+
}
|
|
71
|
+
export type BunBuildAliasConfig = Bun.BuildConfig & {
|
|
72
|
+
alias?: Record<string, string>;
|
|
73
|
+
outfile?: string;
|
|
74
|
+
packages?: "bundle" | "external";
|
|
75
|
+
write?: boolean;
|
|
76
|
+
};
|
|
@@ -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 {};
|