ddd-ts-kit 0.86.0 → 0.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.fr.md +38 -39
  3. package/README.md +38 -37
  4. package/dist/check/canonical/earlier-context-file.d.ts +15 -0
  5. package/dist/check/canonical/earlier-context-file.d.ts.map +1 -0
  6. package/dist/check/canonical/earlier-context-file.js +33 -0
  7. package/dist/check/canonical/earlier-context-file.js.map +1 -0
  8. package/dist/check/canonical/stray-entry.d.ts.map +1 -1
  9. package/dist/check/canonical/stray-entry.js +11 -9
  10. package/dist/check/canonical/stray-entry.js.map +1 -1
  11. package/dist/check/configuration/module-problems.js +2 -2
  12. package/dist/check/configuration/module-problems.js.map +1 -1
  13. package/dist/check/errors/code-list.d.ts +1 -1
  14. package/dist/check/errors/code-list.d.ts.map +1 -1
  15. package/dist/check/errors/is-codes-file.d.ts +1 -1
  16. package/dist/check/errors/is-codes-file.d.ts.map +1 -1
  17. package/dist/check/errors/is-codes-file.js +1 -1
  18. package/dist/check/errors/is-codes-file.js.map +1 -1
  19. package/dist/check/explain/errors-docs.js +5 -5
  20. package/dist/check/explain/errors-docs.js.map +1 -1
  21. package/dist/check/explain/language-docs.js +1 -1
  22. package/dist/check/explain/language-docs.js.map +1 -1
  23. package/dist/check/explain/layout-docs.js +1 -1
  24. package/dist/check/explain/layout-docs.js.map +1 -1
  25. package/dist/check/explain/module-docs.d.ts.map +1 -1
  26. package/dist/check/explain/module-docs.js +16 -12
  27. package/dist/check/explain/module-docs.js.map +1 -1
  28. package/dist/check/explain/tree-docs.js +2 -2
  29. package/dist/check/explain/tree-docs.js.map +1 -1
  30. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  31. package/dist/check/explain/wiring-docs.js +8 -7
  32. package/dist/check/explain/wiring-docs.js.map +1 -1
  33. package/dist/check/fixtures/authz-granted-fixtures.js +2 -2
  34. package/dist/check/fixtures/authz-granted-fixtures.js.map +1 -1
  35. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  36. package/dist/check/fixtures/authz-policy-fixtures.js +3 -3
  37. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  38. package/dist/check/fixtures/authz-scope-narrows-fixtures.js +4 -4
  39. package/dist/check/fixtures/authz-scope-narrows-fixtures.js.map +1 -1
  40. package/dist/check/fixtures/constructor-injection-fixtures.js +6 -6
  41. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
  42. package/dist/check/fixtures/context-file-fixtures.d.ts +4 -0
  43. package/dist/check/fixtures/context-file-fixtures.d.ts.map +1 -0
  44. package/dist/check/fixtures/context-file-fixtures.js +36 -0
  45. package/dist/check/fixtures/context-file-fixtures.js.map +1 -0
  46. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  47. package/dist/check/fixtures/declarations-fixtures.js +15 -36
  48. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  49. package/dist/check/fixtures/declared-declarations.d.ts +4 -2
  50. package/dist/check/fixtures/declared-declarations.d.ts.map +1 -1
  51. package/dist/check/fixtures/declared-declarations.js +9 -3
  52. package/dist/check/fixtures/declared-declarations.js.map +1 -1
  53. package/dist/check/fixtures/earlier-declarations-fixtures.d.ts +4 -0
  54. package/dist/check/fixtures/earlier-declarations-fixtures.d.ts.map +1 -0
  55. package/dist/check/fixtures/earlier-declarations-fixtures.js +48 -0
  56. package/dist/check/fixtures/earlier-declarations-fixtures.js.map +1 -0
  57. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  58. package/dist/check/fixtures/fixtures.js +4 -0
  59. package/dist/check/fixtures/fixtures.js.map +1 -1
  60. package/dist/check/fixtures/module-fixtures.d.ts.map +1 -1
  61. package/dist/check/fixtures/module-fixtures.js +50 -17
  62. package/dist/check/fixtures/module-fixtures.js.map +1 -1
  63. package/dist/check/fixtures/named-refusal-fixtures.js +5 -5
  64. package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -1
  65. package/dist/check/fixtures/paths.d.ts +1 -1
  66. package/dist/check/fixtures/paths.js +1 -1
  67. package/dist/check/fixtures/paths.js.map +1 -1
  68. package/dist/check/fixtures/vocabulary-fixtures.js +2 -2
  69. package/dist/check/fixtures/vocabulary-fixtures.js.map +1 -1
  70. package/dist/check/project/locate.d.ts.map +1 -1
  71. package/dist/check/project/locate.js +18 -9
  72. package/dist/check/project/locate.js.map +1 -1
  73. package/dist/check/rules/declarations-barrel-current.js +16 -11
  74. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  75. package/dist/check/rules/errors-code-listed.js +6 -8
  76. package/dist/check/rules/errors-code-listed.js.map +1 -1
  77. package/dist/check/rules/errors-code-unique.js +2 -2
  78. package/dist/check/rules/errors-code-unique.js.map +1 -1
  79. package/dist/check/rules/errors-known-code.js +2 -2
  80. package/dist/check/rules/errors-known-code.js.map +1 -1
  81. package/dist/check/rules/language-glossary-term.js +1 -1
  82. package/dist/check/rules/language-glossary-term.js.map +1 -1
  83. package/dist/check/rules/module-complete.d.ts.map +1 -1
  84. package/dist/check/rules/module-complete.js +67 -13
  85. package/dist/check/rules/module-complete.js.map +1 -1
  86. package/dist/check/rules/naming-suffix.d.ts.map +1 -1
  87. package/dist/check/rules/naming-suffix.js +12 -9
  88. package/dist/check/rules/naming-suffix.js.map +1 -1
  89. package/dist/check/rules/tree-closed.d.ts.map +1 -1
  90. package/dist/check/rules/tree-closed.js +8 -1
  91. package/dist/check/rules/tree-closed.js.map +1 -1
  92. package/dist/check/support/is-generated-context-file.d.ts +1 -1
  93. package/dist/check/support/is-generated-context-file.js +1 -1
  94. package/dist/check/support/path-in-context.d.ts +5 -1
  95. package/dist/check/support/path-in-context.d.ts.map +1 -1
  96. package/dist/check/support/path-in-context.js +12 -3
  97. package/dist/check/support/path-in-context.js.map +1 -1
  98. package/dist/commands/context-layout.d.ts +4 -0
  99. package/dist/commands/context-layout.d.ts.map +1 -0
  100. package/dist/commands/context-layout.js +48 -0
  101. package/dist/commands/context-layout.js.map +1 -0
  102. package/dist/commands/docs.d.ts.map +1 -1
  103. package/dist/commands/docs.js +14 -9
  104. package/dist/commands/docs.js.map +1 -1
  105. package/dist/commands/generate.js +2 -2
  106. package/dist/commands/generate.js.map +1 -1
  107. package/dist/commands/move-to-module.d.ts.map +1 -1
  108. package/dist/commands/move-to-module.js +2 -0
  109. package/dist/commands/move-to-module.js.map +1 -1
  110. package/dist/config/stack.d.ts +1 -1
  111. package/dist/context-files/context-file-at.d.ts +7 -0
  112. package/dist/context-files/context-file-at.d.ts.map +1 -0
  113. package/dist/context-files/context-file-at.js +9 -0
  114. package/dist/context-files/context-file-at.js.map +1 -0
  115. package/dist/context-files/context-file-placement.d.ts +8 -0
  116. package/dist/context-files/context-file-placement.d.ts.map +1 -0
  117. package/dist/context-files/context-file-placement.js +23 -0
  118. package/dist/context-files/context-file-placement.js.map +1 -0
  119. package/dist/context-files/context-file.d.ts +16 -0
  120. package/dist/context-files/context-file.d.ts.map +1 -0
  121. package/dist/context-files/context-file.js +12 -0
  122. package/dist/context-files/context-file.js.map +1 -0
  123. package/dist/context-files/earlier-place-of.d.ts +7 -0
  124. package/dist/context-files/earlier-place-of.d.ts.map +1 -0
  125. package/dist/context-files/earlier-place-of.js +10 -0
  126. package/dist/context-files/earlier-place-of.js.map +1 -0
  127. package/dist/context-files/index.d.ts +5 -0
  128. package/dist/context-files/index.d.ts.map +1 -0
  129. package/dist/context-files/index.js +5 -0
  130. package/dist/context-files/index.js.map +1 -0
  131. package/dist/context-layout/context-layout.d.ts +19 -0
  132. package/dist/context-layout/context-layout.d.ts.map +1 -0
  133. package/dist/context-layout/context-layout.js +55 -0
  134. package/dist/context-layout/context-layout.js.map +1 -0
  135. package/dist/context-layout/index.d.ts +2 -0
  136. package/dist/context-layout/index.d.ts.map +1 -0
  137. package/dist/context-layout/index.js +2 -0
  138. package/dist/context-layout/index.js.map +1 -0
  139. package/dist/context-layout/module-moves.d.ts +21 -0
  140. package/dist/context-layout/module-moves.d.ts.map +1 -0
  141. package/dist/context-layout/module-moves.js +146 -0
  142. package/dist/context-layout/module-moves.js.map +1 -0
  143. package/dist/controllers/migrate-context.js +20 -15
  144. package/dist/controllers/migrate-context.js.map +1 -1
  145. package/dist/controllers/plan-context.d.ts +5 -1
  146. package/dist/controllers/plan-context.d.ts.map +1 -1
  147. package/dist/controllers/plan-context.js +19 -5
  148. package/dist/controllers/plan-context.js.map +1 -1
  149. package/dist/declared/barrel-file.d.ts +1 -1
  150. package/dist/declared/barrel-file.js +1 -1
  151. package/dist/declared/context-declarations.d.ts +4 -2
  152. package/dist/declared/context-declarations.d.ts.map +1 -1
  153. package/dist/declared/context-declarations.js +4 -2
  154. package/dist/declared/context-declarations.js.map +1 -1
  155. package/dist/declared/declarations-folder-of.d.ts +12 -7
  156. package/dist/declared/declarations-folder-of.d.ts.map +1 -1
  157. package/dist/declared/declarations-folder-of.js +15 -11
  158. package/dist/declared/declarations-folder-of.js.map +1 -1
  159. package/dist/declared/earlier-layout-notice.d.ts +10 -0
  160. package/dist/declared/earlier-layout-notice.d.ts.map +1 -0
  161. package/dist/declared/earlier-layout-notice.js +12 -0
  162. package/dist/declared/earlier-layout-notice.js.map +1 -0
  163. package/dist/declared/earlier-layout-of.d.ts +10 -0
  164. package/dist/declared/earlier-layout-of.d.ts.map +1 -0
  165. package/dist/declared/earlier-layout-of.js +16 -0
  166. package/dist/declared/earlier-layout-of.js.map +1 -0
  167. package/dist/declared/earlier-shape-of.d.ts +13 -0
  168. package/dist/declared/earlier-shape-of.d.ts.map +1 -0
  169. package/dist/declared/earlier-shape-of.js +35 -0
  170. package/dist/declared/earlier-shape-of.js.map +1 -0
  171. package/dist/declared/folder-declarations-file.d.ts +6 -4
  172. package/dist/declared/folder-declarations-file.d.ts.map +1 -1
  173. package/dist/declared/folder-declarations-file.js +7 -5
  174. package/dist/declared/folder-declarations-file.js.map +1 -1
  175. package/dist/declared/index.d.ts +3 -2
  176. package/dist/declared/index.d.ts.map +1 -1
  177. package/dist/declared/index.js +3 -2
  178. package/dist/declared/index.js.map +1 -1
  179. package/dist/declared/is-declarations-file.d.ts +3 -2
  180. package/dist/declared/is-declarations-file.d.ts.map +1 -1
  181. package/dist/declared/is-declarations-file.js +9 -9
  182. package/dist/declared/is-declarations-file.js.map +1 -1
  183. package/dist/declared/keeps-role-folder-files.d.ts +12 -0
  184. package/dist/declared/keeps-role-folder-files.d.ts.map +1 -0
  185. package/dist/declared/keeps-role-folder-files.js +25 -0
  186. package/dist/declared/keeps-role-folder-files.js.map +1 -0
  187. package/dist/declared/keeps-single-file.d.ts +1 -1
  188. package/dist/declared/keeps-single-file.js +1 -1
  189. package/dist/declared/render-declarations.d.ts +7 -3
  190. package/dist/declared/render-declarations.d.ts.map +1 -1
  191. package/dist/declared/render-declarations.js +5 -3
  192. package/dist/declared/render-declarations.js.map +1 -1
  193. package/dist/declared/render-folder-declarations.d.ts +2 -2
  194. package/dist/declared/same-files.d.ts +3 -0
  195. package/dist/declared/same-files.d.ts.map +1 -0
  196. package/dist/declared/same-files.js +5 -0
  197. package/dist/declared/same-files.js.map +1 -0
  198. package/dist/depcruise/layer-rules.js +21 -7
  199. package/dist/depcruise/layer-rules.js.map +1 -1
  200. package/dist/describe/read-adapters.d.ts.map +1 -1
  201. package/dist/describe/read-adapters.js +6 -4
  202. package/dist/describe/read-adapters.js.map +1 -1
  203. package/dist/describe/read-controllers.d.ts.map +1 -1
  204. package/dist/describe/read-controllers.js +5 -3
  205. package/dist/describe/read-controllers.js.map +1 -1
  206. package/dist/describe/read-errors.d.ts +1 -1
  207. package/dist/describe/read-errors.d.ts.map +1 -1
  208. package/dist/describe/read-errors.js +5 -3
  209. package/dist/describe/read-errors.js.map +1 -1
  210. package/dist/describe/read-routes.d.ts.map +1 -1
  211. package/dist/describe/read-routes.js +5 -5
  212. package/dist/describe/read-routes.js.map +1 -1
  213. package/dist/dev/refresh-declarations.d.ts.map +1 -1
  214. package/dist/dev/refresh-declarations.js +1 -1
  215. package/dist/dev/refresh-declarations.js.map +1 -1
  216. package/dist/docs/context-facts.d.ts +1 -1
  217. package/dist/docs/context-facts.d.ts.map +1 -1
  218. package/dist/docs/read-context.d.ts.map +1 -1
  219. package/dist/docs/read-context.js +2 -1
  220. package/dist/docs/read-context.js.map +1 -1
  221. package/dist/docs/refresh-context-doc.js +1 -1
  222. package/dist/docs/refresh-context-doc.js.map +1 -1
  223. package/dist/docs/state-machine-lines.d.ts +1 -1
  224. package/dist/docs/state-machine-lines.d.ts.map +1 -1
  225. package/dist/docs/state-machine-lines.js +6 -2
  226. package/dist/docs/state-machine-lines.js.map +1 -1
  227. package/dist/docs/write-docs.d.ts +3 -3
  228. package/dist/docs/write-docs.d.ts.map +1 -1
  229. package/dist/docs/write-docs.js +3 -3
  230. package/dist/docs/write-docs.js.map +1 -1
  231. package/dist/file-moves/file-move.d.ts +6 -0
  232. package/dist/file-moves/file-move.d.ts.map +1 -0
  233. package/dist/file-moves/file-move.js +2 -0
  234. package/dist/file-moves/file-move.js.map +1 -0
  235. package/dist/file-moves/index.d.ts +3 -0
  236. package/dist/file-moves/index.d.ts.map +1 -0
  237. package/dist/file-moves/index.js +2 -0
  238. package/dist/file-moves/index.js.map +1 -0
  239. package/dist/file-moves/move-files.d.ts +15 -0
  240. package/dist/file-moves/move-files.d.ts.map +1 -0
  241. package/dist/file-moves/move-files.js +37 -0
  242. package/dist/file-moves/move-files.js.map +1 -0
  243. package/dist/generate/errors/codes-list.d.ts +1 -1
  244. package/dist/generate/errors/codes-list.d.ts.map +1 -1
  245. package/dist/generate/errors/write-named-refusal.d.ts +1 -1
  246. package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
  247. package/dist/generate/errors/write-named-refusal.js +3 -2
  248. package/dist/generate/errors/write-named-refusal.js.map +1 -1
  249. package/dist/generate/kind.d.ts +1 -1
  250. package/dist/generate/kind.d.ts.map +1 -1
  251. package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
  252. package/dist/generate/kinds/adapter-kind.js +22 -2
  253. package/dist/generate/kinds/adapter-kind.js.map +1 -1
  254. package/dist/generate/kinds/error-kind.js +1 -1
  255. package/dist/generate/kinds/error-kind.js.map +1 -1
  256. package/dist/generate/kinds/module-kind.js +1 -1
  257. package/dist/generate/kinds/module-kind.js.map +1 -1
  258. package/dist/generate/kinds/port-kind.d.ts.map +1 -1
  259. package/dist/generate/kinds/port-kind.js +3 -1
  260. package/dist/generate/kinds/port-kind.js.map +1 -1
  261. package/dist/generate/kinds/presentation/controller-of.d.ts +1 -1
  262. package/dist/generate/kinds/presentation/controller-of.d.ts.map +1 -1
  263. package/dist/generate/kinds/presentation/controller-of.js +7 -5
  264. package/dist/generate/kinds/presentation/controller-of.js.map +1 -1
  265. package/dist/generate/permissions-file.d.ts +4 -1
  266. package/dist/generate/permissions-file.d.ts.map +1 -1
  267. package/dist/generate/permissions-file.js +6 -2
  268. package/dist/generate/permissions-file.js.map +1 -1
  269. package/dist/generate/place-context-files.d.ts +9 -0
  270. package/dist/generate/place-context-files.d.ts.map +1 -0
  271. package/dist/generate/place-context-files.js +14 -0
  272. package/dist/generate/place-context-files.js.map +1 -0
  273. package/dist/generate/place-generated-files.d.ts +18 -0
  274. package/dist/generate/place-generated-files.d.ts.map +1 -0
  275. package/dist/generate/{place-in-modules.js → place-generated-files.js} +42 -17
  276. package/dist/generate/place-generated-files.js.map +1 -0
  277. package/dist/generate/refresh-barrels.d.ts +17 -11
  278. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  279. package/dist/generate/refresh-barrels.js +32 -26
  280. package/dist/generate/refresh-barrels.js.map +1 -1
  281. package/dist/generate/refresh-docs.d.ts +2 -2
  282. package/dist/generate/refresh-docs.d.ts.map +1 -1
  283. package/dist/generate/refresh-docs.js +6 -3
  284. package/dist/generate/refresh-docs.js.map +1 -1
  285. package/dist/generate/refuse-earlier-layout.d.ts +9 -0
  286. package/dist/generate/refuse-earlier-layout.d.ts.map +1 -0
  287. package/dist/generate/refuse-earlier-layout.js +15 -0
  288. package/dist/generate/refuse-earlier-layout.js.map +1 -0
  289. package/dist/help/notes.d.ts +1 -1
  290. package/dist/help/notes.d.ts.map +1 -1
  291. package/dist/help/notes.js +24 -9
  292. package/dist/help/notes.js.map +1 -1
  293. package/dist/help/usage.d.ts +1 -1
  294. package/dist/help/usage.d.ts.map +1 -1
  295. package/dist/help/usage.js +1 -0
  296. package/dist/help/usage.js.map +1 -1
  297. package/dist/init/manifest/versions.js +24 -24
  298. package/dist/init/run-init.d.ts.map +1 -1
  299. package/dist/init/run-init.js +6 -0
  300. package/dist/init/run-init.js.map +1 -1
  301. package/dist/knip/ignore-code-types-where-they-are.d.ts +11 -0
  302. package/dist/knip/ignore-code-types-where-they-are.d.ts.map +1 -0
  303. package/dist/knip/ignore-code-types-where-they-are.js +56 -0
  304. package/dist/knip/ignore-code-types-where-they-are.js.map +1 -0
  305. package/dist/knip/index.d.ts +2 -0
  306. package/dist/knip/index.d.ts.map +1 -0
  307. package/dist/knip/index.js +2 -0
  308. package/dist/knip/index.js.map +1 -0
  309. package/dist/model-modules/index.d.ts +1 -1
  310. package/dist/model-modules/index.d.ts.map +1 -1
  311. package/dist/model-modules/index.js +1 -1
  312. package/dist/model-modules/index.js.map +1 -1
  313. package/dist/model-modules/into-module.d.ts +5 -1
  314. package/dist/model-modules/into-module.d.ts.map +1 -1
  315. package/dist/model-modules/into-module.js +12 -5
  316. package/dist/model-modules/into-module.js.map +1 -1
  317. package/dist/model-modules/is-context-level.d.ts +5 -3
  318. package/dist/model-modules/is-context-level.d.ts.map +1 -1
  319. package/dist/model-modules/is-context-level.js +17 -4
  320. package/dist/model-modules/is-context-level.js.map +1 -1
  321. package/dist/model-modules/module-layers.d.ts +7 -1
  322. package/dist/model-modules/module-layers.d.ts.map +1 -1
  323. package/dist/model-modules/module-layers.js +8 -2
  324. package/dist/model-modules/module-layers.js.map +1 -1
  325. package/dist/model-modules/module-name-flaw.d.ts +2 -2
  326. package/dist/model-modules/module-name-flaw.js +4 -4
  327. package/dist/model-modules/module-name-flaw.js.map +1 -1
  328. package/dist/model-modules/module-placement.d.ts +5 -1
  329. package/dist/model-modules/module-placement.d.ts.map +1 -1
  330. package/dist/model-modules/module-placement.js +47 -18
  331. package/dist/model-modules/module-placement.js.map +1 -1
  332. package/dist/model-modules/module-split.d.ts +9 -5
  333. package/dist/model-modules/module-split.d.ts.map +1 -1
  334. package/dist/model-modules/module-split.js +30 -13
  335. package/dist/model-modules/module-split.js.map +1 -1
  336. package/dist/model-modules/role-directories-of.d.ts.map +1 -1
  337. package/dist/model-modules/role-directories-of.js +6 -1
  338. package/dist/model-modules/role-directories-of.js.map +1 -1
  339. package/dist/model-modules/role-folders-of.d.ts +1 -1
  340. package/dist/model-modules/role-folders-of.d.ts.map +1 -1
  341. package/dist/model-modules/role-folders-of.js +15 -5
  342. package/dist/model-modules/role-folders-of.js.map +1 -1
  343. package/dist/model-modules/role-folders.d.ts +2 -2
  344. package/dist/model-modules/role-folders.js +2 -2
  345. package/dist/move-to-module/module-move.d.ts +2 -4
  346. package/dist/move-to-module/module-move.d.ts.map +1 -1
  347. package/dist/move-to-module/move-to-module.d.ts +2 -6
  348. package/dist/move-to-module/move-to-module.d.ts.map +1 -1
  349. package/dist/move-to-module/move-to-module.js +2 -31
  350. package/dist/move-to-module/move-to-module.js.map +1 -1
  351. package/dist/move-to-module/moves-into-module.d.ts +1 -1
  352. package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
  353. package/dist/move-to-module/moves-into-module.js +25 -6
  354. package/dist/move-to-module/moves-into-module.js.map +1 -1
  355. package/dist/refusals/code-types-pattern.d.ts +4 -0
  356. package/dist/refusals/code-types-pattern.d.ts.map +1 -0
  357. package/dist/refusals/code-types-pattern.js +6 -0
  358. package/dist/refusals/code-types-pattern.js.map +1 -0
  359. package/dist/refusals/ignore-code-types.d.ts +1 -1
  360. package/dist/refusals/ignore-code-types.d.ts.map +1 -1
  361. package/dist/refusals/ignore-code-types.js +3 -2
  362. package/dist/refusals/ignore-code-types.js.map +1 -1
  363. package/dist/refusals/path-from-contexts.d.ts +1 -1
  364. package/dist/refusals/path-from-contexts.js +2 -2
  365. package/dist/refusals/path-from-contexts.js.map +1 -1
  366. package/dist/refusals/with-codes.d.ts +1 -1
  367. package/dist/refusals/with-codes.d.ts.map +1 -1
  368. package/dist/refusals/with-codes.js +1 -1
  369. package/dist/refusals/with-codes.js.map +1 -1
  370. package/dist/refusals/write-refusal-classes.d.ts.map +1 -1
  371. package/dist/refusals/write-refusal-classes.js +4 -2
  372. package/dist/refusals/write-refusal-classes.js.map +1 -1
  373. package/dist/run.d.ts.map +1 -1
  374. package/dist/run.js +2 -0
  375. package/dist/run.js.map +1 -1
  376. package/dist/version.d.ts +1 -1
  377. package/dist/version.js +1 -1
  378. package/package.json +2 -2
  379. package/templates/command/handler.spec.buses.ts.tpl +1 -1
  380. package/templates/command/handler.spec.tsyringe.ts.tpl +1 -1
  381. package/templates/context/permission-set.tpl +1 -1
  382. package/templates/context/permissions.spec.ts.tpl +1 -1
  383. package/templates/error/refusal.ts.tpl +1 -1
  384. package/templates/file-upload/handler.spec.ts.tpl +1 -1
  385. package/templates/init/AGENTS.md.tpl +1 -1
  386. package/templates/init/README.md.tpl +2 -2
  387. package/templates/init/rules/application.md.tpl +3 -2
  388. package/templates/init/rules/domain.md.tpl +3 -2
  389. package/templates/init/rules/infrastructure.md.tpl +1 -0
  390. package/templates/init/rules/presentation.md.tpl +2 -1
  391. package/templates/pipeline/knip.json.tpl +1 -1
  392. package/templates/pipeline/package-scripts.json +1 -1
  393. package/templates/policy/policy.declared.ts.tpl +1 -1
  394. package/templates/policy/policy.ts.tpl +1 -1
  395. package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +1 -1
  396. package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +1 -1
  397. package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +1 -1
  398. package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +1 -1
  399. package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +1 -1
  400. package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +1 -1
  401. package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +1 -1
  402. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +1 -1
  403. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +1 -1
  404. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +1 -1
  405. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +1 -1
  406. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +1 -1
  407. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +1 -1
  408. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +1 -1
  409. package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +1 -1
  410. package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +1 -1
  411. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +1 -1
  412. package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +1 -1
  413. package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +1 -1
  414. package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +1 -1
  415. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +1 -1
  416. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +1 -1
  417. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +1 -1
  418. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +1 -1
  419. package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +1 -1
  420. package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +1 -1
  421. package/templates/presets/identity/context/domain/errors/above-own-role.error.named.ts.tpl +1 -1
  422. package/templates/presets/identity/context/domain/errors/account-already-deactivated.error.named.ts.tpl +1 -1
  423. package/templates/presets/identity/context/domain/errors/already-member.error.named.ts.tpl +1 -1
  424. package/templates/presets/identity/context/domain/errors/deactivated-account.error.named.ts.tpl +1 -1
  425. package/templates/presets/identity/context/domain/errors/delegation-not-active.error.named.ts.tpl +1 -1
  426. package/templates/presets/identity/context/domain/errors/delegation-period-inverted.error.named.ts.tpl +1 -1
  427. package/templates/presets/identity/context/domain/errors/delegation-to-oneself.error.named.ts.tpl +1 -1
  428. package/templates/presets/identity/context/domain/errors/delegation-too-long.error.named.ts.tpl +1 -1
  429. package/templates/presets/identity/context/domain/errors/delegation-with-no-right.error.named.ts.tpl +1 -1
  430. package/templates/presets/identity/context/domain/errors/email-not-verified.error.named.ts.tpl +1 -1
  431. package/templates/presets/identity/context/domain/errors/invalid-display-name.error.named.ts.tpl +1 -1
  432. package/templates/presets/identity/context/domain/errors/invalid-email-address.error.named.ts.tpl +1 -1
  433. package/templates/presets/identity/context/domain/errors/invalid-organisation-name.error.named.ts.tpl +1 -1
  434. package/templates/presets/identity/context/domain/errors/invalid-organisation-slug.error.named.ts.tpl +1 -1
  435. package/templates/presets/identity/context/domain/errors/invitation-expired.error.named.ts.tpl +1 -1
  436. package/templates/presets/identity/context/domain/errors/invitation-not-addressed-to-account.error.named.ts.tpl +1 -1
  437. package/templates/presets/identity/context/domain/errors/invitation-not-pending.error.named.ts.tpl +1 -1
  438. package/templates/presets/identity/context/domain/errors/last-owner.error.named.ts.tpl +1 -1
  439. package/templates/presets/identity/context/domain/errors/not-an-owner.error.named.ts.tpl +1 -1
  440. package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl +1 -1
  441. package/templates/presets/identity/context/domain/errors/own-role.error.named.ts.tpl +1 -1
  442. package/templates/presets/identity/context/domain/errors/right-not-in-role.error.named.ts.tpl +1 -1
  443. package/templates/presets/identity/context/domain/errors/unknown-account.error.named.ts.tpl +1 -1
  444. package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl +1 -1
  445. package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl +1 -1
  446. package/templates/presets/identity/context/domain/errors/unknown-member.error.named.ts.tpl +1 -1
  447. package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl +1 -1
  448. package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -1
  449. package/templates/query/handler.spec.buses.ts.tpl +1 -1
  450. package/templates/query/handler.spec.tsyringe.ts.tpl +1 -1
  451. package/templates/query/search.handler.declared.ts.tpl +1 -1
  452. package/templates/query/search.handler.spec.buses.ts.tpl +1 -1
  453. package/templates/query/search.handler.spec.tsyringe.ts.tpl +1 -1
  454. package/templates/query/search.handler.ts.tpl +1 -1
  455. package/dist/declared/single-file-notice.d.ts +0 -8
  456. package/dist/declared/single-file-notice.d.ts.map +0 -1
  457. package/dist/declared/single-file-notice.js +0 -9
  458. package/dist/declared/single-file-notice.js.map +0 -1
  459. package/dist/generate/place-in-modules.d.ts +0 -16
  460. package/dist/generate/place-in-modules.d.ts.map +0 -1
  461. package/dist/generate/place-in-modules.js.map +0 -1
  462. /package/templates/presets/identity/context/{domain/errors/codes.named.ts.tpl → __context__.codes.named.ts.tpl} +0 -0
  463. /package/templates/presets/identity/context/{application/authorization/__context__.permissions.ts.tpl → __context__.permissions.ts.tpl} +0 -0
@@ -1,13 +1,9 @@
1
1
  import type { Config } from '../config/index.js';
2
+ import { type FileMoves } from '../file-moves/index.js';
2
3
  import type { Workspace } from '../workspace/index.js';
3
- import type { ModuleMove } from './module-move.js';
4
4
  import { type MoveRequest } from './moves-into-module.js';
5
5
  /** What taking files into a module changed. */
6
- export interface ModuleMoves {
7
- readonly moved: readonly ModuleMove[];
8
- /** The files whose imports now name the new paths, moved ones included. */
9
- readonly rewritten: readonly string[];
10
- }
6
+ export type ModuleMoves = FileMoves;
11
7
  /**
12
8
  * Takes files of the model and of the use cases of a context into one of its modules, and
13
9
  * rewrites every import of them under the source root, `test/` and `scripts/`, by alias or
@@ -1 +1 @@
1
- {"version":3,"file":"move-to-module.d.ts","sourceRoot":"","sources":["../../src/move-to-module/move-to-module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKxE,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,WAAW,CAoC7F"}
1
+ {"version":3,"file":"move-to-module.d.ts","sourceRoot":"","sources":["../../src/move-to-module/move-to-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAExE,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,WAAW,CAE7F"}
@@ -1,40 +1,11 @@
1
- import { aliasRoots } from '../alias/index.js';
2
- import { projectSources } from '../refusals/project-sources.js';
3
- import { withMovedImports } from '../platform-folders/with-moved-imports.js';
1
+ import { moveFiles } from '../file-moves/index.js';
4
2
  import { movesIntoModule } from './moves-into-module.js';
5
- const EXTENSION = /\.(?:ts|tsx|mts)$/;
6
- const SOURCE = /\.(?:ts|tsx|mts|js|mjs|cjs)$/;
7
3
  /**
8
4
  * Takes files of the model and of the use cases of a context into one of its modules, and
9
5
  * rewrites every import of them under the source root, `test/` and `scripts/`, by alias or
10
6
  * relative path, the extension kept as it was written.
11
7
  */
12
8
  export function moveToModule(ws, config, request) {
13
- const moved = movesIntoModule(ws, config, request);
14
- const touched = new Set(moved.flatMap((move) => [move.from, move.to]));
15
- const relocation = {
16
- roots: aliasRoots(config),
17
- moved: new Map(moved.map((move) => [move.from.replace(EXTENSION, ''), move.to.replace(EXTENSION, '')])),
18
- };
19
- // Every file named moves, whatever its kind; only a source has imports to follow.
20
- const rewrittenMoved = moved.flatMap((move) => {
21
- const content = ws.read(move.from) ?? '';
22
- const next = SOURCE.test(move.from) ? withMovedImports(content, move.from, relocation) : content;
23
- ws.delete(move.from);
24
- ws.writeAsIs(move.to, next);
25
- return next === content ? [] : [move.to];
26
- });
27
- const rewrittenOthers = projectSources(ws, config, ['scripts'])
28
- .filter((file) => !touched.has(file))
29
- .flatMap((file) => {
30
- const source = ws.read(file) ?? '';
31
- const next = withMovedImports(source, file, relocation);
32
- if (next === source) {
33
- return [];
34
- }
35
- ws.writeAsIs(file, next);
36
- return [file];
37
- });
38
- return { moved, rewritten: [...rewrittenMoved, ...rewrittenOthers] };
9
+ return moveFiles(ws, config, movesIntoModule(ws, config, request));
39
10
  }
40
11
  //# sourceMappingURL=move-to-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"move-to-module.js","sourceRoot":"","sources":["../../src/move-to-module/move-to-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,U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AAoB;IAC9E,OAAO,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -8,7 +8,7 @@ export interface MoveRequest {
8
8
  readonly paths: readonly string[];
9
9
  }
10
10
  /**
11
- * The files the paths name, a file or a folder of a role of domain/ or application/, each with
11
+ * The files the paths name, a file or a folder of a role of a layer or a spec, each with
12
12
  * where it goes in the module: the files that stay one per context and the generated
13
13
  * declarations stay where they are.
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"moves-into-module.d.ts","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,UAAU,EAAE,CA2BjG"}
1
+ {"version":3,"file":"moves-into-module.d.ts","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAYxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,UAAU,EAAE,CA6BjG"}
@@ -1,9 +1,10 @@
1
+ import { posix } from 'node:path';
1
2
  import { CliError } from '../cli-error.js';
2
3
  import { isDeclarationsFile } from '../declared/index.js';
3
4
  import { filesUnder } from '../generate/files-under.js';
4
- import { declaredModules, intoModule, isContextLevel, isRoleFolder, moduleSplit } from '../model-modules/index.js';
5
+ import { declaredModules, intoModule, isContextLevel, isRoleFolder, MODULE_LAYERS, MODULE_TEST_FOLDERS, moduleSplit, } from '../model-modules/index.js';
5
6
  /**
6
- * The files the paths name, a file or a folder of a role of domain/ or application/, each with
7
+ * The files the paths name, a file or a folder of a role of a layer or a spec, each with
7
8
  * where it goes in the module: the files that stay one per context and the generated
8
9
  * declarations stay where they are.
9
10
  */
@@ -16,11 +17,13 @@ export function movesIntoModule(ws, config, request) {
16
17
  ? [relative]
17
18
  : filesUnder(ws, `${directory}/${relative}`).map((file) => `${relative}/${file}`);
18
19
  if (files.length === 0) {
19
- throw new CliError(`${directory}/${relative} does not exist.`, 'Name a file or a folder of a role of domain/ or application/, relative to the context: domain/aggregates/waitlist.aggregate.ts, application/commands/join-waitlist.');
20
+ throw new CliError(`${directory}/${relative} does not exist.`, 'Name a file or a folder of a role of a layer, or a spec, relative to the context: domain/aggregates/waitlist.aggregate.ts, application/commands/join-waitlist.');
20
21
  }
21
22
  return files.flatMap((file) => moveOf(file, placement));
22
23
  });
23
- const unique = [...new Map(moves.map((move) => [move.from, move])).values()];
24
+ // The specs of a moved file go with it, into the module folder of their test folder.
25
+ const specs = specsOf(ws, moves, placement).flatMap((file) => moveOf(file, placement));
26
+ const unique = [...new Map([...moves, ...specs].map((move) => [move.from, move])).values()];
24
27
  refuseLosses(ws, unique, placement);
25
28
  return unique;
26
29
  }
@@ -47,6 +50,21 @@ function refuseLosses(ws, moves, placement) {
47
50
  throw new CliError(`Nothing was moved: ${binary.join(', ')} is not a text file.`, 'Move it by hand with git mv, then run the command again without it.');
48
51
  }
49
52
  }
53
+ /**
54
+ * The specs of the context named after a moved production file (`appointment.repository.contract.spec.ts`
55
+ * is of `appointment.repository.ts`), wherever they sit in `test/unit/` and `test/integration/`,
56
+ * relative to the context.
57
+ */
58
+ function specsOf(ws, moves, { directory, modules }) {
59
+ const names = moves
60
+ .filter((move) => !move.from.slice(directory.length + 1).startsWith('test/'))
61
+ .map((move) => posix.basename(move.from).replace(/\.ts$/, ''));
62
+ return MODULE_TEST_FOLDERS.flatMap((folder) => filesUnder(ws, `${directory}/test/${folder}`).map((file) => `test/${folder}/${file}`)).filter((file) => {
63
+ const stem = posix.basename(file).replace(/\.spec\.ts$/, '');
64
+ const inPlace = moduleSplit(file, modules).module === undefined;
65
+ return inPlace && file.endsWith('.spec.ts') && names.some((name) => stem === name || stem.startsWith(`${name}.`));
66
+ });
67
+ }
50
68
  /** The same file of the role in another module, or at the level of the context, a move would make a twin of. */
51
69
  function twinsOf(ws, move, { directory, modules, module }) {
52
70
  const inContext = move.to.slice(directory.length + 1);
@@ -59,8 +77,9 @@ function twinsOf(ws, move, { directory, modules, module }) {
59
77
  function moveOf(file, { context, directory, modules, module }) {
60
78
  const { path } = moduleSplit(file, modules);
61
79
  const [layer = '', folder = ''] = path.split('/');
62
- if (!isRoleFolder(layer, folder)) {
63
- throw new CliError(`${file} is not in a role folder of domain/ or application/ of "${context}".`, 'Only the model and its use cases are divided into modules: infrastructure/, presentation/, test/ and published-language/ keep their layout.');
80
+ const inLayer = MODULE_LAYERS.includes(layer) && isRoleFolder(layer, folder);
81
+ if (!inLayer && !(layer === 'test' && MODULE_TEST_FOLDERS.includes(folder))) {
82
+ throw new CliError(`${file} is in no role folder of a layer of "${context}", and in no test/unit/ nor test/integration/.`, 'A module holds the files of the layers of its concepts and their specs: published-language/, the fakes, the builders and the worlds stay at the level of the context.');
64
83
  }
65
84
  if (isContextLevel(context, path) || isDeclarationsFile(context, file, modules)) {
66
85
  return [];
@@ -1 +1 @@
1
- {"version":3,"file":"moves-into-module.js","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAW1G;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAAa,EAAE,MAAc,EAAE,OAAoB;IACjF,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7D,MAAM,SAAS,GAAG,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IAE/F,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAEhE,MAAM,KAAK,GACT,EAAE,CAAC,MAAM,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,KAAK,SAAS;YACxF,CAAC,CAAC,CAAC,QAAQ,CAAC;YACZ,C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S,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AACzF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Config } from '../config/index.js';
2
+ /** The code lists of every context, as knip is told of them: `<context>.codes.ts` at the root of each. */
3
+ export declare function codeTypesPattern(config: Config): string;
4
+ //# sourceMappingURL=code-types-pattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-types-pattern.d.ts","sourceRoot":"","sources":["../../src/refusals/code-types-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvD"}
@@ -0,0 +1,6 @@
1
+ import { CODES_FILE } from '../context-files/index.js';
2
+ /** The code lists of every context, as knip is told of them: `<context>.codes.ts` at the root of each. */
3
+ export function codeTypesPattern(config) {
4
+ return `${config.contextsDir}/*/${CODES_FILE.root('*')}`;
5
+ }
6
+ //# sourceMappingURL=code-types-pattern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-types-pattern.js","sourceRoot":"","sources":["../../src/refusals/code-types-pattern.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,0GAA0G;AAC1G,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,GAAG,MAAM,CAAC,WAAW,MAAM,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC3D,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { Config } from '../config/index.js';
2
2
  import type { MigrationDraft } from './migration-draft.js';
3
3
  /**
4
- * knip reports the type `<Ctx>Code` of each `codes.ts` that nothing imports yet, though it is the
4
+ * knip reports the type `<Ctx>Code` of each `<context>.codes.ts` that nothing imports yet, though it is the
5
5
  * contract a route or a client reads: `init` tells knip so under the named form, and the migration
6
6
  * says it as `init` does. A knip config the migration cannot edit (another file, or not plain
7
7
  * JSON) is left to a person.
@@ -1 +1 @@
1
- {"version":3,"file":"ignore-code-types.d.ts","sourceRoot":"","sources":["../../src/refusals/ignore-code-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAkB3E"}
1
+ {"version":3,"file":"ignore-code-types.d.ts","sourceRoot":"","sources":["../../src/refusals/ignore-code-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAkB3E"}
@@ -1,15 +1,16 @@
1
1
  import { isRecord } from '../config/values/is-record.js';
2
2
  import { formatJson } from '../json/format-json.js';
3
+ import { codeTypesPattern } from './code-types-pattern.js';
3
4
  const KNIP_FILE = 'knip.json';
4
5
  const ISSUES = 'ignoreIssues';
5
6
  /**
6
- * knip reports the type `<Ctx>Code` of each `codes.ts` that nothing imports yet, though it is the
7
+ * knip reports the type `<Ctx>Code` of each `<context>.codes.ts` that nothing imports yet, though it is the
7
8
  * contract a route or a client reads: `init` tells knip so under the named form, and the migration
8
9
  * says it as `init` does. A knip config the migration cannot edit (another file, or not plain
9
10
  * JSON) is left to a person.
10
11
  */
11
12
  export function ignoreCodeTypes(config, draft) {
12
- const pattern = `${config.contextsDir}/*/domain/errors/codes.ts`;
13
+ const pattern = codeTypesPattern(config);
13
14
  const text = draft.read(KNIP_FILE);
14
15
  const knip = text === undefined ? undefined : parsed(text);
15
16
  if (knip !== und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AAC,EAAE,CAAC;IAC5D,MAAM,OAAO,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAE/D,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,yBAAyB,CAAC,CAAC;IAC9E,MAAM,EAAE,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;IAErD,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The path of a source of a context from the contexts directory, without its extension, the way
3
3
  * an import of it is matched: `billing/domain/errors/invoice.error` or, in a module of the model,
4
- * `billing/domain/invoices/errors/invoice.error`.
4
+ * `billing/invoices/domain/errors/invoice.error`.
5
5
  */
6
6
  export declare function pathFromContexts(file: string, context: string): string;
7
7
  //# sourceMappingURL=path-from-contexts.d.ts.map
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * The path of a source of a context from the contexts directory, without its extension, the way
3
3
  * an import of it is matched: `billing/domain/errors/invoice.error` or, in a module of the model,
4
- * `billing/domain/invoices/errors/invoice.error`.
4
+ * `billing/invoices/domain/errors/invoice.error`.
5
5
  */
6
6
  export function pathFromContexts(file, context) {
7
- return file.slice(file.lastIndexOf(`/${context}/domain/`) + 1).replace(/\.ts$/, '');
7
+ return file.slice(file.indexOf(`/${context}/`) + 1).replace(/\.ts$/, '');
8
8
  }
9
9
  //# sourceMappingURL=path-from-contexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"path-from-contexts.js","sourceRoot":"","sources":["../../src/refusals/path-from-contexts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAe;IAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACtF,CAAC"}
1
+ {"version":3,"file":"path-from-contexts.js","sourceRoot":"","sources":["../../src/refusals/path-from-contexts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAe;IAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC"}
@@ -1,4 +1,4 @@
1
- /** One entry of `domain/errors/codes.ts`: the name of a refusal class and the code it sets. */
1
+ /** One entry of `<context>.codes.ts`: the name of a refusal class and the code it sets. */
2
2
  export interface CodeEntry {
3
3
  readonly key: string;
4
4
  readonly code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"with-codes.d.ts","sourceRoot":"","sources":["../../src/refusals/with-codes.ts"],"names":[],"mappings":"AAGA,+FAA+F;AAC/F,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAiB5G"}
1
+ {"version":3,"file":"with-codes.d.ts","sourceRoot":"","sources":["../../src/refusals/with-codes.ts"],"names":[],"mappings":"AAGA,2FAA2F;AAC3F,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAiB5G"}
@@ -22,7 +22,7 @@ function boundsOf(text, list, context) {
22
22
  const opened = new RegExp(`export const ${list}\\s*=\\s*\\{`).exec(text);
23
23
  const closed = opened === null ? -1 : text.indexOf('} as const', opened.index);
24
24
  if (opened === null || closed === -1) {
25
- throw new CliError(`The codes of ${context} are not written as \`export const ${list} = { .. } as const\`.`, 'Write domain/errors/codes.ts in that form, then run `ddd-ts-kit error-factories --apply` again.');
25
+ throw new CliError(`The codes of ${context} are not written as \`export const ${list} = { .. } as const\`.`, 'Write <context>.codes.ts in that form, then run `ddd-ts-kit error-factories --apply` again.');
26
26
  }
27
27
  return { opened: opened.index, closed };
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"with-codes.js","sourceRoot":"","sources":["../../src/refusals/with-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAQnC,MAAM,KAAK,GAAG,iDAAiD,CAAC;AAEhE;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAA0B,EAAE,OAAe,EAAE,OAA6B;IAClG,MAAM,I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;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAmB5G"}
1
+ {"version":3,"file":"write-refusal-classes.d.ts","sourceRoot":"","sources":["../../src/refusals/write-refusal-classes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAoB5G"}
@@ -1,5 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { specifierOf } from '../alias/index.js';
3
+ import { CODES_FILE, contextFileAt } from '../context-files/index.js';
3
4
  import { refusalClassFile } from './refusal-class-file.js';
4
5
  import { withCodes } from './with-codes.js';
5
6
  /**
@@ -9,12 +10,13 @@ import { withCodes } from './with-codes.js';
9
10
  export function writeRefusalClasses(config, moves, draft) {
10
11
  for (const context of [...new Set(moves.map((move) => move.context))]) {
11
12
  // The code list stays one per context; each refusal class is written next to the error it comes from.
12
- const codesFile = `${config.contextsDir}/${context}/domain/errors/codes.ts`;
13
+ const directory = `${config.contextsDir}/${context}`;
14
+ const codesFile = `${directory}/${contextFileAt(CODES_FILE, context, (relative) => draft.read(`${directory}/${relative}`) !== undefined)}`;
13
15
  const own = moves.filter((move) => move.context === context);
14
16
  for (const className of [...new Set(own.map((move) => move.className))]) {
15
17
  const ofClass = own.filter((move) => move.className === className);
16
18
  const [first] = ofClass;
17
- const file = `${path.posix.dirname(first?.oldFile ?? codesFile)}/${first?.classFile ?? ''}.ts`;
19
+ const file = `${first === undefined ? `${directory}/domain/errors` : path.posix.dirname(first.oldFile)}/${first?.classFile ?? ''}.ts`;
18
20
  const refusal = { file, className, context, codesSpecifier: specifierOf(config, codesFile), moves: ofClass };
19
21
  draft.write(file, refusalClassFile(draft.read(file), refusal));
20
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"write-refusal-classes.js","sourceRoot":"","sources":["../../src/refusals/write-refusal-classes.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,KAA2B,EAAE,KAAqB;IACpG,KAAK,MAAM,OAAO,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,sGAAsG;QACtG,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,yBAAyB,CAAC;QAC5E,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;QAE7D,KAAK,MAAM,SAAS,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACxE,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;YACnE,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;YACxB,MAAM,IAA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AAK,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAE9E,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC"}
package/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAsFxC,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,GAAE,EAAc,GAAG,MAAM,CAkCvE"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAwFxC,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,GAAE,EAAc,GAAG,MAAM,CAkCvE"}
package/dist/run.js CHANGED
@@ -19,6 +19,7 @@ import { measuresCommand } from './commands/measures.js';
19
19
  import { mergeTrunkCommand } from './commands/merge-trunk.js';
20
20
  import { planWavesCommand } from './commands/plan-waves.js';
21
21
  import { moveToModuleCommand } from './commands/move-to-module.js';
22
+ import { contextLayoutCommand } from './commands/context-layout.js';
22
23
  import { platformFoldersCommand } from './commands/platform-folders.js';
23
24
  import { sdkCommand } from './commands/sdk.js';
24
25
  import { statusCommand } from './commands/status.js';
@@ -68,6 +69,7 @@ const COMMANDS = {
68
69
  'error-factories': errorFactoriesCommand,
69
70
  'value-objects': valueObjectsCommand,
70
71
  'platform-folders': platformFoldersCommand,
72
+ 'context-layout': contextLayoutCommand,
71
73
  'move-to-module': moveToModuleCommand,
72
74
  controllers: controllersCommand,
73
75
  check: checksCommand,
package/dist/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAA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CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/E,CAAC;AAED,SAAS,IAAI;IACX,OAAO,cAAc,OAAO;;EAE5B,aAAa,EAAE,EAAE,CAAC;AACpB,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.0";
1
+ export declare const VERSION = "0.88.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.86.0';
1
+ export const VERSION = '0.88.0';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-ts-kit",
3
- "version": "0.86.0",
3
+ "version": "0.88.0",
4
4
  "description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
5
5
  "keywords": [
6
6
  "ddd",
@@ -52,6 +52,6 @@
52
52
  "clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
53
53
  },
54
54
  "devDependencies": {
55
- "@ddd-ts-kit/kernel": "^0.86.0"
55
+ "@ddd-ts-kit/kernel": "^0.88.0"
56
56
  }
57
57
  }
@@ -10,7 +10,7 @@ import { anActor } from '@ddd-ts-kit/auth/testing';
10
10
  {{/if}}
11
11
  import { createTestBuses } from '@ddd-ts-kit/testing';
12
12
  {{#if access.protected}}
13
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
13
+ import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
14
14
  {{/if}}
15
15
  import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
16
16
  import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
@@ -13,7 +13,7 @@ import { anActor } from '@ddd-ts-kit/auth/testing';
13
13
  {{spec.contextImports}}
14
14
  import { platformTestModule } from '{{alias.platform}}/composition/platform-test.module{{alias.ext}}';
15
15
  {{#if access.protected}}
16
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
16
+ import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
17
17
  {{/if}}
18
18
  import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
19
19
  {{#if command.hasAggregate}}
@@ -1,4 +1,4 @@
1
1
  @@imports
2
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
2
+ import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
3
3
  @@permission-sets
4
4
  {{context.camel}}Permissions,
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
2
  import type { Permission } from '@ddd-ts-kit/auth';
3
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
3
+ import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
4
4
 
5
5
  describe('The permissions of {{context.kebab}}', () => {
6
6
  it('belong to {{context.kebab}}, each under an identifier of its own and with a description', () => {
@@ -1,5 +1,5 @@
1
1
  import { DomainRefusal } from '@ddd-ts-kit/kernel';
2
- import { {{codes.list}} } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
2
+ import { {{codes.list}} } from '{{alias.context}}/{{context.kebab}}.codes{{alias.ext}}';
3
3
 
4
4
  export class {{name.pascal}} extends DomainRefusal {
5
5
  readonly code = {{codes.list}}.{{name.pascal}};
@@ -14,7 +14,7 @@ import {
14
14
  } from '@ddd-ts-kit/kernel';
15
15
  import { createTestBuses } from '@ddd-ts-kit/testing';
16
16
  {{#if access.protected}}
17
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
17
+ import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
18
18
  {{/if}}
19
19
  import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
20
20
  import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
@@ -24,7 +24,7 @@ One file per layer in `.claude/rules/`: `domain.md` (`domain/`, the shared kerne
24
24
 
25
25
  Create every file of a role with `npx ddd-ts-kit generate <kind> ... --json`, then fill the `TODO(domain)` places it lists; never write one by hand, never restructure what a generator wrote.
26
26
  {{#if assembly.barrel}}
27
- Never edit `<context>.declarations.ts` nor the `<folder>.declarations.ts` of a role folder (`application/commands/commands.declarations.ts`): `generate`, `docs` and `npm run dev` rewrite them, from the role files and from the constructor signatures (each folder file registers what the constructors of its folder are injected; the one at the root re-exports them). After changing a constructor by hand, `npx ddd-ts-kit docs`.
27
+ Never edit `<context>.declarations.ts` nor the `<layer>.declarations.ts` of a layer (`application/application.declarations.ts`): `generate`, `docs` and `npm run dev` rewrite them, from the role files and from the constructor signatures (each layer file registers what the constructors of its layer are injected; the one at the root re-exports them). After changing a constructor by hand, `npx ddd-ts-kit docs`.
28
28
  {{/if}}
29
29
  {{#if assembly.discovery}}
30
30
  Never edit `<context>.dependencies.ts`: `generate`, `docs` and `npm run dev` rewrite it from the constructor signatures (it registers what each constructor is injected). After changing a constructor by hand, `npx ddd-ts-kit docs`.
@@ -94,8 +94,8 @@ configuration, the storage, and `composeApplication` of `{{config.platformDir}}/
94
94
  {{#if style.declared}}
95
95
  - **A context declares itself.** Each class says what it is with a decorator of
96
96
  `@ddd-ts-kit/kernel/declarations` and is its own registration{{#if assembly.barrel}}; the composition root reads the
97
- generated `<context>.declarations.ts`, which re-exports the generated declarations of each role folder
98
- (`application/commands/commands.declarations.ts`){{/if}}{{#if assembly.discovery}}; the composition root discovers the role files of
97
+ generated `<context>.declarations.ts`, which re-exports the generated declarations of each layer
98
+ (`application/application.declarations.ts`){{/if}}{{#if assembly.discovery}}; the composition root discovers the role files of
99
99
  each context at startup (`discoverContext`), publishers and jobs included{{/if}}.
100
100
  {{/if}}
101
101
  {{#if broker.external}}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  paths:
3
3
  - "{{config.contextsDir}}/*/application/**"
4
+ - "{{config.contextsDir}}/*/*/application/**"
4
5
  ---
5
6
 
6
7
  # Application layer
@@ -10,12 +11,12 @@ paths:
10
11
  - Events leave with the save: never `pullEvents()`, never a `DomainEventDispatcher` here (`domain-events/dispatched-on-save`). A reaction is a class of `event-handlers/` or a publisher of `integration/publishers/`. It runs at the end of the unit of work, before the commit, and depends only on what the transaction covers (`domain-events/transactional-before-commit`): repositories, the integration event publisher, the command bus. An effect outside the database is a handler of the `after-commit` phase (`generate event-handler ... --phase after-commit`: at most once, never saves, sends a command) or, when it must not be lost, the handler of an integration event.
11
12
  - Nothing here reads the event store: an event-sourced aggregate is loaded and saved through its repository port like any other (`event-sourcing/store-behind-repository`). A projection writes its read model and never a stream (`event-sourcing/projection-never-appends`); one fed by the store is declared `@Projection(name, { feed: 'event-store' })`.
12
13
  {{#if style.declared}}
13
- - Every command and query carries `@Requires(permission)` or `@Public()` (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `authorization/<context>.permissions.ts`, rules that need loaded state in `authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
14
+ - Every command and query carries `@Requires(permission)` or `@Public()` (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `<context>.permissions.ts` at the root of the context, rules that need loaded state in `application/authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
14
15
  - The decorator is the registration (`declarations/role-declared`): `@CommandHandler(Message)`, `@QueryHandler(Message)`, `@DomainEventHandler(Event)` (the name is the static `eventName` of the event class), `@IntegrationEventHandler(definition, { consumer })`, `@Scheduled('<context>.<job>', schedule)`, `@Background(options)` (the name is the static `jobName`), `@Projection('<context>.<name>')`, `@Policy(permission, { name })`. Names are string literals.
15
16
  - The constructor is the one statement of what a class depends on (`declarations/constructor-injection`): each parameter is typed by one port class, with no `?`, default value, rest or destructuring, and no list repeats it in the decorator. To add a dependency, add the parameter: `npx ddd-ts-kit docs` reads the signature into the generated file of the context (`npm run dev` does it on every change), never edit that file.
16
17
  {{/if}}
17
18
  {{#if style.explicit}}
18
- - Every command and query is registered in `<context>.module.ts` with the permission it requires, or as public (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `authorization/<context>.permissions.ts`, rules that need loaded state in `authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
19
+ - Every command and query is registered in `<context>.module.ts` with the permission it requires, or as public (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `<context>.permissions.ts` at the root of the context, rules that need loaded state in `application/authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
19
20
  - A class here carries no registration of its own: `<context>.module.ts` binds it and lists what its constructor receives. A job is registered as `@Scheduled('<context>.<job>', schedule)` would say: one name, one schedule, and the command bus as its only dependency.
20
21
  {{/if}}
21
22
  - A port is an abstract class in `ports/<name>.port.ts` and its own injection token (`ports/abstract-class`, `ports/no-token-constant`), named for the need (`PaymentGateway`), with a fake in `test/fakes/`.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  paths:
3
3
  - "{{config.contextsDir}}/*/domain/**"
4
+ - "{{config.contextsDir}}/*/*/domain/**"
4
5
  - "{{config.sharedKernelDir}}/**"
5
6
  ---
6
7
 
@@ -16,7 +17,7 @@ paths:
16
17
  - No number without a name: 0, 1, -1 and an index only; a duration, a limit or a rate is a constant of the module (`const MINUTES_PER_HOUR = 60;`) or a value object (`clean/no-magic-number`).
17
18
  {{/if}}
18
19
  {{#if refusals.named}}
19
- - A violated invariant throws a refusal built by a static factory of the class named after it, never `new` and never a bare `Error`: `throw InvoiceAlreadyIssued.forInvoice(this.id)` (`errors/through-factory`, `domain/no-generic-error`). One class per refusal in `domain/errors/<refusal>.error.ts`, extending `DomainRefusal`, named after what is refused and never `...Error`, no constructor (`errors/constructor-not-public`); a factory is named after what the refusal is about, `for`, `with`, `because`, `on` or `at` then a capital letter, no digit: `forInvoice`, `withNotice`, `becauseOf` (`errors/factory-name`). The class reads its code from the closed list of its context, `domain/errors/codes.ts`, `readonly code = BillingCodes.InvoiceAlreadyIssued;`: one entry per refusal class and no other, in constant case (`errors/code-listed`), one code per refusal (`errors/code-unique`). The code is the contract a client reads: a renamed class keeps it.
20
+ - A violated invariant throws a refusal built by a static factory of the class named after it, never `new` and never a bare `Error`: `throw InvoiceAlreadyIssued.forInvoice(this.id)` (`errors/through-factory`, `domain/no-generic-error`). One class per refusal in `domain/errors/<refusal>.error.ts`, extending `DomainRefusal`, named after what is refused and never `...Error`, no constructor (`errors/constructor-not-public`); a factory is named after what the refusal is about, `for`, `with`, `because`, `on` or `at` then a capital letter, no digit: `forInvoice`, `withNotice`, `becauseOf` (`errors/factory-name`). The class reads its code from the closed list of its context, `<context>.codes.ts` at its root, `readonly code = BillingCodes.InvoiceAlreadyIssued;`: one entry per refusal class and no other, in constant case (`errors/code-listed`), one code per refusal (`errors/code-unique`). The code is the contract a client reads: a renamed class keeps it.
20
21
  - A factory takes the facts of the refusal as typed parameters and gives them to `refusal(message, facts)`. Facts are private: one reaches a client only when the factory names it, `.exposing('<fact>')`, and never when it identifies a person. A caught refusal is recognised with `InvoiceAlreadyIssued.is(error)`.
21
22
  {{/if}}
22
23
  {{#if refusals.factories}}
@@ -38,7 +39,7 @@ paths:
38
39
  - Time and identifiers come in as parameters (`purity/*`); nothing here knows the acting user or its rights (`authz/in-application`).
39
40
  - One concept per file, with the suffix of its role: `.aggregate.ts`, `.entity.ts`, `.vo.ts`, `.vocabulary.ts`, `.event.ts`, `.error.ts`, `.repository.ts`, `.service.ts` (`naming/suffix`, `naming/one-concept-per-file`).
40
41
  {{#if refusals.named}}
41
- - The language first, with `/ddd-ts-kit:glossary`. Then create with `npx ddd-ts-kit generate aggregate|entity|value-object|vocabulary|domain-event|domain-service|repository ... --json`, a refusal with `npx ddd-ts-kit generate error <context> <Refusal> <factory> --json` (it writes the class and its code in `codes.ts` when absent, adds the factory, and its case to the spec), and fill the `TODO(domain)` places it lists.
42
+ - The language first, with `/ddd-ts-kit:glossary`. Then create with `npx ddd-ts-kit generate aggregate|entity|value-object|vocabulary|domain-event|domain-service|repository ... --json`, a refusal with `npx ddd-ts-kit generate error <context> <Refusal> <factory> --json` (it writes the class and its code in `<context>.codes.ts` when absent, adds the factory, and its case to the spec), and fill the `TODO(domain)` places it lists.
42
43
  {{/if}}
43
44
  {{#if refusals.factories}}
44
45
  - The language first, with `/ddd-ts-kit:glossary`. Then create with `npx ddd-ts-kit generate aggregate|entity|value-object|vocabulary|domain-event|domain-service|repository ... --json`, a refusal with `npx ddd-ts-kit generate error <context> <Concept> <refusal> --json` (it adds the factory to the class of the concept, and its case to the spec), and fill the `TODO(domain)` places it lists.