express-sweet 5.0.0 → 5.1.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/CHANGELOG.md +52 -0
- package/README.md +3 -3
- package/dist/build.cjs +19 -19
- package/dist/build.mjs +19 -19
- package/package.json +7 -7
- package/screenshots/mount-flow.mmd +1 -1
- package/screenshots/mount-flow.png +0 -0
- package/types/middleware/env.d.ts +17 -1
- package/types/mount.d.ts +1 -1
- package/types/types/AppConfig.d.ts +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
Every release that matters, documented here.
|
|
4
4
|
|
|
5
|
+
## [5.1.1] - 2026-11-18
|
|
6
|
+
|
|
7
|
+
Security release. No API changes, no config changes — just update.
|
|
8
|
+
|
|
9
|
+
### Security
|
|
10
|
+
|
|
11
|
+
Dependencies with known vulnerabilities have been updated. Most of them are bundled into `dist/`, so the fixes ship inside Express Sweet itself, not only through your lockfile.
|
|
12
|
+
|
|
13
|
+
**Direct dependencies** — the version ranges in `package.json` were raised.
|
|
14
|
+
|
|
15
|
+
| Package | Before | After | Severity | What was fixed |
|
|
16
|
+
|---------|--------|-------|----------|----------------|
|
|
17
|
+
| express | 5.2.1 | 5.3.0 | — | Pulls in the fixed proxy-addr, qs and body-parser below |
|
|
18
|
+
| express-handlebars | 8.0.7 | 9.0.6 | — | Pulls in the fixed glob and handlebars below |
|
|
19
|
+
| glob | 13.0.6 | 14.0.6 | Moderate | Aborted async walks kept reading directories in the background ([GHSA-3g3m-2fjr-6pw4](https://github.com/advisories/GHSA-3g3m-2fjr-6pw4)) |
|
|
20
|
+
| multer | 2.2.0 | 2.5.0 | High | Five denial-of-service issues in multipart parsing and aborted uploads, plus a file size limit bypass ([GHSA-wc9g-mqfw-jrwm](https://github.com/advisories/GHSA-wc9g-mqfw-jrwm) and others) |
|
|
21
|
+
| morgan | 1.11.0 | 1.12.1 | Moderate | Log forging and log injection via unescaped characters ([GHSA-jxfw-x594-9x9m](https://github.com/advisories/GHSA-jxfw-x594-9x9m), [GHSA-9f6g-j8ch-79g4](https://github.com/advisories/GHSA-9f6g-j8ch-79g4)) |
|
|
22
|
+
| moment | 2.30.1 | 2.31.0 | Moderate | Path traversal via a crafted locale name ([GHSA-4p3w-j4w9-5jqw](https://github.com/advisories/GHSA-4p3w-j4w9-5jqw)) |
|
|
23
|
+
|
|
24
|
+
**Indirect dependencies** — updated through the packages above.
|
|
25
|
+
|
|
26
|
+
| Package | Before | After | Severity | What was fixed |
|
|
27
|
+
|---------|--------|-------|----------|----------------|
|
|
28
|
+
| handlebars | 4.7.9 | 4.7.10 | Critical | JavaScript injection in template compilation ([GHSA-8r5x-fm3f-whwj](https://github.com/advisories/GHSA-8r5x-fm3f-whwj), [GHSA-p8wg-vrv2-v86f](https://github.com/advisories/GHSA-p8wg-vrv2-v86f), [GHSA-xw65-4hp5-5hc7](https://github.com/advisories/GHSA-xw65-4hp5-5hc7)) |
|
|
29
|
+
| proxy-addr | 2.0.7 | 2.0.8 | Critical | IP spoofing via IPv4-mapped IPv6 addresses when `trust proxy` uses subnets ([GHSA-jqcg-44mw-7w3h](https://github.com/advisories/GHSA-jqcg-44mw-7w3h)) |
|
|
30
|
+
| body-parser | 2.3.0 | 2.4.0 | High | Denial of service via trailing bytes after a compressed body ([GHSA-27r3-jxmh-p828](https://github.com/advisories/GHSA-27r3-jxmh-p828)) |
|
|
31
|
+
| qs | 6.15.3 | 6.17.1 | Moderate | Array limit bypass and two denial-of-service issues ([GHSA-x5fp-wj9c-mxmx](https://github.com/advisories/GHSA-x5fp-wj9c-mxmx) and others) |
|
|
32
|
+
| minimatch | 10.2.6 | 11.0.9 | Moderate | Denial of service via pattern amplification ([GHSA-g3hv-75wg-m249](https://github.com/advisories/GHSA-g3hv-75wg-m249)) |
|
|
33
|
+
| brace-expansion | 5.0.9 | 5.0.13 | High | Three CPU and stack exhaustion issues ([GHSA-q2hr-2g5m-vwhr](https://github.com/advisories/GHSA-q2hr-2g5m-vwhr) and others) |
|
|
34
|
+
|
|
35
|
+
**Not fixed yet**
|
|
36
|
+
|
|
37
|
+
- **uuid 8.3.2** (Moderate, [GHSA-w5hq-g745-h8pq](https://github.com/advisories/GHSA-w5hq-g745-h8pq)) — Comes from Sequelize 6, which pins `uuid@^8`. Sequelize is installed by your app, not bundled, so this can only be fixed upstream.
|
|
38
|
+
|
|
39
|
+
### Node.js 18
|
|
40
|
+
|
|
41
|
+
Still supported. The ESM and CommonJS demos were run on Node.js 18.20.8 against this build: sign-in, every page, the 404 page and file uploads all work.
|
|
42
|
+
|
|
43
|
+
On Node.js 18, `npm install` now prints `EBADENGINE` warnings, because express-handlebars 9 declares Node.js 22.23.5+ and minimatch, brace-expansion and lru-cache declare Node.js 20+. They are warnings only and the install succeeds — unless your project sets `engine-strict=true`, in which case npm stops with an error.
|
|
44
|
+
|
|
45
|
+
## [5.1.0] - 2026-08-18
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- **`hook_after_env_load` config hook** — Run your own code right after environment variables are loaded and before database models are initialized. Useful for decrypting secrets, pulling values from a secret manager, or validating required variables — anything written to `process.env` there is visible to `config/database.js` and every model. Sync or async; throwing aborts `mount()`. The hook runs even when `env_path` is unset, so `.env` is not required. See [docs/configuration.md](docs/configuration.md).
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- **`global.loadedEnv` now means "the environment step finished"** — It used to be set only when an `.env` file was actually parsed, so it stayed `false` forever when `env_path` was unset. It is now set once the environment step completes either way. Only affects apps that read the flag directly; the library itself uses it solely as a re-entry guard.
|
|
54
|
+
- **Dependencies updated** — 82 patch and minor bumps across the tree, Rollup, Terser, express-handlebars, multer, morgan and redis among them. No API changes, nothing removed.
|
|
55
|
+
|
|
5
56
|
## [5.0.0] - 2026-03-13
|
|
6
57
|
|
|
7
58
|
The biggest release yet. Cleaner API surface, proper documentation, and a leaner dependency tree.
|
|
@@ -529,3 +580,4 @@ Initial release. Express.js extension library with Sequelize ORM, Passport.js au
|
|
|
529
580
|
[3.0.2]: https://github.com/shumatsumonobu/express-sweet/compare/v3.0.1...v3.0.2
|
|
530
581
|
[4.0.0]: https://github.com/shumatsumonobu/express-sweet/compare/v3.0.2...v4.0.0
|
|
531
582
|
[5.0.0]: https://github.com/shumatsumonobu/express-sweet/compare/v4.0.0...v5.0.0
|
|
583
|
+
[5.1.0]: https://github.com/shumatsumonobu/express-sweet/compare/v5.0.0...v5.1.0
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ That's it. Four lines of real code and you have a fully configured web applicati
|
|
|
34
34
|
- **Handlebars views** — Pre-configured template engine with 37 built-in helpers
|
|
35
35
|
- **File uploads** — Multer integration with per-route upload resolution
|
|
36
36
|
- **CORS** — Toggle with a single config flag
|
|
37
|
-
- **Environment variables** — Automatic `.env` loading
|
|
37
|
+
- **Environment variables** — Automatic `.env` loading, plus a post-load hook for decrypting secrets or validating required values
|
|
38
38
|
- **Dual format** — Ships as both ESM and CommonJS
|
|
39
39
|
|
|
40
40
|
## Screenshots
|
|
@@ -131,7 +131,7 @@ Six config files control the framework. All are optional — Express Sweet uses
|
|
|
131
131
|
|
|
132
132
|
| File | Purpose | Key Options |
|
|
133
133
|
|------|---------|-------------|
|
|
134
|
-
| `config.js` | App basics | `cors_enabled`, `max_body_size`, `router_dir`, `default_router`, `hook_handle_error` |
|
|
134
|
+
| `config.js` | App basics | `cors_enabled`, `max_body_size`, `router_dir`, `default_router`, `hook_after_env_load`, `hook_handle_error` |
|
|
135
135
|
| `database.js` | DB connection | `database`, `username`, `password`, `host`, `dialect`, `pool` |
|
|
136
136
|
| `authentication.js` | Auth settings | `enabled`, `session_store`, `authenticate_user`, `allow_unauthenticated` |
|
|
137
137
|
| `view.js` | View engine | `views_dir`, `partials_dir`, `default_layout`, `beforeRender` |
|
|
@@ -322,7 +322,7 @@ Full reference (disk storage, multiple files, file filtering) → [docs/file-upl
|
|
|
322
322
|
|
|
323
323
|
## Demo
|
|
324
324
|
|
|
325
|
-
A full-featured demo app is included in [demo/](demo/) — auth, CRUD, file uploads, error pages, all wired up. Both ESM and CommonJS versions.
|
|
325
|
+
A full-featured demo app is included in [demo/](demo/) — auth, CRUD, file uploads, error pages, all wired up. Both ESM and CommonJS versions. It runs against the build in this repository: `docker compose run --rm build`, then `cd demo/esm && docker compose up`. See [demo/README.md](demo/README.md) for what it covers and [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup.
|
|
326
326
|
|
|
327
327
|
## Migration from v4
|
|
328
328
|
|