nodejs-quickstart-structure 1.19.0 → 1.19.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 +309 -301
- package/LICENSE +15 -15
- package/lib/generator.js +139 -139
- package/lib/modules/app-setup.js +401 -401
- package/lib/modules/config-files.js +151 -151
- package/lib/modules/database-setup.js +116 -116
- package/lib/modules/project-setup.js +32 -32
- package/lib/prompts.js +100 -100
- package/package.json +78 -78
- package/templates/clean-architecture/js/src/domain/models/User.js +9 -9
- package/templates/clean-architecture/js/src/errors/ApiError.js +14 -14
- package/templates/clean-architecture/js/src/index.js.ejs +55 -55
- package/templates/clean-architecture/js/src/infrastructure/config/env.js.ejs +47 -47
- package/templates/clean-architecture/js/src/infrastructure/log/logger.js +36 -36
- package/templates/clean-architecture/js/src/infrastructure/log/logger.spec.js.ejs +63 -63
- package/templates/clean-architecture/js/src/infrastructure/webserver/middleware/errorMiddleware.js +30 -30
- package/templates/clean-architecture/js/src/infrastructure/webserver/server.js.ejs +89 -89
- package/templates/clean-architecture/js/src/infrastructure/webserver/swagger.js.ejs +6 -6
- package/templates/clean-architecture/js/src/interfaces/graphql/context.js.ejs +13 -13
- package/templates/clean-architecture/js/src/interfaces/graphql/context.spec.js.ejs +31 -31
- package/templates/clean-architecture/js/src/interfaces/graphql/index.js.ejs +5 -5
- package/templates/clean-architecture/js/src/interfaces/graphql/resolvers/index.js.ejs +6 -6
- package/templates/clean-architecture/js/src/interfaces/graphql/typeDefs/index.js.ejs +6 -6
- package/templates/clean-architecture/js/src/interfaces/routes/api.spec.js.ejs +38 -38
- package/templates/clean-architecture/js/src/usecases/CreateUser.js +14 -14
- package/templates/clean-architecture/js/src/usecases/CreateUser.spec.js.ejs +51 -51
- package/templates/clean-architecture/js/src/usecases/GetAllUsers.js +12 -12
- package/templates/clean-architecture/js/src/usecases/GetAllUsers.spec.js.ejs +61 -61
- package/templates/clean-architecture/js/src/utils/httpCodes.js +9 -9
- package/templates/clean-architecture/ts/src/config/env.ts.ejs +46 -46
- package/templates/clean-architecture/ts/src/config/swagger.ts.ejs +6 -6
- package/templates/clean-architecture/ts/src/domain/user.ts +7 -7
- package/templates/clean-architecture/ts/src/errors/ApiError.ts +15 -15
- package/templates/clean-architecture/ts/src/index.ts.ejs +139 -139
- package/templates/clean-architecture/ts/src/infrastructure/log/logger.spec.ts.ejs +63 -63
- package/templates/clean-architecture/ts/src/infrastructure/log/logger.ts +36 -36
- package/templates/clean-architecture/ts/src/interfaces/graphql/context.spec.ts.ejs +32 -32
- package/templates/clean-architecture/ts/src/interfaces/graphql/context.ts.ejs +17 -17
- package/templates/clean-architecture/ts/src/interfaces/graphql/index.ts.ejs +3 -3
- package/templates/clean-architecture/ts/src/interfaces/graphql/resolvers/index.ts.ejs +4 -4
- package/templates/clean-architecture/ts/src/interfaces/graphql/typeDefs/index.ts.ejs +4 -4
- package/templates/clean-architecture/ts/src/interfaces/routes/userRoutes.spec.ts.ejs +40 -40
- package/templates/clean-architecture/ts/src/usecases/createUser.spec.ts.ejs +51 -51
- package/templates/clean-architecture/ts/src/usecases/createUser.ts +13 -13
- package/templates/clean-architecture/ts/src/usecases/getAllUsers.spec.ts.ejs +63 -63
- package/templates/clean-architecture/ts/src/usecases/getAllUsers.ts +10 -10
- package/templates/clean-architecture/ts/src/utils/errorMiddleware.ts.ejs +27 -27
- package/templates/clean-architecture/ts/src/utils/httpCodes.ts +7 -7
- package/templates/common/.cursorrules.ejs +60 -60
- package/templates/common/.dockerignore +12 -12
- package/templates/common/.env.example.ejs +41 -41
- package/templates/common/.gitlab-ci.yml.ejs +86 -86
- package/templates/common/.lintstagedrc +6 -6
- package/templates/common/.prettierrc +7 -7
- package/templates/common/Dockerfile +73 -73
- package/templates/common/Jenkinsfile.ejs +87 -87
- package/templates/common/SECURITY.md +20 -20
- package/templates/common/_github/workflows/ci.yml.ejs +46 -46
- package/templates/common/_github/workflows/security.yml.ejs +36 -36
- package/templates/common/_gitignore +5 -5
- package/templates/common/_husky/pre-commit +4 -4
- package/templates/common/caching/clean/js/CreateUser.js.ejs +29 -29
- package/templates/common/caching/clean/js/GetAllUsers.js.ejs +37 -37
- package/templates/common/caching/clean/ts/createUser.ts.ejs +27 -27
- package/templates/common/caching/clean/ts/getAllUsers.ts.ejs +34 -34
- package/templates/common/caching/js/memoryCache.js.ejs +60 -60
- package/templates/common/caching/js/memoryCache.spec.js.ejs +101 -101
- package/templates/common/caching/js/redisClient.js.ejs +75 -75
- package/templates/common/caching/js/redisClient.spec.js.ejs +147 -147
- package/templates/common/caching/ts/memoryCache.spec.ts.ejs +102 -102
- package/templates/common/caching/ts/redisClient.spec.ts.ejs +157 -157
- package/templates/common/database/js/database.js.ejs +19 -19
- package/templates/common/database/js/database.spec.js.ejs +56 -56
- package/templates/common/database/js/mongoose.js.ejs +33 -33
- package/templates/common/database/js/mongoose.spec.js.ejs +43 -43
- package/templates/common/database/ts/database.spec.ts.ejs +56 -56
- package/templates/common/database/ts/database.ts.ejs +21 -21
- package/templates/common/database/ts/mongoose.spec.ts.ejs +42 -42
- package/templates/common/database/ts/mongoose.ts.ejs +28 -28
- package/templates/common/docker-compose.yml.ejs +159 -159
- package/templates/common/ecosystem.config.js.ejs +40 -40
- package/templates/common/eslint.config.mjs.ejs +77 -77
- package/templates/common/health/js/healthRoute.spec.js.ejs +70 -70
- package/templates/common/health/ts/healthRoute.spec.ts.ejs +76 -76
- package/templates/common/jest.config.js.ejs +32 -32
- package/templates/common/kafka/js/config/kafka.js +9 -9
- package/templates/common/kafka/js/config/kafka.spec.js.ejs +27 -27
- package/templates/common/kafka/js/messaging/baseConsumer.spec.js.ejs +58 -58
- package/templates/common/kafka/js/messaging/userEventSchema.spec.js.ejs +27 -27
- package/templates/common/kafka/js/services/kafkaService.spec.js.ejs +106 -106
- package/templates/common/kafka/ts/config/kafka.spec.ts.ejs +27 -27
- package/templates/common/kafka/ts/config/kafka.ts +7 -7
- package/templates/common/kafka/ts/messaging/baseConsumer.spec.ts.ejs +50 -50
- package/templates/common/kafka/ts/messaging/baseConsumer.ts.ejs +27 -27
- package/templates/common/kafka/ts/services/kafkaService.spec.ts.ejs +81 -81
- package/templates/common/migrate-mongo-config.js.ejs +31 -31
- package/templates/common/migrations/init.js.ejs +23 -23
- package/templates/common/package.json.ejs +119 -118
- package/templates/common/prompts/add-feature.md.ejs +26 -26
- package/templates/common/prompts/project-context.md.ejs +43 -43
- package/templates/common/prompts/troubleshoot.md.ejs +28 -28
- package/templates/common/public/css/style.css +147 -147
- package/templates/common/scripts/run-e2e.js.ejs +63 -63
- package/templates/common/sonar-project.properties.ejs +27 -27
- package/templates/common/src/utils/errorMiddleware.spec.js.ejs +79 -79
- package/templates/common/src/utils/errorMiddleware.spec.ts.ejs +94 -94
- package/templates/common/tsconfig.json +22 -22
- package/templates/common/views/ejs/index.ejs +55 -55
- package/templates/common/views/pug/index.pug +40 -40
- package/templates/mvc/js/src/config/env.js.ejs +46 -46
- package/templates/mvc/js/src/config/swagger.js.ejs +6 -6
- package/templates/mvc/js/src/errors/ApiError.js +14 -14
- package/templates/mvc/js/src/graphql/context.js.ejs +7 -7
- package/templates/mvc/js/src/graphql/context.spec.js.ejs +29 -29
- package/templates/mvc/js/src/graphql/index.js.ejs +5 -5
- package/templates/mvc/js/src/graphql/resolvers/index.js.ejs +6 -6
- package/templates/mvc/js/src/graphql/typeDefs/index.js.ejs +6 -6
- package/templates/mvc/js/src/index.js.ejs +136 -136
- package/templates/mvc/js/src/utils/errorMiddleware.js +29 -29
- package/templates/mvc/js/src/utils/httpCodes.js +9 -9
- package/templates/mvc/js/src/utils/logger.js +40 -40
- package/templates/mvc/js/src/utils/logger.spec.js.ejs +63 -63
- package/templates/mvc/ts/src/config/env.ts.ejs +45 -45
- package/templates/mvc/ts/src/config/swagger.ts.ejs +6 -6
- package/templates/mvc/ts/src/errors/ApiError.ts +15 -15
- package/templates/mvc/ts/src/graphql/context.spec.ts.ejs +30 -30
- package/templates/mvc/ts/src/graphql/context.ts.ejs +12 -12
- package/templates/mvc/ts/src/graphql/index.ts.ejs +3 -3
- package/templates/mvc/ts/src/graphql/resolvers/index.ts.ejs +4 -4
- package/templates/mvc/ts/src/graphql/typeDefs/index.ts.ejs +4 -4
- package/templates/mvc/ts/src/utils/errorMiddleware.ts.ejs +27 -27
- package/templates/mvc/ts/src/utils/httpCodes.ts +7 -7
- package/templates/mvc/ts/src/utils/logger.spec.ts.ejs +63 -63
- package/templates/mvc/ts/src/utils/logger.ts +36 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,301 +1,309 @@
|
|
|
1
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
2
|
-
|
|
3
|
-
## [1.19.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
- **Security Hardening**:
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
|
|
27
|
-
- **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
###
|
|
39
|
-
- **
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- **
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- **
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- **
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
###
|
|
90
|
-
- **
|
|
91
|
-
- **
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
## [1.
|
|
107
|
-
### Added
|
|
108
|
-
- **
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
- **
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
###
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
-
|
|
172
|
-
|
|
173
|
-
## [1.
|
|
174
|
-
###
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
- Fixed
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
-
|
|
244
|
-
|
|
245
|
-
## [1.7.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
1
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
2
|
+
|
|
3
|
+
## [1.19.1] - 2026-04-01
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Template Security Hardening**: Resolved moderate Prototype Pollution vulnerability in `lodash` (GHSA-xxjr-mmjv-4gpg) by implementing a targeted `override` to version `^4.17.23` in generated templates.
|
|
7
|
+
- **Dependency Modernization**: Updated `jake` override to `^11.9.5` (latest version) across all project templates.
|
|
8
|
+
- **E2E Verified**: Validated the fix across multiple scenarios (JS/TS, MVC/Clean, MySQL/MongoDB/GraphQL) via Windows E2E tests with Docker, ensuring 0 vulnerabilities and 100% functional reliability.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [1.19.0] - 2026-03-28
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Security Hardening**: Added `SECURITY.md` file to the project.
|
|
15
|
+
- **Git Attributes**: Added `.gitattributes` file to the project.
|
|
16
|
+
- **Contributing Guide**: Added `CONTRIBUTING.md` file to the project.
|
|
17
|
+
|
|
18
|
+
## [1.18.1] - 2026-03-27
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **Template Security Hardening**: Resolved 29 vulnerabilities in `package.json.ejs` by upgrading `Apollo Server`, `Jest`, and `ESLint`.
|
|
22
|
+
- **Apollo Server 5 Compatibility**: Migrated GraphQL integration to use `@as-integrations/express4`, resolving breaking changes in the latest Apollo release.
|
|
23
|
+
- **Surgical Security Overrides**: Implemented targeted `overrides` for `brace-expansion`, `jake`, and `micromatch`. Removed global `glob/minimatch` overrides to maintain compatibility with Jest's internal APIs while preserving a "Zero-Vulnerability" status.
|
|
24
|
+
- **E2E Validated**: Verified the entire "Secure-by-Default" ecosystem via Windows E2E tests, achieving 100% pass rate.
|
|
25
|
+
- **Enterprise Standards**: Synchronized all generator templates with the latest secure dependency standards across MVC and Clean Architecture.
|
|
26
|
+
### Changed
|
|
27
|
+
- **Readme**: Standardize Generated Project README.
|
|
28
|
+
|
|
29
|
+
## [1.18.0] - 2026-03-25
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
- **Enterprise-Grade Security Hardening**: Integrated **Snyk (SCA)** and **SonarQube (SAST)** into the project scaffolding, providing "Big Tech" industry-standard security analysis out of the box.
|
|
33
|
+
- **Automated Security Workflows**: Pre-configured CI/CD stages for security scanning across GitHub Actions, GitLab CI, and Jenkins.
|
|
34
|
+
- **Pre-commit Security Gates**: Integrated **Husky** and **lint-staged** to automatically enforce code quality and security standards locally before every commit.
|
|
35
|
+
- **Security Standard Enforcement**: Added a standardized `SECURITY.md` policy and automated quality gates to ensure code resilience.
|
|
36
|
+
- **Comprehensive Security Guide**: Created a new documentation guide detailing the setup and operational workflows for the enterprise security features.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- **Matrix Expansion**: Updated the CLI to support over **1,680+ project combinations** by adding a conditional security hardening layer across all CI/CD providers.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- **Docker Node Version**: Updated Docker node version to 22.22.2-trixie-slim
|
|
43
|
+
|
|
44
|
+
## [1.17.0] - 2026-03-23
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- **Kafka KRaft Mode Integration**: Modernized Kafka setups across all templates (MVC & Clean Architecture) by completely removing the Zookeeper dependency and enabling KRaft mode in `docker-compose.yml`, reducing project orchestration overhead.
|
|
48
|
+
- **End-to-End (E2E) Verification Framework**: Implemented dedicated Docker container targeted end-to-end tests (`tests/e2e/`) utilizing Supertest via dynamic `SERVER_URL` mapping to eliminate port collisions and test the fully assembled container cluster directly.
|
|
49
|
+
- **Enhanced Validation Pipelines**: Automatically executes the `npm run test:e2e` suite at the conclusion of internal validations across the entire platform matrix for improved CI accountability.
|
|
50
|
+
|
|
51
|
+
### Refactored
|
|
52
|
+
- **Test Directory Strict Isolation**: Restructured internal code generation workflows (`lib/modules/`) to pipe all generated `.spec` files strictly into a dedicated `tests/unit/` subdirectory, cleanly abstracting unit specifications from end-to-end specifications.
|
|
53
|
+
|
|
54
|
+
## [1.16.2] - 2026-03-19
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
- **Major Dependency Upgrades**: Upgraded core CLI dependencies to their latest stable versions for better performance and security:
|
|
58
|
+
- `commander`: Upgraded from `^13.1.0` to `^14.0.3`.
|
|
59
|
+
- `ejs`: Upgraded from `^3.1.10` to `^5.0.1`.
|
|
60
|
+
- `inquirer`: Upgraded from `^12.4.1` to `^13.3.2`.
|
|
61
|
+
- **Verified Compatibility**: Validated the generator across multiple complex project configurations including TypeScript/MVC, JavaScript/Clean Architecture, Kafka messaging, and Redis/PostgreSQL integration.
|
|
62
|
+
- **Update jest.config.js**: Update jest.config.js (or your test runner config) with new global thresholds:
|
|
63
|
+
```
|
|
64
|
+
globalThreshold: {
|
|
65
|
+
branches: 70,
|
|
66
|
+
functions: 80,
|
|
67
|
+
lines: 80,
|
|
68
|
+
statements: 80,
|
|
69
|
+
},
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## [1.16.1] - 2026-03-17
|
|
73
|
+
|
|
74
|
+
### Refactored
|
|
75
|
+
- **Top-Level Dynamic Imports**: Moved dynamic `await import()` and `require()` calls to the top-level across all TypeScript and JavaScript templates (MVC & Clean Architecture).
|
|
76
|
+
- **Module Loading Standardization**: Standardized database connections (Mongoose/Sequelize), Kafka services, and graceful shutdown logic for better static analysis and ESM/CJS consistency.
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
- **Kafka Service Scope**: Resolved a potential `ReferenceError` in `kafkaService.ts.ejs` by correcting the instantiation order of dynamic consumers.
|
|
80
|
+
- **Health Check Imports**: Optimized `healthRoute.ts.ejs` to use top-level database driver imports.
|
|
81
|
+
|
|
82
|
+
## [1.16.0] - 2026-03-14
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
- **Robust Kafka Singleton Implementation**: Refactored `KafkaService` to a strict singleton pattern across all architectures with `connectionPromise` and automated retry logic for resilient messaging.
|
|
86
|
+
- **BaseConsumer Standards**: Implemented constructor guards in `BaseConsumer` to prevent direct instantiation of abstract messaging classes.
|
|
87
|
+
- **Professional Docker Log Hygiene**: Added `NPM_CONFIG_UPDATE_NOTIFIER=false` to both builder and production stages to suppress non-essential npm upgrade notifications.
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
- **Docker Build & Type Safety**: Resolved a critical build failure in MVC TypeScript projects using EJS/Pug by addressing missing Express `Request` and `Response` type imports.
|
|
91
|
+
- **Network Resilience**: Removed redundant `npm install -g npm@latest` from the `Dockerfile` template to fix `ECONNRESET` failures during project verification on unstable networks.
|
|
92
|
+
- **Controller Testing Modernization**: Refactored `userController` spec templates (TS and JS) to correctly mock and verify the shared Kafka singleton, fixing persistent unit test failures.
|
|
93
|
+
- **Database Mocking Refinement**: Resolved a data flow bug in the "None" database mock where generated IDs were being overwritten, and enhanced TypeScript types to eliminate `any` in repository patterns.
|
|
94
|
+
|
|
95
|
+
## [1.15.1] - 2026-03-12
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
- **Magic AI Scaffolding**: Automated AI context generation ( `.cursorrules`, `prompts/`) by intelligently inferring project goals from the project name, removing the need for manual business domain prompts.
|
|
99
|
+
- **Enhanced README**: Added specialized guidance for AI-native development with Cursor and LLMs.
|
|
100
|
+
|
|
101
|
+
### Fixed
|
|
102
|
+
- **GitHub Actions Compliance**: Fully resolved Node.js 20 deprecation warnings by moving `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24` to global workflow scope.
|
|
103
|
+
- **CI Modernization**: Upgraded daily audit and GitLab CI runners to Node.js 22.
|
|
104
|
+
- **CI Enforcement**: Updated all CI/CD templates (GitHub, GitLab, Jenkins) to strictly enforce the >70% test coverage gate.
|
|
105
|
+
|
|
106
|
+
## [1.15.0] - 2026-03-12
|
|
107
|
+
### Added
|
|
108
|
+
- **AI-Native Scaffolding & Agent Skill Templates:**
|
|
109
|
+
- Added a new CLI prompt for `businessDomain` to inject custom domain knowledge into generated templates.
|
|
110
|
+
- Generates a `.cursorrules` file at the root to enforce >70% Test coverage and Architecture patterns automatically for AI Code Editors.
|
|
111
|
+
- Scaffolds a `prompts/` directory with specialized Agent Skill templates (`project-context.md`, `add-feature.md`, `troubleshoot.md`) designed to provide deep structural understanding to LLMs like ChatGPT or Claude.
|
|
112
|
+
- Added an "AI-Native Development" section to the generated `README.md` and prominent print messages in the CLI upon successful completion.
|
|
113
|
+
|
|
114
|
+
## [1.14.0] - 2026-03-09
|
|
115
|
+
### Added
|
|
116
|
+
- **Unit test:**
|
|
117
|
+
- Unit Testing Framework: Integrated Jest and ts-jest as the core testing suite.
|
|
118
|
+
|
|
119
|
+
- Scaffolding Logic: Automatically generates .spec.ts files in the tests/ directory mirroring the src/ structure during project initialization.
|
|
120
|
+
|
|
121
|
+
- Quality Gates: Implemented a mandatory Coverage Threshold (>=70%) for lines and functions to ensure long-term maintainability.
|
|
122
|
+
|
|
123
|
+
- Mocking Standards: Included pre-configured mocks for Mongoose (database pings) and Express request/response objects.
|
|
124
|
+
|
|
125
|
+
- NPM Scripts: Added npm test, npm run test:watch, and npm run test:coverage for seamless developer workflow.
|
|
126
|
+
|
|
127
|
+
## [1.13.0] - 2026-03-05
|
|
128
|
+
### Added
|
|
129
|
+
- **Enhanced Health Check System:**
|
|
130
|
+
- Standardized health logic for both MVC and Clean Architecture.
|
|
131
|
+
- Deep verification: Automatically pings the selected database (MySQL, PostgreSQL, MongoDB) during health checks and returns a `DOWN` status with 500 code if the connection is lost.
|
|
132
|
+
- Structured response including `uptime`, `memoryUsage`, `database` connectivity status, and `timestamp`.
|
|
133
|
+
- **Improved Graceful Shutdown:**
|
|
134
|
+
- Standardized signal handling (`SIGINT`, `SIGTERM`) across all architecture types to ensure clean disposal of database and caching resources.
|
|
135
|
+
- Integrated proper shutdown sequences for Redis, MySQL, PostgreSQL, and MongoDB.
|
|
136
|
+
|
|
137
|
+
## [1.12.0] - 2026-03-04
|
|
138
|
+
### Added
|
|
139
|
+
- **Zod Environment Validation:** Replaced manual `dotenv` process calls in server entry points with a centralized schema parser.
|
|
140
|
+
- Automatically generates `src/config/env.ts` (or `.js`) evaluating `NODE_ENV`, `PORT`, and strictly mapping database, cache, and Kafka connection definitions gracefully crashing the app at startup if missing.
|
|
141
|
+
- **PM2 Deployment Configuration:** Natively supports PM2 ecosystem clustering for VPS and EC2 configurations out-of-the-box.
|
|
142
|
+
- Generates `ecosystem.config.js` intelligently mapping dynamic environments for Redis, Databases, and Kafka without user prompts.
|
|
143
|
+
- Modifies `package.json` with an out-of-the-box `npm run deploy` script bound to `pm2 start ecosystem.config.js --env production`.
|
|
144
|
+
- Upgraded generated README deployment guides for transparent CLI instruction workflows outlining the contrast between running Docker vs PM2.
|
|
145
|
+
|
|
146
|
+
## [1.11.1] - 2026-03-03
|
|
147
|
+
### Fixed
|
|
148
|
+
- Fixed relative import paths in Clean Architecture JS `errorMiddleware.js` — changed to correct 3-level relative paths (`../../../`).
|
|
149
|
+
|
|
150
|
+
## [1.11.0] - 2026-03-02
|
|
151
|
+
### Added
|
|
152
|
+
- **Centralized Error Handling Mechanism:** All generated projects now include a standardized, predictable error response structure for both REST APIs and GraphQL communication types.
|
|
153
|
+
- New `src/errors/` directory with custom error classes: `ApiError`, `NotFoundError`, `BadRequestError`.
|
|
154
|
+
- New `error.middleware.{ts|js}` global error handler placed at the end of the Express middleware chain in `src/utils/` (MVC) and `src/utils/` + `src/infrastructure/webserver/middleware/` (Clean Architecture).
|
|
155
|
+
- Integrates `winston` logger to automatically log 500-level errors to persistent log files.
|
|
156
|
+
- All controllers updated to pass errors via `next(error)` instead of manually sending responses.
|
|
157
|
+
- **GraphQL:** Apollo Server `formatError` hook configured with `unwrapResolverError` to intercept resolver errors and map `ApiError` instances to structured GraphQL extension codes.
|
|
158
|
+
- **REST APIs:** Express error middleware returns a consistent `{ statusCode, message, stack? }` JSON body.
|
|
159
|
+
- **Error Response Standardization:** All error responses follow the same schema regardless of database, caching, or communication type selected.
|
|
160
|
+
|
|
161
|
+
### Fixed
|
|
162
|
+
- Fixed `swagger.js` / `swagger.yml` being incorrectly generated for non-REST API configurations (GraphQL, Kafka). Converted static `swagger.js` to `swagger.js.ejs` in MVC JS and Clean Architecture JS templates so `renderSwaggerConfig` can conditionally control its generation.
|
|
163
|
+
- Fixed `userRoutes.ts` in Clean Architecture TypeScript template not passing `NextFunction` to controller methods, causing `TypeScript TS2554: Expected 3 arguments` compile errors during Docker builds.
|
|
164
|
+
- Fixed incorrect relative import paths (`../../../../`) in Clean Architecture JS `errorMiddleware.js` — changed to correct 3-level relative paths (`../../../`).
|
|
165
|
+
- Fixed `HTTP_STATUS` being imported without destructuring from `httpCodes.js` (which uses a plain `module.exports = HTTP_STATUS` default export), causing `Cannot read properties of undefined` runtime errors.
|
|
166
|
+
- Fixed `renderErrorMiddleware` in `app-setup.js` deleting from the **template source directory** instead of the generated project's target directory. This caused error middleware templates to disappear from disk after the first test run, breaking all subsequent generations.
|
|
167
|
+
|
|
168
|
+
## [1.10.1] - 2026-03-02
|
|
169
|
+
### Added
|
|
170
|
+
- Roadmap & Upcoming Features. **[View our Public Roadmap on Trello](https://trello.com/b/TPTo8ylF/nodejs-quickstart-structure-product)**
|
|
171
|
+
- Update start app with npx command.
|
|
172
|
+
|
|
173
|
+
## [1.10.0] - 2026-02-27
|
|
174
|
+
### Added
|
|
175
|
+
- **GraphQL Support:** The generator now supports scaffolding GraphQL APIs using Apollo Server (v4) alongside standard REST APIs. This feature includes built-in integrations for both MVC and Clean Architecture designs across TypeScript and JavaScript.
|
|
176
|
+
- Generates strongly-typed schemas (`typeDefs`) and structured `resolvers`.
|
|
177
|
+
- Automatically provisions Apollo Sandbox for local development.
|
|
178
|
+
- Integrates smoothly with existing databases (MySQL, PostgreSQL, MongoDB) and caching (Redis, Memory Cache) layouts.
|
|
179
|
+
- Automatically configures Content Security Policy (Helmet) to allow embeddable Apollo Sandbox UI out of the box.
|
|
180
|
+
|
|
181
|
+
## [1.9.4] - 2026-02-26
|
|
182
|
+
### Fixed
|
|
183
|
+
- Fixed intermittent "Health check timeout" errors in concurrent (concurrency > 1) E2E validation scripts. Increased the total verification timeout window to 120s to accommodate heavy Docker image cluster instantiations (Kafka/MySQL/Redis), and enhanced the Node.js `fetch` client to use `127.0.0.1` IPv4 loopback resolution alongside strict 5-second `AbortSignal` timeouts to mitigate dangling TCP connections resulting from overloaded internal Docker proxy bridges.
|
|
184
|
+
- Fixed an `EBADENGINE` compatibility issue during Docker builds by upgrading the default template `Dockerfile` base image from `node:18-alpine` to `node:22-alpine`, supporting modern dependencies like `eslint@9` and `cpx2`.
|
|
185
|
+
- Fixed a port collision bug (`Bind for 0.0.0.0:6379 failed: port is already allocated`) during parallel E2E testing. The `validation-core.js` script now dynamically assigns random network ports for `REDIS_PORT` when running concurrent testing matrices.
|
|
186
|
+
|
|
187
|
+
## [1.9.3] - 2026-02-26
|
|
188
|
+
### Added
|
|
189
|
+
- Refactored Swagger documentation to use a standalone `swagger.yml` file instead of inline JSDoc comments across all templates (MVC, Clean Architecture, TS, and JS).
|
|
190
|
+
- Integrated `yamljs` to parse the `swagger.yml` file and removed the `swagger-jsdoc` dependency, significantly reducing boilerplate in route files.
|
|
191
|
+
|
|
192
|
+
### Fixed
|
|
193
|
+
- Fixed an issue in `package.json.ejs` where `jest` configuration had malformed JSON due to whitespace stripping.
|
|
194
|
+
- Fixed a Docker build crash for non-REST API projects caused by the build script unconditionally attempting to copy `swagger.yml` using `cpx2`.
|
|
195
|
+
|
|
196
|
+
## [1.9.2] - 2026-02-23
|
|
197
|
+
### Fixed
|
|
198
|
+
- Fixed an issue where the generator output misleading instructions (`DATABASE_URL`) for standalone `docker run` executions. The CLI success commands and `README.md` now conditionally include dynamic compose network bindings (`--network`) and accurate environment variables matching the user's selected DB stack.
|
|
199
|
+
- Fixed a bug where `DB_PASSWORD` in `database.ts.ejs` and `database.js.ejs` defaulted to `postgres` instead of `root` for PostgreSQL configurations, causing standalone Node local servers (`npm run dev`) to fail connection handshakes with default `docker-compose` clusters.
|
|
200
|
+
|
|
201
|
+
## [1.9.1] - 2026-02-22
|
|
202
|
+
### Added
|
|
203
|
+
- Implemented **Daily Template Vulnerability Audit** via GitHub Actions (`.github/workflows/daily-audit.yml`). A custom script now parses `package.json.ejs` daily to proactively scan for high-severity vulnerabilities in generated dependencies, ensuring generated projects are eternally secure.
|
|
204
|
+
- Added built-in **Memory Cache** (`node-cache`) integration as an alternative caching layer alongside Redis.
|
|
205
|
+
- Scaled up the generator matrix, now supporting over **160 Core Combinations** and **320 Total Scenarios** (including CI/CD pipelines).
|
|
206
|
+
- Configured dynamic cache service imports across both MVC and Clean Architecture controllers/usecases.
|
|
207
|
+
|
|
208
|
+
### Fixed
|
|
209
|
+
- Fixed an ESLint TypeScript parsing error (`Type expected`) caused by unescaped EJS template variables in Clean Architecture usecases.
|
|
210
|
+
- Fixed a CLI execution bug where unquoted caching parameters (like `"Memory Cache"`) caused test validation failures.
|
|
211
|
+
- Updated the E2E Windows Validation test core to evaluate ESLint flat config files (`eslint.config.mjs`) instead of `.eslintrc.json`.
|
|
212
|
+
|
|
213
|
+
## [1.8.2] - 2026-02-22
|
|
214
|
+
### Fixed
|
|
215
|
+
- Hotfix: Changed `cpx2` command to its actual executable binary `cpx` in the build script. This resolves `sh: cpx2: not found` failures when running `npm run build` or `docker-compose up --build`.
|
|
216
|
+
|
|
217
|
+
## [1.8.1] - 2026-02-22
|
|
218
|
+
### Security
|
|
219
|
+
- Resolved all high-severity npm vulnerabilities (0 vulnerabilities detected on install).
|
|
220
|
+
- Upgraded ESLint to v9 and `typescript-eslint` to v8, migrating generated templates from `.eslintrc.json` to Flat Config (`eslint.config.mjs`) to eliminate deprecated `eslint@8` transitive dependencies.
|
|
221
|
+
- Upgraded `supertest` to v7, `rimraf` to v6, and `ejs` to v3.1.10.
|
|
222
|
+
- Replaced vulnerable `copyfiles` dependency with `cpx2` for view template orchestration.
|
|
223
|
+
- Configured npm `overrides` for `minimatch@^10.2.1` to patch outdated `jest` sub-dependencies without breaking the test runner.
|
|
224
|
+
|
|
225
|
+
### Fixed
|
|
226
|
+
- Fixed `npm install` crashing due to `husky install` expecting an initialized `.git` directory by adding a graceful fallback wrapper.
|
|
227
|
+
|
|
228
|
+
## [1.8.0] - 2026-02-18
|
|
229
|
+
### Added
|
|
230
|
+
- Introduced **GitLab CI/CD pipeline support**:
|
|
231
|
+
- Preconfigured `.gitlab-ci.yml` for automated build, test, and deploy steps.
|
|
232
|
+
- End-to-end (e2e) test job included to ensure project reliability.
|
|
233
|
+
- Aligns with existing GitHub Actions and Jenkins workflows for consistent CI/CD coverage.
|
|
234
|
+
|
|
235
|
+
### Improved
|
|
236
|
+
- Documentation updated to highlight GitLab CI/CD as a supported option.
|
|
237
|
+
- Enhanced CI/CD setup instructions in `README.md` for multi-platform pipelines.
|
|
238
|
+
|
|
239
|
+
## [1.7.5] - 2026-02-17
|
|
240
|
+
> Happy Lunar New Year! This release coincides with Tet Vietnam. 🎆
|
|
241
|
+
### Fixed
|
|
242
|
+
- Optimized `scripts/validate-windows.js` to use `--no-audit --no-fund --loglevel=error` during `npm install`, resolving intermittent CI failures on Windows.
|
|
243
|
+
- Fixed 7 failing test cases involving Kafka and Redis combinations.
|
|
244
|
+
|
|
245
|
+
## [1.7.4] - 2026-02-17
|
|
246
|
+
### Fixed
|
|
247
|
+
- Resolved `JSON.parse` error and incorrect Redis arguments in `getAllUsers` usecase for Clean Architecture templates.
|
|
248
|
+
- Fixed `SyntaxError` in `lib/modules/caching-setup.js` preventing project generation.
|
|
249
|
+
|
|
250
|
+
### Added
|
|
251
|
+
- Implemented automatic cache invalidation in `createUser` usecase (Clean Architecture) to ensure data consistency.
|
|
252
|
+
|
|
253
|
+
## [1.7.0]
|
|
254
|
+
|
|
255
|
+
### Added
|
|
256
|
+
- Added support for Redis caching in both MVC and Clean Architecture.
|
|
257
|
+
|
|
258
|
+
## [1.6.1] - 2026-02-11
|
|
259
|
+
|
|
260
|
+
### Fixed
|
|
261
|
+
- Included `CHANGELOG.md` in the published npm package so users can see version history.
|
|
262
|
+
- Updated `README.md` with details on 64+ supported project combinations.
|
|
263
|
+
|
|
264
|
+
## [1.6.0] - 2026-02-10
|
|
265
|
+
|
|
266
|
+
### Refactored
|
|
267
|
+
- Modularized `lib/generator.js` into distinct modules (`lib/modules/`) for better maintainability.
|
|
268
|
+
- Extracted logic for project setup, config files, database, app setup, and Kafka.
|
|
269
|
+
|
|
270
|
+
### Fixed
|
|
271
|
+
- Resolved syntax error in `UserRepository.js` for Clean Architecture projects with 'None' database.
|
|
272
|
+
- Increased health check timeout to 60s in validation scripts to prevent false positives in heavy environments (MySQL + Kafka).
|
|
273
|
+
- Fixed missing `src/views` copy logic for MVC projects, resolving Docker build errors.
|
|
274
|
+
- Corrected CLI argument parsing to properly exclude undefined flags (e.g., `--db-name`).
|
|
275
|
+
- Removed obsolete `version: '3.8'` from `docker-compose.yml`.
|
|
276
|
+
|
|
277
|
+
## [1.5.0] - 2026-02-10
|
|
278
|
+
|
|
279
|
+
### Added
|
|
280
|
+
- Implemented structured logging with `winston-daily-rotate-file` (14-day retention, daily rotation).
|
|
281
|
+
- Added HTTP request logging using `morgan` middleware.
|
|
282
|
+
|
|
283
|
+
### Fixed
|
|
284
|
+
- Resolved `EACCES` permission errors for log directories in Docker.
|
|
285
|
+
|
|
286
|
+
## [1.4.5] - 2026-02-10
|
|
287
|
+
|
|
288
|
+
### Changed
|
|
289
|
+
- Bumped version to 1.4.5.
|
|
290
|
+
|
|
291
|
+
## [1.4.4] - 2026-02-10
|
|
292
|
+
|
|
293
|
+
### Added
|
|
294
|
+
- Created `CHANGELOG.md` to track release history.
|
|
295
|
+
|
|
296
|
+
## [1.4.3] - 2026-02-10
|
|
297
|
+
|
|
298
|
+
### Fixed
|
|
299
|
+
- Updated CLI help text description to include MongoDB support.
|
|
300
|
+
- Fixed unexpected character issues in npm scripts.
|
|
301
|
+
- General bug fixes and improvements.
|
|
302
|
+
|
|
303
|
+
## [1.0.0] - 2026-02-03
|
|
304
|
+
|
|
305
|
+
### Added
|
|
306
|
+
- Initial release of `nodejs-quickstart-structure`.
|
|
307
|
+
- Scaffolding for MVC and Clean Architecture.
|
|
308
|
+
- Support for Express.js.
|
|
309
|
+
- Database integration (MongoDB, MySQL, PostgreSQL)
|