ddd-ts-kit 0.110.1 → 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 (633) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/README.fr.md +39 -8
  3. package/README.md +36 -7
  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/explain/tenancy-docs.d.ts.map +1 -1
  62. package/dist/check/explain/tenancy-docs.js +3 -1
  63. package/dist/check/explain/tenancy-docs.js.map +1 -1
  64. package/dist/check/files/kit-content-types.d.ts +12 -0
  65. package/dist/check/files/kit-content-types.d.ts.map +1 -0
  66. package/dist/check/files/kit-content-types.js +38 -0
  67. package/dist/check/files/kit-content-types.js.map +1 -0
  68. package/dist/check/files/upload-content-defect.d.ts +7 -0
  69. package/dist/check/files/upload-content-defect.d.ts.map +1 -0
  70. package/dist/check/files/upload-content-defect.js +2 -0
  71. package/dist/check/files/upload-content-defect.js.map +1 -0
  72. package/dist/check/files/upload-content-defects.d.ts +9 -0
  73. package/dist/check/files/upload-content-defects.d.ts.map +1 -0
  74. package/dist/check/files/upload-content-defects.js +54 -0
  75. package/dist/check/files/upload-content-defects.js.map +1 -0
  76. package/dist/check/files/upload-declaration.d.ts +7 -0
  77. package/dist/check/files/upload-declaration.d.ts.map +1 -0
  78. package/dist/check/files/upload-declaration.js +2 -0
  79. package/dist/check/files/upload-declaration.js.map +1 -0
  80. package/dist/check/files/upload-declarations.d.ts +9 -0
  81. package/dist/check/files/upload-declarations.d.ts.map +1 -0
  82. package/dist/check/files/upload-declarations.js +41 -0
  83. package/dist/check/files/upload-declarations.js.map +1 -0
  84. package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
  85. package/dist/check/fixtures/alias-declared-fixtures.js +95 -1
  86. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  87. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  88. package/dist/check/fixtures/fixtures.js +2 -0
  89. package/dist/check/fixtures/fixtures.js.map +1 -1
  90. package/dist/check/fixtures/imports-fixtures.d.ts.map +1 -1
  91. package/dist/check/fixtures/imports-fixtures.js +97 -0
  92. package/dist/check/fixtures/imports-fixtures.js.map +1 -1
  93. package/dist/check/fixtures/standard-fixtures.d.ts.map +1 -1
  94. package/dist/check/fixtures/standard-fixtures.js +42 -0
  95. package/dist/check/fixtures/standard-fixtures.js.map +1 -1
  96. package/dist/check/fixtures/tenancy-advisory-lock-fixtures.d.ts +9 -0
  97. package/dist/check/fixtures/tenancy-advisory-lock-fixtures.d.ts.map +1 -0
  98. package/dist/check/fixtures/tenancy-advisory-lock-fixtures.js +45 -0
  99. package/dist/check/fixtures/tenancy-advisory-lock-fixtures.js.map +1 -0
  100. package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
  101. package/dist/check/fixtures/tenancy-fixtures.js +2 -0
  102. package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
  103. package/dist/check/fixtures/upload-fixtures.d.ts +3 -0
  104. package/dist/check/fixtures/upload-fixtures.d.ts.map +1 -0
  105. package/dist/check/fixtures/upload-fixtures.js +94 -0
  106. package/dist/check/fixtures/upload-fixtures.js.map +1 -0
  107. package/dist/check/migrations/is-working-migration.d.ts +6 -0
  108. package/dist/check/migrations/is-working-migration.d.ts.map +1 -0
  109. package/dist/check/migrations/is-working-migration.js +8 -0
  110. package/dist/check/migrations/is-working-migration.js.map +1 -0
  111. package/dist/check/migrations/journal-entries.d.ts +4 -0
  112. package/dist/check/migrations/journal-entries.d.ts.map +1 -0
  113. package/dist/check/migrations/journal-entries.js +21 -0
  114. package/dist/check/migrations/journal-entries.js.map +1 -0
  115. package/dist/check/migrations/read-drizzle-migrations.d.ts.map +1 -1
  116. package/dist/check/migrations/read-drizzle-migrations.js +4 -9
  117. package/dist/check/migrations/read-drizzle-migrations.js.map +1 -1
  118. package/dist/check/modules/imported-modules.d.ts +4 -0
  119. package/dist/check/modules/imported-modules.d.ts.map +1 -0
  120. package/dist/check/modules/imported-modules.js +5 -0
  121. package/dist/check/modules/imported-modules.js.map +1 -0
  122. package/dist/check/modules/module-imports.d.ts +17 -0
  123. package/dist/check/modules/module-imports.d.ts.map +1 -0
  124. package/dist/check/modules/module-imports.js +23 -0
  125. package/dist/check/modules/module-imports.js.map +1 -0
  126. package/dist/check/project/assemble-project.d.ts.map +1 -1
  127. package/dist/check/project/assemble-project.js +1 -8
  128. package/dist/check/project/assemble-project.js.map +1 -1
  129. package/dist/check/project/file-severity.d.ts +4 -0
  130. package/dist/check/project/file-severity.d.ts.map +1 -0
  131. package/dist/check/project/file-severity.js +11 -0
  132. package/dist/check/project/file-severity.js.map +1 -0
  133. package/dist/check/project/load-project.js +1 -10
  134. package/dist/check/project/load-project.js.map +1 -1
  135. package/dist/check/project/not-in-the-tree.d.ts +10 -0
  136. package/dist/check/project/not-in-the-tree.d.ts.map +1 -0
  137. package/dist/check/project/not-in-the-tree.js +17 -0
  138. package/dist/check/project/not-in-the-tree.js.map +1 -0
  139. package/dist/check/project/skipped-directories.d.ts +3 -0
  140. package/dist/check/project/skipped-directories.d.ts.map +1 -0
  141. package/dist/check/project/skipped-directories.js +3 -0
  142. package/dist/check/project/skipped-directories.js.map +1 -0
  143. package/dist/check/project/walk-directory.d.ts.map +1 -1
  144. package/dist/check/project/walk-directory.js +1 -1
  145. package/dist/check/project/walk-directory.js.map +1 -1
  146. package/dist/check/rules/aspects-timeout-covers-delegate.d.ts +3 -0
  147. package/dist/check/rules/aspects-timeout-covers-delegate.d.ts.map +1 -0
  148. package/dist/check/rules/aspects-timeout-covers-delegate.js +179 -0
  149. package/dist/check/rules/aspects-timeout-covers-delegate.js.map +1 -0
  150. package/dist/check/rules/files-upload-content-rule.d.ts +3 -0
  151. package/dist/check/rules/files-upload-content-rule.d.ts.map +1 -0
  152. package/dist/check/rules/files-upload-content-rule.js +25 -0
  153. package/dist/check/rules/files-upload-content-rule.js.map +1 -0
  154. package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
  155. package/dist/check/rules/imports-alias-declared.js +3 -1
  156. package/dist/check/rules/imports-alias-declared.js.map +1 -1
  157. package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
  158. package/dist/check/rules/imports-alias-only.js +86 -7
  159. package/dist/check/rules/imports-alias-only.js.map +1 -1
  160. package/dist/check/rules/module-no-cycle.d.ts.map +1 -1
  161. package/dist/check/rules/module-no-cycle.js +12 -34
  162. package/dist/check/rules/module-no-cycle.js.map +1 -1
  163. package/dist/check/rules/privacy-declared-field.js +1 -1
  164. package/dist/check/rules/privacy-declared-field.js.map +1 -1
  165. package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -1
  166. package/dist/check/rules/tenancy-scoped-statement.js +11 -3
  167. package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
  168. package/dist/cli-error.d.ts +7 -2
  169. package/dist/cli-error.d.ts.map +1 -1
  170. package/dist/cli-error.js +8 -2
  171. package/dist/cli-error.js.map +1 -1
  172. package/dist/commands/generate.js +3 -0
  173. package/dist/commands/generate.js.map +1 -1
  174. package/dist/commands/knex-generate.d.ts.map +1 -1
  175. package/dist/commands/knex-generate.js +2 -1
  176. package/dist/commands/knex-generate.js.map +1 -1
  177. package/dist/commands/move-to-module.d.ts +6 -1
  178. package/dist/commands/move-to-module.d.ts.map +1 -1
  179. package/dist/commands/move-to-module.js +28 -3
  180. package/dist/commands/move-to-module.js.map +1 -1
  181. package/dist/commands/prisma-generate.d.ts.map +1 -1
  182. package/dist/commands/prisma-generate.js +2 -1
  183. package/dist/commands/prisma-generate.js.map +1 -1
  184. package/dist/commands/typeorm-generate.d.ts.map +1 -1
  185. package/dist/commands/typeorm-generate.js +2 -1
  186. package/dist/commands/typeorm-generate.js.map +1 -1
  187. package/dist/commands/verify-merge.d.ts +4 -2
  188. package/dist/commands/verify-merge.d.ts.map +1 -1
  189. package/dist/commands/verify-merge.js +8 -5
  190. package/dist/commands/verify-merge.js.map +1 -1
  191. package/dist/context-layout/context-layout.d.ts.map +1 -1
  192. package/dist/context-layout/context-layout.js +6 -0
  193. package/dist/context-layout/context-layout.js.map +1 -1
  194. package/dist/context-layout/module-moves.d.ts +8 -0
  195. package/dist/context-layout/module-moves.d.ts.map +1 -1
  196. package/dist/context-layout/module-moves.js +14 -3
  197. package/dist/context-layout/module-moves.js.map +1 -1
  198. package/dist/context-layout/runner-configs-by-hand.d.ts.map +1 -1
  199. package/dist/context-layout/runner-configs-by-hand.js +12 -0
  200. package/dist/context-layout/runner-configs-by-hand.js.map +1 -1
  201. package/dist/context-layout/settle.d.ts +9 -0
  202. package/dist/context-layout/settle.d.ts.map +1 -1
  203. package/dist/context-layout/settle.js +25 -3
  204. package/dist/context-layout/settle.js.map +1 -1
  205. package/dist/describe/read-adapters.d.ts.map +1 -1
  206. package/dist/describe/read-adapters.js +5 -1
  207. package/dist/describe/read-adapters.js.map +1 -1
  208. package/dist/describe/read-ports.js +8 -1
  209. package/dist/describe/read-ports.js.map +1 -1
  210. package/dist/generate/generate-options.d.ts +10 -0
  211. package/dist/generate/generate-options.d.ts.map +1 -1
  212. package/dist/generate/generate-options.js +3 -0
  213. package/dist/generate/generate-options.js.map +1 -1
  214. package/dist/generate/kind.d.ts +6 -0
  215. package/dist/generate/kind.d.ts.map +1 -1
  216. package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
  217. package/dist/generate/kinds/adapter-kind.js +12 -0
  218. package/dist/generate/kinds/adapter-kind.js.map +1 -1
  219. package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
  220. package/dist/generate/kinds/declare-storage.js +3 -57
  221. package/dist/generate/kinds/declare-storage.js.map +1 -1
  222. package/dist/generate/kinds/declare-table.d.ts +14 -0
  223. package/dist/generate/kinds/declare-table.d.ts.map +1 -0
  224. package/dist/generate/kinds/declare-table.js +72 -0
  225. package/dist/generate/kinds/declare-table.js.map +1 -0
  226. package/dist/generate/kinds/e2e/job-slug.d.ts +3 -0
  227. package/dist/generate/kinds/e2e/job-slug.d.ts.map +1 -0
  228. package/dist/generate/kinds/e2e/job-slug.js +8 -0
  229. package/dist/generate/kinds/e2e/job-slug.js.map +1 -0
  230. package/dist/generate/kinds/e2e/job-spec.d.ts +16 -0
  231. package/dist/generate/kinds/e2e/job-spec.d.ts.map +1 -0
  232. package/dist/generate/kinds/e2e/job-spec.js +54 -0
  233. package/dist/generate/kinds/e2e/job-spec.js.map +1 -0
  234. package/dist/generate/kinds/e2e/jobs-sending.d.ts +17 -5
  235. package/dist/generate/kinds/e2e/jobs-sending.d.ts.map +1 -1
  236. package/dist/generate/kinds/e2e/jobs-sending.js +15 -6
  237. package/dist/generate/kinds/e2e/jobs-sending.js.map +1 -1
  238. package/dist/generate/kinds/e2e/reaction-of.d.ts +5 -5
  239. package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -1
  240. package/dist/generate/kinds/e2e/reaction-of.js +15 -8
  241. package/dist/generate/kinds/e2e/reaction-of.js.map +1 -1
  242. package/dist/generate/kinds/e2e/starting-jobs.d.ts +10 -0
  243. package/dist/generate/kinds/e2e/starting-jobs.d.ts.map +1 -0
  244. package/dist/generate/kinds/e2e/starting-jobs.js +33 -0
  245. package/dist/generate/kinds/e2e/starting-jobs.js.map +1 -0
  246. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  247. package/dist/generate/kinds/e2e-kind.js +47 -35
  248. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  249. package/dist/generate/kinds/file-upload/upload-file-vars.d.ts +9 -0
  250. package/dist/generate/kinds/file-upload/upload-file-vars.d.ts.map +1 -0
  251. package/dist/generate/kinds/file-upload/upload-file-vars.js +39 -0
  252. package/dist/generate/kinds/file-upload/upload-file-vars.js.map +1 -0
  253. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -1
  254. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +2 -1
  255. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -1
  256. package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -1
  257. package/dist/generate/kinds/file-upload/write-upload-controller.js +2 -1
  258. package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -1
  259. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  260. package/dist/generate/kinds/file-upload-kind.js +5 -3
  261. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  262. package/dist/generate/kinds/generate-repository.d.ts +8 -0
  263. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  264. package/dist/generate/kinds/generate-repository.js +2 -13
  265. package/dist/generate/kinds/generate-repository.js.map +1 -1
  266. package/dist/generate/kinds/note-the-migration.d.ts +4 -0
  267. package/dist/generate/kinds/note-the-migration.d.ts.map +1 -0
  268. package/dist/generate/kinds/note-the-migration.js +13 -0
  269. package/dist/generate/kinds/note-the-migration.js.map +1 -0
  270. package/dist/generate/kinds/personal-data/columns-of-table.d.ts +18 -0
  271. package/dist/generate/kinds/personal-data/columns-of-table.d.ts.map +1 -0
  272. package/dist/generate/kinds/personal-data/columns-of-table.js +31 -0
  273. package/dist/generate/kinds/personal-data/columns-of-table.js.map +1 -0
  274. package/dist/generate/kinds/personal-data/declare-personal-data.d.ts.map +1 -1
  275. package/dist/generate/kinds/personal-data/declare-personal-data.js +7 -52
  276. package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -1
  277. package/dist/generate/kinds/personal-data/declare-table-personal-fields.d.ts +11 -0
  278. package/dist/generate/kinds/personal-data/declare-table-personal-fields.d.ts.map +1 -0
  279. package/dist/generate/kinds/personal-data/declare-table-personal-fields.js +71 -0
  280. package/dist/generate/kinds/personal-data/declare-table-personal-fields.js.map +1 -0
  281. package/dist/generate/kinds/personal-data/personal-request-of-table.d.ts +11 -0
  282. package/dist/generate/kinds/personal-data/personal-request-of-table.d.ts.map +1 -0
  283. package/dist/generate/kinds/personal-data/personal-request-of-table.js +20 -0
  284. package/dist/generate/kinds/personal-data/personal-request-of-table.js.map +1 -0
  285. package/dist/generate/kinds/personal-data/personal-vars.d.ts +7 -0
  286. package/dist/generate/kinds/personal-data/personal-vars.d.ts.map +1 -1
  287. package/dist/generate/kinds/personal-data/personal-vars.js +14 -11
  288. package/dist/generate/kinds/personal-data/personal-vars.js.map +1 -1
  289. package/dist/generate/kinds/personal-data/schema-table.d.ts +13 -0
  290. package/dist/generate/kinds/personal-data/schema-table.d.ts.map +1 -0
  291. package/dist/generate/kinds/personal-data/schema-table.js +2 -0
  292. package/dist/generate/kinds/personal-data/schema-table.js.map +1 -0
  293. package/dist/generate/kinds/personal-data/schema-tables-of.d.ts +9 -0
  294. package/dist/generate/kinds/personal-data/schema-tables-of.d.ts.map +1 -0
  295. package/dist/generate/kinds/personal-data/schema-tables-of.js +78 -0
  296. package/dist/generate/kinds/personal-data/schema-tables-of.js.map +1 -0
  297. package/dist/generate/kinds/personal-data/table-of-schema.d.ts +15 -0
  298. package/dist/generate/kinds/personal-data/table-of-schema.d.ts.map +1 -0
  299. package/dist/generate/kinds/personal-data/table-of-schema.js +39 -0
  300. package/dist/generate/kinds/personal-data/table-of-schema.js.map +1 -0
  301. package/dist/generate/kinds/personal-data/write-personal-declaration.d.ts +20 -0
  302. package/dist/generate/kinds/personal-data/write-personal-declaration.d.ts.map +1 -0
  303. package/dist/generate/kinds/personal-data/write-personal-declaration.js +63 -0
  304. package/dist/generate/kinds/personal-data/write-personal-declaration.js.map +1 -0
  305. package/dist/generate/kinds/personal-fields-kind.d.ts +3 -0
  306. package/dist/generate/kinds/personal-fields-kind.d.ts.map +1 -0
  307. package/dist/generate/kinds/personal-fields-kind.js +15 -0
  308. package/dist/generate/kinds/personal-fields-kind.js.map +1 -0
  309. package/dist/generate/kinds/projection-kind.d.ts.map +1 -1
  310. package/dist/generate/kinds/projection-kind.js +2 -1
  311. package/dist/generate/kinds/projection-kind.js.map +1 -1
  312. package/dist/generate/kinds/read-model/field-lines.d.ts +11 -0
  313. package/dist/generate/kinds/read-model/field-lines.d.ts.map +1 -0
  314. package/dist/generate/kinds/read-model/field-lines.js +85 -0
  315. package/dist/generate/kinds/read-model/field-lines.js.map +1 -0
  316. package/dist/generate/kinds/read-model/list-read-model.d.ts +17 -0
  317. package/dist/generate/kinds/read-model/list-read-model.d.ts.map +1 -0
  318. package/dist/generate/kinds/read-model/list-read-model.js +22 -0
  319. package/dist/generate/kinds/read-model/list-read-model.js.map +1 -0
  320. package/dist/generate/kinds/read-model/live-rows-check.d.ts +22 -0
  321. package/dist/generate/kinds/read-model/live-rows-check.d.ts.map +1 -0
  322. package/dist/generate/kinds/read-model/live-rows-check.js +47 -0
  323. package/dist/generate/kinds/read-model/live-rows-check.js.map +1 -0
  324. package/dist/generate/kinds/read-model/read-model-fields.d.ts +19 -0
  325. package/dist/generate/kinds/read-model/read-model-fields.d.ts.map +1 -0
  326. package/dist/generate/kinds/read-model/read-model-fields.js +31 -0
  327. package/dist/generate/kinds/read-model/read-model-fields.js.map +1 -0
  328. package/dist/generate/kinds/read-model/read-model-store.d.ts +24 -0
  329. package/dist/generate/kinds/read-model/read-model-store.d.ts.map +1 -0
  330. package/dist/generate/kinds/read-model/read-model-store.js +39 -0
  331. package/dist/generate/kinds/read-model/read-model-store.js.map +1 -0
  332. package/dist/generate/kinds/read-model/read-model-table.d.ts +11 -0
  333. package/dist/generate/kinds/read-model/read-model-table.d.ts.map +1 -0
  334. package/dist/generate/kinds/read-model/read-model-table.js +2 -0
  335. package/dist/generate/kinds/read-model/read-model-table.js.map +1 -0
  336. package/dist/generate/kinds/read-model-kind.d.ts +3 -0
  337. package/dist/generate/kinds/read-model-kind.d.ts.map +1 -0
  338. package/dist/generate/kinds/read-model-kind.js +103 -0
  339. package/dist/generate/kinds/read-model-kind.js.map +1 -0
  340. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  341. package/dist/generate/kinds/service-kind.js +8 -0
  342. package/dist/generate/kinds/service-kind.js.map +1 -1
  343. package/dist/generate/kinds/wire-context.d.ts.map +1 -1
  344. package/dist/generate/kinds/wire-context.js +4 -0
  345. package/dist/generate/kinds/wire-context.js.map +1 -1
  346. package/dist/generate/kinds.d.ts.map +1 -1
  347. package/dist/generate/kinds.js +4 -0
  348. package/dist/generate/kinds.js.map +1 -1
  349. package/dist/generate/shared-writes.d.ts.map +1 -1
  350. package/dist/generate/shared-writes.js +9 -0
  351. package/dist/generate/shared-writes.js.map +1 -1
  352. package/dist/help/tool-notes.d.ts.map +1 -1
  353. package/dist/help/tool-notes.js +7 -2
  354. package/dist/help/tool-notes.js.map +1 -1
  355. package/dist/help/usage.js +1 -1
  356. package/dist/help/work-notes.d.ts.map +1 -1
  357. package/dist/help/work-notes.js +9 -2
  358. package/dist/help/work-notes.js.map +1 -1
  359. package/dist/init/files/end-to-end-files.d.ts.map +1 -1
  360. package/dist/init/files/end-to-end-files.js +3 -0
  361. package/dist/init/files/end-to-end-files.js.map +1 -1
  362. package/dist/init/files/persistence-files.d.ts.map +1 -1
  363. package/dist/init/files/persistence-files.js +8 -0
  364. package/dist/init/files/persistence-files.js.map +1 -1
  365. package/dist/init/files/script-files.d.ts +2 -1
  366. package/dist/init/files/script-files.d.ts.map +1 -1
  367. package/dist/init/files/script-files.js +6 -1
  368. package/dist/init/files/script-files.js.map +1 -1
  369. package/dist/init/is-team-file.d.ts +2 -2
  370. package/dist/init/is-team-file.d.ts.map +1 -1
  371. package/dist/init/is-team-file.js +5 -4
  372. package/dist/init/is-team-file.js.map +1 -1
  373. package/dist/init/list-read-models.d.ts +17 -0
  374. package/dist/init/list-read-models.d.ts.map +1 -0
  375. package/dist/init/list-read-models.js +74 -0
  376. package/dist/init/list-read-models.js.map +1 -0
  377. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  378. package/dist/init/manifest/database-scripts.js +8 -0
  379. package/dist/init/manifest/database-scripts.js.map +1 -1
  380. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  381. package/dist/init/manifest/dependencies-for.js +10 -7
  382. package/dist/init/manifest/dependencies-for.js.map +1 -1
  383. package/dist/init/manifest/versions.js +25 -25
  384. package/dist/init/rewire-contexts.d.ts +4 -2
  385. package/dist/init/rewire-contexts.d.ts.map +1 -1
  386. package/dist/init/rewire-contexts.js +10 -2
  387. package/dist/init/rewire-contexts.js.map +1 -1
  388. package/dist/init/run-init.js +1 -1
  389. package/dist/init/run-init.js.map +1 -1
  390. package/dist/init/wiring-notes.js +1 -1
  391. package/dist/init/wiring-notes.js.map +1 -1
  392. package/dist/init/write-type-script-configs.d.ts +3 -1
  393. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  394. package/dist/init/write-type-script-configs.js +14 -2
  395. package/dist/init/write-type-script-configs.js.map +1 -1
  396. package/dist/layout/fit-block.js +4 -0
  397. package/dist/layout/fit-block.js.map +1 -1
  398. package/dist/merge/format-merge-report.js +5 -2
  399. package/dist/merge/format-merge-report.js.map +1 -1
  400. package/dist/merge/land-drizzle.d.ts +4 -0
  401. package/dist/merge/land-drizzle.d.ts.map +1 -1
  402. package/dist/merge/land-drizzle.js +6 -1
  403. package/dist/merge/land-drizzle.js.map +1 -1
  404. package/dist/merge/land-up-to-date.d.ts +15 -0
  405. package/dist/merge/land-up-to-date.d.ts.map +1 -0
  406. package/dist/merge/land-up-to-date.js +76 -0
  407. package/dist/merge/land-up-to-date.js.map +1 -0
  408. package/dist/merge/lost/format-merge-verification.d.ts +2 -1
  409. package/dist/merge/lost/format-merge-verification.d.ts.map +1 -1
  410. package/dist/merge/lost/format-merge-verification.js +13 -2
  411. package/dist/merge/lost/format-merge-verification.js.map +1 -1
  412. package/dist/merge/lost/merge-verification.d.ts +4 -0
  413. package/dist/merge/lost/merge-verification.d.ts.map +1 -1
  414. package/dist/merge/lost/verify-merges.d.ts +2 -1
  415. package/dist/merge/lost/verify-merges.d.ts.map +1 -1
  416. package/dist/merge/lost/verify-merges.js +10 -4
  417. package/dist/merge/lost/verify-merges.js.map +1 -1
  418. package/dist/merge/merge-trunk.d.ts +2 -1
  419. package/dist/merge/merge-trunk.d.ts.map +1 -1
  420. package/dist/merge/merge-trunk.js +5 -2
  421. package/dist/merge/merge-trunk.js.map +1 -1
  422. package/dist/merge/next-steps.d.ts +3 -0
  423. package/dist/merge/next-steps.d.ts.map +1 -1
  424. package/dist/merge/next-steps.js +3 -0
  425. package/dist/merge/next-steps.js.map +1 -1
  426. package/dist/merge/order/applied-under-old-name.d.ts +13 -0
  427. package/dist/merge/order/applied-under-old-name.d.ts.map +1 -0
  428. package/dist/merge/order/applied-under-old-name.js +14 -0
  429. package/dist/merge/order/applied-under-old-name.js.map +1 -0
  430. package/dist/merge/order/comes-after.d.ts +8 -0
  431. package/dist/merge/order/comes-after.d.ts.map +1 -0
  432. package/dist/merge/order/comes-after.js +9 -0
  433. package/dist/merge/order/comes-after.js.map +1 -0
  434. package/dist/merge/order/drizzle-order.d.ts +11 -0
  435. package/dist/merge/order/drizzle-order.d.ts.map +1 -0
  436. package/dist/merge/order/drizzle-order.js +64 -0
  437. package/dist/merge/order/drizzle-order.js.map +1 -0
  438. package/dist/merge/order/in-order.d.ts +4 -0
  439. package/dist/merge/order/in-order.d.ts.map +1 -0
  440. package/dist/merge/order/in-order.js +6 -0
  441. package/dist/merge/order/in-order.js.map +1 -0
  442. package/dist/merge/order/migration-order-finding.d.ts +18 -0
  443. package/dist/merge/order/migration-order-finding.d.ts.map +1 -0
  444. package/dist/merge/order/migration-order-finding.js +2 -0
  445. package/dist/merge/order/migration-order-finding.js.map +1 -0
  446. package/dist/merge/order/migration-order.d.ts +12 -0
  447. package/dist/merge/order/migration-order.d.ts.map +1 -0
  448. package/dist/merge/order/migration-order.js +21 -0
  449. package/dist/merge/order/migration-order.js.map +1 -0
  450. package/dist/merge/order/migrations-of-commit.d.ts +7 -0
  451. package/dist/merge/order/migrations-of-commit.d.ts.map +1 -0
  452. package/dist/merge/order/migrations-of-commit.js +43 -0
  453. package/dist/merge/order/migrations-of-commit.js.map +1 -0
  454. package/dist/merge/order/migrations-of-tree.d.ts +9 -0
  455. package/dist/merge/order/migrations-of-tree.d.ts.map +1 -0
  456. package/dist/merge/order/migrations-of-tree.js +25 -0
  457. package/dist/merge/order/migrations-of-tree.js.map +1 -0
  458. package/dist/merge/order/named-order.d.ts +11 -0
  459. package/dist/merge/order/named-order.d.ts.map +1 -0
  460. package/dist/merge/order/named-order.js +36 -0
  461. package/dist/merge/order/named-order.js.map +1 -0
  462. package/dist/merge/order/ordered-migration.d.ts +12 -0
  463. package/dist/merge/order/ordered-migration.d.ts.map +1 -0
  464. package/dist/merge/order/ordered-migration.js +2 -0
  465. package/dist/merge/order/ordered-migration.js.map +1 -0
  466. package/dist/merge/order/trunk-to-follow.d.ts +9 -0
  467. package/dist/merge/order/trunk-to-follow.d.ts.map +1 -0
  468. package/dist/merge/order/trunk-to-follow.js +2 -0
  469. package/dist/merge/order/trunk-to-follow.js.map +1 -0
  470. package/dist/merge/renumber-migrations.d.ts +14 -5
  471. package/dist/merge/renumber-migrations.d.ts.map +1 -1
  472. package/dist/merge/renumber-migrations.js +141 -60
  473. package/dist/merge/renumber-migrations.js.map +1 -1
  474. package/dist/merge/restamp-class.d.ts +9 -0
  475. package/dist/merge/restamp-class.d.ts.map +1 -0
  476. package/dist/merge/restamp-class.js +30 -0
  477. package/dist/merge/restamp-class.js.map +1 -0
  478. package/dist/migration/index.d.ts +1 -0
  479. package/dist/migration/index.d.ts.map +1 -1
  480. package/dist/migration/index.js +1 -0
  481. package/dist/migration/index.js.map +1 -1
  482. package/dist/migration/plan-replay.d.ts.map +1 -1
  483. package/dist/migration/plan-replay.js +2 -1
  484. package/dist/migration/plan-replay.js.map +1 -1
  485. package/dist/migration/refuse-taken-migration-name.d.ts +8 -0
  486. package/dist/migration/refuse-taken-migration-name.d.ts.map +1 -0
  487. package/dist/migration/refuse-taken-migration-name.js +22 -0
  488. package/dist/migration/refuse-taken-migration-name.js.map +1 -0
  489. package/dist/migration/replay-drizzle-migrations.d.ts +5 -0
  490. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  491. package/dist/migration/replay-drizzle-migrations.js +10 -2
  492. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  493. package/dist/migration/replay-plan.d.ts +2 -2
  494. package/dist/migration/replay-plan.d.ts.map +1 -1
  495. package/dist/migration/restore-migration-folder.d.ts +6 -2
  496. package/dist/migration/restore-migration-folder.d.ts.map +1 -1
  497. package/dist/migration/restore-migration-folder.js +14 -7
  498. package/dist/migration/restore-migration-folder.js.map +1 -1
  499. package/dist/migration/snapshot-migration-folder.d.ts +7 -0
  500. package/dist/migration/snapshot-migration-folder.d.ts.map +1 -0
  501. package/dist/migration/snapshot-migration-folder.js +12 -0
  502. package/dist/migration/snapshot-migration-folder.js.map +1 -0
  503. package/dist/move-to-module/before-the-move.d.ts +5 -0
  504. package/dist/move-to-module/before-the-move.d.ts.map +1 -0
  505. package/dist/move-to-module/before-the-move.js +13 -0
  506. package/dist/move-to-module/before-the-move.js.map +1 -0
  507. package/dist/move-to-module/closed-cycles.d.ts +21 -0
  508. package/dist/move-to-module/closed-cycles.d.ts.map +1 -0
  509. package/dist/move-to-module/closed-cycles.js +66 -0
  510. package/dist/move-to-module/closed-cycles.js.map +1 -0
  511. package/dist/move-to-module/cycle-lines.d.ts +7 -0
  512. package/dist/move-to-module/cycle-lines.d.ts.map +1 -0
  513. package/dist/move-to-module/cycle-lines.js +22 -0
  514. package/dist/move-to-module/cycle-lines.js.map +1 -0
  515. package/dist/move-to-module/cycle-refusal.d.ts +17 -0
  516. package/dist/move-to-module/cycle-refusal.d.ts.map +1 -0
  517. package/dist/move-to-module/cycle-refusal.js +25 -0
  518. package/dist/move-to-module/cycle-refusal.js.map +1 -0
  519. package/dist/move-to-module/index.d.ts +5 -0
  520. package/dist/move-to-module/index.d.ts.map +1 -1
  521. package/dist/move-to-module/index.js +4 -0
  522. package/dist/move-to-module/index.js.map +1 -1
  523. package/dist/move-to-module/module-imports-in.d.ts +11 -0
  524. package/dist/move-to-module/module-imports-in.d.ts.map +1 -0
  525. package/dist/move-to-module/module-imports-in.js +32 -0
  526. package/dist/move-to-module/module-imports-in.js.map +1 -0
  527. package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
  528. package/dist/move-to-module/moves-into-module.js +6 -18
  529. package/dist/move-to-module/moves-into-module.js.map +1 -1
  530. package/dist/move-to-module/place-in-module.d.ts +13 -0
  531. package/dist/move-to-module/place-in-module.d.ts.map +1 -0
  532. package/dist/move-to-module/place-in-module.js +24 -0
  533. package/dist/move-to-module/place-in-module.js.map +1 -0
  534. package/dist/move-to-module/watch-cycles.d.ts +19 -0
  535. package/dist/move-to-module/watch-cycles.d.ts.map +1 -0
  536. package/dist/move-to-module/watch-cycles.js +51 -0
  537. package/dist/move-to-module/watch-cycles.js.map +1 -0
  538. package/dist/presets/no-flags.d.ts.map +1 -1
  539. package/dist/presets/no-flags.js +1 -0
  540. package/dist/presets/no-flags.js.map +1 -1
  541. package/dist/run.js +1 -1
  542. package/dist/run.js.map +1 -1
  543. package/dist/slice/format-slice-verification.d.ts.map +1 -1
  544. package/dist/slice/format-slice-verification.js +11 -5
  545. package/dist/slice/format-slice-verification.js.map +1 -1
  546. package/dist/stack/alias-vars.d.ts +3 -1
  547. package/dist/stack/alias-vars.d.ts.map +1 -1
  548. package/dist/stack/alias-vars.js +5 -2
  549. package/dist/stack/alias-vars.js.map +1 -1
  550. package/dist/stack/end-to-end-vars.d.ts +9 -0
  551. package/dist/stack/end-to-end-vars.d.ts.map +1 -0
  552. package/dist/stack/end-to-end-vars.js +32 -0
  553. package/dist/stack/end-to-end-vars.js.map +1 -0
  554. package/dist/stack/stack-vars.d.ts.map +1 -1
  555. package/dist/stack/stack-vars.js +2 -0
  556. package/dist/stack/stack-vars.js.map +1 -1
  557. package/dist/version.d.ts +1 -1
  558. package/dist/version.js +1 -1
  559. package/dist/worker/briefing-of.js +2 -2
  560. package/dist/worker/briefing-of.js.map +1 -1
  561. package/package.json +6 -6
  562. package/templates/e2e/e2e-background-job-case.ts.tpl +12 -0
  563. package/templates/e2e/e2e-job.spec.ts.tpl +3 -3
  564. package/templates/file-upload/controller.spec.ts.tpl +66 -2
  565. package/templates/file-upload/controller.ts.tpl +12 -0
  566. package/templates/file-upload/handler.spec.ts.tpl +3 -3
  567. package/templates/init/README.md.tpl +20 -1
  568. package/templates/init/e2e/jest.e2e.config.js.tpl +29 -5
  569. package/templates/init/e2e/start-application.database.ts.tpl +40 -2
  570. package/templates/init/e2e/start-application.memory.ts.tpl +36 -0
  571. package/templates/init/e2e/test-database-setup.ts.tpl +120 -0
  572. package/templates/init/e2e/vitest.e2e.config.ts.tpl +14 -4
  573. package/templates/init/platform/composition/compose-application.container.ts.tpl +5 -0
  574. package/templates/init/platform/composition/compose-application.manual.ts.tpl +20 -3
  575. package/templates/init/platform/composition/create-platform.manual.ts.tpl +6 -0
  576. package/templates/init/platform/composition/platform-options.manual.ts.tpl +11 -0
  577. package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
  578. package/templates/init/platform/composition/platform.module.container.ts.tpl +34 -0
  579. package/templates/init/platform/database/connect-to-database.drizzle.ts.tpl +7 -2
  580. package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +27 -4
  581. package/templates/init/platform/database/open-test-database.knex.ts.tpl +26 -3
  582. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +27 -3
  583. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +27 -3
  584. package/templates/init/platform/database/read-model-tables.ts.tpl +67 -0
  585. package/templates/init/platform/database/test-database-budget.ts.tpl +108 -0
  586. package/templates/init/platform/database/test-database-clone.ts.tpl +75 -0
  587. package/templates/init/platform/database/test-database-copy.ts.tpl +76 -0
  588. package/templates/init/platform/database/test-database-emptying.ts.tpl +209 -0
  589. package/templates/init/platform/database/test-database-kept.ts.tpl +32 -0
  590. package/templates/init/platform/database/test-database-leftovers.ts.tpl +52 -0
  591. package/templates/init/platform/database/test-database-run.ts.tpl +99 -0
  592. package/templates/init/platform/database/test-database-server.ts.tpl +140 -0
  593. package/templates/init/platform/database/test-database-session.ts.tpl +141 -0
  594. package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -1
  595. package/templates/init/platform/jobs/background-jobs.ts.tpl +4 -0
  596. package/templates/init/platform/jobs/create-background-work.ts.tpl +1 -0
  597. package/templates/init/platform/resilience/default-policy.ts.tpl +8 -1
  598. package/templates/init/rules/infrastructure.md.tpl +3 -3
  599. package/templates/init/scripts/read-model-tables.ts.tpl +83 -0
  600. package/templates/nest-controller/upload.spec.ts.tpl +67 -2
  601. package/templates/nest-controller/upload.ts.tpl +12 -0
  602. package/templates/personal-data/declaration.drizzle.ts.tpl +6 -1
  603. package/templates/personal-data/declaration.knex.ts.tpl +14 -1
  604. package/templates/personal-data/declaration.prisma.ts.tpl +6 -1
  605. package/templates/personal-data/declaration.typeorm.ts.tpl +21 -1
  606. package/templates/personal-data/spec.table.ts.tpl +39 -0
  607. package/templates/pipeline/package-scripts.json +1 -1
  608. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +5 -9
  609. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +5 -9
  610. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +5 -9
  611. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +5 -9
  612. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +5 -9
  613. package/templates/projection/projection.manual.ts.tpl +2 -2
  614. package/templates/projection/projection.ts.tpl +2 -2
  615. package/templates/read-model/contract.spec.ts.tpl +95 -0
  616. package/templates/read-model/drizzle/schema.ts.tpl +8 -0
  617. package/templates/read-model/drizzle/store.ts.tpl +41 -0
  618. package/templates/read-model/drizzle/table.tpl +38 -0
  619. package/templates/read-model/fake.ts.tpl +8 -0
  620. package/templates/read-model/knex/store.ts.tpl +41 -0
  621. package/templates/read-model/knex/table.tpl +26 -0
  622. package/templates/read-model/none/store.ts.tpl +17 -0
  623. package/templates/read-model/port.ts.tpl +24 -0
  624. package/templates/read-model/prisma/model.tpl +25 -0
  625. package/templates/read-model/prisma/store.ts.tpl +43 -0
  626. package/templates/read-model/typeorm/schema-export.tpl +4 -0
  627. package/templates/read-model/typeorm/schema.ts.tpl +9 -0
  628. package/templates/read-model/typeorm/store.ts.tpl +30 -0
  629. package/templates/read-model/typeorm/table.tpl +54 -0
  630. package/templates/read-model/wiring.container.tpl +21 -0
  631. package/templates/repository/drizzle/repository.ts.tpl +6 -9
  632. package/templates/repository/drizzle/table.tpl +1 -0
  633. package/templates/repository/typeorm/table.tpl +1 -0
package/README.md CHANGED
@@ -616,12 +616,12 @@ config, `docsUi`, `ci` and `logger` included.
616
616
  | `--storage local\|s3` | recorded as `stack.storage`: where the content of files lives, never in the database. `src/platform/config/read-files.ts` and `src/platform/files/open-files.ts`, one per choice: `local`, a directory in development (`FILES_DIRECTORY`, `.data/files`) and the signed links answered by the application under `/files` (`FILES_PUBLIC_URL` and `FILES_SIGNING_SECRET` required in production); `s3`, a bucket of any provider of the S3 protocol through `@ddd-ts-kit/s3` (the `S3_*` variables, MinIO in the compose stack); the memory of the process in the tests and the tools, either way. With `--di tsyringe`: `files/bind-files.ts`, `files/files.module.ts` and `files/staging-uploads.ts`; with hand wiring `files/create-files.ts`; with an HTTP stack `files/file-routes.ts`. They bind `FileStorage`, `FileKeys`, `FileScanner` and `FileStaging`, register the hourly purge of staged files and stage the file a command carries before its transaction; `generate file-upload` needs them. `--storage none` writes none of this ([File storage](../../docs/concepts/file-storage.md)) |
617
617
  | `--search opensearch\|none` | recorded as `stack.search`, `none` by default: where the read models a context keeps for search live. `opensearch`: `@ddd-ts-kit/opensearch`, `src/platform/search/search-indexes.ts` (`SearchIndexes`, the abstract class the adapter of a read model port takes: `super(search.options('billing_invoices', criteria))`) and `search/open-search.ts` (`fetchTransport` on `OPENSEARCH_URL`, the user of `OPENSEARCH_USERNAME` and `OPENSEARCH_PASSWORD` both or neither, the tenancy `attribute` under `--tenancy shared-table`, `none` otherwise), bound by `search/search.module.ts` on a container of the kit, `platform.search` wired by hand and under Nest; the index of each store built from it provisioned before a request, under shared tables for the tenant of the work once the tenant directory of the platform lists it (an unlisted tenant creates no index), best effort at the start, which never fails on search, nothing called without a store; the privacy scripts given the node; a compose service `opensearch` (one node, security plugin off). No generator writes a store, and the pipeline starts no node; a context builds its stores from `SearchIndexes` only (`search/store-from-platform`). [Search read models](../../docs/tools/search-read-models.md) |
618
618
  | `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, and for `--broker` `create-event-provider.ts`: `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, with `aggregate-key-of.ts` for per-aggregate order), `NatsEventBus` (`NATS_URL`) or `RedisStreamsEventBus` of `@ddd-ts-kit/redis/event-bus` (`REDIS_URL`: Redis, Dragonfly or Valkey), each with one subscriber per consuming context (`forConsumer`), `assertTopology` at start, its address validated and a compose service with a healthcheck; or `custom-event-bus.ts` with its `eventBusContract` spec. `start-outbox-relay.ts` with the outbox. `--broker redis` with `--cache redis` is one server and one compose service, `cache`; alone, the service is `streams` |
619
- | `src/platform/database/` | `persistence.ts` (`interface Persistence`: unit of work, outbox and processed-event stores of the ORM package, the storage handle), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, the connection (`connect-to-database.ts`, `create-client.ts` or `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, the schema of what the kit stores for the application), `open-test-database.ts` (PostgreSQL in process, or the server named by a URL; with Vitest each spec opens a copy of the cluster `test/support/test-database-template.ts`, the global setup of the run, initialised once, and creates its tables there; with drizzle from `table-statements.ts`, the SQL of the tables of `schema.ts`, since drizzle-kit writes migrations, not tables, its unique indexes included), `persistence.contract.spec.ts` (the outbox, processed-event, job and process stores as the platform wires them, held to the contracts of `@ddd-ts-kit/testing` with what the stack turns on: the tenant under `--tenancy`, the unit of work). The storage class a repository adapter names in its dependency list: `database.ts` with drizzle and prisma (`abstract class Database extends` the context type of the ORM package), `KnexContext` of `@ddd-ts-kit/knex`, `TypeOrmContext` of `@ddd-ts-kit/typeorm` |
619
+ | `src/platform/database/` | `persistence.ts` (`interface Persistence`: unit of work, outbox and processed-event stores of the ORM package, the storage handle), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, the connection (`connect-to-database.ts`, `create-client.ts` or `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, the schema of what the kit stores for the application), `open-test-database.ts` (PostgreSQL in process, or the server named by a URL, each call then on a copy of the migrated database, made and dropped by `test/support/test-database-clone.ts`; with Vitest each spec opens a copy of the cluster `test/support/test-database-template.ts`, the global setup of the run, initialised once, and creates its tables there; with drizzle from `table-statements.ts`, the SQL of the tables of `schema.ts`, since drizzle-kit writes migrations, not tables, its unique indexes included), `persistence.contract.spec.ts` (the outbox, processed-event, job and process stores as the platform wires them, held to the contracts of `@ddd-ts-kit/testing` with what the stack turns on: the tenant under `--tenancy`, the unit of work), `read-model-tables.ts` (the list of the read models kept in a table, between markers `generate read-model` fills, `init` fills from the stores of the tree and `init --force` keeps, each entry the context of a read model and the class of its store; `readModelTables(persistence, contexts)` has each table of those contexts read by its own store, so with the verdict of that store; an application calls it when it starts, for the contexts it hosts (a context run as a service checks its own tables, on its database), and refuses to start on a listed table that cannot hold the trace of a deleted row, named with its migration, or that it could not read, unless `composeApplication` is given `readModelTables: 'reported'`; `scripts/read-model-tables.ts`, `npm run db:read-models`, asks it of the database `DATABASE_URL` names before a deployment, of every context or of those `-- --context <name>` names, needs no other variable, prints the database it read, and exits 1 when a table is not ready, 2 without a database to read, 3 when no table could be read, 4 when `--context` names a context no listed read model belongs to; an entry names a context of `Contexts`, which `generate context` fills, or does not compile, and a store left out on purpose is a comment of the list that holds `<context>: <Store>`). The storage class a repository adapter names in its dependency list: `database.ts` with drizzle and prisma (`abstract class Database extends` the context type of the ORM package), `KnexContext` of `@ddd-ts-kit/knex`, `TypeOrmContext` of `@ddd-ts-kit/typeorm` |
620
620
  | migration tooling | `drizzle.config.ts`, `knexfile.js` and the folder `migrations/`, `prisma/schema/schema.prisma` (the client, the datasource and the tables of the platform; `generate repository` adds the file of each context, `prisma/schema/<context>.prisma`) and `prisma.config.ts`, or `data-source.ts`. A project that keeps the one `prisma/schema.prisma` of versions before 0.95 keeps it with its `prisma.config.ts` and its `db:client`, even under `--force`: `init` writes nothing under `prisma/schema/`, its notes give the steps of the move with the contexts of the project named, and `generate repository` refuses until the move |
621
621
  | `scripts/openapi.ts`, `scripts/events.ts` | write `openapi/openapi.yaml` (one file per document of `openapi.documents`), `docs/integration/asyncapi.yaml` and `docs/integration/event-catalog.md`, in JSON under `openapi.format: json`; `--check` fails on a difference |
622
622
  | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | with `--privacy on`, the two requests of a data subject, answered from the command line on the sources with the variables of `.env` (`npm run privacy:erase -- <subject-id> [--operator <who-asks>] [--rerun]`, `npm run privacy:export -- <subject-id> > export.json`): the erasure destroys the key of the subject first when the project has an event store (`--event-sourcing on`: its stored events read as erased; audited with `--audit on`), then erases every copy listed in `src/platform/privacy/data-subject-copies.ts`, each leaving its entry with `--audit on`, and what the outbox and the job store keep of the person; an id that reached nothing is refused, exit code 1, and announced to nobody, unless `--rerun` says this person was erased before; `privacy:purge` runs by hand what the job `privacy.purge-expired` runs every night at 03:00 UTC, the purge of what outlived its retention (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` switches the job off); the export gathers every record listed in `data-subject-exports.ts` into one dated JSON document (`format`, `subject`, `exportedAt`, `records`), the export of each context audited with `--audit on`, never the values (every run leaves its entry, a trial included: try it on a test subject). With `--tenancy shared-table`, `TENANTS` names the tenants, comma separated: a write of tenant data is never widened. Neither reaches backups, logs, a copy no context declared, a message already delivered or a job that names no `subject` |
623
623
  | `docker-compose.yml`, `.env.example`, `Dockerfile`, `.dockerignore` | the database with a healthcheck and a named volume, `jaegertracing/jaeger:2.22.0` behind the `observability` profile, every port published on 127.0.0.1 only (a wider address is written in the entry on purpose, the README of the project says how), ports from `.env`; a multi-stage, non-root image with production dependencies only |
624
- | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (the whole application on a free port, on an in-process database unless `DATABASE_URL` is set, no job run by time; `settled()` resolves once the outbox has relayed what the requests stored; `publish(events)` hands integration events of an upstream to its handlers, as the relay of that upstream would), `create-credentials.ts` (who a test calls as, `application.as({ id, roles })`; under RBAC and ABAC the roles are those of `Role` in `src/platform/auth/authorization/role.ts`, so `roles: [Role.Admin]` is completed by the editor and a misspelled role does not compile), `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)`: a trace without the calls an adapter makes on itself, the form `expectSpanTree` asserts) |
624
+ | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (the whole application on a free port, on an in-process database unless `DATABASE_URL` is set, then on a database per spec file, the tables of that migrated one, emptied but for those `test/support/test-database-kept.ts` lists, so the files run at the same time on a server too; `test/support/test-database-setup.ts`, a global setup of the run, copies and empties the migrated database once, shares the connections the server has left between the files that run at once and drops what a killed run left (`test/support/test-database-*.ts`); no job run by time; `settled()` resolves once the outbox has relayed what the requests stored; `publish(events)` hands integration events of an upstream to its handlers, as the relay of that upstream would), `create-credentials.ts` (who a test calls as, `application.as({ id, roles })`; under RBAC and ABAC the roles are those of `Role` in `src/platform/auth/authorization/role.ts`, so `roles: [Role.Admin]` is completed by the editor and a misspelled role does not compile), `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)`: a trace without the calls an adapter makes on itself, the form `expectSpanTree` asserts) |
625
625
  | `docs/context-map.md`, `docs/integration/README.md` | see `docs` |
626
626
  | `test/architecture/extractable.spec.ts` | written with the first context: boots each context alone on the kernel and the platform, its jobs included |
627
627
  | `eslint.config.mjs` | the `dddTsKit` preset of `@ddd-ts-kit/eslint-plugin`, typed linting on the project's tsconfig |
@@ -804,7 +804,7 @@ Next, in this order: the language of the context first, then the business decisi
804
804
  | `port` | `<context> <Name> [--module <module>]` | `application/ports/<name>.port.ts`, one abstract class, and its fake |
805
805
  | `route` | `<context> <UseCaseName> --method <GET\|POST\|PUT\|PATCH\|DELETE> --path <p> [--command\|--query] [--group <Name>] [--mapper] [--serializer] [--cache public\|private\|no-store] [--module <module>]` | under `"stack.routes": "controllers"`: a controller class in `presentation/http/<resource>/<use-case>/` (the resource is the first segment of the path), depending on `CommandBus` or `QueryBus`, behind the route group of its resource, written with it when it is new (`<resource>.routes.ts`: prefix, tag, `Authenticated`); a public use case stands in no group and says `guards: [Public]`; with class-validator one class per file (`<use-case>.params.ts`, `.body.ts`, `.answer.ts`, `.accepted.ts`, `.line.ts`); `--mapper` and `--serializer` add a request mapper and a serializer the controller is given; a spec; no registration in a declared project, a controller built by hand in `<context>.routes.ts` (the module file with hand wiring) in an explicit one. Under `"functions"`: a `defineRoute` function, its spec, its registration in `<context>.routes.ts`, and `<use-case>-<role>.dto.ts` classes |
806
806
  | `controller` | the same arguments as `route` | the controller class, whatever `stack.routes` says: for a project of function routes that writes its next route as a class. `--cache` writes its cache policy: `private` (a `GET` of a caller, `max-age=0`, `must-revalidate`, strong `ETag`), `public` (a `GET` of a public use case, `max-age` 1m, `s-maxage` 5m, tagged with the resources of its path), `no-store`; refused on a write, and `public` behind a route group |
807
- | `file-upload` | `<context> <UseCaseName> --path <p> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--method POST\|PUT] [--group <Name>] [--module <module>]` | an upload: a controller that declares the file it receives (its size and media types in the contract, checked as it streams), the command that carries it as a `FileUpload`, staged by the command bus before the transaction, the handler that records it and promotes it with the commit, and their specs. Refused without `stack.storage` or without an HTTP stack, with the `init --force --storage local` to run |
807
+ | `file-upload` | `<context> <UseCaseName> --path <p> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--method POST\|PUT] [--group <Name>] [--text utf-8\|single-byte] [--module <module>]` | an upload: a controller that declares the file it receives (its size and media types in the contract, checked as it streams; with `--text` a text file such as a CSV under the names browsers give one, `single-byte` when it may be in Windows-1252 as well as UTF-8, and a spec that sends one through the multipart reader), the command that carries it as a `FileUpload`, staged by the command bus before the transaction, the handler that records it and promotes it with the commit, and their specs. Refused without `stack.storage` or without an HTTP stack, with the `init --force --storage local` to run |
808
808
  | `route-group` (`group`) | `<context> <Name> [--prefix <path>] [--group <ParentName>] [--public \| --role <role>]` | `presentation/http/<name>.routes.ts`: an empty class carrying `@RouteGroup`, behind `Authenticated` unless `--public` or `--role` says otherwise (`HasRole(Role.Admin)`, the role read from the vocabulary of the platform, `<platformDir>/auth/authorization/role.ts`, which gets it when it does not hold it); with `--group` it refines that group and inherits from it |
809
809
  | `guard` | `<context> <Name>` | `presentation/http/guards/<name>.guard.ts`: a declared guard class to fill, and its spec |
810
810
  | `representation` | `<context> <UseCase> <xml\|csv\|media/type>[,...] [--module <module>]` | after `generate route` of the use case (a controller under `"stack.routes": "controllers"` or `"nest"`) or `generate controller`: adds `produces` to the `@Controller` of the use case, and `consumes: ['application/xml']` to one that receives a body when XML is asked; says when CSV needs a page or a streamed list, and when `stack.representations` is not `negotiated` |
@@ -812,14 +812,16 @@ Next, in this order: the language of the context first, then the business decisi
812
812
  | `schema` | `<context\|shared-kernel> <Name>` | `presentation/http/shared/<name>.schema.ts` of the context, or `presentation/<name>.schema.ts` of the shared kernel: one shape of the contract declared once (a zod schema with `.meta({ id })`, a class-validator class, or a schema wrapped by `sharedSchema`), to fill; the routes use it whole, nested or in part |
813
813
  | `integration-event` | `<context> <Aggregate> <Fact> [--version n] [--module <module>]` | `defineIntegrationEvent` declaration in the published language (its payload in `<event>.v<n>.payload.ts` with class-validator or a schema of your own), index export, the publisher `application/integration/publishers/<event>.publisher.ts`, spec, registration, a line of `platform/audit/audited-events.ts` |
814
814
  | `integration-handler` (`consumer`) | `<context> <upstreamContext> <eventType>[@v<n>] [--version <n>] [--name <Name>] [--module <module>]` | `application/integration/handlers/<name>.integration-handler.ts`, a class `<Name>IntegrationHandler` depending on `CommandBus`, its spec, its idempotent subscription under the consumer name `<context>.<name>`; the type is taken as `list` prints it, with or without `@v<n>` (the newest version without, `--version <n>` saying the same as the suffix); refused unless the upstream is declared and publishes that version (a version that is not found is refused, never replaced by another) |
815
+ | `personal-fields` | `<context> <table> --personal <column>,... --subject <column> [--erasure pseudonymise\|row] [--retention <column>:<n><d\|m\|y>] [--tenant-scoped] [--module <module>]` | the declaration of the personal columns of a table no aggregate owns (a read model, a table of received messages, a table written by hand), given by its SQL name: `infrastructure/persistence/<table>.personal-fields.ts`, spelled as the erasure of the ORM reads it (on Drizzle and TypeORM with the properties the schema file gives the columns), joined to the erasure and to the export of the context, or written with them as `repository --personal` writes them for a first table, except the spec: `test/integration/<context>-personal-data.spec.ts` proves the fakes and names as `it.todo` each case to prove on the test database, no repository nor builder writing the rows of such a table. `--subject` is required: the row of such a table is rarely the person. The table is read in the schema file of the context and never changed. Refused: a table that file does not declare, a table that has a declaration, a column the definition of the table does not hold (said in the output instead when the definition takes columns from a spread or a helper), a table without `tenant_id` where the erasure is confined to a tenant, and what `--personal` of a repository refuses |
815
816
  | `erasure-handler` | `<context> [--module <module>]` | `application/integration/handlers/data-subject-erased.integration-handler.ts`, a class `DataSubjectErasedIntegrationHandler` that erases what the context keeps of a person through its `<Context>PersonalDataErasure` when the platform announces `privacy.data-subject.erased` (`dataSubjectErasedV1` of the kernel), its spec on the fake, its idempotent subscription under the consumer name `<context>.data-subject-erased` (in a transaction behind a broker); for a context that runs as a service of its own or copies personal data from events. Refused until the context has its erasure (`generate repository --personal`), and refused on an event-sourced context, whose personal values are erased by destroying the key of the subject (`eraseDataSubject`) |
816
817
  | `event-handler` | `<context> <Aggregate> <Fact> [--phase before-commit\|after-commit] [--name <Name>] [--module <module>]` | reaction to a domain event of the context, spec, subscription; before the commit of the unit of work by default, after it with `--phase after-commit` (an effect no transaction covers, at most once), and the spec runs the reaction in that phase |
817
- | `projection` (`projector`) | `<context> <Name> <event-type>[@v<n>] [--module <module>]` | a projector in `application/projections/<name>.projection.ts`, declared with `@Projection('<context>.<name>')` and one `@On(definition)` method for the integration event, which the context itself or a declared upstream publishes, and its spec; the type is taken as `list` prints it, `@v<n>` pinning the version (the newest without). In the explicit style on tsyringe the module file of the context includes it with `builder.include(<Name>Projection)`; on a hand-wired platform the class is plain and the module subscribes it under its consumer name. It keeps one read model: its port is received in the constructor |
818
+ | `projection` (`projector`) | `<context> <Name> <event-type>[@v<n>] [--module <module>]` | a projector in `application/projections/<name>.projection.ts`, declared with `@Projection('<context>.<name>')` and one `@On(definition)` method for the integration event, which the context itself or a declared upstream publishes, and its spec; the type is taken as `list` prints it, `@v<n>` pinning the version (the newest without). In the explicit style on tsyringe the module file of the context includes it with `builder.include(<Name>Projection)`; on a hand-wired platform the class is plain and the module subscribes it under its consumer name. It keeps one read model, which `generate read-model` writes: its port is received in the constructor |
819
+ | `read-model` | `<context> <Name> [--field <name>:<type>[:nullable]]... [--tenant-scoped] [--module <module>]` | the read model a projection keeps. The port in `application/ports/<name>.port.ts`: the type `<Name>Row` (the key `id`, then one field per `--field`, of type `string`, `number`, `boolean`, `instant` or `decimal`, `:nullable` for one that may hold null), the criteria `<name>Criteria` its readers may ask, and the abstract class `<Name>` over `ReadModelStore<<Name>Row>`. Its table, named after it in snake_case, in the schema of the context, with the column of each field and the columns of the store (`readModelColumns()`; the Prisma model holds them as fields). The column of a field accepts null whatever the row requires, a removed row being a trace that keeps its key and its stamp alone, and a check constraint `<table>_live_rows_whole` keeps every other row whole, `deleted or (<column> is not null and ...)` over the fields the row requires: `check(...)` on Drizzle, `table.check(...)` on Knex, `checks` of the entity schema on TypeORM, and on Prisma, whose schema language has none, a `TODO(domain)` line of the model that holds the `ALTER TABLE` to add to the migration. The tenant column and its index with `--tenant-scoped` or in a multi-tenant project. The store adapter `infrastructure/persistence/<orm>-<name>.repository.ts`, a class `<Orm><Name>` over the read model store of the ORM package (`DrizzleReadModelStore`, `KnexReadModelStore`, `PrismaReadModelStore`, `TypeOrmReadModelStore`; `InMemoryReadModelStore` of the kernel in a project without an ORM), declared with `@Repository(<Name>)`, or bound in the module file in the explicit style (a note says where to build it on a hand-wired platform). The fake `test/fakes/<name>.fake.ts` and `test/integration/<name>.contract.spec.ts`, which runs `readModelContract` on the fake and on the adapter, and with a tenant proves that one tenant does not read the rows of another. A port of that name that is no read model is refused |
818
820
  | `job` | `<context> <Name> (--every <duration> \| --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName> [--global] [--module <module>]` | `application/scheduling/<name>.job.ts`, a class `<Name>Job implements ScheduledJob` that sends the command, as `systemActor('<context>.<name>')` when it is protected, with `execution.scheduledAt` when the command takes it; `test/unit/<name>.job.spec.ts`, which runs the job (by name on tsyringe, `application.jobs.runNow`; `job.run(occurrence)` with hand wiring) and asserts the command it sent; its registration; its switch in `platform/jobs/job-settings.ts`; the grant of its system actor (below) |
819
821
  | `background-job` | `<context> <Name> --command <UseCaseName> [--module <module>]` | `application/background/<name>.background-job.ts`, a class `<Name>BackgroundJob implements BackgroundJob<<Name>Payload>` named by its static `jobName` `<context>.<name>`, that sends the command as `execution.actor` when it is protected, followed by one field of `<Name>Payload` per other parameter of the constructor of the command (strings, numbers, booleans, literals and lists of them as written, a `Date` as its ISO text; anything else is refused), and its static `payload`, the schema of that payload in the validation library of the stack (a `z.object` under zod, a class of decorated fields without initial value under class-validator, a `Type.Object` under TypeBox, one refusal per field written by hand under Standard Schema and, with `--validation none`, in the `BackgroundJobPayloadSchema` of the kernel; a type it writes no check for is typed `unknown` with a `TODO(domain)`), which the worker reads the stored payload with before each run; `test/unit/<name>.background-job.spec.ts`, which enqueues it with a payload of every field as a user and runs what is due, then enqueues it as an earlier version declared it (`earlierVersionOf` of `@ddd-ts-kit/testing`) and shows the job dead with `INVALID_JOB_PAYLOAD` (through the test application on tsyringe, through a queue and a worker in memory on the test buses otherwise); its registration (`@Background()`, `builder.backgroundJob(..)` in the module file on tsyringe, `platform.backgroundJobs.register(..)` in the module file of a platform wired by hand) |
820
822
  | `process` (`process-manager`) | `<context> <Name> [--module <module>]` | `application/processes/<name>.process.ts` (its state, `processName`, `timeoutJob`, `isState`, a first step that arms a deadline, a step that ends it in time, the step of the deadline), `application/background/<name>-timeout.background-job.ts`, which delivers its timeouts through `ProcessRunner`, and the specs of both (`givenProcess`, the queue of the test application on tsyringe, a queue and a runner in memory on the test buses otherwise) |
821
823
  | `acl` | `<context> <upstreamOrSystemName> [--module <module>]` | translator in `infrastructure/anti-corruption/`, spec |
822
- | `e2e` | `<context> <UseCaseName> [--event <eventType>]` | `test/e2e/<use-case>.e2e.spec.ts` driving the route of the use case: 401 without a credential, 403 without the permission, the documented status with it; for a command, one more test asserts the trace of the request, exact on names and structure, with `installTestTracing()` and `expectSpanTree(storyOf(trace), [...])` of `@ddd-ts-kit/tracing/testing` (`POST /invoices`, then `command IssueInvoiceCommand`, then `repository InvoiceRepository.save`, and after it, for a command that gives birth to an aggregate born with `--birth`, `unit-of-work before-commit` and `domain-event <name>` of its birth event, a note naming what already reacts to it). A use case no route reaches, started by an integration event handler of the context, gets a spec that publishes the upstream event, built from its declaration, with `application.publish([event])`, awaits `application.settled()` and leaves `it.todo` for what a client observes (the `GET` routes of the context, or the events it publishes with `collectEvents`); the handler that sends `<UseCase>Command` is found in `application/integration/handlers/`, and `--event billing.invoice.issued` names the event when handlers of several send it, or when the handler does not send it yet. Needs the route, or that handler |
824
+ | `e2e` | `<context> <UseCaseName> [--event <eventType> \| --job <JobName>]` | `test/e2e/<use-case>.e2e.spec.ts` driving the route of the use case: 401 without a credential, 403 without the permission, the documented status with it; for a command, one more test asserts the trace of the request, exact on names and structure, with `installTestTracing()` and `expectSpanTree(storyOf(trace), [...])` of `@ddd-ts-kit/tracing/testing` (`POST /invoices`, then `command IssueInvoiceCommand`, then `repository InvoiceRepository.save`, and after it, for a command that gives birth to an aggregate born with `--birth`, `unit-of-work before-commit` and `domain-event <name>` of its birth event, a note naming what already reacts to it). A use case no route reaches, started by an integration event handler of the context, gets a spec that publishes the upstream event, built from its declaration, with `application.publish([event])`, awaits `application.settled()` and leaves `it.todo` for what a client observes (the `GET` routes of the context, or the events it publishes with `collectEvents`); the handler that sends `<UseCase>Command` is found in `application/integration/handlers/`, and `--event billing.invoice.issued` names the event when handlers of several send it, or when the handler does not send it yet. A use case only a job sends the command of gets one test per job: `await application.runJob('<context>.<job>')` for a scheduled job (`application/scheduling/`), and, for a background job (`application/background/`), the request that enqueues it left to write, `const ran = await application.runDueJobs()`, which runs what is due on the queues as the worker would, and the assertion that the job is among `ran`; each then awaits `application.settled()`. `--job VoidInvoice` names one job, by its class or by the name it runs under (`billing.void-invoice`), also for a use case a route reaches, and writes `test/e2e/<use-case>-<job>.e2e.spec.ts`. Needs the route, that handler, or a job that sends the command |
823
825
  | `acceptance` | `<story> ["<title>"]` | `test/acceptance/<story>.acceptance.spec.ts`, written before the code: an `it.todo` per acceptance criterion of `docs/architecture/stories/<story>.md`, or per slice row of the story in `docs/architecture/slices.md` when it states none |
824
826
  | `policy` | `<context> <Name> --permission <aggregate>.<action> [--module <module>]` | `application/authorization/<name>.policy.ts`, spec; declared: the class carries `@Policy(permission, { name })` and nothing else is written; explicit: registration in `platform/auth/authorization/access-policies.ts` |
825
827
  | `gateway` | `<context> <upstreamContext> <Name> [--module <module>]` | the read contract in the upstream's published language (`<name>.contract.ts`, an abstract class and the token of the upstream value), the port `application/ports/<name>-gateway.port.ts`, an in-process adapter in `infrastructure/external/` bound `.as('gateway')`, a fake, one contract suite; refused unless the upstream is declared |
@@ -2026,6 +2028,21 @@ two places, a lost line of punctuation or a change of meaning, and a shallow clo
2026
2028
  commits it reads: in CI it needs `fetch-depth: 0`, which is why the pipelines of `init` do not
2027
2029
  run it.
2028
2030
 
2031
+ **The migrations of the branch against the trunk.** Without a `<commit>`, it then reads the
2032
+ migrations of the working tree against the same trunk, on the four ORM: a migration the branch
2033
+ adds whose name sorts before the last migration of the trunk (knex, Prisma, TypeORM), an entry
2034
+ the branch adds to the journal of drizzle-kit whose `when` is not after the last entry of the
2035
+ trunk's, and a `.sql` file that journal does not list and the trunk does not hold. What is
2036
+ ordered is what the tool takes for a migration, by what it orders it by: every script of the
2037
+ folder of knex and the folders of Prisma that hold a `migration.sql`, by their name; the classes
2038
+ of TypeORM whose name ends with 13 digits, by that number. Each is an error that names the migration,
2039
+ the last one of the trunk and the command that brings the order right (`merge-trunk` under
2040
+ drizzle-kit, or the `meta/` of the trunk then `drizzle-generate --replay` once the trunk is
2041
+ merged; `merge-trunk --to-land` elsewhere), and `--warn` does not soften it: exit 1. A working
2042
+ migration (`working-<what-it-does>`) is left out. In `--json`: `migrations`, each
2043
+ `{ kind, migration, file, trunkLast, text, fix }` with `kind` `before-trunk` or `not-in-journal`,
2044
+ counted in `errorCount`.
2045
+
2029
2046
  ## merge-trunk
2030
2047
 
2031
2048
  ```
@@ -2108,6 +2125,17 @@ for a base git would not compute; an older git merges with `git merge` itself fr
2108
2125
  `git merge-base` (`--since <merge base>`), and refuses `--dry-run`. Exit 0 once committed, up to
2109
2126
  date or previewed, 1 on a stop, 2 when it cannot start.
2110
2127
 
2128
+ On a branch that already holds the trunk there is nothing to merge. `--to-land` still lands its
2129
+ migrations when one is a working one, sorts before the last of the trunk or is out of the journal
2130
+ of drizzle-kit: replayed under drizzle-kit, renamed after the last of the trunk under knex, Prisma
2131
+ and TypeORM, only those that do not follow the trunk's already and in their order (a stop, exit
2132
+ 1, when one of them and a later migration of the trunk name the same table: the stop says to
2133
+ delete it, then to generate it again). They are left to commit: no merge commit carries them. A
2134
+ stop leaves the migrations folder as it was found, so the same command runs again, and
2135
+ `--dry-run` says which migrations would move. Each rename or replay ends with what to do with a
2136
+ database that already applied the old name: reset it, or correct its migration table (the table
2137
+ of each tool is in `docs/tools/persistence.md`).
2138
+
2111
2139
  ```text
2112
2140
  merge-trunk build/billing-2 <- origin/main (d8d281b)
2113
2141
  base 6d8be4b: build/billing-1 landed as d8d281b "feat(billing): issue and cancel (#1)"
@@ -2349,9 +2377,9 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2349
2377
  | `clean/one-export-per-file` | under the source root, tests apart: more than one exported class, interface or function that the allowances do not explain (the types of the signature of the main export, a type and a value sharing one name, a type with its constructors, the accessors of one private state, `onePerFile.allow`); a file not named after its main export in kebab-case (`invoice.aggregate.ts` for `Invoice`); an `index.ts` or a `<context>.declarations.ts` that holds anything but re-exports |
2350
2378
  | `clean/file-size` | a file of more than 350 lines, sources and tests; a path with a segment `generated` and declaration files are exempt |
2351
2379
  | `composition/only-in-module` | `new X`, or `bind(..).toClass(X, ..)` and `rebind(..).toClass(X, ..)`, of a class imported from `infrastructure/`, outside the module file, `main.ts`, the platform and tests; in a file importing `@ddd-ts-kit/di`, a call of `contextModule`, `discoverContext` or `.include(` outside those places and `apps/<context>/main.ts` |
2352
- | `imports/alias-only` | under the source root, `test/` and `scripts/`: an `import`, `export ... from` or `import()` with a relative specifier, the same directory included (the fix names the alias to write; `eslint --fix` writes it); an alias specifier with a `.` or `..` segment |
2380
+ | `imports/alias-only` | under the source root, `test/` and `scripts/`: an `import`, `export ... from` or `import()` with a relative specifier, the same directory included (the fix names the alias to write; `eslint --fix` writes it), but `./<name>` between two files directly under `test/support/`, which a test runner loads before any alias exists; that `./<name>` when the source on disk has another name (a `.ts` source named with an extension under `none`; under `js`, `./x` or `./x.js` for `x.ts`, `./x.mjs` for `x.mts`, `./x.cjs` for `x.cts`), names `.` or `..`, or names a directory; an alias specifier with a `.` or `..` segment |
2353
2381
  | `imports/extension` | under the source root, `test/` and `scripts/`: with `importExtension` `none`, an alias specifier that ends with `.js`, `.mjs`, `.cjs`, `.ts`, `.mts` or `.cts`; with `js` (or no key), an alias specifier that does not end with `.js` (the fix names the specifier to write; `eslint --fix` writes it). A package subpath is never judged |
2354
- | `imports/alias-declared` | an `importAlias` that is not `@/` or `$<name>/`, or that is `$test/`, `$scripts/`, `$generated/`; a `paths` entry of `tsconfig.json` missing or different from what `importAlias` gives (the fix gives the entry); another `paths` entry under an alias; a `baseUrl`; a `tsconfig.build.json` whose `paths` differ; `paths` of `knip.json` mapping an alias; a script that compiles (`tsc` without `--noEmit`) and does not run `ddd-ts-kit build-aliases` afterwards; a script running `tsx --tsconfig` on another file; a `vitest` config at the root without `tsconfigPaths: true`, a `jest` config without the derived `moduleNameMapper` entries, or `.dependency-cruiser.cjs` without `tsConfig`; `module` and `moduleResolution` of `tsconfig.json` (or of a `tsconfig.build.json` that sets its own) that are not what `importExtension` gives: `ESNext`, `Bundler` and `customConditions` holding `node` under `none`, and under `js` a written value that is not a Node resolution; a jest mapping whose pattern does not end as the imports do. A project without `package.json` is not judged |
2382
+ | `imports/alias-declared` | an `importAlias` that is not `@/` or `$<name>/`, or that is `$test/`, `$scripts/`, `$generated/`; a `paths` entry of `tsconfig.json` missing or different from what `importAlias` gives (the fix gives the entry); another `paths` entry under an alias; a `baseUrl`; a `tsconfig.build.json` whose `paths` differ; `paths` of `knip.json` mapping an alias; a script that compiles (`tsc` without `--noEmit`) and does not run `ddd-ts-kit build-aliases` afterwards; a script running `tsx --tsconfig` on another file; a `vitest` config at the root without `tsconfigPaths: true`, a `jest` config without the derived `moduleNameMapper` entries, or `.dependency-cruiser.cjs` without `tsConfig`; `module` and `moduleResolution` of `tsconfig.json` (or of a `tsconfig.build.json` that sets its own) that are not what `importExtension` gives: `ESNext`, `Bundler` and `customConditions` holding `node` under `none`, and under `js` a written value that is not a Node resolution; a jest mapping whose pattern does not end as the imports do; under `js`, a file directly under `test/support/` that imports a neighbour by its `.ts` while `tsconfig.json` sets neither `allowImportingTsExtensions` nor `rewriteRelativeImportExtensions`; whatever the ending, a `tsconfig.build.json`, or a tsconfig a script compiles what ships with, that resolves `noEmit` as `true`, or `allowImportingTsExtensions` as `true` without `rewriteRelativeImportExtensions` or `emitDeclarationOnly`. A project without `package.json` is not judged |
2355
2383
  | `config/valid` | unknown upstream, classification, relationship, rule id, `guard` mode or `importExtension`; a directory of the config that leads out of the project; a context missing on disk or in the config; a `commit` limit that is not a positive integer |
2356
2384
  | `config/suppression-needs-reason` | a suppression without a rule id or a reason (kept as an alias next to `governance/recorded-deviation`, which judges the reason) |
2357
2385
  | `authz/declared` | in a module file, `builder.command(X)` or `builder.query(X)` without `.requires(` or `.public(` in its chain, unless the message class carries `@Requires` or `@Public` of `@ddd-ts-kit/kernel/declarations`; with manual or nest wiring, a command or query class absent from every `requires(X, ...)` and `publicUseCase(X)` of the module file and of `application/authorization/`; a `defineRoute` without `security` (the route type refuses it already, and an empty list too: this is the text-level net for a definition built loosely); in the declared style, the exported class of a `*.command.ts` or `*.query.ts` file carrying neither `@Requires` nor `@Public` |
@@ -2368,6 +2396,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2368
2396
  | `authz/actor-explicit` | in `domain/` and `application/`: `ActorContext`, `ExecutionScope` (as a type or as a value: the class is the token of a dependency list), `AsyncLocalStorageExecutionScope`, `ScopedActorContext`, `AsyncLocalStorage`; `.current()` or `.require()` on an actor context or on something named `scope`, `scopes` or `...executionScope`; an import of `stampCreation`, `stampUpdate` or `tenantScopeOf` |
2369
2397
  | `authz/fields-by-schema` | under `application/queries/`: `roles.includes(`, `.some(`, `.every(`, `.find(`, `.indexOf(`, a comparison with a `role`, `isAdmin` |
2370
2398
  | `aspects/outside-in` | an import of `@ddd-ts-kit/aspects/decorators` outside `infrastructure/` of a context and the platform directory: `presentation/`, the module file, `published-language/`, the shared kernel, `main.ts`, any other source (`domain/` and `application/` are reported by the two `layer/*` rules instead) |
2399
+ | `aspects/timeout-covers-delegate` | an adapter declared with `@Adapter` or `@Gateway`, or bound by `bind(Port).toClass(Adapter)` in a file that imports `@ddd-ts-kit/di`, that runs under the default policy alone and whose constructor has a parameter typed by a port whose adapter states a longer limit. Under the default policy alone: the kind `external` or `gateway` (the literal of `kind:` or of `.as(`; `external` for an `@Adapter` without `kind`, none for a binding without `.as(`), no `ownPolicy(...)` and no `timeout(...)` among the elements of `aspects: [...]` or the arguments of `.with(...)`. The default limit: the `fallback: <number>` written after the string `'OUTBOUND_TIMEOUT_MS'`, the first argument of a call, in one file of the platform directory, else `timeoutMs: <number>` of `<platform>/resilience/default-resilience-settings.ts`. The limit behind the port: the smallest `timeout(<number>)` that is an element of its aspects or an argument of its `ownPolicy(...)`, when it has `ownPolicy(...)` or a kind the default leaves alone. The class of a binding is the one the binding file declares or imports by that name, else the only class of that name. Silent on: a platform wired by hand (`platform.adapter(...)`); a duration or a kind that is not a literal; an aspect that is a variable, a spread, a call of another name or under `when(...)`; a `timeout(` nested in the options of another aspect; a `@Timeout` on a method; a port or an adapter bound more than once, bound again by `rebind(`, or bound under a condition; a parameter typed by a name the adapter does not import from a file of the project (a type of a package, a declaration of its own file); two ports of one name unless each file imports its own from the file that declares it; an adapter reached through a middle adapter; a default limit that is not one number, or an environment that sets `OUTBOUND_TIMEOUT_MS`; the retries |
2371
2400
  | `tracing/platform-only` | an import of `@ddd-ts-kit/tracing` or of an `@opentelemetry/*` package outside the platform directory, `main.ts` and `apps/`, tests included |
2372
2401
  | `nest/no-parallel-pipeline` | in `presentation/`, `infrastructure/` or the module file of a context, tests apart: an import of a controller Nest serves (its route and parameter decorators, unless the file imports `KitRoute` or `KitRoutes` of `@ddd-ts-kit/http/nest`), the raw request or answer, a guard, a pipe, an exception filter or an `HttpException`, an interceptor or the `Logger` of `@nestjs/common`, a bare import of it, or an import of a package of Nest whose work the kit does (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` and the others of section 3 of ARCHITECTURE.md); the message names what the kit does in its place; under the source root outside the contexts, tests apart: a file that imports `Controller` of `@nestjs/common`, neither `KitRoute` nor `KitRoutes`, and names `CommandBus` or `QueryBus` or imports a file of a context |
2373
2402
  | `nest/controllers-current` | with `"stack.routes": "nest"`: a `<context>.controllers.ts` that differs from what the Nest controllers of the context and the signatures of their methods give, or is missing; a part of the request taken whole by no DTO class that `request` of `@KitRoute` does not give; a route method that answers no DTO class, `Accepted` or `void` and declares no `response` in `@KitRoute` |
@@ -10,6 +10,8 @@ export { directoryAlias } from './directory-alias.js';
10
10
  export { FIXED_ALIAS_ROOTS } from './fixed-alias-roots.js';
11
11
  export { moduleNameMapper, type MapperTarget } from './module-name-mapper.js';
12
12
  export { mapperTargetText } from './mapper-target-text.js';
13
+ export { NEIGHBOUR_SOURCES } from './neighbour-sources.js';
14
+ export { neighbourSuffix } from './neighbour-suffix.js';
13
15
  export { specifierOf } from './specifier-of.js';
14
16
  export { specifierSuffix } from './specifier-suffix.js';
15
17
  export { toAlias } from './to-alias.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE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AAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -8,6 +8,8 @@ export { directoryAlias } from './directory-alias.js';
8
8
  export { FIXED_ALIAS_ROOTS } from './fixed-alias-roots.js';
9
9
  export { moduleNameMapper } from './module-name-mapper.js';
10
10
  export { mapperTargetText } from './mapper-target-text.js';
11
+ export { NEIGHBOUR_SOURCES } from './neighbour-sources.js';
12
+ export { neighbourSuffix } from './neighbour-suffix.js';
11
13
  export { specifierOf } from './specifier-of.js';
12
14
  export { specifierSuffix } from './specifier-suffix.js';
13
15
  export { toAlias } from './to-alias.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alias/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * What lets the compiler read an import that ends with `.ts`, which the files of `test/support/`
3
+ * write to their neighbours under "importExtension": "js". `allowImportingTsExtensions` is only
4
+ * accepted by a configuration that emits nothing: the type check takes both, and the build sets
5
+ * both back, so that it emits what it emitted without them.
6
+ */
7
+ export declare const NEIGHBOUR_SOURCES: {
8
+ readonly typeCheck: {
9
+ readonly allowImportingTsExtensions: true;
10
+ readonly noEmit: true;
11
+ };
12
+ readonly build: {
13
+ readonly allowImportingTsExtensions: false;
14
+ readonly noEmit: false;
15
+ };
16
+ };
17
+ //# sourceMappingURL=neighbour-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-sources.d.ts","sourceRoot":"","sources":["../../src/alias/neighbour-sources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;aAC5B,SAAS;iBAAI,0BAA0B;iBAAQ,MAAM;;aACrD,KAAK;iBAAI,0BAA0B;iBAAS,MAAM;;CAC1C,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What lets the compiler read an import that ends with `.ts`, which the files of `test/support/`
3
+ * write to their neighbours under "importExtension": "js". `allowImportingTsExtensions` is only
4
+ * accepted by a configuration that emits nothing: the type check takes both, and the build sets
5
+ * both back, so that it emits what it emitted without them.
6
+ */
7
+ export const NEIGHBOUR_SOURCES = {
8
+ typeCheck: { allowImportingTsExtensions: true, noEmit: true },
9
+ build: { allowImportingTsExtensions: false, noEmit: false },
10
+ };
11
+ //# sourceMappingURL=neighbour-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-sources.js","sourceRoot":"","sources":["../../src/alias/neighbour-sources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAC7D,KAAK,EAAE,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;CACnD,CAAC"}
@@ -0,0 +1,8 @@
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 declare function neighbourSuffix(importExtension: string): '' | '.ts';
8
+ //# sourceMappingURL=neighbour-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neighbour-suffix.d.ts","sourceRoot":"","sources":["../../src/alias/neighbour-suffix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,EAAE,GAAG,KAAK,CAEnE"}
@@ -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,MAA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S,YAAY,CAAC,IAAY,EAAE,MAAc;IAChD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE;QACpE,IAAI,CAAC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;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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,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,CA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C,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE3G,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,SAAS,CAAC,IAAI,KAAK,CAAC;AACpG,CAAC;AAED,SAAS,QAAQ,CAAC,OAAgC,EAAE,SAAiB;IACnE,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAsB,EAAE;QACvE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAE3B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,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,CAA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AAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;;;GAIG;AACH,SAAS,MAAM,CAAC,KAAK,GAAY,EAAE;IACjC,MAAM,OAAO,GACX,KAAK,CAAC,4BAA4B,CAAC,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;IAE5G,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC;AAC7C,CAAC;AAED,SAAS,MAAM,CAAC,EAAE,MAAM,EAAa;IACnC,OAAO,MAAM,CACX,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,EAC7B,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"}