@teyik0/furin 0.5.0-alpha.1 → 0.5.0-alpha.2
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/build/entry-template.ts +3 -1
- package/dist/build/index.js +360 -219
- package/dist/build/private-server-sourcemaps.d.ts +2 -0
- package/dist/build/types.d.ts +2 -0
- package/dist/cli/index.js +363 -221
- package/dist/client/document.d.ts +2 -0
- package/dist/client/link.js +11 -0
- package/dist/client.js +11 -0
- package/dist/config.d.ts +7 -2
- package/dist/config.js +24 -1
- package/dist/furin.js +217 -82
- package/dist/rsc-client.js +9 -1
- package/dist/rsc.js +19 -7
- package/dist/server/browser-events/shutdown.d.ts +3 -0
- package/dist/server/cache/redis/index.d.ts +2 -0
- package/dist/server/cache/redis/index.js +67 -12
- package/dist/server/cache/redis/scripts.d.ts +5 -5
- package/dist/server/dev/plugin.d.ts +1 -0
- package/dist/server/evlog.d.ts +1 -1
- package/dist/server/internal.js +3 -1
- package/dist/server/production-server.d.ts +13 -0
- package/dist/server/production-server.js +2906 -0
- package/dist/server/router/hmr.d.ts +6 -0
- package/dist/server/router/hmr.production.d.ts +5 -0
- package/dist/server/router/plugin.d.ts +5 -1
- package/dist/server/sync/index.js +5 -2
- package/dist/server/sync/stream.d.ts +4 -0
- package/dist/shared/production-build.d.ts +2 -0
- package/package.json +8 -3
- package/src/adapter/bun.ts +74 -15
- package/src/adapter/vercel.ts +15 -1
- package/src/build/elysia-aot.ts +1 -1
- package/src/build/entry-template.ts +3 -1
- package/src/build/hydrate.ts +5 -1
- package/src/build/index.ts +5 -0
- package/src/build/private-server-sourcemaps.ts +20 -0
- package/src/build/server-app-entry.ts +3 -2
- package/src/build/types.ts +2 -0
- package/src/cli/index.ts +1 -0
- package/src/client/document.tsx +19 -0
- package/src/config.ts +30 -2
- package/src/furin.ts +37 -12
- package/src/rsc/codec.ts +11 -6
- package/src/rsc/render-error.ts +3 -1
- package/src/server/browser-events/plugin.ts +7 -0
- package/src/server/browser-events/shutdown.ts +32 -0
- package/src/server/cache/redis/index.ts +19 -2
- package/src/server/cache/redis/scripts.ts +47 -7
- package/src/server/dev/plugin.ts +10 -1
- package/src/server/evlog.ts +11 -4
- package/src/server/production-server.ts +135 -0
- package/src/server/render/document.tsx +7 -1
- package/src/server/render/ssr.ts +2 -1
- package/src/server/render/template.ts +5 -1
- package/src/server/router/discovery.ts +3 -1
- package/src/server/router/hmr.production.ts +11 -0
- package/src/server/router/hmr.ts +84 -77
- package/src/server/router/plugin.ts +76 -17
- package/src/server/router/schema-merge.ts +9 -2
- package/src/server/sync/stream.ts +43 -2
- package/src/shared/production-build.ts +20 -0
|
@@ -3,6 +3,7 @@ import type { HeadOptions } from "../client.ts";
|
|
|
3
3
|
export interface DocumentAssets {
|
|
4
4
|
buildId: string | undefined;
|
|
5
5
|
entryModule: string | undefined;
|
|
6
|
+
extensionErrorFilterScript?: string;
|
|
6
7
|
faviconHref: string | undefined;
|
|
7
8
|
frameworkModules: readonly string[];
|
|
8
9
|
staticMode: boolean;
|
|
@@ -12,6 +13,7 @@ export interface DocumentState {
|
|
|
12
13
|
assets: DocumentAssets;
|
|
13
14
|
dataJson: string | undefined;
|
|
14
15
|
head: HeadOptions | undefined;
|
|
16
|
+
routeFrames?: string;
|
|
15
17
|
syncJson: string | undefined;
|
|
16
18
|
}
|
|
17
19
|
export declare function DocumentProvider({ children, value, }: {
|
package/dist/client/link.js
CHANGED
|
@@ -709,6 +709,10 @@ function HeadContent() {
|
|
|
709
709
|
}
|
|
710
710
|
return /* @__PURE__ */ jsxDEV2(Fragment, {
|
|
711
711
|
children: [
|
|
712
|
+
state.assets.extensionErrorFilterScript === undefined ? null : /* @__PURE__ */ jsxDEV2("script", {
|
|
713
|
+
dangerouslySetInnerHTML: { __html: state.assets.extensionErrorFilterScript },
|
|
714
|
+
"data-furin-extension-error-filter": ""
|
|
715
|
+
}, undefined, false, undefined, this),
|
|
712
716
|
/* @__PURE__ */ jsxDEV2("meta", {
|
|
713
717
|
charSet: "utf-8",
|
|
714
718
|
"data-furin-head": ""
|
|
@@ -766,6 +770,13 @@ function Scripts() {
|
|
|
766
770
|
id: "__FURIN_DATA__",
|
|
767
771
|
type: "application/json"
|
|
768
772
|
}, undefined, false, undefined, this),
|
|
773
|
+
state.routeFrames === undefined ? null : /* @__PURE__ */ jsxDEV2("template", {
|
|
774
|
+
dangerouslySetInnerHTML: {
|
|
775
|
+
__html: state.routeFrames.replaceAll("&", "&").replaceAll("<", "<")
|
|
776
|
+
},
|
|
777
|
+
"data-furin-document-state": "",
|
|
778
|
+
id: "__FURIN_ROUTE_FRAMES__"
|
|
779
|
+
}, undefined, false, undefined, this),
|
|
769
780
|
/* @__PURE__ */ jsxDEV2("script", {
|
|
770
781
|
dangerouslySetInnerHTML: { __html: serializeJson(state.head ?? {}) },
|
|
771
782
|
"data-furin-scripts": "",
|
package/dist/client.js
CHANGED
|
@@ -64,6 +64,10 @@ function HeadContent() {
|
|
|
64
64
|
}
|
|
65
65
|
return /* @__PURE__ */ jsxDEV(Fragment, {
|
|
66
66
|
children: [
|
|
67
|
+
state.assets.extensionErrorFilterScript === undefined ? null : /* @__PURE__ */ jsxDEV("script", {
|
|
68
|
+
dangerouslySetInnerHTML: { __html: state.assets.extensionErrorFilterScript },
|
|
69
|
+
"data-furin-extension-error-filter": ""
|
|
70
|
+
}, undefined, false, undefined, this),
|
|
67
71
|
/* @__PURE__ */ jsxDEV("meta", {
|
|
68
72
|
charSet: "utf-8",
|
|
69
73
|
"data-furin-head": ""
|
|
@@ -121,6 +125,13 @@ function Scripts() {
|
|
|
121
125
|
id: "__FURIN_DATA__",
|
|
122
126
|
type: "application/json"
|
|
123
127
|
}, undefined, false, undefined, this),
|
|
128
|
+
state.routeFrames === undefined ? null : /* @__PURE__ */ jsxDEV("template", {
|
|
129
|
+
dangerouslySetInnerHTML: {
|
|
130
|
+
__html: state.routeFrames.replaceAll("&", "&").replaceAll("<", "<")
|
|
131
|
+
},
|
|
132
|
+
"data-furin-document-state": "",
|
|
133
|
+
id: "__FURIN_ROUTE_FRAMES__"
|
|
134
|
+
}, undefined, false, undefined, this),
|
|
124
135
|
/* @__PURE__ */ jsxDEV("script", {
|
|
125
136
|
dangerouslySetInnerHTML: { __html: serializeJson(state.head ?? {}) },
|
|
126
137
|
"data-furin-scripts": "",
|
package/dist/config.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { BunPlugin } from "bun";
|
|
|
2
2
|
import type { Static } from "typebox";
|
|
3
3
|
export declare const BUILD_TARGETS: readonly ["bun", "vercel", "static", "package"];
|
|
4
4
|
export type BuildTarget = (typeof BUILD_TARGETS)[number];
|
|
5
|
+
declare const VERCEL_REGIONS: readonly ["arn1", "bom1", "cdg1", "cle1", "cpt1", "dub1", "dxb1", "fra1", "gru1", "hkg1", "hnd1", "iad1", "icn1", "kix1", "lhr1", "pdx1", "sfo1", "sin1", "syd1", "yul1"];
|
|
6
|
+
export type VercelRegion = (typeof VERCEL_REGIONS)[number];
|
|
5
7
|
/**
|
|
6
8
|
* Configuration for the `static` build target.
|
|
7
9
|
* Produces a fully pre-rendered directory deployable to any static host
|
|
@@ -29,7 +31,7 @@ export interface StaticExportConfig {
|
|
|
29
31
|
}
|
|
30
32
|
export interface VercelDeploymentConfig {
|
|
31
33
|
/** Vercel compute regions, such as "cdg1" or "iad1". */
|
|
32
|
-
regions?:
|
|
34
|
+
regions?: VercelRegion[];
|
|
33
35
|
}
|
|
34
36
|
export declare const configSchema: import("typebox").TObject<{
|
|
35
37
|
/**
|
|
@@ -64,6 +66,8 @@ export declare const configSchema: import("typebox").TObject<{
|
|
|
64
66
|
reactCompiler: import("typebox").TOptional<import("typebox").TBoolean>;
|
|
65
67
|
rootDir: import("typebox").TOptional<import("typebox").TString>;
|
|
66
68
|
serverEntry: import("typebox").TOptional<import("typebox").TString>;
|
|
69
|
+
/** Emit private server source maps for error-tool uploads. Off by default. */
|
|
70
|
+
serverSourceMaps: import("typebox").TOptional<import("typebox").TBoolean>;
|
|
67
71
|
static: import("typebox").TOptional<import("typebox").TObject<{
|
|
68
72
|
basePath: import("typebox").TOptional<import("typebox").TString>;
|
|
69
73
|
onSSR: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"skip">]>>;
|
|
@@ -71,7 +75,7 @@ export declare const configSchema: import("typebox").TObject<{
|
|
|
71
75
|
}>>;
|
|
72
76
|
targets: import("typebox").TOptional<import("typebox").TArray<import("typebox").TUnion<import("typebox").TLiteral<"bun" | "package" | "static" | "vercel">[]>>>;
|
|
73
77
|
vercel: import("typebox").TOptional<import("typebox").TObject<{
|
|
74
|
-
regions: import("typebox").TOptional<import("typebox").TArray<import("typebox").
|
|
78
|
+
regions: import("typebox").TOptional<import("typebox").TArray<import("typebox").TEnum<["arn1", "bom1", "cdg1", "cle1", "cpt1", "dub1", "dxb1", "fra1", "gru1", "hkg1", "hnd1", "iad1", "icn1", "kix1", "lhr1", "pdx1", "sfo1", "sin1", "syd1", "yul1"]>>>;
|
|
75
79
|
}>>;
|
|
76
80
|
}>;
|
|
77
81
|
export type FurinPlugin = BunPlugin & {
|
|
@@ -82,3 +86,4 @@ export type FurinConfig = Static<typeof configSchema> & {
|
|
|
82
86
|
static?: StaticExportConfig;
|
|
83
87
|
};
|
|
84
88
|
export declare function defineConfig(config: FurinConfig): FurinConfig;
|
|
89
|
+
export {};
|
package/dist/config.js
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
// src/config.ts
|
|
3
3
|
import { t } from "elysia";
|
|
4
4
|
var BUILD_TARGETS = ["bun", "vercel", "static", "package"];
|
|
5
|
+
var VERCEL_REGIONS = [
|
|
6
|
+
"arn1",
|
|
7
|
+
"bom1",
|
|
8
|
+
"cdg1",
|
|
9
|
+
"cle1",
|
|
10
|
+
"cpt1",
|
|
11
|
+
"dub1",
|
|
12
|
+
"dxb1",
|
|
13
|
+
"fra1",
|
|
14
|
+
"gru1",
|
|
15
|
+
"hkg1",
|
|
16
|
+
"hnd1",
|
|
17
|
+
"iad1",
|
|
18
|
+
"icn1",
|
|
19
|
+
"kix1",
|
|
20
|
+
"lhr1",
|
|
21
|
+
"pdx1",
|
|
22
|
+
"sfo1",
|
|
23
|
+
"sin1",
|
|
24
|
+
"syd1",
|
|
25
|
+
"yul1"
|
|
26
|
+
];
|
|
5
27
|
var buildTargetSchema = t.Union(BUILD_TARGETS.map((v) => t.Literal(v)));
|
|
6
28
|
var compileTargetSchema = t.Union([t.Literal("server"), t.Literal("embed")]);
|
|
7
29
|
var configSchema = t.Object({
|
|
@@ -18,6 +40,7 @@ var configSchema = t.Object({
|
|
|
18
40
|
reactCompiler: t.Optional(t.Boolean()),
|
|
19
41
|
rootDir: t.Optional(t.String()),
|
|
20
42
|
serverEntry: t.Optional(t.String()),
|
|
43
|
+
serverSourceMaps: t.Optional(t.Boolean()),
|
|
21
44
|
static: t.Optional(t.Object({
|
|
22
45
|
basePath: t.Optional(t.String()),
|
|
23
46
|
onSSR: t.Optional(t.Union([t.Literal("error"), t.Literal("skip")])),
|
|
@@ -25,7 +48,7 @@ var configSchema = t.Object({
|
|
|
25
48
|
})),
|
|
26
49
|
targets: t.Optional(t.Array(buildTargetSchema)),
|
|
27
50
|
vercel: t.Optional(t.Object({
|
|
28
|
-
regions: t.Optional(t.Array(t.
|
|
51
|
+
regions: t.Optional(t.Array(t.Enum(VERCEL_REGIONS), {
|
|
29
52
|
minItems: 1,
|
|
30
53
|
uniqueItems: true
|
|
31
54
|
}))
|