ddd-ts-kit 0.111.0 → 0.112.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 (444) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/README.fr.md +35 -6
  3. package/README.md +32 -5
  4. package/dist/alias/index.d.ts +2 -0
  5. package/dist/alias/index.d.ts.map +1 -1
  6. package/dist/alias/index.js +2 -0
  7. package/dist/alias/index.js.map +1 -1
  8. package/dist/alias/neighbour-sources.d.ts +17 -0
  9. package/dist/alias/neighbour-sources.d.ts.map +1 -0
  10. package/dist/alias/neighbour-sources.js +11 -0
  11. package/dist/alias/neighbour-sources.js.map +1 -0
  12. package/dist/alias/neighbour-suffix.d.ts +8 -0
  13. package/dist/alias/neighbour-suffix.d.ts.map +1 -0
  14. package/dist/alias/neighbour-suffix.js +10 -0
  15. package/dist/alias/neighbour-suffix.js.map +1 -0
  16. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  17. package/dist/build/rewrite-aliases.js +11 -0
  18. package/dist/build/rewrite-aliases.js.map +1 -1
  19. package/dist/check/alias/build-scripts.d.ts.map +1 -1
  20. package/dist/check/alias/build-scripts.js +4 -8
  21. package/dist/check/alias/build-scripts.js.map +1 -1
  22. package/dist/check/alias/compiler-options-of.d.ts +3 -3
  23. package/dist/check/alias/compiler-options-of.js +17 -6
  24. package/dist/check/alias/compiler-options-of.js.map +1 -1
  25. package/dist/check/alias/neighbour-sources.d.ts +12 -0
  26. package/dist/check/alias/neighbour-sources.d.ts.map +1 -0
  27. package/dist/check/alias/neighbour-sources.js +80 -0
  28. package/dist/check/alias/neighbour-sources.js.map +1 -0
  29. package/dist/check/alias/script-steps.d.ts +11 -0
  30. package/dist/check/alias/script-steps.d.ts.map +1 -0
  31. package/dist/check/alias/script-steps.js +22 -0
  32. package/dist/check/alias/script-steps.js.map +1 -0
  33. package/dist/check/aspects/adapter-policies.d.ts +10 -0
  34. package/dist/check/aspects/adapter-policies.d.ts.map +1 -0
  35. package/dist/check/aspects/adapter-policies.js +104 -0
  36. package/dist/check/aspects/adapter-policies.js.map +1 -0
  37. package/dist/check/aspects/adapter-policy.d.ts +18 -0
  38. package/dist/check/aspects/adapter-policy.d.ts.map +1 -0
  39. package/dist/check/aspects/adapter-policy.js +2 -0
  40. package/dist/check/aspects/adapter-policy.js.map +1 -0
  41. package/dist/check/aspects/is-under-condition.d.ts +7 -0
  42. package/dist/check/aspects/is-under-condition.d.ts.map +1 -0
  43. package/dist/check/aspects/is-under-condition.js +50 -0
  44. package/dist/check/aspects/is-under-condition.js.map +1 -0
  45. package/dist/check/aspects/stated-policy.d.ts +18 -0
  46. package/dist/check/aspects/stated-policy.d.ts.map +1 -0
  47. package/dist/check/aspects/stated-policy.js +39 -0
  48. package/dist/check/aspects/stated-policy.js.map +1 -0
  49. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  50. package/dist/check/catalogue/architecture-rules.js +4 -0
  51. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  52. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  53. package/dist/check/explain/imports-docs.js +5 -3
  54. package/dist/check/explain/imports-docs.js.map +1 -1
  55. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  56. package/dist/check/explain/persistence-docs.js +21 -0
  57. package/dist/check/explain/persistence-docs.js.map +1 -1
  58. package/dist/check/explain/standard-docs.d.ts.map +1 -1
  59. package/dist/check/explain/standard-docs.js +16 -0
  60. package/dist/check/explain/standard-docs.js.map +1 -1
  61. package/dist/check/files/kit-content-types.d.ts +12 -0
  62. package/dist/check/files/kit-content-types.d.ts.map +1 -0
  63. package/dist/check/files/kit-content-types.js +38 -0
  64. package/dist/check/files/kit-content-types.js.map +1 -0
  65. package/dist/check/files/upload-content-defect.d.ts +7 -0
  66. package/dist/check/files/upload-content-defect.d.ts.map +1 -0
  67. package/dist/check/files/upload-content-defect.js +2 -0
  68. package/dist/check/files/upload-content-defect.js.map +1 -0
  69. package/dist/check/files/upload-content-defects.d.ts +9 -0
  70. package/dist/check/files/upload-content-defects.d.ts.map +1 -0
  71. package/dist/check/files/upload-content-defects.js +54 -0
  72. package/dist/check/files/upload-content-defects.js.map +1 -0
  73. package/dist/check/files/upload-declaration.d.ts +7 -0
  74. package/dist/check/files/upload-declaration.d.ts.map +1 -0
  75. package/dist/check/files/upload-declaration.js +2 -0
  76. package/dist/check/files/upload-declaration.js.map +1 -0
  77. package/dist/check/files/upload-declarations.d.ts +9 -0
  78. package/dist/check/files/upload-declarations.d.ts.map +1 -0
  79. package/dist/check/files/upload-declarations.js +41 -0
  80. package/dist/check/files/upload-declarations.js.map +1 -0
  81. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  82. package/dist/check/fixtures/alias-declared-fixtures.js +95 -1
  83. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  84. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  85. package/dist/check/fixtures/fixtures.js +2 -0
  86. package/dist/check/fixtures/fixtures.js.map +1 -1
  87. package/dist/check/fixtures/imports-fixtures.d.ts.map +1 -1
  88. package/dist/check/fixtures/imports-fixtures.js +97 -0
  89. package/dist/check/fixtures/imports-fixtures.js.map +1 -1
  90. package/dist/check/fixtures/standard-fixtures.d.ts.map +1 -1
  91. package/dist/check/fixtures/standard-fixtures.js +42 -0
  92. package/dist/check/fixtures/standard-fixtures.js.map +1 -1
  93. package/dist/check/fixtures/upload-fixtures.d.ts +3 -0
  94. package/dist/check/fixtures/upload-fixtures.d.ts.map +1 -0
  95. package/dist/check/fixtures/upload-fixtures.js +94 -0
  96. package/dist/check/fixtures/upload-fixtures.js.map +1 -0
  97. package/dist/check/migrations/is-working-migration.d.ts +6 -0
  98. package/dist/check/migrations/is-working-migration.d.ts.map +1 -0
  99. package/dist/check/migrations/is-working-migration.js +8 -0
  100. package/dist/check/migrations/is-working-migration.js.map +1 -0
  101. package/dist/check/migrations/journal-entries.d.ts +4 -0
  102. package/dist/check/migrations/journal-entries.d.ts.map +1 -0
  103. package/dist/check/migrations/journal-entries.js +21 -0
  104. package/dist/check/migrations/journal-entries.js.map +1 -0
  105. package/dist/check/migrations/read-drizzle-migrations.d.ts.map +1 -1
  106. package/dist/check/migrations/read-drizzle-migrations.js +4 -9
  107. package/dist/check/migrations/read-drizzle-migrations.js.map +1 -1
  108. package/dist/check/modules/imported-modules.d.ts +4 -0
  109. package/dist/check/modules/imported-modules.d.ts.map +1 -0
  110. package/dist/check/modules/imported-modules.js +5 -0
  111. package/dist/check/modules/imported-modules.js.map +1 -0
  112. package/dist/check/modules/module-imports.d.ts +17 -0
  113. package/dist/check/modules/module-imports.d.ts.map +1 -0
  114. package/dist/check/modules/module-imports.js +23 -0
  115. package/dist/check/modules/module-imports.js.map +1 -0
  116. package/dist/check/project/assemble-project.d.ts.map +1 -1
  117. package/dist/check/project/assemble-project.js +1 -8
  118. package/dist/check/project/assemble-project.js.map +1 -1
  119. package/dist/check/project/file-severity.d.ts +4 -0
  120. package/dist/check/project/file-severity.d.ts.map +1 -0
  121. package/dist/check/project/file-severity.js +11 -0
  122. package/dist/check/project/file-severity.js.map +1 -0
  123. package/dist/check/project/load-project.js +1 -10
  124. package/dist/check/project/load-project.js.map +1 -1
  125. package/dist/check/project/not-in-the-tree.d.ts +10 -0
  126. package/dist/check/project/not-in-the-tree.d.ts.map +1 -0
  127. package/dist/check/project/not-in-the-tree.js +17 -0
  128. package/dist/check/project/not-in-the-tree.js.map +1 -0
  129. package/dist/check/project/skipped-directories.d.ts +3 -0
  130. package/dist/check/project/skipped-directories.d.ts.map +1 -0
  131. package/dist/check/project/skipped-directories.js +3 -0
  132. package/dist/check/project/skipped-directories.js.map +1 -0
  133. package/dist/check/project/walk-directory.d.ts.map +1 -1
  134. package/dist/check/project/walk-directory.js +1 -1
  135. package/dist/check/project/walk-directory.js.map +1 -1
  136. package/dist/check/rules/aspects-timeout-covers-delegate.d.ts +3 -0
  137. package/dist/check/rules/aspects-timeout-covers-delegate.d.ts.map +1 -0
  138. package/dist/check/rules/aspects-timeout-covers-delegate.js +179 -0
  139. package/dist/check/rules/aspects-timeout-covers-delegate.js.map +1 -0
  140. package/dist/check/rules/files-upload-content-rule.d.ts +3 -0
  141. package/dist/check/rules/files-upload-content-rule.d.ts.map +1 -0
  142. package/dist/check/rules/files-upload-content-rule.js +25 -0
  143. package/dist/check/rules/files-upload-content-rule.js.map +1 -0
  144. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  145. package/dist/check/rules/imports-alias-declared.js +3 -1
  146. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  147. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  148. package/dist/check/rules/imports-alias-only.js +86 -7
  149. package/dist/check/rules/imports-alias-only.js.map +1 -1
  150. package/dist/check/rules/module-no-cycle.d.ts.map +1 -1
  151. package/dist/check/rules/module-no-cycle.js +12 -34
  152. package/dist/check/rules/module-no-cycle.js.map +1 -1
  153. package/dist/cli-error.d.ts +7 -2
  154. package/dist/cli-error.d.ts.map +1 -1
  155. package/dist/cli-error.js +8 -2
  156. package/dist/cli-error.js.map +1 -1
  157. package/dist/commands/generate.js +1 -0
  158. package/dist/commands/generate.js.map +1 -1
  159. package/dist/commands/knex-generate.d.ts.map +1 -1
  160. package/dist/commands/knex-generate.js +2 -1
  161. package/dist/commands/knex-generate.js.map +1 -1
  162. package/dist/commands/move-to-module.d.ts +6 -1
  163. package/dist/commands/move-to-module.d.ts.map +1 -1
  164. package/dist/commands/move-to-module.js +28 -3
  165. package/dist/commands/move-to-module.js.map +1 -1
  166. package/dist/commands/prisma-generate.d.ts.map +1 -1
  167. package/dist/commands/prisma-generate.js +2 -1
  168. package/dist/commands/prisma-generate.js.map +1 -1
  169. package/dist/commands/typeorm-generate.d.ts.map +1 -1
  170. package/dist/commands/typeorm-generate.js +2 -1
  171. package/dist/commands/typeorm-generate.js.map +1 -1
  172. package/dist/commands/verify-merge.d.ts +4 -2
  173. package/dist/commands/verify-merge.d.ts.map +1 -1
  174. package/dist/commands/verify-merge.js +8 -5
  175. package/dist/commands/verify-merge.js.map +1 -1
  176. package/dist/generate/generate-options.d.ts +3 -0
  177. package/dist/generate/generate-options.d.ts.map +1 -1
  178. package/dist/generate/generate-options.js +1 -0
  179. package/dist/generate/generate-options.js.map +1 -1
  180. package/dist/generate/kind.d.ts +2 -0
  181. package/dist/generate/kind.d.ts.map +1 -1
  182. package/dist/generate/kinds/file-upload/upload-file-vars.d.ts +9 -0
  183. package/dist/generate/kinds/file-upload/upload-file-vars.d.ts.map +1 -0
  184. package/dist/generate/kinds/file-upload/upload-file-vars.js +39 -0
  185. package/dist/generate/kinds/file-upload/upload-file-vars.js.map +1 -0
  186. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -1
  187. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +2 -1
  188. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -1
  189. package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -1
  190. package/dist/generate/kinds/file-upload/write-upload-controller.js +2 -1
  191. package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -1
  192. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  193. package/dist/generate/kinds/file-upload-kind.js +5 -3
  194. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  195. package/dist/generate/kinds/read-model/list-read-model.d.ts +17 -0
  196. package/dist/generate/kinds/read-model/list-read-model.d.ts.map +1 -0
  197. package/dist/generate/kinds/read-model/list-read-model.js +22 -0
  198. package/dist/generate/kinds/read-model/list-read-model.js.map +1 -0
  199. package/dist/generate/kinds/read-model-kind.d.ts.map +1 -1
  200. package/dist/generate/kinds/read-model-kind.js +19 -0
  201. package/dist/generate/kinds/read-model-kind.js.map +1 -1
  202. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  203. package/dist/generate/kinds/service-kind.js +8 -0
  204. package/dist/generate/kinds/service-kind.js.map +1 -1
  205. package/dist/generate/kinds/wire-context.d.ts.map +1 -1
  206. package/dist/generate/kinds/wire-context.js +4 -0
  207. package/dist/generate/kinds/wire-context.js.map +1 -1
  208. package/dist/generate/shared-writes.d.ts.map +1 -1
  209. package/dist/generate/shared-writes.js +3 -2
  210. package/dist/generate/shared-writes.js.map +1 -1
  211. package/dist/help/tool-notes.d.ts.map +1 -1
  212. package/dist/help/tool-notes.js +5 -1
  213. package/dist/help/tool-notes.js.map +1 -1
  214. package/dist/help/usage.js +1 -1
  215. package/dist/help/work-notes.d.ts.map +1 -1
  216. package/dist/help/work-notes.js +9 -2
  217. package/dist/help/work-notes.js.map +1 -1
  218. package/dist/init/files/end-to-end-files.d.ts.map +1 -1
  219. package/dist/init/files/end-to-end-files.js +3 -0
  220. package/dist/init/files/end-to-end-files.js.map +1 -1
  221. package/dist/init/files/persistence-files.d.ts.map +1 -1
  222. package/dist/init/files/persistence-files.js +8 -2
  223. package/dist/init/files/persistence-files.js.map +1 -1
  224. package/dist/init/files/script-files.d.ts +2 -1
  225. package/dist/init/files/script-files.d.ts.map +1 -1
  226. package/dist/init/files/script-files.js +6 -1
  227. package/dist/init/files/script-files.js.map +1 -1
  228. package/dist/init/is-team-file.d.ts +2 -2
  229. package/dist/init/is-team-file.d.ts.map +1 -1
  230. package/dist/init/is-team-file.js +5 -4
  231. package/dist/init/is-team-file.js.map +1 -1
  232. package/dist/init/list-read-models.d.ts +17 -0
  233. package/dist/init/list-read-models.d.ts.map +1 -0
  234. package/dist/init/list-read-models.js +74 -0
  235. package/dist/init/list-read-models.js.map +1 -0
  236. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  237. package/dist/init/manifest/database-scripts.js +8 -0
  238. package/dist/init/manifest/database-scripts.js.map +1 -1
  239. package/dist/init/manifest/versions.js +25 -25
  240. package/dist/init/rewire-contexts.d.ts +4 -2
  241. package/dist/init/rewire-contexts.d.ts.map +1 -1
  242. package/dist/init/rewire-contexts.js +10 -2
  243. package/dist/init/rewire-contexts.js.map +1 -1
  244. package/dist/init/run-init.js +1 -1
  245. package/dist/init/run-init.js.map +1 -1
  246. package/dist/init/wiring-notes.js +1 -1
  247. package/dist/init/wiring-notes.js.map +1 -1
  248. package/dist/init/write-type-script-configs.d.ts +3 -1
  249. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  250. package/dist/init/write-type-script-configs.js +14 -2
  251. package/dist/init/write-type-script-configs.js.map +1 -1
  252. package/dist/merge/format-merge-report.js +5 -2
  253. package/dist/merge/format-merge-report.js.map +1 -1
  254. package/dist/merge/land-drizzle.d.ts +4 -0
  255. package/dist/merge/land-drizzle.d.ts.map +1 -1
  256. package/dist/merge/land-drizzle.js +6 -1
  257. package/dist/merge/land-drizzle.js.map +1 -1
  258. package/dist/merge/land-up-to-date.d.ts +15 -0
  259. package/dist/merge/land-up-to-date.d.ts.map +1 -0
  260. package/dist/merge/land-up-to-date.js +76 -0
  261. package/dist/merge/land-up-to-date.js.map +1 -0
  262. package/dist/merge/lost/format-merge-verification.d.ts +2 -1
  263. package/dist/merge/lost/format-merge-verification.d.ts.map +1 -1
  264. package/dist/merge/lost/format-merge-verification.js +13 -2
  265. package/dist/merge/lost/format-merge-verification.js.map +1 -1
  266. package/dist/merge/lost/merge-verification.d.ts +4 -0
  267. package/dist/merge/lost/merge-verification.d.ts.map +1 -1
  268. package/dist/merge/lost/verify-merges.d.ts +2 -1
  269. package/dist/merge/lost/verify-merges.d.ts.map +1 -1
  270. package/dist/merge/lost/verify-merges.js +10 -4
  271. package/dist/merge/lost/verify-merges.js.map +1 -1
  272. package/dist/merge/merge-trunk.d.ts +2 -1
  273. package/dist/merge/merge-trunk.d.ts.map +1 -1
  274. package/dist/merge/merge-trunk.js +5 -2
  275. package/dist/merge/merge-trunk.js.map +1 -1
  276. package/dist/merge/next-steps.d.ts +3 -0
  277. package/dist/merge/next-steps.d.ts.map +1 -1
  278. package/dist/merge/next-steps.js +3 -0
  279. package/dist/merge/next-steps.js.map +1 -1
  280. package/dist/merge/order/applied-under-old-name.d.ts +13 -0
  281. package/dist/merge/order/applied-under-old-name.d.ts.map +1 -0
  282. package/dist/merge/order/applied-under-old-name.js +14 -0
  283. package/dist/merge/order/applied-under-old-name.js.map +1 -0
  284. package/dist/merge/order/comes-after.d.ts +8 -0
  285. package/dist/merge/order/comes-after.d.ts.map +1 -0
  286. package/dist/merge/order/comes-after.js +9 -0
  287. package/dist/merge/order/comes-after.js.map +1 -0
  288. package/dist/merge/order/drizzle-order.d.ts +11 -0
  289. package/dist/merge/order/drizzle-order.d.ts.map +1 -0
  290. package/dist/merge/order/drizzle-order.js +64 -0
  291. package/dist/merge/order/drizzle-order.js.map +1 -0
  292. package/dist/merge/order/in-order.d.ts +4 -0
  293. package/dist/merge/order/in-order.d.ts.map +1 -0
  294. package/dist/merge/order/in-order.js +6 -0
  295. package/dist/merge/order/in-order.js.map +1 -0
  296. package/dist/merge/order/migration-order-finding.d.ts +18 -0
  297. package/dist/merge/order/migration-order-finding.d.ts.map +1 -0
  298. package/dist/merge/order/migration-order-finding.js +2 -0
  299. package/dist/merge/order/migration-order-finding.js.map +1 -0
  300. package/dist/merge/order/migration-order.d.ts +12 -0
  301. package/dist/merge/order/migration-order.d.ts.map +1 -0
  302. package/dist/merge/order/migration-order.js +21 -0
  303. package/dist/merge/order/migration-order.js.map +1 -0
  304. package/dist/merge/order/migrations-of-commit.d.ts +7 -0
  305. package/dist/merge/order/migrations-of-commit.d.ts.map +1 -0
  306. package/dist/merge/order/migrations-of-commit.js +43 -0
  307. package/dist/merge/order/migrations-of-commit.js.map +1 -0
  308. package/dist/merge/order/migrations-of-tree.d.ts +9 -0
  309. package/dist/merge/order/migrations-of-tree.d.ts.map +1 -0
  310. package/dist/merge/order/migrations-of-tree.js +25 -0
  311. package/dist/merge/order/migrations-of-tree.js.map +1 -0
  312. package/dist/merge/order/named-order.d.ts +11 -0
  313. package/dist/merge/order/named-order.d.ts.map +1 -0
  314. package/dist/merge/order/named-order.js +36 -0
  315. package/dist/merge/order/named-order.js.map +1 -0
  316. package/dist/merge/order/ordered-migration.d.ts +12 -0
  317. package/dist/merge/order/ordered-migration.d.ts.map +1 -0
  318. package/dist/merge/order/ordered-migration.js +2 -0
  319. package/dist/merge/order/ordered-migration.js.map +1 -0
  320. package/dist/merge/order/trunk-to-follow.d.ts +9 -0
  321. package/dist/merge/order/trunk-to-follow.d.ts.map +1 -0
  322. package/dist/merge/order/trunk-to-follow.js +2 -0
  323. package/dist/merge/order/trunk-to-follow.js.map +1 -0
  324. package/dist/merge/renumber-migrations.d.ts +14 -5
  325. package/dist/merge/renumber-migrations.d.ts.map +1 -1
  326. package/dist/merge/renumber-migrations.js +141 -60
  327. package/dist/merge/renumber-migrations.js.map +1 -1
  328. package/dist/merge/restamp-class.d.ts +9 -0
  329. package/dist/merge/restamp-class.d.ts.map +1 -0
  330. package/dist/merge/restamp-class.js +30 -0
  331. package/dist/merge/restamp-class.js.map +1 -0
  332. package/dist/migration/index.d.ts +1 -0
  333. package/dist/migration/index.d.ts.map +1 -1
  334. package/dist/migration/index.js +1 -0
  335. package/dist/migration/index.js.map +1 -1
  336. package/dist/migration/plan-replay.d.ts.map +1 -1
  337. package/dist/migration/plan-replay.js +2 -1
  338. package/dist/migration/plan-replay.js.map +1 -1
  339. package/dist/migration/refuse-taken-migration-name.d.ts +8 -0
  340. package/dist/migration/refuse-taken-migration-name.d.ts.map +1 -0
  341. package/dist/migration/refuse-taken-migration-name.js +22 -0
  342. package/dist/migration/refuse-taken-migration-name.js.map +1 -0
  343. package/dist/migration/replay-drizzle-migrations.d.ts +5 -0
  344. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  345. package/dist/migration/replay-drizzle-migrations.js +10 -2
  346. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  347. package/dist/migration/replay-plan.d.ts +2 -2
  348. package/dist/migration/replay-plan.d.ts.map +1 -1
  349. package/dist/migration/restore-migration-folder.d.ts +6 -2
  350. package/dist/migration/restore-migration-folder.d.ts.map +1 -1
  351. package/dist/migration/restore-migration-folder.js +14 -7
  352. package/dist/migration/restore-migration-folder.js.map +1 -1
  353. package/dist/migration/snapshot-migration-folder.d.ts +7 -0
  354. package/dist/migration/snapshot-migration-folder.d.ts.map +1 -0
  355. package/dist/migration/snapshot-migration-folder.js +12 -0
  356. package/dist/migration/snapshot-migration-folder.js.map +1 -0
  357. package/dist/move-to-module/before-the-move.d.ts +5 -0
  358. package/dist/move-to-module/before-the-move.d.ts.map +1 -0
  359. package/dist/move-to-module/before-the-move.js +13 -0
  360. package/dist/move-to-module/before-the-move.js.map +1 -0
  361. package/dist/move-to-module/closed-cycles.d.ts +21 -0
  362. package/dist/move-to-module/closed-cycles.d.ts.map +1 -0
  363. package/dist/move-to-module/closed-cycles.js +66 -0
  364. package/dist/move-to-module/closed-cycles.js.map +1 -0
  365. package/dist/move-to-module/cycle-lines.d.ts +7 -0
  366. package/dist/move-to-module/cycle-lines.d.ts.map +1 -0
  367. package/dist/move-to-module/cycle-lines.js +22 -0
  368. package/dist/move-to-module/cycle-lines.js.map +1 -0
  369. package/dist/move-to-module/cycle-refusal.d.ts +17 -0
  370. package/dist/move-to-module/cycle-refusal.d.ts.map +1 -0
  371. package/dist/move-to-module/cycle-refusal.js +25 -0
  372. package/dist/move-to-module/cycle-refusal.js.map +1 -0
  373. package/dist/move-to-module/index.d.ts +5 -0
  374. package/dist/move-to-module/index.d.ts.map +1 -1
  375. package/dist/move-to-module/index.js +4 -0
  376. package/dist/move-to-module/index.js.map +1 -1
  377. package/dist/move-to-module/module-imports-in.d.ts +11 -0
  378. package/dist/move-to-module/module-imports-in.d.ts.map +1 -0
  379. package/dist/move-to-module/module-imports-in.js +32 -0
  380. package/dist/move-to-module/module-imports-in.js.map +1 -0
  381. package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
  382. package/dist/move-to-module/moves-into-module.js +6 -18
  383. package/dist/move-to-module/moves-into-module.js.map +1 -1
  384. package/dist/move-to-module/place-in-module.d.ts +13 -0
  385. package/dist/move-to-module/place-in-module.d.ts.map +1 -0
  386. package/dist/move-to-module/place-in-module.js +24 -0
  387. package/dist/move-to-module/place-in-module.js.map +1 -0
  388. package/dist/move-to-module/watch-cycles.d.ts +19 -0
  389. package/dist/move-to-module/watch-cycles.d.ts.map +1 -0
  390. package/dist/move-to-module/watch-cycles.js +51 -0
  391. package/dist/move-to-module/watch-cycles.js.map +1 -0
  392. package/dist/run.js +1 -1
  393. package/dist/run.js.map +1 -1
  394. package/dist/slice/format-slice-verification.d.ts.map +1 -1
  395. package/dist/slice/format-slice-verification.js +11 -5
  396. package/dist/slice/format-slice-verification.js.map +1 -1
  397. package/dist/stack/alias-vars.d.ts +3 -1
  398. package/dist/stack/alias-vars.d.ts.map +1 -1
  399. package/dist/stack/alias-vars.js +5 -2
  400. package/dist/stack/alias-vars.js.map +1 -1
  401. package/dist/version.d.ts +1 -1
  402. package/dist/version.js +1 -1
  403. package/package.json +6 -6
  404. package/templates/file-upload/controller.spec.ts.tpl +66 -2
  405. package/templates/file-upload/controller.ts.tpl +12 -0
  406. package/templates/file-upload/handler.spec.ts.tpl +3 -3
  407. package/templates/init/README.md.tpl +20 -1
  408. package/templates/init/e2e/jest.e2e.config.js.tpl +5 -0
  409. package/templates/init/e2e/test-database-setup.ts.tpl +120 -0
  410. package/templates/init/e2e/vitest.e2e.config.ts.tpl +2 -1
  411. package/templates/init/platform/composition/compose-application.container.ts.tpl +5 -0
  412. package/templates/init/platform/composition/compose-application.manual.ts.tpl +20 -3
  413. package/templates/init/platform/composition/create-platform.manual.ts.tpl +6 -0
  414. package/templates/init/platform/composition/platform-options.manual.ts.tpl +11 -0
  415. package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
  416. package/templates/init/platform/composition/platform.module.container.ts.tpl +34 -0
  417. package/templates/init/platform/database/connect-to-database.drizzle.ts.tpl +7 -2
  418. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +8 -3
  419. package/templates/init/platform/database/open-test-database.knex.ts.tpl +8 -3
  420. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +8 -3
  421. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +8 -3
  422. package/templates/init/platform/database/read-model-tables.ts.tpl +67 -0
  423. package/templates/init/platform/database/test-database-budget.ts.tpl +108 -0
  424. package/templates/init/platform/database/test-database-clone.ts.tpl +52 -161
  425. package/templates/init/platform/database/test-database-copy.ts.tpl +76 -0
  426. package/templates/init/platform/database/test-database-emptying.ts.tpl +209 -0
  427. package/templates/init/platform/database/test-database-kept.ts.tpl +32 -0
  428. package/templates/init/platform/database/test-database-leftovers.ts.tpl +52 -0
  429. package/templates/init/platform/database/test-database-run.ts.tpl +99 -0
  430. package/templates/init/platform/database/test-database-server.ts.tpl +140 -0
  431. package/templates/init/platform/database/test-database-session.ts.tpl +141 -0
  432. package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -1
  433. package/templates/init/platform/resilience/default-policy.ts.tpl +8 -1
  434. package/templates/init/rules/infrastructure.md.tpl +2 -2
  435. package/templates/init/scripts/read-model-tables.ts.tpl +83 -0
  436. package/templates/nest-controller/upload.spec.ts.tpl +67 -2
  437. package/templates/nest-controller/upload.ts.tpl +12 -0
  438. package/templates/pipeline/package-scripts.json +1 -1
  439. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +5 -9
  440. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +5 -9
  441. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +5 -9
  442. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +5 -9
  443. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +5 -9
  444. package/templates/repository/drizzle/repository.ts.tpl +6 -9
package/CHANGELOG.md CHANGED
@@ -4,6 +4,118 @@ 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.112.0
8
+
9
+ **`ddd-ts-kit generate file-upload --text <utf-8|single-byte>` writes the upload of a text file, with a spec that sends one that is not UTF-8.** Without the flag the generated controller still declares a document (PDF, PNG, JPEG). With it, the upload is a CSV under the names browsers give one (`text/csv`, `application/csv`, and `application/vnd.ms-excel` stated as `text` in `contentRules`), held to the text rule asked: `single-byte` when the file may be in Windows-1252 or ISO-8859-1 as well as UTF-8, `utf-8` when it must be UTF-8. The spec of the controller, a controller of the kit or a Nest controller, then sends a multipart form through `multipartUploads()` of `@ddd-ts-kit/http/uploads`: under `single-byte` a Windows-1252 file reaches the command byte for byte, under `utf-8` it is answered 415, and under both a workbook under the name of a CSV is answered 415. The spec of the handler stages a CSV. Another value of `--text` is refused with the two it takes. See `docs/concepts/file-storage.md`.
10
+
11
+ **Breaking: an upload says the text it takes and the content rule of each media type, and a declaration that could receive no file is refused.** Two defects of the content check of `@ddd-ts-kit/kernel` and `@ddd-ts-kit/http`. A text upload passed only as valid UTF-8, so a CSV exported in Windows-1252 or ISO-8859-1 (a bank statement, a spreadsheet) was answered 415: `UploadSpec` and `ContentExpectation` take `text: 'single-byte'`, under which UTF-8 and every single-byte encoding that extends ASCII pass, while a binary file under the name of a CSV is still refused (a signature, a NUL, a control character other than tab, line feed, form feed and carriage return) and so are UTF-16 and UTF-32. The default stays `utf-8`: the bytes cannot say their encoding, and a route that reads UTF-8 must not receive, without a refusal, a file it decodes wrong. The kit never decodes: the handler and the storage get the bytes as sent, and the new `isUtf8(bytes)` of the kernel tells a reader which decoder to take. And `mediaTypes` accepted types the content check then always refused (`application/vnd.ms-excel`, which a browser on Windows sends for a CSV, `application/csv`, `application/octet-stream`): every accepted type now has a content rule, the one of the kit (`contentRuleOf`: a signature for `SIGNED_MEDIA_TYPES`, text for `TEXT_MEDIA_TYPES`, which gain `application/csv` and `text/tab-separated-values`) or the one the upload states in `contentRules`, `text` (text under another name) or `unchecked` (the bytes are taken as they are). A rule stated for a family (`{ 'image/*': 'unchecked' }`) never reaches a type a browser runs when it opens it (`NAMED_ONLY_MEDIA_TYPES`: `image/svg+xml`, `text/html`, `application/xhtml+xml`, `text/javascript`, `application/javascript`): an upload takes one only by naming it. A type with no rule, a family none of whose types has one (`video/*`), an entry that is no media type (`*/*`) and a stated rule that does nothing are refused when the route is declared, by `@Controller`, `defineRoute` and the routes of a Nest controller, with the type and the rules it may state; `FileStaging.uploadUrl` takes `text` and `contentRules`, keeps them in the `PendingUpload` that `confirm` applies, and throws on the same defects (`contentRuleDefects`). The new rule `files/upload-content-rule` of `ddd-ts-kit check` reports them on the line of the type, in a `*.route.ts` or a `*.controller.ts` whose `mediaTypes` and `contentRules` are written as literals. The OpenAPI document says both (`x-text`, `x-content-rules`, and the description of the file). See `docs/concepts/file-storage.md`, "What a route accepts: a content rule for each media type".
12
+
13
+ To move: run `ddd-ts-kit check --rule files/upload-content-rule` to list the uploads that accept a media type with no content rule; they never received a file of it, and now refuse to start. For each, state the rule: `contentRules: { 'application/vnd.ms-excel': 'text' }` for the CSV of a browser on Windows, `{ 'application/octet-stream': 'unchecked' }` for bytes the route takes as they are, or remove the type. A list built in a constant is not read by the rule: the application says it at start. Add `text: 'single-byte'` to an upload that receives text files which are not UTF-8, and decode them where they are read (`new TextDecoder(isUtf8(bytes) ? 'utf-8' : 'windows-1252')`). A part declared `application/csv` or `text/tab-separated-values` on a route that accepts it, or `text/*`, is now held to the text rule and passes, where it was refused.
14
+
15
+ **Breaking: `ddd-ts-kit check` reports an adapter the default policy cuts before the slower adapter it calls, rule `aspects/timeout-covers-delegate`.** A new rule, an error at once. It reports one case, the one nobody chose: an `external` or `gateway` adapter left to the default policy of the platform (no `ownPolicy(...)`, no `timeout(...)` of its own; an `@Adapter` that names no kind is `external`) that is given a port, a constructor parameter typed by it, whose adapter states a longer `timeout(<ms>)` around all its methods. Every call the inner adapter would still answer then fails in the outer one first, at the default limit, as a timeout of the outer one. The default limit is the fallback of `OUTBOUND_TIMEOUT_MS` in the configuration of the platform, else `timeoutMs` of `resilience/default-resilience-settings.ts`. The rule reads `@Adapter`, `@Gateway` and the bindings of the container of the kit (`bind(Port).toClass(Adapter).as(kind).with(...)`). An adapter that states its own limit, even a shorter one, chose it and is never reported. The fix is `ownPolicy(timeout(<ms>))` on the outer adapter, or `ownPolicy()` alone when it only hands the call over. Not judged, because the text does not show it: a platform wired by hand (`platform.adapter(...)`); a duration or a kind that is not a literal; an aspect that is a variable, a spread, a call of another name or under `when(...)`; a `timeout(` nested in the options of another aspect; a `@Timeout` on a method; a port or an adapter bound more than once, bound again by `rebind(`, or bound under a condition; a parameter typed by a name the adapter does not import from a file of the project (a type of a package, a declaration of its own file); two ports of one name unless each file imports its own from the file that declares it; an adapter reached through a middle adapter; a default limit that is not one number, or an environment that sets `OUTBOUND_TIMEOUT_MS`; the retries. See "A delegating adapter" of `docs/concepts/resilience.md`.
16
+
17
+ To move: `npx ddd-ts-kit check --rule aspects/timeout-covers-delegate` lists the adapters to take up; each gets the policy the fix names.
18
+
19
+ **Breaking: `verify-merge` fails on a migration of a branch that sorts before the last migration of the trunk, on the four ORM, and `merge-trunk --to-land` reorders it on a branch that already holds the trunk.** A push that passed the pre-push hook now stops on such a migration. A branch that lives more than a day holds a migration generated before the last one the trunk gained meanwhile. The migrator of Drizzle then skips it without a word on a database that already applied the later one, and a merge that keeps the journal of the trunk loses its entry; knex, Prisma and TypeORM run it late, so a database that follows the trunk and a new one run one history in two orders. Without a `<commit>`, `ddd-ts-kit verify-merge` now reads the migrations of the working tree against the trunk (the base of the worker, else `origin/HEAD`, else `origin/main`) and exits 1, naming the migration, the last one of the trunk and the command that brings the order right: under drizzle-kit an entry of the journal generated before the last entry of the trunk, or a `.sql` file the journal does not list and the trunk does not hold (`ddd-ts-kit merge-trunk`, or the `meta/` of the trunk then `ddd-ts-kit drizzle-generate --replay` once the trunk is merged otherwise); under knex, Prisma and TypeORM a name that sorts before the trunk's last (`ddd-ts-kit merge-trunk --to-land`). `--warn`, which the pre-push hook of a generated project passes, still softens what a merge lost and never this: the push stops. A working migration (`working-<what-it-does>`) is left out, its place being decided when the branch lands, and what is ordered is what the tool itself takes for a migration, by what it orders it by: every script of the folder of knex and the folders of Prisma that hold a `migration.sql`, by their name, and the classes of TypeORM whose name ends with 13 digits, by that number. `merge-trunk --to-land` on a branch that already holds the trunk used to answer that there was nothing to merge: it now lands the migrations all the same and leaves them to commit. Under drizzle-kit they are replayed; elsewhere those that do not follow the trunk's already are renamed after its last, in their order, the others keeping their name, and a TypeORM class and its `name` follow. It stops, the folder left as it was found so that the same command runs again, when the replay fails or when a later migration of the trunk changes the same table (the stop then says to delete the migration and to generate it again), or when the last file of the trunk carries no number a migration can follow. A rename never takes a number a file of the folder carries already. `--dry-run` says which migrations would move. A database of development, of a preview or shared that already applied a migration under its old name no longer matches (knex refuses every migrate, the migrator of Drizzle and TypeORM run the migration again): the command and the fix of `verify-merge` say to reset it or what to correct, for each tool. `verify-slice` says such a migration apart from what a merge lost: the slice does not fail on it, the push is refused on it. `npm run db:generate <name>` refuses a name a migration of the folder already carries on knex, Prisma and TypeORM too, as it did on Drizzle. The JSON of `verify-merge` gains `migrations`, counted in `errorCount`. The order is read from the files and from git, not measured against a database: see "Migrations: names, merges and order" of `docs/tools/persistence.md`.
20
+
21
+ To move: run `git fetch`, then `npx ddd-ts-kit verify-merge` on each open branch; a branch it reports follows the command it names before its next push (`npx ddd-ts-kit merge-trunk` under Drizzle, `npx ddd-ts-kit merge-trunk --to-land` under knex, Prisma and TypeORM, then commit the renamed migrations when the branch already held the trunk). A script that reads the exit code of `verify-merge --warn` as always 0 now gets 1 on such a migration. A migration to generate under a name already taken gets a name of its own.
22
+
23
+ **A call cut by the default time limit of the platform says so: `timeout(ms, { statedBy })`.** The platform of a generated project puts a default policy around every `external` or `gateway` adapter that states none: 2 seconds per attempt. An adapter that only hands its call to another adapter, slow by nature and bound with a longer limit of its own (a remote reader with 120 seconds), failed every call at 2 seconds, and the error named the outer adapter and nothing else. `timeout(ms, { statedBy })` of `@ddd-ts-kit/aspects`, and `@Timeout(ms, { statedBy })` of its decorators, now take who states the limit: the `TimeoutError` keeps it in `statedBy` and ends its message with it, its code `TIMEOUT` and its `timeoutMs` unchanged, and a `timeout` without `statedBy` writes the message it always wrote. The `default-policy.ts` that `init` writes names itself there, so the message reads `RemoteQuoteReader.read did not answer within 2000 ms (the default policy of the external and gateway adapters, OUTBOUND_TIMEOUT_MS: ownPolicy(timeout(<ms>)) on the declaration or the binding of this adapter states another, at least as long as the adapter it calls)`. See "A delegating adapter" of `docs/concepts/resilience.md`.
24
+
25
+ To move: a project generated earlier takes the message by adding `{ statedBy: '<who states it>' }` to the `timeout(settings.timeoutMs)` of its `src/platform/resilience/default-policy.ts`, as the template of this version does; nothing else changes, and a test that compares the whole message of a `TimeoutError` of the default policy reads the new ending.
26
+
27
+ **`ddd-ts-kit move-to-module` writes nothing when the move would close a cycle between modules, and says which.** The command moved the files and rewrote their imports, and `module/no-cycle` reported the cycle afterwards. It now reads the imports between the modules of the context as the rule does, before the move and with the move planned, and refuses a move that makes a module import another that imports it back, directly or through a third: the refusal names the cycle, each step of it with its imports (file and line, the steps the move adds told apart from the ones there now), and the file at the other end of the imports the move adds, to move along in the same command. `--dry-run` refuses with the same words. The new `--allow-cycle` moves all the same and says the cycle with the move, in the text and under `cycles` of `--json`. A cycle that is there before the move is not counted, and the command judges what the rule will: a project that turns `module/no-cycle` off is not judged, nor a cycle whose every import is in a file the config turns the rule off for, and only the files `ddd-ts-kit check` reads are read. Under `--json`, the refusal carries `cycles` and `along` (the files or folders to move along) in its `error`. `context-layout` is unchanged: it already leaves where it is a file that would make a module depend on another.
28
+
29
+ To move: a script that runs `ddd-ts-kit move-to-module` and must keep moving a cluster one file at a time passes `--allow-cycle`; otherwise name in one command the files the refusal lists.
30
+
31
+ **Breaking: on a PostgreSQL server (`DATABASE_URL`), an end-to-end run of a generated project copies the migrated database once, in a global setup, and each spec file copies the tables of that copy, emptied but for those the project lists.** Each spec file used to copy the migrated database itself, in the hook that starts the application. Three things followed on a migrated database that holds rows (measured at 474 MB on PostgreSQL 18): a copy takes 6 seconds alone and 46 to 56 seconds when four files copy at once, more than the 30 seconds of a hook; nothing held the pools of the applications under the connections of the server, so workers times 10 connections ended in `too many clients`; and the copies of a run that was killed, or of a file that failed while it started, stayed on the server for an hour, or for good. Now `test/support/test-database-setup.ts`, a global setup of the end-to-end run, opens the run once, where no timeout of a hook applies (`test/support/test-database-run.ts` and the files it is made of, `test-database-session.ts`, `-leftovers.ts`, `-budget.ts`, `-copy.ts`, `-emptying.ts`, `-server.ts`): it copies the migrated database, one run at a time on the server, and empties the copy. `cloneDatabase(url)` of `test/support/test-database-clone.ts` copies that template for its file, one copy at a time in a run, in a fraction of a second whatever the migrated database holds. **What a file finds.** The run empties every table of its copy but those `KEPT_TABLES` lists in `test/support/test-database-kept.ts`, a file of the project: as generated, what the migration tool writes and, with an audit trail, the `audit` schema, which is left as the migrated database holds it. A name is `<schema>.<table>`, or `<schema>.*`, written as the server stores it and without quotes, so in lower case unless the table was created between quotes (`"Countries"` is listed as `public.Countries`); `<schema>.*` keeps every table of the schema whatever its name holds, and a table whose name holds a dot or a quote is kept through it only; any other shape (`*`, `public`, a quoted name, `public.plans.v2`) refuses the run with the shapes a name takes, and a name that is no table of the database (a misspelling, another case, a view) is said in one line, except the names the generated list holds for a table its tool has not created yet. The tables are emptied in one `truncate` without `cascade`, each one alone (`only`): a kept table that references an emptied one refuses the run with both names, a kept table that inherits from an emptied one keeps its rows, and a kept partition of an emptied table, or a kept table that references such a partition, refuses the run with both names. A table another role owns, or one in a schema the role of the run may not use, is left with its rows and named, a table of an extension is left, the materialized views are refreshed, a sequence no column owns keeps its value. The run names on its error output the tables it emptied that held rows, up to 20 of them, and above 64 MB what the copy took; a run with nothing to say writes nothing. **The connections.** The global setup counts the files that run at once, the workers of the run and no more than the files of this run: under Vitest the list of the runner once the filters of the command line are applied, and the share of a shard; under Jest, which hands no list to a global setup, the spec files under `test/` that the patterns of the command line match as Jest matches them, less those `testPathIgnorePatterns` ignores, and the share of a shard. Where the count cannot be made or finds nothing (a run that watches, an empty list, under Jest no spec file under `test/` among those of the run, a pattern that is no expression, no `test/` directory) the workers alone count, so a run is never given more files than it counted. The setup reads what the server has left (`max_connections`, less what it reserves and what is open, and no more than the connection limit of the role), and gives each application under test a pool of its share less one connection to spare, 10 at most (`DatabaseClone.poolSize`, handed to the connection of the four ORM; `connectToDatabase` of a project on Drizzle takes a `poolSize` like the three others). A run that does not fit is refused before any file starts, with its numbers, the number of files at once that fits and what raises the bound that holds it, for one `8 spec files at once need 24 connections (2 for each application at least and 1 to spare), and the role app has 12 left (connection limit 13, 1 open): run at most 4 at once (npm run test:e2e -- --maxWorkers=4), or raise the limit of the role (alter role app connection limit <more>).` `TEST_DATABASE_CONNECTIONS` states fewer connections than the server leaves; a value that is not a whole number, or above what the server leaves, is refused. **What a killed run leaves.** A database of a run is named `<database>_test_<run>_template` or `<database>_test_<run>_<random>`. The run holds an advisory lock keyed by its name, on a session to the `postgres` database of the server, and writes every 15 seconds the time of the server in the comment of its template; its teardown never throws. The global setup of a run drops a database named after a run only when the lock of that run is free, it has not written for a minute and nobody is connected to the database: a run that lives, in another checkout or on another machine, keeps its databases, and a database with any other name is never dropped. **When the server ends a session.** The run takes another session and its lock again at once, and says so when it could not. With its lock again it looks for its template: when that one is gone (the run had no session for more than a minute and another run dropped what it held dead, or an administrator did), it says that it lost its databases, and each file that then cannot copy the template fails with that sentence instead of the `template database ... does not exist` of the server. The copy of the migrated database has a session of its own: when the server ends it, what is left of the copy is dropped and the copy made once more, and a second end is said as such. A statement of the run that somebody cancels (`pg_cancel_backend`) is no ended session: the run says that its copy was cancelled and does not take it again. **The timeouts of the role.** The sessions of the run itself, the one of its lock and those that copy, empty and drop its databases, set `statement_timeout`, `lock_timeout` and, from PostgreSQL 17, `transaction_timeout` to 0 for themselves: a role is given such a timeout (`alter role <role> set statement_timeout = '30s'`) for the requests of an application, and what the run does lasts as long as the database is large. The pool of the application under test keeps the timeouts of its role. The address is the server itself, not a pooler in transaction mode, and `DATABASE_URL` cannot name the `postgres` database: the run says so. **Outside an end-to-end run** (`openTestDatabase(url)` in a spec of the unit run, a project without an HTTP stack), the call opens a run of its own, which copies and empties the migrated database itself. Nothing counts the files that do so at the same time: each opens a small pool, 4 connections at most, and is refused when the server has no room for it at that moment. **Any way of starting the runner.** The files directly under `test/support/` import one another by a relative path (`./test-database-run`), since a runner loads its global setup before any alias exists: the setup loads however the runner is started, and the scripts are the ones a project on Jest had. The spec files of a project on Jest are ES modules, as before: a bare `npx jest -c jest.e2e.config.js` fails with `Must use import to load ES Module`, and `NODE_OPTIONS=--experimental-vm-modules npx jest -c jest.e2e.config.js`, or the runner of an editor given that variable, starts the run as the scripts do. Under `"importExtension": "js"` that path ends with the `.ts` of the source, which the transform of the runner finds, and `init` writes `"allowImportingTsExtensions": true` and `"noEmit": true` in `tsconfig.json`, which let the type check read it, and both as `false` in `tsconfig.build.json`: the build emits what it emitted before. See [the testing strategy](docs/concepts/testing-strategy.md).
32
+
33
+ To move: these files are written once by `init`, so a project already generated keeps what it has until it takes them. Commit everything first, then run `npx ddd-ts-kit init --force` and read `git diff` before you commit again: it rewrites from the templates of this version every file `init` owns, not the test support alone, and an edit made by hand in one of them is lost. That is all of `src/platform/**`, `test/e2e/support/*`, `test/support/*`, `scripts/*`, the configurations of the runner, of Stryker, of ESLint, of the ORM and of lefthook, `tsconfig.json`, `.github/actions/setup`, the Dependabot configuration, `test/architecture/extractable.spec.ts`, the declarations file of each context, `docs/behaviour/*.md`, and the scripts of `package.json` that `init` generates, whose names are written again: a script you changed under one of those names is replaced, one you added under another name stays. It keeps the workflows, `README.md`, `AGENTS.md`, `CLAUDE.md`, `src/main.ts`, the migrations, the spec files, the API documents, the published language, and a `test/support/test-database-kept.ts` that exists: once written, that file is the project's ([Migrate after a kit upgrade](docs/guides/commands.md)). To take the files one by one instead, generate a project with the same flags in a temporary directory and copy `test/support/test-database-*.ts`, the function `openServer` of `src/platform/database/open-test-database.ts`, `src/platform/database/connect-to-database.ts` on Drizzle, the `globalSetup` line of `vitest.e2e.config.ts` or of `jest.e2e.config.js`, and under `"importExtension": "js"` the `allowImportingTsExtensions` and `noEmit` lines of `tsconfig.json` and of `tsconfig.build.json`; the rule `imports/alias-only` of this version lets those files import one another by a relative path. Then read `test/support/test-database-kept.ts`: add each table whose rows a migration inserts and the application reads at boot or in a request (a spec that read such a row found it until now); write the table of the migration tool under its name when the project gives it one (`tableName`, `migrationsTableName`, `migrations.table`); on Drizzle and TypeORM, a table the ORM does not declare was never emptied by `reset()` and is emptied now, unless listed. The audit trail is not emptied: a migrated database that holds audit rows hands them to every file, as before. Point `DATABASE_URL` at the server itself and at a database other than `postgres`. The copies an earlier version left carry another name (`<database>_test_<ten digits>_<random>`) and are no longer dropped: list them once with `select datname from pg_database where datname ~ '_test_[0-9]{10}_[0-9a-f]{8}$'` and drop each (`drop database "<name>" with (force)`).
34
+
35
+ **`imports/alias-only` lets a file directly under `test/support/` import its neighbour by `./<name>`.** A test runner loads its global setup, and every file that one imports, before any alias of the project exists: Jest applies no `moduleNameMapper` there. A global setup made of several files could therefore import them by alias only when the runner was started under a loader that resolves aliases, and failed with `Cannot find module '$test/support/...'` from `NODE_OPTIONS=--experimental-vm-modules npx jest` or from the runner of an editor. The rule, in `ddd-ts-kit check` and in `@ddd-ts-kit/eslint-plugin`, now leaves that one relative path alone: from a file directly under `test/support/`, a specifier `./<name>` that names a neighbour file. Nothing else changes: from `test/support/`, `../e2e/support/start-application`, `./parts/part`, `./.`, `./..` and a `./parts` that is a directory are reported as before, and a file of any other directory still imports its neighbour by alias. The rule judges the name of that neighbour against the files on disk, and `eslint --fix` rewrites it: a `.ts` source without its extension under `"importExtension": "none"`, the name of the source under `"js"` (`./test-database-run.ts` for `./test-database-run.js`, `./esm.mts` for `./esm.mjs`), since the runner loads the sources and a `./test-database-run.js` there passes the type check, then stops the run on `Cannot find module`. A file that exists as it is named (a JSON file, a JavaScript file) is left alone, and a directory named as a neighbour is fixed to the alias of its index file. `init` writes what lets the type check of such a project read that ending, and `imports/alias-declared` holds it. See [Import aliases](docs/tools/import-aliases.md).
36
+
37
+ **Events of one key applied at once to a read model are no longer refused for another unique value of its table.** A read model table that holds a second value unique (a unique index on a slug, a number) could refuse one of two writes of the same row made at once, on PostgreSQL, with the unique violation of that other index: the insert named the key alone as its conflict target, and two inserts that cross meet on the other index first. No write was lost, since the handler of the event failed and the event is delivered again, but the error named a value no other row held. The stores of `@ddd-ts-kit/drizzle`, `@ddd-ts-kit/knex` and `@ddd-ts-kit/typeorm`, and on `@ddd-ts-kit/prisma` the copy of a rebuild (its model already skipped on any unique value), now insert with a statement that skips on any unique value, and only when it wrote nothing with a second one that names the key: a key that is held is compared with the event and written if the event is newer, and a value another row holds is still refused by the database. `readModelStoreContract` and `readModelRowsContract` of `@ddd-ts-kit/testing` gain the cases, for a storage that says `uniqueTitle`: writers that insert one row at once, in the table and in the copy of a rebuild, and several rows that take one unique value at once, of which one holds it and the others are refused. See [CQRS](docs/concepts/cqrs.md).
38
+
39
+ To move: nothing for a table of the four ORM. A `ReadModelTable` of your own that runs the contract with `uniqueTitle` and holds the value in memory takes it before its write, as an index does, and gives it back when nothing was written: checked after the write, two rows inserted at once both pass.
40
+
41
+ **Two first saves of one aggregate made at once are a lost update on a table with a unique column too, never a unique violation for the value they both write.** On PostgreSQL, the first save of an aggregate inserted with the key alone as its conflict target (`ON CONFLICT (id) DO NOTHING`). Two inserts of the same id made at once (a request delivered twice, a command run again while its first run commits) both pass the check of the key, then meet on the other unique index of the table (an email, a number), and the one that lost was answered `UniqueViolationError` (code `CONFLICT`, 409) for a value no other row held, where `optimisticUpdate` promises `ConcurrencyError` (code `CONCURRENCY_CONFLICT`). `insertIgnoringConflict` of `@ddd-ts-kit/knex` and of `@ddd-ts-kit/typeorm` now inserts with a statement that skips on any unique value, and only when it wrote nothing with a second one that names the key: a key that is held writes no row, and a value another row holds is still refused by the database, with the error of the driver as the cause of the `UniqueViolationError`. `@ddd-ts-kit/drizzle` gains the same helper, `insertIgnoringConflict(() => executor.insert(table).values(row), table)`, which says whether it inserted, and `generate repository` and the identity preset write it on Drizzle in place of `onConflictDoNothing({ target: primaryKeyOf(table) })`. A repository on `@ddd-ts-kit/prisma` was not concerned: `skipDuplicates` names no target and `rowsCreated` tells a taken id from a taken value. `repositoryContract` of `@ddd-ts-kit/testing` gains the case, with the new option `createAggregateAgain`: the same new aggregate saved several times at once, one save that writes it and the others refused with `CONCURRENCY_CONFLICT`. The stores of the kit were not concerned: their tables hold no second unique value two writers of one key could both write. See [Persistence](docs/tools/persistence.md).
42
+
43
+ To move: nothing on Knex and TypeORM, whose repositories call the helper. On Drizzle, `grep -rn "primaryKeyOf(" src` lists the first saves to take up: `insertion.onConflictDoNothing({ target: primaryKeyOf(table) }).returning(...)` becomes `insertIgnoringConflict(() => this.database.executor().insert(table).values(row), table)`, which answers a boolean where the statement answered its rows (`? 1 : 0` under `optimisticUpdate`). Give `createAggregateAgain` to the `repositoryContract` of a repository over a table with a unique column, and run it on a real PostgreSQL: one connection, as PGlite has, never crosses two inserts.
44
+
45
+ **Breaking: under `"importExtension": "js"`, `imports/alias-declared` reports a `tsconfig.json` that does not let the type check read the `.ts` by which a file of `test/support/` names its neighbour; it reports a build configuration that would write nothing, and `ddd-ts-kit build-aliases` refuses one.** The files a test runner loads as its global setup import one another by `./<name>.ts` in such a project. The compiler refuses that ending (`TS5097`) unless `tsconfig.json` sets `"allowImportingTsExtensions": true`, which it accepts only in a configuration that emits nothing (`"noEmit": true`), and a `tsconfig.build.json` that extends it without setting both back to `false` compiles without an error and writes no file: `build-aliases` then finds no output, or rewrites an earlier one. `init --import-extension js` writes those four lines, and `ddd-ts-kit check` now holds them: it reports `tsconfig.json` when a file directly under `test/support/` names a neighbour by its `.ts` and neither `allowImportingTsExtensions` nor `rewriteRelativeImportExtensions` is set there, and, whatever `importExtension` is, `tsconfig.build.json` and each tsconfig a script of `package.json` compiles what ships with (`tsc -p tsconfig.prod.json`, `tsc` alone for `tsconfig.json`) when it resolves `noEmit` as `true`, or `allowImportingTsExtensions` as `true` without `rewriteRelativeImportExtensions` or `emitDeclarationOnly`. Each finding names the lines to write. An `extends` is followed as the compiler follows it: a relative path with or without its `.json`, and a package installed in the `node_modules` of the project root; a package found through its `exports`, or in a `node_modules` above the root, is not. `ddd-ts-kit build-aliases` refuses, exit 2, a tsconfig that resolves `noEmit` as `true`: the compiler wrote nothing with it, and the command used to answer `rewritten 0 alias specifier(s)` over an earlier output, which then shipped. The compiled output is what it was: no option rewrites an import of the sources, so no helper is added to it. A project that writes its imports without an extension (`"importExtension": "none"`, the default) is given none of these options by `init`, and is reported only for a `noEmit` it wrote itself in a configuration its build inherits. See [Import aliases](docs/tools/import-aliases.md).
46
+
47
+ To move: `npx ddd-ts-kit check --rule imports/alias-declared` lists the two files when they are concerned. Write `"allowImportingTsExtensions": true` and `"noEmit": true` under `compilerOptions` in `tsconfig.json`, and `"compilerOptions": { "allowImportingTsExtensions": false, "noEmit": false }` in `tsconfig.build.json`, or let `npx ddd-ts-kit init --force` write both files after a commit. A script of your own that emits with `tsc -p tsconfig.json` now writes nothing: point it at `tsconfig.build.json`.
48
+
49
+ **Breaking: `ReadModelTableNotReadyError` says what is missing and writes the migration in two steps, for the columns its store maps and no other, and is built from a `ReadModelTableState`.** Its message named the table and the columns that refuse NULL, then gave the statement to write with a `<column>` to fill in. It now names the table, each thing that keeps it from holding a trace, and the whole migration as PostgreSQL statements, in its `steps` field (`definition`, then `validation`) and, both in order, in `statements`. The state it reports is the reading of the store (`PostgresTraceColumns` of `@ddd-ts-kit/kernel`, behind the tables of `@ddd-ts-kit/knex`, `@ddd-ts-kit/drizzle`, `@ddd-ts-kit/prisma` and `@ddd-ts-kit/typeorm`), which looks at the columns the store maps as fields of its row and at nothing else: the key, the tenant column whatever its name, the stamp and a column the store does not map are never read, never altered and never emptied. Among the mapped columns it tells those that refuse NULL (`refusing`) from those no migration opens (`unfit`: a part of the primary key, an identity column, a generated column, a column of a domain that refuses NULL, a column that is not there), and says when the table itself is not in the database; a store whose mapped column is unfit refuses, with no statement for that column, where it failed later on the database. The stamp columns carry the names the definition of the store gives them, so a renamed `deleted` column is the one the migration names; on TypeORM, the names the naming strategy of the data source gives the table and its columns.
50
+
51
+ The first step is the change of definition, one statement: NOT NULL dropped on each refusing column and, in the same `alter table`, the constraint `<table>_live_rows_whole` written again, `not valid`. Nothing commits between the two, on any migration tool. Before it changes anything, the statement reads the constraint the database holds under that name and fails on one that is not written as the kit writes it, naming the constraint and its table: a constraint of the project that happens to carry the name is never dropped, on the database that was read or on another. The second step validates the constraint and empties the rows deleted before, with an update that touches only the rows still holding a value. Every identifier is quoted, the dollar quote of the first step is one no name of the statement holds, the statements hold no backslash and no question mark (a string of JavaScript and `knex.raw` carry them as they are; a column whose own name holds a question mark is said under the statements, to write `\?` in `knex.raw`), and the migration can be run twice. The name of the constraint is cut at 63 bytes, as PostgreSQL cuts it, not at 63 characters.
52
+
53
+ The first step takes the lock that stops the readers and the writers of the table, and holds it to the end of its transaction. On a small table both steps go in one migration. On a large one the second step goes in a migration that runs outside the transaction of the first, where the validation and the update stop neither readers nor writers, and each tool needs something for that: knex runs every pending migration in one transaction unless the second ends with `export const config = { transaction: false };`; TypeORM does unless the data source says `migrationsTransactionMode: 'each'`; Drizzle always does, so the second migration is added and applied after the first; Prisma commits each statement of a file except a file with a `do` block, which the first step is, so two migrations. `docs/tools/persistence.md`, "A large read model table: the second step apart", gives each case as it was run, with the locks read in `pg_locks`.
54
+
55
+ The constraint is read exactly: only the form the kit writes, as PostgreSQL prints it back, counts as holding columns; `(deleted or title is not null) and ..` or `deleted or not (..)` under that name is another check. A constraint that is not validated, another check under that name, and any other check constraint that names a column of the row, unless it is written for the live rows only (`deleted or ..`), are read and reported as warnings by `ReadModelTables`, not as refusals: nothing in the columns refuses a trace, and the kit does not decide what an arbitrary check does. A refusal read from a definition alone (Drizzle, TypeORM, a column declared not null there) carries no statement and says to declare the column nullable.
56
+
57
+ To move: code that builds the error itself (a `ReadModelRows` of your own) passes a state, `new ReadModelTableNotReadyError({ table, exists: true, refusing, unfit: [], row, deleted: 'deleted' })` (`schema` and `constraint` when known), where it passed `(table, columns)`; a test that compared the whole message compares `table`, `columns`, `steps` or `statements`. A read model whose store maps a part of its primary key, an identity column, a generated column or a column of a domain that refuses NULL as a field of its row is now refused before its first trace: take that column out of the fields the store maps, or make it an ordinary nullable column. A TypeORM entity without `tableName` is named in a refusal by the table the naming strategy gives it (`strict_row`), not by its entity name.
58
+
59
+ **The read model tables an application lists are checked when it starts and, from the command line, before a deployment, each by its own store and each root for the contexts it hosts.** A table that cannot hold the trace of a deleted row was refused when its store was built (Drizzle, TypeORM) or before its first trace (the four ORM). In an application whose container builds a store at its first use, both came with the first request or the first event that reached the read model, in production, one table at a time, and nothing listed the tables an upgrade left to migrate. A `TableReadModelStore` of `@ddd-ts-kit/kernel` now answers `tableState()`, the reading its table makes before its first trace (`tableState()` of the `ReadModelTable` port, implemented by the table of `@ddd-ts-kit/knex`, `@ddd-ts-kit/drizzle`, `@ddd-ts-kit/prisma` and `@ddd-ts-kit/typeorm`), as a `ReadModelTableState`. `ReadModelTables` of the kernel takes a list of entries, each a name and what builds a store, and asks it of each: `states()`, `notReady()`, `require()` (which refuses with `ReadModelTablesNotReadyError`, one error that names every table with its migration), `atStart(logger, 'required' | 'reported')` for a start and `report()` for a command. The verdict is the one of the store by construction: the same table, schema, columns and stamp names, read by the same code, and a table nobody lists is never read, whatever else the database holds. Every entry is tried: one whose store cannot be built, or whose table the database refuses to read (a role without the right to use the schema), is told under its name with its cause, in `unread` of the same error, the others are still read, and `'reported'` logs it and lets the start go on. The cause is said in a few words, the message of the driver and never the statement an ORM wraps it in. A database that cannot be reached at all (a refused connection, a host that is not found, a timeout, read through the wrapping of each ORM) is not a refusal: the start goes on, `'required'` or `'reported'`, with one warning that gives the short cause, since an application never depended on its database being up to start, and `db:read-models` exits 3. What the check cannot decide is a warning at the start and a line of the command: a check constraint that is not validated or is not written as the kit writes it, another check constraint that names a column of the row, a view, a store the application names as not listed. A store without a table (memory, OpenSearch) has nothing to say. `readModelTablesContract` of `@ddd-ts-kit/testing` holds the four ORM to it on PostgreSQL.
60
+
61
+ A project generated by `ddd-ts-kit init` on one of the four ORM has the list in `src/platform/database/read-model-tables.ts`, between markers: an entry is the context of a read model and the class of its store, `['billing', KnexInvoiceSummaries]`, and the context is one of those the file holds in `Contexts`, which `generate context` fills, so an entry under a misspelt name does not compile. `ddd-ts-kit generate read-model` adds the store it writes, under an alias that carries its context when another context holds a store of that class name. `init`, with or without `--force`, adds the read model stores the tree holds and the list does not, so a project generated before the list existed gets it filled; it reads every class of the persistence of each context, several in one file and a store over a base class of the project included; a store it cannot list with certainty (its own constructor is not `(database)` nor `(database, scope)`, or is inherited; a generic class) is named in a note and in `NOT_LISTED` of the file, and the check says at each start that nothing checks its table. A store left out on purpose is a comment of the list that holds `<context>: <Store>` and the reason: `init` leaves it out and nothing warns of it, where an entry merely deleted comes back at the next `init --force`. An application checks, when it starts and before a consumer is subscribed or a request served, the entries of the contexts it hosts: the whole application and the worker every context but those run as services, a service (`generate service`) its context alone, so each root starts on a database that holds its own tables. A listed table that is not ready stops the start, which in a rolling deployment keeps the old instances serving until the migration ran; a pipeline that starts the application before its migrations passes `readModelTables: 'reported'` to `composeApplication`, and the same message is logged as one error. `npm run db:read-models` (`scripts/read-model-tables.ts`) runs the same check on the database `DATABASE_URL` names, for every context or for those `-- --context <name>` names, and needs no other variable of the application: it prints the database it reads (name and host, never credentials, since a `.env` file may give the address), how many tables it read and their names, then each one that is not ready with its migration, and exits 0 when all are ready, 1 when one is not, 2 when `DATABASE_URL` names no database, 3 when no table could be read, 4 when `--context` names a context no listed read model belongs to, with the contexts the list holds. Since the list is a file every context shares, `generate read-model` on an ORM is a step of the conductor under `--local-only` (`docs/guides/parallel-work.md`). The persistence skill of the plugin says when to run the command and how to write the migration of its refusal, and the parallel-work skill names the new conductor step. On TypeORM, the table and the columns of a refusal, the mark of a deleted row included, are named as the database holds them under the naming strategy of the data source. See `docs/concepts/cqrs.md`, "Every table checked at the start, and before a deployment", which also says what the check does not read (a trigger, a rule, a check of a domain, the table under a view).
62
+
63
+ To move: commit, then `ddd-ts-kit init --force`. It writes `src/platform/database/read-model-tables.ts` with the read model stores of the tree listed under their contexts (and keeps the list of a file that has the markers), `scripts/read-model-tables.ts`, the call of the start and the `db:read-models` script of `package.json`; read its notes for a store it could not list. By hand instead:
64
+
65
+ 1. `src/platform/database/read-model-tables.ts`:
66
+
67
+ ```ts
68
+ import {
69
+ AsyncLocalStorageExecutionScope,
70
+ ReadModelTables,
71
+ type ExecutionScope,
72
+ type ReadModelInATable,
73
+ } from '@ddd-ts-kit/kernel';
74
+ import type { Persistence } from '@/platform/database/persistence';
75
+ // ddd-ts-kit:imports
76
+ import { KnexAgenda } from '@/contexts/scheduling/infrastructure/persistence/knex-agenda.repository';
77
+ // /ddd-ts-kit:imports
78
+
79
+ type Store = new (database: Persistence['database'], scope: ExecutionScope) => ReadModelInATable;
80
+
81
+ type Contexts = [
82
+ // ddd-ts-kit:contexts
83
+ 'scheduling',
84
+ // /ddd-ts-kit:contexts
85
+ ];
86
+
87
+ const LISTED: readonly (readonly [context: Contexts[number], store: Store])[] = [
88
+ // ddd-ts-kit:read-model-tables
89
+ ['scheduling', KnexAgenda],
90
+ // /ddd-ts-kit:read-model-tables
91
+ ];
92
+
93
+ const NOT_LISTED: readonly string[] = [
94
+ // ddd-ts-kit:read-models-not-listed
95
+ // /ddd-ts-kit:read-models-not-listed
96
+ ];
97
+
98
+ export function readModelTables(persistence: Persistence, contexts?: readonly string[]): ReadModelTables {
99
+ const scope = new AsyncLocalStorageExecutionScope();
100
+
101
+ const listed = LISTED.map(([context, Store]) => ({
102
+ context,
103
+ name: Store.name,
104
+ build: () => new Store(persistence.database, scope),
105
+ }));
106
+
107
+ return new ReadModelTables(listed, NOT_LISTED).hosting(contexts);
108
+ }
109
+ ```
110
+
111
+ One line per read model kept in a table: the name of its context, as `ddd-ts-kit.config.json` declares it, and the class of its store. The scope is given to a store of tenant data and never read by the check.
112
+
113
+ 2. The start. On a container, `platformModule` takes the hosted contexts as a third parameter, `hosted?: readonly ContextModule[]`, reads their names (`const contexts = hosted?.map(({ name }) => name);`), its module holds `onStart: ({ resolve }) => readModelTables(persistence, contexts).atStart(resolve(Logger), options.readModelTables),`, and `compose-application.ts` calls `platformModule(persistence, options, contexts.modules)`. On a platform wired by hand, `readModelTables(contexts: readonly string[]): ReadModelTables;` in the `Platform` interface, `readModelTables: (contexts) => readModelTables(persistence, contexts),` where the platform is created, `start: () => start(platform, options, contexts),` in `composeApplication`, a third parameter `hosted: readonly ContextWiring[]` of `start`, and `await platform.readModelTables(hosted.map(({ name }) => name)).atStart(platform.logger, options.readModelTables);` there, before `options.events.start()`. In both, `readonly readModelTables?: ReadModelTablesAtStart;` in `PlatformOptions`.
114
+
115
+ 3. In `package.json`, `"db:read-models": "tsx --env-file-if-exists=.env scripts/read-model-tables.ts"`, and `scripts/read-model-tables.ts`, which opens the persistence on `process.env['DATABASE_URL']` alone (`openPersistence({ databaseUrl })`), refuses with exit code 4 a `--context` that is not among `readModelTables(persistence).contexts`, prints `(await readModelTables(persistence).hosting(contexts).report()).text`, sets `process.exitCode` from `outcome` (`ready` 0, `not-ready` 1, `unread` 3), and closes the persistence.
116
+
117
+ Before the next deployment, `DATABASE_URL=<its database> npm run db:read-models` lists what is left of the 0.111.0 migration.
118
+
7
119
  ## 0.111.0
8
120
 
9
121
  **The briefing of a worker says upfront that a branch keeps one working migration.** A worker whose second slice changed the schema generated a second working migration, and learned only from the refusal of `drizzle-generate --replay` at the merge that a branch keeps one and generates it again. `worker-scope` and the context builder agent now say it before the first slice.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:a53f244ee1ee65ef -->
2
+ <!-- translation-of: README.md sha256:e7884377cb3ae2cc -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -646,12 +646,12 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
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
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) |
648
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` |
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, chaque appel alors sur une copie de la base migrée, créée et supprimée par `test/support/test-database-clone.ts` ; 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
+ | `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, chaque appel alors sur une copie de la base migrée, créée et supprimée par `test/support/test-database-clone.ts` ; 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), `read-model-tables.ts` (la liste des modèles de lecture gardés dans une table, entre des marqueurs que `generate read-model` remplit, qu'`init` remplit d'après les stores de l'arbre et que `init --force` garde, chaque entrée étant le contexte d'un modèle de lecture et la classe de son store ; `readModelTables(persistence, contexts)` fait lire chaque table de ces contextes par son propre store, donc avec le verdict de ce store ; une application l'appelle à son démarrage, pour les contextes qu'elle héberge (un contexte exécuté en service vérifie ses propres tables, sur sa base), et refuse de démarrer sur une table listée qui ne peut pas contenir la trace d'une ligne supprimée, nommée avec sa migration, ou qu'elle n'a pas pu lire, sauf si `composeApplication` reçoit `readModelTables: 'reported'` ; `scripts/read-model-tables.ts`, `npm run db:read-models`, la demande à la base que nomme `DATABASE_URL` avant un déploiement, pour tous les contextes ou pour ceux que nomme `-- --context <nom>`, sans autre variable, affiche la base qu'il a lue, et sort avec le code 1 quand une table n'est pas prête, 2 sans base à lire, 3 quand aucune table n'a pu être lue, 4 quand `--context` nomme un contexte auquel aucun modèle de lecture listé n'appartient ; une entrée nomme un contexte de `Contexts`, que `generate context` remplit, ou ne compile pas, et un store laissé de côté exprès est un commentaire de la liste qui porte `<contexte>: <Store>`). 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` |
650
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 |
651
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 |
652
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` |
653
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 |
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, alors sur une copie de cette base migrée, une par fichier de *spec*, si bien que les fichiers s'exécutent en même temps sur un serveur aussi ; 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
+ | `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, alors sur une base par fichier de *spec*, les tables de cette base migrée, vidées sauf celles que liste `test/support/test-database-kept.ts`, si bien que les fichiers s'exécutent en même temps sur un serveur aussi ; `test/support/test-database-setup.ts`, une mise en place globale de l'exécution, copie et vide la base migrée une fois, partage entre les fichiers qui s'exécutent en même temps les connexions qu'il reste au serveur et supprime ce qu'une exécution tuée a laissé (`test/support/test-database-*.ts`) ; 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`) |
655
655
  | `docs/context-map.md`, `docs/integration/README.md` | voir `docs` |
656
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 |
657
657
  | `eslint.config.mjs` | le preset `dddTsKit` de `@ddd-ts-kit/eslint-plugin`, lint typé sur le tsconfig du projet |
@@ -841,7 +841,7 @@ Next, in this order: the language of the context first, then the business decisi
841
841
  | `port` | `<context> <Name> [--module <module>]` | `application/ports/<name>.port.ts`, une classe abstraite, et son *fake* |
842
842
  | `route` | `<context> <UseCaseName> --method <GET\|POST\|PUT\|PATCH\|DELETE> --path <p> [--command\|--query] [--group <Name>] [--mapper] [--serializer] [--cache public\|private\|no-store] [--module <module>]` | sous `"stack.routes": "controllers"` : une classe contrôleur dans `presentation/http/<resource>/<use-case>/` (la ressource est le premier segment du chemin), qui dépend de `CommandBus` ou de `QueryBus`, derrière le groupe de routes de sa ressource, écrit avec elle quand il est nouveau (`<resource>.routes.ts` : préfixe, étiquette, `Authenticated`) ; un cas d'usage public ne se tient dans aucun groupe et dit `guards: [Public]` ; avec class-validator, une classe par fichier (`<use-case>.params.ts`, `.body.ts`, `.answer.ts`, `.accepted.ts`, `.line.ts`) ; `--mapper` et `--serializer` ajoutent un *mapper* de requête HTTP et un sérialiseur que reçoit le contrôleur ; une *spec* ; aucun enregistrement dans un projet déclaré, un contrôleur construit à la main dans `<context>.routes.ts` (le fichier de module en câblage manuel) dans un projet explicite. Sous `"functions"` : une fonction `defineRoute`, sa *spec*, son enregistrement dans `<context>.routes.ts`, et des classes `<use-case>-<role>.dto.ts` |
843
843
  | `controller` | les mêmes arguments que `route` | la classe contrôleur, quoi que dise `stack.routes` : pour un projet de routes en fonctions qui écrit sa prochaine route comme une classe. `--cache` écrit sa politique de cache : `private` (un `GET` d'un appelant, `max-age=0`, `must-revalidate`, `ETag` fort), `public` (un `GET` d'un cas d'usage public, `max-age` 1m, `s-maxage` 5m, étiqueté avec les ressources de son chemin), `no-store` ; refusé sur une écriture, et `public` derrière un groupe de routes |
844
- | `file-upload` | `<context> <UseCaseName> --path <p> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--method POST\|PUT] [--group <Name>] [--module <module>]` | un téléversement : un contrôleur qui déclare le fichier qu'il reçoit (sa taille et ses types de média dans le contrat, vérifiés au fil du flux), la commande qui le porte comme un `FileUpload`, mis en attente par le bus de commandes avant la transaction, le gestionnaire qui l'enregistre et le promeut avec la validation (commit), et leurs *specs*. Refusé sans `stack.storage` ou sans *stack* HTTP, avec le `init --force --storage local` à lancer |
844
+ | `file-upload` | `<context> <UseCaseName> --path <p> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--method POST\|PUT] [--group <Name>] [--text utf-8\|single-byte] [--module <module>]` | un téléversement : un contrôleur qui déclare le fichier qu'il reçoit (sa taille et ses types de média dans le contrat, vérifiés au fil du flux ; avec `--text`, un fichier texte tel qu'un CSV sous les noms que les navigateurs lui donnent, `single-byte` quand il peut être en Windows-1252 aussi bien qu'en UTF-8, et une *spec* qui en envoie un à travers le lecteur multipart), la commande qui le porte comme un `FileUpload`, mis en attente par le bus de commandes avant la transaction, le gestionnaire qui l'enregistre et le promeut avec la validation (commit), et leurs *specs*. Refusé sans `stack.storage` ou sans *stack* HTTP, avec le `init --force --storage local` à lancer |
845
845
  | `route-group` (`group`) | `<context> <Name> [--prefix <path>] [--group <ParentName>] [--public \| --role <role>]` | `presentation/http/<name>.routes.ts` : une classe vide qui porte `@RouteGroup`, derrière `Authenticated` sauf si `--public` ou `--role` dit autre chose (`HasRole(Role.Admin)`, le rôle lu dans le vocabulaire de la plateforme, `<platformDir>/auth/authorization/role.ts`, qui le reçoit s'il ne le contient pas) ; avec `--group`, il affine ce groupe et en hérite |
846
846
  | `guard` | `<context> <Name>` | `presentation/http/guards/<name>.guard.ts` : une classe de garde déclarée à remplir, et sa *spec* |
847
847
  | `representation` | `<context> <UseCase> <xml\|csv\|media/type>[,...] [--module <module>]` | après `generate route` du cas d'usage (un contrôleur sous `"stack.routes": "controllers"` ou `"nest"`) ou `generate controller` : ajoute `produces` au `@Controller` du cas d'usage, et `consumes: ['application/xml']` à celui qui reçoit un corps quand XML est demandé ; dit quand CSV a besoin d'une page ou d'une liste en flux, et quand `stack.representations` n'est pas `negotiated` |
@@ -2166,6 +2166,22 @@ une ligne de ponctuation perdue, ni un changement de sens, et un clone superfici
2166
2166
  *commits* qu'elle lit : en CI il lui faut `fetch-depth: 0`, c'est pourquoi les *pipelines*
2167
2167
  d'`init` ne la lancent pas.
2168
2168
 
2169
+ **Les migrations de la branche face au tronc.** Sans `<commit>`, elle lit ensuite les migrations
2170
+ de l'arbre de travail face au même tronc, avec les quatre ORM : une migration que la branche
2171
+ ajoute et dont le nom se trie avant la dernière migration du tronc (knex, Prisma, TypeORM), une
2172
+ entrée que la branche ajoute au journal de drizzle-kit et dont le `when` n'est pas après la
2173
+ dernière entrée de celui du tronc, et un fichier `.sql` que ce journal ne liste pas et que le
2174
+ tronc ne contient pas. Ce qui est ordonné est ce que l'outil prend pour une migration, selon ce
2175
+ par quoi il l'ordonne : chaque script du dossier de knex et les dossiers de Prisma qui
2176
+ contiennent un `migration.sql`, par leur nom ; les classes de TypeORM dont le nom se termine par
2177
+ 13 chiffres, par ce nombre. Chacune est
2178
+ une erreur qui nomme la migration, la dernière du tronc et la commande qui remet l'ordre
2179
+ (`merge-trunk` sous drizzle-kit, ou le `meta/` du tronc puis `drizzle-generate --replay` une fois
2180
+ le tronc fusionné ; `merge-trunk --to-land` ailleurs), et `--warn` ne l'adoucit pas : code de
2181
+ sortie 1. Une migration de travail (`working-<what-it-does>`) est laissée de côté. Dans
2182
+ `--json` : `migrations`, chacune `{ kind, migration, file, trunkLast, text, fix }` avec `kind`
2183
+ `before-trunk` ou `not-in-journal`, comptées dans `errorCount`.
2184
+
2169
2185
 
2170
2186
  ## merge-trunk
2171
2187
 
@@ -2261,6 +2277,18 @@ nécessaire pour une base que git ne calculerait pas ; un git plus ancien fusion
2261
2277
  `git merge` lui-même depuis `git merge-base` (`--since <merge base>`), et refuse `--dry-run`.
2262
2278
  Sortie 0 une fois commité, à jour ou en aperçu, 1 sur un arrêt, 2 quand il ne peut pas démarrer.
2263
2279
 
2280
+ Sur une branche qui contient déjà le tronc, il n'y a rien à fusionner. `--to-land` fait quand
2281
+ même atterrir ses migrations quand l'une est une migration de travail, se trie avant la dernière
2282
+ du tronc ou manque au journal de drizzle-kit : rejouées sous drizzle-kit, renommées après la
2283
+ dernière du tronc sous knex, Prisma et TypeORM, seulement celles qui ne suivent pas déjà celles du
2284
+ tronc et dans leur ordre (un arrêt, code de sortie 1, quand l'une d'elles et une migration plus
2285
+ récente du tronc nomment la même table : l'arrêt dit de la supprimer, puis de la générer de
2286
+ nouveau). Elles sont laissées à committer : aucun commit de fusion ne les porte. Un arrêt laisse
2287
+ le dossier des migrations comme il a été trouvé, donc la même commande se relance, et `--dry-run`
2288
+ dit quelles migrations bougeraient. Chaque renommage ou rejeu se termine par ce qu'il faut faire
2289
+ d'une base qui a déjà appliqué l'ancien nom : la réinitialiser, ou corriger sa table des
2290
+ migrations (la table de chaque outil est dans `docs/tools/persistence.fr.md`).
2291
+
2264
2292
  ```text
2265
2293
  merge-trunk build/billing-2 <- origin/main (d8d281b)
2266
2294
  base 6d8be4b: build/billing-1 landed as d8d281b "feat(billing): issue and cancel (#1)"
@@ -2516,9 +2544,9 @@ règle.
2516
2544
  | `clean/one-export-per-file` | sous la racine des sources, tests à part : plus d'une classe, interface ou fonction exportée que les tolérances n'expliquent pas (les types de la signature de l'export principal, un type et une valeur qui partagent un nom, un type avec ses constructeurs, les accesseurs d'un même état privé, `onePerFile.allow`) ; un fichier qui ne porte pas le nom de son export principal en kebab-case (`invoice.aggregate.ts` pour `Invoice`) ; un `index.ts` ou un `<context>.declarations.ts` qui contient autre chose que des réexports |
2517
2545
  | `clean/file-size` | un fichier de plus de 350 lignes, sources et tests ; un chemin avec un segment `generated` et les fichiers de déclaration sont exemptés |
2518
2546
  | `composition/only-in-module` | `new X`, ou `bind(..).toClass(X, ..)` et `rebind(..).toClass(X, ..)`, d'une classe importée de `infrastructure/`, hors du fichier de module, de `main.ts`, de la plateforme et des tests ; dans un fichier qui importe `@ddd-ts-kit/di`, un appel de `contextModule`, `discoverContext` ou `.include(` hors de ces endroits et de `apps/<context>/main.ts` |
2519
- | `imports/alias-only` | sous la racine des sources, `test/` et `scripts/` : un `import`, `export ... from` ou `import()` avec un spécificateur relatif, même répertoire compris (la correction nomme l'alias à écrire ; `eslint --fix` l'écrit) ; un spécificateur d'alias avec un segment `.` ou `..` |
2547
+ | `imports/alias-only` | sous la racine des sources, `test/` et `scripts/` : un `import`, `export ... from` ou `import()` avec un spécificateur relatif, même répertoire compris (la correction nomme l'alias à écrire ; `eslint --fix` l'écrit), sauf `./<nom>` entre deux fichiers placés directement sous `test/support/`, qu'un lanceur de tests charge avant qu'aucun alias n'existe ; ce `./<nom>` quand la source présente sur le disque porte un autre nom (une source `.ts` nommée avec une extension sous `none` ; sous `js`, `./x` ou `./x.js` pour `x.ts`, `./x.mjs` pour `x.mts`, `./x.cjs` pour `x.cts`), nomme `.` ou `..`, ou nomme un répertoire ; un spécificateur d'alias avec un segment `.` ou `..` |
2520
2548
  | `imports/extension` | sous la racine des sources, `test/` et `scripts/` : avec `importExtension` `none`, un spécificateur d'alias qui se termine par `.js`, `.mjs`, `.cjs`, `.ts`, `.mts` ou `.cts` ; avec `js` (ou sans clé), un spécificateur d'alias qui ne se termine pas par `.js` (la correction nomme le spécificateur à écrire ; `eslint --fix` l'écrit). Un sous-chemin de *package* n'est jamais jugé |
2521
- | `imports/alias-declared` | un `importAlias` qui n'est pas `@/` ou `$<name>/`, ou qui est `$test/`, `$scripts/`, `$generated/` ; une entrée `paths` de `tsconfig.json` manquante ou différente de ce que donne `importAlias` (la correction donne l'entrée) ; une autre entrée `paths` sous un alias ; un `baseUrl` ; un `tsconfig.build.json` dont les `paths` diffèrent ; des `paths` de `knip.json` qui associent un alias ; un script qui compile (`tsc` sans `--noEmit`) et ne lance pas `ddd-ts-kit build-aliases` ensuite ; un script qui lance `tsx --tsconfig` sur un autre fichier ; une configuration `vitest` à la racine sans `tsconfigPaths: true`, une configuration `jest` sans les entrées `moduleNameMapper` dérivées, ou `.dependency-cruiser.cjs` sans `tsConfig` ; un `module` et un `moduleResolution` de `tsconfig.json` (ou d'un `tsconfig.build.json` qui pose les siens) qui ne sont pas ce que donne `importExtension` : `ESNext`, `Bundler` et `customConditions` contenant `node` sous `none`, et sous `js` une valeur écrite qui n'est pas une résolution Node ; une association jest dont le motif ne se termine pas comme les imports. Un projet sans `package.json` n'est pas jugé |
2549
+ | `imports/alias-declared` | un `importAlias` qui n'est pas `@/` ou `$<name>/`, ou qui est `$test/`, `$scripts/`, `$generated/` ; une entrée `paths` de `tsconfig.json` manquante ou différente de ce que donne `importAlias` (la correction donne l'entrée) ; une autre entrée `paths` sous un alias ; un `baseUrl` ; un `tsconfig.build.json` dont les `paths` diffèrent ; des `paths` de `knip.json` qui associent un alias ; un script qui compile (`tsc` sans `--noEmit`) et ne lance pas `ddd-ts-kit build-aliases` ensuite ; un script qui lance `tsx --tsconfig` sur un autre fichier ; une configuration `vitest` à la racine sans `tsconfigPaths: true`, une configuration `jest` sans les entrées `moduleNameMapper` dérivées, ou `.dependency-cruiser.cjs` sans `tsConfig` ; un `module` et un `moduleResolution` de `tsconfig.json` (ou d'un `tsconfig.build.json` qui pose les siens) qui ne sont pas ce que donne `importExtension` : `ESNext`, `Bundler` et `customConditions` contenant `node` sous `none`, et sous `js` une valeur écrite qui n'est pas une résolution Node ; une association jest dont le motif ne se termine pas comme les imports ; sous `js`, un fichier placé directement sous `test/support/` qui importe un voisin par son `.ts` alors que `tsconfig.json` ne fixe ni `allowImportingTsExtensions` ni `rewriteRelativeImportExtensions` ; quelle que soit la terminaison, un `tsconfig.build.json`, ou un tsconfig qu'un script compile pour ce qui est livré, qui résout `noEmit` à `true`, ou `allowImportingTsExtensions` à `true` sans `rewriteRelativeImportExtensions` ni `emitDeclarationOnly`. Un projet sans `package.json` n'est pas jugé |
2522
2550
  | `config/valid` | un amont, une classification, une relation, un identifiant de règle, un mode de `guard` ou un `importExtension` inconnu ; un répertoire de la configuration qui sort du projet ; un contexte absent du disque ou de la configuration ; une limite de `commit` qui n'est pas un entier positif |
2523
2551
  | `config/suppression-needs-reason` | une désactivation sans identifiant de règle ou sans raison (gardée comme alias à côté de `governance/recorded-deviation`, qui juge la raison) |
2524
2552
  | `authz/declared` | dans un fichier de module, `builder.command(X)` ou `builder.query(X)` sans `.requires(` ni `.public(` dans sa chaîne, sauf si la classe du message porte `@Requires` ou `@Public` de `@ddd-ts-kit/kernel/declarations` ; en câblage manuel ou nest, une classe de commande ou de requête absente de tous les `requires(X, ...)` et `publicUseCase(X)` du fichier de module et de `application/authorization/` ; un `defineRoute` sans `security` (le type de la route le refuse déjà, et une liste vide aussi : c'est le filet au niveau du texte pour une définition construite de façon lâche) ; dans le style déclaré, la classe exportée d'un fichier `*.command.ts` ou `*.query.ts` qui ne porte ni `@Requires` ni `@Public` |
@@ -2535,6 +2563,7 @@ règle.
2535
2563
  | `authz/actor-explicit` | dans `domain/` et `application/` : `ActorContext`, `ExecutionScope` (comme type ou comme valeur : la classe est le jeton d'une liste de dépendances), `AsyncLocalStorageExecutionScope`, `ScopedActorContext`, `AsyncLocalStorage` ; `.current()` ou `.require()` sur un contexte d'acteur ou sur quelque chose nommé `scope`, `scopes` ou `...executionScope` ; un import de `stampCreation`, `stampUpdate` ou `tenantScopeOf` |
2536
2564
  | `authz/fields-by-schema` | sous `application/queries/` : `roles.includes(`, `.some(`, `.every(`, `.find(`, `.indexOf(`, une comparaison avec un `role`, `isAdmin` |
2537
2565
  | `aspects/outside-in` | un import de `@ddd-ts-kit/aspects/decorators` hors de `infrastructure/` d'un contexte et du répertoire de la plateforme : `presentation/`, le fichier de module, `published-language/`, le noyau partagé, `main.ts`, toute autre source (`domain/` et `application/` sont signalés par les deux règles `layer/*` à la place) |
2566
+ | `aspects/timeout-covers-delegate` | un adaptateur déclaré avec `@Adapter` ou `@Gateway`, ou lié par `bind(Port).toClass(Adapter)` dans un fichier qui importe `@ddd-ts-kit/di`, qui s'exécute sous la seule politique par défaut et dont le constructeur a un paramètre typé par un port dont l'adaptateur déclare un délai plus long. Sous la seule politique par défaut : le genre `external` ou `gateway` (le littéral de `kind:` ou de `.as(` ; `external` pour un `@Adapter` sans `kind`, aucun pour une liaison sans `.as(`), aucun `ownPolicy(...)` et aucun `timeout(...)` parmi les éléments de `aspects: [...]` ou les arguments de `.with(...)`. Le délai par défaut : le `fallback: <nombre>` écrit après la chaîne `'OUTBOUND_TIMEOUT_MS'`, premier argument d'un appel, dans un seul fichier du répertoire de la plateforme, sinon le `timeoutMs: <nombre>` de `<platform>/resilience/default-resilience-settings.ts`. Le délai derrière le port : le plus petit `timeout(<nombre>)` qui est un élément de ses aspects ou un argument de son `ownPolicy(...)`, quand il a un `ownPolicy(...)` ou un genre que la politique par défaut laisse de côté. La classe d'une liaison est celle que le fichier de la liaison déclare ou importe sous ce nom, sinon la seule classe de ce nom. Muette sur : une plateforme câblée à la main (`platform.adapter(...)`) ; une durée ou un genre qui n'est pas un littéral ; un aspect qui est une variable, une décomposition, un appel d'un autre nom ou sous `when(...)` ; un `timeout(` imbriqué dans les options d'un autre aspect ; un `@Timeout` sur une méthode ; un port ou un adaptateur lié plus d'une fois, lié de nouveau par `rebind(`, ou lié sous une condition ; un paramètre typé par un nom que l'adaptateur n'importe pas d'un fichier du projet (un type d'un paquet, une déclaration de son propre fichier) ; deux ports du même nom, sauf si chaque fichier importe le sien depuis le fichier qui le déclare ; un adaptateur atteint à travers un adaptateur intermédiaire ; un délai par défaut qui n'est pas un seul nombre, ou un environnement qui fixe `OUTBOUND_TIMEOUT_MS` ; les nouvelles tentatives |
2538
2567
  | `tracing/platform-only` | un import de `@ddd-ts-kit/tracing` ou d'un *package* `@opentelemetry/*` hors du répertoire de la plateforme, de `main.ts` et de `apps/`, tests compris |
2539
2568
  | `nest/no-parallel-pipeline` | dans `presentation/`, `infrastructure/` ou le fichier de module d'un contexte, tests à part : un import d'un contrôleur que Nest sert (ses décorateurs de route et de paramètres, sauf si le fichier importe `KitRoute` ou `KitRoutes` de `@ddd-ts-kit/http/nest`), de la requête ou de la réponse brutes, d'un *guard*, d'un *pipe*, d'un filtre d'exceptions ou d'une `HttpException`, d'un intercepteur ou du `Logger` de `@nestjs/common`, un import sans nom de celui-ci, ou un import d'un *package* de Nest dont le kit fait le travail (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` et les autres de la section 3 d'ARCHITECTURE.md) ; le message dit ce que le kit fait à sa place ; sous la racine des sources hors des contextes, tests à part : un fichier qui importe `Controller` de `@nestjs/common`, ni `KitRoute` ni `KitRoutes`, et nomme `CommandBus` ou `QueryBus` ou importe un fichier d'un contexte |
2540
2569
  | `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une partie de la requête prise entière par aucune classe DTO et que `request` de `@KitRoute` ne donne pas ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
package/README.md CHANGED
@@ -616,12 +616,12 @@ config, `docsUi`, `ci` and `logger` included.
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
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) |
618
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` |
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, each call then on a copy of the migrated database, made and dropped by `test/support/test-database-clone.ts`; 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
+ | `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, each call then on a copy of the migrated database, made and dropped by `test/support/test-database-clone.ts`; 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), `read-model-tables.ts` (the list of the read models kept in a table, between markers `generate read-model` fills, `init` fills from the stores of the tree and `init --force` keeps, each entry the context of a read model and the class of its store; `readModelTables(persistence, contexts)` has each table of those contexts read by its own store, so with the verdict of that store; an application calls it when it starts, for the contexts it hosts (a context run as a service checks its own tables, on its database), and refuses to start on a listed table that cannot hold the trace of a deleted row, named with its migration, or that it could not read, unless `composeApplication` is given `readModelTables: 'reported'`; `scripts/read-model-tables.ts`, `npm run db:read-models`, asks it of the database `DATABASE_URL` names before a deployment, of every context or of those `-- --context <name>` names, needs no other variable, prints the database it read, and exits 1 when a table is not ready, 2 without a database to read, 3 when no table could be read, 4 when `--context` names a context no listed read model belongs to; an entry names a context of `Contexts`, which `generate context` fills, or does not compile, and a store left out on purpose is a comment of the list that holds `<context>: <Store>`). 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` |
620
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 |
621
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 |
622
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` |
623
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 |
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, then on a copy of that migrated database, one per spec file, so the files run at the same time on a server too; 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
+ | `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, then on a database per spec file, the tables of that migrated one, emptied but for those `test/support/test-database-kept.ts` lists, so the files run at the same time on a server too; `test/support/test-database-setup.ts`, a global setup of the run, copies and empties the migrated database once, shares the connections the server has left between the files that run at once and drops what a killed run left (`test/support/test-database-*.ts`); 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) |
625
625
  | `docs/context-map.md`, `docs/integration/README.md` | see `docs` |
626
626
  | `test/architecture/extractable.spec.ts` | written with the first context: boots each context alone on the kernel and the platform, its jobs included |
627
627
  | `eslint.config.mjs` | the `dddTsKit` preset of `@ddd-ts-kit/eslint-plugin`, typed linting on the project's tsconfig |
@@ -804,7 +804,7 @@ Next, in this order: the language of the context first, then the business decisi
804
804
  | `port` | `<context> <Name> [--module <module>]` | `application/ports/<name>.port.ts`, one abstract class, and its fake |
805
805
  | `route` | `<context> <UseCaseName> --method <GET\|POST\|PUT\|PATCH\|DELETE> --path <p> [--command\|--query] [--group <Name>] [--mapper] [--serializer] [--cache public\|private\|no-store] [--module <module>]` | under `"stack.routes": "controllers"`: a controller class in `presentation/http/<resource>/<use-case>/` (the resource is the first segment of the path), depending on `CommandBus` or `QueryBus`, behind the route group of its resource, written with it when it is new (`<resource>.routes.ts`: prefix, tag, `Authenticated`); a public use case stands in no group and says `guards: [Public]`; with class-validator one class per file (`<use-case>.params.ts`, `.body.ts`, `.answer.ts`, `.accepted.ts`, `.line.ts`); `--mapper` and `--serializer` add a request mapper and a serializer the controller is given; a spec; no registration in a declared project, a controller built by hand in `<context>.routes.ts` (the module file with hand wiring) in an explicit one. Under `"functions"`: a `defineRoute` function, its spec, its registration in `<context>.routes.ts`, and `<use-case>-<role>.dto.ts` classes |
806
806
  | `controller` | the same arguments as `route` | the controller class, whatever `stack.routes` says: for a project of function routes that writes its next route as a class. `--cache` writes its cache policy: `private` (a `GET` of a caller, `max-age=0`, `must-revalidate`, strong `ETag`), `public` (a `GET` of a public use case, `max-age` 1m, `s-maxage` 5m, tagged with the resources of its path), `no-store`; refused on a write, and `public` behind a route group |
807
- | `file-upload` | `<context> <UseCaseName> --path <p> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--method POST\|PUT] [--group <Name>] [--module <module>]` | an upload: a controller that declares the file it receives (its size and media types in the contract, checked as it streams), the command that carries it as a `FileUpload`, staged by the command bus before the transaction, the handler that records it and promotes it with the commit, and their specs. Refused without `stack.storage` or without an HTTP stack, with the `init --force --storage local` to run |
807
+ | `file-upload` | `<context> <UseCaseName> --path <p> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--method POST\|PUT] [--group <Name>] [--text utf-8\|single-byte] [--module <module>]` | an upload: a controller that declares the file it receives (its size and media types in the contract, checked as it streams; with `--text` a text file such as a CSV under the names browsers give one, `single-byte` when it may be in Windows-1252 as well as UTF-8, and a spec that sends one through the multipart reader), the command that carries it as a `FileUpload`, staged by the command bus before the transaction, the handler that records it and promotes it with the commit, and their specs. Refused without `stack.storage` or without an HTTP stack, with the `init --force --storage local` to run |
808
808
  | `route-group` (`group`) | `<context> <Name> [--prefix <path>] [--group <ParentName>] [--public \| --role <role>]` | `presentation/http/<name>.routes.ts`: an empty class carrying `@RouteGroup`, behind `Authenticated` unless `--public` or `--role` says otherwise (`HasRole(Role.Admin)`, the role read from the vocabulary of the platform, `<platformDir>/auth/authorization/role.ts`, which gets it when it does not hold it); with `--group` it refines that group and inherits from it |
809
809
  | `guard` | `<context> <Name>` | `presentation/http/guards/<name>.guard.ts`: a declared guard class to fill, and its spec |
810
810
  | `representation` | `<context> <UseCase> <xml\|csv\|media/type>[,...] [--module <module>]` | after `generate route` of the use case (a controller under `"stack.routes": "controllers"` or `"nest"`) or `generate controller`: adds `produces` to the `@Controller` of the use case, and `consumes: ['application/xml']` to one that receives a body when XML is asked; says when CSV needs a page or a streamed list, and when `stack.representations` is not `negotiated` |
@@ -2028,6 +2028,21 @@ two places, a lost line of punctuation or a change of meaning, and a shallow clo
2028
2028
  commits it reads: in CI it needs `fetch-depth: 0`, which is why the pipelines of `init` do not
2029
2029
  run it.
2030
2030
 
2031
+ **The migrations of the branch against the trunk.** Without a `<commit>`, it then reads the
2032
+ migrations of the working tree against the same trunk, on the four ORM: a migration the branch
2033
+ adds whose name sorts before the last migration of the trunk (knex, Prisma, TypeORM), an entry
2034
+ the branch adds to the journal of drizzle-kit whose `when` is not after the last entry of the
2035
+ trunk's, and a `.sql` file that journal does not list and the trunk does not hold. What is
2036
+ ordered is what the tool takes for a migration, by what it orders it by: every script of the
2037
+ folder of knex and the folders of Prisma that hold a `migration.sql`, by their name; the classes
2038
+ of TypeORM whose name ends with 13 digits, by that number. Each is an error that names the migration,
2039
+ the last one of the trunk and the command that brings the order right (`merge-trunk` under
2040
+ drizzle-kit, or the `meta/` of the trunk then `drizzle-generate --replay` once the trunk is
2041
+ merged; `merge-trunk --to-land` elsewhere), and `--warn` does not soften it: exit 1. A working
2042
+ migration (`working-<what-it-does>`) is left out. In `--json`: `migrations`, each
2043
+ `{ kind, migration, file, trunkLast, text, fix }` with `kind` `before-trunk` or `not-in-journal`,
2044
+ counted in `errorCount`.
2045
+
2031
2046
  ## merge-trunk
2032
2047
 
2033
2048
  ```
@@ -2110,6 +2125,17 @@ for a base git would not compute; an older git merges with `git merge` itself fr
2110
2125
  `git merge-base` (`--since <merge base>`), and refuses `--dry-run`. Exit 0 once committed, up to
2111
2126
  date or previewed, 1 on a stop, 2 when it cannot start.
2112
2127
 
2128
+ On a branch that already holds the trunk there is nothing to merge. `--to-land` still lands its
2129
+ migrations when one is a working one, sorts before the last of the trunk or is out of the journal
2130
+ of drizzle-kit: replayed under drizzle-kit, renamed after the last of the trunk under knex, Prisma
2131
+ and TypeORM, only those that do not follow the trunk's already and in their order (a stop, exit
2132
+ 1, when one of them and a later migration of the trunk name the same table: the stop says to
2133
+ delete it, then to generate it again). They are left to commit: no merge commit carries them. A
2134
+ stop leaves the migrations folder as it was found, so the same command runs again, and
2135
+ `--dry-run` says which migrations would move. Each rename or replay ends with what to do with a
2136
+ database that already applied the old name: reset it, or correct its migration table (the table
2137
+ of each tool is in `docs/tools/persistence.md`).
2138
+
2113
2139
  ```text
2114
2140
  merge-trunk build/billing-2 <- origin/main (d8d281b)
2115
2141
  base 6d8be4b: build/billing-1 landed as d8d281b "feat(billing): issue and cancel (#1)"
@@ -2351,9 +2377,9 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2351
2377
  | `clean/one-export-per-file` | under the source root, tests apart: more than one exported class, interface or function that the allowances do not explain (the types of the signature of the main export, a type and a value sharing one name, a type with its constructors, the accessors of one private state, `onePerFile.allow`); a file not named after its main export in kebab-case (`invoice.aggregate.ts` for `Invoice`); an `index.ts` or a `<context>.declarations.ts` that holds anything but re-exports |
2352
2378
  | `clean/file-size` | a file of more than 350 lines, sources and tests; a path with a segment `generated` and declaration files are exempt |
2353
2379
  | `composition/only-in-module` | `new X`, or `bind(..).toClass(X, ..)` and `rebind(..).toClass(X, ..)`, of a class imported from `infrastructure/`, outside the module file, `main.ts`, the platform and tests; in a file importing `@ddd-ts-kit/di`, a call of `contextModule`, `discoverContext` or `.include(` outside those places and `apps/<context>/main.ts` |
2354
- | `imports/alias-only` | under the source root, `test/` and `scripts/`: an `import`, `export ... from` or `import()` with a relative specifier, the same directory included (the fix names the alias to write; `eslint --fix` writes it); an alias specifier with a `.` or `..` segment |
2380
+ | `imports/alias-only` | under the source root, `test/` and `scripts/`: an `import`, `export ... from` or `import()` with a relative specifier, the same directory included (the fix names the alias to write; `eslint --fix` writes it), but `./<name>` between two files directly under `test/support/`, which a test runner loads before any alias exists; that `./<name>` when the source on disk has another name (a `.ts` source named with an extension under `none`; under `js`, `./x` or `./x.js` for `x.ts`, `./x.mjs` for `x.mts`, `./x.cjs` for `x.cts`), names `.` or `..`, or names a directory; an alias specifier with a `.` or `..` segment |
2355
2381
  | `imports/extension` | under the source root, `test/` and `scripts/`: with `importExtension` `none`, an alias specifier that ends with `.js`, `.mjs`, `.cjs`, `.ts`, `.mts` or `.cts`; with `js` (or no key), an alias specifier that does not end with `.js` (the fix names the specifier to write; `eslint --fix` writes it). A package subpath is never judged |
2356
- | `imports/alias-declared` | an `importAlias` that is not `@/` or `$<name>/`, or that is `$test/`, `$scripts/`, `$generated/`; a `paths` entry of `tsconfig.json` missing or different from what `importAlias` gives (the fix gives the entry); another `paths` entry under an alias; a `baseUrl`; a `tsconfig.build.json` whose `paths` differ; `paths` of `knip.json` mapping an alias; a script that compiles (`tsc` without `--noEmit`) and does not run `ddd-ts-kit build-aliases` afterwards; a script running `tsx --tsconfig` on another file; a `vitest` config at the root without `tsconfigPaths: true`, a `jest` config without the derived `moduleNameMapper` entries, or `.dependency-cruiser.cjs` without `tsConfig`; `module` and `moduleResolution` of `tsconfig.json` (or of a `tsconfig.build.json` that sets its own) that are not what `importExtension` gives: `ESNext`, `Bundler` and `customConditions` holding `node` under `none`, and under `js` a written value that is not a Node resolution; a jest mapping whose pattern does not end as the imports do. A project without `package.json` is not judged |
2382
+ | `imports/alias-declared` | an `importAlias` that is not `@/` or `$<name>/`, or that is `$test/`, `$scripts/`, `$generated/`; a `paths` entry of `tsconfig.json` missing or different from what `importAlias` gives (the fix gives the entry); another `paths` entry under an alias; a `baseUrl`; a `tsconfig.build.json` whose `paths` differ; `paths` of `knip.json` mapping an alias; a script that compiles (`tsc` without `--noEmit`) and does not run `ddd-ts-kit build-aliases` afterwards; a script running `tsx --tsconfig` on another file; a `vitest` config at the root without `tsconfigPaths: true`, a `jest` config without the derived `moduleNameMapper` entries, or `.dependency-cruiser.cjs` without `tsConfig`; `module` and `moduleResolution` of `tsconfig.json` (or of a `tsconfig.build.json` that sets its own) that are not what `importExtension` gives: `ESNext`, `Bundler` and `customConditions` holding `node` under `none`, and under `js` a written value that is not a Node resolution; a jest mapping whose pattern does not end as the imports do; under `js`, a file directly under `test/support/` that imports a neighbour by its `.ts` while `tsconfig.json` sets neither `allowImportingTsExtensions` nor `rewriteRelativeImportExtensions`; whatever the ending, a `tsconfig.build.json`, or a tsconfig a script compiles what ships with, that resolves `noEmit` as `true`, or `allowImportingTsExtensions` as `true` without `rewriteRelativeImportExtensions` or `emitDeclarationOnly`. A project without `package.json` is not judged |
2357
2383
  | `config/valid` | unknown upstream, classification, relationship, rule id, `guard` mode or `importExtension`; a directory of the config that leads out of the project; a context missing on disk or in the config; a `commit` limit that is not a positive integer |
2358
2384
  | `config/suppression-needs-reason` | a suppression without a rule id or a reason (kept as an alias next to `governance/recorded-deviation`, which judges the reason) |
2359
2385
  | `authz/declared` | in a module file, `builder.command(X)` or `builder.query(X)` without `.requires(` or `.public(` in its chain, unless the message class carries `@Requires` or `@Public` of `@ddd-ts-kit/kernel/declarations`; with manual or nest wiring, a command or query class absent from every `requires(X, ...)` and `publicUseCase(X)` of the module file and of `application/authorization/`; a `defineRoute` without `security` (the route type refuses it already, and an empty list too: this is the text-level net for a definition built loosely); in the declared style, the exported class of a `*.command.ts` or `*.query.ts` file carrying neither `@Requires` nor `@Public` |
@@ -2370,6 +2396,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2370
2396
  | `authz/actor-explicit` | in `domain/` and `application/`: `ActorContext`, `ExecutionScope` (as a type or as a value: the class is the token of a dependency list), `AsyncLocalStorageExecutionScope`, `ScopedActorContext`, `AsyncLocalStorage`; `.current()` or `.require()` on an actor context or on something named `scope`, `scopes` or `...executionScope`; an import of `stampCreation`, `stampUpdate` or `tenantScopeOf` |
2371
2397
  | `authz/fields-by-schema` | under `application/queries/`: `roles.includes(`, `.some(`, `.every(`, `.find(`, `.indexOf(`, a comparison with a `role`, `isAdmin` |
2372
2398
  | `aspects/outside-in` | an import of `@ddd-ts-kit/aspects/decorators` outside `infrastructure/` of a context and the platform directory: `presentation/`, the module file, `published-language/`, the shared kernel, `main.ts`, any other source (`domain/` and `application/` are reported by the two `layer/*` rules instead) |
2399
+ | `aspects/timeout-covers-delegate` | an adapter declared with `@Adapter` or `@Gateway`, or bound by `bind(Port).toClass(Adapter)` in a file that imports `@ddd-ts-kit/di`, that runs under the default policy alone and whose constructor has a parameter typed by a port whose adapter states a longer limit. Under the default policy alone: the kind `external` or `gateway` (the literal of `kind:` or of `.as(`; `external` for an `@Adapter` without `kind`, none for a binding without `.as(`), no `ownPolicy(...)` and no `timeout(...)` among the elements of `aspects: [...]` or the arguments of `.with(...)`. The default limit: the `fallback: <number>` written after the string `'OUTBOUND_TIMEOUT_MS'`, the first argument of a call, in one file of the platform directory, else `timeoutMs: <number>` of `<platform>/resilience/default-resilience-settings.ts`. The limit behind the port: the smallest `timeout(<number>)` that is an element of its aspects or an argument of its `ownPolicy(...)`, when it has `ownPolicy(...)` or a kind the default leaves alone. The class of a binding is the one the binding file declares or imports by that name, else the only class of that name. Silent on: a platform wired by hand (`platform.adapter(...)`); a duration or a kind that is not a literal; an aspect that is a variable, a spread, a call of another name or under `when(...)`; a `timeout(` nested in the options of another aspect; a `@Timeout` on a method; a port or an adapter bound more than once, bound again by `rebind(`, or bound under a condition; a parameter typed by a name the adapter does not import from a file of the project (a type of a package, a declaration of its own file); two ports of one name unless each file imports its own from the file that declares it; an adapter reached through a middle adapter; a default limit that is not one number, or an environment that sets `OUTBOUND_TIMEOUT_MS`; the retries |
2373
2400
  | `tracing/platform-only` | an import of `@ddd-ts-kit/tracing` or of an `@opentelemetry/*` package outside the platform directory, `main.ts` and `apps/`, tests included |
2374
2401
  | `nest/no-parallel-pipeline` | in `presentation/`, `infrastructure/` or the module file of a context, tests apart: an import of a controller Nest serves (its route and parameter decorators, unless the file imports `KitRoute` or `KitRoutes` of `@ddd-ts-kit/http/nest`), the raw request or answer, a guard, a pipe, an exception filter or an `HttpException`, an interceptor or the `Logger` of `@nestjs/common`, a bare import of it, or an import of a package of Nest whose work the kit does (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` and the others of section 3 of ARCHITECTURE.md); the message names what the kit does in its place; under the source root outside the contexts, tests apart: a file that imports `Controller` of `@nestjs/common`, neither `KitRoute` nor `KitRoutes`, and names `CommandBus` or `QueryBus` or imports a file of a context |
2375
2402
  | `nest/controllers-current` | with `"stack.routes": "nest"`: a `<context>.controllers.ts` that differs from what the Nest controllers of the context and the signatures of their methods give, or is missing; a part of the request taken whole by no DTO class that `request` of `@KitRoute` does not give; a route method that answers no DTO class, `Accepted` or `void` and declares no `response` in `@KitRoute` |
@@ -10,6 +10,8 @@ export { directoryAlias } from './directory-alias.js';
10
10
  export { FIXED_ALIAS_ROOTS } from './fixed-alias-roots.js';
11
11
  export { moduleNameMapper, type MapperTarget } from './module-name-mapper.js';
12
12
  export { mapperTargetText } from './mapper-target-text.js';
13
+ export { NEIGHBOUR_SOURCES } from './neighbour-sources.js';
14
+ export { neighbourSuffix } from './neighbour-suffix.js';
13
15
  export { specifierOf } from './specifier-of.js';
14
16
  export { specifierSuffix } from './specifier-suffix.js';
15
17
  export { toAlias } from './to-alias.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -8,6 +8,8 @@ export { directoryAlias } from './directory-alias.js';
8
8
  export { FIXED_ALIAS_ROOTS } from './fixed-alias-roots.js';
9
9
  export { moduleNameMapper } from './module-name-mapper.js';
10
10
  export { mapperTargetText } from './mapper-target-text.js';
11
+ export { NEIGHBOUR_SOURCES } from './neighbour-sources.js';
12
+ export { neighbourSuffix } from './neighbour-suffix.js';
11
13
  export { specifierOf } from './specifier-of.js';
12
14
  export { specifierSuffix } from './specifier-suffix.js';
13
15
  export { toAlias } from './to-alias.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * What lets the compiler read an import that ends with `.ts`, which the files of `test/support/`
3
+ * write to their neighbours under "importExtension": "js". `allowImportingTsExtensions` is only
4
+ * accepted by a configuration that emits nothing: the type check takes both, and the build sets
5
+ * both back, so that it emits what it emitted without them.
6
+ */
7
+ export declare const NEIGHBOUR_SOURCES: {
8
+ readonly typeCheck: {
9
+ readonly allowImportingTsExtensions: true;
10
+ readonly noEmit: true;
11
+ };
12
+ readonly build: {
13
+ readonly allowImportingTsExtensions: false;
14
+ readonly noEmit: false;
15
+ };
16
+ };
17
+ //# sourceMappingURL=neighbour-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-sources.d.ts","sourceRoot":"","sources":["../../src/alias/neighbour-sources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;aAC5B,SAAS;iBAAI,0BAA0B;iBAAQ,MAAM;;aACrD,KAAK;iBAAI,0BAA0B;iBAAS,MAAM;;CAC1C,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What lets the compiler read an import that ends with `.ts`, which the files of `test/support/`
3
+ * write to their neighbours under "importExtension": "js". `allowImportingTsExtensions` is only
4
+ * accepted by a configuration that emits nothing: the type check takes both, and the build sets
5
+ * both back, so that it emits what it emitted without them.
6
+ */
7
+ export const NEIGHBOUR_SOURCES = {
8
+ typeCheck: { allowImportingTsExtensions: true, noEmit: true },
9
+ build: { allowImportingTsExtensions: false, noEmit: false },
10
+ };
11
+ //# sourceMappingURL=neighbour-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-sources.js","sourceRoot":"","sources":["../../src/alias/neighbour-sources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAC7D,KAAK,EAAE,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;CACnD,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * What the relative path of a file of `test/support/` to its neighbour ends with under
3
+ * "importExtension": nothing for `none`, the `.ts` of the source otherwise. A test runner loads its
4
+ * global setup, and what that file imports, from the sources and before any alias exists: a `.js`
5
+ * names a file that is not there.
6
+ */
7
+ export declare function neighbourSuffix(importExtension: string): '' | '.ts';
8
+ //# sourceMappingURL=neighbour-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-suffix.d.ts","sourceRoot":"","sources":["../../src/alias/neighbour-suffix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,EAAE,GAAG,KAAK,CAEnE"}