ddd-ts-kit 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) hide show
  1. package/README.md +81 -21
  2. package/dist/alias/compiler-resolution-of.d.ts +10 -0
  3. package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
  4. package/dist/alias/compiler-resolution-of.js +13 -0
  5. package/dist/alias/compiler-resolution-of.js.map +1 -0
  6. package/dist/alias/compiler-resolution.d.ts +8 -0
  7. package/dist/alias/compiler-resolution.d.ts.map +1 -0
  8. package/dist/alias/compiler-resolution.js +2 -0
  9. package/dist/alias/compiler-resolution.js.map +1 -0
  10. package/dist/alias/index.d.ts +3 -1
  11. package/dist/alias/index.d.ts.map +1 -1
  12. package/dist/alias/index.js +3 -1
  13. package/dist/alias/index.js.map +1 -1
  14. package/dist/alias/module-name-mapper.d.ts +4 -3
  15. package/dist/alias/module-name-mapper.d.ts.map +1 -1
  16. package/dist/alias/module-name-mapper.js +6 -4
  17. package/dist/alias/module-name-mapper.js.map +1 -1
  18. package/dist/alias/specifier-of.d.ts +7 -0
  19. package/dist/alias/specifier-of.d.ts.map +1 -0
  20. package/dist/alias/specifier-of.js +17 -0
  21. package/dist/alias/specifier-of.js.map +1 -0
  22. package/dist/alias/specifier-suffix.d.ts +6 -0
  23. package/dist/alias/specifier-suffix.d.ts.map +1 -0
  24. package/dist/alias/specifier-suffix.js +8 -0
  25. package/dist/alias/specifier-suffix.js.map +1 -0
  26. package/dist/alias/to-alias.d.ts +3 -2
  27. package/dist/alias/to-alias.d.ts.map +1 -1
  28. package/dist/alias/to-alias.js +4 -3
  29. package/dist/alias/to-alias.js.map +1 -1
  30. package/dist/build/emitted-place.d.ts +2 -0
  31. package/dist/build/emitted-place.d.ts.map +1 -1
  32. package/dist/build/emitted-specifier.d.ts +3 -2
  33. package/dist/build/emitted-specifier.d.ts.map +1 -1
  34. package/dist/build/emitted-specifier.js +6 -12
  35. package/dist/build/emitted-specifier.js.map +1 -1
  36. package/dist/build/emitted-target.d.ts +9 -0
  37. package/dist/build/emitted-target.d.ts.map +1 -0
  38. package/dist/build/emitted-target.js +18 -0
  39. package/dist/build/emitted-target.js.map +1 -0
  40. package/dist/build/rewrite-aliases.d.ts +5 -3
  41. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  42. package/dist/build/rewrite-aliases.js +12 -7
  43. package/dist/build/rewrite-aliases.js.map +1 -1
  44. package/dist/build/rewrite-specifiers.d.ts +3 -1
  45. package/dist/build/rewrite-specifiers.d.ts.map +1 -1
  46. package/dist/build/rewrite-specifiers.js +2 -2
  47. package/dist/build/rewrite-specifiers.js.map +1 -1
  48. package/dist/build/unresolved-problem.d.ts +4 -0
  49. package/dist/build/unresolved-problem.d.ts.map +1 -0
  50. package/dist/build/unresolved-problem.js +16 -0
  51. package/dist/build/unresolved-problem.js.map +1 -0
  52. package/dist/check/alias/compiler-resolution.d.ts +10 -0
  53. package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
  54. package/dist/check/alias/compiler-resolution.js +47 -0
  55. package/dist/check/alias/compiler-resolution.js.map +1 -0
  56. package/dist/check/alias/test-runners.js +4 -4
  57. package/dist/check/alias/test-runners.js.map +1 -1
  58. package/dist/check/canonical/roles.d.ts.map +1 -1
  59. package/dist/check/canonical/roles.js +6 -0
  60. package/dist/check/canonical/roles.js.map +1 -1
  61. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  62. package/dist/check/catalogue/architecture-rules.js +4 -0
  63. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  64. package/dist/check/configuration/config-inspection.d.ts +2 -0
  65. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  66. package/dist/check/configuration/config-inspection.js +11 -1
  67. package/dist/check/configuration/config-inspection.js.map +1 -1
  68. package/dist/check/declarations/classes-of.js +1 -1
  69. package/dist/check/declarations/classes-of.js.map +1 -1
  70. package/dist/check/explain/context-docs.js +7 -7
  71. package/dist/check/explain/context-docs.js.map +1 -1
  72. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  73. package/dist/check/explain/imports-docs.js +24 -9
  74. package/dist/check/explain/imports-docs.js.map +1 -1
  75. package/dist/check/explain/layer-docs.js +7 -7
  76. package/dist/check/explain/layer-docs.js.map +1 -1
  77. package/dist/check/explain/ports-docs.d.ts.map +1 -1
  78. package/dist/check/explain/ports-docs.js +15 -7
  79. package/dist/check/explain/ports-docs.js.map +1 -1
  80. package/dist/check/explain/scheduling-docs.js +1 -1
  81. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  82. package/dist/check/explain/wiring-docs.js +35 -10
  83. package/dist/check/explain/wiring-docs.js.map +1 -1
  84. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  85. package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
  86. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  87. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  88. package/dist/check/fixtures/config-fixtures.js +6 -0
  89. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  90. package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
  91. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
  92. package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
  93. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
  94. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  95. package/dist/check/fixtures/declared-project.js +4 -1
  96. package/dist/check/fixtures/declared-project.js.map +1 -1
  97. package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
  98. package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
  99. package/dist/check/fixtures/extension-fixtures.js +77 -0
  100. package/dist/check/fixtures/extension-fixtures.js.map +1 -0
  101. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  102. package/dist/check/fixtures/fixtures.js +4 -0
  103. package/dist/check/fixtures/fixtures.js.map +1 -1
  104. package/dist/check/fixtures/signature-project.d.ts +11 -0
  105. package/dist/check/fixtures/signature-project.d.ts.map +1 -0
  106. package/dist/check/fixtures/signature-project.js +21 -0
  107. package/dist/check/fixtures/signature-project.js.map +1 -0
  108. package/dist/check/fixtures/signature.d.ts +13 -0
  109. package/dist/check/fixtures/signature.d.ts.map +1 -0
  110. package/dist/check/fixtures/signature.js +24 -0
  111. package/dist/check/fixtures/signature.js.map +1 -0
  112. package/dist/check/project/beside-the-sources.d.ts +5 -0
  113. package/dist/check/project/beside-the-sources.d.ts.map +1 -0
  114. package/dist/check/project/beside-the-sources.js +21 -0
  115. package/dist/check/project/beside-the-sources.js.map +1 -0
  116. package/dist/check/project/resolve-import.d.ts.map +1 -1
  117. package/dist/check/project/resolve-import.js +4 -1
  118. package/dist/check/project/resolve-import.js.map +1 -1
  119. package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
  120. package/dist/check/rules/clean-one-export-per-file.js +14 -8
  121. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  122. package/dist/check/rules/config-valid.d.ts.map +1 -1
  123. package/dist/check/rules/config-valid.js +2 -1
  124. package/dist/check/rules/config-valid.js.map +1 -1
  125. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  126. package/dist/check/rules/declarations-barrel-current.js +34 -32
  127. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  128. package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
  129. package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
  130. package/dist/check/rules/declarations-constructor-injection.js +58 -0
  131. package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
  132. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  133. package/dist/check/rules/imports-alias-declared.js +3 -1
  134. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  135. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  136. package/dist/check/rules/imports-alias-only.js +16 -29
  137. package/dist/check/rules/imports-alias-only.js.map +1 -1
  138. package/dist/check/rules/imports-extension.d.ts +3 -0
  139. package/dist/check/rules/imports-extension.d.ts.map +1 -0
  140. package/dist/check/rules/imports-extension.js +65 -0
  141. package/dist/check/rules/imports-extension.js.map +1 -0
  142. package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
  143. package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
  144. package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
  145. package/dist/check/rules/tree-closed.js +6 -4
  146. package/dist/check/rules/tree-closed.js.map +1 -1
  147. package/dist/commands/build-aliases.d.ts.map +1 -1
  148. package/dist/commands/build-aliases.js +5 -3
  149. package/dist/commands/build-aliases.js.map +1 -1
  150. package/dist/commands/docs.d.ts.map +1 -1
  151. package/dist/commands/docs.js +17 -2
  152. package/dist/commands/docs.js.map +1 -1
  153. package/dist/commands/init.d.ts.map +1 -1
  154. package/dist/commands/init.js +5 -4
  155. package/dist/commands/init.js.map +1 -1
  156. package/dist/commit/is-derived.d.ts.map +1 -1
  157. package/dist/commit/is-derived.js +5 -2
  158. package/dist/commit/is-derived.js.map +1 -1
  159. package/dist/config/config.d.ts +2 -0
  160. package/dist/config/config.d.ts.map +1 -1
  161. package/dist/config/default-import-extension.d.ts +3 -0
  162. package/dist/config/default-import-extension.d.ts.map +1 -0
  163. package/dist/config/default-import-extension.js +3 -0
  164. package/dist/config/default-import-extension.js.map +1 -0
  165. package/dist/config/import-extensions.d.ts +3 -0
  166. package/dist/config/import-extensions.d.ts.map +1 -0
  167. package/dist/config/import-extensions.js +3 -0
  168. package/dist/config/import-extensions.js.map +1 -0
  169. package/dist/config/index.d.ts +4 -1
  170. package/dist/config/index.d.ts.map +1 -1
  171. package/dist/config/index.js +4 -1
  172. package/dist/config/index.js.map +1 -1
  173. package/dist/config/parse-config.d.ts.map +1 -1
  174. package/dist/config/parse-config.js +2 -0
  175. package/dist/config/parse-config.js.map +1 -1
  176. package/dist/config/parse-stack.d.ts.map +1 -1
  177. package/dist/config/parse-stack.js +2 -1
  178. package/dist/config/parse-stack.js.map +1 -1
  179. package/dist/config/restack-config-text.d.ts +11 -0
  180. package/dist/config/restack-config-text.d.ts.map +1 -0
  181. package/dist/config/restack-config-text.js +31 -0
  182. package/dist/config/restack-config-text.js.map +1 -0
  183. package/dist/config/serialize-config.d.ts.map +1 -1
  184. package/dist/config/serialize-config.js +3 -6
  185. package/dist/config/serialize-config.js.map +1 -1
  186. package/dist/config/stack.d.ts +8 -0
  187. package/dist/config/stack.d.ts.map +1 -1
  188. package/dist/config/stack.js +1 -0
  189. package/dist/config/stack.js.map +1 -1
  190. package/dist/config/unwritten-import-extension.d.ts +3 -0
  191. package/dist/config/unwritten-import-extension.d.ts.map +1 -0
  192. package/dist/config/unwritten-import-extension.js +3 -0
  193. package/dist/config/unwritten-import-extension.js.map +1 -0
  194. package/dist/config/written-stack.d.ts +8 -0
  195. package/dist/config/written-stack.d.ts.map +1 -0
  196. package/dist/config/written-stack.js +10 -0
  197. package/dist/config/written-stack.js.map +1 -0
  198. package/dist/declared/declared-role.d.ts.map +1 -1
  199. package/dist/declared/declared-role.js +1 -0
  200. package/dist/declared/declared-role.js.map +1 -1
  201. package/dist/declared/dependencies-file.d.ts +7 -0
  202. package/dist/declared/dependencies-file.d.ts.map +1 -0
  203. package/dist/declared/dependencies-file.js +9 -0
  204. package/dist/declared/dependencies-file.js.map +1 -0
  205. package/dist/declared/generated-drift.d.ts +7 -0
  206. package/dist/declared/generated-drift.d.ts.map +1 -0
  207. package/dist/declared/generated-drift.js +47 -0
  208. package/dist/declared/generated-drift.js.map +1 -0
  209. package/dist/declared/index.d.ts +8 -1
  210. package/dist/declared/index.d.ts.map +1 -1
  211. package/dist/declared/index.js +6 -1
  212. package/dist/declared/index.js.map +1 -1
  213. package/dist/declared/injection/class-injection.d.ts +19 -0
  214. package/dist/declared/injection/class-injection.d.ts.map +1 -0
  215. package/dist/declared/injection/class-injection.js +2 -0
  216. package/dist/declared/injection/class-injection.js.map +1 -0
  217. package/dist/declared/injection/constructor-of.d.ts +16 -0
  218. package/dist/declared/injection/constructor-of.d.ts.map +1 -0
  219. package/dist/declared/injection/constructor-of.js +33 -0
  220. package/dist/declared/injection/constructor-of.js.map +1 -0
  221. package/dist/declared/injection/context-injections.d.ts +8 -0
  222. package/dist/declared/injection/context-injections.d.ts.map +1 -0
  223. package/dist/declared/injection/context-injections.js +14 -0
  224. package/dist/declared/injection/context-injections.js.map +1 -0
  225. package/dist/declared/injection/declared-kind-of.d.ts +8 -0
  226. package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
  227. package/dist/declared/injection/declared-kind-of.js +12 -0
  228. package/dist/declared/injection/declared-kind-of.js.map +1 -0
  229. package/dist/declared/injection/exported-name-of.d.ts +4 -0
  230. package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
  231. package/dist/declared/injection/exported-name-of.js +17 -0
  232. package/dist/declared/injection/exported-name-of.js.map +1 -0
  233. package/dist/declared/injection/language-types.d.ts +3 -0
  234. package/dist/declared/injection/language-types.d.ts.map +1 -0
  235. package/dist/declared/injection/language-types.js +32 -0
  236. package/dist/declared/injection/language-types.js.map +1 -0
  237. package/dist/declared/injection/local-names.d.ts +17 -0
  238. package/dist/declared/injection/local-names.d.ts.map +1 -0
  239. package/dist/declared/injection/local-names.js +41 -0
  240. package/dist/declared/injection/local-names.js.map +1 -0
  241. package/dist/declared/injection/parameter-shape.d.ts +11 -0
  242. package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
  243. package/dist/declared/injection/parameter-shape.js +58 -0
  244. package/dist/declared/injection/parameter-shape.js.map +1 -0
  245. package/dist/declared/injection/raw-class-name.d.ts +7 -0
  246. package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
  247. package/dist/declared/injection/raw-class-name.js +28 -0
  248. package/dist/declared/injection/raw-class-name.js.map +1 -0
  249. package/dist/declared/injection/read-constructor.d.ts +10 -0
  250. package/dist/declared/injection/read-constructor.d.ts.map +1 -0
  251. package/dist/declared/injection/read-constructor.js +2 -0
  252. package/dist/declared/injection/read-constructor.js.map +1 -0
  253. package/dist/declared/injection/read-injections.d.ts +6 -0
  254. package/dist/declared/injection/read-injections.d.ts.map +1 -0
  255. package/dist/declared/injection/read-injections.js +75 -0
  256. package/dist/declared/injection/read-injections.js.map +1 -0
  257. package/dist/declared/injection/render-injections.d.ts +11 -0
  258. package/dist/declared/injection/render-injections.d.ts.map +1 -0
  259. package/dist/declared/injection/render-injections.js +51 -0
  260. package/dist/declared/injection/render-injections.js.map +1 -0
  261. package/dist/declared/injection/rendered-injections.d.ts +8 -0
  262. package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
  263. package/dist/declared/injection/rendered-injections.js +2 -0
  264. package/dist/declared/injection/rendered-injections.js.map +1 -0
  265. package/dist/declared/injection/resolve-token.d.ts +18 -0
  266. package/dist/declared/injection/resolve-token.d.ts.map +1 -0
  267. package/dist/declared/injection/resolve-token.js +46 -0
  268. package/dist/declared/injection/resolve-token.js.map +1 -0
  269. package/dist/declared/injection/resolved-token.d.ts +10 -0
  270. package/dist/declared/injection/resolved-token.d.ts.map +1 -0
  271. package/dist/declared/injection/resolved-token.js +2 -0
  272. package/dist/declared/injection/resolved-token.js.map +1 -0
  273. package/dist/declared/injection/sources.d.ts +4 -0
  274. package/dist/declared/injection/sources.d.ts.map +1 -0
  275. package/dist/declared/injection/sources.js +2 -0
  276. package/dist/declared/injection/sources.js.map +1 -0
  277. package/dist/declared/injection/token-reference.d.ts +14 -0
  278. package/dist/declared/injection/token-reference.d.ts.map +1 -0
  279. package/dist/declared/injection/token-reference.js +2 -0
  280. package/dist/declared/injection/token-reference.js.map +1 -0
  281. package/dist/declared/render-barrel.d.ts +8 -5
  282. package/dist/declared/render-barrel.d.ts.map +1 -1
  283. package/dist/declared/render-barrel.js +13 -6
  284. package/dist/declared/render-barrel.js.map +1 -1
  285. package/dist/declared/render-dependencies-file.d.ts +8 -0
  286. package/dist/declared/render-dependencies-file.d.ts.map +1 -0
  287. package/dist/declared/render-dependencies-file.js +12 -0
  288. package/dist/declared/render-dependencies-file.js.map +1 -0
  289. package/dist/depcruise/hygiene-rules.js +2 -1
  290. package/dist/depcruise/hygiene-rules.js.map +1 -1
  291. package/dist/describe/context-description.d.ts +10 -0
  292. package/dist/describe/context-description.d.ts.map +1 -1
  293. package/dist/describe/describe-context.d.ts.map +1 -1
  294. package/dist/describe/describe-context.js +2 -0
  295. package/dist/describe/describe-context.js.map +1 -1
  296. package/dist/describe/format-description.d.ts.map +1 -1
  297. package/dist/describe/format-description.js +4 -0
  298. package/dist/describe/format-description.js.map +1 -1
  299. package/dist/describe/read-projections.d.ts +5 -0
  300. package/dist/describe/read-projections.d.ts.map +1 -0
  301. package/dist/describe/read-projections.js +19 -0
  302. package/dist/describe/read-projections.js.map +1 -0
  303. package/dist/describe/reference-lines.js +9 -0
  304. package/dist/describe/reference-lines.js.map +1 -1
  305. package/dist/dev/refresh-declarations.d.ts +9 -0
  306. package/dist/dev/refresh-declarations.d.ts.map +1 -0
  307. package/dist/dev/refresh-declarations.js +28 -0
  308. package/dist/dev/refresh-declarations.js.map +1 -0
  309. package/dist/generate/access-vars.js +3 -3
  310. package/dist/generate/access-vars.js.map +1 -1
  311. package/dist/generate/kinds/context-plan.d.ts +10 -0
  312. package/dist/generate/kinds/context-plan.d.ts.map +1 -0
  313. package/dist/generate/kinds/context-plan.js +2 -0
  314. package/dist/generate/kinds/context-plan.js.map +1 -0
  315. package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
  316. package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
  317. package/dist/generate/kinds/declare-context-entries.js +4 -2
  318. package/dist/generate/kinds/declare-context-entries.js.map +1 -1
  319. package/dist/generate/kinds/extraction/service-selection.js +8 -11
  320. package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
  321. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  322. package/dist/generate/kinds/job/job-vars.js +5 -3
  323. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  324. package/dist/generate/kinds/plan-vars.d.ts +5 -0
  325. package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
  326. package/dist/generate/kinds/plan-vars.js +24 -0
  327. package/dist/generate/kinds/plan-vars.js.map +1 -0
  328. package/dist/generate/kinds/projection-kind.d.ts +3 -0
  329. package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
  330. package/dist/generate/kinds/projection-kind.js +72 -0
  331. package/dist/generate/kinds/projection-kind.js.map +1 -0
  332. package/dist/generate/kinds/publish-in-index.js +2 -2
  333. package/dist/generate/kinds/publish-in-index.js.map +1 -1
  334. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  335. package/dist/generate/kinds/route/route-vars.js +7 -6
  336. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  337. package/dist/generate/kinds/wire-context.d.ts +10 -0
  338. package/dist/generate/kinds/wire-context.d.ts.map +1 -0
  339. package/dist/generate/kinds/wire-context.js +36 -0
  340. package/dist/generate/kinds/wire-context.js.map +1 -0
  341. package/dist/generate/kinds/write-context-files.d.ts +1 -8
  342. package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
  343. package/dist/generate/kinds/write-context-files.js +3 -40
  344. package/dist/generate/kinds/write-context-files.js.map +1 -1
  345. package/dist/generate/kinds.d.ts.map +1 -1
  346. package/dist/generate/kinds.js +2 -0
  347. package/dist/generate/kinds.js.map +1 -1
  348. package/dist/generate/refresh-barrels.d.ts +4 -3
  349. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  350. package/dist/generate/refresh-barrels.js +41 -16
  351. package/dist/generate/refresh-barrels.js.map +1 -1
  352. package/dist/generate/spec-vars.js +4 -4
  353. package/dist/generate/spec-vars.js.map +1 -1
  354. package/dist/generate/storage-vars.d.ts +2 -2
  355. package/dist/generate/storage-vars.d.ts.map +1 -1
  356. package/dist/generate/storage-vars.js +6 -10
  357. package/dist/generate/storage-vars.js.map +1 -1
  358. package/dist/generate/workspace-sources.d.ts +6 -0
  359. package/dist/generate/workspace-sources.d.ts.map +1 -0
  360. package/dist/generate/workspace-sources.js +13 -0
  361. package/dist/generate/workspace-sources.js.map +1 -0
  362. package/dist/init/manifest/scripts-for.js +6 -1
  363. package/dist/init/manifest/scripts-for.js.map +1 -1
  364. package/dist/init/manifest/versions.js +23 -23
  365. package/dist/init/run-init.d.ts.map +1 -1
  366. package/dist/init/run-init.js +32 -3
  367. package/dist/init/run-init.js.map +1 -1
  368. package/dist/init/stack/recorded-options.d.ts +11 -0
  369. package/dist/init/stack/recorded-options.d.ts.map +1 -0
  370. package/dist/init/stack/recorded-options.js +19 -0
  371. package/dist/init/stack/recorded-options.js.map +1 -0
  372. package/dist/init/stack/resolve-stack.d.ts +6 -1
  373. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  374. package/dist/init/stack/resolve-stack.js +46 -9
  375. package/dist/init/stack/resolve-stack.js.map +1 -1
  376. package/dist/init/stack/resolve-style.d.ts +3 -5
  377. package/dist/init/stack/resolve-style.d.ts.map +1 -1
  378. package/dist/init/stack/resolve-style.js +11 -3
  379. package/dist/init/stack/resolve-style.js.map +1 -1
  380. package/dist/init/stack/stack-options.d.ts +3 -0
  381. package/dist/init/stack/stack-options.d.ts.map +1 -1
  382. package/dist/init/write-agent-settings.js +4 -3
  383. package/dist/init/write-agent-settings.js.map +1 -1
  384. package/dist/init/write-type-script-configs.d.ts +2 -1
  385. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  386. package/dist/init/write-type-script-configs.js +4 -4
  387. package/dist/init/write-type-script-configs.js.map +1 -1
  388. package/dist/refresh-declarations.d.ts +3 -0
  389. package/dist/refresh-declarations.d.ts.map +1 -0
  390. package/dist/refresh-declarations.js +4 -0
  391. package/dist/refresh-declarations.js.map +1 -0
  392. package/dist/run.d.ts.map +1 -1
  393. package/dist/run.js +2 -0
  394. package/dist/run.js.map +1 -1
  395. package/dist/stack/alias-vars.d.ts +2 -1
  396. package/dist/stack/alias-vars.d.ts.map +1 -1
  397. package/dist/stack/alias-vars.js +6 -3
  398. package/dist/stack/alias-vars.js.map +1 -1
  399. package/dist/version.d.ts +1 -1
  400. package/dist/version.js +1 -1
  401. package/package.json +4 -3
  402. package/templates/acl/translator.spec.ts.tpl +1 -1
  403. package/templates/adapter/adapter.declared.ts.tpl +3 -3
  404. package/templates/adapter/adapter.spec.ts.tpl +1 -1
  405. package/templates/adapter/adapter.ts.tpl +1 -1
  406. package/templates/adapter/wiring.tsyringe.tpl +3 -3
  407. package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
  408. package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
  409. package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
  410. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
  411. package/templates/architecture/wiring.declared.tpl +1 -1
  412. package/templates/architecture/wiring.manual.tpl +1 -1
  413. package/templates/architecture/wiring.tsyringe.tpl +1 -1
  414. package/templates/builder/builder.ts.tpl +1 -1
  415. package/templates/command/handler.declared.ts.tpl +7 -7
  416. package/templates/command/handler.spec.buses.ts.tpl +4 -4
  417. package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
  418. package/templates/command/handler.ts.tpl +4 -4
  419. package/templates/command/wiring.manual.tpl +2 -2
  420. package/templates/command/wiring.tsyringe.tpl +3 -3
  421. package/templates/context/module.manual.ts.tpl +1 -1
  422. package/templates/context/permission-set.tpl +1 -1
  423. package/templates/context/permissions.spec.ts.tpl +1 -1
  424. package/templates/context/routes.spec.ts.tpl +1 -1
  425. package/templates/context/wiring.declared.tpl +2 -2
  426. package/templates/context/wiring.manual.tpl +1 -1
  427. package/templates/context/wiring.tsyringe.tpl +2 -2
  428. package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
  429. package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
  430. package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
  431. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  432. package/templates/entity/entity.spec.ts.tpl +1 -1
  433. package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
  434. package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
  435. package/templates/event-handler/event-handler.ts.tpl +1 -1
  436. package/templates/event-handler/wiring.manual.tpl +2 -2
  437. package/templates/event-handler/wiring.tsyringe.tpl +2 -2
  438. package/templates/gateway/adapter.declared.ts.tpl +3 -3
  439. package/templates/gateway/adapter.ts.tpl +2 -2
  440. package/templates/gateway/contract.spec.ts.tpl +3 -3
  441. package/templates/gateway/fake.ts.tpl +1 -1
  442. package/templates/gateway/platform-test.declared.tpl +1 -1
  443. package/templates/gateway/platform.declared.tpl +1 -1
  444. package/templates/gateway/wiring.tsyringe.tpl +3 -3
  445. package/templates/init/CLAUDE.md.tpl +5 -2
  446. package/templates/init/README.md.tpl +15 -10
  447. package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
  448. package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
  449. package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
  450. package/templates/init/e2e/start-application.database.ts.tpl +16 -16
  451. package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
  452. package/templates/init/e2e/test-environment.ts.tpl +1 -1
  453. package/templates/init/main.ts.tpl +11 -11
  454. package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
  455. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
  456. package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
  457. package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
  458. package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
  459. package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
  460. package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
  461. package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
  462. package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
  463. package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
  464. package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
  465. package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
  466. package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
  467. package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
  468. package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
  469. package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
  470. package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
  471. package/templates/init/platform/auth/permissions.ts.tpl +1 -1
  472. package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
  473. package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
  474. package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
  475. package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
  476. package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
  477. package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
  478. package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
  479. package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
  480. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  481. package/templates/init/platform/config/load-config.ts.tpl +3 -3
  482. package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
  483. package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
  484. package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
  485. package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
  486. package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
  487. package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
  488. package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
  489. package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
  490. package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
  491. package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
  492. package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
  493. package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
  494. package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
  495. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
  496. package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
  497. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
  498. package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
  499. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
  500. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
  501. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
  502. package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
  503. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
  504. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
  505. package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
  506. package/templates/init/platform/errors.ts.tpl +1 -1
  507. package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
  508. package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
  509. package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
  510. package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
  511. package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
  512. package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
  513. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  514. package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
  515. package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
  516. package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
  517. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
  518. package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
  519. package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
  520. package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
  521. package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
  522. package/templates/init/platform/platform.manual.ts.tpl +3 -3
  523. package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
  524. package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
  525. package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
  526. package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
  527. package/templates/init/platform/tracing.ts.tpl +2 -2
  528. package/templates/init/rules/application.md.tpl +8 -2
  529. package/templates/init/rules/infrastructure.md.tpl +3 -3
  530. package/templates/init/scripts/openapi.ts.tpl +5 -5
  531. package/templates/integration-event/audited.tpl +1 -1
  532. package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
  533. package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
  534. package/templates/integration-event/publisher.declared.ts.tpl +4 -4
  535. package/templates/integration-event/publisher.spec.ts.tpl +2 -2
  536. package/templates/integration-event/publisher.ts.tpl +2 -2
  537. package/templates/integration-event/wiring.manual.tpl +2 -2
  538. package/templates/integration-event/wiring.tsyringe.tpl +2 -2
  539. package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
  540. package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
  541. package/templates/integration-handler/integration-handler.ts.tpl +1 -1
  542. package/templates/integration-handler/wiring.manual.tpl +3 -3
  543. package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
  544. package/templates/job/job.declared.ts.tpl +3 -3
  545. package/templates/job/job.spec.buses.ts.tpl +2 -2
  546. package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
  547. package/templates/job/job.ts.tpl +1 -1
  548. package/templates/job/wiring.manual.tpl +1 -1
  549. package/templates/job/wiring.tsyringe.tpl +1 -1
  550. package/templates/pipeline/package-scripts.json +1 -1
  551. package/templates/policy/policy.declared.ts.tpl +1 -1
  552. package/templates/policy/policy.spec.declared.ts.tpl +1 -1
  553. package/templates/policy/policy.spec.ts.tpl +1 -1
  554. package/templates/policy/policy.ts.tpl +1 -1
  555. package/templates/policy/registration.tpl +1 -1
  556. package/templates/port/fake.ts.tpl +1 -1
  557. package/templates/projection/projection.spec.ts.tpl +17 -0
  558. package/templates/projection/projection.ts.tpl +11 -0
  559. package/templates/query/handler.declared.ts.tpl +4 -4
  560. package/templates/query/handler.spec.buses.ts.tpl +5 -5
  561. package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
  562. package/templates/query/handler.ts.tpl +3 -3
  563. package/templates/query/query.ts.tpl +1 -1
  564. package/templates/query/reader.fake.ts.tpl +2 -2
  565. package/templates/query/reader.in-memory.ts.tpl +4 -4
  566. package/templates/query/reader.port.ts.tpl +2 -2
  567. package/templates/query/search.handler.declared.ts.tpl +6 -6
  568. package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
  569. package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
  570. package/templates/query/search.handler.ts.tpl +4 -4
  571. package/templates/query/search.query.ts.tpl +1 -1
  572. package/templates/query/search.reader.fake.ts.tpl +2 -2
  573. package/templates/query/search.reader.in-memory.ts.tpl +3 -3
  574. package/templates/query/search.reader.port.ts.tpl +1 -1
  575. package/templates/query/search.reader.spec.ts.tpl +2 -2
  576. package/templates/query/search.wiring.manual.tpl +3 -3
  577. package/templates/query/search.wiring.tsyringe.tpl +4 -4
  578. package/templates/query/wiring.manual.tpl +3 -3
  579. package/templates/query/wiring.tsyringe.tpl +4 -4
  580. package/templates/repository/contract.spec.ts.tpl +5 -5
  581. package/templates/repository/drizzle/mapper.ts.tpl +2 -2
  582. package/templates/repository/drizzle/repository.ts.tpl +9 -17
  583. package/templates/repository/drizzle/schema-export.tpl +1 -1
  584. package/templates/repository/fake.ts.tpl +2 -2
  585. package/templates/repository/knex/mapper.ts.tpl +2 -2
  586. package/templates/repository/knex/repository.ts.tpl +10 -30
  587. package/templates/repository/knex/schema-export.tpl +1 -1
  588. package/templates/repository/knex/tables.ts.tpl +1 -1
  589. package/templates/repository/none/repository.ts.tpl +3 -3
  590. package/templates/repository/prisma/mapper.ts.tpl +2 -2
  591. package/templates/repository/prisma/repository.ts.tpl +6 -9
  592. package/templates/repository/repository.ts.tpl +1 -1
  593. package/templates/repository/typeorm/mapper.ts.tpl +2 -2
  594. package/templates/repository/typeorm/repository.ts.tpl +9 -12
  595. package/templates/repository/typeorm/schema-export.tpl +1 -1
  596. package/templates/repository/typeorm/table.tpl +1 -1
  597. package/templates/repository/wiring.manual.tpl +1 -1
  598. package/templates/repository/wiring.tsyringe.tpl +2 -2
  599. package/templates/route/route.search.ts.tpl +1 -1
  600. package/templates/route/route.spec.ts.tpl +1 -1
  601. package/templates/route/routes.on-tsyringe.tpl +1 -1
  602. package/templates/route/wiring.manual.tpl +1 -1
  603. package/templates/service/main.ts.tpl +11 -11
  604. package/templates/value-object/value-object.spec.ts.tpl +1 -1
  605. package/templates/worker/main.ts.tpl +9 -9
  606. package/dist/alias/platform-alias.d.ts +0 -4
  607. package/dist/alias/platform-alias.d.ts.map +0 -1
  608. package/dist/alias/platform-alias.js +0 -7
  609. package/dist/alias/platform-alias.js.map +0 -1
@@ -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,MAA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,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AACvF,CAAC;AAED,kHAAkH;AAClH,SAAS,MAAM,CAAC,OAAgB,EAAE,SAAyB;IACzD,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAElF,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,KAAK,WAAW,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEpD,IAAI,KAAK,KAAK,SAAS,IAAI,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"}
@@ -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),
@@ -1 +1 @@
1
- {"version":3,"file":"imports-alias-declared.js","sourceRoot":"","sources":["../../../src/check/rules/imports-alias-declared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CA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AE,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,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACtE,C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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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports-extension.js","sourceRoot":"","sources":["../../../src/check/rules/imports-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBA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,CAAC,IAAY,EAAW,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAE1G,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,aAAa,CAAC,SAAiB;IACtC,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAE9C,OAAO;QACL,OAAO,EAAE,IAAI,SAAS,mEAAmE,WAAW,GAAG;QACvG,GAAG,EAAE,UAAU,IAAI,mTAAmT;KACvU,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ports-no-concrete-dependency.d.ts","sourceRoot":"","sources":["../../../src/check/rules/ports-no-concrete-dependency.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,eAAO,MAAM,yBAAyB,EAAE,IA2BvC,CAAC"}
1
+ {"version":3,"file":"ports-no-concrete-dependency.d.ts","sourceRoot":"","sources":["../../../src/check/rules/ports-no-concrete-dependency.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW7C,eAAO,MAAM,yBAAyB,EAAE,IAQvC,CAAC"}
@@ -1,27 +1,55 @@
1
+ import { declaredRoleOf } from '../../declared/declared-role-of.js';
2
+ import { readInjections } from '../../declared/injection/read-injections.js';
1
3
  import { dependencyLists } from '../declarations/dependency-lists.js';
4
+ import { sourceAt } from '../project/source-at.js';
2
5
  import { importedFrom } from '../support/imported-from.js';
6
+ import { isDeclaredStyle } from '../support/is-declared-style.js';
7
+ import { pathInContext } from '../support/path-in-context.js';
3
8
  import { perFile } from '../support/per-file.js';
9
+ const NAME_THE_PORT = 'an abstract class of application/ports or domain/repositories, or a port of the kernel: the adapter, or the fake in a test, is bound to that port at the composition root.';
4
10
  export const portsNoConcreteDependency = {
5
11
  id: 'ports/no-concrete-dependency',
6
- description: 'A dependency list names ports: no class imported from infrastructure/ or from test/fakes/ of a context.',
12
+ description: 'A dependency is named by its port: no class imported from infrastructure/ or from test/fakes/ of a context in a dependency list, nor as the type of a constructor parameter of a declared class.',
7
13
  scope: 'file',
8
14
  run(project) {
9
- return perFile(project, this.id, (file) => dependencyLists(file).flatMap(({ owner, names }) => names.flatMap(({ name, line }) => {
10
- const target = importedFrom(file, name)?.target;
11
- const place = target?.kind === 'file' ? concretePlace(target.location) : undefined;
12
- if (place === undefined) {
13
- return [];
14
- }
15
- return [
16
- {
17
- line,
18
- message: `The dependency list of ${owner} names ${name}, a class of ${place}: a list names ports, never what implements them.`,
19
- fix: `Name the port ${name} implements (an abstract class of application/ports or domain/repositories, or a port of the kernel) and type the constructor parameter with it: the adapter, or the fake in a test, is bound to that port at the composition root.`,
20
- },
21
- ];
22
- })));
15
+ return perFile(project, this.id, (file) => [...listed(file), ...typed(project, file)]);
23
16
  },
24
17
  };
18
+ function listed(file) {
19
+ return dependencyLists(file).flatMap(({ owner, names }) => names.flatMap(({ name, line }) => {
20
+ const target = importedFrom(file, name)?.target;
21
+ const place = target?.kind === 'file' ? concretePlace(target.location) : undefined;
22
+ if (place === undefined) {
23
+ return [];
24
+ }
25
+ return [
26
+ {
27
+ line,
28
+ message: `The dependency list of ${owner} names ${name}, a class of ${place}: a list names ports, never what implements them.`,
29
+ fix: `Name the port ${name} implements and type the constructor parameter with it, ${NAME_THE_PORT}`,
30
+ },
31
+ ];
32
+ }));
33
+ }
34
+ /** A declared class that lists nothing states its dependencies in its constructor: its parameter types are the list. */
35
+ function typed(project, file) {
36
+ if (!isDeclaredStyle(project) || file.isTest || declaredRoleOf(pathInContext(project, file) ?? '') === undefined) {
37
+ return [];
38
+ }
39
+ return readInjections((path) => sourceAt(project, path), file).flatMap(({ className, line, listed: list, dependencies = [] }) => (list === undefined ? dependencies : []).flatMap(({ name, from }) => {
40
+ const place = from.kind === 'file' ? concretePlace(project.locate(from.path)) : undefined;
41
+ if (place === undefined) {
42
+ return [];
43
+ }
44
+ return [
45
+ {
46
+ line,
47
+ message: `The constructor of ${className} takes ${name}, a class of ${place}: a parameter is typed by a port, never by what implements it.`,
48
+ fix: `Type the parameter by the port ${name} implements, ${NAME_THE_PORT}`,
49
+ },
50
+ ];
51
+ }));
52
+ }
25
53
  function concretePlace(location) {
26
54
  if (location.area !== 'context') {
27
55
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"ports-no-concrete-dependency.js","sourceRoot":"","sources":["../../../src/check/rules/ports-no-concrete-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAGtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAS;IAC7C,EAAE,EAAE,8BAA8B;IAClC,WAAW,EACT,yGAAyG;IAC3G,KAAK,EAAE,MAAM;IACb,GAAG,CAAC,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CACxC,eAAe,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CACjD,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;YAC/B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAChD,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,CAAC;QACxC,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,KAAK,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;AACjG,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 { isCanonicalDirectory } from '../canonical/is-canonical-directory.js';
4
4
  import { OPEN_DIRECTORIES } from '../canonical/open-directories.js';
5
5
  import { roleOf } from '../canonical/role-of.js';
@@ -72,11 +72,13 @@ function straySource(placed) {
72
72
  };
73
73
  }
74
74
  function atContextRoot({ context, declared, inside: file }) {
75
- const barrel = barrelFile(context);
76
- if (file === `${context}.module.ts` || (declared && file === barrel)) {
75
+ const generated = [barrelFile(context), dependenciesFile(context)];
76
+ if (file === `${context}.module.ts` || (declared && generated.includes(file))) {
77
77
  return undefined;
78
78
  }
79
- const allowed = declared ? `CONTEXT.md, ${barrel} and ${context}.module.ts` : `CONTEXT.md and ${context}.module.ts`;
79
+ const allowed = declared
80
+ ? `CONTEXT.md, the generated ${generated.join(' or ')} and ${context}.module.ts`
81
+ : `CONTEXT.md and ${context}.module.ts`;
80
82
  return {
81
83
  message: `"${file}" sits at the root of the context.`,
82
84
  fix: `Move it into the directory of its role; only ${allowed} live at the root of a context.`,
@@ -1 +1 @@
1
- {"version":3,"file":"tree-closed.js","sourceRoot":"","sources":["../../../src/check/rules/tree-closed.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EA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,IAAI,KAAK,GAAG,OAAO,YAAY,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ;QACtB,CAAC,CAAC,6BAA6B,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,OAAO,YAAY;QAChF,CAAC,CAAC,kBAAkB,OAAO,YAAY,CAAC;IAE1C,OAAO;QACL,OAAO,EAAE,IAAI,IAAI,oCAAoC;QACrD,GAAG,EAAE,gDAAgD,OAAO,iCAAiC;KAC9F,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,MAAyB,EAAE,SAAiB;IAClE,OAAO,MAAM,CAAC,IAAI,CAChB,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,KAAK,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,CACzG,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-aliases.d.ts","sourceRoot":"","sources":["../../src/commands/build-aliases.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,6HAA6H;AAC7H,eAAO,MAAM,mBAAmB,EAAE,OAajC,CAAC"}
1
+ {"version":3,"file":"build-aliases.d.ts","sourceRoot":"","sources":["../../src/commands/build-aliases.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,6HAA6H;AAC7H,eAAO,MAAM,mBAAmB,EAAE,OAejC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { aliasRoots } from '../alias/index.js';
1
+ import { aliasRoots, specifierSuffix } from '../alias/index.js';
2
2
  import { rewriteAliases } from '../build/index.js';
3
3
  import { readConfig } from '../config/index.js';
4
4
  import { Arguments } from './arguments.js';
@@ -8,8 +8,10 @@ const BUILD_PROJECT = 'tsconfig.build.json';
8
8
  export const buildAliasesCommand = (argv, io) => {
9
9
  const args = Arguments.parse(argv, { project: { type: 'string' } });
10
10
  const root = args.projectRoot;
11
- const roots = aliasRoots(readConfig(root).config);
12
- const report = rewriteAliases({ root, roots, project: args.text('project') ?? BUILD_PROJECT });
11
+ const { config } = readConfig(root);
12
+ const suffix = specifierSuffix(config.importExtension);
13
+ const project = args.text('project') ?? BUILD_PROJECT;
14
+ const report = rewriteAliases({ root, roots: aliasRoots(config), suffix, project });
13
15
  io.out(args.json
14
16
  ? JSON.stringify(report, null, 2)
15
17
  : `rewritten ${report.specifiers} alias specifier(s) in ${report.changed} of ${report.files} file(s) under ${report.outDir}/`);
@@ -1 +1 @@
1
- {"version":3,"file":"build-aliases.js","sourceRoot":"","sources":["../../src/commands/build-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAgB,MAAM,cAAc,CAAC;AAE5C,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAE5C,6HAA6H;AAC7H,MAAM,CAAC,MAAM,mBAAmB,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACvD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IAC9B,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,MAAM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,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,aAAa,CAAC;IACtD,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAEpF,EAAE,CAAC,GAAG,CACJ,IAAI,CAAC,IAAI;QACP,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACjC,CAAC,CAAC,cAAc,MAAM,CAAC,UAAU,0BAA0B,MAAM,CAAC,OAAO,OAAO,MAAM,CAAC,KAAK,kBAAkB,MAAM,CAAC,MAAM,GAAG,CACjI,CAAC;IAEF,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,eAAO,MAAM,WAAW,EAAE,OA8BzB,CAAC"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,eAAO,MAAM,WAAW,EAAE,OAiCzB,CAAC"}
@@ -1,4 +1,7 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
1
3
  import { readConfig } from '../config/index.js';
4
+ import { generatedDrift } from '../declared/index.js';
2
5
  import { writeDocs } from '../docs/write-docs.js';
3
6
  import { stopIgnoringValidation } from '../generate/stop-ignoring-validation.js';
4
7
  import { Workspace } from '../workspace/index.js';
@@ -19,15 +22,27 @@ export const docsCommand = (argv, io) => {
19
22
  }
20
23
  const report = ws.commit(true);
21
24
  const stale = [...report.created, ...report.updated];
25
+ const drift = Object.fromEntries(stale.flatMap((file) => driftOf(root, ws, file)));
22
26
  if (args.json) {
23
- io.out(JSON.stringify({ ok: stale.length === 0, stale }, null, 2));
27
+ io.out(JSON.stringify({ ok: stale.length === 0, stale, drift }, null, 2));
24
28
  }
25
29
  else if (stale.length === 0) {
26
30
  io.out('The generated documentation is up to date.');
27
31
  }
28
32
  else {
29
- io.out([...stale.map((file) => `stale ${file}`), '', 'Run `ddd-ts-kit docs` and commit the result.'].join('\n'));
33
+ const lines = stale.map((file) => `stale ${file}${drift[file] === undefined ? '' : `: ${drift[file]}`}`);
34
+ io.out([...lines, '', 'Run `ddd-ts-kit docs` and commit the result.'].join('\n'));
30
35
  }
31
36
  return stale.length === 0 ? 0 : 1;
32
37
  };
38
+ const GENERATED_CONTEXT_FILE = /\.(?:declarations|dependencies)\.ts$/;
39
+ /** What makes a generated file of a context stale, in words: the role file it misses, or the class whose constructor changed. */
40
+ function driftOf(root, ws, file) {
41
+ const expected = GENERATED_CONTEXT_FILE.test(file) ? ws.read(file) : undefined;
42
+ if (expected === undefined) {
43
+ return [];
44
+ }
45
+ const written = fs.existsSync(path.join(root, file)) ? fs.readFileSync(path.join(root, file), 'utf8') : '';
46
+ return [[file, written === '' ? 'it is missing' : generatedDrift(written, expected)]];
47
+ }
33
48
  //# sourceMappingURL=docs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IAC/C,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,WAAW,EAAE,OAkCzB,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AA0B5C,eAAO,MAAM,WAAW,EAAE,OA6BzB,CAAC"}
@@ -22,13 +22,12 @@ const STACK_FLAGS = [
22
22
  'logger',
23
23
  'style',
24
24
  'assembly',
25
+ 'dependencies',
25
26
  ];
27
+ const OTHER_TEXT_FLAGS = ['docs-ui', 'allow-no-outbox', 'import-alias', 'import-extension', 'package-manager'];
26
28
  export const initCommand = (argv, io) => {
27
29
  const args = Arguments.parse(argv, {
28
- ...Object.fromEntries([...STACK_FLAGS, 'docs-ui', 'allow-no-outbox', 'import-alias', 'package-manager'].map((flag) => [
29
- flag,
30
- { type: 'string' },
31
- ])),
30
+ ...Object.fromEntries([...STACK_FLAGS, ...OTHER_TEXT_FLAGS].map((flag) => [flag, { type: 'string' }])),
32
31
  context: { type: 'string', multiple: true },
33
32
  'dry-run': { type: 'boolean', default: false },
34
33
  force: { type: 'boolean', default: false },
@@ -48,12 +47,14 @@ function stackOptions(args) {
48
47
  const docsUi = args.text('docs-ui');
49
48
  const allowNoOutbox = args.text('allow-no-outbox');
50
49
  const importAlias = args.text('import-alias');
50
+ const importExtension = args.text('import-extension');
51
51
  const packageManager = args.text('package-manager');
52
52
  return {
53
53
  ...args.texts(STACK_FLAGS),
54
54
  ...(docsUi === undefined ? {} : { docsUi }),
55
55
  ...(allowNoOutbox === undefined ? {} : { allowNoOutbox }),
56
56
  ...(importAlias === undefined ? {} : { importAlias }),
57
+ ...(importExtension === undefined ? {} : { importExtension }),
57
58
  ...(packageManager === undefined ? {} : { packageManager }),
58
59
  };
59
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAA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AAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAEpD,OAAO;QACL,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QAC1B,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;QACzD,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QACrD,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC;QAC7D,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;KAC5D,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-derived.d.ts","sourceRoot":"","sources":["../../src/commit/is-derived.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAejD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAU/D"}
1
+ {"version":3,"file":"is-derived.d.ts","sourceRoot":"","sources":["../../src/commit/is-derived.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAejD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAc/D"}
@@ -1,4 +1,4 @@
1
- import { barrelFile } from '../declared/index.js';
1
+ import { barrelFile, dependenciesFile } from '../declared/index.js';
2
2
  import { DEPCRUISE_FILE } from '../depcruise/depcruise-file.js';
3
3
  import { CONTEXT_MAP } from '../docs/context-map-file.js';
4
4
  import { WORKER_SCOPE_FILE } from './worker-scope-file.js';
@@ -17,6 +17,9 @@ export function isDerived(config, file) {
17
17
  const [context, name, ...deeper] = file.startsWith(`${config.contextsDir}/`)
18
18
  ? file.slice(config.contextsDir.length + 1).split('/')
19
19
  : [];
20
- return context !== undefined && deeper.length === 0 && name === barrelFile(context);
20
+ if (context === undefined || deeper.length > 0) {
21
+ return false;
22
+ }
23
+ return name === barrelFile(context) || name === dependenciesFile(context);
21
24
  }
22
25
  //# sourceMappingURL=is-derived.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-derived.js","sourceRoot":"","sources":["../../src/commit/is-derived.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,mBAAmB,GAAG;IAC1B,sBAAsB;IACtB,gCAAgC;IAChC,mCAAmC;CACpC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AACvH,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB,EAAE,GAAG,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAE7G,6FAA6F;AAC7F,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,IAAY;IACpD,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,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