@rexeus/typeweaver-hono 0.4.2 → 0.5.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.
package/README.md CHANGED
@@ -32,7 +32,8 @@ npm install @rexeus/typeweaver-core
32
32
  npx typeweaver generate --input ./api/definition --output ./api/generated --plugins hono
33
33
  ```
34
34
 
35
- More on the CLI in [@rexeus/typeweaver](https://github.com/rexeus/typeweaver/tree/main/packages/cli/README.md#️-cli).
35
+ More on the CLI in
36
+ [@rexeus/typeweaver](https://github.com/rexeus/typeweaver/tree/main/packages/cli/README.md#️-cli).
36
37
 
37
38
  ## 📂 Generated Output
38
39
 
@@ -107,21 +108,23 @@ serve({ fetch: app.fetch, port: 3000 }, () => {
107
108
 
108
109
  `TypeweaverHonoOptions<RequestHandlers>`
109
110
 
110
- - `requestHandlers`: object implementing the generated `<ResourceName>ApiHandler` interface
111
+ - `requestHandlers`: object implementing the generated `<ResourceName>ApiHandler` type
111
112
  - `validateRequests` (default: `true`): enable/disable request validation
112
- - `handleValidationErrors`: `true` | `false` | `(err, c) => IHttpResponse`,
113
+ - `handleValidationErrors`: `true` | `false` | `(err, c) => IHttpResponse | Promise<IHttpResponse>`,
113
114
  - If `true` (default), returns `400 Bad Request` with validation issues in the body
114
- - If `false`, lets the error propagate
115
+ - If `false`, disables this handler (errors fall through to the unknown error handler)
115
116
  - If function, calls the function with the error and context, expects an `IHttpResponse` to
116
117
  return, so you can customize the response in the way you want
117
- - `handleHttpResponseErrors`: `true` | `false` | `(err, c) => IHttpResponse`
118
+ - `handleHttpResponseErrors`: `true` | `false` |
119
+ `(err, c) => IHttpResponse | Promise<IHttpResponse>`
118
120
  - If `true` (default), returns thrown `HttpResponse` as-is, they will be sent as the response
119
- - If `false`, lets the error propagate, which will likely result in a `500 Internal Server Error`
121
+ - If `false`, disables this handler (errors fall through to the unknown error handler)
120
122
  - If function, calls the function with the error and context, expects an `IHttpResponse` to
121
123
  return, so you can customize the response in the way you want
122
- - `handleUnknownErrors`: `true` | `false` | `(err, c) => IHttpResponse`
124
+ - `handleUnknownErrors`: `true` | `false` | `(err, c) => IHttpResponse | Promise<IHttpResponse>`
123
125
  - If `true` (default), returns `500 Internal Server Error` with a generic message
124
- - If `false`, lets the error propagate and the Hono app can handle it (e.g., via middleware)
126
+ - If `false`, disables this handler (errors propagate to Hono's error handling, e.g. via
127
+ `app.onError`)
125
128
  - If function, calls the function with the error and context, expects an `IHttpResponse` to
126
129
  return, so you can customize the response in the way you want
127
130
 
@@ -130,4 +133,4 @@ object.
130
133
 
131
134
  ## 📄 License
132
135
 
133
- Apache 2.0 © Dennis Wentzien 2025
136
+ Apache 2.0 © Dennis Wentzien 2026
package/dist/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright 2025 Dennis Wentzien
190
+ Copyright 2026 Dennis Wentzien
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
package/dist/NOTICE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2025 Dennis Wentzien
1
+ Copyright 2026 Dennis Wentzien
2
2
 
3
3
  This project is licensed under the Apache License, Version 2.0
4
4
  See LICENSE file for details.
@@ -14,14 +14,14 @@ import { <%- operation.className %>RequestValidator } from "./<%- operation.clas
14
14
  import type { <%- operation.className %>Response } from "./<%- operation.className %>Response";
15
15
  <% } %>
16
16
 
17
- export type <%- pascalCaseEntityName %>ApiHandler = {
17
+ export type Hono<%- pascalCaseEntityName %>ApiHandler = {
18
18
  <% for (const operation of operations) { %>
19
19
  <%- operation.handlerName %>: HonoRequestHandler<I<%- operation.className %>Request, <%- operation.className %>Response>;
20
20
  <% } %>
21
21
  };
22
22
 
23
- export class <%- pascalCaseEntityName %>Hono extends TypeweaverHono<<%- pascalCaseEntityName %>ApiHandler> {
24
- public constructor(options: TypeweaverHonoOptions<<%- pascalCaseEntityName %>ApiHandler>) {
23
+ export class <%- pascalCaseEntityName %>Hono extends TypeweaverHono<Hono<%- pascalCaseEntityName %>ApiHandler> {
24
+ public constructor(options: TypeweaverHonoOptions<Hono<%- pascalCaseEntityName %>ApiHandler>) {
25
25
  super(options);
26
26
  this.setupRoutes();
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rexeus/typeweaver-hono",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "Generates Hono routers and handlers straight from your API definitions. Powered by Typeweaver 🧵✨",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -47,14 +47,14 @@
47
47
  "homepage": "https://github.com/rexeus/typeweaver#readme",
48
48
  "peerDependencies": {
49
49
  "hono": "^4.11.0",
50
- "@rexeus/typeweaver-core": "^0.4.2",
51
- "@rexeus/typeweaver-gen": "^0.4.2"
50
+ "@rexeus/typeweaver-core": "^0.5.1",
51
+ "@rexeus/typeweaver-gen": "^0.5.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "hono": "^4.11.3",
55
55
  "test-utils": "file:../test-utils",
56
- "@rexeus/typeweaver-core": "^0.4.2",
57
- "@rexeus/typeweaver-gen": "^0.4.2"
56
+ "@rexeus/typeweaver-gen": "^0.5.1",
57
+ "@rexeus/typeweaver-core": "^0.5.1"
58
58
  },
59
59
  "dependencies": {
60
60
  "case": "^1.6.3"