@vertz/cloudflare 0.2.7 → 0.2.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @vertz/cloudflare
2
2
 
3
+ ## 0.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @vertz/core@0.2.8
9
+ - @vertz/ui-server@0.2.8
10
+
3
11
  ## 0.2.7
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertz/cloudflare",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Cloudflare Workers adapter for vertz",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,16 +22,16 @@
22
22
  "test": "vitest run"
23
23
  },
24
24
  "dependencies": {
25
- "@vertz/core": "^0.2.4"
25
+ "@vertz/core": "workspace:^"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@cloudflare/workers-types": "^4.20260305.0",
29
- "@vertz/ui-server": "^0.2.4",
29
+ "@vertz/ui-server": "workspace:^",
30
30
  "@vitest/coverage-v8": "^4.0.18",
31
31
  "typescript": "^5.7.3"
32
32
  },
33
33
  "peerDependencies": {
34
- "@vertz/ui-server": "^0.2.4"
34
+ "@vertz/ui-server": "workspace:^"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@vertz/ui-server": {
@@ -1 +0,0 @@
1
- $ tsc
@@ -1,11 +0,0 @@
1
- $ vitest run
2
-
3
-  RUN  v4.0.18 /Users/viniciusdacal/vertz-dev/vertz/packages/cloudflare
4
-
5
- ✓ tests/handler.test.ts (33 tests) 99ms
6
-
7
-  Test Files  1 passed (1)
8
-  Tests  33 passed (33)
9
-  Start at  23:11:10
10
-  Duration  730ms (transform 294ms, setup 0ms, import 356ms, tests 99ms, environment 0ms)
11
-
@@ -1 +0,0 @@
1
- $ tsc --noEmit
package/dist/handler.d.ts DELETED
@@ -1,73 +0,0 @@
1
- import type { AppBuilder } from '@vertz/core';
2
- import type { SSRModule } from '@vertz/ui-server/ssr';
3
- export interface CloudflareHandlerOptions {
4
- basePath?: string;
5
- }
6
- /**
7
- * SSR module configuration for zero-boilerplate server-side rendering.
8
- *
9
- * Pass the app module directly and the handler generates the HTML template,
10
- * wires up createSSRHandler, and handles the full SSR pipeline.
11
- */
12
- export interface SSRModuleConfig {
13
- /** App module exporting App, theme?, styles?, getInjectedCSS? */
14
- module: SSRModule;
15
- /** Client-side entry script path. Default: '/assets/entry-client.js' */
16
- clientScript?: string;
17
- /** HTML document title. Default: 'Vertz App' */
18
- title?: string;
19
- /** SSR query timeout in ms. Default: 5000 (generous for D1 cold starts). */
20
- ssrTimeout?: number;
21
- }
22
- /**
23
- * Full-stack configuration for createHandler.
24
- *
25
- * Supports lazy app initialization (for D1 bindings), SSR fallback,
26
- * and automatic security headers.
27
- */
28
- export interface CloudflareHandlerConfig {
29
- /**
30
- * Factory that creates the AppBuilder. Receives the Worker env bindings.
31
- * Called once on first request, then cached.
32
- */
33
- app: (env: unknown) => AppBuilder;
34
- /** API path prefix. Requests matching this prefix go to the app handler. */
35
- basePath: string;
36
- /**
37
- * SSR configuration for non-API routes.
38
- *
39
- * - `SSRModuleConfig` — zero-boilerplate: pass the app module directly
40
- * - `(request: Request) => Promise<Response>` — custom SSR callback
41
- * - `undefined` — non-API requests return 404
42
- */
43
- ssr?: SSRModuleConfig | ((request: Request) => Promise<Response>);
44
- /** When true, adds standard security headers to all responses. */
45
- securityHeaders?: boolean;
46
- }
47
- /** Generate a cryptographically random nonce for CSP. */
48
- export declare function generateNonce(): string;
49
- /**
50
- * Create a Cloudflare Worker handler from a Vertz app.
51
- *
52
- * Simple form — wraps an AppBuilder directly:
53
- * ```ts
54
- * export default createHandler(app, { basePath: '/api' });
55
- * ```
56
- *
57
- * Config form — full-stack with lazy init, SSR, and security headers:
58
- * ```ts
59
- * export default createHandler({
60
- * app: (env) => createServer({ entities, db: createDb({ d1: env.DB }) }),
61
- * basePath: '/api',
62
- * ssr: (req) => renderToString(new URL(req.url).pathname),
63
- * securityHeaders: true,
64
- * });
65
- * ```
66
- */
67
- /** Worker module shape returned by createHandler. */
68
- export interface CloudflareWorkerModule {
69
- fetch(request: Request, env: unknown, ctx: ExecutionContext): Promise<Response>;
70
- }
71
- export declare function createHandler(appOrConfig: AppBuilder | CloudflareHandlerConfig, options?: CloudflareHandlerOptions): CloudflareWorkerModule;
72
- export declare function generateHTMLTemplate(clientScript: string, title: string, nonce?: string): string;
73
- //# sourceMappingURL=handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMtD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,MAAM,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,UAAU,CAAC;IAElC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAElE,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAMD,yDAAyD;AACzD,wBAAgB,aAAa,IAAI,MAAM,CAStC;AA4CD;;;;;;;;;;;;;;;;;GAiBG;AACH,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACjF;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,UAAU,GAAG,uBAAuB,EACjD,OAAO,CAAC,EAAE,wBAAwB,GACjC,sBAAsB,CAQxB;AA+BD,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAchG"}
package/dist/handler.js DELETED
@@ -1,196 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- // Security headers
3
- // ---------------------------------------------------------------------------
4
- /** Generate a cryptographically random nonce for CSP. */
5
- export function generateNonce() {
6
- const bytes = new Uint8Array(16);
7
- crypto.getRandomValues(bytes);
8
- // Base64-encode without padding for a compact, URL-safe nonce
9
- let binary = '';
10
- for (const byte of bytes) {
11
- binary += String.fromCharCode(byte);
12
- }
13
- return btoa(binary);
14
- }
15
- const STATIC_SECURITY_HEADERS = {
16
- 'X-Content-Type-Options': 'nosniff',
17
- 'X-Frame-Options': 'DENY',
18
- 'X-XSS-Protection': '1; mode=block',
19
- 'Referrer-Policy': 'strict-origin-when-cross-origin',
20
- 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
21
- };
22
- function buildCSPHeader(nonce) {
23
- return `default-src 'self'; script-src 'self' 'nonce-${nonce}'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;`;
24
- }
25
- function withSecurityHeaders(response, nonce) {
26
- const headers = new Headers(response.headers);
27
- for (const [key, value] of Object.entries(STATIC_SECURITY_HEADERS)) {
28
- headers.set(key, value);
29
- }
30
- headers.set('Content-Security-Policy', buildCSPHeader(nonce));
31
- return new Response(response.body, {
32
- status: response.status,
33
- statusText: response.statusText,
34
- headers,
35
- });
36
- }
37
- // ---------------------------------------------------------------------------
38
- // Helpers
39
- // ---------------------------------------------------------------------------
40
- function stripBasePath(request, basePath) {
41
- const url = new URL(request.url);
42
- if (url.pathname.startsWith(basePath)) {
43
- url.pathname = url.pathname.slice(basePath.length) || '/';
44
- return new Request(url.toString(), request);
45
- }
46
- return request;
47
- }
48
- export function createHandler(appOrConfig, options) {
49
- // Config object form
50
- if ('app' in appOrConfig && typeof appOrConfig.app === 'function') {
51
- return createFullStackHandler(appOrConfig);
52
- }
53
- // Simple AppBuilder form (backward compat)
54
- return createSimpleHandler(appOrConfig, options);
55
- }
56
- // ---------------------------------------------------------------------------
57
- // Simple handler (backward compat)
58
- // ---------------------------------------------------------------------------
59
- function createSimpleHandler(app, options) {
60
- const handler = app.handler;
61
- return {
62
- async fetch(request, _env, _ctx) {
63
- if (options?.basePath) {
64
- request = stripBasePath(request, options.basePath);
65
- }
66
- try {
67
- return await handler(request);
68
- }
69
- catch (error) {
70
- console.error('Unhandled error in worker:', error);
71
- return new Response('Internal Server Error', { status: 500 });
72
- }
73
- },
74
- };
75
- }
76
- // ---------------------------------------------------------------------------
77
- // HTML template generation
78
- // ---------------------------------------------------------------------------
79
- export function generateHTMLTemplate(clientScript, title, nonce) {
80
- const nonceAttr = nonce != null ? ` nonce="${nonce}"` : '';
81
- return `<!doctype html>
82
- <html lang="en">
83
- <head>
84
- <meta charset="UTF-8">
85
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
86
- <title>${title}</title>
87
- </head>
88
- <body>
89
- <div id="app"><!--ssr-outlet--></div>
90
- <script type="module" src="${clientScript}"${nonceAttr}></script>
91
- </body>
92
- </html>`;
93
- }
94
- // ---------------------------------------------------------------------------
95
- // Full-stack handler
96
- // ---------------------------------------------------------------------------
97
- function isSSRModuleConfig(ssr) {
98
- return typeof ssr === 'object' && 'module' in ssr;
99
- }
100
- function createFullStackHandler(config) {
101
- const { basePath, ssr, securityHeaders } = config;
102
- let cachedApp = null;
103
- // SSR handler factory: when using SSRModuleConfig with nonce support, this
104
- // is called per-request with the current nonce. For custom callbacks it
105
- // is set once and always returns the same handler.
106
- let ssrHandlerFactory = null;
107
- let ssrResolved = false;
108
- function getApp(env) {
109
- if (!cachedApp) {
110
- cachedApp = config.app(env);
111
- }
112
- return cachedApp;
113
- }
114
- async function resolveSSR() {
115
- if (ssrResolved)
116
- return;
117
- ssrResolved = true;
118
- if (!ssr)
119
- return;
120
- if (isSSRModuleConfig(ssr)) {
121
- const { createSSRHandler } = await import('@vertz/ui-server/ssr');
122
- const { module, clientScript = '/assets/entry-client.js', title = 'Vertz App', ssrTimeout = 5000, } = ssr;
123
- // Return a factory that creates an SSR handler with the per-request nonce
124
- ssrHandlerFactory = (nonce) => createSSRHandler({
125
- module,
126
- template: generateHTMLTemplate(clientScript, title, nonce),
127
- ssrTimeout,
128
- nonce,
129
- });
130
- }
131
- else {
132
- // Custom callback — wrap it in a factory that ignores the nonce
133
- ssrHandlerFactory = () => ssr;
134
- }
135
- }
136
- function applyHeaders(response, nonce) {
137
- return securityHeaders ? withSecurityHeaders(response, nonce) : response;
138
- }
139
- return {
140
- async fetch(request, env, _ctx) {
141
- await resolveSSR();
142
- const url = new URL(request.url);
143
- const nonce = generateNonce();
144
- // Route splitting: basePath/* → API handler (no URL rewriting — the
145
- // app's own basePath/apiPrefix handles prefix matching internally)
146
- if (url.pathname.startsWith(basePath)) {
147
- try {
148
- const app = getApp(env);
149
- const response = await app.handler(request);
150
- return applyHeaders(response, nonce);
151
- }
152
- catch (error) {
153
- console.error('Unhandled error in worker:', error);
154
- return applyHeaders(new Response('Internal Server Error', { status: 500 }), nonce);
155
- }
156
- }
157
- // Non-API routes → SSR or 404
158
- if (ssrHandlerFactory) {
159
- const app = getApp(env);
160
- const ssrHandler = ssrHandlerFactory(nonce);
161
- const origin = url.origin;
162
- // Patch fetch during SSR so API requests (e.g. query() calling
163
- // fetch('/api/todos')) are routed through the in-memory app handler
164
- // instead of attempting a network self-fetch (which fails on Workers).
165
- const originalFetch = globalThis.fetch;
166
- globalThis.fetch = (input, init) => {
167
- // Determine the pathname from the input (string, URL, or Request)
168
- const rawUrl = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
169
- const isRelative = rawUrl.startsWith('/');
170
- const pathname = isRelative ? rawUrl.split('?')[0] : new URL(rawUrl).pathname;
171
- const isLocal = isRelative || new URL(rawUrl).origin === origin;
172
- if (isLocal && pathname.startsWith(basePath)) {
173
- // Build an absolute URL so Request() doesn't reject relative URLs
174
- const absoluteUrl = isRelative ? `${origin}${rawUrl}` : rawUrl;
175
- const req = new Request(absoluteUrl, init);
176
- return app.handler(req);
177
- }
178
- return originalFetch(input, init);
179
- };
180
- try {
181
- const response = await ssrHandler(request);
182
- return applyHeaders(response, nonce);
183
- }
184
- catch (error) {
185
- console.error('Unhandled error in worker:', error);
186
- return applyHeaders(new Response('Internal Server Error', { status: 500 }), nonce);
187
- }
188
- finally {
189
- globalThis.fetch = originalFetch;
190
- }
191
- }
192
- return applyHeaders(new Response('Not Found', { status: 404 }), nonce);
193
- },
194
- };
195
- }
196
- //# sourceMappingURL=handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAyDA,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,yDAAyD;AACzD,MAAM,UAAU,aAAa;IAC3B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACjC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,8DAA8D;IAC9D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IA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QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;oBAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACvC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;oBACnD,OAAO,YAAY,CAAC,IAAI,QAAQ,CAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;gBACrF,CAAC;wBAAS,CAAC;oBACT,UAAU,CAAC,KAAK,GAAG,aAAa,CAAC;gBACnC,CAAC;YACH,CAAC;YAED,OAAO,YAAY,CAAC,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACzE,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export type { CloudflareHandlerConfig, CloudflareHandlerOptions, CloudflareWorkerModule, SSRModuleConfig, } from './handler.js';
2
- export { createHandler, generateHTMLTemplate, generateNonce } from './handler.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}