@affectively/aeon-pages-runtime 0.1.0 → 0.3.0
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/api-routes.d.ts +110 -0
- package/dist/benchmark.d.ts +6 -0
- package/dist/cache.d.ts +77 -0
- package/dist/durable-object.d.ts +63 -0
- package/dist/index.d.ts +21 -5
- package/dist/index.js +3445 -96
- package/dist/nextjs-adapter.d.ts +102 -0
- package/dist/offline/encrypted-queue.d.ts +109 -0
- package/dist/offline/encryption.d.ts +87 -0
- package/dist/offline/types.d.ts +341 -0
- package/dist/router/context-extractor.d.ts +63 -1
- package/dist/router/esi-cyrano.d.ts +285 -0
- package/dist/router/esi-react.d.ts +133 -0
- package/dist/router/esi.d.ts +2 -0
- package/dist/router/index.d.ts +6 -4
- package/dist/router/index.js +459 -5
- package/dist/server.js +445 -7
- package/dist/service-worker-push.d.ts +87 -0
- package/dist/service-worker.d.ts +5 -0
- package/dist/skeleton-hydrate.d.ts +61 -0
- package/dist/speculation.d.ts +95 -0
- package/dist/sync/conflict-resolver.d.ts +145 -0
- package/dist/sync/coordinator.d.ts +165 -0
- package/dist/tree-compiler.d.ts +27 -0
- package/dist/types.d.ts +322 -1
- package/dist/worker.d.ts +59 -0
- package/package.json +9 -2
package/dist/types.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface AeonOptions {
|
|
|
28
28
|
presence?: PresenceOptions;
|
|
29
29
|
/** Offline support configuration */
|
|
30
30
|
offline?: OfflineOptions;
|
|
31
|
+
/** Push notification configuration */
|
|
32
|
+
push?: PushOptions;
|
|
33
|
+
/** PWA install prompt configuration */
|
|
34
|
+
install?: InstallOptions;
|
|
31
35
|
/** Allow dynamic route creation for unclaimed paths */
|
|
32
36
|
dynamicRoutes?: boolean;
|
|
33
37
|
}
|
|
@@ -56,8 +60,55 @@ export interface PresenceOptions {
|
|
|
56
60
|
export interface OfflineOptions {
|
|
57
61
|
/** Enable offline support */
|
|
58
62
|
enabled: boolean;
|
|
59
|
-
/** Maximum operations to queue offline */
|
|
63
|
+
/** Maximum operations to queue offline (default: 1000) */
|
|
60
64
|
maxQueueSize?: number;
|
|
65
|
+
/** Encryption configuration for offline queue */
|
|
66
|
+
encryption?: {
|
|
67
|
+
/** Enable encryption for queued operations */
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
/** Key derivation method: 'ucan' for UCAN-derived keys, 'session' for session-based */
|
|
70
|
+
keyDerivation?: 'ucan' | 'session';
|
|
71
|
+
};
|
|
72
|
+
/** Sync configuration */
|
|
73
|
+
sync?: {
|
|
74
|
+
/** Maximum operations per batch (default: 100) */
|
|
75
|
+
maxBatchSize?: number;
|
|
76
|
+
/** Maximum bytes per batch (default: 5MB) */
|
|
77
|
+
maxBatchBytes?: number;
|
|
78
|
+
/** Batch timeout in ms (default: 5000) */
|
|
79
|
+
batchTimeoutMs?: number;
|
|
80
|
+
/** Enable compression for batches (default: true) */
|
|
81
|
+
enableCompression?: boolean;
|
|
82
|
+
/** Enable delta sync (default: true) */
|
|
83
|
+
enableDeltaSync?: boolean;
|
|
84
|
+
/** Enable adaptive batch sizing based on network (default: true) */
|
|
85
|
+
adaptiveBatching?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/** Storage configuration */
|
|
88
|
+
storage?: {
|
|
89
|
+
/** Maximum local storage capacity in bytes (default: 50MB) */
|
|
90
|
+
maxLocalCapacity?: number;
|
|
91
|
+
/** Interval for D1 sync in ms (default: 5 minutes) */
|
|
92
|
+
d1SyncInterval?: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** Push notification configuration */
|
|
96
|
+
export interface PushOptions {
|
|
97
|
+
/** Enable push notifications */
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
/** VAPID public key for push subscription */
|
|
100
|
+
vapidPublicKey?: string;
|
|
101
|
+
/** Default notification icon */
|
|
102
|
+
defaultIcon?: string;
|
|
103
|
+
/** Default notification badge */
|
|
104
|
+
defaultBadge?: string;
|
|
105
|
+
}
|
|
106
|
+
/** PWA install prompt configuration */
|
|
107
|
+
export interface InstallOptions {
|
|
108
|
+
/** Show install prompt when available */
|
|
109
|
+
showPrompt: boolean;
|
|
110
|
+
/** Show iOS-specific installation instructions */
|
|
111
|
+
iosInstructions: boolean;
|
|
61
112
|
}
|
|
62
113
|
export interface ComponentOptions {
|
|
63
114
|
/** Auto-discover components from componentsDir */
|
|
@@ -113,11 +164,64 @@ export interface RouteOperation {
|
|
|
113
164
|
timestamp: string;
|
|
114
165
|
nodeId: string;
|
|
115
166
|
}
|
|
167
|
+
/** Shape types for skeleton rendering */
|
|
168
|
+
export type SkeletonShape = 'rect' | 'circle' | 'text-line' | 'text-block' | 'container';
|
|
169
|
+
/** Source of skeleton inference */
|
|
170
|
+
export type SkeletonSource = 'tailwind' | 'prop-defaults' | 'hint' | 'measured';
|
|
171
|
+
/** Skeleton dimensions extracted from Tailwind classes or props */
|
|
172
|
+
export interface SkeletonDimensions {
|
|
173
|
+
/** Width CSS value: '256px', '100%', 'auto' */
|
|
174
|
+
width?: string;
|
|
175
|
+
/** Height CSS value: '48px', 'auto' */
|
|
176
|
+
height?: string;
|
|
177
|
+
/** Min height CSS value */
|
|
178
|
+
minHeight?: string;
|
|
179
|
+
/** Aspect ratio: '16/9', '1/1' */
|
|
180
|
+
aspectRatio?: string;
|
|
181
|
+
/** Padding CSS value */
|
|
182
|
+
padding?: string;
|
|
183
|
+
/** Margin CSS value */
|
|
184
|
+
margin?: string;
|
|
185
|
+
/** Border radius CSS value */
|
|
186
|
+
borderRadius?: string;
|
|
187
|
+
/** Gap for flex/grid containers */
|
|
188
|
+
gap?: string;
|
|
189
|
+
}
|
|
190
|
+
/** Skeleton metadata attached to component nodes */
|
|
191
|
+
export interface SkeletonMetadata {
|
|
192
|
+
/** Computed dimensions from Tailwind/props/hints */
|
|
193
|
+
dimensions: SkeletonDimensions;
|
|
194
|
+
/** Shape hint for skeleton rendering */
|
|
195
|
+
shape: SkeletonShape;
|
|
196
|
+
/** Number of skeleton lines for text-block shape */
|
|
197
|
+
lines?: number;
|
|
198
|
+
/** Whether this node has dynamic content that needs skeleton */
|
|
199
|
+
isDynamic: boolean;
|
|
200
|
+
/** Confidence score (0-1) for inferred dimensions */
|
|
201
|
+
confidence: number;
|
|
202
|
+
/** Source of skeleton data */
|
|
203
|
+
source: SkeletonSource;
|
|
204
|
+
}
|
|
205
|
+
/** Skeleton hint parsed from data-skeleton-* attributes */
|
|
206
|
+
export interface SkeletonHint {
|
|
207
|
+
/** Explicit shape override */
|
|
208
|
+
shape?: SkeletonShape;
|
|
209
|
+
/** Explicit width override */
|
|
210
|
+
width?: string;
|
|
211
|
+
/** Explicit height override */
|
|
212
|
+
height?: string;
|
|
213
|
+
/** Number of lines for text-block */
|
|
214
|
+
lines?: number;
|
|
215
|
+
/** Skip skeleton generation for this element */
|
|
216
|
+
ignore?: boolean;
|
|
217
|
+
}
|
|
116
218
|
/** Serialized component tree */
|
|
117
219
|
export interface SerializedComponent {
|
|
118
220
|
type: string;
|
|
119
221
|
props?: Record<string, unknown>;
|
|
120
222
|
children?: (SerializedComponent | string)[];
|
|
223
|
+
/** Skeleton metadata for zero-CLS rendering (computed at build time) */
|
|
224
|
+
_skeleton?: SkeletonMetadata;
|
|
121
225
|
}
|
|
122
226
|
/** Page session stored in Aeon */
|
|
123
227
|
export interface PageSession {
|
|
@@ -133,6 +237,38 @@ export interface PageSession {
|
|
|
133
237
|
};
|
|
134
238
|
/** Active presence info */
|
|
135
239
|
presence: PresenceInfo[];
|
|
240
|
+
/** Session version number (increments on each edit) */
|
|
241
|
+
version?: number;
|
|
242
|
+
/** Last modified timestamp */
|
|
243
|
+
updatedAt?: string;
|
|
244
|
+
/** Last modified by user/agent ID */
|
|
245
|
+
updatedBy?: string;
|
|
246
|
+
}
|
|
247
|
+
/** Webhook configuration for sync callbacks */
|
|
248
|
+
export interface WebhookConfig {
|
|
249
|
+
/** URL to call when session changes */
|
|
250
|
+
url: string;
|
|
251
|
+
/** Secret for HMAC signature verification */
|
|
252
|
+
secret?: string;
|
|
253
|
+
/** Events to trigger webhook: 'edit', 'publish', 'all' */
|
|
254
|
+
events: ('edit' | 'publish' | 'merge' | 'all')[];
|
|
255
|
+
}
|
|
256
|
+
/** Webhook payload sent to callback URLs */
|
|
257
|
+
export interface WebhookPayload {
|
|
258
|
+
/** Event type */
|
|
259
|
+
event: 'session.updated' | 'session.published' | 'session.merged' | 'github.push';
|
|
260
|
+
/** Session ID */
|
|
261
|
+
sessionId: string;
|
|
262
|
+
/** Route */
|
|
263
|
+
route: string;
|
|
264
|
+
/** Session version */
|
|
265
|
+
version: number;
|
|
266
|
+
/** Timestamp */
|
|
267
|
+
timestamp: string;
|
|
268
|
+
/** GitHub PR number (for publish/merge events) */
|
|
269
|
+
prNumber?: number;
|
|
270
|
+
/** User who triggered the event */
|
|
271
|
+
triggeredBy?: string;
|
|
136
272
|
}
|
|
137
273
|
/** Presence info for a user/agent */
|
|
138
274
|
export interface PresenceInfo {
|
|
@@ -159,3 +295,188 @@ export interface AeonCapability {
|
|
|
159
295
|
}
|
|
160
296
|
/** Alias for PresenceInfo - used by react package */
|
|
161
297
|
export type PresenceUser = PresenceInfo;
|
|
298
|
+
/** HTTP methods supported for API routes */
|
|
299
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
300
|
+
/** Cloudflare Workers environment bindings */
|
|
301
|
+
export interface AeonEnv {
|
|
302
|
+
/** Durable Object namespace for page sessions */
|
|
303
|
+
PAGE_SESSIONS?: DurableObjectNamespace;
|
|
304
|
+
/** Durable Object namespace for routes registry */
|
|
305
|
+
ROUTES_REGISTRY?: DurableObjectNamespace;
|
|
306
|
+
/** D1 Database binding */
|
|
307
|
+
DB?: D1Database;
|
|
308
|
+
/** Workers KV namespace for caching */
|
|
309
|
+
CACHE?: KVNamespace;
|
|
310
|
+
/** Workers AI binding */
|
|
311
|
+
AI?: Ai;
|
|
312
|
+
/** Environment name (development, staging, production) */
|
|
313
|
+
ENVIRONMENT?: string;
|
|
314
|
+
/** Allow additional custom bindings */
|
|
315
|
+
[key: string]: unknown;
|
|
316
|
+
}
|
|
317
|
+
/** D1 Database interface */
|
|
318
|
+
export interface D1Database {
|
|
319
|
+
prepare(query: string): D1PreparedStatement;
|
|
320
|
+
exec(query: string): Promise<D1ExecResult>;
|
|
321
|
+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
|
|
322
|
+
dump(): Promise<ArrayBuffer>;
|
|
323
|
+
}
|
|
324
|
+
export interface D1PreparedStatement {
|
|
325
|
+
bind(...values: unknown[]): D1PreparedStatement;
|
|
326
|
+
run(): Promise<D1Result>;
|
|
327
|
+
first<T = unknown>(colName?: string): Promise<T | null>;
|
|
328
|
+
all<T = unknown>(): Promise<D1Result<T>>;
|
|
329
|
+
raw<T = unknown>(): Promise<T[]>;
|
|
330
|
+
}
|
|
331
|
+
export interface D1Result<T = unknown> {
|
|
332
|
+
results?: T[];
|
|
333
|
+
success: boolean;
|
|
334
|
+
error?: string;
|
|
335
|
+
meta?: {
|
|
336
|
+
duration: number;
|
|
337
|
+
changes: number;
|
|
338
|
+
last_row_id: number;
|
|
339
|
+
served_by: string;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
export interface D1ExecResult {
|
|
343
|
+
count: number;
|
|
344
|
+
duration: number;
|
|
345
|
+
}
|
|
346
|
+
/** KV Namespace interface */
|
|
347
|
+
export interface KVNamespace {
|
|
348
|
+
get(key: string, options?: {
|
|
349
|
+
type?: 'text' | 'json' | 'arrayBuffer' | 'stream';
|
|
350
|
+
}): Promise<string | null>;
|
|
351
|
+
getWithMetadata<T = unknown>(key: string): Promise<{
|
|
352
|
+
value: string | null;
|
|
353
|
+
metadata: T | null;
|
|
354
|
+
}>;
|
|
355
|
+
put(key: string, value: string | ArrayBuffer | ReadableStream, options?: {
|
|
356
|
+
expirationTtl?: number;
|
|
357
|
+
metadata?: unknown;
|
|
358
|
+
}): Promise<void>;
|
|
359
|
+
delete(key: string): Promise<void>;
|
|
360
|
+
list(options?: {
|
|
361
|
+
prefix?: string;
|
|
362
|
+
limit?: number;
|
|
363
|
+
cursor?: string;
|
|
364
|
+
}): Promise<{
|
|
365
|
+
keys: {
|
|
366
|
+
name: string;
|
|
367
|
+
}[];
|
|
368
|
+
list_complete: boolean;
|
|
369
|
+
cursor?: string;
|
|
370
|
+
}>;
|
|
371
|
+
}
|
|
372
|
+
/** Durable Object Namespace interface */
|
|
373
|
+
export interface DurableObjectNamespace {
|
|
374
|
+
idFromName(name: string): DurableObjectId;
|
|
375
|
+
idFromString(id: string): DurableObjectId;
|
|
376
|
+
newUniqueId(): DurableObjectId;
|
|
377
|
+
get(id: DurableObjectId): DurableObjectStub;
|
|
378
|
+
}
|
|
379
|
+
export interface DurableObjectId {
|
|
380
|
+
toString(): string;
|
|
381
|
+
equals(other: DurableObjectId): boolean;
|
|
382
|
+
}
|
|
383
|
+
export interface DurableObjectStub {
|
|
384
|
+
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
385
|
+
id: DurableObjectId;
|
|
386
|
+
}
|
|
387
|
+
/** Workers AI interface */
|
|
388
|
+
export interface Ai {
|
|
389
|
+
run<T = unknown>(model: string, inputs: unknown, options?: {
|
|
390
|
+
gateway?: {
|
|
391
|
+
id: string;
|
|
392
|
+
};
|
|
393
|
+
}): Promise<T>;
|
|
394
|
+
}
|
|
395
|
+
/** Context passed to API route handlers */
|
|
396
|
+
export interface AeonContext<E extends AeonEnv = AeonEnv> {
|
|
397
|
+
/** The incoming request */
|
|
398
|
+
request: Request;
|
|
399
|
+
/** Environment bindings (D1, KV, AI, Durable Objects, etc.) */
|
|
400
|
+
env: E;
|
|
401
|
+
/** Extracted URL parameters from dynamic routes */
|
|
402
|
+
params: Record<string, string>;
|
|
403
|
+
/** The request URL parsed */
|
|
404
|
+
url: URL;
|
|
405
|
+
/** Execution context for waitUntil, etc. */
|
|
406
|
+
ctx: ExecutionContext;
|
|
407
|
+
}
|
|
408
|
+
/** Execution context for Cloudflare Workers */
|
|
409
|
+
export interface ExecutionContext {
|
|
410
|
+
waitUntil(promise: Promise<unknown>): void;
|
|
411
|
+
passThroughOnException(): void;
|
|
412
|
+
}
|
|
413
|
+
/** API route handler function */
|
|
414
|
+
export type ApiRouteHandler<E extends AeonEnv = AeonEnv> = (context: AeonContext<E>) => Response | Promise<Response>;
|
|
415
|
+
/** API route module - exports handlers for each HTTP method */
|
|
416
|
+
export interface ApiRouteModule<E extends AeonEnv = AeonEnv> {
|
|
417
|
+
GET?: ApiRouteHandler<E>;
|
|
418
|
+
POST?: ApiRouteHandler<E>;
|
|
419
|
+
PUT?: ApiRouteHandler<E>;
|
|
420
|
+
PATCH?: ApiRouteHandler<E>;
|
|
421
|
+
DELETE?: ApiRouteHandler<E>;
|
|
422
|
+
HEAD?: ApiRouteHandler<E>;
|
|
423
|
+
OPTIONS?: ApiRouteHandler<E>;
|
|
424
|
+
/** Catch-all handler for any method */
|
|
425
|
+
default?: ApiRouteHandler<E>;
|
|
426
|
+
}
|
|
427
|
+
/** Registered API route */
|
|
428
|
+
export interface ApiRoute {
|
|
429
|
+
/** Route pattern (e.g., "/api/chat", "/api/users/[id]") */
|
|
430
|
+
pattern: string;
|
|
431
|
+
/** Parsed path segments for matching */
|
|
432
|
+
segments: ApiRouteSegment[];
|
|
433
|
+
/** The route module with handlers */
|
|
434
|
+
module: ApiRouteModule;
|
|
435
|
+
}
|
|
436
|
+
/** Segment of an API route pattern */
|
|
437
|
+
export interface ApiRouteSegment {
|
|
438
|
+
/** The segment text */
|
|
439
|
+
value: string;
|
|
440
|
+
/** Is this a dynamic parameter? */
|
|
441
|
+
isDynamic: boolean;
|
|
442
|
+
/** Is this a catch-all segment? */
|
|
443
|
+
isCatchAll: boolean;
|
|
444
|
+
}
|
|
445
|
+
/** API route match result */
|
|
446
|
+
export interface ApiRouteMatch {
|
|
447
|
+
/** The matched route */
|
|
448
|
+
route: ApiRoute;
|
|
449
|
+
/** Extracted parameters */
|
|
450
|
+
params: Record<string, string>;
|
|
451
|
+
/** The handler for the request method */
|
|
452
|
+
handler: ApiRouteHandler;
|
|
453
|
+
}
|
|
454
|
+
/** Server route module - for page-level server logic */
|
|
455
|
+
export interface ServerRouteModule<E extends AeonEnv = AeonEnv> {
|
|
456
|
+
/** Called before page render - can return data or redirect */
|
|
457
|
+
loader?: (context: AeonContext<E>) => Promise<ServerLoaderResult>;
|
|
458
|
+
/** Called on form submission or POST to the page */
|
|
459
|
+
action?: (context: AeonContext<E>) => Promise<ServerActionResult>;
|
|
460
|
+
}
|
|
461
|
+
/** Result from a server loader */
|
|
462
|
+
export interface ServerLoaderResult {
|
|
463
|
+
/** Data to pass to the page */
|
|
464
|
+
data?: Record<string, unknown>;
|
|
465
|
+
/** Redirect to another URL */
|
|
466
|
+
redirect?: string;
|
|
467
|
+
/** Response status code */
|
|
468
|
+
status?: number;
|
|
469
|
+
/** Additional headers */
|
|
470
|
+
headers?: Record<string, string>;
|
|
471
|
+
}
|
|
472
|
+
/** Result from a server action */
|
|
473
|
+
export interface ServerActionResult {
|
|
474
|
+
/** Data to return */
|
|
475
|
+
data?: Record<string, unknown>;
|
|
476
|
+
/** Errors to display */
|
|
477
|
+
errors?: Record<string, string>;
|
|
478
|
+
/** Redirect after action */
|
|
479
|
+
redirect?: string;
|
|
480
|
+
/** Response status code */
|
|
481
|
+
status?: number;
|
|
482
|
+
}
|
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aeon Pages Cloudflare Worker
|
|
3
|
+
*
|
|
4
|
+
* Entry point for Cloudflare Workers deployment.
|
|
5
|
+
* Handles routing to Durable Objects, API routes, and static assets.
|
|
6
|
+
*/
|
|
7
|
+
export { AeonPageSession, AeonRoutesRegistry } from './durable-object';
|
|
8
|
+
import type { AeonEnv, ApiRouteModule, ExecutionContext } from './types';
|
|
9
|
+
/** Options for creating an Aeon worker */
|
|
10
|
+
export interface AeonWorkerOptions<E extends AeonEnv = AeonEnv> {
|
|
11
|
+
/** API routes to register */
|
|
12
|
+
apiRoutes?: Record<string, ApiRouteModule<E>>;
|
|
13
|
+
/** CORS configuration */
|
|
14
|
+
cors?: {
|
|
15
|
+
origin?: string | string[];
|
|
16
|
+
methods?: string[];
|
|
17
|
+
headers?: string[];
|
|
18
|
+
credentials?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** Custom fetch handler to run before Aeon routing */
|
|
21
|
+
onRequest?: (request: Request, env: E, ctx: ExecutionContext) => Promise<Response | null>;
|
|
22
|
+
/** Custom 404 handler */
|
|
23
|
+
notFound?: (request: Request, env: E) => Response | Promise<Response>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create an Aeon worker with API route support
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { createAeonWorker } from '@affectively/aeon-pages-runtime/worker';
|
|
31
|
+
*
|
|
32
|
+
* export default createAeonWorker({
|
|
33
|
+
* apiRoutes: {
|
|
34
|
+
* '/api/chat': {
|
|
35
|
+
* POST: async ({ request, env }) => {
|
|
36
|
+
* const body = await request.json();
|
|
37
|
+
* const result = await env.AI.run('@cf/meta/llama-3-8b-instruct', { ... });
|
|
38
|
+
* return Response.json({ result });
|
|
39
|
+
* },
|
|
40
|
+
* },
|
|
41
|
+
* '/api/users/[id]': {
|
|
42
|
+
* GET: async ({ params, env }) => {
|
|
43
|
+
* const user = await env.DB.prepare('SELECT * FROM users WHERE id = ?')
|
|
44
|
+
* .bind(params.id)
|
|
45
|
+
* .first();
|
|
46
|
+
* return Response.json(user);
|
|
47
|
+
* },
|
|
48
|
+
* },
|
|
49
|
+
* },
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function createAeonWorker<E extends AeonEnv = AeonEnv>(options?: AeonWorkerOptions<E>): ExportedHandler<E>;
|
|
54
|
+
/** Cloudflare Worker exported handler interface */
|
|
55
|
+
interface ExportedHandler<E = unknown> {
|
|
56
|
+
fetch(request: Request, env: E, ctx: ExecutionContext): Promise<Response>;
|
|
57
|
+
}
|
|
58
|
+
declare const _default: ExportedHandler<AeonEnv>;
|
|
59
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@affectively/aeon-pages-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Bun/Cloudflare runtime for @affectively/aeon-pages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,7 +23,14 @@
|
|
|
23
23
|
"build": "bun build ./src/index.ts ./src/server.ts ./src/router/index.ts --outdir ./dist --target bun && tsc --declaration --emitDeclarationOnly",
|
|
24
24
|
"dev": "bun --watch ./src/index.ts",
|
|
25
25
|
"test": "bun test",
|
|
26
|
-
"prepublishOnly": "bun run build"
|
|
26
|
+
"prepublishOnly": "bun run build",
|
|
27
|
+
"deploy": "wrangler deploy",
|
|
28
|
+
"deploy:staging": "wrangler deploy --env staging",
|
|
29
|
+
"dev:worker": "wrangler dev",
|
|
30
|
+
"db:create": "wrangler d1 create aeon-pages",
|
|
31
|
+
"db:migrate": "wrangler d1 execute aeon-pages --file=./schema.sql",
|
|
32
|
+
"db:migrate:local": "wrangler d1 execute aeon-pages --local --file=./schema.sql",
|
|
33
|
+
"tail": "wrangler tail"
|
|
27
34
|
},
|
|
28
35
|
"files": [
|
|
29
36
|
"dist",
|