ddd-ts-kit 0.89.0 → 0.91.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.
Files changed (463) hide show
  1. package/CHANGELOG.md +318 -0
  2. package/README.fr.md +58 -12
  3. package/README.md +54 -11
  4. package/dist/alias/index.d.ts +2 -1
  5. package/dist/alias/index.d.ts.map +1 -1
  6. package/dist/alias/index.js +1 -0
  7. package/dist/alias/index.js.map +1 -1
  8. package/dist/alias/mapper-target-text.d.ts +4 -0
  9. package/dist/alias/mapper-target-text.d.ts.map +1 -0
  10. package/dist/alias/mapper-target-text.js +5 -0
  11. package/dist/alias/mapper-target-text.js.map +1 -0
  12. package/dist/alias/module-name-mapper.d.ts +5 -2
  13. package/dist/alias/module-name-mapper.d.ts.map +1 -1
  14. package/dist/alias/module-name-mapper.js +5 -2
  15. package/dist/alias/module-name-mapper.js.map +1 -1
  16. package/dist/check/alias/test-runners.js +8 -3
  17. package/dist/check/alias/test-runners.js.map +1 -1
  18. package/dist/check/baseline/apply-baseline.d.ts +14 -0
  19. package/dist/check/baseline/apply-baseline.d.ts.map +1 -0
  20. package/dist/check/baseline/apply-baseline.js +30 -0
  21. package/dist/check/baseline/apply-baseline.js.map +1 -0
  22. package/dist/check/baseline/baseline-following-moves.d.ts +9 -0
  23. package/dist/check/baseline/baseline-following-moves.d.ts.map +1 -0
  24. package/dist/check/baseline/baseline-following-moves.js +10 -0
  25. package/dist/check/baseline/baseline-following-moves.js.map +1 -0
  26. package/dist/check/baseline/baseline-move.d.ts +6 -0
  27. package/dist/check/baseline/baseline-move.d.ts.map +1 -0
  28. package/dist/check/baseline/baseline-move.js +2 -0
  29. package/dist/check/baseline/baseline-move.js.map +1 -0
  30. package/dist/check/baseline/baseline-text.d.ts +4 -0
  31. package/dist/check/baseline/baseline-text.d.ts.map +1 -0
  32. package/dist/check/baseline/baseline-text.js +12 -0
  33. package/dist/check/baseline/baseline-text.js.map +1 -0
  34. package/dist/check/baseline/baseline.d.ts +6 -0
  35. package/dist/check/baseline/baseline.d.ts.map +1 -0
  36. package/dist/check/baseline/baseline.js +2 -0
  37. package/dist/check/baseline/baseline.js.map +1 -0
  38. package/dist/check/baseline/moved-baseline-text.d.ts +4 -0
  39. package/dist/check/baseline/moved-baseline-text.d.ts.map +1 -0
  40. package/dist/check/baseline/moved-baseline-text.js +13 -0
  41. package/dist/check/baseline/moved-baseline-text.js.map +1 -0
  42. package/dist/check/baseline/parse-baseline.d.ts +4 -0
  43. package/dist/check/baseline/parse-baseline.d.ts.map +1 -0
  44. package/dist/check/baseline/parse-baseline.js +19 -0
  45. package/dist/check/baseline/parse-baseline.js.map +1 -0
  46. package/dist/check/baseline/pruned-baseline.d.ts +5 -0
  47. package/dist/check/baseline/pruned-baseline.d.ts.map +1 -0
  48. package/dist/check/baseline/pruned-baseline.js +14 -0
  49. package/dist/check/baseline/pruned-baseline.js.map +1 -0
  50. package/dist/check/baseline/read-baseline.d.ts +6 -0
  51. package/dist/check/baseline/read-baseline.d.ts.map +1 -0
  52. package/dist/check/baseline/read-baseline.js +11 -0
  53. package/dist/check/baseline/read-baseline.js.map +1 -0
  54. package/dist/check/baseline/recorded-baseline.d.ts +5 -0
  55. package/dist/check/baseline/recorded-baseline.d.ts.map +1 -0
  56. package/dist/check/baseline/recorded-baseline.js +11 -0
  57. package/dist/check/baseline/recorded-baseline.js.map +1 -0
  58. package/dist/check/baseline/renamed-files.d.ts +8 -0
  59. package/dist/check/baseline/renamed-files.d.ts.map +1 -0
  60. package/dist/check/baseline/renamed-files.js +23 -0
  61. package/dist/check/baseline/renamed-files.js.map +1 -0
  62. package/dist/check/baseline/write-baseline.d.ts +4 -0
  63. package/dist/check/baseline/write-baseline.d.ts.map +1 -0
  64. package/dist/check/baseline/write-baseline.js +9 -0
  65. package/dist/check/baseline/write-baseline.js.map +1 -0
  66. package/dist/check/canonical/stray-entry.d.ts.map +1 -1
  67. package/dist/check/canonical/stray-entry.js +5 -1
  68. package/dist/check/canonical/stray-entry.js.map +1 -1
  69. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  70. package/dist/check/catalogue/architecture-rules.js +4 -0
  71. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  72. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  73. package/dist/check/catalogue/default-severities.js +0 -4
  74. package/dist/check/catalogue/default-severities.js.map +1 -1
  75. package/dist/check/commands/check-command.d.ts.map +1 -1
  76. package/dist/check/commands/check-command.js +46 -1
  77. package/dist/check/commands/check-command.js.map +1 -1
  78. package/dist/check/commands/check-file-command.d.ts +5 -0
  79. package/dist/check/commands/check-file-command.d.ts.map +1 -1
  80. package/dist/check/commands/check-file-command.js +27 -6
  81. package/dist/check/commands/check-file-command.js.map +1 -1
  82. package/dist/check/explain/nest-docs.d.ts +3 -0
  83. package/dist/check/explain/nest-docs.d.ts.map +1 -0
  84. package/dist/check/explain/nest-docs.js +31 -0
  85. package/dist/check/explain/nest-docs.js.map +1 -0
  86. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  87. package/dist/check/explain/rule-docs.js +2 -0
  88. package/dist/check/explain/rule-docs.js.map +1 -1
  89. package/dist/check/fixtures/alias-declared-fixtures.js +1 -1
  90. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  91. package/dist/check/fixtures/authz-declared-fixtures.js +1 -1
  92. package/dist/check/fixtures/authz-declared-fixtures.js.map +1 -1
  93. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  94. package/dist/check/fixtures/fixtures.js +4 -0
  95. package/dist/check/fixtures/fixtures.js.map +1 -1
  96. package/dist/check/fixtures/nest-controllers-fixtures.d.ts +3 -0
  97. package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -0
  98. package/dist/check/fixtures/nest-controllers-fixtures.js +86 -0
  99. package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -0
  100. package/dist/check/fixtures/nest-fixtures.d.ts +3 -0
  101. package/dist/check/fixtures/nest-fixtures.d.ts.map +1 -0
  102. package/dist/check/fixtures/nest-fixtures.js +59 -0
  103. package/dist/check/fixtures/nest-fixtures.js.map +1 -0
  104. package/dist/check/nest/nest-equivalents-of.d.ts +14 -0
  105. package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -0
  106. package/dist/check/nest/nest-equivalents-of.js +119 -0
  107. package/dist/check/nest/nest-equivalents-of.js.map +1 -0
  108. package/dist/check/project/load-project.d.ts +2 -0
  109. package/dist/check/project/load-project.d.ts.map +1 -1
  110. package/dist/check/project/load-project.js +7 -3
  111. package/dist/check/project/load-project.js.map +1 -1
  112. package/dist/check/rules/nest-controllers-current.d.ts +3 -0
  113. package/dist/check/rules/nest-controllers-current.d.ts.map +1 -0
  114. package/dist/check/rules/nest-controllers-current.js +43 -0
  115. package/dist/check/rules/nest-controllers-current.js.map +1 -0
  116. package/dist/check/rules/nest-no-parallel-pipeline.d.ts +3 -0
  117. package/dist/check/rules/nest-no-parallel-pipeline.d.ts.map +1 -0
  118. package/dist/check/rules/nest-no-parallel-pipeline.js +70 -0
  119. package/dist/check/rules/nest-no-parallel-pipeline.js.map +1 -0
  120. package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
  121. package/dist/check/support/is-generated-context-file.js +4 -1
  122. package/dist/check/support/is-generated-context-file.js.map +1 -1
  123. package/dist/commands/doctor.d.ts.map +1 -1
  124. package/dist/commands/doctor.js +4 -2
  125. package/dist/commands/doctor.js.map +1 -1
  126. package/dist/commands/init.d.ts.map +1 -1
  127. package/dist/commands/init.js +1 -0
  128. package/dist/commands/init.js.map +1 -1
  129. package/dist/config/config.d.ts +6 -0
  130. package/dist/config/config.d.ts.map +1 -1
  131. package/dist/config/index.d.ts +1 -1
  132. package/dist/config/index.d.ts.map +1 -1
  133. package/dist/config/index.js +1 -1
  134. package/dist/config/index.js.map +1 -1
  135. package/dist/config/parse-config.js +1 -0
  136. package/dist/config/parse-config.js.map +1 -1
  137. package/dist/config/parse-stack.d.ts.map +1 -1
  138. package/dist/config/parse-stack.js +2 -1
  139. package/dist/config/parse-stack.js.map +1 -1
  140. package/dist/config/serialize-config.js +9 -2
  141. package/dist/config/serialize-config.js.map +1 -1
  142. package/dist/config/stack.d.ts +17 -4
  143. package/dist/config/stack.d.ts.map +1 -1
  144. package/dist/config/stack.js +4 -1
  145. package/dist/config/stack.js.map +1 -1
  146. package/dist/dev/refresh-declarations.d.ts.map +1 -1
  147. package/dist/dev/refresh-declarations.js +4 -1
  148. package/dist/dev/refresh-declarations.js.map +1 -1
  149. package/dist/docs/write-docs.d.ts.map +1 -1
  150. package/dist/docs/write-docs.js +2 -0
  151. package/dist/docs/write-docs.js.map +1 -1
  152. package/dist/doctor/diagnose.d.ts +2 -1
  153. package/dist/doctor/diagnose.d.ts.map +1 -1
  154. package/dist/doctor/diagnose.js +4 -1
  155. package/dist/doctor/diagnose.js.map +1 -1
  156. package/dist/doctor/doctor-finding.d.ts +3 -2
  157. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  158. package/dist/doctor/format-diagnosis.js +4 -1
  159. package/dist/doctor/format-diagnosis.js.map +1 -1
  160. package/dist/doctor/override-findings.d.ts +10 -0
  161. package/dist/doctor/override-findings.d.ts.map +1 -0
  162. package/dist/doctor/override-findings.js +87 -0
  163. package/dist/doctor/override-findings.js.map +1 -0
  164. package/dist/file-moves/move-files.d.ts.map +1 -1
  165. package/dist/file-moves/move-files.js +10 -0
  166. package/dist/file-moves/move-files.js.map +1 -1
  167. package/dist/generate/kinds/property-kind.d.ts +3 -0
  168. package/dist/generate/kinds/property-kind.d.ts.map +1 -0
  169. package/dist/generate/kinds/property-kind.js +51 -0
  170. package/dist/generate/kinds/property-kind.js.map +1 -0
  171. package/dist/generate/kinds/route/nest-controller-vars.d.ts +11 -0
  172. package/dist/generate/kinds/route/nest-controller-vars.d.ts.map +1 -0
  173. package/dist/generate/kinds/route/nest-controller-vars.js +97 -0
  174. package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -0
  175. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  176. package/dist/generate/kinds/route/route-vars.js +1 -9
  177. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  178. package/dist/generate/kinds/route/success-status.d.ts +5 -0
  179. package/dist/generate/kinds/route/success-status.d.ts.map +1 -0
  180. package/dist/generate/kinds/route/success-status.js +11 -0
  181. package/dist/generate/kinds/route/success-status.js.map +1 -0
  182. package/dist/generate/kinds/route/write-nest-controller.d.ts +8 -0
  183. package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -0
  184. package/dist/generate/kinds/route/write-nest-controller.js +52 -0
  185. package/dist/generate/kinds/route/write-nest-controller.js.map +1 -0
  186. package/dist/generate/kinds/route-kind.d.ts.map +1 -1
  187. package/dist/generate/kinds/route-kind.js +6 -1
  188. package/dist/generate/kinds/route-kind.js.map +1 -1
  189. package/dist/generate/kinds.d.ts.map +1 -1
  190. package/dist/generate/kinds.js +2 -0
  191. package/dist/generate/kinds.js.map +1 -1
  192. package/dist/generate/refresh-docs.d.ts.map +1 -1
  193. package/dist/generate/refresh-docs.js +2 -0
  194. package/dist/generate/refresh-docs.js.map +1 -1
  195. package/dist/generate/shared-writes.d.ts.map +1 -1
  196. package/dist/generate/shared-writes.js +5 -0
  197. package/dist/generate/shared-writes.js.map +1 -1
  198. package/dist/help/notes.d.ts +1 -1
  199. package/dist/help/notes.d.ts.map +1 -1
  200. package/dist/help/notes.js +3 -1
  201. package/dist/help/notes.js.map +1 -1
  202. package/dist/help/usage.d.ts +1 -1
  203. package/dist/help/usage.d.ts.map +1 -1
  204. package/dist/help/usage.js +4 -2
  205. package/dist/help/usage.js.map +1 -1
  206. package/dist/init/agent-permissions.js +2 -0
  207. package/dist/init/agent-permissions.js.map +1 -1
  208. package/dist/init/files/audit-files.js +1 -1
  209. package/dist/init/files/audit-files.js.map +1 -1
  210. package/dist/init/files/persistence-files.d.ts.map +1 -1
  211. package/dist/init/files/persistence-files.js +2 -0
  212. package/dist/init/files/persistence-files.js.map +1 -1
  213. package/dist/init/knip-vars.d.ts.map +1 -1
  214. package/dist/init/knip-vars.js +10 -2
  215. package/dist/init/knip-vars.js.map +1 -1
  216. package/dist/init/manifest/dependencies-against-stack.d.ts +18 -0
  217. package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -0
  218. package/dist/init/manifest/dependencies-against-stack.js +95 -0
  219. package/dist/init/manifest/dependencies-against-stack.js.map +1 -0
  220. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  221. package/dist/init/manifest/dependencies-for.js +12 -2
  222. package/dist/init/manifest/dependencies-for.js.map +1 -1
  223. package/dist/init/manifest/overrides-for.d.ts +7 -0
  224. package/dist/init/manifest/overrides-for.d.ts.map +1 -0
  225. package/dist/init/manifest/overrides-for.js +9 -0
  226. package/dist/init/manifest/overrides-for.js.map +1 -0
  227. package/dist/init/manifest/pinned-below-a-fix.d.ts +14 -0
  228. package/dist/init/manifest/pinned-below-a-fix.d.ts.map +1 -0
  229. package/dist/init/manifest/pinned-below-a-fix.js +20 -0
  230. package/dist/init/manifest/pinned-below-a-fix.js.map +1 -0
  231. package/dist/init/manifest/scripts-for.js +5 -2
  232. package/dist/init/manifest/scripts-for.js.map +1 -1
  233. package/dist/init/manifest/versions.d.ts.map +1 -1
  234. package/dist/init/manifest/versions.js +31 -25
  235. package/dist/init/manifest/versions.js.map +1 -1
  236. package/dist/init/manifest/write-overrides.d.ts +9 -0
  237. package/dist/init/manifest/write-overrides.d.ts.map +1 -0
  238. package/dist/init/manifest/write-overrides.js +56 -0
  239. package/dist/init/manifest/write-overrides.js.map +1 -0
  240. package/dist/init/run-init.d.ts.map +1 -1
  241. package/dist/init/run-init.js +19 -3
  242. package/dist/init/run-init.js.map +1 -1
  243. package/dist/init/stack/resolve-queue.d.ts +4 -10
  244. package/dist/init/stack/resolve-queue.d.ts.map +1 -1
  245. package/dist/init/stack/resolve-queue.js +7 -11
  246. package/dist/init/stack/resolve-queue.js.map +1 -1
  247. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  248. package/dist/init/stack/resolve-stack.js +23 -4
  249. package/dist/init/stack/resolve-stack.js.map +1 -1
  250. package/dist/init/stack/stack-options.d.ts +2 -0
  251. package/dist/init/stack/stack-options.d.ts.map +1 -1
  252. package/dist/nest-controllers/controllers-file.d.ts +3 -0
  253. package/dist/nest-controllers/controllers-file.d.ts.map +1 -0
  254. package/dist/nest-controllers/controllers-file.js +5 -0
  255. package/dist/nest-controllers/controllers-file.js.map +1 -0
  256. package/dist/nest-controllers/nest-answer.d.ts +16 -0
  257. package/dist/nest-controllers/nest-answer.d.ts.map +1 -0
  258. package/dist/nest-controllers/nest-answer.js +2 -0
  259. package/dist/nest-controllers/nest-answer.js.map +1 -0
  260. package/dist/nest-controllers/nest-controller-entry.d.ts +16 -0
  261. package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -0
  262. package/dist/nest-controllers/nest-controller-entry.js +2 -0
  263. package/dist/nest-controllers/nest-controller-entry.js.map +1 -0
  264. package/dist/nest-controllers/read-nest-controllers.d.ts +15 -0
  265. package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -0
  266. package/dist/nest-controllers/read-nest-controllers.js +89 -0
  267. package/dist/nest-controllers/read-nest-controllers.js.map +1 -0
  268. package/dist/nest-controllers/refresh-nest-controllers.d.ts +9 -0
  269. package/dist/nest-controllers/refresh-nest-controllers.d.ts.map +1 -0
  270. package/dist/nest-controllers/refresh-nest-controllers.js +32 -0
  271. package/dist/nest-controllers/refresh-nest-controllers.js.map +1 -0
  272. package/dist/nest-controllers/render-controllers-file.d.ts +8 -0
  273. package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -0
  274. package/dist/nest-controllers/render-controllers-file.js +56 -0
  275. package/dist/nest-controllers/render-controllers-file.js.map +1 -0
  276. package/dist/platform-folders/platform-folders.d.ts.map +1 -1
  277. package/dist/platform-folders/platform-folders.js +10 -0
  278. package/dist/platform-folders/platform-folders.js.map +1 -1
  279. package/dist/presets/apply-preset.d.ts.map +1 -1
  280. package/dist/presets/apply-preset.js +22 -2
  281. package/dist/presets/apply-preset.js.map +1 -1
  282. package/dist/presets/identity-preset.d.ts.map +1 -1
  283. package/dist/presets/identity-preset.js +4 -1
  284. package/dist/presets/identity-preset.js.map +1 -1
  285. package/dist/presets/identity-refusal.d.ts.map +1 -1
  286. package/dist/presets/identity-refusal.js +11 -5
  287. package/dist/presets/identity-refusal.js.map +1 -1
  288. package/dist/presets/lay-out-prisma-models.d.ts +8 -0
  289. package/dist/presets/lay-out-prisma-models.d.ts.map +1 -0
  290. package/dist/presets/lay-out-prisma-models.js +51 -0
  291. package/dist/presets/lay-out-prisma-models.js.map +1 -0
  292. package/dist/presets/preset-files.d.ts.map +1 -1
  293. package/dist/presets/preset-files.js +3 -0
  294. package/dist/presets/preset-files.js.map +1 -1
  295. package/dist/presets/preset.d.ts +11 -0
  296. package/dist/presets/preset.d.ts.map +1 -1
  297. package/dist/sdk/client-files.d.ts +5 -3
  298. package/dist/sdk/client-files.d.ts.map +1 -1
  299. package/dist/sdk/client-files.js +8 -3
  300. package/dist/sdk/client-files.js.map +1 -1
  301. package/dist/sdk/client-manifest.d.ts +3 -0
  302. package/dist/sdk/client-manifest.d.ts.map +1 -1
  303. package/dist/sdk/client-manifest.js +15 -2
  304. package/dist/sdk/client-manifest.js.map +1 -1
  305. package/dist/sdk/client-operation.d.ts +6 -0
  306. package/dist/sdk/client-operation.d.ts.map +1 -1
  307. package/dist/sdk/read-operation.d.ts.map +1 -1
  308. package/dist/sdk/read-operation.js +6 -0
  309. package/dist/sdk/read-operation.js.map +1 -1
  310. package/dist/sdk/render-orpc.d.ts +8 -0
  311. package/dist/sdk/render-orpc.d.ts.map +1 -0
  312. package/dist/sdk/render-orpc.js +42 -0
  313. package/dist/sdk/render-orpc.js.map +1 -0
  314. package/dist/sdk/render-readme.d.ts +3 -0
  315. package/dist/sdk/render-readme.d.ts.map +1 -1
  316. package/dist/sdk/render-readme.js +46 -0
  317. package/dist/sdk/render-readme.js.map +1 -1
  318. package/dist/sdk/render-trpc.d.ts +9 -0
  319. package/dist/sdk/render-trpc.d.ts.map +1 -0
  320. package/dist/sdk/render-trpc.js +36 -0
  321. package/dist/sdk/render-trpc.js.map +1 -0
  322. package/dist/sdk/rpc-packages.d.ts +7 -0
  323. package/dist/sdk/rpc-packages.d.ts.map +1 -0
  324. package/dist/sdk/rpc-packages.js +9 -0
  325. package/dist/sdk/rpc-packages.js.map +1 -0
  326. package/dist/sdk/rpc.d.ts +4 -0
  327. package/dist/sdk/rpc.d.ts.map +1 -0
  328. package/dist/sdk/rpc.js +2 -0
  329. package/dist/sdk/rpc.js.map +1 -0
  330. package/dist/sdk/write-clients.d.ts.map +1 -1
  331. package/dist/sdk/write-clients.js +18 -3
  332. package/dist/sdk/write-clients.js.map +1 -1
  333. package/dist/stack/alias-vars.d.ts.map +1 -1
  334. package/dist/stack/alias-vars.js +2 -2
  335. package/dist/stack/alias-vars.js.map +1 -1
  336. package/dist/stack/audit-vars.js +1 -1
  337. package/dist/stack/audit-vars.js.map +1 -1
  338. package/dist/stack/cache-vars.d.ts +5 -1
  339. package/dist/stack/cache-vars.d.ts.map +1 -1
  340. package/dist/stack/cache-vars.js +9 -3
  341. package/dist/stack/cache-vars.js.map +1 -1
  342. package/dist/stack/stack-vars.d.ts +1 -1
  343. package/dist/stack/stack-vars.d.ts.map +1 -1
  344. package/dist/stack/stack-vars.js +11 -6
  345. package/dist/stack/stack-vars.js.map +1 -1
  346. package/dist/version.d.ts +1 -1
  347. package/dist/version.js +1 -1
  348. package/package.json +4 -4
  349. package/templates/architecture/extractable.declared.spec.ts.tpl +22 -17
  350. package/templates/architecture/extractable.manual.spec.ts.tpl +14 -9
  351. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +19 -14
  352. package/templates/context/module.manual.ts.tpl +11 -0
  353. package/templates/init/jest.config.js.tpl +6 -0
  354. package/templates/init/platform/composition/compose-application.manual.ts.tpl +50 -0
  355. package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +9 -3
  356. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +1 -1
  357. package/templates/init/platform/database/persistence-over.knex.ts.tpl +1 -1
  358. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +30 -1
  359. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +23 -1
  360. package/templates/init/platform/database/persistence.contract.spec.ts.tpl +113 -0
  361. package/templates/init/platform/database/persistence.orm.ts.tpl +8 -3
  362. package/templates/init/platform/database/schema.prisma.tpl +53 -0
  363. package/templates/init/platform/database/schema.typeorm.ts.tpl +17 -3
  364. package/templates/init/platform/database/table-statements.drizzle.ts.tpl +36 -0
  365. package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +1 -1
  366. package/templates/init/platform/files/create-files.ts.tpl +1 -1
  367. package/templates/init/platform/http/create-app-module.ts.tpl +20 -0
  368. package/templates/init/platform/http/start-http-server.express.ts.tpl +48 -1
  369. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +50 -2
  370. package/templates/init/platform/http/start-http-server.hono.ts.tpl +60 -1
  371. package/templates/init/platform/http/start-http-server.nest.ts.tpl +61 -3
  372. package/templates/init/platform/jobs/create-background-work.ts.tpl +2 -2
  373. package/templates/init/rules/infrastructure.md.tpl +3 -0
  374. package/templates/init/rules/presentation.md.tpl +7 -0
  375. package/templates/nest-controller/controller.spec.ts.tpl +57 -0
  376. package/templates/nest-controller/controller.ts.tpl +65 -0
  377. package/templates/pipeline/knip.json.tpl +4 -8
  378. package/templates/pipeline/package-scripts.json +1 -1
  379. package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +254 -0
  380. package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +10 -0
  381. package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +10 -0
  382. package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +10 -0
  383. package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +10 -0
  384. package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +10 -0
  385. package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +10 -0
  386. package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +10 -0
  387. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +6 -0
  388. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +12 -0
  389. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +6 -0
  390. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +12 -0
  391. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +6 -0
  392. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +12 -0
  393. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +6 -0
  394. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +12 -0
  395. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +6 -0
  396. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +12 -0
  397. package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +6 -0
  398. package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +12 -0
  399. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +6 -0
  400. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +12 -0
  401. package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +6 -0
  402. package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +12 -0
  403. package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +6 -0
  404. package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +12 -0
  405. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +6 -0
  406. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +12 -0
  407. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +6 -0
  408. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +12 -0
  409. package/templates/presets/identity/context/application/integration/handlers/account-deactivated.integration-handler.ts.tpl +4 -0
  410. package/templates/presets/identity/context/application/integration/handlers/member-joined.integration-handler.ts.tpl +4 -0
  411. package/templates/presets/identity/context/application/integration/handlers/member-removed.integration-handler.ts.tpl +4 -0
  412. package/templates/presets/identity/context/application/integration/handlers/organisation-opened.integration-handler.ts.tpl +4 -0
  413. package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +10 -1
  414. package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +10 -1
  415. package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +10 -1
  416. package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +10 -1
  417. package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +10 -1
  418. package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +10 -1
  419. package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +10 -1
  420. package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +12 -0
  421. package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +6 -0
  422. package/templates/presets/identity/context/infrastructure/external/crypto-invitation-tokens.adapter.ts.tpl +9 -0
  423. package/templates/presets/identity/context/infrastructure/external/environment-identity-provider-connection.adapter.ts.tpl +9 -0
  424. package/templates/presets/identity/context/infrastructure/external/keycloak-identity-provider-admin.adapter.ts.tpl +9 -0
  425. package/templates/presets/identity/context/infrastructure/persistence/account.mapper.prisma.ts.tpl +36 -0
  426. package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.prisma.ts.tpl +19 -0
  427. package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.prisma.ts.tpl +48 -0
  428. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +9 -0
  429. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +9 -0
  430. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +9 -0
  431. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +9 -0
  432. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +9 -0
  433. package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +9 -0
  434. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +43 -0
  435. package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.prisma.ts.tpl +20 -0
  436. package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +9 -0
  437. package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +9 -0
  438. package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +9 -0
  439. package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +9 -0
  440. package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +9 -0
  441. package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +9 -0
  442. package/templates/presets/identity/context/infrastructure/persistence/member.mapper.prisma.ts.tpl +34 -0
  443. package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.prisma.ts.tpl +26 -0
  444. package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +63 -0
  445. package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +81 -0
  446. package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +69 -0
  447. package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +80 -0
  448. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +63 -0
  449. package/templates/presets/identity/context/infrastructure/persistence/prisma-search-members-reader.repository.prisma.ts.tpl +82 -0
  450. package/templates/presets/identity/context/test/integration/account.repository.contract.spec.ts.tpl +3 -3
  451. package/templates/presets/identity/context/test/integration/delegation.repository.contract.spec.ts.tpl +5 -5
  452. package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +5 -5
  453. package/templates/presets/identity/context/test/integration/member.repository.contract.spec.ts.tpl +5 -5
  454. package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +3 -3
  455. package/templates/presets/identity/context/test/integration/search-members-reader.spec.ts.tpl +8 -8
  456. package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +95 -0
  457. package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +332 -0
  458. package/templates/presets/identity/explicit/access-policies.wiring.tpl +16 -0
  459. package/templates/presets/identity/prisma/models.prisma.tpl +128 -0
  460. package/templates/property/value-object.properties.spec.ts.tpl +38 -0
  461. package/templates/sdk/orpc.ts.tpl +46 -0
  462. package/templates/sdk/trpc.ts.tpl +86 -0
  463. /package/templates/presets/identity/context/test/worlds/{__context__.world.ts.tpl → __context__.world.declared.ts.tpl} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,324 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.91.0
8
+
9
+ **The background jobs and the process instances go to the database by default on every ORM of
10
+ the kit and with every container: `TypeOrmJobStore` and `TypeOrmProcessStore`, and one rule for
11
+ `init --queue`.** `@ddd-ts-kit/typeorm` gains the job store and the process store, with their
12
+ tables `jobEntity()` and `processEntity()`, held to `jobStoreContract` and `processStoreContract`
13
+ on PGlite and on PostgreSQL: a job enqueued by a command is written by its transaction, a claim
14
+ takes the due rows `FOR UPDATE SKIP LOCKED`, an idempotency key is unique per job name and tenant,
15
+ a step of a process manager saves its instance in its unit of work. `init --orm typeorm` now
16
+ accepts `--queue database` and writes the two entities in the `messaging` schema. And the default
17
+ of `--queue` no longer depends on the container: `database` on Knex, Drizzle, Prisma and TypeORM
18
+ with tsyringe, Nest or a platform wired by hand, `memory` with a custom persistence or none. Until
19
+ now a project under Nest or wired by hand kept its jobs in memory unless it asked otherwise.
20
+
21
+ To move: nothing for an existing project, whose `stack.queue` is kept. A new project under Nest or
22
+ wired by hand that wants its jobs in memory passes `--queue memory`.
23
+
24
+ **The identity preset is written on Prisma: `init --orm prisma --preset identity`.** The context
25
+ comes with its Prisma adapters (the repositories of the five aggregates, the search reader of the
26
+ members, their mappers over the generated client, the declarations of the personal fields), and
27
+ its models and enums laid out in `prisma/schema.prisma` in place of the ones the generators start:
28
+ the closed vocabularies (the role of a member, the status of an account and of an invitation) are
29
+ enums of the schema, the token of an invitation is unique, and one current membership per account
30
+ and organisation is a partial unique index, `where: { removedAt: null }`, for which the preset
31
+ turns on the `partialIndexes` preview feature of the client generator: a preview feature, which
32
+ Prisma may change without a major version, so after an upgrade of Prisma check that
33
+ `generated/schema.sql` still ends `members_current_idx` with `WHERE ("removed_at" IS NULL)`. The tables belong to no
34
+ tenant, as on Knex and Drizzle. The preset is still refused on TypeORM, the explicit style and
35
+ NestJS.
36
+
37
+ To move: nothing for an existing project. A project on Prisma that wants the context runs
38
+ `ddd-ts-kit generate context identity --preset identity`, then `npm run db:client` and
39
+ `npm run db:generate identity`.
40
+
41
+ **A route is served as an oRPC procedure too, for a typed TypeScript client: `orpcRouter` of `@ddd-ts-kit/http/orpc`.**
42
+ `orpcRouter(routes, options)` turns each route into an oRPC procedure named by its `operationId`,
43
+ for `RPCHandler` of `@orpc/server` (1.15 or later, a new optional peer of `@ddd-ts-kit/http`),
44
+ mounted next to the routes under a prefix such as `/rpc`. Each call runs through `executeRoute`
45
+ with the options of the HTTP adapter: the same guards, principal, tenant, validation,
46
+ permissions, `onError` and `around`. A refusal is an `ORPCError` with the code and the status of
47
+ its problem document, which it carries as its data, and a code the route declares (its own, its
48
+ guards', `VALIDATION_FAILED`, the preconditions) is a defined error for the client. What only HTTP
49
+ carries stays with the routes: an answer has no headers (no `ETag`, no cache policy), JSON is the
50
+ only representation, a route that receives a file or a raw body is not a procedure, and a file or
51
+ a list streamed as it is read is refused with 406 and closed.
52
+
53
+ A list read as it comes and closed before its end now closes its cursor: the pipeline read its
54
+ first item in advance, and stopping the list, as a client that goes away does, left the cursor
55
+ open until it was collected.
56
+
57
+ **`init --rpc orpc` serves the routes of the contexts under `/rpc` as oRPC procedures, and `ddd-ts-kit sdk` gives each client its oRPC contract at `./orpc`.**
58
+ The new key `stack.rpc` (`none`, `orpc`) has `start-http-server.ts` mount `orpcRouter` of
59
+ `@ddd-ts-kit/http/orpc` under `/rpc` on Express, Fastify, Hono and NestJS, with the options of the
60
+ HTTP boundary, and adds `@orpc/server`; it needs an HTTP framework. `ddd-ts-kit sdk` then writes
61
+ `src/orpc.ts` in each client: the oRPC contract of its document (`contract`, `createRpcClient`),
62
+ each procedure named by its `operationId`, its input and answer the types of the HTTP client, its
63
+ refusals the codes of `x-error-codes` with their status, so that `isDefinedError` narrows them.
64
+ `@orpc/client` and `@orpc/contract` become the only dependencies of the client, whose root entry
65
+ still has none; setting the key back to `none` takes them and `src/orpc.ts` away. The kit no longer
66
+ documents oRPC as set aside: it is a second door to the routes, not a pair of the contract.
67
+
68
+ To move: a project that wants the procedures runs `init --force --rpc orpc` on a clean tree (it
69
+ records the key, rewrites `start-http-server.ts` and adds `@orpc/server`), then
70
+ `npx ddd-ts-kit sdk` when it has clients.
71
+
72
+ **The identity preset is written in the explicit style and under NestJS: `init --di manual --preset
73
+ identity` and `init --http nest --di nest --preset identity`.** The classes of the context are written
74
+ without the declarations of the kernel, a policy carrying its name and its permission, and the preset
75
+ lays out `identity.module.ts` whole once the generators ran: its adapters, its use cases with the
76
+ permission each requires, the publishers of its facts, the consumers that keep the identity provider
77
+ in line (each with its consumer name, the processed-event store and the unit of work), and its
78
+ routes, in short functions named after what they wire, the regions of the generators kept. Its
79
+ policies join `access-policies.ts` of the platform, and the world of its specs wires the fakes the
80
+ way the module wires the adapters; `test/unit/identity.module.spec.ts` holds the module itself to its
81
+ use cases, on the platform: each command and query has its handler and its permission, and each
82
+ route is mounted. Under NestJS the routes are mounted with those of the other
83
+ contexts by the app module of the platform. The explicit style stays refused on tsyringe, which
84
+ reads the declarations, and `--dependencies signature` is asked of the declared style only.
85
+
86
+ To move: nothing for an existing project.
87
+
88
+ **A project generated on Jest is green from its first minute, and the kit now runs it: Jest is
89
+ installed in the workspace and one Jest stack joins the stacks its end-to-end suite runs.** Running
90
+ it found what a type check could not: a Jest project listed `@vitest/coverage-v8`, which knip
91
+ refused as unused; knip entered its fakes and worlds through top-level patterns, reported as
92
+ matching nothing before the first context, instead of a `jest` section beside the `vitest` one of
93
+ a Vitest project; the extractability spec of `test/architecture/` gave `it.each` an empty table,
94
+ which Jest refuses, before the first context (it now waits with an `it.todo`); an import of a
95
+ directory (`@/contexts/<context>/published-language`) did not resolve, each alias now mapping to the
96
+ source then to the barrel of the directory; the modules of the Prisma client, written with `.js`,
97
+ did not resolve, now mapped back to their sources; and a hook opening the test database outlasted
98
+ the 5 seconds of Jest, now 60 as on Vitest. The identity preset is held green on NestJS,
99
+ class-validator, Prisma, shared tables and Jest, the stack of the spend management example.
100
+
101
+ To move: in `jest.config.js`, write each alias of `moduleNameMapper` as
102
+ `['<rootDir>/src/$1.ts', '<rootDir>/src/$1/index.ts']` (the check asks for it), add
103
+ `testTimeout: 60_000`, and on Prisma `'^(\\.{1,2}/.*)\\.js$': '$1'`; in `knip.json`, move the
104
+ entries of the fakes and the worlds into a `jest` section with `"config": ["jest.config.js",
105
+ "jest.e2e.config.js", "jest.mutation.config.js"]`; drop `@vitest/coverage-v8` from the dev
106
+ dependencies.
107
+
108
+ **A route is served as a tRPC procedure too: `trpcRouter` of `@ddd-ts-kit/http/trpc`.**
109
+ `trpcRouter(routes, options)` turns each route into a tRPC procedure named by its `operationId`, a
110
+ query for a `GET` route and a mutation for the other methods, for the adapters of `@trpc/server`
111
+ (11.10 or later, a new optional peer of `@ddd-ts-kit/http`), mounted next to the routes under an
112
+ endpoint such as `/trpc`. Each call runs through `executeRoute` with the options of the HTTP
113
+ adapter, as a call of `orpcRouter` does. A refusal is a `TRPCError` of the code tRPC has for its
114
+ status (`UNAUTHORIZED` for 401, `CONFLICT` for 409), with the problem document of the route in
115
+ `data.problem`, whose `code` is the one of the kit: tRPC has a fixed set of codes of its own. What
116
+ only HTTP carries stays with the routes, as over oRPC, and a binary body is refused with 406 too,
117
+ as tRPC answers JSON only.
118
+
119
+ Over oRPC, a file or a streamed list refused with 406 now carries its problem document as `data`,
120
+ as every other refusal does.
121
+
122
+ **`init --rpc trpc` serves the routes of the contexts under `/trpc` as tRPC procedures, and `ddd-ts-kit sdk` gives each client the type of their router at `./trpc`.**
123
+ `stack.rpc` takes a third value, `trpc`: `start-http-server.ts` mounts `trpcRouter` of
124
+ `@ddd-ts-kit/http/trpc` under `/trpc` on Express, Fastify, Hono and NestJS, with the options of
125
+ the HTTP boundary, and adds `@trpc/server`; it needs an HTTP framework, as `orpc` does. `ddd-ts-kit
126
+ sdk` then writes `src/trpc.ts` in each client: `AppRouter`, the type of the router written from
127
+ its document, a query for each `GET` operation and a mutation for the others, their input and
128
+ answer the types of the HTTP client, a refusal carrying its problem document in `data.problem`;
129
+ `createRpcClient` and `isRpcRefusal` call it. A front end imports the client, never the code of
130
+ the server. `@trpc/client` and `@trpc/server` become the only dependencies of the client; moving
131
+ to another value takes them and `src/trpc.ts` away.
132
+
133
+ To move: a project that wants the procedures runs `init --force --rpc trpc` on a clean tree (it
134
+ records the key, rewrites `start-http-server.ts` and adds `@trpc/server`), then
135
+ `npx ddd-ts-kit sdk` when it has clients. A project that served oRPC removes `@orpc/server` from
136
+ its `package.json`: `init` adds the dependencies of a stack, it does not take back those of the
137
+ previous one.
138
+
139
+ **`init` on an existing project names each dependency of its `package.json` the stack about to be written contradicts.** The first `init` of a project that already has a `package.json`, a dry run included, adds a note per key its direct dependencies answer otherwise than the flags (`package.json depends on fastify, and the project is written for --http express: pass --http fastify to keep it.`), for the HTTP framework, the validation library, the injection, the test runner, the ORM, the database, the broker, the authentication, the logger, the error reporter and the storage. Two dependencies that answer one key differently are left to the owner, and said; the rights model is never read from a dependency. Nothing is written by these notes, and an initialised project is not read again. The `bootstrap` skill puts them to the owner.
140
+
141
+ **The instances of the process managers are kept in the tenant of the work on Knex, Drizzle, Prisma and TypeORM alike, under a key that includes the tenant.**
142
+
143
+ `KnexProcessStore`, `DrizzleProcessStore`, `PrismaProcessStore` and `TypeOrmProcessStore` take `tenant` (the `ExecutionScope`): a step loads and changes the instances of its own tenant only, and work that names no tenant is refused with `NoCurrentTenantError`. The table of each package (`createProcessTable`, `processesTable`, the `ProcessInstance` model, `processEntity`) always has `tenant_id`, the empty text outside any tenant, and its primary key is `(tenant_id, name, id)`: two tenants may run an instance under the same correlation key, a month or an invoice number, where the first save of the second was refused before. `processStoreContract` proves it with `storeInTenant`, on the four packages. A project generated with `--tenancy` gives the scope to its process store: `Persistence.processes` is now `(scope) => ProcessStore`.
144
+
145
+ To move: drop `tenant: true` from `createProcessTable` (the option is gone, the column always there); `DrizzleProcessStore` takes its table as `{ table }`. A database created before needs a migration that adds `tenant_id` (`''` for the rows of no tenant, `addTenantColumn` of `@ddd-ts-kit/knex` for those of a tenant) and makes `(tenant_id, name, id)` the primary key; on Prisma, `prisma migrate dev` writes it from the model. In a generated project, `persistence.processes` is called with the execution scope (`persistence.processes(scope)`), as `init` now writes it.
146
+
147
+ **A renamed `operationId` is a breaking change of the API when the routes are served as procedures, and the architecture reviewer says so.**
148
+ With `stack.rpc` set to `orpc` or `trpc`, a procedure is named by the `operationId` of its route
149
+ and called at that name: renaming it, giving a `GET` route another method (a tRPC query becomes a
150
+ mutation) or having a route receive a file breaks a front end already deployed, which answers
151
+ 404 or calls it the wrong way. The table "Breaking or not" of the `document` skill lists these
152
+ three changes, the client SDK guide says it, and the `architecture-reviewer` agent reports them
153
+ from the diff of `openapi/`, blocking unless the change says its consumers move with it.
154
+
155
+ **`generate property <context> <ValueObject>` writes the laws of a value object as a spec on generated values.** The spec lands beside the spec of the value object (`test/unit/<name>.vo.properties.spec.ts`), with an arbitrary built on its factory (`any<Name>()`), a first law (the value is equal to the one created again from its own value) and one planned rule per kind of law (an invariant after each operation, a symmetry, a round trip), under Vitest and Jest, for value objects that throw or return a `Result`. `fast-check` joins the development dependencies when the project does not have it yet; that write is a shared one, so a worker confined to its context runs the kind with `--local-only` once fast-check is there. The value object must exist: the refusal names the command that creates it.
156
+
157
+ **`ddd-ts-kit check --baseline write` records the errors an existing codebase already has, and `check` then reports only new ones.** The errors of the checker are counted by file and by rule in `ddd-ts-kit-baseline.json`, the shape of `eslint-suppressions.json`. While a file has no more errors of a rule than the baseline records, `check` and `check-file` (the hook of the agent) leave them quiet; once it has more, all of them are reported. A recorded count the project no longer reaches fails `check` until `check --baseline prune` lowers it, so the baseline only shrinks. Warnings are not recorded. Writing it is a decision of the project owner, who runs the command in a terminal: the guard of the plugin refuses `check --baseline write` and any direct edit of the file to an agent, under Claude Code, Codex and Copilot alike, and the permissions `init` writes ask before both for an agent without the plugin. `check --baseline prune` is free.
158
+
159
+ To move: in a project initialised before this version, run `npx ddd-ts-kit init` again: it adds the two permissions to `.claude/settings.json` and names them.
160
+
161
+ **`ddd-ts-kit check` refuses in a context the tools of Nest that the kit does its own way, and says which tool of the kit to use instead (`nest/no-parallel-pipeline`).**
162
+ The routes of the kit are mounted under Nest, not through its pipeline: a Nest guard, pipe,
163
+ exception filter or interceptor never sees them, and a Nest controller written in a context was
164
+ a route the checker let through, with no declared security, no problem codes and no place in the
165
+ contract (`authz/declared` judged the controllers of the kit only). The new rule, an error,
166
+ reports in `presentation/`, `infrastructure/` and the module file of a context, tests apart: a
167
+ controller and its decorators, a guard, a pipe, an exception filter or an `HttpException`, an
168
+ interceptor or the `Logger` of `@nestjs/common`, and `@nestjs/core`, `@nestjs/swagger`,
169
+ `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/jwt`, `@nestjs/schedule`, `@nestjs/bull(mq)`,
170
+ `@nestjs/config`, `@nestjs/throttler`, `@nestjs/cache-manager`, `@nestjs/event-emitter`, the ORM
171
+ modules of Nest and `@nestjs/terminus`. Each finding names the tool of the kit in its place. The
172
+ container of Nest (`@Injectable()`, `@Inject()` on an adapter bound as a provider), its WebSocket,
173
+ GraphQL, microservice and testing packages, and everything in the platform are left alone. The
174
+ HTTP frameworks guide gains "Where each tool of Nest goes", and the `wiring` skill `nest.md`.
175
+
176
+ To move: a project with Nest code in a context runs `npx ddd-ts-kit check` and replaces each
177
+ finding by the tool its message names (a Nest controller by `generate route`, a role guard by the
178
+ permission of the use case, an `HttpException` by a refusal of the code list), or moves what is
179
+ not a use case to the platform.
180
+
181
+ **A file that moves keeps the errors `ddd-ts-kit-baseline.json` records for it.** Adopting the kit is made of moving code into the canonical tree: `move-to-module`, `context-layout` and `platform-folders` now carry the entry of each file they move to its new path, and `check --baseline prune`, which an agent may run, follows the renames git sees since the baseline was committed (a `git mv`) before it lowers the counts. A count follows its file and is never raised, so a move silences nothing new. A file moved otherwise (a plain `mv` git does not see as a rename) still reports its errors at its new path, and its old entry fails until the owner writes the baseline again.
182
+
183
+ **A Nest controller is a route of the kit: `@KitRoute` on its method, `createControllersModule` of `@ddd-ts-kit/http/nest` to serve it.**
184
+ A project on NestJS writes its controllers as Nest does (`@Controller`, `@Get`, `@Post`,
185
+ `@Param`, `@Query`, `@Headers`, `@Body` with a DTO class, `@HttpCode`, injection by constructor),
186
+ and adds `@KitRoute({ operationId, summary, guards, errors, response })` to each method,
187
+ `@KitRoutes({ guards, tags, errors })` to the class for what its routes share. The kit, not Nest's
188
+ router, serves the method, through the pipeline of every route: guards, validation of the DTO
189
+ (`schemaOfClass: classSchema`), problem documents, tracing, the contract, and a procedure over
190
+ `/rpc` and `/trpc`. `@CurrentActor()` hands the method the caller the authentication resolved;
191
+ `@RouteContext()` the context of the request. `nestControllerRoutes` gives the same routes without
192
+ Nest's container, for the contract and the procedures. What the kit's pipeline would not run is
193
+ refused when the routes are built: `@UseGuards`, `@UsePipes`, `@UseInterceptors`, `@UseFilters`,
194
+ `@Header`, `@Redirect`, `@Render`, `@Sse`, `@Version`, pipes on a parameter, `@Req`, `@Res`; a
195
+ route with no guard is refused; a controller also among the `controllers` of a Nest module stops
196
+ the start. The metadata Nest's decorators record is read in one place, checked on each read, and
197
+ held by a test on the Nest the kit is released with.
198
+
199
+ **`nest/no-parallel-pipeline` lets a Nest controller the kit serves declare its routes with Nest's decorators, and refuses anywhere a controller Nest serves that reaches a use case.**
200
+ In a context, a file that imports `KitRoute` of `@ddd-ts-kit/http/nest` may use `@Controller`,
201
+ `@Get`, `@Post` and the other methods, `@Param`, `@Query`, `@Headers`, `@Body` and `@HttpCode` of
202
+ Nest: the kit reads them and serves the route through its own pipeline. The raw request and answer
203
+ (`@Req`, `@Res`, `@Header`, `@Redirect`, `@Render`, `@Sse`, uploads), guards, pipes, filters and
204
+ interceptors of Nest stay refused there. Outside the contexts, under the source root and outside
205
+ the tests, a file that imports `Controller` of `@nestjs/common`, not `KitRoute`, and names
206
+ `CommandBus` or `QueryBus` or imports a file of a context is reported: a controller Nest serves
207
+ that reaches a use case has no declared security, no problem codes and no place in the contract,
208
+ and moving it to the platform no longer hides it. A controller of the platform that reaches no
209
+ use case (health, metrics) is left alone.
210
+
211
+ To move: a Nest controller of the platform that sends commands or queries gets `@KitRoute` on each
212
+ method and moves to `createControllersModule`, or becomes a route of the context.
213
+
214
+ **A method of a Nest controller the kit serves that returns a value without `response.body` is refused, instead of answering an empty body.**
215
+ In Nest, what a method returns is the body of the answer; under `@KitRoute` the kit answers the
216
+ body its `response.body` declares, as the contract does, and dropped what an undeclared method
217
+ returned without a word. The routes are now refused when they are built if TypeScript recorded
218
+ that the method returns a value (`design:returntype`, under `emitDecoratorMetadata`), and an
219
+ `async` method, whose recorded type is only `Promise`, is refused at the call: a 500, the reason
220
+ told to `onError`.
221
+
222
+ To move: give `response: { body }` to each `@KitRoute` whose method returns what the caller reads,
223
+ or return nothing.
224
+
225
+ **The guard of the plugin finds the CLI a workspace hoisted to a parent directory.** It looked for `node_modules/.bin/ddd-ts-kit` in the project only, so in a project of an npm or pnpm workspace, whose install lands at the root of the monorepo, it found none and skipped, without a word, every check that needs the CLI: the check of each written file, the refusal to stop while errors remain, the gates of a story. It now looks where Node would, from the project up to the root of the filesystem.
226
+
227
+ To move: in a project of a workspace, the guard now runs those checks. Run `npx ddd-ts-kit check` before updating the plugin: an error it reports would otherwise first appear as a refusal to end a session.
228
+
229
+ **A project generated on an ORM holds the stores of the kit, as its platform wires them, to their contracts; and the test database of a Drizzle project has its unique indexes.**
230
+
231
+ `init` writes `src/platform/database/persistence.contract.spec.ts` on Knex, Drizzle, Prisma and TypeORM: the outbox, processed-event, job and process stores of `Persistence`, on the database of `open-test-database.ts`, run the contracts of `@ddd-ts-kit/testing` with what the stack turns on (`carriesTenant` and `storeInTenant` under `--tenancy`, the unit of work of a step with `--queue database`), and the event store with its snapshots, checkpoints and keys under `--event-sourcing on`. A store bound without the tenant the stack asks for now fails a spec of the project. On Drizzle, `table-statements.ts` creates the unique indexes and constraints of `schema.ts` too: the in-process database of the tests lacked the one of `background_jobs`, so a job enqueued in a spec failed with `there is no unique or exclusion constraint matching the ON CONFLICT specification`.
232
+
233
+ Run for real at night on Prisma (NestJS, Jest, Kafka, shared tables, the jobs in the database) and on TypeORM, installed from the packed kit, three more things came out, now fixed: under Jest, a port that a module file wiring by hand never loads counted as uncovered code and dropped the domain under its floor from the first use case, so the ports (abstract members only, `ports/abstract-class`) are no longer measured, under Vitest or Jest; knip reported `prisma/schema.prisma` as outside the project on Prisma, and `data-source.ts`, which only the TypeORM CLI loads, as unused on TypeORM.
234
+
235
+ To move: on a project generated before, `init --force` writes the spec and the new `table-statements.ts`; a Drizzle project that copied `table-statements.ts` by hand adds `uniqueIndexStatements` from the new template; `knip.json` gets `"prisma/**/*.prisma"` in `project` on Prisma, and the data source in `entry` on TypeORM.
236
+
237
+ **`init --routes nest` makes a Nest controller what `generate route` writes: Nest builds it with the bus it injects, the kit serves it.**
238
+ A new form of `stack.routes`, `nest`, for a project on `--http nest` with class-validator. `generate
239
+ route` writes `<use-case>.controller.ts` with Nest's `@Controller()`, `@Post` or `@Get`, `@Param`,
240
+ `@Body` typed by the DTO classes beside it, `@CurrentActor()` for the caller, the bus injected by
241
+ Nest (`@Inject(CommandBus)`), and `@KitRoute` and `@KitRoutes({ group })` of
242
+ `@ddd-ts-kit/http/nest`; the module of the context lists it under `controllers`, the application
243
+ composes its routes with the others (`nestControllers`), and the Nest module of the platform builds
244
+ it with the buses of the platform (`provideControllers`). The routes keep the guarantees of every
245
+ route: the guards of the group, validation, problem documents, the contract, and the procedures
246
+ over `/rpc` and `/trpc`. A search stays a controller of the kit (`generate controller`), and
247
+ `--mapper` and `--serializer` are left out: the method maps its input and its answer itself.
248
+
249
+ `@ddd-ts-kit/http/nest` gains `nestControllers`, `provideControllers` and `nestControllerRoute`,
250
+ and `@KitRoutes` a `group`, a route group of the kit whose prefix, tags, guards and codes come first.
251
+
252
+ To move: a new Nest project passes `--routes nest`; an existing one keeps its routes, and a context
253
+ that gets Nest controllers needs the `controllers` list of the module file and the composition of
254
+ the platform that `init --force --routes nest` writes.
255
+
256
+ **On trial, `"dependenciesBeforeWrite": true` has the guard of the plugin refuse, before the write, a new import that breaks a dependency rule.** The lines a session is about to add to a TypeScript file (the content of a `Write`, the replacements of an `Edit`, the added lines of a Codex patch), less those the file already held, are judged by `layer/domain-purity`, `layer/application-inward`, `layer/infrastructure-no-presentation`, `layer/presentation-no-infrastructure` and `context/published-language-only`, and the write is refused with the message of the checker, under Claude Code, Codex and Copilot; the file never reaches the disk with the import. The other rules stay after the write. The key is off by default. `ddd-ts-kit check-file` gains `--content-from <file>`, which judges a given text as the content of the path, and `--rule <id>`. Each judged write is recorded, on the machine only, in `.git/ddd-ts-kit/before-write.jsonl` of the repository (the file, the rules refused, the time the check took), so that the trial can be decided on what it did; the example application runs it.
257
+
258
+ **`@KitRoute` is optional: each method of a Nest controller the kit serves that carries a route decorator of Nest is a route, named after the method.**
259
+ `@Post`, `@Get` and the other route decorators of Nest are enough: the route is named by the
260
+ method (`issueInvoice`), summed up by its name as a sentence (`Issue invoice`), behind the guards
261
+ of `@KitRoutes` on the class. `@KitRoute` says only what Nest does not: another name, guards of its
262
+ own, the refusals it answers, the body it answers (a method that returns a value without it is
263
+ still refused, never answered empty). `generate route` under `"stack.routes": "nest"` no longer
264
+ writes the name and the summary, and `nest/no-parallel-pipeline` takes a file that imports
265
+ `KitRoutes` alone for a controller the kit serves. The docs say that a generated controller
266
+ injects the buses only, the providers the platform gives Nest.
267
+
268
+ **A project without a database (`--orm custom` or `none`) and with `--cache redis` compiles again: its outbox relay is woken by its own store alone.**
269
+
270
+ `main.ts` (and the `main.ts` of each extracted service) gave the relay two `wakeOn` keys, the signal of the in-memory persistence and the Redis signal, which TypeScript refuses (`An object literal cannot have multiple properties with the same name`). An outbox kept in the memory of the process is relayed by that process alone, so the Redis signal, which wakes the relay of another process, is no longer created there; with a database it stays. Found by the stacks that now meet every pair of capability values, generated and type-checked at night and before a release.
271
+
272
+ To move: on such a project, `init --force` writes `main.ts` and the Redis services again; by hand, remove `wakeOn: redis.relaySignal` from `main.ts`.
273
+
274
+ **A criterion of a story that states a law over every value of a value object becomes a property.** In the design review of the `story` skill, such a criterion ("never negative", "the total equals the sum of its lines", "overlaps the other in both directions or in none") gets a `Laws: <ValueObject>: <law>` line in the section of its row, and the build of the row states it with `generate property`, the law its title; the criterion keeps its scenarios in the acceptance. Measured on the example before its specs were hardened: the property of symmetry of `Range.overlaps` kills a mutant of a bound (`<` to `<=`) that its examples let through.
275
+
276
+ **What a method of a Nest controller answers is its signature: the kit reads it into a generated `<context>.controllers.ts`, and `@KitRoute` no longer says it.**
277
+ Under `"stack.routes": "nest"`, `ddd-ts-kit generate`, `docs` and the `dev` script write
278
+ `<context>.controllers.ts` at the root of each context: its Nest controllers, each with what its
279
+ route methods answer as their signatures say it (`Promise<IssuedInvoice>` a DTO class,
280
+ `Promise<Accepted>` an identifier, `Promise<void>` nothing), through `withAnswers` of
281
+ `@ddd-ts-kit/http/nest`. The module of the context lists them from that file, so `generate route`
282
+ no longer touches it, and the generated controller declares in `@KitRoute` its validation and its
283
+ refusal codes only, its status through `@HttpCode` of Nest when Nest would answer another. The
284
+ check `nest/controllers-current` keeps the file current and reports a route method whose answer
285
+ the kit cannot read into a schema (an array, an inline type, an interface, no type) and whose
286
+ `@KitRoute` declares no `response`. A DTO without a decorated field accepts the empty object
287
+ alone, as `whitelist` and `forbidNonWhitelisted` refuse any field.
288
+
289
+ To move: a project on `--routes nest` runs `npx ddd-ts-kit docs` once, and its context modules
290
+ list `<context>Controllers` from the generated file in place of their `controllers` list.
291
+
292
+ ## 0.90.0
293
+
294
+ **A generated project forces qs `^6.16.0`, and multer `^2.5.0` on Nest, where its stack still pins the vulnerable versions; one on Fastify asks for `fastify` `^5.12.7`.** Stryker 10.1 asks for `typed-rest-client` 2.3, which asks for qs 6.15.1 exactly (three denials of service, moderate), and `@nestjs/platform-express`, up to 12.2.0, asks for multer 2.4.0 exactly (a denial of service through a pending `fileFilter`, high). `init` forces the fixed versions in `overrides` of `package.json` under npm, and of `pnpm-workspace.yaml` under pnpm, which reads nothing of `package.json`. An override the project already sets for one of them is kept, and said, unless `--force`. Fastify 5.12.2 to 5.12.5 let a request header go around the validation of a schema whose `propertyNames` reads it by case (low).
295
+
296
+ To move: `npx ddd-ts-kit init` adds the overrides (or write them by hand: `"overrides": { "qs": "^6.16.0", "multer": "^2.5.0" }` in `package.json` under npm, the same entries under `overrides:` of `pnpm-workspace.yaml` under pnpm, multer on Nest alone), then `npm install` (`pnpm install`). Check that `npm ls qs multer` (`pnpm why qs multer`) shows no qs below 6.16 and no multer below 2.5; a copy left older moves with `npm update qs multer`. In a project on Fastify, install `fastify@^5.12.7`.
297
+
298
+ **The background jobs and the process instances live in the database on Prisma too:
299
+ `PrismaJobStore` and `PrismaProcessStore`, and `init --orm prisma --queue database`.** The two
300
+ stores of `@ddd-ts-kit/prisma` are held to `jobStoreContract` and `processStoreContract`, on PGlite
301
+ and on PostgreSQL. A job enqueued by a command is written by the transaction of that command, so it
302
+ exists if and only if the command committed; a claim selects the due rows `FOR UPDATE SKIP LOCKED`,
303
+ the one raw statement of the store, and leases them in a short transaction; an idempotency key is
304
+ unique per job name and tenant. A step of a process manager saves its instance in the transaction
305
+ of its unit of work, refused with `ConcurrencyError` at a stale version. Their models ship in
306
+ `prisma/jobs-and-processes.postgresql.prisma`; the checkpoint of a job and the state of an
307
+ instance are JSON in a text field, since Prisma Client writes a SQL `NULL` to a `Json` field only
308
+ through the sentinel of the generated client. `init` writes the `BackgroundJob` and
309
+ `ProcessInstance` models in the `messaging` schema of `prisma/schema.prisma` and binds the stores in
310
+ `persistence-over.ts`; on Prisma with tsyringe `--queue` now defaults to `database`, as on Knex and
311
+ Drizzle, and with `--queue redis` the process instances stay in the database.
312
+
313
+ To move: a project on Prisma that keeps its jobs in memory and wants them in the database runs
314
+ `init --force --queue database` on a clean tree, then `npm run db:generate <name>` for the two new
315
+ tables.
316
+
317
+ **The four rules that read what a test says are errors: `test/title-states-a-rule`, `test/no-logic`, `test/assertion-present` and `test/refusal-by-code`.** They were warnings in 0.89, listed by `ddd-ts-kit lint` after its report without failing it; `recommended` of the ESLint plugin and `ddd-ts-kit rules` now give them `error`, as `strict` did, and the lint fails on them.
318
+
319
+ To move: before upgrading, run `npm run lint` on 0.89 and take up what it lists under these four rules: rename a title that says `should` or names a method, move a loop to an `it.each` and a decision to a builder or a fake, replace a `toThrow('message')` by the code of the refusal, and write `it.todo` where a test has no body. A project that keeps one of them a warning sets `"rules": { "test/no-logic": "warn" }` in `ddd-ts-kit.config.json`, rule by rule.
320
+
321
+ **`ddd-ts-kit doctor` says when an override `init` writes is missing, or no longer needed.** `init` forces qs `^6.16.0`, and multer `^2.5.0` on Nest, under a dependency that pins them below a security fix; nothing removed such an override from a project once that dependency was fixed, and it would hold the package back when a later major is asked for. `doctor` now reads, on what is installed, the range the parent asks for (`typed-rest-client` under `@stryker-mutator/core`, `@nestjs/platform-express`), found from the real place of each package under npm and under pnpm, against the overrides of `package.json` or of `pnpm-workspace.yaml`: `override <name>: missing` while the parent still pins the package below the fix and the project does not force it, which fails `--strict`; `override <name>: no longer needed` once the parent asks for the fixed version itself, said without failing it.
322
+
323
+ To move: run `npx ddd-ts-kit doctor` after an install; remove an override it says is no longer needed from the file it names, then install again.
324
+
7
325
  ## 0.89.0
8
326
 
9
327
  **`clean/one-export-per-file` runs under the JS plugin API of Oxlint.** The rule walked the
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:c59e62b7dedda6a7 -->
2
+ <!-- translation-of: README.md sha256:b4a3668e41eb11a1 -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -88,7 +88,11 @@ générés tels que les scripts du projet les écrivent pour un projet qui n'a e
88
88
  que le premier *commit* les contienne et que `docs:check` passe d'emblée ; un contrat déjà
89
89
  présent est laissé tel quel, `--force` compris. Un `package.json` existant est fusionné : les
90
90
  scripts et les dépendances qui manquent sont ajoutés, les vôtres sont gardés et mentionnés dans
91
- les notes. Relancé plus tard, `init` garde la *stack* enregistrée dans la configuration.
91
+ les notes. La première fois, les notes nomment aussi chaque dépendance que la *stack* sur le
92
+ point d'être écrite contredit, et l'option qui la garde (`package.json depends on fastify, and the
93
+ project is written for --http express: pass --http fastify to keep it.`), en *dry run* compris :
94
+ lancez d'abord `init --dry-run` sur un projet existant. Relancé plus tard, `init` garde la
95
+ *stack* enregistrée dans la configuration.
92
96
 
93
97
  `init --force` sur un projet déjà initialisé réécrit les fichiers qui appartiennent à `init` et
94
98
  garde la configuration : les contextes et leurs amonts, les règles, les limites, les dérogations
@@ -134,6 +138,11 @@ de celui qui est choisi, enregistré sous `stack.packageManager`. pnpm est épin
134
138
  de script de build sans être autorisée par son nom. Les deux sont prouvés par une installation
135
139
  réelle d'un projet généré, son build et son `verify`. Le kit est installé depuis le registre dans
136
140
  les deux cas.
141
+ Le projet force les versions qui ferment une vulnérabilité que sa pile épingle encore sous le
142
+ correctif, dans les `overrides` de `package.json` sous npm et de `pnpm-workspace.yaml` sous pnpm,
143
+ qui ne lit rien de `package.json` : qs `^6.16.0`, que Stryker demande en 6.15.1 par
144
+ `typed-rest-client`, et avec `--http nest` multer `^2.5.0`, que `@nestjs/platform-express`
145
+ demande en 2.4.0. Un override que le projet pose déjà pour l'un d'eux est gardé, et signalé.
137
146
 
138
147
  **Pipelines.** Une *pull request* ou une *merge request* exécute les *specs* unitaires, les
139
148
  *specs* d'intégration et le lint des contextes que son changement atteint par la carte des
@@ -464,7 +473,9 @@ réponse d'identifiant comprise, comme 0.1 à 0.5 les écrivaient.
464
473
  `generate value-object` écrit un `create` qui renvoie l'objet-valeur ou lève le refus de son
465
474
  concept, et une *spec* qui le vérifie avec `expectRefusal(() => ..)`. `--value-objects result`,
466
475
  ou une configuration sans la clé, garde un `create` qui renvoie un `Result` que l'appelant
467
- déballe, comme 0.1 à 0.5 l'écrivaient ; `value-objects` fait passer un projet de l'un à l'autre.
476
+ déballe, comme 0.1 à 0.5 l'écrivaient ; `value-objects` fait passer un projet de l'un à l'autre. `generate property`
477
+ écrit les lois d'un *value object* existant comme une *spec* sur des valeurs générées, sous
478
+ l'une ou l'autre forme, et ajoute `fast-check` aux dépendances de développement s'il manque.
468
479
 
469
480
  **Les événements du domaine partent avec la sauvegarde.** Un gestionnaire de commande généré
470
481
  construit ou charge son agrégat, appelle une méthode d'intention, `await repository.save(aggregate)`
@@ -559,14 +570,14 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
559
570
  | `--event-sourcing on` | enregistré comme `stack.eventSourcing`, `off` sauf demande : `Persistence` gagne `eventSourcing` (`create<Orm>EventSourcing` dans le schéma `event_store`, dont le fichier de schéma déclare les cinq tables ; les stores en mémoire avec `--orm none`), et `src/platform/event-sourcing/` : `create-event-sourcing.ts` (`EventSourcing` : les stores, le `SubjectKeyStore` enveloppé par `auditedSubjectKeys` avec `--audit on`, et le `PersonalDataCipher` par-dessus) et, avec tsyringe, `event-sourcing.module.ts` (lie `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` et `PersonalDataCipher`, pour qu'un adaptateur de *repository* *event-sourced* les nomme dans son constructeur ; la `Platform` câblée à la main les porte comme `platform.eventSourcing`) ; `platform-test.module.ts` lie les stores en mémoire, pour qu'une *spec* de gestionnaire d'un agrégat *event-sourced* n'ait besoin d'aucun *fake*. `generate aggregate --event-sourced` est refusé sans lui, avec le `init --force --event-sourcing on` à lancer. Refusé avec `--orm custom` : l'event store du kit tourne sur PostgreSQL par les quatre paquets d'ORM |
560
571
  | `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, `inEachTenant` avec `--tenancy shared-table`, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
561
572
  | `--tenancy shared-table` | enregistré comme `stack.tenancy` ; les quatre ORM. Chaque `generate repository` est cloisonné par *tenant* (comme `--tenant-scoped`), au moyen de `tenantTable` et `ownTenantTable` (Knex), de `tenantCondition` et `ownTenantCondition` (Drizzle), de `tenantWhere` et `ownTenantWhere` (Prisma, TypeORM) ; l'outbox garde le *tenant* de chaque événement (`createOutboxTables(knex, { tenant: true })` et le `tenant: true` de `KnexOutboxStore`, `tenantOutboxTable`, le champ `tenantId` du modèle Prisma et le `tenant: true` de `PrismaOutboxStore`, `outboxEntity({ tenant: true })`), si bien que les consommateurs s'exécutent dans ce *tenant* ; `tenancy/scoped-statement` juge les adaptateurs. La sécurité au niveau des lignes, un schéma par *tenant* et une base par *tenant* sont refusés, avec ce qu'il faut câbler à la main ([Multitenance](../../docs/concepts/multitenancy.fr.md)) |
562
- | `--queue database\|redis\|memory` | enregistré comme `stack.queue`. `database` (par défaut sur Knex ou Drizzle avec tsyringe) : `createJobTable` et `createProcessTable`, ou `jobsTable` et `processesTable`, dans le schéma `messaging`, `Persistence` gagne `jobs` et `processes`, et la plateforme relie `JobStore` et `ProcessStore` à eux (le module de la plateforme sur tsyringe, `jobs/create-background-work.ts` là où la plateforme est câblée à la main), si bien qu'un *job* mis en file par une commande est écrit dans sa transaction ; `redis` (avec `--cache redis`) : `RedisJobStore` sur la connexion du cache, les processus dans la base de données ; `memory` (par défaut sinon) : rien n'est écrit, les deux restent dans le processus. Refusé : `database` avec un autre ORM, `redis` sans le cache |
573
+ | `--queue database\|redis\|memory` | enregistré comme `stack.queue`. `database` (par défaut sur Knex, Drizzle, Prisma et TypeORM, quel que soit le conteneur) : les tables du *package* de l'ORM (`createJobTable` et `createProcessTable`, `jobsTable` et `processesTable`, les modèles `BackgroundJob` et `ProcessInstance`, `jobEntity` et `processEntity`) dans le schéma `messaging`, `Persistence` gagne `jobs` et `processes`, et la plateforme relie `JobStore` et `ProcessStore` à eux (le module de la plateforme sur tsyringe, `jobs/create-background-work.ts` là où la plateforme est câblée à la main ou sous Nest), si bien qu'un *job* mis en file par une commande est écrit dans sa transaction ; `redis` (avec `--cache redis`) : `RedisJobStore` sur la connexion du cache, les processus dans la base de données ; `memory` (par défaut avec une persistance sur mesure ou sans persistance) : rien n'est écrit, les deux restent dans le processus. Refusé : `database` avec un autre ORM, `redis` sans le cache |
563
574
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices` : le cache lié au `Cache` du kernel, le limiteur à `RateLimiter`, le verrou à `Lock`, qui réserve un *job* planifié à une seule instance, le signal du relais comme `wakeOn` du relais de l'outbox avec `relayWakeUpMiddleware` sur le bus de commandes), `http/too-many-requests-for.ts` (une fenêtre glissante par adresse d'appelant, 429 `application/problem+json` avec `retry-after` ; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS`), `GET /health/ready` sur le serveur HTTP, `REDIS_URL` validée, un service compose `cache` qui exécute Dragonfly avec un contrôle de santé. Sans serveur (outils, tests sans `REDIS_URL`), les mêmes ports restent dans la mémoire du processus |
564
575
  | `--http-cache varnish` | un service compose `varnish` (Varnish 9.1.0, qui joint l'API sur `host.docker.internal`) avec son VCL dans `docker/varnish/default.vcl` (seules les réponses dont le `Cache-Control` les autorise par `max-age` ou `s-maxage` sont gardées, rangées sous leurs étiquettes `xkey`, purgées par `PURGE` depuis la machine de Varnish ou avec `VARNISH_PURGE_KEY`, `x-cache: HIT\|MISS`), `VARNISH_URL` et `VARNISH_PURGE_KEY` validées, `cacheTags: { header: CacheTagHeader.xkey }` dans la frontière HTTP, et le relais de l'outbox de `main.ts` et de chaque point d'entrée de `generate service` qui publie au moyen de `PurgingPublisher` avec `VarnishCachePurger` (l'application de bout en bout enregistre les purges dans `purges`) ; sur `--di manual` et `nest`, la plateforme gagne `cacheInvalidation` ; avec `--tenancy`, les étiquettes des réponses et les purges sont rangées sous le *tenant* (`perTenant`) et le *tenant* d'une requête HTTP est lu dans `x-tenant-id`. Demande un framework HTTP et `--events outbox` : une purge est une ligne de l'outbox |
565
576
  | `--errors sentry` | les échecs inattendus remontés à Sentry ou à GlitchTip (un seul protocole, seul le DSN diffère) au moyen de l'`ErrorReporter` du kernel, lié à `@ddd-ts-kit/sentry`. `src/platform/observability/errors.ts` (`initSentry` sur la configuration validée, puis `reportProcessFailures`), le deuxième import de `main.ts`, de `apps/<context>/main.ts` et de `apps/worker/main.ts`, juste après `tracing.ts` ; `errors` remis à `composeApplication`, qui le donne au module du kernel sur tsyringe (`errorReporter`, vidé par `container.stop()` avant le *logger*, `errorReportingMiddleware` en premier sur les deux bus, le planificateur par défaut qui observe avec `reportFailedRuns`) ou à `createPlatform` à la main (le même *middleware*, `onRun: reportFailedRuns(errors)`, `platform.errors`, vidé en deux secondes au plus quand l'application s'arrête) ; `reportHttpErrors` dans `auth/authentication/http-boundary.ts` pour chaque requête HTTP qui reçoit une réponse 5xx ; `DeadLetterReports` sur le *hook* `onFailure` d'un *broker* fourni (`createEventProvider(config, errors)`, avec `observing` autour de chaque consommateur) et du relais de l'outbox. `SENTRY_DSN`, `SENTRY_ENVIRONMENT` (par défaut : `NODE_ENV`), `SENTRY_RELEASE` et `SENTRY_SCRUB_MESSAGES` validées dans `config/load-config.ts` comme `errorReporting` : sans DSN, l'application démarre et ne remonte rien ; un DSN qui n'est pas une URL refuse le démarrage. Dépendances `@ddd-ts-kit/sentry` et `@sentry/node`. Un profil compose `errors` qui exécute GlitchTip 6.2.6 avec son propre PostgreSQL et son propre Valkey (`GLITCHTIP_PORT`, sur la boucle locale seulement, amorçage de développement), et une section du README généré qui dit comment lire son DSN. Les outils et les tests composent l'application sans *reporter*. Il va avec tous les autres choix de la *stack* ; avec `--errors none`, rien de tout cela n'est écrit |
566
577
  | `--authn keycloak` | un service compose `keycloak` (Keycloak 26.8.0, `start-dev --import-realm`, profil `identity`) et `docker/keycloak/<project>-realm.json` : le client de l'API, un client public `<project>-local` avec l'octroi direct, ses *mappers* d'audience et de `tenant_id`, le rôle de realm `admin`, et les utilisateurs de démonstration `demo-admin` et `demo-user`, pour le développement local seulement |
567
578
  | `--storage local\|s3` | enregistré comme `stack.storage` : où vit le contenu des fichiers, jamais dans la base de données. `src/platform/config/read-files.ts` et `src/platform/files/open-files.ts`, un par choix : `local`, un répertoire en développement (`FILES_DIRECTORY`, `.data/files`) et les liens signés servis par l'application sous `/files` (`FILES_PUBLIC_URL` et `FILES_SIGNING_SECRET` requises en production) ; `s3`, un bucket de n'importe quel fournisseur du protocole S3 au moyen de `@ddd-ts-kit/s3` (les variables `S3_*`, MinIO dans la stack compose) ; la mémoire du processus dans les tests et les outils, dans les deux cas. Avec `--di tsyringe` : `files/bind-files.ts`, `files/files.module.ts` et `files/staging-uploads.ts` ; en câblage manuel, `files/create-files.ts` ; avec une *stack* HTTP, `files/file-routes.ts`. Ils lient `FileStorage`, `FileKeys`, `FileScanner` et `FileStaging`, enregistrent la purge horaire des fichiers en attente et mettent en attente le fichier que porte une commande avant sa transaction ; `generate file-upload` en a besoin. `--storage none` n'écrit rien de tout cela ([Stockage de fichiers](../../docs/concepts/file-storage.fr.md)) |
568
579
  | `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, et pour `--broker` `create-event-provider.ts` : `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, avec `aggregate-key-of.ts` pour l'ordre par agrégat), `NatsEventBus` (`NATS_URL`) ou `RedisStreamsEventBus` de `@ddd-ts-kit/redis/event-bus` (`REDIS_URL` : Redis, Dragonfly ou Valkey), chacun avec un abonné par contexte consommateur (`forConsumer`), `assertTopology` au démarrage, son adresse validée et un service compose avec un contrôle de santé ; ou `custom-event-bus.ts` avec sa *spec* `eventBusContract`. `start-outbox-relay.ts` avec l'outbox. `--broker redis` avec `--cache redis` fait un seul serveur et un seul service compose, `cache` ; seul, le service s'appelle `streams` |
569
- | `src/platform/database/` | `persistence.ts` (`interface Persistence` : unité de travail, magasins de l'outbox et des événements traités du *package* de l'ORM, la poignée de stockage), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, la connexion (`connect-to-database.ts`, `create-client.ts` ou `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, le schéma de ce que le kit stocke pour l'application), `open-test-database.ts` (PostgreSQL dans le processus, ou le serveur nommé par une URL ; avec Vitest chaque *spec* ouvre une copie du cluster que `test/support/test-database-template.ts`, la mise en place globale de l'exécution, initialise une fois, et y crée ses tables ; avec drizzle depuis `table-statements.ts`, le SQL des tables de `schema.ts`, puisque drizzle-kit écrit des migrations, pas des tables). La classe de stockage qu'un adaptateur de *repository* nomme dans sa liste de dépendances : `database.ts` avec drizzle et prisma (`abstract class Database extends` le type de contexte du *package* de l'ORM), `KnexContext` de `@ddd-ts-kit/knex`, `TypeOrmContext` de `@ddd-ts-kit/typeorm` |
580
+ | `src/platform/database/` | `persistence.ts` (`interface Persistence` : unité de travail, magasins de l'outbox et des événements traités du *package* de l'ORM, la poignée de stockage), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, la connexion (`connect-to-database.ts`, `create-client.ts` ou `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, le schéma de ce que le kit stocke pour l'application), `open-test-database.ts` (PostgreSQL dans le processus, ou le serveur nommé par une URL ; avec Vitest chaque *spec* ouvre une copie du cluster que `test/support/test-database-template.ts`, la mise en place globale de l'exécution, initialise une fois, et y crée ses tables ; avec drizzle depuis `table-statements.ts`, le SQL des tables de `schema.ts`, puisque drizzle-kit écrit des migrations, pas des tables, ses index uniques compris), `persistence.contract.spec.ts` (les stores de l'outbox, des événements traités, des *jobs* et des processus tels que la plateforme les branche, tenus aux contrats de `@ddd-ts-kit/testing` avec ce que la pile active : le *tenant* sous `--tenancy`, l'unité de travail). La classe de stockage qu'un adaptateur de *repository* nomme dans sa liste de dépendances : `database.ts` avec drizzle et prisma (`abstract class Database extends` le type de contexte du *package* de l'ORM), `KnexContext` de `@ddd-ts-kit/knex`, `TypeOrmContext` de `@ddd-ts-kit/typeorm` |
570
581
  | outillage des migrations | `drizzle.config.ts`, `knexfile.js` et `migrations/00000000000000_initial.js`, `prisma/schema.prisma` et `prisma.config.ts`, ou `data-source.ts` |
571
582
  | `scripts/openapi.ts`, `scripts/events.ts` | écrivent `openapi/openapi.yaml` (un fichier par document de `openapi.documents`), `docs/integration/asyncapi.yaml` et `docs/integration/event-catalog.md`, en JSON sous `openapi.format: json` ; `--check` échoue sur une différence |
572
583
  | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | avec `--privacy on`, les deux demandes d'une personne concernée, traitées en ligne de commande sur les sources avec les variables de `.env` (`npm run privacy:erase -- <subject-id> [--operator <qui-demande>]`, `npm run privacy:export -- <subject-id> > export.json`) : l'effacement détruit d'abord la clé de la personne quand le projet a un event store (`--event-sourcing on` : ses événements stockés se lisent effacés ; audité avec `--audit on`), puis efface chaque copie listée dans `src/platform/privacy/data-subject-copies.ts` ; `privacy:purge` lance à la main ce que le *job* `privacy.purge-expired` lance chaque nuit à 03:00 UTC, la purge de ce qui a dépassé sa durée de conservation (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` coupe le *job*) ; l'export rassemble chaque enregistrement listé dans `data-subject-exports.ts` en un document JSON daté (`format`, `subject`, `exportedAt`, `records`), l'export de chaque contexte audité avec `--audit on`, jamais les valeurs (chaque exécution laisse son entrée, un essai compris : essayez-le sur une personne de test). Avec `--tenancy shared-table`, `TENANTS` nomme les tenants, séparés par des virgules : une écriture de données de tenant n'est jamais élargie. Ni l'un ni l'autre n'atteint les sauvegardes, les journaux ou une copie qu'aucun contexte n'a déclarée |
@@ -1617,15 +1628,24 @@ résolus comme le fait Node, du projet vers le haut ; et, quand le dépôt a un
1617
1628
  Chacun vient avec son correctif : un Node qu'`engines.node` accepte (`nvm use`), `npm ci`, les
1618
1629
  paquets du kit montés ensemble, `git submodule update --init --recursive`.
1619
1630
 
1631
+ Enfin, sur ce qui est installé, les *overrides* qu'`init` écrit sous une dépendance qui épingle un
1632
+ paquet sous un correctif de sécurité (qs sous Stryker, multer sous Nest) : la plage que demande le
1633
+ parent installé, trouvé depuis l'emplacement réel de chaque paquet comme Node le trouve, face aux
1634
+ *overrides* de `package.json` sous npm ou de `pnpm-workspace.yaml` sous pnpm. Un *override* qui
1635
+ manque au projet tant que le parent épingle encore le paquet sous le correctif est `missing`, et
1636
+ `init` l'ajoute ; un *override* que le projet garde une fois que le parent demande lui-même la
1637
+ version corrigée est `no longer needed`, à retirer, car il retiendrait le paquet quand une majeure
1638
+ suivante sera demandée. Une chaîne qui n'est pas installée n'est pas jugée.
1639
+
1620
1640
  `--strict` sort avec 1 tant que quelque chose manque ou est à une autre plage, ou tant que le
1621
1641
  *checkout* ne peut pas faire tourner le projet : un Node hors d'`engines.node`, pas de
1622
1642
  `node_modules`, un paquet du kit non installé ou à une autre version, un sous-module non
1623
- initialisé. Un script écrit autrement, un *hook* que ce clone n'a pas installé, un Node que
1624
- `.nvmrc` ne nomme pas quand `engines.node` l'accepte, et un *lockfile* modifié depuis
1625
- l'installation (un *checkout* peut le réécrire avec ce que `node_modules` contient déjà) sont
1626
- signalés sans le faire échouer. `--json` affiche `{ version, findings: [{ area, name, problem,
1643
+ initialisé, un *override* qui manque. Un script écrit autrement, un *hook* que ce clone n'a pas
1644
+ installé, un Node que `.nvmrc` ne nomme pas quand `engines.node` l'accepte, un *lockfile* modifié
1645
+ depuis l'installation (un *checkout* peut le réécrire avec ce que `node_modules` contient déjà), et
1646
+ un *override* qui n'est plus nécessaire sont signalés sans le faire échouer. `--json` affiche `{ version, findings: [{ area, name, problem,
1627
1647
  expected, found }] }`, `area` valant `script`, `package`, `permission`, `hook`, `guidance`,
1628
- `node`, `install` ou `submodule`.
1648
+ `node`, `install`, `submodule` ou `override`.
1629
1649
 
1630
1650
  ## worker-scope
1631
1651
 
@@ -2013,6 +2033,7 @@ ajoute, `lint` ce qu'elle ajoute à ESLint ; les *pipelines* générés câblent
2013
2033
  ```
2014
2034
  ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab]
2015
2035
  [--changed-since <git-ref>] [--explain] [--self]
2036
+ ddd-ts-kit check --baseline write|prune
2016
2037
  ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]
2017
2038
  ddd-ts-kit check --commit-size [--staged] [--strict]
2018
2039
  ```
@@ -2073,6 +2094,26 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2073
2094
  règle.
2074
2095
 
2075
2096
  - `paths` et `--changed-since` limitent ce qui est signalé, pas ce qui est analysé.
2097
+ - `--baseline write` consigne les erreurs qu'un projet a déjà, comptées par fichier et par règle,
2098
+ dans `ddd-ts-kit-baseline.json` (la forme de `eslint-suppressions.json`), pour un code existant
2099
+ qui adopte le kit ; commitez-le. Dès lors, `check` et `check-file` (le *hook* de l'agent) taisent
2100
+ les erreurs d'une règle dans un fichier tant qu'elles ne dépassent pas ce que la *baseline*
2101
+ consigne, et les signalent toutes dès qu'elles le dépassent ; `check` échoue quand un compte
2102
+ consigné n'est plus atteint, jusqu'à ce que `--baseline prune` l'abaisse, pour que la *baseline*
2103
+ ne fasse que rétrécir. Les avertissements ne sont pas consignés : ils ne font rien échouer.
2104
+ Écrire une *baseline* est une décision du *owner* du projet, qui lance `--baseline write` dans
2105
+ un terminal : la garde du *plugin* refuse la commande et toute modification directe du fichier
2106
+ à un agent, sous Claude Code, Codex et Copilot de la même façon, et les permissions qu'écrit
2107
+ `init` demandent avant les deux pour un agent sans le *plugin*. Une commande que la garde ne lit
2108
+ pas (un script du projet qui écrit le fichier) n'est pas interceptée : la revue lit le *diff*
2109
+ de la *baseline*, qui ne doit que rétrécir. `--baseline prune` ne demande personne. Un fichier
2110
+ déplacé garde ses comptes : les commandes du kit qui déplacent des fichiers (`move-to-module`,
2111
+ `context-layout`, `platform-folders`) portent son entrée au nouveau chemin, et `--baseline
2112
+ prune` suit les renommages que git voit depuis le commit de la *baseline* (un `git mv`) ; un
2113
+ fichier déplacé autrement signale ses erreurs à son nouveau chemin, et son ancienne entrée
2114
+ échoue jusqu'à ce que le propriétaire réécrive la *baseline*. Une
2115
+ *baseline* fait taire les anciennes erreurs ; elle ne rend pas vérifiable une arborescence hors
2116
+ de l'arborescence canonique.
2076
2117
  `--changed-since` lance `git diff --name-only --relative <ref>...` dans le projet.
2077
2118
  - `--format github` affiche des annotations `::error file=...,line=...::`.
2078
2119
  - `--explain` fait suivre les violations de chaque règle qu'elles signalent, une fois, avec sa
@@ -2178,6 +2219,8 @@ règle.
2178
2219
  | `authz/fields-by-schema` | sous `application/queries/` : `roles.includes(`, `.some(`, `.every(`, `.find(`, `.indexOf(`, une comparaison avec un `role`, `isAdmin` |
2179
2220
  | `aspects/outside-in` | un import de `@ddd-ts-kit/aspects/decorators` hors de `infrastructure/` d'un contexte et du répertoire de la plateforme : `presentation/`, le fichier de module, `published-language/`, le noyau partagé, `main.ts`, toute autre source (`domain/` et `application/` sont signalés par les deux règles `layer/*` à la place) |
2180
2221
  | `tracing/platform-only` | un import de `@ddd-ts-kit/tracing` ou d'un *package* `@opentelemetry/*` hors du répertoire de la plateforme, de `main.ts` et de `apps/`, tests compris |
2222
+ | `nest/no-parallel-pipeline` | dans `presentation/`, `infrastructure/` ou le fichier de module d'un contexte, tests à part : un import d'un contrôleur que Nest sert (ses décorateurs de route et de paramètres, sauf si le fichier importe `KitRoute` ou `KitRoutes` de `@ddd-ts-kit/http/nest`), de la requête ou de la réponse brutes, d'un *guard*, d'un *pipe*, d'un filtre d'exceptions ou d'une `HttpException`, d'un intercepteur ou du `Logger` de `@nestjs/common`, un import sans nom de celui-ci, ou un import d'un *package* de Nest dont le kit fait le travail (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` et les autres de la section 3 d'ARCHITECTURE.md) ; le message dit ce que le kit fait à sa place ; sous la racine des sources hors des contextes, tests à part : un fichier qui importe `Controller` de `@nestjs/common`, ni `KitRoute` ni `KitRoutes`, et nomme `CommandBus` ou `QueryBus` ou importe un fichier d'un contexte |
2223
+ | `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
2181
2224
  | `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`. Un where construit par une autre fonction n'est pas suivi |
2182
2225
  | `standard/no-parallel-interface` | une classe, une interface ou un alias de type déclaré comme `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (hors de `presentation/` et de la plateforme), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` suivi d'un nom standard (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) ou un nom de `standardInterfaces` ; une classe qui implémente ou étend l'interface standard est un adaptateur et n'est pas signalée |
2183
2226
  | `events/outbox-required` | `stack.events` autre que `outbox` avec un ORM et sans dérogation `stack.events` ; dans `domain/` et `application/`, l'import d'un client de *broker* ou d'une implémentation de bus ou de relais ; un *publisher* qui dépend de plus que `IntegrationEventPublisher` ; un module de la plateforme qui distribue un *publisher* et ne nomme jamais `OutboxPublisher` |
@@ -2360,13 +2403,16 @@ exactement comme le chemin relatif vers le même fichier.
2360
2403
  ## check-file
2361
2404
 
2362
2405
  ```
2363
- ddd-ts-kit check-file <path>
2406
+ ddd-ts-kit check-file <path> [--content-from <file>] [--rule <id>]...
2364
2407
  ```
2365
2408
 
2366
2409
  Exécute les règles par fichier (couches, contextes, nommage, événements, langage, pureté, code
2367
2410
  propre, *mocks*, composition, désactivations) sur un fichier sans parcourir le projet : conçu pour
2368
2411
  un *hook* d'éditeur ou d'agent après chaque écriture. Un fichier qui n'est pas une source du
2369
- projet est ignoré.
2412
+ projet est ignoré. `--content-from <file>` juge le texte de ce fichier comme le contenu de
2413
+ `<path>`, qui n'a pas besoin d'exister encore : ce qu'une session s'apprête à écrire, comme la
2414
+ garde du *plugin* le lit avant l'écriture sous `"dependenciesBeforeWrite": true`. `--rule`
2415
+ restreint les règles ; la *baseline* du projet s'applique comme pour un fichier sur le disque.
2370
2416
 
2371
2417
  ## lint
2372
2418