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.
- package/CHANGELOG.md +225 -0
- package/README.fr.md +62 -15
- package/README.md +56 -14
- package/dist/acceptance/acceptance-file-of.d.ts +5 -0
- package/dist/acceptance/acceptance-file-of.d.ts.map +1 -0
- package/dist/acceptance/acceptance-file-of.js +7 -0
- package/dist/acceptance/acceptance-file-of.js.map +1 -0
- package/dist/acceptance/acceptance-gate.d.ts +8 -0
- package/dist/acceptance/acceptance-gate.d.ts.map +1 -0
- package/dist/acceptance/acceptance-gate.js +2 -0
- package/dist/acceptance/acceptance-gate.js.map +1 -0
- package/dist/acceptance/acceptance-lock.d.ts +32 -0
- package/dist/acceptance/acceptance-lock.d.ts.map +1 -0
- package/dist/acceptance/acceptance-lock.js +2 -0
- package/dist/acceptance/acceptance-lock.js.map +1 -0
- package/dist/acceptance/acceptance-problem.d.ts +15 -0
- package/dist/acceptance/acceptance-problem.d.ts.map +1 -0
- package/dist/acceptance/acceptance-problem.js +2 -0
- package/dist/acceptance/acceptance-problem.js.map +1 -0
- package/dist/acceptance/commentless.d.ts +4 -0
- package/dist/acceptance/commentless.d.ts.map +1 -0
- package/dist/acceptance/commentless.js +31 -0
- package/dist/acceptance/commentless.js.map +1 -0
- package/dist/acceptance/counts-for.d.ts +5 -0
- package/dist/acceptance/counts-for.d.ts.map +1 -0
- package/dist/acceptance/counts-for.js +8 -0
- package/dist/acceptance/counts-for.js.map +1 -0
- package/dist/acceptance/criteria-in.d.ts +14 -0
- package/dist/acceptance/criteria-in.d.ts.map +1 -0
- package/dist/acceptance/criteria-in.js +34 -0
- package/dist/acceptance/criteria-in.js.map +1 -0
- package/dist/acceptance/drift.d.ts +30 -0
- package/dist/acceptance/drift.d.ts.map +1 -0
- package/dist/acceptance/drift.js +44 -0
- package/dist/acceptance/drift.js.map +1 -0
- package/dist/acceptance/format-acceptance.d.ts +5 -0
- package/dist/acceptance/format-acceptance.d.ts.map +1 -0
- package/dist/acceptance/format-acceptance.js +40 -0
- package/dist/acceptance/format-acceptance.js.map +1 -0
- package/dist/acceptance/lock-acceptance.d.ts +24 -0
- package/dist/acceptance/lock-acceptance.d.ts.map +1 -0
- package/dist/acceptance/lock-acceptance.js +58 -0
- package/dist/acceptance/lock-acceptance.js.map +1 -0
- package/dist/acceptance/lock-file-of.d.ts +3 -0
- package/dist/acceptance/lock-file-of.d.ts.map +1 -0
- package/dist/acceptance/lock-file-of.js +6 -0
- package/dist/acceptance/lock-file-of.js.map +1 -0
- package/dist/acceptance/lock-problems.d.ts +21 -0
- package/dist/acceptance/lock-problems.d.ts.map +1 -0
- package/dist/acceptance/lock-problems.js +58 -0
- package/dist/acceptance/lock-problems.js.map +1 -0
- package/dist/acceptance/read-acceptance.d.ts +9 -0
- package/dist/acceptance/read-acceptance.d.ts.map +1 -0
- package/dist/acceptance/read-acceptance.js +76 -0
- package/dist/acceptance/read-acceptance.js.map +1 -0
- package/dist/acceptance/read-lock.d.ts +5 -0
- package/dist/acceptance/read-lock.d.ts.map +1 -0
- package/dist/acceptance/read-lock.js +45 -0
- package/dist/acceptance/read-lock.js.map +1 -0
- package/dist/acceptance/read-verdicts.d.ts +9 -0
- package/dist/acceptance/read-verdicts.d.ts.map +1 -0
- package/dist/acceptance/read-verdicts.js +35 -0
- package/dist/acceptance/read-verdicts.js.map +1 -0
- package/dist/acceptance/scenario-problems.d.ts +12 -0
- package/dist/acceptance/scenario-problems.d.ts.map +1 -0
- package/dist/acceptance/scenario-problems.js +74 -0
- package/dist/acceptance/scenario-problems.js.map +1 -0
- package/dist/acceptance/scenario.d.ts +23 -0
- package/dist/acceptance/scenario.d.ts.map +1 -0
- package/dist/acceptance/scenario.js +2 -0
- package/dist/acceptance/scenario.js.map +1 -0
- package/dist/acceptance/scenarios-in.d.ts +4 -0
- package/dist/acceptance/scenarios-in.d.ts.map +1 -0
- package/dist/acceptance/scenarios-in.js +68 -0
- package/dist/acceptance/scenarios-in.js.map +1 -0
- package/dist/acceptance/story-acceptance.d.ts +29 -0
- package/dist/acceptance/story-acceptance.d.ts.map +1 -0
- package/dist/acceptance/story-acceptance.js +2 -0
- package/dist/acceptance/story-acceptance.js.map +1 -0
- package/dist/acceptance/story-file-of.d.ts +4 -0
- package/dist/acceptance/story-file-of.d.ts.map +1 -0
- package/dist/acceptance/story-file-of.js +8 -0
- package/dist/acceptance/story-file-of.js.map +1 -0
- package/dist/acceptance/story-of-file.d.ts +3 -0
- package/dist/acceptance/story-of-file.d.ts.map +1 -0
- package/dist/acceptance/story-of-file.js +6 -0
- package/dist/acceptance/story-of-file.js.map +1 -0
- package/dist/acceptance/story-of-row.d.ts +3 -0
- package/dist/acceptance/story-of-row.d.ts.map +1 -0
- package/dist/acceptance/story-of-row.js +6 -0
- package/dist/acceptance/story-of-row.js.map +1 -0
- package/dist/acceptance/story-problems.d.ts +16 -0
- package/dist/acceptance/story-problems.d.ts.map +1 -0
- package/dist/acceptance/story-problems.js +48 -0
- package/dist/acceptance/story-problems.js.map +1 -0
- package/dist/acceptance/verdict-on.d.ts +8 -0
- package/dist/acceptance/verdict-on.d.ts.map +1 -0
- package/dist/acceptance/verdict-on.js +9 -0
- package/dist/acceptance/verdict-on.js.map +1 -0
- package/dist/acceptance/verdict.d.ts +14 -0
- package/dist/acceptance/verdict.d.ts.map +1 -0
- package/dist/acceptance/verdict.js +2 -0
- package/dist/acceptance/verdict.js.map +1 -0
- package/dist/acceptance/verdicts-dir.d.ts +3 -0
- package/dist/acceptance/verdicts-dir.d.ts.map +1 -0
- package/dist/acceptance/verdicts-dir.js +3 -0
- package/dist/acceptance/verdicts-dir.js.map +1 -0
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +6 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/catalogue/default-severities.d.ts.map +1 -1
- package/dist/check/catalogue/default-severities.js +3 -0
- package/dist/check/catalogue/default-severities.js.map +1 -1
- package/dist/check/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +4 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/explain-command.d.ts.map +1 -1
- package/dist/check/commands/explain-command.js +2 -9
- package/dist/check/commands/explain-command.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +1 -0
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +9 -1
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/engine/format-check.d.ts +6 -1
- package/dist/check/engine/format-check.d.ts.map +1 -1
- package/dist/check/engine/format-check.js +33 -11
- package/dist/check/engine/format-check.js.map +1 -1
- package/dist/check/explain/documented-rule.d.ts +8 -0
- package/dist/check/explain/documented-rule.d.ts.map +1 -0
- package/dist/check/explain/documented-rule.js +14 -0
- package/dist/check/explain/documented-rule.js.map +1 -0
- package/dist/check/explain/explanations-of.d.ts +5 -0
- package/dist/check/explain/explanations-of.d.ts.map +1 -0
- package/dist/check/explain/explanations-of.js +16 -0
- package/dist/check/explain/explanations-of.js.map +1 -0
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +7 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +9 -0
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +13 -0
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +78 -1
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/persistence-fixtures.js +25 -0
- package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
- package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/test-fixtures.js +35 -0
- package/dist/check/fixtures/test-fixtures.js.map +1 -1
- package/dist/check/model/rule-explanation.d.ts +10 -0
- package/dist/check/model/rule-explanation.d.ts.map +1 -0
- package/dist/check/model/rule-explanation.js +2 -0
- package/dist/check/model/rule-explanation.js.map +1 -0
- package/dist/check/project/walk-directory.js +1 -1
- package/dist/check/project/walk-directory.js.map +1 -1
- package/dist/check/rules/config-valid.d.ts.map +1 -1
- package/dist/check/rules/config-valid.js +1 -0
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
- package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
- package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
- package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
- package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
- package/dist/check/rules/persistence-primary-key-order.js +31 -0
- package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
- package/dist/check/rules/test-acceptance-black-box.d.ts +3 -0
- package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -0
- package/dist/check/rules/test-acceptance-black-box.js +38 -0
- package/dist/check/rules/test-acceptance-black-box.js.map +1 -0
- package/dist/commands/acceptance.d.ts +11 -0
- package/dist/commands/acceptance.d.ts.map +1 -0
- package/dist/commands/acceptance.js +63 -0
- package/dist/commands/acceptance.js.map +1 -0
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +20 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/lint.d.ts +7 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +55 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/plan-waves.d.ts.map +1 -1
- package/dist/commands/plan-waves.js +1 -2
- package/dist/commands/plan-waves.js.map +1 -1
- package/dist/commands/stories.d.ts +9 -0
- package/dist/commands/stories.d.ts.map +1 -0
- package/dist/commands/stories.js +16 -0
- package/dist/commands/stories.js.map +1 -0
- package/dist/commands/story-scope.d.ts +4 -0
- package/dist/commands/story-scope.d.ts.map +1 -0
- package/dist/commands/story-scope.js +34 -0
- package/dist/commands/story-scope.js.map +1 -0
- package/dist/commands/story.d.ts +9 -0
- package/dist/commands/story.d.ts.map +1 -0
- package/dist/commands/story.js +45 -0
- package/dist/commands/story.js.map +1 -0
- package/dist/commands/worker-scope.d.ts.map +1 -1
- package/dist/commands/worker-scope.js +2 -0
- package/dist/commands/worker-scope.js.map +1 -1
- package/dist/commands/worktree.d.ts +7 -0
- package/dist/commands/worktree.d.ts.map +1 -0
- package/dist/commands/worktree.js +34 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/config/config.d.ts +9 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +3 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/restack-config-text.d.ts +3 -2
- package/dist/config/restack-config-text.d.ts.map +1 -1
- package/dist/config/restack-config-text.js +5 -3
- package/dist/config/restack-config-text.js.map +1 -1
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +3 -1
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/worktree-modes.d.ts +3 -0
- package/dist/config/worktree-modes.d.ts.map +1 -0
- package/dist/config/worktree-modes.js +3 -0
- package/dist/config/worktree-modes.js.map +1 -0
- package/dist/doctor/diagnose.d.ts +2 -0
- package/dist/doctor/diagnose.d.ts.map +1 -1
- package/dist/doctor/diagnose.js +22 -3
- package/dist/doctor/diagnose.js.map +1 -1
- package/dist/doctor/doctor-finding.d.ts +13 -5
- package/dist/doctor/doctor-finding.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.d.ts +4 -1
- package/dist/doctor/format-diagnosis.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.js +49 -3
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/in-range.d.ts +7 -0
- package/dist/doctor/in-range.d.ts.map +1 -0
- package/dist/doctor/in-range.js +90 -0
- package/dist/doctor/in-range.js.map +1 -0
- package/dist/doctor/install-findings.d.ts +11 -0
- package/dist/doctor/install-findings.d.ts.map +1 -0
- package/dist/doctor/install-findings.js +119 -0
- package/dist/doctor/install-findings.js.map +1 -0
- package/dist/doctor/node-findings.d.ts +7 -0
- package/dist/doctor/node-findings.d.ts.map +1 -0
- package/dist/doctor/node-findings.js +19 -0
- package/dist/doctor/node-findings.js.map +1 -0
- package/dist/doctor/package-findings.d.ts +2 -0
- package/dist/doctor/package-findings.d.ts.map +1 -1
- package/dist/doctor/package-findings.js +1 -1
- package/dist/doctor/package-findings.js.map +1 -1
- package/dist/doctor/submodule-findings.d.ts +7 -0
- package/dist/doctor/submodule-findings.d.ts.map +1 -0
- package/dist/doctor/submodule-findings.js +22 -0
- package/dist/doctor/submodule-findings.js.map +1 -0
- package/dist/generate/kinds/acceptance-kind.d.ts +3 -0
- package/dist/generate/kinds/acceptance-kind.d.ts.map +1 -0
- package/dist/generate/kinds/acceptance-kind.js +69 -0
- package/dist/generate/kinds/acceptance-kind.js.map +1 -0
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
- package/dist/generate/schedule/cron-problem.js +16 -1
- package/dist/generate/schedule/cron-problem.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +3 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +71 -10
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +8 -1
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.d.ts.map +1 -1
- package/dist/init/agent-permissions.js +9 -1
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/ignore-worktrees.d.ts +7 -0
- package/dist/init/ignore-worktrees.d.ts.map +1 -0
- package/dist/init/ignore-worktrees.js +15 -0
- package/dist/init/ignore-worktrees.js.map +1 -0
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +12 -4
- package/dist/init/run-init.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +8 -0
- package/dist/lint/eslint-in-project.d.ts.map +1 -0
- package/dist/lint/eslint-in-project.js +33 -0
- package/dist/lint/eslint-in-project.js.map +1 -0
- package/dist/lint/format-verdict.d.ts +4 -0
- package/dist/lint/format-verdict.d.ts.map +1 -0
- package/dist/lint/format-verdict.js +11 -0
- package/dist/lint/format-verdict.js.map +1 -0
- package/dist/lint/lint-run.d.ts +8 -0
- package/dist/lint/lint-run.d.ts.map +1 -0
- package/dist/lint/lint-run.js +2 -0
- package/dist/lint/lint-run.js.map +1 -0
- package/dist/lint/lint-verdict.d.ts +19 -0
- package/dist/lint/lint-verdict.d.ts.map +1 -0
- package/dist/lint/lint-verdict.js +25 -0
- package/dist/lint/lint-verdict.js.map +1 -0
- package/dist/lint/parse-lint-answer.d.ts +13 -0
- package/dist/lint/parse-lint-answer.d.ts.map +1 -0
- package/dist/lint/parse-lint-answer.js +18 -0
- package/dist/lint/parse-lint-answer.js.map +1 -0
- package/dist/migration/plan-replay.d.ts +4 -3
- package/dist/migration/plan-replay.d.ts.map +1 -1
- package/dist/migration/plan-replay.js +21 -6
- package/dist/migration/plan-replay.js.map +1 -1
- package/dist/migration/rename-branch-migrations.d.ts +13 -0
- package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
- package/dist/migration/rename-branch-migrations.js +25 -0
- package/dist/migration/rename-branch-migrations.js.map +1 -0
- package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
- package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
- package/dist/migration/replay-drizzle-migrations.js +48 -4
- package/dist/migration/replay-drizzle-migrations.js.map +1 -1
- package/dist/migration/replay-plan.d.ts +8 -0
- package/dist/migration/replay-plan.d.ts.map +1 -1
- package/dist/migration/restore-migration-folder.d.ts +4 -0
- package/dist/migration/restore-migration-folder.d.ts.map +1 -0
- package/dist/migration/restore-migration-folder.js +15 -0
- package/dist/migration/restore-migration-folder.js.map +1 -0
- package/dist/package-manager/lockfiles.d.ts +2 -0
- package/dist/package-manager/lockfiles.d.ts.map +1 -1
- package/dist/package-manager/lockfiles.js +5 -0
- package/dist/package-manager/lockfiles.js.map +1 -1
- package/dist/plan/batched-waves.d.ts +0 -2
- package/dist/plan/batched-waves.d.ts.map +1 -1
- package/dist/plan/batched-waves.js +4 -4
- package/dist/plan/batched-waves.js.map +1 -1
- package/dist/plan/plan-waves.d.ts +0 -2
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +2 -2
- package/dist/plan/plan-waves.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +12 -0
- package/dist/run.js.map +1 -1
- package/dist/slice/plan-staging.d.ts +1 -1
- package/dist/slice/plan-staging.d.ts.map +1 -1
- package/dist/slice/plan-staging.js +5 -2
- package/dist/slice/plan-staging.js.map +1 -1
- package/dist/stories/forecast-merge.d.ts +14 -0
- package/dist/stories/forecast-merge.d.ts.map +1 -0
- package/dist/stories/forecast-merge.js +44 -0
- package/dist/stories/forecast-merge.js.map +1 -0
- package/dist/stories/format-stories.d.ts +4 -0
- package/dist/stories/format-stories.d.ts.map +1 -0
- package/dist/stories/format-stories.js +66 -0
- package/dist/stories/format-stories.js.map +1 -0
- package/dist/stories/format-story-phases.d.ts +5 -0
- package/dist/stories/format-story-phases.d.ts.map +1 -0
- package/dist/stories/format-story-phases.js +14 -0
- package/dist/stories/format-story-phases.js.map +1 -0
- package/dist/stories/merge-forecast.d.ts +18 -0
- package/dist/stories/merge-forecast.d.ts.map +1 -0
- package/dist/stories/merge-forecast.js +2 -0
- package/dist/stories/merge-forecast.js.map +1 -0
- package/dist/stories/open-stories.d.ts +8 -0
- package/dist/stories/open-stories.d.ts.map +1 -0
- package/dist/stories/open-stories.js +31 -0
- package/dist/stories/open-stories.js.map +1 -0
- package/dist/stories/open-story-scope.d.ts +23 -0
- package/dist/stories/open-story-scope.d.ts.map +1 -0
- package/dist/stories/open-story-scope.js +86 -0
- package/dist/stories/open-story-scope.js.map +1 -0
- package/dist/stories/open-story.d.ts +11 -0
- package/dist/stories/open-story.d.ts.map +1 -0
- package/dist/stories/open-story.js +2 -0
- package/dist/stories/open-story.js.map +1 -0
- package/dist/stories/read-stories.d.ts +9 -0
- package/dist/stories/read-stories.d.ts.map +1 -0
- package/dist/stories/read-stories.js +60 -0
- package/dist/stories/read-stories.js.map +1 -0
- package/dist/stories/read-story-phases.d.ts +10 -0
- package/dist/stories/read-story-phases.d.ts.map +1 -0
- package/dist/stories/read-story-phases.js +144 -0
- package/dist/stories/read-story-phases.js.map +1 -0
- package/dist/stories/read-story-place.d.ts +4 -0
- package/dist/stories/read-story-place.d.ts.map +1 -0
- package/dist/stories/read-story-place.js +23 -0
- package/dist/stories/read-story-place.js.map +1 -0
- package/dist/stories/review-file-of.d.ts +4 -0
- package/dist/stories/review-file-of.d.ts.map +1 -0
- package/dist/stories/review-file-of.js +7 -0
- package/dist/stories/review-file-of.js.map +1 -0
- package/dist/stories/section-of.d.ts +3 -0
- package/dist/stories/section-of.d.ts.map +1 -0
- package/dist/stories/section-of.js +11 -0
- package/dist/stories/section-of.js.map +1 -0
- package/dist/stories/stories-view.d.ts +13 -0
- package/dist/stories/stories-view.d.ts.map +1 -0
- package/dist/stories/stories-view.js +2 -0
- package/dist/stories/stories-view.js.map +1 -0
- package/dist/stories/story-crossing.d.ts +16 -0
- package/dist/stories/story-crossing.d.ts.map +1 -0
- package/dist/stories/story-crossing.js +2 -0
- package/dist/stories/story-crossing.js.map +1 -0
- package/dist/stories/story-gate.d.ts +4 -0
- package/dist/stories/story-gate.d.ts.map +1 -0
- package/dist/stories/story-gate.js +2 -0
- package/dist/stories/story-gate.js.map +1 -0
- package/dist/stories/story-phase.d.ts +13 -0
- package/dist/stories/story-phase.d.ts.map +1 -0
- package/dist/stories/story-phase.js +2 -0
- package/dist/stories/story-phase.js.map +1 -0
- package/dist/stories/story-place.d.ts +14 -0
- package/dist/stories/story-place.d.ts.map +1 -0
- package/dist/stories/story-place.js +2 -0
- package/dist/stories/story-place.js.map +1 -0
- package/dist/stories/story-scope-file.d.ts +3 -0
- package/dist/stories/story-scope-file.d.ts.map +1 -0
- package/dist/stories/story-scope-file.js +3 -0
- package/dist/stories/story-scope-file.js.map +1 -0
- package/dist/stories/story-scope.d.ts +17 -0
- package/dist/stories/story-scope.d.ts.map +1 -0
- package/dist/stories/story-scope.js +2 -0
- package/dist/stories/story-scope.js.map +1 -0
- package/dist/stories/story-state.d.ts +13 -0
- package/dist/stories/story-state.d.ts.map +1 -0
- package/dist/stories/story-state.js +2 -0
- package/dist/stories/story-state.js.map +1 -0
- package/dist/stories/trunk-phase.d.ts +8 -0
- package/dist/stories/trunk-phase.d.ts.map +1 -0
- package/dist/stories/trunk-phase.js +27 -0
- package/dist/stories/trunk-phase.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/add-worktree.d.ts +7 -0
- package/dist/worker/add-worktree.d.ts.map +1 -0
- package/dist/worker/add-worktree.js +13 -0
- package/dist/worker/add-worktree.js.map +1 -0
- package/dist/worker/branch-exists.d.ts +3 -0
- package/dist/worker/branch-exists.d.ts.map +1 -0
- package/dist/worker/branch-exists.js +6 -0
- package/dist/worker/branch-exists.js.map +1 -0
- package/dist/worker/briefed-rows.js +1 -1
- package/dist/worker/briefed-rows.js.map +1 -1
- package/dist/worker/ensure-ignored.d.ts +7 -0
- package/dist/worker/ensure-ignored.d.ts.map +1 -0
- package/dist/worker/ensure-ignored.js +17 -0
- package/dist/worker/ensure-ignored.js.map +1 -0
- package/dist/worker/install-notes.d.ts +9 -0
- package/dist/worker/install-notes.d.ts.map +1 -0
- package/dist/worker/install-notes.js +25 -0
- package/dist/worker/install-notes.js.map +1 -0
- package/dist/worker/is-worktree.d.ts +3 -0
- package/dist/worker/is-worktree.d.ts.map +1 -0
- package/dist/worker/is-worktree.js +15 -0
- package/dist/worker/is-worktree.js.map +1 -0
- package/dist/worker/open-worker-scope.d.ts +6 -1
- package/dist/worker/open-worker-scope.d.ts.map +1 -1
- package/dist/worker/open-worker-scope.js +29 -36
- package/dist/worker/open-worker-scope.js.map +1 -1
- package/dist/worker/repository-prefix.d.ts +3 -0
- package/dist/worker/repository-prefix.d.ts.map +1 -0
- package/dist/worker/repository-prefix.js +14 -0
- package/dist/worker/repository-prefix.js.map +1 -0
- package/dist/worker/upstream-of.d.ts +8 -0
- package/dist/worker/upstream-of.d.ts.map +1 -0
- package/dist/worker/upstream-of.js +18 -0
- package/dist/worker/upstream-of.js.map +1 -0
- package/dist/worker/worktree-home.d.ts +9 -0
- package/dist/worker/worktree-home.d.ts.map +1 -0
- package/dist/worker/worktree-home.js +17 -0
- package/dist/worker/worktree-home.js.map +1 -0
- package/dist/worker/worktree-of.d.ts +13 -0
- package/dist/worker/worktree-of.d.ts.map +1 -0
- package/dist/worker/worktree-of.js +30 -0
- package/dist/worker/worktree-of.js.map +1 -0
- package/dist/worktree/open-worktree.d.ts +20 -0
- package/dist/worktree/open-worktree.d.ts.map +1 -0
- package/dist/worktree/open-worktree.js +57 -0
- package/dist/worktree/open-worktree.js.map +1 -0
- package/dist/worktree/worktree-scope.d.ts +15 -0
- package/dist/worktree/worktree-scope.d.ts.map +1 -0
- package/dist/worktree/worktree-scope.js +2 -0
- package/dist/worktree/worktree-scope.js.map +1 -0
- package/package.json +2 -2
- package/templates/acceptance/acceptance.spec.ts.tpl +35 -0
- package/templates/init/docker/dockerignore.tpl +1 -0
- package/templates/init/e2e/jest.e2e.config.js.tpl +1 -1
- package/templates/init/e2e/vitest.e2e.config.ts.tpl +1 -1
- package/templates/init/gitignore.tpl +1 -0
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/package-scripts.json +3 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
/** The open stories as text: one line each, where they meet, and what to do about it. */
|
|
3
|
+
export function formatStories(view, cwd) {
|
|
4
|
+
if (view.stories.length === 0) {
|
|
5
|
+
return 'No story is open in a worktree of this repository (`npx ddd-ts-kit story-scope <code>` opens one).';
|
|
6
|
+
}
|
|
7
|
+
return [
|
|
8
|
+
`Open stories (${view.stories.length})${view.here === undefined ? '' : `, this worktree takes ${view.here}`}; the trunk as ${view.fetched === undefined ? 'this repository holds it, never fetched' : `fetched ${view.fetched}`} (\`git fetch\` brings it up to date)`,
|
|
9
|
+
...view.stories.map((story) => ` ${storyLine(story, cwd)}`),
|
|
10
|
+
'',
|
|
11
|
+
...crossingsBlock(view),
|
|
12
|
+
...nextBlock(view),
|
|
13
|
+
].join('\n');
|
|
14
|
+
}
|
|
15
|
+
function storyLine(story, cwd) {
|
|
16
|
+
const contexts = story.contexts.length === 0 ? 'no row yet' : `contexts ${story.contexts.join(', ')}`;
|
|
17
|
+
const trunk = story.trunk === undefined ? '' : `; ${forecastText(story.trunk)}`;
|
|
18
|
+
return `${story.story} ${path.relative(cwd, story.worktree) || '.'} ${story.branch ?? 'detached'} ${contexts}, ${story.files.length} file(s) changed${trunk}`;
|
|
19
|
+
}
|
|
20
|
+
function crossingsBlock({ here, crossings }) {
|
|
21
|
+
if (crossings.length === 0) {
|
|
22
|
+
return [here === undefined ? 'No two of them meet.' : `${here} meets no other open story.`, ''];
|
|
23
|
+
}
|
|
24
|
+
return ['Where they meet', ...crossings.flatMap((crossing) => crossingLines(crossing)), ''];
|
|
25
|
+
}
|
|
26
|
+
function crossingLines({ stories: [first, second], contexts, files, merge }) {
|
|
27
|
+
return [
|
|
28
|
+
` ${first} and ${second}`,
|
|
29
|
+
...(contexts.length === 0 ? [] : [` contexts both change: ${contexts.join(', ')}`]),
|
|
30
|
+
...(files.length === 0 ? [] : [` files both change: ${files.join(', ')}`]),
|
|
31
|
+
...(merge === undefined ? [] : [` ${second} merged into ${first} now: ${forecastText(merge)}`]),
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
/** `3 commits of main behind, 2 conflicts: 1 settled by merge-trunk, 1 for you (src/a.ts)`. */
|
|
35
|
+
function forecastText({ ref, behind, settled, byHand }) {
|
|
36
|
+
if (behind === 0) {
|
|
37
|
+
return `${ref} merged in`;
|
|
38
|
+
}
|
|
39
|
+
const conflicts = settled.length + byHand.length;
|
|
40
|
+
const forYou = byHand.length === 0 ? '' : `, ${byHand.length} for you (${byHand.map(({ file }) => file).join(', ')})`;
|
|
41
|
+
return `${behind} commit(s) of ${ref} to merge in, ${conflicts === 0 ? 'no conflict' : `${conflicts} conflict(s): ${settled.length} settled by merge-trunk${forYou}`}`;
|
|
42
|
+
}
|
|
43
|
+
function nextBlock(view) {
|
|
44
|
+
return [...trunkAdvice(view), ...crossingAdvice(view)];
|
|
45
|
+
}
|
|
46
|
+
function trunkAdvice({ here, stories }) {
|
|
47
|
+
const trunk = stories.find((story) => story.story === here)?.trunk;
|
|
48
|
+
return trunk === undefined || trunk.byHand.length === 0
|
|
49
|
+
? []
|
|
50
|
+
: [
|
|
51
|
+
`Next: bring the trunk in now, while its conflicts are few: commit, then \`npx ddd-ts-kit merge-trunk --trunk ${trunk.ref}\`.`,
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
function crossingAdvice({ crossings }) {
|
|
55
|
+
if (crossings.some((crossing) => (crossing.merge?.byHand.length ?? 0) > 0)) {
|
|
56
|
+
return [
|
|
57
|
+
'Next: a conflict for you between two stories is settled by the second to land, once the first is on the trunk (`merge-trunk`): keep off its files when the rows allow it, else record which story lands first as a decision of the report.',
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
return crossings.some((crossing) => crossing.files.length > 0 || crossing.contexts.length > 0)
|
|
61
|
+
? [
|
|
62
|
+
'Next: no conflict yet; read the rows and the design review of the other story before changing what both change, and keep off its aggregates when the rows allow it.',
|
|
63
|
+
]
|
|
64
|
+
: [];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=format-stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-stories.js","sourceRoot":"","sources":["../../src/stories/format-stories.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAM7B,yFAAyF;AACzF,MAAM,UAAU,aAAa,CAAC,IAAiB,EAAE,GAAW;IAC1D,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,oGAAoG,CAAC;IAC9G,CAAC;IAED,OAAO;QACL,iBAAiB,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,yBAAyB,IAAI,CAAC,IAAI,EAAE,kBAAkB,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE,uCAAuC;QACtQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;QAC5D,EAAE;QACF,GAAG,cAAc,CAAC,IAAI,CAAC;QACvB,GAAG,SAAS,CAAC,IAAI,CAAC;KACnB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAA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EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAe;IACjD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC;IAEnE,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;QACrD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACE,gHAAgH,KAAK,CAAC,GAAG,KAAK;SAC/H,CAAC;AACR,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,SAAS,EAAe;IAChD,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC3E,OAAO;YACL,4OAA4O;SAC7O,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5F,CAAC,CAAC;YACE,qKAAqK;SACtK;QACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StoryGate } from './story-gate.js';
|
|
2
|
+
import type { StoryPhase } from './story-phase.js';
|
|
3
|
+
/** The phases of a story as text: one line each, then the next step and, when asked, the gate. */
|
|
4
|
+
export declare function formatStoryPhases(story: string, phases: readonly StoryPhase[], gate: StoryGate | undefined): string;
|
|
5
|
+
//# sourceMappingURL=format-story-phases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-story-phases.d.ts","sourceRoot":"","sources":["../../src/stories/format-story-phases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAYnH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** The phases of a story as text: one line each, then the next step and, when asked, the gate. */
|
|
2
|
+
export function formatStoryPhases(story, phases, gate) {
|
|
3
|
+
const next = phases.find((phase) => !phase.met);
|
|
4
|
+
const asked = gate === undefined ? [] : phases.filter((phase) => gate === 'close' || phase.gate === 'build');
|
|
5
|
+
const width = Math.max(...phases.map((phase) => phase.title.length));
|
|
6
|
+
return [
|
|
7
|
+
story,
|
|
8
|
+
...phases.map((phase) => ` [${phase.met ? 'x' : ' '}] ${phase.title.padEnd(width)} ${phase.detail}`),
|
|
9
|
+
'',
|
|
10
|
+
next === undefined ? 'Next: nothing, the story is ready for its pull request.' : `Next: ${next.next}`,
|
|
11
|
+
...(gate === undefined ? [] : [`gate ${gate}: ${asked.every((phase) => phase.met) ? 'met' : 'not met'}`]),
|
|
12
|
+
].join('\n');
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=format-story-phases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-story-phases.js","sourceRoot":"","sources":["../../src/stories/format-story-phases.ts"],"names":[],"mappings":"AAGA,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,MAA6B,EAAE,IAA2B;IACzG,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAC7G,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO;QACL,KAAK;QACL,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACtG,EAAE;QACF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,yDAAyD,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE;QACrG,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;KAC1G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Resolution } from '../merge/resolution.js';
|
|
2
|
+
/** What merging one branch into another would leave now, computed without touching a working tree. */
|
|
3
|
+
export interface MergeForecast {
|
|
4
|
+
/** The branch merged in: the trunk, or the branch of another story. */
|
|
5
|
+
readonly ref: string;
|
|
6
|
+
/** The commits of `ref` the branch it is merged into does not hold. */
|
|
7
|
+
readonly behind: number;
|
|
8
|
+
/** The conflicted paths `merge-trunk` settles: derived files, rows of slices.md, registries, the lockfile. */
|
|
9
|
+
readonly settled: readonly ForecastPath[];
|
|
10
|
+
/** The conflicted paths left to a person. */
|
|
11
|
+
readonly byHand: readonly ForecastPath[];
|
|
12
|
+
}
|
|
13
|
+
/** One conflicted path of a forecast, relative to the top of the repository, with its class. */
|
|
14
|
+
export interface ForecastPath {
|
|
15
|
+
readonly file: string;
|
|
16
|
+
readonly kind: Resolution['kind'];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=merge-forecast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-forecast.d.ts","sourceRoot":"","sources":["../../src/stories/merge-forecast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,sGAAsG;AACtG,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AAED,gGAAgG;AAChG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-forecast.js","sourceRoot":"","sources":["../../src/stories/merge-forecast.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OpenStory } from './open-story.js';
|
|
2
|
+
/**
|
|
3
|
+
* Each story open in a worktree of the repository, with the contexts its rows name in that
|
|
4
|
+
* worktree: where two sessions are about to change the same contexts. `prefix` is the path of the
|
|
5
|
+
* project inside its repository.
|
|
6
|
+
*/
|
|
7
|
+
export declare function openStories(root: string, prefix: string): OpenStory[];
|
|
8
|
+
//# sourceMappingURL=open-stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-stories.d.ts","sourceRoot":"","sources":["../../src/stories/open-stories.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAuBrE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { storyOfRow } from '../acceptance/story-of-row.js';
|
|
3
|
+
import { readSlices } from '../progress/read-slices.js';
|
|
4
|
+
import { listWorktrees } from '../worker/list-worktrees.js';
|
|
5
|
+
import { Workspace } from '../workspace/index.js';
|
|
6
|
+
import { readStoryPlace } from './read-story-place.js';
|
|
7
|
+
/**
|
|
8
|
+
* Each story open in a worktree of the repository, with the contexts its rows name in that
|
|
9
|
+
* worktree: where two sessions are about to change the same contexts. `prefix` is the path of the
|
|
10
|
+
* project inside its repository.
|
|
11
|
+
*/
|
|
12
|
+
export function openStories(root, prefix) {
|
|
13
|
+
return listWorktrees(root).flatMap((worktree) => {
|
|
14
|
+
const inside = path.join(worktree.path, prefix);
|
|
15
|
+
const place = readStoryPlace(inside);
|
|
16
|
+
if (place === undefined) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const rows = (readSlices(new Workspace(inside, false)) ?? []).filter((row) => storyOfRow(row.id).toLowerCase() === place.story.toLowerCase());
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
story: place.story,
|
|
23
|
+
worktree: inside,
|
|
24
|
+
base: place.base,
|
|
25
|
+
...(worktree.branch === undefined ? {} : { branch: worktree.branch }),
|
|
26
|
+
contexts: [...new Set(rows.map((row) => row.context))].sort(),
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=open-stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-stories.js","sourceRoot":"","sources":["../../src/stories/open-stories.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,MAAc;IACtD,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAErC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAClE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CACxE,CAAC;QAEF,OAAO;YACL;gBACE,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACrE,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;aAC9D;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { StoryScope } from './story-scope.js';
|
|
3
|
+
/** What the caller asks for one story. */
|
|
4
|
+
export interface StoryRequest {
|
|
5
|
+
readonly story: string;
|
|
6
|
+
/** The worktree directory, relative to the project root; by default `.worktrees/<story>` in the project of the main checkout. */
|
|
7
|
+
readonly worktree?: string;
|
|
8
|
+
/** By default `story/<story>`, in lower case. */
|
|
9
|
+
readonly branch?: string;
|
|
10
|
+
/** The ref the branch is cut from and merges back into; by default the branch the current one follows, else the current one. */
|
|
11
|
+
readonly base?: string;
|
|
12
|
+
readonly dryRun: boolean;
|
|
13
|
+
readonly install: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gives one story its place, where one session takes it to its pull request while other sessions
|
|
17
|
+
* take other stories: a git worktree on its own branch cut from the base, its dependencies
|
|
18
|
+
* installed, and `.ddd-ts-kit/story.json`. The worktree of a story already open is kept, and the
|
|
19
|
+
* story resumes there; the story open in another worktree is refused, so that two sessions never
|
|
20
|
+
* take the same one. Names the other open stories and the contexts they change.
|
|
21
|
+
*/
|
|
22
|
+
export declare function openStoryScope(root: string, config: Config, request: StoryRequest): StoryScope;
|
|
23
|
+
//# sourceMappingURL=open-story-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-story-scope.d.ts","sourceRoot":"","sources":["../../src/stories/open-story-scope.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAajD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iIAAiI;IACjI,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,gIAAgI;IAChI,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,UAAU,CAgC9F"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { CliError } from '../cli-error.js';
|
|
4
|
+
import { runGit } from '../commit/run-git.js';
|
|
5
|
+
import { addWorktree } from '../worker/add-worktree.js';
|
|
6
|
+
import { baseOf } from '../worker/base-of.js';
|
|
7
|
+
import { ensureContainsBase } from '../worker/ensure-contains-base.js';
|
|
8
|
+
import { installDependencies } from '../worker/install-dependencies.js';
|
|
9
|
+
import { isWorktree } from '../worker/is-worktree.js';
|
|
10
|
+
import { installNotes } from '../worker/install-notes.js';
|
|
11
|
+
import { repositoryPrefix } from '../worker/repository-prefix.js';
|
|
12
|
+
import { upstreamOf } from '../worker/upstream-of.js';
|
|
13
|
+
import { worktreeOf } from '../worker/worktree-of.js';
|
|
14
|
+
import { openStories } from './open-stories.js';
|
|
15
|
+
import { readStoryPlace } from './read-story-place.js';
|
|
16
|
+
import { STORY_SCOPE_FILE } from './story-scope-file.js';
|
|
17
|
+
const STORY = /^[A-Za-z0-9][A-Za-z0-9-]*$/;
|
|
18
|
+
/**
|
|
19
|
+
* Gives one story its place, where one session takes it to its pull request while other sessions
|
|
20
|
+
* take other stories: a git worktree on its own branch cut from the base, its dependencies
|
|
21
|
+
* installed, and `.ddd-ts-kit/story.json`. The worktree of a story already open is kept, and the
|
|
22
|
+
* story resumes there; the story open in another worktree is refused, so that two sessions never
|
|
23
|
+
* take the same one. Names the other open stories and the contexts they change.
|
|
24
|
+
*/
|
|
25
|
+
export function openStoryScope(root, config, request) {
|
|
26
|
+
const story = storyNamed(request.story);
|
|
27
|
+
const prefix = repositoryPrefix(root);
|
|
28
|
+
const base = baseOutsideStory(root, config, request.base);
|
|
29
|
+
const { worktree, note } = worktreeOf(root, request.worktree, story.toLowerCase());
|
|
30
|
+
const branch = request.branch ?? `story/${story.toLowerCase()}`;
|
|
31
|
+
const inside = path.join(worktree, prefix);
|
|
32
|
+
const all = openStories(root, prefix);
|
|
33
|
+
refuseOpenElsewhere(all, story, inside);
|
|
34
|
+
const created = !isWorktree(root, worktree);
|
|
35
|
+
if (!created) {
|
|
36
|
+
ensureContainsBase(worktree, runGit(worktree, ['branch', '--show-current'])?.trim() || 'HEAD', base);
|
|
37
|
+
}
|
|
38
|
+
const install = request.dryRun
|
|
39
|
+
? undefined
|
|
40
|
+
: prepare(root, { worktree, inside, created, install: request.install, story, base, branch, config });
|
|
41
|
+
return {
|
|
42
|
+
story,
|
|
43
|
+
dryRun: request.dryRun,
|
|
44
|
+
worktree: inside,
|
|
45
|
+
branch,
|
|
46
|
+
base,
|
|
47
|
+
created,
|
|
48
|
+
...(install === undefined ? {} : { install }),
|
|
49
|
+
others: all.filter((open) => open.story.toLowerCase() !== story.toLowerCase()),
|
|
50
|
+
notes: [...(note === undefined ? [] : [note]), ...installNotes(inside, config, install)],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function storyNamed(story) {
|
|
54
|
+
if (!STORY.test(story)) {
|
|
55
|
+
throw new CliError(`"${story}" is not the code of a story.`, 'Pass the code its rows start with in docs/architecture/slices.md: `US5` for the rows `US5.01`, `US5.02`.');
|
|
56
|
+
}
|
|
57
|
+
return story;
|
|
58
|
+
}
|
|
59
|
+
/** The base, which is never the branch of another story: a story is cut from the trunk. */
|
|
60
|
+
function baseOutsideStory(root, config, base) {
|
|
61
|
+
const open = readStoryPlace(root);
|
|
62
|
+
if (base === undefined && open !== undefined) {
|
|
63
|
+
throw new CliError(`${root} is the worktree of the story ${open.story}: its branch would be the base of the new one.`, 'Run story-scope from the checkout of the trunk, or name the base: `--base origin/main`.');
|
|
64
|
+
}
|
|
65
|
+
return baseOf(root, config, base ?? upstreamOf(root));
|
|
66
|
+
}
|
|
67
|
+
function refuseOpenElsewhere(open, story, inside) {
|
|
68
|
+
const elsewhere = open.find((other) => other.story.toLowerCase() === story.toLowerCase() && path.resolve(other.worktree) !== path.resolve(inside));
|
|
69
|
+
if (elsewhere !== undefined) {
|
|
70
|
+
throw new CliError(`${story} is already open in ${elsewhere.worktree}: another session may be taking it.`, `Resume it there (\`cd ${elsewhere.worktree}\`), or close that worktree first; two sessions never take the same story.`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** The worktree it creates, the story file, then the clean install of a worktree it created, unless refused. */
|
|
74
|
+
function prepare(root, place) {
|
|
75
|
+
const { worktree, inside, created, story, base, branch, config } = place;
|
|
76
|
+
if (created) {
|
|
77
|
+
addWorktree(root, { worktree, branch, base });
|
|
78
|
+
}
|
|
79
|
+
const baseCommit = runGit(root, ['rev-parse', '--verify', '--quiet', `${base}^{commit}`])?.trim();
|
|
80
|
+
const written = { story, base, ...(baseCommit === undefined ? {} : { baseCommit }), branch };
|
|
81
|
+
const file = path.join(inside, STORY_SCOPE_FILE);
|
|
82
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
83
|
+
fs.writeFileSync(file, `${JSON.stringify(written, null, 2)}\n`);
|
|
84
|
+
return created && place.install ? installDependencies(inside, config.stack.packageManager) : undefined;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=open-story-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-story-scope.js","sourceRoot":"","sources":["../../src/stories/open-story-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAe3C;;;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SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAEhE,OAAO,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A story open in another worktree of the repository. */
|
|
2
|
+
export interface OpenStory {
|
|
3
|
+
readonly story: string;
|
|
4
|
+
readonly worktree: string;
|
|
5
|
+
readonly branch?: string;
|
|
6
|
+
/** The ref its branch was cut from and merges back into. */
|
|
7
|
+
readonly base: string;
|
|
8
|
+
/** The contexts its rows name, read in its worktree; empty before its rows are planned. */
|
|
9
|
+
readonly contexts: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=open-story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-story.d.ts","sourceRoot":"","sources":["../../src/stories/open-story.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-story.js","sourceRoot":"","sources":["../../src/stories/open-story.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoriesView } from './stories-view.js';
|
|
2
|
+
/**
|
|
3
|
+
* The stories open in the worktrees of the repository of the project at `root`, each with the
|
|
4
|
+
* files it changed and the trunk merged in now, and each pair of them that meets. From the
|
|
5
|
+
* worktree of a story, the pairs it is in, that story first. Reads git and the files, changes
|
|
6
|
+
* nothing but objects of the repository.
|
|
7
|
+
*/
|
|
8
|
+
export declare function readStories(root: string): StoriesView;
|
|
9
|
+
//# sourceMappingURL=read-stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-stories.d.ts","sourceRoot":"","sources":["../../src/stories/read-stories.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAiBrD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { runGit } from '../commit/run-git.js';
|
|
4
|
+
import { classifyConflict } from '../merge/classify-conflict.js';
|
|
5
|
+
import { mergeRepositoryOf } from '../merge/lost/merge-repository-of.js';
|
|
6
|
+
import { changedFiles } from '../worker/changed-files.js';
|
|
7
|
+
import { forecastMerge } from './forecast-merge.js';
|
|
8
|
+
import { openStories } from './open-stories.js';
|
|
9
|
+
import { readStoryPlace } from './read-story-place.js';
|
|
10
|
+
/**
|
|
11
|
+
* The stories open in the worktrees of the repository of the project at `root`, each with the
|
|
12
|
+
* files it changed and the trunk merged in now, and each pair of them that meets. From the
|
|
13
|
+
* worktree of a story, the pairs it is in, that story first. Reads git and the files, changes
|
|
14
|
+
* nothing but objects of the repository.
|
|
15
|
+
*/
|
|
16
|
+
export function readStories(root) {
|
|
17
|
+
const repo = mergeRepositoryOf(root);
|
|
18
|
+
const here = readStoryPlace(root)?.story;
|
|
19
|
+
const stories = openStories(root, repo.prefix).map((story) => stateOf(repo, story));
|
|
20
|
+
const own = stories.find((story) => story.story === here);
|
|
21
|
+
const pairs = own === undefined
|
|
22
|
+
? stories.flatMap((first, index) => stories.slice(index + 1).map((second) => [first, second]))
|
|
23
|
+
: stories.filter((other) => other !== own).map((other) => [own, other]);
|
|
24
|
+
return {
|
|
25
|
+
...(here === undefined ? {} : { here }),
|
|
26
|
+
stories,
|
|
27
|
+
crossings: pairs.flatMap(([first, second]) => crossingOf(repo, first, second)),
|
|
28
|
+
...fetchedOf(repo.top),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** When the last fetch wrote FETCH_HEAD, shared by every worktree of the repository. */
|
|
32
|
+
function fetchedOf(top) {
|
|
33
|
+
const common = runGit(top, ['rev-parse', '--git-common-dir'])?.trim();
|
|
34
|
+
const stat = common === undefined ? undefined : fs.statSync(path.resolve(top, common, 'FETCH_HEAD'), { throwIfNoEntry: false });
|
|
35
|
+
return stat === undefined ? {} : { fetched: stat.mtime.toISOString() };
|
|
36
|
+
}
|
|
37
|
+
function stateOf(repo, story) {
|
|
38
|
+
const top = runGit(story.worktree, ['rev-parse', '--show-toplevel'])?.trim() ?? story.worktree;
|
|
39
|
+
const { base, branch } = story;
|
|
40
|
+
const mergeBase = runGit(top, ['merge-base', base, 'HEAD'])?.trim();
|
|
41
|
+
const trunk = branch === undefined ? undefined : forecastMerge(repo, { ours: branch, theirs: base });
|
|
42
|
+
return { ...story, files: changedFiles(top, mergeBase), ...(trunk === undefined ? {} : { trunk }) };
|
|
43
|
+
}
|
|
44
|
+
function crossingOf(repo, first, second) {
|
|
45
|
+
const contexts = first.contexts.filter((context) => second.contexts.includes(context));
|
|
46
|
+
const files = first.files.filter((file) => second.files.includes(file) && classifyConflict(file, repo) === 'source');
|
|
47
|
+
const merge = mergeOf(repo, first, second);
|
|
48
|
+
const conflicts = (merge?.settled.length ?? 0) + (merge?.byHand.length ?? 0);
|
|
49
|
+
if (contexts.length === 0 && files.length === 0 && conflicts === 0) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
return [{ stories: [first.story, second.story], contexts, files, ...(merge === undefined ? {} : { merge }) }];
|
|
53
|
+
}
|
|
54
|
+
/** The branch of the second merged into the branch of the first now; none while either has no branch. */
|
|
55
|
+
function mergeOf(repo, first, second) {
|
|
56
|
+
return first.branch === undefined || second.branch === undefined
|
|
57
|
+
? undefined
|
|
58
|
+
: forecastMerge(repo, { ours: first.branch, theirs: second.branch });
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=read-stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-stories.js","sourceRoot":"","sources":["../../src/stories/read-stories.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,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACzC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,O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ace } from '../workspace/index.js';
|
|
3
|
+
import type { StoryPhase } from './story-phase.js';
|
|
4
|
+
/**
|
|
5
|
+
* The phases of a story, in order: its specification and criteria, its rows, the design review of
|
|
6
|
+
* each row, its acceptance written and locked (the `build` gate: the code may start), then its rows
|
|
7
|
+
* done, its acceptance passing, its trunk merged in and its report (the `close` gate).
|
|
8
|
+
*/
|
|
9
|
+
export declare function readStoryPhases(ws: Workspace, story: string, slices: readonly Slice[]): StoryPhase[];
|
|
10
|
+
//# sourceMappingURL=read-story-phases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-story-phases.d.ts","sourceRoot":"","sources":["../../src/stories/read-story-phases.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAcnD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,UAAU,EAAE,CAgBpG"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { criteriaIn } from '../acceptance/criteria-in.js';
|
|
2
|
+
import { countsFor } from '../acceptance/counts-for.js';
|
|
3
|
+
import { readAcceptance } from '../acceptance/read-acceptance.js';
|
|
4
|
+
import { storyFileOf } from '../acceptance/story-file-of.js';
|
|
5
|
+
import { storyOfRow } from '../acceptance/story-of-row.js';
|
|
6
|
+
import { readStoryClosing } from '../story/read-story-closing.js';
|
|
7
|
+
import { reviewFileOf } from './review-file-of.js';
|
|
8
|
+
import { sectionOf } from './section-of.js';
|
|
9
|
+
import { trunkPhase } from './trunk-phase.js';
|
|
10
|
+
/** A design review section of a row: `## #US5.02 Place order`. */
|
|
11
|
+
const ROW_HEADING = /^##\s+#(\S+)/gm;
|
|
12
|
+
/**
|
|
13
|
+
* The phases of a story, in order: its specification and criteria, its rows, the design review of
|
|
14
|
+
* each row, its acceptance written and locked (the `build` gate: the code may start), then its rows
|
|
15
|
+
* done, its acceptance passing, its trunk merged in and its report (the `close` gate).
|
|
16
|
+
*/
|
|
17
|
+
export function readStoryPhases(ws, story, slices) {
|
|
18
|
+
const rows = slices.filter((row) => storyOfRow(row.id).toLowerCase() === story.toLowerCase());
|
|
19
|
+
const specification = storyFileOf(ws, story);
|
|
20
|
+
const [acceptance] = readAcceptance(ws, slices, story);
|
|
21
|
+
const facts = { ws, story, rows, specification, acceptance };
|
|
22
|
+
return [
|
|
23
|
+
specificationPhase(facts),
|
|
24
|
+
rowsPhase(facts),
|
|
25
|
+
designPhase(facts),
|
|
26
|
+
acceptancePhase(facts, 'written'),
|
|
27
|
+
builtPhase(facts),
|
|
28
|
+
acceptancePhase(facts, 'passing'),
|
|
29
|
+
trunkPhase(ws, story),
|
|
30
|
+
reportPhase(facts),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
function specificationPhase({ ws, story, specification }) {
|
|
34
|
+
const criteria = specification === undefined ? [] : criteriaIn(ws.read(specification) ?? '');
|
|
35
|
+
return {
|
|
36
|
+
id: 'specification',
|
|
37
|
+
title: 'specification',
|
|
38
|
+
met: criteria.length > 0,
|
|
39
|
+
detail: specification === undefined
|
|
40
|
+
? `no docs/architecture/stories/${story}.md`
|
|
41
|
+
: `${specification}, ${criteria.length} acceptance criteria`,
|
|
42
|
+
next: `Write docs/architecture/stories/${story}.md: the statement, the questions asked and their answers, and \`## Acceptance criteria\`, one \`- AC1: <what a client observes>\` each.`,
|
|
43
|
+
gate: 'build',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function rowsPhase({ story, rows }) {
|
|
47
|
+
return {
|
|
48
|
+
id: 'rows',
|
|
49
|
+
title: 'rows',
|
|
50
|
+
met: rows.length > 0,
|
|
51
|
+
detail: `${rows.length} row${rows.length === 1 ? '' : 's'} in docs/architecture/slices.md`,
|
|
52
|
+
next: `Plan the rows of ${story} in docs/architecture/slices.md (skill ddd-ts-kit:plan-slices), numbered ${story}.01, ${story}.02.`,
|
|
53
|
+
gate: 'build',
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function designPhase({ ws, story, rows }) {
|
|
57
|
+
const file = reviewFileOf(ws, story);
|
|
58
|
+
const reviewed = new Set([...(ws.read(file ?? '') ?? '').matchAll(ROW_HEADING)].map(([, id]) => id));
|
|
59
|
+
const missing = rows.filter((row) => row.status !== 'done' && !reviewed.has(row.id)).map((row) => `#${row.id}`);
|
|
60
|
+
return {
|
|
61
|
+
id: 'design',
|
|
62
|
+
title: 'design review',
|
|
63
|
+
met: rows.length > 0 && missing.length === 0,
|
|
64
|
+
detail: file === undefined
|
|
65
|
+
? `no docs/architecture/reviews/${story}.md`
|
|
66
|
+
: missing.length === 0
|
|
67
|
+
? `${file}, a section per row`
|
|
68
|
+
: `${file} has no section for ${missing.join(', ')}`,
|
|
69
|
+
next: `Write the design of each row in docs/architecture/reviews/${story}.md, one \`## #<id> <slice>\` section each, have the architecture-reviewer agent read it as a design review, and settle its findings.`,
|
|
70
|
+
gate: 'build',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** What each acceptance gate is called and asks for, by the gate of the story it belongs to. */
|
|
74
|
+
const ACCEPTANCE_PHASES = {
|
|
75
|
+
written: {
|
|
76
|
+
id: 'acceptance',
|
|
77
|
+
title: 'acceptance written and locked',
|
|
78
|
+
next: (story) => `Write the acceptance of ${story} before its code (skill ddd-ts-kit:testing), then \`npx ddd-ts-kit acceptance ${story} --lock\`; \`npx ddd-ts-kit acceptance ${story} --gate written\` lists what is left.`,
|
|
79
|
+
gate: 'build',
|
|
80
|
+
},
|
|
81
|
+
passing: {
|
|
82
|
+
id: 'passing',
|
|
83
|
+
title: 'acceptance passing',
|
|
84
|
+
next: (story) => `Build what the pending scenarios wait for; \`npx ddd-ts-kit acceptance ${story} --gate passing\` lists them.`,
|
|
85
|
+
gate: 'close',
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
function acceptancePhase({ story, acceptance }, gate) {
|
|
89
|
+
const left = acceptance?.problems.filter((problem) => countsFor(problem, gate)) ?? [];
|
|
90
|
+
const { id, title, next, gate: storyGate } = ACCEPTANCE_PHASES[gate];
|
|
91
|
+
return {
|
|
92
|
+
id,
|
|
93
|
+
title,
|
|
94
|
+
met: acceptance !== undefined && left.length === 0,
|
|
95
|
+
detail: left.length === 0 ? 'met' : `${left.length} left: ${left[0]?.message ?? ''}`,
|
|
96
|
+
next: next(story),
|
|
97
|
+
gate: storyGate,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** Its rows done and no marker of its own left, as `story-check` says. */
|
|
101
|
+
function builtPhase({ ws, story, rows }) {
|
|
102
|
+
const [next] = rows.filter((row) => row.status !== 'done');
|
|
103
|
+
if (next !== undefined) {
|
|
104
|
+
const done = rows.filter((row) => row.status === 'done').length;
|
|
105
|
+
return {
|
|
106
|
+
...BUILT,
|
|
107
|
+
met: false,
|
|
108
|
+
detail: `${done} of ${rows.length} done, next #${next.id} ${next.slice}`,
|
|
109
|
+
next: 'Build the next row: contracts and skeletons yourself, each slice with `npx ddd-ts-kit worker-scope <context> --here --rows <id>` and one context-builder agent; mark it done once verified and committed.',
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const markers = rows.length === 0 ? 0 : markersLeft(ws, story);
|
|
113
|
+
const left = markers === 0
|
|
114
|
+
? ''
|
|
115
|
+
: `, ${markers} marker${markers === 1 ? '' : 's'} of its own left (\`npx ddd-ts-kit story-check ${story}\`)`;
|
|
116
|
+
return {
|
|
117
|
+
...BUILT,
|
|
118
|
+
met: rows.length > 0 && markers === 0,
|
|
119
|
+
detail: `${rows.length} of ${rows.length} done${left}`,
|
|
120
|
+
next: `Settle each marker \`npx ddd-ts-kit story-check ${story}\` lists, as it says.`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const BUILT = { id: 'built', title: 'rows done', gate: 'close' };
|
|
124
|
+
/** The markers that keep the story open; none when they cannot be read. */
|
|
125
|
+
function markersLeft(ws, story) {
|
|
126
|
+
try {
|
|
127
|
+
return readStoryClosing(ws.root, story, false).markers.length;
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function reportPhase({ ws, story, specification }) {
|
|
134
|
+
const report = specification === undefined ? undefined : sectionOf(ws.read(specification) ?? '', 'Report');
|
|
135
|
+
return {
|
|
136
|
+
id: 'report',
|
|
137
|
+
title: 'report',
|
|
138
|
+
met: report !== undefined && report.trim() !== '',
|
|
139
|
+
detail: report === undefined ? 'no `## Report` in the specification' : 'written',
|
|
140
|
+
next: `Write \`## Report\` in docs/architecture/stories/${story}.md: each provisional decision, each compromise, each amendment of the acceptance, what is left; it is the body of the pull request.`,
|
|
141
|
+
gate: 'close',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=read-story-phases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-story-phases.js","sourceRoot":"","sources":["../../src/stories/read-story-phases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,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K,sIAAsI;QACrM,IAAI,EAAE,OAAO;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StoryPlace } from './story-place.js';
|
|
2
|
+
/** The story of the worktree at `root`; undefined outside the worktree of a story or when its file is not one. */
|
|
3
|
+
export declare function readStoryPlace(root: string): StoryPlace | undefined;
|
|
4
|
+
//# sourceMappingURL=read-story-place.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-story-place.d.ts","sourceRoot":"","sources":["../../src/stories/read-story-place.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,kHAAkH;AAClH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAiBnE"}
|