@rexeus/typeweaver-hono 0.5.0 → 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
@@ -108,21 +108,23 @@ serve({ fetch: app.fetch, port: 3000 }, () => {
108
108
 
109
109
  `TypeweaverHonoOptions<RequestHandlers>`
110
110
 
111
- - `requestHandlers`: object implementing the generated `<ResourceName>ApiHandler` interface
111
+ - `requestHandlers`: object implementing the generated `<ResourceName>ApiHandler` type
112
112
  - `validateRequests` (default: `true`): enable/disable request validation
113
- - `handleValidationErrors`: `true` | `false` | `(err, c) => IHttpResponse`,
113
+ - `handleValidationErrors`: `true` | `false` | `(err, c) => IHttpResponse | Promise<IHttpResponse>`,
114
114
  - If `true` (default), returns `400 Bad Request` with validation issues in the body
115
- - If `false`, lets the error propagate
115
+ - If `false`, disables this handler (errors fall through to the unknown error handler)
116
116
  - If function, calls the function with the error and context, expects an `IHttpResponse` to
117
117
  return, so you can customize the response in the way you want
118
- - `handleHttpResponseErrors`: `true` | `false` | `(err, c) => IHttpResponse`
118
+ - `handleHttpResponseErrors`: `true` | `false` |
119
+ `(err, c) => IHttpResponse | Promise<IHttpResponse>`
119
120
  - If `true` (default), returns thrown `HttpResponse` as-is, they will be sent as the response
120
- - 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)
121
122
  - If function, calls the function with the error and context, expects an `IHttpResponse` to
122
123
  return, so you can customize the response in the way you want
123
- - `handleUnknownErrors`: `true` | `false` | `(err, c) => IHttpResponse`
124
+ - `handleUnknownErrors`: `true` | `false` | `(err, c) => IHttpResponse | Promise<IHttpResponse>`
124
125
  - If `true` (default), returns `500 Internal Server Error` with a generic message
125
- - 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`)
126
128
  - If function, calls the function with the error and context, expects an `IHttpResponse` to
127
129
  return, so you can customize the response in the way you want
128
130
 
@@ -131,4 +133,4 @@ object.
131
133
 
132
134
  ## 📄 License
133
135
 
134
- 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.5.0",
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.5.0",
51
- "@rexeus/typeweaver-gen": "^0.5.0"
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.5.0",
57
- "@rexeus/typeweaver-gen": "^0.5.0"
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"