ddd-ts-kit 0.26.0 → 0.27.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 (360) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.fr.md +4 -3
  3. package/README.md +3 -2
  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 +2 -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 +1 -0
  113. package/dist/check/catalogue/default-severities.js.map +1 -1
  114. package/dist/check/configuration/config-inspection.d.ts +1 -0
  115. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  116. package/dist/check/configuration/config-inspection.js +9 -1
  117. package/dist/check/configuration/config-inspection.js.map +1 -1
  118. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  119. package/dist/check/explain/tree-docs.js +9 -0
  120. package/dist/check/explain/tree-docs.js.map +1 -1
  121. package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
  122. package/dist/check/fixtures/test-fixtures.js +35 -0
  123. package/dist/check/fixtures/test-fixtures.js.map +1 -1
  124. package/dist/check/project/walk-directory.js +1 -1
  125. package/dist/check/project/walk-directory.js.map +1 -1
  126. package/dist/check/rules/config-valid.d.ts.map +1 -1
  127. package/dist/check/rules/config-valid.js +1 -0
  128. package/dist/check/rules/config-valid.js.map +1 -1
  129. package/dist/check/rules/test-acceptance-black-box.d.ts +3 -0
  130. package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -0
  131. package/dist/check/rules/test-acceptance-black-box.js +38 -0
  132. package/dist/check/rules/test-acceptance-black-box.js.map +1 -0
  133. package/dist/commands/acceptance.d.ts +11 -0
  134. package/dist/commands/acceptance.d.ts.map +1 -0
  135. package/dist/commands/acceptance.js +63 -0
  136. package/dist/commands/acceptance.js.map +1 -0
  137. package/dist/commands/plan-waves.d.ts.map +1 -1
  138. package/dist/commands/plan-waves.js +1 -2
  139. package/dist/commands/plan-waves.js.map +1 -1
  140. package/dist/commands/stories.d.ts +9 -0
  141. package/dist/commands/stories.d.ts.map +1 -0
  142. package/dist/commands/stories.js +16 -0
  143. package/dist/commands/stories.js.map +1 -0
  144. package/dist/commands/story-scope.d.ts +4 -0
  145. package/dist/commands/story-scope.d.ts.map +1 -0
  146. package/dist/commands/story-scope.js +34 -0
  147. package/dist/commands/story-scope.js.map +1 -0
  148. package/dist/commands/story.d.ts +9 -0
  149. package/dist/commands/story.d.ts.map +1 -0
  150. package/dist/commands/story.js +45 -0
  151. package/dist/commands/story.js.map +1 -0
  152. package/dist/commands/worker-scope.d.ts.map +1 -1
  153. package/dist/commands/worker-scope.js +2 -0
  154. package/dist/commands/worker-scope.js.map +1 -1
  155. package/dist/commands/worktree.d.ts +7 -0
  156. package/dist/commands/worktree.d.ts.map +1 -0
  157. package/dist/commands/worktree.js +34 -0
  158. package/dist/commands/worktree.js.map +1 -0
  159. package/dist/config/config.d.ts +7 -0
  160. package/dist/config/config.d.ts.map +1 -1
  161. package/dist/config/index.d.ts +1 -0
  162. package/dist/config/index.d.ts.map +1 -1
  163. package/dist/config/index.js +1 -0
  164. package/dist/config/index.js.map +1 -1
  165. package/dist/config/parse-config.js +1 -0
  166. package/dist/config/parse-config.js.map +1 -1
  167. package/dist/config/serialize-config.js +1 -0
  168. package/dist/config/serialize-config.js.map +1 -1
  169. package/dist/config/worktree-modes.d.ts +3 -0
  170. package/dist/config/worktree-modes.d.ts.map +1 -0
  171. package/dist/config/worktree-modes.js +3 -0
  172. package/dist/config/worktree-modes.js.map +1 -0
  173. package/dist/generate/kinds/acceptance-kind.d.ts +3 -0
  174. package/dist/generate/kinds/acceptance-kind.d.ts.map +1 -0
  175. package/dist/generate/kinds/acceptance-kind.js +69 -0
  176. package/dist/generate/kinds/acceptance-kind.js.map +1 -0
  177. package/dist/generate/kinds.d.ts.map +1 -1
  178. package/dist/generate/kinds.js +2 -0
  179. package/dist/generate/kinds.js.map +1 -1
  180. package/dist/generate/shared-writes.d.ts.map +1 -1
  181. package/dist/generate/shared-writes.js +3 -0
  182. package/dist/generate/shared-writes.js.map +1 -1
  183. package/dist/help/notes.d.ts +1 -1
  184. package/dist/help/notes.d.ts.map +1 -1
  185. package/dist/help/notes.js +50 -2
  186. package/dist/help/notes.js.map +1 -1
  187. package/dist/help/usage.d.ts +1 -1
  188. package/dist/help/usage.d.ts.map +1 -1
  189. package/dist/help/usage.js +6 -0
  190. package/dist/help/usage.js.map +1 -1
  191. package/dist/init/agent-permissions.d.ts.map +1 -1
  192. package/dist/init/agent-permissions.js +9 -1
  193. package/dist/init/agent-permissions.js.map +1 -1
  194. package/dist/init/ignore-worktrees.d.ts +7 -0
  195. package/dist/init/ignore-worktrees.d.ts.map +1 -0
  196. package/dist/init/ignore-worktrees.js +15 -0
  197. package/dist/init/ignore-worktrees.js.map +1 -0
  198. package/dist/init/manifest/versions.js +24 -24
  199. package/dist/init/run-init.d.ts.map +1 -1
  200. package/dist/init/run-init.js +9 -3
  201. package/dist/init/run-init.js.map +1 -1
  202. package/dist/plan/batched-waves.d.ts +0 -2
  203. package/dist/plan/batched-waves.d.ts.map +1 -1
  204. package/dist/plan/batched-waves.js +4 -4
  205. package/dist/plan/batched-waves.js.map +1 -1
  206. package/dist/plan/plan-waves.d.ts +0 -2
  207. package/dist/plan/plan-waves.d.ts.map +1 -1
  208. package/dist/plan/plan-waves.js +2 -2
  209. package/dist/plan/plan-waves.js.map +1 -1
  210. package/dist/run.d.ts.map +1 -1
  211. package/dist/run.js +10 -0
  212. package/dist/run.js.map +1 -1
  213. package/dist/slice/plan-staging.d.ts +1 -1
  214. package/dist/slice/plan-staging.d.ts.map +1 -1
  215. package/dist/slice/plan-staging.js +5 -2
  216. package/dist/slice/plan-staging.js.map +1 -1
  217. package/dist/stories/forecast-merge.d.ts +14 -0
  218. package/dist/stories/forecast-merge.d.ts.map +1 -0
  219. package/dist/stories/forecast-merge.js +44 -0
  220. package/dist/stories/forecast-merge.js.map +1 -0
  221. package/dist/stories/format-stories.d.ts +4 -0
  222. package/dist/stories/format-stories.d.ts.map +1 -0
  223. package/dist/stories/format-stories.js +66 -0
  224. package/dist/stories/format-stories.js.map +1 -0
  225. package/dist/stories/format-story-phases.d.ts +5 -0
  226. package/dist/stories/format-story-phases.d.ts.map +1 -0
  227. package/dist/stories/format-story-phases.js +14 -0
  228. package/dist/stories/format-story-phases.js.map +1 -0
  229. package/dist/stories/merge-forecast.d.ts +18 -0
  230. package/dist/stories/merge-forecast.d.ts.map +1 -0
  231. package/dist/stories/merge-forecast.js +2 -0
  232. package/dist/stories/merge-forecast.js.map +1 -0
  233. package/dist/stories/open-stories.d.ts +8 -0
  234. package/dist/stories/open-stories.d.ts.map +1 -0
  235. package/dist/stories/open-stories.js +31 -0
  236. package/dist/stories/open-stories.js.map +1 -0
  237. package/dist/stories/open-story-scope.d.ts +23 -0
  238. package/dist/stories/open-story-scope.d.ts.map +1 -0
  239. package/dist/stories/open-story-scope.js +86 -0
  240. package/dist/stories/open-story-scope.js.map +1 -0
  241. package/dist/stories/open-story.d.ts +11 -0
  242. package/dist/stories/open-story.d.ts.map +1 -0
  243. package/dist/stories/open-story.js +2 -0
  244. package/dist/stories/open-story.js.map +1 -0
  245. package/dist/stories/read-stories.d.ts +9 -0
  246. package/dist/stories/read-stories.d.ts.map +1 -0
  247. package/dist/stories/read-stories.js +60 -0
  248. package/dist/stories/read-stories.js.map +1 -0
  249. package/dist/stories/read-story-phases.d.ts +10 -0
  250. package/dist/stories/read-story-phases.d.ts.map +1 -0
  251. package/dist/stories/read-story-phases.js +144 -0
  252. package/dist/stories/read-story-phases.js.map +1 -0
  253. package/dist/stories/read-story-place.d.ts +4 -0
  254. package/dist/stories/read-story-place.d.ts.map +1 -0
  255. package/dist/stories/read-story-place.js +23 -0
  256. package/dist/stories/read-story-place.js.map +1 -0
  257. package/dist/stories/review-file-of.d.ts +4 -0
  258. package/dist/stories/review-file-of.d.ts.map +1 -0
  259. package/dist/stories/review-file-of.js +7 -0
  260. package/dist/stories/review-file-of.js.map +1 -0
  261. package/dist/stories/section-of.d.ts +3 -0
  262. package/dist/stories/section-of.d.ts.map +1 -0
  263. package/dist/stories/section-of.js +11 -0
  264. package/dist/stories/section-of.js.map +1 -0
  265. package/dist/stories/stories-view.d.ts +13 -0
  266. package/dist/stories/stories-view.d.ts.map +1 -0
  267. package/dist/stories/stories-view.js +2 -0
  268. package/dist/stories/stories-view.js.map +1 -0
  269. package/dist/stories/story-crossing.d.ts +16 -0
  270. package/dist/stories/story-crossing.d.ts.map +1 -0
  271. package/dist/stories/story-crossing.js +2 -0
  272. package/dist/stories/story-crossing.js.map +1 -0
  273. package/dist/stories/story-gate.d.ts +4 -0
  274. package/dist/stories/story-gate.d.ts.map +1 -0
  275. package/dist/stories/story-gate.js +2 -0
  276. package/dist/stories/story-gate.js.map +1 -0
  277. package/dist/stories/story-phase.d.ts +13 -0
  278. package/dist/stories/story-phase.d.ts.map +1 -0
  279. package/dist/stories/story-phase.js +2 -0
  280. package/dist/stories/story-phase.js.map +1 -0
  281. package/dist/stories/story-place.d.ts +14 -0
  282. package/dist/stories/story-place.d.ts.map +1 -0
  283. package/dist/stories/story-place.js +2 -0
  284. package/dist/stories/story-place.js.map +1 -0
  285. package/dist/stories/story-scope-file.d.ts +3 -0
  286. package/dist/stories/story-scope-file.d.ts.map +1 -0
  287. package/dist/stories/story-scope-file.js +3 -0
  288. package/dist/stories/story-scope-file.js.map +1 -0
  289. package/dist/stories/story-scope.d.ts +17 -0
  290. package/dist/stories/story-scope.d.ts.map +1 -0
  291. package/dist/stories/story-scope.js +2 -0
  292. package/dist/stories/story-scope.js.map +1 -0
  293. package/dist/stories/story-state.d.ts +13 -0
  294. package/dist/stories/story-state.d.ts.map +1 -0
  295. package/dist/stories/story-state.js +2 -0
  296. package/dist/stories/story-state.js.map +1 -0
  297. package/dist/stories/trunk-phase.d.ts +8 -0
  298. package/dist/stories/trunk-phase.d.ts.map +1 -0
  299. package/dist/stories/trunk-phase.js +27 -0
  300. package/dist/stories/trunk-phase.js.map +1 -0
  301. package/dist/version.d.ts +1 -1
  302. package/dist/version.js +1 -1
  303. package/dist/worker/add-worktree.d.ts +7 -0
  304. package/dist/worker/add-worktree.d.ts.map +1 -0
  305. package/dist/worker/add-worktree.js +13 -0
  306. package/dist/worker/add-worktree.js.map +1 -0
  307. package/dist/worker/branch-exists.d.ts +3 -0
  308. package/dist/worker/branch-exists.d.ts.map +1 -0
  309. package/dist/worker/branch-exists.js +6 -0
  310. package/dist/worker/branch-exists.js.map +1 -0
  311. package/dist/worker/briefed-rows.js +1 -1
  312. package/dist/worker/briefed-rows.js.map +1 -1
  313. package/dist/worker/ensure-ignored.d.ts +7 -0
  314. package/dist/worker/ensure-ignored.d.ts.map +1 -0
  315. package/dist/worker/ensure-ignored.js +17 -0
  316. package/dist/worker/ensure-ignored.js.map +1 -0
  317. package/dist/worker/install-notes.d.ts +9 -0
  318. package/dist/worker/install-notes.d.ts.map +1 -0
  319. package/dist/worker/install-notes.js +25 -0
  320. package/dist/worker/install-notes.js.map +1 -0
  321. package/dist/worker/is-worktree.d.ts +3 -0
  322. package/dist/worker/is-worktree.d.ts.map +1 -0
  323. package/dist/worker/is-worktree.js +15 -0
  324. package/dist/worker/is-worktree.js.map +1 -0
  325. package/dist/worker/open-worker-scope.d.ts +6 -1
  326. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  327. package/dist/worker/open-worker-scope.js +29 -36
  328. package/dist/worker/open-worker-scope.js.map +1 -1
  329. package/dist/worker/repository-prefix.d.ts +3 -0
  330. package/dist/worker/repository-prefix.d.ts.map +1 -0
  331. package/dist/worker/repository-prefix.js +14 -0
  332. package/dist/worker/repository-prefix.js.map +1 -0
  333. package/dist/worker/upstream-of.d.ts +8 -0
  334. package/dist/worker/upstream-of.d.ts.map +1 -0
  335. package/dist/worker/upstream-of.js +18 -0
  336. package/dist/worker/upstream-of.js.map +1 -0
  337. package/dist/worker/worktree-home.d.ts +9 -0
  338. package/dist/worker/worktree-home.d.ts.map +1 -0
  339. package/dist/worker/worktree-home.js +17 -0
  340. package/dist/worker/worktree-home.js.map +1 -0
  341. package/dist/worker/worktree-of.d.ts +13 -0
  342. package/dist/worker/worktree-of.d.ts.map +1 -0
  343. package/dist/worker/worktree-of.js +30 -0
  344. package/dist/worker/worktree-of.js.map +1 -0
  345. package/dist/worktree/open-worktree.d.ts +20 -0
  346. package/dist/worktree/open-worktree.d.ts.map +1 -0
  347. package/dist/worktree/open-worktree.js +57 -0
  348. package/dist/worktree/open-worktree.js.map +1 -0
  349. package/dist/worktree/worktree-scope.d.ts +15 -0
  350. package/dist/worktree/worktree-scope.d.ts.map +1 -0
  351. package/dist/worktree/worktree-scope.js +2 -0
  352. package/dist/worktree/worktree-scope.js.map +1 -0
  353. package/package.json +2 -2
  354. package/templates/acceptance/acceptance.spec.ts.tpl +35 -0
  355. package/templates/init/docker/dockerignore.tpl +1 -0
  356. package/templates/init/e2e/jest.e2e.config.js.tpl +1 -1
  357. package/templates/init/e2e/vitest.e2e.config.ts.tpl +1 -1
  358. package/templates/init/gitignore.tpl +1 -0
  359. package/templates/pipeline/biome.json.tpl +1 -0
  360. package/templates/pipeline/package-scripts.json +1 -1
@@ -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,EA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G,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;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.27.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.27.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",
@@ -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.27.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",