ddd-ts-kit 0.101.0 → 0.102.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 (293) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.fr.md +4 -4
  3. package/README.md +3 -3
  4. package/dist/build/emitted-place.d.ts +1 -2
  5. package/dist/build/emitted-place.d.ts.map +1 -1
  6. package/dist/build/emitted-specifier.d.ts +7 -1
  7. package/dist/build/emitted-specifier.d.ts.map +1 -1
  8. package/dist/build/emitted-specifier.js +5 -6
  9. package/dist/build/emitted-specifier.js.map +1 -1
  10. package/dist/build/emitted-target.d.ts +6 -5
  11. package/dist/build/emitted-target.d.ts.map +1 -1
  12. package/dist/build/emitted-target.js +5 -9
  13. package/dist/build/emitted-target.js.map +1 -1
  14. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  15. package/dist/build/rewrite-aliases.js +4 -5
  16. package/dist/build/rewrite-aliases.js.map +1 -1
  17. package/dist/build/rewrite-specifiers.d.ts +7 -6
  18. package/dist/build/rewrite-specifiers.d.ts.map +1 -1
  19. package/dist/build/rewrite-specifiers.js +6 -4
  20. package/dist/build/rewrite-specifiers.js.map +1 -1
  21. package/dist/build/unresolved-problem.d.ts +2 -1
  22. package/dist/build/unresolved-problem.d.ts.map +1 -1
  23. package/dist/build/unresolved-problem.js +2 -2
  24. package/dist/build/unresolved-problem.js.map +1 -1
  25. package/dist/check/business-names/parameter-lists.js +1 -3
  26. package/dist/check/business-names/parameter-lists.js.map +1 -1
  27. package/dist/check/engine/run-check.d.ts +3 -0
  28. package/dist/check/engine/run-check.d.ts.map +1 -1
  29. package/dist/check/engine/run-check.js +1 -1
  30. package/dist/check/engine/run-check.js.map +1 -1
  31. package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
  32. package/dist/check/explain/tenancy-docs.js +13 -3
  33. package/dist/check/explain/tenancy-docs.js.map +1 -1
  34. package/dist/check/fixtures/conjunct-cases.d.ts +11 -0
  35. package/dist/check/fixtures/conjunct-cases.d.ts.map +1 -0
  36. package/dist/check/fixtures/conjunct-cases.js +19 -0
  37. package/dist/check/fixtures/conjunct-cases.js.map +1 -0
  38. package/dist/check/fixtures/run-fixture.d.ts +3 -2
  39. package/dist/check/fixtures/run-fixture.d.ts.map +1 -1
  40. package/dist/check/fixtures/run-fixture.js +3 -3
  41. package/dist/check/fixtures/run-fixture.js.map +1 -1
  42. package/dist/check/fixtures/run-self-check.js +1 -1
  43. package/dist/check/fixtures/run-self-check.js.map +1 -1
  44. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts +3 -0
  45. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts.map +1 -0
  46. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js +33 -0
  47. package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js.map +1 -0
  48. package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts +4 -0
  49. package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts.map +1 -0
  50. package/dist/check/fixtures/tenancy-conjunct-fixtures.js +12 -0
  51. package/dist/check/fixtures/tenancy-conjunct-fixtures.js.map +1 -0
  52. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts +3 -0
  53. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts.map +1 -0
  54. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js +49 -0
  55. package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js.map +1 -0
  56. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts +3 -0
  57. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts.map +1 -0
  58. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js +32 -0
  59. package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js.map +1 -0
  60. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts +3 -0
  61. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts.map +1 -0
  62. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js +34 -0
  63. package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js.map +1 -0
  64. package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
  65. package/dist/check/fixtures/tenancy-fixtures.js +2 -0
  66. package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
  67. package/dist/check/rules/clean-one-export-per-file.js +1 -0
  68. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  69. package/dist/check/rules/schema-no-duplicate-shape.js +1 -3
  70. package/dist/check/rules/schema-no-duplicate-shape.js.map +1 -1
  71. package/dist/check/rules/tenancy-scoped-statement.js +2 -2
  72. package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
  73. package/dist/check/tenancy/arguments-of-call.d.ts +3 -0
  74. package/dist/check/tenancy/arguments-of-call.d.ts.map +1 -0
  75. package/dist/check/tenancy/arguments-of-call.js +11 -0
  76. package/dist/check/tenancy/arguments-of-call.js.map +1 -0
  77. package/dist/check/tenancy/bare-expression.d.ts +3 -0
  78. package/dist/check/tenancy/bare-expression.d.ts.map +1 -0
  79. package/dist/check/tenancy/bare-expression.js +9 -0
  80. package/dist/check/tenancy/bare-expression.js.map +1 -0
  81. package/dist/check/tenancy/bracket-depth.d.ts +3 -0
  82. package/dist/check/tenancy/bracket-depth.d.ts.map +1 -0
  83. package/dist/check/tenancy/bracket-depth.js +10 -0
  84. package/dist/check/tenancy/bracket-depth.js.map +1 -0
  85. package/dist/check/tenancy/chain-links.d.ts +17 -0
  86. package/dist/check/tenancy/chain-links.d.ts.map +1 -0
  87. package/dist/check/tenancy/chain-links.js +24 -0
  88. package/dist/check/tenancy/chain-links.js.map +1 -0
  89. package/dist/check/tenancy/choice-branches.d.ts +3 -0
  90. package/dist/check/tenancy/choice-branches.d.ts.map +1 -0
  91. package/dist/check/tenancy/choice-branches.js +39 -0
  92. package/dist/check/tenancy/choice-branches.js.map +1 -0
  93. package/dist/check/tenancy/declaration-before.d.ts +12 -0
  94. package/dist/check/tenancy/declaration-before.d.ts.map +1 -0
  95. package/dist/check/tenancy/declaration-before.js +11 -0
  96. package/dist/check/tenancy/declaration-before.js.map +1 -0
  97. package/dist/check/tenancy/declaration-of.d.ts +1 -5
  98. package/dist/check/tenancy/declaration-of.d.ts.map +1 -1
  99. package/dist/check/tenancy/declaration-of.js +3 -8
  100. package/dist/check/tenancy/declaration-of.js.map +1 -1
  101. package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
  102. package/dist/check/tenancy/drizzle-unscoped.js +16 -3
  103. package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
  104. package/dist/check/tenancy/enclosed-by.d.ts +3 -0
  105. package/dist/check/tenancy/enclosed-by.d.ts.map +1 -0
  106. package/dist/check/tenancy/enclosed-by.js +6 -0
  107. package/dist/check/tenancy/enclosed-by.js.map +1 -0
  108. package/dist/check/tenancy/end-of-enclosing.d.ts +7 -0
  109. package/dist/check/tenancy/end-of-enclosing.d.ts.map +1 -0
  110. package/dist/check/tenancy/end-of-enclosing.js +18 -0
  111. package/dist/check/tenancy/end-of-enclosing.js.map +1 -0
  112. package/dist/check/tenancy/holds-condition.d.ts +14 -0
  113. package/dist/check/tenancy/holds-condition.d.ts.map +1 -0
  114. package/dist/check/tenancy/holds-condition.js +26 -0
  115. package/dist/check/tenancy/holds-condition.js.map +1 -0
  116. package/dist/check/tenancy/is-conjunct.d.ts +8 -0
  117. package/dist/check/tenancy/is-conjunct.d.ts.map +1 -0
  118. package/dist/check/tenancy/is-conjunct.js +17 -0
  119. package/dist/check/tenancy/is-conjunct.js.map +1 -0
  120. package/dist/check/tenancy/is-or-link.d.ts +4 -0
  121. package/dist/check/tenancy/is-or-link.d.ts.map +1 -0
  122. package/dist/check/tenancy/is-or-link.js +7 -0
  123. package/dist/check/tenancy/is-or-link.js.map +1 -0
  124. package/dist/check/tenancy/knex-links-outside-condition.d.ts +11 -0
  125. package/dist/check/tenancy/knex-links-outside-condition.d.ts.map +1 -0
  126. package/dist/check/tenancy/knex-links-outside-condition.js +108 -0
  127. package/dist/check/tenancy/knex-links-outside-condition.js.map +1 -0
  128. package/dist/check/tenancy/knex-unscoped.d.ts +3 -1
  129. package/dist/check/tenancy/knex-unscoped.d.ts.map +1 -1
  130. package/dist/check/tenancy/knex-unscoped.js +12 -2
  131. package/dist/check/tenancy/knex-unscoped.js.map +1 -1
  132. package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -1
  133. package/dist/check/tenancy/prisma-unscoped.js +15 -10
  134. package/dist/check/tenancy/prisma-unscoped.js.map +1 -1
  135. package/dist/check/tenancy/spreads-at-top.d.ts +9 -0
  136. package/dist/check/tenancy/spreads-at-top.d.ts.map +1 -0
  137. package/dist/check/tenancy/spreads-at-top.js +49 -0
  138. package/dist/check/tenancy/spreads-at-top.js.map +1 -0
  139. package/dist/check/tenancy/top-level-parts.d.ts +3 -0
  140. package/dist/check/tenancy/top-level-parts.d.ts.map +1 -0
  141. package/dist/check/tenancy/top-level-parts.js +13 -0
  142. package/dist/check/tenancy/top-level-parts.js.map +1 -0
  143. package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -1
  144. package/dist/check/tenancy/typeorm-unscoped.js +30 -16
  145. package/dist/check/tenancy/typeorm-unscoped.js.map +1 -1
  146. package/dist/check/tenancy/unconfined-where.d.ts +11 -0
  147. package/dist/check/tenancy/unconfined-where.d.ts.map +1 -0
  148. package/dist/check/tenancy/unconfined-where.js +18 -0
  149. package/dist/check/tenancy/unconfined-where.js.map +1 -0
  150. package/dist/config/read-config.d.ts.map +1 -1
  151. package/dist/config/read-config.js +20 -0
  152. package/dist/config/read-config.js.map +1 -1
  153. package/dist/declared/render-declarations.js +1 -3
  154. package/dist/declared/render-declarations.js.map +1 -1
  155. package/dist/describe/read-controllers.d.ts.map +1 -1
  156. package/dist/describe/read-controllers.js +18 -2
  157. package/dist/describe/read-controllers.js.map +1 -1
  158. package/dist/describe/schema-class-of.js +8 -1
  159. package/dist/describe/schema-class-of.js.map +1 -1
  160. package/dist/digest/tree-at.d.ts.map +1 -1
  161. package/dist/digest/tree-at.js +2 -0
  162. package/dist/digest/tree-at.js.map +1 -1
  163. package/dist/docs/context-sections.js +3 -7
  164. package/dist/docs/context-sections.js.map +1 -1
  165. package/dist/docs/personal-event-lines.d.ts +7 -0
  166. package/dist/docs/personal-event-lines.d.ts.map +1 -0
  167. package/dist/docs/personal-event-lines.js +34 -0
  168. package/dist/docs/personal-event-lines.js.map +1 -0
  169. package/dist/docs/write-docs.d.ts.map +1 -1
  170. package/dist/docs/write-docs.js +2 -0
  171. package/dist/docs/write-docs.js.map +1 -1
  172. package/dist/docs/write-personal-events.d.ts +11 -0
  173. package/dist/docs/write-personal-events.d.ts.map +1 -0
  174. package/dist/docs/write-personal-events.js +28 -0
  175. package/dist/docs/write-personal-events.js.map +1 -0
  176. package/dist/generate/kinds/assert-event-store.d.ts +5 -1
  177. package/dist/generate/kinds/assert-event-store.d.ts.map +1 -1
  178. package/dist/generate/kinds/assert-event-store.js +11 -5
  179. package/dist/generate/kinds/assert-event-store.js.map +1 -1
  180. package/dist/generate/kinds/background/background-job-vars.js +4 -2
  181. package/dist/generate/kinds/background/background-job-vars.js.map +1 -1
  182. package/dist/generate/kinds/generate-event-sourced-repository.js +8 -1
  183. package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -1
  184. package/dist/generate/kinds/route/controller-vars.js +1 -1
  185. package/dist/generate/kinds/route/controller-vars.js.map +1 -1
  186. package/dist/generate/kinds/route/message-call.d.ts +6 -2
  187. package/dist/generate/kinds/route/message-call.d.ts.map +1 -1
  188. package/dist/generate/kinds/route/message-call.js +2 -1
  189. package/dist/generate/kinds/route/message-call.js.map +1 -1
  190. package/dist/generate/kinds/route/standard-schema-of.d.ts +2 -1
  191. package/dist/generate/kinds/route/standard-schema-of.d.ts.map +1 -1
  192. package/dist/generate/kinds/route/standard-schema-of.js +2 -4
  193. package/dist/generate/kinds/route/standard-schema-of.js.map +1 -1
  194. package/dist/generate/kinds/service-kind.js +1 -1
  195. package/dist/generate/kinds/service-kind.js.map +1 -1
  196. package/dist/generator-lock/unreadable-lock-refusal.d.ts +4 -0
  197. package/dist/generator-lock/unreadable-lock-refusal.d.ts.map +1 -0
  198. package/dist/generator-lock/unreadable-lock-refusal.js +7 -0
  199. package/dist/generator-lock/unreadable-lock-refusal.js.map +1 -0
  200. package/dist/generator-lock/with-generator-lock.d.ts.map +1 -1
  201. package/dist/generator-lock/with-generator-lock.js +8 -7
  202. package/dist/generator-lock/with-generator-lock.js.map +1 -1
  203. package/dist/init/files/platform-files.d.ts.map +1 -1
  204. package/dist/init/files/platform-files.js +14 -0
  205. package/dist/init/files/platform-files.js.map +1 -1
  206. package/dist/init/files/privacy-files.d.ts +2 -2
  207. package/dist/init/files/privacy-files.d.ts.map +1 -1
  208. package/dist/init/files/privacy-files.js +3 -2
  209. package/dist/init/files/privacy-files.js.map +1 -1
  210. package/dist/init/manifest/versions.js +24 -24
  211. package/dist/measures/timeline-of.js +1 -0
  212. package/dist/measures/timeline-of.js.map +1 -1
  213. package/dist/progress/format-progress.js +1 -0
  214. package/dist/progress/format-progress.js.map +1 -1
  215. package/dist/sdk/planned-clients.d.ts +2 -2
  216. package/dist/sdk/planned-clients.d.ts.map +1 -1
  217. package/dist/sdk/planned-clients.js +2 -6
  218. package/dist/sdk/planned-clients.js.map +1 -1
  219. package/dist/sdk/set-up-sdk.d.ts.map +1 -1
  220. package/dist/sdk/set-up-sdk.js +3 -2
  221. package/dist/sdk/set-up-sdk.js.map +1 -1
  222. package/dist/stack/stack-vars.js +12 -3
  223. package/dist/stack/stack-vars.js.map +1 -1
  224. package/dist/stories/forecast-merge.js +1 -0
  225. package/dist/stories/forecast-merge.js.map +1 -1
  226. package/dist/version.d.ts +1 -1
  227. package/dist/version.js +1 -1
  228. package/dist/worker/format-resume.d.ts.map +1 -1
  229. package/dist/worker/format-resume.js +5 -0
  230. package/dist/worker/format-resume.js.map +1 -1
  231. package/dist/worker/format-workers.js +5 -0
  232. package/dist/worker/format-workers.js.map +1 -1
  233. package/dist/worker/progress-of.d.ts +8 -3
  234. package/dist/worker/progress-of.d.ts.map +1 -1
  235. package/dist/worker/progress-of.js +2 -16
  236. package/dist/worker/progress-of.js.map +1 -1
  237. package/dist/worker/read-agent-record.d.ts.map +1 -1
  238. package/dist/worker/read-agent-record.js +15 -3
  239. package/dist/worker/read-agent-record.js.map +1 -1
  240. package/dist/worker/read-workers.js +2 -2
  241. package/dist/worker/read-workers.js.map +1 -1
  242. package/dist/worker/readable-progress.d.ts +5 -0
  243. package/dist/worker/readable-progress.d.ts.map +1 -0
  244. package/dist/worker/readable-progress.js +16 -0
  245. package/dist/worker/readable-progress.js.map +1 -0
  246. package/dist/worker/resume-worker.d.ts.map +1 -1
  247. package/dist/worker/resume-worker.js +4 -5
  248. package/dist/worker/resume-worker.js.map +1 -1
  249. package/dist/worker/worker-progress.d.ts +2 -1
  250. package/dist/worker/worker-progress.d.ts.map +1 -1
  251. package/dist/workspace/real-path-of.d.ts +2 -2
  252. package/dist/workspace/real-path-of.d.ts.map +1 -1
  253. package/dist/workspace/real-path-of.js +15 -10
  254. package/dist/workspace/real-path-of.js.map +1 -1
  255. package/package.json +5 -5
  256. package/templates/docs/privacy-register.md.tpl +2 -0
  257. package/templates/init/README.md.tpl +13 -4
  258. package/templates/init/docker/env.example.tpl +8 -0
  259. package/templates/init/main.ts.tpl +3 -0
  260. package/templates/init/platform/audit/create-audit.ts.tpl +12 -6
  261. package/templates/init/platform/composition/compose-application.manual.ts.tpl +36 -0
  262. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +7 -0
  263. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
  264. package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
  265. package/templates/init/platform/composition/platform-options.manual.ts.tpl +7 -0
  266. package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
  267. package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +7 -0
  268. package/templates/init/platform/config/app-config.ts.tpl +7 -0
  269. package/templates/init/platform/config/load-config.ts.tpl +22 -0
  270. package/templates/init/platform/database/persistence.contract.spec.ts.tpl +14 -3
  271. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +5 -1
  272. package/templates/init/platform/jobs/create-background-work.ts.tpl +12 -0
  273. package/templates/init/platform/jobs/days-before.ts.tpl +8 -0
  274. package/templates/init/platform/jobs/housekeeping.module.tsyringe.ts.tpl +46 -0
  275. package/templates/init/platform/jobs/housekeeping.ts.tpl +24 -0
  276. package/templates/init/platform/jobs/job-settings.ts.tpl +6 -0
  277. package/templates/init/platform/privacy/personal-events.ts.tpl +11 -0
  278. package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +69 -19
  279. package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +69 -8
  280. package/templates/init/platform/privacy/run-export.manual.ts.tpl +2 -2
  281. package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +4 -2
  282. package/templates/init/platform/privacy/run-purge.manual.ts.tpl +3 -2
  283. package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +4 -2
  284. package/templates/init/rules/infrastructure.md.tpl +1 -1
  285. package/templates/init/scripts/privacy-erase.manual.ts.tpl +52 -7
  286. package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +52 -7
  287. package/templates/init/scripts/privacy-export.manual.ts.tpl +4 -0
  288. package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +4 -0
  289. package/templates/init/scripts/privacy-purge.manual.ts.tpl +4 -0
  290. package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +4 -0
  291. package/templates/pipeline/package-scripts.json +1 -1
  292. package/templates/pipeline/stryker.config.mjs.tpl +4 -0
  293. package/templates/worker/main.ts.tpl +3 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,96 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.102.0
8
+
9
+ **A subscription removed while its consumer was starting no longer leaves a consumer without handler, on RabbitMQ and on NATS.** The consumer stayed registered with nothing to handle a message: each one came back at once, in a loop with no delay, until a handler took it or the bus closed. The consumer now leaves as soon as it is registered, and the messages wait in the queue or the stream for the next handler.
10
+
11
+ **A dangling link at `.ddd-ts-kit/lock` no longer hangs a command that takes the generator lock.** The command waited forever, with no message. It now waits as long as for a lock another command holds, then refuses, says what stands there and writes nothing.
12
+
13
+ **`test:mutation` of a project generated on pnpm runs its mutants.** Stryker looks for its plugins beside its own real path, where pnpm's strict layout keeps `core` alone, so the run died in two seconds on `Cannot find TestRunner plugin "vitest"` (and `"jest"`) before any mutant. The generated `stryker.config.mjs` now names the runner of the stack in `plugins`, `@stryker-mutator/vitest-runner` or `@stryker-mutator/jest-runner`; the ignorer of the kit is still appended by `governedMutation()`. An end-to-end spec installs a project with pnpm (Vitest and Jest) and with npm, and runs `test:mutation` on one aggregate.
14
+
15
+ To move: a project already generated on pnpm adds `plugins: ['@stryker-mutator/vitest-runner']` (or `'@stryker-mutator/jest-runner'`) to its `stryker.config.mjs`.
16
+
17
+ **`runCheck` of the `ddd-ts-kit` package takes a `catalogue` option: the rules it judges with, the rules of the kit unless it is given.** It replaces those rules for the run. The commands do not pass it.
18
+
19
+ **The contracts of `@ddd-ts-kit/testing` hold more of what an adapter answers at the edges.** `outboxStoreContract` takes an empty batch, an empty publication and an empty revival as nothing to do, and expects `markFailed` to leave a published record published and to ignore an unknown id. The job store contract expects `false` for the heartbeat of a job the store does not hold. The event store contract loads a consignment again after a refused append and reads the winner's weight. A project that runs these contracts on an adapter of its own may see a new case fail: the case says what the port promises.
20
+
21
+ `controllerRoutes` of `@ddd-ts-kit/http` types the result of a tuple of one controller as a tuple of one route.
22
+
23
+ **The personal data erasure contract also runs a declaration that names no file column: `personalDataErasureContract` of `@ddd-ts-kit/testing` takes a `createWithoutFiles()` option beside `create()`.** Most tables of a context hold no file: the contract now proves that an adapter given such a declaration needs no file storage and still reaches the rows of the subject as the declaration says (erased with `row`, or their personal columns set to null). The four ORM adapters and the in-memory fake pass it.
24
+
25
+ To move: a project that runs `personalDataErasureContract` on an adapter of its own gives it `createWithoutFiles()`, a fresh subject over an empty table whose declaration names no file column, with no file storage handed to the adapter; it is called before each test, as `create()` is.
26
+
27
+ **`StdoutLogger` takes a `stream` option.** The lines go to that stream instead of the standard output, and `flush()` waits for it. A `write` of the project still receives each line and wins over `stream`.
28
+
29
+ **A form refuses a body property whose name holds a dot, when the routes are built.** A field of a form is named by its path, whose segments a dot separates, so `address.line1` read as a nested field: the form lost its constraints and changed its key.
30
+
31
+ To move: rename the property, or keep it out of the body of the form.
32
+
33
+ **A controller whose schema is written inline no longer crashes `describe`, `docs` and `digest`.** `body: z.object({ amount: z.number(), currency: z.string() })` ended in a raw `SyntaxError`. The schema is now reported whole, over several lines included, and a part that closes the options with no comma after it is read too.
34
+
35
+ **A `ddd-ts-kit.config.json` nested more than 32 levels deep is refused with a message.** The command died on a raw `RangeError` when it tried to print such a value, and `digest` did on any commit that held one.
36
+
37
+ **A stored background job keeps who acts, never the profile a credential gave.** `StoredJobQueue` writes the id, the type, the tenant, the roles and the `tenants` attribute of the actor into `enqueued_by`; the email, the username and every other attribute stay with the request, so a job row holds nothing of the person who asked for it. `actorAttributes` of `StoredJobQueue` names an attribute a run needs.
38
+
39
+ To move: a job that reads `execution.actor.attributes` other than `tenants` receives it in its payload, reads the actor again by its id, or names it in `actorAttributes` (`new StoredJobQueue({ ..., actorAttributes: ['department'] })`, in `create-background-work.ts` or the `jobQueue` option of `kernelModule`). Jobs already waiting keep the attributes they were stored with.
40
+
41
+ **A tenant refusal below the edge answers what it means, on every HTTP adapter and RPC procedure, instead of a 500.** `NoCurrentTenantError`, `InvalidTenantIdError` and `EventStreamTenantError` are now `DomainError`s: a caller who names no tenant is answered 403 `FORBIDDEN`, a credential that names an id outside the grammar 404 `NOT_FOUND`, an append to a stream of another tenant 404 `NOT_FOUND`, with no word of the stream or of the id named. Each is logged as a warning and sent to no error tracker.
42
+
43
+ To move: code that told these errors from a refusal by `instanceof DomainError` now sees a refusal. A scheduled or background job refused this way fails its run with `errorCode` `FORBIDDEN` or `NOT_FOUND` instead of `UNEXPECTED_ERROR`, and is no longer sent to the error tracker: an alert on those runs reads the code.
44
+
45
+ **An erasure reaches what the outbox and the job store keep of the person.** `eraseDataSubject` takes `shared`, the copies no tenant confines, run once. `runErasure` gives it `personalEventsInOutbox(store, personalEvents)` of `@ddd-ts-kit/events`, which erases the fields the `personal` option of an event lists in every record that names the person, pending, published or dead, and `jobsOfSubject(store)` of `@ddd-ts-kit/scheduling`, which drops every job enqueued with the person as `subject`, whatever its status: a waiting job does not run, a running one stops at its next heartbeat. Each writes its entry to the audit trail, and the report names them `platform.outbox` and `platform.background-jobs`. `ddd-ts-kit docs` writes `src/platform/privacy/personal-events.ts` from the `personal` options, and `docs --check` holds it to them. `OutboxStore` gains `erasePersonalFields(subject, events)` and `JobStore` gains `eraseSubject(subject)`, on the four ORM, in memory and on Redis, under their contract suites. A pending record goes out with `[erased]` in place of the field: a consumer whose schema refuses that text refuses the event, and nothing of the person leaves. What stays out of reach is a message already delivered, a field no `personal` option lists, and a job that holds a person without naming them as `subject`.
46
+
47
+ To move: `init --force` rewrites `src/platform/privacy/run-erasure.ts`, then run `ddd-ts-kit docs`. A job about a person is enqueued with `{ subject: personId }`. A store of your own implements `erasePersonalFields` (with `erasedPayloadOf` of `@ddd-ts-kit/events`) or `eraseSubject`, and passes `outboxStoreContract` or `jobStoreContract`. With `--di manual`, `Platform` gains `jobStore`, which `create-background-work.ts` hands on.
48
+
49
+ **An erasure that reached nothing announces nobody.** `runErasure` asks `eraseDataSubject` to refuse a subject no copy knows, so `privacy.data-subject.erased` goes out only once something was erased. `privacy:erase` then prints why and exits with code 1: a mistyped id, a tenant the directory does not list, or an erasure already complete. `--rerun` (`rerun: true` of `runErasure`) says this person was erased before: reaching nothing is expected, the exit code is 0 and the erasure is announced again, which completes one that failed before its announcement.
50
+
51
+ To move: a script that runs `privacy:erase` twice for one person passes `--rerun` the second time. `init --force` rewrites `src/platform/privacy/run-erasure.ts` and `scripts/privacy-erase.ts`.
52
+
53
+ **A chain that does not verify stops its own archive, no other.** `archiveBefore` tries every chain, on the four SQL stores and on `InMemoryAuditTrail`, then throws `AuditArchiveRefusedError` once they all ran, with `refusals` (each with its `chain` and its `chainBreak`) and `archives` (what the other chains archived). A failure of the storage still ends the run where it is.
54
+
55
+ To move: `AuditArchiveRefusedError` holds `refusals` in place of `chain` and `chainBreak`, and its constructor takes them. Code that reads `error.chain` reads `error.refusals`.
56
+
57
+ **A chain cut at its tail does not verify against a later checkpoint.** `verifyChain` used to compare a checkpoint with the entry at its position only, so a checkpoint past the last entry was never read. A chain that stops before the last checkpoint given, inside `to` when there is one, is now reported `missing-entry` at the first position gone. Given entries without `chain`, a chain a checkpoint names and no entry holds is reported too. `auditTrailContract` takes `cut`, which removes the end of a chain behind the back of the trail.
58
+
59
+ `verifyChain` still stops at its first break, by decision: past it the chain proves nothing of what comes next. Whoever has looked at a break walks on with `from`, which the documentation now shows.
60
+
61
+ **An audit entry is hashed as the store keeps it, so a chain nobody touched always verifies, whatever text a record held.** A surrogate without its pair has no UTF-8 encoding and PostgreSQL refuses NUL: the entry used to be hashed with the text as it came and stored with something else, or not stored at all. `seal` now puts U+FFFD in their place in every text of the entry, the keys of `changes` and `extensions` and the name of the chain included, before it hashes, on the four SQL stores and on `InMemoryAuditTrail`. A text in `changes` or `extensions` no longer fails the command, and two tenants whose names differ only there share one chain, without a fork. `wellFormed` gives that form to a store of your own, and `auditTrailContract` holds every store to it.
62
+
63
+ A chain that already holds such an entry stays as it is: the text the entry was hashed over is gone, so `verifyChain` keeps reporting `altered-content` at that entry, and a trail is append-only, so nothing repairs it. That chain is not archived from there on; the other chains are. The entries after it verify with `from` set to the position after the break, which trusts that entry.
64
+
65
+ To move: a store of your own, held to `auditTrailContract`, passes every record through `wellFormed` before it hashes.
66
+
67
+ **`verifyChain(trail, { chain, after })` starts after the anchor it is given, so the verification of a chain that has archives holds.** It used to look for sequence 1 all the same and report a `missing-entry` on a chain that was fine, unless `from` said the position again. `from` now defaults to the position after `after`. The plain `verifyChain(trail, { chain })` keeps answering `missing-entry` at sequence 1 on a chain that has archives: the walk does not read the archives on its own, an anchor being what a row says until `verifyArchive` has proved it, so the caller names the one it trusts.
68
+
69
+ **Every erasure leaves its audit entry with its operator, with or without event sourcing.** `auditedPersonalDataErasure(copy, trail, { scope, clock, ids })` of `@ddd-ts-kit/audit` wraps a `PersonalDataCopy`: each run writes `data-access`, `personal-data:erase`, the subject, the name of the copy as `context` and `changes: { rows }`, `0` included, under the actor of the work. `runErasure` wraps every copy when the trail is on, in the three families of dependency injection, beside `auditedSubjectKeys` for the key.
70
+
71
+ To move: `init --force` rewrites `src/platform/privacy/run-erasure.ts`; a project that keeps its file wraps each copy of `copies` with `auditedPersonalDataErasure`.
72
+
73
+ **A failure whose audit entry could not be written is told to the log.** `logLostRecords(logger)` of `@ddd-ts-kit/audit` is an `onLostRecord` that writes one `audit entry lost` line, at level `error`: the category, the action and the reason of the entry, the type and the code of the failure, never its message. A generated project with the trail on passes it to `auditMiddleware`, `auditedSubjectKeys`, `auditedPersonalDataErasure`, `auditedPersonalDataExport` and `auditedPersonalDataRetention`, and the scripts of `--privacy on` now log errors.
74
+
75
+ To move: a generated project calls `createAudit(persistence, source, logger)`, and its `Audit` gains `onLostRecord`. `init --force` writes them; by hand, pass `logLostRecords(logger)` as `onLostRecord` to the sources above.
76
+
77
+ **`tenancy/scoped-statement` holds that the tenant condition is a conjunct of the statement, on the four ORM, and `tenantTable`, `ownTenantTable` and `whereTenant` hold it when the statement is built.** SQL binds `and` before `or`, so an alternative beside the condition is outside it. On Knex the rule reports `.orWhere*`, `.or`, `clearWhere()` and `clear('where')` on a statement of the helpers, on the chain, on a local, on what a function of the file answers and in a `modify`, and the three helpers throw `UngroupedOrError` or `ClearedTenantConditionError` when such a statement is built, whatever the rule can read; the text of a `whereRaw`, and a `knex.raw` given to a where, is kept in parentheses as one conjunct with its bindings; an `orHaving` applies after the where, and is free; their type does not change. On Drizzle the condition is a direct argument of `where` or of `and`, never under `or`, `not` or a `sql` template, and a local of the condition may now be given to `and`. On Prisma the helper is spread at the top of the `where` or of its `AND`, never under `OR`, `NOT` or a relation. On TypeORM the same, a where array spreads it in each entry, a query builder has no `orWhere` at its top, and the condition stands in its last `where` or an `andWhere` after it, since a `where` resets what comes before it. An `or` in a group and-ed with the condition stays correct: the callback of a Knex `where`, `and(tenantCondition(...), or(a, b))`, an `OR` beside the Prisma spread, `new Brackets(...)` in a TypeORM `andWhere`.
78
+
79
+ To move: where `ddd-ts-kit check` now reports a statement, put the alternatives in a group beside the condition, as `ddd-ts-kit explain tenancy/scoped-statement` shows. On Knex, do the same for a statement that throws `UngroupedOrError`, and start a new statement from the helper where one throws `ClearedTenantConditionError`: the helpers refuse at run time what the rule cannot read, such as a builder handed to another function.
80
+
81
+ **The guard holds a worker and the other sessions wherever a file stands, and says what it could not read.** A builder's editor tools are refused outside its worktree from its first call, in the checkout of the conductor, in another worktree and outside every project but the temp directory, with the instruction to name the file under its worktree. A worker's git only reads from any checkout but its own: the conductor alone lands a branch or moves its checkout, and no worker removes a worktree or writes a ref. The shell rules of the test writer, the story gate, the generated files and the baseline judge a place in the project that owns it; the test writer is refused a place only the shell knows, and its `test/` is the root one or the one of a context; what a redirection, `sed -i` or `tee` types in the code of a context on the trunk, or in a new file of a generated role, is refused as the editor tools refuse it. `check --baseline write` is read on the words of the command, through every launcher of the kit and the package scripts of the project.
82
+
83
+ A folder that holds a locked regression spec counts as the spec, and so does a write whose place only the shell knows; `find -exec` is judged by the folders it starts from, and reads through `find` and `xargs` stay free. What a worker's last command and its background commands change outside its scope is compared: a read keeps the note of the worktree, and at the stop the worker goes on once to put a file back, what stays reaching the conductor in `lastStop.outside` of `agent.json`, in its report, in `status --workers` and in `worker-scope --resume`.
84
+
85
+ A line that ends inside a quote, with a here-document that never closes, or that the reader breaks on is refused to a worker. The reader follows a here-document inside `$(...)`, `$'...'` and `$((...))`. The answers of the processes the guard starts are read up to 64 MiB: a `check` past it lets the session finish and says so, and a `git status` past it compares nothing and says so. A generated file put back or deleted (`git checkout`, `git restore`, `git rm`, `rm`) is no longer refused to a session, and `touch -t` no longer reads its date as a target.
86
+
87
+ To move: a worker that ran `git add`, `git commit` or `git merge` without `cd <worktree> &&`, or after `cd <worktree>;`, runs it as `cd <worktree> && ...`. A session that wrote the code of a context on the trunk by the shell opens a worktree, as the editor tools already asked.
88
+
89
+ **The platform purges what it is done with, every night.** `init` schedules `events.purge-published` at 03:30 UTC with an outbox and `jobs.purge-finished` at 03:45 UTC with a stored queue, both in the whole application: a published record and a job that succeeded or was cancelled keep their payload until then. `OUTBOX_RETENTION_DAYS` and `BACKGROUND_JOBS_RETENTION_DAYS` say how long, thirty days by default, `JOB_EVENTS_PURGE_PUBLISHED_ENABLED=false` and `JOB_JOBS_PURGE_FINISHED_ENABLED=false` switch one off in one environment. A dead event and a dead job stay until an operator decides.
90
+
91
+ To move: `init --force` writes `jobs/housekeeping.ts`, `jobs/days-before.ts`, on tsyringe `jobs/housekeeping.module.ts`, and their wiring. A project that purges by a job of its own removes that job, or gives the platform job its retention. A service of its own database schedules the two purges itself: `platformJobs: false` leaves them to the whole application.
92
+
93
+ **In a multi-tenant project, work that names no tenant is refused before it reads or appends to an event stream, and before it finds or cancels a stored job.** An event store given the execution scope now means a project whose streams belong to tenants: `readStream` and `append` refuse work that names no tenant with `NoCurrentTenantError` before any statement, on a stream that exists or not, so no stream is created in no tenant. A stream of another tenant is refused from whatever version it is read, and `EventSourcedRepository.findById` answers it as an id nobody saved. `readAll` and `head` stay open: a subscription applies each event in its tenant. `StoredJobQueue` takes `tenant: true`, which `kernelModule` sets when it is given `tenants`: `find` and `cancel` then refuse work that names no tenant before the store is read. `init --tenancy shared-table` writes both on the four ORM and every wiring, and the tenant suite of `eventStoreContract` proves the rule on every store. A project without tenancy hands neither and is unchanged. `generate aggregate --event-sourced` refuses a context declared `control-plane`, whose data belongs to no tenant.
94
+
95
+ To move: in a multi-tenant project, a global job that reads streams or finds jobs opens `acrossTenants`, and one that appends runs `per-tenant`. Where the platform is wired by hand or on Nest, add `tenant: true` to the `StoredJobQueue` of `src/platform/jobs/create-background-work.ts`. In `src/platform/database/persistence.contract.spec.ts`, `createStore` and `createCompanions` hand `eventSourcing` a `FixedExecutionScope` that names a tenant. A stream stored in no tenant is refused to everyone: give it its tenant in a migration (`addEventStoreTenantColumn(knex, { schema, tenantOfExistingStreams })` on Knex, an `update` of `tenant_id` otherwise). A project without tenancy that hands `scope` to its event store removes it. A custom `EventStore` held to `eventStoreContract` with `createTenantStore` refuses work that names no tenant, and answers its `createStore` in one tenant. An event-sourced aggregate of a `control-plane` context moves to a table.
96
+
7
97
  ## 0.101.0
8
98
 
9
99
  **A class the kit writes for class-validator refuses an input that lacks one of its fields, and `classSchema` refuses a class that gives a field an initial value.** A field was written with an initial value (`calendarId = ''`, `refundAmount = 0`, `notifyCustomer = false`), which class-transformer keeps for a field the input lacks: a request without `calendarId` passed `@IsString()` as if it carried an empty one, and a consumer read an integration event without it the same way. Each field is now `declare`d with no initial value (`declare calendarId: string;`), and an optional one is `@IsOptional()` with `declare note?: string;`. This covers the body, path parameter, `Accepted` and `Line` classes `generate route` writes (functions, controllers and Nest routes), the body fields it reads from the constructor of the command, the payload of `generate integration-event`, the optional fields of the payload of `generate background-job` (its required ones already were), and the DTOs and payloads of `init --preset identity`. The spec `generate route` writes for a route that reads its body from the command now sends that body without its first field and expects 422 `VALIDATION_FAILED` with an issue at `body.<field>` among the others (a constraint added to the field keeps it green), whatever the validation library. The `TODO(domain)` of an empty class-validator class says to `declare` its fields, and a nested one is marked `@IsDefined()` when it is required, since `@ValidateNested()` lets a missing object through. `privacy/event-payload-declared` reads a `declare`d member of a payload class and a member written with `public`, `private` or `protected`, which it skipped. `classSchema` of `@ddd-ts-kit/validation/class-validator` throws a `DeclarationError` when a fresh instance of the class holds a value (`reason = ''`, `amount = 0`), naming the class, the fields and the fix; a field written `note?: string` holds none and is let through.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:30c337f1260e6a9d -->
2
+ <!-- translation-of: README.md sha256:5366c7f12122bcaf -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -632,7 +632,7 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
632
632
  | `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` avec `negotiated`, et `fieldDeciderOf` sur l'`Access` de l'application), décomposé dans la frontière HTTP et donné au script du contrat ; avec `--forms on`, `src/platform/http/with-forms.ts` ajoute `formRoutes` aux routes et `scripts/openapi.ts` écrit `openapi/forms/<operationId>.json`. Les deux sont la valeur par défaut avec une *stack* HTTP ; `json` et `off` les laissent de côté ([docs/CONFIG.fr.md](../../docs/CONFIG.fr.md)) |
633
633
  | `--audit on` | `src/platform/audit/` : `create-audit.ts` (le journal, le `onDecision` de l'autorisation, les refus des gardes à la frontière remis à la frontière HTTP comme `onGuardRefusal`, le *middleware* avant l'unité de travail, les événements d'intégration abonnés sous le nom de consommateur `audit`), `audited-events.ts` (le registre auquel `generate integration-event` ajoute), `audit.module.ts`, et avec une *stack* HTTP le côté lecture : `audit.permissions.ts` (`audit:trail.read`), puis dans `search-audit-entries/` : `search-audit-entries.query.ts`, son gestionnaire, `search-audit-entries.route.ts` ou `.controller.ts` (`GET /audit/entries` : pages par curseur, filtres `actorId`, `action`, `outcome`, `correlationId`), qui commence par le point d'entrée et prend ce qu'il reçoit et répond dans `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` et `audit-outcomes.ts`. C'est une capacité de la plateforme, pas un contexte délimité : pas de modèle, une requête protégée sur le port `AuditReader`, bornée par le *tenant* de l'acteur (avec `--tenancy shared-table`, par le *tenant* du travail au moyen de `TenantAuditReader` : le personnel de la plateforme ne lit à travers les *tenants* qu'à l'intérieur de `acrossTenants`). Les refus d'un appelant sans identifiant de connexion ne sont pas enregistrés. Un *job* planifié est audité comme une requête HTTP : origine `schedule`, acteur `system:<context>.<job>`. Avec knex, les deux tables et leurs déclencheurs en ajout seul sont créés par la première migration ; avec drizzle, les tables sont dans `schema.ts` et `npm run db:generate` ajoute les instructions des déclencheurs à la migration qui crée les tables (`npm run db:audit-guard` les affiche pour une migration écrite à la main) ; avec prisma et typeorm, les tables sont des modèles de `prisma/schema/schema.prisma` ou des entités de `schema.ts` (`auditPrismaModels`, `auditEntities` de `@ddd-ts-kit/audit`), écrites par `PrismaAuditTrail` et `TypeOrmAuditTrail`, et `npm run db:generate` (par `ddd-ts-kit prisma-generate` ou `typeorm-generate`) ajoute les instructions des déclencheurs à la migration qui crée les tables, `npm run db:audit-guard` les affichant pour une migration écrite à la main ; les bases de test installent ce garde ; avec `custom` ou sans ORM, le journal est un `InMemoryAuditTrail` derrière un `TODO(platform)`. Les bases de test laissent le schéma d'audit hors de `reset()`. Avec le journal en base et `--storage local` ou `s3`, `audit.module.ts` (ou la composition câblée à la main) enregistre `audit.archive` le premier jour de chaque mois à 04:00 UTC : les entrées de plus de douze mois entiers partent dans le stockage sous `audit-archives/`, vérifiées, relues et ancrées (`ArchiveAuditEntries`) ; avec `s3` il tourne sauf `JOB_AUDIT_ARCHIVE_ENABLED=false`, avec `local` seulement avec `JOB_AUDIT_ARCHIVE_ENABLED=true`, puisque l'archive supprime les entrées de la base et que le disque du serveur peut ne pas durer |
634
634
  | `--event-sourcing on` | enregistré comme `stack.eventSourcing`, `off` sauf demande : `Persistence` gagne `eventSourcing` (`create<Orm>EventSourcing` dans le schéma `event_store`, dont le fichier de schéma déclare les cinq tables ; les stores en mémoire avec `--orm none`), et `src/platform/event-sourcing/` : `create-event-sourcing.ts` (`EventSourcing` : les stores, le `SubjectKeyStore` enveloppé par `auditedSubjectKeys` avec `--audit on`, et le `PersonalDataCipher` par-dessus) et, avec tsyringe, `event-sourcing.module.ts` (lie `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` et `PersonalDataCipher`, pour qu'un adaptateur de *repository* *event-sourced* les nomme dans son constructeur ; la `Platform` câblée à la main les porte comme `platform.eventSourcing`) ; `platform-test.module.ts` lie les stores en mémoire, pour qu'une *spec* de gestionnaire d'un agrégat *event-sourced* n'ait besoin d'aucun *fake*. `generate aggregate --event-sourced` est refusé sans lui, avec le `init --force --event-sourcing on` à lancer. Refusé avec `--orm custom` : l'event store du kit tourne sur PostgreSQL par les quatre paquets d'ORM |
635
- | `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, `inEachTenant` avec `--tenancy shared-table`, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
635
+ | `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `personal-events.ts` (les événements qui portent des données personnelles, écrits par `docs` depuis leur option `personal`), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, rerun?, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, chacune enveloppée par `auditedPersonalDataErasure` avec `--audit on`, `inEachTenant` avec `--tenancy shared-table`, puis une fois les enregistrements de l'outbox et les *jobs* de la personne, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*, sauf si rien n'a été atteint) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
636
636
  | `--tenancy shared-table` | enregistré comme `stack.tenancy` ; les quatre ORM. Chaque `generate repository` est cloisonné par *tenant* (comme `--tenant-scoped`), au moyen de `tenantTable` et `ownTenantTable` (Knex), de `tenantCondition` et `ownTenantCondition` (Drizzle), de `tenantWhere` et `ownTenantWhere` (Prisma, TypeORM) ; l'outbox garde le *tenant* de chaque événement (`createOutboxTables(knex, { tenant: true })` et le `tenant: true` de `KnexOutboxStore`, `tenantOutboxTable`, le champ `tenantId` du modèle Prisma et le `tenant: true` de `PrismaOutboxStore`, `outboxEntity({ tenant: true })`), si bien que les consommateurs s'exécutent dans ce *tenant* ; `tenancy/scoped-statement` juge les adaptateurs. La sécurité au niveau des lignes, un schéma par *tenant* et une base par *tenant* sont refusés, avec ce qu'il faut câbler à la main ([Multitenance](../../docs/concepts/multitenancy.fr.md)) |
637
637
  | `--queue database\|redis\|memory` | enregistré comme `stack.queue`. `database` (par défaut sur Knex, Drizzle, Prisma et TypeORM, quel que soit le conteneur) : les tables du *package* de l'ORM (`createJobTable` et `createProcessTable`, `jobsTable` et `processesTable`, les modèles `BackgroundJob` et `ProcessInstance`, `jobEntity` et `processEntity`) dans le schéma `messaging`, `Persistence` gagne `jobs` et `processes`, et la plateforme relie `JobStore` et `ProcessStore` à eux (le module de la plateforme sur tsyringe, `jobs/create-background-work.ts` là où la plateforme est câblée à la main ou sous Nest), si bien qu'un *job* mis en file par une commande est écrit dans sa transaction ; `redis` (avec `--cache redis`) : `RedisJobStore` sur la connexion du cache, les processus dans la base de données ; `memory` (par défaut avec une persistance sur mesure ou sans persistance) : rien n'est écrit, les deux restent dans le processus. Refusé : `database` avec un autre ORM, `redis` sans le cache |
638
638
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices` : le cache lié au `Cache` du kernel, le limiteur à `RateLimiter`, le verrou à `Lock`, qui réserve un *job* planifié à une seule instance, le signal du relais comme `wakeOn` du relais de l'outbox avec `relayWakeUpMiddleware` sur le bus de commandes), `http/too-many-requests-for.ts` (une fenêtre glissante par adresse d'appelant, 429 `application/problem+json` avec `retry-after` ; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS` ; l'adresse est celle du socket sauf si `TRUST_PROXY` nomme les proxys placés devant, par sauts ou par adresse, par sauts seulement sur Hono), `GET /health/ready` sur le serveur HTTP, `REDIS_URL` validée, un service compose `cache` qui exécute Dragonfly avec un contrôle de santé. Sans serveur (outils, tests sans `REDIS_URL`), les mêmes ports restent dans la mémoire du processus |
@@ -644,7 +644,7 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
644
644
  | `src/platform/database/` | `persistence.ts` (`interface Persistence` : unité de travail, magasins de l'outbox et des événements traités du *package* de l'ORM, la poignée de stockage), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, la connexion (`connect-to-database.ts`, `create-client.ts` ou `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, le schéma de ce que le kit stocke pour l'application), `open-test-database.ts` (PostgreSQL dans le processus, ou le serveur nommé par une URL ; avec Vitest chaque *spec* ouvre une copie du cluster que `test/support/test-database-template.ts`, la mise en place globale de l'exécution, initialise une fois, et y crée ses tables ; avec drizzle depuis `table-statements.ts`, le SQL des tables de `schema.ts`, puisque drizzle-kit écrit des migrations, pas des tables, ses index uniques compris), `persistence.contract.spec.ts` (les stores de l'outbox, des événements traités, des *jobs* et des processus tels que la plateforme les branche, tenus aux contrats de `@ddd-ts-kit/testing` avec ce que la pile active : le *tenant* sous `--tenancy`, l'unité de travail). La classe de stockage qu'un adaptateur de *repository* nomme dans sa liste de dépendances : `database.ts` avec drizzle et prisma (`abstract class Database extends` le type de contexte du *package* de l'ORM), `KnexContext` de `@ddd-ts-kit/knex`, `TypeOrmContext` de `@ddd-ts-kit/typeorm` |
645
645
  | outillage des migrations | `drizzle.config.ts`, `knexfile.js` et `migrations/00000000000000_initial.js`, `prisma/schema/schema.prisma` (le client, la datasource et les tables de la plateforme ; `generate repository` ajoute le fichier de chaque contexte, `prisma/schema/<context>.prisma`) et `prisma.config.ts`, ou `data-source.ts`. Un projet qui garde le seul `prisma/schema.prisma` des versions antérieures à 0.95 le garde avec son `prisma.config.ts` et son `db:client`, même sous `--force` : `init` n'écrit rien sous `prisma/schema/`, ses notes donnent les étapes du déplacement en nommant les contextes du projet, et `generate repository` refuse jusqu'au déplacement |
646
646
  | `scripts/openapi.ts`, `scripts/events.ts` | écrivent `openapi/openapi.yaml` (un fichier par document de `openapi.documents`), `docs/integration/asyncapi.yaml` et `docs/integration/event-catalog.md`, en JSON sous `openapi.format: json` ; `--check` échoue sur une différence |
647
- | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | avec `--privacy on`, les deux demandes d'une personne concernée, traitées en ligne de commande sur les sources avec les variables de `.env` (`npm run privacy:erase -- <subject-id> [--operator <qui-demande>]`, `npm run privacy:export -- <subject-id> > export.json`) : l'effacement détruit d'abord la clé de la personne quand le projet a un event store (`--event-sourcing on` : ses événements stockés se lisent effacés ; audité avec `--audit on`), puis efface chaque copie listée dans `src/platform/privacy/data-subject-copies.ts` ; `privacy:purge` lance à la main ce que le *job* `privacy.purge-expired` lance chaque nuit à 03:00 UTC, la purge de ce qui a dépassé sa durée de conservation (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` coupe le *job*) ; l'export rassemble chaque enregistrement listé dans `data-subject-exports.ts` en un document JSON daté (`format`, `subject`, `exportedAt`, `records`), l'export de chaque contexte audité avec `--audit on`, jamais les valeurs (chaque exécution laisse son entrée, un essai compris : essayez-le sur une personne de test). Avec `--tenancy shared-table`, `TENANTS` nomme les tenants, séparés par des virgules : une écriture de données de tenant n'est jamais élargie. Ni l'un ni l'autre n'atteint les sauvegardes, les journaux ou une copie qu'aucun contexte n'a déclarée |
647
+ | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | avec `--privacy on`, les deux demandes d'une personne concernée, traitées en ligne de commande sur les sources avec les variables de `.env` (`npm run privacy:erase -- <subject-id> [--operator <qui-demande>] [--rerun]`, `npm run privacy:export -- <subject-id> > export.json`) : l'effacement détruit d'abord la clé de la personne quand le projet a un event store (`--event-sourcing on` : ses événements stockés se lisent effacés ; audité avec `--audit on`), puis efface chaque copie listée dans `src/platform/privacy/data-subject-copies.ts`, chacune laissant son entrée avec `--audit on`, et ce que l'outbox et le stockage des *jobs* gardent de la personne ; un id qui n'a rien atteint est refusé, code de sortie 1, et annoncé à personne, sauf si `--rerun` dit que cette personne a déjà été effacée ; `privacy:purge` lance à la main ce que le *job* `privacy.purge-expired` lance chaque nuit à 03:00 UTC, la purge de ce qui a dépassé sa durée de conservation (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` coupe le *job*) ; l'export rassemble chaque enregistrement listé dans `data-subject-exports.ts` en un document JSON daté (`format`, `subject`, `exportedAt`, `records`), l'export de chaque contexte audité avec `--audit on`, jamais les valeurs (chaque exécution laisse son entrée, un essai compris : essayez-le sur une personne de test). Avec `--tenancy shared-table`, `TENANTS` nomme les tenants, séparés par des virgules : une écriture de données de tenant n'est jamais élargie. Ni l'un ni l'autre n'atteint les sauvegardes, les journaux, une copie qu'aucun contexte n'a déclarée, un message déjà livré ou un *job* qui ne nomme aucun `subject` |
648
648
  | `docker-compose.yml`, `.env.example`, `Dockerfile`, `.dockerignore` | la base de données avec un contrôle de santé et un volume nommé, `jaegertracing/jaeger:2.22.0` derrière le profil `observability`, chaque port publié sur 127.0.0.1 seulement (une adresse plus large s'écrit dans l'entrée à dessein, le README du projet dit comment), les ports depuis `.env` ; une image multi-étapes, sans root, avec les seules dépendances de production |
649
649
  | `vitest.e2e.config.ts`, `test/e2e/support/` | `start-application.ts` (l'application entière sur un port libre, sur une base de données dans le processus sauf si `DATABASE_URL` est définie, aucun *job* lancé par le temps ; `settled()` se résout quand l'outbox a relayé ce que les requêtes HTTP ont enregistré ; `publish(events)` remet des événements d'intégration de l'amont à ses gestionnaires, comme le ferait le relais de cet amont), `create-credentials.ts`, `auth-environment.ts`, `test-environment.ts`, `story-of.ts` (`storyOf(trace)` : une trace sans les appels qu'un adaptateur fait sur lui-même, la forme que vérifie `expectSpanTree`) |
650
650
  | `docs/context-map.md`, `docs/integration/README.md` | voir `docs` |
@@ -2491,7 +2491,7 @@ règle.
2491
2491
  | `tracing/platform-only` | un import de `@ddd-ts-kit/tracing` ou d'un *package* `@opentelemetry/*` hors du répertoire de la plateforme, de `main.ts` et de `apps/`, tests compris |
2492
2492
  | `nest/no-parallel-pipeline` | dans `presentation/`, `infrastructure/` ou le fichier de module d'un contexte, tests à part : un import d'un contrôleur que Nest sert (ses décorateurs de route et de paramètres, sauf si le fichier importe `KitRoute` ou `KitRoutes` de `@ddd-ts-kit/http/nest`), de la requête ou de la réponse brutes, d'un *guard*, d'un *pipe*, d'un filtre d'exceptions ou d'une `HttpException`, d'un intercepteur ou du `Logger` de `@nestjs/common`, un import sans nom de celui-ci, ou un import d'un *package* de Nest dont le kit fait le travail (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` et les autres de la section 3 d'ARCHITECTURE.md) ; le message dit ce que le kit fait à sa place ; sous la racine des sources hors des contextes, tests à part : un fichier qui importe `Controller` de `@nestjs/common`, ni `KitRoute` ni `KitRoutes`, et nomme `CommandBus` ou `QueryBus` ou importe un fichier d'un contexte |
2493
2493
  | `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une partie de la requête prise entière par aucune classe DTO et que `request` de `@KitRoute` ne donne pas ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
2494
- | `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests et contexte dont `tenancy` vaut `control-plane` mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`. Un where construit par une autre fonction n'est pas suivi |
2494
+ | `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests et contexte dont `tenancy` vaut `control-plane` mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`, et une condition du *tenant* qui ne reste pas en `and` avec son instruction : sur Knex `.orWhere*` ou `.or` au sommet d'une instruction de `tenantTable`, `ownTenantTable` ou `whereTenant`, `clearWhere()` ou `clear('where')` sur elle, sur Drizzle la condition sous `or`, `not` ou un gabarit `sql`, sur Prisma l'étalement sous `OR`, `NOT` ou une relation, sur TypeORM de même, un tableau where dont une entrée ne l'étale pas, un `orWhere` au sommet d'un *query builder*, un `where` après celui qui porte la condition. Un where construit par une autre fonction n'est pas suivi |
2495
2495
  | `standard/no-parallel-interface` | une classe, une interface ou un alias de type déclaré comme `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (hors de `presentation/` et de la plateforme), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` suivi d'un nom standard (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) ou un nom de `standardInterfaces` ; une classe qui implémente ou étend l'interface standard est un adaptateur et n'est pas signalée |
2496
2496
  | `events/outbox-required` | `stack.events` autre que `outbox` avec un ORM et sans dérogation `stack.events` ; dans `domain/` et `application/`, l'import d'un client de *broker* ou d'une implémentation de bus ou de relais ; un *publisher* qui dépend de plus que `IntegrationEventPublisher` ; un module de la plateforme qui distribue un *publisher* et ne nomme jamais `OutboxPublisher` |
2497
2497
  | `events/consumer-idempotent` | une classe de gestionnaire d'événement d'intégration (`application/integration/handlers/*.integration-handler.ts`) qui ne porte pas `@IntegrationEventHandler` et n'est pas non plus enregistrée dans son fichier de module sous un nom de consommateur ; un `@IntegrationEventHandler` dont le `consumer` n'est pas une chaîne littérale non vide ; un `on(` ou un `consume(` libre sans `processed` ; un nom de consommateur utilisé deux fois, dans les déclarations comme dans les enregistrements |
package/README.md CHANGED
@@ -603,7 +603,7 @@ config, `docsUi`, `ci` and `logger` included.
603
603
  | `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` with `negotiated`, and `fieldDeciderOf` over the `Access` of the application), spread into the HTTP boundary and given to the contract script; with `--forms on`, `src/platform/http/with-forms.ts` adds `formRoutes` to the routes and `scripts/openapi.ts` writes `openapi/forms/<operationId>.json`. Both are the default with an HTTP stack; `json` and `off` leave them out ([docs/CONFIG.md](../../docs/CONFIG.md)) |
604
604
  | `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), then in `search-audit-entries/`: `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` or `.controller.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`), which starts with the endpoint and takes what it receives and answers from `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` and `audit-outcomes.ts`. It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:generate` adds the trigger statements to the migration that creates the tables (`npm run db:audit-guard` prints them for a migration by hand); with prisma and typeorm the tables are models of `prisma/schema/schema.prisma` or entities of `schema.ts` (`auditPrismaModels`, `auditEntities` of `@ddd-ts-kit/audit`), written by `PrismaAuditTrail` and `TypeOrmAuditTrail`, and `npm run db:generate` (through `ddd-ts-kit prisma-generate` or `typeorm-generate`) adds the trigger statements to the migration that creates the tables, `npm run db:audit-guard` printing them for a migration by hand; the test databases install that guard; with `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()`. With the trail in a database and `--storage local` or `s3`, `audit.module.ts` (or the hand-wired composition) registers `audit.archive` on the first day of every month at 04:00 UTC: the entries older than twelve whole months move to the storage under `audit-archives/`, verified, read back and anchored (`ArchiveAuditEntries`); with `s3` it runs unless `JOB_AUDIT_ARCHIVE_ENABLED=false`, with `local` only with `JOB_AUDIT_ARCHIVE_ENABLED=true`, since the archive removes the entries from the database and the disk of the server may not last |
605
605
  | `--event-sourcing on` | recorded as `stack.eventSourcing`, `off` unless asked: `Persistence` gains `eventSourcing` (`create<Orm>EventSourcing` in the `event_store` schema, whose five tables the schema file declares; the in-memory stores with `--orm none`), and `src/platform/event-sourcing/`: `create-event-sourcing.ts` (`EventSourcing`: the stores, the `SubjectKeyStore` wrapped by `auditedSubjectKeys` with `--audit on`, and the `PersonalDataCipher` over it) and, on tsyringe, `event-sourcing.module.ts` (binds `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` and `PersonalDataCipher`, so an event-sourced repository adapter names them in its constructor; the hand-wired `Platform` carries them as `platform.eventSourcing`); `platform-test.module.ts` binds the in-memory stores, so a handler spec of an event-sourced aggregate needs no fake. `generate aggregate --event-sourced` is refused without it, with the `init --force --event-sourcing on` to run. Refused with `--orm custom`: the event store of the kit runs on PostgreSQL through the four ORM packages |
606
- | `--privacy on` | recorded as `stack.privacy`, `on` when there is an ORM: `src/platform/privacy/`, with `data-subject-copies.ts` and `data-subject-exports.ts` (the ports, or the adapters by hand, of the contexts that extend `PersonalDataErasure` and `PersonalDataExport`, between markers; `generate repository --personal` lists the erasure and the export of a context there), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })`: an execution context of origin `cli` with the operator as actor, the key of the subject when the project has an event store, then `eraseDataSubject` of the kernel over the copies, `inEachTenant` with `--tenancy shared-table`, then `privacy.data-subject.erased` published through the outbox, once per tenant) and `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })`: `exportDataSubject` of the kernel over the exports, each wrapped by `auditedPersonalDataExport` with `--audit on`, `recordsInEachTenant` with `--tenancy shared-table`, one dated `PersonalDataExportDocument`), and the two scripts below. `docs/privacy/register.md`, the register of personal data `ddd-ts-kit docs` keeps (see `docs` below). A project without personal data takes `--privacy off` and pays nothing. No HTTP command erases yet: the two scripts are the entry points |
606
+ | `--privacy on` | recorded as `stack.privacy`, `on` when there is an ORM: `src/platform/privacy/`, with `data-subject-copies.ts` and `data-subject-exports.ts` (the ports, or the adapters by hand, of the contexts that extend `PersonalDataErasure` and `PersonalDataExport`, between markers; `generate repository --personal` lists the erasure and the export of a context there), `personal-events.ts` (the events that carry personal data, written by `docs` from their `personal` option), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, rerun?, tenants? })`: an execution context of origin `cli` with the operator as actor, the key of the subject when the project has an event store, then `eraseDataSubject` of the kernel over the copies, each wrapped by `auditedPersonalDataErasure` with `--audit on`, `inEachTenant` with `--tenancy shared-table`, then once the records of the outbox and the jobs of the person, then `privacy.data-subject.erased` published through the outbox, once per tenant, unless nothing was reached) and `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })`: `exportDataSubject` of the kernel over the exports, each wrapped by `auditedPersonalDataExport` with `--audit on`, `recordsInEachTenant` with `--tenancy shared-table`, one dated `PersonalDataExportDocument`), and the two scripts below. `docs/privacy/register.md`, the register of personal data `ddd-ts-kit docs` keeps (see `docs` below). A project without personal data takes `--privacy off` and pays nothing. No HTTP command erases yet: the two scripts are the entry points |
607
607
  | `--tenancy shared-table` | recorded as `stack.tenancy`; the four ORMs. Every `generate repository` is tenant-scoped (as `--tenant-scoped`), through `tenantTable` and `ownTenantTable` (Knex), `tenantCondition` and `ownTenantCondition` (Drizzle), `tenantWhere` and `ownTenantWhere` (Prisma, TypeORM); the outbox keeps the tenant of each event (`createOutboxTables(knex, { tenant: true })` and `KnexOutboxStore`'s `tenant: true`, `tenantOutboxTable`, the `tenantId` field of the Prisma model and `PrismaOutboxStore`'s `tenant: true`, `outboxEntity({ tenant: true })`), so consumers run in it; `tenancy/scoped-statement` judges the adapters. Row-level security, schema per tenant and database per tenant are refused, with what to wire by hand ([Multitenancy](../../docs/concepts/multitenancy.md)) |
608
608
  | `--queue database\|redis\|memory` | recorded as `stack.queue`. `database` (the default on Knex, Drizzle, Prisma and TypeORM, whatever the container): the tables of the ORM package (`createJobTable` and `createProcessTable`, `jobsTable` and `processesTable`, the `BackgroundJob` and `ProcessInstance` models, `jobEntity` and `processEntity`) in the `messaging` schema, `Persistence` gains `jobs` and `processes`, and the platform binds `JobStore` and `ProcessStore` to them (the platform module on tsyringe, `jobs/create-background-work.ts` where the platform is wired by hand or under Nest), so a job enqueued by a command is written in its transaction; `redis` (with `--cache redis`): `RedisJobStore` on the connection of the cache, the processes in the database; `memory` (the default with a custom persistence or none): nothing is written, both stay in the process. Refused: `database` with another ORM, `redis` without the cache |
609
609
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices`: the cache bound to the kernel `Cache`, the limiter to `RateLimiter`, the lock to `Lock`, which keeps a scheduled job to one instance, the relay signal as the `wakeOn` of the outbox relay with `relayWakeUpMiddleware` on the command bus), `http/too-many-requests-for.ts` (one sliding window per caller address, 429 `application/problem+json` with `retry-after`; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS`; the address is the socket's unless `TRUST_PROXY` names the proxies in front, by hops or by address, by hops only on Hono), `GET /health/ready` on the HTTP server, `REDIS_URL` validated, a compose service `cache` running Dragonfly with a healthcheck. Without a server (tools, tests without `REDIS_URL`) the same ports stay in the memory of the process |
@@ -615,7 +615,7 @@ config, `docsUi`, `ci` and `logger` included.
615
615
  | `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` |
616
616
  | migration tooling | `drizzle.config.ts`, `knexfile.js` and `migrations/00000000000000_initial.js`, `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 |
617
617
  | `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 |
618
- | `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>]`, `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`; `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 or a copy no context declared |
618
+ | `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` |
619
619
  | `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 |
620
620
  | `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`, `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) |
621
621
  | `docs/context-map.md`, `docs/integration/README.md` | see `docs` |
@@ -2334,7 +2334,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2334
2334
  | `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 |
2335
2335
  | `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 |
2336
2336
  | `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` |
2337
- | `tenancy/scoped-statement` | with `stack.tenancy` other than `none`, in `infrastructure/` of a context, tests and a context whose `tenancy` is `control-plane` aside: on Knex the executor used other than as an argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) and any `.raw(`; on Drizzle, statement by statement, a read, update or delete on the executor whose where has no `tenantCondition(` nor `ownTenantCondition(` (inline or in the local it is given), an insert whose row has no `tenantScopeOf(`, a relational query (`executor().query`), a raw `execute(`, or the executor held in a variable; on Prisma, statement by statement on the client, a read (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) whose where spreads no `tenantWhere(`, an update or a delete whose where spreads no `ownTenantWhere(`, a create whose data spreads no `tenantScopeOf(` (inline or in a local the arguments name), `findUnique(`, `upsert(`, a raw query (`$queryRaw`, `$executeRaw`), or the client held in a variable; on TypeORM the same on the manager (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, the row handed to `insertIgnoringConflict(`, a query builder whose where carries no condition, `save(`, `upsert(`, `query(`); on the four, a read model store built without its `tenant` option. A where built by another function is not followed |
2337
+ | `tenancy/scoped-statement` | with `stack.tenancy` other than `none`, in `infrastructure/` of a context, tests and a context whose `tenancy` is `control-plane` aside: on Knex the executor used other than as an argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) and any `.raw(`; on Drizzle, statement by statement, a read, update or delete on the executor whose where has no `tenantCondition(` nor `ownTenantCondition(` (inline or in the local it is given), an insert whose row has no `tenantScopeOf(`, a relational query (`executor().query`), a raw `execute(`, or the executor held in a variable; on Prisma, statement by statement on the client, a read (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) whose where spreads no `tenantWhere(`, an update or a delete whose where spreads no `ownTenantWhere(`, a create whose data spreads no `tenantScopeOf(` (inline or in a local the arguments name), `findUnique(`, `upsert(`, a raw query (`$queryRaw`, `$executeRaw`), or the client held in a variable; on TypeORM the same on the manager (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, the row handed to `insertIgnoringConflict(`, a query builder whose where carries no condition, `save(`, `upsert(`, `query(`); on the four, a read model store built without its `tenant` option, and a tenant condition that is no conjunct of its statement: on Knex `.orWhere*` or `.or` at the top of a statement of `tenantTable`, `ownTenantTable` or `whereTenant`, `clearWhere()` or `clear('where')` on it, on Drizzle the condition under `or`, `not` or a `sql` template, on Prisma the spread under `OR`, `NOT` or a relation, on TypeORM the same, a where array with an entry that does not spread it, an `orWhere` at the top of a query builder, a `where` after the one that carries the condition. A where built by another function is not followed |
2338
2338
  | `standard/no-parallel-interface` | a class, interface or type alias declared as `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (outside `presentation/` and the platform), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` followed by a standard name (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) or a name of `standardInterfaces`; a class that implements or extends the standard interface is an adapter and is not reported |
2339
2339
  | `events/outbox-required` | `stack.events` other than `outbox` with an ORM and no `stack.events` deviation; in `domain/` and `application/`, the import of a broker client or of a bus or relay implementation; a publisher depending on more than `IntegrationEventPublisher`; a platform module that hands out a publisher and never names `OutboxPublisher` |
2340
2340
  | `events/consumer-idempotent` | an integration event handler class (`application/integration/handlers/*.integration-handler.ts`) that neither carries `@IntegrationEventHandler` nor is registered in its module file under a consumer name; an `@IntegrationEventHandler` whose `consumer` is not a non-empty string literal; a free `on(` or `consume(` without `processed`; a consumer name used twice, in declarations and registrations alike |
@@ -1,7 +1,6 @@
1
- import type { AliasRoot, BuildLayout } from '../alias/index.js';
1
+ import type { BuildLayout } from '../alias/index.js';
2
2
  /** Where the compiler wrote, and what it wrote there. */
3
3
  export interface EmittedPlace {
4
- readonly roots: readonly AliasRoot[];
5
4
  readonly layout: BuildLayout;
6
5
  /** What an alias specifier ends with in the sources: `.js`, or nothing. */
7
6
  readonly suffix: string;
@@ -1 +1 @@
1
- {"version":3,"file":"emitted-place.d.ts","sourceRoot":"","sources":["../../src/build/emitted-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvD,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C"}
1
+ {"version":3,"file":"emitted-place.d.ts","sourceRoot":"","sources":["../../src/build/emitted-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C"}
@@ -1,4 +1,10 @@
1
+ import type { AliasRoot } from '../alias/index.js';
1
2
  import type { EmittedPlace } from './emitted-place.js';
3
+ /** An alias specifier, with the root whose prefix it starts with. */
4
+ export interface AliasedSpecifier {
5
+ readonly root: AliasRoot;
6
+ readonly specifier: string;
7
+ }
2
8
  /**
3
9
  * The relative specifier that names, from an emitted file, the emitted file an alias specifier
4
10
  * stands for, always with its `.js` extension: Node resolves no other spelling. A directory is
@@ -6,5 +12,5 @@ import type { EmittedPlace } from './emitted-place.js';
6
12
  * file, or when the specifier is not written as the project writes its imports. Both files are
7
13
  * given from the project root.
8
14
  */
9
- export declare function emittedSpecifier(place: EmittedPlace, file: string, specifier: string): string | undefined;
15
+ export declare function emittedSpecifier(place: EmittedPlace, file: string, { root, specifier }: AliasedSpecifier): string | undefined;
10
16
  //# sourceMappingURL=emitted-specifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emitted-specifier.d.ts","sourceRoot":"","sources":["../../src/build/emitted-specifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYzG"}
1
+ {"version":3,"file":"emitted-specifier.d.ts","sourceRoot":"","sources":["../../src/build/emitted-specifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,MAAM,EACZ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,gBAAgB,GACpC,MAAM,GAAG,SAAS,CAYpB"}
@@ -8,8 +8,8 @@ const DECLARATION = /\.d\.[cm]?ts$/;
8
8
  * file, or when the specifier is not written as the project writes its imports. Both files are
9
9
  * given from the project root.
10
10
  */
11
- export function emittedSpecifier(place, file, specifier) {
12
- const target = candidates(place, specifier).find((candidate) => place.isFile(candidate) || declared(place, file, candidate));
11
+ export function emittedSpecifier(place, file, { root, specifier }) {
12
+ const target = candidates(place, root, specifier).find((candidate) => place.isFile(candidate) || declared(place, file, candidate));
13
13
  if (target === undefined) {
14
14
  return undefined;
15
15
  }
@@ -20,10 +20,9 @@ export function emittedSpecifier(place, file, specifier) {
20
20
  * The files a specifier can stand for: the file of that name, then, in a project that writes no
21
21
  * extension, the `index` of the directory of that name, as the compiler resolves it.
22
22
  */
23
- function candidates(place, specifier) {
24
- const own = emittedTarget(place, specifier);
25
- const inside = place.suffix === '' ? emittedTarget(place, `${specifier.replace(/\/$/, '')}/index`) : undefined;
26
- return [own, inside].filter((candidate) => candidate !== undefined);
23
+ function candidates(place, root, specifier) {
24
+ const own = emittedTarget(place, root, specifier);
25
+ return place.suffix === '' ? [own, emittedTarget(place, root, `${specifier.replace(/\/$/, '')}/index`)] : [own];
27
26
  }
28
27
  /** A declaration file may name a module only its declaration was emitted for. */
29
28
  function declared(place, file, candidate) {
@@ -1 +1 @@
1
- {"version":3,"file":"emitted-specifier.js","sourceRoot":"","sources":["../../src/build/emitted-specifier.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAmB,EAAE,IAAY,EAAE,SAAiB;IACnF,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,IAAI,CAC9C,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAC3E,CAAC;IAEF,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CA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itted-place.js';
2
3
  /**
3
- * The emitted file an alias specifier names, from the project root, whether or not it exists;
4
- * nothing when the specifier starts with no alias. One spelling names it: the path of the file
5
- * with the ending the project writes; a specifier written the other way is never guessed. The
6
- * `index` of a directory is the business of the caller.
4
+ * The emitted file an alias specifier of `root` names, from the project root, whether or not it
5
+ * exists. One spelling names it: the path of the file with the ending the project writes; a
6
+ * specifier written the other way is never guessed. The `index` of a directory is the business of
7
+ * the caller.
7
8
  */
8
- export declare function emittedTarget(place: EmittedPlace, specifier: string): string | undefined;
9
+ export declare function emittedTarget(place: EmittedPlace, root: AliasRoot, specifier: string): string;
9
10
  //# sourceMappingURL=emitted-target.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emitted-target.d.ts","sourceRoot":"","sources":["../../src/build/emitted-target.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYxF"}
1
+ {"version":3,"file":"emitted-target.d.ts","sourceRoot":"","sources":["../../src/build/emitted-target.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAM7F"}
@@ -1,15 +1,11 @@
1
1
  import path from 'node:path';
2
2
  /**
3
- * The emitted file an alias specifier names, from the project root, whether or not it exists;
4
- * nothing when the specifier starts with no alias. One spelling names it: the path of the file
5
- * with the ending the project writes; a specifier written the other way is never guessed. The
6
- * `index` of a directory is the business of the caller.
3
+ * The emitted file an alias specifier of `root` names, from the project root, whether or not it
4
+ * exists. One spelling names it: the path of the file with the ending the project writes; a
5
+ * specifier written the other way is never guessed. The `index` of a directory is the business of
6
+ * the caller.
7
7
  */
8
- export function emittedTarget(place, specifier) {
9
- const root = place.roots.find(({ prefix }) => specifier.startsWith(prefix));
10
- if (root === undefined) {
11
- return undefined;
12
- }
8
+ export function emittedTarget(place, root, specifier) {
13
9
  const { rootDir, outDir } = place.layout;
14
10
  const directory = path.posix.join(outDir, path.posix.relative(rootDir, root.directory));
15
11
  const named = path.posix.join(directory, specifier.slice(root.prefix.length));
@@ -1 +1 @@
1
- {"version":3,"file":"emitted-target.js","sourceRoot":"","sources":["../../src/build/emitted-target.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,SAAiB;IAClE,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5E,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IACzC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACxF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9E,OAAO,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACrD,CAAC"}
1
+ {"version":3,"file":"emitted-target.js","sourceRoot":"","sources":["../../src/build/emitted-target.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB,EAAE,IAAe,EAAE,SAAiB;IACnF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IACzC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACxF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9E,OAAO,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACrD,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,CAgC9F"}
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,CAiC9F"}
@@ -18,14 +18,13 @@ export function rewriteAliases({ root, roots, suffix, project }) {
18
18
  if (layout === undefined || !isDirectory(path.join(root, layout.outDir))) {
19
19
  throw noOutput(project);
20
20
  }
21
- const place = { roots, layout, suffix, isFile: (file) => isFile(path.join(root, file)) };
21
+ const place = { layout, suffix, isFile: (file) => isFile(path.join(root, file)) };
22
22
  const files = emittedUnder(root, layout.outDir);
23
- const prefixes = roots.map(({ prefix }) => prefix);
24
- const problemOf = (specifier) => unresolvedProblem(place, specifier);
23
+ const problemOf = (specifier, alias) => unresolvedProblem(place, alias, specifier);
25
24
  const rewritten = files.map((file) => {
26
25
  const source = fs.readFileSync(path.join(root, file), 'utf8');
27
- const relativeOf = (specifier) => emittedSpecifier(place, file, specifier);
28
- return { file, source, ...rewriteSpecifiers(source, { prefixes, relativeOf, problemOf }) };
26
+ const relativeOf = (specifier, alias) => emittedSpecifier(place, file, { root: alias, specifier });
27
+ return { file, source, ...rewriteSpecifiers(source, { roots, relativeOf, problemOf }) };
29
28
  });
30
29
  refuse(rewritten.flatMap(({ file, problems }) => problems.map((problem) => `${file}, ${problem}`)));
31
30
  const changed = rewritten.filter(({ source, text }) => text !== source);
@@ -1 +1 @@
1
- {"version":3,"file":"rewrite-aliases.js","sourceRoot":"","sources":["../../src/build/rewrite-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAC5C,MAAM,KAAK,GAAG,EAAE,CAAC;AAWjB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAkB;IAC7E,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAEhD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACzE,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,KAAK,GAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CA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a,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,16 +1,17 @@
1
+ import type { AliasRoot } from '../alias/index.js';
1
2
  import type { Rewritten } from './rewritten.js';
2
3
  export interface Rewrite {
3
- /** What an alias specifier starts with. */
4
- readonly prefixes: readonly string[];
5
- /** The relative specifier an alias specifier becomes, or nothing when it names no emitted file. */
6
- readonly relativeOf: (specifier: string) => string | undefined;
4
+ /** The roots of the aliases: a specifier is an alias when it starts with the prefix of one. */
5
+ readonly roots: readonly AliasRoot[];
6
+ /** The relative specifier an alias specifier of `root` becomes, or nothing when it names no emitted file. */
7
+ readonly relativeOf: (specifier: string, root: AliasRoot) => string | undefined;
7
8
  /** Why a specifier has no relative form, when more is known than that it names no emitted file. */
8
- readonly problemOf?: (specifier: string) => string;
9
+ readonly problemOf?: (specifier: string, root: AliasRoot) => string;
9
10
  }
10
11
  /**
11
12
  * Turns every alias specifier of an emitted file into the relative one. Only string literals in
12
13
  * a module specifier position are touched; a line never gains or loses a line break, so the
13
14
  * source map of the file keeps naming the right lines. A file without an alias comes back as is.
14
15
  */
15
- export declare function rewriteSpecifiers(source: string, { prefixes, relativeOf, problemOf }: Rewrite): Rewritten;
16
+ export declare function rewriteSpecifiers(source: string, { roots, relativeOf, problemOf }: Rewrite): Rewritten;
16
17
  //# sourceMappingURL=rewrite-specifiers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rewrite-specifiers.d.ts","sourceRoot":"","sources":["../../src/build/rewrite-specifiers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,WAAW,OAAO;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,mGAAmG;IACnG,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,mGAAmG;IACnG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AAQD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAmB,EAAE,EAAE,OAAO,GAAG,SAAS,CAwBnH"}
1
+ {"version":3,"file":"rewrite-specifiers.d.ts","sourceRoot":"","sources":["../../src/build/rewrite-specifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,WAAW,OAAO;IACtB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,6GAA6G;IAC7G,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;IAChF,mGAAmG;IACnG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;CACrE;AAQD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,SAAmB,EAAE,EAAE,OAAO,GAAG,SAAS,CA2BhH"}
@@ -6,17 +6,19 @@ import { specifierLiterals } from './specifier-literals.js';
6
6
  * a module specifier position are touched; a line never gains or loses a line break, so the
7
7
  * source map of the file keeps naming the right lines. A file without an alias comes back as is.
8
8
  */
9
- export function rewriteSpecifiers(source, { prefixes, relativeOf, problemOf = unknown }) {
9
+ export function rewriteSpecifiers(source, { roots, relativeOf, problemOf = unknown }) {
10
10
  const scanned = scan(source);
11
11
  const edits = [];
12
+ const prefixes = roots.map(({ prefix }) => prefix);
12
13
  const problems = computedImports(source, scanned, prefixes).map((line) => `line ${line}: a dynamic import is given a template that starts with an alias and is completed at run time`);
13
14
  for (const { literal, whole } of specifierLiterals(scanned)) {
14
- if (!prefixes.some((prefix) => literal.value.startsWith(prefix))) {
15
+ const root = roots.find(({ prefix }) => literal.value.startsWith(prefix));
16
+ if (root === undefined) {
15
17
  continue;
16
18
  }
17
- const relative = whole ? relativeOf(literal.value) : undefined;
19
+ const relative = whole ? relativeOf(literal.value, root) : undefined;
18
20
  if (relative === undefined) {
19
- problems.push(`line ${literal.line}: ${whole ? problemOf(literal.value) : computed(literal.value)}`);
21
+ problems.push(`line ${literal.line}: ${whole ? problemOf(literal.value, root) : computed(literal.value)}`);
20
22
  }
21
23
  else {
22
24
  edits.push({ start: literal.start + 1, end: literal.end - 1, text: relative });
@@ -1 +1 @@
1
- {"version":3,"file":"rewrite-specifiers.js","sourceRoot":"","sources":["../../src/build/rewrite-specifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAA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AAS,mCAAmC,CAAC;AAEhG,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAU,EAAE,CAC7C,iCAAiC,SAAS,gCAAgC,CAAC;AAE7E,SAAS,OAAO,CAAC,MAAc,EAAE,KAAsB;IACrD,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AACjH,CAAC"}
@@ -1,4 +1,5 @@
1
+ import type { AliasRoot } from '../alias/index.js';
1
2
  import type { EmittedPlace } from './emitted-place.js';
2
3
  /** Why an alias specifier names no emitted file, in the words of what to write instead. */
3
- export declare function unresolvedProblem(place: EmittedPlace, specifier: string): string;
4
+ export declare function unresolvedProblem(place: EmittedPlace, root: AliasRoot, specifier: string): string;
4
5
  //# sourceMappingURL=unresolved-problem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unresolved-problem.d.ts","sourceRoot":"","sources":["../../src/build/unresolved-problem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAchF"}
1
+ {"version":3,"file":"unresolved-problem.d.ts","sourceRoot":"","sources":["../../src/build/unresolved-problem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAcjG"}
@@ -1,9 +1,9 @@
1
1
  import { emittedTarget } from './emitted-target.js';
2
2
  const EXTENSION = /\.(?:[cm]?js|[cm]?ts)$/;
3
3
  /** Why an alias specifier names no emitted file, in the words of what to write instead. */
4
- export function unresolvedProblem(place, specifier) {
4
+ export function unresolvedProblem(place, root, specifier) {
5
5
  const bare = specifier.replace(EXTENSION, '');
6
- const stem = (emittedTarget({ ...place, suffix: '' }, bare) ?? '').replace(/\.js$/, '');
6
+ const stem = emittedTarget({ ...place, suffix: '' }, root, bare).replace(/\.js$/, '');
7
7
  const written = bare === specifier ? 'no extension' : 'an extension';
8
8
  if (place.suffix !== '' && place.isFile(`${stem}/index.js`)) {
9
9
  return `"${specifier}" names a directory: an alias names one file, write "${bare}/index${place.suffix}"`;
@@ -1 +1 @@
1
- {"version":3,"file":"unresolved-problem.js","sourceRoot":"","sources":["../../src/build/unresolved-problem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,SAAS,GAAG,wBAAwB,CAAC;AAE3C,2FAA2F;AAC3F,MAAM,UAAU,iBAAiB,CAAC,KAAmB,EAAE,SAAiB;IACtE,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,CAAC,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxF,MAAM,OAAO,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;IAErE,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,SAAS,wDA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G,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,EAAE,CAAC;QACjF,OAAO,IAAI,SAAS,SAAS,OAAO,mCAAmC,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,GAAG,KAAK,CAAC,MAAM,2BAA2B,CAAC;IACxK,CAAC;IAED,OAAO,IAAI,SAAS,mCAAmC,CAAC;AAC1D,CAAC"}
@@ -69,10 +69,8 @@ function arrowParameters(code, arrow) {
69
69
  }
70
70
  return code.charAt(previousCode(code, start - 1)) === '.' ? [] : [{ single: start }];
71
71
  }
72
+ /** The list whose `)` is at `close`, which both callers have checked is one. */
72
73
  function listClosingAt(code, close) {
73
- if (code.charAt(close) !== ')') {
74
- return [];
75
- }
76
74
  const open = openingBracket(code, close);
77
75
  return open === -1 ? [] : [{ open, close }];
78
76
  }