kempo-server 2.0.0 → 2.0.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +296 -0
  2. package/package.json +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,296 @@
1
+ # Changelog
2
+
3
+ All notable changes to `kempo-server` are documented in this file.
4
+
5
+ ## [2.0.0] - 2026-04-04
6
+
7
+ ### Breaking Changes
8
+
9
+ - **`request.body` is now a pre-parsed value instead of a function.** Previously, `request.body()` was an async function that returned the raw body string. Now `request.body` is a property that contains the parsed body (JSON object, form data object, or raw string depending on `Content-Type`).
10
+
11
+ **Migration:**
12
+ ```javascript
13
+ // Before (1.x)
14
+ const raw = await request.body();
15
+ const data = JSON.parse(raw);
16
+
17
+ // After (2.0)
18
+ const data = request.body; // already parsed based on Content-Type
19
+ ```
20
+
21
+ If you need the raw body string, use `await request.text()` or access `request._rawBody`.
22
+
23
+ ### Added
24
+
25
+ - `maxBodySize` config option (default: 1MB). Requests exceeding this limit receive a `413 Payload Too Large` response.
26
+ - Request body is now buffered once at the start of the request lifecycle, making it available to both middleware and route handlers without double-consumption issues.
27
+
28
+ ### Fixed
29
+
30
+ - Rescan double-wrap bug where the rescan path was incorrectly wrapping requests.
31
+
32
+ ---
33
+
34
+ ## [1.10.7] - 2026-03-21
35
+
36
+ ### Added
37
+
38
+ - `llm.txt` file for LLM-friendly project documentation.
39
+
40
+ ---
41
+
42
+ ## [1.10.6] - 2026-03-12
43
+
44
+ ### Added
45
+
46
+ - SPA (Single Page Application) example and documentation.
47
+
48
+ ### Changed
49
+
50
+ - Updated CI workflows.
51
+ - Renamed `AGENTS.md` and updated testing framework.
52
+
53
+ ---
54
+
55
+ ## [1.10.3] - 2026-01-15
56
+
57
+ ### Fixed
58
+
59
+ - Missing `cookies` property in the request wrapper. Cookie parsing now works correctly on all requests.
60
+
61
+ ---
62
+
63
+ ## [1.10.2] - 2026-01-14
64
+
65
+ ### Fixed
66
+
67
+ - Middleware path resolution now correctly resolves relative middleware paths.
68
+ - Request and response wrappers are now properly passed through the middleware pipeline and into route handlers.
69
+
70
+ ---
71
+
72
+ ## [1.10.0] - 2026-01-08
73
+
74
+ ### Breaking Changes
75
+
76
+ - **The `--rescan` CLI flag has been removed.** Rescanning is now controlled entirely by the `maxRescanAttempts` config option.
77
+
78
+ **Migration:**
79
+ ```bash
80
+ # Before (1.9.x)
81
+ kempo-server --rescan
82
+
83
+ # After (1.10.0)
84
+ # Set in your config file:
85
+ # { "maxRescanAttempts": 3 }
86
+ # No CLI flag needed — rescanning is automatic based on config.
87
+ ```
88
+
89
+ ### Fixed
90
+
91
+ - `noRescanPaths` now correctly excludes well-known paths.
92
+ - `maxRescanAttempts` config now applies correctly.
93
+ - Various workflow and build fixes.
94
+
95
+ ---
96
+
97
+ ## [1.9.4] - 2026-01-07
98
+
99
+ ### Security
100
+
101
+ - Default config now blocks `package.json` from being served, preventing exposure of dependency and project metadata.
102
+
103
+ **Action:** If you need to serve `package.json`, explicitly add it to your allowed paths.
104
+
105
+ ---
106
+
107
+ ## [1.9.2] - 2025-12-06
108
+
109
+ ### Changed
110
+
111
+ - Removed the word "password" from the default banned regex pattern. This was causing false positives on legitimate routes/files containing the word "password" (e.g., password reset pages).
112
+
113
+ **Action:** If you relied on the default regex to block paths containing "password", add a custom rule to your config.
114
+
115
+ ---
116
+
117
+ ## [1.9.0] - 2025-10-25
118
+
119
+ ### Added
120
+
121
+ - CLI utilities now support equals-separated values (e.g., `--port=3000`) and automatic boolean conversion.
122
+ - HTML documentation for CLI and file system utilities.
123
+
124
+ ### Fixed
125
+
126
+ - Documentation markup fixes.
127
+
128
+ ---
129
+
130
+ ## [1.8.3] - 2025-10-24
131
+
132
+ ### Added
133
+
134
+ - `encoding` response header is now automatically set on served files.
135
+
136
+ ---
137
+
138
+ ## [1.8.1] - 2025-10-24
139
+
140
+ ### Added
141
+
142
+ - Config fallback system: user configs now merge with defaults so missing properties don't cause errors.
143
+
144
+ ---
145
+
146
+ ## [1.8.0] - 2025-10-24
147
+
148
+ ### Added
149
+
150
+ - `encoding` config option to control the character encoding of served files (default: `utf-8`).
151
+
152
+ **Action:** If you were manually setting encoding headers in middleware, you can now use the config option instead.
153
+
154
+ ---
155
+
156
+ ## [1.7.13] - 2025-10-14
157
+
158
+ ### Fixed
159
+
160
+ - Paths ending in `/` now correctly resolve to `index.html` (or the configured directory index).
161
+
162
+ ---
163
+
164
+ ## [1.7.8] - 2025-09-19
165
+
166
+ ### Fixed
167
+
168
+ - Malformed URL parameters no longer crash the server. Invalid query strings are now handled gracefully.
169
+
170
+ ---
171
+
172
+ ## [1.7.5] - 2025-09-02
173
+
174
+ ### Changed
175
+
176
+ - Internal: refactored unit tests to use a static `test-server-root` directory instead of temporary files.
177
+ - Cleaned up documentation and examples.
178
+
179
+ ---
180
+
181
+ ## [1.7.3] - 2025-08-28
182
+
183
+ ### Fixed
184
+
185
+ - Wildcard bug in `customRoutes` matching where `**` patterns were not resolving correctly.
186
+
187
+ ---
188
+
189
+ ## [1.7.2] - 2025-08-28
190
+
191
+ ### Added
192
+
193
+ - Config file path validation: relative paths in the config are now validated to stay within the server root directory. Absolute paths are still allowed.
194
+
195
+ ### Fixed
196
+
197
+ - Custom route path resolution improved to handle edge cases.
198
+
199
+ ---
200
+
201
+ ## [1.7.1] - 2025-08-28
202
+
203
+ ### Fixed
204
+
205
+ - Static files no longer take precedence over `customRoutes` config entries. Custom routes now correctly override static file matches.
206
+
207
+ **Action:** If you relied on static files shadowing custom routes, be aware that custom routes now take priority.
208
+
209
+ ---
210
+
211
+ ## [1.7.0] - 2025-08-28
212
+
213
+ ### Added
214
+
215
+ - **Module caching** for the file router. Dynamically imported route modules are now cached, significantly improving performance for repeated requests.
216
+ - Cache can be configured via the `cache` config section (`enabled`, `maxSize`).
217
+
218
+ ---
219
+
220
+ ## [1.6.0] - 2025-08-28
221
+
222
+ ### Added
223
+
224
+ - **`**` (double asterisk) wildcard support** in custom routes. Matches any number of path segments.
225
+
226
+ ```json
227
+ {
228
+ "customRoutes": {
229
+ "/docs/**": "./docs-handler.js"
230
+ }
231
+ }
232
+ ```
233
+
234
+ **Action:** If you have custom routes with literal `**` in the path, they will now be interpreted as wildcards.
235
+
236
+ ---
237
+
238
+ ## [1.5.1] - 2025-08-28
239
+
240
+ ### Changed
241
+
242
+ - Restructured repository to use `src/` and `dist/` directories.
243
+ - Docs now use `kempo.min.css` instead of `essential.css`.
244
+
245
+ ### Added
246
+
247
+ - Node.js utility modules (`cli.js`, `fs-utils.js`).
248
+
249
+ **Action:** If you were importing internal modules directly, paths have changed from root to `dist/`.
250
+
251
+ ---
252
+
253
+ ## [1.4.7] - 2025-08-26
254
+
255
+ ### Added
256
+
257
+ - **`--config` CLI flag** to specify a custom config file path.
258
+
259
+ ```bash
260
+ kempo-server --config ./my-config.json
261
+ ```
262
+
263
+ ---
264
+
265
+ ## [1.4.6] - 2025-08-22
266
+
267
+ ### Added
268
+
269
+ - GitHub Actions workflow for automated publishing to NPM.
270
+
271
+ ---
272
+
273
+ ## [1.4.5] - 2025-08-19
274
+
275
+ ### Added
276
+
277
+ - Comprehensive unit test suite.
278
+
279
+ ---
280
+
281
+ ## [1.0.0] - 2025-07-09
282
+
283
+ ### Initial Release
284
+
285
+ - File-based routing server with zero dependencies.
286
+ - Dynamic route parameters via `[param]` directory/file naming.
287
+ - HTTP method-based route handlers (`GET.js`, `POST.js`, etc.).
288
+ - Request wrapper with Express-like API (`request.query`, `request.params`, `request.body()`, `request.json()`).
289
+ - Response wrapper with convenience methods (`response.json()`, `response.send()`, `response.status()`).
290
+ - Wildcard (`*`) support in custom routes.
291
+ - MIME type detection and configurable overrides.
292
+ - Security defaults: blocked dotfiles, `node_modules`, and sensitive path patterns.
293
+ - Static file serving.
294
+ - Configurable via `.config.json`.
295
+ - Middleware support.
296
+ - CLI interface with `--root`, `--port`, `--verbose` flags.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kempo-server",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "A lightweight, zero-dependency, file based routing server.",
6
6
  "exports": {
7
7
  "./utils/cli": "./dist/utils/cli.js",