@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 +10 -8
- package/dist/LICENSE +1 -1
- package/dist/NOTICE +1 -1
- package/dist/templates/HonoRouter.ejs +3 -3
- package/package.json +5 -5
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`
|
|
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`,
|
|
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` |
|
|
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`,
|
|
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`,
|
|
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
|
|
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
|
|
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
|
@@ -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
|
|
24
|
-
public constructor(options: TypeweaverHonoOptions
|
|
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.
|
|
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.
|
|
51
|
-
"@rexeus/typeweaver-gen": "^0.5.
|
|
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-
|
|
57
|
-
"@rexeus/typeweaver-
|
|
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"
|