ddd-ts-kit 0.84.0 → 0.85.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 (222) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.fr.md +60 -27
  3. package/README.md +57 -28
  4. package/dist/check/canonical/stray-entry.js +3 -2
  5. package/dist/check/canonical/stray-entry.js.map +1 -1
  6. package/dist/check/explain/layout-docs.js +1 -1
  7. package/dist/check/explain/layout-docs.js.map +1 -1
  8. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  9. package/dist/check/explain/tree-docs.js +3 -2
  10. package/dist/check/explain/tree-docs.js.map +1 -1
  11. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  12. package/dist/check/explain/wiring-docs.js +17 -6
  13. package/dist/check/explain/wiring-docs.js.map +1 -1
  14. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  15. package/dist/check/fixtures/authz-policy-fixtures.js +4 -4
  16. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  17. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -1
  18. package/dist/check/fixtures/constructor-injection-fixtures.js +10 -8
  19. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
  20. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  21. package/dist/check/fixtures/declarations-fixtures.js +54 -9
  22. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  23. package/dist/check/fixtures/declared-declarations.d.ts +7 -0
  24. package/dist/check/fixtures/declared-declarations.d.ts.map +1 -0
  25. package/dist/check/fixtures/declared-declarations.js +21 -0
  26. package/dist/check/fixtures/declared-declarations.js.map +1 -0
  27. package/dist/check/fixtures/declared-project.d.ts +4 -1
  28. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  29. package/dist/check/fixtures/declared-project.js +17 -9
  30. package/dist/check/fixtures/declared-project.js.map +1 -1
  31. package/dist/check/fixtures/paths.d.ts +1 -0
  32. package/dist/check/fixtures/paths.d.ts.map +1 -1
  33. package/dist/check/fixtures/paths.js +1 -0
  34. package/dist/check/fixtures/paths.js.map +1 -1
  35. package/dist/check/fixtures/signature-project.d.ts +3 -3
  36. package/dist/check/fixtures/signature-project.js +3 -3
  37. package/dist/check/fixtures/signature.d.ts +2 -1
  38. package/dist/check/fixtures/signature.d.ts.map +1 -1
  39. package/dist/check/fixtures/signature.js +2 -1
  40. package/dist/check/fixtures/signature.js.map +1 -1
  41. package/dist/check/fixtures/single-file-declarations.d.ts +7 -0
  42. package/dist/check/fixtures/single-file-declarations.d.ts.map +1 -0
  43. package/dist/check/fixtures/single-file-declarations.js +21 -0
  44. package/dist/check/fixtures/single-file-declarations.js.map +1 -0
  45. package/dist/check/rules/clean-file-size.d.ts.map +1 -1
  46. package/dist/check/rules/clean-file-size.js +9 -1
  47. package/dist/check/rules/clean-file-size.js.map +1 -1
  48. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  49. package/dist/check/rules/declarations-barrel-current.js +56 -23
  50. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  51. package/dist/check/rules/naming-suffix.d.ts.map +1 -1
  52. package/dist/check/rules/naming-suffix.js +7 -3
  53. package/dist/check/rules/naming-suffix.js.map +1 -1
  54. package/dist/check/support/is-generated-context-file.d.ts +5 -1
  55. package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
  56. package/dist/check/support/is-generated-context-file.js +11 -5
  57. package/dist/check/support/is-generated-context-file.js.map +1 -1
  58. package/dist/commands/docs.d.ts.map +1 -1
  59. package/dist/commands/docs.js +23 -11
  60. package/dist/commands/docs.js.map +1 -1
  61. package/dist/commands/generate.d.ts.map +1 -1
  62. package/dist/commands/generate.js +7 -4
  63. package/dist/commands/generate.js.map +1 -1
  64. package/dist/commands/print-report.js +1 -0
  65. package/dist/commands/print-report.js.map +1 -1
  66. package/dist/commit/is-derived.js +4 -4
  67. package/dist/commit/is-derived.js.map +1 -1
  68. package/dist/declared/barrel-file.d.ts +4 -1
  69. package/dist/declared/barrel-file.d.ts.map +1 -1
  70. package/dist/declared/barrel-file.js +4 -1
  71. package/dist/declared/barrel-file.js.map +1 -1
  72. package/dist/declared/context-declarations.d.ts +24 -0
  73. package/dist/declared/context-declarations.d.ts.map +1 -0
  74. package/dist/declared/context-declarations.js +22 -0
  75. package/dist/declared/context-declarations.js.map +1 -0
  76. package/dist/declared/declarations-folder-of.d.ts +10 -0
  77. package/dist/declared/declarations-folder-of.d.ts.map +1 -0
  78. package/dist/declared/declarations-folder-of.js +13 -0
  79. package/dist/declared/declarations-folder-of.js.map +1 -0
  80. package/dist/declared/folder-declarations-file.d.ts +7 -0
  81. package/dist/declared/folder-declarations-file.d.ts.map +1 -0
  82. package/dist/declared/folder-declarations-file.js +10 -0
  83. package/dist/declared/folder-declarations-file.js.map +1 -0
  84. package/dist/declared/index.d.ts +8 -1
  85. package/dist/declared/index.d.ts.map +1 -1
  86. package/dist/declared/index.js +8 -1
  87. package/dist/declared/index.js.map +1 -1
  88. package/dist/declared/is-declarations-file.d.ts +7 -0
  89. package/dist/declared/is-declarations-file.d.ts.map +1 -0
  90. package/dist/declared/is-declarations-file.js +20 -0
  91. package/dist/declared/is-declarations-file.js.map +1 -0
  92. package/dist/declared/keeps-single-file.d.ts +11 -0
  93. package/dist/declared/keeps-single-file.d.ts.map +1 -0
  94. package/dist/declared/keeps-single-file.js +23 -0
  95. package/dist/declared/keeps-single-file.js.map +1 -0
  96. package/dist/declared/render-declarations.d.ts +18 -0
  97. package/dist/declared/render-declarations.d.ts.map +1 -0
  98. package/dist/declared/render-declarations.js +37 -0
  99. package/dist/declared/render-declarations.js.map +1 -0
  100. package/dist/declared/render-folder-declarations.d.ts +11 -0
  101. package/dist/declared/render-folder-declarations.d.ts.map +1 -0
  102. package/dist/declared/render-folder-declarations.js +23 -0
  103. package/dist/declared/render-folder-declarations.js.map +1 -0
  104. package/dist/declared/single-file-declarations.d.ts +9 -0
  105. package/dist/declared/single-file-declarations.d.ts.map +1 -0
  106. package/dist/declared/single-file-declarations.js +14 -0
  107. package/dist/declared/single-file-declarations.js.map +1 -0
  108. package/dist/declared/single-file-notice.d.ts +8 -0
  109. package/dist/declared/single-file-notice.d.ts.map +1 -0
  110. package/dist/declared/single-file-notice.js +9 -0
  111. package/dist/declared/single-file-notice.js.map +1 -0
  112. package/dist/derived/is-derived.d.ts +4 -3
  113. package/dist/derived/is-derived.d.ts.map +1 -1
  114. package/dist/derived/is-derived.js +8 -8
  115. package/dist/derived/is-derived.js.map +1 -1
  116. package/dist/describe/read-consumed-events.js +7 -2
  117. package/dist/describe/read-consumed-events.js.map +1 -1
  118. package/dist/dev/refresh-declarations.d.ts.map +1 -1
  119. package/dist/dev/refresh-declarations.js +3 -2
  120. package/dist/dev/refresh-declarations.js.map +1 -1
  121. package/dist/docs/write-docs.d.ts +3 -1
  122. package/dist/docs/write-docs.d.ts.map +1 -1
  123. package/dist/docs/write-docs.js +4 -2
  124. package/dist/docs/write-docs.js.map +1 -1
  125. package/dist/generate/context-imports.d.ts.map +1 -1
  126. package/dist/generate/context-imports.js +2 -1
  127. package/dist/generate/context-imports.js.map +1 -1
  128. package/dist/generate/kind.d.ts +2 -0
  129. package/dist/generate/kind.d.ts.map +1 -1
  130. package/dist/generate/kinds/e2e/reaction-of.d.ts +14 -0
  131. package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -0
  132. package/dist/generate/kinds/e2e/reaction-of.js +93 -0
  133. package/dist/generate/kinds/e2e/reaction-of.js.map +1 -0
  134. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  135. package/dist/generate/kinds/e2e-kind.js +30 -18
  136. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  137. package/dist/generate/refresh-barrels.d.ts +11 -4
  138. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  139. package/dist/generate/refresh-barrels.js +41 -15
  140. package/dist/generate/refresh-barrels.js.map +1 -1
  141. package/dist/generate/refuse-shared-writes.js +1 -1
  142. package/dist/generate/refuse-shared-writes.js.map +1 -1
  143. package/dist/help/notes.d.ts +1 -1
  144. package/dist/help/notes.d.ts.map +1 -1
  145. package/dist/help/notes.js +19 -16
  146. package/dist/help/notes.js.map +1 -1
  147. package/dist/init/manifest/versions.js +24 -24
  148. package/dist/merge/classify-conflict.d.ts +2 -1
  149. package/dist/merge/classify-conflict.d.ts.map +1 -1
  150. package/dist/merge/classify-conflict.js +9 -0
  151. package/dist/merge/classify-conflict.js.map +1 -1
  152. package/dist/merge/higher-version.d.ts +7 -0
  153. package/dist/merge/higher-version.d.ts.map +1 -0
  154. package/dist/merge/higher-version.js +59 -0
  155. package/dist/merge/higher-version.js.map +1 -0
  156. package/dist/merge/merge-client-manifest.d.ts +16 -0
  157. package/dist/merge/merge-client-manifest.d.ts.map +1 -0
  158. package/dist/merge/merge-client-manifest.js +39 -0
  159. package/dist/merge/merge-client-manifest.js.map +1 -0
  160. package/dist/merge/merge-exclusions.d.ts +4 -3
  161. package/dist/merge/merge-exclusions.d.ts.map +1 -1
  162. package/dist/merge/merge-exclusions.js +6 -3
  163. package/dist/merge/merge-exclusions.js.map +1 -1
  164. package/dist/merge/resolve-conflict.d.ts +3 -2
  165. package/dist/merge/resolve-conflict.d.ts.map +1 -1
  166. package/dist/merge/resolve-conflict.js +29 -7
  167. package/dist/merge/resolve-conflict.js.map +1 -1
  168. package/dist/plan/batched-waves.d.ts +2 -0
  169. package/dist/plan/batched-waves.d.ts.map +1 -1
  170. package/dist/plan/batched-waves.js +20 -7
  171. package/dist/plan/batched-waves.js.map +1 -1
  172. package/dist/plan/format-plan.d.ts +1 -1
  173. package/dist/plan/format-plan.d.ts.map +1 -1
  174. package/dist/plan/format-plan.js +33 -8
  175. package/dist/plan/format-plan.js.map +1 -1
  176. package/dist/plan/other-stories.d.ts +9 -0
  177. package/dist/plan/other-stories.d.ts.map +1 -0
  178. package/dist/plan/other-stories.js +31 -0
  179. package/dist/plan/other-stories.js.map +1 -0
  180. package/dist/plan/plan-waves.d.ts +2 -1
  181. package/dist/plan/plan-waves.d.ts.map +1 -1
  182. package/dist/plan/plan-waves.js +13 -4
  183. package/dist/plan/plan-waves.js.map +1 -1
  184. package/dist/plan/wave-plan.d.ts +28 -0
  185. package/dist/plan/wave-plan.d.ts.map +1 -1
  186. package/dist/version.d.ts +1 -1
  187. package/dist/version.js +1 -1
  188. package/dist/worker/briefing-of.js +4 -2
  189. package/dist/worker/briefing-of.js.map +1 -1
  190. package/dist/workspace/workspace-report.d.ts +2 -0
  191. package/dist/workspace/workspace-report.d.ts.map +1 -1
  192. package/dist/workspace/workspace.d.ts +8 -0
  193. package/dist/workspace/workspace.d.ts.map +1 -1
  194. package/dist/workspace/workspace.js +24 -3
  195. package/dist/workspace/workspace.js.map +1 -1
  196. package/package.json +2 -2
  197. package/templates/e2e/e2e-reaction.spec.ts.tpl +68 -0
  198. package/templates/init/AGENTS.md.tpl +1 -1
  199. package/templates/init/README.md.tpl +2 -1
  200. package/templates/init/e2e/start-application.database.ts.tpl +22 -2
  201. package/templates/init/e2e/start-application.memory.ts.tpl +22 -2
  202. package/templates/init/platform/events/custom-event-bus.ts.tpl +1 -1
  203. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  204. package/templates/init/rules/tests.md.tpl +1 -1
  205. package/templates/pipeline/biome.json.tpl +1 -0
  206. package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -0
  207. package/templates/pipeline/github/workflows/ci.yml.tpl +12 -12
  208. package/templates/pipeline/github/workflows/codeql.yml +1 -1
  209. package/templates/pipeline/github/workflows/copilot-setup-steps.yml +1 -1
  210. package/templates/pipeline/github/workflows/pr-title.yml +1 -1
  211. package/templates/pipeline/package-scripts.json +1 -1
  212. package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -0
  213. package/templates/test-world/world.buses.ts.tpl +1 -1
  214. package/templates/test-world/world.tsyringe.ts.tpl +1 -0
  215. package/dist/check/fixtures/declared-barrel.d.ts +0 -3
  216. package/dist/check/fixtures/declared-barrel.d.ts.map +0 -1
  217. package/dist/check/fixtures/declared-barrel.js +0 -4
  218. package/dist/check/fixtures/declared-barrel.js.map +0 -1
  219. package/dist/declared/render-barrel.d.ts +0 -11
  220. package/dist/declared/render-barrel.d.ts.map +0 -1
  221. package/dist/declared/render-barrel.js +0 -29
  222. package/dist/declared/render-barrel.js.map +0 -1
@@ -2,10 +2,15 @@
2
2
  import type { RelationTuple } from '@ddd-ts-kit/auth/rebac';
3
3
  {{/if}}
4
4
  {{#if httpCache.varnish}}
5
- import { InMemoryCachePurger, PurgingPublisher, type IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
5
+ import {
6
+ InMemoryCachePurger,
7
+ PurgingPublisher,
8
+ type IntegrationEvent,
9
+ type IntegrationEventSubscriber,
10
+ } from '@ddd-ts-kit/kernel';
6
11
  {{/if}}
7
12
  {{#unless httpCache.varnish}}
8
- import type { IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
13
+ import type { IntegrationEvent, IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
9
14
  {{/unless}}
10
15
  import { createHttpClient, settled, type HttpClient, type SettledOptions } from '@ddd-ts-kit/testing/e2e';
11
16
  {{#if authz.rebac}}
@@ -58,6 +63,17 @@ export interface RunningApplication {
58
63
  /** A client presenting the credential of `actor`; `client` itself presents none. */
59
64
  as(actor: TestActor): Promise<HttpClient>;
60
65
 
66
+ /**
67
+ * Publishes integration events of an upstream as its relay would, to the handlers of the
68
+ * application: what starts a use case no route reaches. Await `settled()` next, before asserting
69
+ * what the handlers did.
70
+ {{#if broker.provided}}
71
+ * With a broker server (its URL in the environment), the events go to the broker: what its
72
+ * consumers do is awaited with `collectEvents(application.events, [...]).waitFor(...)`.
73
+ {{/if}}
74
+ */
75
+ publish(events: readonly IntegrationEvent[]): Promise<void>;
76
+
61
77
  /**
62
78
  {{#if events.outbox}}
63
79
  * Resolves once the work the requests so far started has settled: every event stored in the
@@ -107,6 +123,7 @@ export async function startApplication(): Promise<RunningApplication> {
107
123
  purges: started.purges,
108
124
  {{/if}}
109
125
  as: async (actor) => started.client.withHeaders(await credentials.headersOf(actor)),
126
+ publish: (events) => started.publish(events),
110
127
  {{#if authz.rebac}}
111
128
  relate: (tuple) => relationTuples.write([tuple]),
112
129
  {{/if}}
@@ -123,6 +140,8 @@ interface Started {
123
140
  readonly purges: InMemoryCachePurger;
124
141
  {{/if}}
125
142
 
143
+ publish(events: readonly IntegrationEvent[]): Promise<void>;
144
+
126
145
  settled(options?: SettledOptions): Promise<void>;
127
146
 
128
147
  close(): Promise<void>;
@@ -171,6 +190,7 @@ async function start(database: TestDatabase, config: AppConfig, credentials: Cre
171
190
  {{#if httpCache.varnish}}
172
191
  purges,
173
192
  {{/if}}
193
+ publish: (events) => application.eventBus.publish(events),
174
194
  {{#if events.outbox}}
175
195
  settled: (options) => settled({ outbox: () => database.persistence.outbox.stats() }, options),
176
196
  {{/if}}
@@ -2,10 +2,15 @@
2
2
  import type { RelationTuple } from '@ddd-ts-kit/auth/rebac';
3
3
  {{/if}}
4
4
  {{#if httpCache.varnish}}
5
- import { InMemoryCachePurger, PurgingPublisher, type IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
5
+ import {
6
+ InMemoryCachePurger,
7
+ PurgingPublisher,
8
+ type IntegrationEvent,
9
+ type IntegrationEventSubscriber,
10
+ } from '@ddd-ts-kit/kernel';
6
11
  {{/if}}
7
12
  {{#unless httpCache.varnish}}
8
- import type { IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
13
+ import type { IntegrationEvent, IntegrationEventSubscriber } from '@ddd-ts-kit/kernel';
9
14
  {{/unless}}
10
15
  import { createHttpClient, settled, type HttpClient, type SettledOptions } from '@ddd-ts-kit/testing/e2e';
11
16
  {{#if authz.rebac}}
@@ -61,6 +66,17 @@ export interface RunningApplication {
61
66
  /** A client presenting the credential of `actor`; `client` itself presents none. */
62
67
  as(actor: TestActor): Promise<HttpClient>;
63
68
 
69
+ /**
70
+ * Publishes integration events of an upstream as its relay would, to the handlers of the
71
+ * application: what starts a use case no route reaches. Await `settled()` next, before asserting
72
+ * what the handlers did.
73
+ {{#if broker.provided}}
74
+ * With a broker server (its URL in the environment), the events go to the broker: what its
75
+ * consumers do is awaited with `collectEvents(application.events, [...]).waitFor(...)`.
76
+ {{/if}}
77
+ */
78
+ publish(events: readonly IntegrationEvent[]): Promise<void>;
79
+
64
80
  /**
65
81
  {{#if events.outbox}}
66
82
  * Resolves once the work the requests so far started has settled: every event stored in the
@@ -109,6 +125,7 @@ export async function startApplication(): Promise<RunningApplication> {
109
125
  },
110
126
  {{/if}}
111
127
  as: async (actor) => current.client.withHeaders(await credentials.headersOf(actor)),
128
+ publish: (events) => current.publish(events),
112
129
  {{#if authz.rebac}}
113
130
  relate: (tuple) => relationTuples.write([tuple]),
114
131
  {{/if}}
@@ -128,6 +145,8 @@ interface Started {
128
145
  readonly purges: InMemoryCachePurger;
129
146
  {{/if}}
130
147
 
148
+ publish(events: readonly IntegrationEvent[]): Promise<void>;
149
+
131
150
  settled(options?: SettledOptions): Promise<void>;
132
151
 
133
152
  close(): Promise<void>;
@@ -177,6 +196,7 @@ async function start(credentials: Credentials): Promise<Started> {
177
196
  {{#if httpCache.varnish}}
178
197
  purges,
179
198
  {{/if}}
199
+ publish: (events) => application.eventBus.publish(events),
180
200
  {{#if events.outbox}}
181
201
  settled: (options) => settled({ outbox: () => persistence.outbox.stats() }, options),
182
202
  {{/if}}
@@ -13,7 +13,7 @@ import {
13
13
  */
14
14
  // TODO(platform): publish with a confirmation of the broker (resolve only once it took every event, reject otherwise) and consume from one durable queue per consumer, acknowledging after the handler succeeded.
15
15
  export class CustomEventBus implements EventBus {
16
- private readonly delivery = new InMemoryEventBus();
16
+ private readonly delivery = new InMemoryEventBus({ failures: 'as-thrown' });
17
17
 
18
18
  publish(events: readonly IntegrationEvent[]): Promise<void> {
19
19
  return this.delivery.publish(events);
@@ -8,7 +8,7 @@ import type { EventProvider } from '{{alias.platform}}/events/event-provider{{al
8
8
  /** For the tools and the tests that run without a broker: the same ports, in the process. */
9
9
  {{/unless}}
10
10
  export function inProcessEvents(): EventProvider {
11
- const bus = new InMemoryEventBus();
11
+ const bus = new InMemoryEventBus({ failures: 'as-thrown' });
12
12
 
13
13
  return { bus, forConsumer: () => bus, start: () => Promise.resolve(), close: () => Promise.resolve() };
14
14
  }
@@ -24,5 +24,5 @@ paths:
24
24
  - Coverage is a floor per context and layer, read from `coverage` in `ddd-ts-kit.config.json` and held by `npm run verify` (`npm run test:coverage`): a layer under its threshold gets the test that is missing. No `exclude` in the runner config, no `v8 ignore` or `istanbul ignore` comment without `-- ADR-NNNN: <reason>` (`test/coverage-governed`); a rate proves that code ran, never that a test asserts anything.
25
25
  - An `it.todo` left by the generator names a behaviour still to prove: replace it by a real test, do not delete it. `npx ddd-ts-kit todo <context>` lists what remains.
26
26
  - A test never asserts on a private field; it observes results, recorded events and what the fakes received.
27
- - `test/e2e/` (project root) drives the whole application through HTTP with generated, seeded data, never reads the database, and asserts the trace of a request with `expectSpanTree(storyOf(trace), [...])`. What happens after the answer (the outbox relayed, the handlers it reaches) is asserted once `await application.settled()` has resolved, never after a fixed delay.
27
+ - `test/e2e/` (project root) drives the whole application through HTTP with generated, seeded data, never reads the database, and asserts the trace of a request with `expectSpanTree(storyOf(trace), [...])`. What happens after the answer (the outbox relayed, the handlers it reaches) is asserted once `await application.settled()` has resolved, never after a fixed delay. A spec past 350 lines is split by behaviour into `test/e2e/<use-case>-<behaviour>.e2e.spec.ts` beside it, and what the specs of one context share goes in `test/e2e/support/<context>/`.
28
28
  - Write tests with `/ddd-ts-kit:testing`; scaffold with `npx ddd-ts-kit generate builder|test-world|e2e`.
@@ -14,6 +14,7 @@
14
14
  "!**/coverage",
15
15
  "!**/reports",
16
16
  "!**/.worktrees",
17
+ "!**/.ddd-ts-kit",
17
18
  "!**/generated",
18
19
  "!**/package-lock.json",
19
20
  "!**/.dependency-cruiser.cjs",
@@ -12,6 +12,9 @@ runs:
12
12
  - uses: actions/setup-node@v7
13
13
  with:
14
14
  node-version: ${{ inputs.node-version }}
15
+ # The newest patch of the release line, not the one the image of the runner holds: a security
16
+ # release of Node reaches the next run.
17
+ check-latest: true
15
18
  {{#if pm.corepack}}
16
19
  - name: The package manager package.json pins
17
20
  shell: bash
@@ -19,7 +19,7 @@ permissions:
19
19
  jobs:
20
20
  install:
21
21
  name: Install
22
- runs-on: ubuntu-latest
22
+ runs-on: ubuntu-26.04
23
23
  timeout-minutes: 10
24
24
  outputs:
25
25
  scope: ${{ steps.affected.outputs.scope }}
@@ -41,7 +41,7 @@ jobs:
41
41
  typecheck:
42
42
  name: Typecheck
43
43
  needs: install
44
- runs-on: ubuntu-latest
44
+ runs-on: ubuntu-26.04
45
45
  timeout-minutes: 10
46
46
  steps:
47
47
  - uses: actions/checkout@v7
@@ -51,7 +51,7 @@ jobs:
51
51
  lint:
52
52
  name: Lint
53
53
  needs: install
54
- runs-on: ubuntu-latest
54
+ runs-on: ubuntu-26.04
55
55
  timeout-minutes: 10
56
56
  steps:
57
57
  - uses: actions/checkout@v7
@@ -65,7 +65,7 @@ jobs:
65
65
  architecture:
66
66
  name: Architecture
67
67
  needs: install
68
- runs-on: ubuntu-latest
68
+ runs-on: ubuntu-26.04
69
69
  timeout-minutes: 10
70
70
  steps:
71
71
  - uses: actions/checkout@v7
@@ -78,7 +78,7 @@ jobs:
78
78
  deadcode:
79
79
  name: Dead code
80
80
  needs: install
81
- runs-on: ubuntu-latest
81
+ runs-on: ubuntu-26.04
82
82
  timeout-minutes: 10
83
83
  steps:
84
84
  - uses: actions/checkout@v7
@@ -88,7 +88,7 @@ jobs:
88
88
  unit:
89
89
  name: Unit tests
90
90
  needs: install
91
- runs-on: ubuntu-latest
91
+ runs-on: ubuntu-26.04
92
92
  timeout-minutes: 15
93
93
  steps:
94
94
  - uses: actions/checkout@v7
@@ -110,7 +110,7 @@ jobs:
110
110
  integration:
111
111
  name: Integration tests
112
112
  needs: install
113
- runs-on: ubuntu-latest
113
+ runs-on: ubuntu-26.04
114
114
  timeout-minutes: 20
115
115
  env:
116
116
  DATABASE_URL: postgres://app:app@localhost:5432/app
@@ -132,7 +132,7 @@ jobs:
132
132
  e2e:
133
133
  name: End-to-end tests
134
134
  needs: install
135
- runs-on: ubuntu-latest
135
+ runs-on: ubuntu-26.04
136
136
  timeout-minutes: 20
137
137
  env:
138
138
  DATABASE_URL: postgres://app:app@localhost:5432/app
@@ -151,7 +151,7 @@ jobs:
151
151
  build:
152
152
  name: Build, docs and contract drift
153
153
  needs: install
154
- runs-on: ubuntu-latest
154
+ runs-on: ubuntu-26.04
155
155
  timeout-minutes: 10
156
156
  steps:
157
157
  - uses: actions/checkout@v7
@@ -164,7 +164,7 @@ jobs:
164
164
  security:
165
165
  name: Security
166
166
  needs: install
167
- runs-on: ubuntu-latest
167
+ runs-on: ubuntu-26.04
168
168
  timeout-minutes: 10
169
169
  steps:
170
170
  - uses: actions/checkout@v7
@@ -188,7 +188,7 @@ jobs:
188
188
  image:
189
189
  name: Docker image
190
190
  needs: install
191
- runs-on: ubuntu-latest
191
+ runs-on: ubuntu-26.04
192
192
  timeout-minutes: 20
193
193
  steps:
194
194
  - uses: actions/checkout@v7
@@ -205,7 +205,7 @@ jobs:
205
205
  name: gate
206
206
  if: ${{ always() }}
207
207
  needs: [install, typecheck, lint, architecture, deadcode, unit, integration, e2e, build, security, image]
208
- runs-on: ubuntu-latest
208
+ runs-on: ubuntu-26.04
209
209
  timeout-minutes: 5
210
210
  steps:
211
211
  - name: Every gate passed
@@ -17,7 +17,7 @@ permissions:
17
17
  jobs:
18
18
  analyze:
19
19
  name: Analyze
20
- runs-on: ubuntu-latest
20
+ runs-on: ubuntu-26.04
21
21
  timeout-minutes: 30
22
22
  permissions:
23
23
  contents: read
@@ -17,7 +17,7 @@ permissions:
17
17
 
18
18
  jobs:
19
19
  copilot-setup-steps:
20
- runs-on: ubuntu-latest
20
+ runs-on: ubuntu-26.04
21
21
  timeout-minutes: 15
22
22
  permissions:
23
23
  contents: read
@@ -14,7 +14,7 @@ permissions:
14
14
  jobs:
15
15
  conventional-title:
16
16
  name: Conventional title
17
- runs-on: ubuntu-latest
17
+ runs-on: ubuntu-26.04
18
18
  timeout-minutes: 5
19
19
  steps:
20
20
  - uses: actions/checkout@v7
@@ -23,7 +23,7 @@
23
23
  "@biomejs/biome": "2.5.15",
24
24
  "@commitlint/cli": "^21.2.3",
25
25
  "@commitlint/config-conventional": "^21.2.3",
26
- "@ddd-ts-kit/eslint-plugin": "^0.84.0",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.85.0",
27
27
  "@eslint/js": "^10.0.1",
28
28
  "@typescript/native": "npm:typescript@~7.0.2",
29
29
  "@vitest/coverage-v8": "5.0.3",
@@ -48,6 +48,7 @@ export function arrangeIdentity() {
48
48
  };
49
49
 
50
50
  const application = createTestApplication({
51
+ eventBusFailures: 'as-thrown',
51
52
  modules: [platformTestModule, contextModule('{{context.kebab}}', {{context.camel}}Declarations), people],
52
53
  fakes: [
53
54
  fake(AccountRepository, ports.accounts),
@@ -27,7 +27,7 @@ export async function {{world.article}}{{world.pascal}}World(settings: {{world.p
27
27
  await given?.(fakes);
28
28
 
29
29
  {{/if}}
30
- const buses = createTestBuses(settings);
30
+ const buses = createTestBuses({ ...settings, eventBusFailures: 'as-thrown' });
31
31
 
32
32
  {{world.returnedBuses}}
33
33
  }
@@ -38,6 +38,7 @@ export async function {{world.article}}{{world.pascal}}World({ modules = [nobody
38
38
  {{/if}}
39
39
  const application = createTestApplication({
40
40
  ...settings,
41
+ eventBusFailures: 'as-thrown',
41
42
  modules: [platformTestModule, {{world.contextModule}}, ...modules],
42
43
  {{#if world.hasFakes}}
43
44
  {{world.overrides}}
@@ -1,3 +0,0 @@
1
- /** The barrel of `DECLARED_CONTEXT`, written out so that the fixtures do not prove the rule with its own code. */
2
- export declare const DECLARED_BARREL: string;
3
- //# sourceMappingURL=declared-barrel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"declared-barrel.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/declared-barrel.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,eAAO,MAAM,eAAe,QAa3B,CAAC"}
@@ -1,4 +0,0 @@
1
- import { source } from './source.js';
2
- /** The barrel of `DECLARED_CONTEXT`, written out so that the fixtures do not prove the rule with its own code. */
3
- export const DECLARED_BARREL = source("export * from '@/contexts/billing/application/authorization/only-issuer-voids.policy.js';", "export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js';", "export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.js';", "export * from '@/contexts/billing/application/event-handlers/invoice-issued.event-handler.js';", "export * from '@/contexts/billing/application/integration/handlers/product-listed.integration-handler.js';", "export * from '@/contexts/billing/application/integration/publishers/invoice-issued.publisher.js';", "export * from '@/contexts/billing/application/queries/invoices-issued/invoices-issued.handler.js';", "export * from '@/contexts/billing/application/queries/invoices-issued/invoices-issued.query.js';", "export * from '@/contexts/billing/application/scheduling/send-reminders.job.js';", "export * from '@/contexts/billing/infrastructure/external/in-process-price-catalog.gateway.js';", "export * from '@/contexts/billing/infrastructure/external/remote-payment-gateway.adapter.js';", "export * from '@/contexts/billing/infrastructure/persistence/in-memory-invoice.repository.js';");
4
- //# sourceMappingURL=declared-barrel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"declared-barrel.js","sourceRoot":"","sources":["../../../src/check/fixtures/declared-barrel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,kHAAkH;AAClH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CACnC,2FAA2F,EAC3F,iGAAiG,EACjG,iGAAiG,EACjG,gGAAgG,EAChG,4GAA4G,EAC5G,oGAAoG,EACpG,oGAAoG,EACpG,kGAAkG,EAClG,kFAAkF,EAClF,iGAAiG,EACjG,+FAA+F,EAC/F,gGAAgG,CACjG,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { RenderedInjections } from './injection/rendered-injections.js';
2
- /**
3
- * The barrel of a context: one `export *` per role file, named by the specifier `specifierOf`
4
- * gives it (its alias, ending as the project writes its imports) and sorted by path; then,
5
- * when a constructor of the context takes something its decorator does not list, the imports
6
- * and the `injected(Class, [Tokens])` statements read from the constructor signatures.
7
- * `files` are relative to the context. It is derived from the tree, never edited by hand:
8
- * `ddd-ts-kit check` reports a barrel that differs (`declarations/barrel-current`).
9
- */
10
- export declare function renderBarrel(files: readonly string[], specifierOf: (file: string) => string, injected?: RenderedInjections): string;
11
- //# sourceMappingURL=render-barrel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-barrel.d.ts","sourceRoot":"","sources":["../../src/declared/render-barrel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAI7E;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EACrC,QAAQ,GAAE,kBAA4B,GACrC,MAAM,CAcR"}
@@ -1,29 +0,0 @@
1
- import { declaredRoleOf } from './declared-role-of.js';
2
- import { laidOutCalls } from './injection/laid-out-calls.js';
3
- const NOTHING = { imports: [], calls: [] };
4
- /**
5
- * The barrel of a context: one `export *` per role file, named by the specifier `specifierOf`
6
- * gives it (its alias, ending as the project writes its imports) and sorted by path; then,
7
- * when a constructor of the context takes something its decorator does not list, the imports
8
- * and the `injected(Class, [Tokens])` statements read from the constructor signatures.
9
- * `files` are relative to the context. It is derived from the tree, never edited by hand:
10
- * `ddd-ts-kit check` reports a barrel that differs (`declarations/barrel-current`).
11
- */
12
- export function renderBarrel(files, specifierOf, injected = NOTHING) {
13
- const roleFiles = [...new Set(files.filter((file) => declaredRoleOf(file) !== undefined))].sort(byPath);
14
- if (roleFiles.length === 0) {
15
- return 'export {};\n';
16
- }
17
- const exported = roleFiles.map((file) => `export * from '${specifierOf(file)}';`).join('\n');
18
- if (injected.calls.length === 0) {
19
- return `${exported}\n`;
20
- }
21
- return `${injected.imports.join('\n')}\n\n${exported}\n\n${laidOutCalls(injected.calls)}\n`;
22
- }
23
- function byPath(left, right) {
24
- if (left === right) {
25
- return 0;
26
- }
27
- return left < right ? -1 : 1;
28
- }
29
- //# sourceMappingURL=render-barrel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-barrel.js","sourceRoot":"","sources":["../../src/declared/render-barrel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,MAAM,OAAO,GAAuB,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAwB,EACxB,WAAqC,EACrC,QAAQ,GAAuB,OAAO;IAEtC,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAExG,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7F,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,QAAQ,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,QAAQ,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;AAC9F,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,KAAa;IACzC,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC"}