ddd-ts-kit 0.20.0 → 0.22.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 +83 -0
- package/README.fr.md +15 -6
- package/README.md +12 -4
- 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/commands/rules-command.js +2 -2
- package/dist/check/commands/rules-command.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +7 -1
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/engine/run-check.d.ts.map +1 -1
- package/dist/check/engine/run-check.js +17 -1
- package/dist/check/engine/run-check.js.map +1 -1
- package/dist/check/explain/clean-docs.js +1 -1
- package/dist/check/explain/clean-docs.js.map +1 -1
- package/dist/check/explain/layout-docs.js +1 -1
- package/dist/check/explain/layout-docs.js.map +1 -1
- package/dist/check/explain/persistence-docs.js +1 -1
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.js +2 -2
- 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 +7 -0
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/config-fixtures.js +50 -1
- package/dist/check/fixtures/config-fixtures.js.map +1 -1
- package/dist/check/fixtures/governance-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/governance-fixtures.js +12 -3
- package/dist/check/fixtures/governance-fixtures.js.map +1 -1
- package/dist/check/fixtures/layer-fixtures.js +1 -1
- package/dist/check/fixtures/layer-fixtures.js.map +1 -1
- package/dist/check/fixtures/layout-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/layout-fixtures.js +6 -0
- package/dist/check/fixtures/layout-fixtures.js.map +1 -1
- package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/persistence-fixtures.js +16 -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 -1
- package/dist/check/fixtures/test-fixtures.js.map +1 -1
- package/dist/check/fixtures/tree-fixtures.js +1 -1
- package/dist/check/fixtures/tree-fixtures.js.map +1 -1
- package/dist/check/migrations/working-migration-findings.d.ts +8 -0
- package/dist/check/migrations/working-migration-findings.d.ts.map +1 -0
- package/dist/check/migrations/working-migration-findings.js +22 -0
- package/dist/check/migrations/working-migration-findings.js.map +1 -0
- package/dist/check/model/project.d.ts +3 -0
- package/dist/check/model/project.d.ts.map +1 -1
- package/dist/check/project/assemble-project.d.ts +2 -2
- package/dist/check/project/assemble-project.d.ts.map +1 -1
- package/dist/check/project/assemble-project.js +16 -6
- package/dist/check/project/assemble-project.js.map +1 -1
- package/dist/check/rules/clean-file-size.d.ts.map +1 -1
- package/dist/check/rules/clean-file-size.js +6 -1
- package/dist/check/rules/clean-file-size.js.map +1 -1
- package/dist/check/rules/clean-function-size.js +2 -2
- package/dist/check/rules/clean-function-size.js.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.js +2 -11
- package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
- package/dist/check/rules/config-rule-off-everywhere.d.ts +3 -0
- package/dist/check/rules/config-rule-off-everywhere.d.ts.map +1 -0
- package/dist/check/rules/config-rule-off-everywhere.js +21 -0
- package/dist/check/rules/config-rule-off-everywhere.js.map +1 -0
- package/dist/check/rules/governance-recorded-deviation.js +14 -7
- package/dist/check/rules/governance-recorded-deviation.js.map +1 -1
- package/dist/check/rules/persistence-migration-history.d.ts.map +1 -1
- package/dist/check/rules/persistence-migration-history.js +9 -2
- package/dist/check/rules/persistence-migration-history.js.map +1 -1
- package/dist/check/rules/test-spec-required.d.ts.map +1 -1
- package/dist/check/rules/test-spec-required.js +3 -2
- package/dist/check/rules/test-spec-required.js.map +1 -1
- package/dist/check/support/is-abstract-base.d.ts +7 -0
- package/dist/check/support/is-abstract-base.d.ts.map +1 -0
- package/dist/check/support/is-abstract-base.js +11 -0
- package/dist/check/support/is-abstract-base.js.map +1 -0
- package/dist/check/support/is-generated-context-file.d.ts +4 -0
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -0
- package/dist/check/support/is-generated-context-file.js +12 -0
- package/dist/check/support/is-generated-context-file.js.map +1 -0
- package/dist/commands/drizzle-generate.d.ts +4 -0
- package/dist/commands/drizzle-generate.d.ts.map +1 -0
- package/dist/commands/drizzle-generate.js +14 -0
- package/dist/commands/drizzle-generate.js.map +1 -0
- package/dist/commands/generate.js +4 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/worker-scope.d.ts.map +1 -1
- package/dist/commands/worker-scope.js +17 -2
- package/dist/commands/worker-scope.js.map +1 -1
- package/dist/config/config.d.ts +2 -1
- 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 +2 -1
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-rule-setting.d.ts +3 -0
- package/dist/config/parse-rule-setting.d.ts.map +1 -0
- package/dist/config/parse-rule-setting.js +10 -0
- package/dist/config/parse-rule-setting.js.map +1 -0
- package/dist/config/project-severity.d.ts +4 -0
- package/dist/config/project-severity.d.ts.map +1 -0
- package/dist/config/project-severity.js +5 -0
- package/dist/config/project-severity.js.map +1 -0
- package/dist/config/rule-setting.d.ts +10 -0
- package/dist/config/rule-setting.d.ts.map +1 -0
- package/dist/config/rule-setting.js +2 -0
- package/dist/config/rule-setting.js.map +1 -0
- package/dist/generate/given-name.d.ts +15 -0
- package/dist/generate/given-name.d.ts.map +1 -0
- package/dist/generate/given-name.js +21 -0
- package/dist/generate/given-name.js.map +1 -0
- package/dist/generate/kind.d.ts +4 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/adr-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adr-kind.js +8 -4
- package/dist/generate/kinds/adr-kind.js.map +1 -1
- package/dist/generate/kinds/adr-number.d.ts +8 -0
- package/dist/generate/kinds/adr-number.d.ts.map +1 -0
- package/dist/generate/kinds/adr-number.js +25 -0
- package/dist/generate/kinds/adr-number.js.map +1 -0
- package/dist/generate/kinds/event-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/event-handler-kind.js +7 -4
- package/dist/generate/kinds/event-handler-kind.js.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.js +8 -2
- package/dist/generate/kinds/integration-handler-kind.js.map +1 -1
- package/dist/generate/kinds/write-adr.d.ts +3 -1
- package/dist/generate/kinds/write-adr.d.ts.map +1 -1
- package/dist/generate/kinds/write-adr.js +3 -3
- package/dist/generate/kinds/write-adr.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 +8 -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 +2 -1
- package/dist/help/usage.js.map +1 -1
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +2 -1
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/scripts-for.js +2 -0
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/write-agent-settings.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +1 -0
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/migration/drizzle-kit-bin.d.ts +3 -0
- package/dist/migration/drizzle-kit-bin.d.ts.map +1 -0
- package/dist/migration/drizzle-kit-bin.js +12 -0
- package/dist/migration/drizzle-kit-bin.js.map +1 -0
- package/dist/migration/drizzle-silent-failures.d.ts +9 -0
- package/dist/migration/drizzle-silent-failures.d.ts.map +1 -0
- package/dist/migration/drizzle-silent-failures.js +14 -0
- package/dist/migration/drizzle-silent-failures.js.map +1 -0
- package/dist/migration/generate-drizzle-migration.d.ts +15 -0
- package/dist/migration/generate-drizzle-migration.d.ts.map +1 -0
- package/dist/migration/generate-drizzle-migration.js +37 -0
- package/dist/migration/generate-drizzle-migration.js.map +1 -0
- package/dist/migration/index.d.ts +2 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +2 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/presets/preset-decision.js +2 -2
- package/dist/presets/preset-decision.js.map +1 -1
- package/dist/progress/read-slice-rules.d.ts +8 -0
- package/dist/progress/read-slice-rules.d.ts.map +1 -0
- package/dist/progress/read-slice-rules.js +20 -0
- package/dist/progress/read-slice-rules.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/base-of.d.ts +8 -0
- package/dist/worker/base-of.d.ts.map +1 -0
- package/dist/worker/base-of.js +36 -0
- package/dist/worker/base-of.js.map +1 -0
- package/dist/worker/briefed-rows.d.ts +14 -0
- package/dist/worker/briefed-rows.d.ts.map +1 -0
- package/dist/worker/briefed-rows.js +53 -0
- package/dist/worker/briefed-rows.js.map +1 -0
- package/dist/worker/briefed-slice.d.ts +7 -0
- package/dist/worker/briefed-slice.d.ts.map +1 -0
- package/dist/worker/briefed-slice.js +2 -0
- package/dist/worker/briefed-slice.js.map +1 -0
- package/dist/worker/briefing-of.d.ts.map +1 -1
- package/dist/worker/briefing-of.js +14 -7
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/worker/ensure-contains-base.d.ts +6 -0
- package/dist/worker/ensure-contains-base.d.ts.map +1 -0
- package/dist/worker/ensure-contains-base.js +13 -0
- package/dist/worker/ensure-contains-base.js.map +1 -0
- package/dist/worker/open-worker-scope.d.ts +7 -3
- package/dist/worker/open-worker-scope.d.ts.map +1 -1
- package/dist/worker/open-worker-scope.js +33 -21
- package/dist/worker/open-worker-scope.js.map +1 -1
- package/dist/worker/worker-place.d.ts +2 -2
- package/dist/worker/worker-place.d.ts.map +1 -1
- package/dist/worker/worker-scope.d.ts +4 -4
- package/dist/worker/worker-scope.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/event-handler/event-handler.declared.ts.tpl +1 -1
- package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
- package/templates/event-handler/event-handler.ts.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +4 -4
- package/templates/event-handler/wiring.tsyringe.tpl +4 -4
- package/templates/init/AGENTS.md.tpl +2 -2
- package/templates/init/README.md.tpl +1 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/vitest.config.ts.tpl +10 -1
- package/dist/generate/kinds/next-adr-number.d.ts +0 -4
- package/dist/generate/kinds/next-adr-number.d.ts.map +0 -1
- package/dist/generate/kinds/next-adr-number.js +0 -7
- package/dist/generate/kinds/next-adr-number.js.map +0 -1
|
@@ -4,25 +4,27 @@ import { CliError } from '../cli-error.js';
|
|
|
4
4
|
import { runGit } from '../commit/run-git.js';
|
|
5
5
|
import { WORKER_SCOPE_FILE } from '../commit/worker-scope-file.js';
|
|
6
6
|
import { KINDS } from '../generate/kinds.js';
|
|
7
|
-
import { readSlices } from '../progress/read-slices.js';
|
|
8
7
|
import { Workspace } from '../workspace/index.js';
|
|
8
|
+
import { briefedRows } from './briefed-rows.js';
|
|
9
9
|
import { briefingOf } from './briefing-of.js';
|
|
10
|
+
import { ensureContainsBase } from './ensure-contains-base.js';
|
|
11
|
+
import { baseOf } from './base-of.js';
|
|
10
12
|
import { workerGenerators } from './worker-generators.js';
|
|
11
13
|
/**
|
|
12
|
-
* Gives one worker its place: a git worktree of the project on its own branch,
|
|
13
|
-
* confines it to its context, and its briefing. An existing worktree
|
|
14
|
-
* written again.
|
|
14
|
+
* Gives one worker its place: a git worktree of the project on its own branch, cut from the
|
|
15
|
+
* base, the file that confines it to its context, and its briefing. An existing worktree or
|
|
16
|
+
* branch is kept when it contains the base: only the file is written again.
|
|
15
17
|
*/
|
|
16
18
|
export function openWorkerScope(root, config, request) {
|
|
17
19
|
const { context, dryRun } = request;
|
|
18
|
-
const { project, worktree, branch, trunk, created, inside } = placeOf(root, request);
|
|
20
|
+
const { project, worktree, branch, trunk, created, inside } = placeOf(root, config, request);
|
|
21
|
+
const { slices, notes } = briefedRows(new Workspace(root, false), context, request.rows);
|
|
19
22
|
if (created && !dryRun) {
|
|
20
|
-
addWorktree(root, worktree, branch);
|
|
23
|
+
addWorktree(root, { worktree, branch, base: trunk });
|
|
21
24
|
}
|
|
22
25
|
if (!dryRun) {
|
|
23
26
|
writeScope(inside, context);
|
|
24
27
|
}
|
|
25
|
-
const slices = todoSlices(root, context);
|
|
26
28
|
const generators = workerGenerators(KINDS);
|
|
27
29
|
const briefing = briefingOf({ config, context, project, root: inside, branch, trunk, generators, slices });
|
|
28
30
|
return {
|
|
@@ -38,25 +40,33 @@ export function openWorkerScope(root, config, request) {
|
|
|
38
40
|
generators,
|
|
39
41
|
slices,
|
|
40
42
|
briefing,
|
|
41
|
-
notes: notesOf(root, dryRun ? root : inside),
|
|
43
|
+
notes: [...notes, ...notesOf(root, dryRun ? root : inside)],
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
|
-
function placeOf(root, request) {
|
|
45
|
-
const
|
|
46
|
+
function placeOf(root, config, request) {
|
|
47
|
+
const prefix = prefixOf(root);
|
|
48
|
+
const trunk = baseOf(root, config, request.base);
|
|
46
49
|
const project = path.basename(root);
|
|
47
50
|
const worktree = path.resolve(root, request.worktree ?? `../${project}-${request.context}`);
|
|
48
51
|
const branch = request.branch ?? `build/${request.context}`;
|
|
49
52
|
const created = !isWorktree(root, worktree);
|
|
53
|
+
if (!created) {
|
|
54
|
+
ensureContainsBase(worktree, runGit(worktree, ['branch', '--show-current'])?.trim() || 'HEAD', trunk);
|
|
55
|
+
}
|
|
56
|
+
else if (branchExists(root, branch)) {
|
|
57
|
+
ensureContainsBase(root, branch, trunk);
|
|
58
|
+
}
|
|
50
59
|
return {
|
|
51
60
|
project,
|
|
52
61
|
worktree,
|
|
53
62
|
branch,
|
|
54
|
-
trunk
|
|
63
|
+
trunk,
|
|
55
64
|
created,
|
|
56
|
-
inside: path.join(worktree,
|
|
65
|
+
inside: path.join(worktree, prefix),
|
|
57
66
|
};
|
|
58
67
|
}
|
|
59
|
-
|
|
68
|
+
/** The path of the project inside its repository, empty at its top. */
|
|
69
|
+
function prefixOf(root) {
|
|
60
70
|
const prefix = runGit(root, ['rev-parse', '--show-prefix']);
|
|
61
71
|
if (prefix === undefined) {
|
|
62
72
|
throw new CliError(`${root} is not inside a git repository.`, 'Run `git init` and make a first commit: a worktree is cut from a commit.');
|
|
@@ -64,7 +74,7 @@ function repositoryOf(root) {
|
|
|
64
74
|
if (runGit(root, ['rev-parse', '--verify', '--quiet', 'HEAD']) === undefined) {
|
|
65
75
|
throw new CliError('The repository has no commit yet.', 'Commit the bootstrap first: a worktree is cut from a commit.');
|
|
66
76
|
}
|
|
67
|
-
return
|
|
77
|
+
return prefix.trim();
|
|
68
78
|
}
|
|
69
79
|
function isWorktree(root, worktree) {
|
|
70
80
|
if (!fs.existsSync(worktree)) {
|
|
@@ -79,11 +89,16 @@ function isWorktree(root, worktree) {
|
|
|
79
89
|
}
|
|
80
90
|
throw new CliError(`${worktree} exists and is not a worktree of this repository.`, 'Pass another directory with --worktree <path>, or remove that one.');
|
|
81
91
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
function branchExists(root, branch) {
|
|
93
|
+
return runGit(root, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}`]) !== undefined;
|
|
94
|
+
}
|
|
95
|
+
/** Adds the worktree on its branch: an existing branch is checked out, a new one is cut from the base. */
|
|
96
|
+
function addWorktree(root, place) {
|
|
97
|
+
const { worktree, branch, base } = place;
|
|
98
|
+
const target = branchExists(root, branch) ? [branch] : ['-b', branch, base];
|
|
99
|
+
const added = runGit(root, ['worktree', 'add', worktree, ...target]);
|
|
85
100
|
if (added === undefined) {
|
|
86
|
-
throw new CliError(`git could not add the worktree ${worktree} on the branch ${branch}.`, `Run \`git worktree add ${worktree} ${
|
|
101
|
+
throw new CliError(`git could not add the worktree ${worktree} on the branch ${branch}.`, `Run \`git worktree add ${worktree} ${target.join(' ')}\` to read its reason; a branch checked out elsewhere takes --branch <name>.`);
|
|
87
102
|
}
|
|
88
103
|
}
|
|
89
104
|
function writeScope(inside, context) {
|
|
@@ -91,9 +106,6 @@ function writeScope(inside, context) {
|
|
|
91
106
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
92
107
|
fs.writeFileSync(file, `${JSON.stringify({ context }, null, 2)}\n`);
|
|
93
108
|
}
|
|
94
|
-
function todoSlices(root, context) {
|
|
95
|
-
return (readSlices(new Workspace(root, false)) ?? []).filter((row) => row.owner === context && row.status === 'todo');
|
|
96
|
-
}
|
|
97
109
|
function notesOf(root, inside) {
|
|
98
110
|
const ignored = runGit(inside, ['check-ignore', '--quiet', WORKER_SCOPE_FILE]) !== undefined;
|
|
99
111
|
const installed = fs.existsSync(path.join(inside, 'node_modules')) || inside === root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-worker-scope.js","sourceRoot":"","sources":["../../src/worker/open-worker-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CA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AAC,EAAE;YACJ,CAAC,CAAC,CAAC,2EAA2E,MAAM,eAAe,CAAC,CAAC;KACxG,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from '../config/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BriefedSlice } from './briefed-slice.js';
|
|
3
3
|
/** What a briefing is filled with. */
|
|
4
4
|
export interface WorkerPlace {
|
|
5
5
|
readonly config: Config;
|
|
@@ -10,6 +10,6 @@ export interface WorkerPlace {
|
|
|
10
10
|
readonly branch: string;
|
|
11
11
|
readonly trunk: string;
|
|
12
12
|
readonly generators: readonly string[];
|
|
13
|
-
readonly slices: readonly
|
|
13
|
+
readonly slices: readonly BriefedSlice[];
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=worker-place.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-place.d.ts","sourceRoot":"","sources":["../../src/worker/worker-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"worker-place.d.ts","sourceRoot":"","sources":["../../src/worker/worker-place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BriefedSlice } from './briefed-slice.js';
|
|
2
2
|
/** The place one worker builds one context in, and what to tell that worker. */
|
|
3
3
|
export interface WorkerScope {
|
|
4
4
|
readonly dryRun: boolean;
|
|
@@ -10,7 +10,7 @@ export interface WorkerScope {
|
|
|
10
10
|
/** Absolute path of the project inside the worktree: where every command of the worker runs. */
|
|
11
11
|
readonly root: string;
|
|
12
12
|
readonly branch: string;
|
|
13
|
-
/** The
|
|
13
|
+
/** The base: the ref the worktree was cut from (`--base`, by default the current branch), that the worker checks against and merges back from. */
|
|
14
14
|
readonly trunk: string;
|
|
15
15
|
/** True when this run created the worktree, or would with `--dry-run`. */
|
|
16
16
|
readonly created: boolean;
|
|
@@ -18,8 +18,8 @@ export interface WorkerScope {
|
|
|
18
18
|
readonly scopeFile: string;
|
|
19
19
|
/** The generator kinds the worker may run; the conductor runs the others on the trunk. */
|
|
20
20
|
readonly generators: readonly string[];
|
|
21
|
-
/** The rows of the slices table
|
|
22
|
-
readonly slices: readonly
|
|
21
|
+
/** The rows of the slices table the worker builds: those of `--rows`, by default those of the context still to do. */
|
|
22
|
+
readonly slices: readonly BriefedSlice[];
|
|
23
23
|
readonly briefing: string;
|
|
24
24
|
readonly notes: readonly string[];
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-scope.d.ts","sourceRoot":"","sources":["../../src/worker/worker-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"worker-scope.d.ts","sourceRoot":"","sources":["../../src/worker/worker-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kJAAkJ;IAClJ,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,sHAAsH;IACtH,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.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.22.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -2,7 +2,7 @@ import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
|
2
2
|
import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
@DomainEventHandler({{event.pascal}}{{#if handler.afterCommit}}, { phase: 'after-commit' }{{/if}})
|
|
5
|
-
export class {{
|
|
5
|
+
export class {{handler.pascal}}EventHandler implements DomainEventHandler<{{event.pascal}}> {
|
|
6
6
|
async handle(event: {{event.pascal}}): Promise<void> {
|
|
7
7
|
{{#unless handler.afterCommit}}
|
|
8
8
|
// TODO(domain): state the policy "when {{event.words}}, then ..." and carry it out by executing a command of this context (receive `CommandBus` of the kernel in the constructor). It runs at the end of the unit of work, before the commit: depend only on what the transaction covers; an effect outside the database belongs in the after-commit phase or, when it must not be lost, behind an integration event, where a reaction in another context goes too.
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
announceDomainEvents,
|
|
6
6
|
unitOfWorkStage,
|
|
7
7
|
} from '@ddd-ts-kit/kernel';
|
|
8
|
-
import { {{
|
|
8
|
+
import { {{handler.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{handler.kebab}}.event-handler{{alias.ext}}';
|
|
9
9
|
import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
10
10
|
|
|
11
11
|
describe('When {{event.words}}', () => {
|
|
@@ -15,7 +15,7 @@ describe('When {{event.words}}', () => {
|
|
|
15
15
|
{{#if handler.afterCommit}}
|
|
16
16
|
it('reacts once the unit of work has committed, without failing', async () => {
|
|
17
17
|
{{/if}}
|
|
18
|
-
const handler = new {{
|
|
18
|
+
const handler = new {{handler.pascal}}EventHandler();
|
|
19
19
|
const event = new {{event.pascal}}('{{aggregate.kebab}}-1', new Date('2026-01-01T00:00:00.000Z'));
|
|
20
20
|
const domainEvents = new InMemoryDomainEventDispatcher();
|
|
21
21
|
const reactedAt: string[] = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
2
2
|
|
|
3
|
-
export class {{
|
|
3
|
+
export class {{handler.pascal}}EventHandler {
|
|
4
4
|
async handle(event: {{event.pascal}}): Promise<void> {
|
|
5
5
|
{{#unless handler.afterCommit}}
|
|
6
6
|
// TODO(domain): state the policy "when {{event.words}}, then ..." and carry it out by executing a command handler of this context (inject it through the constructor). It runs at the end of the unit of work, before the commit: depend only on what the transaction covers; an effect outside the database belongs in the after-commit phase or, when it must not be lost, behind an integration event, where a reaction in another context goes too.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
@@imports
|
|
2
|
-
import { {{
|
|
2
|
+
import { {{handler.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{handler.kebab}}.event-handler{{alias.ext}}';
|
|
3
3
|
import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
4
4
|
@@registrations
|
|
5
|
-
const {{
|
|
5
|
+
const {{handler.camel}}EventHandler = platform.adapter(new {{handler.pascal}}EventHandler(), { kind: 'domain-event-handler', context: '{{context.kebab}}' });
|
|
6
6
|
|
|
7
7
|
{{#if handler.afterCommit}}
|
|
8
8
|
platform.domainEvents.on(
|
|
9
9
|
{{event.reference}},
|
|
10
10
|
async (event) => {
|
|
11
11
|
if (event instanceof {{event.pascal}}) {
|
|
12
|
-
await {{
|
|
12
|
+
await {{handler.camel}}EventHandler.handle(event);
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
{ phase: 'after-commit' },
|
|
@@ -18,7 +18,7 @@ platform.domainEvents.on(
|
|
|
18
18
|
{{#unless handler.afterCommit}}
|
|
19
19
|
platform.domainEvents.on({{event.reference}}, async (event) => {
|
|
20
20
|
if (event instanceof {{event.pascal}}) {
|
|
21
|
-
await {{
|
|
21
|
+
await {{handler.camel}}EventHandler.handle(event);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
{{/unless}}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
@@imports
|
|
2
2
|
import { DomainEventDispatcher } from '@ddd-ts-kit/kernel';
|
|
3
|
-
import { {{
|
|
3
|
+
import { {{handler.pascal}}EventHandler } from '{{alias.context}}/application/event-handlers/{{handler.kebab}}.event-handler{{alias.ext}}';
|
|
4
4
|
import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
5
5
|
@@registrations
|
|
6
|
-
builder.bind({{
|
|
6
|
+
builder.bind({{handler.pascal}}EventHandler).toClass({{handler.pascal}}EventHandler).as('domain-event-handler');
|
|
7
7
|
@@start
|
|
8
8
|
{{#if handler.afterCommit}}
|
|
9
9
|
resolve(DomainEventDispatcher).on(
|
|
10
10
|
{{event.reference}},
|
|
11
11
|
async (event) => {
|
|
12
12
|
if (event instanceof {{event.pascal}}) {
|
|
13
|
-
await resolve({{
|
|
13
|
+
await resolve({{handler.pascal}}EventHandler).handle(event);
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
{ phase: 'after-commit' },
|
|
@@ -19,7 +19,7 @@ resolve(DomainEventDispatcher).on(
|
|
|
19
19
|
{{#unless handler.afterCommit}}
|
|
20
20
|
resolve(DomainEventDispatcher).on({{event.reference}}, async (event) => {
|
|
21
21
|
if (event instanceof {{event.pascal}}) {
|
|
22
|
-
await resolve({{
|
|
22
|
+
await resolve({{handler.pascal}}EventHandler).handle(event);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
{{/unless}}
|
|
@@ -8,7 +8,7 @@ A ddd-ts-kit project: one bounded context per directory of `{{config.contextsDir
|
|
|
8
8
|
- `npx ddd-ts-kit check --changed-since <ref>`: the architecture rules on what changed; `npx ddd-ts-kit explain <rule-id>` gives the reason and an example.
|
|
9
9
|
- `npx ddd-ts-kit list --json`: the map of the contexts. `npx ddd-ts-kit describe <context> --json`: one context as data (use cases, routes, events, ports, dependencies).
|
|
10
10
|
- `npx ddd-ts-kit status`: the next step of the plan, the slices by status, the markers left per context. `npx ddd-ts-kit todo [<context>]`: each remaining `TODO(domain)` and `it.todo` as `file:line`.
|
|
11
|
-
- `npx ddd-ts-kit docs
|
|
11
|
+
- `npm run regenerate`: every derived file in one step, after a change of route, schema, event or config: `.dependency-cruiser.cjs`, then `npm run docs:generate`, which runs `npx ddd-ts-kit docs` (the context map, the barrels, the generated sections of each `CONTEXT.md`) and writes the OpenAPI contract, the forms and the event catalog.
|
|
12
12
|
|
|
13
13
|
## Read less
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ Never edit `<context>.declarations.ts`: `generate`, `docs` and `npm run dev` rew
|
|
|
29
29
|
{{#if assembly.discovery}}
|
|
30
30
|
Never edit `<context>.dependencies.ts`: `generate`, `docs` and `npm run dev` rewrite it from the constructor signatures (it registers what each constructor is injected). After changing a constructor by hand, `npx ddd-ts-kit docs`.
|
|
31
31
|
{{/if}}
|
|
32
|
-
Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it, the forms of `openapi/forms/`), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run
|
|
32
|
+
Never edit the contracts under `openapi/` (`openapi/openapi.yaml`, one file per document when `openapi.documents` splits it, the forms of `openapi/forms/`), `docs/integration/asyncapi.yaml`, `docs/integration/event-catalog.md`, `{{config.platformDir}}/http/openapi-documents.ts`, `.dependency-cruiser.cjs` or the generated sections of a `CONTEXT.md`: change the code or the config, then `npm run regenerate`. `stored-events.lock.json` is written by `npx ddd-ts-kit docs --stored-events` once the shape of a version is final (`docs --check` fails while one is unrecorded), never by hand: a stored shape changes only by a new version with its upcaster (`event-sourcing/upcaster-required`).
|
|
33
33
|
{{#if sdk.on}}
|
|
34
34
|
{{sdk.instruction}}
|
|
35
35
|
{{/if}}
|
|
@@ -320,4 +320,5 @@ for each moment of the project: https://github.com/gbourgeat/ddd-ts-kit/blob/mai
|
|
|
320
320
|
| `npm run test:e2e` | the whole application through HTTP, on an in-process database unless `DATABASE_URL` is set |
|
|
321
321
|
| `npm run check:arch` | `ddd-ts-kit check` |
|
|
322
322
|
| `npm run docs:generate` | context map, OpenAPI, AsyncAPI and event catalog{{#if sdk.on}}, the clients under `clients/`{{/if}} |
|
|
323
|
+
| `npm run regenerate` | every derived file after a change: `.dependency-cruiser.cjs`, then `docs:generate` |
|
|
323
324
|
| `npm run verify` | everything CI runs |
|
|
@@ -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.22.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",
|
|
@@ -39,7 +39,16 @@ export default defineConfig(({ mode }) => ({
|
|
|
39
39
|
exclude: [INTEGRATION_SPECS, ...NOT_AFFECTED],
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
-
{
|
|
42
|
+
{
|
|
43
|
+
extends: true,
|
|
44
|
+
test: {
|
|
45
|
+
name: INTEGRATION_MODE,
|
|
46
|
+
include: [INTEGRATION_SPECS],
|
|
47
|
+
exclude: NOT_AFFECTED,
|
|
48
|
+
// A hook opens the test database (PGlite started and its tables created, or a server reached): under coverage on a busy machine it outlasts the default 10 seconds.
|
|
49
|
+
hookTimeout: 60_000,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
43
52
|
],
|
|
44
53
|
coverage: {
|
|
45
54
|
provider: 'v8',
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Workspace } from '../../workspace/index.js';
|
|
2
|
-
/** The number the next decision record of the project takes: one after the highest in `docs/adr/`. */
|
|
3
|
-
export declare function nextAdrNumber(ws: Workspace): string;
|
|
4
|
-
//# sourceMappingURL=next-adr-number.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next-adr-number.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/next-adr-number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,sGAAsG;AACtG,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAInD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ADR_DIRECTORY } from '../../check/governance/adr-directory.js';
|
|
2
|
-
/** The number the next decision record of the project takes: one after the highest in `docs/adr/`. */
|
|
3
|
-
export function nextAdrNumber(ws) {
|
|
4
|
-
const taken = ws.list(ADR_DIRECTORY).map((file) => Number(/^(\d+)-/.exec(file)?.[1] ?? '0'));
|
|
5
|
-
return String(Math.max(0, ...taken) + 1).padStart(4, '0');
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=next-adr-number.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next-adr-number.js","sourceRoot":"","sources":["../../../src/generate/kinds/next-adr-number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAGxE,sGAAsG;AACtG,MAAM,UAAU,aAAa,CAAC,EAAa;IACzC,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAE7F,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC"}
|