ddd-ts-kit 0.84.0 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.fr.md +60 -27
  3. package/README.md +57 -28
  4. package/dist/check/canonical/stray-entry.js +3 -2
  5. package/dist/check/canonical/stray-entry.js.map +1 -1
  6. package/dist/check/explain/layout-docs.js +1 -1
  7. package/dist/check/explain/layout-docs.js.map +1 -1
  8. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  9. package/dist/check/explain/tree-docs.js +3 -2
  10. package/dist/check/explain/tree-docs.js.map +1 -1
  11. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  12. package/dist/check/explain/wiring-docs.js +17 -6
  13. package/dist/check/explain/wiring-docs.js.map +1 -1
  14. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  15. package/dist/check/fixtures/authz-policy-fixtures.js +4 -4
  16. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  17. package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -1
  18. package/dist/check/fixtures/constructor-injection-fixtures.js +10 -8
  19. package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
  20. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  21. package/dist/check/fixtures/declarations-fixtures.js +54 -9
  22. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  23. package/dist/check/fixtures/declared-declarations.d.ts +7 -0
  24. package/dist/check/fixtures/declared-declarations.d.ts.map +1 -0
  25. package/dist/check/fixtures/declared-declarations.js +21 -0
  26. package/dist/check/fixtures/declared-declarations.js.map +1 -0
  27. package/dist/check/fixtures/declared-project.d.ts +4 -1
  28. package/dist/check/fixtures/declared-project.d.ts.map +1 -1
  29. package/dist/check/fixtures/declared-project.js +17 -9
  30. package/dist/check/fixtures/declared-project.js.map +1 -1
  31. package/dist/check/fixtures/paths.d.ts +1 -0
  32. package/dist/check/fixtures/paths.d.ts.map +1 -1
  33. package/dist/check/fixtures/paths.js +1 -0
  34. package/dist/check/fixtures/paths.js.map +1 -1
  35. package/dist/check/fixtures/signature-project.d.ts +3 -3
  36. package/dist/check/fixtures/signature-project.js +3 -3
  37. package/dist/check/fixtures/signature.d.ts +2 -1
  38. package/dist/check/fixtures/signature.d.ts.map +1 -1
  39. package/dist/check/fixtures/signature.js +2 -1
  40. package/dist/check/fixtures/signature.js.map +1 -1
  41. package/dist/check/fixtures/single-file-declarations.d.ts +7 -0
  42. package/dist/check/fixtures/single-file-declarations.d.ts.map +1 -0
  43. package/dist/check/fixtures/single-file-declarations.js +21 -0
  44. package/dist/check/fixtures/single-file-declarations.js.map +1 -0
  45. package/dist/check/rules/clean-file-size.d.ts.map +1 -1
  46. package/dist/check/rules/clean-file-size.js +9 -1
  47. package/dist/check/rules/clean-file-size.js.map +1 -1
  48. package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
  49. package/dist/check/rules/declarations-barrel-current.js +56 -23
  50. package/dist/check/rules/declarations-barrel-current.js.map +1 -1
  51. package/dist/check/rules/naming-suffix.d.ts.map +1 -1
  52. package/dist/check/rules/naming-suffix.js +7 -3
  53. package/dist/check/rules/naming-suffix.js.map +1 -1
  54. package/dist/check/support/is-generated-context-file.d.ts +5 -1
  55. package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
  56. package/dist/check/support/is-generated-context-file.js +11 -5
  57. package/dist/check/support/is-generated-context-file.js.map +1 -1
  58. package/dist/commands/docs.d.ts.map +1 -1
  59. package/dist/commands/docs.js +23 -11
  60. package/dist/commands/docs.js.map +1 -1
  61. package/dist/commands/generate.d.ts.map +1 -1
  62. package/dist/commands/generate.js +7 -4
  63. package/dist/commands/generate.js.map +1 -1
  64. package/dist/commands/print-report.js +1 -0
  65. package/dist/commands/print-report.js.map +1 -1
  66. package/dist/commit/is-derived.js +4 -4
  67. package/dist/commit/is-derived.js.map +1 -1
  68. package/dist/declared/barrel-file.d.ts +4 -1
  69. package/dist/declared/barrel-file.d.ts.map +1 -1
  70. package/dist/declared/barrel-file.js +4 -1
  71. package/dist/declared/barrel-file.js.map +1 -1
  72. package/dist/declared/context-declarations.d.ts +24 -0
  73. package/dist/declared/context-declarations.d.ts.map +1 -0
  74. package/dist/declared/context-declarations.js +22 -0
  75. package/dist/declared/context-declarations.js.map +1 -0
  76. package/dist/declared/declarations-folder-of.d.ts +10 -0
  77. package/dist/declared/declarations-folder-of.d.ts.map +1 -0
  78. package/dist/declared/declarations-folder-of.js +13 -0
  79. package/dist/declared/declarations-folder-of.js.map +1 -0
  80. package/dist/declared/folder-declarations-file.d.ts +7 -0
  81. package/dist/declared/folder-declarations-file.d.ts.map +1 -0
  82. package/dist/declared/folder-declarations-file.js +10 -0
  83. package/dist/declared/folder-declarations-file.js.map +1 -0
  84. package/dist/declared/index.d.ts +8 -1
  85. package/dist/declared/index.d.ts.map +1 -1
  86. package/dist/declared/index.js +8 -1
  87. package/dist/declared/index.js.map +1 -1
  88. package/dist/declared/is-declarations-file.d.ts +7 -0
  89. package/dist/declared/is-declarations-file.d.ts.map +1 -0
  90. package/dist/declared/is-declarations-file.js +20 -0
  91. package/dist/declared/is-declarations-file.js.map +1 -0
  92. package/dist/declared/keeps-single-file.d.ts +11 -0
  93. package/dist/declared/keeps-single-file.d.ts.map +1 -0
  94. package/dist/declared/keeps-single-file.js +23 -0
  95. package/dist/declared/keeps-single-file.js.map +1 -0
  96. package/dist/declared/render-declarations.d.ts +18 -0
  97. package/dist/declared/render-declarations.d.ts.map +1 -0
  98. package/dist/declared/render-declarations.js +37 -0
  99. package/dist/declared/render-declarations.js.map +1 -0
  100. package/dist/declared/render-folder-declarations.d.ts +11 -0
  101. package/dist/declared/render-folder-declarations.d.ts.map +1 -0
  102. package/dist/declared/render-folder-declarations.js +23 -0
  103. package/dist/declared/render-folder-declarations.js.map +1 -0
  104. package/dist/declared/single-file-declarations.d.ts +9 -0
  105. package/dist/declared/single-file-declarations.d.ts.map +1 -0
  106. package/dist/declared/single-file-declarations.js +14 -0
  107. package/dist/declared/single-file-declarations.js.map +1 -0
  108. package/dist/declared/single-file-notice.d.ts +8 -0
  109. package/dist/declared/single-file-notice.d.ts.map +1 -0
  110. package/dist/declared/single-file-notice.js +9 -0
  111. package/dist/declared/single-file-notice.js.map +1 -0
  112. package/dist/derived/is-derived.d.ts +4 -3
  113. package/dist/derived/is-derived.d.ts.map +1 -1
  114. package/dist/derived/is-derived.js +8 -8
  115. package/dist/derived/is-derived.js.map +1 -1
  116. package/dist/describe/read-consumed-events.js +7 -2
  117. package/dist/describe/read-consumed-events.js.map +1 -1
  118. package/dist/dev/refresh-declarations.d.ts.map +1 -1
  119. package/dist/dev/refresh-declarations.js +3 -2
  120. package/dist/dev/refresh-declarations.js.map +1 -1
  121. package/dist/docs/write-docs.d.ts +3 -1
  122. package/dist/docs/write-docs.d.ts.map +1 -1
  123. package/dist/docs/write-docs.js +4 -2
  124. package/dist/docs/write-docs.js.map +1 -1
  125. package/dist/generate/context-imports.d.ts.map +1 -1
  126. package/dist/generate/context-imports.js +2 -1
  127. package/dist/generate/context-imports.js.map +1 -1
  128. package/dist/generate/kind.d.ts +2 -0
  129. package/dist/generate/kind.d.ts.map +1 -1
  130. package/dist/generate/kinds/e2e/reaction-of.d.ts +14 -0
  131. package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -0
  132. package/dist/generate/kinds/e2e/reaction-of.js +93 -0
  133. package/dist/generate/kinds/e2e/reaction-of.js.map +1 -0
  134. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  135. package/dist/generate/kinds/e2e-kind.js +30 -18
  136. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  137. package/dist/generate/refresh-barrels.d.ts +11 -4
  138. package/dist/generate/refresh-barrels.d.ts.map +1 -1
  139. package/dist/generate/refresh-barrels.js +41 -15
  140. package/dist/generate/refresh-barrels.js.map +1 -1
  141. package/dist/generate/refuse-shared-writes.js +1 -1
  142. package/dist/generate/refuse-shared-writes.js.map +1 -1
  143. package/dist/help/notes.d.ts +1 -1
  144. package/dist/help/notes.d.ts.map +1 -1
  145. package/dist/help/notes.js +19 -16
  146. package/dist/help/notes.js.map +1 -1
  147. package/dist/init/manifest/versions.js +24 -24
  148. package/dist/merge/classify-conflict.d.ts +2 -1
  149. package/dist/merge/classify-conflict.d.ts.map +1 -1
  150. package/dist/merge/classify-conflict.js +9 -0
  151. package/dist/merge/classify-conflict.js.map +1 -1
  152. package/dist/merge/higher-version.d.ts +7 -0
  153. package/dist/merge/higher-version.d.ts.map +1 -0
  154. package/dist/merge/higher-version.js +59 -0
  155. package/dist/merge/higher-version.js.map +1 -0
  156. package/dist/merge/merge-client-manifest.d.ts +16 -0
  157. package/dist/merge/merge-client-manifest.d.ts.map +1 -0
  158. package/dist/merge/merge-client-manifest.js +39 -0
  159. package/dist/merge/merge-client-manifest.js.map +1 -0
  160. package/dist/merge/merge-exclusions.d.ts +4 -3
  161. package/dist/merge/merge-exclusions.d.ts.map +1 -1
  162. package/dist/merge/merge-exclusions.js +6 -3
  163. package/dist/merge/merge-exclusions.js.map +1 -1
  164. package/dist/merge/resolve-conflict.d.ts +3 -2
  165. package/dist/merge/resolve-conflict.d.ts.map +1 -1
  166. package/dist/merge/resolve-conflict.js +29 -7
  167. package/dist/merge/resolve-conflict.js.map +1 -1
  168. package/dist/plan/batched-waves.d.ts +2 -0
  169. package/dist/plan/batched-waves.d.ts.map +1 -1
  170. package/dist/plan/batched-waves.js +20 -7
  171. package/dist/plan/batched-waves.js.map +1 -1
  172. package/dist/plan/format-plan.d.ts +1 -1
  173. package/dist/plan/format-plan.d.ts.map +1 -1
  174. package/dist/plan/format-plan.js +33 -8
  175. package/dist/plan/format-plan.js.map +1 -1
  176. package/dist/plan/other-stories.d.ts +9 -0
  177. package/dist/plan/other-stories.d.ts.map +1 -0
  178. package/dist/plan/other-stories.js +31 -0
  179. package/dist/plan/other-stories.js.map +1 -0
  180. package/dist/plan/plan-waves.d.ts +2 -1
  181. package/dist/plan/plan-waves.d.ts.map +1 -1
  182. package/dist/plan/plan-waves.js +13 -4
  183. package/dist/plan/plan-waves.js.map +1 -1
  184. package/dist/plan/wave-plan.d.ts +28 -0
  185. package/dist/plan/wave-plan.d.ts.map +1 -1
  186. package/dist/version.d.ts +1 -1
  187. package/dist/version.js +1 -1
  188. package/dist/worker/briefing-of.js +4 -2
  189. package/dist/worker/briefing-of.js.map +1 -1
  190. package/dist/workspace/workspace-report.d.ts +2 -0
  191. package/dist/workspace/workspace-report.d.ts.map +1 -1
  192. package/dist/workspace/workspace.d.ts +8 -0
  193. package/dist/workspace/workspace.d.ts.map +1 -1
  194. package/dist/workspace/workspace.js +24 -3
  195. package/dist/workspace/workspace.js.map +1 -1
  196. package/package.json +2 -2
  197. package/templates/e2e/e2e-reaction.spec.ts.tpl +68 -0
  198. package/templates/init/AGENTS.md.tpl +1 -1
  199. package/templates/init/README.md.tpl +2 -1
  200. package/templates/init/e2e/start-application.database.ts.tpl +22 -2
  201. package/templates/init/e2e/start-application.memory.ts.tpl +22 -2
  202. package/templates/init/platform/events/custom-event-bus.ts.tpl +1 -1
  203. package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
  204. package/templates/init/rules/tests.md.tpl +1 -1
  205. package/templates/pipeline/biome.json.tpl +1 -0
  206. package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -0
  207. package/templates/pipeline/github/workflows/ci.yml.tpl +12 -12
  208. package/templates/pipeline/github/workflows/codeql.yml +1 -1
  209. package/templates/pipeline/github/workflows/copilot-setup-steps.yml +1 -1
  210. package/templates/pipeline/github/workflows/pr-title.yml +1 -1
  211. package/templates/pipeline/package-scripts.json +1 -1
  212. package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -0
  213. package/templates/test-world/world.buses.ts.tpl +1 -1
  214. package/templates/test-world/world.tsyringe.ts.tpl +1 -0
  215. package/dist/check/fixtures/declared-barrel.d.ts +0 -3
  216. package/dist/check/fixtures/declared-barrel.d.ts.map +0 -1
  217. package/dist/check/fixtures/declared-barrel.js +0 -4
  218. package/dist/check/fixtures/declared-barrel.js.map +0 -1
  219. package/dist/declared/render-barrel.d.ts +0 -11
  220. package/dist/declared/render-barrel.d.ts.map +0 -1
  221. package/dist/declared/render-barrel.js +0 -29
  222. package/dist/declared/render-barrel.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"write-docs.js","sourceRoot":"","sources":["../../src/docs/write-docs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAa,EAAE,MAAc;IACrD,MAAM,QAAQ,GAAG,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAE1C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACvC,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,eAAe,CA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OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,eAAe,CAAC,EAAa,EAAE,KAAwB;IAC9D,MAAM,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,IAAI,YAAY,CAAC,yBAAyB,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IAEtG,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,QAAQ,CAChB,GAAG,WAAW,2CAA2C,EACzD,gKAAgK,CACjK,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-imports.d.ts","sourceRoot":"","sources":["../../src/generate/context-imports.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAanD"}
1
+ {"version":3,"file":"context-imports.d.ts","sourceRoot":"","sources":["../../src/generate/context-imports.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAanD"}
@@ -1,4 +1,5 @@
1
1
  import { specifierOf } from '../alias/index.js';
2
+ import { barrelFile } from '../declared/index.js';
2
3
  import { isDeclared } from './is-declared.js';
3
4
  /** The import a test file assembles the context from: its module file, its barrel, or discovery. */
4
5
  export function contextImports(scope) {
@@ -10,6 +11,6 @@ export function contextImports(scope) {
10
11
  if (config.stack.assembly === 'discovery') {
11
12
  return "import { discoverContext } from '@ddd-ts-kit/di/discovery';";
12
13
  }
13
- return `import * as ${context.camel}Declarations from '${inContext(`${context.kebab}.declarations.ts`)}';`;
14
+ return `import * as ${context.camel}Declarations from '${inContext(barrelFile(context.kebab))}';`;
14
15
  }
15
16
  //# sourceMappingURL=context-imports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-imports.js","sourceRoot":"","sources":["../../src/generate/context-imports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,oGAAoG;AACpG,MAAM,UAAU,cAAc,CAAC,KAAY;IACzC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;IAElH,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,OAAO,YAAY,OAAO,CAAC,KAAK,kBAAkB,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;IAChG,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC1C,OAAO,6DAA6D,CAAC;IACvE,CAAC;IAED,OAAO,eAAe,OAAO,CAAC,KAAK,sBAAsB,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7G,CAAC"}
1
+ {"version":3,"file":"context-imports.js","sourceRoot":"","sources":["../../src/generate/context-imports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,oGAAoG;AACpG,MAAM,UAAU,cAAc,CAAC,KAAY;IACzC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;IAElH,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,OAAO,YAAY,OAAO,CAAC,KAAK,kBAAkB,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC;IAChG,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC1C,OAAO,6DAA6D,CAAC;IACvE,CAAC;IAED,OAAO,eAAe,OAAO,CAAC,KAAK,sBAAsB,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AACpG,CAAC"}
@@ -49,6 +49,8 @@ export interface KindFlags {
49
49
  readonly name?: string;
50
50
  /** When a domain event handler runs: `before-commit`, the default, or `after-commit`. */
51
51
  readonly phase?: string;
52
+ /** The integration event an end-to-end spec publishes to start its use case, as `<context>.<aggregate>.<fact>`. */
53
+ readonly event?: string;
52
54
  /** The route group of a controller, or the parent of a group, by its name. */
53
55
  readonly group?: string;
54
56
  /** The path prefix of a route group. */
@@ -1 +1 @@
1
- {"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/generate/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,SAAS;IAC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QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,8KAA8K;IAC9K,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,+GAA+G;IAC/G,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC"}
@@ -0,0 +1,14 @@
1
+ import { type Name } from '../../../naming/index.js';
2
+ import type { RenderContext } from '../../../templating/index.js';
3
+ import type { Scope } from '../../scope.js';
4
+ /** What an end-to-end spec publishes to start a use case no route reaches, and where a client reads what followed. */
5
+ export interface Reaction {
6
+ readonly upstream: RenderContext;
7
+ readonly e2e: RenderContext;
8
+ }
9
+ /**
10
+ * The integration event whose handler sends the command of the use case: the one named with
11
+ * `--event`, or the only one a handler of the context sends that command for.
12
+ */
13
+ export declare function reactionOf(scope: Scope, name: Name, routeFile: string): Reaction;
14
+ //# sourceMappingURL=reaction-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction-of.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/e2e/reaction-of.ts"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,sHAAsH;AACtH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,CAehF"}
@@ -0,0 +1,93 @@
1
+ import { CliError } from '../../../cli-error.js';
2
+ import { readConsumedEvents } from '../../../describe/read-consumed-events.js';
3
+ import { readEventDefinitions } from '../../../describe/read-event-definitions.js';
4
+ import { readRoutes } from '../../../describe/read-routes.js';
5
+ import { toName } from '../../../naming/index.js';
6
+ /**
7
+ * The integration event whose handler sends the command of the use case: the one named with
8
+ * `--event`, or the only one a handler of the context sends that command for.
9
+ */
10
+ export function reactionOf(scope, name, routeFile) {
11
+ const sources = sourcesOf(scope);
12
+ const consumed = readConsumedEvents(sources);
13
+ const useCase = { scope, name, consumed };
14
+ const asked = scope.flags.event;
15
+ const event = asked === undefined ? sentFor(useCase, routeFile) : handledOf(useCase, asked);
16
+ const reads = readRoutes(sources, [])
17
+ .filter((route) => route.method === 'GET')
18
+ .map((route) => `GET ${route.path}`);
19
+ return {
20
+ upstream: upstreamVars(scope, event),
21
+ e2e: { reads: reads.join(', '), readable: reads.length > 0, handlers: handlersOf(consumed, event.type) },
22
+ };
23
+ }
24
+ function sourcesOf(scope) {
25
+ const { ws, config, context, dir } = scope;
26
+ return {
27
+ ws,
28
+ config,
29
+ name: context.kebab,
30
+ directory: dir,
31
+ module: ws.read(`${dir}/${context.kebab}.module.ts`) ?? '',
32
+ };
33
+ }
34
+ /** The event of the handlers that send the command of the use case, when they all handle the same one. */
35
+ function sentFor(useCase, routeFile) {
36
+ const { scope, name, consumed } = useCase;
37
+ const command = new RegExp(String.raw `\b${name.pascal}Command\b`);
38
+ const senders = consumed.filter((fact) => command.test(scope.ws.read(fact.file) ?? ''));
39
+ const types = [...new Set(senders.map((fact) => fact.type))];
40
+ const [sender] = senders;
41
+ if (sender === undefined) {
42
+ throw noTrigger(useCase, routeFile);
43
+ }
44
+ if (types.length > 1) {
45
+ throw new CliError(`Several integration event handlers of "${scope.context.kebab}" send ${name.pascal}Command: ${senders.map((fact) => `${fact.handler} (${fact.type})`).join(', ')}.`, `Name the event the spec publishes: \`ddd-ts-kit generate e2e ${scope.context.kebab} ${name.pascal} --event <eventType>\`, one of ${types.join(', ')}.`);
46
+ }
47
+ return sender;
48
+ }
49
+ function noTrigger({ scope, name, consumed }, routeFile) {
50
+ const handled = consumed.length === 0 ? '' : ` (handled here: ${typesOf(consumed).join(', ')})`;
51
+ return new CliError(`The use case ${name.pascal} has no route in "${scope.context.kebab}" (${routeFile}), and no integration event handler of it sends ${name.pascal}Command.`, `An end-to-end spec drives the application through HTTP, or through the integration event that starts the use case: create the route first with \`ddd-ts-kit generate route ${scope.context.kebab} ${name.pascal} --method <M> --path <path>\`, or name the event its handler receives with --event <context>.<aggregate>.<fact>${handled}.`);
52
+ }
53
+ /** The event named with `--event`: a handler of the context receives it, and the command it starts exists. */
54
+ function handledOf({ scope, name, consumed }, asked) {
55
+ const command = `${scope.dir}/application/commands/${name.kebab}/${name.kebab}.command.ts`;
56
+ if (!scope.ws.exists(command)) {
57
+ throw new CliError(`The use case ${name.pascal} has no command in "${scope.context.kebab}" (${command}).`, `An integration event handler starts a command of its context: create it first with \`ddd-ts-kit generate command ${scope.context.kebab} ${name.pascal} --permission <aggregate>.<action>\`.`);
58
+ }
59
+ const handled = consumed.find((fact) => fact.type === asked);
60
+ if (handled !== undefined) {
61
+ return handled;
62
+ }
63
+ const [upstream = '<upstreamContext>'] = asked.split('.');
64
+ const create = `\`ddd-ts-kit generate integration-handler ${scope.context.kebab} ${upstream} ${asked}\``;
65
+ throw new CliError(`No integration event handler of "${scope.context.kebab}" receives ${asked}.`, consumed.length === 0
66
+ ? `Create the handler first with ${create}.`
67
+ : `Pass --event with one of the events it handles, ${typesOf(consumed).join(', ')}, or create the handler first with ${create}.`);
68
+ }
69
+ function typesOf(consumed) {
70
+ return [...new Set(consumed.map((fact) => fact.type))];
71
+ }
72
+ function handlersOf(consumed, type) {
73
+ return consumed
74
+ .filter((fact) => fact.type === type)
75
+ .map((fact) => fact.handler)
76
+ .join(', ');
77
+ }
78
+ /** The declaration the handler is given, when its upstream has one here: the spec builds the event from it. */
79
+ function upstreamVars(scope, event) {
80
+ const declared = readEventDefinitions(scope.ws, `${scope.config.contextsDir}/${event.from}`).find((definition) => definition.type === event.type && definition.version === event.version);
81
+ const [, aggregate = ''] = event.type.split('.');
82
+ return {
83
+ ...toName(event.from),
84
+ eventName: event.type,
85
+ known: declared !== undefined,
86
+ definition: declared?.name ?? '',
87
+ version: event.version ?? 1,
88
+ // The one field a generated declaration starts with.
89
+ payloadKey: `${toName(aggregate).camel}Id`,
90
+ payloadSample: `${aggregate}-1`,
91
+ };
92
+ }
93
+ //# sourceMappingURL=reaction-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction-of.js","sourceRoot":"","sources":["../../../../src/generate/kinds/e2e/reaction-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAa,MAAM,0BAA0B,CAAC;AAU7D;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAY,EAAE,IAAU,EAAE,SAAiB;IACpE,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;IAChC,MAAM,KAAK,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAE5F,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;SAClC,MAAM,CA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QAC1C,aAAa,EAAE,GAAG,SAAS,IAAI;KAChC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"e2e-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/e2e-kind.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQvC,eAAO,MAAM,OAAO,EAAE,IA0BrB,CAAC"}
1
+ {"version":3,"file":"e2e-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/e2e-kind.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AASvC,eAAO,MAAM,OAAO,EAAE,IAsCrB,CAAC"}
@@ -1,4 +1,3 @@
1
- import { CliError } from '../../cli-error.js';
2
1
  import { readControllers } from '../../describe/read-controllers.js';
3
2
  import { fitStatement } from '../../layout/index.js';
4
3
  import { toName } from '../../naming/index.js';
@@ -7,39 +6,55 @@ import { label } from '../label.js';
7
6
  import { named } from '../named.js';
8
7
  import { openScope } from '../open-scope.js';
9
8
  import { vars } from '../vars.js';
9
+ import { reactionOf } from './e2e/reaction-of.js';
10
10
  import { tracedCommand } from './traced-command.js';
11
11
  export const e2eKind = {
12
12
  name: 'e2e',
13
13
  aliases: [],
14
- usage: 'e2e <context> <UseCaseName>',
15
- summary: 'An end-to-end spec driving the route of a use case on the whole application, in test/e2e/ at the project root.',
14
+ usage: 'e2e <context> <UseCaseName> [--event <eventType>]',
15
+ summary: 'An end-to-end spec on the whole application, in test/e2e/ at the project root: driving the route of a use case, or, for a use case no route reaches, publishing the integration event its handler receives (--event names it when several do).',
16
16
  positionals: ['context', 'UseCaseName'],
17
17
  writesShared: false,
18
18
  run: (request) => {
19
19
  const scope = openScope(request);
20
20
  const name = label(scope, request.args[1] ?? '', { what: 'use case', strip: ['route', 'controller', 'handler'] });
21
- const endpoint = endpointOf(scope, name);
22
- const traced = tracedCommand(scope, name);
23
- const command = `{ name: 'command ${name.pascal}Command'${traced.saved} }`;
24
- const tree = spanTree(`${endpoint.method} ${endpoint.path}`, command);
25
- const context = vars(scope, { name: named(name), e2e: { ...endpoint, ...traced, tree } });
26
- scope.ws.create(`test/e2e/${name.kebab}.e2e.spec.ts`, renderTemplate('e2e/e2e.spec.ts.tpl', context));
27
- if (!scope.ws.exists('test/e2e/support/start-application.ts')) {
28
- scope.ws.note('test/e2e/support/start-application.ts is missing: `ddd-ts-kit init` creates it (existing files are kept).');
21
+ const file = `${scope.dir}/presentation/http/${name.kebab}.route.ts`;
22
+ const endpoint = scope.flags.event === undefined ? endpointOf(scope, name, file) : undefined;
23
+ const spec = `test/e2e/${name.kebab}.e2e.spec.ts`;
24
+ if (endpoint === undefined) {
25
+ const reaction = reactionOf(scope, name, file);
26
+ scope.ws.create(spec, renderTemplate('e2e/e2e-reaction.spec.ts.tpl', vars(scope, { name: named(name), ...reaction })));
29
27
  }
28
+ else {
29
+ const traced = tracedCommand(scope, name);
30
+ const command = `{ name: 'command ${name.pascal}Command'${traced.saved} }`;
31
+ const tree = spanTree(`${endpoint.method} ${endpoint.path}`, command);
32
+ scope.ws.create(spec, renderTemplate('e2e/e2e.spec.ts.tpl', vars(scope, { name: named(name), e2e: { ...endpoint, ...traced, tree } })));
33
+ }
34
+ noteSupport(scope, endpoint === undefined);
30
35
  },
31
36
  };
37
+ const SUPPORT = 'test/e2e/support/start-application.ts';
38
+ /** What the spec needs of the support of the project: `init` writes it, older projects add `publish` by hand. */
39
+ function noteSupport(scope, publishes) {
40
+ const support = scope.ws.read(SUPPORT);
41
+ if (support === undefined) {
42
+ scope.ws.note(`${SUPPORT} is missing: \`ddd-ts-kit init\` creates it (existing files are kept).`);
43
+ }
44
+ else if (publishes && !/^\s*publish\(/m.test(support)) {
45
+ scope.ws.note(`${SUPPORT} has no publish(events): add \`publish(events: readonly IntegrationEvent[]): Promise<void>;\` to RunningApplication and implement it with \`(events) => application.eventBus.publish(events)\` on the composed application, as a new project has it.`);
46
+ }
47
+ }
32
48
  /** The spans a request leaves, as the spec expects them, laid out for the six spaces the element is written after. */
33
49
  function spanTree(request, command) {
34
50
  const element = `{ name: '${request}', kind: 'SERVER', children: [${command}] },`;
35
51
  return fitStatement(element, ' ').join('\n').trimStart();
36
52
  }
37
- /** What the route of the use case declares: an end-to-end spec drives the application through it. */
38
- function endpointOf(scope, name) {
39
- const file = `${scope.dir}/presentation/http/${name.kebab}.route.ts`;
53
+ /** What the route of the use case declares, when it has one: an end-to-end spec drives the application through it. */
54
+ function endpointOf(scope, name, file) {
40
55
  const { method, path, status, isProtected } = functionRoute(scope.ws.read(file) ?? '') ?? controllerOf(scope, name) ?? {};
41
56
  if (method === undefined || path === undefined || status === undefined) {
42
- throw noRoute(scope, name, file);
57
+ return undefined;
43
58
  }
44
59
  return {
45
60
  method,
@@ -75,7 +90,4 @@ function controllerOf(scope, name) {
75
90
  isProtected: !route.guards.includes('Public'),
76
91
  };
77
92
  }
78
- function noRoute(scope, name, file) {
79
- return new CliError(`The use case ${name.pascal} has no route in "${scope.context.kebab}" (${file}).`, `An end-to-end spec drives the application through HTTP: create the route first with \`ddd-ts-kit generate route ${scope.context.kebab} ${name.pascal} --method <M> --path <path>\`.`);
80
- }
81
93
  //# sourceMappingURL=e2e-kind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"e2e-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/e2e-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAa,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,a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S,EAAE,CAAC;QACvE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACjG,CAAC;AAED,iHAAiH;AACjH,SAAS,YAAY,CAAC,KAAY,EAAE,IAAU;IAC5C,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,OAAO,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAChF,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC;IAC7G,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAE1C,IAAI,KAAK,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC9C,CAAC;AACJ,CAAC"}
@@ -1,10 +1,17 @@
1
1
  import type { Config } from '../config/index.js';
2
2
  import type { Workspace } from '../workspace/index.js';
3
3
  /**
4
- * Rewrites the generated file of every declared context from its tree: the barrel, which also
5
- * registers what each constructor receives, or under discovery `<context>.dependencies.ts`,
6
- * which holds that alone. Called at the end of every `generate` and by `docs`: these files are
4
+ * Rewrites the generated files of every declared context from its tree: with a barrel, the
5
+ * declarations of each role folder, which export its role files and register what each
6
+ * constructor receives, and the summary at the root of the context, deleting the declarations of
7
+ * a folder that holds no role file any more; under discovery `<context>.dependencies.ts`, which
8
+ * registers the lists alone. Called at the end of every `generate` and by `docs`: these files are
7
9
  * derived, like the documentation, and `declarations/barrel-current` reports one left behind.
10
+ * A context still declared in the single file of 0.84 (`keepsSingleFile`) is moved to the files
11
+ * of its role folders, unless `singleFile` is `keep`: `docs --check` and `generate --local-only`
12
+ * write nothing outside what they are asked, and say it instead. Answers the contexts kept so.
8
13
  */
9
- export declare function refreshBarrels(ws: Workspace, config: Config): void;
14
+ export declare function refreshBarrels(ws: Workspace, config: Config, singleFile?: SingleFile): string[];
15
+ /** What a refresh does with a context still declared in the single file of 0.84: move it, or keep it as it is. */
16
+ export type SingleFile = 'move' | 'keep';
10
17
  //# sourceMappingURL=refresh-barrels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"refresh-barrels.d.ts","sourceRoot":"","sources":["../../src/generate/refresh-barrels.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAWjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAYlE"}
1
+ {"version":3,"file":"refresh-barrels.d.ts","sourceRoot":"","sources":["../../src/generate/refresh-barrels.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAejD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,UAAmB,GAAG,MAAM,EAAE,CAkBvG;AAED,kHAAkH;AAClH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC"}
@@ -1,38 +1,64 @@
1
1
  import { specifierOf } from '../alias/index.js';
2
- import { barrelFile, contextInjections, dependenciesFile, renderBarrel, renderDependenciesFile, renderInjections, } from '../declared/index.js';
2
+ import { barrelFile, contextDeclarations, contextInjections, dependenciesFile, isDeclarationsFile, keepsSingleFile, renderDependenciesFile, renderInjections, singleFileNotice, } from '../declared/index.js';
3
3
  import { filesUnder } from './files-under.js';
4
4
  import { isDeclared } from './is-declared.js';
5
5
  import { workspaceSources } from './workspace-sources.js';
6
6
  /**
7
- * Rewrites the generated file of every declared context from its tree: the barrel, which also
8
- * registers what each constructor receives, or under discovery `<context>.dependencies.ts`,
9
- * which holds that alone. Called at the end of every `generate` and by `docs`: these files are
7
+ * Rewrites the generated files of every declared context from its tree: with a barrel, the
8
+ * declarations of each role folder, which export its role files and register what each
9
+ * constructor receives, and the summary at the root of the context, deleting the declarations of
10
+ * a folder that holds no role file any more; under discovery `<context>.dependencies.ts`, which
11
+ * registers the lists alone. Called at the end of every `generate` and by `docs`: these files are
10
12
  * derived, like the documentation, and `declarations/barrel-current` reports one left behind.
13
+ * A context still declared in the single file of 0.84 (`keepsSingleFile`) is moved to the files
14
+ * of its role folders, unless `singleFile` is `keep`: `docs --check` and `generate --local-only`
15
+ * write nothing outside what they are asked, and say it instead. Answers the contexts kept so.
11
16
  */
12
- export function refreshBarrels(ws, config) {
17
+ export function refreshBarrels(ws, config, singleFile = 'move') {
13
18
  if (!isDeclared(config)) {
14
- return;
19
+ return [];
15
20
  }
16
21
  const sources = workspaceSources(ws, config);
22
+ const kept = [];
17
23
  for (const context of ws.directories(config.contextsDir)) {
18
- if (config.contexts[context] !== undefined) {
19
- refreshContext(ws, { config, sources, context });
24
+ if (config.contexts[context] !== undefined &&
25
+ refreshContext(ws, { config, sources, context, singleFile }) === 'kept') {
26
+ kept.push(context);
20
27
  }
21
28
  }
29
+ return kept;
22
30
  }
23
- function refreshContext(ws, { config, sources, context }) {
31
+ function refreshContext(ws, { config, sources, context, singleFile }) {
24
32
  const directory = `${config.contextsDir}/${context}`;
25
33
  const entries = filesUnder(ws, directory);
26
- const injections = contextInjections(sources, directory, entries);
27
- const injected = renderInjections(injections, (file) => specifierOf(config, file));
28
- noteUnread(ws, injections);
34
+ const specifierOfFile = (file) => specifierOf(config, file);
29
35
  if (config.stack.assembly === 'barrel') {
30
- const barrel = renderBarrel(entries, (entry) => specifierOf(config, `${directory}/${entry}`), injected);
31
- write(ws, `${directory}/${barrelFile(context)}`, barrel);
36
+ return refreshDeclarations(ws, { context, directory, entries, sources, specifierOf: specifierOfFile }, singleFile);
32
37
  }
33
- else if (injected.calls.length > 0 || ws.exists(`${directory}/${dependenciesFile(context)}`)) {
38
+ const injections = contextInjections(sources, directory, entries);
39
+ const injected = renderInjections(injections, specifierOfFile);
40
+ noteUnread(ws, injections);
41
+ if (injected.calls.length > 0 || ws.exists(`${directory}/${dependenciesFile(context)}`)) {
34
42
  write(ws, `${directory}/${dependenciesFile(context)}`, renderDependenciesFile(injected));
35
43
  }
44
+ return 'refreshed';
45
+ }
46
+ /** The declarations of each role folder and their summary, the ones of an emptied folder deleted. */
47
+ function refreshDeclarations(ws, declared, singleFile) {
48
+ const { context, directory, entries } = declared;
49
+ if (singleFile === 'keep' && keepsSingleFile(declared, ws.read(`${directory}/${barrelFile(context)}`))) {
50
+ const { message, fix } = singleFileNotice(context);
51
+ ws.note(`${message} ${fix}`);
52
+ return 'kept';
53
+ }
54
+ const { files, injections } = contextDeclarations(declared);
55
+ noteUnread(ws, injections);
56
+ files.forEach((content, file) => write(ws, `${directory}/${file}`, content));
57
+ // The declarations of a folder that holds no role file any more: nothing derives them now.
58
+ entries
59
+ .filter((entry) => isDeclarationsFile(context, entry) && !files.has(entry))
60
+ .forEach((entry) => ws.delete(`${directory}/${entry}`));
61
+ return 'refreshed';
36
62
  }
37
63
  /** A class whose constructor cannot be read is given no list: said here, reported by `check`, refused at startup. */
38
64
  function noteUnread(ws, injections) {
@@ -1 +1 @@
1
- {"version":3,"file":"refresh-barrels.js","sourceRoot":"","sources":["../../src/generate/refresh-barrels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,EAAa,EAAE,MAAc;IAC1D,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAE7C,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACzD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3C,cAAc,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;AACH,CAAC;AAQD,SAAS,cAAc,CAAC,EAAa,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAa;IAC5E,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,E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EAAE,CAAC,CAAC,CAAC;IAE1D,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,qHAAqH;AACrH,SAAS,UAAU,CAAC,EAAa,EAAE,UAAqC;IACtE,KAAK,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,UAAU,EAAE,CAAC;QAC/D,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAEvD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,EAAE,CAAC,IAAI,CAAC,GAAG,SAAS,KAAK,IAAI,uCAAuC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACxG,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAa,EAAE,IAAY,EAAE,OAAe;IACzD,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -7,7 +7,7 @@ const E2E_SPEC = /^test\/e2e\/[^/]+\.e2e\.spec\.ts$/;
7
7
  export function refuseSharedWrites(ws, config, context) {
8
8
  const plan = ws.commit(true);
9
9
  const local = (file) => E2E_SPEC.test(file) || (context !== undefined && file.startsWith(`${config.contextsDir}/${context}/`));
10
- const shared = [...plan.created, ...plan.updated].filter((file) => !local(file)).sort();
10
+ const shared = [...plan.created, ...plan.updated, ...plan.deleted].filter((file) => !local(file)).sort();
11
11
  if (shared.length === 0) {
12
12
  return;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"refuse-shared-writes.js","sourceRoot":"","sources":["../../src/generate/refuse-shared-writes.ts"],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F,MAAM,IAAI,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7B,MAAM,KAAK,GAAG,CAAC,IAAY,EAAW,EAAE,CACtC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC;IAEzG,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAEzG,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,0CAA0C,MAAM,CAAC,MAAM,eAAe,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAC7H,6OAA6O,CAC9O,CAAC;AACJ,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /** What a line of the usage cannot say about a command or a flag. */
2
- export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base;\n --run <script> runs that script of the project on them (DDD_TS_KIT_AFFECTED set,\n --passWithNoTests on a partial run) and nothing when nothing that runs changed:\n the pre-push hook tests the contexts its branch reaches\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0; then formats the snapshot and the\n journal it wrote with the Biome or Prettier of the format script, and warns when the\n SQL changes a primary key in an order that fails on PostgreSQL (exit code unchanged);\n --replay, after merging the trunk into a branch when both added migrations: when the\n history forks from --base <ref> (origin/main by default), deletes the migrations of the\n branch the base does not have, with their snapshots and journal entries, then generates\n each again on top, in order, under its name (working- dropped outside a worker's\n worktree, a custom one keeping its SQL); when it does not fork, only renames them;\n refused while the journal holds conflict markers, when two of them change the schema,\n or when drizzle-kit now writes a generated one otherwise (edited by hand), the folder\n then put back as it was\n error-factories moves the refusals of a project to one class per refusal (--to named, the default), from\n one class per error or from the factories of one error class per concept: --plan writes\n error-factories.plan.json, where each refusal is given a class (the PascalCase of its\n code, which it keeps) and a factory (for<Concept>), both editable; --apply follows it\n (codes.ts per context, one class file per refusal, specs, every usage, the concept\n classes left empty, \"stack.refusals\" in the config) and lists what it cannot rewrite\n (a bare <Concept>Error.is(error), CodeOf<typeof <Concept>Error>); --to factories moves\n one class per error to static factories on one error class per concept instead\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n platform-folders takes the files of the platform a project generated flat to their folders:\n composition/, observability/ (tracing.ts first), jobs/, auth/authentication/ (who is\n calling), auth/authorization/ (what they may do, whatever the model), the folder of\n the model (auth/roles/, attributes/, relationships/, custom/) and\n audit/search-audit-entries/; every import of them under the source root, test/ and\n scripts/ follows, and the scripts of package.json; a file the kit did not write at\n the root of the platform or of auth/ stays where it is, named, unless --place\n <file>=<folder> (both from the platform) gives it its folder; the generators and\n init --force keep either layout until then\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise, and the git hooks (the lefthook: line of lefthook.yml, the pre-commit hook of\n lefthook in this clone); init adds what is missing, hooks:install the hook; then what\n this checkout lacks to run the project, read without network: the running Node against\n engines.node and .nvmrc, node_modules installed since the lockfile last changed, each\n package of the kit installed at the version of this CLI, the submodules initialised;\n each with its fix; --strict exits 1 while something is missing or the checkout cannot\n run the project, never for a hook this clone has not installed, a Node .nvmrc does not\n name or a lockfile changed since the install\n lint the ESLint of the project (lint and ci:lint run it): fails on an error, and on a warning\n as on an error, but on one of a rule of the kit in transition, a new rule that becomes an\n error in the version it names, whose warnings are listed apart; --format and --fix as ESLint\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, each row not done ready on the trunk (its dependencies done), ready\n on a branch (the others briefed to a worker with commits ahead of its base) or waiting\n (with the ids it waits for), a row that landed with a worker's branch but is not marked done,\n and the TODO(domain), TODO(platform), it.todo and TODO(review) left in each context, and\n each story or milestone whose rows are all done while markers of its own keep it open (see\n story-check, whose git blame it runs on those markers only); --workers shows instead each\n worktree holding .ddd-ts-kit/worker.json (branch, context, rows, base, commits ahead and\n files changed counted from where its branch landed on the base when it was squash-merged\n there (else from the merge base), commits behind, the commit it landed as, what merge-trunk\n would leave conflicted now, dependencies not installed, its report), a state line (rows\n committed, the row under way, files uncommitted, markers, last verify-slice, and the\n worker-scope --resume command of a stopped one), then the contexts and the files more than\n one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n plan-waves the rows of slices.md not done, of the project or of one context, in waves (wave 1: every\n dependency done; wave n: the others in earlier waves), each wave cut into batches of one\n owner, one or two rows on one aggregate, with the worker-scope command that briefs each,\n the batches of a wave likely to touch the same files (same aggregate in Start with, or\n unknown when it names none), the merge order and what runs before each merge (merge-trunk\n --to-land); a cycle, a dependency on an unknown id or a row without owner is reported\n alone, and exits 1\n story-check whether a story or a milestone can close, <code> being the start of the ids of its rows\n (M1 for M1.01, M1.02: the id without its last .<number>): every row of it done in\n slices.md (the others listed with their status), and no marker of its own left\n (TODO(domain), TODO(platform), it.todo, TODO(review)). A marker is attributed to\n rows: those its text names (#M1.03 or M1.03, word-bounded), else those of the commit\n that wrote its line (git blame, once per file; its Slice: trailer, else the row ids\n its message names), else, not committed, those of .ddd-ts-kit/worker.json in a\n worker's worktree. It is the story's own when it belongs to one of its rows,\n wherever it is; a marker of a context of its rows that belongs to no row is its own\n when no other open story has a row in that context, and is listed without blocking\n otherwise (settle it or name its row in it); a marker of other stories' rows does not\n block. --strict: every marker of its contexts blocks. Each blocker comes with why it\n is its own, its file:line and its fix: handle it, or dismiss it by a decision record\n (generate adr), then delete the marker. Reads only: exits 0 when it can close, 1\n listing what keeps it open, 2 on a code no row carries or without slices.md\n acceptance the acceptance scenarios of each story (test/acceptance/<story>.acceptance.spec.ts) against\n its rows in slices.md and the criteria of docs/architecture/stories/<story>.md: the rows and\n criteria each scenario names (#US5.02 AC1 in its title), the scenarios left to write\n (it.todo), those wrapped in pending(...) of @ddd-ts-kit/testing/e2e until their code is\n built, and what is inconsistent (no row, an unknown row or criterion, a scenario skipped,\n a pending one whose rows are done, a locked one changed while its criteria were not);\n --gate written: every slice row and criterion has a written scenario, none is left to\n write, the acceptance is locked (before the code of the story); --gate passing: none is\n pending either (before the story closes); exits 1 while a gate is not met, or, without\n one, on an inconsistency. Never runs a test. --lock writes\n test/acceptance/<story>.acceptance.lock.json, the fingerprint of each criterion and of\n each scenario (pending(...), layout and comments aside), refused while a scenario is\n left to write, or while a criterion changed, or a locked scenario changed while its\n criteria did not, without a verdict \"amend\" of the acceptance-judge agent on that very\n version (test/acceptance/verdicts/*.md, lines Story:, Subject:, Fingerprint:,\n Verdict:, Reason:); a refusal wins; the verdicts become amendments of the lock,\n listed for the owner to validate\n worker-scope a git worktree on the branch build/<context> (by default .worktrees/<context>, see worktree),\n cut from --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules, the documents of their design and\n the names that design cites the base does not have (see cited), and by default the first\n batch plan-waves cuts for the context (one or two rows on one aggregate), a note naming the\n next; a worktree it creates gets the clean install of the package manager (npm ci), its\n time in the notes, unless --no-install; an existing worktree or branch that does not\n contain the base is refused, with the merge-trunk that brings it in\n --here worker-scope in the worktree of a story (.ddd-ts-kit/story.json): writes the scope of the\n next agent in place, its base the base of the story, and prints its briefing; no\n worktree, branch or install of its own; the agents of a story run one after the other\n story-scope the worktree of one story, .worktrees/<story> on story/<story> cut from --base (by default\n origin/main from the trunk, else the current branch, refused from the worktree of a\n story), its .ddd-ts-kit/story.json and\n its clean install; an existing one is kept and the story resumes there; refused when the\n story is open in another worktree; names the other open stories and the contexts their\n rows change\n worktree the worktree of any other piece of work, .worktrees/<name> on work/<name> cut from --base\n (by default origin/main from the trunk, else the current branch), and its clean install\n unless --no-install; an existing one is kept; .worktrees/ lies in the main checkout,\n whichever worktree it runs from, ignored by git and by the tools of the project; while\n the .gitignore of a project started before does not hold it (init adds it), a worktree\n opens next to the project, ../<project>-<name>; in a project whose config says\n \"worktrees\": \"required\" (what init writes), the guard of the plugin refuses the code of\n a context in the main checkout of the trunk, and in a worktree of .worktrees/ without\n its own node_modules\n story where a story stands, phase by phase: its specification and criteria\n (docs/architecture/stories/<story>.md), its rows in slices.md, a design review section\n per row not done (docs/architecture/reviews/<story>.md, ## #<id>), its acceptance written\n and locked, its rows done, its acceptance passing, its trunk merged in, its ## Report; and\n the next step; in the worktree of a story, the story is its own; --gate build exits 1\n until the first four are met (the code may start: the guard of the plugin opens the\n contexts), --gate close until all are\n stories the stories open in the worktrees of the repository and where two of them meet: the\n contexts the rows of both name, the files both worktrees change (committed or not), what\n merging the branch of one into the other leaves to a person and what merge-trunk settles\n (git merge-tree, nothing written); how far each is behind its base; from the worktree of a\n story, the stories it meets; the guard of the plugin says it at session start and on a\n write to a file another story changes\n --resume worker-scope reads where the stopped worker of the context stands (its rows by their\n Slice: trailer, the files of the row under way, the markers, its last verify-slice, its\n report, its agent as the guard recorded it) and prints the message that resumes its agent\n (SendMessage) or the briefing of a new one; creates and rewrites nothing; --fresh asks for\n a new agent whatever the last one did; several worktrees of the context need --worktree\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an\n end-to-end spec, a working migration, the derived files git tracks) and every other\n changed path, left out and never to stage with it; the merges since --since, as\n verify-merge checks them, reported without failing the slice in this version (a later\n minor version fails it); exits 1 while a step fails; then the names the slice removes\n that the design of a row not done still cites (never a failure); in the worktree of a\n worker, the commit command with the trailer Slice: <row>, and\n .ddd-ts-kit/verification.json for the conductor\n cited the names the design of rows not done cites as code (paths, classes, Class.member) that\n the code does not have: those the history of --base removed (with the commit and the\n successor), the places the canonical tree refuses, and a name never there whose close\n name of the same part arrived after the line was written; planned names stay silent.\n The design of a row: its cells and rule lines in slices.md, a section of a document of\n docs/architecture whose heading names it, a document that names it or that its rule\n line links to. Default: every row not done, of the context when given, at the current\n branch. --removed-since <ref>: the names a change removes, from the merge base to the\n working tree, that such a design cites. Reads only, exits 0\n verify-merge what the merges of a branch lost, read from git only: every merge commit since --since\n (by default the base of .ddd-ts-kit/worker.json, then origin/HEAD, then origin/main) and\n the merge in progress (its result: the index and the working tree), or one <commit>; a\n squash commit takes --theirs <head of the branch it took in>. Errors: a line one side\n added or both kept missing from the result (whitespace, a line laid out again, a move\n to another file and imports merged into one statement aside), a file neither side\n deleted gone from the result, a row of slices.md done on one side and no longer done or\n gone, a test title or a spec file of one side gone, a migration of one side whose\n description (name without number and working-) the result lacks, a conflict marker;\n warnings: a line one side removed brought back, a line one side wrote where the other\n changed the same lines or deleted the file (the merge chose), a line the merge replaced\n by lines of its own. Derived files, files a tool says it wrote, migrations, lockfiles\n and slices.md are left out of the lines. The base is --base, else the Merge-Base:\n trailer of the merge, else git merge-base; entries of a Lost-Accepted: <file:line>,...\n trailer are listed and never fail, nor what a later commit restored; silent and exit 0\n without a merge, exit 1 on an error; --warn prints the same and exits 0, as the\n pre-push hook of init runs it in this version (a later minor version blocks the push)\n merge-trunk brings the trunk (--trunk, by default origin/HEAD then origin/main, never fetched) into the\n branch as one merge commit computed from the branch's own diff: from the newest commit of\n the branch the trunk holds (--since; else the commit whose patch, derived files,\n migrations, slices.md, plan.md and lockfiles left out, is one commit of the trunk, on this\n branch or a branch it shares commits with; else the base recorded for the worker when its\n lines are on the trunk; else git merge-base). Settles derived files and drizzle-kit meta\n (trunk side), generated regions of CONTEXT.md and the context map (trunk side), conflicts\n inside generated registries (lines of both sides), slices.md row by row (the furthest\n status), the stored-events lock by key, the lockfile (trunk side, installed again when\n the branch changed package.json); the rest is left in a merge in progress git\n understands, with what each side did (exit 1). Then, or on --continue: the drizzle\n migrations of both sides replayed, on --to-land the working migrations renamed (knex,\n Prisma, TypeORM; stop when both sides change one table), decision records renumbered,\n regenerate, verify-merge on the uncommitted result (an error stops; --accept-lost records\n a Lost-Accepted: trailer), and the commit of the merge's paths only, with the trailers\n Merge-Base:, Trunk: and Landed:; any other changed path blocks it. --dry-run previews,\n --abort undoes; refused (exit 2) on a dirty tree, another operation in progress, no\n committer known to git, an unknown trunk, or a git older than 2.40 with a base git\n would not compute\n --commit-size the files and lines about to be committed against \"commit\" in the config (20 files and\n 600 lines by default, generated files not counted); --staged reads the index only;\n advisory, --strict exits 1 when over\n --explain check follows the violations with the reason of each rule they report, once per rule, as\n explain gives it without its examples (\"explanations\" in JSON); with github and gitlab, each\n annotation carries the reason of its rule, a pull request showing an annotation on its own\n --stored-events docs records the shape of each version of the stored events in stored-events.lock.json,\n never rewriting a recorded one but one recorded by 0.82.0 or earlier, recorded again as\n the kit reads it now: run it once the shape of a version is the one to store; docs --check\n fails while a declared version is not recorded, or recorded by 0.82.0 or earlier\n --sdk init records \"sdk\" in the config and generates the clients with the project\n --local-only generate refuses, and writes nothing, when the kind would write outside its context;\n \"generate --help --json\" says which kinds do";
2
+ export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base;\n --run <script> runs that script of the project on them (DDD_TS_KIT_AFFECTED set,\n --passWithNoTests on a partial run) and nothing when nothing that runs changed:\n the pre-push hook tests the contexts its branch reaches\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0; then formats the snapshot and the\n journal it wrote with the Biome or Prettier of the format script, and warns when the\n SQL changes a primary key in an order that fails on PostgreSQL (exit code unchanged);\n --replay, after merging the trunk into a branch when both added migrations: when the\n history forks from --base <ref> (origin/main by default), deletes the migrations of the\n branch the base does not have, with their snapshots and journal entries, then generates\n each again on top, in order, under its name (working- dropped outside a worker's\n worktree, a custom one keeping its SQL); when it does not fork, only renames them;\n refused while the journal holds conflict markers, when two of them change the schema,\n or when drizzle-kit now writes a generated one otherwise (edited by hand), the folder\n then put back as it was\n error-factories moves the refusals of a project to one class per refusal (--to named, the default), from\n one class per error or from the factories of one error class per concept: --plan writes\n error-factories.plan.json, where each refusal is given a class (the PascalCase of its\n code, which it keeps) and a factory (for<Concept>), both editable; --apply follows it\n (codes.ts per context, one class file per refusal, specs, every usage, the concept\n classes left empty, \"stack.refusals\" in the config) and lists what it cannot rewrite\n (a bare <Concept>Error.is(error), CodeOf<typeof <Concept>Error>); --to factories moves\n one class per error to static factories on one error class per concept instead\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n platform-folders takes the files of the platform a project generated flat to their folders:\n composition/, observability/ (tracing.ts first), jobs/, auth/authentication/ (who is\n calling), auth/authorization/ (what they may do, whatever the model), the folder of\n the model (auth/roles/, attributes/, relationships/, custom/) and\n audit/search-audit-entries/; every import of them under the source root, test/ and\n scripts/ follows, and the scripts of package.json; a file the kit did not write at\n the root of the platform or of auth/ stays where it is, named, unless --place\n <file>=<folder> (both from the platform) gives it its folder; the generators and\n init --force keep either layout until then\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise, and the git hooks (the lefthook: line of lefthook.yml, the pre-commit hook of\n lefthook in this clone); init adds what is missing, hooks:install the hook; then what\n this checkout lacks to run the project, read without network: the running Node against\n engines.node and .nvmrc, node_modules installed since the lockfile last changed, each\n package of the kit installed at the version of this CLI, the submodules initialised;\n each with its fix; --strict exits 1 while something is missing or the checkout cannot\n run the project, never for a hook this clone has not installed, a Node .nvmrc does not\n name or a lockfile changed since the install\n lint the ESLint of the project (lint and ci:lint run it): fails on an error, and on a warning\n as on an error, but on one of a rule of the kit in transition, a new rule that becomes an\n error in the version it names, whose warnings are listed apart; --format and --fix as ESLint\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, each row not done ready on the trunk (its dependencies done), ready\n on a branch (the others briefed to a worker with commits ahead of its base) or waiting\n (with the ids it waits for), a row that landed with a worker's branch but is not marked done,\n and the TODO(domain), TODO(platform), it.todo and TODO(review) left in each context, and\n each story or milestone whose rows are all done while markers of its own keep it open (see\n story-check, whose git blame it runs on those markers only); --workers shows instead each\n worktree holding .ddd-ts-kit/worker.json (branch, context, rows, base, commits ahead and\n files changed counted from where its branch landed on the base when it was squash-merged\n there (else from the merge base), commits behind, the commit it landed as, what merge-trunk\n would leave conflicted now, dependencies not installed, its report), a state line (rows\n committed, the row under way, files uncommitted, markers, last verify-slice, and the\n worker-scope --resume command of a stopped one), then the contexts and the files more than\n one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n plan-waves the rows of slices.md not done, of the project or of one context, in waves (wave 1: every\n dependency done; wave n: the others in earlier waves), each wave cut into batches of one\n owner, one or two rows on one aggregate, with the worker-scope command that briefs each,\n the batches of a wave likely to touch the same files (same aggregate in Start with, or\n unknown when it names none), each row a row waits for with its status (and its context\n and story when it is of another story or outside the context shown), the rows of other\n stories the planned rows wait for, not done, in a section of their own, the merge order\n and what runs before each merge (merge-trunk --to-land); a cycle, a dependency on an\n unknown id or a row without owner is reported alone, and exits 1\n story-check whether a story or a milestone can close, <code> being the start of the ids of its rows\n (M1 for M1.01, M1.02: the id without its last .<number>): every row of it done in\n slices.md (the others listed with their status), and no marker of its own left\n (TODO(domain), TODO(platform), it.todo, TODO(review)). A marker is attributed to\n rows: those its text names (#M1.03 or M1.03, word-bounded), else those of the commit\n that wrote its line (git blame, once per file; its Slice: trailer, else the row ids\n its message names), else, not committed, those of .ddd-ts-kit/worker.json in a\n worker's worktree. It is the story's own when it belongs to one of its rows,\n wherever it is; a marker of a context of its rows that belongs to no row is its own\n when no other open story has a row in that context, and is listed without blocking\n otherwise (settle it or name its row in it); a marker of other stories' rows does not\n block. --strict: every marker of its contexts blocks. Each blocker comes with why it\n is its own, its file:line and its fix: handle it, or dismiss it by a decision record\n (generate adr), then delete the marker. Reads only: exits 0 when it can close, 1\n listing what keeps it open, 2 on a code no row carries or without slices.md\n acceptance the acceptance scenarios of each story (test/acceptance/<story>.acceptance.spec.ts) against\n its rows in slices.md and the criteria of docs/architecture/stories/<story>.md: the rows and\n criteria each scenario names (#US5.02 AC1 in its title), the scenarios left to write\n (it.todo), those wrapped in pending(...) of @ddd-ts-kit/testing/e2e until their code is\n built, and what is inconsistent (no row, an unknown row or criterion, a scenario skipped,\n a pending one whose rows are done, a locked one changed while its criteria were not);\n --gate written: every slice row and criterion has a written scenario, none is left to\n write, the acceptance is locked (before the code of the story); --gate passing: none is\n pending either (before the story closes); exits 1 while a gate is not met, or, without\n one, on an inconsistency. Never runs a test. --lock writes\n test/acceptance/<story>.acceptance.lock.json, the fingerprint of each criterion and of\n each scenario (pending(...), layout and comments aside), refused while a scenario is\n left to write, or while a criterion changed, or a locked scenario changed while its\n criteria did not, without a verdict \"amend\" of the acceptance-judge agent on that very\n version (test/acceptance/verdicts/*.md, lines Story:, Subject:, Fingerprint:,\n Verdict:, Reason:); a refusal wins; the verdicts become amendments of the lock,\n listed for the owner to validate\n worker-scope a git worktree on the branch build/<context> (by default .worktrees/<context>, see worktree),\n cut from --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules, the documents of their design and\n the names that design cites the base does not have (see cited), and by default the first\n batch plan-waves cuts for the context (one or two rows on one aggregate), a note naming the\n next; a worktree it creates gets the clean install of the package manager (npm ci), its\n time in the notes, unless --no-install; an existing worktree or branch that does not\n contain the base is refused, with the merge-trunk that brings it in\n --here worker-scope in the worktree of a story (.ddd-ts-kit/story.json): writes the scope of the\n next agent in place, its base the base of the story, and prints its briefing; no\n worktree, branch or install of its own; the agents of a story run one after the other\n story-scope the worktree of one story, .worktrees/<story> on story/<story> cut from --base (by default\n origin/main from the trunk, else the current branch, refused from the worktree of a\n story), its .ddd-ts-kit/story.json and\n its clean install; an existing one is kept and the story resumes there; refused when the\n story is open in another worktree; names the other open stories and the contexts their\n rows change\n worktree the worktree of any other piece of work, .worktrees/<name> on work/<name> cut from --base\n (by default origin/main from the trunk, else the current branch), and its clean install\n unless --no-install; an existing one is kept; .worktrees/ lies in the main checkout,\n whichever worktree it runs from, ignored by git and by the tools of the project; while\n the .gitignore of a project started before does not hold it (init adds it), a worktree\n opens next to the project, ../<project>-<name>; in a project whose config says\n \"worktrees\": \"required\" (what init writes), the guard of the plugin refuses the code of\n a context in the main checkout of the trunk, and in a worktree of .worktrees/ without\n its own node_modules\n story where a story stands, phase by phase: its specification and criteria\n (docs/architecture/stories/<story>.md), its rows in slices.md, a design review section\n per row not done (docs/architecture/reviews/<story>.md, ## #<id>), its acceptance written\n and locked, its rows done, its acceptance passing, its trunk merged in, its ## Report; and\n the next step; in the worktree of a story, the story is its own; --gate build exits 1\n until the first four are met (the code may start: the guard of the plugin opens the\n contexts), --gate close until all are\n stories the stories open in the worktrees of the repository and where two of them meet: the\n contexts the rows of both name, the files both worktrees change (committed or not), what\n merging the branch of one into the other leaves to a person and what merge-trunk settles\n (git merge-tree, nothing written); how far each is behind its base; from the worktree of a\n story, the stories it meets; the guard of the plugin says it at session start and on a\n write to a file another story changes\n --resume worker-scope reads where the stopped worker of the context stands (its rows by their\n Slice: trailer, the files of the row under way, the markers, its last verify-slice, its\n report, its agent as the guard recorded it) and prints the message that resumes its agent\n (SendMessage) or the briefing of a new one; creates and rewrites nothing; --fresh asks for\n a new agent whatever the last one did; several worktrees of the context need --worktree\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an\n end-to-end spec, a working migration, the derived files git tracks) and every other\n changed path, left out and never to stage with it; the merges since --since, as\n verify-merge checks them, reported without failing the slice in this version (a later\n minor version fails it); exits 1 while a step fails; then the names the slice removes\n that the design of a row not done still cites (never a failure); in the worktree of a\n worker, the commit command with the trailer Slice: <row>, and\n .ddd-ts-kit/verification.json for the conductor\n cited the names the design of rows not done cites as code (paths, classes, Class.member) that\n the code does not have: those the history of --base removed (with the commit and the\n successor), the places the canonical tree refuses, and a name never there whose close\n name of the same part arrived after the line was written; planned names stay silent.\n The design of a row: its cells and rule lines in slices.md, a section of a document of\n docs/architecture whose heading names it, a document that names it or that its rule\n line links to. Default: every row not done, of the context when given, at the current\n branch. --removed-since <ref>: the names a change removes, from the merge base to the\n working tree, that such a design cites. Reads only, exits 0\n verify-merge what the merges of a branch lost, read from git only: every merge commit since --since\n (by default the base of .ddd-ts-kit/worker.json, then origin/HEAD, then origin/main) and\n the merge in progress (its result: the index and the working tree), or one <commit>; a\n squash commit takes --theirs <head of the branch it took in>. Errors: a line one side\n added or both kept missing from the result (whitespace, a line laid out again, a move\n to another file and imports merged into one statement aside), a file neither side\n deleted gone from the result, a row of slices.md done on one side and no longer done or\n gone, a test title or a spec file of one side gone, a migration of one side whose\n description (name without number and working-) the result lacks, a conflict marker;\n warnings: a line one side removed brought back, a line one side wrote where the other\n changed the same lines or deleted the file (the merge chose), a line the merge replaced\n by lines of its own. Derived files, files a tool says it wrote, migrations, lockfiles\n and slices.md are left out of the lines. The base is --base, else the Merge-Base:\n trailer of the merge, else git merge-base; entries of a Lost-Accepted: <file:line>,...\n trailer are listed and never fail, nor what a later commit restored; silent and exit 0\n without a merge, exit 1 on an error; --warn prints the same and exits 0, as the\n pre-push hook of init runs it in this version (a later minor version blocks the push)\n merge-trunk brings the trunk (--trunk, by default origin/HEAD then origin/main, never fetched) into the\n branch as one merge commit computed from the branch's own diff: from the newest commit of\n the branch the trunk holds (--since; else the commit whose patch, derived files,\n migrations, slices.md, plan.md and lockfiles left out, is one commit of the trunk, on this\n branch or a branch it shares commits with; else the base recorded for the worker when its\n lines are on the trunk; else git merge-base). Settles derived files and drizzle-kit meta\n (trunk side), the package.json of a client (trunk side, at the higher of both versions;\n left to you when one is not a semantic version), generated regions of CONTEXT.md and the\n context map (trunk side), conflicts inside generated registries (lines of both sides),\n slices.md row by row (the furthest status), the stored-events lock by key, the lockfile\n (trunk side, installed again when the branch changed package.json); the rest is left in a\n merge in progress git understands, with what each side did (exit 1). Then, or on\n --continue: the drizzle migrations of both sides replayed, on --to-land the working\n migrations renamed (knex, Prisma, TypeORM; stop when both sides change one table), decision\n records renumbered, regenerate, verify-merge on the uncommitted result (an error stops;\n --accept-lost records a Lost-Accepted: trailer), and the commit of the merge's paths only,\n with the trailers Merge-Base:, Trunk: and Landed:; any other changed path blocks it.\n --dry-run previews, --abort undoes; refused (exit 2) on a dirty tree, another operation in\n progress, no committer known to git, an unknown trunk, or a git older than 2.40 with a base\n git would not compute\n --commit-size the files and lines about to be committed against \"commit\" in the config (20 files and\n 600 lines by default, generated files not counted); --staged reads the index only;\n advisory, --strict exits 1 when over\n --explain check follows the violations with the reason of each rule they report, once per rule, as\n explain gives it without its examples (\"explanations\" in JSON); with github and gitlab, each\n annotation carries the reason of its rule, a pull request showing an annotation on its own\n --stored-events docs records the shape of each version of the stored events in stored-events.lock.json,\n never rewriting a recorded one but one recorded by 0.82.0 or earlier, recorded again as\n the kit reads it now: run it once the shape of a version is the one to store; docs --check\n fails while a declared version is not recorded, or recorded by 0.82.0 or earlier\n --sdk init records \"sdk\" in the config and generates the clients with the project\n --local-only generate refuses, and writes nothing, when the kind would write outside its context;\n \"generate --help --json\" says which kinds do";
3
3
  //# sourceMappingURL=notes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,k6tBAqO8C,CAAC"}
1
+ {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,kzuBAwO8C,CAAC"}