ddd-ts-kit 0.104.0 → 0.106.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 +122 -6
- package/README.fr.md +33 -25
- package/README.md +30 -23
- package/dist/check/baseline/renamed-files.d.ts.map +1 -1
- package/dist/check/baseline/renamed-files.js +2 -1
- package/dist/check/baseline/renamed-files.js.map +1 -1
- package/dist/check/canonical/earlier-context-file.d.ts +1 -6
- package/dist/check/canonical/earlier-context-file.d.ts.map +1 -1
- package/dist/check/canonical/earlier-context-file.js +4 -10
- package/dist/check/canonical/earlier-context-file.js.map +1 -1
- package/dist/check/commands/changed-files.d.ts.map +1 -1
- package/dist/check/commands/changed-files.js +2 -1
- package/dist/check/commands/changed-files.js.map +1 -1
- package/dist/check/events/domain-event-names.d.ts +1 -1
- package/dist/check/events/domain-event-names.js +1 -1
- package/dist/check/explain/errors-docs.d.ts.map +1 -1
- package/dist/check/explain/errors-docs.js +10 -18
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/module-docs.js +1 -1
- package/dist/check/explain/module-docs.js.map +1 -1
- package/dist/check/explain/standard-docs.js +2 -2
- package/dist/check/explain/standard-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.js +4 -6
- package/dist/check/fixtures/context-file-fixtures.js.map +1 -1
- package/dist/check/fixtures/earlier-declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/earlier-declarations-fixtures.js +2 -4
- package/dist/check/fixtures/earlier-declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/module-fixtures.js +2 -2
- package/dist/check/fixtures/module-fixtures.js.map +1 -1
- package/dist/check/project/git-ignored.d.ts.map +1 -1
- package/dist/check/project/git-ignored.js +2 -1
- package/dist/check/project/git-ignored.js.map +1 -1
- package/dist/check/rules/authz-declared.d.ts.map +1 -1
- package/dist/check/rules/authz-declared.js +2 -1
- package/dist/check/rules/authz-declared.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +3 -12
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/module-complete.d.ts.map +1 -1
- package/dist/check/rules/module-complete.js +6 -2
- package/dist/check/rules/module-complete.js.map +1 -1
- package/dist/check/rules/tree-closed.d.ts.map +1 -1
- package/dist/check/rules/tree-closed.js +1 -2
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +9 -16
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +6 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/json-report.d.ts +8 -0
- package/dist/commands/json-report.d.ts.map +1 -0
- package/dist/commands/json-report.js +42 -0
- package/dist/commands/json-report.js.map +1 -0
- package/dist/commands/lint.d.ts +2 -3
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +2 -4
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/plan-waves.d.ts +2 -1
- package/dist/commands/plan-waves.d.ts.map +1 -1
- package/dist/commands/plan-waves.js +6 -3
- package/dist/commands/plan-waves.js.map +1 -1
- package/dist/commands/print-report.d.ts.map +1 -1
- package/dist/commands/print-report.js +2 -1
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +16 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commit/git-arguments.d.ts +9 -0
- package/dist/commit/git-arguments.d.ts.map +1 -0
- package/dist/commit/git-arguments.js +46 -0
- package/dist/commit/git-arguments.js.map +1 -0
- package/dist/commit/run-git.d.ts.map +1 -1
- package/dist/commit/run-git.js +2 -1
- package/dist/commit/run-git.js.map +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/kit-container.d.ts +6 -0
- package/dist/config/kit-container.d.ts.map +1 -0
- package/dist/config/kit-container.js +10 -0
- package/dist/config/kit-container.js.map +1 -0
- package/dist/config/stack.d.ts +1 -1
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -1
- package/dist/config/stack.js.map +1 -1
- package/dist/context-files/context-file.d.ts +1 -1
- package/dist/declared/earlier-layout-notice.d.ts +1 -1
- package/dist/declared/earlier-layout-notice.js +1 -1
- package/dist/declared/earlier-layout-notice.js.map +1 -1
- package/dist/declared/keeps-role-folder-files.d.ts +1 -2
- package/dist/declared/keeps-role-folder-files.d.ts.map +1 -1
- package/dist/declared/keeps-role-folder-files.js +1 -2
- package/dist/declared/keeps-role-folder-files.js.map +1 -1
- package/dist/declared/keeps-single-file.d.ts +2 -3
- package/dist/declared/keeps-single-file.d.ts.map +1 -1
- package/dist/declared/keeps-single-file.js +2 -3
- package/dist/declared/keeps-single-file.js.map +1 -1
- package/dist/docs/spec-heading.d.ts +5 -1
- package/dist/docs/spec-heading.d.ts.map +1 -1
- package/dist/docs/spec-heading.js +8 -2
- package/dist/docs/spec-heading.js.map +1 -1
- package/dist/doctor/format-diagnosis.js +3 -0
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/hook-findings.d.ts +2 -1
- package/dist/doctor/hook-findings.d.ts.map +1 -1
- package/dist/doctor/hook-findings.js +10 -2
- package/dist/doctor/hook-findings.js.map +1 -1
- package/dist/doctor/permission-findings.js +1 -0
- package/dist/doctor/permission-findings.js.map +1 -1
- package/dist/generate/di-entry.d.ts +4 -0
- package/dist/generate/di-entry.d.ts.map +1 -0
- package/dist/generate/di-entry.js +5 -0
- package/dist/generate/di-entry.js.map +1 -0
- package/dist/generate/di-imports.d.ts +4 -0
- package/dist/generate/di-imports.d.ts.map +1 -0
- package/dist/generate/di-imports.js +12 -0
- package/dist/generate/di-imports.js.map +1 -0
- package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +3 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts.map +1 -1
- package/dist/generate/kinds/background/spec-family.js +2 -1
- package/dist/generate/kinds/background/spec-family.js.map +1 -1
- package/dist/generate/kinds/background-job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/background-job-kind.js +8 -1
- package/dist/generate/kinds/background-job-kind.js.map +1 -1
- package/dist/generate/kinds/command-outputs.d.ts.map +1 -1
- package/dist/generate/kinds/command-outputs.js +2 -1
- package/dist/generate/kinds/command-outputs.js.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.d.ts.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.js +2 -1
- package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
- package/dist/generate/kinds/gateway-kind.js +1 -1
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/import-assembler.d.ts.map +1 -1
- package/dist/generate/kinds/import-assembler.js +11 -2
- package/dist/generate/kinds/import-assembler.js.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.d.ts.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.js +8 -4
- package/dist/generate/kinds/job/grant-system-actor.js.map +1 -1
- package/dist/generate/kinds/job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/job-kind.js +2 -1
- package/dist/generate/kinds/job-kind.js.map +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -1
- package/dist/generate/kinds/process-kind.d.ts.map +1 -1
- package/dist/generate/kinds/process-kind.js +8 -1
- package/dist/generate/kinds/process-kind.js.map +1 -1
- package/dist/generate/kinds/query-outputs.d.ts.map +1 -1
- package/dist/generate/kinds/query-outputs.js +2 -1
- package/dist/generate/kinds/query-outputs.js.map +1 -1
- package/dist/generate/kinds/test-world-kind.d.ts.map +1 -1
- package/dist/generate/kinds/test-world-kind.js +3 -2
- package/dist/generate/kinds/test-world-kind.js.map +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-fakes.js +2 -1
- package/dist/generate/kinds/world/context-fakes.js.map +1 -1
- package/dist/generate/kinds/world/world-arrangement.d.ts.map +1 -1
- package/dist/generate/kinds/world/world-arrangement.js +2 -1
- package/dist/generate/kinds/world/world-arrangement.js.map +1 -1
- package/dist/generate/kinds/world/world-vars.d.ts.map +1 -1
- package/dist/generate/kinds/world/world-vars.js +2 -1
- package/dist/generate/kinds/world/world-vars.js.map +1 -1
- package/dist/generate/spec-vars.d.ts.map +1 -1
- package/dist/generate/spec-vars.js +2 -1
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/wiring-family.d.ts +1 -1
- package/dist/generate/wiring-family.d.ts.map +1 -1
- package/dist/generate/wiring-family.js +2 -1
- package/dist/generate/wiring-family.js.map +1 -1
- package/dist/generate/wirings.js +2 -2
- package/dist/generate/wirings.js.map +1 -1
- package/dist/help/flag-notes.d.ts.map +1 -1
- package/dist/help/flag-notes.js +8 -0
- package/dist/help/flag-notes.js.map +1 -1
- package/dist/help/reading-notes.d.ts.map +1 -1
- package/dist/help/reading-notes.js +4 -2
- package/dist/help/reading-notes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +1 -2
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.js +4 -4
- package/dist/init/add-presets.d.ts +8 -0
- package/dist/init/add-presets.d.ts.map +1 -0
- package/dist/init/add-presets.js +17 -0
- package/dist/init/add-presets.js.map +1 -0
- package/dist/init/agent-permissions.js +2 -0
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.js +1 -1
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/auth-files.js +2 -2
- package/dist/init/files/auth-files.js.map +1 -1
- package/dist/init/files/event-sourcing-files.js +1 -1
- package/dist/init/files/event-sourcing-files.js.map +1 -1
- package/dist/init/files/family-of.d.ts +1 -1
- package/dist/init/files/family-of.d.ts.map +1 -1
- package/dist/init/files/family-of.js +2 -1
- package/dist/init/files/family-of.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.js +2 -2
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.js +1 -1
- package/dist/init/files/privacy-files.js.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.js +5 -1
- package/dist/init/manifest/dependencies-against-stack.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +4 -0
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +28 -24
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/manifest/write-manifest.js +1 -1
- package/dist/init/manifest/write-manifest.js.map +1 -1
- package/dist/init/regulated-sandbox.d.ts +5 -3
- package/dist/init/regulated-sandbox.d.ts.map +1 -1
- package/dist/init/regulated-sandbox.js +6 -3
- package/dist/init/regulated-sandbox.js.map +1 -1
- package/dist/init/rewire-personal-data.js +1 -1
- package/dist/init/rewire-personal-data.js.map +1 -1
- package/dist/init/rewire-preset.d.ts +1 -1
- package/dist/init/rewire-preset.d.ts.map +1 -1
- package/dist/init/rewire-preset.js +5 -2
- package/dist/init/rewire-preset.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +7 -7
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-stack.js +1 -1
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-style.d.ts +1 -1
- package/dist/init/stack/resolve-style.js +4 -4
- package/dist/init/stack/resolve-style.js.map +1 -1
- package/dist/init/validation-dependencies.d.ts.map +1 -1
- package/dist/init/validation-dependencies.js +3 -1
- package/dist/init/validation-dependencies.js.map +1 -1
- package/dist/layout/fit-statement.js +16 -2
- package/dist/layout/fit-statement.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +1 -1
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +1 -6
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/lint/format-verdict.d.ts +2 -2
- package/dist/lint/format-verdict.d.ts.map +1 -1
- package/dist/lint/format-verdict.js +3 -4
- package/dist/lint/format-verdict.js.map +1 -1
- package/dist/lint/lint-verdict.d.ts +2 -13
- package/dist/lint/lint-verdict.d.ts.map +1 -1
- package/dist/lint/lint-verdict.js +4 -22
- package/dist/lint/lint-verdict.js.map +1 -1
- package/dist/lint/parse-lint-answer.d.ts +1 -3
- package/dist/lint/parse-lint-answer.d.ts.map +1 -1
- package/dist/lint/parse-lint-answer.js +0 -2
- package/dist/lint/parse-lint-answer.js.map +1 -1
- package/dist/merge/git-process.d.ts.map +1 -1
- package/dist/merge/git-process.js +2 -1
- package/dist/merge/git-process.js.map +1 -1
- package/dist/merge/lost/revision-files.d.ts.map +1 -1
- package/dist/merge/lost/revision-files.js +6 -1
- package/dist/merge/lost/revision-files.js.map +1 -1
- package/dist/merge/lost/side-hunks.d.ts.map +1 -1
- package/dist/merge/lost/side-hunks.js +2 -1
- package/dist/merge/lost/side-hunks.js.map +1 -1
- package/dist/merge/merge-in-progress.d.ts +7 -0
- package/dist/merge/merge-in-progress.d.ts.map +1 -0
- package/dist/merge/merge-in-progress.js +22 -0
- package/dist/merge/merge-in-progress.js.map +1 -0
- package/dist/merge/object-bytes.d.ts.map +1 -1
- package/dist/merge/object-bytes.js +2 -1
- package/dist/merge/object-bytes.js.map +1 -1
- package/dist/model-modules/module-layers.d.ts +1 -1
- package/dist/model-modules/module-layers.d.ts.map +1 -1
- package/dist/model-modules/module-layers.js +1 -1
- package/dist/model-modules/module-layers.js.map +1 -1
- package/dist/model-modules/role-folders-of.js +1 -1
- package/dist/model-modules/role-folders-of.js.map +1 -1
- package/dist/package-manager/package-manager-vars.d.ts +1 -1
- package/dist/package-manager/package-manager-vars.js +2 -2
- package/dist/package-manager/package-manager-vars.js.map +1 -1
- package/dist/package-manager/pinned-package-managers.d.ts +2 -2
- package/dist/package-manager/pinned-package-managers.js +2 -2
- package/dist/plan/copy-of-project.d.ts.map +1 -1
- package/dist/plan/copy-of-project.js +2 -1
- package/dist/plan/copy-of-project.js.map +1 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +12 -2
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/ready-now.d.ts +8 -0
- package/dist/plan/ready-now.d.ts.map +1 -0
- package/dist/plan/ready-now.js +25 -0
- package/dist/plan/ready-now.js.map +1 -0
- package/dist/plan/wave-plan.d.ts +8 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +2 -0
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-refusal.d.ts.map +1 -1
- package/dist/presets/identity-refusal.js +4 -3
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/organisations-as-audit-chains.d.ts +10 -0
- package/dist/presets/organisations-as-audit-chains.d.ts.map +1 -0
- package/dist/presets/organisations-as-audit-chains.js +30 -0
- package/dist/presets/organisations-as-audit-chains.js.map +1 -0
- package/dist/progress/format-progress.js +10 -1
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/progress/progress.d.ts +2 -0
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/ready-rows.d.ts +7 -0
- package/dist/progress/ready-rows.d.ts.map +1 -0
- package/dist/progress/ready-rows.js +14 -0
- package/dist/progress/ready-rows.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +7 -2
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -5
- package/templates/acl/translator.spec.ts.tpl +3 -3
- package/templates/adapter/adapter.spec.ts.tpl +2 -7
- package/templates/adapter/simulated.spec.ts.tpl +1 -1
- package/templates/aggregate/aggregate.spec.ts.tpl +1 -9
- package/templates/architecture/{extractable.tsyringe.spec.ts.tpl → extractable.container.spec.ts.tpl} +2 -1
- package/templates/architecture/extractable.declared.spec.ts.tpl +2 -1
- package/templates/background-job/background-job.spec.buses.ts.tpl +19 -3
- package/templates/background-job/{background-job.spec.tsyringe.ts.tpl → background-job.spec.container.ts.tpl} +42 -12
- package/templates/controller/guard.spec.ts.tpl +22 -17
- package/templates/controller/guard.ts.tpl +3 -5
- package/templates/domain-service/domain-service.spec.ts.tpl +2 -2
- package/templates/init/README.md.tpl +8 -6
- package/templates/init/docker/Dockerfile.tpl +7 -7
- package/templates/init/docker/env.example.tpl +2 -0
- package/templates/init/e2e/start-application.database.ts.tpl +5 -5
- package/templates/init/e2e/start-application.memory.ts.tpl +5 -5
- package/templates/init/main.ts.tpl +1 -0
- package/templates/init/platform/composition/{compose-application.tsyringe.ts.tpl → compose-application.container.ts.tpl} +4 -7
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +2 -0
- package/templates/init/platform/events/start-outbox-relay.ts.tpl +5 -1
- package/templates/init/platform/observability/create-logger.stdout.ts.tpl +2 -2
- package/templates/init/platform/observability/create-metrics.ts.tpl +6 -3
- package/templates/init/platform/resilience/adapters-with-own-policy.ts.tpl +1 -1
- package/templates/init/platform/resilience/default-policy.ts.tpl +1 -1
- package/templates/init/rules/application.md.tpl +2 -0
- package/templates/init/rules/domain.md.tpl +2 -0
- package/templates/init/rules/infrastructure.md.tpl +2 -0
- package/templates/init/rules/platform.md.tpl +3 -3
- package/templates/init/rules/tests.md.tpl +2 -2
- package/templates/pipeline/biome.json.tpl +1 -1
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -2
- package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +2 -2
- package/templates/pipeline/lefthook.yml +4 -0
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/pipeline/vitest.config.ts.tpl +2 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +6 -4
- package/templates/presets/identity/context/test/integration/organisation-tenant-directory.spec.ts.tpl +7 -6
- package/templates/presets/identity/context/test/worlds/__context__.world.declared.ts.tpl +2 -1
- package/templates/presets/identity/design.md.tpl +4 -2
- package/templates/presets/identity/e2e/support.wiring.tpl +4 -4
- package/templates/presets/identity/platform/organisation-of-command.ts.tpl +36 -0
- package/templates/process/timeout-job.spec.buses.ts.tpl +15 -2
- package/templates/process/{timeout-job.spec.tsyringe.ts.tpl → timeout-job.spec.container.ts.tpl} +21 -2
- package/templates/query/search.reader.spec.ts.tpl +1 -1
- package/templates/repository/knex/mapper.ts.tpl +1 -1
- package/templates/service/main.ts.tpl +1 -0
- package/templates/value-object/value-object.spec.ts.tpl +1 -5
- /package/templates/adapter/{simulated.wiring.tsyringe.tpl → simulated.wiring.container.tpl} +0 -0
- /package/templates/adapter/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/architecture/{hosting.tsyringe.spec.ts.tpl → hosting.container.spec.ts.tpl} +0 -0
- /package/templates/architecture/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/background-job/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/command/{handler.spec.tsyringe.ts.tpl → handler.spec.container.ts.tpl} +0 -0
- /package/templates/command/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/context/{module.tsyringe.ts.tpl → module.container.ts.tpl} +0 -0
- /package/templates/context/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/controller/{routes.tsyringe.tpl → routes.container.tpl} +0 -0
- /package/templates/erasure-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/event-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/file-upload/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/gateway/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/init/platform/audit/{audit.module.tsyringe.ts.tpl → audit.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/auth/authorization/{authorization.tsyringe.ts.tpl → authorization.container.ts.tpl} +0 -0
- /package/templates/init/platform/buses/{create-command-bus.tsyringe.ts.tpl → create-command-bus.container.ts.tpl} +0 -0
- /package/templates/init/platform/buses/{create-query-bus.tsyringe.ts.tpl → create-query-bus.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{context-selection.tsyringe.ts.tpl → context-selection.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{lay-foundations.tsyringe.ts.tpl → lay-foundations.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{platform-test.module.tsyringe.ts.tpl → platform-test.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{platform.module.tsyringe.ts.tpl → platform.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{routes-of.tsyringe.ts.tpl → routes-of.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{bind-files.tsyringe.ts.tpl → bind-files.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{files.module.tsyringe.ts.tpl → files.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{staging-uploads.tsyringe.ts.tpl → staging-uploads.container.ts.tpl} +0 -0
- /package/templates/init/platform/jobs/{housekeeping.module.tsyringe.ts.tpl → housekeeping.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{data-subject-copies.tsyringe.ts.tpl → data-subject-copies.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{data-subject-exports.tsyringe.ts.tpl → data-subject-exports.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{privacy.module.tsyringe.ts.tpl → privacy.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-erasure.tsyringe.ts.tpl → run-erasure.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-export.tsyringe.ts.tpl → run-export.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-purge.tsyringe.ts.tpl → run-purge.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-erase.tsyringe.ts.tpl → privacy-erase.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-export.tsyringe.ts.tpl → privacy-export.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-purge.tsyringe.ts.tpl → privacy-purge.container.ts.tpl} +0 -0
- /package/templates/integration-event/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/integration-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/job/{job.spec.tsyringe.ts.tpl → job.spec.container.ts.tpl} +0 -0
- /package/templates/job/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/module/{module-file.tsyringe.ts.tpl → module-file.container.ts.tpl} +0 -0
- /package/templates/module/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/personal-data/{copies.tsyringe.tpl → copies.container.tpl} +0 -0
- /package/templates/personal-data/{exports.tsyringe.tpl → exports.container.tpl} +0 -0
- /package/templates/personal-data/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/process/{timeout-job.wiring.tsyringe.tpl → timeout-job.wiring.container.tpl} +0 -0
- /package/templates/projection/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/query/{handler.spec.tsyringe.ts.tpl → handler.spec.container.ts.tpl} +0 -0
- /package/templates/query/{search.handler.spec.tsyringe.ts.tpl → search.handler.spec.container.ts.tpl} +0 -0
- /package/templates/query/{search.wiring.tsyringe.tpl → search.wiring.container.tpl} +0 -0
- /package/templates/query/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/repository/{event-sourced.wiring.tsyringe.tpl → event-sourced.wiring.container.tpl} +0 -0
- /package/templates/repository/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/route/{routes.on-tsyringe.tpl → routes.on-container.tpl} +0 -0
- /package/templates/service/{extracted.tsyringe.tpl → extracted.container.tpl} +0 -0
- /package/templates/test-world/{world.tsyringe.ts.tpl → world.container.ts.tpl} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,122 @@ What each version changes for someone who uses the kit. The packages of `package
|
|
|
4
4
|
together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
|
|
5
5
|
list the pull requests behind it.
|
|
6
6
|
|
|
7
|
+
## 0.106.0
|
|
8
|
+
|
|
9
|
+
**Every published package says the Node it needs: `engines.node` is `>=22.12.0` in each manifest.** `ddd-ts-kit` and the runtime packages carried no `engines` field; only `@ddd-ts-kit/eslint-plugin` did. `npm install` under an older Node now warns (`EBADENGINE`) instead of failing later on a syntax the runtime lacks, and the Node badge of the README reads the range from the published `ddd-ts-kit` instead of `unknown`.
|
|
10
|
+
|
|
11
|
+
**A guard the kit generates refuses everybody until it is written, and a project is green right after `generate guard`.** The stub of `generate guard` read `if (actor.id !== '')` before its refusal: a branch no caller takes, since the anonymous actor has the id `anonymous`, and one the generated spec did not run, so `test:coverage` failed on the 70 percent branch floor of the presentation layer with every test green. The stub now holds one line, `throw new ForbiddenError(...)`, closed by default as the fail-safe default asks, and its spec holds the one test that is true of it, a caller refused with 403, with the `it.todo` for the caller the guard is written for. The TODO of the stub says what to read from the request (`actor`, `params`) and the TODO of the spec says to hold one test per decision of the guard.
|
|
12
|
+
|
|
13
|
+
A guard already generated keeps its stub and its spec.
|
|
14
|
+
|
|
15
|
+
**A generated project and the CI of the kit install pnpm by npm, at the release `package.json` pins; nothing asks corepack any more, since Node 25 ships none.** The `Dockerfile` (both stages), the setup action of GitHub and the `before_script` of GitLab run `npm install --global "$(node -p "require('./package.json').packageManager")"`, one source for the release. The template variable `pm.corepack` is now `pm.pinned`. pnpm 12 reads the `packageManager` field and, when the running release differs, downloads and runs the pinned one (`pmOnFail: download`), so a pnpm installed once follows what each project pins. The workflows and the GitLab pipeline of the kit install `pnpm@12.11.2`, the release `init` writes, and a spec holds the three equal to it.
|
|
16
|
+
|
|
17
|
+
To move: in a project already generated (`init --force` leaves the files it wrote once), replace `corepack enable` by `npm install --global "$(node -p "require('./package.json').packageManager")"` in the `Dockerfile` (two stages), `.github/actions/setup/action.yml` and `.gitlab-ci.yml`. On a developer machine, run `npm install --global pnpm` once.
|
|
18
|
+
|
|
19
|
+
**The dependency injection page compares InversifyJS and Awilix with the three ways the kit wires, measured.** [Dependency injection](docs/tools/dependency-injection.md) now says why these two, sets them against tsyringe with `@ddd-ts-kit/di`, NestJS and manual wiring on one grid, gives when each of six wiring mistakes is found per container and what each costs in start time, memory, bundle and resolve, and recommends by need of the project and by affinity of the team. The kit generates nothing for either: a project that insists on one runs on `--di manual`, and the page gives the wiring, tried on a generated project, with its trap: `generate` keeps writing `new` beside the container, and nothing reports it. The `wiring` skill says so too.
|
|
20
|
+
|
|
21
|
+
**`@ddd-ts-kit/di` runs on tsyringe, InversifyJS or Awilix: `createApplication` and `createTestApplication` move to an entry point per container.** `@ddd-ts-kit/di/tsyringe`, `@ddd-ts-kit/di/inversify` and `@ddd-ts-kit/di/awilix` each export both functions, and `application.container` is typed as the container underneath. Every check of the graph, the buses and the lifecycle stay the kit's own, the same on the three: the whole suite of the package runs on each. tsyringe, `reflect-metadata`, `inversify` and `awilix` are optional peers, so a project installs the one it uses; the main entry point imports none of them. `createApplicationOn(container, options)` and `createTestApplicationOn(container, options)`, with the `Container` interface, wire the kit on another container. A promise bound to a port is refused by InversifyJS at its first resolution, since its `get` is synchronous; tsyringe and Awilix hand it over.
|
|
22
|
+
|
|
23
|
+
To move: import `createApplication` and `createTestApplication` from `@ddd-ts-kit/di/tsyringe` instead of `@ddd-ts-kit/di`.
|
|
24
|
+
|
|
25
|
+
**`ddd-ts-kit doctor` outside a git repository no longer claims the git hooks are in place.** It reports `hook git repository` as missing ("no git repository here: the hooks could not be read; `git init` comes first"), with the fix `git init` then `hooks:install`, and `--strict` exits 1; the summary line that names the hooks is printed only when they could be read.
|
|
26
|
+
|
|
27
|
+
To move: run `git init` before `hooks:install` in a project that has no repository yet.
|
|
28
|
+
|
|
29
|
+
**`@ddd-ts-kit/knex` exports `jsonColumn(value)`, so a list or a string in a `jsonb` column round-trips on Knex as on Drizzle, Prisma and TypeORM.** `pg` wrote a JavaScript array as a PostgreSQL array literal and a string as it is, so the mapper line that worked with an object failed with `22P02` at the first list. `jsonColumn` answers the JSON text of any value (`null` for an absent one). The generated Knex mapper names it in its TODO, and the repository contract of `@ddd-ts-kit/testing` gains an optional `createAggregateKeepingJson` that runs a case writing an object, a list and a string in a JSON column; the four ORM packages run it.
|
|
30
|
+
|
|
31
|
+
To move: a Knex mapper that writes `JSON.stringify(value)` by hand keeps working; use `jsonColumn(value)` instead. A project that runs the repository contract may give it `createAggregateKeepingJson`.
|
|
32
|
+
|
|
33
|
+
**`--di inversify` and `--di awilix`: a project runs on InversifyJS or Awilix with everything the kit gives on tsyringe.** The declared and explicit styles, the generators, the presets and the checks of `createApplication` are the same on the three, and the code of the project too: only the import of `createApplication` and `createTestApplication` and the dependencies change, so `bind()` and `register()` appear nowhere. A team that wants to write their API runs on `--di manual`: [Dependency injection](docs/tools/dependency-injection.md) gives both paths, what each costs and which to take.
|
|
34
|
+
|
|
35
|
+
**`init --force` with the flags of the first init leaves a preset's context as the team has it.** Running `init` again with `--force` and the same `--preset identity` wrote the preset a second time over its own files: the publishers of the identity context came back as the bare stubs of `generate` (the mapping of their payload and the tenant of the fact gone), and `CONTEXT.md` and `docs/behaviour/*` followed. A preset is now applied once: when its context is already written, `--preset` writes nothing of it and a note says "the identity preset is already applied: its context is yours, `--force` rewrote the platform only", so the command line of the first init plus `--force` leaves the same project as `--force` alone.
|
|
36
|
+
|
|
37
|
+
**A generated project measures on OpenTelemetry: `use_case_*`, `dependency_call_*` and the depth of the outbox and of the job queues leave by OTLP with the spans.** `@ddd-ts-kit/tracing` adds `openTelemetryMetrics({ meterName?, meterVersion? })`, the kernel `Metrics` port on the OpenTelemetry metrics API (a counter, a histogram and a synchronous gauge per name, the labels as attributes, an undefined label left out). `initTracing` registers a periodic OTLP/HTTP metric reader when `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` or `OTEL_EXPORTER_OTLP_ENDPOINT` is set, every `metricsExportIntervalMillis` (else `OTEL_METRIC_EXPORT_INTERVAL`, else 60 seconds), and none without them, where the SDK used to export metrics to `localhost:4318` by default; `OTEL_METRICS_EXPORTER=none` keeps the metrics in the process while the spans still leave, and a value other than `otlp` is read as `none`; `@opentelemetry/sdk-metrics` and `@opentelemetry/exporter-metrics-otlp-http` join its optional peers. `OutboxRelay` of `@ddd-ts-kit/events` takes `metrics` and sets `outbox_pending`, `outbox_failed` and `outbox_dead` from `store.stats()` after each tick; `QueueWorker` of `@ddd-ts-kit/scheduling`, given `metrics`, sets `jobs_waiting`, `jobs_running` and `jobs_dead` per `queue` from `store.stats(queue)`, at most once per poll interval. A generated `create-metrics.ts` answers `openTelemetryMetrics()` under the name of the project instead of `NoopMetrics` and its `TODO(platform)`, the composed application exposes `metrics`, and `main.ts` and a context run alone hand them to `startOutboxRelay`. See `packages/tracing/README.md` and `docs/guides/deploy-and-rollback.md`.
|
|
38
|
+
|
|
39
|
+
To move: in `src/platform/observability/create-metrics.ts`, return `openTelemetryMetrics({ meterName: '<project>' })` imported from `@ddd-ts-kit/tracing`; add `readonly metrics: Metrics` to `Application` in `src/platform/composition/compose-application.ts` (`metrics,` from the platform when wired by hand, `metrics: container.resolve(Metrics),` on tsyringe); give `src/platform/events/start-outbox-relay.ts` a `metrics?: Metrics` option passed to `new OutboxRelay({ ..., metrics })`, and pass `metrics: application.metrics` where `main.ts` (and each `src/apps/<context>/main.ts`) starts the relay; add `@opentelemetry/sdk-metrics` `^3.0.0` and `@opentelemetry/exporter-metrics-otlp-http` `^0.300.0` to the dependencies. A project whose `OTEL_EXPORTER_OTLP_ENDPOINT` is Jaeger alone sends the metrics where nothing keeps them: `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` points them at a store that takes OTLP metrics.
|
|
40
|
+
|
|
41
|
+
**The hooks of the plugin hold their branch floor whatever the load of the runner.** A defensive branch of the guard was reached only when a command without a word (a redirection alone) was judged after a worker left changes outside its scope, and only when `git status` had answered within the time the guard gives it: on a loaded runner the floor read 99.91 percent of the branches of `guard.mjs` with every test green (#723, three times). `isProgramPath` now reads the first word of a command as text, an absent word being no path: the same decision, one branch fewer, and the floor no longer depends on the clock. The job names the branches a run did not take since #729.
|
|
42
|
+
|
|
43
|
+
**The ABAC rule `generate job` writes permits the system actor of the job, not any actor whose id reads like it.** Under `--authz abac` the rule of the `system-grants` region was `({ actor }) => actor.id === 'system:<job>'`, so a user whose token carried the subject `system:<job>` held the permission of the command of the job through any route on that command. The rule is now `({ actor }) => isSystem(actor) && actor.id === 'system:<job>'`, and `generate job` adds `import { isSystem } from '@ddd-ts-kit/kernel';` to `platform/auth/attributes/attribute-policies.ts` once, however many jobs it grants. The grants under `--authz rbac` and `--authz rebac` already read a system actor.
|
|
44
|
+
|
|
45
|
+
To move: in `src/platform/auth/attributes/attribute-policies.ts` of a project on `--authz abac`, write `isSystem(actor) && ` before `actor.id === 'system:` in each rule of the `system-grants` region, and import `isSystem` from `@ddd-ts-kit/kernel`.
|
|
46
|
+
|
|
47
|
+
**Every git that `ddd-ts-kit` runs ignores a `core.fsmonitor` planted in the repository, and a read runs no hook of the project.** One helper of the CLI builds the arguments of each git it starts: always `-c core.fsmonitor=false --no-optional-locks`, so that a command written in `.git/config` never runs and a read does not refresh the index (which starts the `post-index-change` hook); and, for a run that changes nothing (`status`, `diff`, `ls-files`, `cat-file`, `rev-parse`, `log`, `show`, `merge-base` and the other reads), `-c core.hooksPath=/dev/null`. `commit`, `merge` and the other writes keep the hooks of the project, which are its gates. A spec of the CLI holds that no git is started any other way. The guard of the plugin already ran its own git this way.
|
|
48
|
+
|
|
49
|
+
**`@ddd-ts-kit/sentry` never sends the values a failed statement quotes: the statement reaches the tracker, its values read `[redacted]`.** Drizzle, the default ORM, writes the parameters of a failed statement after `params:` in its message, so an email or a password hash reached the tracker on any database failure. Whatever `scrubMessages` says, `scrubEvent` now redacts, in every exception of the event, its message and what an integration copied of the error (`extra`, contexts): the parameters of a `DrizzleQueryError` (`\nparams: [redacted]`), the key of a violated unique or foreign key constraint (`Key (email)=([redacted]) already exists.`, in a message or the `detail` of pg and TypeORM), the row a not-null or a check constraint refused (`Failing row contains ([redacted]).`), a value PostgreSQL could not read (`invalid input syntax for type integer: "[redacted]"`), the arguments Prisma renders of a call it refused, and a field named `parameters`, `params` or `bindings`. The statement stays, placeholders included. `scrubMessages` keeps its default `false`; `SENTRY_SCRUB_MESSAGES=true` still drops the whole message of an error that is not a `DomainError`, for a tracker hosted by a third party.
|
|
50
|
+
|
|
51
|
+
**The guard of the plugin asks before an edit that changes the `scripts` of `package.json`, and only then.** The scripts are what the gates and the pipeline run (`ci:lint`, `ci:audit`, `ci:arch:check`), and nothing stopped an edit of one. Before a write of the `package.json` of the project, the guard now rebuilds the text the call leaves in the file (the content of a Write or of a Copilot create; an Edit, a `replace_all`, the `edits` of a MultiEdit or the `old_str`/`new_str` of Copilot applied to the current file), compares its `scripts` block with the current one, and asks, naming each script added, removed or changed. A change of the dependencies, the version or any other field passes as before. A text that is not a JSON object, or a patch of Codex, whose result the guard does not rebuild, is asked too. The permissions `init` writes keep no rule on `package.json`, which a rule could not scope to its scripts.
|
|
52
|
+
|
|
53
|
+
**With the identity preset, tenants and an audit trail, a command that succeeded on an organisation is audited in the chain of that organisation.** `auditMiddleware` of `@ddd-ts-kit/audit` takes `tenantOf(message)`: the entry of a message that succeeded is written with the tenant it names, in its chain, its `actor.tenantId` still the one of the token; a failure, and the decision of `auditDecisions`, stay in the tenant of the work, so a caller who names a tenant it cannot act in never writes to its chain nor opens one. The preset writes `platform/audit/organisation-of-command.ts`, which names the organisation of `OpenOrganisationCommand` (its slug) and of the six commands that carry `organisationId`, and gives it to the audit middleware of the commands in `platform/audit/create-audit.ts`, which `init --force` wires again after rewriting that file, keeping `organisation-of-command.ts` as the team left it: the owner of an organisation reads who opened it, invited, removed, changed a role or lent a right in it, whatever organisation the token of that person named. Accepting or declining an invitation names its token only and stays in the tenant of the token; the organisation joined reads `identity.member.joined` in its own chain, as before.
|
|
54
|
+
|
|
55
|
+
To move: in a project generated with the identity preset and tenants, write `src/platform/audit/organisation-of-command.ts` as `init --preset identity` now writes it, import it in `src/platform/audit/create-audit.ts` and add `tenantOf: organisationOfCommand` to the options of `auditMiddleware` of `commands`.
|
|
56
|
+
|
|
57
|
+
**The identity preset says what a deactivated account can still do, and for how long.** The comment of `DeactivateAccountHandler`, the design of the identity context (its `CONTEXT.md`) and the guide [Bootstrap with well-designed contexts](docs/guides/bootstrap-with-well-designed-contexts.md) said that a deactivated account holds no right anywhere. The identity context refuses it at once; the other contexts read the token, so they refuse it at its next token, and a token already issued lives until it expires (300 s in the Keycloak realm the kit writes). They now say so, and that a project that wants no window checks the account at the edge.
|
|
58
|
+
|
|
59
|
+
A project already generated keeps the old comment and design text.
|
|
60
|
+
|
|
61
|
+
**The three loggers of the kit redact the same credential keys, whatever their case: `StdoutLogger`, the default of a generated project, now redacts too.** `CREDENTIAL_KEYS` of `@ddd-ts-kit/kernel` gains `clientSecret`, `client-secret`, `x-api-key`, `id_token`, `idToken`, `private_key`, `privateKey` and `passwd`, and the kernel exports `isCredentialKey(name)`, which compares a name with them without case. `StdoutLogger` of `@ddd-ts-kit/aspects`, `@ddd-ts-kit/pino` and `@ddd-ts-kit/winston` write `[redacted]` for the value of such a key at the top of an entry and one level below, so `Authorization`, `headers.X-Api-Key` or `ID_TOKEN` no longer reach the lines. A key a project adds through `redact` is compared without case by winston and one level below by pino; at the top of a pino line it is matched as written, since pino names a key there by its path. Nothing deeper than one level, nor inside a list, is looked at, as before.
|
|
62
|
+
|
|
63
|
+
**The regulated profile writes `sandbox.autoAllowBashIfSandboxed: false`, and `doctor` reports a sandbox without it.** Claude Code defaults the key to `true`, under which a bare `Bash` ask rule is skipped for every command the sandbox runs: under the profile every command that fits the sandbox ran without a prompt, and the allow-list it reviews was not a gate. Deny rules and ask rules scoped to a content held either way. The line and its reason are in the table of [the agent sandbox guide](docs/guides/agent-sandbox.md).
|
|
64
|
+
|
|
65
|
+
To move: in a project on the regulated profile, run `npx ddd-ts-kit init` again: it adds the key to the `sandbox` block of `.claude/settings.json` when the block lacks it, and keeps the keys the project set. A project that set the key to `true` keeps it, and `ddd-ts-kit doctor` reports it until it reads `false`.
|
|
66
|
+
|
|
67
|
+
## 0.105.0
|
|
68
|
+
|
|
69
|
+
**The `quality-gate` and `testing` skills load lighter: what only one situation of the work needs is read from a file beside them.** Bringing the trunk in, review remarks, coverage, the end-to-end specs and the acceptance of a story move to `quality-gate/merge-trunk.md`, `review-remarks.md`, `coverage.md` and `testing/end-to-end.md`, `acceptance.md`; the body names each in one line. "A fix" points to the `fix` skill, which holds it. The bodies shrink by about a quarter (4,800 words to 3,600), and a test holds them under a ceiling.
|
|
70
|
+
|
|
71
|
+
**The skills and agents of the plugin read the list of markers left with `todo <context> --brief`.** Where an agent only checks that no marker is left, or picks the next one, the pages now name `ddd-ts-kit todo <context> --brief` (`file:line` and the first words, the file holding the rest), which prints about half as much as the full form on a fresh context. The full form stays where an agent fills the markers.
|
|
72
|
+
|
|
73
|
+
**The test and the guide of the plugin state the budget of the skill listing in characters.** Claude Code reserves 1% of the context window, counted in characters: 8,000 on a 200k window, shared with every other skill of the session. The 20 skills the model may invoke take about 5,600 characters with their names, 70 percent of it, and a new test holds them under the 8,000 on their own. The kit accepts that in a crowded session its least invoked skills lose their description (they are still run by name). The limits of 320 per skill and 6,500 in total stay.
|
|
74
|
+
|
|
75
|
+
**The bootstrap and `ddd-ts-kit init` say `git init` before the step that needs a repository.** The `bootstrap` skill now says in step 3, before `init`, that `init` creates no repository and that `git init` is the owner's, instead of saying it after `hooks:install` had failed; the README says it above the commands of "What the agent runs"; and `init` ends its notes with one line when its directory is no git repository.
|
|
76
|
+
|
|
77
|
+
**The examples `ddd-ts-kit explain` gives for `errors/code-unique` and `governance/recorded-deviation` are accepted by a project `init` wrote.** The first shows the code list of a context under `"stack.refusals": "named"`, the form `init` writes, instead of a factory class the checker reports; the second turns `test/spec-required` off for a glob of files with its decision record, instead of for the whole project.
|
|
78
|
+
|
|
79
|
+
**`docs/ARCHITECTURE.md` says what five rules hold, and a spec holds the page to the checker.** `layer/domain-purity` refuses every Node built-in, not only the ones doing I/O; `test/spec-required` also asks a spec for a state machine, a process manager and a background job; the canonical tree lists `<context>.controllers.ts`, which `"stack.routes": "nest"` generates; the table "Who checks what" gives a row to `presentation/*`, `language/declared-vocabulary`, `persistence/no-file-content` and `files/port-not-connector`, and no longer says that `naming/*` and `language/*` are held by `ddd-ts-kit check` alone; the stepdown rule judges each helper below its first caller, not the order of two helpers. A spec of the CLI now compares these rows with the checker, the ESLint plugin and the canonical tree.
|
|
80
|
+
|
|
81
|
+
**A file of `changes/` links to pages that exist and names the packages as they are published.** The check of a pull request refuses a file of `changes/` whose link leaves the repository or leads to no file, read from the root where `CHANGELOG.md` reads it, and one that names an `@ddd-ts-kit/` package no `package.json` of `packages/` is published as. The entries of 0.100.0 and earlier that link to `../docs/...` and the To move of 0.100.0 that names a scoped package of the CLI are corrected by the release pull request, the one change that may edit `CHANGELOG.md`.
|
|
82
|
+
|
|
83
|
+
**The English and French pages of the CLI README give the same JSON answers.** `status --json` is documented as `{ next, planNext, slices, remaining }` in English too, and `merge-trunk --json` holds `client?` and `trunkMoved?` in French too, as the commands answer. The check of the French documentation now compares the JSON shapes of a page and its French page, the inline ones of the prose and the fenced JSON blocks, comments left out, which a stamp does not read.
|
|
84
|
+
|
|
85
|
+
**`ddd-ts-kit docs --help` names `--dry-run`.** The flag already listed the generated files `docs` would create, update or delete without writing them; the usage of the command, its note, the commands guide and the CLI README now say so. A spec holds the usage of each command to the flags its parser accepts.
|
|
86
|
+
|
|
87
|
+
**A rule of the kit is never in transition: `ddd-ts-kit lint` fails on every warning, and the layouts of 0.84 to 0.87 are errors.** Before 1.0 a rule that prevents a problem lands as an error, with no warning first and no version that makes it an error later (`CONTRIBUTING.md`). The `transition` of the ESLint rules is gone with what read it: `ddd-ts-kit lint` no longer lists the warnings of a rule in transition apart, and `lint --json` answers `{ errors, warnings, report }` without `inTransition`. What the kit read for one minor version is now reported as an error, whatever the severity of its rule, and read only so that the command that moves it can: the code list and the permission set where 0.86 and 0.87 kept them (`tree/closed`), a module where 0.86 and 0.87 put it (`module/complete`), the declarations of 0.84 to 0.86 (`declarations/barrel-current`). `docs --check` fails on those declarations, naming the files `docs` would write, and its JSON answer has no `warnings` field any more.
|
|
88
|
+
|
|
89
|
+
To move: run `npx ddd-ts-kit context-layout` and `npx ddd-ts-kit docs`, commit what they move, then `npx ddd-ts-kit check`; a script that reads `inTransition` of `lint --json` or `warnings` of `docs --check --json` drops it.
|
|
90
|
+
|
|
91
|
+
**The commit hooks print only what fails.** The `lefthook.yml` that `init` writes sets `output: [failure]`: a commit that passes prints one line of lefthook instead of the frame, the output and the summary of every job (3,800 characters for a commit of eleven files), and a job that fails still prints its findings with their fix. The warnings of `check` and the note that `gitleaks` is not installed no longer show on a passing commit; `ddd-ts-kit check` and `verify` still print them.
|
|
92
|
+
|
|
93
|
+
To move: a project already generated keeps the `lefthook.yml` it has (`init --force` leaves the pipeline definitions it wrote once); add `output:` with ` - failure` under `min_version` to get the quiet commit.
|
|
94
|
+
|
|
95
|
+
**`plan-waves --ready` and `status --ready` print only what a conductor can launch now.** `plan-waves --ready` keeps the first wave, whose rows have every dependency done, with its merge order, and says the later waves in one line (`Later: 4 waves, 16 batches, 32 rows`); `status --ready` lists the rows not started whose dependencies are done and counts the others in one line. `--json` carries the same reduction (`later` in the plan, `notShown` in the slices of `status`). Without the flag nothing changes: a conductor of a plan of forty rows reads the next step instead of the whole plan, and runs the command again once the wave has merged. The skill `parallel-work` names both in one line.
|
|
96
|
+
|
|
97
|
+
**`status`, `doctor` and the start of a session say first that a merge is half done.** A `merge-trunk` stopped on conflicts used to leave no trace in them, and a session resumed or compacted could commit or generate on top of it. The first line is now `Merge in progress: <branch> <- <trunk>, N paths left for you when it stopped: merge-trunk --continue or --abort`; a merge that `merge-trunk` did not start names `merge-trunk --abort` (or git) alone. With `--json`, `status` and `doctor` carry the line as `mergeInProgress`.
|
|
98
|
+
|
|
99
|
+
**`until` joins `eventually` in `@ddd-ts-kit/testing/e2e`.** `until(condition, { timeoutMs, intervalMs })` waits for a condition that returns a boolean (a counter, a list) with the same polling as `eventually`, and fails with the same message when the time is up. The test support of the brokers and of the HTTP adapters now reads it instead of keeping a loop of its own.
|
|
100
|
+
|
|
101
|
+
**The specs of a background job and of the timeout of a process arrange through the world of their context once `generate test-world` wrote it, as the specs of a command, a query and a job do.** They take the test application (or the test buses, on a context wired by hand) from `a<Context>World()`, where they built the module, the application and an authorizer themselves. A background job is enqueued by the holder of the permission of its command (`holdersOf`), or by `anActor().build()` when the command is public, where it was a literal `clerk-1`; the guard spec builds its caller with `anActor()` too. A spec generated before the world says that `generate test-world` would shorten it. A spec already generated keeps its arrangement.
|
|
102
|
+
|
|
103
|
+
**The specs of a guard, an adapter and a search reader are titled in words, and the behaviour page heads every spec in words.** A generated guard spec reads `Who may pass the not banned guard`, a remote or simulated adapter spec `The remote tax calculator`, a search reader spec `The reader of search invoices`, where they read a class name. In `docs/behaviour/<context>.md`, a spec that fits no use case, model nor reaction (a policy no use case requires yet, a guard, a contract, an end-to-end journey) is headed as the model is, `Not banned (guard)`, where it was headed by its file name, `not-banned (guard), in unit`; the directory its section names is no longer repeated, a module folder below it still is.
|
|
104
|
+
|
|
105
|
+
To move: run `npm run docs:generate` and commit the pages it rewrites; `docs --check` fails until then. A spec already generated keeps its title.
|
|
106
|
+
|
|
107
|
+
**A spec the kit generates for an adapter, a translator, a domain service, an aggregate or a guard asserts something about the project, or leaves the rule planned.** The remote adapter spec no longer checks that its class is an instance of itself, the guard spec no longer checks a property of the kernel, and the aggregate spec no longer asserts that reading its state records no fact: the first business intention stays an `it.todo`. The translator spec holds the empty record it answers until its mapping is written, and the domain service spec holds that the service takes nothing when it is built (`toHaveLength(0)`), a port or a store being no part of it. A project already generated keeps its specs as they are.
|
|
108
|
+
|
|
109
|
+
**`--json` of `generate`, `init`, `docs` and `sdk` leaves out the lists that hold nothing, and says once the directory every path shares.** `dryRun` appears under `--dry-run` only, `created`, `updated`, `deleted`, `skipped`, `kept`, `unwritable`, `todos` and `notes` only when they hold something, and when every path of the run starts with the same directory it is printed once as `root` (`"root":"src/contexts/ordering/"`) and each path, of the lists and of `todos`, is written from it. A `generate port` run prints `{"root":"src/contexts/ordering/","created":["application/ports/payment-gateway.port.ts",...]}`; a run that also rewrites `docs/behaviour/` prints its paths whole, as before. The text output does not change.
|
|
110
|
+
|
|
111
|
+
To move: a script that reads `--json` joins `root` (when present) to each path before it opens a file, and reads an absent list as an empty one: `const { root = '', created = [], todos = [] } = JSON.parse(stdout)`.
|
|
112
|
+
|
|
113
|
+
**The rule files of the domain, application and infrastructure layers tell of event sourcing only in a project that turned it on.** With `eventSourcing: "off"`, the default, `.claude/rules/domain.md`, `application.md` and `infrastructure.md` and their Copilot copies under `.github/instructions/` leave out the paragraphs on event-sourced aggregates, the event store and `EventSourcedRepository`, which an agent read in every session for an option the project refuses. `init --force --event-sourcing on` writes them.
|
|
114
|
+
|
|
115
|
+
To move: nothing to do; a project already generated keeps the paragraphs until it runs `init --force`.
|
|
116
|
+
|
|
117
|
+
**Under `--value-objects result`, the generated spec of a value object asserts the code of the refusal, as it does with throwing factories.** `refuses an empty value with a coded error` reads `expectRefusal(InvoiceNumber.create(' '), 'INVARIANT_VIOLATION')` on the `Result`, where it asserted only that `ok` was false. A spec already generated keeps its assertion.
|
|
118
|
+
|
|
119
|
+
**The unit project of a generated Vitest config runs without isolation (`isolate: false`), four to eight times faster.** Every handler spec imports the declarations of its context, which Vitest evaluated again for each spec file; each worker now evaluates them once. On a generated project of 33 unit spec files (126 tests), two workers under `nice -n 10` and foreign load, `vitest run --project unit` took 10.1 to 21.1 s before and 2.3 to 5.1 s after, the same tests passing; the example passes its 251 unit spec files either way (39 s isolated, 9 s without). The integration project and Jest keep their isolation, and the budget of a spec file, which leaves the loading of its modules out, keeps its meaning. A module of the project that keeps state from one spec file to the next needs `isolate: true` in the unit project again.
|
|
120
|
+
|
|
121
|
+
To move: in `vitest.config.ts`, add `isolate: false` to the `test` of `UNIT_PROJECT`, or run `init --force`.
|
|
122
|
+
|
|
7
123
|
## 0.104.0
|
|
8
124
|
|
|
9
125
|
**A role folder holds its role files and nothing else: a barrel, a JavaScript file and a port with no abstract class are reported.** `naming/suffix` no longer lets an `index.ts` through in a role folder that has a suffix, alias or not; `tree/closed` reports a `.js`, `.mjs`, `.cjs`, `.jsx`, `.tsx`, `.mts` or `.cts` file anywhere in a context, which no rule read; `ports/abstract-class`, in `ddd-ts-kit check` and in ESLint, reports a port file that declares no class at all, such as `export type InvoiceRepository = { ... }` or a token alone.
|
|
@@ -599,7 +715,7 @@ To move: an aggregate generated before keeps its `registeredAt` and its `registe
|
|
|
599
715
|
|
|
600
716
|
**A background job declares the schema of its payload, and the worker reads every stored payload with it before the run: one that does not fit is dead with `INVALID_JOB_PAYLOAD`, never run.** A payload waits in the queue (the jobs table, Redis, the memory of the process) across deploys; until now the worker handed it to the typed `run` as it was stored, so a job enqueued before a deploy that changed its shape ran as the new type, a missing field read as `undefined`. A background job class now carries a static `payload` next to its `jobName`, a `BackgroundJobPayloadSchema` of the kernel (`parse(input)` answering a `Result`), which the `Schema` of `@ddd-ts-kit/validation` is, whatever library it adapts. It is required by the types: `jobs.enqueue(Job, ...)`, `@Background()`, `builder.backgroundJob(..).handledBy(Job, ...)` and `platform.backgroundJobs.register(Job, ...)` do not compile without it, `handledByFactory(factory, payload)` takes it, `BackgroundJobDefinition` of `@ddd-ts-kit/scheduling` has `payload`, and at run time `@Background()` throws `DeclarationError` and a module `WiringError` (`INVALID_JOB_SETTINGS`) for a class without one. Before each run `QueueWorker` parses the stored payload and hands `run` what the schema answers; a payload it refuses fails the attempt with `InvalidJobPayloadError` (code `INVALID_JOB_PAYLOAD`, its message naming the job, the id of the stored job and the path and code of each issue, `issues` holding them and never the message of the library, which may quote the stored data), and the job is dead at once, no retry: `find` shows `dead` with that code, the log and the metrics carry the code, `reportFailedBackgroundJobs` sends it to the error reporter, and an operator retries it (`retryDead`) once a version that reads it is deployed. `StoredJobQueue` reads the payload with the same schema where it is enqueued: one that does not fit throws `InvalidEnqueuedPayloadError` (`INVALID_ENQUEUED_PAYLOAD`, the path and code of each issue) and nothing is stored. The timeout job of a process uses `processTimeoutDuePayload` of the kernel. `generate background-job` writes the schema in the validation library of the stack (a `z.object` under zod, a class of decorated fields without initial value under class-validator, a `Type.Object` under TypeBox, one refusal per field written by hand under Standard Schema and, with `--validation none`, in the form of the kernel, which refuses a payload that is no object; a field type it writes no check for is let through as `unknown` with a `TODO(domain)`), the type of the payload inferred from it, and its spec enqueues the job as an earlier version declared it (`earlierVersionOf(MyBackgroundJob)`, new in `@ddd-ts-kit/testing`) and shows the job dead. `layer/application-inward` lets a background job, `application/background/*.background-job.ts` and no other file of the layer, import `@ddd-ts-kit/validation` and the validation library of the stack (`stack.validation`), no other, in `ddd-ts-kit check`, the ESLint plugin and the dependency-cruiser file. [Background jobs](docs/concepts/background-jobs.md) says how to evolve a payload: a new field is optional, a new shape is a new job name.
|
|
601
717
|
|
|
602
|
-
To move: three edits. (1) Give each background job class its schema, next to its `jobName`, in the validation library of the project, for example under zod `static readonly payload = zodSchema(z.object({ calendarId: z.string(), appointmentIds: z.array(z.string()), reason: z.string() }));`, the timeout job of a process `static readonly payload = processTimeoutDuePayload;` (from `@ddd-ts-kit/kernel`); a job built by `handledByFactory` passes it as the second argument, a `worker.register({ name, run })` of your own adds `payload`, and where the platform is wired by hand `BackgroundJobClass` of `src/platform/jobs/background-jobs.ts` gains `readonly payload: BackgroundJobPayloadSchema<unknown>;` and `src/platform/jobs/create-background-work.ts` registers `payload: job.payload` (`init --force` writes both). Under class-validator, write the fields without initial value (`declare reason: string;`): a field the stored payload lacks would take the initial value, and pass. Before the deploy, check that the jobs waiting in the queue fit the new schema, or let them run first; a spec that enqueues an unfit payload on purpose goes through `earlierVersionOf` of `@ddd-ts-kit/testing`, since `enqueue` now refuses it. (2) Regenerate the dependency-cruiser file, `npx ddd-ts-kit depcruise-config --write`, so that `npm run depcruise` lets the job import its schema library. (3) Update
|
|
718
|
+
To move: three edits. (1) Give each background job class its schema, next to its `jobName`, in the validation library of the project, for example under zod `static readonly payload = zodSchema(z.object({ calendarId: z.string(), appointmentIds: z.array(z.string()), reason: z.string() }));`, the timeout job of a process `static readonly payload = processTimeoutDuePayload;` (from `@ddd-ts-kit/kernel`); a job built by `handledByFactory` passes it as the second argument, a `worker.register({ name, run })` of your own adds `payload`, and where the platform is wired by hand `BackgroundJobClass` of `src/platform/jobs/background-jobs.ts` gains `readonly payload: BackgroundJobPayloadSchema<unknown>;` and `src/platform/jobs/create-background-work.ts` registers `payload: job.payload` (`init --force` writes both). Under class-validator, write the fields without initial value (`declare reason: string;`): a field the stored payload lacks would take the initial value, and pass. Before the deploy, check that the jobs waiting in the queue fit the new schema, or let them run first; a spec that enqueues an unfit payload on purpose goes through `earlierVersionOf` of `@ddd-ts-kit/testing`, since `enqueue` now refuses it. (2) Regenerate the dependency-cruiser file, `npx ddd-ts-kit depcruise-config --write`, so that `npm run depcruise` lets the job import its schema library. (3) Update `ddd-ts-kit` and `@ddd-ts-kit/eslint-plugin` to this version, and the ddd-ts-kit plugin of your agent (`claude plugin update ddd-ts-kit`), which carry the new text of `layer/application-inward`.
|
|
603
719
|
|
|
604
720
|
## 0.99.0
|
|
605
721
|
|
|
@@ -1500,7 +1616,7 @@ notes and the reasons by `[erased]` and deletes the documents from the file stor
|
|
|
1500
1616
|
fails does not stop the others and running the script again completes the erasure; a run again
|
|
1501
1617
|
once nothing is left is refused and recorded. The README of the example says what an erasure does
|
|
1502
1618
|
not reach: the events published before it, the backups, the opaque ids of the audit trail. The
|
|
1503
|
-
first part of the proposal [privacy by design](
|
|
1619
|
+
first part of the proposal [privacy by design](docs/proposals/privacy-by-design.md) built; the
|
|
1504
1620
|
hand-written steps are the specification of the erasure port the next parts bring to the kit.
|
|
1505
1621
|
|
|
1506
1622
|
**A proposal specifies a second example, spend management on the most popular stack.** `docs/proposals/spend-management-example.md` runs the stack NestJS, class-validator, Jest, Prisma, Kafka, Redis, S3, shared-table tenancy, Keycloak, ABAC, Winston, Scalar through `init --dry-run` and lists what the kit refuses today on it: the queue and the processes on `--di nest`, the shared-table tenancy, the jobs table and the SQL audit trail on Prisma, the identity preset on Nest, Prisma and the explicit style. It specifies those fixes first, then the example (seven bounded contexts on expense reports, corporate cards, approvals, budgets, reimbursements and the ledger), then what the repository gains; MySQL is left out with the list of what it would take. Nothing is built by this change.
|
|
@@ -1523,7 +1639,7 @@ the copies alone are erased, and the report says no key was destroyed. `InMemory
|
|
|
1523
1639
|
`personalDataErasureContract` and `personalDataExportContract` of `@ddd-ts-kit/testing` hold it
|
|
1524
1640
|
and every adapter to the same behaviour. The adapters of the persistence packages, the platform
|
|
1525
1641
|
folder `init` writes and the register come with the next parts of
|
|
1526
|
-
[privacy by design](
|
|
1642
|
+
[privacy by design](docs/proposals/privacy-by-design.md). The persistence skill says it.
|
|
1527
1643
|
|
|
1528
1644
|
**The audit trail masks a personal value under the key of the person it belongs to, so that
|
|
1529
1645
|
erasing the person makes its masks meaningless.** `subjectMasker(keys)` of `@ddd-ts-kit/audit` is
|
|
@@ -1545,7 +1661,7 @@ projection of your own may fill; `AuditedMessage` gains `subjectless`, optional,
|
|
|
1545
1661
|
that name no subject, which `auditedFields` lists and a declaration of your own may leave out;
|
|
1546
1662
|
`AuditMasker` gains `requiresDataSubject`, optional, which a masker keyed per person sets so that
|
|
1547
1663
|
the middleware checks the declarations at wiring time. Nothing existing changes shape or meaning.
|
|
1548
|
-
Part 2 of [privacy by design](
|
|
1664
|
+
Part 2 of [privacy by design](docs/proposals/privacy-by-design.md).
|
|
1549
1665
|
|
|
1550
1666
|
**`init` writes `src/platform/privacy/` with `--privacy on`, the default with an ORM, and wires the
|
|
1551
1667
|
event store with `--event-sourcing on`: a generated project erases and exports a data subject from
|
|
@@ -1601,7 +1717,7 @@ pseudonymise one that does not is refused before any file or row is touched
|
|
|
1601
1717
|
(`NotNullablePersonalColumnError`), so that an erasure never deletes the files of a person and
|
|
1602
1718
|
leaves their rows in clear. The four pass
|
|
1603
1719
|
`personalDataErasureContract` of `@ddd-ts-kit/testing`, on PGlite and PostgreSQL. Part 3 of
|
|
1604
|
-
[privacy by design](
|
|
1720
|
+
[privacy by design](docs/proposals/privacy-by-design.md); the generator writes the declarations
|
|
1605
1721
|
in part 5, and the example adopts the adapter in part 11.
|
|
1606
1722
|
|
|
1607
1723
|
**The background jobs and the process managers run on a platform wired by hand: NestJS and `--di manual` gain `--queue database|redis`, `generate background-job` and `generate process`.** The platform of a project whose contexts are wired in a module file gains `src/platform/jobs/create-background-work.ts`, which builds the queue a use case enqueues through (`platform.jobQueue`), the worker that consumes it (`platform.backgroundJobs`) and the runner of the process managers (`platform.processes`) on the store `stack.queue` names: the jobs table of Knex or Drizzle, the server of the cache with Redis, the memory of the process otherwise, each job traced and its failures reported as on tsyringe. `init --queue database` and `--queue redis` are accepted with every container (the default stays `database` on Knex or Drizzle with tsyringe, `memory` otherwise), the application starts and stops the worker with its jobs, and `generate background-job` and `generate process` register the job in `<context>.module.ts` (`platform.backgroundJobs.register(..)`) with a spec built on the test buses of `@ddd-ts-kit/testing`, where they were refused before. The generated matrix runs background work on every stack, Nest with the jobs in the database and on Redis among them.
|
|
@@ -1646,7 +1762,7 @@ wrapped by tracing and by the aspects, and a helper that answered a query builde
|
|
|
1646
1762
|
chain broken; the helper is a function now, and the Knex spec runs the adapter wrapped the way the
|
|
1647
1763
|
platform binds it. `init --force`, which rewrites `data-subject-copies.ts`, lists the erasure of each
|
|
1648
1764
|
context again, as the port or as the factory of the hand-wired platform. The new concept page
|
|
1649
|
-
[Personal data in a generated project](
|
|
1765
|
+
[Personal data in a generated project](docs/concepts/personal-data.md) draws the erasure end to
|
|
1650
1766
|
end, what stays out of reach and what the tool does not decide, in both languages.
|
|
1651
1767
|
|
|
1652
1768
|
**Mutation testing runs on a project of the kit, with Stryker 10.1.1 and its Vitest runner.** The
|
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:c3ab1cc13ce27ad9 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit
|
|
5
5
|
|
|
@@ -69,7 +69,7 @@ commande et la pile d'appels.
|
|
|
69
69
|
```
|
|
70
70
|
ddd-ts-kit init [--http express|fastify|hono|nest|none]
|
|
71
71
|
[--validation zod|class-validator|typebox|standard-schema|none]
|
|
72
|
-
[--di tsyringe|nest|manual] [--tests vitest|jest]
|
|
72
|
+
[--di tsyringe|inversify|awilix|nest|manual] [--tests vitest|jest]
|
|
73
73
|
[--orm drizzle|knex|prisma|typeorm|custom|none]
|
|
74
74
|
[--database postgres|mysql|sqlite|none]
|
|
75
75
|
[--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]
|
|
@@ -135,7 +135,10 @@ une minute après avoir été pris.
|
|
|
135
135
|
garde la configuration : les contextes et leurs amonts, les règles, les limites, les dérogations
|
|
136
136
|
et toute autre clé restent tels qu'ils sont écrits, et la *stack* ne change que là où une option
|
|
137
137
|
nomme un choix (`init --force --logger pino` change le *logger* ; une combinaison que la *stack*
|
|
138
|
-
enregistrée ne peut pas accepter est refusée comme pour un nouveau projet).
|
|
138
|
+
enregistrée ne peut pas accepter est refusée comme pour un nouveau projet). Les options du
|
|
139
|
+
premier `init` peuvent être passées de nouveau avec `--force` : un *preset* s'applique une seule fois,
|
|
140
|
+
donc `--preset identity` trouve son contexte déjà écrit, le laisse tel que l'équipe l'a, et le dit dans
|
|
141
|
+
une note. La racine de
|
|
139
142
|
composition, la preuve que chaque contexte se câble seul et le registre des permissions sont
|
|
140
143
|
réécrits depuis leurs *templates*, puis les contextes déclarés y sont câblés de nouveau, et l'effacement de chaque contexte est listé de
|
|
141
144
|
nouveau dans les copies du dossier *privacy* ; ce qu'un autre générateur avait ajouté à un fichier de la plateforme (la valeur d'une *gateway*, les
|
|
@@ -176,12 +179,14 @@ kit (des contrôleurs Nest avec `--http nest` sur class-validator, `--routes nes
|
|
|
176
179
|
`jwt`, `rbac`, aucun *broker*, le cache dans le processus, les fichiers dans un répertoire local
|
|
177
180
|
(`--storage local`), le journal d'audit `on` quand il y a un ORM, les demandes d'une personne concernée traitées (`--privacy on`) quand il y a un ORM, pas d'event store (`--event-sourcing off`), les échecs inattendus remontés
|
|
178
181
|
nulle part (`--errors none`), des lignes JSON sur la sortie standard (`--logger stdout`), et le
|
|
179
|
-
style `declared` avec un `barrel` partout où les déclarations sont lues : avec `--di tsyringe
|
|
182
|
+
style `declared` avec un `barrel` partout où les déclarations sont lues : avec `--di tsyringe`,
|
|
183
|
+
`inversify` ou `awilix`, qui génèrent le même code sur un autre conteneur.
|
|
180
184
|
|
|
181
185
|
**Gestionnaire de paquets.** `pnpm` sauf `--package-manager npm` : chaque script, *pipeline*,
|
|
182
186
|
*hook*, le Dockerfile, les consignes et les permissions des agents sont écrits dans le dialecte
|
|
183
187
|
de celui qui est choisi, enregistré sous `stack.packageManager`. pnpm est épinglé dans
|
|
184
|
-
`package.json` et
|
|
188
|
+
`package.json` et installé par npm à cette version (`npm install --global pnpm`, puis pnpm exécute la
|
|
189
|
+
version qu'épingle le projet ; Node 25 et suivants ne livrent plus corepack) ; `pnpm-workspace.yaml` dit qu'aucune dépendance n'exécute
|
|
185
190
|
de script de build sans être autorisée par son nom. Les deux sont prouvés par une installation
|
|
186
191
|
réelle d'un projet généré, son build et son `verify`. Le kit est installé depuis le registre dans
|
|
187
192
|
les deux cas.
|
|
@@ -221,7 +226,7 @@ la racine de composition l'assemble en une ligne. Dans le style `explicit`, chaq
|
|
|
221
226
|
écrite dans le fichier de module du contexte : `builder.bind(Port).toClass(Adapter, [Ports])`,
|
|
222
227
|
`builder.command(Message).requires(...).handledBy(Handler, [Ports])`, `builder.job(name, schedule)`.
|
|
223
228
|
`--style declared` est refusé avec `--di manual` et `--di nest` : les déclarations sont de simples
|
|
224
|
-
métadonnées, et seul `@ddd-ts-kit/di`
|
|
229
|
+
métadonnées, et seul `@ddd-ts-kit/di` les transforme en liaisons.
|
|
225
230
|
`--assembly` dit comment un contexte déclaré rejoint la racine de composition : `barrel` (par
|
|
226
231
|
défaut) est fait de fichiers générés, `<context>.declarations.ts` à la racine du contexte qui
|
|
227
232
|
réexporte les déclarations de chaque couche, statiques, que suivent un bundler, knip et
|
|
@@ -621,9 +626,9 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
|
|
|
621
626
|
| `package.json` | scripts et dépendances de la *stack* (ci-dessous) ; `build` est le compilateur, puis `ddd-ts-kit build-aliases` |
|
|
622
627
|
| `tsconfig.json`, `tsconfig.build.json` | strict, NodeNext, `rootDir` `.` et `outDir` `dist`, et `paths` : l'unique déclaration de l'alias d'import (`@/*` vers `./src/*`, `$test/*`, `$scripts/*`, et `$generated/*` avec Prisma), dérivée de `importAlias` (`--import-alias '$<name>/'`, `@/` par défaut ; `#<name>/` et `@<name>/` sont refusés avec la raison) ; la configuration de build étend l'autre et ne déclare pas de `paths` ; `experimentalDecorators` (et `emitDecoratorMetadata`) seulement pour nest ou class-validator, dont les décorateurs sont de l'ancienne forme (legacy) : les déclarations et les aspects servent les deux modes |
|
|
623
628
|
| `src/main.ts` | racine de composition : le traçage d'abord (la remontée des erreurs en second avec `--errors sentry`), la configuration, la persistance, l'application (`log`, `traceConsumers: config.tracing.consumers`, `resilience`, `jobs: { start: config.runJobs, settings: jobSettings(process.env) }`), le relais de l'outbox, le serveur HTTP ; sur `SIGTERM` ou `SIGINT`, il ferme le serveur, arrête le relais, arrête l'application, ferme la persistance et éteint le traçage |
|
|
624
|
-
| `src/platform/` | un export par fichier, chacun portant son nom, dans un dossier par préoccupation, aucun fichier à sa racine (un projet généré avant les dossiers les garde à plat jusqu'à `npx ddd-ts-kit platform-folders`). `composition/` (`compose-application.ts` et `lay-foundations.ts` dans les deux familles, puis `platform.module.ts` et `platform-test.module.ts` avec tsyringe, `platform.ts`, `platform-options.ts` et `create-platform.ts` câblés à la main) ; `jobs/` (`job-settings.ts`, `jobSettings(environment, context?)` : une ligne par *job*, `JOB_<CONTEXT>_<JOB>_ENABLED=false` en désactive un). `config/` (`app-config.ts` ; `environment.ts`, le lecteur des variables du processus, `env.url('DATABASE_URL')`, `env.integer('PORT', { fallback, min, max })`, `env.flag`, `env.oneOf`, qui garde chaque problème par nom de variable et les signale d'un coup ; `load-config.ts`, `config-error.ts`, `read-tracing.ts` : échec immédiat sur `DATABASE_URL`, `LOG_LEVEL`, `LOG_FORMAT`, `LOG_SCRUB_MESSAGES`, la politique `OUTBOUND_*`, `RUN_JOBS` et les variables de traçage ci-dessous) ; `observability/` (`tracing.ts`, premier import de chaque point d'entrée ; `errors.ts` avec `--errors sentry` ; `create-logger.ts`, voir `--logger` ; `create-metrics.ts` :
|
|
629
|
+
| `src/platform/` | un export par fichier, chacun portant son nom, dans un dossier par préoccupation, aucun fichier à sa racine (un projet généré avant les dossiers les garde à plat jusqu'à `npx ddd-ts-kit platform-folders`). `composition/` (`compose-application.ts` et `lay-foundations.ts` dans les deux familles, puis `platform.module.ts` et `platform-test.module.ts` avec tsyringe, `platform.ts`, `platform-options.ts` et `create-platform.ts` câblés à la main) ; `jobs/` (`job-settings.ts`, `jobSettings(environment, context?)` : une ligne par *job*, `JOB_<CONTEXT>_<JOB>_ENABLED=false` en désactive un). `config/` (`app-config.ts` ; `environment.ts`, le lecteur des variables du processus, `env.url('DATABASE_URL')`, `env.integer('PORT', { fallback, min, max })`, `env.flag`, `env.oneOf`, qui garde chaque problème par nom de variable et les signale d'un coup ; `load-config.ts`, `config-error.ts`, `read-tracing.ts` : échec immédiat sur `DATABASE_URL`, `LOG_LEVEL`, `LOG_FORMAT`, `LOG_SCRUB_MESSAGES`, la politique `OUTBOUND_*`, `RUN_JOBS` et les variables de traçage ci-dessous) ; `observability/` (`tracing.ts`, premier import de chaque point d'entrée ; `errors.ts` avec `--errors sentry` ; `create-logger.ts`, voir `--logger` ; `create-metrics.ts` : `openTelemetryMetrics()` de `@ddd-ts-kit/tracing`, exporté par OTLP avec les traces) ; `resilience/` (`resilience-settings.ts`, `default-resilience-settings.ts`, `default-policy.ts` : nouvelle tentative avec temporisation croissante et délai d'expiration pour `external` et `gateway`, `own-policy.ts` pour un adaptateur qui énonce la sienne, `adapters-with-own-policy.ts`, l'ensemble que la politique par défaut laisse tranquille) ; `events/`, `database/`, `auth/`, `audit/`, `redis/` (ci-dessous) ; `event-sourcing/` et `privacy/` (ci-dessous) ; `http/` (`start-http-server.ts`, `with-documentation.ts` : `/docs` et `/openapi.json`, ou `/openapi/<name>.json` par document d'un contrat découpé, désactivés en production sauf `API_DOCS=true` ; `openapi-documents.ts`, le découpage qu'écrit `ddd-ts-kit docs` depuis `openapi.documents`). Avec `--di tsyringe` : `compose-application.ts` (`composeApplication(persistence, options, contexts?)` : `kernelModule({...})`, le module de la plateforme, le module d'autorisation, les contextes ; installe le moteur des aspects), `lay-foundations.ts` (une portée d'exécution, l'horloge, le générateur d'identifiants, le *logger*, les métriques, l'instrumentation et l'audit, construits avant tout module), `platform.module.ts` (ce qui remplace les valeurs par défaut du kernel dans le processus : unité de travail, magasin des événements traités, la classe de stockage, `OutboxStore`, `EventSubscribers` derrière un *broker*, `ErrorMapper`, et `builder.around(['external', 'gateway'], ...)`, la résilience de chaque adaptateur qui sort du processus), `platform-test.module.ts` (ce qu'une *spec* de gestionnaire liste à côté de son contexte : la classe de stockage liée à une fabrique qui lève une erreur), `buses/create-command-bus.ts` et `create-query-bus.ts` (du plus extérieur au plus intérieur : `errorReportingMiddleware`, `loggingMiddleware`, `metricsMiddleware`, la permission, le *span* du cas d'usage, l'entrée d'audit, puis l'unité de travail d'une commande). Avec `--di manual` ou `nest` : `compose-application.ts`, `platform.ts` (`interface Platform`, avec `jobs: JobScheduler` et `adapter`, qui enveloppe ce qu'un fichier de module instancie), `platform-options.ts`, `lay-foundations.ts` (les mêmes fondations qu'avec tsyringe, le journal des décisions ou les sources d'audit compris), `create-platform.ts` (l'assemblage : les événements du domaine, la garde, les deux bus, les ports d'événements, les fichiers et ce qui enveloppe chaque adaptateur), `buses/create-command-bus.ts` et `create-query-bus.ts` (les mêmes chaînes qu'avec tsyringe, étant donnés la garde et le stockage), `events/platform-events.ts` (le publieur, les abonnés et, derrière Varnish, les purges), `jobs/configured-job-scheduler.ts` (applique `job-settings.ts` à ce qu'un module enregistre) |
|
|
625
630
|
| traçage | câblé une fois, par la plateforme (`tracing/platform-only`) : pas de *hook* `decorate`, pas de `decorate-bindings.ts`. `tracing.ts` démarre `initTracing` de `@ddd-ts-kit/tracing/node` avant tout autre module, sur ce que valide `config/read-tracing.ts` : `OTEL_EXPORTER_OTLP_ENDPOINT` (une URL ; absente, aucun *span* ne sort du processus), `TRACE_SAMPLE_RATIO` (de 0 à 1) et `TRACE_CONSUMERS` (`continue`, par défaut : un événement consommé reste dans la trace de sa publication ; `link` : chaque livraison démarre une trace liée à elle). Avec `--di tsyringe` : `lay-foundations.ts` construit `traceApplication({ consumers })`, `compose-application.ts` la remet à `kernelModule({ instrumentation })` (un *span* par cas d'usage, appel de *repository*, événement du domaine, publication, consommateur et *job*) et donne au relais de l'outbox `tracedPublisher(bus)`. En câblage manuel : `create-platform.ts` applique lui-même les membres de `traceApplication()` (`useCase` sur les deux bus, `domainEvents`, `publisher`, `binding` autour de chaque adaptateur, `job`, `executionScope`, `errorReporter`), avec `tracedSubscriber` et `tracedPublisher` autour du fournisseur. Avec une *stack* HTTP, dans les deux familles, `auth/authentication/http-boundary.ts` pose `around: tracedRoutes()` : un *span* `SERVER` par requête HTTP, nommé d'après sa route |
|
|
626
|
-
| `--logger` | `src/platform/observability/create-logger.ts`, un par choix : `stdout` (par défaut) est le `StdoutLogger` de `@ddd-ts-kit/aspects`, des lignes JSON
|
|
631
|
+
| `--logger` | `src/platform/observability/create-logger.ts`, un par choix : `stdout` (par défaut) est le `StdoutLogger` de `@ddd-ts-kit/aspects`, des lignes JSON ; `pino` est `createPinoLogger` de `@ddd-ts-kit/pino` (dépendances `pino` et `pino-pretty`) ; `winston` est `createWinstonLogger` de `@ddd-ts-kit/winston` ; les trois masquent les clés d'identifiants de connexion du kernel, quelle que soit leur casse. Chaque entrée porte `traceLogFields(scope)` : l'identifiant de corrélation, l'origine, l'acteur et le *tenant* du travail en cours, et les identifiants de la trace active. `LOG_LEVEL`, `LOG_FORMAT` (`json`, par défaut, ou `pretty` ; avec `stdout`, qui n'a pas de format lisible, `pretty` est refusé au chargement de la configuration) et `LOG_SCRUB_MESSAGES` (`[message removed]` à la place du message d'une erreur journalisée qui n'est pas une `DomainError`) sont validés dans `config/load-config.ts`. L'arrêt de l'application vide le tampon du *reporter* d'erreurs, puis celui du *logger*, en dernier : `container.stop()` le fait sur tsyringe, `compose-application.ts` le fait explicitement en câblage manuel. Les outils et les tests composent l'application sans `log` et n'écrivent rien |
|
|
627
632
|
| `src/platform/auth/` | un dossier par question : `authentication/` (qui appelle), `authorization/` (ce qu'il peut faire, quel que soit le modèle) et le dossier du modèle que nomme `stack.authz` (`roles/`, `attributes/`, `relationships/` ou `custom/`). Un projet généré avant les dossiers garde ses fichiers à plat : les générateurs les y lisent, `npx ddd-ts-kit doctor` le signale et `npx ddd-ts-kit platform-folders` les déplace avec chaque import |
|
|
628
633
|
| `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt` : `JwtAuthenticator` sur `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI` ; `--authn keycloak` : `keycloakAuthenticator` sur `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` et l'optionnel `KEYCLOAK_CLIENT_ID` ; `--authn passport` : `passportAuthenticator` de `@ddd-ts-kit/auth/passport` sur `bearer-strategy.ts`, la stratégie de `passport-jwt` sur le jeu de clés que publie `AUTH_JWKS_URI` (`jwks-rsa`), `AUTH_ISSUER` et `AUTH_AUDIENCE`, qui refuse un jeton sans `exp` sauf si on lui donne `requireExpiry: false` et accepte RS256, PS256 et ES256, les `DEFAULT_JWT_ALGORITHMS` de `JwtAuthenticator` sauf EdDSA, que `jsonwebtoken` ne sait pas vérifier (un émetteur qui signe en EdDSA a besoin de `--authn jwt`), et `actor-of-token.ts`, qui lit sa charge utile avec `actorOfClaims` ; `--authn none` : `development-header-authenticator.ts` et `development-actor-header.ts`, qui lisent `x-development-actor` et lèvent une erreur en production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` qui répond une `Session`, `executionScope`, `errorMapper` et `onError`, étalés dans les options de montage : chaque requête HTTP s'exécute dans la portée d'exécution, avec son identifiant de corrélation). Sans *stack* HTTP, il n'y a ni authentificateur ni frontière, ni dossier |
|
|
629
634
|
| `src/platform/auth/authorization/` | `create-authorizer.ts`, `authorization.ts` (`authorizationModule` avec tsyringe) ou `use-case-protection.ts` (la garde des bus câblés à la main), `access-policies.ts`, `role.ts` (les rôles que porte un identifiant, avec des rôles ou des attributs, ou dès qu'une garde en nomme un), `permissions.ts` (le registre de toutes les permissions, avec des relations ou un authorizer à vous), `signed-in-grants.ts` dès qu'un *preset* de contexte accorde à toute personne connectée, et avec `--audit off` `log-decisions.ts` (une entrée de journal par décision, identifiants et codes seulement) |
|
|
@@ -660,7 +665,7 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
|
|
|
660
665
|
| `REVIEW.md` | la politique de revue du projet : les passes d'une revue (bugs, sécurité, conformité face à la revue de conception de la ligne, l'acceptation de la *story*, les enregistrements de `docs/adr/` et les règles), ce qu'Important veut dire, au plus cinq *nits* (un *nit* récurrent devient une ligne de `AGENTS.md` sous `## Mistakes seen here` ou une règle de la configuration), ce qui n'est pas signalé (les fichiers générés, ce que `npm run verify` refuse). Lu par l'agent `architecture-reviewer` par-dessus sa méthode, par un relecteur humain et par tout robot de revue. Écrit une fois, pour que l'équipe le modifie : `--force` le laisse tel quel, `doctor` dit quand il manque |
|
|
661
666
|
| `.github/copilot/settings.json` | le *plugin* du kit, déclaré pour GitHub Copilot (`extraKnownMarketplaces`, `enabledPlugins`) : son agent cloud l'installe, la CLI Copilot et VS Code le recommandent ; un fichier existant garde ce qu'il contient et reçoit les deux entrées |
|
|
662
667
|
| `.claude/hooks/production-gate.mjs`, `.claude/hooks/change-reference.mjs` | avec `--agent-profile regulated` : les deux *hooks* du profil, enregistrés sous `hooks.PreToolUse` de `.claude/settings.json`, écrits une fois pour que l'équipe les modifie (`--force` les réécrit). La porte bloque une commande qui nomme l'environnement de production avec une action de mise en production sauf si `RELEASE_APPROVAL` nomme un approbateur et un changement ; la référence demande avant une modification d'une migration ou des conteneurs, pour le *trailer* `Change: <id>` du *commit* ([Mettre les agents de code en bac à sable](../../docs/guides/agent-sandbox.fr.md#le-profil-réglementé)) |
|
|
663
|
-
| `.claude/settings.json` | des permissions (et, avec `--agent-profile regulated`, le bloc de bac à sable ci-dessous) : les vérifications et les générateurs s'exécutent sans demander, les fichiers `.env` sont illisibles (`.env.example` reste lisible), `generate` et `init` avec `--force`, `git push`, `npm publish` et toute modification des fichiers qui portent les règles et le *pipeline* (`ddd-ts-kit.config.json`, `REVIEW.md`, `eslint.config.mjs`, `biome.json`, `.dependency-cruiser.cjs`, `knip.json`, `lefthook.yml`, `.gitlab-ci.yml`, `.github/workflows/**`, `.claude/settings.json`, `.github/copilot/settings.json`) demandent d'abord, comme une modification des contrats générés et du verrou d'une acceptation (`openapi/**`, `docs/integration/asyncapi.*`, `docs/integration/event-catalog.md`, `test/acceptance/*.acceptance.lock.json` : une règle `ask`, puisque le bac à sable de Claude Code mettrait un chemin refusé en lecture seule pour `docs:generate` et `acceptance --lock` aussi ; la garde du plugin en refuse la modification à la main) et de ce qui atteint la production autrement que par le code : les migrations de l'ORM (`migrations/**` avec drizzle, knex et typeorm, `prisma/migrations/**` avec prisma, rien avec une persistance *custom* ou sans ORM), `Dockerfile`, `docker-compose.yml` et `docker/**`. Le fichier compose lit `.env` à la racine, que la liste de refus couvre déjà ; rien sous `docker/` ne porte de secret |
|
|
668
|
+
| `.claude/settings.json` | des permissions (et, avec `--agent-profile regulated`, le bloc de bac à sable ci-dessous) : les vérifications et les générateurs s'exécutent sans demander, les fichiers `.env` sont illisibles (`.env.example` reste lisible), `generate` et `init` avec `--force`, `git push`, `npm publish` et toute modification des fichiers qui portent les règles et le *pipeline* (`ddd-ts-kit.config.json`, `REVIEW.md`, `eslint.config.mjs`, `biome.json`, `.dependency-cruiser.cjs`, `knip.json`, `lefthook.yml`, `.gitlab-ci.yml`, `.github/workflows/**`, `.claude/settings.json`, `.github/copilot/settings.json`) demandent d'abord, comme une modification des contrats générés et du verrou d'une acceptation (`openapi/**`, `docs/integration/asyncapi.*`, `docs/integration/event-catalog.md`, `test/acceptance/*.acceptance.lock.json` : une règle `ask`, puisque le bac à sable de Claude Code mettrait un chemin refusé en lecture seule pour `docs:generate` et `acceptance --lock` aussi ; la garde du plugin en refuse la modification à la main) et de ce qui atteint la production autrement que par le code : les migrations de l'ORM (`migrations/**` avec drizzle, knex et typeorm, `prisma/migrations/**` avec prisma, rien avec une persistance *custom* ou sans ORM), `Dockerfile`, `docker-compose.yml` et `docker/**`. Le fichier compose lit `.env` à la racine, que la liste de refus couvre déjà ; rien sous `docker/` ne porte de secret. `package.json` n'a pas de règle, car on le modifie pour ses dépendances à longueur de journée : le garde du *plugin* demande quand une modification change ses `scripts`, que les barrières exécutent |
|
|
664
669
|
| `.gitignore` | `node_modules`, `dist`, `coverage`, `.env` et chaque `.env.*` sauf `.env.example` (de même dans `.dockerignore`), `*.tsbuildinfo`, `.ddd-ts-kit/`, où écrit `worker-scope`, et `.worktrees/`, où vivent les *worktrees* |
|
|
665
670
|
|
|
666
671
|
`--ci both` écrit les deux *pipelines*, `--ci none` aucun (et pas de `renovate.json`). Les
|
|
@@ -903,7 +908,9 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
903
908
|
permission sous le rôle `system` de `platform/auth/roles/roles.ts`, le rôle que `createAuthorizer`
|
|
904
909
|
donne à chaque acteur système (`systemRole`) et à nul autre : un jeton d'utilisateur qui nomme
|
|
905
910
|
`system` parmi ses rôles ne le détient pas ; `--authz abac`, une règle
|
|
906
|
-
`permit('system-<job>', [permission], ({ actor }) => actor.id === 'system:<job>')
|
|
911
|
+
`permit('system-<job>', [permission], ({ actor }) => isSystem(actor) && actor.id === 'system:<job>')`,
|
|
912
|
+
`isSystem` du noyau importé, pour qu'un jeton dont le sujet se lit `system:<job>` ne passe pas
|
|
913
|
+
pour le *job*, dans
|
|
907
914
|
`platform/auth/attributes/attribute-policies.ts` ; `--authz rebac`, le tuple
|
|
908
915
|
`context:<context>#operator@system:<job>` dans `platform/auth/relationships/relate-system-actors.ts`,
|
|
909
916
|
écrit dans le magasin de tuples au démarrage de l'application, tant que le schéma laisse encore
|
|
@@ -1041,7 +1048,7 @@ et des blocs `{{#if x}}` / `{{#unless x}}`. Un emplacement inconnu est une erreu
|
|
|
1041
1048
|
## docs
|
|
1042
1049
|
|
|
1043
1050
|
```
|
|
1044
|
-
ddd-ts-kit docs [--check] [--stored-events] [--behaviour]
|
|
1051
|
+
ddd-ts-kit docs [--check] [--dry-run] [--stored-events] [--behaviour]
|
|
1045
1052
|
```
|
|
1046
1053
|
|
|
1047
1054
|
Régénère ce qui dérive de la configuration et du code, et rien d'autre :
|
|
@@ -1095,7 +1102,9 @@ Régénère ce qui dérive de la configuration et du code, et rien d'autre :
|
|
|
1095
1102
|
une version enregistrée : lancez-le une fois que la forme d'une version est définitive.
|
|
1096
1103
|
|
|
1097
1104
|
`--check` n'écrit rien, nomme chaque fichier périmé et chaque version d'événement stocké déclarée
|
|
1098
|
-
qui n'est pas enregistrée dans `stored-events.lock.json`, et sort avec le code 1.
|
|
1105
|
+
qui n'est pas enregistrée dans `stored-events.lock.json`, et sort avec le code 1. `--dry-run`
|
|
1106
|
+
n'écrit rien non plus : il nomme chaque fichier généré qu'il créerait, mettrait à jour ou
|
|
1107
|
+
supprimerait, tel que `docs` l'écrirait. Le catalogue
|
|
1099
1108
|
des événements et le document AsyncAPI ont besoin d'exécuter le code du projet, c'est pourquoi
|
|
1100
1109
|
ils sont produits par `scripts/events.ts` (`npm run events:generate`, qui fait partie de
|
|
1101
1110
|
`npm run docs:generate`).
|
|
@@ -1355,14 +1364,15 @@ dans chaque `CONTEXT.md`.
|
|
|
1355
1364
|
## status, todo
|
|
1356
1365
|
|
|
1357
1366
|
```
|
|
1358
|
-
ddd-ts-kit status [--workers]
|
|
1367
|
+
ddd-ts-kit status [--workers | --ready]
|
|
1359
1368
|
ddd-ts-kit todo [<context>] [--brief]
|
|
1360
1369
|
```
|
|
1361
1370
|
|
|
1362
1371
|
`status` affiche la ligne `Next:` de `docs/architecture/plan.md`, les lignes de
|
|
1363
1372
|
`docs/architecture/slices.md` par statut et par responsable, et par contexte les `TODO(domain)`,
|
|
1364
1373
|
`TODO(platform)` et `it.todo` restants, puis ceux hors des contextes. Un fichier manquant n'est
|
|
1365
|
-
pas une erreur
|
|
1374
|
+
pas une erreur ; un `ddd-ts-kit.config.json` manquant en est une : avant `init`, `status` refuse avec le
|
|
1375
|
+
code 2, nomme `init` et n'imprime aucune demi-réponse. Quand le plan est à l'étape 7 (la construction), la ligne `Next:` est déduite des lignes (la prochaine ligne prête sur le tronc, ou `7 build done` quand toutes sont faites) et la ligne du plan est affichée à côté, `planNext` dans `--json`. Chaque ligne qui n'est pas faite dit si elle peut commencer : prête sur le tronc
|
|
1366
1376
|
quand toutes ses dépendances sont faites, prête sur une branche quand chaque dépendance non faite
|
|
1367
1377
|
est une ligne confiée à un *worker* dont le *worktree* a des *commits* d'avance sur sa base (les
|
|
1368
1378
|
`rows` de son `.ddd-ts-kit/worker.json`, tels que `status --workers` les lit), et en attente
|
|
@@ -1418,7 +1428,7 @@ texte entier.
|
|
|
1418
1428
|
## plan-waves
|
|
1419
1429
|
|
|
1420
1430
|
```
|
|
1421
|
-
ddd-ts-kit plan-waves [<context>]
|
|
1431
|
+
ddd-ts-kit plan-waves [<context>] [--ready]
|
|
1422
1432
|
```
|
|
1423
1433
|
|
|
1424
1434
|
Ordonne les lignes de `docs/architecture/slices.md` qui ne sont pas `done`, pour une construction
|
|
@@ -1812,7 +1822,8 @@ comme `permission hooks.<name>`), puis les *hooks* git. `lefthook.yml` doit port
|
|
|
1812
1822
|
*worktree* son propre lefthook, et fait échouer un *commit*, bruyamment, quand ses dépendances
|
|
1813
1823
|
manquent ; le correctif est cette ligne, ou `init --force` pour le fichier entier. Le *hook*
|
|
1814
1824
|
pre-commit sous `git rev-parse --git-path hooks` doit exister et venir de lefthook ; le correctif
|
|
1815
|
-
est `npm run hooks:install`, une fois par clone.
|
|
1825
|
+
est `npm run hooks:install`, une fois par clone. Hors d'un dépôt git les *hooks* ne peuvent pas être lus : `doctor`
|
|
1826
|
+
signale alors `hook git repository` comme manquant, ce qui fait échouer `--strict`, et `git init` passe d'abord. Puis la consigne écrite une fois pour que
|
|
1816
1827
|
l'équipe la possède : `REVIEW.md`, la politique de revue, et sous le profil réglementé les deux
|
|
1817
1828
|
*hooks* de `.claude/hooks/`, sont signalés manquants (`guidance`) et `init` les écrit de nouveau
|
|
1818
1829
|
sans toucher à rien d'autre.
|
|
@@ -2238,7 +2249,7 @@ next: resolve each hunk, `git add <file>`, then `npx ddd-ts-kit merge-trunk --co
|
|
|
2238
2249
|
```
|
|
2239
2250
|
|
|
2240
2251
|
`--json` affiche le même rapport :
|
|
2241
|
-
`{ status, branch, trunk: { ref, commit }, base: { commit, evidence, landedAs?, unlanded?, notOnTrunk? }, conflicts: { plainMerge, ownDiff, automatic, forYou }, automatic: [{ file, kind, how }], forYou: [{ file, kind, why, hunks, ours: { branch, rows, change }, theirs: { ref, commits, change }, advice }], migrations, regenerate: { status, output? }, lostLines: { errors, warnings, accepted } | null, leftOut, stop?, commit?, next }`,
|
|
2252
|
+
`{ status, branch, trunk: { ref, commit }, base: { commit, evidence, landedAs?, unlanded?, notOnTrunk? }, conflicts: { plainMerge, ownDiff, automatic, forYou }, automatic: [{ file, kind, how }], forYou: [{ file, kind, why, hunks, ours: { branch, rows, change }, theirs: { ref, commits, change }, advice }], migrations, regenerate: { status, output? }, client?: { status, output? }, trunkMoved?: { merged, now }, lostLines: { errors, warnings, accepted } | null, leftOut, stop?, commit?, next }`,
|
|
2242
2253
|
`status` valant `up-to-date`, `dry-run`, `stopped` ou `committed` et `evidence` `option`,
|
|
2243
2254
|
`landed`, `recorded` ou `merge-base`. La garde du *plugin* refuse `--to-land` à un sous-agent :
|
|
2244
2255
|
poser une branche est l'étape du chef d'orchestre, juste avant sa fusion en *squash*.
|
|
@@ -2512,7 +2523,7 @@ règle.
|
|
|
2512
2523
|
| `context/extractable` | un fichier de module qui importe un autre contexte hors de son langage publié ; une persistance qui importe l'infrastructure d'un autre contexte ou nomme son schéma ; un gestionnaire qui importe le *repository* d'un autre contexte ; `export let` ou un `new Map`, `Set`, `WeakMap` exporté au niveau du module ; `deployable: true` sans `apps/<context>/main.ts` ; dans le style déclaré, un fichier de rôle qui importe quoi que ce soit d'un fichier de port d'un autre contexte |
|
|
2513
2524
|
| `governance/recorded-deviation` | un commentaire `ddd-ts-kit-disable` ou `eslint-disable` dont la raison ne nomme aucun `ADR-<number>` avec un fichier `docs/adr/<number>-*.md` ; une règle mise à `off` (ou à `warn` en dessous de sa valeur par défaut), un répertoire supplémentaire, un contexte dont `tenancy` vaut `control-plane`, un *package* autorisé supplémentaire, un `guard` autre que `enforce` ou `stack.events` hors de l'outbox, sans entrée `deviations` `{ what, adr, reason }` qui pointe vers un enregistrement existant |
|
|
2514
2525
|
| `declarations/role-declared` | style déclaré seulement : un fichier de rôle (autre que `*.command.ts` et `*.query.ts`, tenus par `authz/declared` ; `*.job.ts` sous `application/scheduling/` avec `@Scheduled` et `*.publisher.ts` avec `@DomainEventHandler` sont des rôles) qui n'exporte aucune classe portant le décorateur de son suffixe et de son dossier, ou une classe qui en porte une autre ; une classe déclarée dans un fichier qui n'est pas un fichier de rôle ; une option `consumer` ou `name` manquante, vide, une variable, une concaténation ou un template literal avec une substitution ; tout décorateur de déclaration sur une classe sous `domain/` |
|
|
2515
|
-
| `declarations/barrel-current` | style déclaré seulement : avec `stack.assembly: barrel`, un `<layer>.declarations.ts` d'une couche manquant ou qui diffère d'un `export *` par fichier de rôle de la couche trié par chemin, suivi d'un `injected(Class, [Tokens])` par classe de la couche dont le constructeur reçoit quelque chose (lu depuis les signatures, avec leurs imports), un `<context>.declarations.ts` manquant ou qui diffère d'un `export *` par tel fichier trié par chemin, et les déclarations d'une couche qui ne contient plus aucun fichier de rôle ; avec `discovery`, des déclarations générées qui existent encore, et un `<context>.dependencies.ts` qui diffère de ces instructions `injected` (son absence est acceptée tant qu'il n'en contiendrait aucune). Le message nomme le fichier de rôle manquant ou la classe dont la liste est périmée. Un contexte encore déclaré comme l'écrivait une version antérieure, exactement tel que l'écrirait cette version (le fichier unique `<context>.declarations.ts` de 0.84, ou un `<folder>.declarations.ts` par dossier de rôle comme l'écrivaient 0.85 et 0.86), est
|
|
2526
|
+
| `declarations/barrel-current` | style déclaré seulement : avec `stack.assembly: barrel`, un `<layer>.declarations.ts` d'une couche manquant ou qui diffère d'un `export *` par fichier de rôle de la couche trié par chemin, suivi d'un `injected(Class, [Tokens])` par classe de la couche dont le constructeur reçoit quelque chose (lu depuis les signatures, avec leurs imports), un `<context>.declarations.ts` manquant ou qui diffère d'un `export *` par tel fichier trié par chemin, et les déclarations d'une couche qui ne contient plus aucun fichier de rôle ; avec `discovery`, des déclarations générées qui existent encore, et un `<context>.dependencies.ts` qui diffère de ces instructions `injected` (son absence est acceptée tant qu'il n'en contiendrait aucune). Le message nomme le fichier de rôle manquant ou la classe dont la liste est périmée. Un contexte encore déclaré comme l'écrivait une version antérieure, exactement tel que l'écrirait cette version (le fichier unique `<context>.declarations.ts` de 0.84, ou un `<folder>.declarations.ts` par dossier de rôle comme l'écrivaient 0.85 et 0.86), est une erreur, signalée une fois à son résumé (`docs` le déplace, et `docs --check` nomme les fichiers qu'écrirait ce déplacement). Elle a besoin de l'arbre, c'est pourquoi `check-file` ne l'exécute pas |
|
|
2516
2527
|
| `declarations/constructor-injection` | style déclaré seulement, dans un fichier de rôle : sur une classe dont le décorateur ne liste rien, un paramètre de constructeur optionnel, qui a une valeur par défaut, est un paramètre du reste ou est déstructuré, n'a pas de type, ou est typé par autre chose qu'un nom de classe (arguments de type mis à part) : une union, une intersection, un tableau, un nom qualifié, un type du langage, une interface, un alias de type, une enum ou une classe non exportée du fichier ou du fichier du projet d'où elle est importée ; une classe qui hérite son constructeur d'une classe que le projet ne sait pas lire. Sous `stack.dependencies: signature`, un décorateur qui porte une liste alors que le constructeur peut être lu : une liste qui le répète, une qui en diffère |
|
|
2517
2528
|
| `declarations/port-adapter-wired` | une classe de `infrastructure/` qui implémente un port et que rien ne câble : ni `@Repository`, `@Gateway` ou `@Adapter` dans le style déclaré, ni fichier de la racine de composition (`<context>.module.ts`, `main.ts`, `apps/<context>/main.ts`, la plateforme) qui l'importe, une fois que le fichier ne porte plus de `TODO(domain)` ni de `TODO(platform)` ; celle gardée à dessein porte `// ddd-ts-kit-disable-next-line declarations/port-adapter-wired -- ADR-NNNN: <why>` |
|
|
2518
2529
|
| `ports/abstract-class` | dans un fichier de port (`domain/repositories/*.repository.ts`, `application/ports/*.port.ts`) : une classe qui n'est pas `abstract` ; un membre qui n'est pas une méthode ou une propriété abstraite (`static readonly tokenKey = '<text>'` mis à part) : un constructeur, un corps, un initialiseur, un membre `private`, `protected` ou `#` ; une `interface` exportée (un alias `type`, une forme de données, n'est pas signalé) |
|
|
@@ -2701,14 +2712,11 @@ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
|
|
|
2701
2712
|
Ce que lancent `lint` et `ci:lint` d'un projet généré : l'ESLint du projet, par son API, sur les
|
|
2702
2713
|
chemins donnés (le projet sinon), son rapport dans le format demandé (`--format gitlab` écrit le
|
|
2703
2714
|
rapport Code Quality comme le fait `eslint-formatter-gitlab`), `--fix` comme ESLint le prend. Il
|
|
2704
|
-
sort en 1 sur une erreur, et sur un avertissement comme sur une erreur,
|
|
2705
|
-
|
|
2706
|
-
nomme la version où elle devient une erreur. Ceux-là sont affichés dans le rapport et listés
|
|
2707
|
-
après lui, une ligne par règle, sans échouer : une mise à jour du kit ne fait jamais passer au
|
|
2708
|
-
rouge un lint vert. Sans ESLint installé, il sort en 2 et nomme l'installation. Voir
|
|
2715
|
+
sort en 1 sur une erreur, et sur un avertissement comme sur une erreur, une règle nouvelle dans
|
|
2716
|
+
cette version comprise. Sans ESLint installé, il sort en 2 et nomme l'installation. Voir
|
|
2709
2717
|
[Base de qualité](../../docs/tools/quality-baseline.fr.md#un-avertissement-fait-échouer-le-lint).
|
|
2710
2718
|
Avec `--json`, ESLint rapporte dans son format JSON et la commande répond, sur une ligne,
|
|
2711
|
-
`{ errors, warnings,
|
|
2719
|
+
`{ errors, warnings, report }` (`report` est le rapport JSON d'ESLint), avec le même
|
|
2712
2720
|
code de sortie et rien sur stderr.
|
|
2713
2721
|
|
|
2714
2722
|
La commande linte avec le cache d'ESLint, indexé par le contenu de chaque fichier
|
|
@@ -2757,7 +2765,7 @@ conteneur :
|
|
|
2757
2765
|
- `typecheck.spec.ts` : les 36 d'entre elles que le *workspace* sait compiler (jest, prisma et
|
|
2758
2766
|
typeorm à part) passent la vérification de types contre les sources des *packages* du
|
|
2759
2767
|
*workspace*.
|
|
2760
|
-
- `proven-stacks.spec.ts` : les
|
|
2768
|
+
- `proven-stacks.spec.ts` : les projets de `PROVEN` sont installés comme le serait un kit
|
|
2761
2769
|
publié et tenus à tout ce qu'exécute leur propre *pipeline* : `check` avec zéro violation et
|
|
2762
2770
|
zéro avertissement, ESLint avec le preset (le test lit d'abord dans `eslint --print-config` que
|
|
2763
2771
|
les règles des ports, de la planification, de la forme des fichiers et de la disposition sont
|