hoa 0.3.0 → 0.3.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## v0.3.2 / 2025-11-09
2
+
3
+ - fix: export statusTextMapping + statusRedirectMapping + statusEmptyMapping
4
+
5
+ ## v0.3.1 / 2025-11-08
6
+
7
+ - fix: app.onerror print original error
8
+
1
9
  ## v0.3.0 / 2025-10-16
2
10
 
3
11
  - feat: move respond() to ctx.response
package/dist/cjs/hoa.js CHANGED
@@ -33,11 +33,15 @@ __export(hoa_exports, {
33
33
  HoaResponse: () => import_response.default,
34
34
  HttpError: () => import_http_error.default,
35
35
  compose: () => import_compose.default,
36
- default: () => Hoa
36
+ default: () => Hoa,
37
+ statusEmptyMapping: () => import_utils.statusEmptyMapping,
38
+ statusRedirectMapping: () => import_utils.statusRedirectMapping,
39
+ statusTextMapping: () => import_utils.statusTextMapping
37
40
  });
38
41
  module.exports = __toCommonJS(hoa_exports);
39
42
  var import_compose = __toESM(require("./lib/compose.js"), 1);
40
43
  var import_http_error = __toESM(require("./lib/http-error.js"), 1);
44
+ var import_utils = require("./lib/utils.js");
41
45
  var import_context = __toESM(require("./context.js"), 1);
42
46
  var import_request = __toESM(require("./request.js"), 1);
43
47
  var import_response = __toESM(require("./response.js"), 1);
@@ -151,10 +155,7 @@ class Hoa {
151
155
  }
152
156
  if (err.status === 404 || err.expose) return;
153
157
  if (this.silent) return;
154
- const msg = err.stack || err.toString();
155
- console.error(`
156
- ${msg.replace(/^/gm, " ")}
157
- `);
158
+ console.error(err);
158
159
  }
159
160
  /**
160
161
  * ESM/CJS interop helper for default exports.
@@ -184,5 +185,8 @@ ${msg.replace(/^/gm, " ")}
184
185
  HoaRequest,
185
186
  HoaResponse,
186
187
  HttpError,
187
- compose
188
+ compose,
189
+ statusEmptyMapping,
190
+ statusRedirectMapping,
191
+ statusTextMapping
188
192
  });
package/dist/esm/hoa.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import compose from "./lib/compose.js";
2
2
  import HttpError from "./lib/http-error.js";
3
+ import { statusTextMapping, statusRedirectMapping, statusEmptyMapping } from "./lib/utils.js";
3
4
  import HoaContext from "./context.js";
4
5
  import HoaRequest from "./request.js";
5
6
  import HoaResponse from "./response.js";
@@ -113,10 +114,7 @@ class Hoa {
113
114
  }
114
115
  if (err.status === 404 || err.expose) return;
115
116
  if (this.silent) return;
116
- const msg = err.stack || err.toString();
117
- console.error(`
118
- ${msg.replace(/^/gm, " ")}
119
- `);
117
+ console.error(err);
120
118
  }
121
119
  /**
122
120
  * ESM/CJS interop helper for default exports.
@@ -146,5 +144,8 @@ export {
146
144
  HoaResponse,
147
145
  HttpError,
148
146
  compose,
149
- Hoa as default
147
+ Hoa as default,
148
+ statusEmptyMapping,
149
+ statusRedirectMapping,
150
+ statusTextMapping
150
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hoa",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "A minimal web framework built on Web Standards",
5
5
  "main": "./dist/cjs/hoa.js",
6
6
  "type": "module",
@@ -50,8 +50,8 @@
50
50
  "devDependencies": {
51
51
  "@commitlint/cli": "20.1.0",
52
52
  "@commitlint/config-conventional": "20.0.0",
53
- "eslint": "9.37.0",
54
- "globals": "16.4.0",
53
+ "eslint": "9.39.1",
54
+ "globals": "16.5.0",
55
55
  "husky": "9.1.7",
56
56
  "jest": "30.2.0",
57
57
  "neostandard": "0.12.2",