ddd-ts-kit 0.1.0 → 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 (772) hide show
  1. package/README.md +124 -24
  2. package/dist/affected/changed-paths.d.ts +8 -0
  3. package/dist/affected/changed-paths.d.ts.map +1 -0
  4. package/dist/affected/changed-paths.js +21 -0
  5. package/dist/affected/changed-paths.js.map +1 -0
  6. package/dist/affected/downstreams-of.d.ts +4 -0
  7. package/dist/affected/downstreams-of.d.ts.map +1 -0
  8. package/dist/affected/downstreams-of.js +16 -0
  9. package/dist/affected/downstreams-of.js.map +1 -0
  10. package/dist/affected/everything.d.ts +5 -0
  11. package/dist/affected/everything.d.ts.map +1 -0
  12. package/dist/affected/everything.js +5 -0
  13. package/dist/affected/everything.js.map +1 -0
  14. package/dist/affected/format-selection.d.ts +10 -0
  15. package/dist/affected/format-selection.d.ts.map +1 -0
  16. package/dist/affected/format-selection.js +45 -0
  17. package/dist/affected/format-selection.js.map +1 -0
  18. package/dist/affected/path-reach.d.ts +12 -0
  19. package/dist/affected/path-reach.d.ts.map +1 -0
  20. package/dist/affected/path-reach.js +2 -0
  21. package/dist/affected/path-reach.js.map +1 -0
  22. package/dist/affected/reach-of.d.ts +10 -0
  23. package/dist/affected/reach-of.d.ts.map +1 -0
  24. package/dist/affected/reach-of.js +30 -0
  25. package/dist/affected/reach-of.js.map +1 -0
  26. package/dist/affected/select-affected.d.ts +11 -0
  27. package/dist/affected/select-affected.d.ts.map +1 -0
  28. package/dist/affected/select-affected.js +39 -0
  29. package/dist/affected/select-affected.js.map +1 -0
  30. package/dist/affected/selection.d.ts +14 -0
  31. package/dist/affected/selection.d.ts.map +1 -0
  32. package/dist/affected/selection.js +2 -0
  33. package/dist/affected/selection.js.map +1 -0
  34. package/dist/alias/compiler-resolution-of.d.ts +10 -0
  35. package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
  36. package/dist/alias/compiler-resolution-of.js +13 -0
  37. package/dist/alias/compiler-resolution-of.js.map +1 -0
  38. package/dist/alias/compiler-resolution.d.ts +8 -0
  39. package/dist/alias/compiler-resolution.d.ts.map +1 -0
  40. package/dist/alias/compiler-resolution.js +2 -0
  41. package/dist/alias/compiler-resolution.js.map +1 -0
  42. package/dist/alias/index.d.ts +3 -1
  43. package/dist/alias/index.d.ts.map +1 -1
  44. package/dist/alias/index.js +3 -1
  45. package/dist/alias/index.js.map +1 -1
  46. package/dist/alias/module-name-mapper.d.ts +4 -3
  47. package/dist/alias/module-name-mapper.d.ts.map +1 -1
  48. package/dist/alias/module-name-mapper.js +6 -4
  49. package/dist/alias/module-name-mapper.js.map +1 -1
  50. package/dist/alias/specifier-of.d.ts +7 -0
  51. package/dist/alias/specifier-of.d.ts.map +1 -0
  52. package/dist/alias/specifier-of.js +17 -0
  53. package/dist/alias/specifier-of.js.map +1 -0
  54. package/dist/alias/specifier-suffix.d.ts +6 -0
  55. package/dist/alias/specifier-suffix.d.ts.map +1 -0
  56. package/dist/alias/specifier-suffix.js +8 -0
  57. package/dist/alias/specifier-suffix.js.map +1 -0
  58. package/dist/alias/to-alias.d.ts +3 -2
  59. package/dist/alias/to-alias.d.ts.map +1 -1
  60. package/dist/alias/to-alias.js +4 -3
  61. package/dist/alias/to-alias.js.map +1 -1
  62. package/dist/build/emitted-place.d.ts +2 -0
  63. package/dist/build/emitted-place.d.ts.map +1 -1
  64. package/dist/build/emitted-specifier.d.ts +3 -2
  65. package/dist/build/emitted-specifier.d.ts.map +1 -1
  66. package/dist/build/emitted-specifier.js +6 -12
  67. package/dist/build/emitted-specifier.js.map +1 -1
  68. package/dist/build/emitted-target.d.ts +9 -0
  69. package/dist/build/emitted-target.d.ts.map +1 -0
  70. package/dist/build/emitted-target.js +18 -0
  71. package/dist/build/emitted-target.js.map +1 -0
  72. package/dist/build/rewrite-aliases.d.ts +5 -3
  73. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  74. package/dist/build/rewrite-aliases.js +12 -7
  75. package/dist/build/rewrite-aliases.js.map +1 -1
  76. package/dist/build/rewrite-specifiers.d.ts +3 -1
  77. package/dist/build/rewrite-specifiers.d.ts.map +1 -1
  78. package/dist/build/rewrite-specifiers.js +2 -2
  79. package/dist/build/rewrite-specifiers.js.map +1 -1
  80. package/dist/build/unresolved-problem.d.ts +4 -0
  81. package/dist/build/unresolved-problem.d.ts.map +1 -0
  82. package/dist/build/unresolved-problem.js +16 -0
  83. package/dist/build/unresolved-problem.js.map +1 -0
  84. package/dist/check/alias/compiler-resolution.d.ts +10 -0
  85. package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
  86. package/dist/check/alias/compiler-resolution.js +47 -0
  87. package/dist/check/alias/compiler-resolution.js.map +1 -0
  88. package/dist/check/alias/test-runners.js +4 -4
  89. package/dist/check/alias/test-runners.js.map +1 -1
  90. package/dist/check/canonical/roles.d.ts.map +1 -1
  91. package/dist/check/canonical/roles.js +6 -0
  92. package/dist/check/canonical/roles.js.map +1 -1
  93. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  94. package/dist/check/catalogue/architecture-rules.js +4 -0
  95. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  96. package/dist/check/configuration/config-inspection.d.ts +2 -0
  97. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  98. package/dist/check/configuration/config-inspection.js +11 -1
  99. package/dist/check/configuration/config-inspection.js.map +1 -1
  100. package/dist/check/declarations/classes-of.js +1 -1
  101. package/dist/check/declarations/classes-of.js.map +1 -1
  102. package/dist/check/explain/context-docs.js +7 -7
  103. package/dist/check/explain/context-docs.js.map +1 -1
  104. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  105. package/dist/check/explain/imports-docs.js +24 -9
  106. package/dist/check/explain/imports-docs.js.map +1 -1
  107. package/dist/check/explain/layer-docs.js +7 -7
  108. package/dist/check/explain/layer-docs.js.map +1 -1
  109. package/dist/check/explain/ports-docs.d.ts.map +1 -1
  110. package/dist/check/explain/ports-docs.js +15 -7
  111. package/dist/check/explain/ports-docs.js.map +1 -1
  112. package/dist/check/explain/scheduling-docs.js +1 -1
  113. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  114. package/dist/check/explain/wiring-docs.js +35 -10
  115. package/dist/check/explain/wiring-docs.js.map +1 -1
  116. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  117. package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
  118. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  119. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  120. package/dist/check/fixtures/config-fixtures.js +6 -0
  121. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  122. package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
  123. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
  124. package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
  125. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
  126. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  127. package/dist/check/fixtures/declared-project.js +4 -1
  128. package/dist/check/fixtures/declared-project.js.map +1 -1
  129. package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
  130. package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
  131. package/dist/check/fixtures/extension-fixtures.js +77 -0
  132. package/dist/check/fixtures/extension-fixtures.js.map +1 -0
  133. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  134. package/dist/check/fixtures/fixtures.js +4 -0
  135. package/dist/check/fixtures/fixtures.js.map +1 -1
  136. package/dist/check/fixtures/signature-project.d.ts +11 -0
  137. package/dist/check/fixtures/signature-project.d.ts.map +1 -0
  138. package/dist/check/fixtures/signature-project.js +21 -0
  139. package/dist/check/fixtures/signature-project.js.map +1 -0
  140. package/dist/check/fixtures/signature.d.ts +13 -0
  141. package/dist/check/fixtures/signature.d.ts.map +1 -0
  142. package/dist/check/fixtures/signature.js +24 -0
  143. package/dist/check/fixtures/signature.js.map +1 -0
  144. package/dist/check/project/beside-the-sources.d.ts +5 -0
  145. package/dist/check/project/beside-the-sources.d.ts.map +1 -0
  146. package/dist/check/project/beside-the-sources.js +21 -0
  147. package/dist/check/project/beside-the-sources.js.map +1 -0
  148. package/dist/check/project/resolve-import.d.ts.map +1 -1
  149. package/dist/check/project/resolve-import.js +4 -1
  150. package/dist/check/project/resolve-import.js.map +1 -1
  151. package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
  152. package/dist/check/rules/clean-one-export-per-file.js +14 -8
  153. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  154. package/dist/check/rules/config-valid.d.ts.map +1 -1
  155. package/dist/check/rules/config-valid.js +2 -1
  156. package/dist/check/rules/config-valid.js.map +1 -1
  157. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  158. package/dist/check/rules/declarations-barrel-current.js +34 -32
  159. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  160. package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
  161. package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
  162. package/dist/check/rules/declarations-constructor-injection.js +58 -0
  163. package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
  164. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  165. package/dist/check/rules/imports-alias-declared.js +3 -1
  166. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  167. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  168. package/dist/check/rules/imports-alias-only.js +16 -29
  169. package/dist/check/rules/imports-alias-only.js.map +1 -1
  170. package/dist/check/rules/imports-extension.d.ts +3 -0
  171. package/dist/check/rules/imports-extension.d.ts.map +1 -0
  172. package/dist/check/rules/imports-extension.js +65 -0
  173. package/dist/check/rules/imports-extension.js.map +1 -0
  174. package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
  175. package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
  176. package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
  177. package/dist/check/rules/tree-closed.js +6 -4
  178. package/dist/check/rules/tree-closed.js.map +1 -1
  179. package/dist/commands/affected.d.ts +8 -0
  180. package/dist/commands/affected.d.ts.map +1 -0
  181. package/dist/commands/affected.js +38 -0
  182. package/dist/commands/affected.js.map +1 -0
  183. package/dist/commands/build-aliases.d.ts.map +1 -1
  184. package/dist/commands/build-aliases.js +5 -3
  185. package/dist/commands/build-aliases.js.map +1 -1
  186. package/dist/commands/docs.d.ts.map +1 -1
  187. package/dist/commands/docs.js +19 -2
  188. package/dist/commands/docs.js.map +1 -1
  189. package/dist/commands/generate.d.ts.map +1 -1
  190. package/dist/commands/generate.js +5 -0
  191. package/dist/commands/generate.js.map +1 -1
  192. package/dist/commands/init.d.ts.map +1 -1
  193. package/dist/commands/init.js +7 -1
  194. package/dist/commands/init.js.map +1 -1
  195. package/dist/commit/is-derived.d.ts.map +1 -1
  196. package/dist/commit/is-derived.js +5 -2
  197. package/dist/commit/is-derived.js.map +1 -1
  198. package/dist/config/config.d.ts +2 -0
  199. package/dist/config/config.d.ts.map +1 -1
  200. package/dist/config/default-import-extension.d.ts +3 -0
  201. package/dist/config/default-import-extension.d.ts.map +1 -0
  202. package/dist/config/default-import-extension.js +3 -0
  203. package/dist/config/default-import-extension.js.map +1 -0
  204. package/dist/config/import-extensions.d.ts +3 -0
  205. package/dist/config/import-extensions.d.ts.map +1 -0
  206. package/dist/config/import-extensions.js +3 -0
  207. package/dist/config/import-extensions.js.map +1 -0
  208. package/dist/config/index.d.ts +4 -1
  209. package/dist/config/index.d.ts.map +1 -1
  210. package/dist/config/index.js +4 -1
  211. package/dist/config/index.js.map +1 -1
  212. package/dist/config/parse-config.d.ts.map +1 -1
  213. package/dist/config/parse-config.js +2 -0
  214. package/dist/config/parse-config.js.map +1 -1
  215. package/dist/config/parse-stack.d.ts.map +1 -1
  216. package/dist/config/parse-stack.js +3 -1
  217. package/dist/config/parse-stack.js.map +1 -1
  218. package/dist/config/restack-config-text.d.ts +11 -0
  219. package/dist/config/restack-config-text.d.ts.map +1 -0
  220. package/dist/config/restack-config-text.js +31 -0
  221. package/dist/config/restack-config-text.js.map +1 -0
  222. package/dist/config/serialize-config.d.ts.map +1 -1
  223. package/dist/config/serialize-config.js +3 -6
  224. package/dist/config/serialize-config.js.map +1 -1
  225. package/dist/config/stack.d.ts +15 -0
  226. package/dist/config/stack.d.ts.map +1 -1
  227. package/dist/config/stack.js +2 -0
  228. package/dist/config/stack.js.map +1 -1
  229. package/dist/config/unwritten-import-extension.d.ts +3 -0
  230. package/dist/config/unwritten-import-extension.d.ts.map +1 -0
  231. package/dist/config/unwritten-import-extension.js +3 -0
  232. package/dist/config/unwritten-import-extension.js.map +1 -0
  233. package/dist/config/written-stack.d.ts +8 -0
  234. package/dist/config/written-stack.d.ts.map +1 -0
  235. package/dist/config/written-stack.js +10 -0
  236. package/dist/config/written-stack.js.map +1 -0
  237. package/dist/declared/declared-role.d.ts.map +1 -1
  238. package/dist/declared/declared-role.js +1 -0
  239. package/dist/declared/declared-role.js.map +1 -1
  240. package/dist/declared/dependencies-file.d.ts +7 -0
  241. package/dist/declared/dependencies-file.d.ts.map +1 -0
  242. package/dist/declared/dependencies-file.js +9 -0
  243. package/dist/declared/dependencies-file.js.map +1 -0
  244. package/dist/declared/generated-drift.d.ts +7 -0
  245. package/dist/declared/generated-drift.d.ts.map +1 -0
  246. package/dist/declared/generated-drift.js +47 -0
  247. package/dist/declared/generated-drift.js.map +1 -0
  248. package/dist/declared/index.d.ts +8 -1
  249. package/dist/declared/index.d.ts.map +1 -1
  250. package/dist/declared/index.js +6 -1
  251. package/dist/declared/index.js.map +1 -1
  252. package/dist/declared/injection/class-injection.d.ts +19 -0
  253. package/dist/declared/injection/class-injection.d.ts.map +1 -0
  254. package/dist/declared/injection/class-injection.js +2 -0
  255. package/dist/declared/injection/class-injection.js.map +1 -0
  256. package/dist/declared/injection/constructor-of.d.ts +16 -0
  257. package/dist/declared/injection/constructor-of.d.ts.map +1 -0
  258. package/dist/declared/injection/constructor-of.js +33 -0
  259. package/dist/declared/injection/constructor-of.js.map +1 -0
  260. package/dist/declared/injection/context-injections.d.ts +8 -0
  261. package/dist/declared/injection/context-injections.d.ts.map +1 -0
  262. package/dist/declared/injection/context-injections.js +14 -0
  263. package/dist/declared/injection/context-injections.js.map +1 -0
  264. package/dist/declared/injection/declared-kind-of.d.ts +8 -0
  265. package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
  266. package/dist/declared/injection/declared-kind-of.js +12 -0
  267. package/dist/declared/injection/declared-kind-of.js.map +1 -0
  268. package/dist/declared/injection/exported-name-of.d.ts +4 -0
  269. package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
  270. package/dist/declared/injection/exported-name-of.js +17 -0
  271. package/dist/declared/injection/exported-name-of.js.map +1 -0
  272. package/dist/declared/injection/language-types.d.ts +3 -0
  273. package/dist/declared/injection/language-types.d.ts.map +1 -0
  274. package/dist/declared/injection/language-types.js +32 -0
  275. package/dist/declared/injection/language-types.js.map +1 -0
  276. package/dist/declared/injection/local-names.d.ts +17 -0
  277. package/dist/declared/injection/local-names.d.ts.map +1 -0
  278. package/dist/declared/injection/local-names.js +41 -0
  279. package/dist/declared/injection/local-names.js.map +1 -0
  280. package/dist/declared/injection/parameter-shape.d.ts +11 -0
  281. package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
  282. package/dist/declared/injection/parameter-shape.js +58 -0
  283. package/dist/declared/injection/parameter-shape.js.map +1 -0
  284. package/dist/declared/injection/raw-class-name.d.ts +7 -0
  285. package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
  286. package/dist/declared/injection/raw-class-name.js +28 -0
  287. package/dist/declared/injection/raw-class-name.js.map +1 -0
  288. package/dist/declared/injection/read-constructor.d.ts +10 -0
  289. package/dist/declared/injection/read-constructor.d.ts.map +1 -0
  290. package/dist/declared/injection/read-constructor.js +2 -0
  291. package/dist/declared/injection/read-constructor.js.map +1 -0
  292. package/dist/declared/injection/read-injections.d.ts +6 -0
  293. package/dist/declared/injection/read-injections.d.ts.map +1 -0
  294. package/dist/declared/injection/read-injections.js +75 -0
  295. package/dist/declared/injection/read-injections.js.map +1 -0
  296. package/dist/declared/injection/render-injections.d.ts +11 -0
  297. package/dist/declared/injection/render-injections.d.ts.map +1 -0
  298. package/dist/declared/injection/render-injections.js +51 -0
  299. package/dist/declared/injection/render-injections.js.map +1 -0
  300. package/dist/declared/injection/rendered-injections.d.ts +8 -0
  301. package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
  302. package/dist/declared/injection/rendered-injections.js +2 -0
  303. package/dist/declared/injection/rendered-injections.js.map +1 -0
  304. package/dist/declared/injection/resolve-token.d.ts +18 -0
  305. package/dist/declared/injection/resolve-token.d.ts.map +1 -0
  306. package/dist/declared/injection/resolve-token.js +46 -0
  307. package/dist/declared/injection/resolve-token.js.map +1 -0
  308. package/dist/declared/injection/resolved-token.d.ts +10 -0
  309. package/dist/declared/injection/resolved-token.d.ts.map +1 -0
  310. package/dist/declared/injection/resolved-token.js +2 -0
  311. package/dist/declared/injection/resolved-token.js.map +1 -0
  312. package/dist/declared/injection/sources.d.ts +4 -0
  313. package/dist/declared/injection/sources.d.ts.map +1 -0
  314. package/dist/declared/injection/sources.js +2 -0
  315. package/dist/declared/injection/sources.js.map +1 -0
  316. package/dist/declared/injection/token-reference.d.ts +14 -0
  317. package/dist/declared/injection/token-reference.d.ts.map +1 -0
  318. package/dist/declared/injection/token-reference.js +2 -0
  319. package/dist/declared/injection/token-reference.js.map +1 -0
  320. package/dist/declared/render-barrel.d.ts +8 -5
  321. package/dist/declared/render-barrel.d.ts.map +1 -1
  322. package/dist/declared/render-barrel.js +13 -6
  323. package/dist/declared/render-barrel.js.map +1 -1
  324. package/dist/declared/render-dependencies-file.d.ts +8 -0
  325. package/dist/declared/render-dependencies-file.d.ts.map +1 -0
  326. package/dist/declared/render-dependencies-file.js +12 -0
  327. package/dist/declared/render-dependencies-file.js.map +1 -0
  328. package/dist/depcruise/cruise-configuration.js +3 -1
  329. package/dist/depcruise/cruise-configuration.js.map +1 -1
  330. package/dist/depcruise/hygiene-rules.js +2 -1
  331. package/dist/depcruise/hygiene-rules.js.map +1 -1
  332. package/dist/describe/context-description.d.ts +10 -0
  333. package/dist/describe/context-description.d.ts.map +1 -1
  334. package/dist/describe/describe-context.d.ts.map +1 -1
  335. package/dist/describe/describe-context.js +2 -0
  336. package/dist/describe/describe-context.js.map +1 -1
  337. package/dist/describe/format-description.d.ts.map +1 -1
  338. package/dist/describe/format-description.js +4 -0
  339. package/dist/describe/format-description.js.map +1 -1
  340. package/dist/describe/read-projections.d.ts +5 -0
  341. package/dist/describe/read-projections.d.ts.map +1 -0
  342. package/dist/describe/read-projections.js +19 -0
  343. package/dist/describe/read-projections.js.map +1 -0
  344. package/dist/describe/reference-lines.js +9 -0
  345. package/dist/describe/reference-lines.js.map +1 -1
  346. package/dist/dev/refresh-declarations.d.ts +9 -0
  347. package/dist/dev/refresh-declarations.d.ts.map +1 -0
  348. package/dist/dev/refresh-declarations.js +28 -0
  349. package/dist/dev/refresh-declarations.js.map +1 -0
  350. package/dist/generate/access-vars.js +3 -3
  351. package/dist/generate/access-vars.js.map +1 -1
  352. package/dist/generate/apply-wiring.js +1 -1
  353. package/dist/generate/apply-wiring.js.map +1 -1
  354. package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
  355. package/dist/generate/kinds/adapter-kind.js +5 -2
  356. package/dist/generate/kinds/adapter-kind.js.map +1 -1
  357. package/dist/generate/kinds/context-plan.d.ts +10 -0
  358. package/dist/generate/kinds/context-plan.d.ts.map +1 -0
  359. package/dist/generate/kinds/context-plan.js +2 -0
  360. package/dist/generate/kinds/context-plan.js.map +1 -0
  361. package/dist/generate/kinds/declare-context-entries.d.ts +12 -0
  362. package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -0
  363. package/dist/generate/kinds/declare-context-entries.js +33 -0
  364. package/dist/generate/kinds/declare-context-entries.js.map +1 -0
  365. package/dist/generate/kinds/extraction/service-selection.js +8 -11
  366. package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
  367. package/dist/generate/kinds/generate-context.d.ts.map +1 -1
  368. package/dist/generate/kinds/generate-context.js +2 -0
  369. package/dist/generate/kinds/generate-context.js.map +1 -1
  370. package/dist/generate/kinds/import-assembler.d.ts +9 -0
  371. package/dist/generate/kinds/import-assembler.d.ts.map +1 -0
  372. package/dist/generate/kinds/import-assembler.js +29 -0
  373. package/dist/generate/kinds/import-assembler.js.map +1 -0
  374. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  375. package/dist/generate/kinds/job/job-vars.js +5 -3
  376. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  377. package/dist/generate/kinds/plan-vars.d.ts +5 -0
  378. package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
  379. package/dist/generate/kinds/plan-vars.js +24 -0
  380. package/dist/generate/kinds/plan-vars.js.map +1 -0
  381. package/dist/generate/kinds/projection-kind.d.ts +3 -0
  382. package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
  383. package/dist/generate/kinds/projection-kind.js +72 -0
  384. package/dist/generate/kinds/projection-kind.js.map +1 -0
  385. package/dist/generate/kinds/publish-in-index.js +2 -2
  386. package/dist/generate/kinds/publish-in-index.js.map +1 -1
  387. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  388. package/dist/generate/kinds/route/route-vars.js +7 -6
  389. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  390. package/dist/generate/kinds/wire-context.d.ts +10 -0
  391. package/dist/generate/kinds/wire-context.d.ts.map +1 -0
  392. package/dist/generate/kinds/wire-context.js +36 -0
  393. package/dist/generate/kinds/wire-context.js.map +1 -0
  394. package/dist/generate/kinds/write-context-files.d.ts +1 -8
  395. package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
  396. package/dist/generate/kinds/write-context-files.js +3 -32
  397. package/dist/generate/kinds/write-context-files.js.map +1 -1
  398. package/dist/generate/kinds/write-own-policy.d.ts +9 -0
  399. package/dist/generate/kinds/write-own-policy.d.ts.map +1 -0
  400. package/dist/generate/kinds/write-own-policy.js +13 -0
  401. package/dist/generate/kinds/write-own-policy.js.map +1 -0
  402. package/dist/generate/kinds.d.ts.map +1 -1
  403. package/dist/generate/kinds.js +2 -0
  404. package/dist/generate/kinds.js.map +1 -1
  405. package/dist/generate/refresh-barrels.d.ts +4 -3
  406. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  407. package/dist/generate/refresh-barrels.js +41 -16
  408. package/dist/generate/refresh-barrels.js.map +1 -1
  409. package/dist/generate/shared-writes.d.ts.map +1 -1
  410. package/dist/generate/shared-writes.js +6 -0
  411. package/dist/generate/shared-writes.js.map +1 -1
  412. package/dist/generate/spec-vars.js +4 -4
  413. package/dist/generate/spec-vars.js.map +1 -1
  414. package/dist/generate/stop-ignoring-validation.d.ts +9 -0
  415. package/dist/generate/stop-ignoring-validation.d.ts.map +1 -0
  416. package/dist/generate/stop-ignoring-validation.js +36 -0
  417. package/dist/generate/stop-ignoring-validation.js.map +1 -0
  418. package/dist/generate/storage-vars.d.ts +2 -2
  419. package/dist/generate/storage-vars.d.ts.map +1 -1
  420. package/dist/generate/storage-vars.js +6 -10
  421. package/dist/generate/storage-vars.js.map +1 -1
  422. package/dist/generate/workspace-sources.d.ts +6 -0
  423. package/dist/generate/workspace-sources.d.ts.map +1 -0
  424. package/dist/generate/workspace-sources.js +13 -0
  425. package/dist/generate/workspace-sources.js.map +1 -0
  426. package/dist/init/files/architecture-files.d.ts +9 -0
  427. package/dist/init/files/architecture-files.d.ts.map +1 -0
  428. package/dist/init/files/architecture-files.js +10 -0
  429. package/dist/init/files/architecture-files.js.map +1 -0
  430. package/dist/init/files/init-files.d.ts.map +1 -1
  431. package/dist/init/files/init-files.js +2 -0
  432. package/dist/init/files/init-files.js.map +1 -1
  433. package/dist/init/files/persistence-files.d.ts.map +1 -1
  434. package/dist/init/files/persistence-files.js +5 -1
  435. package/dist/init/files/persistence-files.js.map +1 -1
  436. package/dist/init/files/pipeline-files.d.ts.map +1 -1
  437. package/dist/init/files/pipeline-files.js +5 -1
  438. package/dist/init/files/pipeline-files.js.map +1 -1
  439. package/dist/init/files/platform-files.d.ts.map +1 -1
  440. package/dist/init/files/platform-files.js +3 -1
  441. package/dist/init/files/platform-files.js.map +1 -1
  442. package/dist/init/files/project-files.d.ts.map +1 -1
  443. package/dist/init/files/project-files.js +3 -1
  444. package/dist/init/files/project-files.js.map +1 -1
  445. package/dist/init/knip-vars.d.ts +3 -3
  446. package/dist/init/knip-vars.d.ts.map +1 -1
  447. package/dist/init/knip-vars.js +27 -5
  448. package/dist/init/knip-vars.js.map +1 -1
  449. package/dist/init/manifest/documentation-scripts.d.ts.map +1 -1
  450. package/dist/init/manifest/documentation-scripts.js +2 -0
  451. package/dist/init/manifest/documentation-scripts.js.map +1 -1
  452. package/dist/init/manifest/scripts-for.d.ts +5 -1
  453. package/dist/init/manifest/scripts-for.d.ts.map +1 -1
  454. package/dist/init/manifest/scripts-for.js +16 -2
  455. package/dist/init/manifest/scripts-for.js.map +1 -1
  456. package/dist/init/manifest/versions.js +23 -23
  457. package/dist/init/manifest/write-manifest.d.ts.map +1 -1
  458. package/dist/init/manifest/write-manifest.js +18 -1
  459. package/dist/init/manifest/write-manifest.js.map +1 -1
  460. package/dist/init/run-init.d.ts.map +1 -1
  461. package/dist/init/run-init.js +56 -7
  462. package/dist/init/run-init.js.map +1 -1
  463. package/dist/init/stack/recorded-options.d.ts +11 -0
  464. package/dist/init/stack/recorded-options.d.ts.map +1 -0
  465. package/dist/init/stack/recorded-options.js +19 -0
  466. package/dist/init/stack/recorded-options.js.map +1 -0
  467. package/dist/init/stack/resolve-stack.d.ts +6 -1
  468. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  469. package/dist/init/stack/resolve-stack.js +48 -9
  470. package/dist/init/stack/resolve-stack.js.map +1 -1
  471. package/dist/init/stack/resolve-style.d.ts +3 -5
  472. package/dist/init/stack/resolve-style.d.ts.map +1 -1
  473. package/dist/init/stack/resolve-style.js +11 -3
  474. package/dist/init/stack/resolve-style.js.map +1 -1
  475. package/dist/init/stack/stack-options.d.ts +4 -0
  476. package/dist/init/stack/stack-options.d.ts.map +1 -1
  477. package/dist/init/template-vars.d.ts.map +1 -1
  478. package/dist/init/template-vars.js +2 -0
  479. package/dist/init/template-vars.js.map +1 -1
  480. package/dist/init/validation-dependencies.d.ts +10 -0
  481. package/dist/init/validation-dependencies.d.ts.map +1 -0
  482. package/dist/init/validation-dependencies.js +23 -0
  483. package/dist/init/validation-dependencies.js.map +1 -0
  484. package/dist/init/write-agent-settings.js +4 -3
  485. package/dist/init/write-agent-settings.js.map +1 -1
  486. package/dist/init/write-contracts.d.ts +10 -0
  487. package/dist/init/write-contracts.d.ts.map +1 -0
  488. package/dist/init/write-contracts.js +33 -0
  489. package/dist/init/write-contracts.js.map +1 -0
  490. package/dist/init/write-type-script-configs.d.ts +2 -1
  491. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  492. package/dist/init/write-type-script-configs.js +4 -4
  493. package/dist/init/write-type-script-configs.js.map +1 -1
  494. package/dist/package-manager/default-package-manager.d.ts +8 -0
  495. package/dist/package-manager/default-package-manager.d.ts.map +1 -0
  496. package/dist/package-manager/default-package-manager.js +7 -0
  497. package/dist/package-manager/default-package-manager.js.map +1 -0
  498. package/dist/package-manager/dialect.d.ts +3 -0
  499. package/dist/package-manager/dialect.d.ts.map +1 -0
  500. package/dist/package-manager/dialect.js +2 -0
  501. package/dist/package-manager/dialect.js.map +1 -0
  502. package/dist/package-manager/dialects.d.ts +5 -0
  503. package/dist/package-manager/dialects.d.ts.map +1 -0
  504. package/dist/package-manager/dialects.js +21 -0
  505. package/dist/package-manager/dialects.js.map +1 -0
  506. package/dist/package-manager/in-dialect.d.ts +8 -0
  507. package/dist/package-manager/in-dialect.d.ts.map +1 -0
  508. package/dist/package-manager/in-dialect.js +10 -0
  509. package/dist/package-manager/in-dialect.js.map +1 -0
  510. package/dist/package-manager/lockfiles.d.ts +4 -0
  511. package/dist/package-manager/lockfiles.d.ts.map +1 -0
  512. package/dist/package-manager/lockfiles.js +6 -0
  513. package/dist/package-manager/lockfiles.js.map +1 -0
  514. package/dist/package-manager/package-manager-of.d.ts +4 -0
  515. package/dist/package-manager/package-manager-of.d.ts.map +1 -0
  516. package/dist/package-manager/package-manager-of.js +15 -0
  517. package/dist/package-manager/package-manager-of.js.map +1 -0
  518. package/dist/package-manager/package-manager-vars.d.ts +5 -0
  519. package/dist/package-manager/package-manager-vars.d.ts.map +1 -0
  520. package/dist/package-manager/package-manager-vars.js +13 -0
  521. package/dist/package-manager/package-manager-vars.js.map +1 -0
  522. package/dist/package-manager/pinned-package-managers.d.ts +7 -0
  523. package/dist/package-manager/pinned-package-managers.d.ts.map +1 -0
  524. package/dist/package-manager/pinned-package-managers.js +9 -0
  525. package/dist/package-manager/pinned-package-managers.js.map +1 -0
  526. package/dist/refresh-declarations.d.ts +3 -0
  527. package/dist/refresh-declarations.d.ts.map +1 -0
  528. package/dist/refresh-declarations.js +4 -0
  529. package/dist/refresh-declarations.js.map +1 -0
  530. package/dist/run.d.ts.map +1 -1
  531. package/dist/run.js +10 -2
  532. package/dist/run.js.map +1 -1
  533. package/dist/stack/alias-vars.d.ts +2 -1
  534. package/dist/stack/alias-vars.d.ts.map +1 -1
  535. package/dist/stack/alias-vars.js +6 -3
  536. package/dist/stack/alias-vars.js.map +1 -1
  537. package/dist/templating/render.d.ts.map +1 -1
  538. package/dist/templating/render.js +2 -1
  539. package/dist/templating/render.js.map +1 -1
  540. package/dist/templating/rendering.js +1 -1
  541. package/dist/templating/rendering.js.map +1 -1
  542. package/dist/version.d.ts +1 -1
  543. package/dist/version.js +1 -1
  544. package/dist/workspace/workspace.d.ts +5 -1
  545. package/dist/workspace/workspace.d.ts.map +1 -1
  546. package/dist/workspace/workspace.js +13 -3
  547. package/dist/workspace/workspace.js.map +1 -1
  548. package/package.json +4 -3
  549. package/templates/acl/translator.spec.ts.tpl +1 -1
  550. package/templates/adapter/adapter.declared.ts.tpl +3 -3
  551. package/templates/adapter/adapter.spec.ts.tpl +1 -1
  552. package/templates/adapter/adapter.ts.tpl +1 -1
  553. package/templates/adapter/wiring.tsyringe.tpl +3 -3
  554. package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
  555. package/templates/architecture/extractable.declared.spec.ts.tpl +7 -7
  556. package/templates/architecture/extractable.manual.spec.ts.tpl +8 -4
  557. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +7 -1
  558. package/templates/architecture/wiring.declared.tpl +1 -1
  559. package/templates/architecture/wiring.manual.tpl +1 -1
  560. package/templates/architecture/wiring.tsyringe.tpl +1 -1
  561. package/templates/builder/builder.ts.tpl +1 -1
  562. package/templates/command/handler.declared.ts.tpl +7 -7
  563. package/templates/command/handler.spec.buses.ts.tpl +4 -4
  564. package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
  565. package/templates/command/handler.ts.tpl +4 -4
  566. package/templates/command/wiring.manual.tpl +2 -2
  567. package/templates/command/wiring.tsyringe.tpl +3 -3
  568. package/templates/context/module.manual.ts.tpl +1 -1
  569. package/templates/context/permission-set.tpl +1 -1
  570. package/templates/context/permissions.spec.ts.tpl +1 -1
  571. package/templates/context/routes.spec.ts.tpl +1 -1
  572. package/templates/context/wiring.declared.tpl +2 -2
  573. package/templates/context/wiring.manual.tpl +1 -1
  574. package/templates/context/wiring.tsyringe.tpl +2 -2
  575. package/templates/docs/asyncapi.json.tpl +12 -0
  576. package/templates/docs/event-catalog.md +3 -0
  577. package/templates/docs/openapi.json.tpl +354 -0
  578. package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
  579. package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
  580. package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
  581. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  582. package/templates/entity/entity.spec.ts.tpl +1 -1
  583. package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
  584. package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
  585. package/templates/event-handler/event-handler.ts.tpl +1 -1
  586. package/templates/event-handler/wiring.manual.tpl +2 -2
  587. package/templates/event-handler/wiring.tsyringe.tpl +2 -2
  588. package/templates/gateway/adapter.declared.ts.tpl +3 -3
  589. package/templates/gateway/adapter.ts.tpl +2 -2
  590. package/templates/gateway/contract.spec.ts.tpl +3 -3
  591. package/templates/gateway/fake.ts.tpl +1 -1
  592. package/templates/gateway/platform-test.declared.tpl +1 -1
  593. package/templates/gateway/platform.declared.tpl +1 -1
  594. package/templates/gateway/wiring.tsyringe.tpl +3 -3
  595. package/templates/init/CLAUDE.md.tpl +5 -2
  596. package/templates/init/README.md.tpl +16 -10
  597. package/templates/init/docker/Dockerfile.tpl +9 -2
  598. package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
  599. package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
  600. package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
  601. package/templates/init/e2e/start-application.database.ts.tpl +16 -16
  602. package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
  603. package/templates/init/e2e/test-environment.ts.tpl +1 -1
  604. package/templates/init/jest.config.js.tpl +3 -1
  605. package/templates/init/main.ts.tpl +11 -11
  606. package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
  607. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
  608. package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
  609. package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
  610. package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
  611. package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
  612. package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
  613. package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
  614. package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
  615. package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
  616. package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
  617. package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
  618. package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
  619. package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
  620. package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
  621. package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
  622. package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
  623. package/templates/init/platform/auth/permissions.ts.tpl +1 -1
  624. package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
  625. package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
  626. package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
  627. package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
  628. package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
  629. package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
  630. package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
  631. package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -16
  632. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  633. package/templates/init/platform/config/load-config.ts.tpl +3 -3
  634. package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
  635. package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
  636. package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
  637. package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
  638. package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
  639. package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
  640. package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
  641. package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
  642. package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
  643. package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
  644. package/templates/init/platform/database/journal.drizzle.json +5 -0
  645. package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
  646. package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
  647. package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
  648. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
  649. package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
  650. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
  651. package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
  652. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
  653. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
  654. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
  655. package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
  656. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
  657. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
  658. package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
  659. package/templates/init/platform/errors.ts.tpl +1 -1
  660. package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
  661. package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
  662. package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
  663. package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
  664. package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
  665. package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
  666. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  667. package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
  668. package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
  669. package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
  670. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
  671. package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
  672. package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
  673. package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
  674. package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
  675. package/templates/init/platform/platform.manual.ts.tpl +3 -3
  676. package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
  677. package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
  678. package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
  679. package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
  680. package/templates/init/platform/tracing.ts.tpl +2 -2
  681. package/templates/init/pnpm-workspace.yaml +8 -0
  682. package/templates/init/rules/application.md.tpl +8 -2
  683. package/templates/init/rules/infrastructure.md.tpl +3 -3
  684. package/templates/init/scripts/events.ts.tpl +1 -1
  685. package/templates/init/scripts/openapi.ts.tpl +6 -6
  686. package/templates/integration-event/audited.tpl +1 -1
  687. package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
  688. package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
  689. package/templates/integration-event/publisher.declared.ts.tpl +4 -4
  690. package/templates/integration-event/publisher.spec.ts.tpl +2 -2
  691. package/templates/integration-event/publisher.ts.tpl +2 -2
  692. package/templates/integration-event/wiring.manual.tpl +2 -2
  693. package/templates/integration-event/wiring.tsyringe.tpl +2 -2
  694. package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
  695. package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
  696. package/templates/integration-handler/integration-handler.ts.tpl +1 -1
  697. package/templates/integration-handler/wiring.manual.tpl +3 -3
  698. package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
  699. package/templates/job/job.declared.ts.tpl +3 -3
  700. package/templates/job/job.spec.buses.ts.tpl +2 -2
  701. package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
  702. package/templates/job/job.ts.tpl +1 -1
  703. package/templates/job/wiring.manual.tpl +1 -1
  704. package/templates/job/wiring.tsyringe.tpl +1 -1
  705. package/templates/pipeline/biome.json.tpl +2 -1
  706. package/templates/pipeline/github/actions/setup/action.yml.tpl +37 -0
  707. package/templates/pipeline/github/scripts/start-postgres.sh +47 -0
  708. package/templates/pipeline/github/workflows/ci.yml +68 -110
  709. package/templates/pipeline/github/workflows/pr-title.yml +1 -5
  710. package/templates/pipeline/gitlab/{gitlab-ci.yml → gitlab-ci.yml.tpl} +59 -31
  711. package/templates/pipeline/knip.json.tpl +9 -10
  712. package/templates/pipeline/package-scripts.json +1 -1
  713. package/templates/pipeline/vitest.config.ts.tpl +7 -3
  714. package/templates/policy/policy.declared.ts.tpl +1 -1
  715. package/templates/policy/policy.spec.declared.ts.tpl +1 -1
  716. package/templates/policy/policy.spec.ts.tpl +1 -1
  717. package/templates/policy/policy.ts.tpl +1 -1
  718. package/templates/policy/registration.tpl +1 -1
  719. package/templates/port/fake.ts.tpl +1 -1
  720. package/templates/projection/projection.spec.ts.tpl +17 -0
  721. package/templates/projection/projection.ts.tpl +11 -0
  722. package/templates/query/handler.declared.ts.tpl +4 -4
  723. package/templates/query/handler.spec.buses.ts.tpl +5 -5
  724. package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
  725. package/templates/query/handler.ts.tpl +3 -3
  726. package/templates/query/query.ts.tpl +1 -1
  727. package/templates/query/reader.fake.ts.tpl +2 -2
  728. package/templates/query/reader.in-memory.ts.tpl +4 -4
  729. package/templates/query/reader.port.ts.tpl +2 -2
  730. package/templates/query/search.handler.declared.ts.tpl +6 -6
  731. package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
  732. package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
  733. package/templates/query/search.handler.ts.tpl +4 -4
  734. package/templates/query/search.query.ts.tpl +1 -1
  735. package/templates/query/search.reader.fake.ts.tpl +2 -2
  736. package/templates/query/search.reader.in-memory.ts.tpl +3 -3
  737. package/templates/query/search.reader.port.ts.tpl +1 -1
  738. package/templates/query/search.reader.spec.ts.tpl +2 -2
  739. package/templates/query/search.wiring.manual.tpl +3 -3
  740. package/templates/query/search.wiring.tsyringe.tpl +4 -4
  741. package/templates/query/wiring.manual.tpl +3 -3
  742. package/templates/query/wiring.tsyringe.tpl +4 -4
  743. package/templates/repository/contract.spec.ts.tpl +5 -5
  744. package/templates/repository/drizzle/mapper.ts.tpl +2 -2
  745. package/templates/repository/drizzle/repository.ts.tpl +9 -17
  746. package/templates/repository/drizzle/schema-export.tpl +1 -1
  747. package/templates/repository/fake.ts.tpl +2 -2
  748. package/templates/repository/knex/mapper.ts.tpl +2 -2
  749. package/templates/repository/knex/repository.ts.tpl +10 -30
  750. package/templates/repository/knex/schema-export.tpl +1 -1
  751. package/templates/repository/knex/tables.ts.tpl +1 -1
  752. package/templates/repository/none/repository.ts.tpl +3 -3
  753. package/templates/repository/prisma/mapper.ts.tpl +2 -2
  754. package/templates/repository/prisma/repository.ts.tpl +6 -9
  755. package/templates/repository/repository.ts.tpl +1 -1
  756. package/templates/repository/typeorm/mapper.ts.tpl +2 -2
  757. package/templates/repository/typeorm/repository.ts.tpl +9 -12
  758. package/templates/repository/typeorm/schema-export.tpl +1 -1
  759. package/templates/repository/typeorm/table.tpl +1 -1
  760. package/templates/repository/wiring.manual.tpl +1 -1
  761. package/templates/repository/wiring.tsyringe.tpl +2 -2
  762. package/templates/route/route.search.ts.tpl +1 -1
  763. package/templates/route/route.spec.ts.tpl +1 -1
  764. package/templates/route/routes.on-tsyringe.tpl +1 -1
  765. package/templates/route/wiring.manual.tpl +1 -1
  766. package/templates/service/main.ts.tpl +11 -11
  767. package/templates/value-object/value-object.spec.ts.tpl +1 -1
  768. package/templates/worker/main.ts.tpl +9 -9
  769. package/dist/alias/platform-alias.d.ts +0 -4
  770. package/dist/alias/platform-alias.d.ts.map +0 -1
  771. package/dist/alias/platform-alias.js +0 -7
  772. package/dist/alias/platform-alias.js.map +0 -1
@@ -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,MAA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,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC;IAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;AACxF,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACpC,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElD,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACtF,CAAC"}
@@ -1 +1 @@
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,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,2B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E,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,CACrE,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAC1C;YACD,GAAG,UAAU,CAAC,qBAAqB,EAAE;YACrC,GAAG,UAAU,CAAC,YAAY,CAAC,cAAc,CAAC;YAC1C,GAAG,UAAU,CAAC,SAAS,EAAE;YACzB,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
+ {"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,6SAA6S;IAC/S,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,CACrE,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAC1C;YACD,GAAG,UAAU,CAAC,qBAAqB,EAAE;YACrC,GAAG,UAAU,CAAC,YAAY,CAAC,cAAc,CAAC;YAC1C,GAAG,UAAU,CAAC,SAAS,EAAE;YACzB,GAAG,UAAU,CAAC,eAAe,EAAE;YAC/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
- {"version":3,"file":"declarations-barrel-current.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-barrel-current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAInE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,UAAU,GACd,6JAA6J,CAAC;AAEhK,MAAM,MAAM,GAAG,0BAA0B,CAAC;AAE1C,MAAM,CAAC,MAAM,yBAAyB,GAAS;IAC7C,EAAE,EAAE,6BAA6B;IACjC,WAAW,EACT,8HAA8H;IAChI,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,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AC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnH,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjG,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,sBAAsB,OAAO,qDAAqD,CAAC;IAC5F,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAE/F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,cAAc,KAAK,2CAA2C,CAAC;IACxE,CAAC;IAED,OAAO,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,C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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,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E,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),
@@ -1 +1 @@
1
- {"version":3,"file":"imports-alias-declared.js","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-declared.ts"],"names":[],"mapp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],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAc7C,eAAO,MAAM,gBAAgB,EAAE,IAgB9B,CAAC"}
1
+ {"version":3,"file":"imports-alias-only.d.ts","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-only.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAU7C,eAAO,MAAM,gBAAgB,EAAE,IAgB9B,CAAC"}
@@ -1,39 +1,38 @@
1
- import fs from 'node:fs';
2
1
  import path from 'node:path';
3
- import { aliasRoots, FIXED_ALIAS_ROOTS, toAlias } from '../../alias/index.js';
4
- import { isSource } from '../project/is-source.js';
5
- import { loadSourceFile } from '../project/load-source-file.js';
6
- import { walkDirectory } from '../project/walk-directory.js';
2
+ import { aliasRoots, specifierSuffix, toAlias } from '../../alias/index.js';
3
+ import { besideTheSources } from '../project/beside-the-sources.js';
7
4
  import { perFile } from '../support/per-file.js';
8
5
  import { reporter } from '../support/reporter.js';
9
6
  import { toViolations } from '../support/to-violations.js';
10
7
  const RELATIVE = /^\.{1,2}(?:\/|$)/;
11
8
  const DOT_SEGMENT = /\/\.{1,2}(?:\/|$)/;
12
- /** The trees `check` does not walk for the other rules: their files are read for their imports only. */
13
- const BESIDE_THE_SOURCES = [FIXED_ALIAS_ROOTS.test.directory, FIXED_ALIAS_ROOTS.scripts.directory];
14
9
  export const importsAliasOnly = {
15
10
  id: 'imports/alias-only',
16
11
  description: 'A file of the project is imported by its alias (`@/...`), never by a relative path, the same directory included; an alias path holds no `.` or `..` segment. Holds under the source root, `test/` and `scripts/`.',
17
12
  scope: 'file',
18
13
  run(project) {
19
- const roots = aliasRoots(project.config);
20
- return perFile(project, this.id, (file) => findingsIn(roots, file));
14
+ const written = writtenBy(project);
15
+ return perFile(project, this.id, (file) => findingsIn(written, file));
21
16
  },
22
17
  acrossProject(project) {
23
- const roots = aliasRoots(project.config);
18
+ const written = writtenBy(project);
24
19
  const report = reporter(project, this.id);
25
- return besideTheSources(project).flatMap((file) => toViolations(report, file.path, findingsIn(roots, file)));
20
+ return besideTheSources(project).flatMap((file) => toViolations(report, file.path, findingsIn(written, file)));
26
21
  },
27
22
  };
28
- function findingsIn(roots, file) {
23
+ function writtenBy({ config }) {
24
+ return { roots: aliasRoots(config), suffix: specifierSuffix(config.importExtension) };
25
+ }
26
+ function findingsIn(written, file) {
29
27
  return file.imports.flatMap(({ specifier, line }) => {
30
- const flaw = flawOf(roots, file.path, specifier);
28
+ const flaw = flawOf(written, file.path, specifier);
31
29
  return flaw === undefined ? [] : [{ line, ...flaw }];
32
30
  });
33
31
  }
34
- function flawOf(roots, file, specifier) {
32
+ function flawOf(written, file, specifier) {
33
+ const { roots } = written;
35
34
  if (RELATIVE.test(specifier)) {
36
- return relativeFlaw(roots, file, specifier);
35
+ return relativeFlaw(written, file, specifier);
37
36
  }
38
37
  const named = roots.find(({ prefix }) => specifier.startsWith(prefix));
39
38
  if (named === undefined || !DOT_SEGMENT.test(`/${specifier.slice(named.prefix.length)}`)) {
@@ -44,8 +43,8 @@ function flawOf(roots, file, specifier) {
44
43
  fix: `Write the path of the file from ${named.directory}/ after "${named.prefix}", with no "." or ".." segment: an alias names one file of its directory, and the build rewrites it as such.`,
45
44
  };
46
45
  }
47
- function relativeFlaw(roots, file, specifier) {
48
- const alias = toAlias(roots, path.posix.join(path.posix.dirname(file), specifier));
46
+ function relativeFlaw({ roots, suffix }, file, specifier) {
47
+ const alias = toAlias(roots, path.posix.join(path.posix.dirname(file), specifier), suffix);
49
48
  if (alias !== undefined) {
50
49
  return {
51
50
  message: `"${specifier}" is a relative import.`,
@@ -58,16 +57,4 @@ function relativeFlaw(roots, file, specifier) {
58
57
  fix: `Keep what the code imports under ${directories}; a file elsewhere (a manifest, a build product) is read at run time, not imported.`,
59
58
  };
60
59
  }
61
- /** The TypeScript sources of the tests and of the scripts, which live next to the source root. */
62
- function besideTheSources(project) {
63
- const files = [];
64
- for (const directory of BESIDE_THE_SOURCES) {
65
- walkDirectory(project.root, directory, (file, isDirectory) => {
66
- if (!isDirectory && isSource(file)) {
67
- files.push(loadSourceFile(project.config, file, fs.readFileSync(path.join(project.root, file), 'utf8')));
68
- }
69
- });
70
- }
71
- return files;
72
- }
73
60
  //# sourceMappingURL=imports-alias-only.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"imports-alias-only.js","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAkB,MAAM,sBAAsB,CAAC;AAM9F,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AACpC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AACxC,wGAAwG;AACxG,MAAM,kBAAkB,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,EAAE,EAAE,oBAAoB;IACxB,WAAW,EACT,mNAAmN;IACrN,KAAK,EAAE,MAAM;IACb,GAAG,CAAC,OAAO;QACT,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEzC,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CA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AC,MAAM,CAAC,CAAC,CAAC;IAEvE,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;QACzF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,OAAO,EAAE,qBAAqB,SAAS,+CAA+C,KAAK,CAAC,SAAS,IAAI;QACzG,GAAG,EAAE,mCAAmC,KAAK,CAAC,SAAS,YAAY,KAAK,CAAC,MAAM,8GAA8G;KAC9L,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAW,EAAE,IAAY,EAAE,SAAiB;IAC/E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAE3F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,IAAI,SAAS,yBAAyB;YAC/C,GAAG,EAAE,kCAAkC,KAAK,uKAAuK;SACpN,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7E,OAAO;QACL,OAAO,EAAE,IAAI,SAAS,kDAAkD;QACxE,GAAG,EAAE,oCAAoC,WAAW,qFAAqF;KAC1I,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from '../model/rule.js';
2
+ export declare const importsExtension: Rule;
3
+ //# sourceMappingURL=imports-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports-extension.d.ts","sourceRoot":"","sources":["../../../src/check/rules/imports-extension.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW7C,eAAO,MAAM,gBAAgB,EAAE,IAa9B,CAAC"}
@@ -0,0 +1,65 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { aliasRoots, specifierSuffix } from '../../alias/index.js';
4
+ import { CONFIG_FILE } from '../../config/index.js';
5
+ import { besideTheSources } from '../project/beside-the-sources.js';
6
+ import { perFile } from '../support/per-file.js';
7
+ import { reporter } from '../support/reporter.js';
8
+ import { toViolations } from '../support/to-violations.js';
9
+ /** The extensions a module of the project or the file emitted for it can bear. */
10
+ const EXTENSION = /\.(?:[cm]?js|[cm]?ts)$/;
11
+ const EMITTED = /\.[cm]?js$/;
12
+ export const importsExtension = {
13
+ id: 'imports/extension',
14
+ description: 'An import of a file of the project ends as "importExtension" says: with no extension under `none`, where it names a file and never a directory, with `.js` under `js`. Holds under the source root, `test/` and `scripts/`.',
15
+ scope: 'file',
16
+ run(project) {
17
+ return perFile(project, this.id, (file) => findingsIn(project, file));
18
+ },
19
+ acrossProject(project) {
20
+ const report = reporter(project, this.id);
21
+ return besideTheSources(project).flatMap((file) => toViolations(report, file.path, findingsIn(project, file)));
22
+ },
23
+ };
24
+ function findingsIn(project, file) {
25
+ const roots = aliasRoots(project.config);
26
+ const judge = specifierSuffix(project.config.importExtension) === '' ? withoutExtension : withExtension;
27
+ return file.imports.flatMap(({ specifier, line }) => {
28
+ const root = roots.find(({ prefix }) => specifier.startsWith(prefix));
29
+ const flaw = root === undefined ? undefined : judge(specifier, { project, root });
30
+ return flaw === undefined ? [] : [{ line, ...flaw }];
31
+ });
32
+ }
33
+ function withoutExtension(specifier, named) {
34
+ const extension = EXTENSION.exec(specifier)?.[0];
35
+ if (extension !== undefined) {
36
+ return {
37
+ message: `"${specifier}" ends with "${extension}" although "importExtension" is "none" in ${CONFIG_FILE}.`,
38
+ fix: `Write '${specifier.slice(0, -extension.length)}' (\`eslint --fix\` rewrites it): the compiler and every tool that reads the sources resolve the file without its extension, and the build writes the ".js" Node needs into the compiled output.`,
39
+ };
40
+ }
41
+ if (!namesDirectory(specifier, named)) {
42
+ return undefined;
43
+ }
44
+ return {
45
+ message: `"${specifier}" names a directory, not a file.`,
46
+ fix: `Write '${specifier.replace(/\/$/, '')}/index': an alias names one file, so that an import has one spelling and the build never has to choose between a file and a directory of the same name.`,
47
+ };
48
+ }
49
+ /** A directory that holds an `index.ts`, next to no file of the same name: the only case the compiler would resolve to it. */
50
+ function namesDirectory(specifier, { project, root }) {
51
+ const named = path.join(project.root, root.directory, specifier.slice(root.prefix.length));
52
+ const isFile = (file) => fs.statSync(file, { throwIfNoEntry: false })?.isFile() === true;
53
+ return !isFile(`${named}.ts`) && isFile(path.join(named, 'index.ts'));
54
+ }
55
+ function withExtension(specifier) {
56
+ if (EMITTED.test(specifier)) {
57
+ return undefined;
58
+ }
59
+ const bare = specifier.replace(EXTENSION, '');
60
+ return {
61
+ message: `"${specifier}" does not end with ".js" although "importExtension" is "js" in ${CONFIG_FILE}.`,
62
+ fix: `Write '${bare}.js' (\`eslint --fix\` rewrites it), the name of the file the compiler emits: the compiler resolves as Node does and refuses any other spelling. To drop the extension everywhere instead, set "importExtension" to "none", regenerate tsconfig.json as \`imports/alias-declared\` says and run \`eslint --fix\`.`,
63
+ };
64
+ }
65
+ //# sourceMappingURL=imports-extension.js.map