express-sweet-generator 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,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [5.1.0] - 2026-08-18
6
+
7
+ ### Added
8
+
9
+ - **`hook_after_env_load` in the config template** — `config/config.js` ships with a commented example of the hook added in express-sweet 5.1.0, which runs after `.env` is loaded and before the database models are initialized. Uncomment it to decode a password, or fetch one from a secret manager, without putting the plain value in `.env`.
10
+
11
+ ### Changed
12
+
13
+ - **express-sweet v5.1** — Generated apps now depend on `express-sweet@^5.1.0`.
14
+
5
15
  ## [5.0.0] - 2026-03-13
6
16
 
7
17
  ### Breaking Changes
@@ -389,3 +399,4 @@ New projects get the new database architecture automatically. For existing proje
389
399
  [3.0.1]: https://github.com/shumatsumonobu/express-sweet-generator/compare/v3.0.0...v3.0.1
390
400
  [4.0.0]: https://github.com/shumatsumonobu/express-sweet-generator/compare/v3.0.1...v4.0.0
391
401
  [5.0.0]: https://github.com/shumatsumonobu/express-sweet-generator/compare/v4.0.0...v5.0.0
402
+ [5.1.0]: https://github.com/shumatsumonobu/express-sweet-generator/compare/v5.0.0...v5.1.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-sweet-generator",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "One command, zero boilerplate. Instantly scaffold a full-stack Express Sweet app — authentication, ORM, routing, views, and a Webpack-powered frontend — all wired up and ready to ship.",
5
5
  "main": "bin/express-sweet-cli.js",
6
6
  "files": [
@@ -7,6 +7,14 @@ module.exports = {
7
7
  router_dir: path.join(process.cwd(), 'routes'),
8
8
  default_router: '/home',
9
9
  is_ajax: req => !!req.xhr,
10
+ // Runs after .env is loaded and before the database models are initialized,
11
+ // so anything written to process.env here reaches config/database.js.
12
+ // Uncomment to keep the database password out of .env in plain text:
13
+ //
14
+ // hook_after_env_load: () => {
15
+ // if (process.env.DB_PASSWORD_B64)
16
+ // process.env.DB_PASSWORD = Buffer.from(process.env.DB_PASSWORD_B64, 'base64').toString();
17
+ // },
10
18
  hook_handle_error: (error, req, res, next) => {
11
19
  console.error(error);
12
20
  if (error.status === 404)
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "express": "^5.2.1",
11
- "express-sweet": "^5.0.0",
11
+ "express-sweet": "^5.1.0",
12
12
  "sequelize": "^6.37.8",
13
13
  "sqlite3": "^5.1.7"
14
14
  }
@@ -7,6 +7,14 @@ export default {
7
7
  router_dir: path.join(process.cwd(), 'routes'),
8
8
  default_router: '/home',
9
9
  is_ajax: req => !!req.xhr,
10
+ // Runs after .env is loaded and before the database models are initialized,
11
+ // so anything written to process.env here reaches config/database.js.
12
+ // Uncomment to keep the database password out of .env in plain text:
13
+ //
14
+ // hook_after_env_load: () => {
15
+ // if (process.env.DB_PASSWORD_B64)
16
+ // process.env.DB_PASSWORD = Buffer.from(process.env.DB_PASSWORD_B64, 'base64').toString();
17
+ // },
10
18
  hook_handle_error: (error, req, res, next) => {
11
19
  console.error(error);
12
20
  if (error.status === 404)
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "express": "^5.2.1",
12
- "express-sweet": "^5.0.0",
12
+ "express-sweet": "^5.1.0",
13
13
  "sequelize": "^6.37.8",
14
14
  "sqlite3": "^5.1.7"
15
15
  }