ddd-ts-kit 0.104.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 +62 -6
- package/README.fr.md +12 -13
- package/README.md +10 -11
- 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/events/domain-event-names.d.ts +1 -1
- package/dist/check/events/domain-event-names.js +1 -1
- package/dist/check/explain/errors-docs.d.ts.map +1 -1
- package/dist/check/explain/errors-docs.js +10 -18
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/module-docs.js +1 -1
- package/dist/check/explain/module-docs.js.map +1 -1
- package/dist/check/explain/standard-docs.js +2 -2
- package/dist/check/explain/standard-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.js +4 -6
- package/dist/check/fixtures/context-file-fixtures.js.map +1 -1
- package/dist/check/fixtures/earlier-declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/earlier-declarations-fixtures.js +2 -4
- package/dist/check/fixtures/earlier-declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/module-fixtures.js +2 -2
- package/dist/check/fixtures/module-fixtures.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +3 -12
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/module-complete.d.ts.map +1 -1
- package/dist/check/rules/module-complete.js +6 -2
- package/dist/check/rules/module-complete.js.map +1 -1
- package/dist/check/rules/tree-closed.d.ts.map +1 -1
- package/dist/check/rules/tree-closed.js +1 -2
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +9 -16
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +6 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/json-report.d.ts +8 -0
- package/dist/commands/json-report.d.ts.map +1 -0
- package/dist/commands/json-report.js +42 -0
- package/dist/commands/json-report.js.map +1 -0
- package/dist/commands/lint.d.ts +2 -3
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +2 -4
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/plan-waves.d.ts +2 -1
- package/dist/commands/plan-waves.d.ts.map +1 -1
- package/dist/commands/plan-waves.js +6 -3
- package/dist/commands/plan-waves.js.map +1 -1
- package/dist/commands/print-report.d.ts.map +1 -1
- package/dist/commands/print-report.js +2 -1
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +16 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/context-files/context-file.d.ts +1 -1
- package/dist/declared/earlier-layout-notice.d.ts +1 -1
- package/dist/declared/earlier-layout-notice.js +1 -1
- package/dist/declared/earlier-layout-notice.js.map +1 -1
- package/dist/declared/keeps-role-folder-files.d.ts +1 -2
- package/dist/declared/keeps-role-folder-files.d.ts.map +1 -1
- package/dist/declared/keeps-role-folder-files.js +1 -2
- package/dist/declared/keeps-role-folder-files.js.map +1 -1
- package/dist/declared/keeps-single-file.d.ts +2 -3
- package/dist/declared/keeps-single-file.d.ts.map +1 -1
- package/dist/declared/keeps-single-file.js +2 -3
- package/dist/declared/keeps-single-file.js.map +1 -1
- package/dist/docs/spec-heading.d.ts +5 -1
- package/dist/docs/spec-heading.d.ts.map +1 -1
- package/dist/docs/spec-heading.js +8 -2
- package/dist/docs/spec-heading.js.map +1 -1
- package/dist/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/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/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/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/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +12 -2
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/ready-now.d.ts +8 -0
- package/dist/plan/ready-now.d.ts.map +1 -0
- package/dist/plan/ready-now.js +25 -0
- package/dist/plan/ready-now.js.map +1 -0
- package/dist/plan/wave-plan.d.ts +8 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/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/version.d.ts +1 -1
- package/dist/version.js +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,62 @@ 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
|
+
|
|
7
63
|
## 0.104.0
|
|
8
64
|
|
|
9
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.
|
|
@@ -599,7 +655,7 @@ To move: an aggregate generated before keeps its `registeredAt` and its `registe
|
|
|
599
655
|
|
|
600
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.
|
|
601
657
|
|
|
602
|
-
To move: three edits. (1) Give each background job class its schema, next to its `jobName`, in the validation library of the project, for example under zod `static readonly payload = zodSchema(z.object({ calendarId: z.string(), appointmentIds: z.array(z.string()), reason: z.string() }));`, the timeout job of a process `static readonly payload = processTimeoutDuePayload;` (from `@ddd-ts-kit/kernel`); a job built by `handledByFactory` passes it as the second argument, a `worker.register({ name, run })` of your own adds `payload`, and where the platform is wired by hand `BackgroundJobClass` of `src/platform/jobs/background-jobs.ts` gains `readonly payload: BackgroundJobPayloadSchema<unknown>;` and `src/platform/jobs/create-background-work.ts` registers `payload: job.payload` (`init --force` writes both). Under class-validator, write the fields without initial value (`declare reason: string;`): a field the stored payload lacks would take the initial value, and pass. Before the deploy, check that the jobs waiting in the queue fit the new schema, or let them run first; a spec that enqueues an unfit payload on purpose goes through `earlierVersionOf` of `@ddd-ts-kit/testing`, since `enqueue` now refuses it. (2) Regenerate the dependency-cruiser file, `npx ddd-ts-kit depcruise-config --write`, so that `npm run depcruise` lets the job import its schema library. (3) Update
|
|
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`.
|
|
603
659
|
|
|
604
660
|
## 0.99.0
|
|
605
661
|
|
|
@@ -1500,7 +1556,7 @@ notes and the reasons by `[erased]` and deletes the documents from the file stor
|
|
|
1500
1556
|
fails does not stop the others and running the script again completes the erasure; a run again
|
|
1501
1557
|
once nothing is left is refused and recorded. The README of the example says what an erasure does
|
|
1502
1558
|
not reach: the events published before it, the backups, the opaque ids of the audit trail. The
|
|
1503
|
-
first part of the proposal [privacy by design](
|
|
1559
|
+
first part of the proposal [privacy by design](docs/proposals/privacy-by-design.md) built; the
|
|
1504
1560
|
hand-written steps are the specification of the erasure port the next parts bring to the kit.
|
|
1505
1561
|
|
|
1506
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.
|
|
@@ -1523,7 +1579,7 @@ the copies alone are erased, and the report says no key was destroyed. `InMemory
|
|
|
1523
1579
|
`personalDataErasureContract` and `personalDataExportContract` of `@ddd-ts-kit/testing` hold it
|
|
1524
1580
|
and every adapter to the same behaviour. The adapters of the persistence packages, the platform
|
|
1525
1581
|
folder `init` writes and the register come with the next parts of
|
|
1526
|
-
[privacy by design](
|
|
1582
|
+
[privacy by design](docs/proposals/privacy-by-design.md). The persistence skill says it.
|
|
1527
1583
|
|
|
1528
1584
|
**The audit trail masks a personal value under the key of the person it belongs to, so that
|
|
1529
1585
|
erasing the person makes its masks meaningless.** `subjectMasker(keys)` of `@ddd-ts-kit/audit` is
|
|
@@ -1545,7 +1601,7 @@ projection of your own may fill; `AuditedMessage` gains `subjectless`, optional,
|
|
|
1545
1601
|
that name no subject, which `auditedFields` lists and a declaration of your own may leave out;
|
|
1546
1602
|
`AuditMasker` gains `requiresDataSubject`, optional, which a masker keyed per person sets so that
|
|
1547
1603
|
the middleware checks the declarations at wiring time. Nothing existing changes shape or meaning.
|
|
1548
|
-
Part 2 of [privacy by design](
|
|
1604
|
+
Part 2 of [privacy by design](docs/proposals/privacy-by-design.md).
|
|
1549
1605
|
|
|
1550
1606
|
**`init` writes `src/platform/privacy/` with `--privacy on`, the default with an ORM, and wires the
|
|
1551
1607
|
event store with `--event-sourcing on`: a generated project erases and exports a data subject from
|
|
@@ -1601,7 +1657,7 @@ pseudonymise one that does not is refused before any file or row is touched
|
|
|
1601
1657
|
(`NotNullablePersonalColumnError`), so that an erasure never deletes the files of a person and
|
|
1602
1658
|
leaves their rows in clear. The four pass
|
|
1603
1659
|
`personalDataErasureContract` of `@ddd-ts-kit/testing`, on PGlite and PostgreSQL. Part 3 of
|
|
1604
|
-
[privacy by design](
|
|
1660
|
+
[privacy by design](docs/proposals/privacy-by-design.md); the generator writes the declarations
|
|
1605
1661
|
in part 5, and the example adopts the adapter in part 11.
|
|
1606
1662
|
|
|
1607
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.
|
|
@@ -1646,7 +1702,7 @@ wrapped by tracing and by the aspects, and a helper that answered a query builde
|
|
|
1646
1702
|
chain broken; the helper is a function now, and the Knex spec runs the adapter wrapped the way the
|
|
1647
1703
|
platform binds it. `init --force`, which rewrites `data-subject-copies.ts`, lists the erasure of each
|
|
1648
1704
|
context again, as the port or as the factory of the hand-wired platform. The new concept page
|
|
1649
|
-
[Personal data in a generated project](
|
|
1705
|
+
[Personal data in a generated project](docs/concepts/personal-data.md) draws the erasure end to
|
|
1650
1706
|
end, what stays out of reach and what the tool does not decide, in both languages.
|
|
1651
1707
|
|
|
1652
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
|
|
|
@@ -1041,7 +1041,7 @@ et des blocs `{{#if x}}` / `{{#unless x}}`. Un emplacement inconnu est une erreu
|
|
|
1041
1041
|
## docs
|
|
1042
1042
|
|
|
1043
1043
|
```
|
|
1044
|
-
ddd-ts-kit docs [--check] [--stored-events] [--behaviour]
|
|
1044
|
+
ddd-ts-kit docs [--check] [--dry-run] [--stored-events] [--behaviour]
|
|
1045
1045
|
```
|
|
1046
1046
|
|
|
1047
1047
|
Régénère ce qui dérive de la configuration et du code, et rien d'autre :
|
|
@@ -1095,7 +1095,9 @@ Régénère ce qui dérive de la configuration et du code, et rien d'autre :
|
|
|
1095
1095
|
une version enregistrée : lancez-le une fois que la forme d'une version est définitive.
|
|
1096
1096
|
|
|
1097
1097
|
`--check` n'écrit rien, nomme chaque fichier périmé et chaque version d'événement stocké déclarée
|
|
1098
|
-
qui n'est pas enregistrée dans `stored-events.lock.json`, et sort avec le code 1.
|
|
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
|
|
1099
1101
|
des événements et le document AsyncAPI ont besoin d'exécuter le code du projet, c'est pourquoi
|
|
1100
1102
|
ils sont produits par `scripts/events.ts` (`npm run events:generate`, qui fait partie de
|
|
1101
1103
|
`npm run docs:generate`).
|
|
@@ -1355,7 +1357,7 @@ dans chaque `CONTEXT.md`.
|
|
|
1355
1357
|
## status, todo
|
|
1356
1358
|
|
|
1357
1359
|
```
|
|
1358
|
-
ddd-ts-kit status [--workers]
|
|
1360
|
+
ddd-ts-kit status [--workers | --ready]
|
|
1359
1361
|
ddd-ts-kit todo [<context>] [--brief]
|
|
1360
1362
|
```
|
|
1361
1363
|
|
|
@@ -1418,7 +1420,7 @@ texte entier.
|
|
|
1418
1420
|
## plan-waves
|
|
1419
1421
|
|
|
1420
1422
|
```
|
|
1421
|
-
ddd-ts-kit plan-waves [<context>]
|
|
1423
|
+
ddd-ts-kit plan-waves [<context>] [--ready]
|
|
1422
1424
|
```
|
|
1423
1425
|
|
|
1424
1426
|
Ordonne les lignes de `docs/architecture/slices.md` qui ne sont pas `done`, pour une construction
|
|
@@ -2238,7 +2240,7 @@ next: resolve each hunk, `git add <file>`, then `npx ddd-ts-kit merge-trunk --co
|
|
|
2238
2240
|
```
|
|
2239
2241
|
|
|
2240
2242
|
`--json` affiche le même rapport :
|
|
2241
|
-
`{ status, branch, trunk: { ref, commit }, base: { commit, evidence, landedAs?, unlanded?, notOnTrunk? }, conflicts: { plainMerge, ownDiff, automatic, forYou }, automatic: [{ file, kind, how }], forYou: [{ file, kind, why, hunks, ours: { branch, rows, change }, theirs: { ref, commits, change }, advice }], migrations, regenerate: { status, output? }, lostLines: { errors, warnings, accepted } | null, leftOut, stop?, commit?, next }`,
|
|
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 }`,
|
|
2242
2244
|
`status` valant `up-to-date`, `dry-run`, `stopped` ou `committed` et `evidence` `option`,
|
|
2243
2245
|
`landed`, `recorded` ou `merge-base`. La garde du *plugin* refuse `--to-land` à un sous-agent :
|
|
2244
2246
|
poser une branche est l'étape du chef d'orchestre, juste avant sa fusion en *squash*.
|
|
@@ -2512,7 +2514,7 @@ règle.
|
|
|
2512
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 |
|
|
2513
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 |
|
|
2514
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/` |
|
|
2515
|
-
| `declarations/barrel-current` | style déclaré seulement : avec `stack.assembly: barrel`, un `<layer>.declarations.ts` d'une couche manquant ou qui diffère d'un `export *` par fichier de rôle de la couche trié par chemin, suivi d'un `injected(Class, [Tokens])` par classe de la couche dont le constructeur reçoit quelque chose (lu depuis les signatures, avec leurs imports), un `<context>.declarations.ts` manquant ou qui diffère d'un `export *` par tel fichier trié par chemin, et les déclarations d'une couche qui ne contient plus aucun fichier de rôle ; avec `discovery`, des déclarations générées qui existent encore, et un `<context>.dependencies.ts` qui diffère de ces instructions `injected` (son absence est acceptée tant qu'il n'en contiendrait aucune). Le message nomme le fichier de rôle manquant ou la classe dont la liste est périmée. Un contexte encore déclaré comme l'écrivait une version antérieure, exactement tel que l'écrirait cette version (le fichier unique `<context>.declarations.ts` de 0.84, ou un `<folder>.declarations.ts` par dossier de rôle comme l'écrivaient 0.85 et 0.86), est
|
|
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 |
|
|
2516
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 |
|
|
2517
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>` |
|
|
2518
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é) |
|
|
@@ -2701,14 +2703,11 @@ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
|
|
|
2701
2703
|
Ce que lancent `lint` et `ci:lint` d'un projet généré : l'ESLint du projet, par son API, sur les
|
|
2702
2704
|
chemins donnés (le projet sinon), son rapport dans le format demandé (`--format gitlab` écrit le
|
|
2703
2705
|
rapport Code Quality comme le fait `eslint-formatter-gitlab`), `--fix` comme ESLint le prend. Il
|
|
2704
|
-
sort en 1 sur une erreur, et sur un avertissement comme sur une erreur,
|
|
2705
|
-
|
|
2706
|
-
nomme la version où elle devient une erreur. Ceux-là sont affichés dans le rapport et listés
|
|
2707
|
-
après lui, une ligne par règle, sans échouer : une mise à jour du kit ne fait jamais passer au
|
|
2708
|
-
rouge un lint vert. Sans ESLint installé, il sort en 2 et nomme l'installation. Voir
|
|
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
|
|
2709
2708
|
[Base de qualité](../../docs/tools/quality-baseline.fr.md#un-avertissement-fait-échouer-le-lint).
|
|
2710
2709
|
Avec `--json`, ESLint rapporte dans son format JSON et la commande répond, sur une ligne,
|
|
2711
|
-
`{ errors, warnings,
|
|
2710
|
+
`{ errors, warnings, report }` (`report` est le rapport JSON d'ESLint), avec le même
|
|
2712
2711
|
code de sortie et rien sur stderr.
|
|
2713
2712
|
|
|
2714
2713
|
La commande linte avec le cache d'ESLint, indexé par le contenu de chaque fichier
|
package/README.md
CHANGED
|
@@ -986,7 +986,7 @@ Templates are plain files in `templates/<kind>/`, with `{{name.pascal}}`, `{{nam
|
|
|
986
986
|
## docs
|
|
987
987
|
|
|
988
988
|
```
|
|
989
|
-
ddd-ts-kit docs [--check] [--stored-events] [--behaviour]
|
|
989
|
+
ddd-ts-kit docs [--check] [--dry-run] [--stored-events] [--behaviour]
|
|
990
990
|
```
|
|
991
991
|
|
|
992
992
|
Regenerates what is derived from the config and the code, and nothing else:
|
|
@@ -1035,7 +1035,8 @@ event declared in the codecs of `infrastructure/persistence/`, never rewriting a
|
|
|
1035
1035
|
run it once the shape of a version is final.
|
|
1036
1036
|
|
|
1037
1037
|
`--check` writes nothing, names each stale file and each declared stored-event version not
|
|
1038
|
-
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
|
|
1039
1040
|
AsyncAPI document need the code of the project to run, so they are produced by
|
|
1040
1041
|
`scripts/events.ts` (`npm run events:generate`, part of `npm run docs:generate`).
|
|
1041
1042
|
|
|
@@ -1280,7 +1281,7 @@ each `CONTEXT.md`.
|
|
|
1280
1281
|
## status, todo
|
|
1281
1282
|
|
|
1282
1283
|
```
|
|
1283
|
-
ddd-ts-kit status [--workers]
|
|
1284
|
+
ddd-ts-kit status [--workers | --ready]
|
|
1284
1285
|
ddd-ts-kit todo [<context>] [--brief]
|
|
1285
1286
|
```
|
|
1286
1287
|
|
|
@@ -1295,7 +1296,7 @@ are all done while markers of its own keep it open gets a line of its own (only
|
|
|
1295
1296
|
may keep such a story open are blamed, one git call per file), with the command that lists them:
|
|
1296
1297
|
`story M1: every row done, 3 markers left: npx ddd-ts-kit story-check M1` (see
|
|
1297
1298
|
[story-check](#story-check)). `--json` prints
|
|
1298
|
-
`{ 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,
|
|
1299
1300
|
`slices` holds `{ file, rows, byStatus, byOwner, duplicates, unscoped, unclosed }`, `unclosed`
|
|
1300
1301
|
being `[{ story, markers, command }]`, a row not done carrying
|
|
1301
1302
|
`ready: 'trunk' | 'branch' | 'waiting'` and `waitingFor` (its dependencies not done), and
|
|
@@ -1339,7 +1340,7 @@ twelve words at most), the file holding the rest, a quarter of the size mid-slic
|
|
|
1339
1340
|
## plan-waves
|
|
1340
1341
|
|
|
1341
1342
|
```
|
|
1342
|
-
ddd-ts-kit plan-waves [<context>]
|
|
1343
|
+
ddd-ts-kit plan-waves [<context>] [--ready]
|
|
1343
1344
|
```
|
|
1344
1345
|
|
|
1345
1346
|
Orders the rows of `docs/architecture/slices.md` that are not `done`, for a build split between
|
|
@@ -2354,7 +2355,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2354
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 |
|
|
2355
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 |
|
|
2356
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/` |
|
|
2357
|
-
| `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 |
|
|
2358
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 |
|
|
2359
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>` |
|
|
2360
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) |
|
|
@@ -2524,13 +2525,11 @@ ddd-ts-kit lint [paths...] [--format <eslint formatter>] [--fix] [--no-cache]
|
|
|
2524
2525
|
What `lint` and `ci:lint` of a generated project run: the ESLint of the project, through its API,
|
|
2525
2526
|
on the paths given (the project otherwise), its report in the format asked (`--format gitlab`
|
|
2526
2527
|
writes the Code Quality report as `eslint-formatter-gitlab` does), `--fix` as ESLint takes it.
|
|
2527
|
-
It exits 1 on an error, and on a warning as on an error,
|
|
2528
|
-
|
|
2529
|
-
an error. Those are shown in the report and listed after it, one line per rule, without failing:
|
|
2530
|
-
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
|
|
2531
2530
|
the install. See [Quality baseline](../../docs/tools/quality-baseline.md#warnings-fail-the-lint).
|
|
2532
2531
|
With `--json` ESLint reports in its JSON format and the command answers, on one line,
|
|
2533
|
-
`{ errors, warnings,
|
|
2532
|
+
`{ errors, warnings, report }` (`report` is the JSON report of ESLint), with the same
|
|
2534
2533
|
exit code and nothing on stderr.
|
|
2535
2534
|
|
|
2536
2535
|
The command lints with the cache of ESLint, keyed by the content of each file (`.eslintcache/`,
|
|
@@ -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"}
|
|
@@ -2,7 +2,7 @@ import type { SourceFile } from '../model/source-file.js';
|
|
|
2
2
|
import type { StringRecord } from '../scan/string-record.js';
|
|
3
3
|
/**
|
|
4
4
|
* The name a domain event class gives itself: `extends NamedDomainEvent('...')` or `static readonly eventName = '...'`, which its
|
|
5
|
-
* `readonly name` and its reactions read, or
|
|
5
|
+
* `readonly name` and its reactions read, or `readonly name = '...'` alone, the member the `DomainEvent` contract of the kernel asks.
|
|
6
6
|
*/
|
|
7
7
|
export declare function domainEventNames(file: SourceFile): StringRecord[];
|
|
8
8
|
//# sourceMappingURL=domain-event-names.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const NAME_PROPERTY = /(?<![\w$.])(?:name|eventName)\s*\??\s*(?:[:=]|:[^=;\n'"]+=)\s*$|(?<![\w$.])NamedDomainEvent\s*\(\s*$/;
|
|
3
3
|
/**
|
|
4
4
|
* The name a domain event class gives itself: `extends NamedDomainEvent('...')` or `static readonly eventName = '...'`, which its
|
|
5
|
-
* `readonly name` and its reactions read, or
|
|
5
|
+
* `readonly name` and its reactions read, or `readonly name = '...'` alone, the member the `DomainEvent` contract of the kernel asks.
|
|
6
6
|
*/
|
|
7
7
|
export function domainEventNames(file) {
|
|
8
8
|
return file.scan.strings.filter((literal) => NAME_PROPERTY.test(file.scan.code.slice(Math.max(0, literal.start - 200), literal.start)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/errors-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"errors-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/errors-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgDzD,CAAC"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
export const ERRORS_DOCS = {
|
|
2
2
|
'errors/code-unique': {
|
|
3
3
|
why: 'The code is the identity of a refusal for everything outside the domain: the HTTP mapper gives it a status, the OpenAPI document lists it, the audit trail and the span record it as the reason, a client branches on it and a test asserts it. Nothing downstream knows the class or the factory. Two refusals of one context under one code are therefore one refusal for every reader, whatever their messages say. The code is checked per context, since each context owns its language: the same code in two contexts is allowed, and the error mapper of the application gives it one status. Every form is read: the first argument of `refusal(..)` in a factory of a concept class, the `readonly code` field of a class per error, and under "stack.refusals": "named" the values of <context>.codes.ts, the code list of the context, where two keys under one value are reported. Judged under "stack.refusals": "factories" and "named": a project whose config does not say was written when an error was a class, and keeps working untouched.',
|
|
4
|
-
bad:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
static slotTaken(calendarId: string) {
|
|
15
|
-
return AppointmentError.refusal('SLOT_TAKEN', 'The slot is already held.', { calendarId });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static outsideAvailability(startsAt: Date) {
|
|
19
|
-
return AppointmentError.refusal('OUTSIDE_AVAILABILITY', 'The calendar takes no appointment then.', { startsAt });
|
|
20
|
-
}
|
|
21
|
-
}`,
|
|
4
|
+
bad: `// appointment.codes.ts
|
|
5
|
+
export const AppointmentCodes = {
|
|
6
|
+
SlotTaken: 'BOOKING_REFUSED',
|
|
7
|
+
OutsideAvailability: 'BOOKING_REFUSED',
|
|
8
|
+
} as const;`,
|
|
9
|
+
good: `// appointment.codes.ts
|
|
10
|
+
export const AppointmentCodes = {
|
|
11
|
+
SlotTaken: 'SLOT_TAKEN',
|
|
12
|
+
OutsideAvailability: 'OUTSIDE_AVAILABILITY',
|
|
13
|
+
} as const;`,
|
|
22
14
|
},
|
|
23
15
|
'errors/code-listed': {
|
|
24
16
|
why: 'Under "stack.refusals": "named" a refusal is a class of its own, `SlotTaken`, and its code is what everything outside the domain knows it by: the error mapper gives it a status, the OpenAPI document and the client list it, a test asserts it. The codes of a context are therefore one closed list, <context>.codes.ts, `export const SchedulingCodes = { SlotTaken: \'SLOT_TAKEN\' } as const`, and each class reads its code from it under its own name, `readonly code = SchedulingCodes.SlotTaken`: the list is the contract of the context in one file, two refusals cannot drift to one code unseen, and the type of each code stays its own literal. Reported: a refusal class (a class of domain/errors/ that extends DomainRefusal, abstract ones aside) without a code, with a code written another way (a string literal, another entry, the list of another context), a context with refusal classes and no codes.ts, a class whose name the list does not hold; in codes.ts, a list missing or not `as const`, a key that names no refusal class of the context (a code nothing raises), and a value that is not a string literal in constant case. The value is usually the name of the class in constant case, but need not be: a migrated project keeps its codes, since the code is the contract. Judged under "stack.refusals": "named" only.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-docs.js","sourceRoot":"","sources":["../../../src/check/explain/errors-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,oBAAoB,EAAE;QACpB,GAAG,EAAE,ggCAAggC;QACrgC,GAAG,EAAE
|
|
1
|
+
{"version":3,"file":"errors-docs.js","sourceRoot":"","sources":["../../../src/check/explain/errors-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,oBAAoB,EAAE;QACpB,GAAG,EAAE,ggCAAggC;QACrgC,GAAG,EAAE;;;;YAIG;QACR,IAAI,EAAE;;;;YAIE;KACT;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,qyCAAqyC;QAC1yC,GAAG,EAAE;;;;;;;;;EASP;QACE,IAAI,EAAE;;;;;;;;;;;;;;EAcR;KACC;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,ktCAAktC;QACvtC,GAAG,EAAE;iIACwH;QAC7H,IAAI,EAAE,0HAA0H;KACjI;CACF,CAAC"}
|
|
@@ -12,7 +12,7 @@ export const MODULE_DOCS = {
|
|
|
12
12
|
| \`waitlist\` | The waitlist of a calendar and the offers made to waiters. |`,
|
|
13
13
|
},
|
|
14
14
|
'module/complete': {
|
|
15
|
-
why: 'A context half divided into modules is read two ways at once: a concept may be in its module or still at the level of the context, and the reader has to look in both. Once a context declares modules, each module is one folder of the context holding its four layers, and every file of a layer belongs to one of them, with its specs in the module folder of its test folder (test/unit/<module>/). The context keeps at its own level what every module shares: the closed list of its error codes (<context>.codes.ts) and its permission set (<context>.permissions.ts) at its root, the schema, tables and migrations of its database (infrastructure/persistence/), its route groups, guards and shared shapes (presentation/http/), the fakes, builders and worlds of its specs, and the generated declarations. A module still where 0.86 and 0.87 put it (domain/<module>/) is reported too: `ddd-ts-kit context-layout` moves it. It is a warning so that a large context moves into its modules one cluster per commit, with `ddd-ts-kit move-to-module`, which rewrites the imports and takes the specs of a moved file with it.',
|
|
15
|
+
why: 'A context half divided into modules is read two ways at once: a concept may be in its module or still at the level of the context, and the reader has to look in both. Once a context declares modules, each module is one folder of the context holding its four layers, and every file of a layer belongs to one of them, with its specs in the module folder of its test folder (test/unit/<module>/). The context keeps at its own level what every module shares: the closed list of its error codes (<context>.codes.ts) and its permission set (<context>.permissions.ts) at its root, the schema, tables and migrations of its database (infrastructure/persistence/), its route groups, guards and shared shapes (presentation/http/), the fakes, builders and worlds of its specs, and the generated declarations. A module still where 0.86 and 0.87 put it (domain/<module>/) is reported too, as an error: `ddd-ts-kit context-layout` moves it. It is a warning so that a large context moves into its modules one cluster per commit, with `ddd-ts-kit move-to-module`, which rewrites the imports and takes the specs of a moved file with it.',
|
|
16
16
|
bad: `contexts/scheduling/calendars/domain/aggregates/calendar.aggregate.ts
|
|
17
17
|
contexts/scheduling/domain/aggregates/waitlist.aggregate.ts // still at the level of the context
|
|
18
18
|
contexts/scheduling/infrastructure/persistence/knex-waitlist.repository.ts // an adapter of the waitlist, outside it`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-docs.js","sourceRoot":"","sources":["../../../src/check/explain/module-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,iBAAiB,EAAE;QACjB,GAAG,EAAE,8rBAA8rB;QACnsB,GAAG,EAAE;0CACiC;QACtC,IAAI,EAAE;;;;;;8EAMoE;KAC3E;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"module-docs.js","sourceRoot":"","sources":["../../../src/check/explain/module-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,iBAAiB,EAAE;QACjB,GAAG,EAAE,8rBAA8rB;QACnsB,GAAG,EAAE;0CACiC;QACtC,IAAI,EAAE;;;;;;8EAMoE;KAC3E;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,gmCAAgmC;QACrmC,GAAG,EAAE;;uHAE8G;QACnH,IAAI,EAAE;;;;;6GAKmG;KAC1G;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,0jBAA0jB;QAC/jB,GAAG,EAAE;;;oGAG2F;QAChG,IAAI,EAAE;;oFAE0E;KACjF;CACF,CAAC"}
|
|
@@ -35,9 +35,9 @@ export class PinoLogger implements Logger {}`,
|
|
|
35
35
|
'governance/recorded-deviation': {
|
|
36
36
|
why: 'The architecture can be changed deliberately, not case by case. A suppression, a lowered severity or a widened list that points to no decision is indistinguishable from a shortcut, and gets copied. The decision record says why, for what scope and until when, so the exception can be reviewed today and removed later.',
|
|
37
37
|
bad: `// eslint-disable-next-line no-console -- needed for the demo
|
|
38
|
-
"rules": { "test/spec-required": "off" }`,
|
|
38
|
+
"rules": { "test/spec-required": { "severity": "off", "files": ["src/contexts/billing/infrastructure/**"] } }`,
|
|
39
39
|
good: `// eslint-disable-next-line no-console -- ADR-0004: startup banner read by operations
|
|
40
|
-
"rules": { "test/spec-required": "off" },
|
|
40
|
+
"rules": { "test/spec-required": { "severity": "off", "files": ["src/contexts/billing/infrastructure/**"] } },
|
|
41
41
|
"deviations": [{ "what": "rules.test/spec-required", "adr": "0009", "reason": "Generated adapters are covered by the contract suite." }]
|
|
42
42
|
// docs/adr/0004-startup-banner.md, docs/adr/0009-no-spec-for-generated-adapters.md`,
|
|
43
43
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-docs.js","sourceRoot":"","sources":["../../../src/check/explain/standard-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC9D,oBAAoB,EAAE;QACpB,GAAG,EAAE,8cAA8c;QACnd,GAAG,EAAE;wDAC+C;QACpD,IAAI,EAAE;;;wDAG8C;KACrD;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,yiBAAyiB;QAC9iB,GAAG,EAAE;4CACmC;QACxC,IAAI,EAAE;;wDAE8C;KACrD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,qkBAAqkB;QAC1kB,GAAG,EAAE;;;;;gFAKuE;QAC5E,IAAI,EAAE;;;;;;6CAMmC;KAC1C;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,8TAA8T;QACnU,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"standard-docs.js","sourceRoot":"","sources":["../../../src/check/explain/standard-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC9D,oBAAoB,EAAE;QACpB,GAAG,EAAE,8cAA8c;QACnd,GAAG,EAAE;wDAC+C;QACpD,IAAI,EAAE;;;wDAG8C;KACrD;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,yiBAAyiB;QAC9iB,GAAG,EAAE;4CACmC;QACxC,IAAI,EAAE;;wDAE8C;KACrD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,qkBAAqkB;QAC1kB,GAAG,EAAE;;;;;gFAKuE;QAC5E,IAAI,EAAE;;;;;;6CAMmC;KAC1C;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,8TAA8T;QACnU,GAAG,EAAE;8GACqG;QAC1G,IAAI,EAAE;;;oFAG0E;KACjF;CACF,CAAC"}
|
|
@@ -30,7 +30,7 @@ export class IssueInvoiceHandler {}
|
|
|
30
30
|
export class InvoiceIssuedEventHandler {}`,
|
|
31
31
|
},
|
|
32
32
|
'declarations/barrel-current': {
|
|
33
|
-
why: 'With stack.assembly set to barrel, the composition root assembles a context from <context>.declarations.ts and from nothing else. That file only re-exports the generated <layer>.declarations.ts of each layer of the context that holds a role file (application/application.declarations.ts, infrastructure/infrastructure.declarations.ts, presentation/presentation.declarations.ts), in each module of its model. A role file added by hand and missing from the declarations of its layer compiles, passes its unit tests and is never registered. The same file registers what each constructor of its layer is injected, read from its signature: a constructor changed without regenerating would be given the dependencies of the old one. Each file is derived from the tree, one export per role file sorted by path then one injected(Class, [Tokens]) per class that takes something, so it is compared with what the tree says, and the message names the class whose list is stale; the declarations of a layer that holds no role file any more are reported until they are deleted. A context still declared as an earlier version wrote it,
|
|
33
|
+
why: 'With stack.assembly set to barrel, the composition root assembles a context from <context>.declarations.ts and from nothing else. That file only re-exports the generated <layer>.declarations.ts of each layer of the context that holds a role file (application/application.declarations.ts, infrastructure/infrastructure.declarations.ts, presentation/presentation.declarations.ts), in each module of its model. A role file added by hand and missing from the declarations of its layer compiles, passes its unit tests and is never registered. The same file registers what each constructor of its layer is injected, read from its signature: a constructor changed without regenerating would be given the dependencies of the old one. Each file is derived from the tree, one export per role file sorted by path then one injected(Class, [Tokens]) per class that takes something, so it is compared with what the tree says, and the message names the class whose list is stale; the declarations of a layer that holds no role file any more are reported until they are deleted. A context still declared as an earlier version wrote 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 (application/commands/commands.declarations.ts), is reported once, at its summary, and ddd-ts-kit docs moves it to the files of its layers. With stack.assembly set to discovery the role files are found at startup, <context>.dependencies.ts holds the lists alone and is compared the same way, and generated declarations left behind are reported.',
|
|
34
34
|
bad: `// application/application.declarations.ts, while IssueInvoiceHandler now also takes a Clock
|
|
35
35
|
export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command';
|
|
36
36
|
export * from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.handler';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring-docs.js","sourceRoot":"","sources":["../../../src/check/explain/wiring-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,4BAA4B,EAAE;QAC5B,GAAG,EAAE,2uBAA2uB;QAChvB,GAAG,EAAE;;;sCAG6B;QAClC,IAAI,EAAE;;;;;;+CAMqC;KAC5C;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,irBAAirB;QACtrB,GAAG,EAAE;;;;;;wBAMe;QACpB,IAAI,EAAE;;;;;0CAKgC;KACvC;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"wiring-docs.js","sourceRoot":"","sources":["../../../src/check/explain/wiring-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,4BAA4B,EAAE;QAC5B,GAAG,EAAE,2uBAA2uB;QAChvB,GAAG,EAAE;;;sCAG6B;QAClC,IAAI,EAAE;;;;;;+CAMqC;KAC5C;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,irBAAirB;QACtrB,GAAG,EAAE;;;;;;wBAMe;QACpB,IAAI,EAAE;;;;;0CAKgC;KACvC;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,mjDAAmjD;QACxjD,GAAG,EAAE;;;;;;;6FAOoF;QACzF,IAAI,EAAE;;;;;;;;;;;;;;+EAcqE;KAC5E;IACD,oCAAoC,EAAE;QACpC,GAAG,EAAE,omCAAomC;QACzmC,GAAG,EAAE;;;;;;;;;iEASwD;QAC7D,IAAI,EAAE;;;;;;;EAOR;KACC;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,o8BAAo8B;QACz8B,GAAG,EAAE;+DACsD;QAC3D,IAAI,EAAE;;;;;;;+DAOqD;KAC5D;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,+bAA+b;QACpc,GAAG,EAAE;yIACgI;QACrI,IAAI,EAAE;yIAC+H;KACtI;IACD,cAAc,EAAE;QACd,GAAG,EAAE,kXAAkX;QACvX,GAAG,EAAE;;uEAE8D;QACnE,IAAI,EAAE;;2IAEiI;KACxI;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,qMAAqM;QAC1M,GAAG,EAAE,qDAAqD;QAC1D,IAAI,EAAE,qGAAqG;KAC5G;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Fixture } from './fixture.js';
|
|
2
|
-
/** The code list and the permission set of a context: at its root, and
|
|
2
|
+
/** The code list and the permission set of a context: at its root, and where 0.86 and 0.87 kept them, an error. */
|
|
3
3
|
export declare const CONTEXT_FILE_FIXTURES: readonly Fixture[];
|
|
4
4
|
//# sourceMappingURL=context-file-fixtures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-file-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/context-file-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,
|
|
1
|
+
{"version":3,"file":"context-file-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/context-file-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,mHAAmH;AACnH,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,EAyBnD,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { source } from './source.js';
|
|
|
4
4
|
const { BILLING } = PATHS;
|
|
5
5
|
const CODES = source("export const BillingCodes = { InvoiceVoid: 'INVOICE_VOID' } as const;");
|
|
6
6
|
const PERMISSIONS = source("import { definePermissions } from '@ddd-ts-kit/auth';", '', "export const billingPermissions = definePermissions('billing', {", " 'invoice.issue': { description: 'Issue invoice' },", '});');
|
|
7
|
-
/** The code list and the permission set of a context: at its root, and
|
|
7
|
+
/** The code list and the permission set of a context: at its root, and where 0.86 and 0.87 kept them, an error. */
|
|
8
8
|
export const CONTEXT_FILE_FIXTURES = [
|
|
9
9
|
{
|
|
10
10
|
ruleId: 'tree/closed',
|
|
@@ -14,21 +14,19 @@ export const CONTEXT_FILE_FIXTURES = [
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
ruleId: 'tree/closed',
|
|
17
|
-
name: 'the code list where 0.86 and 0.87 kept it:
|
|
17
|
+
name: 'the code list where 0.86 and 0.87 kept it: an error, which context-layout moves',
|
|
18
18
|
expect: { file: `${BILLING}/domain/errors/codes.ts` },
|
|
19
|
-
severity: 'warn',
|
|
20
19
|
files: project({ [`${BILLING}/domain/errors/codes.ts`]: CODES }),
|
|
21
20
|
},
|
|
22
21
|
{
|
|
23
22
|
ruleId: 'tree/closed',
|
|
24
|
-
name: 'the permission set where 0.86 and 0.87 kept it:
|
|
23
|
+
name: 'the permission set where 0.86 and 0.87 kept it: an error, which context-layout moves',
|
|
25
24
|
expect: { file: `${BILLING}/application/authorization/billing.permissions.ts` },
|
|
26
|
-
severity: 'warn',
|
|
27
25
|
files: project({ [`${BILLING}/application/authorization/billing.permissions.ts`]: PERMISSIONS }),
|
|
28
26
|
},
|
|
29
27
|
{
|
|
30
28
|
ruleId: 'tree/closed',
|
|
31
|
-
name: 'the code list at the root and where 0.86 and 0.87 kept it:
|
|
29
|
+
name: 'the code list at the root and where 0.86 and 0.87 kept it: one of each',
|
|
32
30
|
expect: { file: `${BILLING}/domain/errors/codes.ts` },
|
|
33
31
|
files: project({ [`${BILLING}/billing.codes.ts`]: CODES, [`${BILLING}/domain/errors/codes.ts`]: CODES }),
|
|
34
32
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-file-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/context-file-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAE1B,MAAM,KAAK,GAAG,MAAM,CAAC,uEAAuE,CAAC,CAAC;AAE9F,MAAM,WAAW,GAAG,MAAM,CACxB,uDAAuD,EACvD,EAAE,EACF,kEAAkE,EAClE,sDAAsD,EACtD,KAAK,CACN,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"context-file-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/context-file-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAE1B,MAAM,KAAK,GAAG,MAAM,CAAC,uEAAuE,CAAC,CAAC;AAE9F,MAAM,WAAW,GAAG,MAAM,CACxB,uDAAuD,EACvD,EAAE,EACF,kEAAkE,EAClE,sDAAsD,EACtD,KAAK,CACN,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,MAAM,qBAAqB,GAAuB;IACvD;QACE,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,mEAAmE;QACzE,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAAE,WAAW,EAAE,CAAC;KAC/G;IACD;QACE,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,iFAAiF;QACvF,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,yBAAyB,EAAE;QACrD,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAAE,KAAK,EAAE,CAAC;KACjE;IACD;QACE,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,sFAAsF;QAC5F,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,mDAAmD,EAAE;QAC/E,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,mDAAmD,CAAC,EAAE,WAAW,EAAE,CAAC;KACjG;IACD;QACE,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,wEAAwE;QAC9E,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,yBAAyB,EAAE;QACrD,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAAE,KAAK,EAAE,CAAC;KACzG;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earlier-declarations-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/earlier-declarations-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBzC,sGAAsG;AACtG,eAAO,MAAM,6BAA6B,EAAE,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"earlier-declarations-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/earlier-declarations-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBzC,sGAAsG;AACtG,eAAO,MAAM,6BAA6B,EAAE,SAAS,OAAO,EA2C3D,CAAC"}
|