ddd-ts-kit 0.26.0 → 0.82.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 (491) hide show
  1. package/CHANGELOG.md +225 -0
  2. package/README.fr.md +62 -15
  3. package/README.md +56 -14
  4. package/dist/acceptance/acceptance-file-of.d.ts +5 -0
  5. package/dist/acceptance/acceptance-file-of.d.ts.map +1 -0
  6. package/dist/acceptance/acceptance-file-of.js +7 -0
  7. package/dist/acceptance/acceptance-file-of.js.map +1 -0
  8. package/dist/acceptance/acceptance-gate.d.ts +8 -0
  9. package/dist/acceptance/acceptance-gate.d.ts.map +1 -0
  10. package/dist/acceptance/acceptance-gate.js +2 -0
  11. package/dist/acceptance/acceptance-gate.js.map +1 -0
  12. package/dist/acceptance/acceptance-lock.d.ts +32 -0
  13. package/dist/acceptance/acceptance-lock.d.ts.map +1 -0
  14. package/dist/acceptance/acceptance-lock.js +2 -0
  15. package/dist/acceptance/acceptance-lock.js.map +1 -0
  16. package/dist/acceptance/acceptance-problem.d.ts +15 -0
  17. package/dist/acceptance/acceptance-problem.d.ts.map +1 -0
  18. package/dist/acceptance/acceptance-problem.js +2 -0
  19. package/dist/acceptance/acceptance-problem.js.map +1 -0
  20. package/dist/acceptance/commentless.d.ts +4 -0
  21. package/dist/acceptance/commentless.d.ts.map +1 -0
  22. package/dist/acceptance/commentless.js +31 -0
  23. package/dist/acceptance/commentless.js.map +1 -0
  24. package/dist/acceptance/counts-for.d.ts +5 -0
  25. package/dist/acceptance/counts-for.d.ts.map +1 -0
  26. package/dist/acceptance/counts-for.js +8 -0
  27. package/dist/acceptance/counts-for.js.map +1 -0
  28. package/dist/acceptance/criteria-in.d.ts +14 -0
  29. package/dist/acceptance/criteria-in.d.ts.map +1 -0
  30. package/dist/acceptance/criteria-in.js +34 -0
  31. package/dist/acceptance/criteria-in.js.map +1 -0
  32. package/dist/acceptance/drift.d.ts +30 -0
  33. package/dist/acceptance/drift.d.ts.map +1 -0
  34. package/dist/acceptance/drift.js +44 -0
  35. package/dist/acceptance/drift.js.map +1 -0
  36. package/dist/acceptance/format-acceptance.d.ts +5 -0
  37. package/dist/acceptance/format-acceptance.d.ts.map +1 -0
  38. package/dist/acceptance/format-acceptance.js +40 -0
  39. package/dist/acceptance/format-acceptance.js.map +1 -0
  40. package/dist/acceptance/lock-acceptance.d.ts +24 -0
  41. package/dist/acceptance/lock-acceptance.d.ts.map +1 -0
  42. package/dist/acceptance/lock-acceptance.js +58 -0
  43. package/dist/acceptance/lock-acceptance.js.map +1 -0
  44. package/dist/acceptance/lock-file-of.d.ts +3 -0
  45. package/dist/acceptance/lock-file-of.d.ts.map +1 -0
  46. package/dist/acceptance/lock-file-of.js +6 -0
  47. package/dist/acceptance/lock-file-of.js.map +1 -0
  48. package/dist/acceptance/lock-problems.d.ts +21 -0
  49. package/dist/acceptance/lock-problems.d.ts.map +1 -0
  50. package/dist/acceptance/lock-problems.js +58 -0
  51. package/dist/acceptance/lock-problems.js.map +1 -0
  52. package/dist/acceptance/read-acceptance.d.ts +9 -0
  53. package/dist/acceptance/read-acceptance.d.ts.map +1 -0
  54. package/dist/acceptance/read-acceptance.js +76 -0
  55. package/dist/acceptance/read-acceptance.js.map +1 -0
  56. package/dist/acceptance/read-lock.d.ts +5 -0
  57. package/dist/acceptance/read-lock.d.ts.map +1 -0
  58. package/dist/acceptance/read-lock.js +45 -0
  59. package/dist/acceptance/read-lock.js.map +1 -0
  60. package/dist/acceptance/read-verdicts.d.ts +9 -0
  61. package/dist/acceptance/read-verdicts.d.ts.map +1 -0
  62. package/dist/acceptance/read-verdicts.js +35 -0
  63. package/dist/acceptance/read-verdicts.js.map +1 -0
  64. package/dist/acceptance/scenario-problems.d.ts +12 -0
  65. package/dist/acceptance/scenario-problems.d.ts.map +1 -0
  66. package/dist/acceptance/scenario-problems.js +74 -0
  67. package/dist/acceptance/scenario-problems.js.map +1 -0
  68. package/dist/acceptance/scenario.d.ts +23 -0
  69. package/dist/acceptance/scenario.d.ts.map +1 -0
  70. package/dist/acceptance/scenario.js +2 -0
  71. package/dist/acceptance/scenario.js.map +1 -0
  72. package/dist/acceptance/scenarios-in.d.ts +4 -0
  73. package/dist/acceptance/scenarios-in.d.ts.map +1 -0
  74. package/dist/acceptance/scenarios-in.js +68 -0
  75. package/dist/acceptance/scenarios-in.js.map +1 -0
  76. package/dist/acceptance/story-acceptance.d.ts +29 -0
  77. package/dist/acceptance/story-acceptance.d.ts.map +1 -0
  78. package/dist/acceptance/story-acceptance.js +2 -0
  79. package/dist/acceptance/story-acceptance.js.map +1 -0
  80. package/dist/acceptance/story-file-of.d.ts +4 -0
  81. package/dist/acceptance/story-file-of.d.ts.map +1 -0
  82. package/dist/acceptance/story-file-of.js +8 -0
  83. package/dist/acceptance/story-file-of.js.map +1 -0
  84. package/dist/acceptance/story-of-file.d.ts +3 -0
  85. package/dist/acceptance/story-of-file.d.ts.map +1 -0
  86. package/dist/acceptance/story-of-file.js +6 -0
  87. package/dist/acceptance/story-of-file.js.map +1 -0
  88. package/dist/acceptance/story-of-row.d.ts +3 -0
  89. package/dist/acceptance/story-of-row.d.ts.map +1 -0
  90. package/dist/acceptance/story-of-row.js +6 -0
  91. package/dist/acceptance/story-of-row.js.map +1 -0
  92. package/dist/acceptance/story-problems.d.ts +16 -0
  93. package/dist/acceptance/story-problems.d.ts.map +1 -0
  94. package/dist/acceptance/story-problems.js +48 -0
  95. package/dist/acceptance/story-problems.js.map +1 -0
  96. package/dist/acceptance/verdict-on.d.ts +8 -0
  97. package/dist/acceptance/verdict-on.d.ts.map +1 -0
  98. package/dist/acceptance/verdict-on.js +9 -0
  99. package/dist/acceptance/verdict-on.js.map +1 -0
  100. package/dist/acceptance/verdict.d.ts +14 -0
  101. package/dist/acceptance/verdict.d.ts.map +1 -0
  102. package/dist/acceptance/verdict.js +2 -0
  103. package/dist/acceptance/verdict.js.map +1 -0
  104. package/dist/acceptance/verdicts-dir.d.ts +3 -0
  105. package/dist/acceptance/verdicts-dir.d.ts.map +1 -0
  106. package/dist/acceptance/verdicts-dir.js +3 -0
  107. package/dist/acceptance/verdicts-dir.js.map +1 -0
  108. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  109. package/dist/check/catalogue/architecture-rules.js +6 -0
  110. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  111. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  112. package/dist/check/catalogue/default-severities.js +3 -0
  113. package/dist/check/catalogue/default-severities.js.map +1 -1
  114. package/dist/check/commands/check-command.d.ts.map +1 -1
  115. package/dist/check/commands/check-command.js +4 -1
  116. package/dist/check/commands/check-command.js.map +1 -1
  117. package/dist/check/commands/explain-command.d.ts.map +1 -1
  118. package/dist/check/commands/explain-command.js +2 -9
  119. package/dist/check/commands/explain-command.js.map +1 -1
  120. package/dist/check/configuration/config-inspection.d.ts +1 -0
  121. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  122. package/dist/check/configuration/config-inspection.js +9 -1
  123. package/dist/check/configuration/config-inspection.js.map +1 -1
  124. package/dist/check/engine/format-check.d.ts +6 -1
  125. package/dist/check/engine/format-check.d.ts.map +1 -1
  126. package/dist/check/engine/format-check.js +33 -11
  127. package/dist/check/engine/format-check.js.map +1 -1
  128. package/dist/check/explain/documented-rule.d.ts +8 -0
  129. package/dist/check/explain/documented-rule.d.ts.map +1 -0
  130. package/dist/check/explain/documented-rule.js +14 -0
  131. package/dist/check/explain/documented-rule.js.map +1 -0
  132. package/dist/check/explain/explanations-of.d.ts +5 -0
  133. package/dist/check/explain/explanations-of.d.ts.map +1 -0
  134. package/dist/check/explain/explanations-of.js +16 -0
  135. package/dist/check/explain/explanations-of.js.map +1 -0
  136. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  137. package/dist/check/explain/persistence-docs.js +7 -0
  138. package/dist/check/explain/persistence-docs.js.map +1 -1
  139. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  140. package/dist/check/explain/tree-docs.js +9 -0
  141. package/dist/check/explain/tree-docs.js.map +1 -1
  142. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  143. package/dist/check/explain/wiring-docs.js +13 -0
  144. package/dist/check/explain/wiring-docs.js.map +1 -1
  145. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  146. package/dist/check/fixtures/declarations-fixtures.js +78 -1
  147. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  148. package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
  149. package/dist/check/fixtures/persistence-fixtures.js +25 -0
  150. package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
  151. package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
  152. package/dist/check/fixtures/test-fixtures.js +35 -0
  153. package/dist/check/fixtures/test-fixtures.js.map +1 -1
  154. package/dist/check/model/rule-explanation.d.ts +10 -0
  155. package/dist/check/model/rule-explanation.d.ts.map +1 -0
  156. package/dist/check/model/rule-explanation.js +2 -0
  157. package/dist/check/model/rule-explanation.js.map +1 -0
  158. package/dist/check/project/walk-directory.js +1 -1
  159. package/dist/check/project/walk-directory.js.map +1 -1
  160. package/dist/check/rules/config-valid.d.ts.map +1 -1
  161. package/dist/check/rules/config-valid.js +1 -0
  162. package/dist/check/rules/config-valid.js.map +1 -1
  163. package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
  164. package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
  165. package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
  166. package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
  167. package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
  168. package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
  169. package/dist/check/rules/persistence-primary-key-order.js +31 -0
  170. package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
  171. package/dist/check/rules/test-acceptance-black-box.d.ts +3 -0
  172. package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -0
  173. package/dist/check/rules/test-acceptance-black-box.js +38 -0
  174. package/dist/check/rules/test-acceptance-black-box.js.map +1 -0
  175. package/dist/commands/acceptance.d.ts +11 -0
  176. package/dist/commands/acceptance.d.ts.map +1 -0
  177. package/dist/commands/acceptance.js +63 -0
  178. package/dist/commands/acceptance.js.map +1 -0
  179. package/dist/commands/doctor.d.ts +4 -1
  180. package/dist/commands/doctor.d.ts.map +1 -1
  181. package/dist/commands/doctor.js +20 -4
  182. package/dist/commands/doctor.js.map +1 -1
  183. package/dist/commands/lint.d.ts +7 -0
  184. package/dist/commands/lint.d.ts.map +1 -0
  185. package/dist/commands/lint.js +55 -0
  186. package/dist/commands/lint.js.map +1 -0
  187. package/dist/commands/plan-waves.d.ts.map +1 -1
  188. package/dist/commands/plan-waves.js +1 -2
  189. package/dist/commands/plan-waves.js.map +1 -1
  190. package/dist/commands/stories.d.ts +9 -0
  191. package/dist/commands/stories.d.ts.map +1 -0
  192. package/dist/commands/stories.js +16 -0
  193. package/dist/commands/stories.js.map +1 -0
  194. package/dist/commands/story-scope.d.ts +4 -0
  195. package/dist/commands/story-scope.d.ts.map +1 -0
  196. package/dist/commands/story-scope.js +34 -0
  197. package/dist/commands/story-scope.js.map +1 -0
  198. package/dist/commands/story.d.ts +9 -0
  199. package/dist/commands/story.d.ts.map +1 -0
  200. package/dist/commands/story.js +45 -0
  201. package/dist/commands/story.js.map +1 -0
  202. package/dist/commands/worker-scope.d.ts.map +1 -1
  203. package/dist/commands/worker-scope.js +2 -0
  204. package/dist/commands/worker-scope.js.map +1 -1
  205. package/dist/commands/worktree.d.ts +7 -0
  206. package/dist/commands/worktree.d.ts.map +1 -0
  207. package/dist/commands/worktree.js +34 -0
  208. package/dist/commands/worktree.js.map +1 -0
  209. package/dist/config/config.d.ts +9 -0
  210. package/dist/config/config.d.ts.map +1 -1
  211. package/dist/config/index.d.ts +1 -0
  212. package/dist/config/index.d.ts.map +1 -1
  213. package/dist/config/index.js +1 -0
  214. package/dist/config/index.js.map +1 -1
  215. package/dist/config/parse-config.d.ts.map +1 -1
  216. package/dist/config/parse-config.js +3 -0
  217. package/dist/config/parse-config.js.map +1 -1
  218. package/dist/config/restack-config-text.d.ts +3 -2
  219. package/dist/config/restack-config-text.d.ts.map +1 -1
  220. package/dist/config/restack-config-text.js +5 -3
  221. package/dist/config/restack-config-text.js.map +1 -1
  222. package/dist/config/serialize-config.d.ts.map +1 -1
  223. package/dist/config/serialize-config.js +3 -1
  224. package/dist/config/serialize-config.js.map +1 -1
  225. package/dist/config/worktree-modes.d.ts +3 -0
  226. package/dist/config/worktree-modes.d.ts.map +1 -0
  227. package/dist/config/worktree-modes.js +3 -0
  228. package/dist/config/worktree-modes.js.map +1 -0
  229. package/dist/doctor/diagnose.d.ts +2 -0
  230. package/dist/doctor/diagnose.d.ts.map +1 -1
  231. package/dist/doctor/diagnose.js +22 -3
  232. package/dist/doctor/diagnose.js.map +1 -1
  233. package/dist/doctor/doctor-finding.d.ts +13 -5
  234. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  235. package/dist/doctor/format-diagnosis.d.ts +4 -1
  236. package/dist/doctor/format-diagnosis.d.ts.map +1 -1
  237. package/dist/doctor/format-diagnosis.js +49 -3
  238. package/dist/doctor/format-diagnosis.js.map +1 -1
  239. package/dist/doctor/in-range.d.ts +7 -0
  240. package/dist/doctor/in-range.d.ts.map +1 -0
  241. package/dist/doctor/in-range.js +90 -0
  242. package/dist/doctor/in-range.js.map +1 -0
  243. package/dist/doctor/install-findings.d.ts +11 -0
  244. package/dist/doctor/install-findings.d.ts.map +1 -0
  245. package/dist/doctor/install-findings.js +119 -0
  246. package/dist/doctor/install-findings.js.map +1 -0
  247. package/dist/doctor/node-findings.d.ts +7 -0
  248. package/dist/doctor/node-findings.d.ts.map +1 -0
  249. package/dist/doctor/node-findings.js +19 -0
  250. package/dist/doctor/node-findings.js.map +1 -0
  251. package/dist/doctor/package-findings.d.ts +2 -0
  252. package/dist/doctor/package-findings.d.ts.map +1 -1
  253. package/dist/doctor/package-findings.js +1 -1
  254. package/dist/doctor/package-findings.js.map +1 -1
  255. package/dist/doctor/submodule-findings.d.ts +7 -0
  256. package/dist/doctor/submodule-findings.d.ts.map +1 -0
  257. package/dist/doctor/submodule-findings.js +22 -0
  258. package/dist/doctor/submodule-findings.js.map +1 -0
  259. package/dist/generate/kinds/acceptance-kind.d.ts +3 -0
  260. package/dist/generate/kinds/acceptance-kind.d.ts.map +1 -0
  261. package/dist/generate/kinds/acceptance-kind.js +69 -0
  262. package/dist/generate/kinds/acceptance-kind.js.map +1 -0
  263. package/dist/generate/kinds.d.ts.map +1 -1
  264. package/dist/generate/kinds.js +2 -0
  265. package/dist/generate/kinds.js.map +1 -1
  266. package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
  267. package/dist/generate/schedule/cron-problem.js +16 -1
  268. package/dist/generate/schedule/cron-problem.js.map +1 -1
  269. package/dist/generate/shared-writes.d.ts.map +1 -1
  270. package/dist/generate/shared-writes.js +3 -0
  271. package/dist/generate/shared-writes.js.map +1 -1
  272. package/dist/help/notes.d.ts +1 -1
  273. package/dist/help/notes.d.ts.map +1 -1
  274. package/dist/help/notes.js +71 -10
  275. package/dist/help/notes.js.map +1 -1
  276. package/dist/help/usage.d.ts +1 -1
  277. package/dist/help/usage.d.ts.map +1 -1
  278. package/dist/help/usage.js +8 -1
  279. package/dist/help/usage.js.map +1 -1
  280. package/dist/init/agent-permissions.d.ts.map +1 -1
  281. package/dist/init/agent-permissions.js +9 -1
  282. package/dist/init/agent-permissions.js.map +1 -1
  283. package/dist/init/ignore-worktrees.d.ts +7 -0
  284. package/dist/init/ignore-worktrees.d.ts.map +1 -0
  285. package/dist/init/ignore-worktrees.js +15 -0
  286. package/dist/init/ignore-worktrees.js.map +1 -0
  287. package/dist/init/manifest/versions.js +24 -24
  288. package/dist/init/run-init.d.ts.map +1 -1
  289. package/dist/init/run-init.js +12 -4
  290. package/dist/init/run-init.js.map +1 -1
  291. package/dist/lint/eslint-in-project.d.ts +8 -0
  292. package/dist/lint/eslint-in-project.d.ts.map +1 -0
  293. package/dist/lint/eslint-in-project.js +33 -0
  294. package/dist/lint/eslint-in-project.js.map +1 -0
  295. package/dist/lint/format-verdict.d.ts +4 -0
  296. package/dist/lint/format-verdict.d.ts.map +1 -0
  297. package/dist/lint/format-verdict.js +11 -0
  298. package/dist/lint/format-verdict.js.map +1 -0
  299. package/dist/lint/lint-run.d.ts +8 -0
  300. package/dist/lint/lint-run.d.ts.map +1 -0
  301. package/dist/lint/lint-run.js +2 -0
  302. package/dist/lint/lint-run.js.map +1 -0
  303. package/dist/lint/lint-verdict.d.ts +19 -0
  304. package/dist/lint/lint-verdict.d.ts.map +1 -0
  305. package/dist/lint/lint-verdict.js +25 -0
  306. package/dist/lint/lint-verdict.js.map +1 -0
  307. package/dist/lint/parse-lint-answer.d.ts +13 -0
  308. package/dist/lint/parse-lint-answer.d.ts.map +1 -0
  309. package/dist/lint/parse-lint-answer.js +18 -0
  310. package/dist/lint/parse-lint-answer.js.map +1 -0
  311. package/dist/migration/plan-replay.d.ts +4 -3
  312. package/dist/migration/plan-replay.d.ts.map +1 -1
  313. package/dist/migration/plan-replay.js +21 -6
  314. package/dist/migration/plan-replay.js.map +1 -1
  315. package/dist/migration/rename-branch-migrations.d.ts +13 -0
  316. package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
  317. package/dist/migration/rename-branch-migrations.js +25 -0
  318. package/dist/migration/rename-branch-migrations.js.map +1 -0
  319. package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
  320. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  321. package/dist/migration/replay-drizzle-migrations.js +48 -4
  322. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  323. package/dist/migration/replay-plan.d.ts +8 -0
  324. package/dist/migration/replay-plan.d.ts.map +1 -1
  325. package/dist/migration/restore-migration-folder.d.ts +4 -0
  326. package/dist/migration/restore-migration-folder.d.ts.map +1 -0
  327. package/dist/migration/restore-migration-folder.js +15 -0
  328. package/dist/migration/restore-migration-folder.js.map +1 -0
  329. package/dist/package-manager/lockfiles.d.ts +2 -0
  330. package/dist/package-manager/lockfiles.d.ts.map +1 -1
  331. package/dist/package-manager/lockfiles.js +5 -0
  332. package/dist/package-manager/lockfiles.js.map +1 -1
  333. package/dist/plan/batched-waves.d.ts +0 -2
  334. package/dist/plan/batched-waves.d.ts.map +1 -1
  335. package/dist/plan/batched-waves.js +4 -4
  336. package/dist/plan/batched-waves.js.map +1 -1
  337. package/dist/plan/plan-waves.d.ts +0 -2
  338. package/dist/plan/plan-waves.d.ts.map +1 -1
  339. package/dist/plan/plan-waves.js +2 -2
  340. package/dist/plan/plan-waves.js.map +1 -1
  341. package/dist/run.d.ts.map +1 -1
  342. package/dist/run.js +12 -0
  343. package/dist/run.js.map +1 -1
  344. package/dist/slice/plan-staging.d.ts +1 -1
  345. package/dist/slice/plan-staging.d.ts.map +1 -1
  346. package/dist/slice/plan-staging.js +5 -2
  347. package/dist/slice/plan-staging.js.map +1 -1
  348. package/dist/stories/forecast-merge.d.ts +14 -0
  349. package/dist/stories/forecast-merge.d.ts.map +1 -0
  350. package/dist/stories/forecast-merge.js +44 -0
  351. package/dist/stories/forecast-merge.js.map +1 -0
  352. package/dist/stories/format-stories.d.ts +4 -0
  353. package/dist/stories/format-stories.d.ts.map +1 -0
  354. package/dist/stories/format-stories.js +66 -0
  355. package/dist/stories/format-stories.js.map +1 -0
  356. package/dist/stories/format-story-phases.d.ts +5 -0
  357. package/dist/stories/format-story-phases.d.ts.map +1 -0
  358. package/dist/stories/format-story-phases.js +14 -0
  359. package/dist/stories/format-story-phases.js.map +1 -0
  360. package/dist/stories/merge-forecast.d.ts +18 -0
  361. package/dist/stories/merge-forecast.d.ts.map +1 -0
  362. package/dist/stories/merge-forecast.js +2 -0
  363. package/dist/stories/merge-forecast.js.map +1 -0
  364. package/dist/stories/open-stories.d.ts +8 -0
  365. package/dist/stories/open-stories.d.ts.map +1 -0
  366. package/dist/stories/open-stories.js +31 -0
  367. package/dist/stories/open-stories.js.map +1 -0
  368. package/dist/stories/open-story-scope.d.ts +23 -0
  369. package/dist/stories/open-story-scope.d.ts.map +1 -0
  370. package/dist/stories/open-story-scope.js +86 -0
  371. package/dist/stories/open-story-scope.js.map +1 -0
  372. package/dist/stories/open-story.d.ts +11 -0
  373. package/dist/stories/open-story.d.ts.map +1 -0
  374. package/dist/stories/open-story.js +2 -0
  375. package/dist/stories/open-story.js.map +1 -0
  376. package/dist/stories/read-stories.d.ts +9 -0
  377. package/dist/stories/read-stories.d.ts.map +1 -0
  378. package/dist/stories/read-stories.js +60 -0
  379. package/dist/stories/read-stories.js.map +1 -0
  380. package/dist/stories/read-story-phases.d.ts +10 -0
  381. package/dist/stories/read-story-phases.d.ts.map +1 -0
  382. package/dist/stories/read-story-phases.js +144 -0
  383. package/dist/stories/read-story-phases.js.map +1 -0
  384. package/dist/stories/read-story-place.d.ts +4 -0
  385. package/dist/stories/read-story-place.d.ts.map +1 -0
  386. package/dist/stories/read-story-place.js +23 -0
  387. package/dist/stories/read-story-place.js.map +1 -0
  388. package/dist/stories/review-file-of.d.ts +4 -0
  389. package/dist/stories/review-file-of.d.ts.map +1 -0
  390. package/dist/stories/review-file-of.js +7 -0
  391. package/dist/stories/review-file-of.js.map +1 -0
  392. package/dist/stories/section-of.d.ts +3 -0
  393. package/dist/stories/section-of.d.ts.map +1 -0
  394. package/dist/stories/section-of.js +11 -0
  395. package/dist/stories/section-of.js.map +1 -0
  396. package/dist/stories/stories-view.d.ts +13 -0
  397. package/dist/stories/stories-view.d.ts.map +1 -0
  398. package/dist/stories/stories-view.js +2 -0
  399. package/dist/stories/stories-view.js.map +1 -0
  400. package/dist/stories/story-crossing.d.ts +16 -0
  401. package/dist/stories/story-crossing.d.ts.map +1 -0
  402. package/dist/stories/story-crossing.js +2 -0
  403. package/dist/stories/story-crossing.js.map +1 -0
  404. package/dist/stories/story-gate.d.ts +4 -0
  405. package/dist/stories/story-gate.d.ts.map +1 -0
  406. package/dist/stories/story-gate.js +2 -0
  407. package/dist/stories/story-gate.js.map +1 -0
  408. package/dist/stories/story-phase.d.ts +13 -0
  409. package/dist/stories/story-phase.d.ts.map +1 -0
  410. package/dist/stories/story-phase.js +2 -0
  411. package/dist/stories/story-phase.js.map +1 -0
  412. package/dist/stories/story-place.d.ts +14 -0
  413. package/dist/stories/story-place.d.ts.map +1 -0
  414. package/dist/stories/story-place.js +2 -0
  415. package/dist/stories/story-place.js.map +1 -0
  416. package/dist/stories/story-scope-file.d.ts +3 -0
  417. package/dist/stories/story-scope-file.d.ts.map +1 -0
  418. package/dist/stories/story-scope-file.js +3 -0
  419. package/dist/stories/story-scope-file.js.map +1 -0
  420. package/dist/stories/story-scope.d.ts +17 -0
  421. package/dist/stories/story-scope.d.ts.map +1 -0
  422. package/dist/stories/story-scope.js +2 -0
  423. package/dist/stories/story-scope.js.map +1 -0
  424. package/dist/stories/story-state.d.ts +13 -0
  425. package/dist/stories/story-state.d.ts.map +1 -0
  426. package/dist/stories/story-state.js +2 -0
  427. package/dist/stories/story-state.js.map +1 -0
  428. package/dist/stories/trunk-phase.d.ts +8 -0
  429. package/dist/stories/trunk-phase.d.ts.map +1 -0
  430. package/dist/stories/trunk-phase.js +27 -0
  431. package/dist/stories/trunk-phase.js.map +1 -0
  432. package/dist/version.d.ts +1 -1
  433. package/dist/version.js +1 -1
  434. package/dist/worker/add-worktree.d.ts +7 -0
  435. package/dist/worker/add-worktree.d.ts.map +1 -0
  436. package/dist/worker/add-worktree.js +13 -0
  437. package/dist/worker/add-worktree.js.map +1 -0
  438. package/dist/worker/branch-exists.d.ts +3 -0
  439. package/dist/worker/branch-exists.d.ts.map +1 -0
  440. package/dist/worker/branch-exists.js +6 -0
  441. package/dist/worker/branch-exists.js.map +1 -0
  442. package/dist/worker/briefed-rows.js +1 -1
  443. package/dist/worker/briefed-rows.js.map +1 -1
  444. package/dist/worker/ensure-ignored.d.ts +7 -0
  445. package/dist/worker/ensure-ignored.d.ts.map +1 -0
  446. package/dist/worker/ensure-ignored.js +17 -0
  447. package/dist/worker/ensure-ignored.js.map +1 -0
  448. package/dist/worker/install-notes.d.ts +9 -0
  449. package/dist/worker/install-notes.d.ts.map +1 -0
  450. package/dist/worker/install-notes.js +25 -0
  451. package/dist/worker/install-notes.js.map +1 -0
  452. package/dist/worker/is-worktree.d.ts +3 -0
  453. package/dist/worker/is-worktree.d.ts.map +1 -0
  454. package/dist/worker/is-worktree.js +15 -0
  455. package/dist/worker/is-worktree.js.map +1 -0
  456. package/dist/worker/open-worker-scope.d.ts +6 -1
  457. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  458. package/dist/worker/open-worker-scope.js +29 -36
  459. package/dist/worker/open-worker-scope.js.map +1 -1
  460. package/dist/worker/repository-prefix.d.ts +3 -0
  461. package/dist/worker/repository-prefix.d.ts.map +1 -0
  462. package/dist/worker/repository-prefix.js +14 -0
  463. package/dist/worker/repository-prefix.js.map +1 -0
  464. package/dist/worker/upstream-of.d.ts +8 -0
  465. package/dist/worker/upstream-of.d.ts.map +1 -0
  466. package/dist/worker/upstream-of.js +18 -0
  467. package/dist/worker/upstream-of.js.map +1 -0
  468. package/dist/worker/worktree-home.d.ts +9 -0
  469. package/dist/worker/worktree-home.d.ts.map +1 -0
  470. package/dist/worker/worktree-home.js +17 -0
  471. package/dist/worker/worktree-home.js.map +1 -0
  472. package/dist/worker/worktree-of.d.ts +13 -0
  473. package/dist/worker/worktree-of.d.ts.map +1 -0
  474. package/dist/worker/worktree-of.js +30 -0
  475. package/dist/worker/worktree-of.js.map +1 -0
  476. package/dist/worktree/open-worktree.d.ts +20 -0
  477. package/dist/worktree/open-worktree.d.ts.map +1 -0
  478. package/dist/worktree/open-worktree.js +57 -0
  479. package/dist/worktree/open-worktree.js.map +1 -0
  480. package/dist/worktree/worktree-scope.d.ts +15 -0
  481. package/dist/worktree/worktree-scope.d.ts.map +1 -0
  482. package/dist/worktree/worktree-scope.js +2 -0
  483. package/dist/worktree/worktree-scope.js.map +1 -0
  484. package/package.json +2 -2
  485. package/templates/acceptance/acceptance.spec.ts.tpl +35 -0
  486. package/templates/init/docker/dockerignore.tpl +1 -0
  487. package/templates/init/e2e/jest.e2e.config.js.tpl +1 -1
  488. package/templates/init/e2e/vitest.e2e.config.ts.tpl +1 -1
  489. package/templates/init/gitignore.tpl +1 -0
  490. package/templates/pipeline/biome.json.tpl +1 -0
  491. package/templates/pipeline/package-scripts.json +3 -3
@@ -6,15 +6,21 @@ import { runGit } from '../commit/run-git.js';
6
6
  import { WORKER_SCOPE_FILE } from '../commit/worker-scope-file.js';
7
7
  import { KINDS } from '../generate/kinds.js';
8
8
  import { inDialect } from '../package-manager/in-dialect.js';
9
+ import { readStoryPlace } from '../stories/read-story-place.js';
10
+ import { STORY_SCOPE_FILE } from '../stories/story-scope-file.js';
9
11
  import { Workspace } from '../workspace/index.js';
12
+ import { addWorktree } from './add-worktree.js';
13
+ import { branchExists } from './branch-exists.js';
10
14
  import { briefedRows } from './briefed-rows.js';
11
15
  import { briefingOf } from './briefing-of.js';
12
16
  import { designNote } from './design-note.js';
13
17
  import { ensureContainsBase } from './ensure-contains-base.js';
14
18
  import { installDependencies } from './install-dependencies.js';
15
- import { listWorktrees } from './list-worktrees.js';
19
+ import { isWorktree } from './is-worktree.js';
16
20
  import { baseOf } from './base-of.js';
21
+ import { repositoryPrefix } from './repository-prefix.js';
17
22
  import { workerGenerators } from './worker-generators.js';
23
+ import { worktreeOf } from './worktree-of.js';
18
24
  /**
19
25
  * Gives one worker its place: a git worktree of the project on its own branch, cut from the
20
26
  * base, with its dependencies installed, the file that confines it to its context, and its
@@ -23,7 +29,7 @@ import { workerGenerators } from './worker-generators.js';
23
29
  */
24
30
  export function openWorkerScope(root, config, request) {
25
31
  const { context, dryRun } = request;
26
- const { project, worktree, branch, trunk, created, inside } = placeOf(root, config, request);
32
+ const { project, worktree, branch, trunk, created, inside, placeNote } = placeOf(root, config, request);
27
33
  const { slices, notes } = briefedRows(new Workspace(root, false), context, request.rows);
28
34
  const manager = config.stack.packageManager;
29
35
  const citations = staleNamesAt(root, config, { ref: trunk, rows: slices.map((row) => row.id) });
@@ -49,7 +55,7 @@ export function openWorkerScope(root, config, request) {
49
55
  ...notes,
50
56
  ...designNote(citations),
51
57
  ...citations.notes,
52
- ...notesOf(root, dryRun ? root : inside, { manager, install }),
58
+ ...notesOf(root, dryRun ? root : inside, { manager, install, placeNote }),
53
59
  ],
54
60
  };
55
61
  }
@@ -69,10 +75,13 @@ function prepareWorktree(root, request, place) {
69
75
  return created && request.install ? installDependencies(inside, manager) : undefined;
70
76
  }
71
77
  function placeOf(root, config, request) {
72
- const prefix = prefixOf(root);
78
+ if (request.here === true) {
79
+ return herePlace(root, request);
80
+ }
81
+ const prefix = repositoryPrefix(root);
73
82
  const trunk = baseOf(root, config, request.base);
74
83
  const project = path.basename(root);
75
- const worktree = path.resolve(root, request.worktree ?? `../${project}-${request.context}`);
84
+ const { worktree, note } = worktreeOf(root, request.worktree, request.context);
76
85
  const branch = request.branch ?? `build/${request.context}`;
77
86
  const created = !isWorktree(root, worktree);
78
87
  if (!created) {
@@ -88,40 +97,23 @@ function placeOf(root, config, request) {
88
97
  trunk,
89
98
  created,
90
99
  inside: path.join(worktree, prefix),
100
+ ...(note === undefined ? {} : { placeNote: note }),
91
101
  };
92
102
  }
93
- /** The path of the project inside its repository, empty at its top. */
94
- function prefixOf(root) {
95
- const prefix = runGit(root, ['rev-parse', '--show-prefix']);
96
- if (prefix === undefined) {
97
- 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.');
98
- }
99
- if (runGit(root, ['rev-parse', '--verify', '--quiet', 'HEAD']) === undefined) {
100
- throw new CliError('The repository has no commit yet.', 'Commit the bootstrap first: a worktree is cut from a commit.');
101
- }
102
- return prefix.trim();
103
- }
104
- function isWorktree(root, worktree) {
105
- if (!fs.existsSync(worktree)) {
106
- return false;
107
- }
108
- const known = listWorktrees(root).map((listed) => listed.path);
109
- if (known.includes(fs.realpathSync(worktree))) {
110
- return true;
111
- }
112
- throw new CliError(`${worktree} exists and is not a worktree of this repository.`, 'Pass another directory with --worktree <path>, or remove that one.');
113
- }
114
- function branchExists(root, branch) {
115
- return runGit(root, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}`]) !== undefined;
116
- }
117
- /** Adds the worktree on its branch: an existing branch is checked out, a new one is cut from the base. */
118
- function addWorktree(root, place) {
119
- const { worktree, branch, base } = place;
120
- const target = branchExists(root, branch) ? [branch] : ['-b', branch, base];
121
- const added = runGit(root, ['worktree', 'add', worktree, ...target]);
122
- if (added === undefined) {
123
- 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>.`);
103
+ /** The worktree of the story itself, on its branch, the base of the story as the base of the worker. */
104
+ function herePlace(root, request) {
105
+ const story = readStoryPlace(root);
106
+ if (story === undefined) {
107
+ throw new CliError(`--here briefs a worker inside the worktree of a story, and ${root} holds no ${STORY_SCOPE_FILE}.`, 'Open the story first (`npx ddd-ts-kit story-scope <story>`), then run worker-scope --here from its worktree; elsewhere a worker gets its own worktree.');
124
108
  }
109
+ return {
110
+ project: path.basename(root),
111
+ worktree: root,
112
+ branch: runGit(root, ['branch', '--show-current'])?.trim() || story.branch,
113
+ trunk: request.base ?? story.base,
114
+ created: false,
115
+ inside: root,
116
+ };
125
117
  }
126
118
  /**
127
119
  * The guard of the plugin reads `context`; `status --workers` shows the rest. The commit the base
@@ -143,6 +135,7 @@ function writeScope(root, inside, scope) {
143
135
  function notesOf(root, inside, dependencies) {
144
136
  const ignored = runGit(inside, ['check-ignore', '--quiet', WORKER_SCOPE_FILE]) !== undefined;
145
137
  return [
138
+ ...(dependencies.placeNote === undefined ? [] : [dependencies.placeNote]),
146
139
  ...(ignored
147
140
  ? []
148
141
  : [
@@ -1 +1 @@
1
- {"version":3,"file":"open-worker-scope.js","sourceRoot":"","sources":["../../src/worker/open-worker-scope.ts"],"names":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C,OAAO,OAAO,CAAC;IACrH,MAAM,GAAG,GAAG,2EAA2E,MAAM,OAAO,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;IACtI,MAAM,MAAM,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAElG,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The path of the project inside its repository, empty at its top; refused outside a repository or before its first commit. */
2
+ export declare function repositoryPrefix(root: string): string;
3
+ //# sourceMappingURL=repository-prefix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-prefix.d.ts","sourceRoot":"","sources":["../../src/worker/repository-prefix.ts"],"names":[],"mappings":"AAGA,gIAAgI;AAChI,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkBrD"}
@@ -0,0 +1,14 @@
1
+ import { CliError } from '../cli-error.js';
2
+ import { runGit } from '../commit/run-git.js';
3
+ /** The path of the project inside its repository, empty at its top; refused outside a repository or before its first commit. */
4
+ export function repositoryPrefix(root) {
5
+ const prefix = runGit(root, ['rev-parse', '--show-prefix']);
6
+ if (prefix === undefined) {
7
+ 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.');
8
+ }
9
+ if (runGit(root, ['rev-parse', '--verify', '--quiet', 'HEAD']) === undefined) {
10
+ throw new CliError('The repository has no commit yet.', 'Commit the bootstrap first: a worktree is cut from a commit.');
11
+ }
12
+ return prefix.trim();
13
+ }
14
+ //# sourceMappingURL=repository-prefix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-prefix.js","sourceRoot":"","sources":["../../src/worker/repository-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,gIAAgI;AAChI,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;IAE5D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,QAAQ,CAChB,GAAG,IAAI,kCAAkC,EACzC,0EAA0E,CAC3E,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAC7E,MAAM,IAAI,QAAQ,CAChB,mCAAmC,EACnC,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The remote branch of the trunk when the current branch is the trunk (the branch origin/HEAD
3
+ * names, else main or master) and follows it: `origin/main` for `main`, what a fetch brings up to
4
+ * date while the local branch stays behind until it is pulled. Any other branch, pushed or not,
5
+ * is its own base: its remote copy may lack what was just committed.
6
+ */
7
+ export declare function upstreamOf(root: string): string | undefined;
8
+ //# sourceMappingURL=upstream-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstream-of.d.ts","sourceRoot":"","sources":["../../src/worker/upstream-of.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3D"}
@@ -0,0 +1,18 @@
1
+ import { runGit } from '../commit/run-git.js';
2
+ /**
3
+ * The remote branch of the trunk when the current branch is the trunk (the branch origin/HEAD
4
+ * names, else main or master) and follows it: `origin/main` for `main`, what a fetch brings up to
5
+ * date while the local branch stays behind until it is pulled. Any other branch, pushed or not,
6
+ * is its own base: its remote copy may lack what was just committed.
7
+ */
8
+ export function upstreamOf(root) {
9
+ const current = runGit(root, ['branch', '--show-current'])?.trim() ?? '';
10
+ const upstream = runGit(root, ['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{upstream}'])?.trim();
11
+ return trunkNames(root).includes(current) && upstream !== '' ? upstream : undefined;
12
+ }
13
+ /** The names the trunk goes by: the branch origin/HEAD points to, else main and master. */
14
+ function trunkNames(root) {
15
+ const named = runGit(root, ['rev-parse', '--abbrev-ref', 'origin/HEAD'])?.trim() ?? '';
16
+ return named.startsWith('origin/') && named !== 'origin/HEAD' ? [named.slice('origin/'.length)] : ['main', 'master'];
17
+ }
18
+ //# sourceMappingURL=upstream-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstream-of.js","sourceRoot":"","sources":["../../src/worker/upstream-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,sBAAsB,EAAE,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAE5G,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACtF,CAAC;AAED,2FAA2F;AAC3F,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAEvF,OAAO,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACvH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Where the worktrees of a project live: a folder of the project in its main checkout, ignored by git and by every tool. */
2
+ export declare const WORKTREES_DIR = ".worktrees";
3
+ /**
4
+ * The worktree named `name` of the project at `root`: `.worktrees/<name>` in the project of the
5
+ * main checkout, whichever worktree of the repository the command runs from, so that a worktree
6
+ * opened from another one is not nested in it.
7
+ */
8
+ export declare function worktreeHome(root: string, name: string): string;
9
+ //# sourceMappingURL=worktree-home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-home.d.ts","sourceRoot":"","sources":["../../src/worker/worktree-home.ts"],"names":[],"mappings":"AAGA,6HAA6H;AAC7H,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/D"}
@@ -0,0 +1,17 @@
1
+ import path from 'node:path';
2
+ import { runGit } from '../commit/run-git.js';
3
+ /** Where the worktrees of a project live: a folder of the project in its main checkout, ignored by git and by every tool. */
4
+ export const WORKTREES_DIR = '.worktrees';
5
+ /**
6
+ * The worktree named `name` of the project at `root`: `.worktrees/<name>` in the project of the
7
+ * main checkout, whichever worktree of the repository the command runs from, so that a worktree
8
+ * opened from another one is not nested in it.
9
+ */
10
+ export function worktreeHome(root, name) {
11
+ const common = runGit(root, ['rev-parse', '--path-format=absolute', '--git-common-dir'])?.trim();
12
+ const top = runGit(root, ['rev-parse', '--show-toplevel'])?.trim() ?? root;
13
+ const prefix = runGit(root, ['rev-parse', '--show-prefix'])?.trim() ?? '';
14
+ const main = common !== undefined && path.basename(common) === '.git' ? path.dirname(common) : top;
15
+ return path.join(main, prefix, WORKTREES_DIR, name);
16
+ }
17
+ //# sourceMappingURL=worktree-home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-home.js","sourceRoot":"","sources":["../../src/worker/worktree-home.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,6HAA6H;AAC7H,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,wBAAwB,EAAE,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACjG,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC;IAC3E,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC1E,MAAM,IAAI,GAAG,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEnG,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** Where a command opens or finds a worktree, and what to say when it is not where it should be. */
2
+ export interface WorktreePlace {
3
+ readonly worktree: string;
4
+ readonly note?: string;
5
+ }
6
+ /**
7
+ * The worktree a command opens or finds again: the path asked, relative to the project root, or
8
+ * else `.worktrees/<name>`. A project whose .gitignore does not hold `.worktrees/` yet (one
9
+ * started before) gets its new worktree next to it, `../<project>-<name>`, with a note; a path
10
+ * asked under `.worktrees/` that git does not ignore is refused.
11
+ */
12
+ export declare function worktreeOf(root: string, asked: string | undefined, name: string): WorktreePlace;
13
+ //# sourceMappingURL=worktree-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-of.d.ts","sourceRoot":"","sources":["../../src/worker/worktree-of.ts"],"names":[],"mappings":"AAMA,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAsB/F"}
@@ -0,0 +1,30 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { runGit } from '../commit/run-git.js';
4
+ import { ensureIgnored } from './ensure-ignored.js';
5
+ import { WORKTREES_DIR, worktreeHome } from './worktree-home.js';
6
+ /**
7
+ * The worktree a command opens or finds again: the path asked, relative to the project root, or
8
+ * else `.worktrees/<name>`. A project whose .gitignore does not hold `.worktrees/` yet (one
9
+ * started before) gets its new worktree next to it, `../<project>-<name>`, with a note; a path
10
+ * asked under `.worktrees/` that git does not ignore is refused.
11
+ */
12
+ export function worktreeOf(root, asked, name) {
13
+ if (asked !== undefined) {
14
+ const worktree = path.resolve(root, asked);
15
+ if (path.basename(path.dirname(worktree)) === WORKTREES_DIR && !fs.existsSync(worktree)) {
16
+ ensureIgnored(worktree);
17
+ }
18
+ return { worktree };
19
+ }
20
+ const home = worktreeHome(root, name);
21
+ const project = path.dirname(path.dirname(home));
22
+ if (fs.existsSync(home) || runGit(project, ['check-ignore', '--quiet', path.relative(project, home)]) !== undefined) {
23
+ return { worktree: home };
24
+ }
25
+ return {
26
+ worktree: path.join(path.dirname(project), `${path.basename(project)}-${name}`),
27
+ note: `${WORKTREES_DIR}/ is not ignored by git yet: the worktree is opened next to the project. Run \`npx ddd-ts-kit init\` (it adds ${WORKTREES_DIR}/ to .gitignore), commit it, and the next ones go under ${WORKTREES_DIR}/.`,
28
+ };
29
+ }
30
+ //# sourceMappingURL=worktree-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-of.js","sourceRoot":"","sources":["../../src/worker/worktree-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQjE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAyB,EAAE,IAAY;IAC9E,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE3C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,aAAa,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxF,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC1B,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QACpH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;QAC/E,IAAI,EAAE,GAAG,aAAa,iHAAiH,aAAa,2DAA2D,aAAa,IAAI;KACjO,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { Config } from '../config/index.js';
2
+ import type { WorktreeScope } from './worktree-scope.js';
3
+ /** What the caller asks: a name, and how to cut and prepare its worktree. */
4
+ export interface WorktreeRequest {
5
+ readonly name: string;
6
+ /** By default `work/<name>`. */
7
+ readonly branch?: string;
8
+ /** By default the branch the current one follows (`origin/main` for `main`), else the current one. */
9
+ readonly base?: string;
10
+ readonly dryRun: boolean;
11
+ readonly install: boolean;
12
+ }
13
+ /**
14
+ * The worktree of one piece of work that is neither a story nor the worker of a plan:
15
+ * `.worktrees/<name>` in the project of the main checkout (next to the project while its
16
+ * .gitignore does not hold `.worktrees/`), on `work/<name>` cut from the base,
17
+ * with the clean install of its package manager. An existing one is kept: the work resumes there.
18
+ */
19
+ export declare function openWorktree(root: string, config: Config, request: WorktreeRequest): WorktreeScope;
20
+ //# sourceMappingURL=open-worktree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-worktree.d.ts","sourceRoot":"","sources":["../../src/worktree/open-worktree.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAUjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,sGAAsG;IACtG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAID;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CA0BlG"}
@@ -0,0 +1,57 @@
1
+ import path from 'node:path';
2
+ import { CliError } from '../cli-error.js';
3
+ import { runGit } from '../commit/run-git.js';
4
+ import { addWorktree } from '../worker/add-worktree.js';
5
+ import { baseOf } from '../worker/base-of.js';
6
+ import { ensureContainsBase } from '../worker/ensure-contains-base.js';
7
+ import { installDependencies } from '../worker/install-dependencies.js';
8
+ import { installNotes } from '../worker/install-notes.js';
9
+ import { isWorktree } from '../worker/is-worktree.js';
10
+ import { repositoryPrefix } from '../worker/repository-prefix.js';
11
+ import { upstreamOf } from '../worker/upstream-of.js';
12
+ import { worktreeOf } from '../worker/worktree-of.js';
13
+ const NAME = /^[a-z0-9][a-z0-9._-]*$/i;
14
+ /**
15
+ * The worktree of one piece of work that is neither a story nor the worker of a plan:
16
+ * `.worktrees/<name>` in the project of the main checkout (next to the project while its
17
+ * .gitignore does not hold `.worktrees/`), on `work/<name>` cut from the base,
18
+ * with the clean install of its package manager. An existing one is kept: the work resumes there.
19
+ */
20
+ export function openWorktree(root, config, request) {
21
+ const name = nameOf(request.name);
22
+ const prefix = repositoryPrefix(root);
23
+ const base = baseOf(root, config, request.base ?? upstreamOf(root));
24
+ const { worktree, note } = worktreeOf(root, undefined, name);
25
+ const branch = request.branch ?? `work/${name}`;
26
+ const inside = path.join(worktree, prefix);
27
+ const created = !isWorktree(root, worktree);
28
+ if (!created) {
29
+ ensureContainsBase(worktree, runGit(worktree, ['branch', '--show-current'])?.trim() || 'HEAD', base);
30
+ }
31
+ const install = created && !request.dryRun ? prepare(root, config, { worktree, inside, branch, base, request }) : undefined;
32
+ return {
33
+ name,
34
+ dryRun: request.dryRun,
35
+ worktree: inside,
36
+ branch,
37
+ base,
38
+ created,
39
+ ...(install === undefined ? {} : { install }),
40
+ notes: [...(note === undefined ? [] : [note]), ...notesAfter(request, { inside, config, install })],
41
+ };
42
+ }
43
+ /** The worktree it creates, then its clean install unless refused. */
44
+ function prepare(root, config, place) {
45
+ addWorktree(root, place);
46
+ return place.request.install ? installDependencies(place.inside, config.stack.packageManager) : undefined;
47
+ }
48
+ function nameOf(name) {
49
+ if (!NAME.test(name)) {
50
+ throw new CliError(`"${name}" cannot name a worktree.`, 'Name the work in a few letters, digits, dots or dashes: `npx ddd-ts-kit worktree invoice-totals`.');
51
+ }
52
+ return name;
53
+ }
54
+ function notesAfter(request, { inside, config, install }) {
55
+ return request.dryRun ? [] : installNotes(inside, config, install);
56
+ }
57
+ //# sourceMappingURL=open-worktree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-worktree.js","sourceRoot":"","sources":["../../src/worktree/open-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE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;AAED,SAAS,UAAU,CACjB,OAAwB,EACxB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAA8E;IAEvG,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DependencyInstall } from '../worker/install-dependencies.js';
2
+ /** What `worktree` prepared, or would prepare in a dry run. */
3
+ export interface WorktreeScope {
4
+ readonly name: string;
5
+ readonly dryRun: boolean;
6
+ /** The project inside the worktree: where every command of the session runs. */
7
+ readonly worktree: string;
8
+ readonly branch: string;
9
+ readonly base: string;
10
+ /** False when the worktree was already there: the work resumes. */
11
+ readonly created: boolean;
12
+ readonly install?: DependencyInstall;
13
+ readonly notes: readonly string[];
14
+ }
15
+ //# sourceMappingURL=worktree-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-scope.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=worktree-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-scope.js","sourceRoot":"","sources":["../../src/worktree/worktree-scope.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-ts-kit",
3
- "version": "0.26.0",
3
+ "version": "0.82.0",
4
4
  "description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
5
5
  "keywords": [
6
6
  "ddd",
@@ -52,6 +52,6 @@
52
52
  "clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
53
53
  },
54
54
  "devDependencies": {
55
- "@ddd-ts-kit/kernel": "^0.26.0"
55
+ "@ddd-ts-kit/kernel": "^0.82.0"
56
56
  }
57
57
  }
@@ -0,0 +1,35 @@
1
+ {{#if tests.vitest}}
2
+ import { afterAll, beforeAll, beforeEach, describe, it, onTestFailed } from 'vitest';
3
+ {{/if}}
4
+ {{#if tests.jest}}
5
+ import { afterAll, beforeAll, beforeEach, describe, it } from '@jest/globals';
6
+ {{/if}}
7
+ {{#if tests.vitest}}
8
+ import { reportSeedOnFailure } from '@ddd-ts-kit/testing/faker';
9
+ {{/if}}
10
+ import { startApplication, type RunningApplication } from '{{alias.test}}/e2e/support/start-application{{alias.ext}}';
11
+
12
+ // The acceptance of {{story.id}}, written before its code: one scenario per acceptance criterion, as a client sees it through the API (routes, answers, integration events), never through a class of src/ nor the database. A scenario's title starts with the rows that make it pass, then the criterion it proves (`#{{story.example}} AC1 ...`); its body stays wrapped in `pending(...)` of `@ddd-ts-kit/testing/e2e` until they are built, and the commit of the last one removes the wrapper. Once written, `npx ddd-ts-kit acceptance {{story.id}} --lock`: a locked scenario then changes only with its criterion. `npx ddd-ts-kit acceptance {{story.id}} --gate written` says when the code may start.
13
+ // Rows to cover: {{story.rows}}.
14
+ describe('{{story.title}}, acceptance', () => {
15
+ let application: RunningApplication;
16
+
17
+ beforeAll(async () => {
18
+ application = await startApplication();
19
+ });
20
+
21
+ afterAll(async () => {
22
+ await application.close();
23
+ });
24
+
25
+ beforeEach(async () => {
26
+ await application.reset();
27
+ });
28
+ {{#if tests.vitest}}
29
+
30
+ reportSeedOnFailure({ beforeEach, onTestFailed });
31
+ {{/if}}
32
+
33
+ // TODO(domain): replace each entry by the scenarios of the acceptance criteria it covers, given / when / then, each one `it('#<row> <what the client observes>', pending(async () => { ... }))`, and run them (`npm run test:e2e -- test/acceptance`) to see each fail on an assertion.
34
+ {{story.todos}}
35
+ });
@@ -2,5 +2,6 @@ node_modules
2
2
  dist
3
3
  coverage
4
4
  .git
5
+ .worktrees
5
6
  .env
6
7
  *.tsbuildinfo
@@ -2,7 +2,7 @@ import base from './jest.config.js';
2
2
 
3
3
  export default {
4
4
  ...base,
5
- testMatch: ['<rootDir>/test/e2e/**/*.e2e.spec.ts'],
5
+ testMatch: ['<rootDir>/test/e2e/**/*.e2e.spec.ts', '<rootDir>/test/acceptance/**/*.acceptance.spec.ts'],
6
6
  testTimeout: 20000,
7
7
  maxWorkers: 1,
8
8
  };
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  // An import alias is resolved from the "paths" of tsconfig.json, which name the sources.
12
12
  resolve: { tsconfigPaths: true },
13
13
  test: {
14
- include: ['test/e2e/**/*.e2e.spec.ts'],
14
+ include: ['test/e2e/**/*.e2e.spec.ts', 'test/acceptance/**/*.acceptance.spec.ts'],
15
15
  {{#if assembly.discovery}}
16
16
  // Discovery imports the role files of a context itself: inlined, the package loads them through the runner, which compiles them.
17
17
  server: { deps: { inline: ['@ddd-ts-kit/di'] } },
@@ -4,6 +4,7 @@ dist
4
4
  .env
5
5
  *.tsbuildinfo
6
6
  .ddd-ts-kit/
7
+ .worktrees/
7
8
  {{#if orm.prisma}}
8
9
  generated
9
10
  {{/if}}
@@ -13,6 +13,7 @@
13
13
  "!**/dist",
14
14
  "!**/coverage",
15
15
  "!**/reports",
16
+ "!**/.worktrees",
16
17
  "!**/generated",
17
18
  "!**/package-lock.json",
18
19
  "!**/.dependency-cruiser.cjs",
@@ -2,11 +2,11 @@
2
2
  "scripts": {
3
3
  "typecheck": "node node_modules/@typescript/native/bin/tsc -p tsconfig.json --noEmit",
4
4
  "build": "node node_modules/@typescript/native/bin/tsc -p tsconfig.build.json && ddd-ts-kit build-aliases",
5
- "lint": "eslint .",
5
+ "lint": "ddd-ts-kit lint",
6
6
  "format": "biome format --write .",
7
7
  "format:check": "biome format .",
8
8
  "ci:typecheck": "npm run typecheck",
9
- "ci:lint": "eslint .",
9
+ "ci:lint": "ddd-ts-kit lint",
10
10
  "ci:format": "npm run format:check",
11
11
  "ci:arch": "npm run ci:arch:check && npm run ci:arch:graph",
12
12
  "ci:arch:check": "ddd-ts-kit check",
@@ -23,7 +23,7 @@
23
23
  "@biomejs/biome": "2.5.15",
24
24
  "@commitlint/cli": "^21.2.3",
25
25
  "@commitlint/config-conventional": "^21.2.3",
26
- "@ddd-ts-kit/eslint-plugin": "^0.26.0",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.82.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",