ddd-ts-kit 0.103.0 → 0.105.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 +110 -6
- package/README.fr.md +29 -18
- package/README.md +28 -16
- 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/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +14 -1
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.js +1 -1
- package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
- package/dist/check/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +24 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/check-file-command.d.ts.map +1 -1
- package/dist/check/commands/check-file-command.js +3 -0
- package/dist/check/commands/check-file-command.js.map +1 -1
- package/dist/check/commands/explain-command.d.ts.map +1 -1
- package/dist/check/commands/explain-command.js +8 -21
- package/dist/check/commands/explain-command.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/delegated-doc.d.ts +4 -0
- package/dist/check/explain/delegated-doc.d.ts.map +1 -0
- package/dist/check/explain/delegated-doc.js +11 -0
- package/dist/check/explain/delegated-doc.js.map +1 -0
- package/dist/check/explain/delegated-docs.d.ts +8 -0
- package/dist/check/explain/delegated-docs.d.ts.map +1 -0
- package/dist/check/explain/delegated-docs.js +292 -0
- package/dist/check/explain/delegated-docs.js.map +1 -0
- 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/layer-docs.d.ts.map +1 -1
- package/dist/check/explain/layer-docs.js +6 -4
- package/dist/check/explain/layer-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/ports-docs.js +1 -1
- package/dist/check/explain/ports-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/tree-docs.js +2 -2
- package/dist/check/explain/tree-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/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +4 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/layer-entry-fixtures.d.ts +4 -0
- package/dist/check/fixtures/layer-entry-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/layer-entry-fixtures.js +35 -0
- package/dist/check/fixtures/layer-entry-fixtures.js.map +1 -0
- package/dist/check/fixtures/layer-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/layer-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/fixtures/other-language-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/other-language-fixtures.js +1 -1
- package/dist/check/fixtures/other-language-fixtures.js.map +1 -1
- package/dist/check/fixtures/ports-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/ports-fixtures.js +1 -0
- package/dist/check/fixtures/ports-fixtures.js.map +1 -1
- package/dist/check/fixtures/purity-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/purity-fixtures.js +18 -0
- package/dist/check/fixtures/purity-fixtures.js.map +1 -1
- package/dist/check/fixtures/role-folder-fixtures.d.ts +4 -0
- package/dist/check/fixtures/role-folder-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/role-folder-fixtures.js +31 -0
- package/dist/check/fixtures/role-folder-fixtures.js.map +1 -0
- package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/test-fixtures.js +9 -0
- package/dist/check/fixtures/test-fixtures.js.map +1 -1
- package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tree-fixtures.js +0 -1
- package/dist/check/fixtures/tree-fixtures.js.map +1 -1
- package/dist/check/layers/outer-entry.d.ts +13 -0
- package/dist/check/layers/outer-entry.d.ts.map +1 -0
- package/dist/check/layers/outer-entry.js +29 -0
- package/dist/check/layers/outer-entry.js.map +1 -0
- package/dist/check/rules/clean-braces.js +1 -1
- package/dist/check/rules/clean-braces.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/layer-application-inward.d.ts.map +1 -1
- package/dist/check/rules/layer-application-inward.js +3 -1
- package/dist/check/rules/layer-application-inward.js.map +1 -1
- package/dist/check/rules/layer-domain-purity.d.ts.map +1 -1
- package/dist/check/rules/layer-domain-purity.js +3 -1
- package/dist/check/rules/layer-domain-purity.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/naming-suffix.js +7 -1
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/rules/ports-abstract-class.d.ts.map +1 -1
- package/dist/check/rules/ports-abstract-class.js +16 -2
- package/dist/check/rules/ports-abstract-class.js.map +1 -1
- package/dist/check/rules/purity-no-ambient-randomness.d.ts.map +1 -1
- package/dist/check/rules/purity-no-ambient-randomness.js +4 -0
- package/dist/check/rules/purity-no-ambient-randomness.js.map +1 -1
- package/dist/check/rules/purity-no-environment.d.ts.map +1 -1
- package/dist/check/rules/purity-no-environment.js +5 -0
- package/dist/check/rules/purity-no-environment.js.map +1 -1
- package/dist/check/rules/purity-no-system-clock.d.ts.map +1 -1
- package/dist/check/rules/purity-no-system-clock.js +4 -0
- package/dist/check/rules/purity-no-system-clock.js.map +1 -1
- package/dist/check/rules/test-no-mocks.d.ts.map +1 -1
- package/dist/check/rules/test-no-mocks.js +16 -6
- package/dist/check/rules/test-no-mocks.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/affected.d.ts.map +1 -1
- package/dist/commands/affected.js +5 -4
- package/dist/commands/affected.js.map +1 -1
- package/dist/commands/cited.d.ts.map +1 -1
- package/dist/commands/cited.js +2 -1
- package/dist/commands/cited.js.map +1 -1
- package/dist/commands/depcruise-config.d.ts.map +1 -1
- package/dist/commands/depcruise-config.js +10 -7
- package/dist/commands/depcruise-config.js.map +1 -1
- package/dist/commands/digest.d.ts.map +1 -1
- package/dist/commands/digest.js +2 -1
- package/dist/commands/digest.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/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +9 -2
- package/dist/commands/drizzle-generate.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/knex-generate.d.ts.map +1 -1
- package/dist/commands/knex-generate.js +8 -2
- package/dist/commands/knex-generate.js.map +1 -1
- package/dist/commands/lint.d.ts +2 -2
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +26 -5
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mutation.d.ts.map +1 -1
- package/dist/commands/mutation.js +3 -2
- package/dist/commands/mutation.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 +8 -4
- 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/prisma-generate.d.ts.map +1 -1
- package/dist/commands/prisma-generate.js +5 -4
- package/dist/commands/prisma-generate.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/commands/typeorm-generate.d.ts.map +1 -1
- package/dist/commands/typeorm-generate.js +19 -16
- package/dist/commands/typeorm-generate.js.map +1 -1
- package/dist/commands/verify-slice.d.ts.map +1 -1
- package/dist/commands/verify-slice.js +3 -2
- package/dist/commands/verify-slice.js.map +1 -1
- package/dist/commit/resolved-trunk.d.ts +3 -0
- package/dist/commit/resolved-trunk.d.ts.map +1 -0
- package/dist/commit/resolved-trunk.js +7 -0
- package/dist/commit/resolved-trunk.js.map +1 -0
- package/dist/commit/trunk-example.d.ts +3 -0
- package/dist/commit/trunk-example.d.ts.map +1 -0
- package/dist/commit/trunk-example.js +6 -0
- package/dist/commit/trunk-example.js.map +1 -0
- 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/describe/context-description.d.ts +2 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/describe-context.d.ts.map +1 -1
- package/dist/describe/describe-context.js +6 -0
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/describe/format-description.js +1 -1
- package/dist/describe/format-description.js.map +1 -1
- package/dist/digest/branch-points.d.ts.map +1 -1
- package/dist/digest/branch-points.js +3 -2
- package/dist/digest/branch-points.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/generate/errors/refuse-taken-class-name.d.ts +9 -0
- package/dist/generate/errors/refuse-taken-class-name.d.ts.map +1 -0
- package/dist/generate/errors/refuse-taken-class-name.js +22 -0
- package/dist/generate/errors/refuse-taken-class-name.js.map +1 -0
- package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
- package/dist/generate/errors/write-named-refusal.js +2 -0
- package/dist/generate/errors/write-named-refusal.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/generate-context.js +1 -0
- package/dist/generate/kinds/generate-context.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/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 +3 -3
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +6 -2
- package/dist/init/run-init.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/measures/format-measures.js +1 -1
- package/dist/measures/format-measures.js.map +1 -1
- package/dist/measures/measures-view.d.ts +1 -1
- package/dist/measures/measures-view.d.ts.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/migration/answered-as-json.d.ts +13 -0
- package/dist/migration/answered-as-json.d.ts.map +1 -0
- package/dist/migration/answered-as-json.js +38 -0
- package/dist/migration/answered-as-json.js.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -1
- package/dist/migration/audit-guard/run-orm-tool.js +2 -1
- package/dist/migration/audit-guard/run-orm-tool.js.map +1 -1
- package/dist/migration/index.d.ts +1 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +1 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/knex-schema-difference.d.ts.map +1 -1
- package/dist/migration/knex-schema-difference.js +2 -1
- package/dist/migration/knex-schema-difference.js.map +1 -1
- package/dist/migration/run-on-in-process-database.d.ts.map +1 -1
- package/dist/migration/run-on-in-process-database.js +2 -1
- package/dist/migration/run-on-in-process-database.js.map +1 -1
- package/dist/migration/tool-stdio.d.ts +6 -0
- package/dist/migration/tool-stdio.d.ts.map +1 -0
- package/dist/migration/tool-stdio.js +17 -0
- package/dist/migration/tool-stdio.js.map +1 -0
- 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/plan/batched-waves.d.ts +2 -0
- package/dist/plan/batched-waves.d.ts.map +1 -1
- package/dist/plan/batched-waves.js +6 -4
- package/dist/plan/batched-waves.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/plan-problems.d.ts +5 -0
- package/dist/plan/plan-problems.d.ts.map +1 -1
- package/dist/plan/plan-problems.js +6 -1
- package/dist/plan/plan-problems.js.map +1 -1
- package/dist/plan/plan-waves.d.ts +2 -0
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +1 -1
- package/dist/plan/plan-waves.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/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/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/stories/open-story-scope.d.ts.map +1 -1
- package/dist/stories/open-story-scope.js +2 -1
- package/dist/stories/open-story-scope.js.map +1 -1
- package/dist/stories/origin-of.d.ts.map +1 -1
- package/dist/stories/origin-of.js +14 -2
- package/dist/stories/origin-of.js.map +1 -1
- package/dist/stories/origin-phase.js +4 -4
- package/dist/stories/origin-phase.js.map +1 -1
- package/dist/stories/read-story-phases.js +8 -4
- package/dist/stories/read-story-phases.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/base-of.d.ts.map +1 -1
- package/dist/worker/base-of.js +2 -2
- package/dist/worker/base-of.js.map +1 -1
- package/dist/worker/briefing-of.js +2 -2
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/worker/open-worker-scope.js +1 -1
- package/dist/worker/open-worker-scope.js.map +1 -1
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +2 -1
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +5 -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/background-job/background-job.spec.buses.ts.tpl +19 -3
- package/templates/background-job/background-job.spec.tsyringe.ts.tpl +42 -12
- package/templates/controller/guard.spec.ts.tpl +4 -4
- package/templates/domain-service/domain-service.spec.ts.tpl +2 -2
- 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/pipeline/lefthook.yml +4 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/vitest.config.ts.tpl +2 -0
- package/templates/process/timeout-job.spec.buses.ts.tpl +15 -2
- package/templates/process/timeout-job.spec.tsyringe.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/value-object/value-object.spec.ts.tpl +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,110 @@ 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.105.0
|
|
8
|
+
|
|
9
|
+
**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.
|
|
10
|
+
|
|
11
|
+
**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.
|
|
12
|
+
|
|
13
|
+
**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.
|
|
14
|
+
|
|
15
|
+
**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.
|
|
16
|
+
|
|
17
|
+
**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.
|
|
18
|
+
|
|
19
|
+
**`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.
|
|
20
|
+
|
|
21
|
+
**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`.
|
|
22
|
+
|
|
23
|
+
**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.
|
|
24
|
+
|
|
25
|
+
**`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.
|
|
26
|
+
|
|
27
|
+
**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.
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
**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.
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
**`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.
|
|
36
|
+
|
|
37
|
+
**`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`.
|
|
38
|
+
|
|
39
|
+
**`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.
|
|
40
|
+
|
|
41
|
+
**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.
|
|
42
|
+
|
|
43
|
+
**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.
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
**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.
|
|
48
|
+
|
|
49
|
+
**`--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.
|
|
50
|
+
|
|
51
|
+
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)`.
|
|
52
|
+
|
|
53
|
+
**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.
|
|
54
|
+
|
|
55
|
+
To move: nothing to do; a project already generated keeps the paragraphs until it runs `init --force`.
|
|
56
|
+
|
|
57
|
+
**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.
|
|
58
|
+
|
|
59
|
+
**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.
|
|
60
|
+
|
|
61
|
+
To move: in `vitest.config.ts`, add `isolate: false` to the `test` of `UNIT_PROJECT`, or run `init --force`.
|
|
62
|
+
|
|
63
|
+
## 0.104.0
|
|
64
|
+
|
|
65
|
+
**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.
|
|
66
|
+
|
|
67
|
+
To move: import each file of a role folder by its own path and delete its `index.ts`; write a `.js` file of a context in TypeScript, or delete it if a build wrote it; declare each port as `export abstract class` with abstract members.
|
|
68
|
+
|
|
69
|
+
**`layer/application-inward` and `layer/domain-purity` read the entry imported, not only its package.** An allow-list that names `@ddd-ts-kit/auth` or `@ddd-ts-kit/kernel` let every entry of the package through, so a handler could import `@ddd-ts-kit/auth/passport` or `/jwt` and an aggregate the test doubles of `@ddd-ts-kit/kernel/testing` with no report from `ddd-ts-kit check` or ESLint. The entries of the kit that hold an adapter, the wiring of a container or test doubles (`@ddd-ts-kit/auth/jwt`, `/passport`, `/rebac`, `/di`, `/testing`, `@ddd-ts-kit/kernel/testing`) are now reported in `domain/` and `application/`, unless the allow-list names that entry itself.
|
|
70
|
+
|
|
71
|
+
To move: move the import to `infrastructure/` or `src/platform` (an adapter, the wiring) or to a test (a test double); or name the entry in `domainAllowedPackages` or `applicationAllowedPackages`, with its deviation recorded.
|
|
72
|
+
|
|
73
|
+
**ESLint reads `<module>/<module>.module.ts` as a module file, as `ddd-ts-kit check` does.** The module file of a module of the model was read as a file at the root of its context: `clean/function-size` reported its `register` past 30 lines, which a generated project with a large module failed on in its own lint, and `events/consumer-idempotent` did not see a bare `subscribe` there. Every rule of the plugin now reads it as the module file of the context.
|
|
74
|
+
|
|
75
|
+
**`ddd-ts-kit explain` gives a reason and both examples for every rule, the ones ESLint or the formatter decides included.** The 19 rules of `@ddd-ts-kit/eslint-plugin` that `ddd-ts-kit check` does not judge, `domain/no-generic-error` among them, and `clean/formatted`, which Biome decides, printed their description and the tool that checks them, and nothing else. They now print why the rule exists, a bad and a good example, then the tool that checks them; under `--json` they carry `why`, `bad` and `good` beside `checkedBy`.
|
|
76
|
+
|
|
77
|
+
**`domain/no-generic-error` names the step of the form of the project, and `generate error` refuses a refusal named after another class of the context.** Under `"stack.refusals": "named"`, which `init` writes, the message sent to `generate error <context> <Concept> <refusal>`, the step of `factories`, which the named form refuses; it now says `generate error <context> <Refusal> for<Subject>`. `generate error billing Invoice forOverdue` wrote a refusal class `Invoice` beside the aggregate `Invoice`; it now stops and asks for a name of what is refused.
|
|
78
|
+
|
|
79
|
+
**`domain/no-generic-error`, the `purity/*` rules, `test/no-mocks` and `test/no-only-no-skip` read the obvious variants of what they forbid.** `throw new TypeError(..)` and the other errors of the language, and an error thrown through a `const` (`const failure = new Error(..); throw failure;`), are reported by `domain/no-generic-error`; `const { env } = process`, `const { now } = Date` and `const { random } = Math` by the `purity/*` rules, in ESLint and in `ddd-ts-kit check`, and a `const` alias of the global (`const clock = Date; clock.now()`) in ESLint; `vi`, `jest` and `it` under an import alias (`import { vi as mocks, it as scenario } from 'vitest'`) by `test/no-mocks` and `test/no-only-no-skip`, and by every rule of the plugin that reads a test.
|
|
80
|
+
|
|
81
|
+
To move: throw a refusal of the context where a `TypeError` or a `RangeError` was thrown in `domain/` or `application/`; take what a destructuring read from `process`, `Date`, `Math` or `crypto` from a port (`Clock`, `IdGenerator`, a configuration value); replace the mocks and the `.only` or `.skip` an alias hid, as for the runner under its own name.
|
|
82
|
+
|
|
83
|
+
**`describe` names the lines of `CONTEXT.md` that people write, and a worker reads no more.** Its `language:` line reads `src/contexts/<context>/CONTEXT.md:1-76 (4 terms)`, and `describe --json` carries `docHead`, the last of those lines. The briefing of `worker-scope`, the `context-builder` agent and the `use-case` skill read `CONTEXT.md` above its generated `## Reference`, then `describe` once, instead of reading the same facts twice.
|
|
84
|
+
|
|
85
|
+
**`plan-waves` orders a row whose Context is `platform` (the work of `src/platform/`) or `all` (a slice across every context).** Both names are accepted without a declared context and refused as the name of a context by `generate context` and `init --context`, the `plan-slices` skill documents them, and no worker brief is written for such a row: the conductor owns it. The slices of the scheduling example (M1.10, M1.38, M1.39) are planned again.
|
|
86
|
+
|
|
87
|
+
**The session preamble names `pnpm exec ddd-ts-kit` on a pnpm project, not `npx ddd-ts-kit`.** The commands it suggests are the ones `AGENTS.md` documents and the allow list of `.claude/settings.json` permits, so none asks for a permission. An npm project keeps `npx`.
|
|
88
|
+
|
|
89
|
+
**`story` no longer prints `met` beside an open box for a story with no specification, and `measures` no longer says "Measures of none".** The acceptance phases say `not evaluated: no specification`, and a repository with no branch to read is titled `Measures of the repository (no branch)`.
|
|
90
|
+
|
|
91
|
+
**`story` no longer ticks "origin recorded" and "report" on the untouched template.** A `From:` or `Built with:` line, or the `npm run verify` line of `### Verification`, that still holds a `<placeholder>` is not written, and the close gate stays shut until the story skill fills it.
|
|
92
|
+
|
|
93
|
+
**`story-scope --from` refuses an intent whose status is `draft` even when the comment of the template says `Status: accepted`.** The gate reads the status line of the intent, no longer the comment copied from `intent-template.md`.
|
|
94
|
+
|
|
95
|
+
**The `use-case` skill names the command that prints the spec titles of a slice.** Before the pull request it reads `npx ddd-ts-kit digest --base <trunk>`, which lists the titles under `New spec titles`, instead of asking for a section of the behaviour page with no way to read one.
|
|
96
|
+
|
|
97
|
+
**The briefing of `worker-scope` asks a worker for `describe <context>` as text and for the `todos` each generator prints.** It named `describe --json`, which says the same in more size, and a `next` place that no generator prints. It now says what the `parallel-work` briefing template says.
|
|
98
|
+
|
|
99
|
+
**`check` and `check-file` refuse a path that exists nowhere, and `check` a folder that holds no TypeScript file to read.** A mistyped or moved path used to read as "0 errors" with exit 0, which the skills take as the proof that a file is clean; it is now an error naming the path, with exit 2. `check-file --content-from` still accepts a path that is not written yet. `lint` of a pattern that matches no file already answered with one sentence and no stack.
|
|
100
|
+
|
|
101
|
+
To move: a hook or a script that called `check-file` on a path that may not exist yet passes the text with `--content-from`.
|
|
102
|
+
|
|
103
|
+
**A checkout with CRLF line ends passes `check` and `docs --check` on code nobody edited.** Under `core.autocrlf=true` (Git for Windows, WSL 2 clones) `clean/braces` reported every multi-line body and `docs --check` listed every generated page as stale, with nothing to commit after `ddd-ts-kit docs`. Files are now read with any line end, and a file the kit writes again is written with LF, as before. `init` writes no `.gitattributes` and `doctor` does not ask for one: reading with any line end covers the gates.
|
|
104
|
+
|
|
105
|
+
**`--json` now holds on `lint`, `drizzle-generate`, `knex-generate`, `prisma-generate`, `typeorm-generate` and `depcruise-config`, as `--help` says of every command.** `lint --json` answers `{ errors, warnings, inTransition, report }` on one line, `report` being the JSON report of ESLint; the four `*-generate` commands answer `{ code, written, messages }` and send the output of the ORM tool to stderr; `depcruise-config --json` answers `{ file, config }` (and `{ file, written }` with `--write`). A spec holds every command of the table to one line of JSON.
|
|
106
|
+
|
|
107
|
+
**`cited`, `digest`, `verify-slice`, `mutation`, `affected` and `story-scope` give `origin/main` as the example of a ref only where it resolves.** In a repository with no remote their refusals now say `<branch, tag or commit>`, as `plan-waves` and `worker-scope` do, instead of a ref the next command would refuse.
|
|
108
|
+
|
|
109
|
+
**`plan-waves` prints `--base origin/main` only when that ref resolves.** In a repository with no remote (before its first push) the briefs it prints left out a base that `worker-scope` refused, and the refusal repeated it as its example. The briefs now carry no `--base` there (`worker-scope` cuts from the current branch), and the refusals of `worker-scope` say `--base <branch, tag or commit>`.
|
|
110
|
+
|
|
7
111
|
## 0.103.0
|
|
8
112
|
|
|
9
113
|
**A `merge-trunk` stopped half way can be continued with `merge-trunk --continue`.** The state of the merge is written as soon as the merge starts and after each step, not only at the first stop for a person, so a merge killed on the automatic path no longer needs a plain `git commit`, which skips the steps merge-trunk runs (regenerate, the migrations replay). A merge in progress that holds no state is now refused with `npx ddd-ts-kit merge-trunk --abort` named first.
|
|
@@ -551,7 +655,7 @@ To move: an aggregate generated before keeps its `registeredAt` and its `registe
|
|
|
551
655
|
|
|
552
656
|
**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.
|
|
553
657
|
|
|
554
|
-
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
|
|
658
|
+
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`.
|
|
555
659
|
|
|
556
660
|
## 0.99.0
|
|
557
661
|
|
|
@@ -1452,7 +1556,7 @@ notes and the reasons by `[erased]` and deletes the documents from the file stor
|
|
|
1452
1556
|
fails does not stop the others and running the script again completes the erasure; a run again
|
|
1453
1557
|
once nothing is left is refused and recorded. The README of the example says what an erasure does
|
|
1454
1558
|
not reach: the events published before it, the backups, the opaque ids of the audit trail. The
|
|
1455
|
-
first part of the proposal [privacy by design](
|
|
1559
|
+
first part of the proposal [privacy by design](docs/proposals/privacy-by-design.md) built; the
|
|
1456
1560
|
hand-written steps are the specification of the erasure port the next parts bring to the kit.
|
|
1457
1561
|
|
|
1458
1562
|
**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.
|
|
@@ -1475,7 +1579,7 @@ the copies alone are erased, and the report says no key was destroyed. `InMemory
|
|
|
1475
1579
|
`personalDataErasureContract` and `personalDataExportContract` of `@ddd-ts-kit/testing` hold it
|
|
1476
1580
|
and every adapter to the same behaviour. The adapters of the persistence packages, the platform
|
|
1477
1581
|
folder `init` writes and the register come with the next parts of
|
|
1478
|
-
[privacy by design](
|
|
1582
|
+
[privacy by design](docs/proposals/privacy-by-design.md). The persistence skill says it.
|
|
1479
1583
|
|
|
1480
1584
|
**The audit trail masks a personal value under the key of the person it belongs to, so that
|
|
1481
1585
|
erasing the person makes its masks meaningless.** `subjectMasker(keys)` of `@ddd-ts-kit/audit` is
|
|
@@ -1497,7 +1601,7 @@ projection of your own may fill; `AuditedMessage` gains `subjectless`, optional,
|
|
|
1497
1601
|
that name no subject, which `auditedFields` lists and a declaration of your own may leave out;
|
|
1498
1602
|
`AuditMasker` gains `requiresDataSubject`, optional, which a masker keyed per person sets so that
|
|
1499
1603
|
the middleware checks the declarations at wiring time. Nothing existing changes shape or meaning.
|
|
1500
|
-
Part 2 of [privacy by design](
|
|
1604
|
+
Part 2 of [privacy by design](docs/proposals/privacy-by-design.md).
|
|
1501
1605
|
|
|
1502
1606
|
**`init` writes `src/platform/privacy/` with `--privacy on`, the default with an ORM, and wires the
|
|
1503
1607
|
event store with `--event-sourcing on`: a generated project erases and exports a data subject from
|
|
@@ -1553,7 +1657,7 @@ pseudonymise one that does not is refused before any file or row is touched
|
|
|
1553
1657
|
(`NotNullablePersonalColumnError`), so that an erasure never deletes the files of a person and
|
|
1554
1658
|
leaves their rows in clear. The four pass
|
|
1555
1659
|
`personalDataErasureContract` of `@ddd-ts-kit/testing`, on PGlite and PostgreSQL. Part 3 of
|
|
1556
|
-
[privacy by design](
|
|
1660
|
+
[privacy by design](docs/proposals/privacy-by-design.md); the generator writes the declarations
|
|
1557
1661
|
in part 5, and the example adopts the adapter in part 11.
|
|
1558
1662
|
|
|
1559
1663
|
**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.
|
|
@@ -1598,7 +1702,7 @@ wrapped by tracing and by the aspects, and a helper that answered a query builde
|
|
|
1598
1702
|
chain broken; the helper is a function now, and the Knex spec runs the adapter wrapped the way the
|
|
1599
1703
|
platform binds it. `init --force`, which rewrites `data-subject-copies.ts`, lists the erasure of each
|
|
1600
1704
|
context again, as the port or as the factory of the hand-wired platform. The new concept page
|
|
1601
|
-
[Personal data in a generated project](
|
|
1705
|
+
[Personal data in a generated project](docs/concepts/personal-data.md) draws the erasure end to
|
|
1602
1706
|
end, what stays out of reach and what the tool does not decide, in both languages.
|
|
1603
1707
|
|
|
1604
1708
|
**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:139a01ecf343c2e2 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit
|
|
5
5
|
|
|
@@ -720,7 +720,9 @@ toute la base : typecheck, lint, `format:check`, `test:coverage`, tests de bout
|
|
|
720
720
|
commençant par une lettre ou un chiffre (`npm run db:generate add-invoices`, sous TypeORM
|
|
721
721
|
`migrations/add-invoices`) : `drizzle-generate`, `knex-generate`, `prisma-generate` et
|
|
722
722
|
`typeorm-generate` refusent tout autre nom avant que l'ORM ne le lise, puisqu'une valeur qui commence par un tiret serait l'une
|
|
723
|
-
de ses options ; `typeorm-generate` refuse aussi un dossier hors du projet.
|
|
723
|
+
de ses options ; `typeorm-generate` refuse aussi un dossier hors du projet. Avec `--json`, elles répondent
|
|
724
|
+
`{ code, written, messages }` sur une ligne : le code de sortie, les fichiers du dossier de migrations
|
|
725
|
+
nouveaux ou modifiés, et ce que la commande a dit ; la sortie de l'outil de l'ORM va sur stderr.
|
|
724
726
|
|
|
725
727
|
`package.json` porte deux compilateurs : `typescript ~6.0.3`, que les outils chargent comme une
|
|
726
728
|
bibliothèque, et `@typescript/native` (`npm:typescript@~7.0.2`), que `build` et `typecheck`
|
|
@@ -1039,7 +1041,7 @@ et des blocs `{{#if x}}` / `{{#unless x}}`. Un emplacement inconnu est une erreu
|
|
|
1039
1041
|
## docs
|
|
1040
1042
|
|
|
1041
1043
|
```
|
|
1042
|
-
ddd-ts-kit docs [--check] [--stored-events] [--behaviour]
|
|
1044
|
+
ddd-ts-kit docs [--check] [--dry-run] [--stored-events] [--behaviour]
|
|
1043
1045
|
```
|
|
1044
1046
|
|
|
1045
1047
|
Régénère ce qui dérive de la configuration et du code, et rien d'autre :
|
|
@@ -1093,7 +1095,9 @@ Régénère ce qui dérive de la configuration et du code, et rien d'autre :
|
|
|
1093
1095
|
une version enregistrée : lancez-le une fois que la forme d'une version est définitive.
|
|
1094
1096
|
|
|
1095
1097
|
`--check` n'écrit rien, nomme chaque fichier périmé et chaque version d'événement stocké déclarée
|
|
1096
|
-
qui n'est pas enregistrée dans `stored-events.lock.json`, et sort avec le code 1.
|
|
1098
|
+
qui n'est pas enregistrée dans `stored-events.lock.json`, et sort avec le code 1. `--dry-run`
|
|
1099
|
+
n'écrit rien non plus : il nomme chaque fichier généré qu'il créerait, mettrait à jour ou
|
|
1100
|
+
supprimerait, tel que `docs` l'écrirait. Le catalogue
|
|
1097
1101
|
des événements et le document AsyncAPI ont besoin d'exécuter le code du projet, c'est pourquoi
|
|
1098
1102
|
ils sont produits par `scripts/events.ts` (`npm run events:generate`, qui fait partie de
|
|
1099
1103
|
`npm run docs:generate`).
|
|
@@ -1130,7 +1134,8 @@ Affiche la configuration de dependency-cruiser dérivée de `ddd-ts-kit.config.j
|
|
|
1130
1134
|
langages publiés, amonts déclarés, *packages* autorisés, cycles et orphelins. `--write` la
|
|
1131
1135
|
sauvegarde sous `.dependency-cruiser.cjs` ; `--check` sort avec le code 1 quand le fichier
|
|
1132
1136
|
manque ou est périmé, ce que `npm run depcruise` exécute en premier. Modifiez la configuration,
|
|
1133
|
-
pas le fichier.
|
|
1137
|
+
pas le fichier. Avec `--json`, l'affichage est `{ file, config }` et `--write` répond
|
|
1138
|
+
`{ file, written }`.
|
|
1134
1139
|
|
|
1135
1140
|
## value-objects
|
|
1136
1141
|
|
|
@@ -1352,7 +1357,7 @@ dans chaque `CONTEXT.md`.
|
|
|
1352
1357
|
## status, todo
|
|
1353
1358
|
|
|
1354
1359
|
```
|
|
1355
|
-
ddd-ts-kit status [--workers]
|
|
1360
|
+
ddd-ts-kit status [--workers | --ready]
|
|
1356
1361
|
ddd-ts-kit todo [<context>] [--brief]
|
|
1357
1362
|
```
|
|
1358
1363
|
|
|
@@ -1415,7 +1420,7 @@ texte entier.
|
|
|
1415
1420
|
## plan-waves
|
|
1416
1421
|
|
|
1417
1422
|
```
|
|
1418
|
-
ddd-ts-kit plan-waves [<context>]
|
|
1423
|
+
ddd-ts-kit plan-waves [<context>] [--ready]
|
|
1419
1424
|
```
|
|
1420
1425
|
|
|
1421
1426
|
Ordonne les lignes de `docs/architecture/slices.md` qui ne sont pas `done`, pour une construction
|
|
@@ -1428,8 +1433,9 @@ ses commandes de générateur : `--aggregate <Name>`, `aggregate <context> <Name
|
|
|
1428
1433
|
`repository <context> <Name>`. Deux lots d'un contexte dans une vague sont dits susceptibles de
|
|
1429
1434
|
toucher les mêmes fichiers quand ils nomment le même agrégat ; quand l'un d'eux n'en nomme aucun,
|
|
1430
1435
|
le chevauchement est dit inconnu plutôt que deviné. Chaque lot du *worker* d'un contexte vient avec
|
|
1431
|
-
la commande qui le consigne, `npx ddd-ts-kit worker-scope <context> --base origin/main --rows <ids
|
|
1432
|
-
|
|
1436
|
+
la commande qui le consigne, `npx ddd-ts-kit worker-scope <context> --base origin/main --rows <ids>` (sans
|
|
1437
|
+
`--base` dans un dépôt où `origin/main` n'existe pas encore : le *worker* part alors de la branche
|
|
1438
|
+
courante), avec ses propres `--worktree` et `--branch` quand sa vague porte un autre lot de ce contexte ; un
|
|
1433
1439
|
lot du chef d'orchestre se construit sur le tronc ; une personne reçoit sa consigne à la main.
|
|
1434
1440
|
Puis l'ordre des fusions : par vague, et dans une vague d'abord le lot que le plus de lignes
|
|
1435
1441
|
attendent, directement ou non, et ce qui se lance avant chaque fusion :
|
|
@@ -2234,7 +2240,7 @@ next: resolve each hunk, `git add <file>`, then `npx ddd-ts-kit merge-trunk --co
|
|
|
2234
2240
|
```
|
|
2235
2241
|
|
|
2236
2242
|
`--json` affiche le même rapport :
|
|
2237
|
-
`{ 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 }`,
|
|
2243
|
+
`{ 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 }`,
|
|
2238
2244
|
`status` valant `up-to-date`, `dry-run`, `stopped` ou `committed` et `evidence` `option`,
|
|
2239
2245
|
`landed`, `recorded` ou `merge-base`. La garde du *plugin* refuse `--to-land` à un sous-agent :
|
|
2240
2246
|
poser une branche est l'étape du chef d'orchestre, juste avant sa fusion en *squash*.
|
|
@@ -2299,6 +2305,10 @@ ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|gith
|
|
|
2299
2305
|
ddd-ts-kit check --commit-size [--staged] [--strict]
|
|
2300
2306
|
```
|
|
2301
2307
|
|
|
2308
|
+
Un chemin qui n'existe nulle part, ou un dossier sans fichier TypeScript sous la racine des
|
|
2309
|
+
sources, est une erreur de l'appelant : `check` le refuse (code 2) au lieu de déclarer le projet
|
|
2310
|
+
propre.
|
|
2311
|
+
|
|
2302
2312
|
Chaque violation a un identifiant de règle, une sévérité, un fichier, une ligne, un message et un
|
|
2303
2313
|
`fix` : une phrase qui dit quoi faire à la place. Code de sortie 1 quand il y a au moins une
|
|
2304
2314
|
erreur. Supposons que l'agrégat `Reminder` de l'application d'exemple lise l'horloge système dans
|
|
@@ -2504,7 +2514,7 @@ règle.
|
|
|
2504
2514
|
| `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 |
|
|
2505
2515
|
| `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 |
|
|
2506
2516
|
| `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/` |
|
|
2507
|
-
| `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
|
|
2517
|
+
| `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 |
|
|
2508
2518
|
| `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 |
|
|
2509
2519
|
| `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>` |
|
|
2510
2520
|
| `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é) |
|
|
@@ -2679,7 +2689,7 @@ ddd-ts-kit check-file <path> [--content-from <file>] [--rule <id>]...
|
|
|
2679
2689
|
Exécute les règles par fichier (couches, contextes, nommage, événements, langage, pureté, code
|
|
2680
2690
|
propre, *mocks*, composition, désactivations) sur un fichier sans parcourir le projet : conçu pour
|
|
2681
2691
|
un *hook* d'éditeur ou d'agent après chaque écriture. Un fichier qui n'est pas une source du
|
|
2682
|
-
projet est
|
|
2692
|
+
projet est ignoré ; un chemin qui n'existe nulle part est refusé (code 2), comme pour `check`. `--content-from <file>` juge le texte de ce fichier comme le contenu de
|
|
2683
2693
|
`<path>`, qui n'a pas besoin d'exister encore : ce qu'une session s'apprête à écrire, comme la
|
|
2684
2694
|
garde du *plugin* le lit avant l'écriture sous `"dependenciesBeforeWrite": true`. `--rule`
|
|
2685
2695
|
restreint les règles ; la *baseline* du projet s'applique comme pour un fichier sur le disque.
|
|
@@ -2693,12 +2703,12 @@ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
|
|
|
2693
2703
|
Ce que lancent `lint` et `ci:lint` d'un projet généré : l'ESLint du projet, par son API, sur les
|
|
2694
2704
|
chemins donnés (le projet sinon), son rapport dans le format demandé (`--format gitlab` écrit le
|
|
2695
2705
|
rapport Code Quality comme le fait `eslint-formatter-gitlab`), `--fix` comme ESLint le prend. Il
|
|
2696
|
-
sort en 1 sur une erreur, et sur un avertissement comme sur une erreur,
|
|
2697
|
-
|
|
2698
|
-
nomme la version où elle devient une erreur. Ceux-là sont affichés dans le rapport et listés
|
|
2699
|
-
après lui, une ligne par règle, sans échouer : une mise à jour du kit ne fait jamais passer au
|
|
2700
|
-
rouge un lint vert. Sans ESLint installé, il sort en 2 et nomme l'installation. Voir
|
|
2706
|
+
sort en 1 sur une erreur, et sur un avertissement comme sur une erreur, une règle nouvelle dans
|
|
2707
|
+
cette version comprise. Sans ESLint installé, il sort en 2 et nomme l'installation. Voir
|
|
2701
2708
|
[Base de qualité](../../docs/tools/quality-baseline.fr.md#un-avertissement-fait-échouer-le-lint).
|
|
2709
|
+
Avec `--json`, ESLint rapporte dans son format JSON et la commande répond, sur une ligne,
|
|
2710
|
+
`{ errors, warnings, report }` (`report` est le rapport JSON d'ESLint), avec le même
|
|
2711
|
+
code de sortie et rien sur stderr.
|
|
2702
2712
|
|
|
2703
2713
|
La commande linte avec le cache d'ESLint, indexé par le contenu de chaque fichier
|
|
2704
2714
|
(`.eslintcache/`, ignoré par git) : une seconde exécution sur un arbre qui n'a pas changé ne
|
|
@@ -2720,7 +2730,8 @@ ddd-ts-kit explain <rule-id>
|
|
|
2720
2730
|
|
|
2721
2731
|
`rules` liste les identifiants, les descriptions et les sévérités actuelles, et dit lesquels
|
|
2722
2732
|
ESLint vérifie. `explain` affiche la règle, pourquoi elle existe, un mauvais et un bon exemple,
|
|
2723
|
-
et la syntaxe de désactivation
|
|
2733
|
+
et la syntaxe de désactivation ; pour une règle que décide ESLint ou le formateur, la même raison
|
|
2734
|
+
et les mêmes exemples, puis l'outil qui la vérifie (`checkedBy` sous `--json`).
|
|
2724
2735
|
|
|
2725
2736
|
## Développement
|
|
2726
2737
|
|
package/README.md
CHANGED
|
@@ -688,7 +688,9 @@ pipelines call, `test:coverage` (every spec once, each context and layer held to
|
|
|
688
688
|
with a letter or a digit (`npm run db:generate add-invoices`, on TypeORM
|
|
689
689
|
`migrations/add-invoices`): `drizzle-generate`, `knex-generate`, `prisma-generate` and
|
|
690
690
|
`typeorm-generate` refuse any other name before the ORM reads it, since a value that starts with a dash would be one of its
|
|
691
|
-
options; `typeorm-generate` also refuses a folder outside the project.
|
|
691
|
+
options; `typeorm-generate` also refuses a folder outside the project. With `--json` they answer
|
|
692
|
+
`{ code, written, messages }` on one line: the exit code, the files of the migrations folder that are new
|
|
693
|
+
or changed, and what the command said; the output of the ORM tool goes to stderr.
|
|
692
694
|
|
|
693
695
|
`package.json` carries two compilers: `typescript ~6.0.3`, which the tools load as a library,
|
|
694
696
|
and `@typescript/native` (`npm:typescript@~7.0.2`), which `build` and `typecheck` call by path
|
|
@@ -984,7 +986,7 @@ Templates are plain files in `templates/<kind>/`, with `{{name.pascal}}`, `{{nam
|
|
|
984
986
|
## docs
|
|
985
987
|
|
|
986
988
|
```
|
|
987
|
-
ddd-ts-kit docs [--check] [--stored-events] [--behaviour]
|
|
989
|
+
ddd-ts-kit docs [--check] [--dry-run] [--stored-events] [--behaviour]
|
|
988
990
|
```
|
|
989
991
|
|
|
990
992
|
Regenerates what is derived from the config and the code, and nothing else:
|
|
@@ -1033,7 +1035,8 @@ event declared in the codecs of `infrastructure/persistence/`, never rewriting a
|
|
|
1033
1035
|
run it once the shape of a version is final.
|
|
1034
1036
|
|
|
1035
1037
|
`--check` writes nothing, names each stale file and each declared stored-event version not
|
|
1036
|
-
recorded in `stored-events.lock.json`, and exits 1.
|
|
1038
|
+
recorded in `stored-events.lock.json`, and exits 1. `--dry-run` writes nothing either: it names
|
|
1039
|
+
each generated file it would create, update or delete, as `docs` would write them. The event catalog and the
|
|
1037
1040
|
AsyncAPI document need the code of the project to run, so they are produced by
|
|
1038
1041
|
`scripts/events.ts` (`npm run events:generate`, part of `npm run docs:generate`).
|
|
1039
1042
|
|
|
@@ -1067,7 +1070,8 @@ ddd-ts-kit depcruise-config [--check | --write]
|
|
|
1067
1070
|
Prints the dependency-cruiser configuration derived from `ddd-ts-kit.config.json`: layers,
|
|
1068
1071
|
published languages, declared upstreams, allowed packages, cycles and orphans. `--write` saves
|
|
1069
1072
|
it as `.dependency-cruiser.cjs`; `--check` exits 1 when the file is missing or stale, which is
|
|
1070
|
-
what `npm run depcruise` runs first. Edit the config, not the file.
|
|
1073
|
+
what `npm run depcruise` runs first. Edit the config, not the file. With `--json`, the print is
|
|
1074
|
+
`{ file, config }` and `--write` answers `{ file, written }`.
|
|
1071
1075
|
|
|
1072
1076
|
## value-objects
|
|
1073
1077
|
|
|
@@ -1277,7 +1281,7 @@ each `CONTEXT.md`.
|
|
|
1277
1281
|
## status, todo
|
|
1278
1282
|
|
|
1279
1283
|
```
|
|
1280
|
-
ddd-ts-kit status [--workers]
|
|
1284
|
+
ddd-ts-kit status [--workers | --ready]
|
|
1281
1285
|
ddd-ts-kit todo [<context>] [--brief]
|
|
1282
1286
|
```
|
|
1283
1287
|
|
|
@@ -1292,7 +1296,7 @@ are all done while markers of its own keep it open gets a line of its own (only
|
|
|
1292
1296
|
may keep such a story open are blamed, one git call per file), with the command that lists them:
|
|
1293
1297
|
`story M1: every row done, 3 markers left: npx ddd-ts-kit story-check M1` (see
|
|
1294
1298
|
[story-check](#story-check)). `--json` prints
|
|
1295
|
-
`{ next, slices, remaining }`: `next` and `slices` are `null` when their file is missing,
|
|
1299
|
+
`{ next, planNext, slices, remaining }`: `next` and `slices` are `null` when their file is missing,
|
|
1296
1300
|
`slices` holds `{ file, rows, byStatus, byOwner, duplicates, unscoped, unclosed }`, `unclosed`
|
|
1297
1301
|
being `[{ story, markers, command }]`, a row not done carrying
|
|
1298
1302
|
`ready: 'trunk' | 'branch' | 'waiting'` and `waitingFor` (its dependencies not done), and
|
|
@@ -1336,7 +1340,7 @@ twelve words at most), the file holding the rest, a quarter of the size mid-slic
|
|
|
1336
1340
|
## plan-waves
|
|
1337
1341
|
|
|
1338
1342
|
```
|
|
1339
|
-
ddd-ts-kit plan-waves [<context>]
|
|
1343
|
+
ddd-ts-kit plan-waves [<context>] [--ready]
|
|
1340
1344
|
```
|
|
1341
1345
|
|
|
1342
1346
|
Orders the rows of `docs/architecture/slices.md` that are not `done`, for a build split between
|
|
@@ -1348,8 +1352,9 @@ from its generator commands: `--aggregate <Name>`, `aggregate <context> <Name>`
|
|
|
1348
1352
|
`repository <context> <Name>`. Two batches of one context in one wave are said likely to touch the
|
|
1349
1353
|
same files when they name the same aggregate; when one of them names none, the overlap is said to
|
|
1350
1354
|
be unknown rather than guessed. Each batch of a context's worker comes with the command that briefs
|
|
1351
|
-
it, `npx ddd-ts-kit worker-scope <context> --base origin/main --rows <ids
|
|
1352
|
-
|
|
1355
|
+
it, `npx ddd-ts-kit worker-scope <context> --base origin/main --rows <ids>` (without `--base` in a
|
|
1356
|
+
repository where `origin/main` does not resolve yet: the worker is then cut from the current branch),
|
|
1357
|
+
with its own `--worktree` and `--branch` when its wave holds another batch of that context; a batch of the
|
|
1353
1358
|
conductor is built on the trunk; a person is briefed by hand. Then the merge order: by wave, and in
|
|
1354
1359
|
a wave the batch that the most rows wait for, directly or not, first, and what runs before each
|
|
1355
1360
|
merge: `npx ddd-ts-kit merge-trunk --to-land --cwd <worktree>`, then the squash merge. With a context, only its rows
|
|
@@ -2154,6 +2159,9 @@ ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|gith
|
|
|
2154
2159
|
ddd-ts-kit check --commit-size [--staged] [--strict]
|
|
2155
2160
|
```
|
|
2156
2161
|
|
|
2162
|
+
A path that exists nowhere, or a folder that holds no TypeScript file under the source root, is a
|
|
2163
|
+
mistake of the caller: `check` refuses it (exit 2) in place of reporting a clean project.
|
|
2164
|
+
|
|
2157
2165
|
Each violation has a rule id, a severity, a file, a line, a message and a `fix`: one sentence
|
|
2158
2166
|
saying what to do instead. Exit code 1 when there is at least one error. Suppose that the
|
|
2159
2167
|
`Reminder` aggregate of the example application read the system clock in its domain: an `isDue()`
|
|
@@ -2347,7 +2355,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2347
2355
|
| `context/extractable` | a module file importing another context outside its published language; persistence importing another context's infrastructure or naming its schema; a handler importing another context's repository; `export let` or an exported `new Map`, `Set`, `WeakMap` at module level; `deployable: true` without `apps/<context>/main.ts`; in the declared style, a role file importing anything of a port file of another context |
|
|
2348
2356
|
| `governance/recorded-deviation` | a `ddd-ts-kit-disable` or `eslint-disable` comment whose reason names no `ADR-<number>` with a file `docs/adr/<number>-*.md`; a rule set to `off` (or to `warn` below its default), an extra directory, a context whose `tenancy` is `control-plane`, an extra allowed package, a `guard` other than `enforce` or `stack.events` off the outbox, without a `deviations` entry `{ what, adr, reason }` pointing to an existing record |
|
|
2349
2357
|
| `declarations/role-declared` | declared style only: a role file (other than `*.command.ts` and `*.query.ts`, held by `authz/declared`; `*.job.ts` under `application/scheduling/` with `@Scheduled` and `*.publisher.ts` with `@DomainEventHandler` are roles) exporting no class with the decorator of its suffix and folder, or one carrying another declaration; a declared class in a file that is not a role file; a `consumer` or `name` option that is missing, empty, a variable, a concatenation or a template with a substitution; any declaration decorator on a class under `domain/` |
|
|
2350
|
-
| `declarations/barrel-current` | declared style only: with `stack.assembly: barrel`, a missing `<layer>.declarations.ts` of a layer or one that differs from one `export *` per role file of the layer sorted by path followed by one `injected(Class, [Tokens])` per class of the layer whose constructor takes something (read from the signatures, with their imports), a `<context>.declarations.ts` that is missing or differs from one `export *` per such file sorted by path, and the declarations of a layer that holds no role file any more; with `discovery`, generated declarations that still exist, and a `<context>.dependencies.ts` that differs from those `injected` statements (absent is accepted while it would hold none). The message names the missing role file or the class whose list is stale. A context still declared as an earlier version wrote it, exactly as that version would write it (the single `<context>.declarations.ts` of 0.84, or one `<folder>.declarations.ts` per role folder as 0.85 and 0.86 wrote them), is
|
|
2358
|
+
| `declarations/barrel-current` | declared style only: with `stack.assembly: barrel`, a missing `<layer>.declarations.ts` of a layer or one that differs from one `export *` per role file of the layer sorted by path followed by one `injected(Class, [Tokens])` per class of the layer whose constructor takes something (read from the signatures, with their imports), a `<context>.declarations.ts` that is missing or differs from one `export *` per such file sorted by path, and the declarations of a layer that holds no role file any more; with `discovery`, generated declarations that still exist, and a `<context>.dependencies.ts` that differs from those `injected` statements (absent is accepted while it would hold none). The message names the missing role file or the class whose list is stale. A context still declared as an earlier version wrote it, exactly as that version would write it (the single `<context>.declarations.ts` of 0.84, or one `<folder>.declarations.ts` per role folder as 0.85 and 0.86 wrote them), is an error, reported once at its summary (`docs` moves it, and `docs --check` names the files that move would write). It needs the tree, so `check-file` does not run it |
|
|
2351
2359
|
| `declarations/constructor-injection` | declared style only, in a role file: on a class whose decorator lists nothing, a constructor parameter that is optional, has a default value, is a rest parameter or is destructured, has no type, or is typed by anything but one class name (type arguments aside): a union, an intersection, an array, a qualified name, a type of the language, an interface, a type alias, an enum or an unexported class of the file or of the file of the project it is imported from; a class that inherits its constructor from a class the project cannot read. Under `stack.dependencies: signature`, a decorator that carries a list although the constructor can be read: one that repeats it, one that differs |
|
|
2352
2360
|
| `declarations/port-adapter-wired` | a class of `infrastructure/` implementing a port that nothing wires: no `@Repository`, `@Gateway` or `@Adapter` in the declared style, and no file of the composition root (`<context>.module.ts`, `main.ts`, `apps/<context>/main.ts`, the platform) importing it, once the file carries no `TODO(domain)` or `TODO(platform)` left; one kept on purpose carries `// ddd-ts-kit-disable-next-line declarations/port-adapter-wired -- ADR-NNNN: <why>` |
|
|
2353
2361
|
| `ports/abstract-class` | in a port file (`domain/repositories/*.repository.ts`, `application/ports/*.port.ts`): a class that is not `abstract`; a member that is not an abstract method or property (`static readonly tokenKey = '<text>'` apart): a constructor, a body, an initializer, a `private`, `protected` or `#` member; an exported `interface` (a `type` alias, a data shape, is not reported) |
|
|
@@ -2501,7 +2509,8 @@ ddd-ts-kit check-file <path> [--content-from <file>] [--rule <id>]...
|
|
|
2501
2509
|
|
|
2502
2510
|
Runs the per-file rules (layers, contexts, naming, events, language, purity, clean code, mocks,
|
|
2503
2511
|
composition, suppressions) on one file without walking the project: meant for an editor or
|
|
2504
|
-
agent hook after each write. A file that is not a source of the project is ignored
|
|
2512
|
+
agent hook after each write. A file that is not a source of the project is ignored; a path that
|
|
2513
|
+
exists nowhere is refused (exit 2), as for `check`.
|
|
2505
2514
|
`--content-from <file>` judges the text of that file as the content of `<path>`, which need not
|
|
2506
2515
|
exist yet: what a session is about to write, as the guard of the plugin reads it before the write
|
|
2507
2516
|
under `"dependenciesBeforeWrite": true`. `--rule` narrows the rules; the baseline of the project
|
|
@@ -2516,11 +2525,12 @@ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
|
|
|
2516
2525
|
What `lint` and `ci:lint` of a generated project run: the ESLint of the project, through its API,
|
|
2517
2526
|
on the paths given (the project otherwise), its report in the format asked (`--format gitlab`
|
|
2518
2527
|
writes the Code Quality report as `eslint-formatter-gitlab` does), `--fix` as ESLint takes it.
|
|
2519
|
-
It exits 1 on an error, and on a warning as on an error,
|
|
2520
|
-
|
|
2521
|
-
an error. Those are shown in the report and listed after it, one line per rule, without failing:
|
|
2522
|
-
an upgrade of the kit never turns a green lint red. Without ESLint installed it exits 2 and names
|
|
2528
|
+
It exits 1 on an error, and on a warning as on an error, a rule new in this version included.
|
|
2529
|
+
Without ESLint installed it exits 2 and names
|
|
2523
2530
|
the install. See [Quality baseline](../../docs/tools/quality-baseline.md#warnings-fail-the-lint).
|
|
2531
|
+
With `--json` ESLint reports in its JSON format and the command answers, on one line,
|
|
2532
|
+
`{ errors, warnings, report }` (`report` is the JSON report of ESLint), with the same
|
|
2533
|
+
exit code and nothing on stderr.
|
|
2524
2534
|
|
|
2525
2535
|
The command lints with the cache of ESLint, keyed by the content of each file (`.eslintcache/`,
|
|
2526
2536
|
ignored by git): a second run on a tree that did not change lints the files that changed since.
|
|
@@ -2539,7 +2549,9 @@ ddd-ts-kit explain <rule-id>
|
|
|
2539
2549
|
```
|
|
2540
2550
|
|
|
2541
2551
|
`rules` lists the ids, descriptions and current severities, and says which ones ESLint checks.
|
|
2542
|
-
`explain` prints the rule, why it exists, a bad and a good example, and the suppression syntax
|
|
2552
|
+
`explain` prints the rule, why it exists, a bad and a good example, and the suppression syntax;
|
|
2553
|
+
for a rule ESLint or the formatter decides, the same reason and examples, then the tool that
|
|
2554
|
+
checks it (`checkedBy` under `--json`).
|
|
2543
2555
|
|
|
2544
2556
|
## Development
|
|
2545
2557
|
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import type { Config } from '../../config/index.js';
|
|
2
2
|
import type { Flaw } from '../model/flaw.js';
|
|
3
|
-
/** A file of a context still where 0.86 and 0.87 wrote it: a warning while it is the only one, an error next to the one at the root. */
|
|
4
|
-
export interface EarlierContextFile {
|
|
5
|
-
readonly flaw: Flaw;
|
|
6
|
-
readonly severity: 'warn' | 'error';
|
|
7
|
-
}
|
|
8
3
|
/**
|
|
9
4
|
* What `tree/closed` says of a file of a context that 0.86 and 0.87 wrote in a role folder, the code list
|
|
10
5
|
* (`domain/errors/codes.ts`) or the permission set (`application/authorization/<context>.permissions.ts`),
|
|
11
6
|
* now at the root of the context; undefined for any other entry. `entries` are every entry of the
|
|
12
7
|
* contexts, to tell whether the root holds the file already.
|
|
13
8
|
*/
|
|
14
|
-
export declare function earlierContextFile(entry: string, config: Config, entries: ReadonlySet<string>):
|
|
9
|
+
export declare function earlierContextFile(entry: string, config: Config, entries: ReadonlySet<string>): Flaw | undefined;
|
|
15
10
|
//# sourceMappingURL=earlier-context-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earlier-context-file.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/earlier-context-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"earlier-context-file.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/earlier-context-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAsBhH"}
|
|
@@ -15,19 +15,13 @@ export function earlierContextFile(entry, config, entries) {
|
|
|
15
15
|
const root = file.root(context);
|
|
16
16
|
if (entries.has(`${config.contextsDir}/${context}/${root}`)) {
|
|
17
17
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
message: `"${context}" holds ${relative} next to ${root}: one context has one of each.`,
|
|
21
|
-
fix: `Keep ${root}, move into it what ${relative} holds that it lacks, and delete ${relative}.`,
|
|
22
|
-
},
|
|
18
|
+
message: `"${context}" holds ${relative} next to ${root}: one context has one of each.`,
|
|
19
|
+
fix: `Keep ${root}, move into it what ${relative} holds that it lacks, and delete ${relative}.`,
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
22
|
return {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
message: `${relative} of "${context}" is where 0.86 and 0.87 kept it: it lives at the root of the context now, ${root}. This version reads it where it is, and a later minor version reports it as an error.`,
|
|
29
|
-
fix: 'Run `npx ddd-ts-kit context-layout`, which moves it to the root of its context and rewrites every import of it, then commit the result.',
|
|
30
|
-
},
|
|
23
|
+
message: `${relative} of "${context}" is where 0.86 and 0.87 kept it: it lives at the root of the context now, ${root}.`,
|
|
24
|
+
fix: 'Run `npx ddd-ts-kit context-layout`, which moves it to the root of its context and rewrites every import of it, then commit the result.',
|
|
31
25
|
};
|
|
32
26
|
}
|
|
33
27
|
//# sourceMappingURL=earlier-context-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earlier-context-file.js","sourceRoot":"","sources":["../../../src/check/canonical/earlier-context-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"earlier-context-file.js","sourceRoot":"","sources":["../../../src/check/canonical/earlier-context-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,MAAc,EAAE,OAA4B;IAC5F,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;IAExF,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;QACtE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEhC,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QAC5D,OAAO;YACL,OAAO,EAAE,IAAI,OAAO,WAAW,QAAQ,YAAY,IAAI,gCAAgC;YACvF,GAAG,EAAE,QAAQ,IAAI,uBAAuB,QAAQ,oCAAoC,QAAQ,GAAG;SAChG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,GAAG,QAAQ,QAAQ,OAAO,8EAA8E,IAAI,GAAG;QACxH,GAAG,EAAE,yIAAyI;KAC/I,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stray-entry.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/stray-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"stray-entry.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/stray-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAsB1C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAkB1E"}
|
|
@@ -7,6 +7,8 @@ import { isCanonicalDirectory } from './is-canonical-directory.js';
|
|
|
7
7
|
import { OPEN_DIRECTORIES } from './open-directories.js';
|
|
8
8
|
import { roleOf } from './role-of.js';
|
|
9
9
|
import { ownEntry } from '../../config/values/own-entry.js';
|
|
10
|
+
/** JavaScript, and TypeScript in another form than `.ts`: code no rule of the tree reads. */
|
|
11
|
+
const OTHER_CODE = /\.(?:[mc]?js|jsx|tsx|[mc]ts)$/;
|
|
10
12
|
/**
|
|
11
13
|
* Why an entry of a context, a directory (ending with `/`) or a file, has no place in the
|
|
12
14
|
* canonical tree; undefined when it has one, or when it is the context itself.
|
|
@@ -21,7 +23,10 @@ export function strayEntry(entry, config) {
|
|
|
21
23
|
if (moduleOfModuleFile(placed.inside, placed.modules) !== undefined) {
|
|
22
24
|
return undefined;
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
if (entry.endsWith('/')) {
|
|
27
|
+
return strayDirectory(placed);
|
|
28
|
+
}
|
|
29
|
+
return OTHER_CODE.test(placed.inside) ? notTypeScript(placed.inside) : straySource(placed);
|
|
25
30
|
}
|
|
26
31
|
/** A dot-directory of a context (the `.claude/` a sandbox leaves) is written by a tool: it is no part of the tree. */
|
|
27
32
|
function inDotDirectory(entry) {
|
|
@@ -90,6 +95,14 @@ function straySource(placed) {
|
|
|
90
95
|
fix: `Move it one level down into the directory of its role (for example ${directory.split('/')[0] ?? directory}/<role>/), so that its suffix and its tests can be checked.`,
|
|
91
96
|
};
|
|
92
97
|
}
|
|
98
|
+
/** A source no rule reads: the checker, ESLint and the compiler of the project read `.ts` files only. */
|
|
99
|
+
function notTypeScript(inside) {
|
|
100
|
+
const name = path.posix.basename(inside);
|
|
101
|
+
return {
|
|
102
|
+
message: `"${inside}" is a source that is not a .ts file.`,
|
|
103
|
+
fix: `Write it in TypeScript, ${name.replace(OTHER_CODE, '.ts')}, in the directory of its role, or delete it if a build wrote it: a context holds .ts files only, the build writes to dist/.`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
93
106
|
function atContextRoot({ context, declared, inside: file }) {
|
|
94
107
|
const generated = [barrelFile(context), dependenciesFile(context)];
|
|
95
108
|
const ofTheContext = CONTEXT_FILES.map((candidate) => candidate.root(context));
|