ddd-ts-kit 0.23.1 → 0.25.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 +64 -0
- package/README.fr.md +47 -9
- package/README.md +43 -8
- package/dist/check/canonical/open-directories.d.ts.map +1 -1
- package/dist/check/canonical/open-directories.js +7 -1
- package/dist/check/canonical/open-directories.js.map +1 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +1 -0
- package/dist/check/canonical/roles.js.map +1 -1
- 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 +4 -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 +2 -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 +11 -0
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/test-fixtures.js +25 -0
- package/dist/check/fixtures/test-fixtures.js.map +1 -1
- package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tree-fixtures.js +24 -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/test-helper-placed.d.ts +3 -0
- package/dist/check/rules/test-helper-placed.d.ts.map +1 -0
- package/dist/check/rules/test-helper-placed.js +41 -0
- package/dist/check/rules/test-helper-placed.js.map +1 -0
- 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/format-context.d.ts.map +1 -1
- package/dist/commands/format-context.js +5 -1
- package/dist/commands/format-context.js.map +1 -1
- package/dist/commands/generate.js +9 -2
- package/dist/commands/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/depcruise/hygiene-rules.js +2 -1
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/docs/context-facts.d.ts +2 -0
- package/dist/docs/context-facts.d.ts.map +1 -1
- package/dist/docs/read-context.js +1 -0
- package/dist/docs/read-context.js.map +1 -1
- package/dist/generate/context-imports.d.ts +4 -0
- package/dist/generate/context-imports.d.ts.map +1 -0
- package/dist/generate/context-imports.js +15 -0
- package/dist/generate/context-imports.js.map +1 -0
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/test-world-kind.d.ts +3 -0
- package/dist/generate/kinds/test-world-kind.d.ts.map +1 -0
- package/dist/generate/kinds/test-world-kind.js +33 -0
- package/dist/generate/kinds/test-world-kind.js.map +1 -0
- package/dist/generate/kinds/world/context-fakes.d.ts +27 -0
- package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -0
- package/dist/generate/kinds/world/context-fakes.js +61 -0
- package/dist/generate/kinds/world/context-fakes.js.map +1 -0
- package/dist/generate/kinds/world/declared-ports.d.ts +12 -0
- package/dist/generate/kinds/world/declared-ports.d.ts.map +1 -0
- package/dist/generate/kinds/world/declared-ports.js +20 -0
- package/dist/generate/kinds/world/declared-ports.js.map +1 -0
- package/dist/generate/kinds/world/fake-class.d.ts +8 -0
- package/dist/generate/kinds/world/fake-class.d.ts.map +1 -0
- package/dist/generate/kinds/world/fake-class.js +30 -0
- package/dist/generate/kinds/world/fake-class.js.map +1 -0
- package/dist/generate/kinds/world/ports-in-use.d.ts +10 -0
- package/dist/generate/kinds/world/ports-in-use.d.ts.map +1 -0
- package/dist/generate/kinds/world/ports-in-use.js +18 -0
- package/dist/generate/kinds/world/ports-in-use.js.map +1 -0
- package/dist/generate/kinds/world/world-vars.d.ts +10 -0
- package/dist/generate/kinds/world/world-vars.d.ts.map +1 -0
- package/dist/generate/kinds/world/world-vars.js +55 -0
- package/dist/generate/kinds/world/world-vars.js.map +1 -0
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/spec-vars.d.ts.map +1 -1
- package/dist/generate/spec-vars.js +1 -12
- package/dist/generate/spec-vars.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/AGENTS.md.tpl +1 -1
- 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 +3 -2
- package/templates/pipeline/knip.json.tpl +2 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/vitest.config.ts.tpl +6 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/account-deactivated.integration-handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/change-member-role.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/decline-invitation.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/grant-delegation.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/member-joined.integration-handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/member-removed.integration-handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/open-organisation.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/organisation-opened.integration-handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/provision-account.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/remove-member.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/revoke-delegation.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/search-members.handler.spec.ts.tpl +1 -1
- package/templates/test-world/world.buses.ts.tpl +33 -0
- package/templates/test-world/world.tsyringe.ts.tpl +53 -0
- /package/templates/presets/identity/context/test/{unit/identity-application.ts.tpl → worlds/__context__.world.ts.tpl} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/world/world-vars.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,aAAa,CA4BhG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { specifierOf } from '../../../alias/index.js';
|
|
2
|
+
import { LINE_WIDTH } from '../../../layout/line-width.js';
|
|
3
|
+
import { assembledContext } from '../../assembled-context.js';
|
|
4
|
+
import { contextImports } from '../../context-imports.js';
|
|
5
|
+
import { isDeclared } from '../../is-declared.js';
|
|
6
|
+
/**
|
|
7
|
+
* What a world template reads: its name, the imports of the fakes and of the ports they stand
|
|
8
|
+
* for, the object that builds them, and the module of the context as the style assembles it.
|
|
9
|
+
*/
|
|
10
|
+
export function worldVars(scope, name, fakes) {
|
|
11
|
+
const imported = (exported, file) => `import { ${exported} } from '${specifierOf(scope.config, file)}';`;
|
|
12
|
+
return {
|
|
13
|
+
...name,
|
|
14
|
+
hasFakes: fakes.length > 0,
|
|
15
|
+
given: fakes.length > 0 ? 'given, ' : '',
|
|
16
|
+
diImport: diImport(scope, fakes.length > 0),
|
|
17
|
+
contextImport: contextImports(scope),
|
|
18
|
+
assembles: isDeclared(scope.config),
|
|
19
|
+
context: assembledContext(scope, '../../'),
|
|
20
|
+
contextModule: isDeclared(scope.config) ? 'context' : assembledContext(scope, '../../'),
|
|
21
|
+
portImports: fakes.map((fake) => imported(fake.port.name, fake.port.file)).join('\n'),
|
|
22
|
+
fakeImports: fakes.map((fake) => imported(fake.name, fake.file)).join('\n'),
|
|
23
|
+
members: fakes.map((fake) => ` readonly ${fake.key}: ${fake.name};`).join('\n'),
|
|
24
|
+
built: laidOut(' const fakes = { ', fakes.map((fake) => `${fake.key}: new ${fake.name}()`), ' };'),
|
|
25
|
+
overrides: laidOut(' fakes: [', fakes.map((fake) => `fake(${fake.port.name}, fakes.${fake.key})`), '],'),
|
|
26
|
+
returnedBuses: laidOut(' return { ', ['...buses', ...returnedFakes(fakes)], ' };'),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Every fake, a repository as the application hands it to a handler: its save announces the events of the aggregate. */
|
|
30
|
+
function returnedFakes(fakes) {
|
|
31
|
+
const dispatched = fakes
|
|
32
|
+
.filter((fake) => fake.port.repository)
|
|
33
|
+
.map((fake) => `${fake.key}: buses.dispatching(fakes.${fake.key})`);
|
|
34
|
+
return fakes.length === 0 ? [] : ['...fakes', ...dispatched];
|
|
35
|
+
}
|
|
36
|
+
function diImport(scope, withFakes) {
|
|
37
|
+
const listed = isDeclared(scope.config) && scope.config.stack.assembly !== 'discovery';
|
|
38
|
+
const names = [
|
|
39
|
+
...(listed ? ['contextModule'] : []),
|
|
40
|
+
'createTestApplication',
|
|
41
|
+
...(withFakes ? ['fake'] : []),
|
|
42
|
+
'type ContextModule',
|
|
43
|
+
];
|
|
44
|
+
return `import { ${names.join(', ')} } from '@ddd-ts-kit/di';`;
|
|
45
|
+
}
|
|
46
|
+
/** A list on one line when it fits, one entry per line otherwise, as the formatter lays it out. */
|
|
47
|
+
function laidOut(head, entries, tail) {
|
|
48
|
+
const line = `${head}${entries.join(', ')}${tail}`;
|
|
49
|
+
if (line.length <= LINE_WIDTH) {
|
|
50
|
+
return line;
|
|
51
|
+
}
|
|
52
|
+
const indent = /^\s*/.exec(head)?.[0] ?? '';
|
|
53
|
+
return [head.trimEnd(), ...entries.map((entry) => `${indent} ${entry},`), `${indent}${tail.trimStart()}`].join('\n');
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=world-vars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-vars.js","sourceRoot":"","sources":["../../../../src/generate/kinds/world/world-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAAY,EAAE,IAAU,EAAE,KAA6B;IAC/E,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAU,EAAE,CAC1D,YAAY,QAAQ,YAAY,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;IAEtE,OAAO;QACL,GAAG,IAAI;QACP,QAAQ,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,SAAS,OAAO,CAAC,IAAY,EAAE,OAA0B,EAAE,IAAY;IACrE,MAAM,IAAI,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;IAEnD,IAAI,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE5C,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,MAAM,KAAK,KAAK,GAAG,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../src/generate/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../src/generate/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAwCtC,qEAAqE;AACrE,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAwChC,CAAC"}
|
package/dist/generate/kinds.js
CHANGED
|
@@ -32,6 +32,7 @@ import { controllerKind, routeKind } from './kinds/route-kind.js';
|
|
|
32
32
|
import { schemaKind } from './kinds/schema-kind.js';
|
|
33
33
|
import { serviceKind } from './kinds/service-kind.js';
|
|
34
34
|
import { stateMachineKind } from './kinds/state-machine-kind.js';
|
|
35
|
+
import { testWorldKind } from './kinds/test-world-kind.js';
|
|
35
36
|
import { valueObjectKind } from './kinds/value-object-kind.js';
|
|
36
37
|
import { vocabularyKind } from './kinds/vocabulary-kind.js';
|
|
37
38
|
import { workerKind } from './kinds/worker-kind.js';
|
|
@@ -40,6 +41,7 @@ export const KINDS = [
|
|
|
40
41
|
contextKind,
|
|
41
42
|
aggregateKind,
|
|
42
43
|
builderKind,
|
|
44
|
+
testWorldKind,
|
|
43
45
|
entityKind,
|
|
44
46
|
valueObjectKind,
|
|
45
47
|
vocabularyKind,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../src/generate/kinds.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO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AAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,UAAU;IACV,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,eAAe;IACf,SAAS;IACT,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,SAAS;IACT,QAAQ;IACR,SAAS;IACT,cAAc;IACd,cAAc;IACd,cAAc;IACd,SAAS;IACT,kBAAkB;IAClB,QAAQ;IACR,UAAU;IACV,oBAAoB;IACpB,sBAAsB;IACtB,gBAAgB;IAChB,cAAc;IACd,OAAO;IACP,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,OAAO;IACP,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;CACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-vars.d.ts","sourceRoot":"","sources":["../../src/generate/spec-vars.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spec-vars.d.ts","sourceRoot":"","sources":["../../src/generate/spec-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa,CAsB3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { specifierOf } from '../alias/index.js';
|
|
2
1
|
import { assembledContext } from './assembled-context.js';
|
|
2
|
+
import { contextImports } from './context-imports.js';
|
|
3
3
|
import { isDeclared } from './is-declared.js';
|
|
4
4
|
/**
|
|
5
5
|
* What a spec builds its test application from: the module file of the context, or its
|
|
@@ -27,15 +27,4 @@ export function specVars(scope, access) {
|
|
|
27
27
|
await: discovered ? 'await ' : '',
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function contextImports(scope) {
|
|
31
|
-
const { config, context } = scope;
|
|
32
|
-
const inContext = (file) => specifierOf(config, `${config.contextsDir}/${context.kebab}/${file}`);
|
|
33
|
-
if (!isDeclared(config)) {
|
|
34
|
-
return `import { ${context.camel}Module } from '${inContext(`${context.kebab}.module.ts`)}';`;
|
|
35
|
-
}
|
|
36
|
-
if (config.stack.assembly === 'discovery') {
|
|
37
|
-
return "import { discoverContext } from '@ddd-ts-kit/di/discovery';";
|
|
38
|
-
}
|
|
39
|
-
return `import * as ${context.camel}Declarations from '${inContext(`${context.kebab}.declarations.ts`)}';`;
|
|
40
|
-
}
|
|
41
30
|
//# sourceMappingURL=spec-vars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-vars.js","sourceRoot":"","sources":["../../src/generate/spec-vars.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spec-vars.js","sourceRoot":"","sources":["../../src/generate/spec-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAY,EAAE,MAAqB;IAC1D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACjD,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,WAAW,CAAC;IAC3F,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;IACvD,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEhG,MAAM,MAAM,GAAG,CAAC,KAAwB,EAAU,EAAE,CAClD,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC;IAErG,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;QACrD,OAAO,EAAE,MAAM,CAAC,CAAC,uBAAuB,CAAC,CAAC;QAC1C,cAAc,EAAE,cAAc,CAAC,KAAK,CAAC;QACrC,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC1C,OAAO,EAAE,CAAC,GAAG,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1E,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE;QACzC,oEAAoE;QACpE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;QACjC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;KAClC,CAAC;AACJ,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,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together with the kit. */
|
|
2
2
|
export const VERSIONS = {
|
|
3
|
-
'@ddd-ts-kit/kernel': '^0.
|
|
4
|
-
'@ddd-ts-kit/validation': '^0.
|
|
5
|
-
'@ddd-ts-kit/http': '^0.
|
|
6
|
-
'@ddd-ts-kit/tracing': '^0.
|
|
7
|
-
'@ddd-ts-kit/di': '^0.
|
|
8
|
-
'@ddd-ts-kit/events': '^0.
|
|
9
|
-
'@ddd-ts-kit/testing': '^0.
|
|
10
|
-
'@ddd-ts-kit/drizzle': '^0.
|
|
11
|
-
'@ddd-ts-kit/knex': '^0.
|
|
12
|
-
'@ddd-ts-kit/prisma': '^0.
|
|
13
|
-
'@ddd-ts-kit/typeorm': '^0.
|
|
14
|
-
'@ddd-ts-kit/auth': '^0.
|
|
15
|
-
'@ddd-ts-kit/rabbitmq': '^0.
|
|
16
|
-
'@ddd-ts-kit/aspects': '^0.
|
|
17
|
-
'@ddd-ts-kit/audit': '^0.
|
|
18
|
-
'@ddd-ts-kit/redis': '^0.
|
|
19
|
-
'@ddd-ts-kit/kafka': '^0.
|
|
20
|
-
'@ddd-ts-kit/nats': '^0.
|
|
21
|
-
'@ddd-ts-kit/scheduling': '^0.
|
|
22
|
-
'@ddd-ts-kit/sentry': '^0.
|
|
23
|
-
'@ddd-ts-kit/s3': '^0.
|
|
3
|
+
'@ddd-ts-kit/kernel': '^0.25.0',
|
|
4
|
+
'@ddd-ts-kit/validation': '^0.25.0',
|
|
5
|
+
'@ddd-ts-kit/http': '^0.25.0',
|
|
6
|
+
'@ddd-ts-kit/tracing': '^0.25.0',
|
|
7
|
+
'@ddd-ts-kit/di': '^0.25.0',
|
|
8
|
+
'@ddd-ts-kit/events': '^0.25.0',
|
|
9
|
+
'@ddd-ts-kit/testing': '^0.25.0',
|
|
10
|
+
'@ddd-ts-kit/drizzle': '^0.25.0',
|
|
11
|
+
'@ddd-ts-kit/knex': '^0.25.0',
|
|
12
|
+
'@ddd-ts-kit/prisma': '^0.25.0',
|
|
13
|
+
'@ddd-ts-kit/typeorm': '^0.25.0',
|
|
14
|
+
'@ddd-ts-kit/auth': '^0.25.0',
|
|
15
|
+
'@ddd-ts-kit/rabbitmq': '^0.25.0',
|
|
16
|
+
'@ddd-ts-kit/aspects': '^0.25.0',
|
|
17
|
+
'@ddd-ts-kit/audit': '^0.25.0',
|
|
18
|
+
'@ddd-ts-kit/redis': '^0.25.0',
|
|
19
|
+
'@ddd-ts-kit/kafka': '^0.25.0',
|
|
20
|
+
'@ddd-ts-kit/nats': '^0.25.0',
|
|
21
|
+
'@ddd-ts-kit/scheduling': '^0.25.0',
|
|
22
|
+
'@ddd-ts-kit/sentry': '^0.25.0',
|
|
23
|
+
'@ddd-ts-kit/s3': '^0.25.0',
|
|
24
24
|
'@aws-sdk/client-s3': '^3.1150.0',
|
|
25
25
|
'@aws-sdk/lib-storage': '^3.1150.0',
|
|
26
26
|
'@aws-sdk/s3-request-presigner': '^3.1150.0',
|
|
27
27
|
busboy: '^1.6.0',
|
|
28
28
|
'@sentry/node': '^11.6.0',
|
|
29
|
-
'@ddd-ts-kit/pino': '^0.
|
|
29
|
+
'@ddd-ts-kit/pino': '^0.25.0',
|
|
30
30
|
pino: '^10.4.0',
|
|
31
31
|
'pino-pretty': '^13.2.0',
|
|
32
|
-
'@ddd-ts-kit/winston': '^0.
|
|
32
|
+
'@ddd-ts-kit/winston': '^0.25.0',
|
|
33
33
|
winston: '^3.19.0',
|
|
34
34
|
'@confluentinc/kafka-javascript': '^1.11.0',
|
|
35
35
|
'@nats-io/jetstream': '^3.4.0',
|
|
@@ -37,7 +37,7 @@ export const VERSIONS = {
|
|
|
37
37
|
ioredis: '^6.0.0',
|
|
38
38
|
jose: '^6.0.0',
|
|
39
39
|
amqplib: '^2.2.0',
|
|
40
|
-
'ddd-ts-kit': '^0.
|
|
40
|
+
'ddd-ts-kit': '^0.25.0',
|
|
41
41
|
tsx: '^4.23.15',
|
|
42
42
|
vitest: '^5.0.3',
|
|
43
43
|
zod: '^4.6.5',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A migration of the branch that its base does not have, as the branch wrote it. */
|
|
2
|
+
export interface BranchMigration {
|
|
3
|
+
/** Its file name without `.sql`: `20261015101500_working-add-invoices`. */
|
|
4
|
+
readonly tag: string;
|
|
5
|
+
readonly sql: string;
|
|
6
|
+
/** Its snapshot repeats the one before it: the schema did not change, the statements were written by hand (`--custom`). */
|
|
7
|
+
readonly custom: boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=branch-migration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-migration.d.ts","sourceRoot":"","sources":["../../src/migration/branch-migration.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2HAA2H;IAC3H,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-migration.js","sourceRoot":"","sources":["../../src/migration/branch-migration.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BranchMigration } from './branch-migration.js';
|
|
2
|
+
interface BranchFiles {
|
|
3
|
+
/** The files of the migrations folder and of its `meta/`, by path. */
|
|
4
|
+
readonly files: ReadonlyMap<string, string>;
|
|
5
|
+
readonly folder: string;
|
|
6
|
+
/** The tags of the branch's migrations, in their order. */
|
|
7
|
+
readonly tags: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The migrations of the branch with their SQL, each known as written by hand when its snapshot
|
|
11
|
+
* repeats, ids aside, the snapshot it names as `prevId`: drizzle-kit copies the last snapshot for a
|
|
12
|
+
* `--custom` migration, and writes the changed schema for any other.
|
|
13
|
+
*/
|
|
14
|
+
export declare function branchMigrations({ files, folder, tags }: BranchFiles): BranchMigration[];
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=branch-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-migrations.d.ts","sourceRoot":"","sources":["../../src/migration/branch-migrations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,UAAU,WAAW;IACnB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,eAAe,EAAE,CAsBxF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isRecord } from '../check/support/is-record.js';
|
|
2
|
+
/**
|
|
3
|
+
* The migrations of the branch with their SQL, each known as written by hand when its snapshot
|
|
4
|
+
* repeats, ids aside, the snapshot it names as `prevId`: drizzle-kit copies the last snapshot for a
|
|
5
|
+
* `--custom` migration, and writes the changed schema for any other.
|
|
6
|
+
*/
|
|
7
|
+
export function branchMigrations({ files, folder, tags }) {
|
|
8
|
+
const snapshots = new Map();
|
|
9
|
+
for (const [file, content] of files) {
|
|
10
|
+
const snapshot = file.startsWith(`${folder}/meta/`) && file.endsWith('_snapshot.json') ? parsed(content) : undefined;
|
|
11
|
+
if (isRecord(snapshot) && typeof snapshot['id'] === 'string') {
|
|
12
|
+
snapshots.set(snapshot['id'], withoutIds(snapshot));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return tags.map((tag) => {
|
|
16
|
+
const own = parsed(files.get(`${folder}/meta/${tag.split('_')[0] ?? ''}_snapshot.json`));
|
|
17
|
+
const parent = isRecord(own) && typeof own['prevId'] === 'string' ? snapshots.get(own['prevId']) : undefined;
|
|
18
|
+
return {
|
|
19
|
+
tag,
|
|
20
|
+
sql: files.get(`${folder}/${tag}.sql`) ?? '',
|
|
21
|
+
custom: isRecord(own) && parent !== undefined && withoutIds(own) === parent,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** The snapshot without its own id and its parent's, keys sorted: what two snapshots of one schema share. */
|
|
26
|
+
function withoutIds(snapshot) {
|
|
27
|
+
const schema = Object.entries(snapshot).filter(([key]) => key !== 'id' && key !== 'prevId');
|
|
28
|
+
return JSON.stringify(sorted(Object.fromEntries(schema)));
|
|
29
|
+
}
|
|
30
|
+
function sorted(value) {
|
|
31
|
+
if (Array.isArray(value)) {
|
|
32
|
+
return value.map(sorted);
|
|
33
|
+
}
|
|
34
|
+
return isRecord(value)
|
|
35
|
+
? Object.fromEntries(Object.keys(value)
|
|
36
|
+
.sort()
|
|
37
|
+
.map((key) => [key, sorted(value[key])]))
|
|
38
|
+
: value;
|
|
39
|
+
}
|
|
40
|
+
function parsed(text) {
|
|
41
|
+
try {
|
|
42
|
+
return text === undefined ? undefined : JSON.parse(text);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=branch-migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-migrations.js","sourceRoot":"","sources":["../../src/migration/branch-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAWzD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAe;IACnE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5C,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,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C,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,CAAC,CAAC;IAE5F,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,CAAC;QACpB,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aACf,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC3C;QACH,CAAC,CAAC,KAAK,CAAC;AACZ,CAAC;AAED,SAAS,MAAM,CAAC,IAAwB;IACtC,IAAI,CAAC;QACH,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReplayPlan } from './replay-plan.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deletes the migrations of the branch, their snapshots and their journal entries: the journal
|
|
4
|
+
* becomes the one of the base, so that its last snapshot is the parent of what drizzle-kit
|
|
5
|
+
* generates next. A file the base has under the same path (a snapshot numbered as one of the
|
|
6
|
+
* base's, under `prefix: 'index'`) takes the content of the base instead of being deleted.
|
|
7
|
+
*/
|
|
8
|
+
export declare function deleteBranchMigrations({ root, base, folder, migrations }: ReplayPlan): void;
|
|
9
|
+
//# sourceMappingURL=delete-branch-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-branch-migrations.d.ts","sourceRoot":"","sources":["../../src/migration/delete-branch-migrations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,UAAU,GAAG,IAAI,CAa3F"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { runGit } from '../commit/run-git.js';
|
|
4
|
+
/**
|
|
5
|
+
* Deletes the migrations of the branch, their snapshots and their journal entries: the journal
|
|
6
|
+
* becomes the one of the base, so that its last snapshot is the parent of what drizzle-kit
|
|
7
|
+
* generates next. A file the base has under the same path (a snapshot numbered as one of the
|
|
8
|
+
* base's, under `prefix: 'index'`) takes the content of the base instead of being deleted.
|
|
9
|
+
*/
|
|
10
|
+
export function deleteBranchMigrations({ root, base, folder, migrations }) {
|
|
11
|
+
const snapshots = migrations.map((migration) => `${folder}/meta/${migration.tag.split('_')[0] ?? ''}_snapshot.json`);
|
|
12
|
+
const sqlFiles = migrations.map((migration) => `${folder}/${migration.tag}.sql`);
|
|
13
|
+
for (const file of [...sqlFiles, ...snapshots, `${folder}/meta/_journal.json`]) {
|
|
14
|
+
const onBase = runGit(root, ['show', `${base}:./${file}`]);
|
|
15
|
+
if (onBase === undefined) {
|
|
16
|
+
fs.rmSync(path.join(root, file), { force: true });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
fs.writeFileSync(path.join(root, file), onBase);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=delete-branch-migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-branch-migrations.js","sourceRoot":"","sources":["../../src/migration/delete-branch-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAc;IACnF,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,MAAM,SAAS,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACrH,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;IAEjF,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,qBAAqB,CAAC,EAAE,CAAC;QAC/E,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;QAE3D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WrittenMigration } from './written-migration.js';
|
|
2
|
+
/** One run of drizzle-kit generate: its exit code and what it wrote under the migrations folder. */
|
|
3
|
+
export interface DrizzleRun {
|
|
4
|
+
readonly code: number;
|
|
5
|
+
readonly written: WrittenMigration;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=drizzle-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-run.d.ts","sourceRoot":"","sources":["../../src/migration/drizzle-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,oGAAoG;AACpG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-run.js","sourceRoot":"","sources":["../../src/migration/drizzle-run.ts"],"names":[],"mappings":""}
|
|
@@ -8,7 +8,7 @@ export const DRIZZLE_SILENT_FAILURES = [
|
|
|
8
8
|
{
|
|
9
9
|
printed: 'which is a collision',
|
|
10
10
|
message: 'Two snapshots of the migrations were generated from the same one, as two branches merged without regenerating: no migration was written.',
|
|
11
|
-
fix: 'Keep the migrations of the main branch, delete the one of your branch (its .sql file, its snapshot under meta/ and its entry of meta/_journal.json), then run `npm run db:generate <name>` again on top of them; `npm run check:arch` names them (persistence/migration-history).',
|
|
11
|
+
fix: 'Keep the migrations of the main branch, delete the one of your branch (its .sql file, its snapshot under meta/ and its entry of meta/_journal.json), then run `npm run db:generate <name>` again on top of them, or let `npx ddd-ts-kit drizzle-generate --replay` do both; `npm run check:arch` names them (persistence/migration-history).',
|
|
12
12
|
},
|
|
13
13
|
];
|
|
14
14
|
//# sourceMappingURL=drizzle-silent-failures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle-silent-failures.js","sourceRoot":"","sources":["../../src/migration/drizzle-silent-failures.ts"],"names":[],"mappings":"AAOA,uCAAuC;AACvC,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE;QACE,OAAO,EAAE,mCAAmC;QAC5C,OAAO,EACL,8IAA8I;QAChJ,GAAG,EAAE,iXAAiX;KACvX;IACD;QACE,OAAO,EAAE,sBAAsB;QAC/B,OAAO,EACL,0IAA0I;QAC5I,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"drizzle-silent-failures.js","sourceRoot":"","sources":["../../src/migration/drizzle-silent-failures.ts"],"names":[],"mappings":"AAOA,uCAAuC;AACvC,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE;QACE,OAAO,EAAE,mCAAmC;QAC5C,OAAO,EACL,8IAA8I;QAChJ,GAAG,EAAE,iXAAiX;KACvX;IACD;QACE,OAAO,EAAE,sBAAsB;QAC/B,OAAO,EACL,0IAA0I;QAC5I,GAAG,EAAE,8UAA8U;KACpV;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProjectFormatter } from './project-formatter.js';
|
|
2
|
+
/**
|
|
3
|
+
* The formatter the `format` script of the project's package.json runs, Biome or Prettier, found
|
|
4
|
+
* in its node_modules; otherwise why nothing will be formatted. The script itself is not run: it
|
|
5
|
+
* formats the whole project (`biome format --write .`), where only what drizzle-kit wrote is meant.
|
|
6
|
+
*/
|
|
7
|
+
export declare function findProjectFormatter(root: string): ProjectFormatter | string;
|
|
8
|
+
//# sourceMappingURL=find-project-formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-project-formatter.d.ts","sourceRoot":"","sources":["../../src/migration/find-project-formatter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAsB/D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,MAAM,CAa5E"}
|