ddd-ts-kit 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (791) hide show
  1. package/README.md +136 -23
  2. package/dist/alias/compiler-resolution-of.d.ts +10 -0
  3. package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
  4. package/dist/alias/compiler-resolution-of.js +13 -0
  5. package/dist/alias/compiler-resolution-of.js.map +1 -0
  6. package/dist/alias/compiler-resolution.d.ts +8 -0
  7. package/dist/alias/compiler-resolution.d.ts.map +1 -0
  8. package/dist/alias/compiler-resolution.js +2 -0
  9. package/dist/alias/compiler-resolution.js.map +1 -0
  10. package/dist/alias/index.d.ts +3 -1
  11. package/dist/alias/index.d.ts.map +1 -1
  12. package/dist/alias/index.js +3 -1
  13. package/dist/alias/index.js.map +1 -1
  14. package/dist/alias/module-name-mapper.d.ts +4 -3
  15. package/dist/alias/module-name-mapper.d.ts.map +1 -1
  16. package/dist/alias/module-name-mapper.js +6 -4
  17. package/dist/alias/module-name-mapper.js.map +1 -1
  18. package/dist/alias/specifier-of.d.ts +7 -0
  19. package/dist/alias/specifier-of.d.ts.map +1 -0
  20. package/dist/alias/specifier-of.js +17 -0
  21. package/dist/alias/specifier-of.js.map +1 -0
  22. package/dist/alias/specifier-suffix.d.ts +6 -0
  23. package/dist/alias/specifier-suffix.d.ts.map +1 -0
  24. package/dist/alias/specifier-suffix.js +8 -0
  25. package/dist/alias/specifier-suffix.js.map +1 -0
  26. package/dist/alias/to-alias.d.ts +3 -2
  27. package/dist/alias/to-alias.d.ts.map +1 -1
  28. package/dist/alias/to-alias.js +4 -3
  29. package/dist/alias/to-alias.js.map +1 -1
  30. package/dist/build/emitted-place.d.ts +2 -0
  31. package/dist/build/emitted-place.d.ts.map +1 -1
  32. package/dist/build/emitted-specifier.d.ts +3 -2
  33. package/dist/build/emitted-specifier.d.ts.map +1 -1
  34. package/dist/build/emitted-specifier.js +6 -12
  35. package/dist/build/emitted-specifier.js.map +1 -1
  36. package/dist/build/emitted-target.d.ts +9 -0
  37. package/dist/build/emitted-target.d.ts.map +1 -0
  38. package/dist/build/emitted-target.js +18 -0
  39. package/dist/build/emitted-target.js.map +1 -0
  40. package/dist/build/rewrite-aliases.d.ts +5 -3
  41. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  42. package/dist/build/rewrite-aliases.js +12 -7
  43. package/dist/build/rewrite-aliases.js.map +1 -1
  44. package/dist/build/rewrite-specifiers.d.ts +3 -1
  45. package/dist/build/rewrite-specifiers.d.ts.map +1 -1
  46. package/dist/build/rewrite-specifiers.js +2 -2
  47. package/dist/build/rewrite-specifiers.js.map +1 -1
  48. package/dist/build/unresolved-problem.d.ts +4 -0
  49. package/dist/build/unresolved-problem.d.ts.map +1 -0
  50. package/dist/build/unresolved-problem.js +16 -0
  51. package/dist/build/unresolved-problem.js.map +1 -0
  52. package/dist/check/alias/compiler-resolution.d.ts +10 -0
  53. package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
  54. package/dist/check/alias/compiler-resolution.js +47 -0
  55. package/dist/check/alias/compiler-resolution.js.map +1 -0
  56. package/dist/check/alias/test-runners.js +4 -4
  57. package/dist/check/alias/test-runners.js.map +1 -1
  58. package/dist/check/canonical/roles.d.ts.map +1 -1
  59. package/dist/check/canonical/roles.js +6 -0
  60. package/dist/check/canonical/roles.js.map +1 -1
  61. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  62. package/dist/check/catalogue/architecture-rules.js +8 -0
  63. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  64. package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
  65. package/dist/check/catalogue/eslint-only-rules.js +12 -0
  66. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  67. package/dist/check/configuration/config-inspection.d.ts +2 -0
  68. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  69. package/dist/check/configuration/config-inspection.js +11 -1
  70. package/dist/check/configuration/config-inspection.js.map +1 -1
  71. package/dist/check/declarations/classes-of.js +1 -1
  72. package/dist/check/declarations/classes-of.js.map +1 -1
  73. package/dist/check/errors/builds-through-factories.d.ts +4 -0
  74. package/dist/check/errors/builds-through-factories.d.ts.map +1 -0
  75. package/dist/check/errors/builds-through-factories.js +5 -0
  76. package/dist/check/errors/builds-through-factories.js.map +1 -0
  77. package/dist/check/errors/error-code.d.ts +6 -0
  78. package/dist/check/errors/error-code.d.ts.map +1 -0
  79. package/dist/check/errors/error-code.js +2 -0
  80. package/dist/check/errors/error-code.js.map +1 -0
  81. package/dist/check/errors/error-codes.d.ts +8 -0
  82. package/dist/check/errors/error-codes.d.ts.map +1 -0
  83. package/dist/check/errors/error-codes.js +21 -0
  84. package/dist/check/errors/error-codes.js.map +1 -0
  85. package/dist/check/errors/kit-error-codes.d.ts +3 -0
  86. package/dist/check/errors/kit-error-codes.d.ts.map +1 -0
  87. package/dist/check/errors/kit-error-codes.js +17 -0
  88. package/dist/check/errors/kit-error-codes.js.map +1 -0
  89. package/dist/check/explain/context-docs.js +7 -7
  90. package/dist/check/explain/context-docs.js.map +1 -1
  91. package/dist/check/explain/errors-docs.d.ts +3 -0
  92. package/dist/check/explain/errors-docs.d.ts.map +1 -0
  93. package/dist/check/explain/errors-docs.js +30 -0
  94. package/dist/check/explain/errors-docs.js.map +1 -0
  95. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  96. package/dist/check/explain/imports-docs.js +24 -9
  97. package/dist/check/explain/imports-docs.js.map +1 -1
  98. package/dist/check/explain/layer-docs.js +7 -7
  99. package/dist/check/explain/layer-docs.js.map +1 -1
  100. package/dist/check/explain/ports-docs.d.ts.map +1 -1
  101. package/dist/check/explain/ports-docs.js +15 -7
  102. package/dist/check/explain/ports-docs.js.map +1 -1
  103. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  104. package/dist/check/explain/rule-docs.js +2 -0
  105. package/dist/check/explain/rule-docs.js.map +1 -1
  106. package/dist/check/explain/scheduling-docs.js +1 -1
  107. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  108. package/dist/check/explain/wiring-docs.js +35 -10
  109. package/dist/check/explain/wiring-docs.js.map +1 -1
  110. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  111. package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
  112. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  113. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  114. package/dist/check/fixtures/config-fixtures.js +6 -0
  115. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  116. package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
  117. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
  118. package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
  119. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
  120. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  121. package/dist/check/fixtures/declared-project.js +4 -1
  122. package/dist/check/fixtures/declared-project.js.map +1 -1
  123. package/dist/check/fixtures/errors-fixtures.d.ts +3 -0
  124. package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -0
  125. package/dist/check/fixtures/errors-fixtures.js +126 -0
  126. package/dist/check/fixtures/errors-fixtures.js.map +1 -0
  127. package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
  128. package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
  129. package/dist/check/fixtures/extension-fixtures.js +77 -0
  130. package/dist/check/fixtures/extension-fixtures.js.map +1 -0
  131. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  132. package/dist/check/fixtures/fixtures.js +6 -0
  133. package/dist/check/fixtures/fixtures.js.map +1 -1
  134. package/dist/check/fixtures/signature-project.d.ts +11 -0
  135. package/dist/check/fixtures/signature-project.d.ts.map +1 -0
  136. package/dist/check/fixtures/signature-project.js +21 -0
  137. package/dist/check/fixtures/signature-project.js.map +1 -0
  138. package/dist/check/fixtures/signature.d.ts +13 -0
  139. package/dist/check/fixtures/signature.d.ts.map +1 -0
  140. package/dist/check/fixtures/signature.js +24 -0
  141. package/dist/check/fixtures/signature.js.map +1 -0
  142. package/dist/check/project/beside-the-sources.d.ts +5 -0
  143. package/dist/check/project/beside-the-sources.d.ts.map +1 -0
  144. package/dist/check/project/beside-the-sources.js +21 -0
  145. package/dist/check/project/beside-the-sources.js.map +1 -0
  146. package/dist/check/project/resolve-import.d.ts.map +1 -1
  147. package/dist/check/project/resolve-import.js +4 -1
  148. package/dist/check/project/resolve-import.js.map +1 -1
  149. package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
  150. package/dist/check/rules/clean-one-export-per-file.js +14 -8
  151. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  152. package/dist/check/rules/config-valid.d.ts.map +1 -1
  153. package/dist/check/rules/config-valid.js +2 -1
  154. package/dist/check/rules/config-valid.js.map +1 -1
  155. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  156. package/dist/check/rules/declarations-barrel-current.js +34 -32
  157. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  158. package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
  159. package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
  160. package/dist/check/rules/declarations-constructor-injection.js +58 -0
  161. package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
  162. package/dist/check/rules/errors-code-unique.d.ts +3 -0
  163. package/dist/check/rules/errors-code-unique.d.ts.map +1 -0
  164. package/dist/check/rules/errors-code-unique.js +34 -0
  165. package/dist/check/rules/errors-code-unique.js.map +1 -0
  166. package/dist/check/rules/errors-known-code.d.ts +3 -0
  167. package/dist/check/rules/errors-known-code.d.ts.map +1 -0
  168. package/dist/check/rules/errors-known-code.js +51 -0
  169. package/dist/check/rules/errors-known-code.js.map +1 -0
  170. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  171. package/dist/check/rules/imports-alias-declared.js +3 -1
  172. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  173. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  174. package/dist/check/rules/imports-alias-only.js +16 -29
  175. package/dist/check/rules/imports-alias-only.js.map +1 -1
  176. package/dist/check/rules/imports-extension.d.ts +3 -0
  177. package/dist/check/rules/imports-extension.d.ts.map +1 -0
  178. package/dist/check/rules/imports-extension.js +65 -0
  179. package/dist/check/rules/imports-extension.js.map +1 -0
  180. package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
  181. package/dist/check/rules/language-glossary-term.js +7 -5
  182. package/dist/check/rules/language-glossary-term.js.map +1 -1
  183. package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
  184. package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
  185. package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
  186. package/dist/check/rules/tree-closed.js +6 -4
  187. package/dist/check/rules/tree-closed.js.map +1 -1
  188. package/dist/commands/build-aliases.d.ts.map +1 -1
  189. package/dist/commands/build-aliases.js +5 -3
  190. package/dist/commands/build-aliases.js.map +1 -1
  191. package/dist/commands/docs.d.ts.map +1 -1
  192. package/dist/commands/docs.js +17 -2
  193. package/dist/commands/docs.js.map +1 -1
  194. package/dist/commands/error-factories.d.ts +7 -0
  195. package/dist/commands/error-factories.d.ts.map +1 -0
  196. package/dist/commands/error-factories.js +65 -0
  197. package/dist/commands/error-factories.js.map +1 -0
  198. package/dist/commands/init.d.ts.map +1 -1
  199. package/dist/commands/init.js +6 -4
  200. package/dist/commands/init.js.map +1 -1
  201. package/dist/commit/is-derived.d.ts.map +1 -1
  202. package/dist/commit/is-derived.js +5 -2
  203. package/dist/commit/is-derived.js.map +1 -1
  204. package/dist/config/config.d.ts +2 -0
  205. package/dist/config/config.d.ts.map +1 -1
  206. package/dist/config/default-import-extension.d.ts +3 -0
  207. package/dist/config/default-import-extension.d.ts.map +1 -0
  208. package/dist/config/default-import-extension.js +3 -0
  209. package/dist/config/default-import-extension.js.map +1 -0
  210. package/dist/config/import-extensions.d.ts +3 -0
  211. package/dist/config/import-extensions.d.ts.map +1 -0
  212. package/dist/config/import-extensions.js +3 -0
  213. package/dist/config/import-extensions.js.map +1 -0
  214. package/dist/config/index.d.ts +4 -1
  215. package/dist/config/index.d.ts.map +1 -1
  216. package/dist/config/index.js +4 -1
  217. package/dist/config/index.js.map +1 -1
  218. package/dist/config/parse-config.d.ts.map +1 -1
  219. package/dist/config/parse-config.js +2 -0
  220. package/dist/config/parse-config.js.map +1 -1
  221. package/dist/config/parse-stack.d.ts.map +1 -1
  222. package/dist/config/parse-stack.js +3 -1
  223. package/dist/config/parse-stack.js.map +1 -1
  224. package/dist/config/restack-config-text.d.ts +11 -0
  225. package/dist/config/restack-config-text.d.ts.map +1 -0
  226. package/dist/config/restack-config-text.js +31 -0
  227. package/dist/config/restack-config-text.js.map +1 -0
  228. package/dist/config/serialize-config.d.ts.map +1 -1
  229. package/dist/config/serialize-config.js +3 -6
  230. package/dist/config/serialize-config.js.map +1 -1
  231. package/dist/config/stack.d.ts +17 -0
  232. package/dist/config/stack.d.ts.map +1 -1
  233. package/dist/config/stack.js +2 -0
  234. package/dist/config/stack.js.map +1 -1
  235. package/dist/config/unwritten-import-extension.d.ts +3 -0
  236. package/dist/config/unwritten-import-extension.d.ts.map +1 -0
  237. package/dist/config/unwritten-import-extension.js +3 -0
  238. package/dist/config/unwritten-import-extension.js.map +1 -0
  239. package/dist/config/written-stack.d.ts +8 -0
  240. package/dist/config/written-stack.d.ts.map +1 -0
  241. package/dist/config/written-stack.js +10 -0
  242. package/dist/config/written-stack.js.map +1 -0
  243. package/dist/declared/declared-role.d.ts.map +1 -1
  244. package/dist/declared/declared-role.js +1 -0
  245. package/dist/declared/declared-role.js.map +1 -1
  246. package/dist/declared/dependencies-file.d.ts +7 -0
  247. package/dist/declared/dependencies-file.d.ts.map +1 -0
  248. package/dist/declared/dependencies-file.js +9 -0
  249. package/dist/declared/dependencies-file.js.map +1 -0
  250. package/dist/declared/generated-drift.d.ts +7 -0
  251. package/dist/declared/generated-drift.d.ts.map +1 -0
  252. package/dist/declared/generated-drift.js +47 -0
  253. package/dist/declared/generated-drift.js.map +1 -0
  254. package/dist/declared/index.d.ts +8 -1
  255. package/dist/declared/index.d.ts.map +1 -1
  256. package/dist/declared/index.js +6 -1
  257. package/dist/declared/index.js.map +1 -1
  258. package/dist/declared/injection/class-injection.d.ts +19 -0
  259. package/dist/declared/injection/class-injection.d.ts.map +1 -0
  260. package/dist/declared/injection/class-injection.js +2 -0
  261. package/dist/declared/injection/class-injection.js.map +1 -0
  262. package/dist/declared/injection/constructor-of.d.ts +16 -0
  263. package/dist/declared/injection/constructor-of.d.ts.map +1 -0
  264. package/dist/declared/injection/constructor-of.js +33 -0
  265. package/dist/declared/injection/constructor-of.js.map +1 -0
  266. package/dist/declared/injection/context-injections.d.ts +8 -0
  267. package/dist/declared/injection/context-injections.d.ts.map +1 -0
  268. package/dist/declared/injection/context-injections.js +14 -0
  269. package/dist/declared/injection/context-injections.js.map +1 -0
  270. package/dist/declared/injection/declared-kind-of.d.ts +8 -0
  271. package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
  272. package/dist/declared/injection/declared-kind-of.js +12 -0
  273. package/dist/declared/injection/declared-kind-of.js.map +1 -0
  274. package/dist/declared/injection/exported-name-of.d.ts +4 -0
  275. package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
  276. package/dist/declared/injection/exported-name-of.js +17 -0
  277. package/dist/declared/injection/exported-name-of.js.map +1 -0
  278. package/dist/declared/injection/language-types.d.ts +3 -0
  279. package/dist/declared/injection/language-types.d.ts.map +1 -0
  280. package/dist/declared/injection/language-types.js +32 -0
  281. package/dist/declared/injection/language-types.js.map +1 -0
  282. package/dist/declared/injection/local-names.d.ts +17 -0
  283. package/dist/declared/injection/local-names.d.ts.map +1 -0
  284. package/dist/declared/injection/local-names.js +41 -0
  285. package/dist/declared/injection/local-names.js.map +1 -0
  286. package/dist/declared/injection/parameter-shape.d.ts +11 -0
  287. package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
  288. package/dist/declared/injection/parameter-shape.js +58 -0
  289. package/dist/declared/injection/parameter-shape.js.map +1 -0
  290. package/dist/declared/injection/raw-class-name.d.ts +7 -0
  291. package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
  292. package/dist/declared/injection/raw-class-name.js +28 -0
  293. package/dist/declared/injection/raw-class-name.js.map +1 -0
  294. package/dist/declared/injection/read-constructor.d.ts +10 -0
  295. package/dist/declared/injection/read-constructor.d.ts.map +1 -0
  296. package/dist/declared/injection/read-constructor.js +2 -0
  297. package/dist/declared/injection/read-constructor.js.map +1 -0
  298. package/dist/declared/injection/read-injections.d.ts +6 -0
  299. package/dist/declared/injection/read-injections.d.ts.map +1 -0
  300. package/dist/declared/injection/read-injections.js +75 -0
  301. package/dist/declared/injection/read-injections.js.map +1 -0
  302. package/dist/declared/injection/render-injections.d.ts +11 -0
  303. package/dist/declared/injection/render-injections.d.ts.map +1 -0
  304. package/dist/declared/injection/render-injections.js +51 -0
  305. package/dist/declared/injection/render-injections.js.map +1 -0
  306. package/dist/declared/injection/rendered-injections.d.ts +8 -0
  307. package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
  308. package/dist/declared/injection/rendered-injections.js +2 -0
  309. package/dist/declared/injection/rendered-injections.js.map +1 -0
  310. package/dist/declared/injection/resolve-token.d.ts +18 -0
  311. package/dist/declared/injection/resolve-token.d.ts.map +1 -0
  312. package/dist/declared/injection/resolve-token.js +46 -0
  313. package/dist/declared/injection/resolve-token.js.map +1 -0
  314. package/dist/declared/injection/resolved-token.d.ts +10 -0
  315. package/dist/declared/injection/resolved-token.d.ts.map +1 -0
  316. package/dist/declared/injection/resolved-token.js +2 -0
  317. package/dist/declared/injection/resolved-token.js.map +1 -0
  318. package/dist/declared/injection/sources.d.ts +4 -0
  319. package/dist/declared/injection/sources.d.ts.map +1 -0
  320. package/dist/declared/injection/sources.js +2 -0
  321. package/dist/declared/injection/sources.js.map +1 -0
  322. package/dist/declared/injection/token-reference.d.ts +14 -0
  323. package/dist/declared/injection/token-reference.d.ts.map +1 -0
  324. package/dist/declared/injection/token-reference.js +2 -0
  325. package/dist/declared/injection/token-reference.js.map +1 -0
  326. package/dist/declared/render-barrel.d.ts +8 -5
  327. package/dist/declared/render-barrel.d.ts.map +1 -1
  328. package/dist/declared/render-barrel.js +13 -6
  329. package/dist/declared/render-barrel.js.map +1 -1
  330. package/dist/declared/render-dependencies-file.d.ts +8 -0
  331. package/dist/declared/render-dependencies-file.d.ts.map +1 -0
  332. package/dist/declared/render-dependencies-file.js +12 -0
  333. package/dist/declared/render-dependencies-file.js.map +1 -0
  334. package/dist/depcruise/hygiene-rules.js +2 -1
  335. package/dist/depcruise/hygiene-rules.js.map +1 -1
  336. package/dist/describe/context-description.d.ts +22 -0
  337. package/dist/describe/context-description.d.ts.map +1 -1
  338. package/dist/describe/describe-context.d.ts.map +1 -1
  339. package/dist/describe/describe-context.js +4 -0
  340. package/dist/describe/describe-context.js.map +1 -1
  341. package/dist/describe/format-description.d.ts.map +1 -1
  342. package/dist/describe/format-description.js +9 -0
  343. package/dist/describe/format-description.js.map +1 -1
  344. package/dist/describe/read-errors.d.ts +8 -0
  345. package/dist/describe/read-errors.d.ts.map +1 -0
  346. package/dist/describe/read-errors.js +52 -0
  347. package/dist/describe/read-errors.js.map +1 -0
  348. package/dist/describe/read-projections.d.ts +5 -0
  349. package/dist/describe/read-projections.d.ts.map +1 -0
  350. package/dist/describe/read-projections.js +19 -0
  351. package/dist/describe/read-projections.js.map +1 -0
  352. package/dist/describe/reference-lines.js +23 -1
  353. package/dist/describe/reference-lines.js.map +1 -1
  354. package/dist/dev/refresh-declarations.d.ts +9 -0
  355. package/dist/dev/refresh-declarations.d.ts.map +1 -0
  356. package/dist/dev/refresh-declarations.js +28 -0
  357. package/dist/dev/refresh-declarations.js.map +1 -0
  358. package/dist/generate/access-vars.js +3 -3
  359. package/dist/generate/access-vars.js.map +1 -1
  360. package/dist/generate/errors/add-factory.d.ts +13 -0
  361. package/dist/generate/errors/add-factory.d.ts.map +1 -0
  362. package/dist/generate/errors/add-factory.js +30 -0
  363. package/dist/generate/errors/add-factory.js.map +1 -0
  364. package/dist/generate/errors/add-spec-case.d.ts +6 -0
  365. package/dist/generate/errors/add-spec-case.d.ts.map +1 -0
  366. package/dist/generate/errors/add-spec-case.js +26 -0
  367. package/dist/generate/errors/add-spec-case.js.map +1 -0
  368. package/dist/generate/errors/class-body.d.ts +8 -0
  369. package/dist/generate/errors/class-body.d.ts.map +1 -0
  370. package/dist/generate/errors/class-body.js +11 -0
  371. package/dist/generate/errors/class-body.js.map +1 -0
  372. package/dist/generate/errors/codes-of-context.d.ts +4 -0
  373. package/dist/generate/errors/codes-of-context.d.ts.map +1 -0
  374. package/dist/generate/errors/codes-of-context.js +17 -0
  375. package/dist/generate/errors/codes-of-context.js.map +1 -0
  376. package/dist/generate/errors/refusal-code.d.ts +13 -0
  377. package/dist/generate/errors/refusal-code.d.ts.map +1 -0
  378. package/dist/generate/errors/refusal-code.js +19 -0
  379. package/dist/generate/errors/refusal-code.js.map +1 -0
  380. package/dist/generate/errors/refusal-name.d.ts +4 -0
  381. package/dist/generate/errors/refusal-name.d.ts.map +1 -0
  382. package/dist/generate/errors/refusal-name.js +15 -0
  383. package/dist/generate/errors/refusal-name.js.map +1 -0
  384. package/dist/generate/errors/static-methods.d.ts +10 -0
  385. package/dist/generate/errors/static-methods.d.ts.map +1 -0
  386. package/dist/generate/errors/static-methods.js +13 -0
  387. package/dist/generate/errors/static-methods.js.map +1 -0
  388. package/dist/generate/errors/vague-refusal-names.d.ts +3 -0
  389. package/dist/generate/errors/vague-refusal-names.d.ts.map +1 -0
  390. package/dist/generate/errors/vague-refusal-names.js +15 -0
  391. package/dist/generate/errors/vague-refusal-names.js.map +1 -0
  392. package/dist/generate/kinds/context-plan.d.ts +10 -0
  393. package/dist/generate/kinds/context-plan.d.ts.map +1 -0
  394. package/dist/generate/kinds/context-plan.js +2 -0
  395. package/dist/generate/kinds/context-plan.js.map +1 -0
  396. package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
  397. package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
  398. package/dist/generate/kinds/declare-context-entries.js +4 -2
  399. package/dist/generate/kinds/declare-context-entries.js.map +1 -1
  400. package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
  401. package/dist/generate/kinds/domain-error-kind.js +4 -1
  402. package/dist/generate/kinds/domain-error-kind.js.map +1 -1
  403. package/dist/generate/kinds/error-kind.d.ts +3 -0
  404. package/dist/generate/kinds/error-kind.d.ts.map +1 -0
  405. package/dist/generate/kinds/error-kind.js +75 -0
  406. package/dist/generate/kinds/error-kind.js.map +1 -0
  407. package/dist/generate/kinds/extraction/service-selection.js +8 -11
  408. package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
  409. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  410. package/dist/generate/kinds/job/job-vars.js +5 -3
  411. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  412. package/dist/generate/kinds/plan-vars.d.ts +5 -0
  413. package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
  414. package/dist/generate/kinds/plan-vars.js +24 -0
  415. package/dist/generate/kinds/plan-vars.js.map +1 -0
  416. package/dist/generate/kinds/projection-kind.d.ts +3 -0
  417. package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
  418. package/dist/generate/kinds/projection-kind.js +72 -0
  419. package/dist/generate/kinds/projection-kind.js.map +1 -0
  420. package/dist/generate/kinds/publish-in-index.js +2 -2
  421. package/dist/generate/kinds/publish-in-index.js.map +1 -1
  422. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  423. package/dist/generate/kinds/route/route-vars.js +7 -6
  424. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  425. package/dist/generate/kinds/wire-context.d.ts +10 -0
  426. package/dist/generate/kinds/wire-context.d.ts.map +1 -0
  427. package/dist/generate/kinds/wire-context.js +36 -0
  428. package/dist/generate/kinds/wire-context.js.map +1 -0
  429. package/dist/generate/kinds/write-context-files.d.ts +1 -8
  430. package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
  431. package/dist/generate/kinds/write-context-files.js +3 -40
  432. package/dist/generate/kinds/write-context-files.js.map +1 -1
  433. package/dist/generate/kinds.d.ts.map +1 -1
  434. package/dist/generate/kinds.js +4 -0
  435. package/dist/generate/kinds.js.map +1 -1
  436. package/dist/generate/refresh-barrels.d.ts +4 -3
  437. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  438. package/dist/generate/refresh-barrels.js +41 -16
  439. package/dist/generate/refresh-barrels.js.map +1 -1
  440. package/dist/generate/spec-vars.js +4 -4
  441. package/dist/generate/spec-vars.js.map +1 -1
  442. package/dist/generate/storage-vars.d.ts +2 -2
  443. package/dist/generate/storage-vars.d.ts.map +1 -1
  444. package/dist/generate/storage-vars.js +6 -10
  445. package/dist/generate/storage-vars.js.map +1 -1
  446. package/dist/generate/workspace-sources.d.ts +6 -0
  447. package/dist/generate/workspace-sources.d.ts.map +1 -0
  448. package/dist/generate/workspace-sources.js +13 -0
  449. package/dist/generate/workspace-sources.js.map +1 -0
  450. package/dist/init/manifest/scripts-for.js +6 -1
  451. package/dist/init/manifest/scripts-for.js.map +1 -1
  452. package/dist/init/manifest/versions.js +23 -23
  453. package/dist/init/run-init.d.ts.map +1 -1
  454. package/dist/init/run-init.js +32 -3
  455. package/dist/init/run-init.js.map +1 -1
  456. package/dist/init/stack/recorded-options.d.ts +11 -0
  457. package/dist/init/stack/recorded-options.d.ts.map +1 -0
  458. package/dist/init/stack/recorded-options.js +19 -0
  459. package/dist/init/stack/recorded-options.js.map +1 -0
  460. package/dist/init/stack/resolve-stack.d.ts +6 -1
  461. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  462. package/dist/init/stack/resolve-stack.js +48 -9
  463. package/dist/init/stack/resolve-stack.js.map +1 -1
  464. package/dist/init/stack/resolve-style.d.ts +3 -5
  465. package/dist/init/stack/resolve-style.d.ts.map +1 -1
  466. package/dist/init/stack/resolve-style.js +11 -3
  467. package/dist/init/stack/resolve-style.js.map +1 -1
  468. package/dist/init/stack/stack-options.d.ts +4 -0
  469. package/dist/init/stack/stack-options.d.ts.map +1 -1
  470. package/dist/init/write-agent-settings.js +4 -3
  471. package/dist/init/write-agent-settings.js.map +1 -1
  472. package/dist/init/write-type-script-configs.d.ts +2 -1
  473. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  474. package/dist/init/write-type-script-configs.js +4 -4
  475. package/dist/init/write-type-script-configs.js.map +1 -1
  476. package/dist/refresh-declarations.d.ts +3 -0
  477. package/dist/refresh-declarations.d.ts.map +1 -0
  478. package/dist/refresh-declarations.js +4 -0
  479. package/dist/refresh-declarations.js.map +1 -0
  480. package/dist/refusals/apply-plan.d.ts +17 -0
  481. package/dist/refusals/apply-plan.d.ts.map +1 -0
  482. package/dist/refusals/apply-plan.js +118 -0
  483. package/dist/refusals/apply-plan.js.map +1 -0
  484. package/dist/refusals/factory-name-for.d.ts +7 -0
  485. package/dist/refusals/factory-name-for.d.ts.map +1 -0
  486. package/dist/refusals/factory-name-for.js +16 -0
  487. package/dist/refusals/factory-name-for.js.map +1 -0
  488. package/dist/refusals/legacy-error.d.ts +21 -0
  489. package/dist/refusals/legacy-error.d.ts.map +1 -0
  490. package/dist/refusals/legacy-error.js +2 -0
  491. package/dist/refusals/legacy-error.js.map +1 -0
  492. package/dist/refusals/legacy-errors.d.ts +6 -0
  493. package/dist/refusals/legacy-errors.d.ts.map +1 -0
  494. package/dist/refusals/legacy-errors.js +16 -0
  495. package/dist/refusals/legacy-errors.js.map +1 -0
  496. package/dist/refusals/migration-draft.d.ts +15 -0
  497. package/dist/refusals/migration-draft.d.ts.map +1 -0
  498. package/dist/refusals/migration-draft.js +41 -0
  499. package/dist/refusals/migration-draft.js.map +1 -0
  500. package/dist/refusals/migration-plan.d.ts +6 -0
  501. package/dist/refusals/migration-plan.d.ts.map +1 -0
  502. package/dist/refusals/migration-plan.js +2 -0
  503. package/dist/refusals/migration-plan.js.map +1 -0
  504. package/dist/refusals/move.d.ts +15 -0
  505. package/dist/refusals/move.d.ts.map +1 -0
  506. package/dist/refusals/move.js +2 -0
  507. package/dist/refusals/move.js.map +1 -0
  508. package/dist/refusals/nested-cases.d.ts +3 -0
  509. package/dist/refusals/nested-cases.d.ts.map +1 -0
  510. package/dist/refusals/nested-cases.js +9 -0
  511. package/dist/refusals/nested-cases.js.map +1 -0
  512. package/dist/refusals/plan-file.d.ts +3 -0
  513. package/dist/refusals/plan-file.d.ts.map +1 -0
  514. package/dist/refusals/plan-file.js +3 -0
  515. package/dist/refusals/plan-file.js.map +1 -0
  516. package/dist/refusals/planned-factory.d.ts +11 -0
  517. package/dist/refusals/planned-factory.d.ts.map +1 -0
  518. package/dist/refusals/planned-factory.js +2 -0
  519. package/dist/refusals/planned-factory.js.map +1 -0
  520. package/dist/refusals/planned-move.d.ts +8 -0
  521. package/dist/refusals/planned-move.d.ts.map +1 -0
  522. package/dist/refusals/planned-move.js +2 -0
  523. package/dist/refusals/planned-move.js.map +1 -0
  524. package/dist/refusals/project-sources.d.ts +5 -0
  525. package/dist/refusals/project-sources.d.ts.map +1 -0
  526. package/dist/refusals/project-sources.js +13 -0
  527. package/dist/refusals/project-sources.js.map +1 -0
  528. package/dist/refusals/propose-plan.d.ts +16 -0
  529. package/dist/refusals/propose-plan.d.ts.map +1 -0
  530. package/dist/refusals/propose-plan.js +39 -0
  531. package/dist/refusals/propose-plan.js.map +1 -0
  532. package/dist/refusals/read-legacy-error.d.ts +9 -0
  533. package/dist/refusals/read-legacy-error.d.ts.map +1 -0
  534. package/dist/refusals/read-legacy-error.js +75 -0
  535. package/dist/refusals/read-legacy-error.js.map +1 -0
  536. package/dist/refusals/read-plan.d.ts +4 -0
  537. package/dist/refusals/read-plan.d.ts.map +1 -0
  538. package/dist/refusals/read-plan.js +43 -0
  539. package/dist/refusals/read-plan.js.map +1 -0
  540. package/dist/refusals/render-factory.d.ts +5 -0
  541. package/dist/refusals/render-factory.d.ts.map +1 -0
  542. package/dist/refusals/render-factory.js +14 -0
  543. package/dist/refusals/render-factory.js.map +1 -0
  544. package/dist/refusals/replace-in-code.d.ts +16 -0
  545. package/dist/refusals/replace-in-code.d.ts.map +1 -0
  546. package/dist/refusals/replace-in-code.js +20 -0
  547. package/dist/refusals/replace-in-code.js.map +1 -0
  548. package/dist/refusals/rewrite-usages.d.ts +6 -0
  549. package/dist/refusals/rewrite-usages.d.ts.map +1 -0
  550. package/dist/refusals/rewrite-usages.js +80 -0
  551. package/dist/refusals/rewrite-usages.js.map +1 -0
  552. package/dist/refusals/spec-parts.d.ts +8 -0
  553. package/dist/refusals/spec-parts.d.ts.map +1 -0
  554. package/dist/refusals/spec-parts.js +14 -0
  555. package/dist/refusals/spec-parts.js.map +1 -0
  556. package/dist/run.d.ts.map +1 -1
  557. package/dist/run.js +8 -0
  558. package/dist/run.js.map +1 -1
  559. package/dist/stack/alias-vars.d.ts +2 -1
  560. package/dist/stack/alias-vars.d.ts.map +1 -1
  561. package/dist/stack/alias-vars.js +6 -3
  562. package/dist/stack/alias-vars.js.map +1 -1
  563. package/dist/stack/stack-vars.d.ts.map +1 -1
  564. package/dist/stack/stack-vars.js +2 -1
  565. package/dist/stack/stack-vars.js.map +1 -1
  566. package/dist/version.d.ts +1 -1
  567. package/dist/version.js +1 -1
  568. package/package.json +4 -3
  569. package/templates/acl/translator.spec.ts.tpl +1 -1
  570. package/templates/adapter/adapter.declared.ts.tpl +3 -3
  571. package/templates/adapter/adapter.spec.ts.tpl +1 -1
  572. package/templates/adapter/adapter.ts.tpl +1 -1
  573. package/templates/adapter/wiring.tsyringe.tpl +3 -3
  574. package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
  575. package/templates/aggregate/aggregate.ts.tpl +5 -0
  576. package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
  577. package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
  578. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
  579. package/templates/architecture/wiring.declared.tpl +1 -1
  580. package/templates/architecture/wiring.manual.tpl +1 -1
  581. package/templates/architecture/wiring.tsyringe.tpl +1 -1
  582. package/templates/builder/builder.ts.tpl +1 -1
  583. package/templates/command/handler.declared.ts.tpl +12 -7
  584. package/templates/command/handler.spec.buses.ts.tpl +4 -4
  585. package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
  586. package/templates/command/handler.ts.tpl +9 -4
  587. package/templates/command/wiring.manual.tpl +2 -2
  588. package/templates/command/wiring.tsyringe.tpl +3 -3
  589. package/templates/context/module.manual.ts.tpl +1 -1
  590. package/templates/context/permission-set.tpl +1 -1
  591. package/templates/context/permissions.spec.ts.tpl +1 -1
  592. package/templates/context/routes.spec.ts.tpl +1 -1
  593. package/templates/context/wiring.declared.tpl +2 -2
  594. package/templates/context/wiring.manual.tpl +1 -1
  595. package/templates/context/wiring.tsyringe.tpl +2 -2
  596. package/templates/docs/openapi.json.tpl +5 -0
  597. package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
  598. package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
  599. package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
  600. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  601. package/templates/entity/entity.spec.ts.tpl +1 -1
  602. package/templates/entity/entity.ts.tpl +5 -0
  603. package/templates/error/case.spec.ts.tpl +8 -0
  604. package/templates/error/concept-error.spec.ts.tpl +7 -0
  605. package/templates/error/concept-error.ts.tpl +5 -0
  606. package/templates/error/factory.ts.tpl +4 -0
  607. package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
  608. package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
  609. package/templates/event-handler/event-handler.ts.tpl +1 -1
  610. package/templates/event-handler/wiring.manual.tpl +2 -2
  611. package/templates/event-handler/wiring.tsyringe.tpl +2 -2
  612. package/templates/gateway/adapter.declared.ts.tpl +3 -3
  613. package/templates/gateway/adapter.ts.tpl +2 -2
  614. package/templates/gateway/contract.spec.ts.tpl +3 -3
  615. package/templates/gateway/fake.ts.tpl +1 -1
  616. package/templates/gateway/platform-test.declared.tpl +1 -1
  617. package/templates/gateway/platform.declared.tpl +1 -1
  618. package/templates/gateway/wiring.tsyringe.tpl +3 -3
  619. package/templates/init/CLAUDE.md.tpl +5 -2
  620. package/templates/init/README.md.tpl +15 -10
  621. package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
  622. package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
  623. package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
  624. package/templates/init/e2e/start-application.database.ts.tpl +16 -16
  625. package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
  626. package/templates/init/e2e/test-environment.ts.tpl +1 -1
  627. package/templates/init/jest.config.js.tpl +7 -0
  628. package/templates/init/main.ts.tpl +11 -11
  629. package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
  630. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
  631. package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
  632. package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
  633. package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
  634. package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
  635. package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
  636. package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
  637. package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
  638. package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
  639. package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
  640. package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
  641. package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
  642. package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
  643. package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
  644. package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
  645. package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
  646. package/templates/init/platform/auth/permissions.ts.tpl +1 -1
  647. package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
  648. package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
  649. package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
  650. package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
  651. package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
  652. package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
  653. package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
  654. package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
  655. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  656. package/templates/init/platform/config/load-config.ts.tpl +3 -3
  657. package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
  658. package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
  659. package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
  660. package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
  661. package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
  662. package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
  663. package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
  664. package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
  665. package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
  666. package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
  667. package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
  668. package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
  669. package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
  670. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
  671. package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
  672. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
  673. package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
  674. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
  675. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
  676. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
  677. package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
  678. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
  679. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
  680. package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
  681. package/templates/init/platform/errors.ts.tpl +1 -1
  682. package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
  683. package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
  684. package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
  685. package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
  686. package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
  687. package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
  688. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  689. package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
  690. package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
  691. package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
  692. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
  693. package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
  694. package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
  695. package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
  696. package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
  697. package/templates/init/platform/platform.manual.ts.tpl +3 -3
  698. package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
  699. package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
  700. package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
  701. package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
  702. package/templates/init/platform/tracing.ts.tpl +2 -2
  703. package/templates/init/rules/application.md.tpl +8 -2
  704. package/templates/init/rules/domain.md.tpl +11 -0
  705. package/templates/init/rules/infrastructure.md.tpl +3 -3
  706. package/templates/init/rules/presentation.md.tpl +5 -0
  707. package/templates/init/scripts/openapi.ts.tpl +5 -5
  708. package/templates/integration-event/audited.tpl +1 -1
  709. package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
  710. package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
  711. package/templates/integration-event/publisher.declared.ts.tpl +4 -4
  712. package/templates/integration-event/publisher.spec.ts.tpl +2 -2
  713. package/templates/integration-event/publisher.ts.tpl +2 -2
  714. package/templates/integration-event/wiring.manual.tpl +2 -2
  715. package/templates/integration-event/wiring.tsyringe.tpl +2 -2
  716. package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
  717. package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
  718. package/templates/integration-handler/integration-handler.ts.tpl +1 -1
  719. package/templates/integration-handler/wiring.manual.tpl +3 -3
  720. package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
  721. package/templates/job/job.declared.ts.tpl +3 -3
  722. package/templates/job/job.spec.buses.ts.tpl +2 -2
  723. package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
  724. package/templates/job/job.ts.tpl +1 -1
  725. package/templates/job/wiring.manual.tpl +1 -1
  726. package/templates/job/wiring.tsyringe.tpl +1 -1
  727. package/templates/pipeline/package-scripts.json +1 -1
  728. package/templates/policy/policy.declared.ts.tpl +1 -1
  729. package/templates/policy/policy.spec.declared.ts.tpl +1 -1
  730. package/templates/policy/policy.spec.ts.tpl +1 -1
  731. package/templates/policy/policy.ts.tpl +1 -1
  732. package/templates/policy/registration.tpl +1 -1
  733. package/templates/port/fake.ts.tpl +1 -1
  734. package/templates/projection/projection.spec.ts.tpl +17 -0
  735. package/templates/projection/projection.ts.tpl +11 -0
  736. package/templates/query/handler.declared.ts.tpl +4 -4
  737. package/templates/query/handler.spec.buses.ts.tpl +5 -5
  738. package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
  739. package/templates/query/handler.ts.tpl +3 -3
  740. package/templates/query/query.ts.tpl +1 -1
  741. package/templates/query/reader.fake.ts.tpl +2 -2
  742. package/templates/query/reader.in-memory.ts.tpl +4 -4
  743. package/templates/query/reader.port.ts.tpl +2 -2
  744. package/templates/query/search.handler.declared.ts.tpl +6 -6
  745. package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
  746. package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
  747. package/templates/query/search.handler.ts.tpl +4 -4
  748. package/templates/query/search.query.ts.tpl +1 -1
  749. package/templates/query/search.reader.fake.ts.tpl +2 -2
  750. package/templates/query/search.reader.in-memory.ts.tpl +3 -3
  751. package/templates/query/search.reader.port.ts.tpl +1 -1
  752. package/templates/query/search.reader.spec.ts.tpl +2 -2
  753. package/templates/query/search.wiring.manual.tpl +3 -3
  754. package/templates/query/search.wiring.tsyringe.tpl +4 -4
  755. package/templates/query/wiring.manual.tpl +3 -3
  756. package/templates/query/wiring.tsyringe.tpl +4 -4
  757. package/templates/repository/contract.spec.ts.tpl +5 -5
  758. package/templates/repository/drizzle/mapper.ts.tpl +2 -2
  759. package/templates/repository/drizzle/repository.ts.tpl +9 -17
  760. package/templates/repository/drizzle/schema-export.tpl +1 -1
  761. package/templates/repository/fake.ts.tpl +2 -2
  762. package/templates/repository/knex/mapper.ts.tpl +2 -2
  763. package/templates/repository/knex/repository.ts.tpl +10 -30
  764. package/templates/repository/knex/schema-export.tpl +1 -1
  765. package/templates/repository/knex/tables.ts.tpl +1 -1
  766. package/templates/repository/none/repository.ts.tpl +3 -3
  767. package/templates/repository/prisma/mapper.ts.tpl +2 -2
  768. package/templates/repository/prisma/repository.ts.tpl +6 -9
  769. package/templates/repository/repository.ts.tpl +1 -1
  770. package/templates/repository/typeorm/mapper.ts.tpl +2 -2
  771. package/templates/repository/typeorm/repository.ts.tpl +9 -12
  772. package/templates/repository/typeorm/schema-export.tpl +1 -1
  773. package/templates/repository/typeorm/table.tpl +1 -1
  774. package/templates/repository/wiring.manual.tpl +1 -1
  775. package/templates/repository/wiring.tsyringe.tpl +2 -2
  776. package/templates/route/route.class-validator.ts.tpl +1 -1
  777. package/templates/route/route.none.ts.tpl +1 -1
  778. package/templates/route/route.search.ts.tpl +2 -2
  779. package/templates/route/route.spec.ts.tpl +1 -1
  780. package/templates/route/route.standard-schema.ts.tpl +1 -1
  781. package/templates/route/route.zod.ts.tpl +1 -1
  782. package/templates/route/routes.on-tsyringe.tpl +1 -1
  783. package/templates/route/wiring.manual.tpl +1 -1
  784. package/templates/service/main.ts.tpl +11 -11
  785. package/templates/value-object/value-object.spec.ts.tpl +1 -1
  786. package/templates/value-object/value-object.ts.tpl +5 -0
  787. package/templates/worker/main.ts.tpl +9 -9
  788. package/dist/alias/platform-alias.d.ts +0 -4
  789. package/dist/alias/platform-alias.d.ts.map +0 -1
  790. package/dist/alias/platform-alias.js +0 -7
  791. package/dist/alias/platform-alias.js.map +0 -1
@@ -0,0 +1,47 @@
1
+ const EXPORT = /^export \* from '(.+)';$/;
2
+ const CALL = /(?<![\w$.])injected\(\s*([\w$]+)\s*,\s*\[([^\]]*)\]\s*,?\s*\)/g;
3
+ /**
4
+ * The first thing that tells a generated file of a context from what its tree says, in words:
5
+ * a role file it does not export, or the class whose dependency list no longer is what its
6
+ * constructor takes.
7
+ */
8
+ export function generatedDrift(written, expected) {
9
+ return (exportDrift(written, expected) ?? listDrift(written, expected) ?? 'it is not laid out as the generator writes it');
10
+ }
11
+ function exportDrift(written, expected) {
12
+ const exportsOf = (text) => text.split('\n').flatMap((line) => EXPORT.exec(line)?.[1] ?? []);
13
+ const missing = exportsOf(expected).find((specifier) => !exportsOf(written).includes(specifier));
14
+ if (missing !== undefined) {
15
+ return `it does not export ${missing}, so the class declared there is registered nowhere`;
16
+ }
17
+ const extra = exportsOf(written).find((specifier) => !exportsOf(expected).includes(specifier));
18
+ return extra === undefined ? undefined : `it exports ${extra}, which is not a role file of the context`;
19
+ }
20
+ function listDrift(written, expected) {
21
+ const [known, wanted] = [listsOf(written), listsOf(expected)];
22
+ for (const [className, tokens] of wanted) {
23
+ const registered = known.get(className);
24
+ if (registered === undefined) {
25
+ return `it registers no dependency list for ${className}, whose constructor takes [${tokens}]`;
26
+ }
27
+ if (registered !== tokens) {
28
+ return `the dependency list of ${className} is stale: its constructor takes [${tokens}] and the file says [${registered}]`;
29
+ }
30
+ }
31
+ const [gone] = [...known.keys()].filter((className) => !wanted.has(className));
32
+ return gone === undefined
33
+ ? undefined
34
+ : `it registers a dependency list for ${gone}, whose constructor takes nothing the generator reads any more`;
35
+ }
36
+ /** The token names each `injected(Class, [..])` of a generated file registers, by class. */
37
+ function listsOf(text) {
38
+ return new Map([...text.matchAll(CALL)].map(([, className = '', tokens = '']) => [
39
+ className,
40
+ tokens
41
+ .split(',')
42
+ .map((token) => token.trim())
43
+ .filter((token) => token !== '')
44
+ .join(', '),
45
+ ]));
46
+ }
47
+ //# sourceMappingURL=generated-drift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-drift.js","sourceRoot":"","sources":["../../src/declared/generated-drift.ts"],"names":[],"mappings":"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"}
@@ -1,6 +1,13 @@
1
1
  export { barrelFile } from './barrel-file.js';
2
- export { DECLARATION_DECORATORS, DECLARED_ROLES, DISCOVERED_SUFFIXES, type DeclaredRole } from './declared-role.js';
2
+ export { DECLARED_ROLES, DISCOVERED_SUFFIXES, type DeclaredRole } from './declared-role.js';
3
3
  export { declaredRoleOf } from './declared-role-of.js';
4
+ export { dependenciesFile } from './dependencies-file.js';
5
+ export { generatedDrift } from './generated-drift.js';
6
+ export type { ClassInjection } from './injection/class-injection.js';
7
+ export { contextInjections } from './injection/context-injections.js';
8
+ export { renderInjections } from './injection/render-injections.js';
9
+ export type { Sources } from './injection/sources.js';
4
10
  export { renderBarrel } from './render-barrel.js';
11
+ export { renderDependenciesFile } from './render-dependencies-file.js';
5
12
  export { routesFile } from './routes-file.js';
6
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/declared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/declared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,6 +1,11 @@
1
1
  export { barrelFile } from './barrel-file.js';
2
- export { DECLARATION_DECORATORS, DECLARED_ROLES, DISCOVERED_SUFFIXES } from './declared-role.js';
2
+ export { DECLARED_ROLES, DISCOVERED_SUFFIXES } from './declared-role.js';
3
3
  export { declaredRoleOf } from './declared-role-of.js';
4
+ export { dependenciesFile } from './dependencies-file.js';
5
+ export { generatedDrift } from './generated-drift.js';
6
+ export { contextInjections } from './injection/context-injections.js';
7
+ export { renderInjections } from './injection/render-injections.js';
4
8
  export { renderBarrel } from './render-barrel.js';
9
+ export { renderDependenciesFile } from './render-dependencies-file.js';
5
10
  export { routesFile } from './routes-file.js';
6
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/declared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,mBAAmB,EAAqB,MAAM,oBAAoB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/declared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAqB,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Finding } from '../../check/model/finding.js';
2
+ import type { TokenReference } from './token-reference.js';
3
+ /** What a declared class is given, read from its source: the list of its decorator, and its constructor. */
4
+ export interface ClassInjection {
5
+ readonly className: string;
6
+ /** The role file that declares the class, from the project root. */
7
+ readonly file: string;
8
+ /** Line of the declaration decorator. */
9
+ readonly line: number;
10
+ /** The names the decorator lists, when it carries a list: that list then wins over the signature. */
11
+ readonly listed: readonly string[] | undefined;
12
+ /** One token per constructor parameter, in order; undefined when the constructor could not be read as tokens. */
13
+ readonly dependencies: readonly TokenReference[] | undefined;
14
+ /** Why the constructor does not state the dependencies, each with the fix. */
15
+ readonly problems: readonly Finding[];
16
+ /** False when the class inherits its constructor from a class this project cannot read. */
17
+ readonly readable: boolean;
18
+ }
19
+ //# sourceMappingURL=class-injection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-injection.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/class-injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,4GAA4G;AAC5G,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/C,iHAAiH;IACjH,QAAQ,CAAC,YAAY,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAC;IAC7D,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=class-injection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-injection.js","sourceRoot":"","sources":["../../../src/declared/injection/class-injection.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import type { SourceFile } from '../../check/model/source-file.js';
2
+ import type { ReadConstructor } from './read-constructor.js';
3
+ import type { Sources } from './sources.js';
4
+ interface Lookup {
5
+ readonly sources: Sources;
6
+ readonly file: SourceFile;
7
+ readonly className: string;
8
+ }
9
+ /**
10
+ * The constructor of the class `className` of `file`: the one it writes, or the one of the
11
+ * class it extends, followed through the imports as far as the project goes. Undefined when the
12
+ * chain leaves the project (a base class of a package): nothing here can read that constructor.
13
+ */
14
+ export declare function constructorOf(lookup: Lookup, depth?: number): ReadConstructor | undefined;
15
+ export {};
16
+ //# sourceMappingURL=constructor-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constructor-of.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/constructor-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,UAAU,MAAM;IACd,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,eAAe,GAAG,SAAS,CAqBpF"}
@@ -0,0 +1,33 @@
1
+ import { importedFrom } from '../../check/support/imported-from.js';
2
+ import { exportedNameOf } from './exported-name-of.js';
3
+ const DEEPEST = 8;
4
+ /**
5
+ * The constructor of the class `className` of `file`: the one it writes, or the one of the
6
+ * class it extends, followed through the imports as far as the project goes. Undefined when the
7
+ * chain leaves the project (a base class of a package): nothing here can read that constructor.
8
+ */
9
+ export function constructorOf(lookup, depth = 0) {
10
+ const { file, className } = lookup;
11
+ const shape = file.structure.classes.find((candidate) => candidate.name === className && candidate.depth === 0);
12
+ if (shape === undefined || depth > DEEPEST) {
13
+ return undefined;
14
+ }
15
+ const own = shape.methods.find((method) => method.isConstructor);
16
+ if (own !== undefined) {
17
+ return { file, line: own.line, parameters: own.parameters };
18
+ }
19
+ if (shape.superclass === undefined) {
20
+ return { file, line: shape.line, parameters: [] };
21
+ }
22
+ const base = baseOf(lookup, shape.superclass);
23
+ return base === undefined ? undefined : constructorOf(base, depth + 1);
24
+ }
25
+ function baseOf({ sources, file }, superclass) {
26
+ const target = importedFrom(file, superclass)?.target;
27
+ if (target === undefined) {
28
+ return { sources, file, className: superclass };
29
+ }
30
+ const source = target.kind === 'file' ? sources(target.path) : undefined;
31
+ return source === undefined ? undefined : { sources, file: source, className: exportedNameOf(file, superclass) };
32
+ }
33
+ //# sourceMappingURL=constructor-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constructor-of.js","sourceRoot":"","sources":["../../../src/declared/injection/constructor-of.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAUvD,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,KAAK,GAAG,CAAC;IACrD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;IAEhH,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,OAAO,EAAE,CAAC;QAC3C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEjE,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;IAC9D,CAAC;IAED,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;IACpD,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAE9C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,SAAS,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAU,EAAE,UAAkB;IAC3D,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAEtD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IAClD,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEzE,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;AACnH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ClassInjection } from './class-injection.js';
2
+ import type { Sources } from './sources.js';
3
+ /**
4
+ * What every declared class of a context is given, in the order of its role files.
5
+ * `directory` is the context from the project root, `entries` its files relative to it.
6
+ */
7
+ export declare function contextInjections(sources: Sources, directory: string, entries: readonly string[]): ClassInjection[];
8
+ //# sourceMappingURL=context-injections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-injections.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/context-injections.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,EAAE,CAMnH"}
@@ -0,0 +1,14 @@
1
+ import { declaredRoleOf } from '../declared-role-of.js';
2
+ import { readInjections } from './read-injections.js';
3
+ /**
4
+ * What every declared class of a context is given, in the order of its role files.
5
+ * `directory` is the context from the project root, `entries` its files relative to it.
6
+ */
7
+ export function contextInjections(sources, directory, entries) {
8
+ return [...new Set(entries)]
9
+ .filter((entry) => declaredRoleOf(entry) !== undefined)
10
+ .sort()
11
+ .flatMap((entry) => sources(`${directory}/${entry}`) ?? [])
12
+ .flatMap((file) => readInjections(sources, file));
13
+ }
14
+ //# sourceMappingURL=context-injections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-injections.js","sourceRoot":"","sources":["../../../src/declared/injection/context-injections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,SAAiB,EAAE,OAA0B;IAC/F,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;SACzB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;SACtD,IAAI,EAAE;SACN,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;SAC1D,OAAO,CAAC,CAAC,IAAgB,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { SourceFile } from '../../check/model/source-file.js';
2
+ export interface DeclaredKind {
3
+ readonly kind: 'class' | 'interface' | 'type' | 'enum' | 'const' | 'function';
4
+ readonly exported: boolean;
5
+ }
6
+ /** What `file` declares under `name` at its top level, or undefined when it declares nothing by that name. */
7
+ export declare function declaredKindOf(file: SourceFile, name: string): DeclaredKind | undefined;
8
+ //# sourceMappingURL=declared-kind-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declared-kind-of.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/declared-kind-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAGnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC9E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,8GAA8G;AAC9G,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CASvF"}
@@ -0,0 +1,12 @@
1
+ import { escapeRegExp } from '../../check/text/escape-reg-exp.js';
2
+ /** What `file` declares under `name` at its top level, or undefined when it declares nothing by that name. */
3
+ export function declaredKindOf(file, name) {
4
+ const declaration = new RegExp(`(?<![\\w$.])(export\\s+)?(?:default\\s+)?(?:declare\\s+)?(?:abstract\\s+)?(class|interface|type|enum|const|function)\\s+${escapeRegExp(name)}(?![\\w$])`);
5
+ const match = declaration.exec(file.scan.code);
6
+ const kind = match?.[2];
7
+ return isKind(kind) ? { kind, exported: match?.[1] !== undefined } : undefined;
8
+ }
9
+ function isKind(value) {
10
+ return value !== undefined && ['class', 'interface', 'type', 'enum', 'const', 'function'].includes(value);
11
+ }
12
+ //# sourceMappingURL=declared-kind-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declared-kind-of.js","sourceRoot":"","sources":["../../../src/declared/injection/declared-kind-of.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAOlE,8GAA8G;AAC9G,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,IAAY;IAC3D,MAAM,WAAW,GAAG,IAAI,MAAM,CAC5B,2HAA2H,YAAY,CAAC,IAAI,CAAC,YAAY,CAC1J,CAAC;IAEF,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC;AAED,SAAS,MAAM,CAAC,KAAyB;IACvC,OAAO,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SourceFile } from '../../check/model/source-file.js';
2
+ /** The name a class is exported under by the module `file` imports it from: `Clock` for `import { Clock as Time }`. */
3
+ export declare function exportedNameOf(file: SourceFile, local: string): string;
4
+ //# sourceMappingURL=exported-name-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exported-name-of.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/exported-name-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAInE,uHAAuH;AACvH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAetE"}
@@ -0,0 +1,17 @@
1
+ const NAMED_IMPORTS = /(?<![\w$.])import\s+(?:type\s+)?(?:[\w$]+\s*,\s*)?\{([^}]*)\}/g;
2
+ /** The name a class is exported under by the module `file` imports it from: `Clock` for `import { Clock as Time }`. */
3
+ export function exportedNameOf(file, local) {
4
+ for (const [, names = ''] of file.scan.code.matchAll(NAMED_IMPORTS)) {
5
+ for (const binding of names.split(',')) {
6
+ const [exported, renamed] = binding
7
+ .trim()
8
+ .replace(/^type\s+/, '')
9
+ .split(/\s+as\s+/);
10
+ if (renamed === local && exported !== undefined) {
11
+ return exported;
12
+ }
13
+ }
14
+ }
15
+ return local;
16
+ }
17
+ //# sourceMappingURL=exported-name-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exported-name-of.js","sourceRoot":"","sources":["../../../src/declared/injection/exported-name-of.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,gEAAgE,CAAC;AAEvF,uHAAuH;AACvH,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,KAAa;IAC5D,KAAK,MAAM,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACpE,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,OAAO;iBAChC,IAAI,EAAE;iBACN,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;iBACvB,KAAK,CAAC,UAAU,CAAC,CAAC;YAErB,IAAI,OAAO,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAChD,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Types of the language and of its standard library: they exist for every program, so they name no dependency of one. */
2
+ export declare const LANGUAGE_TYPES: readonly string[];
3
+ //# sourceMappingURL=language-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-types.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/language-types.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EA6B3C,CAAC"}
@@ -0,0 +1,32 @@
1
+ /** Types of the language and of its standard library: they exist for every program, so they name no dependency of one. */
2
+ export const LANGUAGE_TYPES = [
3
+ 'string',
4
+ 'number',
5
+ 'boolean',
6
+ 'bigint',
7
+ 'symbol',
8
+ 'object',
9
+ 'unknown',
10
+ 'any',
11
+ 'never',
12
+ 'void',
13
+ 'undefined',
14
+ 'null',
15
+ 'Date',
16
+ 'Map',
17
+ 'Set',
18
+ 'Array',
19
+ 'ReadonlyArray',
20
+ 'Record',
21
+ 'Promise',
22
+ 'Function',
23
+ 'RegExp',
24
+ 'Error',
25
+ 'URL',
26
+ 'Buffer',
27
+ 'Partial',
28
+ 'Readonly',
29
+ 'Pick',
30
+ 'Omit',
31
+ ];
32
+ //# sourceMappingURL=language-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-types.js","sourceRoot":"","sources":["../../../src/declared/injection/language-types.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,KAAK;IACL,OAAO;IACP,MAAM;IACN,WAAW;IACX,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,eAAe;IACf,QAAQ;IACR,SAAS;IACT,UAAU;IACV,QAAQ;IACR,OAAO;IACP,KAAK;IACL,QAAQ;IACR,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;CACP,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { TokenReference } from './token-reference.js';
2
+ /**
3
+ * The names a generated file binds its imports under. A class keeps its own name; a second
4
+ * class of the same name, exported by another module, is bound as `Name_2`, so that two ports
5
+ * called alike in two contexts never collide.
6
+ */
7
+ export declare class LocalNames {
8
+ private readonly specifierOf;
9
+ private readonly byOrigin;
10
+ private readonly taken;
11
+ constructor(specifierOf: (reference: TokenReference) => string);
12
+ of(reference: TokenReference): string;
13
+ /** Every binding, grouped by the specifier it is imported from. */
14
+ bySpecifier(): Map<string, string[]>;
15
+ private free;
16
+ }
17
+ //# sourceMappingURL=local-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-names.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/local-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,UAAU;IAKT,OAAO,CAAC,QAAQ,CAAC,WAAW;IAJxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAE3C,YAA6B,WAAW,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,MAAM,EAAI;IAEnF,EAAE,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAcpC;IAED,mEAAmE;IACnE,WAAW,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAUnC;IAED,OAAO,CAAC,IAAI;CASb"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The names a generated file binds its imports under. A class keeps its own name; a second
3
+ * class of the same name, exported by another module, is bound as `Name_2`, so that two ports
4
+ * called alike in two contexts never collide.
5
+ */
6
+ export class LocalNames {
7
+ specifierOf;
8
+ byOrigin = new Map();
9
+ taken = new Set();
10
+ constructor(specifierOf) {
11
+ this.specifierOf = specifierOf;
12
+ }
13
+ of(reference) {
14
+ const origin = `${this.specifierOf(reference)}#${reference.name}`;
15
+ const known = this.byOrigin.get(origin);
16
+ if (known !== undefined) {
17
+ return known;
18
+ }
19
+ const local = this.free(reference.name);
20
+ this.byOrigin.set(origin, local);
21
+ this.taken.add(local);
22
+ return local;
23
+ }
24
+ /** Every binding, grouped by the specifier it is imported from. */
25
+ bySpecifier() {
26
+ const grouped = new Map();
27
+ for (const [origin, local] of this.byOrigin) {
28
+ const [specifier = '', name = ''] = origin.split('#');
29
+ grouped.set(specifier, [...(grouped.get(specifier) ?? []), name === local ? name : `${name} as ${local}`]);
30
+ }
31
+ return grouped;
32
+ }
33
+ free(name) {
34
+ let local = name;
35
+ for (let rank = 2; this.taken.has(local); rank += 1) {
36
+ local = `${name}_${rank}`;
37
+ }
38
+ return local;
39
+ }
40
+ }
41
+ //# sourceMappingURL=local-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-names.js","sourceRoot":"","sources":["../../../src/declared/injection/local-names.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,UAAU;IAKQ,WAAW;IAJvB,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAErC,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAE3C,YAA6B,WAAkD;2BAAlD,WAAW;IAA0C,CAAC;IAEnF,EAAE,CAAC,SAAyB;QAC1B,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;QAClE,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,mEAAmE;IACnE,WAAW;QACT,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;QAE5C,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5C,MAAM,CAAC,SAAS,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEtD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;QAC7G,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,IAAI,CAAC,IAAY;QACvB,IAAI,KAAK,GAAG,IAAI,CAAC;QAEjB,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;YACpD,KAAK,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ /** A constructor parameter, read as text: its name, the type it is annotated with, and what makes it more than that. */
2
+ export interface ParameterShape {
3
+ readonly name: string;
4
+ /** The annotation, trimmed; undefined when the parameter has none. */
5
+ readonly type: string | undefined;
6
+ /** What keeps the parameter from naming one dependency: a rest, a destructuring, a `?` or a default value. */
7
+ readonly oddity: string | undefined;
8
+ }
9
+ /** Reads `private readonly clock: Clock`, whatever decorators and modifiers come first. */
10
+ export declare function parameterShape(parameter: string): ParameterShape;
11
+ //# sourceMappingURL=parameter-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-shape.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/parameter-shape.ts"],"names":[],"mappings":"AAEA,wHAAwH;AACxH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,8GAA8G;IAC9G,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAMD,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAYhE"}
@@ -0,0 +1,58 @@
1
+ import { matchingBracket } from '../../check/text/matching-bracket.js';
2
+ const DECORATOR = /^@[\w$.]+\s*/;
3
+ const MODIFIERS = /^(?:(?:public|private|protected|readonly|override)\s+)*/;
4
+ const NAME = /^([A-Za-z_$][\w$]*)\s*(\?)?\s*(?::([\s\S]*))?$/;
5
+ /** Reads `private readonly clock: Clock`, whatever decorators and modifiers come first. */
6
+ export function parameterShape(parameter) {
7
+ const text = withoutDecorators(parameter.trim()).replace(MODIFIERS, '');
8
+ const unnamed = unnamedShape(text);
9
+ if (unnamed !== undefined) {
10
+ return unnamed;
11
+ }
12
+ const assigned = defaultAt(text);
13
+ const [, name = text, optional, type] = NAME.exec(assigned === -1 ? text : text.slice(0, assigned).trim()) ?? [];
14
+ return { name, type: type?.trim(), oddity: oddityOf(optional !== undefined, assigned !== -1) };
15
+ }
16
+ /** A rest parameter or a destructuring: neither is one named value typed by one class. */
17
+ function unnamedShape(text) {
18
+ if (text.startsWith('...')) {
19
+ const [name = ''] = text.replace(/^\.\.\.\s*/, '').split(/[\s:]/);
20
+ return { name, type: undefined, oddity: 'is a rest parameter' };
21
+ }
22
+ if (text.startsWith('{') || text.startsWith('[')) {
23
+ return { name: text.split(':')[0]?.trim() ?? text, type: undefined, oddity: 'is destructured' };
24
+ }
25
+ return undefined;
26
+ }
27
+ function oddityOf(optional, defaulted) {
28
+ if (defaulted) {
29
+ return 'has a default value';
30
+ }
31
+ return optional ? 'is optional' : undefined;
32
+ }
33
+ function withoutDecorators(text) {
34
+ let rest = text;
35
+ for (let name = DECORATOR.exec(rest); name !== null; name = DECORATOR.exec(rest)) {
36
+ const called = rest.charAt(name[0].length) === '(';
37
+ rest = rest.slice(called ? matchingBracket(rest, name[0].length) + 1 : name[0].length).trimStart();
38
+ }
39
+ return rest;
40
+ }
41
+ /** Offset of the `=` that gives the parameter a default value, or -1: the `=` of `=>`, `==`, `<=` and `>=` are not one. */
42
+ function defaultAt(text) {
43
+ let depth = 0;
44
+ for (let at = 0; at < text.length; at += 1) {
45
+ const char = text.charAt(at);
46
+ if ('([{'.includes(char)) {
47
+ depth += 1;
48
+ }
49
+ else if (')]}'.includes(char)) {
50
+ depth -= 1;
51
+ }
52
+ else if (char === '=' && depth === 0 && text.charAt(at + 1) !== '>' && !'=!<>'.includes(text.charAt(at - 1))) {
53
+ return at;
54
+ }
55
+ }
56
+ return -1;
57
+ }
58
+ //# sourceMappingURL=parameter-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-shape.js","sourceRoot":"","sources":["../../../src/declared/injection/parameter-shape.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The class a type annotation names when it names exactly one: `Clock`, or `Cache` for
3
+ * `Cache<Session>`, whose type arguments say nothing of the token. Undefined for a union, an
4
+ * intersection, an array, a function, a literal, an object type or a qualified name.
5
+ */
6
+ export declare function rawClassName(type: string): string | undefined;
7
+ //# sourceMappingURL=raw-class-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-class-name.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/raw-class-name.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ7D"}
@@ -0,0 +1,28 @@
1
+ const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
2
+ const GENERIC = /^([A-Za-z_$][\w$]*)\s*</;
3
+ /**
4
+ * The class a type annotation names when it names exactly one: `Clock`, or `Cache` for
5
+ * `Cache<Session>`, whose type arguments say nothing of the token. Undefined for a union, an
6
+ * intersection, an array, a function, a literal, an object type or a qualified name.
7
+ */
8
+ export function rawClassName(type) {
9
+ if (IDENTIFIER.test(type)) {
10
+ return type;
11
+ }
12
+ const name = GENERIC.exec(type)?.[1];
13
+ return name !== undefined && closesAtTheEnd(type, type.indexOf('<')) ? name : undefined;
14
+ }
15
+ function closesAtTheEnd(type, open) {
16
+ let depth = 0;
17
+ for (let at = open; at < type.length; at += 1) {
18
+ const char = type.charAt(at);
19
+ if (char === '<') {
20
+ depth += 1;
21
+ }
22
+ else if (char === '>' && type.charAt(at - 1) !== '=' && (depth -= 1) === 0) {
23
+ return at === type.length - 1;
24
+ }
25
+ }
26
+ return false;
27
+ }
28
+ //# sourceMappingURL=raw-class-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-class-name.js","sourceRoot":"","sources":["../../../src/declared/injection/raw-class-name.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,oBAAoB,CAAC;AACxC,MAAM,OAAO,GAAG,yBAAyB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAErC,OAAO,IAAI,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1F,CAAC;AAED,SAAS,cAAc,CAAC,IAAY,EAAE,IAAY;IAChD,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAE7B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7E,OAAO,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { SourceFile } from '../../check/model/source-file.js';
2
+ /** The constructor a class is built by: its own, or the nearest one it inherits inside the project. */
3
+ export interface ReadConstructor {
4
+ /** The source that writes it: its parameter types are resolved through the imports of that file. */
5
+ readonly file: SourceFile;
6
+ readonly line: number;
7
+ /** The blanked text of each parameter. */
8
+ readonly parameters: readonly string[];
9
+ }
10
+ //# sourceMappingURL=read-constructor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-constructor.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/read-constructor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE,uGAAuG;AACvG,MAAM,WAAW,eAAe;IAC9B,oGAAoG;IACpG,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=read-constructor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-constructor.js","sourceRoot":"","sources":["../../../src/declared/injection/read-constructor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { SourceFile } from '../../check/model/source-file.js';
2
+ import type { ClassInjection } from './class-injection.js';
3
+ import type { Sources } from './sources.js';
4
+ /** What each declared class of a role file is given: the list of its decorator, and what its constructor says. */
5
+ export declare function readInjections(sources: Sources, file: SourceFile): ClassInjection[];
6
+ //# sourceMappingURL=read-injections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-injections.d.ts","sourceRoot":"","sources":["../../../src/declared/injection/read-injections.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAO3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAY5C,kHAAkH;AAClH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,cAAc,EAAE,CAiBnF"}