ddd-ts-kit 0.19.0 → 0.21.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 (255) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.fr.md +24 -11
  3. package/README.md +20 -9
  4. package/dist/check/authz/is-granted.d.ts +8 -0
  5. package/dist/check/authz/is-granted.d.ts.map +1 -0
  6. package/dist/check/authz/is-granted.js +11 -0
  7. package/dist/check/authz/is-granted.js.map +1 -0
  8. package/dist/check/authz/permission-sets.d.ts +13 -0
  9. package/dist/check/authz/permission-sets.d.ts.map +1 -0
  10. package/dist/check/authz/permission-sets.js +19 -0
  11. package/dist/check/authz/permission-sets.js.map +1 -0
  12. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  13. package/dist/check/catalogue/architecture-rules.js +4 -0
  14. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  15. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  16. package/dist/check/catalogue/default-severities.js +2 -0
  17. package/dist/check/catalogue/default-severities.js.map +1 -1
  18. package/dist/check/commands/rules-command.js +2 -2
  19. package/dist/check/commands/rules-command.js.map +1 -1
  20. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  21. package/dist/check/configuration/config-inspection.js +7 -1
  22. package/dist/check/configuration/config-inspection.js.map +1 -1
  23. package/dist/check/engine/run-check.d.ts.map +1 -1
  24. package/dist/check/engine/run-check.js +17 -1
  25. package/dist/check/engine/run-check.js.map +1 -1
  26. package/dist/check/explain/authz-docs.d.ts.map +1 -1
  27. package/dist/check/explain/authz-docs.js +15 -0
  28. package/dist/check/explain/authz-docs.js.map +1 -1
  29. package/dist/check/explain/layout-docs.js +1 -1
  30. package/dist/check/explain/layout-docs.js.map +1 -1
  31. package/dist/check/explain/persistence-docs.js +1 -1
  32. package/dist/check/explain/persistence-docs.js.map +1 -1
  33. package/dist/check/explain/tree-docs.js +2 -2
  34. package/dist/check/explain/tree-docs.js.map +1 -1
  35. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  36. package/dist/check/explain/wiring-docs.js +7 -0
  37. package/dist/check/explain/wiring-docs.js.map +1 -1
  38. package/dist/check/fixtures/authz-granted-fixtures.d.ts +3 -0
  39. package/dist/check/fixtures/authz-granted-fixtures.d.ts.map +1 -0
  40. package/dist/check/fixtures/authz-granted-fixtures.js +71 -0
  41. package/dist/check/fixtures/authz-granted-fixtures.js.map +1 -0
  42. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  43. package/dist/check/fixtures/config-fixtures.js +50 -1
  44. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  45. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  46. package/dist/check/fixtures/fixtures.js +2 -0
  47. package/dist/check/fixtures/fixtures.js.map +1 -1
  48. package/dist/check/fixtures/governance-fixtures.d.ts.map +1 -1
  49. package/dist/check/fixtures/governance-fixtures.js +12 -3
  50. package/dist/check/fixtures/governance-fixtures.js.map +1 -1
  51. package/dist/check/fixtures/layer-fixtures.js +1 -1
  52. package/dist/check/fixtures/layer-fixtures.js.map +1 -1
  53. package/dist/check/fixtures/layout-fixtures.d.ts.map +1 -1
  54. package/dist/check/fixtures/layout-fixtures.js +6 -0
  55. package/dist/check/fixtures/layout-fixtures.js.map +1 -1
  56. package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
  57. package/dist/check/fixtures/persistence-fixtures.js +16 -0
  58. package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
  59. package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
  60. package/dist/check/fixtures/test-fixtures.js +35 -1
  61. package/dist/check/fixtures/test-fixtures.js.map +1 -1
  62. package/dist/check/fixtures/tree-fixtures.js +1 -1
  63. package/dist/check/fixtures/tree-fixtures.js.map +1 -1
  64. package/dist/check/fixtures/vocabulary-fixtures.d.ts.map +1 -1
  65. package/dist/check/fixtures/vocabulary-fixtures.js +4 -0
  66. package/dist/check/fixtures/vocabulary-fixtures.js.map +1 -1
  67. package/dist/check/language/declared-vocabularies.d.ts.map +1 -1
  68. package/dist/check/language/declared-vocabularies.js +8 -28
  69. package/dist/check/language/declared-vocabularies.js.map +1 -1
  70. package/dist/check/migrations/working-migration-findings.d.ts +8 -0
  71. package/dist/check/migrations/working-migration-findings.d.ts.map +1 -0
  72. package/dist/check/migrations/working-migration-findings.js +22 -0
  73. package/dist/check/migrations/working-migration-findings.js.map +1 -0
  74. package/dist/check/model/project.d.ts +3 -0
  75. package/dist/check/model/project.d.ts.map +1 -1
  76. package/dist/check/project/assemble-project.d.ts +2 -2
  77. package/dist/check/project/assemble-project.d.ts.map +1 -1
  78. package/dist/check/project/assemble-project.js +16 -6
  79. package/dist/check/project/assemble-project.js.map +1 -1
  80. package/dist/check/rules/authz-granted.d.ts +11 -0
  81. package/dist/check/rules/authz-granted.d.ts.map +1 -0
  82. package/dist/check/rules/authz-granted.js +45 -0
  83. package/dist/check/rules/authz-granted.js.map +1 -0
  84. package/dist/check/rules/clean-file-size.d.ts.map +1 -1
  85. package/dist/check/rules/clean-file-size.js +6 -1
  86. package/dist/check/rules/clean-file-size.js.map +1 -1
  87. package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
  88. package/dist/check/rules/clean-one-export-per-file.js +2 -11
  89. package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
  90. package/dist/check/rules/config-rule-off-everywhere.d.ts +3 -0
  91. package/dist/check/rules/config-rule-off-everywhere.d.ts.map +1 -0
  92. package/dist/check/rules/config-rule-off-everywhere.js +21 -0
  93. package/dist/check/rules/config-rule-off-everywhere.js.map +1 -0
  94. package/dist/check/rules/governance-recorded-deviation.js +14 -7
  95. package/dist/check/rules/governance-recorded-deviation.js.map +1 -1
  96. package/dist/check/rules/persistence-migration-history.d.ts.map +1 -1
  97. package/dist/check/rules/persistence-migration-history.js +9 -2
  98. package/dist/check/rules/persistence-migration-history.js.map +1 -1
  99. package/dist/check/rules/test-spec-required.d.ts.map +1 -1
  100. package/dist/check/rules/test-spec-required.js +3 -2
  101. package/dist/check/rules/test-spec-required.js.map +1 -1
  102. package/dist/check/support/is-abstract-base.d.ts +7 -0
  103. package/dist/check/support/is-abstract-base.d.ts.map +1 -0
  104. package/dist/check/support/is-abstract-base.js +11 -0
  105. package/dist/check/support/is-abstract-base.js.map +1 -0
  106. package/dist/check/support/is-generated-context-file.d.ts +4 -0
  107. package/dist/check/support/is-generated-context-file.d.ts.map +1 -0
  108. package/dist/check/support/is-generated-context-file.js +12 -0
  109. package/dist/check/support/is-generated-context-file.js.map +1 -0
  110. package/dist/check/text/depth-at.d.ts +3 -0
  111. package/dist/check/text/depth-at.d.ts.map +1 -0
  112. package/dist/check/text/depth-at.js +11 -0
  113. package/dist/check/text/depth-at.js.map +1 -0
  114. package/dist/commands/drizzle-generate.d.ts +4 -0
  115. package/dist/commands/drizzle-generate.d.ts.map +1 -0
  116. package/dist/commands/drizzle-generate.js +14 -0
  117. package/dist/commands/drizzle-generate.js.map +1 -0
  118. package/dist/commands/generate.js +4 -0
  119. package/dist/commands/generate.js.map +1 -1
  120. package/dist/commands/worker-scope.d.ts.map +1 -1
  121. package/dist/commands/worker-scope.js +17 -2
  122. package/dist/commands/worker-scope.js.map +1 -1
  123. package/dist/config/config.d.ts +2 -1
  124. package/dist/config/config.d.ts.map +1 -1
  125. package/dist/config/index.d.ts +1 -0
  126. package/dist/config/index.d.ts.map +1 -1
  127. package/dist/config/index.js +1 -0
  128. package/dist/config/index.js.map +1 -1
  129. package/dist/config/parse-config.d.ts.map +1 -1
  130. package/dist/config/parse-config.js +2 -1
  131. package/dist/config/parse-config.js.map +1 -1
  132. package/dist/config/parse-rule-setting.d.ts +3 -0
  133. package/dist/config/parse-rule-setting.d.ts.map +1 -0
  134. package/dist/config/parse-rule-setting.js +10 -0
  135. package/dist/config/parse-rule-setting.js.map +1 -0
  136. package/dist/config/project-severity.d.ts +4 -0
  137. package/dist/config/project-severity.d.ts.map +1 -0
  138. package/dist/config/project-severity.js +5 -0
  139. package/dist/config/project-severity.js.map +1 -0
  140. package/dist/config/rule-setting.d.ts +10 -0
  141. package/dist/config/rule-setting.d.ts.map +1 -0
  142. package/dist/config/rule-setting.js +2 -0
  143. package/dist/config/rule-setting.js.map +1 -0
  144. package/dist/generate/access-vars.d.ts.map +1 -1
  145. package/dist/generate/access-vars.js +5 -0
  146. package/dist/generate/access-vars.js.map +1 -1
  147. package/dist/generate/grant-permission.d.ts +9 -0
  148. package/dist/generate/grant-permission.d.ts.map +1 -0
  149. package/dist/generate/grant-permission.js +111 -0
  150. package/dist/generate/grant-permission.js.map +1 -0
  151. package/dist/generate/kind.d.ts +4 -0
  152. package/dist/generate/kind.d.ts.map +1 -1
  153. package/dist/generate/kinds/adr-kind.d.ts.map +1 -1
  154. package/dist/generate/kinds/adr-kind.js +8 -4
  155. package/dist/generate/kinds/adr-kind.js.map +1 -1
  156. package/dist/generate/kinds/adr-number.d.ts +8 -0
  157. package/dist/generate/kinds/adr-number.d.ts.map +1 -0
  158. package/dist/generate/kinds/adr-number.js +25 -0
  159. package/dist/generate/kinds/adr-number.js.map +1 -0
  160. package/dist/generate/kinds/command-kind.js +1 -1
  161. package/dist/generate/kinds/command-kind.js.map +1 -1
  162. package/dist/generate/kinds/file-upload-kind.js +2 -2
  163. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  164. package/dist/generate/kinds/query-kind.js +2 -2
  165. package/dist/generate/kinds/query-kind.js.map +1 -1
  166. package/dist/generate/kinds/write-adr.d.ts +3 -1
  167. package/dist/generate/kinds/write-adr.d.ts.map +1 -1
  168. package/dist/generate/kinds/write-adr.js +3 -3
  169. package/dist/generate/kinds/write-adr.js.map +1 -1
  170. package/dist/generate/shared-writes.d.ts.map +1 -1
  171. package/dist/generate/shared-writes.js +10 -3
  172. package/dist/generate/shared-writes.js.map +1 -1
  173. package/dist/help/notes.d.ts +1 -1
  174. package/dist/help/notes.d.ts.map +1 -1
  175. package/dist/help/notes.js +8 -2
  176. package/dist/help/notes.js.map +1 -1
  177. package/dist/help/usage.d.ts +1 -1
  178. package/dist/help/usage.d.ts.map +1 -1
  179. package/dist/help/usage.js +2 -1
  180. package/dist/help/usage.js.map +1 -1
  181. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  182. package/dist/init/manifest/database-scripts.js +2 -1
  183. package/dist/init/manifest/database-scripts.js.map +1 -1
  184. package/dist/init/manifest/scripts-for.js +2 -0
  185. package/dist/init/manifest/scripts-for.js.map +1 -1
  186. package/dist/init/manifest/versions.js +24 -24
  187. package/dist/init/run-init.js +1 -1
  188. package/dist/init/run-init.js.map +1 -1
  189. package/dist/init/write-agent-settings.d.ts.map +1 -1
  190. package/dist/init/write-agent-settings.js +1 -0
  191. package/dist/init/write-agent-settings.js.map +1 -1
  192. package/dist/migration/drizzle-kit-bin.d.ts +3 -0
  193. package/dist/migration/drizzle-kit-bin.d.ts.map +1 -0
  194. package/dist/migration/drizzle-kit-bin.js +12 -0
  195. package/dist/migration/drizzle-kit-bin.js.map +1 -0
  196. package/dist/migration/drizzle-silent-failures.d.ts +9 -0
  197. package/dist/migration/drizzle-silent-failures.d.ts.map +1 -0
  198. package/dist/migration/drizzle-silent-failures.js +14 -0
  199. package/dist/migration/drizzle-silent-failures.js.map +1 -0
  200. package/dist/migration/generate-drizzle-migration.d.ts +15 -0
  201. package/dist/migration/generate-drizzle-migration.d.ts.map +1 -0
  202. package/dist/migration/generate-drizzle-migration.js +37 -0
  203. package/dist/migration/generate-drizzle-migration.js.map +1 -0
  204. package/dist/migration/index.d.ts +2 -0
  205. package/dist/migration/index.d.ts.map +1 -0
  206. package/dist/migration/index.js +2 -0
  207. package/dist/migration/index.js.map +1 -0
  208. package/dist/presets/preset-decision.js +2 -2
  209. package/dist/presets/preset-decision.js.map +1 -1
  210. package/dist/progress/read-slice-rules.d.ts +8 -0
  211. package/dist/progress/read-slice-rules.d.ts.map +1 -0
  212. package/dist/progress/read-slice-rules.js +20 -0
  213. package/dist/progress/read-slice-rules.js.map +1 -0
  214. package/dist/run.d.ts.map +1 -1
  215. package/dist/run.js +2 -0
  216. package/dist/run.js.map +1 -1
  217. package/dist/version.d.ts +1 -1
  218. package/dist/version.js +1 -1
  219. package/dist/worker/base-of.d.ts +8 -0
  220. package/dist/worker/base-of.d.ts.map +1 -0
  221. package/dist/worker/base-of.js +36 -0
  222. package/dist/worker/base-of.js.map +1 -0
  223. package/dist/worker/briefed-rows.d.ts +14 -0
  224. package/dist/worker/briefed-rows.d.ts.map +1 -0
  225. package/dist/worker/briefed-rows.js +53 -0
  226. package/dist/worker/briefed-rows.js.map +1 -0
  227. package/dist/worker/briefed-slice.d.ts +7 -0
  228. package/dist/worker/briefed-slice.d.ts.map +1 -0
  229. package/dist/worker/briefed-slice.js +2 -0
  230. package/dist/worker/briefed-slice.js.map +1 -0
  231. package/dist/worker/briefing-of.d.ts.map +1 -1
  232. package/dist/worker/briefing-of.js +7 -5
  233. package/dist/worker/briefing-of.js.map +1 -1
  234. package/dist/worker/ensure-contains-base.d.ts +6 -0
  235. package/dist/worker/ensure-contains-base.d.ts.map +1 -0
  236. package/dist/worker/ensure-contains-base.js +13 -0
  237. package/dist/worker/ensure-contains-base.js.map +1 -0
  238. package/dist/worker/open-worker-scope.d.ts +7 -3
  239. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  240. package/dist/worker/open-worker-scope.js +33 -21
  241. package/dist/worker/open-worker-scope.js.map +1 -1
  242. package/dist/worker/worker-place.d.ts +2 -2
  243. package/dist/worker/worker-place.d.ts.map +1 -1
  244. package/dist/worker/worker-scope.d.ts +4 -4
  245. package/dist/worker/worker-scope.d.ts.map +1 -1
  246. package/package.json +3 -3
  247. package/templates/init/AGENTS.md.tpl +2 -2
  248. package/templates/init/README.md.tpl +1 -0
  249. package/templates/init/rules/application.md.tpl +2 -2
  250. package/templates/pipeline/package-scripts.json +1 -1
  251. package/templates/pipeline/vitest.config.ts.tpl +10 -1
  252. package/dist/generate/kinds/next-adr-number.d.ts +0 -4
  253. package/dist/generate/kinds/next-adr-number.d.ts.map +0 -1
  254. package/dist/generate/kinds/next-adr-number.js +0 -7
  255. package/dist/generate/kinds/next-adr-number.js.map +0 -1
@@ -28,9 +28,10 @@ export function briefingOf(place) {
28
28
  'Done when: every slice is committed, `npm run verify` is green in the worktree, and',
29
29
  `\`npx ddd-ts-kit todo ${context}\` lists nothing.`,
30
30
  '',
31
- 'Report, in under 200 words: slices done (commit hashes), slices not done and why, needs on',
32
- "shared files or on another context's contract, glossary terms added, open business",
33
- 'questions. No code, no file contents.',
31
+ 'Report, always, even when you stop early, in under 200 words: slices done (commit hashes),',
32
+ 'slices not done and why, with the files left modified by an unfinished one, needs on shared',
33
+ "files or on another context's contract, glossary terms added, open business questions. No",
34
+ 'code, no file contents.',
34
35
  ].join('\n');
35
36
  }
36
37
  function scopeLines({ config, generators }, directory) {
@@ -39,7 +40,8 @@ function scopeLines({ config, generators }, directory) {
39
40
  `- You may write: ${directory}/** and test/e2e/<use-case>.e2e.spec.ts of your slices.`,
40
41
  `- You may not write anything else. Shared files (config, ${config.platformDir}, ${config.sourceRoot}/main.ts,`,
41
42
  ' package.json, lockfile, migrations, docs/) and other contexts are refused by the guard:',
42
- ' report the need, do not work around it.',
43
+ ' report the need, do not work around it. A slice that changes the stored state generates a',
44
+ ' working migration only: `npm run db:generate working-<what-it-does>`.',
43
45
  `- Generators you may run: ${generators.join(', ')}.`,
44
46
  ' The others are run by the conductor.',
45
47
  ];
@@ -48,7 +50,7 @@ function sliceLines(slices) {
48
50
  if (slices.length === 0) {
49
51
  return ['- #<n> <slice>: <generator commands of the row> ; rules: <invariants and failures by name>'];
50
52
  }
51
- return slices.map((row) => `- #${row.id} ${row.slice}: ${row.startWith} ; rules: <invariants and failures by name>`);
53
+ return slices.map((row) => `- #${row.id} ${row.slice}: ${row.startWith}${row.rules === undefined ? '' : ` ; rules: ${row.rules}`}`);
52
54
  }
53
55
  function contractsOf({ config, context }) {
54
56
  const upstreams = config.contexts[context]?.upstreams ?? [];
@@ -1 +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AAE,CACjH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,EAAe;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IAE5D,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC;QACzB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACzG,CAAC,CAAC,MAAM,CAAC;AACb,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Refuses a branch that does not contain the base: a worker on it would build on a stale
3
+ * trunk, and its merge would undo what the trunk gained since.
4
+ */
5
+ export declare function ensureContainsBase(root: string, branch: string, base: string): void;
6
+ //# sourceMappingURL=ensure-contains-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensure-contains-base.d.ts","sourceRoot":"","sources":["../../src/worker/ensure-contains-base.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CASnF"}
@@ -0,0 +1,13 @@
1
+ import { CliError } from '../cli-error.js';
2
+ import { runGit } from '../commit/run-git.js';
3
+ /**
4
+ * Refuses a branch that does not contain the base: a worker on it would build on a stale
5
+ * trunk, and its merge would undo what the trunk gained since.
6
+ */
7
+ export function ensureContainsBase(root, branch, base) {
8
+ if (runGit(root, ['merge-base', '--is-ancestor', base, branch]) !== undefined) {
9
+ return;
10
+ }
11
+ throw new CliError(`The branch ${branch} does not contain ${base}: its worker would build on a stale base.`, `Bring it up to date first (\`git -C <worktree> merge ${base}\`, or rebase it), or pass the base it was cut from with --base <ref>.`);
12
+ }
13
+ //# sourceMappingURL=ensure-contains-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensure-contains-base.js","sourceRoot":"","sources":["../../src/worker/ensure-contains-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAc,EAAE,IAAY;IAC3E,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAC9E,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,cAAc,MAAM,qBAAqB,IAAI,2CAA2C,EACxF,wDAAwD,IAAI,wEAAwE,CACrI,CAAC;AACJ,CAAC"}
@@ -7,12 +7,16 @@ export interface WorkerRequest {
7
7
  readonly worktree?: string;
8
8
  /** By default `build/<context>`. */
9
9
  readonly branch?: string;
10
+ /** The ref the worktree is cut from and checked against; by default the current branch. */
11
+ readonly base?: string;
12
+ /** The ids of the rows to brief, in this order; by default every row of the context still to do. */
13
+ readonly rows?: readonly string[];
10
14
  readonly dryRun: boolean;
11
15
  }
12
16
  /**
13
- * Gives one worker its place: a git worktree of the project on its own branch, the file that
14
- * confines it to its context, and its briefing. An existing worktree is kept: only the file is
15
- * written again.
17
+ * Gives one worker its place: a git worktree of the project on its own branch, cut from the
18
+ * base, the file that confines it to its context, and its briefing. An existing worktree or
19
+ * branch is kept when it contains the base: only the file is written again.
16
20
  */
17
21
  export declare function openWorkerScope(root: string, config: Config, request: WorkerRequest): WorkerScope;
18
22
  //# sourceMappingURL=open-worker-scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-worker-scope.d.ts","sourceRoot":"","sources":["../../src/worker/open-worker-scope.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAA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@ import { CliError } from '../cli-error.js';
4
4
  import { runGit } from '../commit/run-git.js';
5
5
  import { WORKER_SCOPE_FILE } from '../commit/worker-scope-file.js';
6
6
  import { KINDS } from '../generate/kinds.js';
7
- import { readSlices } from '../progress/read-slices.js';
8
7
  import { Workspace } from '../workspace/index.js';
8
+ import { briefedRows } from './briefed-rows.js';
9
9
  import { briefingOf } from './briefing-of.js';
10
+ import { ensureContainsBase } from './ensure-contains-base.js';
11
+ import { baseOf } from './base-of.js';
10
12
  import { workerGenerators } from './worker-generators.js';
11
13
  /**
12
- * Gives one worker its place: a git worktree of the project on its own branch, the file that
13
- * confines it to its context, and its briefing. An existing worktree is kept: only the file is
14
- * written again.
14
+ * Gives one worker its place: a git worktree of the project on its own branch, cut from the
15
+ * base, the file that confines it to its context, and its briefing. An existing worktree or
16
+ * branch is kept when it contains the base: only the file is written again.
15
17
  */
16
18
  export function openWorkerScope(root, config, request) {
17
19
  const { context, dryRun } = request;
18
- const { project, worktree, branch, trunk, created, inside } = placeOf(root, request);
20
+ const { project, worktree, branch, trunk, created, inside } = placeOf(root, config, request);
21
+ const { slices, notes } = briefedRows(new Workspace(root, false), context, request.rows);
19
22
  if (created && !dryRun) {
20
- addWorktree(root, worktree, branch);
23
+ addWorktree(root, { worktree, branch, base: trunk });
21
24
  }
22
25
  if (!dryRun) {
23
26
  writeScope(inside, context);
24
27
  }
25
- const slices = todoSlices(root, context);
26
28
  const generators = workerGenerators(KINDS);
27
29
  const briefing = briefingOf({ config, context, project, root: inside, branch, trunk, generators, slices });
28
30
  return {
@@ -38,25 +40,33 @@ export function openWorkerScope(root, config, request) {
38
40
  generators,
39
41
  slices,
40
42
  briefing,
41
- notes: notesOf(root, dryRun ? root : inside),
43
+ notes: [...notes, ...notesOf(root, dryRun ? root : inside)],
42
44
  };
43
45
  }
44
- function placeOf(root, request) {
45
- const repository = repositoryOf(root);
46
+ function placeOf(root, config, request) {
47
+ const prefix = prefixOf(root);
48
+ const trunk = baseOf(root, config, request.base);
46
49
  const project = path.basename(root);
47
50
  const worktree = path.resolve(root, request.worktree ?? `../${project}-${request.context}`);
48
51
  const branch = request.branch ?? `build/${request.context}`;
49
52
  const created = !isWorktree(root, worktree);
53
+ if (!created) {
54
+ ensureContainsBase(worktree, runGit(worktree, ['branch', '--show-current'])?.trim() || 'HEAD', trunk);
55
+ }
56
+ else if (branchExists(root, branch)) {
57
+ ensureContainsBase(root, branch, trunk);
58
+ }
50
59
  return {
51
60
  project,
52
61
  worktree,
53
62
  branch,
54
- trunk: repository.trunk,
63
+ trunk,
55
64
  created,
56
- inside: path.join(worktree, repository.prefix),
65
+ inside: path.join(worktree, prefix),
57
66
  };
58
67
  }
59
- function repositoryOf(root) {
68
+ /** The path of the project inside its repository, empty at its top. */
69
+ function prefixOf(root) {
60
70
  const prefix = runGit(root, ['rev-parse', '--show-prefix']);
61
71
  if (prefix === undefined) {
62
72
  throw new CliError(`${root} is not inside a git repository.`, 'Run `git init` and make a first commit: a worktree is cut from a commit.');
@@ -64,7 +74,7 @@ function repositoryOf(root) {
64
74
  if (runGit(root, ['rev-parse', '--verify', '--quiet', 'HEAD']) === undefined) {
65
75
  throw new CliError('The repository has no commit yet.', 'Commit the bootstrap first: a worktree is cut from a commit.');
66
76
  }
67
- return { trunk: runGit(root, ['branch', '--show-current'])?.trim() || 'HEAD', prefix: prefix.trim() };
77
+ return prefix.trim();
68
78
  }
69
79
  function isWorktree(root, worktree) {
70
80
  if (!fs.existsSync(worktree)) {
@@ -79,11 +89,16 @@ function isWorktree(root, worktree) {
79
89
  }
80
90
  throw new CliError(`${worktree} exists and is not a worktree of this repository.`, 'Pass another directory with --worktree <path>, or remove that one.');
81
91
  }
82
- function addWorktree(root, worktree, branch) {
83
- const exists = runGit(root, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}`]) !== undefined;
84
- const added = runGit(root, ['worktree', 'add', worktree, ...(exists ? [branch] : ['-b', branch])]);
92
+ function branchExists(root, branch) {
93
+ return runGit(root, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}`]) !== undefined;
94
+ }
95
+ /** Adds the worktree on its branch: an existing branch is checked out, a new one is cut from the base. */
96
+ function addWorktree(root, place) {
97
+ const { worktree, branch, base } = place;
98
+ const target = branchExists(root, branch) ? [branch] : ['-b', branch, base];
99
+ const added = runGit(root, ['worktree', 'add', worktree, ...target]);
85
100
  if (added === undefined) {
86
- throw new CliError(`git could not add the worktree ${worktree} on the branch ${branch}.`, `Run \`git worktree add ${worktree} ${exists ? branch : `-b ${branch}`}\` to read its reason; a branch checked out elsewhere takes --branch <name>.`);
101
+ throw new CliError(`git could not add the worktree ${worktree} on the branch ${branch}.`, `Run \`git worktree add ${worktree} ${target.join(' ')}\` to read its reason; a branch checked out elsewhere takes --branch <name>.`);
87
102
  }
88
103
  }
89
104
  function writeScope(inside, context) {
@@ -91,9 +106,6 @@ function writeScope(inside, context) {
91
106
  fs.mkdirSync(path.dirname(file), { recursive: true });
92
107
  fs.writeFileSync(file, `${JSON.stringify({ context }, null, 2)}\n`);
93
108
  }
94
- function todoSlices(root, context) {
95
- return (readSlices(new Workspace(root, false)) ?? []).filter((row) => row.owner === context && row.status === 'todo');
96
- }
97
109
  function notesOf(root, inside) {
98
110
  const ignored = runGit(inside, ['check-ignore', '--quiet', WORKER_SCOPE_FILE]) !== undefined;
99
111
  const installed = fs.existsSync(path.join(inside, 'node_modules')) || inside === root;
@@ -1 +1 @@
1
- {"version":3,"file":"open-worker-scope.js","sourceRoot":"","sources":["../../src/worker/open-worker-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,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G;aAC7H,CAAC;QACN,GAAG,CAAC,SAAS;YACX,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,2EAA2E,MAAM,eAAe,CAAC,CAAC;KACxG,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Config } from '../config/index.js';
2
- import type { Slice } from '../progress/slice.js';
2
+ import type { BriefedSlice } from './briefed-slice.js';
3
3
  /** What a briefing is filled with. */
4
4
  export interface WorkerPlace {
5
5
  readonly config: Config;
@@ -10,6 +10,6 @@ export interface WorkerPlace {
10
10
  readonly branch: string;
11
11
  readonly trunk: string;
12
12
  readonly generators: readonly string[];
13
- readonly slices: readonly Slice[];
13
+ readonly slices: readonly BriefedSlice[];
14
14
  }
15
15
  //# sourceMappingURL=worker-place.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker-place.d.ts","sourceRoot":"","sources":["../../src/worker/worker-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;CACnC"}
1
+ {"version":3,"file":"worker-place.d.ts","sourceRoot":"","sources":["../../src/worker/worker-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C"}
@@ -1,4 +1,4 @@
1
- import type { Slice } from '../progress/slice.js';
1
+ import type { BriefedSlice } from './briefed-slice.js';
2
2
  /** The place one worker builds one context in, and what to tell that worker. */
3
3
  export interface WorkerScope {
4
4
  readonly dryRun: boolean;
@@ -10,7 +10,7 @@ export interface WorkerScope {
10
10
  /** Absolute path of the project inside the worktree: where every command of the worker runs. */
11
11
  readonly root: string;
12
12
  readonly branch: string;
13
- /** The branch the worktree was cut from, and that the worker merges back from. */
13
+ /** The base: the ref the worktree was cut from (`--base`, by default the current branch), that the worker checks against and merges back from. */
14
14
  readonly trunk: string;
15
15
  /** True when this run created the worktree, or would with `--dry-run`. */
16
16
  readonly created: boolean;
@@ -18,8 +18,8 @@ export interface WorkerScope {
18
18
  readonly scopeFile: string;
19
19
  /** The generator kinds the worker may run; the conductor runs the others on the trunk. */
20
20
  readonly generators: readonly string[];
21
- /** The rows of the slices table owned by the context and still to do. */
22
- readonly slices: readonly Slice[];
21
+ /** The rows of the slices table the worker builds: those of `--rows`, by default those of the context still to do. */
22
+ readonly slices: readonly BriefedSlice[];
23
23
  readonly briefing: string;
24
24
  readonly notes: readonly string[];
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"worker-scope.d.ts","sourceRoot":"","sources":["../../src/worker/worker-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
1
+ {"version":3,"file":"worker-scope.d.ts","sourceRoot":"","sources":["../../src/worker/worker-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kJAAkJ;IAClJ,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,sHAAsH;IACtH,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-ts-kit",
3
- "version": "0.19.0",
3
+ "version": "0.21.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",
@@ -29,7 +29,7 @@
29
29
  "url": "git+https://github.com/gbourgeat/ddd-ts-kit.git",
30
30
  "directory": "packages/cli"
31
31
  },
32
- "homepage": "https://github.com/gbourgeat/ddd-ts-kit/tree/main/packages/cli#readme",
32
+ "homepage": "https://gbourgeat.github.io/ddd-ts-kit/",
33
33
  "bugs": "https://github.com/gbourgeat/ddd-ts-kit/issues",
34
34
  "publishConfig": {
35
35
  "access": "public",
@@ -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.19.0"
55
+ "@ddd-ts-kit/kernel": "^0.21.0"
56
56
  }
57
57
  }
@@ -8,7 +8,7 @@ A ddd-ts-kit project: one bounded context per directory of `{{config.contextsDir
8
8
  - `npx ddd-ts-kit check --changed-since <ref>`: the architecture rules on what changed; `npx ddd-ts-kit explain <rule-id>` gives the reason and an example.
9
9
  - `npx ddd-ts-kit list --json`: the map of the contexts. `npx ddd-ts-kit describe <context> --json`: one context as data (use cases, routes, events, ports, dependencies).
10
10
  - `npx ddd-ts-kit status`: the next step of the plan, the slices by status, the markers left per context. `npx ddd-ts-kit todo [<context>]`: each remaining `TODO(domain)` and `it.todo` as `file:line`.
11
- - `npx ddd-ts-kit docs`: regenerates the context map and the generated sections of each `CONTEXT.md`; `npm run docs:generate` the OpenAPI contract, the forms and the event catalog.
11
+ - `npm run regenerate`: every derived file in one step, after a change of route, schema, event or config: `.dependency-cruiser.cjs`, then `npm run docs:generate`, which runs `npx ddd-ts-kit docs` (the context map, the barrels, the generated sections of each `CONTEXT.md`) and writes the OpenAPI contract, the forms and the event catalog.
12
12
 
13
13
  ## Read less
14
14
 
@@ -29,7 +29,7 @@ Never edit `<context>.declarations.ts`: `generate`, `docs` and `npm run dev` rew
29
29
  {{#if assembly.discovery}}
30
30
  Never edit `<context>.dependencies.ts`: `generate`, `docs` and `npm run dev` rewrite it from the constructor signatures (it registers what each constructor is injected). After changing a constructor by hand, `npx ddd-ts-kit docs`.
31
31
  {{/if}}
32
- Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it, the forms of `openapi/forms/`), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run docs:generate`, `npx ddd-ts-kit docs` and `npx ddd-ts-kit depcruise-config --write`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
32
+ Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it, the forms of `openapi/forms/`), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run regenerate`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
33
33
  {{#if sdk.on}}
34
34
  {{sdk.instruction}}
35
35
  {{/if}}
@@ -320,4 +320,5 @@ for each moment of the project: https://github.com/gbourgeat/ddd-ts-kit/blob/mai
320
320
  | `npm run test:e2e` | the whole application through HTTP, on an in-process database unless `DATABASE_URL` is set |
321
321
  | `npm run check:arch` | `ddd-ts-kit check` |
322
322
  | `npm run docs:generate` | context map, OpenAPI, AsyncAPI and event catalog{{#if sdk.on}}, the clients under `clients/`{{/if}} |
323
+ | `npm run regenerate` | every derived file after a change: `.dependency-cruiser.cjs`, then `docs:generate` |
323
324
  | `npm run verify` | everything CI runs |
@@ -10,12 +10,12 @@ paths:
10
10
  - Events leave with the save: never `pullEvents()`, never a `DomainEventDispatcher` here (`domain-events/dispatched-on-save`). A reaction is a class of `event-handlers/` or a publisher of `integration/publishers/`. It runs at the end of the unit of work, before the commit, and depends only on what the transaction covers (`domain-events/transactional-before-commit`): repositories, the integration event publisher, the command bus. An effect outside the database is a handler of the `after-commit` phase (`generate event-handler ... --phase after-commit`: at most once, never saves, sends a command) or, when it must not be lost, the handler of an integration event.
11
11
  - Nothing here reads the event store: an event-sourced aggregate is loaded and saved through its repository port like any other (`event-sourcing/store-behind-repository`). A projection writes its read model and never a stream (`event-sourcing/projection-never-appends`); one fed by the store is declared `@Projection(name, { feed: 'event-store' })`.
12
12
  {{#if style.declared}}
13
- - Every command and query carries `@Requires(permission)` or `@Public()` (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `authorization/<context>.permissions.ts`, rules that need loaded state in `authorization/*.policy.ts`.
13
+ - Every command and query carries `@Requires(permission)` or `@Public()` (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `authorization/<context>.permissions.ts`, rules that need loaded state in `authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
14
14
  - The decorator is the registration (`declarations/role-declared`): `@CommandHandler(Message)`, `@QueryHandler(Message)`, `@DomainEventHandler(Event)` (the name is the static `eventName` of the event class), `@IntegrationEventHandler(definition, { consumer })`, `@Scheduled('<context>.<job>', schedule)`, `@Background(options)` (the name is the static `jobName`), `@Projection('<context>.<name>')`, `@Policy(permission, { name })`. Names are string literals.
15
15
  - The constructor is the one statement of what a class depends on (`declarations/constructor-injection`): each parameter is typed by one port class, with no `?`, default value, rest or destructuring, and no list repeats it in the decorator. To add a dependency, add the parameter: `npx ddd-ts-kit docs` reads the signature into the generated file of the context (`npm run dev` does it on every change), never edit that file.
16
16
  {{/if}}
17
17
  {{#if style.explicit}}
18
- - Every command and query is registered in `<context>.module.ts` with the permission it requires, or as public (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `authorization/<context>.permissions.ts`, rules that need loaded state in `authorization/*.policy.ts`.
18
+ - Every command and query is registered in `<context>.module.ts` with the permission it requires, or as public (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `authorization/<context>.permissions.ts`, rules that need loaded state in `authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
19
19
  - A class here carries no registration of its own: `<context>.module.ts` binds it and lists what its constructor receives. A job is registered as `@Scheduled('<context>.<job>', schedule)` would say: one name, one schedule, and the command bus as its only dependency.
20
20
  {{/if}}
21
21
  - A port is an abstract class in `ports/<name>.port.ts` and its own injection token (`ports/abstract-class`, `ports/no-token-constant`), named for the need (`PaymentGateway`), with a fake in `test/fakes/`.
@@ -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.19.0",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.21.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",
@@ -39,7 +39,16 @@ export default defineConfig(({ mode }) => ({
39
39
  exclude: [INTEGRATION_SPECS, ...NOT_AFFECTED],
40
40
  },
41
41
  },
42
- { extends: true, test: { name: INTEGRATION_MODE, include: [INTEGRATION_SPECS], exclude: NOT_AFFECTED } },
42
+ {
43
+ extends: true,
44
+ test: {
45
+ name: INTEGRATION_MODE,
46
+ include: [INTEGRATION_SPECS],
47
+ exclude: NOT_AFFECTED,
48
+ // A hook opens the test database (PGlite started and its tables created, or a server reached): under coverage on a busy machine it outlasts the default 10 seconds.
49
+ hookTimeout: 60_000,
50
+ },
51
+ },
43
52
  ],
44
53
  coverage: {
45
54
  provider: 'v8',
@@ -1,4 +0,0 @@
1
- import type { Workspace } from '../../workspace/index.js';
2
- /** The number the next decision record of the project takes: one after the highest in `docs/adr/`. */
3
- export declare function nextAdrNumber(ws: Workspace): string;
4
- //# sourceMappingURL=next-adr-number.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"next-adr-number.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/next-adr-number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,sGAAsG;AACtG,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAInD"}
@@ -1,7 +0,0 @@
1
- import { ADR_DIRECTORY } from '../../check/governance/adr-directory.js';
2
- /** The number the next decision record of the project takes: one after the highest in `docs/adr/`. */
3
- export function nextAdrNumber(ws) {
4
- const taken = ws.list(ADR_DIRECTORY).map((file) => Number(/^(\d+)-/.exec(file)?.[1] ?? '0'));
5
- return String(Math.max(0, ...taken) + 1).padStart(4, '0');
6
- }
7
- //# sourceMappingURL=next-adr-number.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"next-adr-number.js","sourceRoot":"","sources":["../../../src/generate/kinds/next-adr-number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAGxE,sGAAsG;AACtG,MAAM,UAAU,aAAa,CAAC,EAAa;IACzC,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAE7F,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC"}