@kanjijs/platform-hono 0.2.0-beta.1

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.
Files changed (3) hide show
  1. package/README.md +29 -0
  2. package/dist/index.js +3336 -0
  3. package/package.json +22 -0
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @kanjijs/platform-hono
2
+
3
+ The default HTTP adapter for [Kanjijs Framework](https://github.com/kanjijs-framework), utilizing [Hono](https://hono.dev/) for high-performance routing.
4
+
5
+ ## Usage
6
+
7
+ ```typescript
8
+ import { KanjijsAdapter } from "@kanjijs/platform-hono";
9
+ import { AppModule } from "./app.module";
10
+
11
+ // Create Hono app from Root Module
12
+ const app = KanjijsAdapter.create(AppModule);
13
+
14
+ // Serve with Bun
15
+ export default {
16
+ port: 3000,
17
+ fetch: app.fetch
18
+ }
19
+ ```
20
+
21
+ ## Features
22
+
23
+ - **KanjijsAdapter**: Recursively scans your Module tree to register controllers.
24
+ - **Middleware Support**: Seamless integration with native Hono middlewares via `@Use` and Global Middleware injection.
25
+ - **Validation Middleware**: Automatically enforces Zod contracts on Requests (Headers, Path, Query, Body).
26
+ - **Dependency Injection**: Built-in `KanjijsIoC` container resolution for Controllers.
27
+ - **Request Context**: Automatically generates `x-request-id` header and initializes context for `@kanjijs/logger`.
28
+ - **Global Exception Filters**: Automatically catches all errors (404, 500, Zod) and transforms them into a standard JSON response (`{ statusCode, message, error }`).
29
+ - **Security Headers**: Integrated support for Helmet and Throttler headers.