ddd-ts-kit 0.23.1 → 0.24.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 +37 -0
- package/README.fr.md +42 -7
- package/README.md +38 -6
- package/dist/check/canonical/stray-entry.d.ts +8 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -0
- package/dist/check/canonical/stray-entry.js +75 -0
- package/dist/check/canonical/stray-entry.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/explain/persistence-docs.js +1 -1
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +5 -0
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tree-fixtures.js +17 -0
- package/dist/check/fixtures/tree-fixtures.js.map +1 -1
- package/dist/check/migrations/drizzle-history-findings.js +1 -1
- package/dist/check/migrations/drizzle-history-findings.js.map +1 -1
- package/dist/check/rules/tree-closed.d.ts.map +1 -1
- package/dist/check/rules/tree-closed.js +4 -68
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/check/rules/tree-documented-paths.d.ts +3 -0
- package/dist/check/rules/tree-documented-paths.d.ts.map +1 -0
- package/dist/check/rules/tree-documented-paths.js +54 -0
- package/dist/check/rules/tree-documented-paths.js.map +1 -0
- package/dist/commands/drizzle-generate.d.ts +6 -1
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +39 -6
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/plan-waves.d.ts +9 -0
- package/dist/commands/plan-waves.d.ts.map +1 -0
- package/dist/commands/plan-waves.js +36 -0
- package/dist/commands/plan-waves.js.map +1 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -2
- package/dist/commands/status.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 -3
- 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 -0
- package/dist/help/usage.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +7 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/migration/branch-migration.d.ts +9 -0
- package/dist/migration/branch-migration.d.ts.map +1 -0
- package/dist/migration/branch-migration.js +2 -0
- package/dist/migration/branch-migration.js.map +1 -0
- package/dist/migration/branch-migrations.d.ts +16 -0
- package/dist/migration/branch-migrations.d.ts.map +1 -0
- package/dist/migration/branch-migrations.js +48 -0
- package/dist/migration/branch-migrations.js.map +1 -0
- package/dist/migration/delete-branch-migrations.d.ts +9 -0
- package/dist/migration/delete-branch-migrations.d.ts.map +1 -0
- package/dist/migration/delete-branch-migrations.js +23 -0
- package/dist/migration/delete-branch-migrations.js.map +1 -0
- package/dist/migration/drizzle-run.d.ts +7 -0
- package/dist/migration/drizzle-run.d.ts.map +1 -0
- package/dist/migration/drizzle-run.js +2 -0
- package/dist/migration/drizzle-run.js.map +1 -0
- package/dist/migration/drizzle-silent-failures.js +1 -1
- package/dist/migration/drizzle-silent-failures.js.map +1 -1
- package/dist/migration/find-project-formatter.d.ts +8 -0
- package/dist/migration/find-project-formatter.d.ts.map +1 -0
- package/dist/migration/find-project-formatter.js +52 -0
- package/dist/migration/find-project-formatter.js.map +1 -0
- package/dist/migration/format-written-files.d.ts +9 -0
- package/dist/migration/format-written-files.d.ts.map +1 -0
- package/dist/migration/format-written-files.js +32 -0
- package/dist/migration/format-written-files.js.map +1 -0
- package/dist/migration/generate-and-read.d.ts +6 -0
- package/dist/migration/generate-and-read.d.ts.map +1 -0
- package/dist/migration/generate-and-read.js +14 -0
- package/dist/migration/generate-and-read.js.map +1 -0
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +4 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/known-primary-keys.d.ts +3 -0
- package/dist/migration/known-primary-keys.d.ts.map +1 -0
- package/dist/migration/known-primary-keys.js +2 -0
- package/dist/migration/known-primary-keys.js.map +1 -0
- package/dist/migration/migration-files.d.ts +7 -0
- package/dist/migration/migration-files.d.ts.map +1 -0
- package/dist/migration/migration-files.js +29 -0
- package/dist/migration/migration-files.js.map +1 -0
- package/dist/migration/plan-replay.d.ts +9 -0
- package/dist/migration/plan-replay.d.ts.map +1 -0
- package/dist/migration/plan-replay.js +68 -0
- package/dist/migration/plan-replay.js.map +1 -0
- package/dist/migration/previous-primary-keys.d.ts +9 -0
- package/dist/migration/previous-primary-keys.d.ts.map +1 -0
- package/dist/migration/previous-primary-keys.js +55 -0
- package/dist/migration/previous-primary-keys.js.map +1 -0
- package/dist/migration/primary-key-order-finding.d.ts +12 -0
- package/dist/migration/primary-key-order-finding.d.ts.map +1 -0
- package/dist/migration/primary-key-order-finding.js +2 -0
- package/dist/migration/primary-key-order-finding.js.map +1 -0
- package/dist/migration/primary-key-order-findings.d.ts +12 -0
- package/dist/migration/primary-key-order-findings.d.ts.map +1 -0
- package/dist/migration/primary-key-order-findings.js +55 -0
- package/dist/migration/primary-key-order-findings.js.map +1 -0
- package/dist/migration/project-formatter.d.ts +9 -0
- package/dist/migration/project-formatter.d.ts.map +1 -0
- package/dist/migration/project-formatter.js +2 -0
- package/dist/migration/project-formatter.js.map +1 -0
- package/dist/migration/replay-drizzle-migrations.d.ts +15 -0
- package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -0
- package/dist/migration/replay-drizzle-migrations.js +63 -0
- package/dist/migration/replay-drizzle-migrations.js.map +1 -0
- package/dist/migration/replay-plan.d.ts +11 -0
- package/dist/migration/replay-plan.d.ts.map +1 -0
- package/dist/migration/replay-plan.js +2 -0
- package/dist/migration/replay-plan.js.map +1 -0
- package/dist/migration/replayed-name.d.ts +7 -0
- package/dist/migration/replayed-name.d.ts.map +1 -0
- package/dist/migration/replayed-name.js +12 -0
- package/dist/migration/replayed-name.js.map +1 -0
- package/dist/migration/sql-statement.d.ts +6 -0
- package/dist/migration/sql-statement.d.ts.map +1 -0
- package/dist/migration/sql-statement.js +2 -0
- package/dist/migration/sql-statement.js.map +1 -0
- package/dist/migration/sql-statements.d.ts +4 -0
- package/dist/migration/sql-statements.d.ts.map +1 -0
- package/dist/migration/sql-statements.js +36 -0
- package/dist/migration/sql-statements.js.map +1 -0
- package/dist/migration/table-change.d.ts +12 -0
- package/dist/migration/table-change.d.ts.map +1 -0
- package/dist/migration/table-change.js +2 -0
- package/dist/migration/table-change.js.map +1 -0
- package/dist/migration/table-changes.d.ts +9 -0
- package/dist/migration/table-changes.d.ts.map +1 -0
- package/dist/migration/table-changes.js +55 -0
- package/dist/migration/table-changes.js.map +1 -0
- package/dist/migration/tidy-written-migration.d.ts +5 -0
- package/dist/migration/tidy-written-migration.d.ts.map +1 -0
- package/dist/migration/tidy-written-migration.js +8 -0
- package/dist/migration/tidy-written-migration.js.map +1 -0
- package/dist/migration/wait-for-next-second.d.ts +6 -0
- package/dist/migration/wait-for-next-second.d.ts.map +1 -0
- package/dist/migration/wait-for-next-second.js +11 -0
- package/dist/migration/wait-for-next-second.js.map +1 -0
- package/dist/migration/warn-primary-key-order.d.ts +5 -0
- package/dist/migration/warn-primary-key-order.d.ts.map +1 -0
- package/dist/migration/warn-primary-key-order.js +16 -0
- package/dist/migration/warn-primary-key-order.js.map +1 -0
- package/dist/migration/written-migration.d.ts +9 -0
- package/dist/migration/written-migration.d.ts.map +1 -0
- package/dist/migration/written-migration.js +2 -0
- package/dist/migration/written-migration.js.map +1 -0
- package/dist/migration/written-paths.d.ts +3 -0
- package/dist/migration/written-paths.d.ts.map +1 -0
- package/dist/migration/written-paths.js +5 -0
- package/dist/migration/written-paths.js.map +1 -0
- package/dist/plan/aggregates-of.d.ts +6 -0
- package/dist/plan/aggregates-of.d.ts.map +1 -0
- package/dist/plan/aggregates-of.js +13 -0
- package/dist/plan/aggregates-of.js.map +1 -0
- package/dist/plan/batched-waves.d.ts +18 -0
- package/dist/plan/batched-waves.d.ts.map +1 -0
- package/dist/plan/batched-waves.js +73 -0
- package/dist/plan/batched-waves.js.map +1 -0
- package/dist/plan/cycles-of.d.ts +8 -0
- package/dist/plan/cycles-of.d.ts.map +1 -0
- package/dist/plan/cycles-of.js +30 -0
- package/dist/plan/cycles-of.js.map +1 -0
- package/dist/plan/format-plan.d.ts +4 -0
- package/dist/plan/format-plan.d.ts.map +1 -0
- package/dist/plan/format-plan.js +53 -0
- package/dist/plan/format-plan.js.map +1 -0
- package/dist/plan/merge-order.d.ts +8 -0
- package/dist/plan/merge-order.d.ts.map +1 -0
- package/dist/plan/merge-order.js +32 -0
- package/dist/plan/merge-order.js.map +1 -0
- package/dist/plan/plan-problems.d.ts +8 -0
- package/dist/plan/plan-problems.d.ts.map +1 -0
- package/dist/plan/plan-problems.js +57 -0
- package/dist/plan/plan-problems.js.map +1 -0
- package/dist/plan/plan-waves.d.ts +16 -0
- package/dist/plan/plan-waves.d.ts.map +1 -0
- package/dist/plan/plan-waves.js +23 -0
- package/dist/plan/plan-waves.js.map +1 -0
- package/dist/plan/rows-to-plan.d.ts +7 -0
- package/dist/plan/rows-to-plan.d.ts.map +1 -0
- package/dist/plan/rows-to-plan.js +19 -0
- package/dist/plan/rows-to-plan.js.map +1 -0
- package/dist/plan/wave-numbers.d.ts +8 -0
- package/dist/plan/wave-numbers.d.ts.map +1 -0
- package/dist/plan/wave-numbers.js +27 -0
- package/dist/plan/wave-numbers.js.map +1 -0
- package/dist/plan/wave-plan.d.ts +48 -0
- package/dist/plan/wave-plan.d.ts.map +1 -0
- package/dist/plan/wave-plan.js +2 -0
- package/dist/plan/wave-plan.js.map +1 -0
- package/dist/progress/format-progress.d.ts.map +1 -1
- package/dist/progress/format-progress.js +16 -1
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/progress/progress.d.ts +11 -1
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/read-progress.d.ts +6 -2
- package/dist/progress/read-progress.d.ts.map +1 -1
- package/dist/progress/read-progress.js +10 -5
- package/dist/progress/read-progress.js.map +1 -1
- package/dist/progress/status-row-of.d.ts +16 -0
- package/dist/progress/status-row-of.d.ts.map +1 -0
- package/dist/progress/status-row-of.js +23 -0
- package/dist/progress/status-row-of.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/rows-on-branches.d.ts +8 -0
- package/dist/worker/rows-on-branches.d.ts.map +1 -0
- package/dist/worker/rows-on-branches.js +9 -0
- package/dist/worker/rows-on-branches.js.map +1 -0
- package/package.json +2 -2
- package/templates/e2e/e2e.spec.ts.tpl +2 -2
- package/templates/init/e2e/start-application.database.ts.tpl +30 -1
- package/templates/init/e2e/start-application.memory.ts.tpl +30 -1
- package/templates/init/e2e/vitest.e2e.config.ts.tpl +4 -0
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +18 -1
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +18 -1
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +18 -1
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +18 -1
- package/templates/init/platform/database/test-database-template.ts.tpl +23 -0
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/vitest.config.ts.tpl +6 -0
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { barrelFile, dependenciesFile } from '../../declared/index.js';
|
|
3
|
-
import { isCanonicalDirectory } from '../canonical/is-canonical-directory.js';
|
|
4
|
-
import { OPEN_DIRECTORIES } from '../canonical/open-directories.js';
|
|
5
|
-
import { roleOf } from '../canonical/role-of.js';
|
|
1
|
+
import { strayEntry } from '../canonical/stray-entry.js';
|
|
6
2
|
import { reporter } from '../support/reporter.js';
|
|
7
3
|
export const treeClosed = {
|
|
8
4
|
id: 'tree/closed',
|
|
@@ -13,78 +9,18 @@ export const treeClosed = {
|
|
|
13
9
|
// A rejected directory is reported once: what it holds is not reported again.
|
|
14
10
|
const rejected = [];
|
|
15
11
|
return project.contextEntries.flatMap((entry) => {
|
|
16
|
-
|
|
17
|
-
if (placed === undefined || rejected.some((parent) => entry.startsWith(parent))) {
|
|
12
|
+
if (rejected.some((parent) => entry.startsWith(parent))) {
|
|
18
13
|
return [];
|
|
19
14
|
}
|
|
20
|
-
const
|
|
21
|
-
const flaw = isDirectory ? strayDirectory(placed) : straySource(placed);
|
|
15
|
+
const flaw = strayEntry(entry, project.config);
|
|
22
16
|
if (flaw === undefined) {
|
|
23
17
|
return [];
|
|
24
18
|
}
|
|
25
|
-
if (
|
|
19
|
+
if (entry.endsWith('/')) {
|
|
26
20
|
rejected.push(entry);
|
|
27
21
|
}
|
|
28
22
|
return [report({ file: entry.replace(/\/$/, ''), line: 1 }, flaw.message, flaw.fix)];
|
|
29
23
|
});
|
|
30
24
|
},
|
|
31
25
|
};
|
|
32
|
-
function place(entry, { contextsDir, contexts, stack }) {
|
|
33
|
-
const [context = '', ...rest] = entry
|
|
34
|
-
.slice(contextsDir.length + 1)
|
|
35
|
-
.replace(/\/$/, '')
|
|
36
|
-
.split('/');
|
|
37
|
-
if (rest.length === 0) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
context,
|
|
42
|
-
declared: stack.style === 'declared',
|
|
43
|
-
inside: rest.join('/'),
|
|
44
|
-
extras: contexts[context]?.extraDirectories ?? [],
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function strayDirectory({ context, inside, extras }) {
|
|
48
|
-
if (isCanonicalDirectory(inside) || coveredByExtra(extras, inside)) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
message: `"${inside}" is not a directory of the canonical tree.`,
|
|
53
|
-
fix: `Move its files to the canonical directory of their role (see \`ddd-ts-kit explain tree/closed\`), or, if this is a design decision, add "${inside}" to contexts.${context}.extraDirectories in ddd-ts-kit.config.json.`,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function straySource(placed) {
|
|
57
|
-
const { inside, extras } = placed;
|
|
58
|
-
if (!inside.endsWith('.ts')) {
|
|
59
|
-
return undefined;
|
|
60
|
-
}
|
|
61
|
-
const directory = path.posix.dirname(inside);
|
|
62
|
-
if (directory === '.') {
|
|
63
|
-
return atContextRoot(placed);
|
|
64
|
-
}
|
|
65
|
-
const open = OPEN_DIRECTORIES.some((root) => directory === root || directory.startsWith(`${root}/`));
|
|
66
|
-
if (open || roleOf(directory) !== undefined || coveredByExtra(extras, directory)) {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
message: `"${inside}" is not in a role directory.`,
|
|
71
|
-
fix: `Move it one level down into the directory of its role (for example ${directory.split('/')[0] ?? directory}/<role>/), so that its suffix and its tests can be checked.`,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function atContextRoot({ context, declared, inside: file }) {
|
|
75
|
-
const generated = [barrelFile(context), dependenciesFile(context)];
|
|
76
|
-
if (file === `${context}.module.ts` || (declared && generated.includes(file))) {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
const allowed = declared
|
|
80
|
-
? `CONTEXT.md, the generated ${generated.join(' or ')} and ${context}.module.ts`
|
|
81
|
-
: `CONTEXT.md and ${context}.module.ts`;
|
|
82
|
-
return {
|
|
83
|
-
message: `"${file}" sits at the root of the context.`,
|
|
84
|
-
fix: `Move it into the directory of its role; only ${allowed} live at the root of a context.`,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function coveredByExtra(extras, directory) {
|
|
88
|
-
return extras.some((extra) => directory === extra || directory.startsWith(`${extra}/`) || extra.startsWith(`${directory}/`));
|
|
89
|
-
}
|
|
90
26
|
//# sourceMappingURL=tree-closed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-closed.js","sourceRoot":"","sources":["../../../src/check/rules/tree-closed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree-closed.js","sourceRoot":"","sources":["../../../src/check/rules/tree-closed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,aAAa;IACjB,WAAW,EACT,mIAAmI;IACrI,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,8EAA8E;QAC9E,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,OAAO,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9C,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACxD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAE/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YAED,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-documented-paths.d.ts","sourceRoot":"","sources":["../../../src/check/rules/tree-documented-paths.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAS7C,eAAO,MAAM,mBAAmB,EAAE,IAmBjC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { strayEntry } from '../canonical/stray-entry.js';
|
|
4
|
+
import { reporter } from '../support/reporter.js';
|
|
5
|
+
/** Where the plan, the design notes and the reviews of a project live. */
|
|
6
|
+
const ARCHITECTURE_DOCS = 'docs/architecture';
|
|
7
|
+
/** A path written as code in Markdown, a `:line` after it left out. */
|
|
8
|
+
const CITED = /`([^`\s]+?)(?::\d+)?`/g;
|
|
9
|
+
export const treeDocumentedPaths = {
|
|
10
|
+
id: 'tree/documented-paths',
|
|
11
|
+
description: 'A path of a bounded context cited as code in docs/architecture (a plan, a design note, a review) is a place the canonical tree allows: a document that names a directory the tree refuses describes a design the code no longer has.',
|
|
12
|
+
scope: 'project',
|
|
13
|
+
run(project) {
|
|
14
|
+
const report = reporter(project, this.id);
|
|
15
|
+
return markdownUnder(project.root, ARCHITECTURE_DOCS).flatMap((document) => citedFlaws(fs.readFileSync(path.join(project.root, document), 'utf8'), project.config).map(({ line, cited, flaw }) => report({ file: document, line }, `"${cited}" names a place the canonical tree refuses: ${flaw.message}`, `Write the place the code has now (\`npx ddd-ts-kit describe <context>\` lists it), or remove the path; ${flaw.fix}`)));
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
/** Each path of a context cited in a document, with the first flaw of its directories or of itself. */
|
|
19
|
+
function citedFlaws(text, config) {
|
|
20
|
+
return text.split('\n').flatMap((content, index) => [...content.matchAll(CITED)].flatMap(([, cited = '']) => {
|
|
21
|
+
const flaw = cited.startsWith(`${config.contextsDir}/`) ? firstFlaw(cited, config) : undefined;
|
|
22
|
+
return flaw === undefined ? [] : [{ line: index + 1, cited, flaw }];
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
/** The directories of a path from the outermost, then the path itself: the first one the tree refuses. */
|
|
26
|
+
function firstFlaw(cited, config) {
|
|
27
|
+
const segments = cited.replace(/\/$/, '').split('/');
|
|
28
|
+
const directories = segments.slice(0, -1).map((_, index) => `${segments.slice(0, index + 1).join('/')}/`);
|
|
29
|
+
const entries = [...directories, cited];
|
|
30
|
+
for (const entry of entries) {
|
|
31
|
+
const flaw = strayEntry(entry, config);
|
|
32
|
+
if (flaw !== undefined) {
|
|
33
|
+
return flaw;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
function markdownUnder(root, directory) {
|
|
39
|
+
const absolute = path.join(root, directory);
|
|
40
|
+
if (!fs.existsSync(absolute)) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return fs
|
|
44
|
+
.readdirSync(absolute, { withFileTypes: true })
|
|
45
|
+
.flatMap((entry) => {
|
|
46
|
+
const relative = `${directory}/${entry.name}`;
|
|
47
|
+
if (entry.isDirectory()) {
|
|
48
|
+
return markdownUnder(root, relative);
|
|
49
|
+
}
|
|
50
|
+
return entry.isFile() && entry.name.endsWith('.md') ? [relative] : [];
|
|
51
|
+
})
|
|
52
|
+
.sort();
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=tree-documented-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-documented-paths.js","sourceRoot":"","sources":["../../../src/check/rules/tree-documented-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAC9C,uEAAuE;AACvE,MAAM,KAAK,GAAG,wBAAwB,CAAC;AAEvC,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,uBAAuB;IAC3B,WAAW,EACT,sOAAsO;IACxO,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAE1C,OAAO,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CACzE,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CACxF,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAa,EAAE,CACnC,MAAM,CACJ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EACxB,IAAI,KAAK,+CAA+C,IAAI,CAAC,OAAO,EAAE,EACtE,0GAA0G,IAAI,CAAC,GAAG,EAAE,CACrH,CACJ,CACF,CAAC;IACJ,CAAC;CACF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AAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,SAAiB;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAE5C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,EAAE;SACN,WAAW,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SAC9C,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,GAAG,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAE9C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,OAAO,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Command } from './command.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* `db:generate` of a Drizzle project: drizzle-kit generate, which fails instead of succeeding
|
|
4
|
+
* silently when it cannot ask its question, then formats what it wrote and warns about a primary
|
|
5
|
+
* key changed in an order that fails. `--replay` generates again the migrations of a branch on top
|
|
6
|
+
* of the trunk it merged.
|
|
7
|
+
*/
|
|
3
8
|
export declare const drizzleGenerateCommand: Command;
|
|
4
9
|
//# sourceMappingURL=drizzle-generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle-generate.d.ts","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"drizzle-generate.d.ts","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAyBpC,CAAC"}
|
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import { CliError } from '../cli-error.js';
|
|
2
|
-
import {
|
|
2
|
+
import { generateAndRead, replayDrizzleMigrations, tidyWrittenMigration } from '../migration/index.js';
|
|
3
3
|
import { Arguments } from './arguments.js';
|
|
4
|
-
/**
|
|
4
|
+
/** The trunk a branch merged, when `--replay` is not given another. */
|
|
5
|
+
const DEFAULT_BASE = 'origin/main';
|
|
6
|
+
/**
|
|
7
|
+
* `db:generate` of a Drizzle project: drizzle-kit generate, which fails instead of succeeding
|
|
8
|
+
* silently when it cannot ask its question, then formats what it wrote and warns about a primary
|
|
9
|
+
* key changed in an order that fails. `--replay` generates again the migrations of a branch on top
|
|
10
|
+
* of the trunk it merged.
|
|
11
|
+
*/
|
|
5
12
|
export const drizzleGenerateCommand = (argv, io) => {
|
|
6
|
-
const args = Arguments.parse(argv, {
|
|
13
|
+
const args = Arguments.parse(argv, {
|
|
14
|
+
name: { type: 'string' },
|
|
15
|
+
custom: { type: 'boolean', default: false },
|
|
16
|
+
replay: { type: 'boolean', default: false },
|
|
17
|
+
base: { type: 'string' },
|
|
18
|
+
});
|
|
19
|
+
const root = args.projectRoot;
|
|
20
|
+
const interactive = process.stdin.isTTY && process.stdout.isTTY;
|
|
21
|
+
if (args.flag('replay')) {
|
|
22
|
+
refuseNamedReplay(args);
|
|
23
|
+
return replayDrizzleMigrations({ root, base: args.text('base') ?? DEFAULT_BASE, interactive }, io);
|
|
24
|
+
}
|
|
25
|
+
const name = namedMigration(args);
|
|
26
|
+
const { code, written } = generateAndRead({ root, name, custom: args.flag('custom'), interactive }, io);
|
|
27
|
+
if (code === 0) {
|
|
28
|
+
tidyWrittenMigration(written, io);
|
|
29
|
+
}
|
|
30
|
+
return code;
|
|
31
|
+
};
|
|
32
|
+
function refuseNamedReplay(args) {
|
|
33
|
+
if (args.text('name') !== undefined || args.flag('custom')) {
|
|
34
|
+
throw new CliError('A replay generates the migrations of the branch again under their own names, custom ones included.', 'Run `npx ddd-ts-kit drizzle-generate --replay [--base <ref>]`, without --name or --custom.');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function namedMigration(args) {
|
|
7
38
|
const name = args.text('name')?.trim() ?? '';
|
|
39
|
+
if (args.text('base') !== undefined) {
|
|
40
|
+
throw new CliError('--base names the trunk of a replay.', 'Run `npx ddd-ts-kit drizzle-generate --replay --base <ref>` after merging the trunk into the branch.');
|
|
41
|
+
}
|
|
8
42
|
if (name === '') {
|
|
9
43
|
throw new CliError('A migration is named by what it does.', 'Run `npm run db:generate <what-it-does>`, for example `npm run db:generate add-invoices`.');
|
|
10
44
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
45
|
+
return name;
|
|
46
|
+
}
|
|
14
47
|
//# sourceMappingURL=drizzle-generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle-generate.js","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"drizzle-generate.js","sourceRoot":"","sources":["../../src/commands/drizzle-generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MA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,EAAE,EAAE,CAAC,CAAC;IAExG,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,SAAS,iBAAiB,CAAC,IAAe;IACxC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,QAAQ,CAChB,oGAAoG,EACpG,4FAA4F,CAC7F,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,IAAe;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAE7C,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,IAAI,QAAQ,CAChB,qCAAqC,EACrC,sGAAsG,CACvG,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,QAAQ,CAChB,uCAAuC,EACvC,2FAA2F,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Command } from './command.js';
|
|
2
|
+
/**
|
|
3
|
+
* Orders the rows of the slices file not done, of the project or of one context, in waves cut
|
|
4
|
+
* into batches of one or two rows, with the command that briefs each batch and the order of the
|
|
5
|
+
* merges. Exits 1, without waves, while a cycle, an unknown dependency or a row without owner
|
|
6
|
+
* keeps the rows from being ordered.
|
|
7
|
+
*/
|
|
8
|
+
export declare const planWavesCommand: Command;
|
|
9
|
+
//# sourceMappingURL=plan-waves.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-waves.d.ts","sourceRoot":"","sources":["../../src/commands/plan-waves.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAiB9B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { CliError } from '../cli-error.js';
|
|
3
|
+
import { formatPlan } from '../plan/format-plan.js';
|
|
4
|
+
import { planWaves } from '../plan/plan-waves.js';
|
|
5
|
+
import { readSlices, SLICES_FILE } from '../progress/read-slices.js';
|
|
6
|
+
import { Workspace } from '../workspace/index.js';
|
|
7
|
+
import { Arguments } from './arguments.js';
|
|
8
|
+
/**
|
|
9
|
+
* Orders the rows of the slices file not done, of the project or of one context, in waves cut
|
|
10
|
+
* into batches of one or two rows, with the command that briefs each batch and the order of the
|
|
11
|
+
* merges. Exits 1, without waves, while a cycle, an unknown dependency or a row without owner
|
|
12
|
+
* keeps the rows from being ordered.
|
|
13
|
+
*/
|
|
14
|
+
export const planWavesCommand = (argv, io) => {
|
|
15
|
+
const args = Arguments.parse(argv, {});
|
|
16
|
+
const root = args.projectRoot;
|
|
17
|
+
const rows = readSlices(new Workspace(root, false));
|
|
18
|
+
if (rows === undefined) {
|
|
19
|
+
throw new CliError(`${SLICES_FILE} has no slices table.`, 'Plan the slices first (the skill ddd-ts-kit:plan-slices writes the table), then run plan-waves again.');
|
|
20
|
+
}
|
|
21
|
+
const plan = planWaves(rows, { context: contextOf(rows, args.positionals[0]), project: path.basename(root) });
|
|
22
|
+
io.out(args.json ? JSON.stringify(plan, null, 2) : formatPlan(plan));
|
|
23
|
+
return plan.problems.length === 0 ? 0 : 1;
|
|
24
|
+
};
|
|
25
|
+
/** The context asked for, which a row of the file must name; null when none is. */
|
|
26
|
+
function contextOf(rows, asked) {
|
|
27
|
+
if (asked === undefined) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const contexts = [...new Set(rows.map((row) => row.context))].sort();
|
|
31
|
+
if (!contexts.includes(asked)) {
|
|
32
|
+
throw new CliError(`No row of ${SLICES_FILE} is in the context "${asked}".`, `Use one of: ${contexts.join(', ')}.`);
|
|
33
|
+
}
|
|
34
|
+
return asked;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=plan-waves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-waves.js","sourceRoot":"","sources":["../../src/commands/plan-waves.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACpD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IAC9B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAEpD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,QAAQ,CAChB,GAAG,WAAW,uBAAuB,EACrC,uGAAuG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE9G,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAErE,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,mFAAmF;AACnF,SAAS,SAAS,CAAC,IAAsB,EAAE,KAAyB;IAClE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAErE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,QAAQ,CAAC,aAAa,WAAW,uBAAuB,KAAK,IAAI,EAAE,eAAe,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Command } from './command.js';
|
|
2
2
|
/**
|
|
3
3
|
* Prints where the work stands: the next step of the plan, the slices by status and by owner, the markers left in each context.
|
|
4
|
+
* Each slice not done says whether it is ready on the trunk, ready once a worker's branch merges, or waiting.
|
|
4
5
|
* With `--workers`, the workers of a parallel build instead: who builds what in which worktree, and the files two of them change.
|
|
5
6
|
*/
|
|
6
7
|
export declare const statusCommand: Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,OAiB3B,CAAC"}
|
package/dist/commands/status.js
CHANGED
|
@@ -3,21 +3,23 @@ import { formatProgress } from '../progress/format-progress.js';
|
|
|
3
3
|
import { readProgress } from '../progress/read-progress.js';
|
|
4
4
|
import { formatWorkers } from '../worker/format-workers.js';
|
|
5
5
|
import { readWorkers } from '../worker/read-workers.js';
|
|
6
|
+
import { rowsOnBranches } from '../worker/rows-on-branches.js';
|
|
6
7
|
import { Workspace } from '../workspace/index.js';
|
|
7
8
|
import { Arguments } from './arguments.js';
|
|
8
9
|
/**
|
|
9
10
|
* Prints where the work stands: the next step of the plan, the slices by status and by owner, the markers left in each context.
|
|
11
|
+
* Each slice not done says whether it is ready on the trunk, ready once a worker's branch merges, or waiting.
|
|
10
12
|
* With `--workers`, the workers of a parallel build instead: who builds what in which worktree, and the files two of them change.
|
|
11
13
|
*/
|
|
12
14
|
export const statusCommand = (argv, io) => {
|
|
13
15
|
const args = Arguments.parse(argv, { workers: { type: 'boolean', default: false } });
|
|
14
16
|
const root = args.projectRoot;
|
|
17
|
+
const workers = readWorkers(root);
|
|
15
18
|
if (args.flag('workers')) {
|
|
16
|
-
const workers = readWorkers(root);
|
|
17
19
|
io.out(args.json ? JSON.stringify(workers, null, 2) : formatWorkers(workers));
|
|
18
20
|
return 0;
|
|
19
21
|
}
|
|
20
|
-
const progress = readProgress(new Workspace(root, false), readConfig(root).config);
|
|
22
|
+
const progress = readProgress(new Workspace(root, false), readConfig(root).config, rowsOnBranches(workers));
|
|
21
23
|
io.out(args.json ? JSON.stringify(progress, null, 2) : formatProgress(progress));
|
|
22
24
|
return 0;
|
|
23
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACjD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACrF,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IAE9B,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAElC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QAE9E,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5G,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjF,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
|
package/dist/help/notes.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** What a line of the usage cannot say about a command or a flag. */
|
|
2
|
-
export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0\n error-factories moves a project from one class per error to static factories on one error class per\n concept: --plan writes error-factories.plan.json, where each class is given its concept;\n --apply follows it (classes, specs, every usage, \"stack.refusals\" in the config)\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise; init adds what is missing; --strict exits 1 while something is missing\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, and the TODO(domain), TODO(platform), it.todo and TODO(review)
|
|
2
|
+
export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0; then formats the snapshot and the\n journal it wrote with the Biome or Prettier of the format script, and warns when the\n SQL changes a primary key in an order that fails on PostgreSQL (exit code unchanged);\n --replay, after merging the trunk into a branch when both added migrations: deletes\n the migrations of the branch that --base <ref> (origin/main by default) does not have,\n with their snapshots and journal entries, then generates each again on top, in order,\n under its name (working- dropped outside a worker's worktree, a custom one keeping\n its SQL); refused while the journal holds conflict markers or when two of them change\n the schema\n error-factories moves a project from one class per error to static factories on one error class per\n concept: --plan writes error-factories.plan.json, where each class is given its concept;\n --apply follows it (classes, specs, every usage, \"stack.refusals\" in the config)\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise; init adds what is missing; --strict exits 1 while something is missing\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, each row not done ready on the trunk (its dependencies done), ready\n on a branch (the others briefed to a worker with commits ahead of its base) or waiting\n (with the ids it waits for), and the TODO(domain), TODO(platform), it.todo and TODO(review)\n left in each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,\n context, rows, base, commits ahead, files changed since the base, its report), then the\n contexts and the files more than one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n plan-waves the rows of slices.md not done, of the project or of one context, in waves (wave 1: every\n dependency done; wave n: the others in earlier waves), each wave cut into batches of one\n owner, one or two rows on one aggregate, with the worker-scope command that briefs each,\n the batches of a wave likely to touch the same files (same aggregate in Start with, or\n unknown when it names none), and the merge order; a cycle, a dependency on an unknown id\n or a row without owner is reported alone, and exits 1\n worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from\n --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules; an existing worktree or branch\n that does not contain the base is refused\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an\n end-to-end spec, a working migration, the derived files git tracks) and every other\n changed path, left out and never to stage with it; exits 1 while a step fails\n --commit-size the files and lines about to be committed against \"commit\" in the config (20 files and\n 600 lines by default, generated files not counted); --staged reads the index only;\n advisory, --strict exits 1 when over\n --stored-events docs records the shape of each version of the stored events in stored-events.lock.json,\n never rewriting a recorded one: run it once the shape of a version is the one to store;\n docs --check fails while a declared version is not recorded\n --sdk init records \"sdk\" in the config and generates the clients with the project\n --local-only generate refuses, and writes nothing, when the kind would write outside its context;\n \"generate --help --json\" says which kinds do";
|
|
3
3
|
//# sourceMappingURL=notes.d.ts.map
|
package/dist/help/notes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,kqNAkE8C,CAAC"}
|
package/dist/help/notes.js
CHANGED
|
@@ -6,7 +6,15 @@ export const NOTES = ` affected what a pull request has to run: the con
|
|
|
6
6
|
into relative paths, so that plain node runs the output (tsconfig.build.json by default)
|
|
7
7
|
drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal
|
|
8
8
|
fails and names the fix when drizzle-kit would ask whether a column or table is renamed,
|
|
9
|
-
where drizzle-kit alone writes nothing and exits 0
|
|
9
|
+
where drizzle-kit alone writes nothing and exits 0; then formats the snapshot and the
|
|
10
|
+
journal it wrote with the Biome or Prettier of the format script, and warns when the
|
|
11
|
+
SQL changes a primary key in an order that fails on PostgreSQL (exit code unchanged);
|
|
12
|
+
--replay, after merging the trunk into a branch when both added migrations: deletes
|
|
13
|
+
the migrations of the branch that --base <ref> (origin/main by default) does not have,
|
|
14
|
+
with their snapshots and journal entries, then generates each again on top, in order,
|
|
15
|
+
under its name (working- dropped outside a worker's worktree, a custom one keeping
|
|
16
|
+
its SQL); refused while the journal holds conflict markers or when two of them change
|
|
17
|
+
the schema
|
|
10
18
|
error-factories moves a project from one class per error to static factories on one error class per
|
|
11
19
|
concept: --plan writes error-factories.plan.json, where each class is given its concept;
|
|
12
20
|
--apply follows it (classes, specs, every usage, "stack.refusals" in the config)
|
|
@@ -21,8 +29,10 @@ export const NOTES = ` affected what a pull request has to run: the con
|
|
|
21
29
|
otherwise; init adds what is missing; --strict exits 1 while something is missing
|
|
22
30
|
describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies
|
|
23
31
|
status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by
|
|
24
|
-
status and by owner,
|
|
25
|
-
|
|
32
|
+
status and by owner, each row not done ready on the trunk (its dependencies done), ready
|
|
33
|
+
on a branch (the others briefed to a worker with commits ahead of its base) or waiting
|
|
34
|
+
(with the ids it waits for), and the TODO(domain), TODO(platform), it.todo and TODO(review)
|
|
35
|
+
left in each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,
|
|
26
36
|
context, rows, base, commits ahead, files changed since the base, its report), then the
|
|
27
37
|
contexts and the files more than one worker holds
|
|
28
38
|
sdk the typed client of each document of the contract, a workspace package under
|
|
@@ -31,6 +41,12 @@ export const NOTES = ` affected what a pull request has to run: the con
|
|
|
31
41
|
scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);
|
|
32
42
|
--check writes nothing and exits 1 while a client differs from its contract
|
|
33
43
|
todo those markers as file:line, in the project or in one context
|
|
44
|
+
plan-waves the rows of slices.md not done, of the project or of one context, in waves (wave 1: every
|
|
45
|
+
dependency done; wave n: the others in earlier waves), each wave cut into batches of one
|
|
46
|
+
owner, one or two rows on one aggregate, with the worker-scope command that briefs each,
|
|
47
|
+
the batches of a wave likely to touch the same files (same aggregate in Start with, or
|
|
48
|
+
unknown when it names none), and the merge order; a cycle, a dependency on an unknown id
|
|
49
|
+
or a row without owner is reported alone, and exits 1
|
|
34
50
|
worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from
|
|
35
51
|
--base <ref> (by default the current branch, refused from a worker's worktree), its
|
|
36
52
|
.ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>
|
package/dist/help/notes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAkE2C,CAAC"}
|
package/dist/help/usage.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Every command of the CLI and its flags, as `--help` prints them and docs/guides/commands.md shows them. */
|
|
2
|
-
export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--values classes|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status [--workers]\n ddd-ts-kit doctor [--strict]\n ddd-ts-kit todo [<context>]\n ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit verify-slice <context> --since <git-ref>\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
|
|
2
|
+
export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--values classes|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status [--workers]\n ddd-ts-kit doctor [--strict]\n ddd-ts-kit todo [<context>]\n ddd-ts-kit plan-waves [<context>]\n ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit verify-slice <context> --since <git-ref>\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]\n ddd-ts-kit drizzle-generate --replay [--base <git-ref>]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
|
|
3
3
|
//# sourceMappingURL=usage.d.ts.map
|
package/dist/help/usage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,+
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,+iGA8CqE,CAAC"}
|
package/dist/help/usage.js
CHANGED
|
@@ -25,6 +25,7 @@ export const USAGE = `Usage
|
|
|
25
25
|
ddd-ts-kit status [--workers]
|
|
26
26
|
ddd-ts-kit doctor [--strict]
|
|
27
27
|
ddd-ts-kit todo [<context>]
|
|
28
|
+
ddd-ts-kit plan-waves [<context>]
|
|
28
29
|
ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]
|
|
29
30
|
ddd-ts-kit verify-slice <context> --since <git-ref>
|
|
30
31
|
ddd-ts-kit docs [--check] [--stored-events]
|
|
@@ -32,6 +33,7 @@ export const USAGE = `Usage
|
|
|
32
33
|
ddd-ts-kit depcruise-config [--check|--write]
|
|
33
34
|
ddd-ts-kit build-aliases [--project <tsconfig>]
|
|
34
35
|
ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]
|
|
36
|
+
ddd-ts-kit drizzle-generate --replay [--base <git-ref>]
|
|
35
37
|
ddd-ts-kit error-factories --plan | --apply [--dry-run]
|
|
36
38
|
ddd-ts-kit controllers [<context>] [--dry-run]
|
|
37
39
|
ddd-ts-kit value-objects [--dry-run]
|
package/dist/help/usage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFA8CkE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-files.d.ts","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"persistence-files.d.ts","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA8D/C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAY3D"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { WITH_DATABASE } from '../../stack/with-database.js';
|
|
1
2
|
import { platformFile } from './platform-file.js';
|
|
3
|
+
import { when } from './when.js';
|
|
2
4
|
const INERT = 'inert-persistence.ts';
|
|
3
5
|
const IN_MEMORY = [
|
|
4
6
|
['persistence.ts', 'memory'],
|
|
@@ -50,11 +52,15 @@ const TOOLING = {
|
|
|
50
52
|
],
|
|
51
53
|
};
|
|
52
54
|
export function persistenceFiles(config) {
|
|
53
|
-
const { orm } = config.stack;
|
|
55
|
+
const { orm, tests } = config.stack;
|
|
54
56
|
const files = (PERSISTENCE[orm] ?? []).filter(([file]) => file !== INERT || composesWithoutConnecting(config));
|
|
55
57
|
return [
|
|
56
58
|
...files.map(([file, variant]) => platformFile(config, `database/${file}`, variant)),
|
|
57
59
|
...(TOOLING[orm] ?? []),
|
|
60
|
+
// The global setup of Vitest that saves the test database once per run, for each spec to open a copy of it.
|
|
61
|
+
...when(tests === 'vitest' && WITH_DATABASE.includes(orm), [
|
|
62
|
+
['test/support/test-database-template.ts', 'init/platform/database/test-database-template.ts.tpl'],
|
|
63
|
+
]),
|
|
58
64
|
];
|
|
59
65
|
}
|
|
60
66
|
/** The script that lists the routes and the hand-wired architecture test compose the application without a database to reach. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-files.js","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"persistence-files.js","sourceRoot":"","sources":["../../../src/init/files/persistence-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,MAAM,KAAK,GAAG,sBAAsB,CAAC;AAErC,MAAM,SAAS,GAAa;IAC1B,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,qBAAqB,EAAE,QAAQ,CAAC;IACjC,CAAC,KAAK,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,2GAA2G;AAC3G,MAAM,WAAW,GAAuC;IACtD,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,CAAC,GAAG,SAAS,EAAE,C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