@supacloud/elysia 0.38.1 → 0.39.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/README.md CHANGED
@@ -8,6 +8,46 @@ is a separately authorized business command, never an assumed rollback.
8
8
 
9
9
  ## Compatibility and Acceptance Boundary
10
10
 
11
+ ### Static route registration migration
12
+
13
+ HTTP modules now require compiler-emitted `registerRoutes(register)` calls.
14
+ The adapter has no descriptor-array registration fallback. A module with routes
15
+ and a missing or non-callable plan fails at startup with
16
+ `COMPILED_ROUTE_REGISTRATION_REQUIRED`. Modules containing only providers,
17
+ commands or jobs may omit this HTTP-only plan.
18
+
19
+ Upgrade `@supacloud/compiler` and `@supacloud/elysia` together using a matched
20
+ release, then regenerate application artifacts with the installed compiler:
21
+
22
+ ```sh
23
+ bun run supacloud-compiler compile
24
+ bun run supacloud-compiler check --json
25
+ ```
26
+
27
+ Commit the regenerated `application.ts` and manifests together with the lockfile,
28
+ rebuild the application bundle, and exercise its affected HTTP entry points.
29
+ Do not patch generated files by hand or deploy a new adapter with an old bundle.
30
+ For rollback, restore the compiler, adapter, lockfile and compiled bundle as one
31
+ tested release. The package version numbers need not be identical.
32
+
33
+ Hand-authored test fixtures and custom integrations must register each route
34
+ explicitly, with its full path. Preserve descriptor identities and order:
35
+
36
+ ```ts
37
+ registerRoutes(register) {
38
+ register(this.controllers[0]!, this.controllers[0]!.routes[0]!, '/orders')
39
+ register(this.controllers[0]!, this.controllers[0]!.routes[1]!, '/orders/:id')
40
+ }
41
+ ```
42
+
43
+ The callback runs during plugin construction. The compiler emits full paths and
44
+ individual registrations; schema validation, HTTP policies, command governance,
45
+ scope cleanup and error handling stay in the adapter. Startup validation still
46
+ inspects descriptors. This is not a claim of zero overhead or a measured speedup.
47
+ The manifest describes static declarations; host options can add lifecycle hooks
48
+ or select the request pipeline. Native Elysia macros supplied by the host are
49
+ not inferred from application declarations.
50
+
11
51
  The Elysia peer and development dependency are pinned to `2.0.0-rc.1`.
12
52
  The runtime adapter pins Effect `4.0.5` and consumes its `Exit`-based
13
53
  execution boundary.
@@ -0,0 +1,18 @@
1
+ import { Elysia } from "elysia";
2
+ import type { AnyElysia } from "elysia";
3
+ import { type ApplicationOptions } from "./index";
4
+ export interface BunAotApplication {
5
+ readonly app: AnyElysia;
6
+ readonly fetch: (request: Request) => Response | Promise<Response>;
7
+ readonly start: (options: BunAotServeOptions) => BunAotServer;
8
+ readonly destroy: () => Promise<void>;
9
+ }
10
+ export interface BunAotServeOptions {
11
+ hostname?: string;
12
+ port: number;
13
+ }
14
+ export interface BunAotServer {
15
+ readonly url: string;
16
+ stop(closeActiveConnections?: boolean): Promise<void>;
17
+ }
18
+ export declare function createBunAotApplication<const Http extends AnyElysia = Elysia, RequestContext = unknown>(options: ApplicationOptions<Http, RequestContext>): BunAotApplication;