ddd-ts-kit 0.1.1 → 0.2.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 (609) hide show
  1. package/README.md +81 -21
  2. package/dist/alias/compiler-resolution-of.d.ts +10 -0
  3. package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
  4. package/dist/alias/compiler-resolution-of.js +13 -0
  5. package/dist/alias/compiler-resolution-of.js.map +1 -0
  6. package/dist/alias/compiler-resolution.d.ts +8 -0
  7. package/dist/alias/compiler-resolution.d.ts.map +1 -0
  8. package/dist/alias/compiler-resolution.js +2 -0
  9. package/dist/alias/compiler-resolution.js.map +1 -0
  10. package/dist/alias/index.d.ts +3 -1
  11. package/dist/alias/index.d.ts.map +1 -1
  12. package/dist/alias/index.js +3 -1
  13. package/dist/alias/index.js.map +1 -1
  14. package/dist/alias/module-name-mapper.d.ts +4 -3
  15. package/dist/alias/module-name-mapper.d.ts.map +1 -1
  16. package/dist/alias/module-name-mapper.js +6 -4
  17. package/dist/alias/module-name-mapper.js.map +1 -1
  18. package/dist/alias/specifier-of.d.ts +7 -0
  19. package/dist/alias/specifier-of.d.ts.map +1 -0
  20. package/dist/alias/specifier-of.js +17 -0
  21. package/dist/alias/specifier-of.js.map +1 -0
  22. package/dist/alias/specifier-suffix.d.ts +6 -0
  23. package/dist/alias/specifier-suffix.d.ts.map +1 -0
  24. package/dist/alias/specifier-suffix.js +8 -0
  25. package/dist/alias/specifier-suffix.js.map +1 -0
  26. package/dist/alias/to-alias.d.ts +3 -2
  27. package/dist/alias/to-alias.d.ts.map +1 -1
  28. package/dist/alias/to-alias.js +4 -3
  29. package/dist/alias/to-alias.js.map +1 -1
  30. package/dist/build/emitted-place.d.ts +2 -0
  31. package/dist/build/emitted-place.d.ts.map +1 -1
  32. package/dist/build/emitted-specifier.d.ts +3 -2
  33. package/dist/build/emitted-specifier.d.ts.map +1 -1
  34. package/dist/build/emitted-specifier.js +6 -12
  35. package/dist/build/emitted-specifier.js.map +1 -1
  36. package/dist/build/emitted-target.d.ts +9 -0
  37. package/dist/build/emitted-target.d.ts.map +1 -0
  38. package/dist/build/emitted-target.js +18 -0
  39. package/dist/build/emitted-target.js.map +1 -0
  40. package/dist/build/rewrite-aliases.d.ts +5 -3
  41. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  42. package/dist/build/rewrite-aliases.js +12 -7
  43. package/dist/build/rewrite-aliases.js.map +1 -1
  44. package/dist/build/rewrite-specifiers.d.ts +3 -1
  45. package/dist/build/rewrite-specifiers.d.ts.map +1 -1
  46. package/dist/build/rewrite-specifiers.js +2 -2
  47. package/dist/build/rewrite-specifiers.js.map +1 -1
  48. package/dist/build/unresolved-problem.d.ts +4 -0
  49. package/dist/build/unresolved-problem.d.ts.map +1 -0
  50. package/dist/build/unresolved-problem.js +16 -0
  51. package/dist/build/unresolved-problem.js.map +1 -0
  52. package/dist/check/alias/compiler-resolution.d.ts +10 -0
  53. package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
  54. package/dist/check/alias/compiler-resolution.js +47 -0
  55. package/dist/check/alias/compiler-resolution.js.map +1 -0
  56. package/dist/check/alias/test-runners.js +4 -4
  57. package/dist/check/alias/test-runners.js.map +1 -1
  58. package/dist/check/canonical/roles.d.ts.map +1 -1
  59. package/dist/check/canonical/roles.js +6 -0
  60. package/dist/check/canonical/roles.js.map +1 -1
  61. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  62. package/dist/check/catalogue/architecture-rules.js +4 -0
  63. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  64. package/dist/check/configuration/config-inspection.d.ts +2 -0
  65. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  66. package/dist/check/configuration/config-inspection.js +11 -1
  67. package/dist/check/configuration/config-inspection.js.map +1 -1
  68. package/dist/check/declarations/classes-of.js +1 -1
  69. package/dist/check/declarations/classes-of.js.map +1 -1
  70. package/dist/check/explain/context-docs.js +7 -7
  71. package/dist/check/explain/context-docs.js.map +1 -1
  72. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  73. package/dist/check/explain/imports-docs.js +24 -9
  74. package/dist/check/explain/imports-docs.js.map +1 -1
  75. package/dist/check/explain/layer-docs.js +7 -7
  76. package/dist/check/explain/layer-docs.js.map +1 -1
  77. package/dist/check/explain/ports-docs.d.ts.map +1 -1
  78. package/dist/check/explain/ports-docs.js +15 -7
  79. package/dist/check/explain/ports-docs.js.map +1 -1
  80. package/dist/check/explain/scheduling-docs.js +1 -1
  81. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  82. package/dist/check/explain/wiring-docs.js +35 -10
  83. package/dist/check/explain/wiring-docs.js.map +1 -1
  84. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  85. package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
  86. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  87. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  88. package/dist/check/fixtures/config-fixtures.js +6 -0
  89. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  90. package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
  91. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
  92. package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
  93. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
  94. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  95. package/dist/check/fixtures/declared-project.js +4 -1
  96. package/dist/check/fixtures/declared-project.js.map +1 -1
  97. package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
  98. package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
  99. package/dist/check/fixtures/extension-fixtures.js +77 -0
  100. package/dist/check/fixtures/extension-fixtures.js.map +1 -0
  101. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  102. package/dist/check/fixtures/fixtures.js +4 -0
  103. package/dist/check/fixtures/fixtures.js.map +1 -1
  104. package/dist/check/fixtures/signature-project.d.ts +11 -0
  105. package/dist/check/fixtures/signature-project.d.ts.map +1 -0
  106. package/dist/check/fixtures/signature-project.js +21 -0
  107. package/dist/check/fixtures/signature-project.js.map +1 -0
  108. package/dist/check/fixtures/signature.d.ts +13 -0
  109. package/dist/check/fixtures/signature.d.ts.map +1 -0
  110. package/dist/check/fixtures/signature.js +24 -0
  111. package/dist/check/fixtures/signature.js.map +1 -0
  112. package/dist/check/project/beside-the-sources.d.ts +5 -0
  113. package/dist/check/project/beside-the-sources.d.ts.map +1 -0
  114. package/dist/check/project/beside-the-sources.js +21 -0
  115. package/dist/check/project/beside-the-sources.js.map +1 -0
  116. package/dist/check/project/resolve-import.d.ts.map +1 -1
  117. package/dist/check/project/resolve-import.js +4 -1
  118. package/dist/check/project/resolve-import.js.map +1 -1
  119. package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
  120. package/dist/check/rules/clean-one-export-per-file.js +14 -8
  121. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  122. package/dist/check/rules/config-valid.d.ts.map +1 -1
  123. package/dist/check/rules/config-valid.js +2 -1
  124. package/dist/check/rules/config-valid.js.map +1 -1
  125. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  126. package/dist/check/rules/declarations-barrel-current.js +34 -32
  127. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  128. package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
  129. package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
  130. package/dist/check/rules/declarations-constructor-injection.js +58 -0
  131. package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
  132. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  133. package/dist/check/rules/imports-alias-declared.js +3 -1
  134. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  135. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  136. package/dist/check/rules/imports-alias-only.js +16 -29
  137. package/dist/check/rules/imports-alias-only.js.map +1 -1
  138. package/dist/check/rules/imports-extension.d.ts +3 -0
  139. package/dist/check/rules/imports-extension.d.ts.map +1 -0
  140. package/dist/check/rules/imports-extension.js +65 -0
  141. package/dist/check/rules/imports-extension.js.map +1 -0
  142. package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
  143. package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
  144. package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
  145. package/dist/check/rules/tree-closed.js +6 -4
  146. package/dist/check/rules/tree-closed.js.map +1 -1
  147. package/dist/commands/build-aliases.d.ts.map +1 -1
  148. package/dist/commands/build-aliases.js +5 -3
  149. package/dist/commands/build-aliases.js.map +1 -1
  150. package/dist/commands/docs.d.ts.map +1 -1
  151. package/dist/commands/docs.js +17 -2
  152. package/dist/commands/docs.js.map +1 -1
  153. package/dist/commands/init.d.ts.map +1 -1
  154. package/dist/commands/init.js +5 -4
  155. package/dist/commands/init.js.map +1 -1
  156. package/dist/commit/is-derived.d.ts.map +1 -1
  157. package/dist/commit/is-derived.js +5 -2
  158. package/dist/commit/is-derived.js.map +1 -1
  159. package/dist/config/config.d.ts +2 -0
  160. package/dist/config/config.d.ts.map +1 -1
  161. package/dist/config/default-import-extension.d.ts +3 -0
  162. package/dist/config/default-import-extension.d.ts.map +1 -0
  163. package/dist/config/default-import-extension.js +3 -0
  164. package/dist/config/default-import-extension.js.map +1 -0
  165. package/dist/config/import-extensions.d.ts +3 -0
  166. package/dist/config/import-extensions.d.ts.map +1 -0
  167. package/dist/config/import-extensions.js +3 -0
  168. package/dist/config/import-extensions.js.map +1 -0
  169. package/dist/config/index.d.ts +4 -1
  170. package/dist/config/index.d.ts.map +1 -1
  171. package/dist/config/index.js +4 -1
  172. package/dist/config/index.js.map +1 -1
  173. package/dist/config/parse-config.d.ts.map +1 -1
  174. package/dist/config/parse-config.js +2 -0
  175. package/dist/config/parse-config.js.map +1 -1
  176. package/dist/config/parse-stack.d.ts.map +1 -1
  177. package/dist/config/parse-stack.js +2 -1
  178. package/dist/config/parse-stack.js.map +1 -1
  179. package/dist/config/restack-config-text.d.ts +11 -0
  180. package/dist/config/restack-config-text.d.ts.map +1 -0
  181. package/dist/config/restack-config-text.js +31 -0
  182. package/dist/config/restack-config-text.js.map +1 -0
  183. package/dist/config/serialize-config.d.ts.map +1 -1
  184. package/dist/config/serialize-config.js +3 -6
  185. package/dist/config/serialize-config.js.map +1 -1
  186. package/dist/config/stack.d.ts +8 -0
  187. package/dist/config/stack.d.ts.map +1 -1
  188. package/dist/config/stack.js +1 -0
  189. package/dist/config/stack.js.map +1 -1
  190. package/dist/config/unwritten-import-extension.d.ts +3 -0
  191. package/dist/config/unwritten-import-extension.d.ts.map +1 -0
  192. package/dist/config/unwritten-import-extension.js +3 -0
  193. package/dist/config/unwritten-import-extension.js.map +1 -0
  194. package/dist/config/written-stack.d.ts +8 -0
  195. package/dist/config/written-stack.d.ts.map +1 -0
  196. package/dist/config/written-stack.js +10 -0
  197. package/dist/config/written-stack.js.map +1 -0
  198. package/dist/declared/declared-role.d.ts.map +1 -1
  199. package/dist/declared/declared-role.js +1 -0
  200. package/dist/declared/declared-role.js.map +1 -1
  201. package/dist/declared/dependencies-file.d.ts +7 -0
  202. package/dist/declared/dependencies-file.d.ts.map +1 -0
  203. package/dist/declared/dependencies-file.js +9 -0
  204. package/dist/declared/dependencies-file.js.map +1 -0
  205. package/dist/declared/generated-drift.d.ts +7 -0
  206. package/dist/declared/generated-drift.d.ts.map +1 -0
  207. package/dist/declared/generated-drift.js +47 -0
  208. package/dist/declared/generated-drift.js.map +1 -0
  209. package/dist/declared/index.d.ts +8 -1
  210. package/dist/declared/index.d.ts.map +1 -1
  211. package/dist/declared/index.js +6 -1
  212. package/dist/declared/index.js.map +1 -1
  213. package/dist/declared/injection/class-injection.d.ts +19 -0
  214. package/dist/declared/injection/class-injection.d.ts.map +1 -0
  215. package/dist/declared/injection/class-injection.js +2 -0
  216. package/dist/declared/injection/class-injection.js.map +1 -0
  217. package/dist/declared/injection/constructor-of.d.ts +16 -0
  218. package/dist/declared/injection/constructor-of.d.ts.map +1 -0
  219. package/dist/declared/injection/constructor-of.js +33 -0
  220. package/dist/declared/injection/constructor-of.js.map +1 -0
  221. package/dist/declared/injection/context-injections.d.ts +8 -0
  222. package/dist/declared/injection/context-injections.d.ts.map +1 -0
  223. package/dist/declared/injection/context-injections.js +14 -0
  224. package/dist/declared/injection/context-injections.js.map +1 -0
  225. package/dist/declared/injection/declared-kind-of.d.ts +8 -0
  226. package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
  227. package/dist/declared/injection/declared-kind-of.js +12 -0
  228. package/dist/declared/injection/declared-kind-of.js.map +1 -0
  229. package/dist/declared/injection/exported-name-of.d.ts +4 -0
  230. package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
  231. package/dist/declared/injection/exported-name-of.js +17 -0
  232. package/dist/declared/injection/exported-name-of.js.map +1 -0
  233. package/dist/declared/injection/language-types.d.ts +3 -0
  234. package/dist/declared/injection/language-types.d.ts.map +1 -0
  235. package/dist/declared/injection/language-types.js +32 -0
  236. package/dist/declared/injection/language-types.js.map +1 -0
  237. package/dist/declared/injection/local-names.d.ts +17 -0
  238. package/dist/declared/injection/local-names.d.ts.map +1 -0
  239. package/dist/declared/injection/local-names.js +41 -0
  240. package/dist/declared/injection/local-names.js.map +1 -0
  241. package/dist/declared/injection/parameter-shape.d.ts +11 -0
  242. package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
  243. package/dist/declared/injection/parameter-shape.js +58 -0
  244. package/dist/declared/injection/parameter-shape.js.map +1 -0
  245. package/dist/declared/injection/raw-class-name.d.ts +7 -0
  246. package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
  247. package/dist/declared/injection/raw-class-name.js +28 -0
  248. package/dist/declared/injection/raw-class-name.js.map +1 -0
  249. package/dist/declared/injection/read-constructor.d.ts +10 -0
  250. package/dist/declared/injection/read-constructor.d.ts.map +1 -0
  251. package/dist/declared/injection/read-constructor.js +2 -0
  252. package/dist/declared/injection/read-constructor.js.map +1 -0
  253. package/dist/declared/injection/read-injections.d.ts +6 -0
  254. package/dist/declared/injection/read-injections.d.ts.map +1 -0
  255. package/dist/declared/injection/read-injections.js +75 -0
  256. package/dist/declared/injection/read-injections.js.map +1 -0
  257. package/dist/declared/injection/render-injections.d.ts +11 -0
  258. package/dist/declared/injection/render-injections.d.ts.map +1 -0
  259. package/dist/declared/injection/render-injections.js +51 -0
  260. package/dist/declared/injection/render-injections.js.map +1 -0
  261. package/dist/declared/injection/rendered-injections.d.ts +8 -0
  262. package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
  263. package/dist/declared/injection/rendered-injections.js +2 -0
  264. package/dist/declared/injection/rendered-injections.js.map +1 -0
  265. package/dist/declared/injection/resolve-token.d.ts +18 -0
  266. package/dist/declared/injection/resolve-token.d.ts.map +1 -0
  267. package/dist/declared/injection/resolve-token.js +46 -0
  268. package/dist/declared/injection/resolve-token.js.map +1 -0
  269. package/dist/declared/injection/resolved-token.d.ts +10 -0
  270. package/dist/declared/injection/resolved-token.d.ts.map +1 -0
  271. package/dist/declared/injection/resolved-token.js +2 -0
  272. package/dist/declared/injection/resolved-token.js.map +1 -0
  273. package/dist/declared/injection/sources.d.ts +4 -0
  274. package/dist/declared/injection/sources.d.ts.map +1 -0
  275. package/dist/declared/injection/sources.js +2 -0
  276. package/dist/declared/injection/sources.js.map +1 -0
  277. package/dist/declared/injection/token-reference.d.ts +14 -0
  278. package/dist/declared/injection/token-reference.d.ts.map +1 -0
  279. package/dist/declared/injection/token-reference.js +2 -0
  280. package/dist/declared/injection/token-reference.js.map +1 -0
  281. package/dist/declared/render-barrel.d.ts +8 -5
  282. package/dist/declared/render-barrel.d.ts.map +1 -1
  283. package/dist/declared/render-barrel.js +13 -6
  284. package/dist/declared/render-barrel.js.map +1 -1
  285. package/dist/declared/render-dependencies-file.d.ts +8 -0
  286. package/dist/declared/render-dependencies-file.d.ts.map +1 -0
  287. package/dist/declared/render-dependencies-file.js +12 -0
  288. package/dist/declared/render-dependencies-file.js.map +1 -0
  289. package/dist/depcruise/hygiene-rules.js +2 -1
  290. package/dist/depcruise/hygiene-rules.js.map +1 -1
  291. package/dist/describe/context-description.d.ts +10 -0
  292. package/dist/describe/context-description.d.ts.map +1 -1
  293. package/dist/describe/describe-context.d.ts.map +1 -1
  294. package/dist/describe/describe-context.js +2 -0
  295. package/dist/describe/describe-context.js.map +1 -1
  296. package/dist/describe/format-description.d.ts.map +1 -1
  297. package/dist/describe/format-description.js +4 -0
  298. package/dist/describe/format-description.js.map +1 -1
  299. package/dist/describe/read-projections.d.ts +5 -0
  300. package/dist/describe/read-projections.d.ts.map +1 -0
  301. package/dist/describe/read-projections.js +19 -0
  302. package/dist/describe/read-projections.js.map +1 -0
  303. package/dist/describe/reference-lines.js +9 -0
  304. package/dist/describe/reference-lines.js.map +1 -1
  305. package/dist/dev/refresh-declarations.d.ts +9 -0
  306. package/dist/dev/refresh-declarations.d.ts.map +1 -0
  307. package/dist/dev/refresh-declarations.js +28 -0
  308. package/dist/dev/refresh-declarations.js.map +1 -0
  309. package/dist/generate/access-vars.js +3 -3
  310. package/dist/generate/access-vars.js.map +1 -1
  311. package/dist/generate/kinds/context-plan.d.ts +10 -0
  312. package/dist/generate/kinds/context-plan.d.ts.map +1 -0
  313. package/dist/generate/kinds/context-plan.js +2 -0
  314. package/dist/generate/kinds/context-plan.js.map +1 -0
  315. package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
  316. package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
  317. package/dist/generate/kinds/declare-context-entries.js +4 -2
  318. package/dist/generate/kinds/declare-context-entries.js.map +1 -1
  319. package/dist/generate/kinds/extraction/service-selection.js +8 -11
  320. package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
  321. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  322. package/dist/generate/kinds/job/job-vars.js +5 -3
  323. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  324. package/dist/generate/kinds/plan-vars.d.ts +5 -0
  325. package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
  326. package/dist/generate/kinds/plan-vars.js +24 -0
  327. package/dist/generate/kinds/plan-vars.js.map +1 -0
  328. package/dist/generate/kinds/projection-kind.d.ts +3 -0
  329. package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
  330. package/dist/generate/kinds/projection-kind.js +72 -0
  331. package/dist/generate/kinds/projection-kind.js.map +1 -0
  332. package/dist/generate/kinds/publish-in-index.js +2 -2
  333. package/dist/generate/kinds/publish-in-index.js.map +1 -1
  334. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  335. package/dist/generate/kinds/route/route-vars.js +7 -6
  336. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  337. package/dist/generate/kinds/wire-context.d.ts +10 -0
  338. package/dist/generate/kinds/wire-context.d.ts.map +1 -0
  339. package/dist/generate/kinds/wire-context.js +36 -0
  340. package/dist/generate/kinds/wire-context.js.map +1 -0
  341. package/dist/generate/kinds/write-context-files.d.ts +1 -8
  342. package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
  343. package/dist/generate/kinds/write-context-files.js +3 -40
  344. package/dist/generate/kinds/write-context-files.js.map +1 -1
  345. package/dist/generate/kinds.d.ts.map +1 -1
  346. package/dist/generate/kinds.js +2 -0
  347. package/dist/generate/kinds.js.map +1 -1
  348. package/dist/generate/refresh-barrels.d.ts +4 -3
  349. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  350. package/dist/generate/refresh-barrels.js +41 -16
  351. package/dist/generate/refresh-barrels.js.map +1 -1
  352. package/dist/generate/spec-vars.js +4 -4
  353. package/dist/generate/spec-vars.js.map +1 -1
  354. package/dist/generate/storage-vars.d.ts +2 -2
  355. package/dist/generate/storage-vars.d.ts.map +1 -1
  356. package/dist/generate/storage-vars.js +6 -10
  357. package/dist/generate/storage-vars.js.map +1 -1
  358. package/dist/generate/workspace-sources.d.ts +6 -0
  359. package/dist/generate/workspace-sources.d.ts.map +1 -0
  360. package/dist/generate/workspace-sources.js +13 -0
  361. package/dist/generate/workspace-sources.js.map +1 -0
  362. package/dist/init/manifest/scripts-for.js +6 -1
  363. package/dist/init/manifest/scripts-for.js.map +1 -1
  364. package/dist/init/manifest/versions.js +23 -23
  365. package/dist/init/run-init.d.ts.map +1 -1
  366. package/dist/init/run-init.js +32 -3
  367. package/dist/init/run-init.js.map +1 -1
  368. package/dist/init/stack/recorded-options.d.ts +11 -0
  369. package/dist/init/stack/recorded-options.d.ts.map +1 -0
  370. package/dist/init/stack/recorded-options.js +19 -0
  371. package/dist/init/stack/recorded-options.js.map +1 -0
  372. package/dist/init/stack/resolve-stack.d.ts +6 -1
  373. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  374. package/dist/init/stack/resolve-stack.js +46 -9
  375. package/dist/init/stack/resolve-stack.js.map +1 -1
  376. package/dist/init/stack/resolve-style.d.ts +3 -5
  377. package/dist/init/stack/resolve-style.d.ts.map +1 -1
  378. package/dist/init/stack/resolve-style.js +11 -3
  379. package/dist/init/stack/resolve-style.js.map +1 -1
  380. package/dist/init/stack/stack-options.d.ts +3 -0
  381. package/dist/init/stack/stack-options.d.ts.map +1 -1
  382. package/dist/init/write-agent-settings.js +4 -3
  383. package/dist/init/write-agent-settings.js.map +1 -1
  384. package/dist/init/write-type-script-configs.d.ts +2 -1
  385. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  386. package/dist/init/write-type-script-configs.js +4 -4
  387. package/dist/init/write-type-script-configs.js.map +1 -1
  388. package/dist/refresh-declarations.d.ts +3 -0
  389. package/dist/refresh-declarations.d.ts.map +1 -0
  390. package/dist/refresh-declarations.js +4 -0
  391. package/dist/refresh-declarations.js.map +1 -0
  392. package/dist/run.d.ts.map +1 -1
  393. package/dist/run.js +2 -0
  394. package/dist/run.js.map +1 -1
  395. package/dist/stack/alias-vars.d.ts +2 -1
  396. package/dist/stack/alias-vars.d.ts.map +1 -1
  397. package/dist/stack/alias-vars.js +6 -3
  398. package/dist/stack/alias-vars.js.map +1 -1
  399. package/dist/version.d.ts +1 -1
  400. package/dist/version.js +1 -1
  401. package/package.json +4 -3
  402. package/templates/acl/translator.spec.ts.tpl +1 -1
  403. package/templates/adapter/adapter.declared.ts.tpl +3 -3
  404. package/templates/adapter/adapter.spec.ts.tpl +1 -1
  405. package/templates/adapter/adapter.ts.tpl +1 -1
  406. package/templates/adapter/wiring.tsyringe.tpl +3 -3
  407. package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
  408. package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
  409. package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
  410. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
  411. package/templates/architecture/wiring.declared.tpl +1 -1
  412. package/templates/architecture/wiring.manual.tpl +1 -1
  413. package/templates/architecture/wiring.tsyringe.tpl +1 -1
  414. package/templates/builder/builder.ts.tpl +1 -1
  415. package/templates/command/handler.declared.ts.tpl +7 -7
  416. package/templates/command/handler.spec.buses.ts.tpl +4 -4
  417. package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
  418. package/templates/command/handler.ts.tpl +4 -4
  419. package/templates/command/wiring.manual.tpl +2 -2
  420. package/templates/command/wiring.tsyringe.tpl +3 -3
  421. package/templates/context/module.manual.ts.tpl +1 -1
  422. package/templates/context/permission-set.tpl +1 -1
  423. package/templates/context/permissions.spec.ts.tpl +1 -1
  424. package/templates/context/routes.spec.ts.tpl +1 -1
  425. package/templates/context/wiring.declared.tpl +2 -2
  426. package/templates/context/wiring.manual.tpl +1 -1
  427. package/templates/context/wiring.tsyringe.tpl +2 -2
  428. package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
  429. package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
  430. package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
  431. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  432. package/templates/entity/entity.spec.ts.tpl +1 -1
  433. package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
  434. package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
  435. package/templates/event-handler/event-handler.ts.tpl +1 -1
  436. package/templates/event-handler/wiring.manual.tpl +2 -2
  437. package/templates/event-handler/wiring.tsyringe.tpl +2 -2
  438. package/templates/gateway/adapter.declared.ts.tpl +3 -3
  439. package/templates/gateway/adapter.ts.tpl +2 -2
  440. package/templates/gateway/contract.spec.ts.tpl +3 -3
  441. package/templates/gateway/fake.ts.tpl +1 -1
  442. package/templates/gateway/platform-test.declared.tpl +1 -1
  443. package/templates/gateway/platform.declared.tpl +1 -1
  444. package/templates/gateway/wiring.tsyringe.tpl +3 -3
  445. package/templates/init/CLAUDE.md.tpl +5 -2
  446. package/templates/init/README.md.tpl +15 -10
  447. package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
  448. package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
  449. package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
  450. package/templates/init/e2e/start-application.database.ts.tpl +16 -16
  451. package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
  452. package/templates/init/e2e/test-environment.ts.tpl +1 -1
  453. package/templates/init/main.ts.tpl +11 -11
  454. package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
  455. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
  456. package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
  457. package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
  458. package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
  459. package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
  460. package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
  461. package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
  462. package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
  463. package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
  464. package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
  465. package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
  466. package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
  467. package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
  468. package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
  469. package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
  470. package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
  471. package/templates/init/platform/auth/permissions.ts.tpl +1 -1
  472. package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
  473. package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
  474. package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
  475. package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
  476. package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
  477. package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
  478. package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
  479. package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
  480. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  481. package/templates/init/platform/config/load-config.ts.tpl +3 -3
  482. package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
  483. package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
  484. package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
  485. package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
  486. package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
  487. package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
  488. package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
  489. package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
  490. package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
  491. package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
  492. package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
  493. package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
  494. package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
  495. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
  496. package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
  497. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
  498. package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
  499. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
  500. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
  501. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
  502. package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
  503. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
  504. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
  505. package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
  506. package/templates/init/platform/errors.ts.tpl +1 -1
  507. package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
  508. package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
  509. package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
  510. package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
  511. package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
  512. package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
  513. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  514. package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
  515. package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
  516. package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
  517. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
  518. package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
  519. package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
  520. package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
  521. package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
  522. package/templates/init/platform/platform.manual.ts.tpl +3 -3
  523. package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
  524. package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
  525. package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
  526. package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
  527. package/templates/init/platform/tracing.ts.tpl +2 -2
  528. package/templates/init/rules/application.md.tpl +8 -2
  529. package/templates/init/rules/infrastructure.md.tpl +3 -3
  530. package/templates/init/scripts/openapi.ts.tpl +5 -5
  531. package/templates/integration-event/audited.tpl +1 -1
  532. package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
  533. package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
  534. package/templates/integration-event/publisher.declared.ts.tpl +4 -4
  535. package/templates/integration-event/publisher.spec.ts.tpl +2 -2
  536. package/templates/integration-event/publisher.ts.tpl +2 -2
  537. package/templates/integration-event/wiring.manual.tpl +2 -2
  538. package/templates/integration-event/wiring.tsyringe.tpl +2 -2
  539. package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
  540. package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
  541. package/templates/integration-handler/integration-handler.ts.tpl +1 -1
  542. package/templates/integration-handler/wiring.manual.tpl +3 -3
  543. package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
  544. package/templates/job/job.declared.ts.tpl +3 -3
  545. package/templates/job/job.spec.buses.ts.tpl +2 -2
  546. package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
  547. package/templates/job/job.ts.tpl +1 -1
  548. package/templates/job/wiring.manual.tpl +1 -1
  549. package/templates/job/wiring.tsyringe.tpl +1 -1
  550. package/templates/pipeline/package-scripts.json +1 -1
  551. package/templates/policy/policy.declared.ts.tpl +1 -1
  552. package/templates/policy/policy.spec.declared.ts.tpl +1 -1
  553. package/templates/policy/policy.spec.ts.tpl +1 -1
  554. package/templates/policy/policy.ts.tpl +1 -1
  555. package/templates/policy/registration.tpl +1 -1
  556. package/templates/port/fake.ts.tpl +1 -1
  557. package/templates/projection/projection.spec.ts.tpl +17 -0
  558. package/templates/projection/projection.ts.tpl +11 -0
  559. package/templates/query/handler.declared.ts.tpl +4 -4
  560. package/templates/query/handler.spec.buses.ts.tpl +5 -5
  561. package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
  562. package/templates/query/handler.ts.tpl +3 -3
  563. package/templates/query/query.ts.tpl +1 -1
  564. package/templates/query/reader.fake.ts.tpl +2 -2
  565. package/templates/query/reader.in-memory.ts.tpl +4 -4
  566. package/templates/query/reader.port.ts.tpl +2 -2
  567. package/templates/query/search.handler.declared.ts.tpl +6 -6
  568. package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
  569. package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
  570. package/templates/query/search.handler.ts.tpl +4 -4
  571. package/templates/query/search.query.ts.tpl +1 -1
  572. package/templates/query/search.reader.fake.ts.tpl +2 -2
  573. package/templates/query/search.reader.in-memory.ts.tpl +3 -3
  574. package/templates/query/search.reader.port.ts.tpl +1 -1
  575. package/templates/query/search.reader.spec.ts.tpl +2 -2
  576. package/templates/query/search.wiring.manual.tpl +3 -3
  577. package/templates/query/search.wiring.tsyringe.tpl +4 -4
  578. package/templates/query/wiring.manual.tpl +3 -3
  579. package/templates/query/wiring.tsyringe.tpl +4 -4
  580. package/templates/repository/contract.spec.ts.tpl +5 -5
  581. package/templates/repository/drizzle/mapper.ts.tpl +2 -2
  582. package/templates/repository/drizzle/repository.ts.tpl +9 -17
  583. package/templates/repository/drizzle/schema-export.tpl +1 -1
  584. package/templates/repository/fake.ts.tpl +2 -2
  585. package/templates/repository/knex/mapper.ts.tpl +2 -2
  586. package/templates/repository/knex/repository.ts.tpl +10 -30
  587. package/templates/repository/knex/schema-export.tpl +1 -1
  588. package/templates/repository/knex/tables.ts.tpl +1 -1
  589. package/templates/repository/none/repository.ts.tpl +3 -3
  590. package/templates/repository/prisma/mapper.ts.tpl +2 -2
  591. package/templates/repository/prisma/repository.ts.tpl +6 -9
  592. package/templates/repository/repository.ts.tpl +1 -1
  593. package/templates/repository/typeorm/mapper.ts.tpl +2 -2
  594. package/templates/repository/typeorm/repository.ts.tpl +9 -12
  595. package/templates/repository/typeorm/schema-export.tpl +1 -1
  596. package/templates/repository/typeorm/table.tpl +1 -1
  597. package/templates/repository/wiring.manual.tpl +1 -1
  598. package/templates/repository/wiring.tsyringe.tpl +2 -2
  599. package/templates/route/route.search.ts.tpl +1 -1
  600. package/templates/route/route.spec.ts.tpl +1 -1
  601. package/templates/route/routes.on-tsyringe.tpl +1 -1
  602. package/templates/route/wiring.manual.tpl +1 -1
  603. package/templates/service/main.ts.tpl +11 -11
  604. package/templates/value-object/value-object.spec.ts.tpl +1 -1
  605. package/templates/worker/main.ts.tpl +9 -9
  606. package/dist/alias/platform-alias.d.ts +0 -4
  607. package/dist/alias/platform-alias.d.ts.map +0 -1
  608. package/dist/alias/platform-alias.js +0 -7
  609. package/dist/alias/platform-alias.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  {{#if command.hasAggregate}}
2
- import { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
2
+ import type { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
3
3
  import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
4
- import { {{aggregate.pascal}} } from '{{alias.context}}/domain/aggregates/{{aggregate.kebab}}.aggregate.js';
5
- import { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository.js';
6
- import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
4
+ import { {{aggregate.pascal}} } from '{{alias.context}}/domain/aggregates/{{aggregate.kebab}}.aggregate{{alias.ext}}';
5
+ import type { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository{{alias.ext}}';
6
+ import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
7
7
 
8
- @CommandHandler({{name.pascal}}Command, [{{aggregate.pascal}}Repository, IdGenerator, Clock])
8
+ @CommandHandler({{name.pascal}}Command)
9
9
  export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
10
10
  constructor(
11
11
  private readonly {{aggregate.camel}}Repository: {{aggregate.pascal}}Repository,
@@ -25,12 +25,12 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
25
25
  {{/if}}
26
26
  {{#unless command.hasAggregate}}
27
27
  import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
28
- import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
28
+ import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
29
29
 
30
30
  @CommandHandler({{name.pascal}}Command)
31
31
  export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
32
32
  async execute(command: {{name.pascal}}Command): Promise<void> {
33
- // TODO(domain): name the repository of the aggregate "{{name.words}}" acts on in the dependency list and receive it in the constructor (rerun with --aggregate <Name> --force to get it declared), load or create the aggregate from `command`, call its intention method and save it (its events leave with the save); the unit of work is opened by the command bus.
33
+ // TODO(domain): receive the repository of the aggregate "{{name.words}}" acts on in the constructor, typed by its port (rerun with --aggregate <Name> --force to get it declared), load or create the aggregate from `command`, call its intention method and save it (its events leave with the save); the unit of work is opened by the command bus.
34
34
  }
35
35
  }
36
36
  {{/unless}}
@@ -5,12 +5,12 @@ import { anActor } from '@ddd-ts-kit/auth/testing';
5
5
  {{/if}}
6
6
  import { createTestBuses } from '@ddd-ts-kit/testing';
7
7
  {{#if access.protected}}
8
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions.js';
8
+ import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
9
9
  {{/if}}
10
- import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
11
- import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler.js';
10
+ import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
11
+ import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
12
12
  {{#if command.hasAggregate}}
13
- import { Fake{{aggregate.pascal}}Repository } from '{{alias.context}}/test/fakes/{{aggregate.kebab}}.repository.fake.js';
13
+ import { Fake{{aggregate.pascal}}Repository } from '{{alias.context}}/test/fakes/{{aggregate.kebab}}.repository.fake{{alias.ext}}';
14
14
  {{/if}}
15
15
  {{#if access.protected}}
16
16
 
@@ -11,14 +11,14 @@ import { anActor } from '@ddd-ts-kit/auth/testing';
11
11
  {{spec.diPlain}}
12
12
  {{/unless}}
13
13
  {{spec.contextImports}}
14
- import { platformTestModule } from '{{alias.platform}}/platform-test.module.js';
14
+ import { platformTestModule } from '{{alias.platform}}/platform-test.module{{alias.ext}}';
15
15
  {{#if access.protected}}
16
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions.js';
16
+ import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
17
17
  {{/if}}
18
- import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
18
+ import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
19
19
  {{#if command.hasAggregate}}
20
- import { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository.js';
21
- import { Fake{{aggregate.pascal}}Repository } from '{{alias.context}}/test/fakes/{{aggregate.kebab}}.repository.fake.js';
20
+ import { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository{{alias.ext}}';
21
+ import { Fake{{aggregate.pascal}}Repository } from '{{alias.context}}/test/fakes/{{aggregate.kebab}}.repository.fake{{alias.ext}}';
22
22
  {{/if}}
23
23
  {{#if access.protected}}
24
24
 
@@ -1,8 +1,8 @@
1
1
  {{#if command.hasAggregate}}
2
2
  import type { Clock, CommandHandler, IdGenerator } from '@ddd-ts-kit/kernel';
3
- import { {{aggregate.pascal}} } from '{{alias.context}}/domain/aggregates/{{aggregate.kebab}}.aggregate.js';
4
- import type { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository.js';
5
- import type { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
3
+ import { {{aggregate.pascal}} } from '{{alias.context}}/domain/aggregates/{{aggregate.kebab}}.aggregate{{alias.ext}}';
4
+ import type { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository{{alias.ext}}';
5
+ import type { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
6
6
 
7
7
  export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
8
8
  constructor(
@@ -23,7 +23,7 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
23
23
  {{/if}}
24
24
  {{#unless command.hasAggregate}}
25
25
  import type { CommandHandler } from '@ddd-ts-kit/kernel';
26
- import type { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
26
+ import type { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
27
27
 
28
28
  export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
29
29
  async execute(command: {{name.pascal}}Command): Promise<void> {
@@ -1,8 +1,8 @@
1
1
  @@imports
2
2
  {{access.manualImport}}
3
3
  {{access.permissionsImport}}
4
- import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
5
- import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler.js';
4
+ import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
5
+ import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
6
6
  @@registrations
7
7
  {{#if command.hasAggregate}}
8
8
  platform.commands.register({{name.pascal}}Command, new {{name.pascal}}Handler({{aggregate.camel}}Repository, platform.ids, platform.clock), { context: '{{context.kebab}}' });
@@ -1,11 +1,11 @@
1
1
  @@imports
2
2
  {{#if command.hasAggregate}}
3
3
  import { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
4
- import { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository.js';
4
+ import { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository{{alias.ext}}';
5
5
  {{/if}}
6
6
  {{access.permissionsImport}}
7
- import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command.js';
8
- import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler.js';
7
+ import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
8
+ import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
9
9
  @@registrations
10
10
  {{#if command.hasAggregate}}
11
11
  builder.command({{name.pascal}}Command){{access.declaration}}.handledBy({{name.pascal}}Handler, [{{aggregate.pascal}}Repository, IdGenerator, Clock]);
@@ -2,7 +2,7 @@ import type { UseCaseDeclaration } from '@ddd-ts-kit/auth';
2
2
  {{#if http.any}}
3
3
  import type { Route } from '@ddd-ts-kit/http';
4
4
  {{/if}}
5
- import type { Platform } from '{{alias.platform}}/platform.js';
5
+ import type { Platform } from '{{alias.platform}}/platform{{alias.ext}}';
6
6
  // ddd-ts-kit:imports
7
7
  // /ddd-ts-kit:imports
8
8
 
@@ -1,4 +1,4 @@
1
1
  @@imports
2
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions.js';
2
+ import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{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.js';
3
+ import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{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,6 +1,6 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
2
  import { InMemoryCommandBus, InMemoryQueryBus } from '@ddd-ts-kit/kernel';
3
- import { {{context.camel}}Routes } from '{{alias.context}}/presentation/http/{{context.kebab}}.routes.js';
3
+ import { {{context.camel}}Routes } from '{{alias.context}}/presentation/http/{{context.kebab}}.routes{{alias.ext}}';
4
4
 
5
5
  describe('The routes of {{context.kebab}}', () => {
6
6
  it('answer each method and path once, each under an operation of its own', () => {
@@ -1,9 +1,9 @@
1
1
  @@imports
2
2
  {{#if assembly.barrel}}
3
- import * as {{context.camel}}Declarations from '{{alias.context}}/{{context.kebab}}.declarations.js';
3
+ import * as {{context.camel}}Declarations from '{{alias.context}}/{{context.kebab}}.declarations{{alias.ext}}';
4
4
  {{/if}}
5
5
  {{#if http.any}}
6
- import { {{context.camel}}Routes } from '{{alias.context}}/presentation/http/{{context.kebab}}.routes.js';
6
+ import { {{context.camel}}Routes } from '{{alias.context}}/presentation/http/{{context.kebab}}.routes{{alias.ext}}';
7
7
  {{/if}}
8
8
  @@contexts
9
9
  {{assembled.module}},
@@ -1,4 +1,4 @@
1
1
  @@imports
2
- import { {{context.camel}}Module } from '{{alias.context}}/{{context.kebab}}.module.js';
2
+ import { {{context.camel}}Module } from '{{alias.context}}/{{context.kebab}}.module{{alias.ext}}';
3
3
  @@contexts
4
4
  {{context.camel}}Module,
@@ -1,7 +1,7 @@
1
1
  @@imports
2
- import { {{context.camel}}Module } from '{{alias.context}}/{{context.kebab}}.module.js';
2
+ import { {{context.camel}}Module } from '{{alias.context}}/{{context.kebab}}.module{{alias.ext}}';
3
3
  {{#if http.any}}
4
- import { {{context.camel}}Routes } from '{{alias.context}}/presentation/http/{{context.kebab}}.routes.js';
4
+ import { {{context.camel}}Routes } from '{{alias.context}}/presentation/http/{{context.kebab}}.routes{{alias.ext}}';
5
5
  {{/if}}
6
6
  @@contexts
7
7
  {{context.camel}}Module,
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
2
  import { DomainError } from '@ddd-ts-kit/kernel';
3
- import { {{name.pascal}}Error } from '{{alias.context}}/domain/errors/{{name.kebab}}.error.js';
3
+ import { {{name.pascal}}Error } from '{{alias.context}}/domain/errors/{{name.kebab}}.error{{alias.ext}}';
4
4
 
5
5
  describe('{{name.pascal}}Error', () => {
6
6
  it('carries its stable code', () => {
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
- import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event.js';
2
+ import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
3
3
 
4
4
  describe('{{event.pascal}}', () => {
5
5
  it('is named after the context, the aggregate and the fact', () => {
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
- import { {{name.pascal}}Service } from '{{alias.context}}/domain/services/{{name.kebab}}.service.js';
2
+ import { {{name.pascal}}Service } from '{{alias.context}}/domain/services/{{name.kebab}}.service{{alias.ext}}';
3
3
 
4
4
  describe('{{name.pascal}}Service', () => {
5
5
  it('holds no state of its own', () => {
@@ -11,9 +11,9 @@ import { reportSeedOnFailure } from '@ddd-ts-kit/testing/faker';
11
11
  {{#if e2e.traced}}
12
12
  import { expectSpanTree, installTestTracing } from '@ddd-ts-kit/tracing/testing';
13
13
  {{/if}}
14
- import { startApplication, type RunningApplication } from '{{alias.test}}/e2e/support/start-application.js';
14
+ import { startApplication, type RunningApplication } from '{{alias.test}}/e2e/support/start-application{{alias.ext}}';
15
15
  {{#if e2e.traced}}
16
- import { storyOf } from '{{alias.test}}/e2e/support/story-of.js';
16
+ import { storyOf } from '{{alias.test}}/e2e/support/story-of{{alias.ext}}';
17
17
  {{/if}}
18
18
 
19
19
  describe('{{name.title}}, end to end', () => {
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
- import { {{name.pascal}} } from '{{alias.context}}/domain/entities/{{name.kebab}}.entity.js';
2
+ import { {{name.pascal}} } from '{{alias.context}}/domain/entities/{{name.kebab}}.entity{{alias.ext}}';
3
3
 
4
4
  describe('{{name.pascal}}', () => {
5
5
  it('is identified by its id, not by its attributes', () => {
@@ -1,14 +1,14 @@
1
1
  import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
2
- import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event.js';
2
+ import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
3
3
 
4
4
  @DomainEventHandler({{event.pascal}}, { name: '{{event.name}}'{{#if handler.afterCommit}}, phase: 'after-commit'{{/if}} })
5
5
  export class {{event.pascal}}EventHandler implements DomainEventHandler<{{event.pascal}}> {
6
6
  async handle(event: {{event.pascal}}): Promise<void> {
7
7
  {{#unless handler.afterCommit}}
8
- // TODO(domain): state the policy "when {{event.words}}, then ..." and carry it out by executing a command of this context (name `CommandBus` of the kernel in the dependency list and receive it in the constructor). It runs at the end of the unit of work, before the commit: depend only on what the transaction covers; an effect outside the database belongs in the after-commit phase or, when it must not be lost, behind an integration event, where a reaction in another context goes too.
8
+ // TODO(domain): state the policy "when {{event.words}}, then ..." and carry it out by executing a command of this context (receive `CommandBus` of the kernel in the constructor). It runs at the end of the unit of work, before the commit: depend only on what the transaction covers; an effect outside the database belongs in the after-commit phase or, when it must not be lost, behind an integration event, where a reaction in another context goes too.
9
9
  {{/unless}}
10
10
  {{#if handler.afterCommit}}
11
- // TODO(domain): state the effect "once {{event.words}} is committed, then ..." and carry it out through its port (name the port in the dependency list and receive it in the constructor). It runs after the commit, at most once: a failure is reported and never fails the command, and a crash loses it, so what must not be lost goes through an integration event instead. It never saves an aggregate: a state change is a command sent through `CommandBus`.
11
+ // TODO(domain): state the effect "once {{event.words}} is committed, then ..." and carry it out through its port (receive the port in the constructor). It runs after the commit, at most once: a failure is reported and never fails the command, and a crash loses it, so what must not be lost goes through an integration event instead. It never saves an aggregate: a state change is a command sent through `CommandBus`.
12
12
  {{/if}}
13
13
  }
14
14
  }
@@ -5,8 +5,8 @@ import {
5
5
  announceDomainEvents,
6
6
  unitOfWorkStage,
7
7
  } from '@ddd-ts-kit/kernel';
8
- import { {{event.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{event.kebab}}.event-handler.js';
9
- import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event.js';
8
+ import { {{event.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{event.kebab}}.event-handler{{alias.ext}}';
9
+ import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
10
10
 
11
11
  describe('When {{event.words}}', () => {
12
12
  {{#unless handler.afterCommit}}
@@ -1,4 +1,4 @@
1
- import type { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event.js';
1
+ import type { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
2
2
 
3
3
  export class {{event.pascal}}EventHandler {
4
4
  async handle(event: {{event.pascal}}): Promise<void> {
@@ -1,6 +1,6 @@
1
1
  @@imports
2
- import { {{event.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{event.kebab}}.event-handler.js';
3
- import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event.js';
2
+ import { {{event.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{event.kebab}}.event-handler{{alias.ext}}';
3
+ import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
4
4
  @@registrations
5
5
  const {{event.camel}}EventHandler = platform.adapter(new {{event.pascal}}EventHandler(), { kind: 'domain-event-handler', context: '{{context.kebab}}' });
6
6
 
@@ -1,7 +1,7 @@
1
1
  @@imports
2
2
  import { DomainEventDispatcher } from '@ddd-ts-kit/kernel';
3
- import { {{event.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{event.kebab}}.event-handler.js';
4
- import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event.js';
3
+ import { {{event.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{event.kebab}}.event-handler{{alias.ext}}';
4
+ import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
5
5
  @@registrations
6
6
  builder.bind({{event.pascal}}EventHandler).toClass({{event.pascal}}EventHandler).as('domain-event-handler');
7
7
  @@start
@@ -1,9 +1,9 @@
1
1
  import { Gateway } from '@ddd-ts-kit/kernel/declarations';
2
- import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index.js';
3
- import { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port.js';
2
+ import type { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index{{alias.ext}}';
3
+ import { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port{{alias.ext}}';
4
4
 
5
5
  // TODO(platform): when {{upstream.kebab}} runs as its own service, turn this class into the remote adapter of {{name.pascal}}Gateway (an HTTP or RPC client with a timeout, retries and a fallback): the declaration stays, nothing else changes.
6
- @Gateway({{name.pascal}}Gateway, [{{name.pascal}}Contract])
6
+ @Gateway({{name.pascal}}Gateway)
7
7
  export class InProcess{{name.pascal}}Gateway implements {{name.pascal}}Gateway {
8
8
  constructor(readonly upstream: {{name.pascal}}Contract) {}
9
9
 
@@ -1,5 +1,5 @@
1
- import type { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index.js';
2
- import type { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port.js';
1
+ import type { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index{{alias.ext}}';
2
+ import type { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port{{alias.ext}}';
3
3
 
4
4
  // TODO(platform): when {{upstream.kebab}} runs as its own service, write the remote adapter of {{name.pascal}}Gateway next to this one (an HTTP or RPC client with a timeout, retries and a fallback) and bind it instead; nothing else changes.
5
5
  export class InProcess{{name.pascal}}Gateway implements {{name.pascal}}Gateway {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from '{{tests.module}}';
2
- import type { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port.js';
3
- import { InProcess{{name.pascal}}Gateway } from '{{alias.context}}/infrastructure/external/in-process-{{name.kebab}}.gateway.js';
4
- import { Fake{{name.pascal}}Gateway } from '{{alias.context}}/test/fakes/{{name.kebab}}-gateway.fake.js';
2
+ import type { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port{{alias.ext}}';
3
+ import { InProcess{{name.pascal}}Gateway } from '{{alias.context}}/infrastructure/external/in-process-{{name.kebab}}.gateway{{alias.ext}}';
4
+ import { Fake{{name.pascal}}Gateway } from '{{alias.context}}/test/fakes/{{name.kebab}}-gateway.fake{{alias.ext}}';
5
5
 
6
6
  const ADAPTERS: readonly (readonly [string, () => {{name.pascal}}Gateway])[] = [
7
7
  ['the fake', () => new Fake{{name.pascal}}Gateway()],
@@ -1,4 +1,4 @@
1
- import type { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port.js';
1
+ import type { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port{{alias.ext}}';
2
2
 
3
3
  export class Fake{{name.pascal}}Gateway implements {{name.pascal}}Gateway {
4
4
  // TODO(domain): implement each operation of {{name.pascal}}Gateway in memory, with what {{upstream.kebab}} would answer given by the test.
@@ -1,4 +1,4 @@
1
1
  @@imports
2
- import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index.js';
2
+ import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index{{alias.ext}}';
3
3
  @@test-bindings
4
4
  builder.bind({{name.pascal}}Contract).toValue({});
@@ -1,4 +1,4 @@
1
1
  @@imports
2
- import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index.js';
2
+ import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index{{alias.ext}}';
3
3
  @@bindings
4
4
  builder.bind({{name.pascal}}Contract).toValue({});
@@ -1,7 +1,7 @@
1
1
  @@imports
2
- import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index.js';
3
- import { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port.js';
4
- import { InProcess{{name.pascal}}Gateway } from '{{alias.context}}/infrastructure/external/in-process-{{name.kebab}}.gateway.js';
2
+ import { {{name.pascal}}Contract } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index{{alias.ext}}';
3
+ import { {{name.pascal}}Gateway } from '{{alias.context}}/application/ports/{{name.kebab}}-gateway.port{{alias.ext}}';
4
+ import { InProcess{{name.pascal}}Gateway } from '{{alias.context}}/infrastructure/external/in-process-{{name.kebab}}.gateway{{alias.ext}}';
5
5
  @@registrations
6
6
  builder.bind({{name.pascal}}Contract).toValue({});
7
7
  builder.bind({{name.pascal}}Gateway).toClass(InProcess{{name.pascal}}Gateway, [{{name.pascal}}Contract]).as('gateway');
@@ -24,10 +24,13 @@ Loaded with the files they apply to, from `.claude/rules/`: `domain.md` (`domain
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`: `generate` and `docs` rewrite it.
27
+ Never edit `<context>.declarations.ts`: `generate`, `docs` and `npm run dev` rewrite it, from the role files and from the constructor signatures (it registers what each constructor is injected). After changing a constructor by hand, `npx ddd-ts-kit docs`.
28
+ {{/if}}
29
+ {{#if assembly.discovery}}
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`.
28
31
  {{/if}}
29
32
  Never edit `openapi/openapi.json`, `docs/integration/asyncapi.json`, `docs/integration/event-catalog.md`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run docs:generate`, `npx ddd-ts-kit docs` and `npx ddd-ts-kit depcruise-config --write`.
30
- Imports: a file of the project is imported by its alias from the project root, never by a relative path, the same directory included: `{{alias.source}}/...` for `{{config.sourceRoot}}/`, `{{alias.test}}/...` for `test/`, `{{alias.scripts}}/...` for `scripts/`, always ending in `.js` (`imports/alias-only`; `npm run lint:fix` rewrites a relative import). The alias is declared once, under `paths` in `tsconfig.json`, from `importAlias` of `ddd-ts-kit.config.json`: never add a second entry or mapping, and never compile without `npm run build`, which rewrites the aliases of `dist/` into relative paths for Node (`imports/alias-declared`).
33
+ Imports: a file of the project is imported by its alias from the project root, never by a relative path, the same directory included: `{{alias.source}}/...` for `{{config.sourceRoot}}/`, `{{alias.test}}/...` for `test/`, `{{alias.scripts}}/...` for `scripts/`, {{#if alias.extensionless}}never ending in `.js` or `.ts`, and naming a file, never a directory{{/if}}{{#unless alias.extensionless}}always ending in `.js`{{/unless}} (`imports/alias-only`, `imports/extension`; `npm run lint:fix` rewrites a relative import and a wrong ending). The alias is declared once, under `paths` in `tsconfig.json`, from `importAlias` of `ddd-ts-kit.config.json`, and the ending follows `importExtension`: never add a second entry or mapping, never change `module` or `moduleResolution` in `tsconfig.json`, and never compile without `npm run build`, which rewrites the aliases of `dist/` into relative paths ending in `.js` for Node (`imports/alias-declared`).
31
34
  Everywhere: one exported class, interface or function per file, named after it in kebab-case; at most 350 lines a file, 30 lines and 3 parameters a function; `private` members, never `#name`; a blank line before a `return` and around `if`, `for`, `try` (`npm run lint:fix`); braces around the body of every `if`, `else`, `for`, `while` and `do`, on its own lines: a branch is visible at a glance, and a statement added to it later cannot silently fall outside it. `npm run format` (Biome, line width 120) lays out every file: do not spend tokens on line breaks.
32
35
 
33
36
  ## TypeScript
@@ -58,9 +58,10 @@ configuration, the storage, and `composeApplication` of `{{config.platformDir}}/
58
58
 
59
59
  - **A port is an abstract class, and the class is what is injected.** A repository port lives in
60
60
  `domain/repositories/`, any other port in `application/ports/`, one per file; an adapter
61
- `implements` its port. There is no token constant and no token file anywhere: a dependency list
62
- names port classes (`[InvoiceRepository, Clock]`), the ports of the kernel included (`Clock`,
63
- `IdGenerator`, `CommandBus`, `UnitOfWork`... of `@ddd-ts-kit/kernel`).
61
+ `implements` its port. There is no token constant and no token file anywhere: a constructor
62
+ parameter typed by a port class names what is injected (`private readonly clock: Clock`), the
63
+ ports of the kernel included (`Clock`, `IdGenerator`, `CommandBus`, `UnitOfWork`... of
64
+ `@ddd-ts-kit/kernel`).
64
65
  {{#if di.tsyringe}}
65
66
  - **Three modules, then the contexts.** `kernelModule({...})` binds the ports of the kernel to what
66
67
  this platform chose (one execution scope, one clock, the two buses with their middlewares);
@@ -214,15 +215,19 @@ to it because ESLint and dependency-cruiser read sources through the compiler AP
214
215
  native version does not ship: do not use `npx tsc`, it would run version 6.
215
216
 
216
217
  Every file of the project is imported by an alias from the project root, never by a relative
217
- path: `{{alias.platform}}/config/load-config.js` for `{{config.platformDir}}/config/load-config.ts`,
218
- `{{alias.test}}/...` for `test/`, `{{alias.scripts}}/...` for `scripts/`. The alias is declared
218
+ path: `{{alias.platform}}/config/load-config{{alias.ext}}` for `{{config.platformDir}}/config/load-config.ts`,
219
+ `{{alias.test}}/...` for `test/`, `{{alias.scripts}}/...` for `scripts/`.{{#if alias.extensionless}} An import names its
220
+ file without an extension (`"importExtension": "none"` in `ddd-ts-kit.config.json`), and never a
221
+ directory: `.../published-language/index`.{{/if}}{{#unless alias.extensionless}} An import ends with the `.js` of the file the
222
+ compiler emits (`"importExtension": "js"` in `ddd-ts-kit.config.json`).{{/unless}} The alias is declared
219
223
  once, under `paths` in `tsconfig.json`, which the compiler, `npm run dev`, the tests, knip and
220
- the import graph read. Node reads no alias: `npm run build` compiles, then
221
- `ddd-ts-kit build-aliases` rewrites each alias of `dist/` into a relative path, so `npm start`
222
- is plain `node`. `npm run lint:fix` turns a relative import into its alias, and
223
- `npm run check:arch` reports a declaration that no longer follows `importAlias` of
224
+ the import graph read. Node reads no alias and needs the extension: `npm run build` compiles,
225
+ then `ddd-ts-kit build-aliases` rewrites each alias of `dist/` into a relative path ending in
226
+ `.js`, so `npm start` is plain `node`. `npm run lint:fix` turns a relative import into its alias
227
+ and gives an import the ending the config asks for, and `npm run check:arch` reports a
228
+ declaration that no longer follows `importAlias` and `importExtension` of
224
229
  `ddd-ts-kit.config.json`, or a build that skips the rewrite (`imports/alias-only`,
225
- `imports/alias-declared`).
230
+ `imports/extension`, `imports/alias-declared`).
226
231
 
227
232
  | Gate | Script | Tool |
228
233
  |---|---|---|
@@ -2,7 +2,7 @@ import type { Authenticator } from '@ddd-ts-kit/auth';
2
2
  import { JwtAuthenticator } from '@ddd-ts-kit/auth/jwt';
3
3
  import type { HttpHeaders } from '@ddd-ts-kit/testing/e2e';
4
4
  import { SignJWT, generateKeyPair, type CryptoKey } from 'jose';
5
- import { authEnvironment } from '{{alias.test}}/e2e/support/auth-environment.js';
5
+ import { authEnvironment } from '{{alias.test}}/e2e/support/auth-environment{{alias.ext}}';
6
6
 
7
7
  const issuer = authEnvironment.AUTH_ISSUER;
8
8
  const audience = authEnvironment.AUTH_AUDIENCE;
@@ -4,7 +4,7 @@ import type { Authenticator } from '@ddd-ts-kit/auth';
4
4
  import { keycloakAuthenticator } from '@ddd-ts-kit/auth/jwt';
5
5
  import type { HttpHeaders } from '@ddd-ts-kit/testing/e2e';
6
6
  import { SignJWT, exportJWK, generateKeyPair, type CryptoKey, type JWK } from 'jose';
7
- import { authEnvironment } from '{{alias.test}}/e2e/support/auth-environment.js';
7
+ import { authEnvironment } from '{{alias.test}}/e2e/support/auth-environment{{alias.ext}}';
8
8
 
9
9
  const realm = authEnvironment.KEYCLOAK_REALM;
10
10
  const audience = authEnvironment.KEYCLOAK_AUDIENCE;
@@ -1,7 +1,7 @@
1
1
  import type { Authenticator } from '@ddd-ts-kit/auth';
2
2
  import type { HttpHeaders } from '@ddd-ts-kit/testing/e2e';
3
- import { developmentActorHeader } from '{{alias.platform}}/auth/development-actor-header.js';
4
- import { DevelopmentHeaderAuthenticator } from '{{alias.platform}}/auth/development-header-authenticator.js';
3
+ import { developmentActorHeader } from '{{alias.platform}}/auth/development-actor-header{{alias.ext}}';
4
+ import { DevelopmentHeaderAuthenticator } from '{{alias.platform}}/auth/development-header-authenticator{{alias.ext}}';
5
5
 
6
6
  /** Who a test calls as: the identity, the roles and the tenant the development header carries. */
7
7
  export interface TestActor {
@@ -4,39 +4,39 @@ import type { RelationTuple } from '@ddd-ts-kit/auth/rebac';
4
4
  import type { IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
5
5
  import { createHttpClient, type HttpClient } from '@ddd-ts-kit/testing/e2e';
6
6
  {{#if authz.rebac}}
7
- import { relationTuples } from '{{alias.platform}}/auth/relation-tuples.js';
7
+ import { relationTuples } from '{{alias.platform}}/auth/relation-tuples{{alias.ext}}';
8
8
  {{/if}}
9
- import { composeApplication } from '{{alias.platform}}/compose-application.js';
10
- import type { AppConfig } from '{{alias.platform}}/config/app-config.js';
11
- import { loadConfig } from '{{alias.platform}}/config/load-config.js';
12
- import { openTestDatabase, type TestDatabase } from '{{alias.platform}}/database/open-test-database.js';
9
+ import { composeApplication } from '{{alias.platform}}/compose-application{{alias.ext}}';
10
+ import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
11
+ import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
12
+ import { openTestDatabase, type TestDatabase } from '{{alias.platform}}/database/open-test-database{{alias.ext}}';
13
13
  {{#if broker.provided}}
14
- import { createEventProvider } from '{{alias.platform}}/events/create-event-provider.js';
15
- import type { EventProvider } from '{{alias.platform}}/events/event-provider.js';
14
+ import { createEventProvider } from '{{alias.platform}}/events/create-event-provider{{alias.ext}}';
15
+ import type { EventProvider } from '{{alias.platform}}/events/event-provider{{alias.ext}}';
16
16
  {{/if}}
17
- import { inProcessEvents } from '{{alias.platform}}/events/in-process-events.js';
17
+ import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
18
18
  {{#if events.outbox}}
19
- import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay.js';
19
+ import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay{{alias.ext}}';
20
20
  {{/if}}
21
- import { startHttpServer } from '{{alias.platform}}/http/start-http-server.js';
21
+ import { startHttpServer } from '{{alias.platform}}/http/start-http-server{{alias.ext}}';
22
22
  {{#if cache.redis}}
23
- import { openRedis } from '{{alias.platform}}/redis/open-redis.js';
23
+ import { openRedis } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
24
24
  {{/if}}
25
- import { createCredentials, type Credentials, type TestActor } from '{{alias.test}}/e2e/support/create-credentials.js';
25
+ import { createCredentials, type Credentials, type TestActor } from '{{alias.test}}/e2e/support/create-credentials{{alias.ext}}';
26
26
  {{#if broker.addressed}}
27
27
  {{#if redis.server}}
28
- import { noBroker, noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
28
+ import { noBroker, noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
29
29
  {{/if}}
30
30
  {{#unless redis.server}}
31
- import { noBroker, testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
31
+ import { noBroker, testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
32
32
  {{/unless}}
33
33
  {{/if}}
34
34
  {{#unless broker.addressed}}
35
35
  {{#if redis.server}}
36
- import { noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
36
+ import { noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
37
37
  {{/if}}
38
38
  {{#unless redis.server}}
39
- import { testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
39
+ import { testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
40
40
  {{/unless}}
41
41
  {{/unless}}
42
42
 
@@ -4,41 +4,41 @@ import type { RelationTuple } from '@ddd-ts-kit/auth/rebac';
4
4
  import type { IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
5
5
  import { createHttpClient, type HttpClient } from '@ddd-ts-kit/testing/e2e';
6
6
  {{#if authz.rebac}}
7
- import { relationTuples } from '{{alias.platform}}/auth/relation-tuples.js';
7
+ import { relationTuples } from '{{alias.platform}}/auth/relation-tuples{{alias.ext}}';
8
8
  {{/if}}
9
- import { composeApplication } from '{{alias.platform}}/compose-application.js';
9
+ import { composeApplication } from '{{alias.platform}}/compose-application{{alias.ext}}';
10
10
  {{#if broker.provided}}
11
- import type { AppConfig } from '{{alias.platform}}/config/app-config.js';
11
+ import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
12
12
  {{/if}}
13
- import { loadConfig } from '{{alias.platform}}/config/load-config.js';
14
- import { openPersistence } from '{{alias.platform}}/database/open-persistence.js';
13
+ import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
14
+ import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
15
15
  {{#if broker.provided}}
16
- import { createEventProvider } from '{{alias.platform}}/events/create-event-provider.js';
17
- import type { EventProvider } from '{{alias.platform}}/events/event-provider.js';
16
+ import { createEventProvider } from '{{alias.platform}}/events/create-event-provider{{alias.ext}}';
17
+ import type { EventProvider } from '{{alias.platform}}/events/event-provider{{alias.ext}}';
18
18
  {{/if}}
19
- import { inProcessEvents } from '{{alias.platform}}/events/in-process-events.js';
19
+ import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
20
20
  {{#if events.outbox}}
21
- import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay.js';
21
+ import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay{{alias.ext}}';
22
22
  {{/if}}
23
- import { startHttpServer } from '{{alias.platform}}/http/start-http-server.js';
23
+ import { startHttpServer } from '{{alias.platform}}/http/start-http-server{{alias.ext}}';
24
24
  {{#if cache.redis}}
25
- import { openRedis } from '{{alias.platform}}/redis/open-redis.js';
25
+ import { openRedis } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
26
26
  {{/if}}
27
- import { createCredentials, type Credentials, type TestActor } from '{{alias.test}}/e2e/support/create-credentials.js';
27
+ import { createCredentials, type Credentials, type TestActor } from '{{alias.test}}/e2e/support/create-credentials{{alias.ext}}';
28
28
  {{#if broker.addressed}}
29
29
  {{#if redis.server}}
30
- import { noBroker, noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
30
+ import { noBroker, noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
31
31
  {{/if}}
32
32
  {{#unless redis.server}}
33
- import { noBroker, testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
33
+ import { noBroker, testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
34
34
  {{/unless}}
35
35
  {{/if}}
36
36
  {{#unless broker.addressed}}
37
37
  {{#if redis.server}}
38
- import { noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
38
+ import { noRedis, testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
39
39
  {{/if}}
40
40
  {{#unless redis.server}}
41
- import { testEnvironment } from '{{alias.test}}/e2e/support/test-environment.js';
41
+ import { testEnvironment } from '{{alias.test}}/e2e/support/test-environment{{alias.ext}}';
42
42
  {{/unless}}
43
43
  {{/unless}}
44
44