@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.
Files changed (71) hide show
  1. package/dist/adapter/bun.d.ts +3 -0
  2. package/dist/build/client.d.ts +14 -0
  3. package/dist/build/compile-entry.d.ts +22 -0
  4. package/dist/build/entry-template.d.ts +13 -0
  5. package/dist/build/hydrate.d.ts +20 -0
  6. package/dist/build/index.d.ts +7 -0
  7. package/dist/build/index.js +2212 -0
  8. package/dist/build/route-types.d.ts +20 -0
  9. package/dist/build/scan-server.d.ts +8 -0
  10. package/dist/build/server-routes-entry.d.ts +22 -0
  11. package/dist/build/shared.d.ts +12 -0
  12. package/dist/build/types.d.ts +53 -0
  13. package/dist/cli/config.d.ts +9 -0
  14. package/dist/cli/index.d.ts +1 -0
  15. package/dist/cli/index.js +2240 -0
  16. package/dist/client.d.ts +158 -0
  17. package/dist/client.js +20 -0
  18. package/dist/config.d.ts +16 -0
  19. package/dist/config.js +23 -0
  20. package/dist/furin.d.ts +45 -0
  21. package/dist/furin.js +937 -0
  22. package/dist/internal.d.ts +18 -0
  23. package/dist/link.d.ts +119 -0
  24. package/dist/link.js +281 -0
  25. package/dist/plugin/index.d.ts +20 -0
  26. package/dist/plugin/index.js +1408 -0
  27. package/dist/plugin/transform-client.d.ts +9 -0
  28. package/dist/render/assemble.d.ts +13 -0
  29. package/dist/render/cache.d.ts +7 -0
  30. package/dist/render/element.d.ts +4 -0
  31. package/dist/render/index.d.ts +26 -0
  32. package/dist/render/loaders.d.ts +12 -0
  33. package/dist/render/shell.d.ts +17 -0
  34. package/dist/render/template.d.ts +4 -0
  35. package/dist/router.d.ts +32 -0
  36. package/dist/router.js +575 -0
  37. package/dist/runtime-env.d.ts +3 -0
  38. package/dist/tsconfig.dts.tsbuildinfo +1 -0
  39. package/dist/utils.d.ts +6 -0
  40. package/package.json +74 -0
  41. package/src/adapter/README.md +13 -0
  42. package/src/adapter/bun.ts +119 -0
  43. package/src/build/client.ts +110 -0
  44. package/src/build/compile-entry.ts +99 -0
  45. package/src/build/entry-template.ts +62 -0
  46. package/src/build/hydrate.ts +106 -0
  47. package/src/build/index.ts +120 -0
  48. package/src/build/route-types.ts +88 -0
  49. package/src/build/scan-server.ts +88 -0
  50. package/src/build/server-routes-entry.ts +38 -0
  51. package/src/build/shared.ts +80 -0
  52. package/src/build/types.ts +60 -0
  53. package/src/cli/config.ts +68 -0
  54. package/src/cli/index.ts +106 -0
  55. package/src/client.ts +237 -0
  56. package/src/config.ts +31 -0
  57. package/src/furin.ts +251 -0
  58. package/src/internal.ts +36 -0
  59. package/src/link.tsx +480 -0
  60. package/src/plugin/index.ts +80 -0
  61. package/src/plugin/transform-client.ts +372 -0
  62. package/src/render/assemble.ts +57 -0
  63. package/src/render/cache.ts +9 -0
  64. package/src/render/element.tsx +28 -0
  65. package/src/render/index.ts +312 -0
  66. package/src/render/loaders.ts +67 -0
  67. package/src/render/shell.ts +128 -0
  68. package/src/render/template.ts +54 -0
  69. package/src/router.ts +234 -0
  70. package/src/runtime-env.ts +6 -0
  71. 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>;