ddd-ts-kit 0.84.0 → 0.85.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 +50 -0
- package/README.fr.md +60 -27
- package/README.md +57 -28
- package/dist/check/canonical/stray-entry.js +3 -2
- package/dist/check/canonical/stray-entry.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/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +3 -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 +17 -6
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +4 -4
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.js +10 -8
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +54 -9
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/declared-declarations.d.ts +7 -0
- package/dist/check/fixtures/declared-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/declared-declarations.js +21 -0
- package/dist/check/fixtures/declared-declarations.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts +4 -1
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +17 -9
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/paths.d.ts +1 -0
- package/dist/check/fixtures/paths.d.ts.map +1 -1
- package/dist/check/fixtures/paths.js +1 -0
- package/dist/check/fixtures/paths.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +3 -3
- package/dist/check/fixtures/signature-project.js +3 -3
- package/dist/check/fixtures/signature.d.ts +2 -1
- package/dist/check/fixtures/signature.d.ts.map +1 -1
- package/dist/check/fixtures/signature.js +2 -1
- package/dist/check/fixtures/signature.js.map +1 -1
- package/dist/check/fixtures/single-file-declarations.d.ts +7 -0
- package/dist/check/fixtures/single-file-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/single-file-declarations.js +21 -0
- package/dist/check/fixtures/single-file-declarations.js.map +1 -0
- package/dist/check/rules/clean-file-size.d.ts.map +1 -1
- package/dist/check/rules/clean-file-size.js +9 -1
- package/dist/check/rules/clean-file-size.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +56 -23
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/naming-suffix.d.ts.map +1 -1
- package/dist/check/rules/naming-suffix.js +7 -3
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/support/is-generated-context-file.d.ts +5 -1
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +11 -5
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +23 -11
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +7 -4
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/print-report.js +1 -0
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commit/is-derived.js +4 -4
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/declared/barrel-file.d.ts +4 -1
- package/dist/declared/barrel-file.d.ts.map +1 -1
- package/dist/declared/barrel-file.js +4 -1
- package/dist/declared/barrel-file.js.map +1 -1
- package/dist/declared/context-declarations.d.ts +24 -0
- package/dist/declared/context-declarations.d.ts.map +1 -0
- package/dist/declared/context-declarations.js +22 -0
- package/dist/declared/context-declarations.js.map +1 -0
- package/dist/declared/declarations-folder-of.d.ts +10 -0
- package/dist/declared/declarations-folder-of.d.ts.map +1 -0
- package/dist/declared/declarations-folder-of.js +13 -0
- package/dist/declared/declarations-folder-of.js.map +1 -0
- package/dist/declared/folder-declarations-file.d.ts +7 -0
- package/dist/declared/folder-declarations-file.d.ts.map +1 -0
- package/dist/declared/folder-declarations-file.js +10 -0
- package/dist/declared/folder-declarations-file.js.map +1 -0
- package/dist/declared/index.d.ts +8 -1
- package/dist/declared/index.d.ts.map +1 -1
- package/dist/declared/index.js +8 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/is-declarations-file.d.ts +7 -0
- package/dist/declared/is-declarations-file.d.ts.map +1 -0
- package/dist/declared/is-declarations-file.js +20 -0
- package/dist/declared/is-declarations-file.js.map +1 -0
- package/dist/declared/keeps-single-file.d.ts +11 -0
- package/dist/declared/keeps-single-file.d.ts.map +1 -0
- package/dist/declared/keeps-single-file.js +23 -0
- package/dist/declared/keeps-single-file.js.map +1 -0
- package/dist/declared/render-declarations.d.ts +18 -0
- package/dist/declared/render-declarations.d.ts.map +1 -0
- package/dist/declared/render-declarations.js +37 -0
- package/dist/declared/render-declarations.js.map +1 -0
- package/dist/declared/render-folder-declarations.d.ts +11 -0
- package/dist/declared/render-folder-declarations.d.ts.map +1 -0
- package/dist/declared/render-folder-declarations.js +23 -0
- package/dist/declared/render-folder-declarations.js.map +1 -0
- package/dist/declared/single-file-declarations.d.ts +9 -0
- package/dist/declared/single-file-declarations.d.ts.map +1 -0
- package/dist/declared/single-file-declarations.js +14 -0
- package/dist/declared/single-file-declarations.js.map +1 -0
- package/dist/declared/single-file-notice.d.ts +8 -0
- package/dist/declared/single-file-notice.d.ts.map +1 -0
- package/dist/declared/single-file-notice.js +9 -0
- package/dist/declared/single-file-notice.js.map +1 -0
- package/dist/derived/is-derived.d.ts +4 -3
- package/dist/derived/is-derived.d.ts.map +1 -1
- package/dist/derived/is-derived.js +8 -8
- package/dist/derived/is-derived.js.map +1 -1
- package/dist/describe/read-consumed-events.js +7 -2
- package/dist/describe/read-consumed-events.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +3 -2
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/write-docs.d.ts +3 -1
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +4 -2
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/generate/context-imports.d.ts.map +1 -1
- package/dist/generate/context-imports.js +2 -1
- package/dist/generate/context-imports.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.d.ts +14 -0
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/reaction-of.js +93 -0
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +30 -18
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +11 -4
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -15
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/refuse-shared-writes.js +1 -1
- package/dist/generate/refuse-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 +19 -16
- package/dist/help/notes.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/merge/classify-conflict.d.ts +2 -1
- package/dist/merge/classify-conflict.d.ts.map +1 -1
- package/dist/merge/classify-conflict.js +9 -0
- package/dist/merge/classify-conflict.js.map +1 -1
- package/dist/merge/higher-version.d.ts +7 -0
- package/dist/merge/higher-version.d.ts.map +1 -0
- package/dist/merge/higher-version.js +59 -0
- package/dist/merge/higher-version.js.map +1 -0
- package/dist/merge/merge-client-manifest.d.ts +16 -0
- package/dist/merge/merge-client-manifest.d.ts.map +1 -0
- package/dist/merge/merge-client-manifest.js +39 -0
- package/dist/merge/merge-client-manifest.js.map +1 -0
- package/dist/merge/merge-exclusions.d.ts +4 -3
- package/dist/merge/merge-exclusions.d.ts.map +1 -1
- package/dist/merge/merge-exclusions.js +6 -3
- package/dist/merge/merge-exclusions.js.map +1 -1
- package/dist/merge/resolve-conflict.d.ts +3 -2
- package/dist/merge/resolve-conflict.d.ts.map +1 -1
- package/dist/merge/resolve-conflict.js +29 -7
- package/dist/merge/resolve-conflict.js.map +1 -1
- package/dist/plan/batched-waves.d.ts +2 -0
- package/dist/plan/batched-waves.d.ts.map +1 -1
- package/dist/plan/batched-waves.js +20 -7
- package/dist/plan/batched-waves.js.map +1 -1
- package/dist/plan/format-plan.d.ts +1 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +33 -8
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/other-stories.d.ts +9 -0
- package/dist/plan/other-stories.d.ts.map +1 -0
- package/dist/plan/other-stories.js +31 -0
- package/dist/plan/other-stories.js.map +1 -0
- package/dist/plan/plan-waves.d.ts +2 -1
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +13 -4
- package/dist/plan/plan-waves.js.map +1 -1
- package/dist/plan/wave-plan.d.ts +28 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.js +4 -2
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/workspace/workspace-report.d.ts +2 -0
- package/dist/workspace/workspace-report.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +8 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +24 -3
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +2 -2
- package/templates/e2e/e2e-reaction.spec.ts.tpl +68 -0
- package/templates/init/AGENTS.md.tpl +1 -1
- package/templates/init/README.md.tpl +2 -1
- package/templates/init/e2e/start-application.database.ts.tpl +22 -2
- package/templates/init/e2e/start-application.memory.ts.tpl +22 -2
- package/templates/init/platform/events/custom-event-bus.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +12 -12
- package/templates/pipeline/github/workflows/codeql.yml +1 -1
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +1 -1
- package/templates/pipeline/github/workflows/pr-title.yml +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -0
- package/templates/test-world/world.buses.ts.tpl +1 -1
- package/templates/test-world/world.tsyringe.ts.tpl +1 -0
- package/dist/check/fixtures/declared-barrel.d.ts +0 -3
- package/dist/check/fixtures/declared-barrel.d.ts.map +0 -1
- package/dist/check/fixtures/declared-barrel.js +0 -4
- package/dist/check/fixtures/declared-barrel.js.map +0 -1
- package/dist/declared/render-barrel.d.ts +0 -11
- package/dist/declared/render-barrel.d.ts.map +0 -1
- package/dist/declared/render-barrel.js +0 -29
- package/dist/declared/render-barrel.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-plan.d.ts","sourceRoot":"","sources":["../../src/plan/format-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"format-plan.d.ts","sourceRoot":"","sources":["../../src/plan/format-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqD,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAMlG;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAyBjD"}
|
package/dist/plan/format-plan.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const BEFORE_EACH_MERGE = 'Before each merge: `npx ddd-ts-kit merge-trunk --to-land --cwd <worktree>`, then the squash merge';
|
|
3
3
|
/**
|
|
4
4
|
* `plan-waves` for a reader: the problems alone when there are some, else each wave and its
|
|
5
|
-
* batches, then the merge order and what to run before each merge.
|
|
5
|
+
* batches, the rows another story waits for, then the merge order and what to run before each merge.
|
|
6
6
|
*/
|
|
7
7
|
export function formatPlan(plan) {
|
|
8
8
|
const scope = plan.context === null ? plan.file : `${plan.file}, context ${plan.context}`;
|
|
@@ -19,7 +19,8 @@ export function formatPlan(plan) {
|
|
|
19
19
|
const rows = batches.reduce((count, batch) => count + batch.rows.length, 0);
|
|
20
20
|
return [
|
|
21
21
|
`Waves (${scope}): ${rows} rows not done, ${plural(plan.waves.length, 'wave', 'waves')}, ${plural(batches.length, 'batch', 'batches')}`,
|
|
22
|
-
...plan.waves.flatMap(waveLines),
|
|
22
|
+
...plan.waves.flatMap((wave) => waveLines(wave, plan.context)),
|
|
23
|
+
...otherStoriesLines(plan),
|
|
23
24
|
`Merge order: ${plan.mergeOrder.join(', ')}`,
|
|
24
25
|
BEFORE_EACH_MERGE,
|
|
25
26
|
].join('\n');
|
|
@@ -27,15 +28,15 @@ export function formatPlan(plan) {
|
|
|
27
28
|
function plural(count, one, many) {
|
|
28
29
|
return `${count} ${count === 1 ? one : many}`;
|
|
29
30
|
}
|
|
30
|
-
function waveLines(wave) {
|
|
31
|
-
return [`Wave ${wave.wave}`, ...wave.batches.flatMap(batchLines)];
|
|
31
|
+
function waveLines(wave, context) {
|
|
32
|
+
return [`Wave ${wave.wave}`, ...wave.batches.flatMap((batch) => batchLines(batch, context))];
|
|
32
33
|
}
|
|
33
|
-
function batchLines(batch) {
|
|
34
|
+
function batchLines(batch, context) {
|
|
34
35
|
const owner = batch.owner === batch.context ? batch.context : `${batch.owner}, ${batch.context}`;
|
|
35
36
|
const aggregates = batch.aggregates.length === 0 ? 'aggregate unknown' : `aggregate ${batch.aggregates.join(', ')}`;
|
|
36
37
|
return [
|
|
37
38
|
` ${batch.id} ${owner} (${aggregates})`,
|
|
38
|
-
...batch.rows.map(rowLine),
|
|
39
|
+
...batch.rows.map((row) => rowLine(row, context)),
|
|
39
40
|
` ${howLine(batch)}`,
|
|
40
41
|
...(batch.sameFiles.length === 0 ? [] : [` likely to touch the same files as ${batch.sameFiles.join(', ')}`]),
|
|
41
42
|
...(batch.unknownOverlap.length === 0
|
|
@@ -43,11 +44,35 @@ function batchLines(batch) {
|
|
|
43
44
|
: [` unknown whether it touches the files of ${batch.unknownOverlap.join(', ')}: no aggregate named`]),
|
|
44
45
|
];
|
|
45
46
|
}
|
|
46
|
-
function rowLine(row) {
|
|
47
|
+
function rowLine(row, context) {
|
|
47
48
|
const status = row.status === 'todo' ? '' : ` (${row.status})`;
|
|
48
|
-
const
|
|
49
|
+
const after = row.waitingForRows.map((waited) => waitedText(waited, row, context));
|
|
50
|
+
const waits = after.length === 0 ? '' : `, after ${after.join(', ')}`;
|
|
49
51
|
return ` #${row.id} ${row.kind} "${row.slice}"${status}${waits}`;
|
|
50
52
|
}
|
|
53
|
+
/** `#US1.02 (todo)`; with its context and story when it is of another story or outside the context shown: `#US1.04 (todo, billing, story US1)`. */
|
|
54
|
+
function waitedText(waited, row, context) {
|
|
55
|
+
const elsewhere = waited.story !== row.story || (context !== null && waited.context !== context);
|
|
56
|
+
if (!elsewhere) {
|
|
57
|
+
return `#${waited.id} (${waited.status})`;
|
|
58
|
+
}
|
|
59
|
+
const story = waited.story === null ? (row.story === null ? '' : ', no story') : `, story ${waited.story}`;
|
|
60
|
+
return `#${waited.id} (${waited.status}, ${waited.context}${story})`;
|
|
61
|
+
}
|
|
62
|
+
/** The rows a story waits for in another, each with its status, and where it is planned. */
|
|
63
|
+
function otherStoriesLines(plan) {
|
|
64
|
+
if (plan.otherStories.length === 0) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return ['Rows another story waits for, not done', ...plan.otherStories.map(otherStoryLine)];
|
|
68
|
+
}
|
|
69
|
+
/** `#US1.04 billing slice "Pay invoice" (story US1, owner billing, todo): in W2.1, waited for by #US2.05`. */
|
|
70
|
+
function otherStoryLine(row) {
|
|
71
|
+
const story = row.story === null ? '' : `story ${row.story}, `;
|
|
72
|
+
const where = row.batch === null ? `not shown here (npx ddd-ts-kit plan-waves ${row.context})` : `in ${row.batch}`;
|
|
73
|
+
const waiting = row.waitedForBy.map((id) => `#${id}`).join(', ');
|
|
74
|
+
return ` #${row.id} ${row.context} ${row.kind} "${row.slice}" (${story}owner ${row.owner}, ${row.status}): ${where}, waited for by ${waiting}`;
|
|
75
|
+
}
|
|
51
76
|
function howLine(batch) {
|
|
52
77
|
if (batch.brief !== null) {
|
|
53
78
|
return batch.brief;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-plan.js","sourceRoot":"","sources":["../../src/plan/format-plan.ts"],"names":[],"mappings":"AAEA,mIAAmI;AACnI,MAAM,iBAAiB,GACrB,mGAAmG,CAAC;AAEtG;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,OAAO,EAAE,CAAC;IAE1F,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,UAAU,KAAK,gEAAgE;YAC/E,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;SAC1D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,IAAI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
|
+
import type { OtherStoryRow, Wave } from './wave-plan.js';
|
|
3
|
+
/**
|
|
4
|
+
* The planned rows that a planned row of another story depends on, in the order of the file: the
|
|
5
|
+
* work of one story that another waits for. Every planned row is not done; a row whose id names no
|
|
6
|
+
* story belongs to none, which is not the story of a row that names one.
|
|
7
|
+
*/
|
|
8
|
+
export declare function otherStories(planned: readonly Slice[], waves: readonly Wave[]): OtherStoryRow[];
|
|
9
|
+
//# sourceMappingURL=other-stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"other-stories.d.ts","sourceRoot":"","sources":["../../src/plan/other-stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,aAAa,EAAE,CA4B/F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { storyOf } from '../story/story-of.js';
|
|
2
|
+
/**
|
|
3
|
+
* The planned rows that a planned row of another story depends on, in the order of the file: the
|
|
4
|
+
* work of one story that another waits for. Every planned row is not done; a row whose id names no
|
|
5
|
+
* story belongs to none, which is not the story of a row that names one.
|
|
6
|
+
*/
|
|
7
|
+
export function otherStories(planned, waves) {
|
|
8
|
+
const batchOf = new Map(waves.flatMap((wave) => wave.batches.flatMap((batch) => batch.rows.map((row) => [row.id, batch.id]))));
|
|
9
|
+
return planned.flatMap((row) => {
|
|
10
|
+
const story = storyOf(row.id) ?? null;
|
|
11
|
+
const waitedForBy = planned
|
|
12
|
+
.filter((other) => other.dependsOn.includes(row.id) && (storyOf(other.id) ?? null) !== story)
|
|
13
|
+
.map((other) => other.id);
|
|
14
|
+
return waitedForBy.length === 0
|
|
15
|
+
? []
|
|
16
|
+
: [
|
|
17
|
+
{
|
|
18
|
+
id: row.id,
|
|
19
|
+
context: row.context,
|
|
20
|
+
story,
|
|
21
|
+
kind: row.kind,
|
|
22
|
+
slice: row.slice,
|
|
23
|
+
owner: row.owner,
|
|
24
|
+
status: row.status,
|
|
25
|
+
batch: batchOf.get(row.id) ?? null,
|
|
26
|
+
waitedForBy,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=other-stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"other-stories.js","sourceRoot":"","sources":["../../src/plan/other-stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAyB,EAAE,KAAsB;IAC5E,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAU,CAAC,CAAC,CAAC,CAC/G,CAAC;IAEF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QAEtC,MAAM,WAAW,GAAG,OAAO;aACxB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;aAC5F,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAE5B,OAAO,WAAW,CAAC,MAAM,KAAK,CAAC;YAC7B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE;oBACE,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,OAAO,EAAE,GAAG,CAAC,OAAO;oBACpB,KAAK;oBACL,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI;oBAClC,WAAW;iBACZ;aACF,CAAC;IACR,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -8,7 +8,8 @@ export interface PlanRequest {
|
|
|
8
8
|
/**
|
|
9
9
|
* The rows of the slices file not done, in waves cut into batches, with the order of their merges.
|
|
10
10
|
* A problem that makes the rows impossible to order is returned alone, without waves. With a
|
|
11
|
-
* context, the rows of other contexts it waits for count in the waves but are not shown.
|
|
11
|
+
* context, the rows of other contexts it waits for count in the waves but are not shown. The rows
|
|
12
|
+
* of one story that rows of another wait for are listed apart, shown in the waves or not.
|
|
12
13
|
*/
|
|
13
14
|
export declare function planWaves(rows: readonly Slice[], request: PlanRequest): WavePlan;
|
|
14
15
|
//# sourceMappingURL=plan-waves.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-waves.d.ts","sourceRoot":"","sources":["../../src/plan/plan-waves.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"plan-waves.d.ts","sourceRoot":"","sources":["../../src/plan/plan-waves.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAMlD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,8BAA8B;AAC9B,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,GAAG,QAAQ,CAoBhF"}
|
package/dist/plan/plan-waves.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { SLICES_FILE } from '../progress/read-slices.js';
|
|
2
2
|
import { batchedWaves } from './batched-waves.js';
|
|
3
3
|
import { mergeOrder } from './merge-order.js';
|
|
4
|
+
import { otherStories } from './other-stories.js';
|
|
4
5
|
import { planProblems } from './plan-problems.js';
|
|
5
6
|
import { rowsToPlan } from './rows-to-plan.js';
|
|
6
7
|
import { waveNumbers } from './wave-numbers.js';
|
|
7
8
|
/**
|
|
8
9
|
* The rows of the slices file not done, in waves cut into batches, with the order of their merges.
|
|
9
10
|
* A problem that makes the rows impossible to order is returned alone, without waves. With a
|
|
10
|
-
* context, the rows of other contexts it waits for count in the waves but are not shown.
|
|
11
|
+
* context, the rows of other contexts it waits for count in the waves but are not shown. The rows
|
|
12
|
+
* of one story that rows of another wait for are listed apart, shown in the waves or not.
|
|
11
13
|
*/
|
|
12
14
|
export function planWaves(rows, request) {
|
|
13
15
|
const { context } = request;
|
|
14
16
|
const planned = rowsToPlan(rows, context);
|
|
15
17
|
const problems = planProblems(rows, planned);
|
|
16
18
|
if (problems.length > 0) {
|
|
17
|
-
return { file: SLICES_FILE, context, problems, waves: [], mergeOrder: [] };
|
|
19
|
+
return { file: SLICES_FILE, context, problems, waves: [], mergeOrder: [], otherStories: [] };
|
|
18
20
|
}
|
|
19
21
|
const shown = planned.filter((row) => context === null || row.context === context);
|
|
20
|
-
const waves = batchedWaves({ rows: shown, numbers: waveNumbers(planned) });
|
|
21
|
-
return {
|
|
22
|
+
const waves = batchedWaves({ rows: shown, planned, numbers: waveNumbers(planned) });
|
|
23
|
+
return {
|
|
24
|
+
file: SLICES_FILE,
|
|
25
|
+
context,
|
|
26
|
+
problems,
|
|
27
|
+
waves,
|
|
28
|
+
mergeOrder: mergeOrder(waves, planned),
|
|
29
|
+
otherStories: otherStories(planned, waves),
|
|
30
|
+
};
|
|
22
31
|
}
|
|
23
32
|
//# sourceMappingURL=plan-waves.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-waves.js","sourceRoot":"","sources":["../../src/plan/plan-waves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD
|
|
1
|
+
{"version":3,"file":"plan-waves.js","sourceRoot":"","sources":["../../src/plan/plan-waves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAsB,EAAE,OAAoB;IACpE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE7C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAC/F,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IACnF,MAAM,KAAK,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEpF,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,OAAO;QACP,QAAQ;QACR,KAAK;QACL,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC;QACtC,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
package/dist/plan/wave-plan.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface WavePlan {
|
|
|
8
8
|
readonly waves: readonly Wave[];
|
|
9
9
|
/** The ids of the batches, by wave, then the batch more rows wait for first. */
|
|
10
10
|
readonly mergeOrder: readonly string[];
|
|
11
|
+
/** The rows not done that a planned row of another story depends on, in the order of the file. */
|
|
12
|
+
readonly otherStories: readonly OtherStoryRow[];
|
|
11
13
|
}
|
|
12
14
|
export interface PlanProblem {
|
|
13
15
|
readonly kind: 'cycle' | 'unknown-dependency' | 'no-owner' | 'duplicate-id';
|
|
@@ -42,7 +44,33 @@ export interface PlannedRow {
|
|
|
42
44
|
readonly kind: string;
|
|
43
45
|
readonly slice: string;
|
|
44
46
|
readonly status: string;
|
|
47
|
+
/** The story or milestone of the row, its id without the last `.<number>` (`US1` for `US1.02`); null for an id without it. */
|
|
48
|
+
readonly story: string | null;
|
|
45
49
|
/** The dependencies not done yet, each in an earlier wave. */
|
|
46
50
|
readonly waitingFor: readonly string[];
|
|
51
|
+
/** The rows of `waitingFor`, in its order, with where they belong and their status. */
|
|
52
|
+
readonly waitingForRows: readonly WaitedRow[];
|
|
53
|
+
}
|
|
54
|
+
/** A row not done that a planned row waits for, shown in the waves or not. */
|
|
55
|
+
export interface WaitedRow {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly context: string;
|
|
58
|
+
readonly story: string | null;
|
|
59
|
+
/** `todo` or `in progress`. */
|
|
60
|
+
readonly status: string;
|
|
61
|
+
}
|
|
62
|
+
/** A row not done of one story that rows of another story wait for: they start once it is done. */
|
|
63
|
+
export interface OtherStoryRow {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly context: string;
|
|
66
|
+
readonly story: string | null;
|
|
67
|
+
readonly kind: string;
|
|
68
|
+
readonly slice: string;
|
|
69
|
+
readonly owner: string;
|
|
70
|
+
readonly status: string;
|
|
71
|
+
/** The batch that holds it; null when it is not shown, being outside the context asked for. */
|
|
72
|
+
readonly batch: string | null;
|
|
73
|
+
/** The planned rows of other stories that depend on it, in the order of the file. */
|
|
74
|
+
readonly waitedForBy: readonly string[];
|
|
47
75
|
}
|
|
48
76
|
//# sourceMappingURL=wave-plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wave-plan.d.ts","sourceRoot":"","sources":["../../src/plan/wave-plan.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAA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CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.85.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.85.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -80,10 +80,12 @@ function stepLines({ context, trunk }) {
|
|
|
80
80
|
'`TODO(review)` lines: those remarks of a review are followed by the conductor, leave them.',
|
|
81
81
|
];
|
|
82
82
|
}
|
|
83
|
-
function scopeLines({ config, generators }, directory) {
|
|
83
|
+
function scopeLines({ config, context, generators }, directory) {
|
|
84
84
|
return [
|
|
85
85
|
'Scope',
|
|
86
|
-
`- You may write: ${directory}
|
|
86
|
+
`- You may write: ${directory}/**, test/e2e/<use-case>.e2e.spec.ts of your slices (split by behaviour into`,
|
|
87
|
+
` test/e2e/<use-case>-<behaviour>.e2e.spec.ts when one grows long), and their helpers and worlds in`,
|
|
88
|
+
` test/e2e/support/${context}/.`,
|
|
87
89
|
`- You may not write anything else. Shared files (config, ${config.platformDir}, ${config.sourceRoot}/main.ts,`,
|
|
88
90
|
' package.json, lockfile, migrations, docs/) and other contexts are refused by the guard:',
|
|
89
91
|
' report the need, do not work around it. The shell writes inside your scope only, as the editor tools do:',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"briefing-of.js","sourceRoot":"","sources":["../../src/worker/briefing-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD;;;GAGG;AACH,MAAM,YAAY,GAAG;IACnB,4FAA4F;IAC5F,6FAA6F;IAC7F,0FAA0F;IAC1F,8FAA8F;IAC9F,+FAA+F;IAC/F,4BAA4B;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,YAAY,GAAG;IACnB,yGAAyG;IACzG,2GAA2G;IAC3G,yGAAyG;IACzG,6GAA6G;IAC7G,4GAA4G;IAC5G,eAAe;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAkB;IAC3C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,SAAS,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE,CAAC;IAE3D,OAAO;QACL,iCAAiC,OAAO,OAAO,KAAK,CAAC,OAAO,GAAG;QAC/D,EAAE;QACF,aAAa,IAAI,cAAc,KAAK,CAAC,MAAM,aAAa,KAAK,EAAE;QAC/D,6CAA6C,IAAI,wBAAwB,IAAI,MAAM;QACnF,2BAA2B,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,4CAA4C;QAC7H,EAAE;QACF,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;QAC/B,EAAE;QACF,6DAA6D;QAC7D,GAAG,UAAU,CAAC,KAAK,C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AAe;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IAE5D,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC;QACzB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACzG,CAAC,CAAC,MAAM,CAAC;AACb,CAAC"}
|
|
@@ -3,6 +3,8 @@ import type { TodoLocation } from './todo-location.js';
|
|
|
3
3
|
export interface WorkspaceReport {
|
|
4
4
|
readonly created: string[];
|
|
5
5
|
readonly updated: string[];
|
|
6
|
+
/** Derived files removed because nothing derives them any more. */
|
|
7
|
+
readonly deleted: string[];
|
|
6
8
|
readonly skipped: string[];
|
|
7
9
|
readonly next: string[];
|
|
8
10
|
readonly todos: TodoLocation[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-report.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;CAC1B"}
|
|
1
|
+
{"version":3,"file":"workspace-report.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;CAC1B"}
|
|
@@ -12,6 +12,8 @@ export declare class Workspace {
|
|
|
12
12
|
readonly notes: string[];
|
|
13
13
|
private readonly pending;
|
|
14
14
|
private readonly skipped;
|
|
15
|
+
/** Files on disk this command removes: no longer derived from anything. */
|
|
16
|
+
private readonly removed;
|
|
15
17
|
private readonly steps;
|
|
16
18
|
private rewrite;
|
|
17
19
|
constructor(root: string, force: boolean);
|
|
@@ -26,6 +28,12 @@ export declare class Workspace {
|
|
|
26
28
|
/** Never replaces a file the user may have edited, unless asked to with --force. */
|
|
27
29
|
create(file: string, content: string): boolean;
|
|
28
30
|
update(file: string, written: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Removes a file a command derives and that is no longer derived from anything, such as the
|
|
33
|
+
* generated declarations of a folder that holds no declared class any more. A file only
|
|
34
|
+
* planned is forgotten; one on disk is deleted at the commit, and reported.
|
|
35
|
+
*/
|
|
36
|
+
delete(file: string): void;
|
|
29
37
|
/**
|
|
30
38
|
* Every module this command writes names the files of the project through `rewrite`: a project
|
|
31
39
|
* that keeps its platform flat is written imports of the flat files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace.ts"],"names":[],"mappings":"AAKA,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;IAED,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAiB1C;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAMzB;IAED;;;OAGG;IACH,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAEpE;IAED,sIAAsI;IACtI,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3B;IAED,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI1B;IAED,iHAAiH;IACjH,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAIzB;IAED,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe,CA0BvC;IAED,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,MAAM;IAYd,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -16,6 +16,8 @@ export class Workspace {
|
|
|
16
16
|
notes = [];
|
|
17
17
|
pending = new Map();
|
|
18
18
|
skipped = new Set();
|
|
19
|
+
/** Files on disk this command removes: no longer derived from anything. */
|
|
20
|
+
removed = new Set();
|
|
19
21
|
steps = [];
|
|
20
22
|
rewrite;
|
|
21
23
|
constructor(root, force) {
|
|
@@ -23,13 +25,16 @@ export class Workspace {
|
|
|
23
25
|
this.force = force;
|
|
24
26
|
}
|
|
25
27
|
exists(file) {
|
|
26
|
-
return this.pending.has(file) || fs.existsSync(this.absolute(file));
|
|
28
|
+
return this.pending.has(file) || (!this.removed.has(file) && fs.existsSync(this.absolute(file)));
|
|
27
29
|
}
|
|
28
30
|
read(file) {
|
|
29
31
|
const pending = this.pending.get(file);
|
|
30
32
|
if (pending !== undefined) {
|
|
31
33
|
return pending.content;
|
|
32
34
|
}
|
|
35
|
+
if (this.removed.has(file)) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
33
38
|
try {
|
|
34
39
|
return fs.readFileSync(this.absolute(file), 'utf8');
|
|
35
40
|
}
|
|
@@ -42,7 +47,8 @@ export class Workspace {
|
|
|
42
47
|
const planned = [...this.pending.keys()]
|
|
43
48
|
.filter((file) => path.posix.dirname(file) === directory)
|
|
44
49
|
.map((file) => path.posix.basename(file));
|
|
45
|
-
|
|
50
|
+
const onDisk = this.onDisk(directory, (entry) => entry.isFile()).filter((name) => !this.removed.has(`${directory}/${name}`));
|
|
51
|
+
return [...new Set([...onDisk, ...planned])].sort();
|
|
46
52
|
}
|
|
47
53
|
/** Names of the directories directly inside `directory`, on disk or planned. */
|
|
48
54
|
directories(directory) {
|
|
@@ -60,12 +66,13 @@ export class Workspace {
|
|
|
60
66
|
/** Never replaces a file the user may have edited, unless asked to with --force. */
|
|
61
67
|
create(file, content) {
|
|
62
68
|
const onDisk = fs.existsSync(this.absolute(file));
|
|
63
|
-
if (
|
|
69
|
+
if (this.exists(file) && !this.force) {
|
|
64
70
|
if (onDisk) {
|
|
65
71
|
this.skipped.add(file);
|
|
66
72
|
}
|
|
67
73
|
return false;
|
|
68
74
|
}
|
|
75
|
+
this.removed.delete(file);
|
|
69
76
|
this.pending.set(file, { content: this.spoken(this.withImports(file, content)), existed: onDisk });
|
|
70
77
|
return true;
|
|
71
78
|
}
|
|
@@ -76,11 +83,23 @@ export class Workspace {
|
|
|
76
83
|
pending.content = content;
|
|
77
84
|
return;
|
|
78
85
|
}
|
|
86
|
+
this.removed.delete(file);
|
|
79
87
|
if (this.read(file) === content) {
|
|
80
88
|
return;
|
|
81
89
|
}
|
|
82
90
|
this.pending.set(file, { content, existed: true });
|
|
83
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Removes a file a command derives and that is no longer derived from anything, such as the
|
|
94
|
+
* generated declarations of a folder that holds no declared class any more. A file only
|
|
95
|
+
* planned is forgotten; one on disk is deleted at the commit, and reported.
|
|
96
|
+
*/
|
|
97
|
+
delete(file) {
|
|
98
|
+
this.pending.delete(file);
|
|
99
|
+
if (fs.existsSync(this.absolute(file))) {
|
|
100
|
+
this.removed.add(file);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
84
103
|
/**
|
|
85
104
|
* Every module this command writes names the files of the project through `rewrite`: a project
|
|
86
105
|
* that keeps its platform flat is written imports of the flat files.
|
|
@@ -111,12 +130,14 @@ export class Workspace {
|
|
|
111
130
|
const todos = [...left, ...this.steps.map((step) => this.located(step))];
|
|
112
131
|
if (!dryRun) {
|
|
113
132
|
written.forEach(({ file, content }) => this.write(file, content));
|
|
133
|
+
this.removed.forEach((file) => fs.rmSync(this.absolute(file), { force: true }));
|
|
114
134
|
}
|
|
115
135
|
// The language comes before the code: its definition is the first thing to do.
|
|
116
136
|
todos.sort((left, right) => Number(isLanguageStep(right)) - Number(isLanguageStep(left)));
|
|
117
137
|
return {
|
|
118
138
|
created: written.filter(({ existed }) => !existed).map(({ file }) => file),
|
|
119
139
|
updated: written.filter(({ existed }) => existed).map(({ file }) => file),
|
|
140
|
+
deleted: [...this.removed].sort(),
|
|
120
141
|
skipped: [...this.skipped].sort(),
|
|
121
142
|
next: todos.map((todo) => `${todo.file}:${todo.line}`),
|
|
122
143
|
todos,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/workspace/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAQxC;;;;;GAKG;AACH,MAAM,OAAO,SAAS;
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot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C5C,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/G,CAAC;CACF;AAED,SAAS,cAAc,CAAC,IAAkB;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.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.85.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
{{#if tests.vitest}}
|
|
3
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it, onTestFailed } from 'vitest';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if tests.jest}}
|
|
6
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from '@jest/globals';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless upstream.known}}
|
|
9
|
+
import type { IntegrationEvent } from '@ddd-ts-kit/kernel';
|
|
10
|
+
{{/unless}}
|
|
11
|
+
{{#if tests.vitest}}
|
|
12
|
+
import { reportSeedOnFailure } from '@ddd-ts-kit/testing/faker';
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{#if upstream.known}}
|
|
15
|
+
import { {{upstream.definition}} } from '{{alias.contexts}}/{{upstream.kebab}}/published-language/index{{alias.ext}}';
|
|
16
|
+
{{/if}}
|
|
17
|
+
import { startApplication, type RunningApplication } from '{{alias.test}}/e2e/support/start-application{{alias.ext}}';
|
|
18
|
+
|
|
19
|
+
// No route starts "{{name.words}}": {{e2e.handlers}} sends its command when {{upstream.kebab}} publishes {{upstream.eventName}}, so the spec publishes that event as {{upstream.kebab}} would.
|
|
20
|
+
describe('{{name.title}}, end to end', () => {
|
|
21
|
+
let application: RunningApplication;
|
|
22
|
+
|
|
23
|
+
beforeAll(async () => {
|
|
24
|
+
application = await startApplication();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
afterAll(async () => {
|
|
28
|
+
await application.close();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
beforeEach(async () => {
|
|
32
|
+
await application.reset();
|
|
33
|
+
});
|
|
34
|
+
{{#if tests.vitest}}
|
|
35
|
+
|
|
36
|
+
reportSeedOnFailure({ beforeEach, onTestFailed });
|
|
37
|
+
{{/if}}
|
|
38
|
+
|
|
39
|
+
it('runs "{{name.words}}" when {{upstream.kebab}} publishes {{upstream.eventName}}', async () => {
|
|
40
|
+
// TODO(domain): arrange what "{{name.words}}" needs through the public API only (routes), with the builders of test/builders and generated data; give the payload every field {{upstream.kebab}} declares, with the identifiers the arrangement created.
|
|
41
|
+
{{#if upstream.known}}
|
|
42
|
+
const meta = { id: randomUUID(), occurredAt: new Date().toISOString() };
|
|
43
|
+
const event = {{upstream.definition}}.create({ {{upstream.payloadKey}}: '{{upstream.payloadSample}}' }, meta);
|
|
44
|
+
{{/if}}
|
|
45
|
+
{{#unless upstream.known}}
|
|
46
|
+
const event: IntegrationEvent = {
|
|
47
|
+
id: randomUUID(),
|
|
48
|
+
type: '{{upstream.eventName}}',
|
|
49
|
+
version: {{upstream.version}},
|
|
50
|
+
occurredAt: new Date().toISOString(),
|
|
51
|
+
payload: { {{upstream.payloadKey}}: '{{upstream.payloadSample}}' },
|
|
52
|
+
};
|
|
53
|
+
{{/unless}}
|
|
54
|
+
|
|
55
|
+
await expect(application.publish([event])).resolves.toBeUndefined();
|
|
56
|
+
await application.settled();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
{{#if e2e.readable}}
|
|
60
|
+
// TODO(domain): replace each entry below by a test of what a client or another context observes once `await application.settled()` has resolved: the answers of {{e2e.reads}}, then the integration events (`collectEvents(application.events, [...])`); never a fixed delay, never the database.
|
|
61
|
+
it.todo('lets a client observe the outcome of "{{name.words}}" through the API');
|
|
62
|
+
{{/if}}
|
|
63
|
+
{{#unless e2e.readable}}
|
|
64
|
+
// TODO(domain): replace each entry below by a test of what another context observes once `await application.settled()` has resolved: the integration events "{{name.words}}" publishes (`collectEvents(application.events, [...])`), or the answer of a route that reads what it changed; never a fixed delay, never the database.
|
|
65
|
+
{{/unless}}
|
|
66
|
+
it.todo('publishes the integration events other contexts rely on');
|
|
67
|
+
it.todo('has the same outcome when {{upstream.eventName}} is delivered twice');
|
|
68
|
+
});
|
|
@@ -24,7 +24,7 @@ One file per layer in `.claude/rules/`: `domain.md` (`domain/`, the shared kerne
|
|
|
24
24
|
|
|
25
25
|
Create every file of a role with `npx ddd-ts-kit generate <kind> ... --json`, then fill the `TODO(domain)` places it lists; never write one by hand, never restructure what a generator wrote.
|
|
26
26
|
{{#if assembly.barrel}}
|
|
27
|
-
Never edit `<context>.declarations.ts
|
|
27
|
+
Never edit `<context>.declarations.ts` nor the `<folder>.declarations.ts` of a role folder (`application/commands/commands.declarations.ts`): `generate`, `docs` and `npm run dev` rewrite them, from the role files and from the constructor signatures (each folder file registers what the constructors of its folder are injected; the one at the root re-exports them). After changing a constructor by hand, `npx ddd-ts-kit docs`.
|
|
28
28
|
{{/if}}
|
|
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`.
|
|
@@ -94,7 +94,8 @@ configuration, the storage, and `composeApplication` of `{{config.platformDir}}/
|
|
|
94
94
|
{{#if style.declared}}
|
|
95
95
|
- **A context declares itself.** Each class says what it is with a decorator of
|
|
96
96
|
`@ddd-ts-kit/kernel/declarations` and is its own registration{{#if assembly.barrel}}; the composition root reads the
|
|
97
|
-
generated
|
|
97
|
+
generated `<context>.declarations.ts`, which re-exports the generated declarations of each role folder
|
|
98
|
+
(`application/commands/commands.declarations.ts`){{/if}}{{#if assembly.discovery}}; the composition root discovers the role files of
|
|
98
99
|
each context at startup (`discoverContext`), publishers and jobs included{{/if}}.
|
|
99
100
|
{{/if}}
|
|
100
101
|
{{#if broker.external}}
|