ddd-ts-kit 0.2.0 → 0.4.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 (437) hide show
  1. package/README.md +99 -3
  2. package/dist/check/canonical/roles.d.ts.map +1 -1
  3. package/dist/check/canonical/roles.js +18 -1
  4. package/dist/check/canonical/roles.js.map +1 -1
  5. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  6. package/dist/check/catalogue/architecture-rules.js +4 -0
  7. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  8. package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
  9. package/dist/check/catalogue/eslint-only-rules.js +24 -0
  10. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  11. package/dist/check/declarations/classes-of.d.ts +2 -2
  12. package/dist/check/declarations/classes-of.js +4 -6
  13. package/dist/check/declarations/classes-of.js.map +1 -1
  14. package/dist/check/errors/builds-through-factories.d.ts +4 -0
  15. package/dist/check/errors/builds-through-factories.d.ts.map +1 -0
  16. package/dist/check/errors/builds-through-factories.js +5 -0
  17. package/dist/check/errors/builds-through-factories.js.map +1 -0
  18. package/dist/check/errors/error-code.d.ts +6 -0
  19. package/dist/check/errors/error-code.d.ts.map +1 -0
  20. package/dist/check/errors/error-code.js +2 -0
  21. package/dist/check/errors/error-code.js.map +1 -0
  22. package/dist/check/errors/error-codes.d.ts +8 -0
  23. package/dist/check/errors/error-codes.d.ts.map +1 -0
  24. package/dist/check/errors/error-codes.js +21 -0
  25. package/dist/check/errors/error-codes.js.map +1 -0
  26. package/dist/check/errors/kit-error-codes.d.ts +3 -0
  27. package/dist/check/errors/kit-error-codes.d.ts.map +1 -0
  28. package/dist/check/errors/kit-error-codes.js +17 -0
  29. package/dist/check/errors/kit-error-codes.js.map +1 -0
  30. package/dist/check/explain/errors-docs.d.ts +3 -0
  31. package/dist/check/explain/errors-docs.d.ts.map +1 -0
  32. package/dist/check/explain/errors-docs.js +30 -0
  33. package/dist/check/explain/errors-docs.js.map +1 -0
  34. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  35. package/dist/check/explain/rule-docs.js +2 -0
  36. package/dist/check/explain/rule-docs.js.map +1 -1
  37. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  38. package/dist/check/explain/tree-docs.js +3 -2
  39. package/dist/check/explain/tree-docs.js.map +1 -1
  40. package/dist/check/fixtures/authz-declared-fixtures.d.ts.map +1 -1
  41. package/dist/check/fixtures/authz-declared-fixtures.js +19 -0
  42. package/dist/check/fixtures/authz-declared-fixtures.js.map +1 -1
  43. package/dist/check/fixtures/errors-fixtures.d.ts +3 -0
  44. package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -0
  45. package/dist/check/fixtures/errors-fixtures.js +136 -0
  46. package/dist/check/fixtures/errors-fixtures.js.map +1 -0
  47. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  48. package/dist/check/fixtures/fixtures.js +2 -0
  49. package/dist/check/fixtures/fixtures.js.map +1 -1
  50. package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
  51. package/dist/check/fixtures/tree-fixtures.js +25 -3
  52. package/dist/check/fixtures/tree-fixtures.js.map +1 -1
  53. package/dist/check/rules/authz-declared.d.ts.map +1 -1
  54. package/dist/check/rules/authz-declared.js +24 -0
  55. package/dist/check/rules/authz-declared.js.map +1 -1
  56. package/dist/check/rules/declarations-role-declared.js +1 -1
  57. package/dist/check/rules/declarations-role-declared.js.map +1 -1
  58. package/dist/check/rules/errors-code-unique.d.ts +3 -0
  59. package/dist/check/rules/errors-code-unique.d.ts.map +1 -0
  60. package/dist/check/rules/errors-code-unique.js +34 -0
  61. package/dist/check/rules/errors-code-unique.js.map +1 -0
  62. package/dist/check/rules/errors-known-code.d.ts +3 -0
  63. package/dist/check/rules/errors-known-code.d.ts.map +1 -0
  64. package/dist/check/rules/errors-known-code.js +51 -0
  65. package/dist/check/rules/errors-known-code.js.map +1 -0
  66. package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
  67. package/dist/check/rules/language-glossary-term.js +7 -5
  68. package/dist/check/rules/language-glossary-term.js.map +1 -1
  69. package/dist/commands/controllers.d.ts +8 -0
  70. package/dist/commands/controllers.d.ts.map +1 -0
  71. package/dist/commands/controllers.js +57 -0
  72. package/dist/commands/controllers.js.map +1 -0
  73. package/dist/commands/error-factories.d.ts +7 -0
  74. package/dist/commands/error-factories.d.ts.map +1 -0
  75. package/dist/commands/error-factories.js +65 -0
  76. package/dist/commands/error-factories.js.map +1 -0
  77. package/dist/commands/generate.js +10 -0
  78. package/dist/commands/generate.js.map +1 -1
  79. package/dist/commands/init.d.ts.map +1 -1
  80. package/dist/commands/init.js +2 -0
  81. package/dist/commands/init.js.map +1 -1
  82. package/dist/config/index.d.ts +1 -1
  83. package/dist/config/index.d.ts.map +1 -1
  84. package/dist/config/index.js +1 -1
  85. package/dist/config/index.js.map +1 -1
  86. package/dist/config/parse-stack.d.ts.map +1 -1
  87. package/dist/config/parse-stack.js +3 -1
  88. package/dist/config/parse-stack.js.map +1 -1
  89. package/dist/config/stack.d.ts +18 -0
  90. package/dist/config/stack.d.ts.map +1 -1
  91. package/dist/config/stack.js +2 -0
  92. package/dist/config/stack.js.map +1 -1
  93. package/dist/controllers/entries-of.d.ts +3 -0
  94. package/dist/controllers/entries-of.d.ts.map +1 -0
  95. package/dist/controllers/entries-of.js +19 -0
  96. package/dist/controllers/entries-of.js.map +1 -0
  97. package/dist/controllers/finish-migration.d.ts +8 -0
  98. package/dist/controllers/finish-migration.d.ts.map +1 -0
  99. package/dist/controllers/finish-migration.js +71 -0
  100. package/dist/controllers/finish-migration.js.map +1 -0
  101. package/dist/controllers/function-route.d.ts +23 -0
  102. package/dist/controllers/function-route.d.ts.map +1 -0
  103. package/dist/controllers/function-route.js +2 -0
  104. package/dist/controllers/function-route.js.map +1 -0
  105. package/dist/controllers/handle-body.d.ts +8 -0
  106. package/dist/controllers/handle-body.d.ts.map +1 -0
  107. package/dist/controllers/handle-body.js +29 -0
  108. package/dist/controllers/handle-body.js.map +1 -0
  109. package/dist/controllers/handle-types-of.d.ts +15 -0
  110. package/dist/controllers/handle-types-of.d.ts.map +1 -0
  111. package/dist/controllers/handle-types-of.js +48 -0
  112. package/dist/controllers/handle-types-of.js.map +1 -0
  113. package/dist/controllers/migrate-context.d.ts +4 -0
  114. package/dist/controllers/migrate-context.d.ts.map +1 -0
  115. package/dist/controllers/migrate-context.js +74 -0
  116. package/dist/controllers/migrate-context.js.map +1 -0
  117. package/dist/controllers/migrated-group.d.ts +11 -0
  118. package/dist/controllers/migrated-group.d.ts.map +1 -0
  119. package/dist/controllers/migrated-group.js +2 -0
  120. package/dist/controllers/migrated-group.js.map +1 -0
  121. package/dist/controllers/migration.d.ts +16 -0
  122. package/dist/controllers/migration.d.ts.map +1 -0
  123. package/dist/controllers/migration.js +2 -0
  124. package/dist/controllers/migration.js.map +1 -0
  125. package/dist/controllers/plan-context.d.ts +22 -0
  126. package/dist/controllers/plan-context.d.ts.map +1 -0
  127. package/dist/controllers/plan-context.js +70 -0
  128. package/dist/controllers/plan-context.js.map +1 -0
  129. package/dist/controllers/read-function-route.d.ts +4 -0
  130. package/dist/controllers/read-function-route.d.ts.map +1 -0
  131. package/dist/controllers/read-function-route.js +37 -0
  132. package/dist/controllers/read-function-route.js.map +1 -0
  133. package/dist/controllers/render-controller.d.ts +15 -0
  134. package/dist/controllers/render-controller.d.ts.map +1 -0
  135. package/dist/controllers/render-controller.js +104 -0
  136. package/dist/controllers/render-controller.js.map +1 -0
  137. package/dist/declared/declared-role.d.ts +8 -2
  138. package/dist/declared/declared-role.d.ts.map +1 -1
  139. package/dist/declared/declared-role.js +17 -3
  140. package/dist/declared/declared-role.js.map +1 -1
  141. package/dist/declared/index.d.ts +1 -1
  142. package/dist/declared/index.d.ts.map +1 -1
  143. package/dist/declared/index.js +1 -1
  144. package/dist/declared/index.js.map +1 -1
  145. package/dist/depcruise/hygiene-rules.js +2 -1
  146. package/dist/depcruise/hygiene-rules.js.map +1 -1
  147. package/dist/describe/context-description.d.ts +17 -0
  148. package/dist/describe/context-description.d.ts.map +1 -1
  149. package/dist/describe/decorator-options.d.ts +3 -0
  150. package/dist/describe/decorator-options.d.ts.map +1 -0
  151. package/dist/describe/decorator-options.js +20 -0
  152. package/dist/describe/decorator-options.js.map +1 -0
  153. package/dist/describe/describe-context.d.ts.map +1 -1
  154. package/dist/describe/describe-context.js +2 -0
  155. package/dist/describe/describe-context.js.map +1 -1
  156. package/dist/describe/format-description.d.ts.map +1 -1
  157. package/dist/describe/format-description.js +9 -1
  158. package/dist/describe/format-description.js.map +1 -1
  159. package/dist/describe/listed-in.d.ts +3 -0
  160. package/dist/describe/listed-in.d.ts.map +1 -0
  161. package/dist/describe/listed-in.js +9 -0
  162. package/dist/describe/listed-in.js.map +1 -0
  163. package/dist/describe/read-controllers.d.ts +5 -0
  164. package/dist/describe/read-controllers.d.ts.map +1 -0
  165. package/dist/describe/read-controllers.js +98 -0
  166. package/dist/describe/read-controllers.js.map +1 -0
  167. package/dist/describe/read-errors.d.ts +8 -0
  168. package/dist/describe/read-errors.d.ts.map +1 -0
  169. package/dist/describe/read-errors.js +52 -0
  170. package/dist/describe/read-errors.js.map +1 -0
  171. package/dist/describe/read-route-groups.d.ts +5 -0
  172. package/dist/describe/read-route-groups.d.ts.map +1 -0
  173. package/dist/describe/read-route-groups.js +37 -0
  174. package/dist/describe/read-route-groups.js.map +1 -0
  175. package/dist/describe/read-routes.d.ts +4 -1
  176. package/dist/describe/read-routes.d.ts.map +1 -1
  177. package/dist/describe/read-routes.js +10 -4
  178. package/dist/describe/read-routes.js.map +1 -1
  179. package/dist/describe/reference-lines.js +27 -7
  180. package/dist/describe/reference-lines.js.map +1 -1
  181. package/dist/describe/route-group-fact.d.ts +11 -0
  182. package/dist/describe/route-group-fact.d.ts.map +1 -0
  183. package/dist/describe/route-group-fact.js +2 -0
  184. package/dist/describe/route-group-fact.js.map +1 -0
  185. package/dist/generate/errors/add-factory.d.ts +13 -0
  186. package/dist/generate/errors/add-factory.d.ts.map +1 -0
  187. package/dist/generate/errors/add-factory.js +30 -0
  188. package/dist/generate/errors/add-factory.js.map +1 -0
  189. package/dist/generate/errors/add-spec-case.d.ts +6 -0
  190. package/dist/generate/errors/add-spec-case.d.ts.map +1 -0
  191. package/dist/generate/errors/add-spec-case.js +26 -0
  192. package/dist/generate/errors/add-spec-case.js.map +1 -0
  193. package/dist/generate/errors/class-body.d.ts +8 -0
  194. package/dist/generate/errors/class-body.d.ts.map +1 -0
  195. package/dist/generate/errors/class-body.js +11 -0
  196. package/dist/generate/errors/class-body.js.map +1 -0
  197. package/dist/generate/errors/codes-of-context.d.ts +4 -0
  198. package/dist/generate/errors/codes-of-context.d.ts.map +1 -0
  199. package/dist/generate/errors/codes-of-context.js +17 -0
  200. package/dist/generate/errors/codes-of-context.js.map +1 -0
  201. package/dist/generate/errors/refusal-code.d.ts +13 -0
  202. package/dist/generate/errors/refusal-code.d.ts.map +1 -0
  203. package/dist/generate/errors/refusal-code.js +19 -0
  204. package/dist/generate/errors/refusal-code.js.map +1 -0
  205. package/dist/generate/errors/refusal-name.d.ts +4 -0
  206. package/dist/generate/errors/refusal-name.d.ts.map +1 -0
  207. package/dist/generate/errors/refusal-name.js +15 -0
  208. package/dist/generate/errors/refusal-name.js.map +1 -0
  209. package/dist/generate/errors/static-methods.d.ts +10 -0
  210. package/dist/generate/errors/static-methods.d.ts.map +1 -0
  211. package/dist/generate/errors/static-methods.js +13 -0
  212. package/dist/generate/errors/static-methods.js.map +1 -0
  213. package/dist/generate/errors/vague-refusal-names.d.ts +3 -0
  214. package/dist/generate/errors/vague-refusal-names.d.ts.map +1 -0
  215. package/dist/generate/errors/vague-refusal-names.js +15 -0
  216. package/dist/generate/errors/vague-refusal-names.js.map +1 -0
  217. package/dist/generate/kind.d.ts +12 -0
  218. package/dist/generate/kind.d.ts.map +1 -1
  219. package/dist/generate/kinds/declare-context-entries.d.ts +1 -1
  220. package/dist/generate/kinds/declare-context-entries.js +4 -3
  221. package/dist/generate/kinds/declare-context-entries.js.map +1 -1
  222. package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
  223. package/dist/generate/kinds/domain-error-kind.js +4 -1
  224. package/dist/generate/kinds/domain-error-kind.js.map +1 -1
  225. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  226. package/dist/generate/kinds/e2e-kind.js +29 -6
  227. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  228. package/dist/generate/kinds/error-kind.d.ts +3 -0
  229. package/dist/generate/kinds/error-kind.d.ts.map +1 -0
  230. package/dist/generate/kinds/error-kind.js +75 -0
  231. package/dist/generate/kinds/error-kind.js.map +1 -0
  232. package/dist/generate/kinds/extraction/service-selection.d.ts.map +1 -1
  233. package/dist/generate/kinds/extraction/service-selection.js +2 -1
  234. package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
  235. package/dist/generate/kinds/guard-kind.d.ts +3 -0
  236. package/dist/generate/kinds/guard-kind.d.ts.map +1 -0
  237. package/dist/generate/kinds/guard-kind.js +27 -0
  238. package/dist/generate/kinds/guard-kind.js.map +1 -0
  239. package/dist/generate/kinds/route/controller-imports.d.ts +17 -0
  240. package/dist/generate/kinds/route/controller-imports.d.ts.map +1 -0
  241. package/dist/generate/kinds/route/controller-imports.js +22 -0
  242. package/dist/generate/kinds/route/controller-imports.js.map +1 -0
  243. package/dist/generate/kinds/route/controller-plan.d.ts +12 -0
  244. package/dist/generate/kinds/route/controller-plan.d.ts.map +1 -0
  245. package/dist/generate/kinds/route/controller-plan.js +2 -0
  246. package/dist/generate/kinds/route/controller-plan.js.map +1 -0
  247. package/dist/generate/kinds/route/controller-types.d.ts +18 -0
  248. package/dist/generate/kinds/route/controller-types.d.ts.map +1 -0
  249. package/dist/generate/kinds/route/controller-types.js +27 -0
  250. package/dist/generate/kinds/route/controller-types.js.map +1 -0
  251. package/dist/generate/kinds/route/controller-vars.d.ts +6 -0
  252. package/dist/generate/kinds/route/controller-vars.d.ts.map +1 -0
  253. package/dist/generate/kinds/route/controller-vars.js +117 -0
  254. package/dist/generate/kinds/route/controller-vars.js.map +1 -0
  255. package/dist/generate/kinds/route/group-file.d.ts +3 -0
  256. package/dist/generate/kinds/route/group-file.d.ts.map +1 -0
  257. package/dist/generate/kinds/route/group-file.js +5 -0
  258. package/dist/generate/kinds/route/group-file.js.map +1 -0
  259. package/dist/generate/kinds/route/group-prefix.d.ts +4 -0
  260. package/dist/generate/kinds/route/group-prefix.d.ts.map +1 -0
  261. package/dist/generate/kinds/route/group-prefix.js +17 -0
  262. package/dist/generate/kinds/route/group-prefix.js.map +1 -0
  263. package/dist/generate/kinds/route/group-vars.d.ts +17 -0
  264. package/dist/generate/kinds/route/group-vars.d.ts.map +1 -0
  265. package/dist/generate/kinds/route/group-vars.js +33 -0
  266. package/dist/generate/kinds/route/group-vars.js.map +1 -0
  267. package/dist/generate/kinds/route/plan-controller.d.ts +6 -0
  268. package/dist/generate/kinds/route/plan-controller.d.ts.map +1 -0
  269. package/dist/generate/kinds/route/plan-controller.js +16 -0
  270. package/dist/generate/kinds/route/plan-controller.js.map +1 -0
  271. package/dist/generate/kinds/route/resolve-group.d.ts +11 -0
  272. package/dist/generate/kinds/route/resolve-group.d.ts.map +1 -0
  273. package/dist/generate/kinds/route/resolve-group.js +31 -0
  274. package/dist/generate/kinds/route/resolve-group.js.map +1 -0
  275. package/dist/generate/kinds/route/resource-of.d.ts +5 -0
  276. package/dist/generate/kinds/route/resource-of.d.ts.map +1 -0
  277. package/dist/generate/kinds/route/resource-of.js +6 -0
  278. package/dist/generate/kinds/route/resource-of.js.map +1 -0
  279. package/dist/generate/kinds/route/route-group.d.ts +11 -0
  280. package/dist/generate/kinds/route/route-group.d.ts.map +1 -0
  281. package/dist/generate/kinds/route/route-group.js +2 -0
  282. package/dist/generate/kinds/route/route-group.js.map +1 -0
  283. package/dist/generate/kinds/route/write-controller.d.ts +5 -0
  284. package/dist/generate/kinds/route/write-controller.d.ts.map +1 -0
  285. package/dist/generate/kinds/route/write-controller.js +55 -0
  286. package/dist/generate/kinds/route/write-controller.js.map +1 -0
  287. package/dist/generate/kinds/route-group-kind.d.ts +3 -0
  288. package/dist/generate/kinds/route-group-kind.d.ts.map +1 -0
  289. package/dist/generate/kinds/route-group-kind.js +55 -0
  290. package/dist/generate/kinds/route-group-kind.js.map +1 -0
  291. package/dist/generate/kinds/route-kind.d.ts +2 -0
  292. package/dist/generate/kinds/route-kind.d.ts.map +1 -1
  293. package/dist/generate/kinds/route-kind.js +19 -4
  294. package/dist/generate/kinds/route-kind.js.map +1 -1
  295. package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
  296. package/dist/generate/kinds/write-context-files.js +5 -4
  297. package/dist/generate/kinds/write-context-files.js.map +1 -1
  298. package/dist/generate/kinds.d.ts.map +1 -1
  299. package/dist/generate/kinds.js +8 -1
  300. package/dist/generate/kinds.js.map +1 -1
  301. package/dist/generate/lists-routes.d.ts +8 -0
  302. package/dist/generate/lists-routes.d.ts.map +1 -0
  303. package/dist/generate/lists-routes.js +10 -0
  304. package/dist/generate/lists-routes.js.map +1 -0
  305. package/dist/init/files/audit-files.d.ts.map +1 -1
  306. package/dist/init/files/audit-files.js +2 -7
  307. package/dist/init/files/audit-files.js.map +1 -1
  308. package/dist/init/manifest/versions.js +23 -23
  309. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  310. package/dist/init/stack/resolve-stack.js +5 -1
  311. package/dist/init/stack/resolve-stack.js.map +1 -1
  312. package/dist/init/stack/stack-options.d.ts +2 -0
  313. package/dist/init/stack/stack-options.d.ts.map +1 -1
  314. package/dist/refusals/apply-plan.d.ts +17 -0
  315. package/dist/refusals/apply-plan.d.ts.map +1 -0
  316. package/dist/refusals/apply-plan.js +118 -0
  317. package/dist/refusals/apply-plan.js.map +1 -0
  318. package/dist/refusals/factory-name-for.d.ts +7 -0
  319. package/dist/refusals/factory-name-for.d.ts.map +1 -0
  320. package/dist/refusals/factory-name-for.js +16 -0
  321. package/dist/refusals/factory-name-for.js.map +1 -0
  322. package/dist/refusals/legacy-error.d.ts +21 -0
  323. package/dist/refusals/legacy-error.d.ts.map +1 -0
  324. package/dist/refusals/legacy-error.js +2 -0
  325. package/dist/refusals/legacy-error.js.map +1 -0
  326. package/dist/refusals/legacy-errors.d.ts +6 -0
  327. package/dist/refusals/legacy-errors.d.ts.map +1 -0
  328. package/dist/refusals/legacy-errors.js +16 -0
  329. package/dist/refusals/legacy-errors.js.map +1 -0
  330. package/dist/refusals/migration-draft.d.ts +15 -0
  331. package/dist/refusals/migration-draft.d.ts.map +1 -0
  332. package/dist/refusals/migration-draft.js +41 -0
  333. package/dist/refusals/migration-draft.js.map +1 -0
  334. package/dist/refusals/migration-plan.d.ts +6 -0
  335. package/dist/refusals/migration-plan.d.ts.map +1 -0
  336. package/dist/refusals/migration-plan.js +2 -0
  337. package/dist/refusals/migration-plan.js.map +1 -0
  338. package/dist/refusals/move.d.ts +15 -0
  339. package/dist/refusals/move.d.ts.map +1 -0
  340. package/dist/refusals/move.js +2 -0
  341. package/dist/refusals/move.js.map +1 -0
  342. package/dist/refusals/nested-cases.d.ts +3 -0
  343. package/dist/refusals/nested-cases.d.ts.map +1 -0
  344. package/dist/refusals/nested-cases.js +9 -0
  345. package/dist/refusals/nested-cases.js.map +1 -0
  346. package/dist/refusals/plan-file.d.ts +3 -0
  347. package/dist/refusals/plan-file.d.ts.map +1 -0
  348. package/dist/refusals/plan-file.js +3 -0
  349. package/dist/refusals/plan-file.js.map +1 -0
  350. package/dist/refusals/planned-factory.d.ts +11 -0
  351. package/dist/refusals/planned-factory.d.ts.map +1 -0
  352. package/dist/refusals/planned-factory.js +2 -0
  353. package/dist/refusals/planned-factory.js.map +1 -0
  354. package/dist/refusals/planned-move.d.ts +8 -0
  355. package/dist/refusals/planned-move.d.ts.map +1 -0
  356. package/dist/refusals/planned-move.js +2 -0
  357. package/dist/refusals/planned-move.js.map +1 -0
  358. package/dist/refusals/project-sources.d.ts +5 -0
  359. package/dist/refusals/project-sources.d.ts.map +1 -0
  360. package/dist/refusals/project-sources.js +13 -0
  361. package/dist/refusals/project-sources.js.map +1 -0
  362. package/dist/refusals/propose-plan.d.ts +16 -0
  363. package/dist/refusals/propose-plan.d.ts.map +1 -0
  364. package/dist/refusals/propose-plan.js +39 -0
  365. package/dist/refusals/propose-plan.js.map +1 -0
  366. package/dist/refusals/read-legacy-error.d.ts +9 -0
  367. package/dist/refusals/read-legacy-error.d.ts.map +1 -0
  368. package/dist/refusals/read-legacy-error.js +75 -0
  369. package/dist/refusals/read-legacy-error.js.map +1 -0
  370. package/dist/refusals/read-plan.d.ts +4 -0
  371. package/dist/refusals/read-plan.d.ts.map +1 -0
  372. package/dist/refusals/read-plan.js +43 -0
  373. package/dist/refusals/read-plan.js.map +1 -0
  374. package/dist/refusals/render-factory.d.ts +5 -0
  375. package/dist/refusals/render-factory.d.ts.map +1 -0
  376. package/dist/refusals/render-factory.js +14 -0
  377. package/dist/refusals/render-factory.js.map +1 -0
  378. package/dist/refusals/replace-in-code.d.ts +16 -0
  379. package/dist/refusals/replace-in-code.d.ts.map +1 -0
  380. package/dist/refusals/replace-in-code.js +20 -0
  381. package/dist/refusals/replace-in-code.js.map +1 -0
  382. package/dist/refusals/rewrite-usages.d.ts +6 -0
  383. package/dist/refusals/rewrite-usages.d.ts.map +1 -0
  384. package/dist/refusals/rewrite-usages.js +80 -0
  385. package/dist/refusals/rewrite-usages.js.map +1 -0
  386. package/dist/refusals/spec-parts.d.ts +8 -0
  387. package/dist/refusals/spec-parts.d.ts.map +1 -0
  388. package/dist/refusals/spec-parts.js +14 -0
  389. package/dist/refusals/spec-parts.js.map +1 -0
  390. package/dist/run.d.ts.map +1 -1
  391. package/dist/run.js +14 -1
  392. package/dist/run.js.map +1 -1
  393. package/dist/stack/audit-vars.d.ts.map +1 -1
  394. package/dist/stack/audit-vars.js +3 -1
  395. package/dist/stack/audit-vars.js.map +1 -1
  396. package/dist/stack/stack-vars.d.ts.map +1 -1
  397. package/dist/stack/stack-vars.js +18 -1
  398. package/dist/stack/stack-vars.js.map +1 -1
  399. package/dist/version.d.ts +1 -1
  400. package/dist/version.js +1 -1
  401. package/package.json +2 -2
  402. package/templates/aggregate/aggregate.ts.tpl +5 -0
  403. package/templates/command/handler.declared.ts.tpl +5 -0
  404. package/templates/command/handler.ts.tpl +5 -0
  405. package/templates/context/wiring.declared.tpl +2 -2
  406. package/templates/controller/controller.class-validator.ts.tpl +85 -0
  407. package/templates/controller/controller.none.ts.tpl +101 -0
  408. package/templates/controller/controller.search.ts.tpl +84 -0
  409. package/templates/controller/controller.spec.ts.tpl +49 -0
  410. package/templates/controller/controller.standard-schema.ts.tpl +113 -0
  411. package/templates/controller/controller.zod.ts.tpl +99 -0
  412. package/templates/controller/group.ts.tpl +4 -0
  413. package/templates/controller/guard.spec.ts.tpl +27 -0
  414. package/templates/controller/guard.ts.tpl +14 -0
  415. package/templates/controller/mapper.ts.tpl +10 -0
  416. package/templates/controller/routes.tsyringe.tpl +5 -0
  417. package/templates/controller/serializer.ts.tpl +10 -0
  418. package/templates/controller/wiring.manual.tpl +5 -0
  419. package/templates/docs/openapi.json.tpl +5 -0
  420. package/templates/entity/entity.ts.tpl +5 -0
  421. package/templates/error/case.spec.ts.tpl +8 -0
  422. package/templates/error/concept-error.spec.ts.tpl +7 -0
  423. package/templates/error/concept-error.ts.tpl +5 -0
  424. package/templates/error/factory.ts.tpl +4 -0
  425. package/templates/init/jest.config.js.tpl +7 -0
  426. package/templates/init/platform/audit/audit.module.manual.ts.tpl +18 -0
  427. package/templates/init/platform/audit/search-audit-entries.controller.ts.tpl +193 -0
  428. package/templates/init/platform/compose-application.tsyringe.ts.tpl +38 -4
  429. package/templates/init/rules/domain.md.tpl +11 -0
  430. package/templates/init/rules/presentation.md.tpl +18 -5
  431. package/templates/pipeline/package-scripts.json +1 -1
  432. package/templates/route/route.class-validator.ts.tpl +1 -1
  433. package/templates/route/route.none.ts.tpl +1 -1
  434. package/templates/route/route.search.ts.tpl +1 -1
  435. package/templates/route/route.standard-schema.ts.tpl +1 -1
  436. package/templates/route/route.zod.ts.tpl +1 -1
  437. package/templates/value-object/value-object.ts.tpl +5 -0
@@ -1,30 +1,30 @@
1
1
  /** Ranges written to the generated package.json; bumped together with the kit. */
2
2
  export const VERSIONS = {
3
- '@ddd-ts-kit/kernel': '^0.2.0',
4
- '@ddd-ts-kit/validation': '^0.2.0',
5
- '@ddd-ts-kit/http': '^0.2.0',
6
- '@ddd-ts-kit/tracing': '^0.2.0',
7
- '@ddd-ts-kit/di': '^0.2.0',
8
- '@ddd-ts-kit/events': '^0.2.0',
9
- '@ddd-ts-kit/testing': '^0.2.0',
10
- '@ddd-ts-kit/drizzle': '^0.2.0',
11
- '@ddd-ts-kit/knex': '^0.2.0',
12
- '@ddd-ts-kit/prisma': '^0.2.0',
13
- '@ddd-ts-kit/typeorm': '^0.2.0',
14
- '@ddd-ts-kit/auth': '^0.2.0',
15
- '@ddd-ts-kit/rabbitmq': '^0.2.0',
16
- '@ddd-ts-kit/aspects': '^0.2.0',
17
- '@ddd-ts-kit/audit': '^0.2.0',
18
- '@ddd-ts-kit/redis': '^0.2.0',
19
- '@ddd-ts-kit/kafka': '^0.2.0',
20
- '@ddd-ts-kit/nats': '^0.2.0',
21
- '@ddd-ts-kit/scheduling': '^0.2.0',
22
- '@ddd-ts-kit/sentry': '^0.2.0',
3
+ '@ddd-ts-kit/kernel': '^0.4.0',
4
+ '@ddd-ts-kit/validation': '^0.4.0',
5
+ '@ddd-ts-kit/http': '^0.4.0',
6
+ '@ddd-ts-kit/tracing': '^0.4.0',
7
+ '@ddd-ts-kit/di': '^0.4.0',
8
+ '@ddd-ts-kit/events': '^0.4.0',
9
+ '@ddd-ts-kit/testing': '^0.4.0',
10
+ '@ddd-ts-kit/drizzle': '^0.4.0',
11
+ '@ddd-ts-kit/knex': '^0.4.0',
12
+ '@ddd-ts-kit/prisma': '^0.4.0',
13
+ '@ddd-ts-kit/typeorm': '^0.4.0',
14
+ '@ddd-ts-kit/auth': '^0.4.0',
15
+ '@ddd-ts-kit/rabbitmq': '^0.4.0',
16
+ '@ddd-ts-kit/aspects': '^0.4.0',
17
+ '@ddd-ts-kit/audit': '^0.4.0',
18
+ '@ddd-ts-kit/redis': '^0.4.0',
19
+ '@ddd-ts-kit/kafka': '^0.4.0',
20
+ '@ddd-ts-kit/nats': '^0.4.0',
21
+ '@ddd-ts-kit/scheduling': '^0.4.0',
22
+ '@ddd-ts-kit/sentry': '^0.4.0',
23
23
  '@sentry/node': '^11.6.0',
24
- '@ddd-ts-kit/pino': '^0.2.0',
24
+ '@ddd-ts-kit/pino': '^0.4.0',
25
25
  pino: '^10.4.0',
26
26
  'pino-pretty': '^13.2.0',
27
- '@ddd-ts-kit/winston': '^0.2.0',
27
+ '@ddd-ts-kit/winston': '^0.4.0',
28
28
  winston: '^3.19.0',
29
29
  '@confluentinc/kafka-javascript': '^1.11.0',
30
30
  '@nats-io/jetstream': '^3.4.0',
@@ -32,7 +32,7 @@ export const VERSIONS = {
32
32
  ioredis: '^6.0.0',
33
33
  jose: '^6.0.0',
34
34
  amqplib: '^2.2.0',
35
- 'ddd-ts-kit': '^0.2.0',
35
+ 'ddd-ts-kit': '^0.4.0',
36
36
  tsx: '^4.23.15',
37
37
  vitest: '^5.0.3',
38
38
  zod: '^4.6.5',
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-stack.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAEA,OAAO,EAqBL,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAgBxE"}
1
+ {"version":3,"file":"resolve-stack.d.ts","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAEA,OAAO,EAuBL,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAgBxE"}
@@ -1,6 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
- import { AUDIT_MODES, AUTHN_STACKS, AUTHZ_STACKS, BROKER_STACKS, CACHE_STACKS, CI_PLATFORMS, CONFIG_FILE, DEFAULT_IMPORT_ALIAS, DEFAULT_IMPORT_EXTENSION, DI_STACKS, DOCS_UIS, ERROR_REPORTERS, HTTP_STACKS, IMPORT_EXTENSIONS, LOGGERS, PACKAGE_MANAGERS, parseConfig, readConfig, TEST_STACKS, VALIDATION_STACKS, } from '../../config/index.js';
3
+ import { AUDIT_MODES, AUTHN_STACKS, AUTHZ_STACKS, BROKER_STACKS, CACHE_STACKS, CI_PLATFORMS, CONFIG_FILE, DEFAULT_IMPORT_ALIAS, DEFAULT_IMPORT_EXTENSION, DI_STACKS, DOCS_UIS, ERROR_REPORTERS, HTTP_STACKS, IMPORT_EXTENSIONS, LOGGERS, REFUSAL_FORMS, ROUTE_FORMS, PACKAGE_MANAGERS, parseConfig, readConfig, TEST_STACKS, VALIDATION_STACKS, } from '../../config/index.js';
4
4
  import { aliasProblem } from '../../alias/index.js';
5
5
  import { DEFAULT_PACKAGE_MANAGER } from '../../package-manager/default-package-manager.js';
6
6
  import { CliError } from '../../cli-error.js';
@@ -95,6 +95,10 @@ function resolveOperations(options, orm) {
95
95
  audit: choose(AUDIT_MODES, options.audit, 'audit') ?? (orm === 'none' ? 'off' : 'on'),
96
96
  errors: choose(ERROR_REPORTERS, options.errors, 'errors') ?? 'none',
97
97
  logger: choose(LOGGERS, options.logger, 'logger') ?? 'stdout',
98
+ // A new project builds its domain errors through factories; a recorded one keeps the form it says, or the one of 0.2.
99
+ refusals: choose(REFUSAL_FORMS, options.refusals, 'refusals') ?? 'factories',
100
+ // A new project writes each route as a controller class; a recorded one keeps the form it says, or the functions of 0.3.
101
+ routes: choose(ROUTE_FORMS, options.routes, 'routes') ?? 'controllers',
98
102
  };
99
103
  }
100
104
  function resolveSecurity(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-stack.js","sourceRoot":"","sources":["../../../src/init/stack/resolve-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,SAAS,EACT,QAAQ,EACR,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,OAAqB;IAC9D,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,EAA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AI,CAAC,IAAI,QAAQ;QACtD,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,IAAI,uBAAuB;KAC/G,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY,EAAE,EAAU;IACtD,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,UAAU,IAAI,iCAAiC,EAAE,GAAG,EACpD,uIAAuI,CACxI,CAAC;AACJ,CAAC"}
@@ -19,6 +19,8 @@ export interface StackOptions {
19
19
  readonly style?: string;
20
20
  readonly assembly?: string;
21
21
  readonly dependencies?: string;
22
+ readonly refusals?: string;
23
+ readonly routes?: string;
22
24
  readonly packageManager?: string;
23
25
  /** The prefix of the source root in imports, when it is not the default. */
24
26
  readonly importAlias?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"stack-options.d.ts","sourceRoot":"","sources":["../../../src/init/stack/stack-options.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAA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AC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,8GAA8G;IAC9G,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB"}
@@ -0,0 +1,17 @@
1
+ import { type Config } from '../config/index.js';
2
+ import type { Workspace } from '../workspace/index.js';
3
+ import type { MigrationDraft } from './migration-draft.js';
4
+ import type { MigrationPlan } from './migration-plan.js';
5
+ import type { PlannedMove } from './planned-move.js';
6
+ interface Tree {
7
+ readonly ws: Workspace;
8
+ readonly config: Config;
9
+ }
10
+ /**
11
+ * Follows the plan: each class per error becomes a factory of the error class of its concept,
12
+ * its spec becomes cases of the spec of that class, every file that named it follows, and the
13
+ * config says the project builds its refusals through factories. Answers the moves it made.
14
+ */
15
+ export declare function applyPlan(tree: Tree, plan: MigrationPlan, draft: MigrationDraft): PlannedMove[];
16
+ export {};
17
+ //# sourceMappingURL=apply-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-plan.d.ts","sourceRoot":"","sources":["../../src/refusals/apply-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAM9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMrD,UAAU,IAAI;IACZ,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,GAAG,WAAW,EAAE,CAgC/F"}
@@ -0,0 +1,118 @@
1
+ import { CONFIG_FILE, editConfigText } from '../config/index.js';
2
+ import { isRecord } from '../check/support/is-record.js';
3
+ import { addFactory } from '../generate/errors/add-factory.js';
4
+ import { addSpecCase } from '../generate/errors/add-spec-case.js';
5
+ import { fitSource } from '../layout/index.js';
6
+ import { toName } from '../naming/index.js';
7
+ import { legacyErrors } from './legacy-errors.js';
8
+ import { nestedCases } from './nested-cases.js';
9
+ import { projectSources } from './project-sources.js';
10
+ import { renderFactory } from './render-factory.js';
11
+ import { rewriteUsages } from './rewrite-usages.js';
12
+ import { specParts } from './spec-parts.js';
13
+ /**
14
+ * Follows the plan: each class per error becomes a factory of the error class of its concept,
15
+ * its spec becomes cases of the spec of that class, every file that named it follows, and the
16
+ * config says the project builds its refusals through factories. Answers the moves it made.
17
+ */
18
+ export function applyPlan(tree, plan, draft) {
19
+ const moves = plannedMoves(tree, plan, draft);
20
+ for (const planned of moves) {
21
+ moveClass(tree, planned, draft);
22
+ }
23
+ const all = moves.map(({ move }) => move);
24
+ const gone = new Set(draft.removed);
25
+ for (const file of projectSources(tree.ws, tree.config).filter((candidate) => !gone.has(candidate))) {
26
+ const told = (className, conceptClass) => {
27
+ draft.manual.push(`${file}: ${conceptClass} stands where ${className} stood as a value: assert the code of the refusal there.`);
28
+ };
29
+ const source = draft.read(file) ?? '';
30
+ draft.write(file, rewriteUsages(source, all.filter((move) => concerns(move, { file, source }, tree.config)), told));
31
+ }
32
+ draft.write(CONFIG_FILE, editConfigText(draft.read(CONFIG_FILE) ?? '{}', sayFactories));
33
+ return moves;
34
+ }
35
+ /**
36
+ * Two contexts may name a class the same way: a move concerns the files of its own context, and
37
+ * elsewhere the files that import the class from that context.
38
+ */
39
+ function concerns(move, { file, source }, config) {
40
+ const contexts = `${config.contextsDir}/`;
41
+ return file.startsWith(contexts)
42
+ ? file.startsWith(`${contexts}${move.context}/`)
43
+ : source.includes(`/${move.legacyPath}`);
44
+ }
45
+ function sayFactories(raw) {
46
+ raw['stack'] = { ...(isRecord(raw['stack']) ? raw['stack'] : {}), refusals: 'factories' };
47
+ }
48
+ /** The classes still there whose plan entry says where they go; one that cannot move mechanically is said, and left. */
49
+ function plannedMoves({ ws, config }, plan, draft) {
50
+ return legacyErrors(ws, config).flatMap((error) => {
51
+ const entry = (plan.contexts[error.context] ?? []).find((candidate) => candidate.class === error.className && candidate.file === error.file);
52
+ if (entry === undefined || `${entry.concept}Error` === error.className) {
53
+ return [];
54
+ }
55
+ if (error.manual !== undefined) {
56
+ draft.manual.push(`${error.file}: ${error.className} is left as it is, ${error.manual}.`);
57
+ return [];
58
+ }
59
+ const move = {
60
+ className: error.className,
61
+ conceptClass: `${entry.concept}Error`,
62
+ conceptFile: `${toName(entry.concept).kebab}.error`,
63
+ factory: entry.factory,
64
+ code: error.code,
65
+ context: error.context,
66
+ legacyPath: `${error.context}/domain/errors/${baseName(error.file).replace(/\.ts$/, '')}`,
67
+ };
68
+ return [{ error, move }];
69
+ });
70
+ }
71
+ function moveClass({ config }, { error, move }, draft) {
72
+ const context = `${config.contextsDir}/${error.context}`;
73
+ const target = `${context}/domain/errors/${move.conceptFile}.ts`;
74
+ const factory = renderFactory(error, move);
75
+ const empty = `import { ConceptError } from '@ddd-ts-kit/kernel';\n\nexport class ${move.conceptClass} extends ConceptError {}\n`;
76
+ const next = addFactory(draft.read(target) ?? empty, {
77
+ className: move.conceptClass,
78
+ name: move.factory,
79
+ text: factory,
80
+ });
81
+ if (error.parameters.length > 3) {
82
+ draft.manual.push(`${target}: ${move.conceptClass}.${move.factory} takes more than three parameters, give it one typed object.`);
83
+ }
84
+ for (const property of error.properties) {
85
+ draft.manual.push(`${error.className}.${property} was a property of the error: read \`error.facts.${property}\` where it was read.`);
86
+ }
87
+ draft.remove(error.file);
88
+ draft.write(target, fitSource(next ?? empty));
89
+ moveSpec(context, { error, move }, draft);
90
+ }
91
+ /** The spec of the class, rewritten as any other file, becomes the cases of its factory in the spec of the concept class. */
92
+ function moveSpec(context, { error, move }, draft) {
93
+ const old = `${context}/test/unit/${baseName(error.file).replace(/\.ts$/, '.spec.ts')}`;
94
+ const source = draft.read(old);
95
+ if (source === undefined) {
96
+ return;
97
+ }
98
+ const { imports, cases } = specParts(rewriteUsages(source, [move]));
99
+ const target = `${context}/test/unit/${move.conceptFile}.spec.ts`;
100
+ if (cases === undefined) {
101
+ draft.manual.push(`${old}: no describe block was found, move its cases to ${target} by hand.`);
102
+ return;
103
+ }
104
+ const existing = draft.read(target) ?? `${imports.join('')}\ndescribe('${move.conceptClass}', () => {\n});\n`;
105
+ const merged = addSpecCase(withImports(existing, imports), `describe('${move.factory}'`, nestedCases(move.factory, cases));
106
+ draft.remove(old);
107
+ draft.write(target, merged ?? existing);
108
+ }
109
+ function withImports(spec, imports) {
110
+ const missing = imports.filter((line) => !spec.includes(line));
111
+ const last = [...spec.matchAll(/^import [^;]+;\n/gm)].at(-1);
112
+ const at = last === undefined ? 0 : last.index + last[0].length;
113
+ return spec.slice(0, at) + missing.join('') + spec.slice(at);
114
+ }
115
+ function baseName(file) {
116
+ return file.slice(file.lastIndexOf('/') + 1);
117
+ }
118
+ //# sourceMappingURL=apply-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-plan.js","sourceRoot":"","sources":["../../src/refusals/apply-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU,EAAE,IAAmB,EAAE,KAAqB;IAC9E,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAE9C,KAAK,MAAM,OAAO,IAAI,KA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AC,IAAY;IAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The factory name whose code is `code` on the error class of `concept`: the code without the
3
+ * name of the concept at either end (`APPOINTMENT_NOT_FOUND` gives `notFound`), or the whole
4
+ * code when what is left would say nothing.
5
+ */
6
+ export declare function factoryNameFor(code: string, concept: string): string;
7
+ //# sourceMappingURL=factory-name-for.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-name-for.d.ts","sourceRoot":"","sources":["../../src/refusals/factory-name-for.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CASpE"}
@@ -0,0 +1,16 @@
1
+ import { VAGUE_REFUSAL_NAMES } from '../generate/errors/vague-refusal-names.js';
2
+ import { toName } from '../naming/index.js';
3
+ /**
4
+ * The factory name whose code is `code` on the error class of `concept`: the code without the
5
+ * name of the concept at either end (`APPOINTMENT_NOT_FOUND` gives `notFound`), or the whole
6
+ * code when what is left would say nothing.
7
+ */
8
+ export function factoryNameFor(code, concept) {
9
+ const subject = toName(concept).constant;
10
+ const whole = toName(code).camel;
11
+ const rest = [new RegExp(`^${subject}_`), new RegExp(`_${subject}$`)]
12
+ .filter((edge) => subject !== '' && edge.test(code))
13
+ .map((edge) => toName(code.replace(edge, '')).camel)[0];
14
+ return rest === undefined || rest === '' || VAGUE_REFUSAL_NAMES.includes(rest.toLowerCase()) ? whole : rest;
15
+ }
16
+ //# sourceMappingURL=factory-name-for.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-name-for.js","sourceRoot":"","sources":["../../src/refusals/factory-name-for.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,OAAe;IAC1D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IACzC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;IAEjC,MAAM,IAAI,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC;SAClE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACnD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,IAAI,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9G,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** One parameter of the constructor of a class per error, modifiers removed. */
2
+ export interface LegacyParameter {
3
+ readonly name: string;
4
+ /** As written after the colon, or `unknown` when the parameter has no type. */
5
+ readonly type: string;
6
+ }
7
+ /** A class per error of 0.2, as much of it as a factory needs. */
8
+ export interface LegacyError {
9
+ readonly file: string;
10
+ readonly context: string;
11
+ readonly className: string;
12
+ readonly code: string;
13
+ readonly parameters: readonly LegacyParameter[];
14
+ /** The parameters that were also properties of the error (`readonly personId: string`): the facts carry them now. */
15
+ readonly properties: readonly string[];
16
+ /** The expression given to `super(..)`, as written. */
17
+ readonly message: string;
18
+ /** Why the class cannot be turned into a factory mechanically, when it cannot. */
19
+ readonly manual?: string;
20
+ }
21
+ //# sourceMappingURL=legacy-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-error.d.ts","sourceRoot":"","sources":["../../src/refusals/legacy-error.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IAChD,qHAAqH;IACrH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=legacy-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-error.js","sourceRoot":"","sources":["../../src/refusals/legacy-error.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Config } from '../config/index.js';
2
+ import type { Workspace } from '../workspace/index.js';
3
+ import type { LegacyError } from './legacy-error.js';
4
+ /** Every class per error of the `domain/errors/` of every context, in the order of their files. */
5
+ export declare function legacyErrors(ws: Workspace, config: Config): LegacyError[];
6
+ //# sourceMappingURL=legacy-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-errors.d.ts","sourceRoot":"","sources":["../../src/refusals/legacy-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAczE"}
@@ -0,0 +1,16 @@
1
+ import { readLegacyError } from './read-legacy-error.js';
2
+ /** Every class per error of the `domain/errors/` of every context, in the order of their files. */
3
+ export function legacyErrors(ws, config) {
4
+ return Object.keys(config.contexts).flatMap((context) => {
5
+ const directory = `${config.contextsDir}/${context}/domain/errors`;
6
+ return ws
7
+ .list(directory)
8
+ .filter((name) => name.endsWith('.error.ts'))
9
+ .flatMap((name) => {
10
+ const file = `${directory}/${name}`;
11
+ const read = readLegacyError(ws.read(file) ?? '', { file, context });
12
+ return read === undefined ? [] : [read];
13
+ });
14
+ });
15
+ }
16
+ //# sourceMappingURL=legacy-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-errors.js","sourceRoot":"","sources":["../../src/refusals/legacy-errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,mGAAmG;AACnG,MAAM,UAAU,YAAY,CAAC,EAAa,EAAE,MAAc;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,gBAAgB,CAAC;QAEnE,OAAO,EAAE;aACN,IAAI,CAAC,SAAS,CAAC;aACf,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;aAC5C,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YAErE,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Workspace } from '../workspace/index.js';
2
+ /** The files a migration writes and removes, kept in memory until it is committed: a dry run commits nothing. */
3
+ export declare class MigrationDraft {
4
+ private readonly ws;
5
+ readonly manual: string[];
6
+ private readonly files;
7
+ constructor(ws: Workspace);
8
+ read(file: string): string | undefined;
9
+ write(file: string, content: string): void;
10
+ remove(file: string): void;
11
+ get written(): string[];
12
+ get removed(): string[];
13
+ commit(): void;
14
+ }
15
+ //# sourceMappingURL=migration-draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-draft.d.ts","sourceRoot":"","sources":["../../src/refusals/migration-draft.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,iHAAiH;AACjH,qBAAa,cAAc;IAKb,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJ/B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyC;IAE/D,YAA6B,EAAE,EAAE,SAAS,EAAI;IAE9C,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAErC;IAED,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIzC;IAED,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEzB;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED,MAAM,IAAI,IAAI,CAWb;CACF"}
@@ -0,0 +1,41 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ /** The files a migration writes and removes, kept in memory until it is committed: a dry run commits nothing. */
4
+ export class MigrationDraft {
5
+ ws;
6
+ manual = [];
7
+ files = new Map();
8
+ constructor(ws) {
9
+ this.ws = ws;
10
+ }
11
+ read(file) {
12
+ return this.files.has(file) ? this.files.get(file) : this.ws.read(file);
13
+ }
14
+ write(file, content) {
15
+ if (this.read(file) !== content) {
16
+ this.files.set(file, content);
17
+ }
18
+ }
19
+ remove(file) {
20
+ this.files.set(file, undefined);
21
+ }
22
+ get written() {
23
+ return [...this.files].filter(([, content]) => content !== undefined).map(([file]) => file);
24
+ }
25
+ get removed() {
26
+ return [...this.files].filter(([, content]) => content === undefined).map(([file]) => file);
27
+ }
28
+ commit() {
29
+ for (const [file, content] of this.files) {
30
+ const target = path.join(this.ws.root, file);
31
+ if (content === undefined) {
32
+ fs.rmSync(target, { force: true });
33
+ }
34
+ else {
35
+ fs.mkdirSync(path.dirname(target), { recursive: true });
36
+ fs.writeFileSync(target, content);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ //# sourceMappingURL=migration-draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-draft.js","sourceRoot":"","sources":["../../src/refusals/migration-draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,iHAAiH;AACjH,MAAM,OAAO,cAAc;IAKI,EAAE;IAJtB,MAAM,GAAa,EAAE,CAAC;IAEd,KAAK,GAAG,IAAI,GAAG,EAA8B,CAAC;IAE/D,YAA6B,EAAa;kBAAb,EAAE;IAAc,CA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AAC;YAE7C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxD,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import type { PlannedFactory } from './planned-factory.js';
2
+ /** What `error-factories --plan` proposes and `--apply` follows: per context, where each class per error goes. */
3
+ export interface MigrationPlan {
4
+ readonly contexts: Readonly<Record<string, readonly PlannedFactory[]>>;
5
+ }
6
+ //# sourceMappingURL=migration-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../src/refusals/migration-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,kHAAkH;AAClH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC,CAAC,CAAC;CACxE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=migration-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-plan.js","sourceRoot":"","sources":["../../src/refusals/migration-plan.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /** One class per error on its way to a factory: what replaces it wherever it is named. */
2
+ export interface Move {
3
+ /** The class that disappears, for example `SlotTakenError`. */
4
+ readonly className: string;
5
+ /** The error class of the concept, for example `AppointmentError`. */
6
+ readonly conceptClass: string;
7
+ /** The file name of that class without its extension, for example `appointment.error`. */
8
+ readonly conceptFile: string;
9
+ readonly factory: string;
10
+ /** The context the class belongs to, and the path of its file from the contexts directory, without extension. */
11
+ readonly context: string;
12
+ readonly legacyPath: string;
13
+ readonly code: string;
14
+ }
15
+ //# sourceMappingURL=move.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move.d.ts","sourceRoot":"","sources":["../../src/refusals/move.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,WAAW,IAAI;IACnB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iHAAiH;IACjH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=move.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move.js","sourceRoot":"","sources":["../../src/refusals/move.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** The cases of one factory, under a `describe` of its name, one level deeper. */
2
+ export declare function nestedCases(factory: string, cases: string): string;
3
+ //# sourceMappingURL=nested-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nested-cases.d.ts","sourceRoot":"","sources":["../../src/refusals/nested-cases.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlE"}
@@ -0,0 +1,9 @@
1
+ /** The cases of one factory, under a `describe` of its name, one level deeper. */
2
+ export function nestedCases(factory, cases) {
3
+ const deeper = cases
4
+ .split('\n')
5
+ .map((line) => (line === '' ? line : ` ${line}`))
6
+ .join('\n');
7
+ return ` describe('${factory}', () => {\n${deeper}\n });`;
8
+ }
9
+ //# sourceMappingURL=nested-cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nested-cases.js","sourceRoot":"","sources":["../../src/refusals/nested-cases.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,KAAa;IACxD,MAAM,MAAM,GAAG,KAAK;SACjB,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;SACjD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,eAAe,OAAO,eAAe,MAAM,SAAS,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Where `error-factories --plan` writes its proposal, and where `--apply` reads the decisions. */
2
+ export declare const PLAN_FILE = "error-factories.plan.json";
3
+ //# sourceMappingURL=plan-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-file.d.ts","sourceRoot":"","sources":["../../src/refusals/plan-file.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,eAAO,MAAM,SAAS,8BAA8B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Where `error-factories --plan` writes its proposal, and where `--apply` reads the decisions. */
2
+ export const PLAN_FILE = 'error-factories.plan.json';
3
+ //# sourceMappingURL=plan-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-file.js","sourceRoot":"","sources":["../../src/refusals/plan-file.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,CAAC,MAAM,SAAS,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** The decision about one class per error: the concept whose error class takes it, and the name of its factory. */
2
+ export interface PlannedFactory {
3
+ /** The class to replace, for example `SlotTakenError`. */
4
+ readonly class: string;
5
+ readonly file: string;
6
+ readonly code: string;
7
+ /** The concept of the glossary, without `Error`: empty until somebody decides. */
8
+ readonly concept: string;
9
+ readonly factory: string;
10
+ }
11
+ //# sourceMappingURL=planned-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planned-factory.d.ts","sourceRoot":"","sources":["../../src/refusals/planned-factory.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=planned-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planned-factory.js","sourceRoot":"","sources":["../../src/refusals/planned-factory.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { LegacyError } from './legacy-error.js';
2
+ import type { Move } from './move.js';
3
+ /** A class per error with the decision taken about it. */
4
+ export interface PlannedMove {
5
+ readonly error: LegacyError;
6
+ readonly move: Move;
7
+ }
8
+ //# sourceMappingURL=planned-move.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planned-move.d.ts","sourceRoot":"","sources":["../../src/refusals/planned-move.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=planned-move.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planned-move.js","sourceRoot":"","sources":["../../src/refusals/planned-move.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { Config } from '../config/index.js';
2
+ import type { Workspace } from '../workspace/index.js';
3
+ /** Every TypeScript file under the source root and under `test/` at the root of the project. */
4
+ export declare function projectSources(ws: Workspace, config: Config): string[];
5
+ //# sourceMappingURL=project-sources.d.ts.map