ddd-ts-kit 0.1.1 → 0.3.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 (791) hide show
  1. package/README.md +136 -23
  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 +8 -0
  63. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  64. package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
  65. package/dist/check/catalogue/eslint-only-rules.js +12 -0
  66. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  67. package/dist/check/configuration/config-inspection.d.ts +2 -0
  68. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  69. package/dist/check/configuration/config-inspection.js +11 -1
  70. package/dist/check/configuration/config-inspection.js.map +1 -1
  71. package/dist/check/declarations/classes-of.js +1 -1
  72. package/dist/check/declarations/classes-of.js.map +1 -1
  73. package/dist/check/errors/builds-through-factories.d.ts +4 -0
  74. package/dist/check/errors/builds-through-factories.d.ts.map +1 -0
  75. package/dist/check/errors/builds-through-factories.js +5 -0
  76. package/dist/check/errors/builds-through-factories.js.map +1 -0
  77. package/dist/check/errors/error-code.d.ts +6 -0
  78. package/dist/check/errors/error-code.d.ts.map +1 -0
  79. package/dist/check/errors/error-code.js +2 -0
  80. package/dist/check/errors/error-code.js.map +1 -0
  81. package/dist/check/errors/error-codes.d.ts +8 -0
  82. package/dist/check/errors/error-codes.d.ts.map +1 -0
  83. package/dist/check/errors/error-codes.js +21 -0
  84. package/dist/check/errors/error-codes.js.map +1 -0
  85. package/dist/check/errors/kit-error-codes.d.ts +3 -0
  86. package/dist/check/errors/kit-error-codes.d.ts.map +1 -0
  87. package/dist/check/errors/kit-error-codes.js +17 -0
  88. package/dist/check/errors/kit-error-codes.js.map +1 -0
  89. package/dist/check/explain/context-docs.js +7 -7
  90. package/dist/check/explain/context-docs.js.map +1 -1
  91. package/dist/check/explain/errors-docs.d.ts +3 -0
  92. package/dist/check/explain/errors-docs.d.ts.map +1 -0
  93. package/dist/check/explain/errors-docs.js +30 -0
  94. package/dist/check/explain/errors-docs.js.map +1 -0
  95. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  96. package/dist/check/explain/imports-docs.js +24 -9
  97. package/dist/check/explain/imports-docs.js.map +1 -1
  98. package/dist/check/explain/layer-docs.js +7 -7
  99. package/dist/check/explain/layer-docs.js.map +1 -1
  100. package/dist/check/explain/ports-docs.d.ts.map +1 -1
  101. package/dist/check/explain/ports-docs.js +15 -7
  102. package/dist/check/explain/ports-docs.js.map +1 -1
  103. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  104. package/dist/check/explain/rule-docs.js +2 -0
  105. package/dist/check/explain/rule-docs.js.map +1 -1
  106. package/dist/check/explain/scheduling-docs.js +1 -1
  107. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  108. package/dist/check/explain/wiring-docs.js +35 -10
  109. package/dist/check/explain/wiring-docs.js.map +1 -1
  110. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  111. package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
  112. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  113. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  114. package/dist/check/fixtures/config-fixtures.js +6 -0
  115. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  116. package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
  117. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
  118. package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
  119. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
  120. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  121. package/dist/check/fixtures/declared-project.js +4 -1
  122. package/dist/check/fixtures/declared-project.js.map +1 -1
  123. package/dist/check/fixtures/errors-fixtures.d.ts +3 -0
  124. package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -0
  125. package/dist/check/fixtures/errors-fixtures.js +126 -0
  126. package/dist/check/fixtures/errors-fixtures.js.map +1 -0
  127. package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
  128. package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
  129. package/dist/check/fixtures/extension-fixtures.js +77 -0
  130. package/dist/check/fixtures/extension-fixtures.js.map +1 -0
  131. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  132. package/dist/check/fixtures/fixtures.js +6 -0
  133. package/dist/check/fixtures/fixtures.js.map +1 -1
  134. package/dist/check/fixtures/signature-project.d.ts +11 -0
  135. package/dist/check/fixtures/signature-project.d.ts.map +1 -0
  136. package/dist/check/fixtures/signature-project.js +21 -0
  137. package/dist/check/fixtures/signature-project.js.map +1 -0
  138. package/dist/check/fixtures/signature.d.ts +13 -0
  139. package/dist/check/fixtures/signature.d.ts.map +1 -0
  140. package/dist/check/fixtures/signature.js +24 -0
  141. package/dist/check/fixtures/signature.js.map +1 -0
  142. package/dist/check/project/beside-the-sources.d.ts +5 -0
  143. package/dist/check/project/beside-the-sources.d.ts.map +1 -0
  144. package/dist/check/project/beside-the-sources.js +21 -0
  145. package/dist/check/project/beside-the-sources.js.map +1 -0
  146. package/dist/check/project/resolve-import.d.ts.map +1 -1
  147. package/dist/check/project/resolve-import.js +4 -1
  148. package/dist/check/project/resolve-import.js.map +1 -1
  149. package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
  150. package/dist/check/rules/clean-one-export-per-file.js +14 -8
  151. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  152. package/dist/check/rules/config-valid.d.ts.map +1 -1
  153. package/dist/check/rules/config-valid.js +2 -1
  154. package/dist/check/rules/config-valid.js.map +1 -1
  155. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  156. package/dist/check/rules/declarations-barrel-current.js +34 -32
  157. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  158. package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
  159. package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
  160. package/dist/check/rules/declarations-constructor-injection.js +58 -0
  161. package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
  162. package/dist/check/rules/errors-code-unique.d.ts +3 -0
  163. package/dist/check/rules/errors-code-unique.d.ts.map +1 -0
  164. package/dist/check/rules/errors-code-unique.js +34 -0
  165. package/dist/check/rules/errors-code-unique.js.map +1 -0
  166. package/dist/check/rules/errors-known-code.d.ts +3 -0
  167. package/dist/check/rules/errors-known-code.d.ts.map +1 -0
  168. package/dist/check/rules/errors-known-code.js +51 -0
  169. package/dist/check/rules/errors-known-code.js.map +1 -0
  170. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  171. package/dist/check/rules/imports-alias-declared.js +3 -1
  172. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  173. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  174. package/dist/check/rules/imports-alias-only.js +16 -29
  175. package/dist/check/rules/imports-alias-only.js.map +1 -1
  176. package/dist/check/rules/imports-extension.d.ts +3 -0
  177. package/dist/check/rules/imports-extension.d.ts.map +1 -0
  178. package/dist/check/rules/imports-extension.js +65 -0
  179. package/dist/check/rules/imports-extension.js.map +1 -0
  180. package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
  181. package/dist/check/rules/language-glossary-term.js +7 -5
  182. package/dist/check/rules/language-glossary-term.js.map +1 -1
  183. package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
  184. package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
  185. package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
  186. package/dist/check/rules/tree-closed.js +6 -4
  187. package/dist/check/rules/tree-closed.js.map +1 -1
  188. package/dist/commands/build-aliases.d.ts.map +1 -1
  189. package/dist/commands/build-aliases.js +5 -3
  190. package/dist/commands/build-aliases.js.map +1 -1
  191. package/dist/commands/docs.d.ts.map +1 -1
  192. package/dist/commands/docs.js +17 -2
  193. package/dist/commands/docs.js.map +1 -1
  194. package/dist/commands/error-factories.d.ts +7 -0
  195. package/dist/commands/error-factories.d.ts.map +1 -0
  196. package/dist/commands/error-factories.js +65 -0
  197. package/dist/commands/error-factories.js.map +1 -0
  198. package/dist/commands/init.d.ts.map +1 -1
  199. package/dist/commands/init.js +6 -4
  200. package/dist/commands/init.js.map +1 -1
  201. package/dist/commit/is-derived.d.ts.map +1 -1
  202. package/dist/commit/is-derived.js +5 -2
  203. package/dist/commit/is-derived.js.map +1 -1
  204. package/dist/config/config.d.ts +2 -0
  205. package/dist/config/config.d.ts.map +1 -1
  206. package/dist/config/default-import-extension.d.ts +3 -0
  207. package/dist/config/default-import-extension.d.ts.map +1 -0
  208. package/dist/config/default-import-extension.js +3 -0
  209. package/dist/config/default-import-extension.js.map +1 -0
  210. package/dist/config/import-extensions.d.ts +3 -0
  211. package/dist/config/import-extensions.d.ts.map +1 -0
  212. package/dist/config/import-extensions.js +3 -0
  213. package/dist/config/import-extensions.js.map +1 -0
  214. package/dist/config/index.d.ts +4 -1
  215. package/dist/config/index.d.ts.map +1 -1
  216. package/dist/config/index.js +4 -1
  217. package/dist/config/index.js.map +1 -1
  218. package/dist/config/parse-config.d.ts.map +1 -1
  219. package/dist/config/parse-config.js +2 -0
  220. package/dist/config/parse-config.js.map +1 -1
  221. package/dist/config/parse-stack.d.ts.map +1 -1
  222. package/dist/config/parse-stack.js +3 -1
  223. package/dist/config/parse-stack.js.map +1 -1
  224. package/dist/config/restack-config-text.d.ts +11 -0
  225. package/dist/config/restack-config-text.d.ts.map +1 -0
  226. package/dist/config/restack-config-text.js +31 -0
  227. package/dist/config/restack-config-text.js.map +1 -0
  228. package/dist/config/serialize-config.d.ts.map +1 -1
  229. package/dist/config/serialize-config.js +3 -6
  230. package/dist/config/serialize-config.js.map +1 -1
  231. package/dist/config/stack.d.ts +17 -0
  232. package/dist/config/stack.d.ts.map +1 -1
  233. package/dist/config/stack.js +2 -0
  234. package/dist/config/stack.js.map +1 -1
  235. package/dist/config/unwritten-import-extension.d.ts +3 -0
  236. package/dist/config/unwritten-import-extension.d.ts.map +1 -0
  237. package/dist/config/unwritten-import-extension.js +3 -0
  238. package/dist/config/unwritten-import-extension.js.map +1 -0
  239. package/dist/config/written-stack.d.ts +8 -0
  240. package/dist/config/written-stack.d.ts.map +1 -0
  241. package/dist/config/written-stack.js +10 -0
  242. package/dist/config/written-stack.js.map +1 -0
  243. package/dist/declared/declared-role.d.ts.map +1 -1
  244. package/dist/declared/declared-role.js +1 -0
  245. package/dist/declared/declared-role.js.map +1 -1
  246. package/dist/declared/dependencies-file.d.ts +7 -0
  247. package/dist/declared/dependencies-file.d.ts.map +1 -0
  248. package/dist/declared/dependencies-file.js +9 -0
  249. package/dist/declared/dependencies-file.js.map +1 -0
  250. package/dist/declared/generated-drift.d.ts +7 -0
  251. package/dist/declared/generated-drift.d.ts.map +1 -0
  252. package/dist/declared/generated-drift.js +47 -0
  253. package/dist/declared/generated-drift.js.map +1 -0
  254. package/dist/declared/index.d.ts +8 -1
  255. package/dist/declared/index.d.ts.map +1 -1
  256. package/dist/declared/index.js +6 -1
  257. package/dist/declared/index.js.map +1 -1
  258. package/dist/declared/injection/class-injection.d.ts +19 -0
  259. package/dist/declared/injection/class-injection.d.ts.map +1 -0
  260. package/dist/declared/injection/class-injection.js +2 -0
  261. package/dist/declared/injection/class-injection.js.map +1 -0
  262. package/dist/declared/injection/constructor-of.d.ts +16 -0
  263. package/dist/declared/injection/constructor-of.d.ts.map +1 -0
  264. package/dist/declared/injection/constructor-of.js +33 -0
  265. package/dist/declared/injection/constructor-of.js.map +1 -0
  266. package/dist/declared/injection/context-injections.d.ts +8 -0
  267. package/dist/declared/injection/context-injections.d.ts.map +1 -0
  268. package/dist/declared/injection/context-injections.js +14 -0
  269. package/dist/declared/injection/context-injections.js.map +1 -0
  270. package/dist/declared/injection/declared-kind-of.d.ts +8 -0
  271. package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
  272. package/dist/declared/injection/declared-kind-of.js +12 -0
  273. package/dist/declared/injection/declared-kind-of.js.map +1 -0
  274. package/dist/declared/injection/exported-name-of.d.ts +4 -0
  275. package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
  276. package/dist/declared/injection/exported-name-of.js +17 -0
  277. package/dist/declared/injection/exported-name-of.js.map +1 -0
  278. package/dist/declared/injection/language-types.d.ts +3 -0
  279. package/dist/declared/injection/language-types.d.ts.map +1 -0
  280. package/dist/declared/injection/language-types.js +32 -0
  281. package/dist/declared/injection/language-types.js.map +1 -0
  282. package/dist/declared/injection/local-names.d.ts +17 -0
  283. package/dist/declared/injection/local-names.d.ts.map +1 -0
  284. package/dist/declared/injection/local-names.js +41 -0
  285. package/dist/declared/injection/local-names.js.map +1 -0
  286. package/dist/declared/injection/parameter-shape.d.ts +11 -0
  287. package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
  288. package/dist/declared/injection/parameter-shape.js +58 -0
  289. package/dist/declared/injection/parameter-shape.js.map +1 -0
  290. package/dist/declared/injection/raw-class-name.d.ts +7 -0
  291. package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
  292. package/dist/declared/injection/raw-class-name.js +28 -0
  293. package/dist/declared/injection/raw-class-name.js.map +1 -0
  294. package/dist/declared/injection/read-constructor.d.ts +10 -0
  295. package/dist/declared/injection/read-constructor.d.ts.map +1 -0
  296. package/dist/declared/injection/read-constructor.js +2 -0
  297. package/dist/declared/injection/read-constructor.js.map +1 -0
  298. package/dist/declared/injection/read-injections.d.ts +6 -0
  299. package/dist/declared/injection/read-injections.d.ts.map +1 -0
  300. package/dist/declared/injection/read-injections.js +75 -0
  301. package/dist/declared/injection/read-injections.js.map +1 -0
  302. package/dist/declared/injection/render-injections.d.ts +11 -0
  303. package/dist/declared/injection/render-injections.d.ts.map +1 -0
  304. package/dist/declared/injection/render-injections.js +51 -0
  305. package/dist/declared/injection/render-injections.js.map +1 -0
  306. package/dist/declared/injection/rendered-injections.d.ts +8 -0
  307. package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
  308. package/dist/declared/injection/rendered-injections.js +2 -0
  309. package/dist/declared/injection/rendered-injections.js.map +1 -0
  310. package/dist/declared/injection/resolve-token.d.ts +18 -0
  311. package/dist/declared/injection/resolve-token.d.ts.map +1 -0
  312. package/dist/declared/injection/resolve-token.js +46 -0
  313. package/dist/declared/injection/resolve-token.js.map +1 -0
  314. package/dist/declared/injection/resolved-token.d.ts +10 -0
  315. package/dist/declared/injection/resolved-token.d.ts.map +1 -0
  316. package/dist/declared/injection/resolved-token.js +2 -0
  317. package/dist/declared/injection/resolved-token.js.map +1 -0
  318. package/dist/declared/injection/sources.d.ts +4 -0
  319. package/dist/declared/injection/sources.d.ts.map +1 -0
  320. package/dist/declared/injection/sources.js +2 -0
  321. package/dist/declared/injection/sources.js.map +1 -0
  322. package/dist/declared/injection/token-reference.d.ts +14 -0
  323. package/dist/declared/injection/token-reference.d.ts.map +1 -0
  324. package/dist/declared/injection/token-reference.js +2 -0
  325. package/dist/declared/injection/token-reference.js.map +1 -0
  326. package/dist/declared/render-barrel.d.ts +8 -5
  327. package/dist/declared/render-barrel.d.ts.map +1 -1
  328. package/dist/declared/render-barrel.js +13 -6
  329. package/dist/declared/render-barrel.js.map +1 -1
  330. package/dist/declared/render-dependencies-file.d.ts +8 -0
  331. package/dist/declared/render-dependencies-file.d.ts.map +1 -0
  332. package/dist/declared/render-dependencies-file.js +12 -0
  333. package/dist/declared/render-dependencies-file.js.map +1 -0
  334. package/dist/depcruise/hygiene-rules.js +2 -1
  335. package/dist/depcruise/hygiene-rules.js.map +1 -1
  336. package/dist/describe/context-description.d.ts +22 -0
  337. package/dist/describe/context-description.d.ts.map +1 -1
  338. package/dist/describe/describe-context.d.ts.map +1 -1
  339. package/dist/describe/describe-context.js +4 -0
  340. package/dist/describe/describe-context.js.map +1 -1
  341. package/dist/describe/format-description.d.ts.map +1 -1
  342. package/dist/describe/format-description.js +9 -0
  343. package/dist/describe/format-description.js.map +1 -1
  344. package/dist/describe/read-errors.d.ts +8 -0
  345. package/dist/describe/read-errors.d.ts.map +1 -0
  346. package/dist/describe/read-errors.js +52 -0
  347. package/dist/describe/read-errors.js.map +1 -0
  348. package/dist/describe/read-projections.d.ts +5 -0
  349. package/dist/describe/read-projections.d.ts.map +1 -0
  350. package/dist/describe/read-projections.js +19 -0
  351. package/dist/describe/read-projections.js.map +1 -0
  352. package/dist/describe/reference-lines.js +23 -1
  353. package/dist/describe/reference-lines.js.map +1 -1
  354. package/dist/dev/refresh-declarations.d.ts +9 -0
  355. package/dist/dev/refresh-declarations.d.ts.map +1 -0
  356. package/dist/dev/refresh-declarations.js +28 -0
  357. package/dist/dev/refresh-declarations.js.map +1 -0
  358. package/dist/generate/access-vars.js +3 -3
  359. package/dist/generate/access-vars.js.map +1 -1
  360. package/dist/generate/errors/add-factory.d.ts +13 -0
  361. package/dist/generate/errors/add-factory.d.ts.map +1 -0
  362. package/dist/generate/errors/add-factory.js +30 -0
  363. package/dist/generate/errors/add-factory.js.map +1 -0
  364. package/dist/generate/errors/add-spec-case.d.ts +6 -0
  365. package/dist/generate/errors/add-spec-case.d.ts.map +1 -0
  366. package/dist/generate/errors/add-spec-case.js +26 -0
  367. package/dist/generate/errors/add-spec-case.js.map +1 -0
  368. package/dist/generate/errors/class-body.d.ts +8 -0
  369. package/dist/generate/errors/class-body.d.ts.map +1 -0
  370. package/dist/generate/errors/class-body.js +11 -0
  371. package/dist/generate/errors/class-body.js.map +1 -0
  372. package/dist/generate/errors/codes-of-context.d.ts +4 -0
  373. package/dist/generate/errors/codes-of-context.d.ts.map +1 -0
  374. package/dist/generate/errors/codes-of-context.js +17 -0
  375. package/dist/generate/errors/codes-of-context.js.map +1 -0
  376. package/dist/generate/errors/refusal-code.d.ts +13 -0
  377. package/dist/generate/errors/refusal-code.d.ts.map +1 -0
  378. package/dist/generate/errors/refusal-code.js +19 -0
  379. package/dist/generate/errors/refusal-code.js.map +1 -0
  380. package/dist/generate/errors/refusal-name.d.ts +4 -0
  381. package/dist/generate/errors/refusal-name.d.ts.map +1 -0
  382. package/dist/generate/errors/refusal-name.js +15 -0
  383. package/dist/generate/errors/refusal-name.js.map +1 -0
  384. package/dist/generate/errors/static-methods.d.ts +10 -0
  385. package/dist/generate/errors/static-methods.d.ts.map +1 -0
  386. package/dist/generate/errors/static-methods.js +13 -0
  387. package/dist/generate/errors/static-methods.js.map +1 -0
  388. package/dist/generate/errors/vague-refusal-names.d.ts +3 -0
  389. package/dist/generate/errors/vague-refusal-names.d.ts.map +1 -0
  390. package/dist/generate/errors/vague-refusal-names.js +15 -0
  391. package/dist/generate/errors/vague-refusal-names.js.map +1 -0
  392. package/dist/generate/kinds/context-plan.d.ts +10 -0
  393. package/dist/generate/kinds/context-plan.d.ts.map +1 -0
  394. package/dist/generate/kinds/context-plan.js +2 -0
  395. package/dist/generate/kinds/context-plan.js.map +1 -0
  396. package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
  397. package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
  398. package/dist/generate/kinds/declare-context-entries.js +4 -2
  399. package/dist/generate/kinds/declare-context-entries.js.map +1 -1
  400. package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
  401. package/dist/generate/kinds/domain-error-kind.js +4 -1
  402. package/dist/generate/kinds/domain-error-kind.js.map +1 -1
  403. package/dist/generate/kinds/error-kind.d.ts +3 -0
  404. package/dist/generate/kinds/error-kind.d.ts.map +1 -0
  405. package/dist/generate/kinds/error-kind.js +75 -0
  406. package/dist/generate/kinds/error-kind.js.map +1 -0
  407. package/dist/generate/kinds/extraction/service-selection.js +8 -11
  408. package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
  409. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  410. package/dist/generate/kinds/job/job-vars.js +5 -3
  411. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  412. package/dist/generate/kinds/plan-vars.d.ts +5 -0
  413. package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
  414. package/dist/generate/kinds/plan-vars.js +24 -0
  415. package/dist/generate/kinds/plan-vars.js.map +1 -0
  416. package/dist/generate/kinds/projection-kind.d.ts +3 -0
  417. package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
  418. package/dist/generate/kinds/projection-kind.js +72 -0
  419. package/dist/generate/kinds/projection-kind.js.map +1 -0
  420. package/dist/generate/kinds/publish-in-index.js +2 -2
  421. package/dist/generate/kinds/publish-in-index.js.map +1 -1
  422. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  423. package/dist/generate/kinds/route/route-vars.js +7 -6
  424. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  425. package/dist/generate/kinds/wire-context.d.ts +10 -0
  426. package/dist/generate/kinds/wire-context.d.ts.map +1 -0
  427. package/dist/generate/kinds/wire-context.js +36 -0
  428. package/dist/generate/kinds/wire-context.js.map +1 -0
  429. package/dist/generate/kinds/write-context-files.d.ts +1 -8
  430. package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
  431. package/dist/generate/kinds/write-context-files.js +3 -40
  432. package/dist/generate/kinds/write-context-files.js.map +1 -1
  433. package/dist/generate/kinds.d.ts.map +1 -1
  434. package/dist/generate/kinds.js +4 -0
  435. package/dist/generate/kinds.js.map +1 -1
  436. package/dist/generate/refresh-barrels.d.ts +4 -3
  437. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  438. package/dist/generate/refresh-barrels.js +41 -16
  439. package/dist/generate/refresh-barrels.js.map +1 -1
  440. package/dist/generate/spec-vars.js +4 -4
  441. package/dist/generate/spec-vars.js.map +1 -1
  442. package/dist/generate/storage-vars.d.ts +2 -2
  443. package/dist/generate/storage-vars.d.ts.map +1 -1
  444. package/dist/generate/storage-vars.js +6 -10
  445. package/dist/generate/storage-vars.js.map +1 -1
  446. package/dist/generate/workspace-sources.d.ts +6 -0
  447. package/dist/generate/workspace-sources.d.ts.map +1 -0
  448. package/dist/generate/workspace-sources.js +13 -0
  449. package/dist/generate/workspace-sources.js.map +1 -0
  450. package/dist/init/manifest/scripts-for.js +6 -1
  451. package/dist/init/manifest/scripts-for.js.map +1 -1
  452. package/dist/init/manifest/versions.js +23 -23
  453. package/dist/init/run-init.d.ts.map +1 -1
  454. package/dist/init/run-init.js +32 -3
  455. package/dist/init/run-init.js.map +1 -1
  456. package/dist/init/stack/recorded-options.d.ts +11 -0
  457. package/dist/init/stack/recorded-options.d.ts.map +1 -0
  458. package/dist/init/stack/recorded-options.js +19 -0
  459. package/dist/init/stack/recorded-options.js.map +1 -0
  460. package/dist/init/stack/resolve-stack.d.ts +6 -1
  461. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  462. package/dist/init/stack/resolve-stack.js +48 -9
  463. package/dist/init/stack/resolve-stack.js.map +1 -1
  464. package/dist/init/stack/resolve-style.d.ts +3 -5
  465. package/dist/init/stack/resolve-style.d.ts.map +1 -1
  466. package/dist/init/stack/resolve-style.js +11 -3
  467. package/dist/init/stack/resolve-style.js.map +1 -1
  468. package/dist/init/stack/stack-options.d.ts +4 -0
  469. package/dist/init/stack/stack-options.d.ts.map +1 -1
  470. package/dist/init/write-agent-settings.js +4 -3
  471. package/dist/init/write-agent-settings.js.map +1 -1
  472. package/dist/init/write-type-script-configs.d.ts +2 -1
  473. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  474. package/dist/init/write-type-script-configs.js +4 -4
  475. package/dist/init/write-type-script-configs.js.map +1 -1
  476. package/dist/refresh-declarations.d.ts +3 -0
  477. package/dist/refresh-declarations.d.ts.map +1 -0
  478. package/dist/refresh-declarations.js +4 -0
  479. package/dist/refresh-declarations.js.map +1 -0
  480. package/dist/refusals/apply-plan.d.ts +17 -0
  481. package/dist/refusals/apply-plan.d.ts.map +1 -0
  482. package/dist/refusals/apply-plan.js +118 -0
  483. package/dist/refusals/apply-plan.js.map +1 -0
  484. package/dist/refusals/factory-name-for.d.ts +7 -0
  485. package/dist/refusals/factory-name-for.d.ts.map +1 -0
  486. package/dist/refusals/factory-name-for.js +16 -0
  487. package/dist/refusals/factory-name-for.js.map +1 -0
  488. package/dist/refusals/legacy-error.d.ts +21 -0
  489. package/dist/refusals/legacy-error.d.ts.map +1 -0
  490. package/dist/refusals/legacy-error.js +2 -0
  491. package/dist/refusals/legacy-error.js.map +1 -0
  492. package/dist/refusals/legacy-errors.d.ts +6 -0
  493. package/dist/refusals/legacy-errors.d.ts.map +1 -0
  494. package/dist/refusals/legacy-errors.js +16 -0
  495. package/dist/refusals/legacy-errors.js.map +1 -0
  496. package/dist/refusals/migration-draft.d.ts +15 -0
  497. package/dist/refusals/migration-draft.d.ts.map +1 -0
  498. package/dist/refusals/migration-draft.js +41 -0
  499. package/dist/refusals/migration-draft.js.map +1 -0
  500. package/dist/refusals/migration-plan.d.ts +6 -0
  501. package/dist/refusals/migration-plan.d.ts.map +1 -0
  502. package/dist/refusals/migration-plan.js +2 -0
  503. package/dist/refusals/migration-plan.js.map +1 -0
  504. package/dist/refusals/move.d.ts +15 -0
  505. package/dist/refusals/move.d.ts.map +1 -0
  506. package/dist/refusals/move.js +2 -0
  507. package/dist/refusals/move.js.map +1 -0
  508. package/dist/refusals/nested-cases.d.ts +3 -0
  509. package/dist/refusals/nested-cases.d.ts.map +1 -0
  510. package/dist/refusals/nested-cases.js +9 -0
  511. package/dist/refusals/nested-cases.js.map +1 -0
  512. package/dist/refusals/plan-file.d.ts +3 -0
  513. package/dist/refusals/plan-file.d.ts.map +1 -0
  514. package/dist/refusals/plan-file.js +3 -0
  515. package/dist/refusals/plan-file.js.map +1 -0
  516. package/dist/refusals/planned-factory.d.ts +11 -0
  517. package/dist/refusals/planned-factory.d.ts.map +1 -0
  518. package/dist/refusals/planned-factory.js +2 -0
  519. package/dist/refusals/planned-factory.js.map +1 -0
  520. package/dist/refusals/planned-move.d.ts +8 -0
  521. package/dist/refusals/planned-move.d.ts.map +1 -0
  522. package/dist/refusals/planned-move.js +2 -0
  523. package/dist/refusals/planned-move.js.map +1 -0
  524. package/dist/refusals/project-sources.d.ts +5 -0
  525. package/dist/refusals/project-sources.d.ts.map +1 -0
  526. package/dist/refusals/project-sources.js +13 -0
  527. package/dist/refusals/project-sources.js.map +1 -0
  528. package/dist/refusals/propose-plan.d.ts +16 -0
  529. package/dist/refusals/propose-plan.d.ts.map +1 -0
  530. package/dist/refusals/propose-plan.js +39 -0
  531. package/dist/refusals/propose-plan.js.map +1 -0
  532. package/dist/refusals/read-legacy-error.d.ts +9 -0
  533. package/dist/refusals/read-legacy-error.d.ts.map +1 -0
  534. package/dist/refusals/read-legacy-error.js +75 -0
  535. package/dist/refusals/read-legacy-error.js.map +1 -0
  536. package/dist/refusals/read-plan.d.ts +4 -0
  537. package/dist/refusals/read-plan.d.ts.map +1 -0
  538. package/dist/refusals/read-plan.js +43 -0
  539. package/dist/refusals/read-plan.js.map +1 -0
  540. package/dist/refusals/render-factory.d.ts +5 -0
  541. package/dist/refusals/render-factory.d.ts.map +1 -0
  542. package/dist/refusals/render-factory.js +14 -0
  543. package/dist/refusals/render-factory.js.map +1 -0
  544. package/dist/refusals/replace-in-code.d.ts +16 -0
  545. package/dist/refusals/replace-in-code.d.ts.map +1 -0
  546. package/dist/refusals/replace-in-code.js +20 -0
  547. package/dist/refusals/replace-in-code.js.map +1 -0
  548. package/dist/refusals/rewrite-usages.d.ts +6 -0
  549. package/dist/refusals/rewrite-usages.d.ts.map +1 -0
  550. package/dist/refusals/rewrite-usages.js +80 -0
  551. package/dist/refusals/rewrite-usages.js.map +1 -0
  552. package/dist/refusals/spec-parts.d.ts +8 -0
  553. package/dist/refusals/spec-parts.d.ts.map +1 -0
  554. package/dist/refusals/spec-parts.js +14 -0
  555. package/dist/refusals/spec-parts.js.map +1 -0
  556. package/dist/run.d.ts.map +1 -1
  557. package/dist/run.js +8 -0
  558. package/dist/run.js.map +1 -1
  559. package/dist/stack/alias-vars.d.ts +2 -1
  560. package/dist/stack/alias-vars.d.ts.map +1 -1
  561. package/dist/stack/alias-vars.js +6 -3
  562. package/dist/stack/alias-vars.js.map +1 -1
  563. package/dist/stack/stack-vars.d.ts.map +1 -1
  564. package/dist/stack/stack-vars.js +2 -1
  565. package/dist/stack/stack-vars.js.map +1 -1
  566. package/dist/version.d.ts +1 -1
  567. package/dist/version.js +1 -1
  568. package/package.json +4 -3
  569. package/templates/acl/translator.spec.ts.tpl +1 -1
  570. package/templates/adapter/adapter.declared.ts.tpl +3 -3
  571. package/templates/adapter/adapter.spec.ts.tpl +1 -1
  572. package/templates/adapter/adapter.ts.tpl +1 -1
  573. package/templates/adapter/wiring.tsyringe.tpl +3 -3
  574. package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
  575. package/templates/aggregate/aggregate.ts.tpl +5 -0
  576. package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
  577. package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
  578. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
  579. package/templates/architecture/wiring.declared.tpl +1 -1
  580. package/templates/architecture/wiring.manual.tpl +1 -1
  581. package/templates/architecture/wiring.tsyringe.tpl +1 -1
  582. package/templates/builder/builder.ts.tpl +1 -1
  583. package/templates/command/handler.declared.ts.tpl +12 -7
  584. package/templates/command/handler.spec.buses.ts.tpl +4 -4
  585. package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
  586. package/templates/command/handler.ts.tpl +9 -4
  587. package/templates/command/wiring.manual.tpl +2 -2
  588. package/templates/command/wiring.tsyringe.tpl +3 -3
  589. package/templates/context/module.manual.ts.tpl +1 -1
  590. package/templates/context/permission-set.tpl +1 -1
  591. package/templates/context/permissions.spec.ts.tpl +1 -1
  592. package/templates/context/routes.spec.ts.tpl +1 -1
  593. package/templates/context/wiring.declared.tpl +2 -2
  594. package/templates/context/wiring.manual.tpl +1 -1
  595. package/templates/context/wiring.tsyringe.tpl +2 -2
  596. package/templates/docs/openapi.json.tpl +5 -0
  597. package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
  598. package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
  599. package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
  600. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  601. package/templates/entity/entity.spec.ts.tpl +1 -1
  602. package/templates/entity/entity.ts.tpl +5 -0
  603. package/templates/error/case.spec.ts.tpl +8 -0
  604. package/templates/error/concept-error.spec.ts.tpl +7 -0
  605. package/templates/error/concept-error.ts.tpl +5 -0
  606. package/templates/error/factory.ts.tpl +4 -0
  607. package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
  608. package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
  609. package/templates/event-handler/event-handler.ts.tpl +1 -1
  610. package/templates/event-handler/wiring.manual.tpl +2 -2
  611. package/templates/event-handler/wiring.tsyringe.tpl +2 -2
  612. package/templates/gateway/adapter.declared.ts.tpl +3 -3
  613. package/templates/gateway/adapter.ts.tpl +2 -2
  614. package/templates/gateway/contract.spec.ts.tpl +3 -3
  615. package/templates/gateway/fake.ts.tpl +1 -1
  616. package/templates/gateway/platform-test.declared.tpl +1 -1
  617. package/templates/gateway/platform.declared.tpl +1 -1
  618. package/templates/gateway/wiring.tsyringe.tpl +3 -3
  619. package/templates/init/CLAUDE.md.tpl +5 -2
  620. package/templates/init/README.md.tpl +15 -10
  621. package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
  622. package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
  623. package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
  624. package/templates/init/e2e/start-application.database.ts.tpl +16 -16
  625. package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
  626. package/templates/init/e2e/test-environment.ts.tpl +1 -1
  627. package/templates/init/jest.config.js.tpl +7 -0
  628. package/templates/init/main.ts.tpl +11 -11
  629. package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
  630. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
  631. package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
  632. package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
  633. package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
  634. package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
  635. package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
  636. package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
  637. package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
  638. package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
  639. package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
  640. package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
  641. package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
  642. package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
  643. package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
  644. package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
  645. package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
  646. package/templates/init/platform/auth/permissions.ts.tpl +1 -1
  647. package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
  648. package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
  649. package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
  650. package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
  651. package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
  652. package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
  653. package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
  654. package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
  655. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  656. package/templates/init/platform/config/load-config.ts.tpl +3 -3
  657. package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
  658. package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
  659. package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
  660. package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
  661. package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
  662. package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
  663. package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
  664. package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
  665. package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
  666. package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
  667. package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
  668. package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
  669. package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
  670. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
  671. package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
  672. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
  673. package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
  674. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
  675. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
  676. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
  677. package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
  678. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
  679. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
  680. package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
  681. package/templates/init/platform/errors.ts.tpl +1 -1
  682. package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
  683. package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
  684. package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
  685. package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
  686. package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
  687. package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
  688. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  689. package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
  690. package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
  691. package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
  692. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
  693. package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
  694. package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
  695. package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
  696. package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
  697. package/templates/init/platform/platform.manual.ts.tpl +3 -3
  698. package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
  699. package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
  700. package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
  701. package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
  702. package/templates/init/platform/tracing.ts.tpl +2 -2
  703. package/templates/init/rules/application.md.tpl +8 -2
  704. package/templates/init/rules/domain.md.tpl +11 -0
  705. package/templates/init/rules/infrastructure.md.tpl +3 -3
  706. package/templates/init/rules/presentation.md.tpl +5 -0
  707. package/templates/init/scripts/openapi.ts.tpl +5 -5
  708. package/templates/integration-event/audited.tpl +1 -1
  709. package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
  710. package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
  711. package/templates/integration-event/publisher.declared.ts.tpl +4 -4
  712. package/templates/integration-event/publisher.spec.ts.tpl +2 -2
  713. package/templates/integration-event/publisher.ts.tpl +2 -2
  714. package/templates/integration-event/wiring.manual.tpl +2 -2
  715. package/templates/integration-event/wiring.tsyringe.tpl +2 -2
  716. package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
  717. package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
  718. package/templates/integration-handler/integration-handler.ts.tpl +1 -1
  719. package/templates/integration-handler/wiring.manual.tpl +3 -3
  720. package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
  721. package/templates/job/job.declared.ts.tpl +3 -3
  722. package/templates/job/job.spec.buses.ts.tpl +2 -2
  723. package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
  724. package/templates/job/job.ts.tpl +1 -1
  725. package/templates/job/wiring.manual.tpl +1 -1
  726. package/templates/job/wiring.tsyringe.tpl +1 -1
  727. package/templates/pipeline/package-scripts.json +1 -1
  728. package/templates/policy/policy.declared.ts.tpl +1 -1
  729. package/templates/policy/policy.spec.declared.ts.tpl +1 -1
  730. package/templates/policy/policy.spec.ts.tpl +1 -1
  731. package/templates/policy/policy.ts.tpl +1 -1
  732. package/templates/policy/registration.tpl +1 -1
  733. package/templates/port/fake.ts.tpl +1 -1
  734. package/templates/projection/projection.spec.ts.tpl +17 -0
  735. package/templates/projection/projection.ts.tpl +11 -0
  736. package/templates/query/handler.declared.ts.tpl +4 -4
  737. package/templates/query/handler.spec.buses.ts.tpl +5 -5
  738. package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
  739. package/templates/query/handler.ts.tpl +3 -3
  740. package/templates/query/query.ts.tpl +1 -1
  741. package/templates/query/reader.fake.ts.tpl +2 -2
  742. package/templates/query/reader.in-memory.ts.tpl +4 -4
  743. package/templates/query/reader.port.ts.tpl +2 -2
  744. package/templates/query/search.handler.declared.ts.tpl +6 -6
  745. package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
  746. package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
  747. package/templates/query/search.handler.ts.tpl +4 -4
  748. package/templates/query/search.query.ts.tpl +1 -1
  749. package/templates/query/search.reader.fake.ts.tpl +2 -2
  750. package/templates/query/search.reader.in-memory.ts.tpl +3 -3
  751. package/templates/query/search.reader.port.ts.tpl +1 -1
  752. package/templates/query/search.reader.spec.ts.tpl +2 -2
  753. package/templates/query/search.wiring.manual.tpl +3 -3
  754. package/templates/query/search.wiring.tsyringe.tpl +4 -4
  755. package/templates/query/wiring.manual.tpl +3 -3
  756. package/templates/query/wiring.tsyringe.tpl +4 -4
  757. package/templates/repository/contract.spec.ts.tpl +5 -5
  758. package/templates/repository/drizzle/mapper.ts.tpl +2 -2
  759. package/templates/repository/drizzle/repository.ts.tpl +9 -17
  760. package/templates/repository/drizzle/schema-export.tpl +1 -1
  761. package/templates/repository/fake.ts.tpl +2 -2
  762. package/templates/repository/knex/mapper.ts.tpl +2 -2
  763. package/templates/repository/knex/repository.ts.tpl +10 -30
  764. package/templates/repository/knex/schema-export.tpl +1 -1
  765. package/templates/repository/knex/tables.ts.tpl +1 -1
  766. package/templates/repository/none/repository.ts.tpl +3 -3
  767. package/templates/repository/prisma/mapper.ts.tpl +2 -2
  768. package/templates/repository/prisma/repository.ts.tpl +6 -9
  769. package/templates/repository/repository.ts.tpl +1 -1
  770. package/templates/repository/typeorm/mapper.ts.tpl +2 -2
  771. package/templates/repository/typeorm/repository.ts.tpl +9 -12
  772. package/templates/repository/typeorm/schema-export.tpl +1 -1
  773. package/templates/repository/typeorm/table.tpl +1 -1
  774. package/templates/repository/wiring.manual.tpl +1 -1
  775. package/templates/repository/wiring.tsyringe.tpl +2 -2
  776. package/templates/route/route.class-validator.ts.tpl +1 -1
  777. package/templates/route/route.none.ts.tpl +1 -1
  778. package/templates/route/route.search.ts.tpl +2 -2
  779. package/templates/route/route.spec.ts.tpl +1 -1
  780. package/templates/route/route.standard-schema.ts.tpl +1 -1
  781. package/templates/route/route.zod.ts.tpl +1 -1
  782. package/templates/route/routes.on-tsyringe.tpl +1 -1
  783. package/templates/route/wiring.manual.tpl +1 -1
  784. package/templates/service/main.ts.tpl +11 -11
  785. package/templates/value-object/value-object.spec.ts.tpl +1 -1
  786. package/templates/value-object/value-object.ts.tpl +5 -0
  787. package/templates/worker/main.ts.tpl +9 -9
  788. package/dist/alias/platform-alias.d.ts +0 -4
  789. package/dist/alias/platform-alias.d.ts.map +0 -1
  790. package/dist/alias/platform-alias.js +0 -7
  791. package/dist/alias/platform-alias.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ /** A handler whose constructor states its dependencies, and what the generated files of its context then hold. */
2
+ export declare const SIGNATURE: {
3
+ readonly handler: string;
4
+ readonly handlerOf: typeof handler;
5
+ readonly ports: string[];
6
+ readonly taken: string[];
7
+ readonly barrel: string;
8
+ readonly dependencies: string;
9
+ };
10
+ /** The issue-invoice handler, declared with `decorator`, importing `imports` and taking `parameters`. */
11
+ declare function handler(decorator: string, imports: readonly string[], parameters: readonly string[]): string;
12
+ export {};
13
+ //# sourceMappingURL=signature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAcA,kHAAkH;AAClH,eAAO,MAAM,SAAS;aACpB,OAAO;aACP,SAAS;aACT,KAAK;aACL,KAAK;aACL,MAAM;aAWN,YAAY;CAQJ,CAAC;AAEX,yGAAyG;AACzG,iBAAS,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAarG"}
@@ -0,0 +1,24 @@
1
+ import { source } from './source.js';
2
+ const DECLARATIONS = "'@ddd-ts-kit/kernel/declarations'";
3
+ const COMMAND = "'@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js'";
4
+ const HANDLER = "'@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.js'";
5
+ const REPOSITORY = "'@/contexts/billing/domain/repositories/invoice.repository.js'";
6
+ const PORTS = [
7
+ "import type { Clock } from '@ddd-ts-kit/kernel';",
8
+ `import type { InvoiceRepository } from ${REPOSITORY};`,
9
+ ];
10
+ const TAKEN = ['private readonly invoiceRepository: InvoiceRepository', 'private readonly clock: Clock'];
11
+ /** A handler whose constructor states its dependencies, and what the generated files of its context then hold. */
12
+ export const SIGNATURE = {
13
+ handler: handler('@CommandHandler(IssueInvoiceCommand)', PORTS, TAKEN),
14
+ handlerOf: handler,
15
+ ports: PORTS,
16
+ taken: TAKEN,
17
+ barrel: source(`import { injected } from ${DECLARATIONS};`, `import { IssueInvoiceHandler } from ${HANDLER};`, `import { InvoiceRepository } from ${REPOSITORY};`, "import { Clock } from '@ddd-ts-kit/kernel';", '', `export * from ${COMMAND};`, `export * from ${HANDLER};`, '', 'injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);'),
18
+ dependencies: source(`import { injected } from ${DECLARATIONS};`, `import { IssueInvoiceHandler } from ${HANDLER};`, `import { InvoiceRepository } from ${REPOSITORY};`, "import { Clock } from '@ddd-ts-kit/kernel';", '', 'injected(IssueInvoiceHandler, [InvoiceRepository, Clock]);'),
19
+ };
20
+ /** The issue-invoice handler, declared with `decorator`, importing `imports` and taking `parameters`. */
21
+ function handler(decorator, imports, parameters) {
22
+ return source(...imports, `import { CommandHandler } from ${DECLARATIONS};`, `import { IssueInvoiceCommand } from ${COMMAND};`, '', decorator, 'export class IssueInvoiceHandler implements CommandHandler<IssueInvoiceCommand> {', ' constructor(', ...parameters.map((parameter) => ` ${parameter},`), ' ) {}', '}');
23
+ }
24
+ //# sourceMappingURL=signature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/check/fixtures/signature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,YAAY,GAAG,mCAAmC,CAAC;AACzD,MAAM,OAAO,GAAG,kFAAkF,CAAC;AACnG,MAAM,OAAO,GAAG,kFAAkF,CAAC;AACnG,MAAM,UAAU,GAAG,gEAAgE,CAAC;AAEpF,MAAM,KAAK,GAAG;IACZ,kDAAkD;IAClD,0CAA0C,UAAU,GAAG;CACxD,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,uDAAuD,EAAE,+BAA+B,CAAC,CAAC;AAEzG,kHAAkH;AAClH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,OAAO,CAAC,sCAAsC,EAAE,KAAK,EAAE,KAAK,CAAC;IACtE,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM,CACZ,4BAA4B,YAAY,GAAG,EAC3C,uCAAuC,OAAO,GAAG,EACjD,qCAAqC,UAAU,GAAG,EAClD,6CAA6C,EAC7C,EAAE,EACF,iBAAiB,OAAO,GAAG,EAC3B,iBAAiB,OAAO,GAAG,EAC3B,EAAE,EACF,4DAA4D,CAC7D;IACD,YAAY,EAAE,MAAM,CAClB,4BAA4B,YAAY,GAAG,EAC3C,uCAAuC,OAAO,GAAG,EACjD,qCAAqC,UAAU,GAAG,EAClD,6CAA6C,EAC7C,EAAE,EACF,4DAA4D,CAC7D;CACO,CAAC;AAEX,yGAAyG;AACzG,SAAS,OAAO,CAAC,SAAiB,EAAE,OAA0B,EAAE,UAA6B;IAC3F,OAAO,MAAM,CACX,GAAG,OAAO,EACV,kCAAkC,YAAY,GAAG,EACjD,uCAAuC,OAAO,GAAG,EACjD,EAAE,EACF,SAAS,EACT,mFAAmF,EACnF,gBAAgB,EAChB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,SAAS,GAAG,CAAC,EACrD,QAAQ,EACR,GAAG,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Project } from '../model/project.js';
2
+ import type { SourceFile } from '../model/source-file.js';
3
+ /** The TypeScript sources of the tests and of the scripts, which live next to the source root. */
4
+ export declare function besideTheSources(project: Pick<Project, 'root' | 'config'>): SourceFile[];
5
+ //# sourceMappingURL=beside-the-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beside-the-sources.d.ts","sourceRoot":"","sources":["../../../src/check/project/beside-the-sources.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQ1D,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,UAAU,EAAE,CAYxF"}
@@ -0,0 +1,21 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { FIXED_ALIAS_ROOTS } from '../../alias/index.js';
4
+ import { isSource } from './is-source.js';
5
+ import { loadSourceFile } from './load-source-file.js';
6
+ import { walkDirectory } from './walk-directory.js';
7
+ /** The trees `check` does not walk for the other rules: their files are read for their imports only. */
8
+ const BESIDE_THE_SOURCES = [FIXED_ALIAS_ROOTS.test.directory, FIXED_ALIAS_ROOTS.scripts.directory];
9
+ /** The TypeScript sources of the tests and of the scripts, which live next to the source root. */
10
+ export function besideTheSources(project) {
11
+ const files = [];
12
+ for (const directory of BESIDE_THE_SOURCES) {
13
+ walkDirectory(project.root, directory, (file, isDirectory) => {
14
+ if (!isDirectory && isSource(file)) {
15
+ files.push(loadSourceFile(project.config, file, fs.readFileSync(path.join(project.root, file), 'utf8')));
16
+ }
17
+ });
18
+ }
19
+ return files;
20
+ }
21
+ //# sourceMappingURL=beside-the-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beside-the-sources.js","sourceRoot":"","sources":["../../../src/check/project/beside-the-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wGAAwG;AACxG,MAAM,kBAAkB,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnG,kGAAkG;AAClG,MAAM,UAAU,gBAAgB,CAAC,OAAyC;IACxE,MAAM,KAAK,GAAiB,EAAE,CAAC;IAE/B,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;QAC3C,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE;YAC3D,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3G,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-import.d.ts","sourceRoot":"","sources":["../../../src/check/project/resolve-import.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAoB/F"}
1
+ {"version":3,"file":"resolve-import.d.ts","sourceRoot":"","sources":["../../../src/check/project/resolve-import.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAQ9D,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAoB/F"}
@@ -3,6 +3,8 @@ import path from 'node:path';
3
3
  import { aliasRoots } from '../../alias/index.js';
4
4
  import { locate } from './locate.js';
5
5
  const SOURCE = /\.(?:ts|mts|cts)$/;
6
+ /** A file that is not a module of the project, named with its own extension. */
7
+ const ASSET = /\.(?:json|node|wasm|[jt]sx)$/;
6
8
  const BUILTINS = new Set(builtinModules);
7
9
  /** Classifies by path alone: the imported file does not have to exist for a rule to judge it. */
8
10
  export function resolveImport(config, fromFile, specifier) {
@@ -23,7 +25,8 @@ export function resolveImport(config, fromFile, specifier) {
23
25
  }
24
26
  function asFile(config, target) {
25
27
  const clean = path.posix.normalize(target).replace(/\.(?:js|mjs|cjs)$/, '.ts');
26
- const withExtension = SOURCE.test(clean) || path.posix.extname(clean) !== '' ? clean : `${clean}.ts`;
28
+ // Written without its extension, a module is named by what remains, dots included: `invoice.aggregate` is `invoice.aggregate.ts`.
29
+ const withExtension = SOURCE.test(clean) || ASSET.test(clean) ? clean : `${clean}.ts`;
27
30
  return { kind: 'file', path: withExtension, location: locate(config, withExtension) };
28
31
  }
29
32
  function packageName(specifier) {
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-import.js","sourceRoot":"","sources":["../../../src/check/project/resolve-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,MAAM,GAAG,mBAAmB,CAAC;AACnC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;AAEzC,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,QAAgB,EAAE,SAAiB;IAC/E,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,EAAE,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAEpG,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAA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ean-one-export-per-file.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAgB7C,eAAO,MAAM,qBAAqB,EAAE,IAcnC,CAAC"}
1
+ {"version":3,"file":"clean-one-export-per-file.d.ts","sourceRoot":"","sources":["../../../src/check/rules/clean-one-export-per-file.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAgB7C,eAAO,MAAM,qBAAqB,EAAE,IAkBnC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path';
2
- import { barrelFile } from '../../declared/index.js';
2
+ import { barrelFile, dependenciesFile } from '../../declared/index.js';
3
3
  import { judgeExports } from '../exports/judge-exports.js';
4
4
  import { kebabCaseOf } from '../exports/kebab-case-of.js';
5
5
  import { matchesGlob } from '../exports/matches-glob.js';
@@ -19,6 +19,9 @@ export const cleanOneExportPerFile = {
19
19
  if (!isJudged(file, project)) {
20
20
  return [];
21
21
  }
22
+ if (isGenerated(file)) {
23
+ return [];
24
+ }
22
25
  return isEntry(file) ? declaredInEntry(file) : judged(file, project);
23
26
  });
24
27
  },
@@ -32,15 +35,18 @@ function isJudged(file, project) {
32
35
  }
33
36
  return file.path.startsWith(`${root}/`) || segments.slice(0, -1).includes(path.posix.basename(root));
34
37
  }
35
- /** `index.ts` at any depth, and the generated barrel of a declared context. */
36
- function isEntry(file) {
38
+ /** The generated files of a declared context: `declarations/barrel-current` holds every line of them. */
39
+ function isGenerated(file) {
37
40
  const name = path.posix.basename(file.path);
38
41
  const { location } = file;
39
- return (/^index\.[cm]?ts$/.test(name) ||
40
- (location.area === 'context' &&
41
- location.layer === 'root' &&
42
- location.inside.length === 0 &&
43
- name === barrelFile(location.context)));
42
+ if (location.area !== 'context' || location.layer !== 'root' || location.inside.length > 0) {
43
+ return false;
44
+ }
45
+ return name === barrelFile(location.context) || name === dependenciesFile(location.context);
46
+ }
47
+ /** `index.ts` at any depth. */
48
+ function isEntry(file) {
49
+ return /^index\.[cm]?ts$/.test(path.posix.basename(file.path));
44
50
  }
45
51
  /** Everything of an entry file that is not a re-export, an import without binding or the empty `export {};`. */
46
52
  function declaredInEntry(file) {
@@ -1 +1 @@
1
- {"version":3,"file":"clean-one-export-per-file.js","sourceRoot":"","sources":["../../../src/check/rules/clean-one-export-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKvD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,MAAM,SAAS,GACb,6HAA6H,CAAC;AAEhI,MAAM,WAAW,GAAG,+CAA+C,CAAC;AAEpE,MAAM,SAAS,GACb,qMAAqM,CAAC;AAExM,MAAM,SAAS,GACb,oOAAoO,CAAC;AAEvO,MAAM,CAAC,MAAM,qBAAqB,GAAS;IACzC,EAAE,EAAE,2BAA2B;IAC/B,WAAW,EACT,2OAA2O;IAC7O,KAAK,EAAE,MAAM;IACb,GAAG,CAAC,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI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,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IAEtB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;QAClG,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO;QACL;YACE,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,IAAI,IAAI,yCAAyC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACtG,GAAG,EAAE,mBAAmB,QAAQ,QAAQ,QAAQ,uKAAuK;SACxN;KACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config-valid.d.ts","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,WAAW,EAAE,IAqBzB,CAAC"}
1
+ {"version":3,"file":"config-valid.d.ts","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,WAAW,EAAE,IAsBzB,CAAC"}
@@ -3,7 +3,7 @@ import { ConfigInspection } from '../configuration/config-inspection.js';
3
3
  import { reporter } from '../support/reporter.js';
4
4
  export const configValid = {
5
5
  id: 'config/valid',
6
- description: 'ddd-ts-kit.config.json is consistent: known contexts, classifications, relationships, rule ids and guard mode, the same contexts as on disk, a function limit within the ceiling, complete onePerFile.allow entries, positive commit limits and coverage thresholds that are percentages.',
6
+ description: 'ddd-ts-kit.config.json is consistent: known contexts, classifications, relationships, rule ids, guard mode and import extension, the same contexts as on disk, a function limit within the ceiling, complete onePerFile.allow entries, positive commit limits and coverage thresholds that are percentages.',
7
7
  scope: 'project',
8
8
  run(project) {
9
9
  const inspection = new ConfigInspection(project, reporter(project, this.id));
@@ -12,6 +12,7 @@ export const configValid = {
12
12
  ...inspection.undeclaredDirectories(),
13
13
  ...inspection.ruleSettings(KNOWN_RULE_IDS),
14
14
  ...inspection.guardMode(),
15
+ ...inspection.importExtension(),
15
16
  ...inspection.functionLinesLimit(),
16
17
  ...inspection.onePerFileAllowances(),
17
18
  ...inspection.commitLimits(),
@@ -1 +1 @@
1
- {"version":3,"file":"config-valid.js","sourceRoot":"","sources":["../../../src/check/rules/config-valid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,EAAE,EAAE,cAAc;IAClB,WAAW,EACT,2RAA2R;IAC7R,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7E,OAAO;YACL,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CACr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/B,GAAG,UAAU,CAAC,kBAAkB,EAAE;YAClC,GAAG,UAAU,CAAC,oBAAoB,EAAE;YACpC,GAAG,UAAU,CAAC,YAAY,EAAE;YAC5B,GAAG,UAAU,CAAC,kBAAkB,EAAE;SACnC,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"declarations-barrel-current.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAS7C,eAAO,MAAM,yBAAyB,EAAE,IAsBvC,CAAC"}
1
+ {"version":3,"file":"declarations-barrel-current.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAa7C,eAAO,MAAM,yBAAyB,EAAE,IAiBvC,CAAC"}
@@ -1,44 +1,59 @@
1
- import { contextAlias } from '../../alias/index.js';
2
- import { barrelFile, renderBarrel } from '../../declared/index.js';
1
+ import { specifierOf } from '../../alias/index.js';
2
+ import { barrelFile, contextInjections, dependenciesFile, generatedDrift, renderBarrel, renderDependenciesFile, renderInjections, } from '../../declared/index.js';
3
+ import { sourceAt } from '../project/source-at.js';
3
4
  import { isDeclaredStyle } from '../support/is-declared-style.js';
4
5
  import { reporter } from '../support/reporter.js';
5
- const REGENERATE = 'Run `ddd-ts-kit generate` again, or `ddd-ts-kit docs`, which rewrite it: the barrel is derived from the role files of the context and never edited by hand.';
6
- const EXPORT = /^export \* from '(.+)';$/;
6
+ const REGENERATE = 'Run `ddd-ts-kit docs`, or `ddd-ts-kit generate` again, which rewrite it: the file is derived from the role files of the context and from their constructor signatures, and never edited by hand.';
7
7
  export const declarationsBarrelCurrent = {
8
8
  id: 'declarations/barrel-current',
9
- description: 'In the declared style assembled by barrel, <context>.declarations.ts exists and lists exactly the role files of its context.',
9
+ description: 'In the declared style, the generated file of a context is what its tree says: <context>.declarations.ts lists exactly its role files and registers the dependency list read from each constructor; under discovery <context>.dependencies.ts registers the lists alone.',
10
10
  scope: 'project',
11
11
  run(project) {
12
12
  if (!isDeclaredStyle(project)) {
13
13
  return [];
14
14
  }
15
15
  const report = reporter(project, this.id);
16
- const { contextsDir, contexts } = project.config;
17
16
  return project.contextsOnDisk
18
- .filter((context) => contexts[context] !== undefined)
19
- .flatMap((context) => {
20
- const file = `${contextsDir}/${context}/${barrelFile(context)}`;
21
- const flaw = judge(project, context, file);
22
- return flaw === undefined ? [] : [report({ file, line: 1 }, flaw.message, flaw.fix)];
23
- });
17
+ .filter((context) => project.config.contexts[context] !== undefined)
18
+ .flatMap((context) => judge(project, context))
19
+ .flatMap(({ file, flaw }) => (flaw === undefined ? [] : [report({ file, line: 1 }, flaw.message, flaw.fix)]));
24
20
  },
25
21
  };
26
- function judge(project, context, file) {
27
- const written = project.files.find((candidate) => candidate.path === file)?.text.replaceAll('\r\n', '\n');
22
+ function judge(project, context) {
23
+ const directory = `${project.config.contextsDir}/${context}`;
24
+ const barrel = `${directory}/${barrelFile(context)}`;
25
+ const entries = entriesOf(project, context);
26
+ const injections = contextInjections((file) => sourceAt(project, file), directory, entries);
27
+ const injected = renderInjections(injections, (file) => specifierOf(project.config, file));
28
28
  if (project.config.stack.assembly === 'discovery') {
29
- return written === undefined ? undefined : leftBehind(context);
29
+ const lists = { name: 'dependency lists', expected: renderDependenciesFile(injected), optional: true };
30
+ return [
31
+ { file: barrel, flaw: writtenIn(project, barrel) === undefined ? undefined : leftBehind(context) },
32
+ { file: `${directory}/${dependenciesFile(context)}`, flaw: stale(project, context, lists) },
33
+ ];
30
34
  }
31
- const expected = renderBarrel(entriesOf(project, context), contextAlias(project.config, context));
32
- if (written === expected) {
35
+ const expected = renderBarrel(entries, (entry) => specifierOf(project.config, `${directory}/${entry}`), injected);
36
+ return [{ file: barrel, flaw: stale(project, context, { name: 'barrel', expected, optional: false }) }];
37
+ }
38
+ function stale(project, context, { name, expected, optional }) {
39
+ const file = name === 'barrel' ? barrelFile(context) : dependenciesFile(context);
40
+ const written = writtenIn(project, `${project.config.contextsDir}/${context}/${file}`);
41
+ if (written === expected || (written === undefined && optional && expected === 'export {};\n')) {
33
42
  return undefined;
34
43
  }
35
44
  if (written === undefined) {
36
45
  return {
37
- message: `The barrel of "${context}" is missing: the composition root has nothing to assemble the context from.`,
46
+ message: `The ${name} of "${context}" ${name === 'barrel' ? 'is' : 'are'} missing: the composition root has nothing to ${name === 'barrel' ? 'assemble the context from' : 'inject its constructors from'}.`,
38
47
  fix: REGENERATE,
39
48
  };
40
49
  }
41
- return { message: `The barrel of "${context}" is stale: ${difference(written, expected)}.`, fix: REGENERATE };
50
+ return {
51
+ message: `The ${name} of "${context}" ${name === 'barrel' ? 'is' : 'are'} stale: ${generatedDrift(written, expected)}.`,
52
+ fix: REGENERATE,
53
+ };
54
+ }
55
+ function writtenIn(project, file) {
56
+ return project.files.find((candidate) => candidate.path === file)?.text.replaceAll('\r\n', '\n');
42
57
  }
43
58
  function leftBehind(context) {
44
59
  return {
@@ -53,17 +68,4 @@ function entriesOf(project, context) {
53
68
  .filter((entry) => entry.startsWith(prefix) && !entry.endsWith('/'))
54
69
  .map((entry) => entry.slice(prefix.length));
55
70
  }
56
- /** The first thing that tells the written barrel from the expected one, in words. */
57
- function difference(written, expected) {
58
- const exportsOf = (barrel) => barrel.split('\n').flatMap((line) => EXPORT.exec(line)?.[1] ?? []);
59
- const missing = exportsOf(expected).find((specifier) => !exportsOf(written).includes(specifier));
60
- if (missing !== undefined) {
61
- return `it does not export ${missing}, so the class declared there is registered nowhere`;
62
- }
63
- const extra = exportsOf(written).find((specifier) => !exportsOf(expected).includes(specifier));
64
- if (extra !== undefined) {
65
- return `it exports ${extra}, which is not a role file of the context`;
66
- }
67
- return 'it holds something else than one `export * from` per role file, sorted by path';
68
- }
69
71
  //# sourceMappingURL=declarations-barrel-current.js.map
@@ -1 +1 @@
1
-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gFAAgF,CAAC;AAC1F,CAAC"}
1
+ {"version":3,"file":"declarations-barrel-current.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,UAAU,GACd,kMAAkM,CAAC;AAOrM,MAAM,CAAC,MAAM,yBAAyB,GAAS;IAC7C,EAAE,EAAE,6BAA6B;IACjC,WAAW,EACT,yQAAyQ;IAC3Q,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAE1C,OAAO,OAAO,CAAC,cAAc;aAC1B,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;aACnE,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;aAC7C,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CA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OAAO,IAAI,QAAQ,OAAO,KAAK,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG;QACvH,GAAG,EAAE,UAAU;KAChB,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,OAAgB,EAAE,IAAY;IAC/C,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACnG,CAAC;AAED,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO;QACL,OAAO,EAAE,kBAAkB,OAAO,uFAAuF;QACzH,GAAG,EAAE,0BAA0B,OAAO,0BAA0B,OAAO,6FAA6F;KACrK,CAAC;AACJ,CAAC;AAED,8CAA8C;AAC9C,SAAS,SAAS,CAAC,OAAgB,EAAE,OAAe;IAClD,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,OAAO,GAAG,CAAC;IAE3D,OAAO,OAAO,CAAC,cAAc;SAC1B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACnE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const declarationsConstructorInjection: Rule;
3
+ //# sourceMappingURL=declarations-constructor-injection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarations-constructor-injection.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-constructor-injection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAO7C,eAAO,MAAM,gCAAgC,EAAE,IAwB9C,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { declaredRoleOf } from '../../declared/declared-role-of.js';
2
+ import { readInjections } from '../../declared/injection/read-injections.js';
3
+ import { sourceAt } from '../project/source-at.js';
4
+ import { inContext } from '../support/in-context.js';
5
+ import { isDeclaredStyle } from '../support/is-declared-style.js';
6
+ import { pathInContext } from '../support/path-in-context.js';
7
+ import { perFile } from '../support/per-file.js';
8
+ export const declarationsConstructorInjection = {
9
+ id: 'declarations/constructor-injection',
10
+ description: 'In the declared style, a class whose decorator lists no dependency states them in its constructor: each parameter is typed by one class, with no `?`, default value, rest or destructuring, and an inherited constructor is one the project can read. Under "stack.dependencies": "signature" a decorator carries no list.',
11
+ scope: 'file',
12
+ run(project) {
13
+ if (!isDeclaredStyle(project)) {
14
+ return [];
15
+ }
16
+ return perFile(project, this.id, (file) => {
17
+ if (!inContext(file.location) ||
18
+ file.isTest ||
19
+ declaredRoleOf(pathInContext(project, file) ?? '') === undefined) {
20
+ return [];
21
+ }
22
+ return readInjections((path) => sourceAt(project, path), file).flatMap((injection) => injection.listed === undefined ? unstated(project, injection) : listed(project, injection));
23
+ });
24
+ },
25
+ };
26
+ /**
27
+ * What keeps a constructor from stating the dependencies. A project that lists them in its
28
+ * decorators wrote its classes before the signature was read: there, a class that inherits a
29
+ * constructor nothing can read and lists nothing takes nothing, as it always did.
30
+ */
31
+ function unstated(project, { problems, readable }) {
32
+ return readable || project.config.stack.dependencies === 'signature' ? problems : [];
33
+ }
34
+ /** A list in a decorator: the statement of a 0.1 project, a second statement where the constructor is the one. */
35
+ function listed(project, injection) {
36
+ const { className, line, listed: names = [], dependencies, readable } = injection;
37
+ if (project.config.stack.dependencies !== 'signature' || !readable) {
38
+ return [];
39
+ }
40
+ const typed = dependencies?.map(({ name }) => name);
41
+ if (typed !== undefined && typed.join(',') === names.join(',')) {
42
+ return [
43
+ {
44
+ line,
45
+ message: `The decorator of ${className} lists [${names.join(', ')}], which its constructor already states.`,
46
+ fix: 'Remove the list from the decorator (`eslint --fix` does it) and import the ports that are now only types with `import type`: the constructor signature is the one statement of what a class depends on.',
47
+ },
48
+ ];
49
+ }
50
+ return [
51
+ {
52
+ line,
53
+ message: `The decorator of ${className} lists [${names.join(', ')}] and its constructor says something else: the list wins at run time, so the signature lies.`,
54
+ fix: 'Type each constructor parameter by the class its list entry names (the token is the type), then remove the list from the decorator: the constructor signature is the one statement of what a class depends on.',
55
+ },
56
+ ];
57
+ }
58
+ //# sourceMappingURL=declarations-constructor-injection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarations-constructor-injection.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-constructor-injection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAI7E,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,MAAM,CAAC,MAAM,gCAAgC,GAAS;IACpD,EAAE,EAAE,oCAAoC;IACxC,WAAW,EACT,4TAA4T;IAC9T,KAAK,EAAE,MAAM;IACb,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACxC,IACE,CAAC,SAAS,C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,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/D,OAAO;YACL;gBACE,IAAI;gBACJ,OAAO,EAAE,oBAAoB,SAAS,WAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,0CAA0C;gBAC3G,GAAG,EAAE,yMAAyM;aAC/M;SACF,CAAC;IACJ,CAAC;IAED,OAAO;QACL;YACE,IAAI;YACJ,OAAO,EAAE,oBAAoB,SAAS,WAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,8FAA8F;YAC/J,GAAG,EAAE,gNAAgN;SACtN;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const errorsCodeUnique: Rule;
3
+ //# sourceMappingURL=errors-code-unique.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-code-unique.d.ts","sourceRoot":"","sources":["../../../src/check/rules/errors-code-unique.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAO7C,eAAO,MAAM,gBAAgB,EAAE,IAe9B,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { buildsThroughFactories } from '../errors/builds-through-factories.js';
2
+ import { errorCodes } from '../errors/error-codes.js';
3
+ import { perFile } from '../support/per-file.js';
4
+ const FIX = 'Give each refusal of a context its own code, or call the factory that already sets this one: the HTTP mapping, the OpenAPI document, the audit trail and the tests know a refusal by its code alone.';
5
+ export const errorsCodeUnique = {
6
+ id: 'errors/code-unique',
7
+ description: 'Under "stack.refusals": "factories", a code is given to one refusal of a context: no two factories, and no two error classes, of the domain/errors/ of a context set the same code.',
8
+ scope: 'project',
9
+ run(project) {
10
+ if (!buildsThroughFactories(project)) {
11
+ return [];
12
+ }
13
+ // Remembers, across the error files of a context, where each code was first written.
14
+ const firstUse = new Map();
15
+ return perFile(project, this.id, (file) => codesTaken(file, firstUse));
16
+ },
17
+ };
18
+ function codesTaken(file, firstUse) {
19
+ const { location } = file;
20
+ if (location.area !== 'context' || location.layer !== 'domain' || location.inside[0] !== 'errors' || file.isTest) {
21
+ return [];
22
+ }
23
+ return errorCodes(file.scan).flatMap(({ code, line }) => {
24
+ const key = `${location.context} ${code}`;
25
+ const first = firstUse.get(key);
26
+ if (first === undefined) {
27
+ firstUse.set(key, `${file.path}:${line}`);
28
+ }
29
+ return first === undefined
30
+ ? []
31
+ : [{ line, message: `The code "${code}" is already set in ${first}, in the same context.`, fix: FIX }];
32
+ });
33
+ }
34
+ //# sourceMappingURL=errors-code-unique.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-code-unique.js","sourceRoot":"","sources":["../../../src/check/rules/errors-code-unique.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,MAAM,GAAG,GACP,sMAAsM,CAAC;AAEzM,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,EAAE,EAAE,oBAAoB;IACxB,WAAW,EACT,qLAAqL;IACvL,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,qFAAqF;QACrF,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;QAE3C,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACzE,CAAC;CACF,CAAC;AAEF,SAAS,UAAU,CAAC,IAAgB,EAAE,QAA6B;IACjE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1B,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACjH,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;QACtD,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,IAAI,uBAAuB,KAAK,wBAAwB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3G,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const errorsKnownCode: Rule;
3
+ //# sourceMappingURL=errors-known-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-known-code.d.ts","sourceRoot":"","sources":["../../../src/check/rules/errors-known-code.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAO7C,eAAO,MAAM,eAAe,EAAE,IAc7B,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { buildsThroughFactories } from '../errors/builds-through-factories.js';
2
+ import { errorCodes } from '../errors/error-codes.js';
3
+ import { KIT_ERROR_CODES } from '../errors/kit-error-codes.js';
4
+ import { perFile } from '../support/per-file.js';
5
+ import { matchingBracket } from '../text/matching-bracket.js';
6
+ const ERRORS_LIST = /(?<![\w$.])errors\s*:\s*\[/g;
7
+ export const errorsKnownCode = {
8
+ id: 'errors/known-code',
9
+ description: 'Under "stack.refusals": "factories", every code a route declares in `errors` exists: a factory or an error class of its context sets it, a class outside the contexts does, or it is a code of the kit.',
10
+ scope: 'project',
11
+ run(project) {
12
+ if (!buildsThroughFactories(project)) {
13
+ return [];
14
+ }
15
+ const known = knownCodes(project);
16
+ return perFile(project, this.id, (file) => (isRouteFile(file) ? unknownCodes(file, known) : []));
17
+ },
18
+ };
19
+ /** The codes set outside the contexts (platform, shared kernel) under the key `*`, and those of each context under its name. */
20
+ function knownCodes(project) {
21
+ const known = new Map([['*', new Set(KIT_ERROR_CODES)]]);
22
+ for (const file of project.files.filter((candidate) => !candidate.isTest)) {
23
+ const owner = file.location.area === 'context' ? file.location.context : '*';
24
+ const codes = known.get(owner) ?? new Set();
25
+ for (const { code } of errorCodes(file.scan)) {
26
+ codes.add(code);
27
+ }
28
+ known.set(owner, codes);
29
+ }
30
+ return known;
31
+ }
32
+ function isRouteFile(file) {
33
+ return !file.isTest && file.path.endsWith('.route.ts');
34
+ }
35
+ function unknownCodes(file, known) {
36
+ const { scan, location } = file;
37
+ const context = location.area === 'context' ? location.context : '*';
38
+ const exists = (code) => known.get('*')?.has(code) === true || known.get(context)?.has(code) === true;
39
+ return [...scan.code.matchAll(ERRORS_LIST)].flatMap((match) => {
40
+ const open = match.index + match[0].length - 1;
41
+ const close = matchingBracket(scan.code, open);
42
+ return scan.strings
43
+ .filter((literal) => literal.start > open && literal.end <= close && !exists(literal.value))
44
+ .map((literal) => ({
45
+ line: scan.lineAt(literal.start),
46
+ message: `The route declares the error code "${literal.value}", which no refusal ${context === '*' ? 'of the project' : `of the context "${context}"`} sets.`,
47
+ fix: `Write the code as its factory sets it, or add the refusal: \`ddd-ts-kit generate error ${context === '*' ? '<context>' : context} <Concept> <refusal>\`. A code declared and never raised is a promise the contract makes for nothing.`,
48
+ }));
49
+ });
50
+ }
51
+ //# sourceMappingURL=errors-known-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-known-code.js","sourceRoot":"","sources":["../../../src/check/rules/errors-known-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAK/D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,mBAAmB;IACvB,WAAW,EACT,yMAAyM;IAC3M,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAElC,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnG,CAAC;CACF,CAAC;AAEF,gIAAgI;AAChI,SAAS,UAAU,CAAC,OAAgB;IAClC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAsB,CAAC,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC,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,IAAI,CAAC;IAE/E,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC,OAAO;aAChB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aAC3F,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACjB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YAChC,OAAO,EAAE,sCAAsC,OAAO,CAAC,KAAK,uBAAuB,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,mBAAmB,OAAO,GAAG,QAAQ;YAC7J,GAAG,EAAE,0FAA0F,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,uGAAuG;SAC9O,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"imports-alias-declared.d.ts","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-declared.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,oBAAoB,EAAE,IAqBlC,CAAC"}
1
+ {"version":3,"file":"imports-alias-declared.d.ts","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-declared.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,eAAO,MAAM,oBAAoB,EAAE,IAsBlC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { aliasRoots } from '../../alias/index.js';
2
2
  import { buildScripts } from '../alias/build-scripts.js';
3
3
  import { compilerPaths } from '../alias/compiler-paths.js';
4
+ import { compilerResolution } from '../alias/compiler-resolution.js';
4
5
  import { configuredAlias } from '../alias/configured-alias.js';
5
6
  import { graphTools } from '../alias/graph-tools.js';
6
7
  import { sourceRunners } from '../alias/source-runners.js';
@@ -8,7 +9,7 @@ import { testRunners } from '../alias/test-runners.js';
8
9
  import { reporter } from '../support/reporter.js';
9
10
  export const importsAliasDeclared = {
10
11
  id: 'imports/alias-declared',
11
- description: 'The import alias has one source, "importAlias", and every tool follows it: tsconfig "paths" is exactly what it gives, vitest and dependency-cruiser read tsconfig, jest repeats the same mapping, no knip "paths" adds another, and the build rewrites the aliases after the compiler.',
12
+ description: 'The import alias has one source, "importAlias", and the ending of an import another, "importExtension"; every tool follows them: tsconfig "paths" is exactly what the alias gives, "module" and "moduleResolution" are what the ending needs, vitest and dependency-cruiser read tsconfig, jest repeats the same mapping, no knip "paths" adds another, and the build rewrites the aliases after the compiler.',
12
13
  scope: 'project',
13
14
  run(project) {
14
15
  const inspected = { project, roots: aliasRoots(project.config), report: reporter(project, this.id) };
@@ -18,6 +19,7 @@ export const importsAliasDeclared = {
18
19
  }
19
20
  return [
20
21
  ...compilerPaths(inspected),
22
+ ...compilerResolution(inspected),
21
23
  ...buildScripts(inspected),
22
24
  ...sourceRunners(inspected),
23
25
  ...testRunners(inspected),