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.
- package/CHANGELOG.md +96 -0
- package/README.fr.md +4 -3
- package/README.md +3 -2
- 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 +2 -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 +1 -0
- package/dist/check/catalogue/default-severities.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/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/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/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/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/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 +7 -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.js +1 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/serialize-config.js +1 -0
- 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/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/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 +50 -2
- 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 +6 -0
- 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 +9 -3
- package/dist/init/run-init.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 +10 -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 +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,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAA0B,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CA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@ -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 @@
|
|
|
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.
|
|
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.
|
|
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,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'] } },
|
|
@@ -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
|
+
"@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",
|