ddd-ts-kit 0.27.0 → 0.83.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (626) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/README.fr.md +186 -72
  3. package/README.md +177 -71
  4. package/dist/check/canonical/role.d.ts +2 -0
  5. package/dist/check/canonical/role.d.ts.map +1 -1
  6. package/dist/check/canonical/roles.js +1 -1
  7. package/dist/check/canonical/roles.js.map +1 -1
  8. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  9. package/dist/check/catalogue/architecture-rules.js +6 -0
  10. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  11. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  12. package/dist/check/catalogue/default-severities.js +2 -0
  13. package/dist/check/catalogue/default-severities.js.map +1 -1
  14. package/dist/check/catalogue/eslint-only-rules.js +3 -3
  15. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  16. package/dist/check/commands/check-command.d.ts.map +1 -1
  17. package/dist/check/commands/check-command.js +4 -1
  18. package/dist/check/commands/check-command.js.map +1 -1
  19. package/dist/check/commands/explain-command.d.ts.map +1 -1
  20. package/dist/check/commands/explain-command.js +2 -9
  21. package/dist/check/commands/explain-command.js.map +1 -1
  22. package/dist/check/engine/format-check.d.ts +6 -1
  23. package/dist/check/engine/format-check.d.ts.map +1 -1
  24. package/dist/check/engine/format-check.js +33 -11
  25. package/dist/check/engine/format-check.js.map +1 -1
  26. package/dist/check/errors/builds-through-factories.d.ts +4 -1
  27. package/dist/check/errors/builds-through-factories.d.ts.map +1 -1
  28. package/dist/check/errors/builds-through-factories.js +6 -2
  29. package/dist/check/errors/builds-through-factories.js.map +1 -1
  30. package/dist/check/errors/code-entry.d.ts +8 -0
  31. package/dist/check/errors/code-entry.d.ts.map +1 -0
  32. package/dist/check/errors/code-entry.js +2 -0
  33. package/dist/check/errors/code-entry.js.map +1 -0
  34. package/dist/check/errors/code-list-name.d.ts +3 -0
  35. package/dist/check/errors/code-list-name.d.ts.map +1 -0
  36. package/dist/check/errors/code-list-name.js +6 -0
  37. package/dist/check/errors/code-list-name.js.map +1 -0
  38. package/dist/check/errors/code-list.d.ts +10 -0
  39. package/dist/check/errors/code-list.d.ts.map +1 -0
  40. package/dist/check/errors/code-list.js +2 -0
  41. package/dist/check/errors/code-list.js.map +1 -0
  42. package/dist/check/errors/codes-set-in.d.ts +9 -0
  43. package/dist/check/errors/codes-set-in.d.ts.map +1 -0
  44. package/dist/check/errors/codes-set-in.js +15 -0
  45. package/dist/check/errors/codes-set-in.js.map +1 -0
  46. package/dist/check/errors/error-codes.d.ts +2 -0
  47. package/dist/check/errors/error-codes.d.ts.map +1 -1
  48. package/dist/check/errors/error-codes.js +8 -0
  49. package/dist/check/errors/error-codes.js.map +1 -1
  50. package/dist/check/errors/is-codes-file.d.ts +4 -0
  51. package/dist/check/errors/is-codes-file.d.ts.map +1 -0
  52. package/dist/check/errors/is-codes-file.js +11 -0
  53. package/dist/check/errors/is-codes-file.js.map +1 -0
  54. package/dist/check/errors/is-error-file.d.ts +4 -0
  55. package/dist/check/errors/is-error-file.d.ts.map +1 -0
  56. package/dist/check/errors/is-error-file.js +6 -0
  57. package/dist/check/errors/is-error-file.js.map +1 -0
  58. package/dist/check/errors/listed-codes.d.ts +5 -0
  59. package/dist/check/errors/listed-codes.d.ts.map +1 -0
  60. package/dist/check/errors/listed-codes.js +12 -0
  61. package/dist/check/errors/listed-codes.js.map +1 -0
  62. package/dist/check/errors/names-refusals.d.ts +4 -0
  63. package/dist/check/errors/names-refusals.d.ts.map +1 -0
  64. package/dist/check/errors/names-refusals.js +5 -0
  65. package/dist/check/errors/names-refusals.js.map +1 -0
  66. package/dist/check/errors/read-code-list.d.ts +5 -0
  67. package/dist/check/errors/read-code-list.d.ts.map +1 -0
  68. package/dist/check/errors/read-code-list.js +32 -0
  69. package/dist/check/errors/read-code-list.js.map +1 -0
  70. package/dist/check/errors/refusal-classes.d.ts +8 -0
  71. package/dist/check/errors/refusal-classes.d.ts.map +1 -0
  72. package/dist/check/errors/refusal-classes.js +9 -0
  73. package/dist/check/errors/refusal-classes.js.map +1 -0
  74. package/dist/check/event-sourcing/declared-shape.d.ts +7 -1
  75. package/dist/check/event-sourcing/declared-shape.d.ts.map +1 -1
  76. package/dist/check/event-sourcing/declared-shape.js +12 -4
  77. package/dist/check/event-sourcing/declared-shape.js.map +1 -1
  78. package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
  79. package/dist/check/event-sourcing/read-stored-shape.js +10 -2
  80. package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
  81. package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
  82. package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
  83. package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
  84. package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
  85. package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
  86. package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
  87. package/dist/check/explain/documented-rule.d.ts +8 -0
  88. package/dist/check/explain/documented-rule.d.ts.map +1 -0
  89. package/dist/check/explain/documented-rule.js +14 -0
  90. package/dist/check/explain/documented-rule.js.map +1 -0
  91. package/dist/check/explain/errors-docs.d.ts.map +1 -1
  92. package/dist/check/explain/errors-docs.js +30 -2
  93. package/dist/check/explain/errors-docs.js.map +1 -1
  94. package/dist/check/explain/explanations-of.d.ts +5 -0
  95. package/dist/check/explain/explanations-of.d.ts.map +1 -0
  96. package/dist/check/explain/explanations-of.js +16 -0
  97. package/dist/check/explain/explanations-of.js.map +1 -0
  98. package/dist/check/explain/language-docs.js +1 -1
  99. package/dist/check/explain/language-docs.js.map +1 -1
  100. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  101. package/dist/check/explain/persistence-docs.js +7 -0
  102. package/dist/check/explain/persistence-docs.js.map +1 -1
  103. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  104. package/dist/check/explain/wiring-docs.js +13 -0
  105. package/dist/check/explain/wiring-docs.js.map +1 -1
  106. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  107. package/dist/check/fixtures/authz-policy-fixtures.js +11 -0
  108. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  109. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  110. package/dist/check/fixtures/declarations-fixtures.js +78 -1
  111. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  112. package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -1
  113. package/dist/check/fixtures/errors-fixtures.js +1 -1
  114. package/dist/check/fixtures/errors-fixtures.js.map +1 -1
  115. package/dist/check/fixtures/errors-route.d.ts +3 -0
  116. package/dist/check/fixtures/errors-route.d.ts.map +1 -0
  117. package/dist/check/fixtures/errors-route.js +6 -0
  118. package/dist/check/fixtures/errors-route.js.map +1 -0
  119. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  120. package/dist/check/fixtures/fixtures.js +2 -0
  121. package/dist/check/fixtures/fixtures.js.map +1 -1
  122. package/dist/check/fixtures/named-refusal-fixtures.d.ts +4 -0
  123. package/dist/check/fixtures/named-refusal-fixtures.d.ts.map +1 -0
  124. package/dist/check/fixtures/named-refusal-fixtures.js +210 -0
  125. package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -0
  126. package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
  127. package/dist/check/fixtures/persistence-fixtures.js +25 -0
  128. package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
  129. package/dist/check/language/refusal-qualifiers.d.ts +8 -0
  130. package/dist/check/language/refusal-qualifiers.d.ts.map +1 -0
  131. package/dist/check/language/refusal-qualifiers.js +16 -0
  132. package/dist/check/language/refusal-qualifiers.js.map +1 -0
  133. package/dist/check/language/unknown-words.d.ts +2 -2
  134. package/dist/check/language/unknown-words.d.ts.map +1 -1
  135. package/dist/check/language/unknown-words.js +3 -2
  136. package/dist/check/language/unknown-words.js.map +1 -1
  137. package/dist/check/model/rule-explanation.d.ts +10 -0
  138. package/dist/check/model/rule-explanation.d.ts.map +1 -0
  139. package/dist/check/model/rule-explanation.js +2 -0
  140. package/dist/check/model/rule-explanation.js.map +1 -0
  141. package/dist/check/rules/authz-policy-asked.js +5 -2
  142. package/dist/check/rules/authz-policy-asked.js.map +1 -1
  143. package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
  144. package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
  145. package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
  146. package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
  147. package/dist/check/rules/errors-code-listed.d.ts +3 -0
  148. package/dist/check/rules/errors-code-listed.d.ts.map +1 -0
  149. package/dist/check/rules/errors-code-listed.js +160 -0
  150. package/dist/check/rules/errors-code-listed.js.map +1 -0
  151. package/dist/check/rules/errors-code-unique.d.ts.map +1 -1
  152. package/dist/check/rules/errors-code-unique.js +13 -8
  153. package/dist/check/rules/errors-code-unique.js.map +1 -1
  154. package/dist/check/rules/errors-known-code.d.ts.map +1 -1
  155. package/dist/check/rules/errors-known-code.js +17 -7
  156. package/dist/check/rules/errors-known-code.js.map +1 -1
  157. package/dist/check/rules/event-sourcing-upcaster-required.js +14 -4
  158. package/dist/check/rules/event-sourcing-upcaster-required.js.map +1 -1
  159. package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
  160. package/dist/check/rules/language-glossary-term.js +10 -3
  161. package/dist/check/rules/language-glossary-term.js.map +1 -1
  162. package/dist/check/rules/naming-suffix.js +1 -1
  163. package/dist/check/rules/naming-suffix.js.map +1 -1
  164. package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
  165. package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
  166. package/dist/check/rules/persistence-primary-key-order.js +31 -0
  167. package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
  168. package/dist/commands/docs.d.ts.map +1 -1
  169. package/dist/commands/docs.js +16 -7
  170. package/dist/commands/docs.js.map +1 -1
  171. package/dist/commands/doctor.d.ts +4 -1
  172. package/dist/commands/doctor.d.ts.map +1 -1
  173. package/dist/commands/doctor.js +20 -4
  174. package/dist/commands/doctor.js.map +1 -1
  175. package/dist/commands/error-factories.d.ts +4 -2
  176. package/dist/commands/error-factories.d.ts.map +1 -1
  177. package/dist/commands/error-factories.js +74 -17
  178. package/dist/commands/error-factories.js.map +1 -1
  179. package/dist/commands/lint.d.ts +7 -0
  180. package/dist/commands/lint.d.ts.map +1 -0
  181. package/dist/commands/lint.js +55 -0
  182. package/dist/commands/lint.js.map +1 -0
  183. package/dist/config/config.d.ts +2 -0
  184. package/dist/config/config.d.ts.map +1 -1
  185. package/dist/config/open-api-problems.js +7 -6
  186. package/dist/config/open-api-problems.js.map +1 -1
  187. package/dist/config/parse-config.d.ts.map +1 -1
  188. package/dist/config/parse-config.js +2 -0
  189. package/dist/config/parse-config.js.map +1 -1
  190. package/dist/config/restack-config-text.d.ts +3 -2
  191. package/dist/config/restack-config-text.d.ts.map +1 -1
  192. package/dist/config/restack-config-text.js +5 -3
  193. package/dist/config/restack-config-text.js.map +1 -1
  194. package/dist/config/serialize-config.d.ts.map +1 -1
  195. package/dist/config/serialize-config.js +2 -1
  196. package/dist/config/serialize-config.js.map +1 -1
  197. package/dist/config/stack.d.ts +9 -6
  198. package/dist/config/stack.d.ts.map +1 -1
  199. package/dist/config/stack.js +1 -1
  200. package/dist/config/stack.js.map +1 -1
  201. package/dist/describe/context-description.d.ts +7 -2
  202. package/dist/describe/context-description.d.ts.map +1 -1
  203. package/dist/describe/exposed-by.d.ts +7 -0
  204. package/dist/describe/exposed-by.d.ts.map +1 -0
  205. package/dist/describe/exposed-by.js +11 -0
  206. package/dist/describe/exposed-by.js.map +1 -0
  207. package/dist/describe/read-errors.d.ts +3 -1
  208. package/dist/describe/read-errors.d.ts.map +1 -1
  209. package/dist/describe/read-errors.js +18 -11
  210. package/dist/describe/read-errors.js.map +1 -1
  211. package/dist/describe/read-refusals.d.ts +11 -0
  212. package/dist/describe/read-refusals.d.ts.map +1 -0
  213. package/dist/describe/read-refusals.js +41 -0
  214. package/dist/describe/read-refusals.js.map +1 -0
  215. package/dist/describe/reference-lines.d.ts.map +1 -1
  216. package/dist/describe/reference-lines.js +18 -2
  217. package/dist/describe/reference-lines.js.map +1 -1
  218. package/dist/docs/formerly-recorded-stored-events.d.ts +9 -0
  219. package/dist/docs/formerly-recorded-stored-events.d.ts.map +1 -0
  220. package/dist/docs/formerly-recorded-stored-events.js +17 -0
  221. package/dist/docs/formerly-recorded-stored-events.js.map +1 -0
  222. package/dist/docs/write-stored-events-lock.d.ts +3 -2
  223. package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
  224. package/dist/docs/write-stored-events-lock.js +10 -4
  225. package/dist/docs/write-stored-events-lock.js.map +1 -1
  226. package/dist/doctor/diagnose.d.ts +2 -0
  227. package/dist/doctor/diagnose.d.ts.map +1 -1
  228. package/dist/doctor/diagnose.js +22 -3
  229. package/dist/doctor/diagnose.js.map +1 -1
  230. package/dist/doctor/doctor-finding.d.ts +13 -5
  231. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  232. package/dist/doctor/format-diagnosis.d.ts +4 -1
  233. package/dist/doctor/format-diagnosis.d.ts.map +1 -1
  234. package/dist/doctor/format-diagnosis.js +49 -3
  235. package/dist/doctor/format-diagnosis.js.map +1 -1
  236. package/dist/doctor/in-range.d.ts +7 -0
  237. package/dist/doctor/in-range.d.ts.map +1 -0
  238. package/dist/doctor/in-range.js +90 -0
  239. package/dist/doctor/in-range.js.map +1 -0
  240. package/dist/doctor/install-findings.d.ts +11 -0
  241. package/dist/doctor/install-findings.d.ts.map +1 -0
  242. package/dist/doctor/install-findings.js +119 -0
  243. package/dist/doctor/install-findings.js.map +1 -0
  244. package/dist/doctor/node-findings.d.ts +7 -0
  245. package/dist/doctor/node-findings.d.ts.map +1 -0
  246. package/dist/doctor/node-findings.js +19 -0
  247. package/dist/doctor/node-findings.js.map +1 -0
  248. package/dist/doctor/package-findings.d.ts +2 -0
  249. package/dist/doctor/package-findings.d.ts.map +1 -1
  250. package/dist/doctor/package-findings.js +1 -1
  251. package/dist/doctor/package-findings.js.map +1 -1
  252. package/dist/doctor/submodule-findings.d.ts +7 -0
  253. package/dist/doctor/submodule-findings.d.ts.map +1 -0
  254. package/dist/doctor/submodule-findings.js +22 -0
  255. package/dist/doctor/submodule-findings.js.map +1 -0
  256. package/dist/generate/concept.d.ts.map +1 -1
  257. package/dist/generate/concept.js +3 -29
  258. package/dist/generate/concept.js.map +1 -1
  259. package/dist/generate/errors/add-code.d.ts +13 -0
  260. package/dist/generate/errors/add-code.d.ts.map +1 -0
  261. package/dist/generate/errors/add-code.js +18 -0
  262. package/dist/generate/errors/add-code.js.map +1 -0
  263. package/dist/generate/errors/codes-list.d.ts +10 -0
  264. package/dist/generate/errors/codes-list.d.ts.map +1 -0
  265. package/dist/generate/errors/codes-list.js +25 -0
  266. package/dist/generate/errors/codes-list.js.map +1 -0
  267. package/dist/generate/errors/error-code-pattern.d.ts +3 -0
  268. package/dist/generate/errors/error-code-pattern.d.ts.map +1 -0
  269. package/dist/generate/errors/error-code-pattern.js +3 -0
  270. package/dist/generate/errors/error-code-pattern.js.map +1 -0
  271. package/dist/generate/errors/factory-prefix.d.ts +3 -0
  272. package/dist/generate/errors/factory-prefix.d.ts.map +1 -0
  273. package/dist/generate/errors/factory-prefix.js +3 -0
  274. package/dist/generate/errors/factory-prefix.js.map +1 -0
  275. package/dist/generate/errors/named-refusal-code.d.ts +17 -0
  276. package/dist/generate/errors/named-refusal-code.d.ts.map +1 -0
  277. package/dist/generate/errors/named-refusal-code.js +42 -0
  278. package/dist/generate/errors/named-refusal-code.js.map +1 -0
  279. package/dist/generate/errors/refusal-class-name.d.ts +8 -0
  280. package/dist/generate/errors/refusal-class-name.d.ts.map +1 -0
  281. package/dist/generate/errors/refusal-class-name.js +16 -0
  282. package/dist/generate/errors/refusal-class-name.js.map +1 -0
  283. package/dist/generate/errors/refusal-factory-name.d.ts +4 -0
  284. package/dist/generate/errors/refusal-factory-name.d.ts.map +1 -0
  285. package/dist/generate/errors/refusal-factory-name.js +15 -0
  286. package/dist/generate/errors/refusal-factory-name.js.map +1 -0
  287. package/dist/generate/errors/write-named-refusal.d.ts +18 -0
  288. package/dist/generate/errors/write-named-refusal.d.ts.map +1 -0
  289. package/dist/generate/errors/write-named-refusal.js +89 -0
  290. package/dist/generate/errors/write-named-refusal.js.map +1 -0
  291. package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
  292. package/dist/generate/kinds/domain-error-kind.js +12 -5
  293. package/dist/generate/kinds/domain-error-kind.js.map +1 -1
  294. package/dist/generate/kinds/error-kind.d.ts.map +1 -1
  295. package/dist/generate/kinds/error-kind.js +27 -12
  296. package/dist/generate/kinds/error-kind.js.map +1 -1
  297. package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
  298. package/dist/generate/schedule/cron-problem.js +16 -1
  299. package/dist/generate/schedule/cron-problem.js.map +1 -1
  300. package/dist/generate/spoken-in-language.d.ts +9 -0
  301. package/dist/generate/spoken-in-language.d.ts.map +1 -0
  302. package/dist/generate/spoken-in-language.js +39 -0
  303. package/dist/generate/spoken-in-language.js.map +1 -0
  304. package/dist/help/notes.d.ts +1 -1
  305. package/dist/help/notes.d.ts.map +1 -1
  306. package/dist/help/notes.js +32 -13
  307. package/dist/help/notes.js.map +1 -1
  308. package/dist/help/usage.d.ts +1 -1
  309. package/dist/help/usage.d.ts.map +1 -1
  310. package/dist/help/usage.js +4 -3
  311. package/dist/help/usage.js.map +1 -1
  312. package/dist/init/manifest/versions.js +24 -24
  313. package/dist/init/run-init.d.ts.map +1 -1
  314. package/dist/init/run-init.js +4 -2
  315. package/dist/init/run-init.js.map +1 -1
  316. package/dist/init/stack/resolve-stack.js +2 -2
  317. package/dist/init/stack/resolve-stack.js.map +1 -1
  318. package/dist/lint/eslint-in-project.d.ts +8 -0
  319. package/dist/lint/eslint-in-project.d.ts.map +1 -0
  320. package/dist/lint/eslint-in-project.js +33 -0
  321. package/dist/lint/eslint-in-project.js.map +1 -0
  322. package/dist/lint/format-verdict.d.ts +4 -0
  323. package/dist/lint/format-verdict.d.ts.map +1 -0
  324. package/dist/lint/format-verdict.js +11 -0
  325. package/dist/lint/format-verdict.js.map +1 -0
  326. package/dist/lint/lint-run.d.ts +8 -0
  327. package/dist/lint/lint-run.d.ts.map +1 -0
  328. package/dist/lint/lint-run.js +2 -0
  329. package/dist/lint/lint-run.js.map +1 -0
  330. package/dist/lint/lint-verdict.d.ts +19 -0
  331. package/dist/lint/lint-verdict.d.ts.map +1 -0
  332. package/dist/lint/lint-verdict.js +25 -0
  333. package/dist/lint/lint-verdict.js.map +1 -0
  334. package/dist/lint/parse-lint-answer.d.ts +13 -0
  335. package/dist/lint/parse-lint-answer.d.ts.map +1 -0
  336. package/dist/lint/parse-lint-answer.js +18 -0
  337. package/dist/lint/parse-lint-answer.js.map +1 -0
  338. package/dist/migration/plan-replay.d.ts +4 -3
  339. package/dist/migration/plan-replay.d.ts.map +1 -1
  340. package/dist/migration/plan-replay.js +21 -6
  341. package/dist/migration/plan-replay.js.map +1 -1
  342. package/dist/migration/rename-branch-migrations.d.ts +13 -0
  343. package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
  344. package/dist/migration/rename-branch-migrations.js +25 -0
  345. package/dist/migration/rename-branch-migrations.js.map +1 -0
  346. package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
  347. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  348. package/dist/migration/replay-drizzle-migrations.js +48 -4
  349. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  350. package/dist/migration/replay-plan.d.ts +8 -0
  351. package/dist/migration/replay-plan.d.ts.map +1 -1
  352. package/dist/migration/restore-migration-folder.d.ts +4 -0
  353. package/dist/migration/restore-migration-folder.d.ts.map +1 -0
  354. package/dist/migration/restore-migration-folder.js +15 -0
  355. package/dist/migration/restore-migration-folder.js.map +1 -0
  356. package/dist/package-manager/lockfiles.d.ts +2 -0
  357. package/dist/package-manager/lockfiles.d.ts.map +1 -1
  358. package/dist/package-manager/lockfiles.js +5 -0
  359. package/dist/package-manager/lockfiles.js.map +1 -1
  360. package/dist/presets/identity-refusal.js +1 -1
  361. package/dist/presets/identity-refusal.js.map +1 -1
  362. package/dist/presets/identity-terms.d.ts.map +1 -1
  363. package/dist/presets/identity-terms.js +30 -0
  364. package/dist/presets/identity-terms.js.map +1 -1
  365. package/dist/presets/preset-files.d.ts.map +1 -1
  366. package/dist/presets/preset-files.js +4 -1
  367. package/dist/presets/preset-files.js.map +1 -1
  368. package/dist/refusals/aggregates-of.d.ts +10 -0
  369. package/dist/refusals/aggregates-of.d.ts.map +1 -0
  370. package/dist/refusals/aggregates-of.js +9 -0
  371. package/dist/refusals/aggregates-of.js.map +1 -0
  372. package/dist/refusals/applied-moves.d.ts +7 -0
  373. package/dist/refusals/applied-moves.d.ts.map +1 -0
  374. package/dist/refusals/applied-moves.js +2 -0
  375. package/dist/refusals/applied-moves.js.map +1 -0
  376. package/dist/refusals/apply-named-plan.d.ts +19 -0
  377. package/dist/refusals/apply-named-plan.d.ts.map +1 -0
  378. package/dist/refusals/apply-named-plan.js +46 -0
  379. package/dist/refusals/apply-named-plan.js.map +1 -0
  380. package/dist/refusals/apply-plan.d.ts.map +1 -1
  381. package/dist/refusals/apply-plan.js +21 -25
  382. package/dist/refusals/apply-plan.js.map +1 -1
  383. package/dist/refusals/code-without-imports.d.ts +3 -0
  384. package/dist/refusals/code-without-imports.d.ts.map +1 -0
  385. package/dist/refusals/code-without-imports.js +9 -0
  386. package/dist/refusals/code-without-imports.js.map +1 -0
  387. package/dist/refusals/concept-error-class.d.ts +26 -0
  388. package/dist/refusals/concept-error-class.d.ts.map +1 -0
  389. package/dist/refusals/concept-error-class.js +2 -0
  390. package/dist/refusals/concept-error-class.js.map +1 -0
  391. package/dist/refusals/concept-errors.d.ts +6 -0
  392. package/dist/refusals/concept-errors.d.ts.map +1 -0
  393. package/dist/refusals/concept-errors.js +16 -0
  394. package/dist/refusals/concept-errors.js.map +1 -0
  395. package/dist/refusals/concept-imports.d.ts +8 -0
  396. package/dist/refusals/concept-imports.d.ts.map +1 -0
  397. package/dist/refusals/concept-imports.js +33 -0
  398. package/dist/refusals/concept-imports.js.map +1 -0
  399. package/dist/refusals/concept-leftovers.d.ts +5 -0
  400. package/dist/refusals/concept-leftovers.d.ts.map +1 -0
  401. package/dist/refusals/concept-leftovers.js +26 -0
  402. package/dist/refusals/concept-leftovers.js.map +1 -0
  403. package/dist/refusals/concept-named.d.ts +3 -0
  404. package/dist/refusals/concept-named.d.ts.map +1 -0
  405. package/dist/refusals/concept-named.js +13 -0
  406. package/dist/refusals/concept-named.js.map +1 -0
  407. package/dist/refusals/concerns.d.ts +16 -0
  408. package/dist/refusals/concerns.d.ts.map +1 -0
  409. package/dist/refusals/concerns.js +9 -0
  410. package/dist/refusals/concerns.js.map +1 -0
  411. package/dist/refusals/cut-factories.d.ts +7 -0
  412. package/dist/refusals/cut-factories.d.ts.map +1 -0
  413. package/dist/refusals/cut-factories.js +30 -0
  414. package/dist/refusals/cut-factories.js.map +1 -0
  415. package/dist/refusals/earlier-guidance.d.ts +8 -0
  416. package/dist/refusals/earlier-guidance.d.ts.map +1 -0
  417. package/dist/refusals/earlier-guidance.js +21 -0
  418. package/dist/refusals/earlier-guidance.js.map +1 -0
  419. package/dist/refusals/factory-for-parameter.d.ts +7 -0
  420. package/dist/refusals/factory-for-parameter.d.ts.map +1 -0
  421. package/dist/refusals/factory-for-parameter.js +17 -0
  422. package/dist/refusals/factory-for-parameter.js.map +1 -0
  423. package/dist/refusals/first-parameter.d.ts +6 -0
  424. package/dist/refusals/first-parameter.d.ts.map +1 -0
  425. package/dist/refusals/first-parameter.js +12 -0
  426. package/dist/refusals/first-parameter.js.map +1 -0
  427. package/dist/refusals/ignore-code-types.d.ts +10 -0
  428. package/dist/refusals/ignore-code-types.d.ts.map +1 -0
  429. package/dist/refusals/ignore-code-types.js +53 -0
  430. package/dist/refusals/ignore-code-types.js.map +1 -0
  431. package/dist/refusals/imports-used-by.d.ts +6 -0
  432. package/dist/refusals/imports-used-by.d.ts.map +1 -0
  433. package/dist/refusals/imports-used-by.js +32 -0
  434. package/dist/refusals/imports-used-by.js.map +1 -0
  435. package/dist/refusals/leave-origins.d.ts +10 -0
  436. package/dist/refusals/leave-origins.d.ts.map +1 -0
  437. package/dist/refusals/leave-origins.js +35 -0
  438. package/dist/refusals/leave-origins.js.map +1 -0
  439. package/dist/refusals/legacy-move.d.ts +5 -0
  440. package/dist/refusals/legacy-move.d.ts.map +1 -0
  441. package/dist/refusals/legacy-move.js +14 -0
  442. package/dist/refusals/legacy-move.js.map +1 -0
  443. package/dist/refusals/markdown-files.d.ts +4 -0
  444. package/dist/refusals/markdown-files.d.ts.map +1 -0
  445. package/dist/refusals/markdown-files.js +13 -0
  446. package/dist/refusals/markdown-files.js.map +1 -0
  447. package/dist/refusals/member-start.d.ts +3 -0
  448. package/dist/refusals/member-start.d.ts.map +1 -0
  449. package/dist/refusals/member-start.js +14 -0
  450. package/dist/refusals/member-start.js.map +1 -0
  451. package/dist/refusals/migration-targets.d.ts +3 -0
  452. package/dist/refusals/migration-targets.d.ts.map +1 -0
  453. package/dist/refusals/migration-targets.js +3 -0
  454. package/dist/refusals/migration-targets.js.map +1 -0
  455. package/dist/refusals/move-named-specs.d.ts +16 -0
  456. package/dist/refusals/move-named-specs.d.ts.map +1 -0
  457. package/dist/refusals/move-named-specs.js +119 -0
  458. package/dist/refusals/move-named-specs.js.map +1 -0
  459. package/dist/refusals/move.d.ts +6 -1
  460. package/dist/refusals/move.d.ts.map +1 -1
  461. package/dist/refusals/named-move.d.ts +23 -0
  462. package/dist/refusals/named-move.d.ts.map +1 -0
  463. package/dist/refusals/named-move.js +2 -0
  464. package/dist/refusals/named-move.js.map +1 -0
  465. package/dist/refusals/named-moves.d.ts +10 -0
  466. package/dist/refusals/named-moves.d.ts.map +1 -0
  467. package/dist/refusals/named-moves.js +64 -0
  468. package/dist/refusals/named-moves.js.map +1 -0
  469. package/dist/refusals/named-plan.d.ts +7 -0
  470. package/dist/refusals/named-plan.d.ts.map +1 -0
  471. package/dist/refusals/named-plan.js +2 -0
  472. package/dist/refusals/named-plan.js.map +1 -0
  473. package/dist/refusals/own-factory.d.ts +14 -0
  474. package/dist/refusals/own-factory.d.ts.map +1 -0
  475. package/dist/refusals/own-factory.js +38 -0
  476. package/dist/refusals/own-factory.js.map +1 -0
  477. package/dist/refusals/plan-target.d.ts +7 -0
  478. package/dist/refusals/plan-target.d.ts.map +1 -0
  479. package/dist/refusals/plan-target.js +13 -0
  480. package/dist/refusals/plan-target.js.map +1 -0
  481. package/dist/refusals/planned-refusal.d.ts +13 -0
  482. package/dist/refusals/planned-refusal.d.ts.map +1 -0
  483. package/dist/refusals/planned-refusal.js +2 -0
  484. package/dist/refusals/planned-refusal.js.map +1 -0
  485. package/dist/refusals/propose-named-plan.d.ts +25 -0
  486. package/dist/refusals/propose-named-plan.d.ts.map +1 -0
  487. package/dist/refusals/propose-named-plan.js +67 -0
  488. package/dist/refusals/propose-named-plan.js.map +1 -0
  489. package/dist/refusals/propose-plan.d.ts.map +1 -1
  490. package/dist/refusals/propose-plan.js +3 -19
  491. package/dist/refusals/propose-plan.js.map +1 -1
  492. package/dist/refusals/read-concept-error.d.ts +9 -0
  493. package/dist/refusals/read-concept-error.d.ts.map +1 -0
  494. package/dist/refusals/read-concept-error.js +51 -0
  495. package/dist/refusals/read-concept-error.js.map +1 -0
  496. package/dist/refusals/read-named-plan.d.ts +4 -0
  497. package/dist/refusals/read-named-plan.d.ts.map +1 -0
  498. package/dist/refusals/read-named-plan.js +57 -0
  499. package/dist/refusals/read-named-plan.js.map +1 -0
  500. package/dist/refusals/refusal-class-file.d.ts +15 -0
  501. package/dist/refusals/refusal-class-file.d.ts.map +1 -0
  502. package/dist/refusals/refusal-class-file.js +38 -0
  503. package/dist/refusals/refusal-class-file.js.map +1 -0
  504. package/dist/refusals/rename-concept.d.ts +7 -0
  505. package/dist/refusals/rename-concept.d.ts.map +1 -0
  506. package/dist/refusals/rename-concept.js +15 -0
  507. package/dist/refusals/rename-concept.js.map +1 -0
  508. package/dist/refusals/render-factory.d.ts +1 -1
  509. package/dist/refusals/render-factory.d.ts.map +1 -1
  510. package/dist/refusals/render-factory.js +3 -2
  511. package/dist/refusals/render-factory.js.map +1 -1
  512. package/dist/refusals/rewrite-concept-usages.d.ts +11 -0
  513. package/dist/refusals/rewrite-concept-usages.d.ts.map +1 -0
  514. package/dist/refusals/rewrite-concept-usages.js +61 -0
  515. package/dist/refusals/rewrite-concept-usages.js.map +1 -0
  516. package/dist/refusals/rewrite-named-usages.d.ts +9 -0
  517. package/dist/refusals/rewrite-named-usages.d.ts.map +1 -0
  518. package/dist/refusals/rewrite-named-usages.js +14 -0
  519. package/dist/refusals/rewrite-named-usages.js.map +1 -0
  520. package/dist/refusals/rewrite-usages.d.ts.map +1 -1
  521. package/dist/refusals/rewrite-usages.js +10 -6
  522. package/dist/refusals/rewrite-usages.js.map +1 -1
  523. package/dist/refusals/say-refusals.d.ts +3 -0
  524. package/dist/refusals/say-refusals.d.ts.map +1 -0
  525. package/dist/refusals/say-refusals.js +8 -0
  526. package/dist/refusals/say-refusals.js.map +1 -0
  527. package/dist/refusals/split-concept-spec.d.ts +19 -0
  528. package/dist/refusals/split-concept-spec.d.ts.map +1 -0
  529. package/dist/refusals/split-concept-spec.js +74 -0
  530. package/dist/refusals/split-concept-spec.js.map +1 -0
  531. package/dist/refusals/stale-mentions.d.ts +10 -0
  532. package/dist/refusals/stale-mentions.d.ts.map +1 -0
  533. package/dist/refusals/stale-mentions.js +41 -0
  534. package/dist/refusals/stale-mentions.js.map +1 -0
  535. package/dist/refusals/undefined-words.d.ts +15 -0
  536. package/dist/refusals/undefined-words.d.ts.map +1 -0
  537. package/dist/refusals/undefined-words.js +26 -0
  538. package/dist/refusals/undefined-words.js.map +1 -0
  539. package/dist/refusals/with-codes.d.ts +11 -0
  540. package/dist/refusals/with-codes.d.ts.map +1 -0
  541. package/dist/refusals/with-codes.js +46 -0
  542. package/dist/refusals/with-codes.js.map +1 -0
  543. package/dist/refusals/with-imports.d.ts +3 -0
  544. package/dist/refusals/with-imports.d.ts.map +1 -0
  545. package/dist/refusals/with-imports.js +8 -0
  546. package/dist/refusals/with-imports.js.map +1 -0
  547. package/dist/refusals/write-refusal-classes.d.ts +9 -0
  548. package/dist/refusals/write-refusal-classes.d.ts.map +1 -0
  549. package/dist/refusals/write-refusal-classes.js +23 -0
  550. package/dist/refusals/write-refusal-classes.js.map +1 -0
  551. package/dist/run.d.ts.map +1 -1
  552. package/dist/run.js +2 -0
  553. package/dist/run.js.map +1 -1
  554. package/dist/stack/stack-vars.js +1 -1
  555. package/dist/stack/stack-vars.js.map +1 -1
  556. package/dist/version.d.ts +1 -1
  557. package/dist/version.js +1 -1
  558. package/package.json +2 -2
  559. package/templates/aggregate/aggregate.ts.tpl +3 -0
  560. package/templates/aggregate/event-sourced.aggregate.ts.tpl +3 -0
  561. package/templates/command/handler.declared.ts.tpl +3 -0
  562. package/templates/command/handler.ts.tpl +3 -0
  563. package/templates/entity/entity.ts.tpl +3 -0
  564. package/templates/error/codes.ts.tpl +5 -0
  565. package/templates/error/refusal-case.spec.ts.tpl +8 -0
  566. package/templates/error/refusal-factory.ts.tpl +4 -0
  567. package/templates/error/refusal.spec.ts.tpl +7 -0
  568. package/templates/error/refusal.ts.tpl +8 -0
  569. package/templates/init/rules/domain.md.tpl +9 -2
  570. package/templates/init/rules/presentation.md.tpl +3 -0
  571. package/templates/pipeline/knip.json.tpl +5 -0
  572. package/templates/pipeline/package-scripts.json +3 -3
  573. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +22 -0
  574. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +16 -0
  575. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +16 -0
  576. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +16 -0
  577. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +10 -0
  578. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +16 -0
  579. package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +10 -0
  580. package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +16 -0
  581. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +10 -0
  582. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +10 -0
  583. package/templates/presets/identity/context/domain/aggregates/account.aggregate.ts.tpl +16 -0
  584. package/templates/presets/identity/context/domain/aggregates/delegation.aggregate.ts.tpl +28 -0
  585. package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +27 -0
  586. package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +31 -0
  587. package/templates/presets/identity/context/domain/errors/above-own-role.error.named.ts.tpl +13 -0
  588. package/templates/presets/identity/context/domain/errors/account-already-deactivated.error.named.ts.tpl +10 -0
  589. package/templates/presets/identity/context/domain/errors/already-member.error.named.ts.tpl +13 -0
  590. package/templates/presets/identity/context/domain/errors/codes.named.ts.tpl +33 -0
  591. package/templates/presets/identity/context/domain/errors/deactivated-account.error.named.ts.tpl +10 -0
  592. package/templates/presets/identity/context/domain/errors/delegation-not-active.error.named.ts.tpl +10 -0
  593. package/templates/presets/identity/context/domain/errors/delegation-period-inverted.error.named.ts.tpl +13 -0
  594. package/templates/presets/identity/context/domain/errors/delegation-to-oneself.error.named.ts.tpl +10 -0
  595. package/templates/presets/identity/context/domain/errors/delegation-too-long.error.named.ts.tpl +12 -0
  596. package/templates/presets/identity/context/domain/errors/delegation-with-no-right.error.named.ts.tpl +10 -0
  597. package/templates/presets/identity/context/domain/errors/email-not-verified.error.named.ts.tpl +13 -0
  598. package/templates/presets/identity/context/domain/errors/invalid-display-name.error.named.ts.tpl +10 -0
  599. package/templates/presets/identity/context/domain/errors/invalid-email-address.error.named.ts.tpl +10 -0
  600. package/templates/presets/identity/context/domain/errors/invalid-organisation-name.error.named.ts.tpl +10 -0
  601. package/templates/presets/identity/context/domain/errors/invalid-organisation-slug.error.named.ts.tpl +13 -0
  602. package/templates/presets/identity/context/domain/errors/invitation-expired.error.named.ts.tpl +13 -0
  603. package/templates/presets/identity/context/domain/errors/invitation-not-addressed-to-account.error.named.ts.tpl +13 -0
  604. package/templates/presets/identity/context/domain/errors/invitation-not-pending.error.named.ts.tpl +13 -0
  605. package/templates/presets/identity/context/domain/errors/last-owner.error.named.ts.tpl +12 -0
  606. package/templates/presets/identity/context/domain/errors/not-an-owner.error.named.ts.tpl +10 -0
  607. package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl +10 -0
  608. package/templates/presets/identity/context/domain/errors/own-role.error.named.ts.tpl +12 -0
  609. package/templates/presets/identity/context/domain/errors/right-not-in-role.error.named.ts.tpl +12 -0
  610. package/templates/presets/identity/context/domain/errors/unknown-account.error.named.ts.tpl +12 -0
  611. package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl +10 -0
  612. package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl +11 -0
  613. package/templates/presets/identity/context/domain/errors/unknown-member.error.named.ts.tpl +13 -0
  614. package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl +12 -0
  615. package/templates/presets/identity/context/domain/value-objects/delegation-period.vo.ts.tpl +16 -0
  616. package/templates/presets/identity/context/domain/value-objects/display-name.vo.ts.tpl +10 -0
  617. package/templates/presets/identity/context/domain/value-objects/email-address.vo.ts.tpl +10 -0
  618. package/templates/presets/identity/context/domain/value-objects/organisation-name.vo.ts.tpl +10 -0
  619. package/templates/presets/identity/context/domain/value-objects/organisation-slug.vo.ts.tpl +10 -0
  620. package/templates/state-machine/state-machine.ts.tpl +5 -0
  621. package/templates/value-object/value-object.ts.tpl +6 -0
  622. /package/templates/presets/identity/context/domain/errors/{account.error.ts.tpl → account.error.factories.ts.tpl} +0 -0
  623. /package/templates/presets/identity/context/domain/errors/{delegation.error.ts.tpl → delegation.error.factories.ts.tpl} +0 -0
  624. /package/templates/presets/identity/context/domain/errors/{invitation.error.ts.tpl → invitation.error.factories.ts.tpl} +0 -0
  625. /package/templates/presets/identity/context/domain/errors/{member.error.ts.tpl → member.error.factories.ts.tpl} +0 -0
  626. /package/templates/presets/identity/context/domain/errors/{organisation.error.ts.tpl → organisation.error.factories.ts.tpl} +0 -0
package/README.md CHANGED
@@ -61,7 +61,7 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
61
61
  [--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
62
62
  [--errors none|sentry] [--logger stdout|pino|winston]
63
63
  [--style declared|explicit] [--assembly barrel|discovery]
64
- [--dependencies signature|listed] [--refusals factories|classes]
64
+ [--dependencies signature|listed] [--refusals named|factories|classes]
65
65
  [--routes controllers|functions] [--value-objects throwing|result]
66
66
  [--literals named|free] [--values classes|free] [--tenancy none|shared-table]
67
67
  [--queue database|redis|memory]
@@ -332,33 +332,48 @@ injected(KnexReminderRepository, [KnexContext, ExecutionScope, Clock]);
332
332
  and the one line of the composition root that adds the whole context:
333
333
  `contextModule('notification', notificationDeclarations)` in `src/platform/compose-application.ts`.
334
334
 
335
- **Domain errors are built by factories.** `init` writes `"stack.refusals": "factories"`: a
336
- context has one error class per concept, extending `ConceptError` of the kernel, and
337
- `generate error <context> <Concept> <refusal>` adds a static factory to it. The `errors/*`
338
- rules hold that form. `--refusals classes`, or a config without the key, keeps one class per
339
- error built with `new`, as 0.1 and 0.2 wrote them; `error-factories` moves a project from one
340
- to the other.
335
+ **A refusal is a class of its own.** `init` writes `"stack.refusals": "named"`: each refusal of
336
+ a context is a class named after what is refused, extending `DomainRefusal` of the kernel, built
337
+ by static factories named after what the refusal is about, and its code is read from the closed
338
+ list of the codes of the context, `domain/errors/codes.ts`.
339
+ `generate error <context> <Refusal> <factory>` writes the class, its code and the factory. The
340
+ `errors/*` rules hold that form. Two earlier forms keep working: `--refusals factories`, one error class per concept extending
341
+ `ConceptError`, each refusal a static factory of it, as `init` wrote it before; and
342
+ `--refusals classes`, or a config without the key, one class per error built with `new`, as 0.1
343
+ and 0.2 wrote them. `error-factories` moves a project from either to `named`.
341
344
 
342
- The older form, under `"stack.refusals": "classes"`: one class per error.
345
+ The form `init` writes, which `generate error scheduling SlotTaken forCalendar` starts:
343
346
 
344
347
  <!-- checked sample -->
345
348
  ```ts
346
- import { DomainError } from '@ddd-ts-kit/kernel';
349
+ import { DomainRefusal } from '@ddd-ts-kit/kernel';
350
+
351
+ // domain/errors/codes.ts: the closed list of the codes of the context
352
+ export const SchedulingCodes = {
353
+ SlotTaken: 'SLOT_TAKEN',
354
+ } as const;
355
+
356
+ export type SchedulingCode = (typeof SchedulingCodes)[keyof typeof SchedulingCodes];
347
357
 
348
358
  // domain/errors/slot-taken.error.ts
349
- export class SlotTakenError extends DomainError {
350
- readonly code = 'SLOT_TAKEN';
359
+ export class SlotTaken extends DomainRefusal {
360
+ readonly code = SchedulingCodes.SlotTaken;
351
361
 
352
- constructor(readonly calendarId: string) {
353
- super(`The slot of calendar ${calendarId} is already held.`);
362
+ static forCalendar(calendarId: string) {
363
+ return SlotTaken.refusal(`The slot of calendar ${calendarId} is already held.`, { calendarId });
354
364
  }
355
365
  }
356
366
 
357
- const refusal = new SlotTakenError('calendar-1');
367
+ const refusal = SlotTaken.forCalendar('calendar-1');
368
+
369
+ // what catches it tells the refusal by its class, and reads its facts
370
+ if (SlotTaken.is(refusal)) {
371
+ console.log(refusal.facts.calendarId);
372
+ }
358
373
  ```
359
374
 
360
- The form `init` writes: one class per concept of the glossary, one factory per refusal, which
361
- `generate error scheduling Appointment slotTaken` adds.
375
+ Under `"stack.refusals": "factories"`: one class per concept of the glossary, one factory per
376
+ refusal, which `generate error scheduling Appointment slotTaken` adds.
362
377
 
363
378
  <!-- checked sample -->
364
379
  ```ts
@@ -379,6 +394,24 @@ if (AppointmentError.is(refusal, 'SLOT_TAKEN')) {
379
394
  }
380
395
  ```
381
396
 
397
+ The oldest form, under `"stack.refusals": "classes"`: one class per error.
398
+
399
+ <!-- checked sample -->
400
+ ```ts
401
+ import { DomainError } from '@ddd-ts-kit/kernel';
402
+
403
+ // domain/errors/slot-taken.error.ts
404
+ export class SlotTakenError extends DomainError {
405
+ readonly code = 'SLOT_TAKEN';
406
+
407
+ constructor(readonly calendarId: string) {
408
+ super(`The slot of calendar ${calendarId} is already held.`);
409
+ }
410
+ }
411
+
412
+ const refusal = new SlotTakenError('calendar-1');
413
+ ```
414
+
382
415
  **A route is a controller class.** `init` writes `"stack.routes": "controllers"`: each route is
383
416
  one class with one method, in a folder of its own, behind the guards of its route group, and a
384
417
  declared context lists no route: its controllers reach the application through its generated
@@ -422,15 +455,16 @@ write the save, and nothing after it:
422
455
 
423
456
  <!-- checked sample -->
424
457
  ```ts
425
- import { type Actor, AggregateRoot, AuthorizedCommand, type Clock, type CommandHandler, ConceptError, Repository } from '@ddd-ts-kit/kernel';
458
+ import { type Actor, AggregateRoot, AuthorizedCommand, type Clock, type CommandHandler, DomainRefusal, Repository } from '@ddd-ts-kit/kernel';
426
459
 
427
460
  declare class Invoice extends AggregateRoot {
428
461
  /** Makes the invoice final and records InvoiceIssued, which waits in the aggregate. */
429
462
  issue(now: Date): void;
430
463
  }
431
464
 
432
- declare class InvoiceError extends ConceptError {
433
- static notFound(invoiceId: string): InvoiceError;
465
+ declare class UnknownInvoice extends DomainRefusal {
466
+ readonly code: 'INVOICE_NOT_FOUND';
467
+ static forInvoice(invoiceId: string): UnknownInvoice;
434
468
  }
435
469
 
436
470
  export abstract class InvoiceRepository extends Repository<Invoice> {}
@@ -454,7 +488,7 @@ export class IssueInvoiceHandler implements CommandHandler<IssueInvoiceCommand>
454
488
  const invoice = await this.invoiceRepository.findById(command.invoiceId);
455
489
 
456
490
  if (invoice === undefined) {
457
- throw InvoiceError.notFound(command.invoiceId);
491
+ throw UnknownInvoice.forInvoice(command.invoiceId);
458
492
  }
459
493
 
460
494
  invoice.issue(this.clock.now());
@@ -618,8 +652,8 @@ Next, in this order: the language of the context first, then the business decisi
618
652
  | `value-object` (`vo`) | `<context> <Name>` | value object, spec |
619
653
  | `vocabulary` | `<context> <Name> --value <value> [--value <value>]...` | `domain/vocabularies/<name>.vocabulary.ts`: an object `as const` of the values, keyed by each value in PascalCase, and the union type of the same name; run again, adds the values the file does not hold |
620
654
  | `domain-event` | `<context> <Aggregate> <Fact>` | event named `<context>.<aggregate>.<fact>`, spec |
621
- | `error` (`refusal`) | `<context> <Concept> <refusal> [--code CODE] [--term ...]...` | a static factory `<refusal>` on `domain/errors/<concept>.error.ts`, the class of the errors of that concept (created when absent, extending `ConceptError`), and its case in `test/unit/<concept>.error.spec.ts`. The factory is added after the last one; run again, the command changes nothing. `<Concept>` is a term of the glossary (`--term` adds it). The code is the name of the refusal in constant case, with the concept before it when the name is one word or a code of the kit (`Appointment notFound` sets `APPOINTMENT_NOT_FOUND`); `--code` takes one of the forms `errors/factory-name` accepts. Refused: a name such as `create` or `error1`, and a code already set in the context |
622
- | `domain-error` | `<context> <Name> [--code CODE]` | one class per error with a stable code, spec: the form of a project whose config says `"stack.refusals": "classes"` or nothing. Refused under `factories`, with the `generate error` command to run instead |
655
+ | `error` (`refusal`) | `<context> <Refusal> <factory> [--code CODE] [--term ...]...` | under `"stack.refusals": "named"`: the class `<Refusal>` in `domain/errors/<refusal>.error.ts`, extending `DomainRefusal` and reading its code from the list, its entry in `domain/errors/codes.ts` (the list `<Context>Codes` and its type `<Context>Code`, created when absent; the entry is added at the end), the static factory `<factory>` and its case in `test/unit/<refusal>.error.spec.ts`. Each is written when absent: run again, the command changes nothing; given another factory, it adds it to the class. `<Refusal>` is in PascalCase (a trailing `Error` is dropped), named with terms of the glossary and the qualifiers of a refusal, `invalid`, `unknown`, `already`, `too`, `no`, `missing` and `required` (`BookingTooLate`): a word the glossary does not define is refused, with the `--term` that adds it; `<factory>` starts with `for`, `with`, `because`, `on` or `at` (`forAccountId`), else the command refuses and proposes `for<Factory>`. The code is the refusal in constant case (`InsufficientFunds` sets `INSUFFICIENT_FUNDS`), `--code` gives another; refused: a code already set in the context. Under `factories` and `classes`, `<context> <Concept> <refusal>`: a static factory `<refusal>` on `domain/errors/<concept>.error.ts`, the class of the errors of that concept (created when absent, extending `ConceptError`), and its case in `test/unit/<concept>.error.spec.ts`. The factory is added after the last one; run again, the command changes nothing. `<Concept>` is a term of the glossary (`--term` adds it). The code is the name of the refusal in constant case, with the concept before it when the name is one word or a code of the kit (`Appointment notFound` sets `APPOINTMENT_NOT_FOUND`); `--code` takes one of the forms `errors/factory-name` accepts. Refused: a name such as `create` or `error1`, and a code already set in the context |
656
+ | `domain-error` | `<context> <Name> [--code CODE]` | one class per error with a stable code, spec: the form of a project whose config says `"stack.refusals": "classes"` or nothing. Refused under `named` and `factories`, with the `generate error` command to run instead |
623
657
  | `domain-service` | `<context> <Name>` | service, spec |
624
658
  | `state-machine` | `<context> <Aggregate> [--value <state>]... [--transition "<intention>:<from>[,<from>]...[><to>]"]...` | the vocabulary `<Aggregate>Status` (created from `--value`, two states at least, or given the values it misses), `domain/state-machines/<aggregate>.state-machine.ts` (`<aggregate>Lifecycle`: every value a state, the first one initial, the transitions asked, a `TODO(domain)` for the refusal of the concept error) and `test/unit/<aggregate>.state-machine.spec.ts` (each transition where it leads, a refusal from a state it does not leave); the aggregate is left to use it |
625
659
  | `repository` | `<context> <Aggregate> [--tenant-scoped]` | the port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), the adapter of the project's ORM (`implements` the port) with its mapper and table (or model), a fake, one `repositoryContract` spec run on both, registration |
@@ -683,11 +717,11 @@ Next, in this order: the language of the context first, then the business decisi
683
717
  `platform.jobs.register({ name, schedule, run })`.
684
718
  - **Jobs.** The schedule is validated when the job is generated, by the rules of the scheduler
685
719
  (`parseJobSchedule` of the kernel, pinned by a test): a duration (`15m`, `2s`, digits alone are
686
- milliseconds) or a five-field cron expression, with an IANA time zone; `--time-zone` without
687
- `--cron` is refused, and so is a job without `--command`, a command that does not exist (with the
688
- command that creates it) and a command whose constructor needs more than the actor and the
689
- instant the work is for: a job only says that the time has come, the handler finds what to act
690
- on. Parameters that are optional or have a default are left out of the call.
720
+ milliseconds) or a cron expression of five fields or a shorthand (`@daily`), with an IANA time
721
+ zone; `--time-zone` without `--cron` is refused, and so is a job without `--command`, a command
722
+ that does not exist (with the command that creates it) and a command whose constructor needs more
723
+ than the actor and the instant the work is for: a job only says that the time has come, the
724
+ handler finds what to act on. Parameters that are optional or have a default are left out of the call.
691
725
  - **The grant of a job.** A job whose command is protected sends it as `system:<context>.<name>`,
692
726
  which has no right unless the model gives it one. `generate job` writes the grant where the model
693
727
  makes it one line, in a `system-grants` marker region, and `next` points at that line:
@@ -887,44 +921,74 @@ serializer, give the groups their guards, hold the guards in the specs.
887
921
  ## error-factories
888
922
 
889
923
  ```
890
- ddd-ts-kit error-factories --plan
924
+ ddd-ts-kit error-factories --plan [--to named|factories]
891
925
  ddd-ts-kit error-factories --apply [--dry-run]
892
926
  ```
893
927
 
894
- Moves a project from one class per error (`new SlotTakenError(..)`) to static factories on one
895
- error class per concept (`AppointmentError.slotTaken(..)`), in two steps, because which concept
896
- a refusal is about is a decision of the model.
897
-
898
- `--plan` writes `error-factories.plan.json`: per context, one entry per class of
928
+ Moves the refusals of a project to one class per refusal (`--to named`, the default), from one
929
+ class per error (`new SlotTakenError(..)`) or from the factories of one error class per concept
930
+ (`AppointmentError.slotTaken(..)`), to `SlotTaken.forCalendar(..)`. In two steps, because the
931
+ name of a refusal and of its factory are decisions of the model.
932
+
933
+ `--plan` writes `error-factories.plan.json`, `{ "to": "named", "contexts": { .. } }`: per
934
+ context, one entry per refusal, with what builds it today (`from`: `SlotTakenError`,
935
+ `AppointmentError.ended`), its file, its code, which is kept, the class proposed for it (`class`:
936
+ the PascalCase of its code, `APPOINTMENT_ENDED` gives `AppointmentEnded`, and `X_NOT_FOUND` gives
937
+ `UnknownX`) and its factory (`factory`: `for` and its first parameter, an `Id` suffix dropped,
938
+ `appointmentId` gives `forAppointment`, `cause` gives `becauseOf`; else `for` and the concept or
939
+ the aggregate the class is named after). Edit the names
940
+ you want otherwise: two entries under one class are two factories of it, under its one code. A
941
+ factory whose code is not a string literal is left out of the plan, and moves by hand. A class
942
+ is named with terms of the glossary of its context, as `language/glossary-term` judges every
943
+ class of `domain/errors/` under `named`, the qualifiers of a refusal aside: for each proposed
944
+ class whose name uses a word the glossary does not define, `--plan` says, under "Left to you",
945
+ which words and where to define them, or to rename the class in the plan; `--apply` says it again
946
+ for each class it writes.
947
+
948
+ `--apply` follows the plan, and refuses a class that is not in PascalCase or ends with `Error`,
949
+ a factory that does not start with `for`, `with`, `because`, `on` or `at` then an upper-case
950
+ letter, a class given two codes and a factory planned twice. It:
951
+
952
+ - writes `domain/errors/codes.ts` in each context, the list `<Context>Codes` with one entry per
953
+ class, and one file per refusal class, `domain/errors/<refusal>.error.ts`, extending
954
+ `DomainRefusal` and reading its code from the list, with its factories: each keeps the
955
+ parameters, the message and the facts it had;
956
+ - moves each case of a spec to `test/unit/<refusal>.error.spec.ts`;
957
+ - rewrites every file under the source root and `test/`: `AppointmentError.ended(a, b)` becomes
958
+ `AppointmentEnded.forAppointment(a, b)`, `AppointmentError.is(error, 'APPOINTMENT_ENDED')`
959
+ becomes `AppointmentEnded.is(error)`, `new SlotTakenError(..)` becomes
960
+ `SlotTaken.forCalendar(..)`, and the name of a class per error becomes the name of its class
961
+ everywhere else (assertions, `instanceof`, types), imports included. Comments and strings are
962
+ left alone;
963
+ - removes the classes per error it moved, and the concept classes left empty;
964
+ - sets `"stack.refusals": "named"` in the config.
965
+
966
+ It leaves, and says with its line, what still names a concept class that is gone: a bare
967
+ `AppointmentError.is(error)`, which meant every refusal of the concept (write the refusals it
968
+ means, `AppointmentEnded.is(error) || ..`), and `CodeOf<typeof AppointmentError>` (write the
969
+ union of the codes it means, or the code type of `codes.ts`). And always: run the formatter and
970
+ the checks, decide which facts a client may read where no factory exposes any yet, assert the
971
+ facts in the specs, and delete the plan file. Run again, it finds nothing left to move. `--json`
972
+ answers `{ dryRun, moved, written, removed, manual }`.
973
+
974
+ `--to factories` is the earlier move, from one class per error to static factories on one error
975
+ class per concept, in the same two steps. `--plan --to factories` writes one entry per class of
899
976
  `domain/errors/` that extends `DomainError`, with its code, the concept proposed for it (the
900
- aggregate its name starts or ends with, empty when none does) and the factory name that says
901
- its code (`APPOINTMENT_NOT_FOUND` on `Appointment` gives `notFound`). Edit it: every entry
902
- needs a `concept`, a term of the glossary.
903
-
904
- `--apply` follows the plan and refuses an entry without a concept, a vague factory name or one
905
- that does not say the code. It:
906
-
907
- - writes `domain/errors/<concept>.error.ts`, a class extending `ConceptError` with one factory
908
- per class moved there: the parameters of the constructor, the message it gave to `super`, and
909
- as facts the parameters that are plain data (text, numbers, booleans, dates);
910
- - removes each class and its spec, whose cases go under `describe('<factory>')` in
911
- `test/unit/<concept>.error.spec.ts`;
912
- - rewrites every file under the source root and `test/`: `new X(..)` becomes
913
- `<Concept>Error.<factory>(..)`, `thenError(X)` and `thenError(X, code)` become
914
- `thenError('<CODE>')`, `toThrow(X)` and `expect.any(X)` become an assertion on the code,
915
- `toBeInstanceOf(X)` becomes `toMatchObject({ code })`, `e instanceof X` becomes
916
- `<Concept>Error.is(e, '<CODE>')`, an import of the class becomes the import of its concept
917
- class, and a type names the concept class. A class of the same name in two contexts goes to
918
- the concept of its own. Comments and strings are left alone;
919
- - sets `"stack.refusals": "factories"` in the config.
920
-
921
- It leaves, and says: a class that has members of its own, reads `this` in its constructor or
922
- gives options to `super` (written by hand); a place where a class stood as a value it cannot
923
- translate; a property of the error that became a fact (`error.personId` is now
924
- `error.facts.personId`); a factory with more than three parameters. And always: which facts a
925
- client may read (none is exposed), the factories that still take a sentence as only parameter,
926
- and the facts to assert in the specs. Run the formatter afterwards. Run again, it finds nothing
927
- left to move. `--json` answers `{ dryRun, moved, written, removed, manual }`.
977
+ aggregate its name starts or ends with, empty when none does) and the factory name that says its
978
+ code (`APPOINTMENT_NOT_FOUND` on `Appointment` gives `notFound`); every entry needs a `concept`,
979
+ a term of the glossary. `--apply` then refuses an entry without a concept, a vague factory name
980
+ or one that does not say the code. It writes `domain/errors/<concept>.error.ts`, a class
981
+ extending `ConceptError` with one factory per class moved there (the parameters of the
982
+ constructor, the message it gave to `super`, and as facts the parameters that are plain data),
983
+ moves the cases of the specs under `describe('<factory>')` in `test/unit/<concept>.error.spec.ts`,
984
+ rewrites every usage (`new X(..)` becomes `<Concept>Error.<factory>(..)`, `thenError(X)` becomes
985
+ `thenError('<CODE>')`, `toThrow(X)` and `expect.any(X)` an assertion on the code,
986
+ `toBeInstanceOf(X)` `toMatchObject({ code })`, `e instanceof X` `<Concept>Error.is(e, '<CODE>')`)
987
+ and sets `"stack.refusals": "factories"`. It leaves, and says: a class that has members of its
988
+ own, reads `this` in its constructor or gives options to `super`; a place where a class stood as
989
+ a value it cannot translate; a property of the error that became a fact (`error.personId` is now
990
+ `error.facts.personId`); a factory with more than three parameters; the factories that still
991
+ take a sentence as only parameter.
928
992
 
929
993
  ## build-aliases
930
994
 
@@ -1187,10 +1251,30 @@ otherwise, then the git hooks. `lefthook.yml` must hold `lefthook: node_modules/
1187
1251
  which makes each checkout and each worktree run its own lefthook and fail a commit, loudly,
1188
1252
  when its dependencies are missing; the fix is that line, or `init --force` for the whole file.
1189
1253
  The pre-commit hook under `git rev-parse --git-path hooks` must exist and come from lefthook;
1190
- the fix is `npm run hooks:install`, once per clone. `--strict` exits 1 while something is
1191
- missing or at another range; a script written otherwise and a hook this clone has not installed
1192
- are said without failing it. `--json` prints `{ version, findings: [{ area, name, problem,
1193
- expected, found }] }`, `area` being `script`, `package`, `permission` or `hook`.
1254
+ the fix is `npm run hooks:install`, once per clone.
1255
+
1256
+ Then what this checkout lacks to run the project, the state of a clone or a new worktree rather
1257
+ than of the project, read from its files without network: the running Node against
1258
+ `engines.node` of `package.json` (`unsupported`) and the version `.nvmrc` names (`other version`;
1259
+ an alias such as `lts/*` is not judged); `node_modules` present (`missing`) and installed since
1260
+ the lockfile last changed (`outdated`, from the copy of the lockfile the package manager writes
1261
+ under `node_modules`); `ddd-ts-kit` and every `@ddd-ts-kit/*` package that `package.json`
1262
+ declares or `node_modules` holds, installed (`not installed`) at the version of the running CLI
1263
+ (`other version`). A project without a lockfile of its own inside a workspace (a `package.json`
1264
+ above it that declares `workspaces`, or a `pnpm-workspace.yaml`, with the lockfile) is read where
1265
+ the workspace installs, its packages resolved as Node does, from the project up; and, when the repository has a `.gitmodules`, every submodule initialised
1266
+ (`not initialised`, from `git submodule status`). Each comes with its fix: a Node that
1267
+ `engines.node` accepts (`nvm use`), `npm ci`, the packages of the kit upgraded together,
1268
+ `git submodule update --init --recursive`.
1269
+
1270
+ `--strict` exits 1 while something is missing or at another range, or while the checkout cannot
1271
+ run the project: a Node outside `engines.node`, no `node_modules`, a package of the kit not
1272
+ installed or at another version, a submodule not initialised. A script written otherwise, a hook
1273
+ this clone has not installed, a Node `.nvmrc` does not name while `engines.node` accepts it, and a
1274
+ lockfile changed since the install (a checkout may rewrite it with what `node_modules` already
1275
+ holds) are said without failing it. `--json` prints `{ version, findings: [{ area, name, problem,
1276
+ expected, found }] }`, `area` being `script`, `package`, `permission`, `hook`, `node`, `install`
1277
+ or `submodule`.
1194
1278
 
1195
1279
  ## worker-scope
1196
1280
 
@@ -1506,7 +1590,7 @@ generated pipelines wire all three.
1506
1590
 
1507
1591
  ```
1508
1592
  ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab]
1509
- [--changed-since <git-ref>] [--self]
1593
+ [--changed-since <git-ref>] [--explain] [--self]
1510
1594
  ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]
1511
1595
  ddd-ts-kit check --commit-size [--staged] [--strict]
1512
1596
  ```
@@ -1568,12 +1652,17 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
1568
1652
  - `paths` and `--changed-since` limit what is reported, not what is analysed.
1569
1653
  `--changed-since` runs `git diff --name-only --relative <ref>...` in the project.
1570
1654
  - `--format github` prints `::error file=...,line=...::` annotations.
1655
+ - `--explain` follows the violations with each rule they report, once, with its description and
1656
+ the reason it exists (as `explain` prints it, without the examples), and in JSON adds an
1657
+ `explanations` array. With `--format github` or `gitlab`, the reason goes at the end of the
1658
+ message of each annotation instead: a pull request shows an annotation alone on its line, and
1659
+ a Code Quality report has no place for text beside its issues. The fingerprints stay the same.
1571
1660
  - `--format gitlab` prints a GitLab Code Quality report: one issue per violation, `major` for
1572
1661
  an error and `minor` for a warning, with a fingerprint that does not depend on the line.
1573
1662
  - Severities come from `rules` in the config (`error`, `warn`, `off`). Default `error`, except
1574
1663
  `test/no-mocks`, `test/builder-required`, `clean/function-size`, `clean/no-noise-comment`,
1575
- `clean/no-flag-argument`, `standard/no-parallel-interface` and, held by ESLint,
1576
- `application/command-query-separation` (`warn`). `any` in a test file is
1664
+ `clean/no-flag-argument`, `standard/no-parallel-interface`, `declarations/port-adapter-wired`
1665
+ and, held by ESLint, `application/command-query-separation` (`warn`). `any` in a test file is
1577
1666
  always a warning.
1578
1667
  - `limits: { "maxParameters": 3, "maxFunctionLines": 30 }` in the config sets
1579
1668
  `clean/function-size`. `maxFunctionLines` goes from 1 to 100: a value above is read as 100 and
@@ -1622,7 +1711,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
1622
1711
  | `events/name-format` | an event name that is not `<context>.<aggregate>.<fact>` in kebab-case with the right context |
1623
1712
  | `events/name-declared-once` | a class of `domain/events/` without `static readonly eventName`, or whose `readonly name` writes the name again instead of reading it |
1624
1713
  | `events/defined-in-published-language` | `defineIntegrationEvent` outside a published language, without a payload, twice for one version; an event described by hand |
1625
- | `language/glossary-term` | a class of the model named with a word the glossary of its context does not define; an empty glossary; under `"stack.refusals": "factories"`, an error class of `domain/errors/` too |
1714
+ | `language/glossary-term` | a class of the model named with a word the glossary of its context does not define; an empty glossary; under `"stack.refusals": "factories"` or `"named"`, a class of `domain/errors/` too, a refusal class of `named` allowed the qualifiers `invalid`, `unknown`, `already`, `too`, `no`, `missing` and `required` besides (`codes.ts` is not judged) |
1626
1715
  | `language/declared-vocabulary` | a string literal whose value is a value of a closed vocabulary the project declares (an object `as const` exported with the union type of its name, a permission set of `definePermissions`), outside the file that declares it, in the place that speaks its language (its context; the platform and the route groups for the platform; everywhere for a permission id or the shared kernel); tests, published languages and the relationship schema are not judged, nor, outside `domain/`, a word typed by another language (a key of a `Record<T, ..>`, a value of a `Record<.., T>`, `'x' satisfies T`, `T` a type of a published language, of a package or of `infrastructure/anti-corruption/` or `infrastructure/external/`); under `"stack.literals": "named"` |
1627
1716
  | `language/no-technical-name` | `Manager`, `Helper`, `Util`, `Utils`, `Data`, `Info`, `Processor`, `Wrapper`, `Impl`, `Base`, `Abstract`, `Dto`, `Entity`, `Model` in a type declared under `domain/` or in a use case folder |
1628
1717
  | `purity/no-system-clock` | `new Date()` without argument, `Date.now()`, `performance.now()` in `domain/` or `application/` |
@@ -1668,6 +1757,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
1668
1757
  | `declarations/role-declared` | declared style only: a role file (other than `*.command.ts` and `*.query.ts`, held by `authz/declared`; `*.job.ts` under `application/scheduling/` with `@Scheduled` and `*.publisher.ts` with `@DomainEventHandler` are roles) exporting no class with the decorator of its suffix and folder, or one carrying another declaration; a declared class in a file that is not a role file; a `consumer` or `name` option that is missing, empty, a variable, a concatenation or a template with a substitution; any declaration decorator on a class under `domain/` |
1669
1758
  | `declarations/barrel-current` | declared style only: with `stack.assembly: barrel`, a missing `<context>.declarations.ts` or one that differs from one `export *` per role file sorted by path followed by one `injected(Class, [Tokens])` per class whose constructor takes something (read from the signatures, with their imports); with `discovery`, a barrel that still exists, and a `<context>.dependencies.ts` that differs from those `injected` statements (absent is accepted while it would hold none). The message names the missing role file or the class whose list is stale. It needs the tree, so `check-file` does not run it |
1670
1759
  | `declarations/constructor-injection` | declared style only, in a role file: on a class whose decorator lists nothing, a constructor parameter that is optional, has a default value, is a rest parameter or is destructured, has no type, or is typed by anything but one class name (type arguments aside): a union, an intersection, an array, a qualified name, a type of the language, an interface, a type alias, an enum or an unexported class of the file or of the file of the project it is imported from; a class that inherits its constructor from a class the project cannot read. Under `stack.dependencies: signature`, a decorator that carries a list although the constructor can be read: one that repeats it, one that differs |
1760
+ | `declarations/port-adapter-wired` | a class of `infrastructure/` implementing a port that nothing wires: no `@Repository`, `@Gateway` or `@Adapter` in the declared style, and no file of the composition root (`<context>.module.ts`, `main.ts`, `apps/<context>/main.ts`, the platform) importing it, once the file carries no `TODO(domain)` or `TODO(platform)` left; one kept on purpose carries `// ddd-ts-kit-disable-next-line declarations/port-adapter-wired -- ADR-NNNN: <why>` |
1671
1761
  | `ports/abstract-class` | in a port file (`domain/repositories/*.repository.ts`, `application/ports/*.port.ts`): a class that is not `abstract`; a member that is not an abstract method or property (`static readonly tokenKey = '<text>'` apart): a constructor, a body, an initializer, a `private`, `protected` or `#` member; an exported `interface` (a `type` alias, a data shape, is not reported) |
1672
1762
  | `ports/implements-never-extends` | a class carrying `@Repository(P)`, `@Gateway(P)` or `@Adapter(P)`, or given to `bind(P).toClass(C)` or `rebind(P).toClass(C)`, without `implements P` or with `extends P`; under `infrastructure/`, a class extending a class imported from a port file |
1673
1763
  | `ports/no-token-constant` | a call of `token` imported from a `@ddd-ts-kit/*` package; `Symbol(..)`, `Symbol.for(..)` or a string literal as the first argument of `bind`, `rebind`, `resolve`, `fake` or `override` in a file importing `@ddd-ts-kit/di`; an UPPER_SNAKE_CASE name in a dependency list; a file named `*.ports.ts` or `tokens.ts` |
@@ -1675,10 +1765,11 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
1675
1765
  | `ports/value-import` | a class named in a dependency list, or given to `bind` or `rebind`, imported with `import type` or `import { type X }` |
1676
1766
  | `scheduling/job-triggers-use-case` | in `application/scheduling/*.job.ts`: an exported class that does not implement `ScheduledJob`; a `run` that sends no command (no `.execute(` call); a repository in the dependency list or the constructor; an import from `domain/aggregates/`, `domain/entities/`, `domain/services/` or `infrastructure/`. A `builder.job(..)` registration of a class that lives elsewhere |
1677
1767
  | `scheduling/job-name` | the first argument of `@Scheduled(..)` or `.job(..)` that is not a string literal `<context>.<job-name>` in lower-case kebab-case with the context of its file; a `systemActor(..)` of a job file passing another name; one job name used twice in the project |
1678
- | `errors/code-unique` | under `"stack.refusals": "factories"`, in the `domain/errors/` of a context: a code set a second time, by a factory (`refusal('CODE', ..)`) or by a class (`readonly code = 'CODE'`), with the file and line of the first. The same code in two contexts is not reported |
1768
+ | `errors/code-unique` | under `"stack.refusals": "named"` or `"factories"`, in the `domain/errors/` of a context: a code set a second time, by a value of `codes.ts`, a factory (`refusal('CODE', ..)`) or a class (`readonly code = 'CODE'`), with the file and line of the first. The same code in two contexts is not reported |
1769
+ | `errors/code-listed` | under `"stack.refusals": "named"`, in the `domain/errors/` of a context: a refusal class (extending `DomainRefusal`) whose code is not `readonly code = <Context>Codes.<Class>` from the `codes.ts` of its context, refusal classes and no `codes.ts`, a class the list does not hold; in `codes.ts`, no list `<Context>Codes` or one not declared `as const`, a key that names no refusal class of the context, a value that is not a string literal in constant case |
1679
1770
  | `schema/presentation-only` | under `"stack.schemas": "shared"`: in the shared kernel outside `presentation/`, an import of a validation library; in `domain/`, `application/`, `infrastructure/`, `published-language/` and the shared kernel outside `presentation/`, an import of a file of `presentation/` of the shared kernel |
1680
1771
  | `schema/no-duplicate-shape` | under `"stack.schemas": "shared"`, in the presentation layer of one context, or in it and `presentation/` of the shared kernel: a DTO class or an object schema (`z.object`, `v.object`, `Type.Object`) declaring the shape of another one, with the place of the original (the shared kernel, then `presentation/http/shared/`); two contexts are not compared, and request parameters and shapes still carrying a `TODO(domain)` of the generator are not judged |
1681
- | `errors/known-code` | under `"stack.refusals": "factories"`, in a `*.route.ts`: a code of the `errors` list that no refusal of the context of the route sets, that no class outside the contexts sets, and that is not a code of the kit |
1772
+ | `errors/known-code` | under `"stack.refusals": "named"` or `"factories"`, in a `*.route.ts`: a code of the `errors` list that the `codes.ts` of the context of the route does not list, that no refusal of that context sets, that no class outside the contexts sets, and that is not a code of the kit |
1682
1773
  | `domain/value-object-class` | under `"stack.values": "classes"`: in `domain/value-objects/` of a context or a `*.vo.ts` of the shared kernel outside `presentation/`, no exported class or a second one, a class that extends neither `ValueObject` nor another value object of the project, a public constructor, a concrete class without a static method, an exported function, arrow constant or object literal (inline, listed or by default); in `domain/` and in the shared kernel outside `presentation/`, an exported function that answers a record of data: data entries, no spread, nothing a call of the model built |
1683
1774
 
1684
1775
  More ids belong to `@ddd-ts-kit/eslint-plugin`, which reads the syntax tree where this
@@ -1818,6 +1909,21 @@ Runs the per-file rules (layers, contexts, naming, events, language, purity, cle
1818
1909
  composition, suppressions) on one file without walking the project: meant for an editor or
1819
1910
  agent hook after each write. A file that is not a source of the project is ignored.
1820
1911
 
1912
+ ## lint
1913
+
1914
+ ```
1915
+ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix]
1916
+ ```
1917
+
1918
+ What `lint` and `ci:lint` of a generated project run: the ESLint of the project, through its API,
1919
+ on the paths given (the project otherwise), its report in the format asked (`--format gitlab`
1920
+ writes the Code Quality report as `eslint-formatter-gitlab` does), `--fix` as ESLint takes it.
1921
+ It exits 1 on an error, and on a warning as on an error, but on a warning of a rule of the kit in
1922
+ transition: a rule new in this version, whose documentation names the version in which it becomes
1923
+ an error. Those are shown in the report and listed after it, one line per rule, without failing:
1924
+ an upgrade of the kit never turns a green lint red. Without ESLint installed it exits 2 and names
1925
+ the install. See [Quality baseline](../../docs/tools/quality-baseline.md#warnings-fail-the-lint).
1926
+
1821
1927
  ## rules, explain
1822
1928
 
1823
1929
  ```
@@ -3,6 +3,8 @@ export interface Role {
3
3
  readonly directory: string;
4
4
  /** Accepted file suffixes; empty when the role only requires kebab-case. */
5
5
  readonly suffixes: readonly string[];
6
+ /** Whole file names the role accepts besides its suffixes: the code list `codes.ts` of `domain/errors`. */
7
+ readonly files?: readonly string[];
6
8
  /** Counted by naming/one-concept-per-file when true. */
7
9
  readonly oneConcept?: boolean;
8
10
  /** Suffixes whose files need a spec (test/spec-required). */
@@ -1 +1 @@
1
- {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/role.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,wDAAwD;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC"}
1
+ {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/role.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,2GAA2G;IAC3G,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,wDAAwD;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC"}
@@ -6,7 +6,7 @@ export const ROLES = [
6
6
  { directory: 'domain/value-objects', suffixes: ['.vo.ts'], oneConcept: true, specFor: ['.vo.ts'] },
7
7
  { directory: 'domain/vocabularies', suffixes: ['.vocabulary.ts'], oneConcept: true },
8
8
  { directory: 'domain/events', suffixes: ['.event.ts'], oneConcept: true },
9
- { directory: 'domain/errors', suffixes: ['.error.ts'] },
9
+ { directory: 'domain/errors', suffixes: ['.error.ts'], files: ['codes.ts'] },
10
10
  { directory: 'domain/repositories', suffixes: ['.repository.ts'] },
11
11
  { directory: 'domain/services', suffixes: ['.service.ts'], specFor: ['.service.ts'] },
12
12
  {
@@ -1 +1 @@
1
- {"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../src/check/canonical/roles.ts"],"names":[],"mappings":"AAEA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC,EAAE,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjD,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE;IAC7G,EAAE,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5E,EAAE,SAAS,EAAE,sBAAsB,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE;IAClG,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;IACpF,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;IACzE,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;IACvD,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,g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A,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAyF7C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EAwF7C,CAAC"}
1
+ {"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA4F7C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EA2F7C,CAAC"}
@@ -25,10 +25,12 @@ import { contextPublishedLanguageIsAContract } from '../rules/context-published-
25
25
  import { contextPublishedLanguageOnly } from '../rules/context-published-language-only.js';
26
26
  import { declarationsBarrelCurrent } from '../rules/declarations-barrel-current.js';
27
27
  import { declarationsConstructorInjection } from '../rules/declarations-constructor-injection.js';
28
+ import { declarationsPortAdapterWired } from '../rules/declarations-port-adapter-wired.js';
28
29
  import { declarationsRoleDeclared } from '../rules/declarations-role-declared.js';
29
30
  import { domainEventsDispatchedOnSave } from '../rules/domain-events-dispatched-on-save.js';
30
31
  import { domainEventsTransactionalBeforeCommit } from '../rules/domain-events-transactional-before-commit.js';
31
32
  import { domainValueObjectClass } from '../rules/domain-value-object-class.js';
33
+ import { errorsCodeListed } from '../rules/errors-code-listed.js';
32
34
  import { errorsCodeUnique } from '../rules/errors-code-unique.js';
33
35
  import { eventSourcingPastTense } from '../rules/event-sourcing-past-tense.js';
34
36
  import { eventSourcingProjectionNeverAppends } from '../rules/event-sourcing-projection-never-appends.js';
@@ -60,6 +62,7 @@ import { namingSearchNotList } from '../rules/naming-search-not-list.js';
60
62
  import { namingSuffix } from '../rules/naming-suffix.js';
61
63
  import { persistenceMigrationHistory } from '../rules/persistence-migration-history.js';
62
64
  import { persistenceNoFileContent } from '../rules/persistence-no-file-content.js';
65
+ import { persistencePrimaryKeyOrder } from '../rules/persistence-primary-key-order.js';
63
66
  import { portsAbstractClass } from '../rules/ports-abstract-class.js';
64
67
  import { portsImplementsNeverExtends } from '../rules/ports-implements-never-extends.js';
65
68
  import { portsNoConcreteDependency } from '../rules/ports-no-concrete-dependency.js';
@@ -157,6 +160,7 @@ export const ARCHITECTURE_RULES = [
157
160
  declarationsRoleDeclared,
158
161
  declarationsBarrelCurrent,
159
162
  declarationsConstructorInjection,
163
+ declarationsPortAdapterWired,
160
164
  portsAbstractClass,
161
165
  portsImplementsNeverExtends,
162
166
  portsNoTokenConstant,
@@ -170,9 +174,11 @@ export const ARCHITECTURE_RULES = [
170
174
  importsExtension,
171
175
  importsAliasDeclared,
172
176
  errorsCodeUnique,
177
+ errorsCodeListed,
173
178
  errorsKnownCode,
174
179
  persistenceMigrationHistory,
175
180
  persistenceNoFileContent,
181
+ persistencePrimaryKeyOrder,
176
182
  filesPortNotConnector,
177
183
  ];
178
184
  //# sourceMappingURL=architecture-rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC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,gBAAgB;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,2BAA2B;IAC3B,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,gCAAgC;IAChC,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,qBAAqB;CACtB,CAAC"}
1
+ {"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,E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;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,2BAA2B;IAC3B,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,gCAAgC;IAChC,4BAA4B;IAC5B,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;CACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"default-severities.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/default-severities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,0GAA0G;AAC1G,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAajE,CAAC"}
1
+ {"version":3,"file":"default-severities.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/default-severities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,0GAA0G;AAC1G,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAejE,CAAC"}
@@ -12,5 +12,7 @@ export const DEFAULT_SEVERITIES = {
12
12
  'tree/documented-paths': 'warn',
13
13
  'test/helper-placed': 'warn',
14
14
  'test/acceptance-black-box': 'warn',
15
+ 'persistence/primary-key-order': 'warn',
16
+ 'declarations/port-adapter-wired': 'warn',
15
17
  };
16
18
  //# sourceMappingURL=default-severities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-severities.js","sourceRoot":"","sources":["../../../src/check/catalogue/default-severities.ts"],"names":[],"mappings":"AAEA,0GAA0G;AAC1G,MAAM,CAAC,MAAM,kBAAkB,GAAuC;IACpE,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,MAAM;IACvB,uBAAuB,EAAE,MAAM;IAC/B,qBAAqB,EAAE,MAAM;IAC7B,wBAAwB,EAAE,MAAM;IAChC,wBAAwB,EAAE,MAAM;IAChC,sCAAsC,EAAE,MAAM;IAC9C,gCAAgC,EAAE,MAAM;IACxC,4BAA4B,EAAE,MAAM;IACpC,uBAAuB,EAAE,MAAM;IAC/B,oBAAoB,EAAE,MAAM;IAC5B,2BAA2B,EAAE,MAAM;CACpC,CAAC"}
1
+ {"version":3,"file":"default-severities.js","sourceRoot":"","sources":["../../../src/check/catalogue/default-severities.ts"],"names":[],"mappings":"AAEA,0GAA0G;AAC1G,MAAM,CAAC,MAAM,kBAAkB,GAAuC;IACpE,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,MAAM;IACvB,uBAAuB,EAAE,MAAM;IAC/B,qBAAqB,EAAE,MAAM;IAC7B,wBAAwB,EAAE,MAAM;IAChC,wBAAwB,EAAE,MAAM;IAChC,sCAAsC,EAAE,MAAM;IAC9C,gCAAgC,EAAE,MAAM;IACxC,4BAA4B,EAAE,MAAM;IACpC,uBAAuB,EAAE,MAAM;IAC/B,oBAAoB,EAAE,MAAM;IAC5B,2BAA2B,EAAE,MAAM;IACnC,+BAA+B,EAAE,MAAM;IACvC,iCAAiC,EAAE,MAAM;CAC1C,CAAC"}
@@ -17,15 +17,15 @@ export const ESLINT_ONLY_RULES = [
17
17
  },
18
18
  {
19
19
  id: 'errors/through-factory',
20
- description: 'Under "stack.refusals": "factories", a domain error is built by a static factory of its concept class: no `new` of a class of domain/errors/ outside that class.',
20
+ description: 'Under "stack.refusals": "factories" or "named", a domain error is built by a static factory of its class: no `new` of a class of domain/errors/ outside that class, nor of a class extending DomainRefusal.',
21
21
  },
22
22
  {
23
23
  id: 'errors/constructor-not-public',
24
- description: 'Under "stack.refusals": "factories", the constructor of an error class of domain/errors/ is not public: the class extends ConceptError and declares none, or declares it private or protected.',
24
+ description: 'Under "stack.refusals": "factories" or "named", the constructor of an error class of domain/errors/ is not public: the class extends ConceptError or DomainRefusal and declares none, or declares it private or protected.',
25
25
  },
26
26
  {
27
27
  id: 'errors/factory-name',
28
- description: 'Under "stack.refusals": "factories", a static factory of an error class is named after the refusal, never `create`, `make`, `of` or `error1`, and its code is that name in constant case, alone or with the name of the concept.',
28
+ description: 'Under "stack.refusals": "factories", a static factory of an error class is named after the refusal, never `create`, `make`, `of` or `error1`, and its code is that name in constant case, alone or with the name of the concept. Under "named", the class is named after the refusal, never `...Error`, and a factory after what the refusal is about: for, with, because, on or at, then an upper-case letter, no digit.',
29
29
  },
30
30
  {
31
31
  id: 'clean/no-magic-number',
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-only-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/eslint-only-rules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqE;IACjG;QACE,EAAE,EAAE,gCAAgC;QACpC,WAAW,EACT,0GAA0G;KAC7G;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,kGAAkG;KAChH;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,WAAW,EAAE,sGAAsG;KACpH;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EACT,kKAAkK;KACrK;IACD;QACE,EAAE,EAAE,+BAA+B;QACnC,WAAW,EACT,gMAAgM;KACnM;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,WAAW,EACT,kOAAkO;KACrO;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EACT,gLAAgL;KACnL;IACD;QACE,EAAE,EAAE,2BAA2B;QAC/B,WAAW,EAAE,6EAA6E;KAC3F;IACD,EAAE,EAAE,EAAE,sCAAsC,EAAE,WAAW,EAAE,oDAAoD,EAAE;IACjH;QACE,EAAE,EAAE,+BAA+B;QACnC,WAAW,EACT,sHAAsH;KACzH;IACD;QACE,EAAE,EAAE,mCAAmC;QACvC,WAAW,EACT,kKAAkK;KACrK;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,WAAW,EACT,wMAAwM;KAC3M;IACD;QACE,EAAE,EAAE,gCAAgC;QACpC,WAAW,EACT,uHAAuH;KAC1H;CACF,CAAC"}
1
+ {"version":3,"file":"eslint-only-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/eslint-only-rules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqE;IACjG;QACE,EAAE,EAAE,gCAAgC;QACpC,WAAW,EACT,0GAA0G;KAC7G;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,kGAAkG;KAChH;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,WAAW,EAAE,sGAAsG;KACpH;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EACT,6MAA6M;KAChN;IACD;QACE,EAAE,EAAE,+BAA+B;QACnC,WAAW,EACT,4NAA4N;KAC/N;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,WAAW,EACT,2ZAA2Z;KAC9Z;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EACT,gLAAgL;KACnL;IACD;QACE,EAAE,EAAE,2BAA2B;QAC/B,WAAW,EAAE,6EAA6E;KAC3F;IACD,EAAE,EAAE,EAAE,sCAAsC,EAAE,WAAW,EAAE,oDAAoD,EAAE;IACjH;QACE,EAAE,EAAE,+BAA+B;QACnC,WAAW,EACT,sHAAsH;KACzH;IACD;QACE,EAAE,EAAE,mCAAmC;QACvC,WAAW,EACT,kKAAkK;KACrK;IACD;QACE,EAAE,EAAE,kCAAkC;QACtC,WAAW,EACT,wMAAwM;KAC3M;IACD;QACE,EAAE,EAAE,gCAAgC;QACpC,WAAW,EACT,uHAAuH;KAC1H;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"check-command.d.ts","sourceRoot":"","sources":["../../../src/check/commands/check-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAiBzD,eAAO,MAAM,YAAY,EAAE,OAoB1B,CAAC"}
1
+ {"version":3,"file":"check-command.d.ts","sourceRoot":"","sources":["../../../src/check/commands/check-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAkBzD,eAAO,MAAM,YAAY,EAAE,OAuB1B,CAAC"}
@@ -8,6 +8,7 @@ import { CLEAN_RULE_IDS } from '../catalogue/clean-rule-ids.js';
8
8
  import { formatCheck } from '../engine/format-check.js';
9
9
  import { runCheck } from '../engine/run-check.js';
10
10
  import { summarize } from '../engine/summarize.js';
11
+ import { explanationsOf } from '../explain/explanations-of.js';
11
12
  import { loadLooseProject } from '../project/load-loose-project.js';
12
13
  import { loadProject } from '../project/load-project.js';
13
14
  import { toPosix } from '../project/to-posix.js';
@@ -22,6 +23,7 @@ export const checkCommand = (argv, io) => {
22
23
  'changed-since': { type: 'string' },
23
24
  self: { type: 'boolean', default: false },
24
25
  'clean-only': { type: 'boolean', default: false },
26
+ explain: { type: 'boolean', default: false },
25
27
  });
26
28
  if (args.flag('self')) {
27
29
  return selfCheck(args, io);
@@ -29,7 +31,8 @@ export const checkCommand = (argv, io) => {
29
31
  const format = formatOf(args);
30
32
  const rules = knownRules(args.many('rule'));
31
33
  const result = args.flag('clean-only') ? checkCleanliness(args, rules) : checkProject(args, rules);
32
- io.out(formatCheck(result, format));
34
+ const explanations = args.flag('explain') ? explanationsOf(result.violations) : undefined;
35
+ io.out(formatCheck(result, format, explanations));
33
36
  return result.errorCount > 0 ? 1 : 0;
34
37
  };
35
38
  function formatOf(args) {