ddd-ts-kit 0.21.0 → 0.23.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 +85 -0
- package/README.fr.md +15 -3
- package/README.md +13 -2
- package/dist/check/commands/changed-files.d.ts +6 -1
- package/dist/check/commands/changed-files.d.ts.map +1 -1
- package/dist/check/commands/changed-files.js +15 -11
- package/dist/check/commands/changed-files.js.map +1 -1
- package/dist/check/events/domain-event-names.d.ts +1 -1
- package/dist/check/events/domain-event-names.d.ts.map +1 -1
- package/dist/check/events/domain-event-names.js +2 -2
- package/dist/check/events/domain-event-names.js.map +1 -1
- package/dist/check/explain/authz-docs.js +1 -1
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/clean-docs.js +1 -1
- package/dist/check/explain/clean-docs.js.map +1 -1
- package/dist/check/explain/events-docs.d.ts.map +1 -1
- package/dist/check/explain/events-docs.js +2 -5
- package/dist/check/explain/events-docs.js.map +1 -1
- package/dist/check/explain/language-docs.js +1 -1
- package/dist/check/explain/language-docs.js.map +1 -1
- package/dist/check/explain/layout-docs.js +1 -1
- package/dist/check/explain/layout-docs.js.map +1 -1
- package/dist/check/explain/schema-docs.js +1 -1
- package/dist/check/explain/schema-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +12 -0
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/clean-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/clean-fixtures.js +2 -1
- package/dist/check/fixtures/clean-fixtures.js.map +1 -1
- package/dist/check/fixtures/layout-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/layout-fixtures.js +15 -0
- package/dist/check/fixtures/layout-fixtures.js.map +1 -1
- package/dist/check/fixtures/schema-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/schema-fixtures.js +10 -0
- package/dist/check/fixtures/schema-fixtures.js.map +1 -1
- package/dist/check/fixtures/vocabulary-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/vocabulary-fixtures.js +23 -0
- package/dist/check/fixtures/vocabulary-fixtures.js.map +1 -1
- package/dist/check/rules/authz-policy-asked.js +5 -4
- package/dist/check/rules/authz-policy-asked.js.map +1 -1
- package/dist/check/rules/clean-file-size.d.ts.map +1 -1
- package/dist/check/rules/clean-file-size.js +28 -14
- package/dist/check/rules/clean-file-size.js.map +1 -1
- package/dist/check/rules/clean-function-size.js +2 -2
- package/dist/check/rules/clean-function-size.js.map +1 -1
- package/dist/check/rules/events-name-declared-once.d.ts.map +1 -1
- package/dist/check/rules/events-name-declared-once.js +6 -6
- package/dist/check/rules/events-name-declared-once.js.map +1 -1
- package/dist/check/rules/language-declared-vocabulary.d.ts.map +1 -1
- package/dist/check/rules/language-declared-vocabulary.js +23 -3
- package/dist/check/rules/language-declared-vocabulary.js.map +1 -1
- package/dist/check/schemas/still-generated.js +1 -1
- package/dist/check/schemas/still-generated.js.map +1 -1
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/status.d.ts +4 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +12 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/todo.d.ts +1 -1
- package/dist/commands/todo.d.ts.map +1 -1
- package/dist/commands/todo.js +2 -1
- package/dist/commands/todo.js.map +1 -1
- package/dist/commands/verify-slice.d.ts +4 -0
- package/dist/commands/verify-slice.d.ts.map +1 -0
- package/dist/commands/verify-slice.js +21 -0
- package/dist/commands/verify-slice.js.map +1 -0
- package/dist/generate/given-name.d.ts +15 -0
- package/dist/generate/given-name.d.ts.map +1 -0
- package/dist/generate/given-name.js +21 -0
- package/dist/generate/given-name.js.map +1 -0
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/assert-declares-its-name.js +1 -1
- package/dist/generate/kinds/assert-declares-its-name.js.map +1 -1
- package/dist/generate/kinds/declares-its-name.d.ts +1 -1
- package/dist/generate/kinds/declares-its-name.d.ts.map +1 -1
- package/dist/generate/kinds/declares-its-name.js +2 -2
- package/dist/generate/kinds/declares-its-name.js.map +1 -1
- package/dist/generate/kinds/event-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/event-handler-kind.js +7 -4
- package/dist/generate/kinds/event-handler-kind.js.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.js +8 -2
- package/dist/generate/kinds/integration-handler-kind.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +4 -1
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +7 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +2 -1
- package/dist/help/usage.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/write-agent-settings.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +1 -0
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/progress/format-progress.js +7 -1
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/progress/progress.d.ts +4 -0
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/read-progress.js +4 -1
- package/dist/progress/read-progress.js.map +1 -1
- package/dist/progress/read-slice-rules.d.ts.map +1 -1
- package/dist/progress/read-slice-rules.js +6 -2
- package/dist/progress/read-slice-rules.js.map +1 -1
- package/dist/progress/remaining-in.d.ts.map +1 -1
- package/dist/progress/remaining-in.js +10 -8
- package/dist/progress/remaining-in.js.map +1 -1
- package/dist/progress/remaining.d.ts +3 -3
- package/dist/progress/remaining.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/slice/format-slice-verification.d.ts +4 -0
- package/dist/slice/format-slice-verification.d.ts.map +1 -0
- package/dist/slice/format-slice-verification.js +40 -0
- package/dist/slice/format-slice-verification.js.map +1 -0
- package/dist/slice/near-the-limit.d.ts +7 -0
- package/dist/slice/near-the-limit.d.ts.map +1 -0
- package/dist/slice/near-the-limit.js +24 -0
- package/dist/slice/near-the-limit.js.map +1 -0
- package/dist/slice/paths-to-stage.d.ts +6 -0
- package/dist/slice/paths-to-stage.d.ts.map +1 -0
- package/dist/slice/paths-to-stage.js +13 -0
- package/dist/slice/paths-to-stage.js.map +1 -0
- package/dist/slice/run-script.d.ts +9 -0
- package/dist/slice/run-script.d.ts.map +1 -0
- package/dist/slice/run-script.js +26 -0
- package/dist/slice/run-script.js.map +1 -0
- package/dist/slice/script-call.d.ts +9 -0
- package/dist/slice/script-call.d.ts.map +1 -0
- package/dist/slice/script-call.js +2 -0
- package/dist/slice/script-call.js.map +1 -0
- package/dist/slice/script-run.d.ts +6 -0
- package/dist/slice/script-run.d.ts.map +1 -0
- package/dist/slice/script-run.js +2 -0
- package/dist/slice/script-run.js.map +1 -0
- package/dist/slice/sized-file.d.ts +6 -0
- package/dist/slice/sized-file.d.ts.map +1 -0
- package/dist/slice/sized-file.js +2 -0
- package/dist/slice/sized-file.js.map +1 -0
- package/dist/slice/slice-to-verify.d.ts +9 -0
- package/dist/slice/slice-to-verify.d.ts.map +1 -0
- package/dist/slice/slice-to-verify.js +2 -0
- package/dist/slice/slice-to-verify.js.map +1 -0
- package/dist/slice/slice-verification.d.ts +15 -0
- package/dist/slice/slice-verification.d.ts.map +1 -0
- package/dist/slice/slice-verification.js +2 -0
- package/dist/slice/slice-verification.js.map +1 -0
- package/dist/slice/verify-slice.d.ts +10 -0
- package/dist/slice/verify-slice.d.ts.map +1 -0
- package/dist/slice/verify-slice.js +47 -0
- package/dist/slice/verify-slice.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.d.ts.map +1 -1
- package/dist/worker/briefing-of.js +33 -11
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/worker/changed-files.d.ts +7 -0
- package/dist/worker/changed-files.d.ts.map +1 -0
- package/dist/worker/changed-files.js +20 -0
- package/dist/worker/changed-files.js.map +1 -0
- package/dist/worker/format-workers.d.ts +4 -0
- package/dist/worker/format-workers.d.ts.map +1 -0
- package/dist/worker/format-workers.js +47 -0
- package/dist/worker/format-workers.js.map +1 -0
- package/dist/worker/list-worktrees.d.ts +10 -0
- package/dist/worker/list-worktrees.d.ts.map +1 -0
- package/dist/worker/list-worktrees.js +18 -0
- package/dist/worker/list-worktrees.js.map +1 -0
- package/dist/worker/open-worker-scope.d.ts.map +1 -1
- package/dist/worker/open-worker-scope.js +6 -7
- package/dist/worker/open-worker-scope.js.map +1 -1
- package/dist/worker/overlaps-of.d.ts +4 -0
- package/dist/worker/overlaps-of.d.ts.map +1 -0
- package/dist/worker/overlaps-of.js +17 -0
- package/dist/worker/overlaps-of.js.map +1 -0
- package/dist/worker/read-worker-file.d.ts +4 -0
- package/dist/worker/read-worker-file.d.ts.map +1 -0
- package/dist/worker/read-worker-file.js +18 -0
- package/dist/worker/read-worker-file.js.map +1 -0
- package/dist/worker/read-workers.d.ts +8 -0
- package/dist/worker/read-workers.d.ts.map +1 -0
- package/dist/worker/read-workers.js +56 -0
- package/dist/worker/read-workers.js.map +1 -0
- package/dist/worker/report-file.d.ts +3 -0
- package/dist/worker/report-file.d.ts.map +1 -0
- package/dist/worker/report-file.js +3 -0
- package/dist/worker/report-file.js.map +1 -0
- package/dist/worker/worker-file.d.ts +14 -0
- package/dist/worker/worker-file.d.ts.map +1 -0
- package/dist/worker/worker-file.js +2 -0
- package/dist/worker/worker-file.js.map +1 -0
- package/dist/worker/worker-generators.d.ts +4 -1
- package/dist/worker/worker-generators.d.ts.map +1 -1
- package/dist/worker/worker-generators.js +5 -2
- package/dist/worker/worker-generators.js.map +1 -1
- package/dist/worker/workers-status.d.ts +48 -0
- package/dist/worker/workers-status.d.ts.map +1 -0
- package/dist/worker/workers-status.js +2 -0
- package/dist/worker/workers-status.js.map +1 -0
- package/package.json +2 -2
- package/templates/domain-event/domain-event.ts.tpl +5 -7
- package/templates/event-handler/event-handler.declared.ts.tpl +1 -1
- package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
- package/templates/event-handler/event-handler.ts.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +4 -4
- package/templates/event-handler/wiring.tsyringe.tpl +4 -4
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/domain/events/account-deactivated.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/account-provisioned.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/delegation-granted.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/delegation-revoked.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/invitation-accepted.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/invitation-declined.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/invitation-issued.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/invitation-revoked.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/member-joined.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/member-removed.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/member-role-changed.event.ts.tpl +5 -7
- package/templates/presets/identity/context/domain/events/organisation-opened.event.ts.tpl +5 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,91 @@ 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.23.0
|
|
8
|
+
|
|
9
|
+
**A domain event declares its name once, with `NamedDomainEvent`.** `export class InvoiceIssued
|
|
10
|
+
extends NamedDomainEvent('billing.invoice.issued') { .. }` gives the class `eventName` and each
|
|
11
|
+
instance `name`, both typed with the literal, in place of the two lines `static readonly eventName`
|
|
12
|
+
and `readonly name = X.eventName`. The generators and the identity preset write it; the rules and
|
|
13
|
+
generators that read an event's name recognise it. The former form stays accepted.
|
|
14
|
+
|
|
15
|
+
**`verify-slice` closes a slice in one run.** `npx ddd-ts-kit verify-slice <context> --since
|
|
16
|
+
<trunk>` runs the `regenerate` script, the architecture rules on the files changed since the trunk
|
|
17
|
+
(new files included) and the `test` script for the context, then names the changed files past 300
|
|
18
|
+
of the 350 lines and the paths to stage, one by one. Every step runs, so one answer says all that is
|
|
19
|
+
left; it exits 1 while a step fails. The briefing of `worker-scope` and the `context-builder` agent
|
|
20
|
+
use it in place of three commands. It needs the `regenerate` script of 0.21: run
|
|
21
|
+
`npx ddd-ts-kit init --force` if it is missing.
|
|
22
|
+
|
|
23
|
+
**`status --workers` shows who builds what.** For each git worktree that `worker-scope` prepared:
|
|
24
|
+
its branch, context, rows, base, commits ahead, the files it changed and its report; then the files
|
|
25
|
+
more than one worker changed, where the second merge will conflict. `worker-scope` now writes the
|
|
26
|
+
rows, the base and the branch in `.ddd-ts-kit/worker.json`. `parallel-work` has the conductor run
|
|
27
|
+
it before briefing a second worker in a context and before each merge, and says how a stacked
|
|
28
|
+
branch moves its own commits onto the trunk after a squash merge.
|
|
29
|
+
|
|
30
|
+
**A non-blocking review remark is a `TODO(review)` marker.** `architecture-reviewer` sorts its
|
|
31
|
+
findings into blocking and non-blocking, and gives each non-blocking one its `file:line` and the
|
|
32
|
+
marker line to write there. `todo` lists `TODO(review)`, `status` counts it per context. A slice
|
|
33
|
+
may merge with such markers; a story or a milestone is closed when none is left, each handled or
|
|
34
|
+
dismissed by a decision record.
|
|
35
|
+
|
|
36
|
+
**Slices are numbered within their story.** `plan-slices` gives each row the code of its story or
|
|
37
|
+
milestone and a number within it (`US5.03`, `M2.07`), never one sequence across stories, and an id
|
|
38
|
+
is never renumbered. `status` names a bare number. A rule line under the slices tables may omit the
|
|
39
|
+
`#` (`- 5.01: ..`): `worker-scope` reads it. A slice that changes a behaviour already delivered
|
|
40
|
+
adapts its tests in the same row. The example application numbers its rows `M1.01` to `M1.39`.
|
|
41
|
+
|
|
42
|
+
**The briefing of a worker says what blocks.** A worker marks each need of its report blocking (a
|
|
43
|
+
migration, a contract field, a shared file, a dependency) or a note for the merge, and the run goes
|
|
44
|
+
on for a note. It records a decision of its own slices with `generate adr` (without `--deviation`,
|
|
45
|
+
which stays the conductor's), formats with `npm run format` only, and is done when `npm run verify`
|
|
46
|
+
passes on the whole tree. The conductor merges the trunk into a branch before its review and
|
|
47
|
+
`verify`. Only the conductor prepares a worktree: the guard refuses `worker-scope` without
|
|
48
|
+
`--dry-run` to a sub-agent.
|
|
49
|
+
|
|
50
|
+
**`check --changed-since` judges the new files.** A file git does not track yet, as a generator
|
|
51
|
+
just wrote it, was left out until it was staged; it is judged now.
|
|
52
|
+
|
|
53
|
+
**`clean/file-size` judges `test/` and `scripts/`, and tells an aggregate how to shrink.**
|
|
54
|
+
`ddd-ts-kit check` now holds the end-to-end specs and the scripts to the 350 lines, as the ESLint
|
|
55
|
+
rule already did in the lint gate. For an aggregate past the limit, the fix names a domain service
|
|
56
|
+
that returns the new state and its events, which the aggregate applies, or a value object; never a
|
|
57
|
+
public setter.
|
|
58
|
+
|
|
59
|
+
**`language/declared-vocabulary` leaves the storage names alone.** In `infrastructure/persistence/`,
|
|
60
|
+
the name of a column, a table or a schema (the first argument of a call, `name`, `tableName`,
|
|
61
|
+
`schema`) is no longer taken for a value of a vocabulary; a stored value (`.default(..)`, a value
|
|
62
|
+
compared in a query) still is.
|
|
63
|
+
|
|
64
|
+
To move: run `npx ddd-ts-kit init --force`, which adds the `regenerate` script when it is missing
|
|
65
|
+
and allows `verify-slice` to agents in `.claude/settings.json`; run
|
|
66
|
+
`npx ddd-ts-kit check` once and split each file of `test/` or `scripts/` it reports past 350 lines
|
|
67
|
+
(the lint gate already refused them).
|
|
68
|
+
|
|
69
|
+
## 0.22.0
|
|
70
|
+
|
|
71
|
+
**A context builder keeps its report current and regenerates with each slice.** The
|
|
72
|
+
`context-builder` agent has 150 turns instead of 80, and after each step of a slice it rewrites
|
|
73
|
+
`.ddd-ts-kit/report.md` in its worktree, in the form of its final report: an agent that stops
|
|
74
|
+
early leaves its state there, and `parallel-work` tells the conductor to read it. The guard lets a
|
|
75
|
+
worker write that one file. After each slice the worker runs `npm run regenerate` and commits the
|
|
76
|
+
derived files with it, as the briefing of `worker-scope` now says: they were left to the conductor,
|
|
77
|
+
so a worker stopped on "regenerate" and the run stopped with it. The agent never shortens a
|
|
78
|
+
comment, a test or a written rule to stay under a size limit: it extracts instead.
|
|
79
|
+
|
|
80
|
+
**`generate event-handler` and `generate integration-handler` take `--name <Name>`.** A reaction
|
|
81
|
+
was named after the event it handles; when the design names it after what it does in its context,
|
|
82
|
+
`--name` gives that name to the file, the class, the spec and the registration, and for an
|
|
83
|
+
integration handler to its consumer name and its system actor. The name passes the same checks
|
|
84
|
+
as any concept of the context (`--term`, `--allow-name`). Without it, nothing changes.
|
|
85
|
+
|
|
86
|
+
**`clean/function-size` names the fix.** More than three parameters: group them in a typed props
|
|
87
|
+
object or a value object (`Invoice.draft({ ... })`), never a fourth parameter. A `describe`
|
|
88
|
+
past the 100-line ceiling: one top-level `describe` per behaviour, in the same file. The ESLint
|
|
89
|
+
rule no longer takes production code such as `context.run(callback)` for a group of tests: such a
|
|
90
|
+
callback is now held to the limit of a function, and may be reported where it was not.
|
|
91
|
+
|
|
7
92
|
## 0.21.0
|
|
8
93
|
|
|
9
94
|
**A rule can be set for some files only, and a rule off everywhere is said.** `rules.<id>` in
|
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:f6e0fcc61902b03c -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit
|
|
5
5
|
|
|
@@ -1067,7 +1067,7 @@ dans chaque `CONTEXT.md`.
|
|
|
1067
1067
|
## status, todo
|
|
1068
1068
|
|
|
1069
1069
|
```
|
|
1070
|
-
ddd-ts-kit status
|
|
1070
|
+
ddd-ts-kit status [--workers]
|
|
1071
1071
|
ddd-ts-kit todo [<context>]
|
|
1072
1072
|
```
|
|
1073
1073
|
|
|
@@ -1079,6 +1079,18 @@ quand leur fichier manque, `slices` contient `{ file, rows, byStatus, byOwner }`
|
|
|
1079
1079
|
`{ context, domain, platform, test }` par contexte, et un avec un `context` vide pour ce qui reste
|
|
1080
1080
|
hors d'eux.
|
|
1081
1081
|
|
|
1082
|
+
`status --workers` affiche à la place les *workers* d'une construction en parallèle : chaque
|
|
1083
|
+
*worktree* du dépôt dont la copie du projet porte `.ddd-ts-kit/worker.json`, avec sa branche,
|
|
1084
|
+
son contexte, ses lignes, sa base, les *commits* qu'il a d'avance sur la base, les fichiers qu'il
|
|
1085
|
+
a changés (commités depuis la base de fusion, modifiés, et non suivis mais non ignorés, relatifs
|
|
1086
|
+
au sommet du dépôt) et son `.ddd-ts-kit/report.md` avec sa date d'écriture ; puis les contextes
|
|
1087
|
+
construits par plus d'un *worker* et les fichiers changés par plus d'un *worker*, chacun avec
|
|
1088
|
+
leurs *worktrees*. Un fichier de périmètre qui ne porte que le contexte est lu aussi : le
|
|
1089
|
+
*worker* vient sans ses lignes, sa base ni son avance, et ses fichiers sont les fichiers non
|
|
1090
|
+
commités. `--json` affiche
|
|
1091
|
+
`{ workers: [{ worktree, branch, context, rows, base, ahead, files, report }], overlaps: { contexts: [{ context, worktrees }], files: [{ file, worktrees }] } }`,
|
|
1092
|
+
`report` valant `{ file, modified }` ou `null`. Sans *worker*, elle le dit en une ligne.
|
|
1093
|
+
|
|
1082
1094
|
`todo` liste ces marqueurs en `file:line` avec leur genre et leur texte, dans le projet ou dans
|
|
1083
1095
|
un contexte ; `--json` affiche `{ count, remaining: [{ kind, context, file, line, text }] }`.
|
|
1084
1096
|
|
|
@@ -1091,7 +1103,7 @@ ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <
|
|
|
1091
1103
|
Prépare la place d'un *worker* d'un build réparti par contexte : crée un *worktree* git du projet
|
|
1092
1104
|
(`../<project>-<context>` par défaut) sur la branche `build/<context>`, à partir de `--base` (une
|
|
1093
1105
|
branche, une étiquette ou un *commit* : `origin/main` ; par défaut la branche courante), y écrit
|
|
1094
|
-
`.ddd-ts-kit/worker.json` (`{
|
|
1106
|
+
`.ddd-ts-kit/worker.json` (`{ context, rows, base, branch }` ; `init` ignore `.ddd-ts-kit/`), et
|
|
1095
1107
|
affiche la consigne du *worker* : son périmètre, les générateurs qu'il peut lancer, ses tranches
|
|
1096
1108
|
encore à faire d'après `docs/architecture/slices.md`, les langages publiés qu'il consomme, et la
|
|
1097
1109
|
base comme tronc de ses vérifications (`check --changed-since <base>`). `--rows 4.15,4.16` ne
|
package/README.md
CHANGED
|
@@ -1016,7 +1016,7 @@ each `CONTEXT.md`.
|
|
|
1016
1016
|
## status, todo
|
|
1017
1017
|
|
|
1018
1018
|
```
|
|
1019
|
-
ddd-ts-kit status
|
|
1019
|
+
ddd-ts-kit status [--workers]
|
|
1020
1020
|
ddd-ts-kit todo [<context>]
|
|
1021
1021
|
```
|
|
1022
1022
|
|
|
@@ -1028,6 +1028,17 @@ file is missing, `slices` holds `{ file, rows, byStatus, byOwner }`, `remaining`
|
|
|
1028
1028
|
`{ context, domain, platform, test }` per context, and one with an empty `context` for what is
|
|
1029
1029
|
left outside them.
|
|
1030
1030
|
|
|
1031
|
+
`status --workers` prints the workers of a parallel build instead: each worktree of the
|
|
1032
|
+
repository whose copy of the project holds `.ddd-ts-kit/worker.json`, with its branch, its
|
|
1033
|
+
context, its rows, its base, the commits it is ahead of the base, the files it changed (committed
|
|
1034
|
+
since the merge base, modified, and untracked but not ignored, relative to the top of the
|
|
1035
|
+
repository) and its `.ddd-ts-kit/report.md` with when it was written; then the contexts built by
|
|
1036
|
+
more than one worker and the files changed by more than one worker, each with their worktrees.
|
|
1037
|
+
A scope file that holds the context only is read too: the worker comes without its rows, its
|
|
1038
|
+
base and its commits ahead, and its files are the uncommitted ones. `--json` prints
|
|
1039
|
+
`{ workers: [{ worktree, branch, context, rows, base, ahead, files, report }], overlaps: { contexts: [{ context, worktrees }], files: [{ file, worktrees }] } }`,
|
|
1040
|
+
`report` being `{ file, modified }` or `null`. Without a worker it says so in one line.
|
|
1041
|
+
|
|
1031
1042
|
`todo` lists those markers as `file:line` with their kind and their text, in the project or in one
|
|
1032
1043
|
context; `--json` prints `{ count, remaining: [{ kind, context, file, line, text }] }`.
|
|
1033
1044
|
|
|
@@ -1040,7 +1051,7 @@ ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <
|
|
|
1040
1051
|
Prepares the place of one worker of a build split by context: creates a git worktree of the
|
|
1041
1052
|
project (`../<project>-<context>` by default) on the branch `build/<context>`, cut from
|
|
1042
1053
|
`--base` (a branch, a tag or a commit: `origin/main`; by default the current branch), writes
|
|
1043
|
-
`.ddd-ts-kit/worker.json` in it (`{
|
|
1054
|
+
`.ddd-ts-kit/worker.json` in it (`{ context, rows, base, branch }`; `init` ignores `.ddd-ts-kit/`), and
|
|
1044
1055
|
prints the briefing of the worker: its scope, the generators it may run, its slices still to do
|
|
1045
1056
|
from `docs/architecture/slices.md`, the published languages it consumes, and the base as the
|
|
1046
1057
|
trunk of its checks (`check --changed-since <base>`). `--rows 4.15,4.16` briefs those rows only,
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* The files changed since `ref`, relative to the project root: committed since the merge base,
|
|
3
|
+
* modified in the working tree, and new files git does not track yet, which a generator has just
|
|
4
|
+
* written and nothing has staged. The only place git is invoked, and only to read the user's own
|
|
5
|
+
* history.
|
|
6
|
+
*/
|
|
2
7
|
export declare function changedFiles(root: string, ref: string): Set<string>;
|
|
3
8
|
//# sourceMappingURL=changed-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changed-files.d.ts","sourceRoot":"","sources":["../../../src/check/commands/changed-files.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"changed-files.d.ts","sourceRoot":"","sources":["../../../src/check/commands/changed-files.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAYnE"}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { execFileSync } from 'node:child_process';
|
|
2
2
|
import { CliError } from '../../cli-error.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The files changed since `ref`, relative to the project root: committed since the merge base,
|
|
5
|
+
* modified in the working tree, and new files git does not track yet, which a generator has just
|
|
6
|
+
* written and nothing has staged. The only place git is invoked, and only to read the user's own
|
|
7
|
+
* history.
|
|
8
|
+
*/
|
|
4
9
|
export function changedFiles(root, ref) {
|
|
5
10
|
try {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
10
|
-
});
|
|
11
|
-
const files = output
|
|
12
|
-
.split('\n')
|
|
13
|
-
.map((line) => line.trim())
|
|
14
|
-
.filter((line) => line !== '');
|
|
15
|
-
return new Set(files);
|
|
11
|
+
const changed = gitLines(root, ['diff', '--name-only', '--relative', `${ref}...`]);
|
|
12
|
+
const untracked = gitLines(root, ['ls-files', '--others', '--exclude-standard']);
|
|
13
|
+
return new Set([...changed, ...untracked]);
|
|
16
14
|
}
|
|
17
15
|
catch {
|
|
18
16
|
throw new CliError(`Could not list the files changed since "${ref}".`, 'Check that the directory is a git repository and that the ref exists (fetch it in CI with enough history).');
|
|
19
17
|
}
|
|
20
18
|
}
|
|
19
|
+
function gitLines(root, args) {
|
|
20
|
+
return execFileSync('git', [...args], { cwd: root, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
|
|
21
|
+
.split('\n')
|
|
22
|
+
.map((line) => line.trim())
|
|
23
|
+
.filter((line) => line !== '');
|
|
24
|
+
}
|
|
21
25
|
//# sourceMappingURL=changed-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changed-files.js","sourceRoot":"","sources":["../../../src/check/commands/changed-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"changed-files.js","sourceRoot":"","sources":["../../../src/check/commands/changed-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;QACnF,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC;QAEjF,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,QAAQ,CAChB,2CAA2C,GAAG,IAAI,EAClD,4GAA4G,CAC7G,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,IAAuB;IACrD,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;SACtG,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SourceFile } from '../model/source-file.js';
|
|
2
2
|
import type { StringRecord } from '../scan/string-record.js';
|
|
3
3
|
/**
|
|
4
|
-
* The name a domain event class gives itself: `static readonly eventName = '...'`, which its
|
|
4
|
+
* The name a domain event class gives itself: `extends NamedDomainEvent('...')` or `static readonly eventName = '...'`, which its
|
|
5
5
|
* `readonly name` and its reactions read, or as 0.5 wrote it, `readonly name = '...'`.
|
|
6
6
|
*/
|
|
7
7
|
export declare function domainEventNames(file: SourceFile): StringRecord[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event-names.d.ts","sourceRoot":"","sources":["../../../src/check/events/domain-event-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"domain-event-names.d.ts","sourceRoot":"","sources":["../../../src/check/events/domain-event-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAM7D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,CAIjE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** `name = '...'`, `name: '...'`, `name: string = '...'`, and the same of `eventName`. */
|
|
2
|
-
const NAME_PROPERTY = /(?<![\w$.])(?:name|eventName)\s*\??\s*(?:[:=]|:[^=;\n'"]+=)\s*$/;
|
|
2
|
+
const NAME_PROPERTY = /(?<![\w$.])(?:name|eventName)\s*\??\s*(?:[:=]|:[^=;\n'"]+=)\s*$|(?<![\w$.])NamedDomainEvent\s*\(\s*$/;
|
|
3
3
|
/**
|
|
4
|
-
* The name a domain event class gives itself: `static readonly eventName = '...'`, which its
|
|
4
|
+
* The name a domain event class gives itself: `extends NamedDomainEvent('...')` or `static readonly eventName = '...'`, which its
|
|
5
5
|
* `readonly name` and its reactions read, or as 0.5 wrote it, `readonly name = '...'`.
|
|
6
6
|
*/
|
|
7
7
|
export function domainEventNames(file) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event-names.js","sourceRoot":"","sources":["../../../src/check/events/domain-event-names.ts"],"names":[],"mappings":"AAGA,0FAA0F;AAC1F,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"domain-event-names.js","sourceRoot":"","sources":["../../../src/check/events/domain-event-names.ts"],"names":[],"mappings":"AAGA,0FAA0F;AAC1F,MAAM,aAAa,GACjB,sGAAsG,CAAC;AAEzG;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1C,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAC1F,CAAC;AACJ,CAAC"}
|
|
@@ -44,7 +44,7 @@ export const roles = {
|
|
|
44
44
|
// or, when generating the use case: --permission invoice.void --grant accountant`,
|
|
45
45
|
},
|
|
46
46
|
'authz/policy-asked': {
|
|
47
|
-
why: 'The bus checks the permission of a use case before its handler runs, with the identifier of the element at most: it cannot read the element. A policy is the part of the right that needs the element (only the issuer, not after closing), and it is evaluated only when the handler asks Access once the element is loaded. A handler that forgets to ask leaves the policy declared, tested and never applied, and nothing at run time says so. Judged: for every permission refined by a policy (@Policy or definePolicy in application/authorization/), the handlers in the folder of each command or query that requires it (@Requires, .requires(...) or requires(X, ...)) call authorize, decide or decideOn and name that permission in their code. The TODO(domain) the generator leaves in such a handler, naming the permission, is accepted: `ddd-ts-kit todo` lists
|
|
47
|
+
why: 'The bus checks the permission of a use case before its handler runs, with the identifier of the element at most: it cannot read the element. A policy is the part of the right that needs the element (only the issuer, not after closing), and it is evaluated only when the handler asks Access once the element is loaded. A handler that forgets to ask leaves the policy declared, tested and never applied, and nothing at run time says so. Judged: for every permission refined by a policy (@Policy or definePolicy in application/authorization/), the handlers in the folder of each command or query that requires it (@Requires, .requires(...) or requires(X, ...)) call authorize, decide or decideOn and name that permission in their code. The TODO(domain) the generator leaves in such a handler, naming the permission, is accepted, and so is a TODO(review) that names it: `ddd-ts-kit todo` lists both, and until it is done the authorization module refuses the result of the handler at run time (PolicyNotAskedError).',
|
|
48
48
|
bad: `// application/authorization/only-issuer-voids.policy.ts
|
|
49
49
|
@Policy(billingPermissions['invoice.void'], { name: 'billing.only-issuer-voids' })
|
|
50
50
|
export class OnlyIssuerVoidsPolicy {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-docs.js","sourceRoot":"","sources":["../../../src/check/explain/authz-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,mvBAAmvB;QACxvB,GAAG,EAAE;;;mEAG0D;QAC/D,IAAI,EAAE;;;;;mEAKyD;KAChE;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,q0BAAq0B;QAC10B,GAAG,EAAE;;;;;4DAKmD;QACxD,IAAI,EAAE;;;;;;sCAM4B;KACnC;IACD,eAAe,EAAE;QACf,GAAG,EAAE,4nCAA4nC;QACjoC,GAAG,EAAE;;;;;8CAKqC;QAC1C,IAAI,EAAE;;;;;kFAKwE;KAC/E;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"authz-docs.js","sourceRoot":"","sources":["../../../src/check/explain/authz-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,mvBAAmvB;QACxvB,GAAG,EAAE;;;mEAG0D;QAC/D,IAAI,EAAE;;;;;mEAKyD;KAChE;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,q0BAAq0B;QAC10B,GAAG,EAAE;;;;;4DAKmD;QACxD,IAAI,EAAE;;;;;;sCAM4B;KACnC;IACD,eAAe,EAAE;QACf,GAAG,EAAE,4nCAA4nC;QACjoC,GAAG,EAAE;;;;;8CAKqC;QAC1C,IAAI,EAAE;;;;;kFAKwE;KAC/E;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,o/BAAo/B;QACz/B,GAAG,EAAE;;;;;gCAKuB;QAC5B,IAAI,EAAE;;;gCAGsB;KAC7B;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,ykBAAykB;QAC9kB,GAAG,EAAE;;;;qDAI4C;QACjD,IAAI,EAAE;;;;;2GAKiG;KACxG;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,i1BAAi1B;QACt1B,GAAG,EAAE;;+FAEsF;QAC3F,IAAI,EAAE;;;;;IAKN;KACD;CACF,CAAC"}
|
|
@@ -7,7 +7,7 @@ export function parseFile(text: string) { return text.split('\\n').map(parseLine
|
|
|
7
7
|
function parseLine(line: string) {}`,
|
|
8
8
|
},
|
|
9
9
|
'clean/function-size': {
|
|
10
|
-
why: 'A long function mixes several levels of abstraction, and its parts can be neither named nor tested alone. More than three parameters usually travel together because they are one concept without a type. Small functions with few arguments are what makes the stepdown order readable. The limits are configurable under `limits`, up to a ceiling: no function is longer than 100 lines, describe callbacks, module files and tests included, and that ceiling is an error whatever the severity of the rule.',
|
|
10
|
+
why: 'A long function mixes several levels of abstraction, and its parts can be neither named nor tested alone. More than three parameters usually travel together because they are one concept without a type: name it, as a typed props object or a value object (`Invoice.draft({ customer, lines, currency, draftedAt })`), rather than adding a fourth parameter. Small functions with few arguments are what makes the stepdown order readable. The limits are configurable under `limits`, up to a ceiling: no function is longer than 100 lines, describe callbacks, module files and tests included, and that ceiling is an error whatever the severity of the rule. A `describe` longer than that covers several behaviours: the spec file holds one top-level `describe` per behaviour (a nested one counts in its parent), and a second spec file is needed only past the 350 lines of `clean/file-size`.',
|
|
11
11
|
bad: `function issue(id: string, customer: string, amount: number, currency: string, dueOn: Date) {}`,
|
|
12
12
|
good: `function issue(id: string, customer: CustomerId, total: Money) {}`,
|
|
13
13
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-docs.js","sourceRoot":"","sources":["../../../src/check/explain/clean-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,4RAA4R;QACjS,GAAG,EAAE;qFAC4E;QACjF,IAAI,EAAE;oCAC0B;KACjC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"clean-docs.js","sourceRoot":"","sources":["../../../src/check/explain/clean-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,4RAA4R;QACjS,GAAG,EAAE;qFAC4E;QACjF,IAAI,EAAE;oCAC0B;KACjC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,i3BAAi3B;QACt3B,GAAG,EAAE,gGAAgG;QACrG,IAAI,EAAE,mEAAmE;KAC1E;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,yOAAyO;QAC9O,GAAG,EAAE,qEAAqE;QAC1E,IAAI,EAAE,8CAA8C;KACrD;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,kPAAkP;QACvP,GAAG,EAAE;;iCAEwB;QAC7B,IAAI,EAAE;+BACqB;KAC5B;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,6PAA6P;QAClQ,GAAG,EAAE,2DAA2D;QAChE,IAAI,EAAE,uEAAuE;KAC9E;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,+NAA+N;QACpO,GAAG,EAAE,kCAAkC;QACvC,IAAI,EAAE;2BACiB;KACxB;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/events-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"events-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/events-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqGzD,CAAC"}
|
|
@@ -5,14 +5,11 @@ export const EVENTS_DOCS = {
|
|
|
5
5
|
good: `static readonly eventName = 'billing.invoice.issued';`,
|
|
6
6
|
},
|
|
7
7
|
'events/name-declared-once': {
|
|
8
|
-
why: 'A domain event handler and a projection are attached under the name the event class declares, static readonly eventName: the compiler refuses a reaction to an event class without it. Checked on every domain event, a missing name is found when the event is written, not later when someone first reacts to it. A name written a second time, as a literal in readonly name, drifts from the one the reactions read.',
|
|
8
|
+
why: 'A domain event handler and a projection are attached under the name the event class declares, static readonly eventName: the compiler refuses a reaction to an event class without it. Checked on every domain event, a missing name is found when the event is written, not later when someone first reacts to it. A name written a second time, as a literal in readonly name, drifts from the one the reactions read: extend NamedDomainEvent and the instance name reads the static one.',
|
|
9
9
|
bad: `export class InvoiceIssued implements DomainEvent {
|
|
10
10
|
readonly name = 'billing.invoice.issued';
|
|
11
11
|
}`,
|
|
12
|
-
good: `export class InvoiceIssued
|
|
13
|
-
static readonly eventName = 'billing.invoice.issued';
|
|
14
|
-
|
|
15
|
-
readonly name = InvoiceIssued.eventName;
|
|
12
|
+
good: `export class InvoiceIssued extends NamedDomainEvent('billing.invoice.issued') {
|
|
16
13
|
}`,
|
|
17
14
|
},
|
|
18
15
|
'events/defined-in-published-language': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-docs.js","sourceRoot":"","sources":["../../../src/check/explain/events-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,oBAAoB,EAAE;QACpB,GAAG,EAAE,2LAA2L;QAChM,GAAG,EAAE,8CAA8C;QACnD,IAAI,EAAE,uDAAuD;KAC9D;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"events-docs.js","sourceRoot":"","sources":["../../../src/check/explain/events-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,oBAAoB,EAAE;QACpB,GAAG,EAAE,2LAA2L;QAChM,GAAG,EAAE,8CAA8C;QACnD,IAAI,EAAE,uDAAuD;KAC9D;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,8dAA8d;QACne,GAAG,EAAE;;EAEP;QACE,IAAI,EAAE;EACR;KACC;IACD,sCAAsC,EAAE;QACtC,GAAG,EAAE,2UAA2U;QAChV,GAAG,EAAE;uEAC8D;QACnE,IAAI,EAAE;;;IAGN;KACD;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,wVAAwV;QAC7V,GAAG,EAAE;;;qDAG4C;QACjD,IAAI,EAAE;;;yDAG+C;KACtD;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,mlBAAmlB;QACxlB,GAAG,EAAE;;;uEAG8D;QACnE,IAAI,EAAE;;;;;;;;EAQR;KACC;IACD,kCAAkC,EAAE;QAClC,GAAG,EAAE,svBAAsvB;QAC3vB,GAAG,EAAE;;;;sDAI6C;QAClD,IAAI,EAAE;;;;;qCAK2B;KAClC;IACD,2CAA2C,EAAE;QAC3C,GAAG,EAAE,uxDAAuxD;QAC5xD,GAAG,EAAE;;;;;;;;;;sFAU6E;QAClF,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBR;KACC;CACF,CAAC"}
|
|
@@ -12,7 +12,7 @@ export class IssueInvoiceCommand {}`,
|
|
|
12
12
|
good: `export class InvoiceNumbering {}`,
|
|
13
13
|
},
|
|
14
14
|
'language/declared-vocabulary': {
|
|
15
|
-
why: 'A status, a kind, a role or a permission is a word of the language whose values are a closed list. Spelled again as a string wherever it is compared, granted or stored, each copy can drift: a typo compiles, a renamed value leaves its old spelling behind, and nothing completes it in the editor. Declared once, as an object `as const` and the union type of its name (a permission set for permissions), it is read by its key, completed by the editor, and a parameter typed with it accepts nothing else. The value stays the same string on the wire and in the database. A quoted key counts, and is written as a computed key, `[AppointmentStatus.NoShow]: ..`. Tests and published languages are not judged: a test sends the values a client sends, and a published language names the values of its contract itself; nor is the relationship schema of the access model, which declares its relations. Where: the vocabulary of a context in that context only (the same word may mean something else next door), one of the platform (the roles) in the platform and in the route groups `*.routes.ts`, a permission id and a vocabulary of the shared kernel everywhere. What is read as a vocabulary: every entry a key and a string literal, comments, either quote and `as const satisfies ..` allowed; a number, a spread or a computed entry leaves the object unread, and so does a union type written otherwise than `(typeof X)[keyof typeof X]`. The rule holds under "stack.literals": "named", which `init` writes; a config that does not say keeps the free literals of 0.5.',
|
|
15
|
+
why: 'A status, a kind, a role or a permission is a word of the language whose values are a closed list. Spelled again as a string wherever it is compared, granted or stored, each copy can drift: a typo compiles, a renamed value leaves its old spelling behind, and nothing completes it in the editor. Declared once, as an object `as const` and the union type of its name (a permission set for permissions), it is read by its key, completed by the editor, and a parameter typed with it accepts nothing else. The value stays the same string on the wire and in the database. A quoted key counts, and is written as a computed key, `[AppointmentStatus.NoShow]: ..`. Tests and published languages are not judged: a test sends the values a client sends, and a published language names the values of its contract itself; nor is the relationship schema of the access model, which declares its relations. In the persistence of a context, the name of a column, a table or a schema is a word of the storage that may spell a value by chance: the first argument of a call (`text("note")`) and the value of `name`, `tableName` or `schema` are not judged; a stored value, the argument of `.default(..)` or a value compared in a query, is. Where: the vocabulary of a context in that context only (the same word may mean something else next door), one of the platform (the roles) in the platform and in the route groups `*.routes.ts`, a permission id and a vocabulary of the shared kernel everywhere. What is read as a vocabulary: every entry a key and a string literal, comments, either quote and `as const satisfies ..` allowed; a number, a spread or a computed entry leaves the object unread, and so does a union type written otherwise than `(typeof X)[keyof typeof X]`. The rule holds under "stack.literals": "named", which `init` writes; a config that does not say keeps the free literals of 0.5.',
|
|
16
16
|
bad: `// domain/vocabularies/appointment-status.vocabulary.ts declares AppointmentStatus
|
|
17
17
|
if (appointment.status === 'no-show') {
|
|
18
18
|
grants.push('billing:invoice.issue');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-docs.js","sourceRoot":"","sources":["../../../src/check/explain/language-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC9D,wBAAwB,EAAE;QACxB,GAAG,EAAE,gTAAgT;QACrT,GAAG,EAAE;+BACsB;QAC3B,IAAI,EAAE;oCAC0B;KACjC;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,+OAA+O;QACpP,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,kCAAkC;KACzC;IACD,8BAA8B,EAAE;QAC9B,GAAG,EAAE
|
|
1
|
+
{"version":3,"file":"language-docs.js","sourceRoot":"","sources":["../../../src/check/explain/language-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC9D,wBAAwB,EAAE;QACxB,GAAG,EAAE,gTAAgT;QACrT,GAAG,EAAE;+BACsB;QAC3B,IAAI,EAAE;oCAC0B;KACjC;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,+OAA+O;QACpP,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,kCAAkC;KACzC;IACD,8BAA8B,EAAE;QAC9B,GAAG,EAAE,u1DAAu1D;QAC51D,GAAG,EAAE;;;EAGP;QACE,IAAI,EAAE;;EAER;KACC;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,iQAAiQ;QACtQ,GAAG,EAAE,4DAA4D;QACjE,IAAI,EAAE,8DAA8D;KACrE;IACD,8BAA8B,EAAE;QAC9B,GAAG,EAAE,4QAA4Q;QACjR,GAAG,EAAE,uEAAuE;QAC5E,IAAI,EAAE,gEAAgE;KACvE;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,2QAA2Q;QAChR,GAAG,EAAE,6DAA6D;QAClE,IAAI,EAAE,yDAAyD;KAChE;CACF,CAAC"}
|
|
@@ -63,7 +63,7 @@ export abstract class TaxGateway {}
|
|
|
63
63
|
export interface IssueInvoiceResult { readonly invoiceId: string }`,
|
|
64
64
|
},
|
|
65
65
|
'clean/file-size': {
|
|
66
|
-
why: 'Past a few hundred lines a file holds more than one responsibility: nobody reads it whole, and every change touches something unrelated. The limit is 350 physical lines, for sources and tests alike, and is not configurable. A long test file is split by behaviour, a long source by concept. Generated files (a path segment named generated, the <context>.declarations.ts and <context>.dependencies.ts at the root of a context) and declaration files are not judged.',
|
|
66
|
+
why: 'Past a few hundred lines a file holds more than one responsibility: nobody reads it whole, and every change touches something unrelated. The limit is 350 physical lines, for sources and tests alike, and is not configurable. A long test file is split by behaviour, a long source by concept. An aggregate keeps its intention methods and moves a decision out: a domain service that takes the state and returns the new state and its events, which the aggregate applies, or a value object for fields that travel together; never a public method that sets its state from outside. Generated files (a path segment named generated, the <context>.declarations.ts and <context>.dependencies.ts at the root of a context) and declaration files are not judged.',
|
|
67
67
|
bad: `// application/commands/issue-invoice/issue-invoice.handler.ts, 600 lines:
|
|
68
68
|
// the handler, its validation, its mapping and three helpers`,
|
|
69
69
|
good: `// issue-invoice.handler.ts orchestrates, in 40 lines;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-docs.js","sourceRoot":"","sources":["../../../src/check/explain/layout-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,uBAAuB,EAAE;QACvB,GAAG,EAAE,qXAAqX;QAC1X,GAAG,EAAE;;;;;;EAMP;QACE,IAAI,EAAE;;;;;;EAMR;KACC;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,qgBAAqgB;QAC1gB,GAAG,EAAE;;;;EAIP;QACE,IAAI,EAAE;;;;EAIR;KACC;IACD,cAAc,EAAE;QACd,GAAG,EAAE,ieAAie;QACte,GAAG,EAAE;;;;0CAIiC;QACtC,IAAI,EAAE;;;;;;;;;;EAUR;KACC;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,yrBAAyrB;QAC9rB,GAAG,EAAE;;;;iCAIwB;QAC7B,IAAI,EAAE;;;;;mEAKyD;KAChE;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"layout-docs.js","sourceRoot":"","sources":["../../../src/check/explain/layout-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,uBAAuB,EAAE;QACvB,GAAG,EAAE,qXAAqX;QAC1X,GAAG,EAAE;;;;;;EAMP;QACE,IAAI,EAAE;;;;;;EAMR;KACC;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,qgBAAqgB;QAC1gB,GAAG,EAAE;;;;EAIP;QACE,IAAI,EAAE;;;;EAIR;KACC;IACD,cAAc,EAAE;QACd,GAAG,EAAE,ieAAie;QACte,GAAG,EAAE;;;;0CAIiC;QACtC,IAAI,EAAE;;;;;;;;;;EAUR;KACC;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,yrBAAyrB;QAC9rB,GAAG,EAAE;;;;iCAIwB;QAC7B,IAAI,EAAE;;;;;mEAKyD;KAChE;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,2uBAA2uB;QAChvB,GAAG,EAAE;8DACqD;QAC1D,IAAI,EAAE;wFAC8E;KACrF;CACF,CAAC"}
|
|
@@ -13,7 +13,7 @@ import type { Money } from '@/shared-kernel/presentation/money.schema';
|
|
|
13
13
|
// maps Money to the command, which carries plain values`,
|
|
14
14
|
},
|
|
15
15
|
'schema/no-duplicate-shape': {
|
|
16
|
-
why: 'Two routes that declare the same shape by hand document it twice, as two unrelated schemas: the contract grows a copy per route, a client SDK generates two types for one thing, and the day the shape changes one copy is forgotten. Declared once and shared, it lands once in components.schemas and every route points at it with $ref; a route that needs a part of it derives that part (pick, omit, partial, extend) from the one declaration. Judged within one context, and between a context and presentation/ of the shared kernel: two contexts may declare the same structure, because an equal shape with two meanings is two concepts and sharing it would couple contexts that stay extractable. Compared: a DTO class (a class of the module that extends nothing, has no method and decorates each property), compared by its property names, their decorators with their arguments and whether each is optional; and the object of a schema builder (`z.object({...})`, `v.object({...})`, `Type.Object({...})`), compared by its entries whatever their order and layout. Empty shapes, shapes that still carry a TODO(domain) of the generator (every search line starts as `{ id }`), *.params.ts, *.query.ts and *.headers.ts files and the objects assigned to params, query or headers are not judged: a request parameter is documented per operation, never as a component. The original is the declaration of the shared kernel, then the one under presentation/http/shared/ of the context, then the first in path order; each copy is reported with the place of the original. Judged under "stack.schemas": "shared" only.',
|
|
16
|
+
why: 'Two routes that declare the same shape by hand document it twice, as two unrelated schemas: the contract grows a copy per route, a client SDK generates two types for one thing, and the day the shape changes one copy is forgotten. Declared once and shared, it lands once in components.schemas and every route points at it with $ref; a route that needs a part of it derives that part (pick, omit, partial, extend) from the one declaration. Judged within one context, and between a context and presentation/ of the shared kernel: two contexts may declare the same structure, because an equal shape with two meanings is two concepts and sharing it would couple contexts that stay extractable. Compared: a DTO class (a class of the module that extends nothing, has no method and decorates each property), compared by its property names, their decorators with their arguments and whether each is optional; and the object of a schema builder (`z.object({...})`, `v.object({...})`, `Type.Object({...})`), compared by its entries whatever their order and layout. Empty shapes, shapes that still carry a TODO(domain) of the generator (every search line starts as `{ id }`) or a TODO(review), *.params.ts, *.query.ts and *.headers.ts files and the objects assigned to params, query or headers are not judged: a request parameter is documented per operation, never as a component. The original is the declaration of the shared kernel, then the one under presentation/http/shared/ of the context, then the first in path order; each copy is reported with the place of the original. Judged under "stack.schemas": "shared" only.',
|
|
17
17
|
bad: `// appointments/cancel-appointment/cancel-appointment.accepted.ts
|
|
18
18
|
export class CancelAppointmentAccepted { @IsString() id = ''; }
|
|
19
19
|
// appointments/confirm-appointment/confirm-appointment.accepted.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-docs.js","sourceRoot":"","sources":["../../../src/check/explain/schema-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,0BAA0B,EAAE;QAC1B,GAAG,EAAE,mhCAAmhC;QACxhC,GAAG,EAAE;;;;sEAI6D;QAClE,IAAI,EAAE;;;;yDAI+C;KACtD;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"schema-docs.js","sourceRoot":"","sources":["../../../src/check/explain/schema-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,0BAA0B,EAAE;QAC1B,GAAG,EAAE,mhCAAmhC;QACxhC,GAAG,EAAE;;;;sEAI6D;QAClE,IAAI,EAAE;;;;yDAI+C;KACtD;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,8kDAA8kD;QACnlD,GAAG,EAAE;;;iEAGwD;QAC7D,IAAI,EAAE;;;;mHAIyG;KAChH;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA0C5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"authz-policy-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA0C5C,eAAO,MAAM,qBAAqB,EAAE,SAAS,OAAO,EAiFnD,CAAC"}
|
|
@@ -39,6 +39,18 @@ export const AUTHZ_POLICY_FIXTURES = [
|
|
|
39
39
|
expect: 'pass',
|
|
40
40
|
files: withPolicy(declaredHandler(" // TODO(domain): a policy refines billingPermissions['invoice.issue']: load the element this command acts on, then ask it.\n await this.invoices.save(command);")),
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
ruleId: 'authz/policy-asked',
|
|
44
|
+
name: 'a handler carrying a TODO(review) that names the permission',
|
|
45
|
+
expect: 'pass',
|
|
46
|
+
files: withPolicy(declaredHandler(" // TODO(review): ask billingPermissions['invoice.issue'] once the invoice is loaded, not before.\n await this.invoices.save(command);")),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
ruleId: 'authz/policy-asked',
|
|
50
|
+
name: 'a handler carrying a TODO of another owner that names the permission',
|
|
51
|
+
expect: { file: HANDLER },
|
|
52
|
+
files: withPolicy(declaredHandler(" // TODO(billing-team): ask billingPermissions['invoice.issue'] here.\n await this.invoices.save(command);")),
|
|
53
|
+
},
|
|
42
54
|
{
|
|
43
55
|
ruleId: 'authz/policy-asked',
|
|
44
56
|
name: 'a handler naming the permission in a comment only',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AAE3D,8GAA8G;AAC9G,MAAM,oBAAoB,GAAG,MAAM,CACjC,6DAA6D,EAC7D,uHAAuH,EACvH,mGAAmG,EACnG,4CAA4C,EAC5C,EAAE,EACF,2FAA2F,EAC3F,iGAAiG,EACjG,iGAAiG,EACjG,EAAE,EACF,6DAA6D,CAC9D,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,2DAA2D;IAC3D,EAAE;IACF,qFAAqF;IACrF,uCAAuC;IACvC,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,eAAe,GAAG;IACtB,yDAAyD;IACzD,gIAAgI;IAChI,GAAG;IACH,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,cAAc,GAClB,yMAAyM,CAAC;AAE5M,MAAM,CAAC,MAAM,qBAAqB,GAAuB;IACvD;QACE,MAAM,EAAE,oBAAoB;QAC5B,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,UAAU,CACf,eAAe,CAAC,+FAA+F,CAAC,CACjH;KACF;IACD;QACE,MAAM,EAAE,oBAAoB;QAC5B,IAAI,EAAE,mDAAmD;QACzD,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO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AK;QACL,GAAG;QACH,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,8GAA8G;AAC9G,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
|
1
|
+
{"version":3,"file":"authz-policy-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/authz-policy-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AAE3D,8GAA8G;AAC9G,MAAM,oBAAoB,GAAG,MAAM,CACjC,6DAA6D,EAC7D,uHAAuH,EACvH,mGAAmG,EACnG,4CAA4C,EAC5C,EAAE,EACF,2FAA2F,EAC3F,iGAAiG,EACjG,iGAAiG,EACjG,EAAE,EACF,6DAA6D,CAC9D,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,2DAA2D;IAC3D,EAAE;IACF,qFAAqF;IACrF,uCAAuC;IACvC,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,eAAe,GAAG;IACtB,yDAAyD;IACzD,gIAAgI;IAChI,GAAG;IACH,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,cAAc,GAClB,yMAAyM,CAAC;AAE5M,MAAM,CAAC,MAAM,qB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CAAC;KACH;IACD;QACE,MAAM,EAAE,oBAAoB;QAC5B,IAAI,EAAE,mEAAmE;QACzE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC;YACb,CAAC,MAAM,CAAC,EAAE,eAAe;YACzB,CAAC,OAAO,CAAC,EAAE,uCAAuC;YAClD,CAAC,MAAM,CAAC,EAAE,cAAc;YACxB,GAAG,OAAO,CACR,sJAAsJ,CACvJ;SACF,CAAC;KACH;CACF,CAAC;AAEF,uEAAuE;AACvE,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO;QACL,iDAAiD;QACjD,mEAAmE;QACnE,wGAAwG;QACxG,uHAAuH;QACvH,EAAE;QACF,sCAAsC;QACtC,oCAAoC;QACpC,gBAAgB;QAChB,sCAAsC;QACtC,mDAAmD;QACnD,QAAQ;QACR,EAAE;QACF,gEAAgE;QAChE,IAAI;QACJ,KAAK;QACL,GAAG;QACH,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,8GAA8G;AAC9G,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAY5C,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"clean-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAY5C,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,EAqQ5C,CAAC"}
|
|
@@ -142,7 +142,7 @@ export const CLEAN_FIXTURES = [
|
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
ruleId: 'clean/no-noise-comment',
|
|
145
|
-
name: 'comments that say why, a described parameter, an owned TODO',
|
|
145
|
+
name: 'comments that say why, a described parameter, an owned TODO, a TODO(review)',
|
|
146
146
|
expect: 'pass',
|
|
147
147
|
files: project({
|
|
148
148
|
[FIND]: [
|
|
@@ -153,6 +153,7 @@ export const CLEAN_FIXTURES = [
|
|
|
153
153
|
' */',
|
|
154
154
|
'export function find(id: string): string {',
|
|
155
155
|
' // TODO(billing-team): replace by the archive lookup, see #142.',
|
|
156
|
+
' // TODO(review): name the archive after its term in the glossary.',
|
|
156
157
|
' return id;',
|
|
157
158
|
'}',
|
|
158
159
|
'',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAEvD,MAAM,KAAK,GAAG,uBAAuB,CAAC;AACtC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,KAAK,GAAG,uBAAuB,CAAC;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAu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,OAAO,CAAC;YACb,CAAC,OAAO,CAAC,EAAE;gBACT,iEAAiE;gBACjE,0EAA0E;gBAC1E,KAAK;gBACL,+BAA+B;gBAC/B,aAAa;gBACb,wDAAwD;gBACxD,oCAAoC;gBACpC,KAAK;gBACL,2CAA2C;gBAC3C,EAAE;aACH,CAAC,IAAI,CAAC,IAAI,CAAC;SACb,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,+BAA+B;QACrC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC;YACb,CAAC,OAAO,CAAC,EACP,kHAAkH;SACrH,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,oCAAoC;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CAAC;YACb,CAAC,OAAO,CAAC,EAAE,kGAAkG;SAC9G,CAAC;KACH;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"clean-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAEvD,MAAM,KAAK,GAAG,uBAAuB,CAAC;AACtC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AwB;QAChC,IAAI,EAAE,+DAA+D;QACrE,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO,CAAC;YACb,GAAG,SAAS,CACV,oJAAoJ,CACrJ;YACD,CAAC,GAAG,OAAO,8DAA8D,CAAC,EACxE,oFAAoF;SACvF,CAAC;KACH;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,IAAI,EAAE,wDAAwD;QAC9D,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,KAAK,EAAE,OAAO,CACZ,SAAS,CAAC,yFAAyF,CAAC,CACrG;KACF;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CACZ,OAAO,CACL,+JAA+J,CAChK,CACF;KACF;CACF,CAAC;AAEF,iEAAiE;AACjE,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC;IAE5F,OAAO,MAAM,CAAC,6CAA6C,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/layout-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"layout-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/layout-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA0U5C,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EAM7C,CAAC"}
|
|
@@ -156,6 +156,21 @@ const FILE_SIZE = [
|
|
|
156
156
|
expect: { file: 'src/platform/billing.declarations.ts' },
|
|
157
157
|
files: project({ 'src/platform/billing.declarations.ts': listOfLines(400) }),
|
|
158
158
|
},
|
|
159
|
+
{
|
|
160
|
+
ruleId: 'clean/file-size',
|
|
161
|
+
name: 'an end-to-end spec of 351 lines, beside the source root',
|
|
162
|
+
expect: { file: 'test/e2e/issue-invoice.e2e.spec.ts' },
|
|
163
|
+
files: project({ 'test/e2e/issue-invoice.e2e.spec.ts': listOfLines(351) }),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
ruleId: 'clean/file-size',
|
|
167
|
+
name: 'an end-to-end spec and a script of exactly 350 lines',
|
|
168
|
+
expect: 'pass',
|
|
169
|
+
files: project({
|
|
170
|
+
'test/e2e/issue-invoice.e2e.spec.ts': listOfLines(350),
|
|
171
|
+
'scripts/seed-demo.ts': listOfLines(350),
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
159
174
|
];
|
|
160
175
|
export const LAYOUT_FIXTURES = [
|
|
161
176
|
...HASH_PRIVATE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/layout-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;AAEzC,MAAM,MAAM,GAAG,GAAG,OAAO,6DAA6D,CAAC;AACvF,MAAM,KAAK,GAAG,uBAAu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IACD;QACE,MAAM,EAAE,iBAAiB;QACzB,IAAI,EAAE,sDAAsD;QAC5D,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO,CAAC;YACb,oCAAoC,EAAE,WAAW,CAAC,GAAG,CAAC;YACtD,sBAAsB,EAAE,WAAW,CAAC,GAAG,CAAC;SACzC,CAAC;KACH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAuB;IACjD,GAAG,YAAY;IACf,GAAG,WAAW;IACd,GAAG,MAAM;IACT,GAAG,UAAU;IACb,GAAG,SAAS;CACb,CAAC;AAEF,4EAA4E;AAC5E,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,MAAM,CAAC,wBAAwB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AACnH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/schema-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/schema-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA8N5C,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EAAkD,CAAC"}
|
|
@@ -25,6 +25,7 @@ const dto = (name, property) => source("import { IsString } from 'class-validato
|
|
|
25
25
|
/** A line as `generate query --search` writes it: an identifier and the mark of what is left to declare. */
|
|
26
26
|
const generatedLine = (name) => source("import { IsString } from 'class-validator';", '', `export class ${name} {`, ' @IsString()', " id = '';", '', ' // TODO(domain): declare the fields that are part of the public contract.', '}');
|
|
27
27
|
const GENERATED_ZOD_LINE = 'z.object({\n id: z.string(),\n // TODO(domain): declare the public fields.\n})';
|
|
28
|
+
const REVIEWED_ZOD_LINE = 'z.object({\n id: z.string(),\n // TODO(review): share this line with the other search once both are filled.\n})';
|
|
28
29
|
const MAPPING = source("import type { Money } from '@/shared-kernel/presentation/money.schema.js';", '', 'export class IssueInvoiceMapper {', ' amountOf(money: Money): number {', ' return money.cents;', ' }', '}');
|
|
29
30
|
const COMMAND_READING_A_SCHEMA = source("import type { Money } from '@/shared-kernel/presentation/money.schema.js';", '', 'export class IssueInvoiceCommand {', ' constructor(readonly amount: Money) {}', '}');
|
|
30
31
|
const controller = (body) => source("import { z } from 'zod';", "import { zodSchema } from '@ddd-ts-kit/validation/zod';", '', `export const body = zodSchema(${body});`);
|
|
@@ -115,6 +116,15 @@ const NO_DUPLICATE_SHAPE = [
|
|
|
115
116
|
[ISSUE_CONTROLLER]: controller(GENERATED_ZOD_LINE),
|
|
116
117
|
}, SHARED),
|
|
117
118
|
},
|
|
119
|
+
{
|
|
120
|
+
ruleId: 'schema/no-duplicate-shape',
|
|
121
|
+
name: 'two zod shapes a review left a TODO(review) in',
|
|
122
|
+
expect: 'pass',
|
|
123
|
+
files: project({
|
|
124
|
+
[AMEND_CONTROLLER]: controller(REVIEWED_ZOD_LINE),
|
|
125
|
+
[ISSUE_CONTROLLER]: controller(REVIEWED_ZOD_LINE),
|
|
126
|
+
}, SHARED),
|
|
127
|
+
},
|
|
118
128
|
{
|
|
119
129
|
ruleId: 'schema/no-duplicate-shape',
|
|
120
130
|
name: 'a project that does not say how it writes its schemas is not judged',
|