ddd-ts-kit 0.108.1 → 0.110.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 (559) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/README.fr.md +33 -14
  3. package/README.md +28 -14
  4. package/dist/affected/reach-of.d.ts.map +1 -1
  5. package/dist/affected/reach-of.js +4 -1
  6. package/dist/affected/reach-of.js.map +1 -1
  7. package/dist/check/canonical/holds-shared-files.d.ts +3 -0
  8. package/dist/check/canonical/holds-shared-files.d.ts.map +1 -0
  9. package/dist/check/canonical/holds-shared-files.js +7 -0
  10. package/dist/check/canonical/holds-shared-files.js.map +1 -0
  11. package/dist/check/canonical/is-shared-directory.d.ts +7 -0
  12. package/dist/check/canonical/is-shared-directory.d.ts.map +1 -0
  13. package/dist/check/canonical/is-shared-directory.js +13 -0
  14. package/dist/check/canonical/is-shared-directory.js.map +1 -0
  15. package/dist/check/canonical/role.d.ts +2 -0
  16. package/dist/check/canonical/role.d.ts.map +1 -1
  17. package/dist/check/canonical/roles.d.ts.map +1 -1
  18. package/dist/check/canonical/roles.js +10 -5
  19. package/dist/check/canonical/roles.js.map +1 -1
  20. package/dist/check/canonical/shared-directories.d.ts +3 -0
  21. package/dist/check/canonical/shared-directories.d.ts.map +1 -0
  22. package/dist/check/canonical/shared-directories.js +8 -0
  23. package/dist/check/canonical/shared-directories.js.map +1 -0
  24. package/dist/check/canonical/stray-entry.d.ts.map +1 -1
  25. package/dist/check/canonical/stray-entry.js +43 -4
  26. package/dist/check/canonical/stray-entry.js.map +1 -1
  27. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  28. package/dist/check/catalogue/architecture-rules.js +2 -0
  29. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  30. package/dist/check/configuration/module-problems.js +20 -16
  31. package/dist/check/configuration/module-problems.js.map +1 -1
  32. package/dist/check/errors/code-reference.d.ts +7 -0
  33. package/dist/check/errors/code-reference.d.ts.map +1 -0
  34. package/dist/check/errors/code-reference.js +2 -0
  35. package/dist/check/errors/code-reference.js.map +1 -0
  36. package/dist/check/errors/code-references.d.ts +7 -0
  37. package/dist/check/errors/code-references.d.ts.map +1 -0
  38. package/dist/check/errors/code-references.js +13 -0
  39. package/dist/check/errors/code-references.js.map +1 -0
  40. package/dist/check/errors/kit-code-keys.d.ts +3 -0
  41. package/dist/check/errors/kit-code-keys.d.ts.map +1 -0
  42. package/dist/check/errors/kit-code-keys.js +5 -0
  43. package/dist/check/errors/kit-code-keys.js.map +1 -0
  44. package/dist/check/errors/kit-codes-list.d.ts +3 -0
  45. package/dist/check/errors/kit-codes-list.d.ts.map +1 -0
  46. package/dist/check/errors/kit-codes-list.js +3 -0
  47. package/dist/check/errors/kit-codes-list.js.map +1 -0
  48. package/dist/check/explain/errors-docs.d.ts.map +1 -1
  49. package/dist/check/explain/errors-docs.js +5 -2
  50. package/dist/check/explain/errors-docs.js.map +1 -1
  51. package/dist/check/explain/module-docs.d.ts.map +1 -1
  52. package/dist/check/explain/module-docs.js +9 -6
  53. package/dist/check/explain/module-docs.js.map +1 -1
  54. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  55. package/dist/check/explain/persistence-docs.js +18 -0
  56. package/dist/check/explain/persistence-docs.js.map +1 -1
  57. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  58. package/dist/check/explain/tree-docs.js +3 -1
  59. package/dist/check/explain/tree-docs.js.map +1 -1
  60. package/dist/check/fixtures/errors-route.d.ts +1 -1
  61. package/dist/check/fixtures/errors-route.d.ts.map +1 -1
  62. package/dist/check/fixtures/errors-route.js +2 -2
  63. package/dist/check/fixtures/errors-route.js.map +1 -1
  64. package/dist/check/fixtures/files-fixtures.d.ts.map +1 -1
  65. package/dist/check/fixtures/files-fixtures.js +77 -0
  66. package/dist/check/fixtures/files-fixtures.js.map +1 -1
  67. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  68. package/dist/check/fixtures/fixtures.js +2 -0
  69. package/dist/check/fixtures/fixtures.js.map +1 -1
  70. package/dist/check/fixtures/module-fixtures.d.ts.map +1 -1
  71. package/dist/check/fixtures/module-fixtures.js +27 -31
  72. package/dist/check/fixtures/module-fixtures.js.map +1 -1
  73. package/dist/check/fixtures/named-refusal-fixtures.d.ts.map +1 -1
  74. package/dist/check/fixtures/named-refusal-fixtures.js +40 -0
  75. package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -1
  76. package/dist/check/fixtures/shared-folder-fixtures.d.ts +7 -0
  77. package/dist/check/fixtures/shared-folder-fixtures.d.ts.map +1 -0
  78. package/dist/check/fixtures/shared-folder-fixtures.js +176 -0
  79. package/dist/check/fixtures/shared-folder-fixtures.js.map +1 -0
  80. package/dist/check/fixtures/shared-kernel-fixtures.d.ts.map +1 -1
  81. package/dist/check/fixtures/shared-kernel-fixtures.js +11 -0
  82. package/dist/check/fixtures/shared-kernel-fixtures.js.map +1 -1
  83. package/dist/check/fixtures/with-modules.d.ts +4 -0
  84. package/dist/check/fixtures/with-modules.d.ts.map +1 -0
  85. package/dist/check/fixtures/with-modules.js +22 -0
  86. package/dist/check/fixtures/with-modules.js.map +1 -0
  87. package/dist/check/model/context-location.d.ts +5 -0
  88. package/dist/check/model/context-location.d.ts.map +1 -1
  89. package/dist/check/project/locate.js +12 -5
  90. package/dist/check/project/locate.js.map +1 -1
  91. package/dist/check/rules/errors-known-code.d.ts.map +1 -1
  92. package/dist/check/rules/errors-known-code.js +60 -9
  93. package/dist/check/rules/errors-known-code.js.map +1 -1
  94. package/dist/check/rules/module-complete.d.ts.map +1 -1
  95. package/dist/check/rules/module-complete.js +19 -20
  96. package/dist/check/rules/module-complete.js.map +1 -1
  97. package/dist/check/rules/module-declared.js +5 -1
  98. package/dist/check/rules/module-declared.js.map +1 -1
  99. package/dist/check/rules/search-store-from-platform.d.ts +3 -0
  100. package/dist/check/rules/search-store-from-platform.d.ts.map +1 -0
  101. package/dist/check/rules/search-store-from-platform.js +93 -0
  102. package/dist/check/rules/search-store-from-platform.js.map +1 -0
  103. package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -1
  104. package/dist/check/rules/test-acceptance-black-box.js +6 -7
  105. package/dist/check/rules/test-acceptance-black-box.js.map +1 -1
  106. package/dist/check/rules/test-builder-required.d.ts.map +1 -1
  107. package/dist/check/rules/test-builder-required.js +15 -12
  108. package/dist/check/rules/test-builder-required.js.map +1 -1
  109. package/dist/check/rules/test-spec-required.d.ts.map +1 -1
  110. package/dist/check/rules/test-spec-required.js +12 -11
  111. package/dist/check/rules/test-spec-required.js.map +1 -1
  112. package/dist/check/rules/tree-closed.js +1 -1
  113. package/dist/check/rules/tree-closed.js.map +1 -1
  114. package/dist/check/support/path-in-context.d.ts +1 -1
  115. package/dist/check/support/path-in-context.d.ts.map +1 -1
  116. package/dist/check/support/path-in-context.js +6 -3
  117. package/dist/check/support/path-in-context.js.map +1 -1
  118. package/dist/check/support/test-folder-of.d.ts +11 -0
  119. package/dist/check/support/test-folder-of.d.ts.map +1 -0
  120. package/dist/check/support/test-folder-of.js +12 -0
  121. package/dist/check/support/test-folder-of.js.map +1 -0
  122. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  123. package/dist/commands/drizzle-generate.js +9 -0
  124. package/dist/commands/drizzle-generate.js.map +1 -1
  125. package/dist/commands/generate.js +9 -1
  126. package/dist/commands/generate.js.map +1 -1
  127. package/dist/commands/init.d.ts.map +1 -1
  128. package/dist/commands/init.js +1 -0
  129. package/dist/commands/init.js.map +1 -1
  130. package/dist/commands/lint.d.ts +2 -1
  131. package/dist/commands/lint.d.ts.map +1 -1
  132. package/dist/commands/lint.js +4 -1
  133. package/dist/commands/lint.js.map +1 -1
  134. package/dist/commands/move-to-module.d.ts.map +1 -1
  135. package/dist/commands/move-to-module.js +0 -2
  136. package/dist/commands/move-to-module.js.map +1 -1
  137. package/dist/config/index.d.ts +1 -1
  138. package/dist/config/index.d.ts.map +1 -1
  139. package/dist/config/index.js +1 -1
  140. package/dist/config/index.js.map +1 -1
  141. package/dist/config/known-stack-keys.d.ts +1 -1
  142. package/dist/config/known-stack-keys.d.ts.map +1 -1
  143. package/dist/config/known-stack-keys.js +1 -0
  144. package/dist/config/known-stack-keys.js.map +1 -1
  145. package/dist/config/parse-stack.d.ts.map +1 -1
  146. package/dist/config/parse-stack.js +2 -1
  147. package/dist/config/parse-stack.js.map +1 -1
  148. package/dist/config/stack.d.ts +9 -0
  149. package/dist/config/stack.d.ts.map +1 -1
  150. package/dist/config/stack.js +1 -0
  151. package/dist/config/stack.js.map +1 -1
  152. package/dist/context-layout/context-layout.d.ts +3 -2
  153. package/dist/context-layout/context-layout.d.ts.map +1 -1
  154. package/dist/context-layout/context-layout.js +18 -8
  155. package/dist/context-layout/context-layout.js.map +1 -1
  156. package/dist/context-layout/imports-of.d.ts +11 -0
  157. package/dist/context-layout/imports-of.d.ts.map +1 -0
  158. package/dist/context-layout/imports-of.js +20 -0
  159. package/dist/context-layout/imports-of.js.map +1 -0
  160. package/dist/context-layout/module-moves.d.ts +10 -7
  161. package/dist/context-layout/module-moves.d.ts.map +1 -1
  162. package/dist/context-layout/module-moves.js +65 -122
  163. package/dist/context-layout/module-moves.js.map +1 -1
  164. package/dist/context-layout/runner-configs-by-hand.d.ts +11 -0
  165. package/dist/context-layout/runner-configs-by-hand.d.ts.map +1 -0
  166. package/dist/context-layout/runner-configs-by-hand.js +23 -0
  167. package/dist/context-layout/runner-configs-by-hand.js.map +1 -0
  168. package/dist/context-layout/settle.d.ts +20 -0
  169. package/dist/context-layout/settle.d.ts.map +1 -0
  170. package/dist/context-layout/settle.js +58 -0
  171. package/dist/context-layout/settle.js.map +1 -0
  172. package/dist/controllers/declared-code.d.ts +3 -0
  173. package/dist/controllers/declared-code.d.ts.map +1 -0
  174. package/dist/controllers/declared-code.js +8 -0
  175. package/dist/controllers/declared-code.js.map +1 -0
  176. package/dist/controllers/finish-migration.d.ts.map +1 -1
  177. package/dist/controllers/finish-migration.js +5 -3
  178. package/dist/controllers/finish-migration.js.map +1 -1
  179. package/dist/controllers/migrate-context.js +3 -2
  180. package/dist/controllers/migrate-context.js.map +1 -1
  181. package/dist/controllers/plan-context.d.ts +1 -1
  182. package/dist/controllers/plan-context.d.ts.map +1 -1
  183. package/dist/controllers/plan-context.js +11 -6
  184. package/dist/controllers/plan-context.js.map +1 -1
  185. package/dist/controllers/render-controller.d.ts.map +1 -1
  186. package/dist/controllers/render-controller.js +20 -4
  187. package/dist/controllers/render-controller.js.map +1 -1
  188. package/dist/depcruise/hygiene-rules.js +2 -2
  189. package/dist/depcruise/hygiene-rules.js.map +1 -1
  190. package/dist/depcruise/test-files.d.ts +4 -1
  191. package/dist/depcruise/test-files.d.ts.map +1 -1
  192. package/dist/depcruise/test-files.js +5 -2
  193. package/dist/depcruise/test-files.js.map +1 -1
  194. package/dist/describe/codes-named-in.d.ts +8 -0
  195. package/dist/describe/codes-named-in.d.ts.map +1 -0
  196. package/dist/describe/codes-named-in.js +33 -0
  197. package/dist/describe/codes-named-in.js.map +1 -0
  198. package/dist/describe/read-controllers.js +2 -2
  199. package/dist/describe/read-controllers.js.map +1 -1
  200. package/dist/describe/read-route-groups.d.ts +6 -2
  201. package/dist/describe/read-route-groups.d.ts.map +1 -1
  202. package/dist/describe/read-route-groups.js +8 -4
  203. package/dist/describe/read-route-groups.js.map +1 -1
  204. package/dist/describe/read-routes.d.ts.map +1 -1
  205. package/dist/describe/read-routes.js +7 -2
  206. package/dist/describe/read-routes.js.map +1 -1
  207. package/dist/docs/spec-heading.d.ts +5 -4
  208. package/dist/docs/spec-heading.d.ts.map +1 -1
  209. package/dist/docs/spec-heading.js +4 -6
  210. package/dist/docs/spec-heading.js.map +1 -1
  211. package/dist/docs/spec-of-page.d.ts +7 -2
  212. package/dist/docs/spec-of-page.d.ts.map +1 -1
  213. package/dist/docs/spec-of-page.js +8 -3
  214. package/dist/docs/spec-of-page.js.map +1 -1
  215. package/dist/docs/specs-by-directory.d.ts +2 -2
  216. package/dist/docs/specs-by-directory.d.ts.map +1 -1
  217. package/dist/docs/specs-by-directory.js +4 -5
  218. package/dist/docs/specs-by-directory.js.map +1 -1
  219. package/dist/docs/write-behaviour.d.ts +1 -1
  220. package/dist/docs/write-behaviour.d.ts.map +1 -1
  221. package/dist/docs/write-behaviour.js +17 -2
  222. package/dist/docs/write-behaviour.js.map +1 -1
  223. package/dist/file-moves/follow-in-migrations.d.ts +10 -0
  224. package/dist/file-moves/follow-in-migrations.d.ts.map +1 -0
  225. package/dist/file-moves/follow-in-migrations.js +30 -0
  226. package/dist/file-moves/follow-in-migrations.js.map +1 -0
  227. package/dist/file-moves/move-files.d.ts +2 -1
  228. package/dist/file-moves/move-files.d.ts.map +1 -1
  229. package/dist/file-moves/move-files.js +4 -2
  230. package/dist/file-moves/move-files.js.map +1 -1
  231. package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
  232. package/dist/generate/errors/write-named-refusal.js +6 -2
  233. package/dist/generate/errors/write-named-refusal.js.map +1 -1
  234. package/dist/generate/kinds/builder-kind.js +1 -1
  235. package/dist/generate/kinds/builder-kind.js.map +1 -1
  236. package/dist/generate/kinds/declarations-of.js +1 -1
  237. package/dist/generate/kinds/declarations-of.js.map +1 -1
  238. package/dist/generate/kinds/declare-storage.d.ts +2 -1
  239. package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
  240. package/dist/generate/kinds/declare-storage.js +19 -5
  241. package/dist/generate/kinds/declare-storage.js.map +1 -1
  242. package/dist/generate/kinds/e2e/acting-role.d.ts +15 -0
  243. package/dist/generate/kinds/e2e/acting-role.d.ts.map +1 -0
  244. package/dist/generate/kinds/e2e/acting-role.js +19 -0
  245. package/dist/generate/kinds/e2e/acting-role.js.map +1 -0
  246. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  247. package/dist/generate/kinds/e2e-kind.js +5 -1
  248. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  249. package/dist/generate/kinds/gateway-kind.d.ts.map +1 -1
  250. package/dist/generate/kinds/gateway-kind.js +14 -2
  251. package/dist/generate/kinds/gateway-kind.js.map +1 -1
  252. package/dist/generate/kinds/generate-repository.js +1 -1
  253. package/dist/generate/kinds/generate-repository.js.map +1 -1
  254. package/dist/generate/kinds/module-kind.d.ts.map +1 -1
  255. package/dist/generate/kinds/module-kind.js +9 -1
  256. package/dist/generate/kinds/module-kind.js.map +1 -1
  257. package/dist/generate/kinds/route/group-vars.d.ts.map +1 -1
  258. package/dist/generate/kinds/route/group-vars.js +5 -3
  259. package/dist/generate/kinds/route/group-vars.js.map +1 -1
  260. package/dist/generate/kinds/route/route-vars.js +1 -1
  261. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  262. package/dist/generate/kinds/world/context-fakes.d.ts +1 -1
  263. package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -1
  264. package/dist/generate/kinds/world/context-fakes.js +8 -7
  265. package/dist/generate/kinds/world/context-fakes.js.map +1 -1
  266. package/dist/generate/kinds/world/context-world.d.ts +1 -1
  267. package/dist/generate/kinds/world/context-world.d.ts.map +1 -1
  268. package/dist/generate/kinds/world/context-world.js +3 -1
  269. package/dist/generate/kinds/world/context-world.js.map +1 -1
  270. package/dist/generate/place-generated-files.d.ts +2 -0
  271. package/dist/generate/place-generated-files.d.ts.map +1 -1
  272. package/dist/generate/place-generated-files.js +13 -13
  273. package/dist/generate/place-generated-files.js.map +1 -1
  274. package/dist/generate/refresh-docs.d.ts +1 -1
  275. package/dist/generate/refresh-docs.d.ts.map +1 -1
  276. package/dist/generate/refresh-docs.js +3 -1
  277. package/dist/generate/refresh-docs.js.map +1 -1
  278. package/dist/generate/refuse-earlier-layout.d.ts +4 -3
  279. package/dist/generate/refuse-earlier-layout.d.ts.map +1 -1
  280. package/dist/generate/refuse-earlier-layout.js +9 -6
  281. package/dist/generate/refuse-earlier-layout.js.map +1 -1
  282. package/dist/help/flag-notes.d.ts.map +1 -1
  283. package/dist/help/flag-notes.js +8 -7
  284. package/dist/help/flag-notes.js.map +1 -1
  285. package/dist/help/tool-notes.d.ts.map +1 -1
  286. package/dist/help/tool-notes.js +23 -17
  287. package/dist/help/tool-notes.js.map +1 -1
  288. package/dist/help/usage.js +2 -2
  289. package/dist/help/work-notes.d.ts.map +1 -1
  290. package/dist/help/work-notes.js +4 -3
  291. package/dist/help/work-notes.js.map +1 -1
  292. package/dist/init/files/platform-files.d.ts.map +1 -1
  293. package/dist/init/files/platform-files.js +11 -0
  294. package/dist/init/files/platform-files.js.map +1 -1
  295. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  296. package/dist/init/manifest/dependencies-for.js +2 -0
  297. package/dist/init/manifest/dependencies-for.js.map +1 -1
  298. package/dist/init/manifest/versions.d.ts.map +1 -1
  299. package/dist/init/manifest/versions.js +25 -24
  300. package/dist/init/manifest/versions.js.map +1 -1
  301. package/dist/init/rewire-personal-data.d.ts.map +1 -1
  302. package/dist/init/rewire-personal-data.js +4 -2
  303. package/dist/init/rewire-personal-data.js.map +1 -1
  304. package/dist/init/rewire-tables.d.ts.map +1 -1
  305. package/dist/init/rewire-tables.js +4 -2
  306. package/dist/init/rewire-tables.js.map +1 -1
  307. package/dist/init/stack/resolve-operations.d.ts +12 -0
  308. package/dist/init/stack/resolve-operations.d.ts.map +1 -0
  309. package/dist/init/stack/resolve-operations.js +23 -0
  310. package/dist/init/stack/resolve-operations.js.map +1 -0
  311. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  312. package/dist/init/stack/resolve-stack.js +2 -19
  313. package/dist/init/stack/resolve-stack.js.map +1 -1
  314. package/dist/init/stack/stack-options.d.ts +2 -0
  315. package/dist/init/stack/stack-options.d.ts.map +1 -1
  316. package/dist/init/template-vars.d.ts.map +1 -1
  317. package/dist/init/template-vars.js +6 -4
  318. package/dist/init/template-vars.js.map +1 -1
  319. package/dist/init/with-held-imports.d.ts +9 -0
  320. package/dist/init/with-held-imports.d.ts.map +1 -0
  321. package/dist/init/with-held-imports.js +15 -0
  322. package/dist/init/with-held-imports.js.map +1 -0
  323. package/dist/knip/enter-module-test-folders.d.ts +10 -0
  324. package/dist/knip/enter-module-test-folders.d.ts.map +1 -0
  325. package/dist/knip/enter-module-test-folders.js +42 -0
  326. package/dist/knip/enter-module-test-folders.js.map +1 -0
  327. package/dist/knip/index.d.ts +1 -0
  328. package/dist/knip/index.d.ts.map +1 -1
  329. package/dist/knip/index.js +1 -0
  330. package/dist/knip/index.js.map +1 -1
  331. package/dist/lint/eslint-in-project.d.ts +1 -1
  332. package/dist/lint/eslint-in-project.d.ts.map +1 -1
  333. package/dist/lint/eslint-in-project.js +3 -2
  334. package/dist/lint/eslint-in-project.js.map +1 -1
  335. package/dist/lint/lint-run.d.ts +2 -0
  336. package/dist/lint/lint-run.d.ts.map +1 -1
  337. package/dist/merge/landed-commit.js +14 -2
  338. package/dist/merge/landed-commit.js.map +1 -1
  339. package/dist/merge/landed-point.js +3 -0
  340. package/dist/merge/landed-point.js.map +1 -1
  341. package/dist/merge/lost/dropped-additions.d.ts +20 -0
  342. package/dist/merge/lost/dropped-additions.d.ts.map +1 -0
  343. package/dist/merge/lost/dropped-additions.js +42 -0
  344. package/dist/merge/lost/dropped-additions.js.map +1 -0
  345. package/dist/merge/lost/expected-over.d.ts +13 -0
  346. package/dist/merge/lost/expected-over.d.ts.map +1 -0
  347. package/dist/merge/lost/expected-over.js +16 -0
  348. package/dist/merge/lost/expected-over.js.map +1 -0
  349. package/dist/merge/lost/kept-rows.d.ts +4 -2
  350. package/dist/merge/lost/kept-rows.d.ts.map +1 -1
  351. package/dist/merge/lost/kept-rows.js +10 -7
  352. package/dist/merge/lost/kept-rows.js.map +1 -1
  353. package/dist/merge/lost/lost-lines.d.ts +2 -2
  354. package/dist/merge/lost/lost-lines.d.ts.map +1 -1
  355. package/dist/merge/lost/lost-lines.js +5 -3
  356. package/dist/merge/lost/lost-lines.js.map +1 -1
  357. package/dist/merge/lost/lost-tests.d.ts +2 -2
  358. package/dist/merge/lost/lost-tests.d.ts.map +1 -1
  359. package/dist/merge/lost/lost-tests.js +5 -3
  360. package/dist/merge/lost/lost-tests.js.map +1 -1
  361. package/dist/merge/lost/verify-merge.d.ts.map +1 -1
  362. package/dist/merge/lost/verify-merge.js +12 -5
  363. package/dist/merge/lost/verify-merge.js.map +1 -1
  364. package/dist/merge/merge-trunk.d.ts.map +1 -1
  365. package/dist/merge/merge-trunk.js +35 -7
  366. package/dist/merge/merge-trunk.js.map +1 -1
  367. package/dist/merge/slices-from-fork.d.ts +20 -0
  368. package/dist/merge/slices-from-fork.d.ts.map +1 -0
  369. package/dist/merge/slices-from-fork.js +27 -0
  370. package/dist/merge/slices-from-fork.js.map +1 -0
  371. package/dist/merge/trunk-of.d.ts +4 -2
  372. package/dist/merge/trunk-of.d.ts.map +1 -1
  373. package/dist/merge/trunk-of.js +4 -2
  374. package/dist/merge/trunk-of.js.map +1 -1
  375. package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -1
  376. package/dist/migration/warn-dropped-context-tables.js +6 -4
  377. package/dist/migration/warn-dropped-context-tables.js.map +1 -1
  378. package/dist/model-modules/context-level-folder-of.d.ts +9 -0
  379. package/dist/model-modules/context-level-folder-of.d.ts.map +1 -0
  380. package/dist/model-modules/context-level-folder-of.js +11 -0
  381. package/dist/model-modules/context-level-folder-of.js.map +1 -0
  382. package/dist/model-modules/earlier-folders.d.ts +10 -0
  383. package/dist/model-modules/earlier-folders.d.ts.map +1 -0
  384. package/dist/model-modules/earlier-folders.js +20 -0
  385. package/dist/model-modules/earlier-folders.js.map +1 -0
  386. package/dist/model-modules/folders-of-context.d.ts +8 -0
  387. package/dist/model-modules/folders-of-context.d.ts.map +1 -0
  388. package/dist/model-modules/folders-of-context.js +11 -0
  389. package/dist/model-modules/folders-of-context.js.map +1 -0
  390. package/dist/model-modules/held-file-of.d.ts +10 -0
  391. package/dist/model-modules/held-file-of.d.ts.map +1 -0
  392. package/dist/model-modules/held-file-of.js +18 -0
  393. package/dist/model-modules/held-file-of.js.map +1 -0
  394. package/dist/model-modules/index.d.ts +8 -1
  395. package/dist/model-modules/index.d.ts.map +1 -1
  396. package/dist/model-modules/index.js +8 -1
  397. package/dist/model-modules/index.js.map +1 -1
  398. package/dist/model-modules/into-module.d.ts +3 -3
  399. package/dist/model-modules/into-module.d.ts.map +1 -1
  400. package/dist/model-modules/into-module.js +9 -12
  401. package/dist/model-modules/into-module.js.map +1 -1
  402. package/dist/model-modules/is-context-level.d.ts +4 -5
  403. package/dist/model-modules/is-context-level.d.ts.map +1 -1
  404. package/dist/model-modules/is-context-level.js +6 -16
  405. package/dist/model-modules/is-context-level.js.map +1 -1
  406. package/dist/model-modules/is-held-by-shared.d.ts +8 -0
  407. package/dist/model-modules/is-held-by-shared.d.ts.map +1 -0
  408. package/dist/model-modules/is-held-by-shared.js +20 -0
  409. package/dist/model-modules/is-held-by-shared.js.map +1 -0
  410. package/dist/model-modules/module-layers.d.ts +9 -2
  411. package/dist/model-modules/module-layers.d.ts.map +1 -1
  412. package/dist/model-modules/module-layers.js +10 -3
  413. package/dist/model-modules/module-layers.js.map +1 -1
  414. package/dist/model-modules/module-name-flaw.d.ts +4 -1
  415. package/dist/model-modules/module-name-flaw.d.ts.map +1 -1
  416. package/dist/model-modules/module-name-flaw.js +6 -2
  417. package/dist/model-modules/module-name-flaw.js.map +1 -1
  418. package/dist/model-modules/module-placement.d.ts +8 -6
  419. package/dist/model-modules/module-placement.d.ts.map +1 -1
  420. package/dist/model-modules/module-placement.js +32 -30
  421. package/dist/model-modules/module-placement.js.map +1 -1
  422. package/dist/model-modules/module-split.d.ts +7 -5
  423. package/dist/model-modules/module-split.d.ts.map +1 -1
  424. package/dist/model-modules/module-split.js +18 -17
  425. package/dist/model-modules/module-split.js.map +1 -1
  426. package/dist/model-modules/module-test-folder-of.d.ts +8 -0
  427. package/dist/model-modules/module-test-folder-of.d.ts.map +1 -0
  428. package/dist/model-modules/module-test-folder-of.js +11 -0
  429. package/dist/model-modules/module-test-folder-of.js.map +1 -0
  430. package/dist/model-modules/role-folders-of.d.ts +5 -3
  431. package/dist/model-modules/role-folders-of.d.ts.map +1 -1
  432. package/dist/model-modules/role-folders-of.js +19 -11
  433. package/dist/model-modules/role-folders-of.js.map +1 -1
  434. package/dist/model-modules/role-folders.d.ts +1 -1
  435. package/dist/model-modules/role-folders.js +1 -1
  436. package/dist/model-modules/subject-module.d.ts +13 -0
  437. package/dist/model-modules/subject-module.d.ts.map +1 -0
  438. package/dist/model-modules/subject-module.js +34 -0
  439. package/dist/model-modules/subject-module.js.map +1 -0
  440. package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
  441. package/dist/move-to-module/moves-into-module.js +29 -16
  442. package/dist/move-to-module/moves-into-module.js.map +1 -1
  443. package/dist/naming/plural.d.ts.map +1 -1
  444. package/dist/naming/plural.js +5 -0
  445. package/dist/naming/plural.js.map +1 -1
  446. package/dist/plan/format-plan.js +1 -1
  447. package/dist/plan/format-plan.js.map +1 -1
  448. package/dist/progress/build-next-of.d.ts.map +1 -1
  449. package/dist/progress/build-next-of.js +8 -3
  450. package/dist/progress/build-next-of.js.map +1 -1
  451. package/dist/refusals/apply-plan.d.ts.map +1 -1
  452. package/dist/refusals/apply-plan.js +8 -4
  453. package/dist/refusals/apply-plan.js.map +1 -1
  454. package/dist/refusals/move-named-specs.d.ts.map +1 -1
  455. package/dist/refusals/move-named-specs.js +7 -4
  456. package/dist/refusals/move-named-specs.js.map +1 -1
  457. package/dist/refusals/unit-folder-of.d.ts +9 -0
  458. package/dist/refusals/unit-folder-of.d.ts.map +1 -0
  459. package/dist/refusals/unit-folder-of.js +15 -0
  460. package/dist/refusals/unit-folder-of.js.map +1 -0
  461. package/dist/slice/plan-staging.d.ts +2 -1
  462. package/dist/slice/plan-staging.d.ts.map +1 -1
  463. package/dist/slice/plan-staging.js +3 -1
  464. package/dist/slice/plan-staging.js.map +1 -1
  465. package/dist/stack/declares-roles.d.ts +8 -0
  466. package/dist/stack/declares-roles.d.ts.map +1 -0
  467. package/dist/stack/declares-roles.js +11 -0
  468. package/dist/stack/declares-roles.js.map +1 -0
  469. package/dist/stack/stack-vars.d.ts.map +1 -1
  470. package/dist/stack/stack-vars.js +7 -4
  471. package/dist/stack/stack-vars.js.map +1 -1
  472. package/dist/version.d.ts +1 -1
  473. package/dist/version.js +1 -1
  474. package/dist/worker/progress-of.js +12 -1
  475. package/dist/worker/progress-of.js.map +1 -1
  476. package/dist/worker/row-commits.js +7 -1
  477. package/dist/worker/row-commits.js.map +1 -1
  478. package/package.json +6 -5
  479. package/templates/command/handler.spec.buses.ts.tpl +4 -1
  480. package/templates/command/handler.spec.container.ts.tpl +6 -1
  481. package/templates/controller/controller.spec.ts.tpl +4 -1
  482. package/templates/controller/guard.spec.ts.tpl +2 -2
  483. package/templates/controller/guard.ts.tpl +2 -1
  484. package/templates/e2e/e2e.spec.ts.tpl +5 -2
  485. package/templates/error/codes-import.ts.tpl +1 -0
  486. package/templates/error/refusal-case.spec.ts.tpl +1 -1
  487. package/templates/error/refusal.spec.ts.tpl +1 -0
  488. package/templates/file-upload/handler.spec.ts.tpl +4 -1
  489. package/templates/init/README.md.tpl +20 -0
  490. package/templates/init/docker/docker-compose.yml.tpl +24 -0
  491. package/templates/init/docker/env.example.tpl +9 -0
  492. package/templates/init/e2e/create-credentials.jwt.ts.tpl +13 -0
  493. package/templates/init/e2e/create-credentials.keycloak.ts.tpl +13 -0
  494. package/templates/init/e2e/create-credentials.none.ts.tpl +13 -0
  495. package/templates/init/e2e/create-credentials.passport.ts.tpl +13 -0
  496. package/templates/init/e2e/test-environment.ts.tpl +4 -0
  497. package/templates/init/main.ts.tpl +3 -0
  498. package/templates/init/platform/audit/search-audit-entries/search-audit-entries.controller.ts.tpl +2 -2
  499. package/templates/init/platform/audit/search-audit-entries/search-audit-entries.route.ts.tpl +2 -2
  500. package/templates/init/platform/composition/compose-application.container.ts.tpl +13 -0
  501. package/templates/init/platform/composition/compose-application.manual.ts.tpl +4 -0
  502. package/templates/init/platform/composition/create-platform.manual.ts.tpl +14 -4
  503. package/templates/init/platform/composition/lay-foundations.container.ts.tpl +30 -0
  504. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +11 -0
  505. package/templates/init/platform/composition/platform-options.manual.ts.tpl +7 -0
  506. package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
  507. package/templates/init/platform/config/app-config.ts.tpl +13 -0
  508. package/templates/init/platform/config/load-config.ts.tpl +38 -3
  509. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +8 -2
  510. package/templates/init/platform/search/open-search.ts.tpl +88 -0
  511. package/templates/init/platform/search/provisioned-indexes.ts.tpl +134 -0
  512. package/templates/init/platform/search/search-indexes.ts.tpl +23 -0
  513. package/templates/init/platform/search/search-name-taken-error.ts.tpl +10 -0
  514. package/templates/init/platform/search/search.module.container.ts.tpl +17 -0
  515. package/templates/init/platform/search/store-index.ts.tpl +49 -0
  516. package/templates/init/rules/infrastructure.md.tpl +3 -0
  517. package/templates/init/rules/platform.md.tpl +3 -0
  518. package/templates/init/rules/presentation.md.tpl +2 -2
  519. package/templates/init/rules/tests.md.tpl +1 -0
  520. package/templates/init/scripts/privacy-erase.container.ts.tpl +9 -0
  521. package/templates/init/scripts/privacy-erase.manual.ts.tpl +9 -0
  522. package/templates/init/scripts/privacy-export.container.ts.tpl +9 -0
  523. package/templates/init/scripts/privacy-export.manual.ts.tpl +9 -0
  524. package/templates/init/scripts/privacy-purge.container.ts.tpl +9 -0
  525. package/templates/init/scripts/privacy-purge.manual.ts.tpl +9 -0
  526. package/templates/nest-controller/controller.spec.ts.tpl +4 -1
  527. package/templates/pipeline/biome.json.tpl +1 -1
  528. package/templates/pipeline/jest.mutation.config.js.tpl +1 -1
  529. package/templates/pipeline/knip.json.tpl +2 -0
  530. package/templates/pipeline/package-scripts.json +2 -2
  531. package/templates/pipeline/vitest.config.ts.tpl +11 -6
  532. package/templates/pipeline/vitest.mutation.config.ts.tpl +1 -1
  533. package/templates/presets/identity/context/presentation/http/accounts.routes.ts.tpl +2 -1
  534. package/templates/presets/identity/context/presentation/http/invitations.routes.ts.tpl +2 -1
  535. package/templates/presets/identity/context/presentation/http/organisations.routes.ts.tpl +2 -1
  536. package/templates/presets/identity/context/test/unit/change-member-role.handler.spec.ts.tpl +2 -1
  537. package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +4 -4
  538. package/templates/presets/identity/context/test/unit/grant-delegation.handler.spec.ts.tpl +2 -1
  539. package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +3 -3
  540. package/templates/presets/identity/context/test/unit/provision-account.handler.spec.ts.tpl +2 -1
  541. package/templates/presets/identity/context/test/unit/remove-member.handler.spec.ts.tpl +2 -1
  542. package/templates/presets/identity/context/test/unit/revoke-delegation.handler.spec.ts.tpl +2 -1
  543. package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +2 -1
  544. package/templates/presets/identity/context/test/unit/search-members.handler.spec.ts.tpl +2 -2
  545. package/templates/query/handler.spec.buses.ts.tpl +4 -1
  546. package/templates/query/handler.spec.container.ts.tpl +6 -1
  547. package/templates/query/search.handler.spec.buses.ts.tpl +2 -2
  548. package/templates/query/search.handler.spec.container.ts.tpl +2 -2
  549. package/templates/query/search.reader.spec.ts.tpl +2 -2
  550. package/templates/route/route.class-validator.ts.tpl +5 -0
  551. package/templates/route/route.none.ts.tpl +6 -1
  552. package/templates/route/route.search.ts.tpl +3 -3
  553. package/templates/route/route.spec.ts.tpl +4 -1
  554. package/templates/route/route.standard-schema.ts.tpl +5 -0
  555. package/templates/route/route.typebox.ts.tpl +5 -0
  556. package/templates/route/route.zod.ts.tpl +5 -0
  557. package/templates/service/main.ts.tpl +3 -0
  558. package/templates/value-object/value-object.spec.ts.tpl +6 -3
  559. package/templates/worker/main.ts.tpl +3 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,150 @@ 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.110.0
8
+
9
+ **A project generated on Fastify compiles again with Fastify 5.12.8.** That version types `app.addresses()` as addresses or pipe paths, and `src/platform/http/start-http-server.ts` read `.port` of the first one, so `tsc` refused a new project (`Property 'port' does not exist on type 'string | AddressInfo'`). The file now reads the port through a function that answers 0 for a server bound to a pipe.
10
+
11
+ To move: in a project already generated on Fastify, replace the last lines of `startHttpServer` in `src/platform/http/start-http-server.ts` with `return { port: boundPort(app.addresses()), close: () => app.close() };` and add below it
12
+
13
+ ```ts
14
+ function boundPort(addresses: readonly unknown[]): number {
15
+ const [address] = addresses;
16
+ const port: unknown = typeof address === 'object' && address !== null && 'port' in address ? address.port : 0;
17
+
18
+ return typeof port === 'number' ? port : 0;
19
+ }
20
+ ```
21
+
22
+ **Under Nest 12.3 over Express, a body too large is still answered with its limit.** Since 12.3 the Express adapter of Nest hands the error of its parser as the `cause` of an `HttpException`, so the 413 of `@ddd-ts-kit/http` said `The body is larger than what the server reads.` where it said `The body is larger than 102400 bytes.` The limit and the type of the error are now read on that cause too: the log line of a body that is not JSON carries `errorType: 'entity.parse.failed'` under Nest over Express, as under Express alone, where it carried `BadRequestException`.
23
+
24
+ To move: a dashboard or an alert that filters the refusals of the edge on `errorType: 'BadRequestException'` filters on `entity.parse.failed`.
25
+
26
+ **`ddd-ts-kit lint` takes the `--ignore-pattern` that `affected` writes, and three defects of the generators are fixed.**
27
+
28
+ - `affected --format github` and `--format gitlab` give the lint of a partial run as `--ignore-pattern <context>/`, one per context left out, and the generated pipeline hands that line to `npm run ci:lint`. `ddd-ts-kit lint` refused it (`Unknown option '--ignore-pattern'`), so the lint step of a partial run failed. `lint` now takes the option, as many times as given, and leaves those folders out on top of what the ESLint config of the project ignores.
29
+ - `generate projection` and the other kinds that name an integration event refused one whose type the formatter had folded, `export type InvoiceIssuedV2 =` on one line and `IntegrationEvent<...>` on the next. The declaration is read whatever its layout.
30
+ - The table of an aggregate whose last word is plural already keeps its name: `ReaderSettings` gives `reader_settings` where it gave `reader_settingses`. The words are `settings`, `preferences`, `news`, `series`, `species`, `data`, `metadata`, `analytics`, `statistics`, `logistics` and `economics`.
31
+ - `npm run db:generate <name>` on Drizzle refuses a name the journal already holds, and names the migration that carries it, before drizzle-kit runs: two migrations of one name read as one in a review.
32
+
33
+ To move: a table already generated as `..._settingses` keeps its name, nothing reads it again. Rename it by a migration if the name matters.
34
+
35
+ **`verify-slice` lists what the end-to-end specs of the context share, and `plan-waves` no longer describes the whole project after each replayed command.**
36
+
37
+ - A slice whose end-to-end spec imports a new file of `test/e2e/support/<context>/` was told to commit the spec and not that file: the spec landed without what it imports, or the file was committed against the list. The folder of the context is now part of its slice, in the paths `verify-slice` prints and in the worktree `merge-trunk --to-land` asks to be clean. `test/e2e/support/` itself, shared by every context, stays the conductor's.
38
+ - `plan-waves` replays every command of every open row in a copy of the project, and each one wrote every generated document again: the lists of each `CONTEXT.md`, the contracts, the pages of what the tests state, read from every spec. On a plan of several hundred rows the command answered after minutes. A replayed command now writes the declarations a later command builds on, and nothing else.
39
+
40
+ **`generate gateway` no longer binds a contract a second time.** A gateway binds the read contract of its upstream to an empty value, which a person replaces by the implementation. A second context asking for a gateway on the same contract wrote that empty binding again below the first: at run time the last one won, and the first context called an empty object. The binding is now left alone where the contract is bound already.
41
+
42
+ **`generate repository` no longer declares a table a second time under the same name.** Run again on an aggregate that has its repository, with other options than the first time (`--personal`, `--tenant-scoped`), the command kept every file it had written and added a second declaration of the table to the schema of the context: every spec that loads that file then failed on a name declared twice. It is now refused, on the four ORM, and the file is left as it was; run again with the same options, it still adds nothing.
43
+
44
+ To move: nothing. To add a personal field to a table that exists, change the table by hand, with its line in the `*.personal-fields.ts` of the aggregate.
45
+
46
+ **Coverage no longer counts what the compiler writes to apply standard decorators, and the e2e client sends bytes as they are.**
47
+
48
+ - `decoratorCoverage()` of `@ddd-ts-kit/testing/vitest` handled the legacy decorator mode alone. Under the standard mode the compiler writes, for every decorated member, two `access` closures that only a decorator reading them calls, mapped to the line of the decorator: a projection with several `@On` lost statements or functions no spec could win back, and a layer fell under its floor with every line covered. The plugin now marks those statements too, and a project generated in the standard mode lists it after `decorators()` in `vitest.config.ts`.
49
+ - `FetchClient` of `@ddd-ts-kit/testing/e2e` turned every body that was not a text into JSON, a `Uint8Array` included, so an upload in another encoding than UTF-8 could not be tested end to end. Bytes, a `Blob` and a `FormData` are now sent as they are, under the content type the call names or the one of the form.
50
+
51
+ To move: in a project on standard decorators, write `plugins: [decorators({ compiler: '@typescript/native' }), decoratorCoverage()]` in `vitest.config.ts`, with `decoratorCoverage` imported from `@ddd-ts-kit/testing/vitest`. A coverage floor lowered for this reason, or a local plugin doing the same, can go.
52
+
53
+ **`status` names the rows in progress before the next one, and `plan-waves` names the command that opens the worktree of the conductor.**
54
+
55
+ - During the build, `Next:` of `ddd-ts-kit status` proposed the first `todo` row ready on the trunk even while rows were in progress, as if they were not there. It now reads `#US1.01 in progress; once landed, the next row ready on the trunk, #US1.02 ...`.
56
+ - A batch of the conductor in `plan-waves` said `on the trunk, by the conductor`, and the guard then refused the code of a context in the main checkout. The line now ends with where that work is done: `in the worktree of the plan (npx ddd-ts-kit worktree <plan>)`.
57
+
58
+ **`ddd-ts-kit merge-trunk` finds where a branch landed when the branch had merged the trunk before its squash.** Between two commits of the branch that carry the same patch, the newer one was taken only when the trunk held every file that differs between them. Across a merge of the trunk those are the files the merge brought: one more change of the trunk to any of them and the base fell back before that merge, so the lines of the trunk read as the branch's own and came back as conflicts. Only the files where that merge differs from the trunk commit it brought in are compared now.
59
+
60
+ **`ddd-ts-kit merge-trunk` without `--trunk` brings in the base of the worker of the worktree.** It read `origin/HEAD`, then `origin/main`, whatever `.ddd-ts-kit/worker.json` named as `base`, the ref `worker-scope` cut the branch from, where `verify-merge` already reads it: a worker cut from another branch than the default one was given the default one. `--trunk` still names any other ref. When the branch is up to date with that base while the default trunk holds commits it lacks, the answer says so and gives the command that brings it in, so that a worker cut from the branch of another one, or scoped again on its own branch, does not read "up to date" as "holds the trunk".
61
+
62
+ To move: a worker stacked on the branch of another worker has that branch as its base. Once that branch landed, name the trunk: `npx ddd-ts-kit merge-trunk --trunk origin/main`.
63
+
64
+ **`ddd-ts-kit merge-trunk` no longer drops the work of a branch when `--since` names a commit the trunk does not hold.** The merge is computed from `--since`: named too new, every file the branch added before it read as deleted by the trunk, the merge removed it without a conflict, and the report said `lost lines: none lost`. `--since` at the head of the branch is now refused (exit 2), since the result would be the trunk alone. `verify-merge`, which `merge-trunk` runs before its commit, reads the files a side added since the two sides parted (`git merge-base`), whatever base the merge was computed from: one the result lacks, while no commit of the other side touched its path, is reported under `files deleted by the merge` and stops the merge. A file the result holds under another path is not reported.
65
+
66
+ **`ddd-ts-kit worker-scope --resume` and `status --workers` no longer show a new row as committed, `(by order)`, by the commit of a row that already landed.** The rows of a worker were read from its base by name. On a branch kept for its next rows, the commits of the rows the trunk took as one squash commit are still ahead of that name, and a commit without a `Slice:` trailer among them took the first new row. The rows are now read from the commit `worker-scope` recorded with the base (`baseCommit`) while the branch holds it, and only from the commits made on top of it.
67
+
68
+ **`ddd-ts-kit merge-trunk` keeps a row of `docs/architecture/slices.md` the branch added before its squash when the trunk took the code without it, and `verify-merge` reports one that is lost.** The base of a branch that landed is found without the slices file, so it may hold a row, or a `done`, the trunk never took: merged from that base, the row read as deleted by the trunk and went, with `lost lines: none lost`. `verify-merge` now reads the row where the two sides parted before it calls a removal or a reopening the decision of the side brought in: a row the trunk never held is reported under `rows gone`, a status it never had under `rows no longer done`. When the base of `merge-trunk` is not that fork and holds another slices file, the rows are merged from the fork, shown under `automatic:`.
69
+
70
+ **`ddd-ts-kit verify-merge` no longer reports as lost the same line, or the same test title, that each side removed from a different file.** Lines and titles are counted over all the files of a merge as one set, so that a line moved to another file is not lost; counted that way, two removals of one text by the two sides counted once. The same generated marker (`// TODO(domain): ...`, an `it.todo`) filled in one file by the branch and in another by the trunk was reported as a loss tagged `(both)`. A line is now expected no more often than its files expect one by one.
71
+
72
+ **A worker that merges an integration branch is no longer stopped by the guard of the plugin.** The guard took what a merge brought in for the trunk's only when the other side was on the branch `origin/HEAD` names, `main` or `master`: with workers cut from an integration branch (`worker-scope --base work/<plan>`), every file of that branch outside the scope of the worker was held as its own change after `merge-trunk`, each command and write was refused, and the refusal named `git checkout <commit> -- <path>` and `git rm`, which would have undone the trunk in the branch. The `base` that `.ddd-ts-kit/worker.json` records is now a trunk too, ahead of the three others, during the work and at the stop of the worker. It is read once, when the worker is pinned, with the base commit and the branch the file records, and a scope file whose base, base commit or branch changes afterwards stops the worker as one whose context changes does, until the conductor restores it. A base is a branch of the repository, local or of a remote, other than the worker's own; and what a merge brings in is the trunk's when the branch holds it as the trunk does, as far as the branch merged the trunk that stood before the command, so a trunk fetched and merged by one command (`git fetch origin && git merge origin/main`) is held: `npx ddd-ts-kit merge-trunk` merges it, or the fetch goes in a command of its own. `merge-trunk --trunk <ref>` asked for another ref than that base is compared as any merge is. A branch that merged its trunk hundreds of times is read by a fixed number of runs of git, and a comparison git cannot make (a commit gone from the repository) holds the call instead of passing it. A merge of a branch that is no trunk is still held, and the refusal then names no command: the worker undoes nothing and reports the merge to the conductor. The refusal of a file changed outside the scope reads "Your commands, or another session, changed files outside your scope", since the guard sees the change, not who made it.
73
+
74
+ **The pin of a worker's scope follows the worker.** The guard of the plugin kept the pin of a `context-builder` (its context and its worktree, recorded at its first call) and the count of its run in the checkout the call started in; they are now kept under the git directory the worktrees of the repository share (`ddd-ts-kit/guard/` there), so a call is judged against the worktree pinned whichever checkout it starts in, and the refusal in the worktree of another worker now says how to go on: `cd <worktree> && ...`. Where several workers have a worktree, a first command that names none no longer pins the worker to the worktree its session happens to stand in: it reads, and what it writes is refused with "Run it as `cd <worktree> && ...`" until a command names its worktree, or an editor tool a file under it; a read under another `HOME`, `PATH`, `GIT_DIR`, `TMPDIR` or `CDPATH` is refused there as it is to a pinned worker, and git that versions is told the same thing as the other commands: the call names no worktree. With one worker, or outside a git repository, nothing changes. The note taken before a command is compared with the checkout of the session it was taken for, wherever the next call starts: a session whose working directory moved is no longer told that packages or files changed in a checkout the note never read.
75
+
76
+ A pin that stands and cannot be read, of this version or of an earlier one, holds every call of its worker, which is told to ask the conductor for a new launch: a worker is never pinned twice.
77
+
78
+ To move: nothing in a project. A worker running while the plugin is updated keeps its pin: the guard finds the one the earlier version took under `.ddd-ts-kit/guard/` and keeps it with the others, for the worktree it names; the old `scope-*.json` and `turns-*.json` files there are removed by the guard a week later.
79
+
80
+ **A file the conductor changes in its own checkout no longer stops its workers.** When a file of the checkout of the session was left changed while the last command of a worker ran, the guard of the plugin refused the next call of that worker once and told it to stop, though the file was written already and the worker may put nothing back there: each edit of the plan by the conductor stopped the workers running. The call now passes, and the worker is told once, as context of the call, to put nothing back there and to name the files in its report for the conductor; the stop of the worker still carries it to the conductor. A change of the packages the guard runs (`node_modules/ddd-ts-kit`, Biome) still refuses the next call once, except after `npx ddd-ts-kit merge-trunk`, which installs them itself when the lockfile changed, and so does a change of what the guard stands on in that checkout: `ddd-ts-kit.config.json`, the settings, hooks and plugins of a coding agent (`.claude/`, `.codex/`, `.agents/`, `.github/hooks/`, `.github/copilot/`) and a scope file under `.ddd-ts-kit/`. A guard switched off in the checkout of the session no longer lifts a pinned worker there: its guard keeps the mode of its first call in every checkout of the repository.
81
+
82
+ **The guard of the plugin no longer refuses three commands a worker may run inside its scope.** A folder of its context is moved, removed and copied into (`git mv <folder>`, `mv`, `rmdir`, `rm -r`, `cp file <folder>/`): the guard took a folder for a file with another name (a hard link), since a folder counts more than one link. The folder of the context itself is inside the scope for a tool given it whole (`eslint src/contexts/<context> --fix`). The schema of a query string, `presentation/http/<resource>/<use-case>/*.query.ts`, is written by hand as `docs/ARCHITECTURE.md` says, in the presentation layer of a context alone (`<context>/presentation/`, `<context>/<module>/presentation/`, `<context>/shared/presentation/`): everywhere else a new `*.query.ts` is still sent to `generate query`. A command given a folder (`cp`, `mv`, `ln`, `install`, `rsync`) is judged by what it brings into it and by the files it lands on there: a link or a whole tree comes from the scope alone, a file named lands where its name leads, and a whole tree, or files whose names the shell computes, land in no folder that holds a file with another name elsewhere, nor in one past 5000 files. `chmod`, `chown`, `chgrp`, `chattr`, `chcon`, `chflags`, `setfacl`, `setfattr`, `git add --chmod` and `git update-index --chmod` are held to the scope as a command that writes the file is. And the words of the command behind a package runner (`npx`, `pnpx`, `bunx`, `npm exec`, `pnpm exec`, `pnpm dlx`, `bun x`) are read as the shell split them, so `npx ddd-ts-kit generate value-object invoicing SupplierName --term "SupplierName=le nom d'un fournisseur"` is no longer refused as a quote that never closes, nor a `>` or a `;` inside a quoted word read as a redirection or a second command. That holds for the one shape the guard reads in full: the runner, its subcommand, the options it knows (`-y`, `-p`, `-w`, `--filter`, `--dir` and their like), then a program named plainly and its arguments. Any other invocation may hand text to a shell (`-c`, `--call`, `--shell-mode`, an option the guard does not know, short options written together, `true` or `false` after an option that takes no value, `npm exe`, a setting such as `npm_config_call` on the line, `yarn`, `bun run`) and every word of it is read as shell text, as before. A runner told where to run (`pnpm -C <dir> exec`, `npm --prefix <dir> exec`, `bun --cwd <dir> x`) has its command judged in that directory, `pnpm <program>` is read as `pnpm exec <program>`, and a worker runs no command in another checkout, where it only reads. A wrapper (`time`, `nice`, `timeout`, `env`, `sudo` and their like) is read through to the command it runs when the guard knows each option it is given; behind any other first word that is no program the guard knows, each later word that may name a program is read as a command too. A wrapper that writes a file of its own (the report of `time -o`, the log of `strace -o` or `script`, the lock of `flock`, `nohup.out` when nothing takes the output) is held to the scope for it as a redirection is, one given an option the guard does not know may write anywhere and is refused, and a wrapper or a program told where to run (`env -C <dir>`, `sudo -D <dir>`, `make -C <dir>`, `npm --prefix <dir> run`, `pnpm -C <dir> install`) is judged there, as a command after `cd <dir>;` is.
83
+
84
+ **The rules, the readers and the tool configuration of the CLI read a module that holds its tests (`<module>/test/`) and `shared/`, wherever they named a path of the context.** Nothing writes that layout yet, and the layout of today is read as before.
85
+
86
+ - `test/spec-required` and `test/builder-required` find a spec in `<module>/test/` and a builder in `<module>/test/builders/` or `shared/test/builders/`, and name the test folder of the module once it holds one; `test/acceptance-black-box` lets an acceptance spec import those builders; `module/complete` names `shared/<layer>/<role>` for a file of a module left in `shared/`.
87
+ - `ddd-ts-kit docs` writes the rules of the specs of `<module>/test/` on the behaviour page of their context, under the same headings as the specs of `test/unit/<module>/`, each named where it is; `describe` reads the route groups of `shared/presentation/http/` and of a module.
88
+ - `generate test-world` reads the fakes of every module and of `shared/`, and the world of `shared/test/worlds/`; `controllers` writes the route groups in `shared/presentation/http/` once the context holds it and moves a spec within `<module>/test/unit/`; `error-factories --apply` finds the spec of an error of a module in `<module>/test/unit/` or `test/unit/<module>/`, where it found it in `test/unit/` alone; `init --force` lists again a tables file of `shared/infrastructure/persistence/` and an erasure adapter of a module; `drizzle-generate` and `typeorm-generate` warn of the tables of `shared/` and of the modules a migration would drop.
89
+ - `ddd-ts-kit affected` reads a change of `<module>/test/` or `shared/test/` as a change of tests alone.
90
+ - The generated `.dependency-cruiser.cjs` holds `<context>/<folder>/test/` as test code, and the fakes and worlds there as files that may have no importer. The templates of a new project follow: `vitest.config.ts` (the integration specs), `vitest.mutation.config.ts`, `jest.mutation.config.js`, `knip.json` and `.claude/rules/tests.md` (with the Copilot instruction written from it) name `src/contexts/*/*/test/` beside `src/contexts/*/test/`.
91
+
92
+ To move: run `npx ddd-ts-kit depcruise-config --write` and commit `.dependency-cruiser.cjs`, which `depcruise-config --check` reports as stale until then. The other files change nothing until a module holds its tests; to follow them now, by hand: in `vitest.config.ts`, `const INTEGRATION_SPECS = ['src/contexts/*/test/integration/**/*.spec.ts', 'src/contexts/*/*/test/integration/**/*.spec.ts'];`, spread in the `exclude` of the unit project (`[...INTEGRATION_SPECS, ...NOT_AFFECTED]`) and given as the `include` of the integration one; in `vitest.mutation.config.ts`, add `'src/contexts/*/*/test/integration/**'` to `exclude`; in `jest.mutation.config.js`, the pattern `'/src/contexts/[^/]+/(?:test|[^/]+/test)/integration/'`; in `knip.json`, the entries `"src/contexts/*/*/test/fakes/*.ts"` and `"src/contexts/*/*/test/worlds/*.ts"`; in `.claude/rules/tests.md`, the path `"src/contexts/*/*/test/**"`.
93
+
94
+ **`ddd-ts-kit check` reads the layout to come of a context divided into modules: each module holding its tests, and `shared/` for what belongs to no module.** In a context that declares modules of its model, `<module>/test/` (`unit/`, `integration/`, `builders/`, `fakes/`) is read as the test folder of that module, and `shared/` as the place of what the context keeps at its own level: `shared/infrastructure/persistence/` (its schema and tables), `shared/presentation/http/` (its route groups, `guards/` and `shared/`) and `shared/test/` (`worlds/`, `fakes/`, `builders/`). A file there has the role it has today at the level of the context, and no module: `tree/closed` holds both, closed (`shared/` has no `domain/` and no `application/`), and the rules that read a location (`naming/suffix`, `test/helper-placed`, `module/complete`, `module/no-cycle`) judge it as the same file at its place of today. Nothing writes this layout yet and the layout of today is read as before: the generators, `move-to-module`, `context-layout`, `test/spec-required` and `test/builder-required` follow in the next versions, with the documentation. `shared` is now the name of that folder and can no longer name a module: `config/valid` and `ddd-ts-kit generate module` refuse it and say why, where `module/declared` refused it as a technical word.
95
+
96
+ **`ddd-ts-kit context-layout` lays a context divided into modules out with its tests in its modules and `shared/` for what belongs to none, and `move-to-module` moves within that layout.** Nothing else writes that layout yet, and the layout of today is read and accepted as before: running the command is a choice.
97
+
98
+ - In a context that declares modules, `context-layout` moves, in one run: the specs of `test/unit/<module>/` and `test/integration/<module>/` to `<module>/test/`; a spec, a fake or a builder left in the test folders of the context to the module of the file it is named after (a builder after an aggregate, a fake after a port or a repository), else of the one module its imports name; what the context keeps at its own level to `shared/`: its schema and tables (`shared/infrastructure/persistence/`), its route groups, guards and shared shapes (`shared/presentation/http/`), its worlds, and the specs, fakes and builders no module is told for (`shared/test/`). A file of a layer whose imports name no module, or two, stays and is listed with the `move-to-module` command to run. A file already at its target is never overwritten, the pair is listed; run again, nothing moves.
99
+ - Every import follows, as before, and now also the compiled path a migration names a moved file by (`../dist/src/contexts/<context>/infrastructure/persistence/<name>.schema.js` in a Knex migration), for `move-to-module` too. The schema index of the platform follows as any import.
100
+ - The entries of `knip.json` that name the fakes and worlds of a context name those of its modules beside them; a `vitest.config.ts`, `vitest.mutation.config.ts` or `jest.mutation.config.js` that still names the integration specs of `<contexts>/*/test/integration/` alone is said, not rewritten.
101
+ - `move-to-module`, in a context laid out that way, writes a spec to `<module>/test/<unit|integration>/`, takes a fake or a builder to `<module>/test/`, moves a file out of `shared/` and from one module to another, and finds the specs named after a moved file where that file came from.
102
+ - `tree/closed` accepts `shared/test/unit/` and `shared/test/integration/`: the spec of a guard of `shared/presentation/http/guards/`, or of several modules, lives there.
103
+
104
+ **`@ddd-ts-kit/eslint-plugin` reads `shared/` and the test folder of a module as the CLI does.** In a context divided into modules, a file of `<module>/test/` is a test of that module, and a file of `shared/infrastructure/`, `shared/presentation/` or `shared/test/` is read in its layer, with no module. The preset counts `<contexts>/*/*/test/**` among the test files. Nothing changes for a project as it is laid out today: this is the layout to come, which the CLI reads since the previous step.
105
+
106
+ **Breaking: a context divided into modules keeps no layer folder and no `test/` folder at its root; each module holds its tests, and `shared/` holds what belongs to none.** A part of the model is one folder, its tests with it; what several modules share has one place. A context without modules is unchanged.
107
+
108
+ - The layout: `<module>/domain/` to `<module>/presentation/` and `<module>/test/` (`unit/`, `integration/`, `builders/`, `fakes/`); `shared/infrastructure/persistence/` (the schema and tables of the context), `shared/presentation/http/` (its route groups, `guards/`, `shared/`) and `shared/test/` (its worlds, and the fakes, builders and specs of no module). A builder follows the aggregate it is named after and a fake the port or the repository it is named after, into their module. `shared/` holds no `domain/` and no `application/`, is never declared in the config, and no module may be named `shared`.
109
+ - `ddd-ts-kit generate` writes that layout and nothing else: a spec, a fake and a builder in `<module>/test/` (`generate builder` now takes `--module`), a schema, a route group, a guard, a shared shape and a world in `shared/`. It refuses a context that still holds `test/` at its own level, and names `context-layout`.
110
+ - `module/complete` reports `test/` at the level of a context that declares modules, and a layer folder there that holds nothing but what `shared/` holds now, as an error whatever its severity, one finding per folder. A file of a layer still at the level of the context, or a file of a module left in `shared/`, stays a warning: a context that gains its first module moves one cluster per commit with `move-to-module`, read as it is meanwhile.
111
+ - `move-to-module` takes a spec, a fake or a builder to `<module>/test/`, from the level of the context, from `shared/` or from another module.
112
+ - `controllers` refuses to turn a function route that sits in `shared/presentation/http/`: a route belongs to a module, and the command names the `move-to-module` to run first.
113
+ - The layout of 0.86 and 0.87, a module under `domain/<module>/` and `application/<module>/`, is no longer read, by the CLI nor by `@ddd-ts-kit/eslint-plugin`: a project still laid out that way runs `context-layout` of 0.109 first.
114
+
115
+ To move: `npx ddd-ts-kit context-layout`, then `npx ddd-ts-kit depcruise-config --write`, the formatter, the checks and the tests. The command moves, in each context that declares modules, the specs of `test/<unit|integration>/<module>/` to `<module>/test/`, each spec, fake and builder left in the test folders of the context to the module of the file it is named after, else of the one module its imports name, else to `shared/test/`, and the schema, the route groups, guards and shared shapes and the worlds to `shared/`, with every import of them and the compiled path a migration names them by. It leaves to a person, and lists: a file of a layer whose imports name two modules, or none (`ddd-ts-kit move-to-module <context> <module> <path>`); a file already at its target, which it never overwrites; and each `vitest.config.ts`, `vitest.mutation.config.ts` or `jest.mutation.config.js` that still names the integration specs of `src/contexts/*/test/integration/` alone, where `src/contexts/*/*/test/integration/` goes beside it. `ddd-ts-kit check --rule module/complete` lists the folders still to move.
116
+
117
+ **The skills and agents of the plugin name the places of a context divided into modules of the model.** A module holds its four layers and its tests (`<module>/test/unit/`, `integration/`, `builders/`, `fakes/`), what belongs to no module sits in one `shared/` folder (`shared/infrastructure/persistence/`, `shared/presentation/http/`, `shared/test/`), `generate builder` takes `--module`, and `move-to-module` and `context-layout` are named where a project moves. The `plan-slices` skill also says that a read taking criteria, a scope or a page is named `Search...`, never `List...`.
118
+
119
+ **The actor of an end-to-end test holds roles of the role vocabulary of the platform, and a misspelled role no longer compiles.** Under `--authz rbac` and `--authz abac`, where `init` writes `Role` in `src/platform/auth/authorization/role.ts`, `test/e2e/support/create-credentials.ts` types the roles of a test actor with it (`readonly roles?: readonly Role[]`), whatever the authenticator (`none`, `jwt`, `keycloak`, `passport`): `application.as({ id: 'ada', roles: ['admn'] })` is refused by the compiler (`Type '"admn"' is not assignable to type 'Role'`) and the editor completes the role. `generate e2e` writes the role by its key, `roles: [Role.Admin]`, with its import: the administrator of the vocabulary, or its first role when it names none. Under relationships and a custom authorizer, which start without that vocabulary, the roles stay strings, as before.
120
+
121
+ `Actor.roles` of `@ddd-ts-kit/kernel` stays `readonly string[]`, and `RoleBasedAuthorizer` of `@ddd-ts-kit/auth` is not typed by the role names: a role may be declared by `inherits` alone, which a single type of the keys of `roles` refuses.
122
+
123
+ To move: in a project already generated under RBAC or ABAC, in `test/e2e/support/create-credentials.ts`, add `import type { Role } from '@/platform/auth/authorization/role';` and replace `readonly roles?: readonly string[];` of `TestActor` by `readonly roles?: readonly Role[];`. The compiler then lists each spec that names a role the vocabulary does not hold: write it `Role.<Key>`, or add the role to `role.ts`.
124
+
125
+ **Generated code names an error code by a constant, which the editor completes and the compiler checks, where it wrote a string.** `@ddd-ts-kit/kernel` exports `KitCodes`, the codes the packages of the kit raise (`KitCodes.Forbidden` is `'FORBIDDEN'`, `KitCodes.ValidationFailed` is `'VALIDATION_FAILED'`, and so on for the twenty-two of them), with the type `KitCode`. The generators write it wherever they named such a code: the `errors` of a function route (`errors: [KitCodes.Unauthorized, KitCodes.Forbidden]`), of a route group (`errors: [KitCodes.Forbidden]`), of a guard and of the audit routes of the platform, the spec of a route or of a controller (`code: KitCodes.ValidationFailed`), the specs of the handlers (`rejects.toMatchObject({ code: KitCodes.Forbidden })`), of a search reader and of a value object, and the route groups and the handler specs of the identity preset. Under `"stack.refusals": "named"`, the spec `generate error` writes for a refusal expects its code by its entry of the code list of the context (`expect(error.code).toBe(BillingCodes.InvoiceAlreadyIssued)`), and a spec written before is given the import of the list when a case is added to it.
126
+
127
+ What reads an `errors` list reads both forms. `errors/known-code` follows a member of a code list to its code: the list of the context of the route (`<context>.codes.ts`), that of the shared kernel, or `KitCodes`; it reports a key the list does not hold, a code of another context named through the list of that context, and a member of anything else, which it cannot read. `ddd-ts-kit describe`, the reference of `CONTEXT.md` and the digest give the code a member names. `ddd-ts-kit controllers` leaves out of a controller the codes of the kit its guard and its group already say, written either way, and writes the group with `KitCodes.Forbidden`.
128
+
129
+ `expectProblem` and `expectRefusal` of `@ddd-ts-kit/testing` take the codes a caller names as a type argument: `expectProblem<SchedulingCode | KitCode>(response, { status: 409, code: 'SLOT_TAKEN' })` and `expectRefusal<SchedulingCode>(() => appointment.cancel(at), 'APPOINTMENT_ENDED')` refuse a code outside them at compile time. Without the type argument they take any string, as before.
130
+
131
+ Left as it was: under `"stack.refusals": "factories"` and `"classes"` a context has no code list, so its own codes stay strings; the identity preset still writes the codes of its context as strings in its controllers and its specs.
132
+
133
+ To move: nothing has to change, a string still names its code. To take the constants in a project already generated, import `KitCodes` from `@ddd-ts-kit/kernel` and replace each code of the kit written as a string in `errors: [...]` and in the specs (`'FORBIDDEN'` becomes `KitCodes.Forbidden`, `'VALIDATION_FAILED'` becomes `KitCodes.ValidationFailed`); under named refusals, replace a code of the context by its member of `<Context>Codes`. A route that already named a code through an object of its own (`errors: [MyCodes.Something]`) is now reported: `ddd-ts-kit check --rule errors/known-code` lists them, and each is written as a member of the code list of its context, of `KitCodes`, or as a string.
134
+
135
+ **The `use-case` skill has a route declare its error codes by the members of the code lists.** It tells the agent to write `errors` of a route with `<Context>Codes.<Refusal>` for a refusal of the context and `KitCodes.<Code>` of `@ddd-ts-kit/kernel` for a code of the kit, never as a string, so that the editor completes the code and a typo does not compile; under `"stack.refusals": "factories"`, where no list holds the codes of the context, they stay strings and only the codes of the kit are named by `KitCodes`.
136
+
137
+ **In the process, the projections of an integration event apply before the handlers that react to it.** `@ddd-ts-kit/di` subscribed the consumers of an event in the order of the modules, so a handler declared in a context listed before the one of a projection ran first and read a read model the event had not reached yet. The projections now subscribe first, whatever the order of the modules: on the in-memory bus, and on what the outbox relay publishes to it, a handler reads the row the same event wrote. On a broker each consumer has its own queue and nothing orders them, as before.
138
+
139
+ To move: nothing. A handler that relied on running before a projection of the same event, which nothing promised, now runs after it.
140
+
141
+ **The handlers of a domain event run in the execution context of the save that recorded it, so an integration event published for a command run inside another one carries the tenant of the inner command.** A command dispatched inside another joins its unit of work, and its domain events are dispatched at the end of the outer one: their handlers ran in the execution context of the outer command, and what they published took its tenant, or none when the outer work had none, so the consumers answered `FORBIDDEN` or worked in the wrong tenant. `dispatchingOnSave` and `announceDomainEvents` of `@ddd-ts-kit/kernel` take the execution scope as an optional last argument and keep, with each event, the context in progress at the save; both phases (`before-commit`, `after-commit`) run in it. `kernelModule` of `@ddd-ts-kit/di` passes the scope it binds, and the platform `init` writes without a container passes its own.
142
+
143
+ To move: under a container, nothing. In a project assembled by hand (`"stack.di": "manual"`), in `src/platform/composition/create-platform.ts`, pass the scope to `adapterOf` and write `dispatchingOnSave(resilient, () => domainEvents, () => scope)`. A handler that relied on running in the context of the outer command reads the execution context of the save instead.
144
+
145
+ ## 0.109.0
146
+
147
+ **`ddd-ts-kit init --search opensearch` wires the read models of OpenSearch in the platform.** The choice is recorded as `stack.search` (`none` by default, and for a config that does not say). `@ddd-ts-kit/opensearch` joins the dependencies; `src/platform/search/` hands every context `SearchIndexes`, whose `options(name, definition)` gives an `OpenSearchReadModelStore` the transport of `OPENSEARCH_URL` and the tenancy of the project (a filtered alias per tenant under `--tenancy shared-table`), and provisions the index of each store before a request: once without tenancy, and under shared tables for the tenant of the work, once the tenant directory of the platform lists it (`TENANTS`, or the organisations of the identity preset), so a tenant created later needs no restart and an unknown one creates no index. The start provisions best effort and never fails on search; a project with no store calls nothing, and the privacy scripts reach the copies kept in OpenSearch. A store name built twice with another definition throws `SearchNameTakenError`. `loadConfig` reads `OPENSEARCH_URL`, and `OPENSEARCH_USERNAME` with `OPENSEARCH_PASSWORD` both or neither, and refuses a `TENANTS` entry that is not lower case; the compose stack runs one node, `.env.example` and the README name the variables. No generator writes a store yet: an adapter extends `OpenSearchReadModelStore` and calls `super(search.options('billing_invoices', criteria))`. The new rule `search/store-from-platform`, an error, refuses a context that names anything of the package but the store and its refusals, names the store outside `extends`, builds it with anything but `super(<search>.options(..))`, or spreads the answer of `.options(` in any of its files. What fits a search read model and what does not, its tests, its tenants and its rights in production: `docs/tools/search-read-models.md`; each choice: `docs/adr/0009-init-wires-opensearch.md`.
148
+
149
+ **`@ddd-ts-kit/opensearch/testing` exports an OpenSearch in memory and a local node for tests.** `InMemoryOpenSearch` is an `OpenSearchTransport` that serves the subset of the REST API `OpenSearchReadModelStore` calls (strict mappings, aliases with a filter and a routing, conditional writes, the query DSL the store writes), the fake the package runs its own specs on: handed to the store, it holds an adapter to `readModelRowsContract` and `criteriaContract` in a unit spec with no server. `OpenSearchServer` serves the same node on a local port, behind the credentials of the security plugin, for a spec that goes through `fetchTransport`. A spec on a real node still proves what the fake answers differently. See the README of the package, "In the specs of a project", and `docs/tools/search-read-models.md`.
150
+
7
151
  ## 0.108.1
8
152
 
9
153
  **`@ddd-ts-kit/opensearch` is on npm.** The read model store on OpenSearch, with each tenant in an index or behind a filtered alias, ships with the other packages under the version of the kit: `npm i @ddd-ts-kit/opensearch`. `init` does not wire it yet; its README shows the composition by hand, and `docs/adr/0008-a-read-model-store-on-opensearch.md` records each choice.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:d53193bb21e9a5d1 -->
2
+ <!-- translation-of: README.md sha256:a81e842cf19ebf21 -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -77,7 +77,7 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
77
77
  [--authn jwt|keycloak|passport|none] [--authz rbac|abac|rebac|custom]
78
78
  [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis]
79
79
  [--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
80
- [--event-sourcing on|off] [--privacy on|off]
80
+ [--search none|opensearch] [--event-sourcing on|off] [--privacy on|off]
81
81
  [--errors none|sentry] [--logger stdout|pino|winston]
82
82
  [--style declared|explicit] [--assembly barrel|discovery]
83
83
  [--dependencies signature|listed] [--refusals named|factories|classes]
@@ -644,13 +644,14 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
644
644
  | `--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 |
645
645
  | `--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 |
646
646
  | `--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)) |
647
+ | `--search opensearch\|none` | enregistré comme `stack.search`, `none` par défaut : où vivent les modèles de lecture qu'un contexte tient pour la recherche. `opensearch` : `@ddd-ts-kit/opensearch`, `src/platform/search/search-indexes.ts` (`SearchIndexes`, la classe abstraite que reçoit l'adaptateur d'un port de modèle de lecture : `super(search.options('billing_invoices', criteria))`) et `search/open-search.ts` (`fetchTransport` sur `OPENSEARCH_URL`, l'utilisateur d'`OPENSEARCH_USERNAME` et `OPENSEARCH_PASSWORD` les deux ou aucune, la stratégie `attribute` sous `--tenancy shared-table`, `none` sinon), lié par `search/search.module.ts` sur un conteneur du kit, `platform.search` câblé à la main et sous Nest ; l'index de chaque store construit à partir de lui provisionné avant une requête, sous tables partagées pour le locataire du travail une fois que l'annuaire des locataires de la plateforme le liste (un locataire non listé ne crée aucun index), au mieux au démarrage, qui n'échoue jamais sur la recherche, rien d'appelé sans store ; les scripts de confidentialité reçoivent le nœud ; un service compose `opensearch` (un nœud, extension de sécurité coupée). Aucun générateur n'écrit de store, et le pipeline ne démarre aucun nœud ; un contexte construit ses stores depuis `SearchIndexes` seulement (`search/store-from-platform`). [Modèles de lecture de recherche](../../docs/tools/search-read-models.fr.md) |
647
648
  | `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` |
648
649
  | `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` |
649
650
  | outillage des migrations | `drizzle.config.ts`, `knexfile.js` et le dossier `migrations/`, `prisma/schema/schema.prisma` (le client, la datasource et les tables de la plateforme ; `generate repository` ajoute le fichier de chaque contexte, `prisma/schema/<context>.prisma`) et `prisma.config.ts`, ou `data-source.ts`. Un projet qui garde le seul `prisma/schema.prisma` des versions antérieures à 0.95 le garde avec son `prisma.config.ts` et son `db:client`, même sous `--force` : `init` n'écrit rien sous `prisma/schema/`, ses notes donnent les étapes du déplacement en nommant les contextes du projet, et `generate repository` refuse jusqu'au déplacement |
650
651
  | `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 |
651
652
  | `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>] [--rerun]`, `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`, chacune laissant son entrée avec `--audit on`, et ce que l'outbox et le stockage des *jobs* gardent de la personne ; un id qui n'a rien atteint est refusé, code de sortie 1, et annoncé à personne, sauf si `--rerun` dit que cette personne a déjà été effacée ; `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, une copie qu'aucun contexte n'a déclarée, un message déjà livré ou un *job* qui ne nomme aucun `subject` |
652
653
  | `docker-compose.yml`, `.env.example`, `Dockerfile`, `.dockerignore` | la base de données avec un contrôle de santé et un volume nommé, `jaegertracing/jaeger:2.22.0` derrière le profil `observability`, chaque port publié sur 127.0.0.1 seulement (une adresse plus large s'écrit dans l'entrée à dessein, le README du projet dit comment), les ports depuis `.env` ; une image multi-étapes, sans root, avec les seules dépendances de production |
653
- | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (l'application entière sur un port libre, sur une base de données dans le processus sauf si `DATABASE_URL` est définie, aucun *job* lancé par le temps ; `settled()` se résout quand l'outbox a relayé ce que les requêtes HTTP ont enregistré ; `publish(events)` remet des événements d'intégration de l'amont à ses gestionnaires, comme le ferait le relais de cet amont), `create-credentials.ts`, `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)` : une trace sans les appels qu'un adaptateur fait sur lui-même, la forme que vérifie `expectSpanTree`) |
654
+ | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (l'application entière sur un port libre, sur une base de données dans le processus sauf si `DATABASE_URL` est définie, aucun *job* lancé par le temps ; `settled()` se résout quand l'outbox a relayé ce que les requêtes HTTP ont enregistré ; `publish(events)` remet des événements d'intégration de l'amont à ses gestionnaires, comme le ferait le relais de cet amont), `create-credentials.ts` (au nom de qui un test appelle, `application.as({ id, roles })` ; en RBAC et en ABAC les rôles sont ceux de `Role` dans `src/platform/auth/authorization/role.ts`, si bien que `roles: [Role.Admin]` est complété par l'éditeur et qu'un rôle mal orthographié ne compile pas), `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)` : une trace sans les appels qu'un adaptateur fait sur lui-même, la forme que vérifie `expectSpanTree`) |
654
655
  | `docs/context-map.md`, `docs/integration/README.md` | voir `docs` |
655
656
  | `test/architecture/extractable.spec.ts` | écrit avec le premier contexte : démarre chaque contexte seul sur le kernel et la plateforme, ses *jobs* compris |
656
657
  | `eslint.config.mjs` | le preset `dddTsKit` de `@ddd-ts-kit/eslint-plugin`, lint typé sur le tsconfig du projet |
@@ -821,9 +822,9 @@ Next, in this order: the language of the context first, then the business decisi
821
822
  | Genre | Arguments | Écrit |
822
823
  |---|---|---|
823
824
  | `context` | `<name> --classification <c> [--purpose "<two sentences>"] [--term ...]... [--upstream <ctx>[:relationship]]... [--preset identity] [--reason "<why>"]` | `CONTEXT.md` avec son glossaire, `published-language/index.ts`, l'entrée de configuration, l'enregistrement dans `platform/composition/compose-application.ts` et dans `test/architecture/extractable.spec.ts` ; sur tsyringe, avec HTTP, `presentation/http/<name>.routes.ts` (une fonction des deux bus, dans les deux styles) ; déclaré : le barrel `<name>.declarations.ts` ; explicite et câblage manuel : `<name>.module.ts`. `<name>.permissions.ts`, à la racine du contexte, naît avec la première permission, ou tout de suite quand `platform/auth/authorization/permissions.ts` liste les ensembles de permissions (rebac, custom). Avec `--preset`, le contexte est ensuite écrit en entier depuis ce *preset*, sa classification et son objet étant ceux du *preset* sauf si les options disent autre chose ([Presets](#presets)) |
824
- | `module` | `<context> <module> [--purpose "<what it holds>"] [--classification <c>] [--term ...]...` | un module du modèle d'un contexte (Evans, Modules) : déclaré dans `contexts.<name>.modules` de la configuration, sa ligne dans le tableau `## Modules` de `CONTEXT.md`, ses termes ajoutés au glossaire et, en style explicite, son fichier de module `<module>/<module>.module.ts` composé par `<context>.module.ts` ; relancée, la commande ajoute ce qui manque. Les autres genres y écrivent avec `--module <module>`, `move-to-module` y déplace des fichiers |
825
+ | `module` | `<context> <module> [--purpose "<what it holds>"] [--classification <c>] [--term ...]...` | un module du modèle d'un contexte (Evans, Modules) : déclaré dans `contexts.<name>.modules` de la configuration, sa ligne dans le tableau `## Modules` de `CONTEXT.md`, ses termes ajoutés au glossaire et, en style explicite, son fichier de module `<module>/<module>.module.ts` composé par `<context>.module.ts` ; relancée, la commande ajoute ce qui manque. Les autres genres y écrivent avec `--module <module>`, `move-to-module` y déplace des fichiers. Les autres générateurs y écrivent une *spec*, un *fake* et un *builder* dans `<module>/test/`, et écrivent dans `shared/` ce qui n'appartient à aucun module (le schéma, les groupes de routes, les gardes, les formes partagées, les mondes) ; `context-layout` dispose un contexte qui tenait ses tests à son propre niveau |
825
826
  | `aggregate` | `<context> <Name> [--birth "<Fact>"] [--event-sourced] [--module <module>]` | agrégat, *builder*, *spec* sur le modèle étant donné / quand / alors. `--birth` nomme le fait avec lequel il naît, dans les mots du métier (`"Invoice Issued"`, `InvoiceIssued` ou `Issued`), jugé par le glossaire et refusé s'il ne se lit pas comme quelque chose qui est arrivé : il écrit cet événement du domaine comme le fait `generate domain-event`, `create` l'enregistre à l'instant qu'on lui donne, le *builder* prend cet instant nommé d'après le fait (`issuedAt(instant)`) et la *spec* prouve la naissance ; sans lui, l'état ne garde aucun instant à lui (les colonnes d'audit de la ligne datent sa création) et un `TODO(domain)` dans `create` dit comment enregistrer la naissance plus tard sans réécrire l'agrégat (`generate domain-event`, la ligne `record`, puis `generate builder`) ; avec `--event-sourced`, un agrégat sur `EventSourcedAggregate` dont l'état est le rejeu de ses événements, né avec son événement du domaine `Created` (ou le fait que nomme `--birth`), son état gardant l'instant de ce fait (`createdAt`), le codec de ses événements stockés dans `infrastructure/persistence/<name>-events.mapper.ts`, un *builder* qui rejoue un historique et une *spec* à partir d'événements donnés, et une note qui nomme le `EventSourcedRepository` auquel délègue son adaptateur de *repository* ; refusé tant que `stack.eventSourcing` est `off`, avec le `init --force --event-sourcing on` à lancer |
826
- | `builder` | `<context> <Aggregate>` | `test/builders/<name>.builder.ts`, une classe qui étend `Builder` ; l'instant de la naissance qu'enregistre `create` est un ingrédient nommé d'après son fait, le *builder* d'un agrégat *event-sourced* rejoue son événement de naissance, et une note nomme les paramètres de `create` qu'il ne peut deviner ; quand `create` manque ou enregistre un événement qui ne s'appelle pas `<Aggregate><Fact>`, aucun *builder* n'est écrit et une note dit pourquoi |
827
+ | `builder` | `<context> <Aggregate> [--module <module>]` | `test/builders/<name>.builder.ts`, une classe qui étend `Builder` ; l'instant de la naissance qu'enregistre `create` est un ingrédient nommé d'après son fait, le *builder* d'un agrégat *event-sourced* rejoue son événement de naissance, et une note nomme les paramètres de `create` qu'il ne peut deviner ; quand `create` manque ou enregistre un événement qui ne s'appelle pas `<Aggregate><Fact>`, aucun *builder* n'est écrit et une note dit pourquoi |
827
828
  | `test-world` | `<context> [Name]` | `test/worlds/<name>.world.ts` (le nom est par défaut celui du contexte) : `a<Name>World({ now, idPrefix, given })`, la mise en place que partagent plusieurs *specs* du contexte. Il lit les *fakes* de `test/fakes/` et le port que chacun implémente, les construit, les passe à `given` pour que la *spec* enregistre ce dont elle part, puis à l'application de test (avec `modules`, l'autorisation de la *spec*) ou, câblé à la main, enveloppe les *repositories* des bus de `createTestBuses` par `dispatching` ; il rend chaque *fake* sous le nom de son port. Un *fake* qui attend des arguments de constructeur, ou, avec un conteneur, celui d'un port que rien ne lie ni n'utilise encore, est laissé de côté avec une note. Avec un conteneur, il prend aussi `fakes`, le *fake* d'un port qu'il ne sait pas construire (un lecteur qui répond ce que la *spec* lui donne), et, avec la multi-location, `tenants`. Le monde nommé d'après le contexte est celui par lequel passent les *specs* de `command`, `query` et `job` générées après lui |
828
829
  | `entity` | `<context> <Name> [--module <module>]` | entité, *spec* |
829
830
  | `value-object` (`vo`) | `<context> <Name> [--module <module>]` | objet-valeur, *spec* |
@@ -1930,7 +1931,9 @@ exacte, avec le *trailer* qui nomme la ligne :
1930
1931
 
1931
1932
  `--resume` lit où en est le *worker* arrêté du contexte, depuis le tronc, et ne crée ni ne réécrit
1932
1933
  rien : ses lignes (commitées d'après leur *trailer* `Slice:`, ou dans l'ordre des *commits*
1933
- `feat(<contexte>)` pour un *commit* plus ancien, affichées `(by order)`), les fichiers de la ligne
1934
+ `feat(<contexte>)` pour un *commit* plus ancien, affichées `(by order)` ; sur une branche gardée
1935
+ pour ses lignes suivantes, les *commits* faits avant qu'elle n'apporte la base enregistrée par
1936
+ `worker-scope` sont ceux des lignes déjà arrivées et ne sont pas lus), les fichiers de la ligne
1934
1937
  en cours, les marqueurs laissés dans le contexte, sa dernière vérification et ce qui a changé
1935
1938
  depuis, si son rapport est à jour, et son agent. Puis l'étape suivante : `SendMessage` à cet agent,
1936
1939
  avec le message à envoyer tel quel, quand il s'est arrêté au milieu d'une ligne après un progrès,
@@ -2106,7 +2109,10 @@ débarrassée de ses espaces de bord et de ses espaces répétés, les lignes de
2106
2109
  les marqueurs de conflit qu'un côté a commités écartés, et chaque import de liaisons nommées éclaté en une entrée par liaison : le résultat doit
2107
2110
  la contenir autant de fois que la base, plus ce que chaque côté a ajouté, moins ce que chaque côté
2108
2111
  a retiré. Les fichiers sont comptés ensemble : une ligne déplacée dans un autre fichier n'est pas
2109
- perdue, une ligne remise en forme sur plusieurs lignes non plus. Les fichiers dérivés, les
2112
+ perdue, une ligne remise en forme sur plusieurs lignes non plus. Une ligne n'est pas attendue
2113
+ plus de fois que ses fichiers ne l'attendent un par un : la même ligne retirée par chaque côté
2114
+ d'un fichier différent (un marqueur généré rempli dans un fichier par la branche, dans un autre
2115
+ par le tronc) n'est pas une perte. Les titres des tests sont comptés de la même façon. Les fichiers dérivés, les
2110
2116
  fichiers dont les premières lignes disent qu'un outil les a écrits (`@generated`,
2111
2117
  `autogenerated`, `DO NOT EDIT`), les migrations, les fichiers de verrouillage (npm, pnpm, yarn,
2112
2118
  bun, uv, poetry, Pipfile, Cargo, Bundler, Composer, Go, NuGet) et `docs/architecture/slices.md`
@@ -2116,6 +2122,7 @@ sont tenus hors des lignes.
2116
2122
  |---|---|
2117
2123
  | une ligne ajoutée par un côté, ou gardée par les deux, absente du résultat | erreur |
2118
2124
  | un fichier qu'aucun côté n'a supprimé, absent du résultat avec des lignes qu'aucun autre fichier n'a (un constat par fichier) | erreur |
2125
+ | un fichier ajouté par un côté depuis la séparation des deux côtés (`git merge-base`), absent du résultat alors qu'aucun *commit* de l'autre côté n'a touché son chemin ; pas signalé quand le résultat le porte sous un autre chemin | erreur |
2119
2126
  | une ligne de `slices.md` terminée d'un côté et non terminée dans le résultat, ou une ligne d'un côté disparue | erreur |
2120
2127
  | le titre d'un `it(` ou d'un `test(` d'un côté disparu, un fichier de *spec* d'un côté supprimé | erreur |
2121
2128
  | une migration d'un côté dont aucune migration du résultat n'a la description (son nom sans numéro ni `working-`) | erreur |
@@ -2128,7 +2135,12 @@ Une ligne insérée entre des lignes de la base que l'autre côté n'a pas touch
2128
2135
  même quand l'autre côté a inséré au même endroit : perdre l'une de deux nouvelles méthodes est la
2129
2136
  perte que le contrôle cherche. De même pour une réécriture qui a perdu plus de lignes que les
2130
2137
  lignes de la base ou que la réécriture de l'autre côté qu'elle concurrençait (une modification
2131
- suivie d'une nouvelle méthode). Ce qu'un côté a supprimé, ou rouvert, n'est jamais signalé. Une ligne de la branche dans un fichier
2138
+ suivie d'une nouvelle méthode). Ce qu'un côté a supprimé, ou rouvert, n'est jamais signalé. Pour
2139
+ le côté apporté, une ligne de `slices.md` est lue aussi là où les côtés se sont séparés : une base
2140
+ trouvée sur la branche après un *squash* peut porter une ligne, ou un `done`, que le tronc n'a
2141
+ jamais pris, et une ligne que le tronc n'a jamais portée n'est pas une ligne qu'il a supprimée ou
2142
+ rouverte. Le fichier ajouté ci-dessus est lu de là aussi : une base nommée trop récente
2143
+ (`--since`, `--base`, un *trailer* `Merge-Base:`) ne le cache pas. Une ligne de la branche dans un fichier
2132
2144
  que la branche n'a pas touché depuis sa bifurcation de la branche principale (le fichier est le même sur
2133
2145
  la branche et à `git merge-base`) ne l'est pas non plus : ce que la branche principale y a supprimé ou
2134
2146
  remplacé depuis est son propre changement, quelle que soit la base du calcul de la fusion. Une
@@ -2162,13 +2174,17 @@ ddd-ts-kit merge-trunk --continue [--accept-lost] | --abort
2162
2174
 
2163
2175
  Apporte le tronc dans la branche en un seul *commit* de fusion calculé à partir du *diff* propre
2164
2176
  de la branche. Ne rebase jamais, ne récupère jamais rien (le *commit* que nomme `--trunk` est
2165
- affiché ; par défaut `origin/HEAD`, puis `origin/main`). Refusé, sortie 2 : un arbre de travail
2177
+ affiché ; par défaut la `base` de `.ddd-ts-kit/worker.json` dans le *worktree* d'un *worker*, la
2178
+ référence d'où sa branche a été coupée, puis `origin/HEAD`, puis `origin/main` ; un *worker*
2179
+ empilé sur la branche d'un autre nomme lui-même le tronc, `--trunk origin/main`, une fois cette
2180
+ branche arrivée). Refusé, sortie 2 : un arbre de travail
2166
2181
  qui n'est pas propre (hors `.ddd-ts-kit/`), une fusion, un *rebase*, un *cherry-pick* ou un
2167
2182
  *revert* en cours, un dépôt où git ne connaît aucun auteur de *commit* (la fusion se termine
2168
2183
  par un *commit*), un tronc inconnu.
2169
2184
 
2170
2185
  1. **La base** : le *commit* le plus récent de la branche que le tronc porte déjà. `--since
2171
- <commit>` (un *commit* de la branche) ; sinon le point d'arrivée : le *commit* le plus récent
2186
+ <commit>` (un *commit* de la branche, refusé quand c'est sa tête : le résultat serait le tronc
2187
+ seul) ; sinon le point d'arrivée : le *commit* le plus récent
2172
2188
  dont le changement entier depuis le tronc est un *commit* du tronc, comparé par *patch id*
2173
2189
  stable sans lignes de contexte, sans les fichiers dérivés, les migrations, `slices.md`,
2174
2190
  `plan.md` ni les fichiers de verrouillage, cherché sur cette branche, sur la branche que
@@ -2176,11 +2192,14 @@ par un *commit*), un tronc inconnu.
2176
2192
  des *commits* avec elle (une branche empilée dont le parent a été fusionné en *squash*, une
2177
2193
  branche réutilisée après l'arrivée de sa première ligne) ; parmi des *commits* qui partagent un
2178
2194
  même *patch*, le plus ancien est pris, un plus récent seulement quand le tronc porte ce qu'il a
2179
- changé ; sinon le `baseCommit` enregistré par worker-scope, quand c'est un *commit* de la
2195
+ changé (à travers une fusion du tronc faite par la branche, ce que cette fusion a changé en
2196
+ propre : les fichiers qu'elle a apportés sont ceux du tronc) ; sinon le `baseCommit` enregistré par worker-scope, quand c'est un *commit* de la
2180
2197
  branche et que ses propres lignes sont toutes sur le tronc (sinon il s'arrête, rien de changé,
2181
2198
  et les liste pour qu'une personne confirme par `--since`) ; sinon `git merge-base`, et le
2182
2199
  rapport nomme chaque branche qui partage des *commits* sans être trouvée sur le tronc, avec son
2183
- `--since`. Trop ancienne, la base se voit en conflits de plus, jamais en perte silencieuse.
2200
+ `--since`. Trop ancienne, la base se voit en conflits de plus, jamais en perte silencieuse ;
2201
+ trop récente, ce que seul `--since` peut nommer, elle fait perdre ce que la branche a ajouté
2202
+ avant elle, et `verify-merge` s'arrête sur chaque fichier disparu ainsi.
2184
2203
  2. **L'aperçu** : `git merge-tree --write-tree --merge-base=<base> HEAD <trunk>`, marqueurs diff3 ;
2185
2204
  le même sans la base donne ce sur quoi un simple `git merge` entrerait en conflit. `--dry-run`
2186
2205
  s'arrête ici et ne change rien.
@@ -2197,7 +2216,7 @@ par un *commit*), un tronc inconnu.
2197
2216
  | dérivé | `openapi/`, `clients/`, `docs/integration/`, `docs/behaviour/`, `.dependency-cruiser.cjs`, les *barrels* et listes de chaque contexte | côté du tronc, réécrit par `regenerate` |
2198
2217
  | document mixte | `CONTEXT.md`, `docs/context-map.md` | un conflit dans une région `<!-- ddd-ts-kit:<region> -->` : côté du tronc ; hors région : pour vous |
2199
2218
  | registre | un conflit entre des marqueurs `// ddd-ts-kit:<region>` de n'importe quel fichier | la base sans ce que l'un ou l'autre côté a retiré, plus ce que chacun a ajouté, le nôtre d'abord, une fois chacun ; dans `imports`, les noms importés d'un même module joints en une instruction |
2200
- | tranches | `docs/architecture/slices.md` | ligne par ligne par `#` : le statut le plus avancé (done, in progress, todo), chaque autre cellule du côté qui l'a changée ; une cellule changée autrement par les deux : pour vous |
2219
+ | tranches | `docs/architecture/slices.md` | ligne par ligne par `#` : le statut le plus avancé (done, in progress, todo), chaque autre cellule du côté qui l'a changée ; une cellule changée autrement par les deux : pour vous. Quand la base n'est pas l'endroit où la branche a quitté le tronc et porte un autre `slices.md`, les lignes sont fusionnées à partir de cette séparation, en conflit ou non : la base peut porter une ligne que le tronc n'a jamais prise |
2201
2220
  | méta de drizzle | `<out>/meta/_journal.json`, *snapshots* | côté du tronc, puis le *replay* |
2202
2221
  | verrouillage | `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock` | côté du tronc ; `<manager> install` quand la branche a changé `package.json` depuis la base |
2203
2222
  | événements stockés | `stored-events.lock.json` | chaque version des deux côtés ; une enregistrée sous deux formes : pour vous |
@@ -2714,7 +2733,7 @@ restreint les règles ; la *baseline* du projet s'applique comme pour un fichier
2714
2733
  ## lint
2715
2734
 
2716
2735
  ```
2717
- ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
2736
+ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache] [--ignore-pattern <pattern>]...
2718
2737
  ```
2719
2738
 
2720
2739
  Ce que lancent `lint` et `ci:lint` d'un projet généré : l'ESLint du projet, par son API, sur les
package/README.md CHANGED
@@ -71,7 +71,7 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
71
71
  [--authn jwt|keycloak|passport|none] [--authz rbac|abac|rebac|custom]
72
72
  [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis]
73
73
  [--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
74
- [--event-sourcing on|off] [--privacy on|off]
74
+ [--search none|opensearch] [--event-sourcing on|off] [--privacy on|off]
75
75
  [--errors none|sentry] [--logger stdout|pino|winston]
76
76
  [--style declared|explicit] [--assembly barrel|discovery]
77
77
  [--dependencies signature|listed] [--refusals named|factories|classes]
@@ -614,13 +614,14 @@ config, `docsUi`, `ci` and `logger` included.
614
614
  | `--errors sentry` | unexpected failures reported to Sentry or GlitchTip (one protocol, only the DSN differs) through the kernel `ErrorReporter`, bound to `@ddd-ts-kit/sentry`. `src/platform/observability/errors.ts` (`initSentry` on the validated configuration, then `reportProcessFailures`), the second import of `main.ts`, of `apps/<context>/main.ts` and of `apps/worker/main.ts`, right after `tracing.ts`; `errors` handed to `composeApplication`, which gives it to the kernel module on tsyringe (`errorReporter`, flushed by `container.stop()` before the logger, `errorReportingMiddleware` first on both buses, the default scheduler observing with `reportFailedRuns`) or to `createPlatform` by hand (the same middleware, `onRun: reportFailedRuns(errors)`, `platform.errors`, flushed two seconds at most when the application stops); `reportHttpErrors` in `auth/authentication/http-boundary.ts` for every request answered 5xx; `DeadLetterReports` on the `onFailure` hook of a provided broker (`createEventProvider(config, errors)`, with `observing` around each consumer) and of the outbox relay. `SENTRY_DSN`, `SENTRY_ENVIRONMENT` (default: `NODE_ENV`), `SENTRY_RELEASE` and `SENTRY_SCRUB_MESSAGES` validated in `config/load-config.ts` as `errorReporting`: without a DSN the application starts and reports nothing; a DSN that is not a URL refuses the start. Dependencies `@ddd-ts-kit/sentry` and `@sentry/node`. A compose profile `errors` running GlitchTip 6.2.6 with its own PostgreSQL and Valkey (`GLITCHTIP_PORT`, loopback only, development bootstrap), and a section of the generated README saying how to read its DSN. The tools and the tests compose the application without a reporter. It goes with every other choice of the stack; with `--errors none` nothing of this is written |
615
615
  | `--authn keycloak` | a compose service `keycloak` (Keycloak 26.8.0, `start-dev --import-realm`, profile `identity`) and `docker/keycloak/<project>-realm.json`: the API client, a public client `<project>-local` with the direct grant, its audience and `tenant_id` mappers, the realm role `admin`, and the demo users `demo-admin` and `demo-user`, for local development only |
616
616
  | `--storage local\|s3` | recorded as `stack.storage`: where the content of files lives, never in the database. `src/platform/config/read-files.ts` and `src/platform/files/open-files.ts`, one per choice: `local`, a directory in development (`FILES_DIRECTORY`, `.data/files`) and the signed links answered by the application under `/files` (`FILES_PUBLIC_URL` and `FILES_SIGNING_SECRET` required in production); `s3`, a bucket of any provider of the S3 protocol through `@ddd-ts-kit/s3` (the `S3_*` variables, MinIO in the compose stack); the memory of the process in the tests and the tools, either way. With `--di tsyringe`: `files/bind-files.ts`, `files/files.module.ts` and `files/staging-uploads.ts`; with hand wiring `files/create-files.ts`; with an HTTP stack `files/file-routes.ts`. They bind `FileStorage`, `FileKeys`, `FileScanner` and `FileStaging`, register the hourly purge of staged files and stage the file a command carries before its transaction; `generate file-upload` needs them. `--storage none` writes none of this ([File storage](../../docs/concepts/file-storage.md)) |
617
+ | `--search opensearch\|none` | recorded as `stack.search`, `none` by default: where the read models a context keeps for search live. `opensearch`: `@ddd-ts-kit/opensearch`, `src/platform/search/search-indexes.ts` (`SearchIndexes`, the abstract class the adapter of a read model port takes: `super(search.options('billing_invoices', criteria))`) and `search/open-search.ts` (`fetchTransport` on `OPENSEARCH_URL`, the user of `OPENSEARCH_USERNAME` and `OPENSEARCH_PASSWORD` both or neither, the tenancy `attribute` under `--tenancy shared-table`, `none` otherwise), bound by `search/search.module.ts` on a container of the kit, `platform.search` wired by hand and under Nest; the index of each store built from it provisioned before a request, under shared tables for the tenant of the work once the tenant directory of the platform lists it (an unlisted tenant creates no index), best effort at the start, which never fails on search, nothing called without a store; the privacy scripts given the node; a compose service `opensearch` (one node, security plugin off). No generator writes a store, and the pipeline starts no node; a context builds its stores from `SearchIndexes` only (`search/store-from-platform`). [Search read models](../../docs/tools/search-read-models.md) |
617
618
  | `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, and for `--broker` `create-event-provider.ts`: `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, with `aggregate-key-of.ts` for per-aggregate order), `NatsEventBus` (`NATS_URL`) or `RedisStreamsEventBus` of `@ddd-ts-kit/redis/event-bus` (`REDIS_URL`: Redis, Dragonfly or Valkey), each with one subscriber per consuming context (`forConsumer`), `assertTopology` at start, its address validated and a compose service with a healthcheck; or `custom-event-bus.ts` with its `eventBusContract` spec. `start-outbox-relay.ts` with the outbox. `--broker redis` with `--cache redis` is one server and one compose service, `cache`; alone, the service is `streams` |
618
619
  | `src/platform/database/` | `persistence.ts` (`interface Persistence`: unit of work, outbox and processed-event stores of the ORM package, the storage handle), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, the connection (`connect-to-database.ts`, `create-client.ts` or `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, the schema of what the kit stores for the application), `open-test-database.ts` (PostgreSQL in process, or the server named by a URL; with Vitest each spec opens a copy of the cluster `test/support/test-database-template.ts`, the global setup of the run, initialised once, and creates its tables there; with drizzle from `table-statements.ts`, the SQL of the tables of `schema.ts`, since drizzle-kit writes migrations, not tables, its unique indexes included), `persistence.contract.spec.ts` (the outbox, processed-event, job and process stores as the platform wires them, held to the contracts of `@ddd-ts-kit/testing` with what the stack turns on: the tenant under `--tenancy`, the unit of work). The storage class a repository adapter names in its dependency list: `database.ts` with drizzle and prisma (`abstract class Database extends` the context type of the ORM package), `KnexContext` of `@ddd-ts-kit/knex`, `TypeOrmContext` of `@ddd-ts-kit/typeorm` |
619
620
  | migration tooling | `drizzle.config.ts`, `knexfile.js` and the folder `migrations/`, `prisma/schema/schema.prisma` (the client, the datasource and the tables of the platform; `generate repository` adds the file of each context, `prisma/schema/<context>.prisma`) and `prisma.config.ts`, or `data-source.ts`. A project that keeps the one `prisma/schema.prisma` of versions before 0.95 keeps it with its `prisma.config.ts` and its `db:client`, even under `--force`: `init` writes nothing under `prisma/schema/`, its notes give the steps of the move with the contexts of the project named, and `generate repository` refuses until the move |
620
621
  | `scripts/openapi.ts`, `scripts/events.ts` | write `openapi/openapi.yaml` (one file per document of `openapi.documents`), `docs/integration/asyncapi.yaml` and `docs/integration/event-catalog.md`, in JSON under `openapi.format: json`; `--check` fails on a difference |
621
622
  | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | with `--privacy on`, the two requests of a data subject, answered from the command line on the sources with the variables of `.env` (`npm run privacy:erase -- <subject-id> [--operator <who-asks>] [--rerun]`, `npm run privacy:export -- <subject-id> > export.json`): the erasure destroys the key of the subject first when the project has an event store (`--event-sourcing on`: its stored events read as erased; audited with `--audit on`), then erases every copy listed in `src/platform/privacy/data-subject-copies.ts`, each leaving its entry with `--audit on`, and what the outbox and the job store keep of the person; an id that reached nothing is refused, exit code 1, and announced to nobody, unless `--rerun` says this person was erased before; `privacy:purge` runs by hand what the job `privacy.purge-expired` runs every night at 03:00 UTC, the purge of what outlived its retention (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` switches the job off); the export gathers every record listed in `data-subject-exports.ts` into one dated JSON document (`format`, `subject`, `exportedAt`, `records`), the export of each context audited with `--audit on`, never the values (every run leaves its entry, a trial included: try it on a test subject). With `--tenancy shared-table`, `TENANTS` names the tenants, comma separated: a write of tenant data is never widened. Neither reaches backups, logs, a copy no context declared, a message already delivered or a job that names no `subject` |
622
623
  | `docker-compose.yml`, `.env.example`, `Dockerfile`, `.dockerignore` | the database with a healthcheck and a named volume, `jaegertracing/jaeger:2.22.0` behind the `observability` profile, every port published on 127.0.0.1 only (a wider address is written in the entry on purpose, the README of the project says how), ports from `.env`; a multi-stage, non-root image with production dependencies only |
623
- | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (the whole application on a free port, on an in-process database unless `DATABASE_URL` is set, no job run by time; `settled()` resolves once the outbox has relayed what the requests stored; `publish(events)` hands integration events of an upstream to its handlers, as the relay of that upstream would), `create-credentials.ts`, `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)`: a trace without the calls an adapter makes on itself, the form `expectSpanTree` asserts) |
624
+ | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (the whole application on a free port, on an in-process database unless `DATABASE_URL` is set, no job run by time; `settled()` resolves once the outbox has relayed what the requests stored; `publish(events)` hands integration events of an upstream to its handlers, as the relay of that upstream would), `create-credentials.ts` (who a test calls as, `application.as({ id, roles })`; under RBAC and ABAC the roles are those of `Role` in `src/platform/auth/authorization/role.ts`, so `roles: [Role.Admin]` is completed by the editor and a misspelled role does not compile), `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)`: a trace without the calls an adapter makes on itself, the form `expectSpanTree` asserts) |
624
625
  | `docs/context-map.md`, `docs/integration/README.md` | see `docs` |
625
626
  | `test/architecture/extractable.spec.ts` | written with the first context: boots each context alone on the kernel and the platform, its jobs included |
626
627
  | `eslint.config.mjs` | the `dddTsKit` preset of `@ddd-ts-kit/eslint-plugin`, typed linting on the project's tsconfig |
@@ -784,9 +785,9 @@ Next, in this order: the language of the context first, then the business decisi
784
785
  | Kind | Arguments | Writes |
785
786
  |---|---|---|
786
787
  | `context` | `<name> --classification <c> [--purpose "<two sentences>"] [--term ...]... [--upstream <ctx>[:relationship]]... [--preset identity] [--reason "<why>"]` | `CONTEXT.md` with its glossary, `published-language/index.ts`, config entry, registration in `platform/composition/compose-application.ts` and in `test/architecture/extractable.spec.ts`; on tsyringe, with HTTP, `presentation/http/<name>.routes.ts` (a function of the two buses, in both styles); declared: the barrel `<name>.declarations.ts`; explicit and hand wiring: `<name>.module.ts`. `<name>.permissions.ts`, at the root of the context, is born with the first permission, or at once when `platform/auth/authorization/permissions.ts` lists the permission sets (rebac, custom). With `--preset`, the context is then written whole from that preset, its classification and purpose those of the preset unless the flags say otherwise ([Presets](#presets)) |
787
- | `module` | `<context> <module> [--purpose "<what it holds>"] [--classification <c>] [--term ...]...` | a module of the model of a context (Evans, Modules): declared in `contexts.<name>.modules` of the config, its row in the `## Modules` table of `CONTEXT.md`, its terms added to the glossary and, in the explicit style, its module file `<module>/<module>.module.ts` composed by `<context>.module.ts`; run again, it adds what is missing. The other kinds write into it with `--module <module>`, `move-to-module` moves files into it |
788
+ | `module` | `<context> <module> [--purpose "<what it holds>"] [--classification <c>] [--term ...]...` | a module of the model of a context (Evans, Modules): declared in `contexts.<name>.modules` of the config, its row in the `## Modules` table of `CONTEXT.md`, its terms added to the glossary and, in the explicit style, its module file `<module>/<module>.module.ts` composed by `<context>.module.ts`; run again, it adds what is missing. The other kinds write into it with `--module <module>`, a spec, a fake and a builder in `<module>/test/`, and write what belongs to no module (the schema, the route groups, the guards, the shared shapes, the worlds) in `shared/`; `move-to-module` moves files into it, and `context-layout` lays out a context that held its tests at its own level |
788
789
  | `aggregate` | `<context> <Name> [--birth "<Fact>"] [--event-sourced] [--module <module>]` | aggregate, builder, spec in given / when / then. `--birth` names the fact it is born with in business words (`"Invoice Issued"`, `InvoiceIssued` or `Issued`), judged by the glossary and refused when it does not read as something that happened: it writes that domain event as `generate domain-event` does, `create` records it at the instant it is given, the builder takes that instant named after the fact (`issuedAt(instant)`) and the spec proves the birth; without it, the state holds no instant of its own (the audit columns of the row date its creation) and a `TODO(domain)` in `create` says how to record the birth later without rewriting the aggregate (`generate domain-event`, the `record` line, then `generate builder`); with `--event-sourced`, an aggregate on `EventSourcedAggregate` whose state is the replay of its events, born with its `Created` domain event (or the fact `--birth` names), its state holding the instant of that fact (`createdAt`), the codec of its stored events in `infrastructure/persistence/<name>-events.mapper.ts`, a builder that replays a history and a spec given events, and a note naming the `EventSourcedRepository` its repository adapter delegates to; refused while `stack.eventSourcing` is `off`, with the `init --force --event-sourcing on` to run |
789
- | `builder` | `<context> <Aggregate>` | `test/builders/<name>.builder.ts`, a class extending `Builder`; the instant of the birth `create` records is an ingredient named after its fact, the builder of an event-sourced aggregate replays its birth event, and a note names the parameters of `create` it cannot guess; when `create` is missing or records an event not named `<Aggregate><Fact>`, no builder is written and a note says why |
790
+ | `builder` | `<context> <Aggregate> [--module <module>]` | `test/builders/<name>.builder.ts`, a class extending `Builder`; the instant of the birth `create` records is an ingredient named after its fact, the builder of an event-sourced aggregate replays its birth event, and a note names the parameters of `create` it cannot guess; when `create` is missing or records an event not named `<Aggregate><Fact>`, no builder is written and a note says why |
790
791
  | `test-world` | `<context> [Name]` | `test/worlds/<name>.world.ts` (the name defaults to the context): `a<Name>World({ now, idPrefix, given })`, the arrangement several specs of the context share. It reads the fakes of `test/fakes/` and the port each one implements, builds them, hands them to `given` so that the spec stores what it starts from, then to the test application (with `modules`, the authorization of the spec) or, wired by hand, wraps the repositories of the buses of `createTestBuses` with `dispatching`; it returns every fake under the name of its port. A fake that needs constructor arguments, or, under a container, stands for a port nothing binds or depends on yet, is left out with a note. Under a container it also takes `fakes`, the fake of a port it cannot build (a reader that answers what the spec gives it), and, under tenancy, `tenants`. The world named after the context is the one the specs of `command`, `query` and `job` generated after it arrange through |
791
792
  | `entity` | `<context> <Name> [--module <module>]` | entity, spec |
792
793
  | `value-object` (`vo`) | `<context> <Name> [--module <module>]` | value object, spec |
@@ -1812,7 +1813,9 @@ guard of the plugin keeps the runs of the `context-builder` agent in `.ddd-ts-ki
1812
1813
 
1813
1814
  `--resume` reads where the stopped worker of the context stands, from the trunk, and creates and
1814
1815
  rewrites nothing: its rows (committed by their `Slice:` trailer, or in order with the
1815
- `feat(<context>)` commits for an older commit, shown `(by order)`), the files of the row under
1816
+ `feat(<context>)` commits for an older commit, shown `(by order)`; on a branch kept for its next
1817
+ rows, the commits made before it brought in the base `worker-scope` recorded belong to the rows
1818
+ that landed and are not read), the files of the row under
1816
1819
  way, the markers left in the context, its last verification and what changed since, whether its
1817
1820
  report is current, and its agent. Then the next step: `SendMessage` to that agent, with the
1818
1821
  message to send as it is, when it stopped mid-row after progress in a run that is not its third;
@@ -1975,7 +1978,9 @@ its whitespace collapsed, lines of punctuation only and conflict markers a side
1975
1978
  out, and each import of named bindings split into one entry per binding: the result must hold it
1976
1979
  as many times as the base, plus what either side added, minus what either removed. The files are
1977
1980
  counted together, so a line moved to another file is not lost; a line laid out again on several
1978
- lines is not either. The derived files, the files whose first lines say a tool wrote them
1981
+ lines is not either. A line is expected no more often than its files expect one by one: the same
1982
+ line each side removed from a different file (a generated marker filled in one file by the
1983
+ branch, in another by the trunk) is not a loss. The titles of the tests are counted the same way. The derived files, the files whose first lines say a tool wrote them
1979
1984
  (`@generated`, `autogenerated`, `DO NOT EDIT`), the migrations, the lockfiles (npm, pnpm, yarn,
1980
1985
  bun, uv, poetry, Pipfile, Cargo, Bundler, Composer, Go, NuGet) and `docs/architecture/slices.md`
1981
1986
  are left out of the lines.
@@ -1984,6 +1989,7 @@ are left out of the lines.
1984
1989
  |---|---|
1985
1990
  | a line one side added, or both kept, missing from the result | error |
1986
1991
  | a file neither side deleted, gone from the result with lines no other file has (one finding per file) | error |
1992
+ | a file one side added since the two sides parted (`git merge-base`), gone from the result while no commit of the other side touched its path; not reported when the result holds it under another path | error |
1987
1993
  | a row of `slices.md` done on one side and not done in the result, or a row of one side gone | error |
1988
1994
  | the title of an `it(` or a `test(` of one side gone, a spec file of one side deleted | error |
1989
1995
  | a migration of one side whose description (its name without number and `working-`) no migration of the result has | error |
@@ -1996,7 +2002,11 @@ A line inserted between base lines the other side left alone stays an error even
1996
2002
  side inserted at the same place: dropping one of two new methods is the loss the check exists
1997
2003
  for. So does a rewrite that lost more lines than the base lines or the other side's rewrite it
1998
2004
  competed with (an edit with a new method under it). What one side deleted, or reopened, is never
1999
- reported. Nor is a line of the branch in a file the branch did not touch since its fork from the trunk
2005
+ reported. For the side brought in, a row of `slices.md` is read where the sides parted too: a base
2006
+ found on the branch after a squash may hold a row, or a `done`, the trunk never took, and a row
2007
+ the trunk never held is not a row the trunk deleted or reopened. The added file above is read
2008
+ from there as well, so a base named too new (`--since`, `--base`, a `Merge-Base:` trailer) does
2009
+ not hide it. Nor is a line of the branch in a file the branch did not touch since its fork from the trunk
2000
2010
  (the file is the same on the branch and at `git merge-base`): what the trunk removed or replaced
2001
2011
  there since is the trunk's change, whatever base the merge is computed from. A removal decided on purpose is recorded in the merge commit as a trailer
2002
2012
  `Lost-Accepted: <file:line>,...` (a file alone accepts all of its lines): those findings are
@@ -2024,23 +2034,27 @@ ddd-ts-kit merge-trunk --continue [--accept-lost] | --abort
2024
2034
  ```
2025
2035
 
2026
2036
  Brings the trunk into the branch as one merge commit computed from the branch's own diff. Never
2027
- rebases, never fetches (the commit `--trunk` names is printed; by default `origin/HEAD`, then
2028
- `origin/main`). Refused, exit 2: a working tree that is not clean (`.ddd-ts-kit/` aside), a merge,
2037
+ rebases, never fetches (the commit `--trunk` names is printed; by default the `base` of
2038
+ `.ddd-ts-kit/worker.json` in the worktree of a worker, the ref its branch was cut from, then
2039
+ `origin/HEAD`, then `origin/main`; a worker stacked on the branch of another names the trunk
2040
+ itself, `--trunk origin/main`, once that branch landed). Refused, exit 2: a working tree that is not clean (`.ddd-ts-kit/` aside), a merge,
2029
2041
  rebase, cherry-pick or revert in progress, a repository where git knows no committer (the merge
2030
2042
  ends with a commit), an unknown trunk.
2031
2043
 
2032
2044
  1. **The base**: the newest commit of the branch the trunk already holds. `--since <commit>` (a
2033
- commit of the branch); else the landed point: the newest commit whose whole change since the
2045
+ commit of the branch, refused when it is its head: the result would be the trunk alone); else the landed point: the newest commit whose whole change since the
2034
2046
  trunk is one commit of the trunk, compared by stable patch id without context lines, the
2035
2047
  derived files, migrations, `slices.md`, `plan.md` and lockfiles left out, looked for on this
2036
2048
  branch, on the branch `.ddd-ts-kit/worker.json` records as its base, and on the local branches
2037
2049
  sharing commits with it (a stacked branch whose parent was squash-merged, a branch reused after
2038
2050
  its first row landed); of commits sharing one patch the oldest is taken, a newer one only when
2039
- the trunk holds what it changed; else the `baseCommit` worker-scope recorded, when it is a
2051
+ the trunk holds what it changed (across a merge of the trunk the branch made, what that merge
2052
+ changed of its own: the files it brought are the trunk's); else the `baseCommit` worker-scope recorded, when it is a
2040
2053
  commit of the branch and its own lines are all on the trunk (otherwise it stops, nothing
2041
2054
  changed, and lists them for a person to confirm with `--since`); else `git merge-base`, and
2042
2055
  the report names each branch sharing commits not found on the trunk, with its `--since`. Too
2043
- old shows as more conflicts, never as a silent loss.
2056
+ old shows as more conflicts, never as a silent loss; too new, which only `--since` can name,
2057
+ drops what the branch added before it, and `verify-merge` stops on each file gone that way.
2044
2058
  2. **The preview**: `git merge-tree --write-tree --merge-base=<base> HEAD <trunk>`, diff3 markers;
2045
2059
  the same without the base gives what a plain `git merge` would conflict on. `--dry-run` stops
2046
2060
  here and changes nothing.
@@ -2056,7 +2070,7 @@ ends with a commit), an unknown trunk.
2056
2070
  | derived | `openapi/`, `clients/`, `docs/integration/`, `docs/behaviour/`, `.dependency-cruiser.cjs`, the barrels and lists of each context | trunk side, rewritten by `regenerate` |
2057
2071
  | mixed document | `CONTEXT.md`, `docs/context-map.md` | a conflict inside a `<!-- ddd-ts-kit:<region> -->` region: trunk side; outside: for you |
2058
2072
  | registry | a conflict inside `// ddd-ts-kit:<region>` markers of any file | the base without what either side removed, plus what each added, ours first, once each; names imported from one module joined in one statement in `imports` |
2059
- | slices | `docs/architecture/slices.md` | row by row by `#`: the furthest status (done, in progress, todo), each other cell from the side that changed it; a cell both changed differently: for you |
2073
+ | slices | `docs/architecture/slices.md` | row by row by `#`: the furthest status (done, in progress, todo), each other cell from the side that changed it; a cell both changed differently: for you. When the base is not where the branch left the trunk and holds another `slices.md`, the rows are merged from that fork, conflicted or not: the base may hold a row the trunk never took |
2060
2074
  | drizzle meta | `<out>/meta/_journal.json`, snapshots | trunk side, then the replay |
2061
2075
  | lockfile | `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock` | trunk side; `<manager> install` when the branch changed `package.json` since the base |
2062
2076
  | stored events | `stored-events.lock.json` | every version of both sides; one recorded with two shapes: for you |
@@ -2535,7 +2549,7 @@ applies as for a file on disk.
2535
2549
  ## lint
2536
2550
 
2537
2551
  ```
2538
- ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
2552
+ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache] [--ignore-pattern <pattern>]...
2539
2553
  ```
2540
2554
 
2541
2555
  What `lint` and `ci:lint` of a generated project run: the ESLint of the project, through its API,
@@ -1 +1 @@
1
- {"version":3,"file":"reach-of.d.ts","sourceRoot":"","sources":["../../src/affected/reach-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAM9C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAY/D"}
1
+ {"version":3,"file":"reach-of.d.ts","sourceRoot":"","sources":["../../src/affected/reach-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAM9C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAY/D"}
@@ -1,3 +1,4 @@
1
+ import { declaredModules, foldersOfContext, TEST_FOLDER } from '../model-modules/index.js';
1
2
  import { ownEntry } from '../config/values/own-entry.js';
2
3
  /** Written for people and agents, never loaded by a spec, a build or a tool of the pipeline other than the documents gate, which always runs. */
3
4
  const DOCUMENT_DIRECTORIES = ['docs/', 'openapi/', '.claude/', '.github/instructions/', '.github/copilot/'];
@@ -22,7 +23,9 @@ function contextReach(config, inside) {
22
23
  if (rest.length === 0 || ownEntry(config.contexts, context) === undefined) {
23
24
  return { kind: 'everything', reason: `${config.contextsDir}/${inside} belongs to no declared context` };
24
25
  }
25
- return { kind: 'context', context, testsOnly: rest[0] === 'test' };
26
+ // The tests of the context, of a module of its model or of its shared folder.
27
+ const held = foldersOfContext(declaredModules(config, context)).includes(rest[0] ?? '') ? rest[1] : rest[0];
28
+ return { kind: 'context', context, testsOnly: held === TEST_FOLDER };
26
29
  }
27
30
  function isDocument(file) {
28
31
  const atRoot = !file.includes('/');