ddd-ts-kit 0.111.0 → 0.112.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 (444) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/README.fr.md +35 -6
  3. package/README.md +32 -5
  4. package/dist/alias/index.d.ts +2 -0
  5. package/dist/alias/index.d.ts.map +1 -1
  6. package/dist/alias/index.js +2 -0
  7. package/dist/alias/index.js.map +1 -1
  8. package/dist/alias/neighbour-sources.d.ts +17 -0
  9. package/dist/alias/neighbour-sources.d.ts.map +1 -0
  10. package/dist/alias/neighbour-sources.js +11 -0
  11. package/dist/alias/neighbour-sources.js.map +1 -0
  12. package/dist/alias/neighbour-suffix.d.ts +8 -0
  13. package/dist/alias/neighbour-suffix.d.ts.map +1 -0
  14. package/dist/alias/neighbour-suffix.js +10 -0
  15. package/dist/alias/neighbour-suffix.js.map +1 -0
  16. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  17. package/dist/build/rewrite-aliases.js +11 -0
  18. package/dist/build/rewrite-aliases.js.map +1 -1
  19. package/dist/check/alias/build-scripts.d.ts.map +1 -1
  20. package/dist/check/alias/build-scripts.js +4 -8
  21. package/dist/check/alias/build-scripts.js.map +1 -1
  22. package/dist/check/alias/compiler-options-of.d.ts +3 -3
  23. package/dist/check/alias/compiler-options-of.js +17 -6
  24. package/dist/check/alias/compiler-options-of.js.map +1 -1
  25. package/dist/check/alias/neighbour-sources.d.ts +12 -0
  26. package/dist/check/alias/neighbour-sources.d.ts.map +1 -0
  27. package/dist/check/alias/neighbour-sources.js +80 -0
  28. package/dist/check/alias/neighbour-sources.js.map +1 -0
  29. package/dist/check/alias/script-steps.d.ts +11 -0
  30. package/dist/check/alias/script-steps.d.ts.map +1 -0
  31. package/dist/check/alias/script-steps.js +22 -0
  32. package/dist/check/alias/script-steps.js.map +1 -0
  33. package/dist/check/aspects/adapter-policies.d.ts +10 -0
  34. package/dist/check/aspects/adapter-policies.d.ts.map +1 -0
  35. package/dist/check/aspects/adapter-policies.js +104 -0
  36. package/dist/check/aspects/adapter-policies.js.map +1 -0
  37. package/dist/check/aspects/adapter-policy.d.ts +18 -0
  38. package/dist/check/aspects/adapter-policy.d.ts.map +1 -0
  39. package/dist/check/aspects/adapter-policy.js +2 -0
  40. package/dist/check/aspects/adapter-policy.js.map +1 -0
  41. package/dist/check/aspects/is-under-condition.d.ts +7 -0
  42. package/dist/check/aspects/is-under-condition.d.ts.map +1 -0
  43. package/dist/check/aspects/is-under-condition.js +50 -0
  44. package/dist/check/aspects/is-under-condition.js.map +1 -0
  45. package/dist/check/aspects/stated-policy.d.ts +18 -0
  46. package/dist/check/aspects/stated-policy.d.ts.map +1 -0
  47. package/dist/check/aspects/stated-policy.js +39 -0
  48. package/dist/check/aspects/stated-policy.js.map +1 -0
  49. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  50. package/dist/check/catalogue/architecture-rules.js +4 -0
  51. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  52. package/dist/check/explain/imports-docs.d.ts.map +1 -1
  53. package/dist/check/explain/imports-docs.js +5 -3
  54. package/dist/check/explain/imports-docs.js.map +1 -1
  55. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  56. package/dist/check/explain/persistence-docs.js +21 -0
  57. package/dist/check/explain/persistence-docs.js.map +1 -1
  58. package/dist/check/explain/standard-docs.d.ts.map +1 -1
  59. package/dist/check/explain/standard-docs.js +16 -0
  60. package/dist/check/explain/standard-docs.js.map +1 -1
  61. package/dist/check/files/kit-content-types.d.ts +12 -0
  62. package/dist/check/files/kit-content-types.d.ts.map +1 -0
  63. package/dist/check/files/kit-content-types.js +38 -0
  64. package/dist/check/files/kit-content-types.js.map +1 -0
  65. package/dist/check/files/upload-content-defect.d.ts +7 -0
  66. package/dist/check/files/upload-content-defect.d.ts.map +1 -0
  67. package/dist/check/files/upload-content-defect.js +2 -0
  68. package/dist/check/files/upload-content-defect.js.map +1 -0
  69. package/dist/check/files/upload-content-defects.d.ts +9 -0
  70. package/dist/check/files/upload-content-defects.d.ts.map +1 -0
  71. package/dist/check/files/upload-content-defects.js +54 -0
  72. package/dist/check/files/upload-content-defects.js.map +1 -0
  73. package/dist/check/files/upload-declaration.d.ts +7 -0
  74. package/dist/check/files/upload-declaration.d.ts.map +1 -0
  75. package/dist/check/files/upload-declaration.js +2 -0
  76. package/dist/check/files/upload-declaration.js.map +1 -0
  77. package/dist/check/files/upload-declarations.d.ts +9 -0
  78. package/dist/check/files/upload-declarations.d.ts.map +1 -0
  79. package/dist/check/files/upload-declarations.js +41 -0
  80. package/dist/check/files/upload-declarations.js.map +1 -0
  81. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  82. package/dist/check/fixtures/alias-declared-fixtures.js +95 -1
  83. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  84. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  85. package/dist/check/fixtures/fixtures.js +2 -0
  86. package/dist/check/fixtures/fixtures.js.map +1 -1
  87. package/dist/check/fixtures/imports-fixtures.d.ts.map +1 -1
  88. package/dist/check/fixtures/imports-fixtures.js +97 -0
  89. package/dist/check/fixtures/imports-fixtures.js.map +1 -1
  90. package/dist/check/fixtures/standard-fixtures.d.ts.map +1 -1
  91. package/dist/check/fixtures/standard-fixtures.js +42 -0
  92. package/dist/check/fixtures/standard-fixtures.js.map +1 -1
  93. package/dist/check/fixtures/upload-fixtures.d.ts +3 -0
  94. package/dist/check/fixtures/upload-fixtures.d.ts.map +1 -0
  95. package/dist/check/fixtures/upload-fixtures.js +94 -0
  96. package/dist/check/fixtures/upload-fixtures.js.map +1 -0
  97. package/dist/check/migrations/is-working-migration.d.ts +6 -0
  98. package/dist/check/migrations/is-working-migration.d.ts.map +1 -0
  99. package/dist/check/migrations/is-working-migration.js +8 -0
  100. package/dist/check/migrations/is-working-migration.js.map +1 -0
  101. package/dist/check/migrations/journal-entries.d.ts +4 -0
  102. package/dist/check/migrations/journal-entries.d.ts.map +1 -0
  103. package/dist/check/migrations/journal-entries.js +21 -0
  104. package/dist/check/migrations/journal-entries.js.map +1 -0
  105. package/dist/check/migrations/read-drizzle-migrations.d.ts.map +1 -1
  106. package/dist/check/migrations/read-drizzle-migrations.js +4 -9
  107. package/dist/check/migrations/read-drizzle-migrations.js.map +1 -1
  108. package/dist/check/modules/imported-modules.d.ts +4 -0
  109. package/dist/check/modules/imported-modules.d.ts.map +1 -0
  110. package/dist/check/modules/imported-modules.js +5 -0
  111. package/dist/check/modules/imported-modules.js.map +1 -0
  112. package/dist/check/modules/module-imports.d.ts +17 -0
  113. package/dist/check/modules/module-imports.d.ts.map +1 -0
  114. package/dist/check/modules/module-imports.js +23 -0
  115. package/dist/check/modules/module-imports.js.map +1 -0
  116. package/dist/check/project/assemble-project.d.ts.map +1 -1
  117. package/dist/check/project/assemble-project.js +1 -8
  118. package/dist/check/project/assemble-project.js.map +1 -1
  119. package/dist/check/project/file-severity.d.ts +4 -0
  120. package/dist/check/project/file-severity.d.ts.map +1 -0
  121. package/dist/check/project/file-severity.js +11 -0
  122. package/dist/check/project/file-severity.js.map +1 -0
  123. package/dist/check/project/load-project.js +1 -10
  124. package/dist/check/project/load-project.js.map +1 -1
  125. package/dist/check/project/not-in-the-tree.d.ts +10 -0
  126. package/dist/check/project/not-in-the-tree.d.ts.map +1 -0
  127. package/dist/check/project/not-in-the-tree.js +17 -0
  128. package/dist/check/project/not-in-the-tree.js.map +1 -0
  129. package/dist/check/project/skipped-directories.d.ts +3 -0
  130. package/dist/check/project/skipped-directories.d.ts.map +1 -0
  131. package/dist/check/project/skipped-directories.js +3 -0
  132. package/dist/check/project/skipped-directories.js.map +1 -0
  133. package/dist/check/project/walk-directory.d.ts.map +1 -1
  134. package/dist/check/project/walk-directory.js +1 -1
  135. package/dist/check/project/walk-directory.js.map +1 -1
  136. package/dist/check/rules/aspects-timeout-covers-delegate.d.ts +3 -0
  137. package/dist/check/rules/aspects-timeout-covers-delegate.d.ts.map +1 -0
  138. package/dist/check/rules/aspects-timeout-covers-delegate.js +179 -0
  139. package/dist/check/rules/aspects-timeout-covers-delegate.js.map +1 -0
  140. package/dist/check/rules/files-upload-content-rule.d.ts +3 -0
  141. package/dist/check/rules/files-upload-content-rule.d.ts.map +1 -0
  142. package/dist/check/rules/files-upload-content-rule.js +25 -0
  143. package/dist/check/rules/files-upload-content-rule.js.map +1 -0
  144. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  145. package/dist/check/rules/imports-alias-declared.js +3 -1
  146. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  147. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  148. package/dist/check/rules/imports-alias-only.js +86 -7
  149. package/dist/check/rules/imports-alias-only.js.map +1 -1
  150. package/dist/check/rules/module-no-cycle.d.ts.map +1 -1
  151. package/dist/check/rules/module-no-cycle.js +12 -34
  152. package/dist/check/rules/module-no-cycle.js.map +1 -1
  153. package/dist/cli-error.d.ts +7 -2
  154. package/dist/cli-error.d.ts.map +1 -1
  155. package/dist/cli-error.js +8 -2
  156. package/dist/cli-error.js.map +1 -1
  157. package/dist/commands/generate.js +1 -0
  158. package/dist/commands/generate.js.map +1 -1
  159. package/dist/commands/knex-generate.d.ts.map +1 -1
  160. package/dist/commands/knex-generate.js +2 -1
  161. package/dist/commands/knex-generate.js.map +1 -1
  162. package/dist/commands/move-to-module.d.ts +6 -1
  163. package/dist/commands/move-to-module.d.ts.map +1 -1
  164. package/dist/commands/move-to-module.js +28 -3
  165. package/dist/commands/move-to-module.js.map +1 -1
  166. package/dist/commands/prisma-generate.d.ts.map +1 -1
  167. package/dist/commands/prisma-generate.js +2 -1
  168. package/dist/commands/prisma-generate.js.map +1 -1
  169. package/dist/commands/typeorm-generate.d.ts.map +1 -1
  170. package/dist/commands/typeorm-generate.js +2 -1
  171. package/dist/commands/typeorm-generate.js.map +1 -1
  172. package/dist/commands/verify-merge.d.ts +4 -2
  173. package/dist/commands/verify-merge.d.ts.map +1 -1
  174. package/dist/commands/verify-merge.js +8 -5
  175. package/dist/commands/verify-merge.js.map +1 -1
  176. package/dist/generate/generate-options.d.ts +3 -0
  177. package/dist/generate/generate-options.d.ts.map +1 -1
  178. package/dist/generate/generate-options.js +1 -0
  179. package/dist/generate/generate-options.js.map +1 -1
  180. package/dist/generate/kind.d.ts +2 -0
  181. package/dist/generate/kind.d.ts.map +1 -1
  182. package/dist/generate/kinds/file-upload/upload-file-vars.d.ts +9 -0
  183. package/dist/generate/kinds/file-upload/upload-file-vars.d.ts.map +1 -0
  184. package/dist/generate/kinds/file-upload/upload-file-vars.js +39 -0
  185. package/dist/generate/kinds/file-upload/upload-file-vars.js.map +1 -0
  186. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -1
  187. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +2 -1
  188. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -1
  189. package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -1
  190. package/dist/generate/kinds/file-upload/write-upload-controller.js +2 -1
  191. package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -1
  192. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  193. package/dist/generate/kinds/file-upload-kind.js +5 -3
  194. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  195. package/dist/generate/kinds/read-model/list-read-model.d.ts +17 -0
  196. package/dist/generate/kinds/read-model/list-read-model.d.ts.map +1 -0
  197. package/dist/generate/kinds/read-model/list-read-model.js +22 -0
  198. package/dist/generate/kinds/read-model/list-read-model.js.map +1 -0
  199. package/dist/generate/kinds/read-model-kind.d.ts.map +1 -1
  200. package/dist/generate/kinds/read-model-kind.js +19 -0
  201. package/dist/generate/kinds/read-model-kind.js.map +1 -1
  202. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  203. package/dist/generate/kinds/service-kind.js +8 -0
  204. package/dist/generate/kinds/service-kind.js.map +1 -1
  205. package/dist/generate/kinds/wire-context.d.ts.map +1 -1
  206. package/dist/generate/kinds/wire-context.js +4 -0
  207. package/dist/generate/kinds/wire-context.js.map +1 -1
  208. package/dist/generate/shared-writes.d.ts.map +1 -1
  209. package/dist/generate/shared-writes.js +3 -2
  210. package/dist/generate/shared-writes.js.map +1 -1
  211. package/dist/help/tool-notes.d.ts.map +1 -1
  212. package/dist/help/tool-notes.js +5 -1
  213. package/dist/help/tool-notes.js.map +1 -1
  214. package/dist/help/usage.js +1 -1
  215. package/dist/help/work-notes.d.ts.map +1 -1
  216. package/dist/help/work-notes.js +9 -2
  217. package/dist/help/work-notes.js.map +1 -1
  218. package/dist/init/files/end-to-end-files.d.ts.map +1 -1
  219. package/dist/init/files/end-to-end-files.js +3 -0
  220. package/dist/init/files/end-to-end-files.js.map +1 -1
  221. package/dist/init/files/persistence-files.d.ts.map +1 -1
  222. package/dist/init/files/persistence-files.js +8 -2
  223. package/dist/init/files/persistence-files.js.map +1 -1
  224. package/dist/init/files/script-files.d.ts +2 -1
  225. package/dist/init/files/script-files.d.ts.map +1 -1
  226. package/dist/init/files/script-files.js +6 -1
  227. package/dist/init/files/script-files.js.map +1 -1
  228. package/dist/init/is-team-file.d.ts +2 -2
  229. package/dist/init/is-team-file.d.ts.map +1 -1
  230. package/dist/init/is-team-file.js +5 -4
  231. package/dist/init/is-team-file.js.map +1 -1
  232. package/dist/init/list-read-models.d.ts +17 -0
  233. package/dist/init/list-read-models.d.ts.map +1 -0
  234. package/dist/init/list-read-models.js +74 -0
  235. package/dist/init/list-read-models.js.map +1 -0
  236. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  237. package/dist/init/manifest/database-scripts.js +8 -0
  238. package/dist/init/manifest/database-scripts.js.map +1 -1
  239. package/dist/init/manifest/versions.js +25 -25
  240. package/dist/init/rewire-contexts.d.ts +4 -2
  241. package/dist/init/rewire-contexts.d.ts.map +1 -1
  242. package/dist/init/rewire-contexts.js +10 -2
  243. package/dist/init/rewire-contexts.js.map +1 -1
  244. package/dist/init/run-init.js +1 -1
  245. package/dist/init/run-init.js.map +1 -1
  246. package/dist/init/wiring-notes.js +1 -1
  247. package/dist/init/wiring-notes.js.map +1 -1
  248. package/dist/init/write-type-script-configs.d.ts +3 -1
  249. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  250. package/dist/init/write-type-script-configs.js +14 -2
  251. package/dist/init/write-type-script-configs.js.map +1 -1
  252. package/dist/merge/format-merge-report.js +5 -2
  253. package/dist/merge/format-merge-report.js.map +1 -1
  254. package/dist/merge/land-drizzle.d.ts +4 -0
  255. package/dist/merge/land-drizzle.d.ts.map +1 -1
  256. package/dist/merge/land-drizzle.js +6 -1
  257. package/dist/merge/land-drizzle.js.map +1 -1
  258. package/dist/merge/land-up-to-date.d.ts +15 -0
  259. package/dist/merge/land-up-to-date.d.ts.map +1 -0
  260. package/dist/merge/land-up-to-date.js +76 -0
  261. package/dist/merge/land-up-to-date.js.map +1 -0
  262. package/dist/merge/lost/format-merge-verification.d.ts +2 -1
  263. package/dist/merge/lost/format-merge-verification.d.ts.map +1 -1
  264. package/dist/merge/lost/format-merge-verification.js +13 -2
  265. package/dist/merge/lost/format-merge-verification.js.map +1 -1
  266. package/dist/merge/lost/merge-verification.d.ts +4 -0
  267. package/dist/merge/lost/merge-verification.d.ts.map +1 -1
  268. package/dist/merge/lost/verify-merges.d.ts +2 -1
  269. package/dist/merge/lost/verify-merges.d.ts.map +1 -1
  270. package/dist/merge/lost/verify-merges.js +10 -4
  271. package/dist/merge/lost/verify-merges.js.map +1 -1
  272. package/dist/merge/merge-trunk.d.ts +2 -1
  273. package/dist/merge/merge-trunk.d.ts.map +1 -1
  274. package/dist/merge/merge-trunk.js +5 -2
  275. package/dist/merge/merge-trunk.js.map +1 -1
  276. package/dist/merge/next-steps.d.ts +3 -0
  277. package/dist/merge/next-steps.d.ts.map +1 -1
  278. package/dist/merge/next-steps.js +3 -0
  279. package/dist/merge/next-steps.js.map +1 -1
  280. package/dist/merge/order/applied-under-old-name.d.ts +13 -0
  281. package/dist/merge/order/applied-under-old-name.d.ts.map +1 -0
  282. package/dist/merge/order/applied-under-old-name.js +14 -0
  283. package/dist/merge/order/applied-under-old-name.js.map +1 -0
  284. package/dist/merge/order/comes-after.d.ts +8 -0
  285. package/dist/merge/order/comes-after.d.ts.map +1 -0
  286. package/dist/merge/order/comes-after.js +9 -0
  287. package/dist/merge/order/comes-after.js.map +1 -0
  288. package/dist/merge/order/drizzle-order.d.ts +11 -0
  289. package/dist/merge/order/drizzle-order.d.ts.map +1 -0
  290. package/dist/merge/order/drizzle-order.js +64 -0
  291. package/dist/merge/order/drizzle-order.js.map +1 -0
  292. package/dist/merge/order/in-order.d.ts +4 -0
  293. package/dist/merge/order/in-order.d.ts.map +1 -0
  294. package/dist/merge/order/in-order.js +6 -0
  295. package/dist/merge/order/in-order.js.map +1 -0
  296. package/dist/merge/order/migration-order-finding.d.ts +18 -0
  297. package/dist/merge/order/migration-order-finding.d.ts.map +1 -0
  298. package/dist/merge/order/migration-order-finding.js +2 -0
  299. package/dist/merge/order/migration-order-finding.js.map +1 -0
  300. package/dist/merge/order/migration-order.d.ts +12 -0
  301. package/dist/merge/order/migration-order.d.ts.map +1 -0
  302. package/dist/merge/order/migration-order.js +21 -0
  303. package/dist/merge/order/migration-order.js.map +1 -0
  304. package/dist/merge/order/migrations-of-commit.d.ts +7 -0
  305. package/dist/merge/order/migrations-of-commit.d.ts.map +1 -0
  306. package/dist/merge/order/migrations-of-commit.js +43 -0
  307. package/dist/merge/order/migrations-of-commit.js.map +1 -0
  308. package/dist/merge/order/migrations-of-tree.d.ts +9 -0
  309. package/dist/merge/order/migrations-of-tree.d.ts.map +1 -0
  310. package/dist/merge/order/migrations-of-tree.js +25 -0
  311. package/dist/merge/order/migrations-of-tree.js.map +1 -0
  312. package/dist/merge/order/named-order.d.ts +11 -0
  313. package/dist/merge/order/named-order.d.ts.map +1 -0
  314. package/dist/merge/order/named-order.js +36 -0
  315. package/dist/merge/order/named-order.js.map +1 -0
  316. package/dist/merge/order/ordered-migration.d.ts +12 -0
  317. package/dist/merge/order/ordered-migration.d.ts.map +1 -0
  318. package/dist/merge/order/ordered-migration.js +2 -0
  319. package/dist/merge/order/ordered-migration.js.map +1 -0
  320. package/dist/merge/order/trunk-to-follow.d.ts +9 -0
  321. package/dist/merge/order/trunk-to-follow.d.ts.map +1 -0
  322. package/dist/merge/order/trunk-to-follow.js +2 -0
  323. package/dist/merge/order/trunk-to-follow.js.map +1 -0
  324. package/dist/merge/renumber-migrations.d.ts +14 -5
  325. package/dist/merge/renumber-migrations.d.ts.map +1 -1
  326. package/dist/merge/renumber-migrations.js +141 -60
  327. package/dist/merge/renumber-migrations.js.map +1 -1
  328. package/dist/merge/restamp-class.d.ts +9 -0
  329. package/dist/merge/restamp-class.d.ts.map +1 -0
  330. package/dist/merge/restamp-class.js +30 -0
  331. package/dist/merge/restamp-class.js.map +1 -0
  332. package/dist/migration/index.d.ts +1 -0
  333. package/dist/migration/index.d.ts.map +1 -1
  334. package/dist/migration/index.js +1 -0
  335. package/dist/migration/index.js.map +1 -1
  336. package/dist/migration/plan-replay.d.ts.map +1 -1
  337. package/dist/migration/plan-replay.js +2 -1
  338. package/dist/migration/plan-replay.js.map +1 -1
  339. package/dist/migration/refuse-taken-migration-name.d.ts +8 -0
  340. package/dist/migration/refuse-taken-migration-name.d.ts.map +1 -0
  341. package/dist/migration/refuse-taken-migration-name.js +22 -0
  342. package/dist/migration/refuse-taken-migration-name.js.map +1 -0
  343. package/dist/migration/replay-drizzle-migrations.d.ts +5 -0
  344. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  345. package/dist/migration/replay-drizzle-migrations.js +10 -2
  346. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  347. package/dist/migration/replay-plan.d.ts +2 -2
  348. package/dist/migration/replay-plan.d.ts.map +1 -1
  349. package/dist/migration/restore-migration-folder.d.ts +6 -2
  350. package/dist/migration/restore-migration-folder.d.ts.map +1 -1
  351. package/dist/migration/restore-migration-folder.js +14 -7
  352. package/dist/migration/restore-migration-folder.js.map +1 -1
  353. package/dist/migration/snapshot-migration-folder.d.ts +7 -0
  354. package/dist/migration/snapshot-migration-folder.d.ts.map +1 -0
  355. package/dist/migration/snapshot-migration-folder.js +12 -0
  356. package/dist/migration/snapshot-migration-folder.js.map +1 -0
  357. package/dist/move-to-module/before-the-move.d.ts +5 -0
  358. package/dist/move-to-module/before-the-move.d.ts.map +1 -0
  359. package/dist/move-to-module/before-the-move.js +13 -0
  360. package/dist/move-to-module/before-the-move.js.map +1 -0
  361. package/dist/move-to-module/closed-cycles.d.ts +21 -0
  362. package/dist/move-to-module/closed-cycles.d.ts.map +1 -0
  363. package/dist/move-to-module/closed-cycles.js +66 -0
  364. package/dist/move-to-module/closed-cycles.js.map +1 -0
  365. package/dist/move-to-module/cycle-lines.d.ts +7 -0
  366. package/dist/move-to-module/cycle-lines.d.ts.map +1 -0
  367. package/dist/move-to-module/cycle-lines.js +22 -0
  368. package/dist/move-to-module/cycle-lines.js.map +1 -0
  369. package/dist/move-to-module/cycle-refusal.d.ts +17 -0
  370. package/dist/move-to-module/cycle-refusal.d.ts.map +1 -0
  371. package/dist/move-to-module/cycle-refusal.js +25 -0
  372. package/dist/move-to-module/cycle-refusal.js.map +1 -0
  373. package/dist/move-to-module/index.d.ts +5 -0
  374. package/dist/move-to-module/index.d.ts.map +1 -1
  375. package/dist/move-to-module/index.js +4 -0
  376. package/dist/move-to-module/index.js.map +1 -1
  377. package/dist/move-to-module/module-imports-in.d.ts +11 -0
  378. package/dist/move-to-module/module-imports-in.d.ts.map +1 -0
  379. package/dist/move-to-module/module-imports-in.js +32 -0
  380. package/dist/move-to-module/module-imports-in.js.map +1 -0
  381. package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
  382. package/dist/move-to-module/moves-into-module.js +6 -18
  383. package/dist/move-to-module/moves-into-module.js.map +1 -1
  384. package/dist/move-to-module/place-in-module.d.ts +13 -0
  385. package/dist/move-to-module/place-in-module.d.ts.map +1 -0
  386. package/dist/move-to-module/place-in-module.js +24 -0
  387. package/dist/move-to-module/place-in-module.js.map +1 -0
  388. package/dist/move-to-module/watch-cycles.d.ts +19 -0
  389. package/dist/move-to-module/watch-cycles.d.ts.map +1 -0
  390. package/dist/move-to-module/watch-cycles.js +51 -0
  391. package/dist/move-to-module/watch-cycles.js.map +1 -0
  392. package/dist/run.js +1 -1
  393. package/dist/run.js.map +1 -1
  394. package/dist/slice/format-slice-verification.d.ts.map +1 -1
  395. package/dist/slice/format-slice-verification.js +11 -5
  396. package/dist/slice/format-slice-verification.js.map +1 -1
  397. package/dist/stack/alias-vars.d.ts +3 -1
  398. package/dist/stack/alias-vars.d.ts.map +1 -1
  399. package/dist/stack/alias-vars.js +5 -2
  400. package/dist/stack/alias-vars.js.map +1 -1
  401. package/dist/version.d.ts +1 -1
  402. package/dist/version.js +1 -1
  403. package/package.json +6 -6
  404. package/templates/file-upload/controller.spec.ts.tpl +66 -2
  405. package/templates/file-upload/controller.ts.tpl +12 -0
  406. package/templates/file-upload/handler.spec.ts.tpl +3 -3
  407. package/templates/init/README.md.tpl +20 -1
  408. package/templates/init/e2e/jest.e2e.config.js.tpl +5 -0
  409. package/templates/init/e2e/test-database-setup.ts.tpl +120 -0
  410. package/templates/init/e2e/vitest.e2e.config.ts.tpl +2 -1
  411. package/templates/init/platform/composition/compose-application.container.ts.tpl +5 -0
  412. package/templates/init/platform/composition/compose-application.manual.ts.tpl +20 -3
  413. package/templates/init/platform/composition/create-platform.manual.ts.tpl +6 -0
  414. package/templates/init/platform/composition/platform-options.manual.ts.tpl +11 -0
  415. package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
  416. package/templates/init/platform/composition/platform.module.container.ts.tpl +34 -0
  417. package/templates/init/platform/database/connect-to-database.drizzle.ts.tpl +7 -2
  418. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +8 -3
  419. package/templates/init/platform/database/open-test-database.knex.ts.tpl +8 -3
  420. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +8 -3
  421. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +8 -3
  422. package/templates/init/platform/database/read-model-tables.ts.tpl +67 -0
  423. package/templates/init/platform/database/test-database-budget.ts.tpl +108 -0
  424. package/templates/init/platform/database/test-database-clone.ts.tpl +52 -161
  425. package/templates/init/platform/database/test-database-copy.ts.tpl +76 -0
  426. package/templates/init/platform/database/test-database-emptying.ts.tpl +209 -0
  427. package/templates/init/platform/database/test-database-kept.ts.tpl +32 -0
  428. package/templates/init/platform/database/test-database-leftovers.ts.tpl +52 -0
  429. package/templates/init/platform/database/test-database-run.ts.tpl +99 -0
  430. package/templates/init/platform/database/test-database-server.ts.tpl +140 -0
  431. package/templates/init/platform/database/test-database-session.ts.tpl +141 -0
  432. package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -1
  433. package/templates/init/platform/resilience/default-policy.ts.tpl +8 -1
  434. package/templates/init/rules/infrastructure.md.tpl +2 -2
  435. package/templates/init/scripts/read-model-tables.ts.tpl +83 -0
  436. package/templates/nest-controller/upload.spec.ts.tpl +67 -2
  437. package/templates/nest-controller/upload.ts.tpl +12 -0
  438. package/templates/pipeline/package-scripts.json +1 -1
  439. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +5 -9
  440. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +5 -9
  441. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +5 -9
  442. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +5 -9
  443. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +5 -9
  444. package/templates/repository/drizzle/repository.ts.tpl +6 -9
@@ -0,0 +1,10 @@
1
+ /**
2
+ * What the relative path of a file of `test/support/` to its neighbour ends with under
3
+ * "importExtension": nothing for `none`, the `.ts` of the source otherwise. A test runner loads its
4
+ * global setup, and what that file imports, from the sources and before any alias exists: a `.js`
5
+ * names a file that is not there.
6
+ */
7
+ export function neighbourSuffix(importExtension) {
8
+ return importExtension === 'none' ? '' : '.ts';
9
+ }
10
+ //# sourceMappingURL=neighbour-suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-suffix.js","sourceRoot":"","sources":["../../src/alias/neighbour-suffix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,eAAuB;IACrD,OAAO,eAAe,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rewrite-aliases.d.ts","sourceRoot":"","sources":["../../src/build/rewrite-aliases.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAM1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,GAAG,aAAa,CAqC9F"}
1
+ {"version":3,"file":"rewrite-aliases.d.ts","sourceRoot":"","sources":["../../src/build/rewrite-aliases.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,GAAG,aAAa,CAuC9F"}
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { buildLayoutOf } from '../check/alias/build-layout-of.js';
4
+ import { compilerOptionsOf } from '../check/alias/compiler-options-of.js';
4
5
  import { walkDirectory } from '../check/project/walk-directory.js';
5
6
  import { CliError } from '../cli-error.js';
6
7
  import { emittedSpecifier } from './emitted-specifier.js';
@@ -17,6 +18,7 @@ export function rewriteAliases({ root, roots, suffix, project }) {
17
18
  if (!fs.existsSync(path.join(root, project))) {
18
19
  throw new CliError(`${project} does not exist.`, 'Name the tsconfig of the build with --project <file>.');
19
20
  }
21
+ refuseABuildThatEmitsNothing(root, project);
20
22
  const layout = buildLayoutOf({ root }, project);
21
23
  if (layout === undefined || !isDirectory(path.join(root, layout.outDir))) {
22
24
  throw noOutput(project);
@@ -39,6 +41,15 @@ export function rewriteAliases({ root, roots, suffix, project }) {
39
41
  specifiers: changed.reduce((sum, { count }) => sum + count, 0),
40
42
  };
41
43
  }
44
+ /**
45
+ * A configuration that resolves `noEmit` made the compiler write nothing, without an error: what its
46
+ * output directory holds, if anything, is an earlier build, and rewriting it would let it ship.
47
+ */
48
+ function refuseABuildThatEmitsNothing(root, project) {
49
+ if (compilerOptionsOf({ root }, project)?.['noEmit'] === true) {
50
+ throw new CliError(`${project} resolves "noEmit": true: the compiler wrote nothing with it, and what its output directory holds is not this build.`, `Write "noEmit": false under "compilerOptions" in ${project}, and "allowImportingTsExtensions": false when it inherits that one too: a configuration that extends the type check inherits what makes it emit nothing. Or name the tsconfig the build compiled with --project <file>.`);
51
+ }
52
+ }
42
53
  function noOutput(project) {
43
54
  return new CliError(`${project} names no output directory that exists.`, 'Compile first (`npm run build` chains the compiler and this command), or name the tsconfig of the build with --project.');
44
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rewrite-aliases.js","sourceRoot":"","sources":["../../src/build/rewrite-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAC5C,MAAM,KAAK,GAAG,EAAE,CAAC;AAWjB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAkB;IAC7E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,QAAQ,CAAC,GAAG,OAAO,kBAAkB,EAAE,uDAAuD,CAAC,CAAC;IAC5G,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAEhD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC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AAC;AACzE,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;AAC9E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-scripts.d.ts","sourceRoot":"","sources":["../../../src/check/alias/build-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAU7C,qHAAqH;AACrH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,CAsB9D"}
1
+ {"version":3,"file":"build-scripts.d.ts","sourceRoot":"","sources":["../../../src/check/alias/build-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,qHAAqH;AACrH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,CAmB9D"}
@@ -1,19 +1,15 @@
1
1
  import { lineOf } from '../support/line-of.js';
2
2
  import { ALIAS_FILES } from './alias-files.js';
3
3
  import { manifestScripts } from './manifest-scripts.js';
4
- /** The compiler, called by its name, by its path or through a wrapper script named after it. */
5
- const COMPILES = /(?:^|[\s/])tsc(?:\.[cm]?js)?(?=\s|$)/;
6
- const TYPE_CHECK_ONLY = /--noEmit(?:\s|$)/;
4
+ import { scriptSteps } from './script-steps.js';
7
5
  const REWRITES = /(?:^|[\s/])(?:ddd-ts-kit|kit\.[cm]?js|bin\.js)\s+build-aliases(?:\s|$)/;
8
- /** The build of the clients `ddd-ts-kit sdk` generates: their sources import one another by relative paths, no alias. */
9
- const BUILDS_CLIENTS = /\s-[bp]\s+(?:\.\/)?clients(?:\/|\s|$)/;
10
6
  /** A script that compiles and does not rewrite the aliases afterwards: plain `node` could not load what it emits. */
11
7
  export function buildScripts(inspected) {
12
8
  const read = manifestScripts(inspected);
13
9
  return (read?.scripts ?? []).flatMap(([name, command]) => {
14
- const steps = command.split('&&').map((step) => step.trim());
15
- const compiled = steps.findLastIndex((step) => COMPILES.test(step) && !TYPE_CHECK_ONLY.test(step) && !BUILDS_CLIENTS.test(step));
16
- if (compiled === -1 || steps.slice(compiled + 1).some((step) => REWRITES.test(step))) {
10
+ const steps = scriptSteps(command);
11
+ const compiled = steps.findLastIndex((step) => step.compiles);
12
+ if (compiled === -1 || steps.slice(compiled + 1).some((step) => REWRITES.test(step.text))) {
17
13
  return [];
18
14
  }
19
15
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"build-scripts.js","sourceRoot":"","sources":["../../../src/check/alias/build-scripts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,gGAAgG;AAChG,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,QAAQ,GAAG,wEAAwE,CAAC;AAC1F,yHAAyH;AACzH,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAE/D,qHAAqH;AACrH,MAAM,UAAU,YAAY,CAAC,SAAoB;IAC/C,MAAM,IAAI,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IAExC,OAAO,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE;QACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,C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O,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE;QACvD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE9D,IAAI,QAAQ,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC1F,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO;YACL,SAAS,CAAC,MAAM,CACd,EAAE,IAAI,EAAE,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,IAAI,GAAG,CAAC,EAAE,EAC3E,eAAe,IAAI,sEAAsE,EACzF,mMAAmM,CACpM;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import type { Project } from '../model/project.js';
2
2
  /**
3
- * The compiler options of a tsconfig of the project with those it extends from files of the
4
- * project, the nearest winning; nothing when the file is absent. `rootDir` and `outDir` are
5
- * answered from the project root.
3
+ * The compiler options of a tsconfig of the project with those it extends, from files of the
4
+ * project or from a package installed at its root, the nearest winning; nothing when the file is
5
+ * absent. `rootDir` and `outDir` are answered from the project root.
6
6
  */
7
7
  export declare function compilerOptionsOf(project: Pick<Project, 'root'>, file: string, depth?: number): Record<string, unknown> | undefined;
8
8
  //# sourceMappingURL=compiler-options-of.d.ts.map
@@ -4,9 +4,9 @@ import { parseJsonc } from './parse-jsonc.js';
4
4
  import { readProjectFile } from './read-project-file.js';
5
5
  const DEPTH = 8;
6
6
  /**
7
- * The compiler options of a tsconfig of the project with those it extends from files of the
8
- * project, the nearest winning; nothing when the file is absent. `rootDir` and `outDir` are
9
- * answered from the project root.
7
+ * The compiler options of a tsconfig of the project with those it extends, from files of the
8
+ * project or from a package installed at its root, the nearest winning; nothing when the file is
9
+ * absent. `rootDir` and `outDir` are answered from the project root.
10
10
  */
11
11
  export function compilerOptionsOf(project, file, depth = DEPTH) {
12
12
  const text = readProjectFile(project, file);
@@ -14,9 +14,7 @@ export function compilerOptionsOf(project, file, depth = DEPTH) {
14
14
  if (written === undefined || depth === 0) {
15
15
  return undefined;
16
16
  }
17
- const inherited = parentsOf(written['extends'])
18
- .filter((parent) => parent.startsWith('.'))
19
- .map((parent) => compilerOptionsOf(project, path.posix.join(path.posix.dirname(file), parent), depth - 1) ?? {});
17
+ const inherited = parentsOf(written['extends']).map((parent) => compilerOptionsOf(project, extended(project, file, parent), depth - 1) ?? {});
20
18
  const own = isRecord(written['compilerOptions']) ? written['compilerOptions'] : {};
21
19
  return [...inherited, fromRoot(own, path.posix.dirname(file))].reduce((merged, options) => ({ ...merged, ...options }), {});
22
20
  }
@@ -24,6 +22,19 @@ function parentsOf(extended) {
24
22
  const listed = Array.isArray(extended) ? extended : [extended];
25
23
  return listed.filter((parent) => typeof parent === 'string');
26
24
  }
25
+ /**
26
+ * The file an `extends` names, as the compiler finds it: a relative path as written, or completed
27
+ * with `.json`; anything else is a package, read in the `node_modules` of the project root as a
28
+ * file, a file without its `.json`, or a directory that holds a tsconfig.json. A package found
29
+ * through its `exports`, or in a `node_modules` above the root, is not followed.
30
+ */
31
+ function extended(project, file, parent) {
32
+ const named = parent.startsWith('.')
33
+ ? path.posix.join(path.posix.dirname(file), parent)
34
+ : path.posix.join('node_modules', parent);
35
+ const candidates = [named, `${named}.json`, ...(parent.startsWith('.') ? [] : [`${named}/tsconfig.json`])];
36
+ return candidates.find((candidate) => readProjectFile(project, candidate) !== undefined) ?? named;
37
+ }
27
38
  function fromRoot(options, directory) {
28
39
  const placed = ['rootDir', 'outDir'].flatMap((key) => {
29
40
  const value = options[key];
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-options-of.js","sourceRoot":"","sources":["../../../src/check/alias/compiler-options-of.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,KAAK,GAAG,CAAC,CAAC;AAEhB;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA8B,EAC9B,IAAY,EACZ,KAAK,GAAG,KAAK;IAEb,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAElE,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAC5C,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;SAC1C,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAEnH,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAA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AC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;AACvD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Violation } from '../model/violation.js';
2
+ import type { Inspected } from './inspected.js';
3
+ /**
4
+ * Under "importExtension": "js" the files of `test/support/` name their neighbours by the `.ts` of
5
+ * their source, which a test runner loads before any alias exists. The compiler refuses that ending
6
+ * unless tsconfig.json lets it read sources, which it accepts only of a configuration that emits
7
+ * nothing; a configuration that extends it and builds then has to emit again. Whatever the ending,
8
+ * a configuration a script compiles what ships with, and tsconfig.build.json, emit: one that
9
+ * resolves `noEmit` writes nothing without an error.
10
+ */
11
+ export declare function neighbourSources(inspected: Inspected): Violation[];
12
+ //# sourceMappingURL=neighbour-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-sources.d.ts","sourceRoot":"","sources":["../../../src/check/alias/neighbour-sources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiB7C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,CAiBlE"}
@@ -0,0 +1,80 @@
1
+ import fs from 'node:fs';
2
+ import { neighbourSuffix } from '../../alias/index.js';
3
+ import { loadSourceFile } from '../project/load-source-file.js';
4
+ import { ALIAS_FILES } from './alias-files.js';
5
+ import { compilerOptionsOf } from './compiler-options-of.js';
6
+ import { manifestScripts } from './manifest-scripts.js';
7
+ import { readProjectFile } from './read-project-file.js';
8
+ import { scriptSteps } from './script-steps.js';
9
+ const { build: BUILD, typeCheck: TYPE_CHECK } = ALIAS_FILES;
10
+ const SUPPORT = 'test/support';
11
+ /** A neighbour named by the `.ts` of its source, as `imports/alias-only` asks of a file directly under test/support/; a declaration file is no source. */
12
+ const NEIGHBOUR_SOURCE = /^\.\/[^/]+\.[cm]?ts$/;
13
+ const DECLARATION = /\.d\.[cm]?ts$/;
14
+ /** Either option lets the compiler read an import that ends with `.ts`. */
15
+ const READS_SOURCES = ['allowImportingTsExtensions', 'rewriteRelativeImportExtensions'];
16
+ /** What the compiler accepts `allowImportingTsExtensions` with, in a configuration that emits. */
17
+ const READS_AND_EMITS = ['rewriteRelativeImportExtensions', 'emitDeclarationOnly'];
18
+ /**
19
+ * Under "importExtension": "js" the files of `test/support/` name their neighbours by the `.ts` of
20
+ * their source, which a test runner loads before any alias exists. The compiler refuses that ending
21
+ * unless tsconfig.json lets it read sources, which it accepts only of a configuration that emits
22
+ * nothing; a configuration that extends it and builds then has to emit again. Whatever the ending,
23
+ * a configuration a script compiles what ships with, and tsconfig.build.json, emit: one that
24
+ * resolves `noEmit` writes nothing without an error.
25
+ */
26
+ export function neighbourSources(inspected) {
27
+ const { project } = inspected;
28
+ const checked = compilerOptionsOf(project, TYPE_CHECK);
29
+ if (checked === undefined) {
30
+ return [];
31
+ }
32
+ const asked = neighbourSuffix(project.config.importExtension) !== '' && namesANeighbourSource(inspected);
33
+ const reads = READS_SOURCES.some((option) => checked[option] === true);
34
+ return [
35
+ ...(asked && !reads ? [unread(inspected)] : []),
36
+ ...builds(inspected)
37
+ .filter((file) => silent(compilerOptionsOf(project, file)))
38
+ .map((file) => unbuilt(inspected, file)),
39
+ ];
40
+ }
41
+ /** The imports of each file are read as the other rules read them: a comment or a string names nothing. */
42
+ function namesANeighbourSource({ project }) {
43
+ return supportFiles(project.root).some((file) => {
44
+ const path = `${SUPPORT}/${file}`;
45
+ const { imports } = loadSourceFile(project.config, path, readProjectFile(project, path) ?? '');
46
+ return imports.some(({ specifier }) => NEIGHBOUR_SOURCE.test(specifier) && !DECLARATION.test(specifier));
47
+ });
48
+ }
49
+ function supportFiles(root) {
50
+ try {
51
+ return fs.readdirSync(`${root}/${SUPPORT}`).filter((file) => file.endsWith('.ts'));
52
+ }
53
+ catch {
54
+ return [];
55
+ }
56
+ }
57
+ /** tsconfig.build.json, and each configuration a script of package.json compiles what ships with. */
58
+ function builds(inspected) {
59
+ const steps = (manifestScripts(inspected)?.scripts ?? []).flatMap(([, command]) => scriptSteps(command));
60
+ return [...new Set([BUILD, ...steps.filter((step) => step.compiles).map((step) => step.project)])];
61
+ }
62
+ /**
63
+ * A build that emits nothing, or that the compiler refuses. `noEmit` wins over every other option;
64
+ * `allowImportingTsExtensions` is accepted of a build that rewrites those endings or emits
65
+ * declarations alone.
66
+ */
67
+ function silent(built = {}) {
68
+ const refused = built['allowImportingTsExtensions'] === true && !READS_AND_EMITS.some((option) => built[option] === true);
69
+ return built['noEmit'] === true || refused;
70
+ }
71
+ function unread({ report }) {
72
+ return report({ file: TYPE_CHECK, line: 1 }, `${TYPE_CHECK} does not let the compiler read the ".ts" by which a file of ${SUPPORT}/ names its neighbour.`, `Write "allowImportingTsExtensions": true and "noEmit": true under "compilerOptions" in ${TYPE_CHECK}, and both as false in ${BUILD}: a test runner loads its global setup, and what that file imports, from the sources and before any alias exists, so under "importExtension": "js" these files import one another by "./<name>.ts". The compiler accepts that ending only with the first option, and the first option only in a configuration that emits nothing; the build sets both back and emits what it emitted before.`);
73
+ }
74
+ function unbuilt({ report }, file) {
75
+ const remedy = file === TYPE_CHECK
76
+ ? `Compile ${BUILD} in that script (\`tsc -p ${BUILD}\`), which extends ${TYPE_CHECK} and sets "noEmit" and "allowImportingTsExtensions" back to false`
77
+ : `Write "allowImportingTsExtensions": false and "noEmit": false under "compilerOptions" in ${file}`;
78
+ return report({ file, line: 1 }, `${file} builds what ships and resolves "noEmit": true, or "allowImportingTsExtensions": true without what the compiler accepts it with: the build would write nothing, or be refused.`, `${remedy}: a configuration that type-checks emits nothing, the one it is extended by to build inherits that, and the compiler then writes no file without an error, so that an earlier output would ship. \`ddd-ts-kit build-aliases\` refuses such a build too.`);
79
+ }
80
+ //# sourceMappingURL=neighbour-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-sources.js","sourceRoot":"","sources":["../../../src/check/alias/neighbour-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;AAC5D,MAAM,OAAO,GAAG,cAAc,CAAC;AAC/B,0JAA0J;AAC1J,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAChD,MAAM,WAAW,GAAG,eAAe,CAAC;AACpC,2EAA2E;AAC3E,MAAM,aAAa,GAAG,CAAC,4BAA4B,EAAE,iCAAiC,CAAC,CAAC;AACxF,kGAAkG;AAClG,MAAM,eAAe,GAAG,CAAC,iCAAiC,EAAE,qBAAqB,CAAC,CAAC;AAInF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAoB;IACnD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IAC9B,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEvD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,O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GAAG,UAAU,gEAAgE,OAAO,wBAAwB,EAC5G,0FAA0F,UAAU,0BAA0B,KAAK,8XAA8X,CAClgB,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,EAAE,MAAM,EAAa,EAAE,IAAY;IAClD,MAAM,MAAM,GACV,IAAI,KAAK,UAAU;QACjB,CAAC,CAAC,WAAW,KAAK,6BAA6B,KAAK,sBAAsB,UAAU,mEAAmE;QACvJ,CAAC,CAAC,4FAA4F,IAAI,EAAE,CAAC;IAEzG,OAAO,MAAM,CACX,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,GAAG,IAAI,gLAAgL,EACvL,GAAG,MAAM,yPAAyP,CACnQ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** One step of a script of package.json. */
2
+ export interface ScriptStep {
3
+ readonly text: string;
4
+ /** It compiles what ships: not a type check, nor the build of the generated clients. */
5
+ readonly compiles: boolean;
6
+ /** The tsconfig it gives the compiler, from the project root: `tsconfig.json` when it names none. */
7
+ readonly project: string;
8
+ }
9
+ /** The steps of a script, as `&&` chains them, with what each one compiles. */
10
+ export declare function scriptSteps(command: string): ScriptStep[];
11
+ //# sourceMappingURL=script-steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-steps.d.ts","sourceRoot":"","sources":["../../../src/check/alias/script-steps.ts"],"names":[],"mappings":"AAUA,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,qGAAqG;IACrG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAOzD"}
@@ -0,0 +1,22 @@
1
+ /** The compiler, called by its name, by its path or through a wrapper script named after it. */
2
+ const COMPILES = /(?:^|[\s/])tsc(?:\.[cm]?js)?(?=\s|$)/;
3
+ const TYPE_CHECK_ONLY = /--noEmit(?:\s|$)/;
4
+ /** The build of the clients `ddd-ts-kit sdk` generates: their sources import one another by relative paths, no alias. */
5
+ const BUILDS_CLIENTS = /\s-[bp]\s+(?:\.\/)?clients(?:\/|\s|$)/;
6
+ /** The configuration a step gives the compiler: a file, or a directory that holds a tsconfig.json. */
7
+ const PROJECT = /\s(?:-p|--project|-b|--build)[=\s]+(?:\.\/)?([^\s-]\S*)/;
8
+ /** What the compiler reads when a step names none. */
9
+ const DEFAULT_PROJECT = 'tsconfig.json';
10
+ /** The steps of a script, as `&&` chains them, with what each one compiles. */
11
+ export function scriptSteps(command) {
12
+ return command.split('&&').map((step) => {
13
+ const text = step.trim();
14
+ const compiles = COMPILES.test(text) && !TYPE_CHECK_ONLY.test(text) && !BUILDS_CLIENTS.test(text);
15
+ return { text, compiles, project: projectOf(text) };
16
+ });
17
+ }
18
+ function projectOf(step) {
19
+ const given = PROJECT.exec(step)?.[1]?.replace(/\/$/, '') ?? DEFAULT_PROJECT;
20
+ return given.endsWith('.json') ? given : `${given}/${DEFAULT_PROJECT}`;
21
+ }
22
+ //# sourceMappingURL=script-steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-steps.js","sourceRoot":"","sources":["../../../src/check/alias/script-steps.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,yHAAyH;AACzH,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAC/D,sGAAsG;AACtG,MAAM,OAAO,GAAG,yDAAyD,CAAC;AAC1E,sDAAsD;AACtD,MAAM,eAAe,GAAG,eAAe,CAAC;AAWxC,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC;IAE7E,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,eAAe,EAAE,CAAC;AACzE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Project } from '../model/project.js';
2
+ import type { AdapterPolicy } from './adapter-policy.js';
3
+ /**
4
+ * What binds a port in the sources, with the policy stated there: the `@Adapter` or `@Gateway`
5
+ * above a class (declared style), or a `bind(Port)...` of a file that imports the container of the
6
+ * kit, whose chain `.toClass(Adapter).as(kind).with(...)` is read. A platform wired by hand
7
+ * (`platform.adapter(...)`) states nothing a text can follow.
8
+ */
9
+ export declare function adapterPolicies(project: Project): AdapterPolicy[];
10
+ //# sourceMappingURL=adapter-policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-policies.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiBtD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,EAAE,CAEjE"}
@@ -0,0 +1,104 @@
1
+ import { bindingCalls } from '../declarations/binding-calls.js';
2
+ import { classesOf } from '../declarations/classes-of.js';
3
+ import { optionOf } from '../declarations/option-of.js';
4
+ import { callArguments } from '../text/call-arguments.js';
5
+ import { chainEnd } from '../text/chain-end.js';
6
+ import { splitTopLevel } from '../text/split-top-level.js';
7
+ import { isUnderCondition } from './is-under-condition.js';
8
+ import { statedPolicy } from './stated-policy.js';
9
+ const ADAPTER_DECORATORS = ['Adapter', 'Gateway'];
10
+ const TO_CLASS = /\.\s*toClass\s*\(\s*([A-Za-z_$][\w$]*)/;
11
+ const AS = /\.\s*as\s*\(\s*/;
12
+ const WITH = /\.\s*with\s*\(/g;
13
+ const ASPECTS = /^aspects\s*:\s*\[([\s\S]*)\]$/;
14
+ const UNREADABLE = { ownPolicy: false, timeouts: [], readable: false };
15
+ /**
16
+ * What binds a port in the sources, with the policy stated there: the `@Adapter` or `@Gateway`
17
+ * above a class (declared style), or a `bind(Port)...` of a file that imports the container of the
18
+ * kit, whose chain `.toClass(Adapter).as(kind).with(...)` is read. A platform wired by hand
19
+ * (`platform.adapter(...)`) states nothing a text can follow.
20
+ */
21
+ export function adapterPolicies(project) {
22
+ return project.files.filter((file) => !file.isTest).flatMap((file) => [...declared(file), ...bound(file)]);
23
+ }
24
+ function declared(source) {
25
+ const { scan } = source;
26
+ return classesOf(scan).flatMap(({ name, decorations }) => decorations
27
+ .filter((decoration) => ADAPTER_DECORATORS.includes(decoration.name))
28
+ .map((decoration) => {
29
+ const given = splitTopLevel(scan.code.slice(decoration.open + 1, decoration.close)).map(({ code }) => code);
30
+ const kind = declaredKind(source, decoration);
31
+ return {
32
+ port: given[0] ?? '',
33
+ className: name,
34
+ source,
35
+ kind: kind.value,
36
+ kindKnown: kind.known,
37
+ conditional: false,
38
+ ...declaredPolicy(given.slice(1)),
39
+ };
40
+ }));
41
+ }
42
+ /** `@Gateway` is a gateway; `@Adapter` is `external` unless its `kind` says otherwise, as the kernel reads it. */
43
+ function declaredKind({ scan }, decoration) {
44
+ if (decoration.name === 'Gateway') {
45
+ return { known: true, value: 'gateway' };
46
+ }
47
+ const kind = optionOf(scan, decoration, 'kind');
48
+ return kind === undefined
49
+ ? { known: true, value: 'external' }
50
+ : { known: kind.literal !== undefined, value: kind.literal };
51
+ }
52
+ /** The policy the `aspects: [...]` of the options of a declaration states; a list of dependencies is not options. */
53
+ function declaredPolicy(settings) {
54
+ const options = settings.filter((setting) => !setting.startsWith('['));
55
+ const [first = '{}'] = options;
56
+ if (options.length > 1 || !first.startsWith('{')) {
57
+ return UNREADABLE;
58
+ }
59
+ const properties = splitTopLevel(first.slice(1, -1)).map(({ code }) => code);
60
+ const aspects = properties.find((property) => /^aspects(?![\w$])/.test(property));
61
+ const listed = aspects === undefined ? '' : ASPECTS.exec(aspects)?.[1];
62
+ return listed === undefined || properties.some((property) => property.startsWith('...'))
63
+ ? UNREADABLE
64
+ : statedPolicy(elementsOf(listed));
65
+ }
66
+ function bound(source) {
67
+ const { code } = source.scan;
68
+ return bindingCalls(source)
69
+ .filter(({ method }) => method === 'bind')
70
+ .map(({ open, token }) => {
71
+ const chain = code.slice(open, chainEnd(code, open + 1));
72
+ const kind = boundKind(source, chain, open);
73
+ return {
74
+ port: token?.code ?? '',
75
+ className: TO_CLASS.exec(chain)?.[1],
76
+ source,
77
+ kind: kind.value,
78
+ kindKnown: kind.known,
79
+ conditional: isUnderCondition(code, open),
80
+ ...statedPolicy([...chain.matchAll(WITH)].flatMap((call) => elementsOf(givenTo(chain, call)))),
81
+ };
82
+ });
83
+ }
84
+ /** The literal given to `.as(...)`; a binding without `.as(...)` has no kind, and no policy of a kind goes around it. */
85
+ function boundKind({ scan }, chain, chainStart) {
86
+ const as = AS.exec(chain);
87
+ if (as === null) {
88
+ return { known: true, value: undefined };
89
+ }
90
+ const kindAt = chainStart + as.index + as[0].length;
91
+ const literal = scan.strings.find((candidate) => candidate.start === kindAt);
92
+ return { known: literal !== undefined, value: literal?.value };
93
+ }
94
+ function givenTo(chain, call) {
95
+ return callArguments(chain, call.index + call[0].length - 1)
96
+ .map(({ code }) => code)
97
+ .join(', ');
98
+ }
99
+ function elementsOf(list) {
100
+ return splitTopLevel(list)
101
+ .map(({ code }) => code)
102
+ .filter((code) => code !== '');
103
+ }
104
+ //# sourceMappingURL=adapter-policies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-policies.js","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAElE,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAClD,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AAC1D,MAAM,EAAE,GAAG,iBAAiB,CAAC;AAC7B,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,OAAO,GAAG,+BAA+B,CAAC;AAChD,MAAM,UAAU,GAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAQrF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,OAAO,OA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SourceFile } from '../model/source-file.js';
2
+ import type { StatedPolicy } from './stated-policy.js';
3
+ /** What the declaration or the binding of one adapter says of its policy, read as text. */
4
+ export interface AdapterPolicy extends StatedPolicy {
5
+ /** The port the adapter is bound to. */
6
+ readonly port: string;
7
+ /** Undefined for a binding that names no class (`toValue`, `toFactory`): it still binds the port. */
8
+ readonly className: string | undefined;
9
+ /** The file that states it: the one of the class in the declared style, the one that binds it otherwise. */
10
+ readonly source: SourceFile;
11
+ /** `external`, `gateway`, or whatever is stated; undefined when the adapter has no kind, or one the text does not show. */
12
+ readonly kind: string | undefined;
13
+ /** False when the kind is written as anything but a literal. */
14
+ readonly kindKnown: boolean;
15
+ /** True for a binding that runs in some cases only: under a condition, a loop, a ternary, `when(...)`. */
16
+ readonly conditional: boolean;
17
+ }
18
+ //# sourceMappingURL=adapter-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-policy.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,2FAA2F;AAC3F,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,4GAA4G;IAC5G,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,2HAA2H;IAC3H,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,0GAA0G;IAC1G,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=adapter-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-policy.js","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policy.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether the call whose name ends at `at` runs in some cases only: its statement starts with
3
+ * anything but a receiver (a ternary, `&&`, an assignment), or a block around it is opened by a
4
+ * condition, a loop or `when(...)`. Read on blanked code.
5
+ */
6
+ export declare function isUnderCondition(code: string, at: number): boolean;
7
+ //# sourceMappingURL=is-under-condition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-under-condition.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/is-under-condition.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAQlE"}
@@ -0,0 +1,50 @@
1
+ /** What makes a statement, or the block it sits in, run in some cases only. */
2
+ const CONDITION = /(?<![\w$.])(?:if|else|switch|case|for|while|do|try|catch|finally|when)(?![\w$])/;
3
+ const RECEIVER = /^[\s\w$.]*$/;
4
+ /**
5
+ * Whether the call whose name ends at `at` runs in some cases only: its statement starts with
6
+ * anything but a receiver (a ternary, `&&`, an assignment), or a block around it is opened by a
7
+ * condition, a loop or `when(...)`. Read on blanked code.
8
+ */
9
+ export function isUnderCondition(code, at) {
10
+ const statement = code.slice(headStart(code, at), at);
11
+ return (!RECEIVER.test(statement) ||
12
+ CONDITION.test(statement) ||
13
+ enclosingHeads(code, at).some((head) => CONDITION.test(head)));
14
+ }
15
+ /** The text that opens each block around `at`, the innermost first. */
16
+ function enclosingHeads(code, at) {
17
+ const heads = [];
18
+ let closed = 0;
19
+ for (let index = at - 1; index >= 0; index -= 1) {
20
+ const char = code.charAt(index);
21
+ if (char === '}') {
22
+ closed += 1;
23
+ }
24
+ else if (char === '{' && closed > 0) {
25
+ closed -= 1;
26
+ }
27
+ else if (char === '{') {
28
+ heads.push(code.slice(headStart(code, index), index));
29
+ }
30
+ }
31
+ return heads;
32
+ }
33
+ /** Offset after the `;`, `{` or `}` that ends what comes before the statement or the block head ending at `end`, parentheses skipped. */
34
+ function headStart(code, end) {
35
+ let nested = 0;
36
+ for (let index = end - 1; index >= 0; index -= 1) {
37
+ const char = code.charAt(index);
38
+ if (char === ')') {
39
+ nested += 1;
40
+ }
41
+ else if (char === '(') {
42
+ nested -= 1;
43
+ }
44
+ else if (nested <= 0 && ';{}'.includes(char)) {
45
+ return index + 1;
46
+ }
47
+ }
48
+ return 0;
49
+ }
50
+ //# sourceMappingURL=is-under-condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-under-condition.js","sourceRoot":"","sources":["../../../src/check/aspects/is-under-condition.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,SAAS,GAAG,iFAAiF,CAAC;AACpG,MAAM,QAAQ,GAAG,aAAa,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,EAAU;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEtD,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QACzB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;QACzB,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,SAAS,cAAc,CAAC,IAAY,EAAE,EAAU;IAC9C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yIAAyI;AACzI,SAAS,SAAS,CAAC,IAAY,EAAE,GAAW;IAC1C,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,IAAI,KAAK,GAAG,GAAG,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,OAAO,KAAK,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** What a list of aspects states, each element read as text. */
2
+ export interface StatedPolicy {
3
+ /** Whether `ownPolicy(...)` is an element: the default policy of the platform then leaves the adapter alone. */
4
+ readonly ownPolicy: boolean;
5
+ /** The durations of the `timeout(<number>)` that are elements of the list or arguments of its `ownPolicy(...)`. */
6
+ readonly timeouts: readonly number[];
7
+ /**
8
+ * False when an element may state a limit or a policy the text does not show: a `timeout(...)` given
9
+ * anything but a number, an aspect under `when(...)`, a variable, a spread, a call of another name.
10
+ */
11
+ readonly readable: boolean;
12
+ }
13
+ /**
14
+ * Reads the elements of an aspects list. A `timeout(` nested in the options of another aspect is
15
+ * not an element, and states nothing here.
16
+ */
17
+ export declare function statedPolicy(elements: readonly string[]): StatedPolicy;
18
+ //# sourceMappingURL=stated-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stated-policy.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/stated-policy.ts"],"names":[],"mappings":"AAQA,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,gHAAgH;IAChH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,mHAAmH;IACnH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,CAStE"}