ddd-ts-kit 0.22.0 → 0.23.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 (207) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/README.fr.md +15 -3
  3. package/README.md +13 -2
  4. package/dist/check/commands/changed-files.d.ts +6 -1
  5. package/dist/check/commands/changed-files.d.ts.map +1 -1
  6. package/dist/check/commands/changed-files.js +15 -11
  7. package/dist/check/commands/changed-files.js.map +1 -1
  8. package/dist/check/events/domain-event-names.d.ts +1 -1
  9. package/dist/check/events/domain-event-names.d.ts.map +1 -1
  10. package/dist/check/events/domain-event-names.js +2 -2
  11. package/dist/check/events/domain-event-names.js.map +1 -1
  12. package/dist/check/explain/authz-docs.js +1 -1
  13. package/dist/check/explain/authz-docs.js.map +1 -1
  14. package/dist/check/explain/clean-docs.js +1 -1
  15. package/dist/check/explain/clean-docs.js.map +1 -1
  16. package/dist/check/explain/events-docs.d.ts.map +1 -1
  17. package/dist/check/explain/events-docs.js +2 -5
  18. package/dist/check/explain/events-docs.js.map +1 -1
  19. package/dist/check/explain/language-docs.js +1 -1
  20. package/dist/check/explain/language-docs.js.map +1 -1
  21. package/dist/check/explain/layout-docs.js +1 -1
  22. package/dist/check/explain/layout-docs.js.map +1 -1
  23. package/dist/check/explain/schema-docs.js +1 -1
  24. package/dist/check/explain/schema-docs.js.map +1 -1
  25. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  26. package/dist/check/fixtures/authz-policy-fixtures.js +12 -0
  27. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  28. package/dist/check/fixtures/clean-fixtures.d.ts.map +1 -1
  29. package/dist/check/fixtures/clean-fixtures.js +2 -1
  30. package/dist/check/fixtures/clean-fixtures.js.map +1 -1
  31. package/dist/check/fixtures/layout-fixtures.d.ts.map +1 -1
  32. package/dist/check/fixtures/layout-fixtures.js +15 -0
  33. package/dist/check/fixtures/layout-fixtures.js.map +1 -1
  34. package/dist/check/fixtures/schema-fixtures.d.ts.map +1 -1
  35. package/dist/check/fixtures/schema-fixtures.js +10 -0
  36. package/dist/check/fixtures/schema-fixtures.js.map +1 -1
  37. package/dist/check/fixtures/vocabulary-fixtures.d.ts.map +1 -1
  38. package/dist/check/fixtures/vocabulary-fixtures.js +23 -0
  39. package/dist/check/fixtures/vocabulary-fixtures.js.map +1 -1
  40. package/dist/check/rules/authz-policy-asked.js +5 -4
  41. package/dist/check/rules/authz-policy-asked.js.map +1 -1
  42. package/dist/check/rules/clean-file-size.d.ts.map +1 -1
  43. package/dist/check/rules/clean-file-size.js +28 -14
  44. package/dist/check/rules/clean-file-size.js.map +1 -1
  45. package/dist/check/rules/clean-function-size.js +1 -1
  46. package/dist/check/rules/clean-function-size.js.map +1 -1
  47. package/dist/check/rules/events-name-declared-once.d.ts.map +1 -1
  48. package/dist/check/rules/events-name-declared-once.js +6 -6
  49. package/dist/check/rules/events-name-declared-once.js.map +1 -1
  50. package/dist/check/rules/language-declared-vocabulary.d.ts.map +1 -1
  51. package/dist/check/rules/language-declared-vocabulary.js +23 -3
  52. package/dist/check/rules/language-declared-vocabulary.js.map +1 -1
  53. package/dist/check/schemas/still-generated.js +1 -1
  54. package/dist/check/schemas/still-generated.js.map +1 -1
  55. package/dist/commands/status.d.ts +4 -1
  56. package/dist/commands/status.d.ts.map +1 -1
  57. package/dist/commands/status.js +12 -2
  58. package/dist/commands/status.js.map +1 -1
  59. package/dist/commands/todo.d.ts +1 -1
  60. package/dist/commands/todo.d.ts.map +1 -1
  61. package/dist/commands/todo.js +2 -1
  62. package/dist/commands/todo.js.map +1 -1
  63. package/dist/commands/verify-slice.d.ts +4 -0
  64. package/dist/commands/verify-slice.d.ts.map +1 -0
  65. package/dist/commands/verify-slice.js +21 -0
  66. package/dist/commands/verify-slice.js.map +1 -0
  67. package/dist/generate/kinds/assert-declares-its-name.js +1 -1
  68. package/dist/generate/kinds/assert-declares-its-name.js.map +1 -1
  69. package/dist/generate/kinds/declares-its-name.d.ts +1 -1
  70. package/dist/generate/kinds/declares-its-name.d.ts.map +1 -1
  71. package/dist/generate/kinds/declares-its-name.js +2 -2
  72. package/dist/generate/kinds/declares-its-name.js.map +1 -1
  73. package/dist/generate/shared-writes.d.ts.map +1 -1
  74. package/dist/generate/shared-writes.js +4 -1
  75. package/dist/generate/shared-writes.js.map +1 -1
  76. package/dist/help/notes.d.ts +1 -1
  77. package/dist/help/notes.d.ts.map +1 -1
  78. package/dist/help/notes.js +7 -1
  79. package/dist/help/notes.js.map +1 -1
  80. package/dist/help/usage.d.ts +1 -1
  81. package/dist/help/usage.d.ts.map +1 -1
  82. package/dist/help/usage.js +2 -1
  83. package/dist/help/usage.js.map +1 -1
  84. package/dist/init/manifest/versions.js +24 -24
  85. package/dist/init/write-agent-settings.d.ts.map +1 -1
  86. package/dist/init/write-agent-settings.js +1 -0
  87. package/dist/init/write-agent-settings.js.map +1 -1
  88. package/dist/progress/format-progress.js +7 -1
  89. package/dist/progress/format-progress.js.map +1 -1
  90. package/dist/progress/progress.d.ts +4 -0
  91. package/dist/progress/progress.d.ts.map +1 -1
  92. package/dist/progress/read-progress.js +4 -1
  93. package/dist/progress/read-progress.js.map +1 -1
  94. package/dist/progress/read-slice-rules.d.ts.map +1 -1
  95. package/dist/progress/read-slice-rules.js +6 -2
  96. package/dist/progress/read-slice-rules.js.map +1 -1
  97. package/dist/progress/remaining-in.d.ts.map +1 -1
  98. package/dist/progress/remaining-in.js +10 -8
  99. package/dist/progress/remaining-in.js.map +1 -1
  100. package/dist/progress/remaining.d.ts +3 -3
  101. package/dist/progress/remaining.d.ts.map +1 -1
  102. package/dist/run.d.ts.map +1 -1
  103. package/dist/run.js +2 -0
  104. package/dist/run.js.map +1 -1
  105. package/dist/slice/format-slice-verification.d.ts +4 -0
  106. package/dist/slice/format-slice-verification.d.ts.map +1 -0
  107. package/dist/slice/format-slice-verification.js +40 -0
  108. package/dist/slice/format-slice-verification.js.map +1 -0
  109. package/dist/slice/near-the-limit.d.ts +7 -0
  110. package/dist/slice/near-the-limit.d.ts.map +1 -0
  111. package/dist/slice/near-the-limit.js +24 -0
  112. package/dist/slice/near-the-limit.js.map +1 -0
  113. package/dist/slice/paths-to-stage.d.ts +6 -0
  114. package/dist/slice/paths-to-stage.d.ts.map +1 -0
  115. package/dist/slice/paths-to-stage.js +13 -0
  116. package/dist/slice/paths-to-stage.js.map +1 -0
  117. package/dist/slice/run-script.d.ts +9 -0
  118. package/dist/slice/run-script.d.ts.map +1 -0
  119. package/dist/slice/run-script.js +26 -0
  120. package/dist/slice/run-script.js.map +1 -0
  121. package/dist/slice/script-call.d.ts +9 -0
  122. package/dist/slice/script-call.d.ts.map +1 -0
  123. package/dist/slice/script-call.js +2 -0
  124. package/dist/slice/script-call.js.map +1 -0
  125. package/dist/slice/script-run.d.ts +6 -0
  126. package/dist/slice/script-run.d.ts.map +1 -0
  127. package/dist/slice/script-run.js +2 -0
  128. package/dist/slice/script-run.js.map +1 -0
  129. package/dist/slice/sized-file.d.ts +6 -0
  130. package/dist/slice/sized-file.d.ts.map +1 -0
  131. package/dist/slice/sized-file.js +2 -0
  132. package/dist/slice/sized-file.js.map +1 -0
  133. package/dist/slice/slice-to-verify.d.ts +9 -0
  134. package/dist/slice/slice-to-verify.d.ts.map +1 -0
  135. package/dist/slice/slice-to-verify.js +2 -0
  136. package/dist/slice/slice-to-verify.js.map +1 -0
  137. package/dist/slice/slice-verification.d.ts +15 -0
  138. package/dist/slice/slice-verification.d.ts.map +1 -0
  139. package/dist/slice/slice-verification.js +2 -0
  140. package/dist/slice/slice-verification.js.map +1 -0
  141. package/dist/slice/verify-slice.d.ts +10 -0
  142. package/dist/slice/verify-slice.d.ts.map +1 -0
  143. package/dist/slice/verify-slice.js +47 -0
  144. package/dist/slice/verify-slice.js.map +1 -0
  145. package/dist/version.d.ts +1 -1
  146. package/dist/version.js +1 -1
  147. package/dist/worker/briefing-of.d.ts.map +1 -1
  148. package/dist/worker/briefing-of.js +30 -13
  149. package/dist/worker/briefing-of.js.map +1 -1
  150. package/dist/worker/changed-files.d.ts +7 -0
  151. package/dist/worker/changed-files.d.ts.map +1 -0
  152. package/dist/worker/changed-files.js +20 -0
  153. package/dist/worker/changed-files.js.map +1 -0
  154. package/dist/worker/format-workers.d.ts +4 -0
  155. package/dist/worker/format-workers.d.ts.map +1 -0
  156. package/dist/worker/format-workers.js +47 -0
  157. package/dist/worker/format-workers.js.map +1 -0
  158. package/dist/worker/list-worktrees.d.ts +10 -0
  159. package/dist/worker/list-worktrees.d.ts.map +1 -0
  160. package/dist/worker/list-worktrees.js +18 -0
  161. package/dist/worker/list-worktrees.js.map +1 -0
  162. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  163. package/dist/worker/open-worker-scope.js +6 -7
  164. package/dist/worker/open-worker-scope.js.map +1 -1
  165. package/dist/worker/overlaps-of.d.ts +4 -0
  166. package/dist/worker/overlaps-of.d.ts.map +1 -0
  167. package/dist/worker/overlaps-of.js +17 -0
  168. package/dist/worker/overlaps-of.js.map +1 -0
  169. package/dist/worker/read-worker-file.d.ts +4 -0
  170. package/dist/worker/read-worker-file.d.ts.map +1 -0
  171. package/dist/worker/read-worker-file.js +18 -0
  172. package/dist/worker/read-worker-file.js.map +1 -0
  173. package/dist/worker/read-workers.d.ts +8 -0
  174. package/dist/worker/read-workers.d.ts.map +1 -0
  175. package/dist/worker/read-workers.js +56 -0
  176. package/dist/worker/read-workers.js.map +1 -0
  177. package/dist/worker/report-file.d.ts +3 -0
  178. package/dist/worker/report-file.d.ts.map +1 -0
  179. package/dist/worker/report-file.js +3 -0
  180. package/dist/worker/report-file.js.map +1 -0
  181. package/dist/worker/worker-file.d.ts +14 -0
  182. package/dist/worker/worker-file.d.ts.map +1 -0
  183. package/dist/worker/worker-file.js +2 -0
  184. package/dist/worker/worker-file.js.map +1 -0
  185. package/dist/worker/worker-generators.d.ts +4 -1
  186. package/dist/worker/worker-generators.d.ts.map +1 -1
  187. package/dist/worker/worker-generators.js +5 -2
  188. package/dist/worker/worker-generators.js.map +1 -1
  189. package/dist/worker/workers-status.d.ts +48 -0
  190. package/dist/worker/workers-status.d.ts.map +1 -0
  191. package/dist/worker/workers-status.js +2 -0
  192. package/dist/worker/workers-status.js.map +1 -0
  193. package/package.json +2 -2
  194. package/templates/domain-event/domain-event.ts.tpl +5 -7
  195. package/templates/pipeline/package-scripts.json +1 -1
  196. package/templates/presets/identity/context/domain/events/account-deactivated.event.ts.tpl +5 -7
  197. package/templates/presets/identity/context/domain/events/account-provisioned.event.ts.tpl +5 -7
  198. package/templates/presets/identity/context/domain/events/delegation-granted.event.ts.tpl +5 -7
  199. package/templates/presets/identity/context/domain/events/delegation-revoked.event.ts.tpl +5 -7
  200. package/templates/presets/identity/context/domain/events/invitation-accepted.event.ts.tpl +5 -7
  201. package/templates/presets/identity/context/domain/events/invitation-declined.event.ts.tpl +5 -7
  202. package/templates/presets/identity/context/domain/events/invitation-issued.event.ts.tpl +5 -7
  203. package/templates/presets/identity/context/domain/events/invitation-revoked.event.ts.tpl +5 -7
  204. package/templates/presets/identity/context/domain/events/member-joined.event.ts.tpl +5 -7
  205. package/templates/presets/identity/context/domain/events/member-removed.event.ts.tpl +5 -7
  206. package/templates/presets/identity/context/domain/events/member-role-changed.event.ts.tpl +5 -7
  207. package/templates/presets/identity/context/domain/events/organisation-opened.event.ts.tpl +5 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlaps-of.js","sourceRoot":"","sources":["../../src/worker/overlaps-of.ts"],"names":[],"mappings":"AAEA,wGAAwG;AACxG,MAAM,UAAU,UAAU,CAAC,OAAgC;IACzD,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/G,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;KACnG,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CACb,OAAgC,EAChC,IAAiD;IAEjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE5C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7G,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { WorkerFile } from './worker-file.js';
2
+ /** The scope file of a worker; undefined when it is missing, unreadable or names no context. What it lacks is left out. */
3
+ export declare function readWorkerFile(file: string): WorkerFile | undefined;
4
+ //# sourceMappingURL=read-worker-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-worker-file.d.ts","sourceRoot":"","sources":["../../src/worker/read-worker-file.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,2HAA2H;AAC3H,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAgBnE"}
@@ -0,0 +1,18 @@
1
+ import fs from 'node:fs';
2
+ import { jsonObject } from '../init/json-object.js';
3
+ /** The scope file of a worker; undefined when it is missing, unreadable or names no context. What it lacks is left out. */
4
+ export function readWorkerFile(file) {
5
+ const json = fs.existsSync(file) ? jsonObject(fs.readFileSync(file, 'utf8')) : undefined;
6
+ const context = json?.context;
7
+ if (json === undefined || typeof context !== 'string' || context === '') {
8
+ return undefined;
9
+ }
10
+ const { rows, base, branch } = json;
11
+ return {
12
+ context,
13
+ ...(Array.isArray(rows) ? { rows: rows.filter((id) => typeof id === 'string') } : {}),
14
+ ...(typeof base === 'string' ? { base } : {}),
15
+ ...(typeof branch === 'string' ? { branch } : {}),
16
+ };
17
+ }
18
+ //# sourceMappingURL=read-worker-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-worker-file.js","sourceRoot":"","sources":["../../src/worker/read-worker-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,2HAA2H;AAC3H,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzF,MAAM,OAAO,GAAG,IAAI,EAAE,OAAO,CAAC;IAE9B,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACxE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEpC,OAAO;QACL,OAAO;QACP,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { WorkersStatus } from './workers-status.js';
2
+ /**
3
+ * The workers of a parallel build, read from the worktrees of the repository of the project at
4
+ * `root`: each worktree whose copy of the project holds a scope file is one. Reads git and the
5
+ * files, changes nothing.
6
+ */
7
+ export declare function readWorkers(root: string): WorkersStatus;
8
+ //# sourceMappingURL=read-workers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-workers.d.ts","sourceRoot":"","sources":["../../src/worker/read-workers.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAA8B,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CASvD"}
@@ -0,0 +1,56 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { runGit } from '../commit/run-git.js';
4
+ import { WORKER_SCOPE_FILE } from '../commit/worker-scope-file.js';
5
+ import { changedFiles } from './changed-files.js';
6
+ import { listWorktrees } from './list-worktrees.js';
7
+ import { overlapsOf } from './overlaps-of.js';
8
+ import { readWorkerFile } from './read-worker-file.js';
9
+ import { REPORT_FILE } from './report-file.js';
10
+ /**
11
+ * The workers of a parallel build, read from the worktrees of the repository of the project at
12
+ * `root`: each worktree whose copy of the project holds a scope file is one. Reads git and the
13
+ * files, changes nothing.
14
+ */
15
+ export function readWorkers(root) {
16
+ const prefix = runGit(root, ['rev-parse', '--show-prefix'])?.trim();
17
+ const workers = prefix === undefined
18
+ ? []
19
+ : listWorktrees(root).flatMap((worktree) => workerIn(worktree, path.join(worktree.path, prefix)));
20
+ return { workers, overlaps: overlapsOf(workers) };
21
+ }
22
+ /** The worker of one worktree, whose project is at `project`; none without a readable scope file. */
23
+ function workerIn(worktree, project) {
24
+ const scope = readWorkerFile(path.join(project, WORKER_SCOPE_FILE));
25
+ if (scope === undefined) {
26
+ return [];
27
+ }
28
+ const branch = worktree.branch ?? scope.branch;
29
+ const { ahead, mergeBase } = sinceBase(worktree.path, scope.base);
30
+ return [
31
+ {
32
+ worktree: worktree.path,
33
+ ...(branch === undefined ? {} : { branch }),
34
+ context: scope.context,
35
+ ...(scope.rows === undefined ? {} : { rows: scope.rows }),
36
+ ...(scope.base === undefined ? {} : { base: scope.base }),
37
+ ...(ahead === undefined ? {} : { ahead }),
38
+ files: changedFiles(worktree.path, mergeBase),
39
+ report: reportIn(project),
40
+ },
41
+ ];
42
+ }
43
+ /** Where the worktree stands against its base; nothing when the base is unknown or names no commit. */
44
+ function sinceBase(worktree, base) {
45
+ if (base === undefined) {
46
+ return {};
47
+ }
48
+ const mergeBase = runGit(worktree, ['merge-base', base, 'HEAD'])?.trim();
49
+ const ahead = runGit(worktree, ['rev-list', '--count', `${base}..HEAD`]);
50
+ return mergeBase === undefined || ahead === undefined ? {} : { ahead: Number(ahead.trim()), mergeBase };
51
+ }
52
+ function reportIn(project) {
53
+ const file = path.join(project, REPORT_FILE);
54
+ return fs.existsSync(file) ? { file, modified: fs.statSync(file).mtime.toISOString() } : null;
55
+ }
56
+ //# sourceMappingURL=read-workers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-workers.js","sourceRoot":"","sources":["../../src/worker/read-workers.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ /** The report a worker keeps current in its worktree, ignored by git with the rest of `.ddd-ts-kit/`. */
2
+ export declare const REPORT_FILE = ".ddd-ts-kit/report.md";
3
+ //# sourceMappingURL=report-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-file.d.ts","sourceRoot":"","sources":["../../src/worker/report-file.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,eAAO,MAAM,WAAW,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The report a worker keeps current in its worktree, ignored by git with the rest of `.ddd-ts-kit/`. */
2
+ export const REPORT_FILE = '.ddd-ts-kit/report.md';
3
+ //# sourceMappingURL=report-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-file.js","sourceRoot":"","sources":["../../src/worker/report-file.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * What `.ddd-ts-kit/worker.json` holds in the worktree of a worker. A file written before the
3
+ * kit recorded the rows, the base and the branch holds the context only.
4
+ */
5
+ export interface WorkerFile {
6
+ /** The one context the worker builds: what the guard of the plugin reads. */
7
+ readonly context: string;
8
+ /** The ids of the rows of the slices file it was briefed on, as written. */
9
+ readonly rows?: readonly string[];
10
+ /** The ref its worktree was cut from and is checked against. */
11
+ readonly base?: string;
12
+ readonly branch?: string;
13
+ }
14
+ //# sourceMappingURL=worker-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-file.d.ts","sourceRoot":"","sources":["../../src/worker/worker-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=worker-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-file.js","sourceRoot":"","sources":["../../src/worker/worker-file.ts"],"names":[],"mappings":""}
@@ -1,4 +1,7 @@
1
1
  import type { Kind } from '../generate/kind.js';
2
- /** The kinds a worker confined to one context may run: those that write nothing shared, and those that have a way not to. */
2
+ /**
3
+ * The kinds a worker confined to one context may run: those of a context that write nothing
4
+ * shared, and those that have a way not to (a decision record of its slices, for one).
5
+ */
3
6
  export declare function workerGenerators(kinds: readonly Kind[]): string[];
4
7
  //# sourceMappingURL=worker-generators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker-generators.d.ts","sourceRoot":"","sources":["../../src/worker/worker-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGhD,6HAA6H;AAC7H,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,MAAM,EAAE,CAYjE"}
1
+ {"version":3,"file":"worker-generators.d.ts","sourceRoot":"","sources":["../../src/worker/worker-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,MAAM,EAAE,CAYjE"}
@@ -1,8 +1,11 @@
1
1
  import { SHARED_WRITES } from '../generate/shared-writes.js';
2
- /** The kinds a worker confined to one context may run: those that write nothing shared, and those that have a way not to. */
2
+ /**
3
+ * The kinds a worker confined to one context may run: those of a context that write nothing
4
+ * shared, and those that have a way not to (a decision record of its slices, for one).
5
+ */
3
6
  export function workerGenerators(kinds) {
4
7
  return kinds
5
- .filter((kind) => kind.positionals[0] === 'context')
8
+ .filter((kind) => kind.positionals[0] === 'context' || SHARED_WRITES[kind.name]?.worker !== undefined)
6
9
  .flatMap((kind) => {
7
10
  if (!kind.writesShared) {
8
11
  return [kind.name];
@@ -1 +1 @@
1
- {"version":3,"file":"worker-generators.js","sourceRoot":"","sources":["../../src/worker/worker-generators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,6HAA6H;AAC7H,MAAM,UAAU,gBAAgB,CAAC,KAAsB;IACrD,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;SACnD,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAEjD,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,OAAO,GAAG,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"worker-generators.js","sourceRoot":"","sources":["../../src/worker/worker-generators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAsB;IACrD,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC;SACrG,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAEjD,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,OAAO,GAAG,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,48 @@
1
+ /** Who builds what, in which worktree, and where two workers meet: what `status --workers` says. */
2
+ export interface WorkersStatus {
3
+ /** One entry per worktree holding `.ddd-ts-kit/worker.json`, in the order git lists them. */
4
+ readonly workers: readonly WorkerStatus[];
5
+ readonly overlaps: Overlaps;
6
+ }
7
+ /** One worker. What its scope file does not say (a file written before the rows and the base were recorded) is left out. */
8
+ export interface WorkerStatus {
9
+ /** Absolute path of the git worktree. */
10
+ readonly worktree: string;
11
+ /** The branch checked out there, or the one its scope file names on a detached HEAD. */
12
+ readonly branch?: string;
13
+ readonly context: string;
14
+ /** The ids of the rows it was briefed on. */
15
+ readonly rows?: readonly string[];
16
+ /** The ref it was cut from. */
17
+ readonly base?: string;
18
+ /** The commits on its branch that the base does not have; left out when the base is unknown or names no commit. */
19
+ readonly ahead?: number;
20
+ /**
21
+ * The files it changed, relative to the top of the repository: committed since the merge base
22
+ * with its base, modified, and untracked but not ignored. Without a known base, the modified
23
+ * and untracked ones only.
24
+ */
25
+ readonly files: readonly string[];
26
+ /** Its `.ddd-ts-kit/report.md`; null while it has written none. */
27
+ readonly report: WorkerReport | null;
28
+ }
29
+ export interface WorkerReport {
30
+ /** Absolute path. */
31
+ readonly file: string;
32
+ /** When it was last written, as an ISO 8601 date. */
33
+ readonly modified: string;
34
+ }
35
+ /** Where two workers or more meet: each is a merge conflict to come. */
36
+ export interface Overlaps {
37
+ /** Each context built by more than one worker, with their worktrees. */
38
+ readonly contexts: readonly {
39
+ readonly context: string;
40
+ readonly worktrees: readonly string[];
41
+ }[];
42
+ /** Each file changed by more than one worker, relative to the top of the repository, with their worktrees. */
43
+ readonly files: readonly {
44
+ readonly file: string;
45
+ readonly worktrees: readonly string[];
46
+ }[];
47
+ }
48
+ //# sourceMappingURL=workers-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workers-status.d.ts","sourceRoot":"","sources":["../../src/worker/workers-status.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC5B,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,4HAA4H;AAC5H,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,mHAAmH;IACnH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,YAAY;IAC3B,qBAAqB;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wEAAwE;AACxE,MAAM,WAAW,QAAQ;IACvB,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAClG,8GAA8G;IAC9G,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CAC7F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workers-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workers-status.js","sourceRoot":"","sources":["../../src/worker/workers-status.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-ts-kit",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
5
5
  "keywords": [
6
6
  "ddd",
@@ -52,6 +52,6 @@
52
52
  "clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
53
53
  },
54
54
  "devDependencies": {
55
- "@ddd-ts-kit/kernel": "^0.22.0"
55
+ "@ddd-ts-kit/kernel": "^0.23.0"
56
56
  }
57
57
  }
@@ -1,13 +1,11 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
2
-
3
- export class {{event.pascal}} implements DomainEvent {
4
- static readonly eventName = '{{event.name}}';
5
-
6
- readonly name = {{event.pascal}}.eventName;
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
7
2
 
3
+ export class {{event.pascal}} extends NamedDomainEvent('{{event.name}}') {
8
4
  constructor(
9
5
  readonly aggregateId: string,
10
6
  readonly occurredAt: Date,
11
7
  // TODO(domain): add as readonly parameters the facts a reaction needs to know about "{{event.words}}" (value objects or primitives, never the aggregate itself).
12
- ) {}
8
+ ) {
9
+ super();
10
+ }
13
11
  }
@@ -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.22.0",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.23.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",
@@ -1,13 +1,11 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** An account was deactivated: its person signs in no more. */
4
- export class AccountDeactivated implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.account.deactivated';
6
-
7
- readonly name = AccountDeactivated.eventName;
8
-
4
+ export class AccountDeactivated extends NamedDomainEvent('{{context.kebab}}.account.deactivated') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
12
- ) {}
8
+ ) {
9
+ super();
10
+ }
13
11
  }
@@ -1,11 +1,7 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** An account was provisioned at the first sign-in of its person. */
4
- export class AccountProvisioned implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.account.provisioned';
6
-
7
- readonly name = AccountProvisioned.eventName;
8
-
4
+ export class AccountProvisioned extends NamedDomainEvent('{{context.kebab}}.account.provisioned') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
@@ -13,5 +9,7 @@ export class AccountProvisioned implements DomainEvent {
13
9
  readonly email: string;
14
10
  readonly displayName: string;
15
11
  },
16
- ) {}
12
+ ) {
13
+ super();
14
+ }
17
15
  }
@@ -1,12 +1,8 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
  import type { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
3
3
 
4
4
  /** A member lent some of their rights to another, for a period. */
5
- export class DelegationGranted implements DomainEvent {
6
- static readonly eventName = '{{context.kebab}}.delegation.granted';
7
-
8
- readonly name = DelegationGranted.eventName;
9
-
5
+ export class DelegationGranted extends NamedDomainEvent('{{context.kebab}}.delegation.granted') {
10
6
  constructor(
11
7
  readonly aggregateId: string,
12
8
  readonly occurredAt: Date,
@@ -18,5 +14,7 @@ export class DelegationGranted implements DomainEvent {
18
14
  readonly startsAt: Date;
19
15
  readonly endsAt: Date;
20
16
  },
21
- ) {}
17
+ ) {
18
+ super();
19
+ }
22
20
  }
@@ -1,11 +1,7 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** A delegation ended before its period: revoked, or its delegator lost the standing it was granted with. */
4
- export class DelegationRevoked implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.delegation.revoked';
6
-
7
- readonly name = DelegationRevoked.eventName;
8
-
4
+ export class DelegationRevoked extends NamedDomainEvent('{{context.kebab}}.delegation.revoked') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
@@ -14,5 +10,7 @@ export class DelegationRevoked implements DomainEvent {
14
10
  readonly delegatorId: string;
15
11
  readonly delegateId: string;
16
12
  },
17
- ) {}
13
+ ) {
14
+ super();
15
+ }
18
16
  }
@@ -1,11 +1,7 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** The person an invitation was addressed to accepted it. */
4
- export class InvitationAccepted implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.invitation.accepted';
6
-
7
- readonly name = InvitationAccepted.eventName;
8
-
4
+ export class InvitationAccepted extends NamedDomainEvent('{{context.kebab}}.invitation.accepted') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
@@ -13,5 +9,7 @@ export class InvitationAccepted implements DomainEvent {
13
9
  readonly organisationId: string;
14
10
  readonly accountId: string;
15
11
  },
16
- ) {}
12
+ ) {
13
+ super();
14
+ }
17
15
  }
@@ -1,16 +1,14 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** The person an invitation was addressed to declined it. */
4
- export class InvitationDeclined implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.invitation.declined';
6
-
7
- readonly name = InvitationDeclined.eventName;
8
-
4
+ export class InvitationDeclined extends NamedDomainEvent('{{context.kebab}}.invitation.declined') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
12
8
  readonly facts: {
13
9
  readonly organisationId: string;
14
10
  },
15
- ) {}
11
+ ) {
12
+ super();
13
+ }
16
14
  }
@@ -1,12 +1,8 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
  import type { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
3
3
 
4
4
  /** An invitation was issued to an email address. */
5
- export class InvitationIssued implements DomainEvent {
6
- static readonly eventName = '{{context.kebab}}.invitation.issued';
7
-
8
- readonly name = InvitationIssued.eventName;
9
-
5
+ export class InvitationIssued extends NamedDomainEvent('{{context.kebab}}.invitation.issued') {
10
6
  constructor(
11
7
  readonly aggregateId: string,
12
8
  readonly occurredAt: Date,
@@ -18,5 +14,7 @@ export class InvitationIssued implements DomainEvent {
18
14
  /** The delegation that lent the right to invite, when the role of the inviter did not grant it. */
19
15
  readonly delegationId?: string;
20
16
  },
21
- ) {}
17
+ ) {
18
+ super();
19
+ }
22
20
  }
@@ -1,16 +1,14 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** The organisation took an invitation back before it was answered. */
4
- export class InvitationRevoked implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.invitation.revoked';
6
-
7
- readonly name = InvitationRevoked.eventName;
8
-
4
+ export class InvitationRevoked extends NamedDomainEvent('{{context.kebab}}.invitation.revoked') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
12
8
  readonly facts: {
13
9
  readonly organisationId: string;
14
10
  },
15
- ) {}
11
+ ) {
12
+ super();
13
+ }
16
14
  }
@@ -1,12 +1,8 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
  import type { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
3
3
 
4
4
  /** An account became a member of an organisation, in a role. */
5
- export class MemberJoined implements DomainEvent {
6
- static readonly eventName = '{{context.kebab}}.member.joined';
7
-
8
- readonly name = MemberJoined.eventName;
9
-
5
+ export class MemberJoined extends NamedDomainEvent('{{context.kebab}}.member.joined') {
10
6
  constructor(
11
7
  readonly aggregateId: string,
12
8
  readonly occurredAt: Date,
@@ -15,5 +11,7 @@ export class MemberJoined implements DomainEvent {
15
11
  readonly accountId: string;
16
12
  readonly role: MemberRole;
17
13
  },
18
- ) {}
14
+ ) {
15
+ super();
16
+ }
19
17
  }
@@ -1,11 +1,7 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** A member left an organisation, or was removed from it. */
4
- export class MemberRemoved implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.member.removed';
6
-
7
- readonly name = MemberRemoved.eventName;
8
-
4
+ export class MemberRemoved extends NamedDomainEvent('{{context.kebab}}.member.removed') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
@@ -15,5 +11,7 @@ export class MemberRemoved implements DomainEvent {
15
11
  /** The delegation that lent the right to decide it, when the role of who decided did not grant it. */
16
12
  readonly delegationId?: string;
17
13
  },
18
- ) {}
14
+ ) {
15
+ super();
16
+ }
19
17
  }
@@ -1,12 +1,8 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
  import type { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
3
3
 
4
4
  /** A member holds another role: what they may do in the organisation follows from it from now on. */
5
- export class MemberRoleChanged implements DomainEvent {
6
- static readonly eventName = '{{context.kebab}}.member.role-changed';
7
-
8
- readonly name = MemberRoleChanged.eventName;
9
-
5
+ export class MemberRoleChanged extends NamedDomainEvent('{{context.kebab}}.member.role-changed') {
10
6
  constructor(
11
7
  readonly aggregateId: string,
12
8
  readonly occurredAt: Date,
@@ -18,5 +14,7 @@ export class MemberRoleChanged implements DomainEvent {
18
14
  /** The delegation that lent the right to decide it, when the role of who decided did not grant it. */
19
15
  readonly delegationId?: string;
20
16
  },
21
- ) {}
17
+ ) {
18
+ super();
19
+ }
22
20
  }
@@ -1,11 +1,7 @@
1
- import type { DomainEvent } from '@ddd-ts-kit/kernel';
1
+ import { NamedDomainEvent } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  /** An organisation was opened, its opener its first owner. */
4
- export class OrganisationOpened implements DomainEvent {
5
- static readonly eventName = '{{context.kebab}}.organisation.opened';
6
-
7
- readonly name = OrganisationOpened.eventName;
8
-
4
+ export class OrganisationOpened extends NamedDomainEvent('{{context.kebab}}.organisation.opened') {
9
5
  constructor(
10
6
  readonly aggregateId: string,
11
7
  readonly occurredAt: Date,
@@ -13,5 +9,7 @@ export class OrganisationOpened implements DomainEvent {
13
9
  readonly name: string;
14
10
  readonly openedBy: string;
15
11
  },
16
- ) {}
12
+ ) {
13
+ super();
14
+ }
17
15
  }