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.
- package/CHANGELOG.md +50 -0
- package/README.fr.md +60 -27
- package/README.md +57 -28
- package/dist/check/canonical/stray-entry.js +3 -2
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/explain/layout-docs.js +1 -1
- package/dist/check/explain/layout-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +3 -2
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +17 -6
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +4 -4
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.js +10 -8
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +54 -9
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/declared-declarations.d.ts +7 -0
- package/dist/check/fixtures/declared-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/declared-declarations.js +21 -0
- package/dist/check/fixtures/declared-declarations.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts +4 -1
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +17 -9
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/paths.d.ts +1 -0
- package/dist/check/fixtures/paths.d.ts.map +1 -1
- package/dist/check/fixtures/paths.js +1 -0
- package/dist/check/fixtures/paths.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +3 -3
- package/dist/check/fixtures/signature-project.js +3 -3
- package/dist/check/fixtures/signature.d.ts +2 -1
- package/dist/check/fixtures/signature.d.ts.map +1 -1
- package/dist/check/fixtures/signature.js +2 -1
- package/dist/check/fixtures/signature.js.map +1 -1
- package/dist/check/fixtures/single-file-declarations.d.ts +7 -0
- package/dist/check/fixtures/single-file-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/single-file-declarations.js +21 -0
- package/dist/check/fixtures/single-file-declarations.js.map +1 -0
- package/dist/check/rules/clean-file-size.d.ts.map +1 -1
- package/dist/check/rules/clean-file-size.js +9 -1
- package/dist/check/rules/clean-file-size.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +56 -23
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/naming-suffix.d.ts.map +1 -1
- package/dist/check/rules/naming-suffix.js +7 -3
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/support/is-generated-context-file.d.ts +5 -1
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +11 -5
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +23 -11
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +7 -4
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/print-report.js +1 -0
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commit/is-derived.js +4 -4
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/declared/barrel-file.d.ts +4 -1
- package/dist/declared/barrel-file.d.ts.map +1 -1
- package/dist/declared/barrel-file.js +4 -1
- package/dist/declared/barrel-file.js.map +1 -1
- package/dist/declared/context-declarations.d.ts +24 -0
- package/dist/declared/context-declarations.d.ts.map +1 -0
- package/dist/declared/context-declarations.js +22 -0
- package/dist/declared/context-declarations.js.map +1 -0
- package/dist/declared/declarations-folder-of.d.ts +10 -0
- package/dist/declared/declarations-folder-of.d.ts.map +1 -0
- package/dist/declared/declarations-folder-of.js +13 -0
- package/dist/declared/declarations-folder-of.js.map +1 -0
- package/dist/declared/folder-declarations-file.d.ts +7 -0
- package/dist/declared/folder-declarations-file.d.ts.map +1 -0
- package/dist/declared/folder-declarations-file.js +10 -0
- package/dist/declared/folder-declarations-file.js.map +1 -0
- package/dist/declared/index.d.ts +8 -1
- package/dist/declared/index.d.ts.map +1 -1
- package/dist/declared/index.js +8 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/is-declarations-file.d.ts +7 -0
- package/dist/declared/is-declarations-file.d.ts.map +1 -0
- package/dist/declared/is-declarations-file.js +20 -0
- package/dist/declared/is-declarations-file.js.map +1 -0
- package/dist/declared/keeps-single-file.d.ts +11 -0
- package/dist/declared/keeps-single-file.d.ts.map +1 -0
- package/dist/declared/keeps-single-file.js +23 -0
- package/dist/declared/keeps-single-file.js.map +1 -0
- package/dist/declared/render-declarations.d.ts +18 -0
- package/dist/declared/render-declarations.d.ts.map +1 -0
- package/dist/declared/render-declarations.js +37 -0
- package/dist/declared/render-declarations.js.map +1 -0
- package/dist/declared/render-folder-declarations.d.ts +11 -0
- package/dist/declared/render-folder-declarations.d.ts.map +1 -0
- package/dist/declared/render-folder-declarations.js +23 -0
- package/dist/declared/render-folder-declarations.js.map +1 -0
- package/dist/declared/single-file-declarations.d.ts +9 -0
- package/dist/declared/single-file-declarations.d.ts.map +1 -0
- package/dist/declared/single-file-declarations.js +14 -0
- package/dist/declared/single-file-declarations.js.map +1 -0
- package/dist/declared/single-file-notice.d.ts +8 -0
- package/dist/declared/single-file-notice.d.ts.map +1 -0
- package/dist/declared/single-file-notice.js +9 -0
- package/dist/declared/single-file-notice.js.map +1 -0
- package/dist/derived/is-derived.d.ts +4 -3
- package/dist/derived/is-derived.d.ts.map +1 -1
- package/dist/derived/is-derived.js +8 -8
- package/dist/derived/is-derived.js.map +1 -1
- package/dist/describe/read-consumed-events.js +7 -2
- package/dist/describe/read-consumed-events.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +3 -2
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/write-docs.d.ts +3 -1
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +4 -2
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/generate/context-imports.d.ts.map +1 -1
- package/dist/generate/context-imports.js +2 -1
- package/dist/generate/context-imports.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.d.ts +14 -0
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/reaction-of.js +93 -0
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +30 -18
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +11 -4
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -15
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/refuse-shared-writes.js +1 -1
- package/dist/generate/refuse-shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +19 -16
- package/dist/help/notes.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/merge/classify-conflict.d.ts +2 -1
- package/dist/merge/classify-conflict.d.ts.map +1 -1
- package/dist/merge/classify-conflict.js +9 -0
- package/dist/merge/classify-conflict.js.map +1 -1
- package/dist/merge/higher-version.d.ts +7 -0
- package/dist/merge/higher-version.d.ts.map +1 -0
- package/dist/merge/higher-version.js +59 -0
- package/dist/merge/higher-version.js.map +1 -0
- package/dist/merge/merge-client-manifest.d.ts +16 -0
- package/dist/merge/merge-client-manifest.d.ts.map +1 -0
- package/dist/merge/merge-client-manifest.js +39 -0
- package/dist/merge/merge-client-manifest.js.map +1 -0
- package/dist/merge/merge-exclusions.d.ts +4 -3
- package/dist/merge/merge-exclusions.d.ts.map +1 -1
- package/dist/merge/merge-exclusions.js +6 -3
- package/dist/merge/merge-exclusions.js.map +1 -1
- package/dist/merge/resolve-conflict.d.ts +3 -2
- package/dist/merge/resolve-conflict.d.ts.map +1 -1
- package/dist/merge/resolve-conflict.js +29 -7
- package/dist/merge/resolve-conflict.js.map +1 -1
- package/dist/plan/batched-waves.d.ts +2 -0
- package/dist/plan/batched-waves.d.ts.map +1 -1
- package/dist/plan/batched-waves.js +20 -7
- package/dist/plan/batched-waves.js.map +1 -1
- package/dist/plan/format-plan.d.ts +1 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +33 -8
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/other-stories.d.ts +9 -0
- package/dist/plan/other-stories.d.ts.map +1 -0
- package/dist/plan/other-stories.js +31 -0
- package/dist/plan/other-stories.js.map +1 -0
- package/dist/plan/plan-waves.d.ts +2 -1
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +13 -4
- package/dist/plan/plan-waves.js.map +1 -1
- package/dist/plan/wave-plan.d.ts +28 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.js +4 -2
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/workspace/workspace-report.d.ts +2 -0
- package/dist/workspace/workspace-report.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +8 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +24 -3
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +2 -2
- package/templates/e2e/e2e-reaction.spec.ts.tpl +68 -0
- package/templates/init/AGENTS.md.tpl +1 -1
- package/templates/init/README.md.tpl +2 -1
- package/templates/init/e2e/start-application.database.ts.tpl +22 -2
- package/templates/init/e2e/start-application.memory.ts.tpl +22 -2
- package/templates/init/platform/events/custom-event-bus.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +12 -12
- package/templates/pipeline/github/workflows/codeql.yml +1 -1
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +1 -1
- package/templates/pipeline/github/workflows/pr-title.yml +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -0
- package/templates/test-world/world.buses.ts.tpl +1 -1
- package/templates/test-world/world.tsyringe.ts.tpl +1 -0
- package/dist/check/fixtures/declared-barrel.d.ts +0 -3
- package/dist/check/fixtures/declared-barrel.d.ts.map +0 -1
- package/dist/check/fixtures/declared-barrel.js +0 -4
- package/dist/check/fixtures/declared-barrel.js.map +0 -1
- package/dist/declared/render-barrel.d.ts +0 -11
- package/dist/declared/render-barrel.d.ts.map +0 -1
- package/dist/declared/render-barrel.js +0 -29
- 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 {
|
|
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 {
|
|
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`.
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
208
|
+
runs-on: ubuntu-26.04
|
|
209
209
|
timeout-minutes: 5
|
|
210
210
|
steps:
|
|
211
211
|
- name: Every gate passed
|
|
@@ -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.
|
|
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 +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"}
|