CodeVetter · Repo Unpack · System map
elysiajs/elysia
The public Elysia class owns application configuration, routes, schemas, hooks and shared state. Execution divides between generated AOT handlers and a dynamic handler, with adapters supplying serving and response behavior. Storage in the inspected framework core consists of application memory and HTTP cookies. Packaging and CI target multiple module formats and runtime integrations.
- Elysia's generic parameters track base paths, singleton context, definitions, metadata, routes and scoped/local additions; runtime fields hold corresponding stores and registries.
- The constructor defaults AOT from ELYSIA_AOT, enables normalization, schema encoding and native static responses, and selects BunAdapter when Bun exists unless an adapter is supplied.
- Routing separates static path tables, native response tables, route history and lazy Memoirist HTTP/dynamic routers; parameter decoding uses fastDecodeURIComponent.
- The fetch getter installs either composeGeneralHandler or createDynamicHandler; compile also invokes adapter.beforeCompile, while listen delegates to the adapter.
- BunAdapter owns Bun.serve and WebSocket integration; WebStandardAdapter rejects listen, and CloudflareAdapter extends it with eager route and error-handler compilation.
- Validation integrates TypeBox and Standard Schema; normalization can use exact-mirror with a cleaner fallback, and the manifest declares cookie, URI decoding and Memoirist dependencies.
- Application state resides in singleton.store; request contexts reference that object, while cookie changes become HTTP headers rather than framework database writes in this inspected path.
- build.ts emits unbundled ESM/CJS files targeting Node 20 and generates declarations; package exports expose both formats, CI builds and tests, and release-published events trigger npm provenance publishing.