@teyik0/furin 0.1.0-alpha.7 → 0.1.0-alpha.8

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.
@@ -0,0 +1,3 @@
1
+ import type { BuildAppOptions, StaticTargetBuildManifest } from "../build/types.ts";
2
+ import type { ResolvedRoute, RootLayout } from "../router.ts";
3
+ export declare function buildStaticTarget(routes: ResolvedRoute[], rootDir: string, buildRoot: string, root: RootLayout, options: BuildAppOptions): Promise<StaticTargetBuildManifest>;
@@ -1,10 +1,10 @@
1
1
  import type { ResolvedRoute } from "../router";
2
2
  import type { BuildClientOptions } from "./types";
3
3
  export interface BuildClientResult {
4
- /** Public path of the JS entry chunk, e.g. `/_client/chunk-abc.js` */
5
- entryChunk: string;
6
4
  /** Public paths of all CSS chunks, e.g. `["/_client/chunk-abc.css"]` */
7
5
  cssChunks: string[];
6
+ /** Public path of the JS entry chunk, e.g. `/_client/chunk-abc.js` */
7
+ entryChunk: string;
8
8
  }
9
9
  /**
10
10
  * Builds the production client bundle via Bun.build() using _hydrate.tsx as
@@ -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 }: BuildClientOptions): Promise<BuildClientResult>;
25
+ export declare function buildClient(routes: ResolvedRoute[], { outDir, rootLayout, plugins, publicPath, basePath }: BuildClientOptions): Promise<BuildClientResult>;
@@ -1,6 +1,10 @@
1
1
  export interface CompileEntryOptions {
2
2
  buildId?: string;
3
+ embed?: {
4
+ clientDir: string;
5
+ };
3
6
  outDir: string;
7
+ publicDir?: string;
4
8
  rootPath: string;
5
9
  routes: Array<{
6
10
  mode: "ssr" | "ssg" | "isr";
@@ -8,10 +12,6 @@ export interface CompileEntryOptions {
8
12
  pattern: string;
9
13
  }>;
10
14
  serverEntry: string;
11
- embed?: {
12
- clientDir: string;
13
- };
14
- publicDir?: string;
15
15
  }
16
16
  /**
17
17
  * Generates a single `_compile-entry.ts` that:
@@ -1,5 +1,7 @@
1
1
  export interface EntryTemplateOptions {
2
2
  buildId?: string;
3
+ extraContext?: string[];
4
+ extraImports?: string[];
3
5
  headerComment: string;
4
6
  rootPath: string;
5
7
  routes: Array<{
@@ -8,7 +10,5 @@ export interface EntryTemplateOptions {
8
10
  pattern: string;
9
11
  }>;
10
12
  serverEntry: string;
11
- extraImports?: string[];
12
- extraContext?: string[];
13
13
  }
14
14
  export declare function buildEntrySource(options: EntryTemplateOptions): string;
@@ -9,12 +9,16 @@ import type { BuildClientOptions } from "./types";
9
9
  *
10
10
  * @param routes - Resolved routes to include in the hydration manifest.
11
11
  * @param rootLayout - Absolute path to the root layout module.
12
+ * @param basePath - Optional sub-path prefix for static deployments (e.g. "/furin").
13
+ * When set, the generated code strips the prefix from `window.location.pathname`
14
+ * before matching routes, and passes `basePath` to `RouterProvider` so SPA
15
+ * navigation uses the correct physical URLs.
12
16
  */
13
- export declare function generateHydrateEntry(routes: ResolvedRoute[], rootLayout: string): string;
17
+ export declare function generateHydrateEntry(routes: ResolvedRoute[], rootLayout: string, basePath: string): string;
14
18
  /**
15
19
  * Writes _hydrate.tsx + index.html to outDir for dev (Bun HMR) mode.
16
20
  *
17
21
  * Only rewrites a file when its content has actually changed so Bun's --hot
18
22
  * watcher does not trigger a spurious reload on every server restart.
19
23
  */
20
- export declare function writeDevFiles(routes: ResolvedRoute[], { outDir, rootLayout }: BuildClientOptions, projectRoot: string): void;
24
+ export declare function writeDevFiles(routes: ResolvedRoute[], { outDir, rootLayout, basePath }: BuildClientOptions, projectRoot: string): void;
@@ -1,7 +1,7 @@
1
1
  import type { BuildAppOptions, BuildAppResult } from "./types";
2
- export type { BuildAppOptions, BuildAppResult, BuildClientOptions, BuildManifest, BuildRouteManifestEntry, TargetBuildManifest, } from "./types";
3
2
  export { buildClient } from "./client";
4
3
  export { writeDevFiles } from "./hydrate";
5
4
  export { patternToTypeString, schemaToTypeString, writeRouteTypes } from "./route-types";
5
+ export type { BuildAppOptions, BuildAppResult, BuildClientOptions, BuildManifest, BuildRouteManifestEntry, TargetBuildManifest, } from "./types";
6
6
  export declare const BUILD_OUTPUT_DIR = ".furin/build";
7
7
  export declare function buildApp(options: BuildAppOptions): Promise<BuildAppResult>;