hoa 0.1.1 → 0.1.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,8 @@
1
+ ## v0.1.2 / 2025-10-09
2
+
3
+ - fix: change default status code from 200 to 404
4
+ - fix: add missing `silent` property to TypeScript declarations
5
+
1
6
  ## v0.1.1 / 2025-10-08
2
7
 
3
8
  - fix: console is removed due to tsup configuration errors
@@ -207,9 +207,6 @@ function respond(ctx) {
207
207
  res.delete("Transfer-Encoding");
208
208
  res.set("Content-Length", "0");
209
209
  }
210
- if (!res._explicitStatus) {
211
- res.status = 404;
212
- }
213
210
  return new Response(null, {
214
211
  status: res.status,
215
212
  statusText: res.statusText,
@@ -147,13 +147,13 @@ class HoaResponse {
147
147
  }
148
148
  /**
149
149
  * Get the response status code.
150
- * Defaults to 200 if not explicitly set.
150
+ * Defaults to 404 if not explicitly set.
151
151
  *
152
152
  * @returns {number} The HTTP status code
153
153
  * @public
154
154
  */
155
155
  get status() {
156
- return this._status || 200;
156
+ return this._status || 404;
157
157
  }
158
158
  /**
159
159
  * Set the response status code.
@@ -169,9 +169,6 @@ function respond(ctx) {
169
169
  res.delete("Transfer-Encoding");
170
170
  res.set("Content-Length", "0");
171
171
  }
172
- if (!res._explicitStatus) {
173
- res.status = 404;
174
- }
175
172
  return new Response(null, {
176
173
  status: res.status,
177
174
  statusText: res.statusText,
@@ -125,13 +125,13 @@ class HoaResponse {
125
125
  }
126
126
  /**
127
127
  * Get the response status code.
128
- * Defaults to 200 if not explicitly set.
128
+ * Defaults to 404 if not explicitly set.
129
129
  *
130
130
  * @returns {number} The HTTP status code
131
131
  * @public
132
132
  */
133
133
  get status() {
134
- return this._status || 200;
134
+ return this._status || 404;
135
135
  }
136
136
  /**
137
137
  * Set the response status code.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hoa",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A minimal web framework built on Web Standards",
5
5
  "main": "./dist/cjs/application.js",
6
6
  "type": "module",
package/types/index.d.ts CHANGED
@@ -194,6 +194,7 @@ export declare class Application {
194
194
  constructor(options?: ApplicationOptions);
195
195
 
196
196
  name: string;
197
+ silent?: boolean;
197
198
  readonly HoaContext: typeof HoaContext;
198
199
  readonly HoaRequest: typeof HoaRequest;
199
200
  readonly HoaResponse: typeof HoaResponse;