express-sweet 5.0.0 → 5.1.0

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
@@ -2,6 +2,17 @@
2
2
 
3
3
  Every release that matters, documented here.
4
4
 
5
+ ## [5.1.0] - 2026-08-18
6
+
7
+ ### Added
8
+
9
+ - **`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).
10
+
11
+ ### Changed
12
+
13
+ - **`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.
14
+ - **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.
15
+
5
16
  ## [5.0.0] - 2026-03-13
6
17
 
7
18
  The biggest release yet. Cleaner API surface, proper documentation, and a leaner dependency tree.
@@ -529,3 +540,4 @@ Initial release. Express.js extension library with Sequelize ORM, Passport.js au
529
540
  [3.0.2]: https://github.com/shumatsumonobu/express-sweet/compare/v3.0.1...v3.0.2
530
541
  [4.0.0]: https://github.com/shumatsumonobu/express-sweet/compare/v3.0.2...v4.0.0
531
542
  [5.0.0]: https://github.com/shumatsumonobu/express-sweet/compare/v4.0.0...v5.0.0
543
+ [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. Three commands and you're running.
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