ddd-ts-kit 0.98.0 → 0.99.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 +16 -0
- package/README.fr.md +14 -5
- package/README.md +13 -5
- package/dist/check/commands/changed-files.d.ts +1 -1
- package/dist/check/commands/changed-files.d.ts.map +1 -1
- package/dist/check/commands/changed-files.js +3 -2
- package/dist/check/commands/changed-files.js.map +1 -1
- package/dist/check/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +2 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/is-reported-since.d.ts +8 -0
- package/dist/check/commands/is-reported-since.d.ts.map +1 -0
- package/dist/check/commands/is-reported-since.js +9 -0
- package/dist/check/commands/is-reported-since.js.map +1 -0
- package/dist/check/model/finding.d.ts +6 -0
- package/dist/check/model/finding.d.ts.map +1 -1
- package/dist/check/model/report.d.ts +2 -0
- package/dist/check/model/report.d.ts.map +1 -1
- package/dist/check/model/violation.d.ts +2 -0
- package/dist/check/model/violation.d.ts.map +1 -1
- package/dist/check/rules/authz-declared.js +17 -7
- package/dist/check/rules/authz-declared.js.map +1 -1
- package/dist/check/rules/authz-policy-asked.d.ts.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/declarations-port-adapter-wired.d.ts.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js +11 -2
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
- package/dist/check/rules/events-consumer-idempotent.js +13 -3
- package/dist/check/rules/events-consumer-idempotent.js.map +1 -1
- package/dist/check/support/reporter.d.ts.map +1 -1
- package/dist/check/support/reporter.js +9 -1
- package/dist/check/support/reporter.js.map +1 -1
- package/dist/check/support/to-violations.js +1 -1
- package/dist/check/support/to-violations.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/merge/classify-conflict.js +2 -2
- package/dist/merge/classify-conflict.js.map +1 -1
- package/dist/merge/continue-merge.d.ts.map +1 -1
- package/dist/merge/continue-merge.js +26 -1
- package/dist/merge/continue-merge.js.map +1 -1
- package/dist/merge/format-merge-report.js +19 -0
- package/dist/merge/format-merge-report.js.map +1 -1
- package/dist/merge/is-derived-in-merge.d.ts +4 -0
- package/dist/merge/is-derived-in-merge.d.ts.map +1 -0
- package/dist/merge/is-derived-in-merge.js +8 -0
- package/dist/merge/is-derived-in-merge.js.map +1 -0
- package/dist/merge/is-merge-path.js +2 -2
- package/dist/merge/is-merge-path.js.map +1 -1
- package/dist/merge/merge-report.d.ts +7 -0
- package/dist/merge/merge-report.d.ts.map +1 -1
- package/dist/merge/next-steps.d.ts +1 -0
- package/dist/merge/next-steps.d.ts.map +1 -1
- package/dist/merge/next-steps.js +1 -0
- package/dist/merge/next-steps.js.map +1 -1
- package/dist/merge/resume-merge.d.ts.map +1 -1
- package/dist/merge/resume-merge.js +10 -1
- package/dist/merge/resume-merge.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/asked-worktree.d.ts +7 -0
- package/dist/worker/asked-worktree.d.ts.map +1 -0
- package/dist/worker/asked-worktree.js +15 -0
- package/dist/worker/asked-worktree.js.map +1 -0
- package/dist/worker/find-worker.d.ts.map +1 -1
- package/dist/worker/find-worker.js +2 -1
- package/dist/worker/find-worker.js.map +1 -1
- package/dist/worker/main-project.d.ts +3 -0
- package/dist/worker/main-project.d.ts.map +1 -0
- package/dist/worker/main-project.js +11 -0
- package/dist/worker/main-project.js.map +1 -0
- package/dist/worker/worktree-home.d.ts.map +1 -1
- package/dist/worker/worktree-home.js +2 -6
- package/dist/worker/worktree-home.js.map +1 -1
- package/dist/worker/worktree-of.d.ts +2 -1
- package/dist/worker/worktree-of.d.ts.map +1 -1
- package/dist/worker/worktree-of.js +7 -3
- package/dist/worker/worktree-of.js.map +1 -1
- package/package.json +4 -4
- package/templates/init/e2e/start-application.database.ts.tpl +6 -2
- package/templates/init/e2e/start-application.memory.ts.tpl +6 -2
- package/templates/pipeline/package-scripts.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ 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.99.0
|
|
8
|
+
|
|
9
|
+
**`merge-trunk` regenerates the Prisma client after a schema merge, `--abort` restores the behaviour pages, and `--continue` says when the trunk moved.** A merge that added or changed `prisma/schema/<context>.prisma` left the git-ignored `generated/schema.sql` of the in-process test database stale until `npm run db:client` ran, so the end-to-end requests answered 500 on missing tables: with the Prisma stack, `merge-trunk` (and `--continue`) now runs `db:client` after `regenerate` when the merge changed a file under `prisma/schema/`, and stops, naming the script, when it fails (Drizzle, Knex and TypeORM derive no such file: their test database reads the tracked sources). The pages of `docs/behaviour/` are now derived files: settled by regenerating when they conflict, staged again after `regenerate` rewrote them, and restored and named by `--abort` instead of refusing with "changed by hand since it was staged". A merge left in progress keeps the trunk commit of its first run, so `--continue` now reports `trunk moved: <ref> was <a> when the merge started, it is <b> now` (`trunkMoved` in `--json`) and tells to run `merge-trunk` again once the merge is committed.
|
|
10
|
+
|
|
11
|
+
**The guard says where the `requires(...)` declarations of a module live.** A worker whose context module file is near the size limit created `application/authorization/declare-<module>-use-cases.policy.ts` by hand. The declarations already go to `<module>/<module>.module.ts` when `generate command|query ... --module <module>` is given (modules of the model, 0.98.0); the guard now answers a new `*.policy.ts` with that, and the wiring and access-control skills and the authorization page say it.
|
|
12
|
+
|
|
13
|
+
**`check --changed-since` reports a finding whose cause is a changed file, not only the findings that sit on a changed file.** A violation may now name `subjects`, the other files it is repaired in (shown in `--json`), and `--changed-since` keeps it when its file or one of its subjects changed. `events/consumer-idempotent` (handler not registered with a consumer name), `declarations/port-adapter-wired`, `authz/declared` (use case missing from the authorization map or declared on its message class) and `authz/policy-asked` now name the module files, composition files, authorization files or policy files that repair them, `<module>/<module>.module.ts` of a module of the model included. So a worker who removes a registration from a module file, or changes a policy, sees the error at once instead of at the full `check`. `events/consumer-idempotent` also reads every module file of a context, so a handler registered in the module file of its module is no longer reported against the first module file found.
|
|
14
|
+
|
|
15
|
+
**`check --changed-since <ref>` (and `verify-slice`) now judge a tracked file modified but not committed.** The list of changed files compared the merge base with `HEAD` only, so an edit not yet committed was skipped, contrary to the comment of the function, and a green run said nothing of it. It is now the union of the files committed since the merge base, the tracked files modified in the index or the working tree, and the untracked files git does not ignore. No more need to commit before checking.
|
|
16
|
+
|
|
17
|
+
**A relative `--worktree .worktrees/<name>` resolves against the main checkout, from any worktree.** `worker-scope`, `story-scope` and `worker-scope --resume` resolved the asked path against the root of the checkout the command ran in, so the line `plan-waves` prints, run from a trunk worktree (`.worktrees/wave7`), nested the new worktree in the trunk's (`.worktrees/wave7/.worktrees/<name>`). A relative path under `.worktrees/` now goes to the main checkout, as the default place does, and a note says so; any other relative path still starts at the project you run from.
|
|
18
|
+
|
|
19
|
+
**A run of a per-tenant job says how many tenants it ran for, and `runJob` of the e2e support fails on a run that reached none.** `JobRun` has a new `tenants` field on a succeeded per-tenant run (absent for a global job), also in the log line of the run: with an empty tenant directory the job is never called and the run is `succeeded` with `tenants: 0`. The generated `runJob(name)` throws on it, telling the spec to open a tenant (an organisation) first.
|
|
20
|
+
|
|
21
|
+
To move: a project generated before keeps its `test/e2e/support/start-application.ts`; add `tenants` to the destructuring of `jobs.runNow(name)` and throw when `tenants === 0` to get the check.
|
|
22
|
+
|
|
7
23
|
## 0.98.0
|
|
8
24
|
|
|
9
25
|
**The test runners page measures Vitest against Jest, and says which settings make each faster.**
|
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:e5847ce5e5fda748 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit
|
|
5
5
|
|
|
@@ -1988,7 +1988,7 @@ par un *commit*), un tronc inconnu.
|
|
|
1988
1988
|
|
|
1989
1989
|
| Classe | Chemins | Résolution |
|
|
1990
1990
|
|---|---|---|
|
|
1991
|
-
| dérivé | `openapi/`, `clients/`, `docs/integration/`, `.dependency-cruiser.cjs`, les *barrels* et listes de chaque contexte | côté du tronc, réécrit par `regenerate` |
|
|
1991
|
+
| dérivé | `openapi/`, `clients/`, `docs/integration/`, `docs/behaviour/`, `.dependency-cruiser.cjs`, les *barrels* et listes de chaque contexte | côté du tronc, réécrit par `regenerate` |
|
|
1992
1992
|
| document mixte | `CONTEXT.md`, `docs/context-map.md` | un conflit dans une région `<!-- ddd-ts-kit:<region> -->` : côté du tronc ; hors région : pour vous |
|
|
1993
1993
|
| registre | un conflit entre des marqueurs `// ddd-ts-kit:<region>` de n'importe quel fichier | la base sans ce que l'un ou l'autre côté a retiré, plus ce que chacun a ajouté, le nôtre d'abord, une fois chacun ; dans `imports`, les noms importés d'un même module joints en une instruction |
|
|
1994
1994
|
| tranches | `docs/architecture/slices.md` | ligne par ligne par `#` : le statut le plus avancé (done, in progress, todo), chaque autre cellule du côté qui l'a changée ; une cellule changée autrement par les deux : pour vous |
|
|
@@ -2013,7 +2013,11 @@ par un *commit*), un tronc inconnu.
|
|
|
2013
2013
|
de la branche dont le tronc a pris le numéro depuis la base reçoit le prochain libre (ses
|
|
2014
2014
|
fichiers, son titre `# ADR-NNNN`, les liens de ses traductions, consignés en lignes
|
|
2015
2015
|
`Lost-Accepted:`).
|
|
2016
|
-
6. **`regenerate`** (sauté sans la configuration du kit ou le script) ; un échec arrête.
|
|
2016
|
+
6. **`regenerate`** (sauté sans la configuration du kit ou le script) ; un échec arrête. Avec
|
|
2017
|
+
Prisma, quand la fusion a changé un fichier de `prisma/schema/`, puis `npm run db:client` : le
|
|
2018
|
+
client et `generated/schema.sql`, ignorés par git et lus par la base de test en processus, en
|
|
2019
|
+
sont dérivés ; un échec arrête. Drizzle, Knex et TypeORM ne dérivent aucun fichier de ce genre
|
|
2020
|
+
(leur base de test lit les sources suivies), donc ils ne lancent rien de plus.
|
|
2017
2021
|
7. **`verify-merge`** sur le résultat non commité, sur la base qu'enregistre le *trailer* : une
|
|
2018
2022
|
erreur arrête (sortie 1), avec `file:line (ours|theirs) <text>`, les lignes du plan qui ne
|
|
2019
2023
|
sont plus terminées, les tests perdus ; `--continue --accept-lost` les consigne dans un
|
|
@@ -2024,7 +2028,7 @@ par un *commit*), un tronc inconnu.
|
|
|
2024
2028
|
de côté et le bloque jusqu'à ce qu'il soit indexé ou mis de côté. Les *hooks* du projet
|
|
2025
2029
|
tournent.
|
|
2026
2030
|
|
|
2027
|
-
`--abort` défait la fusion en cours comme `git merge --abort` et oublie son état. Chaque arrêt
|
|
2031
|
+
`--abort` défait la fusion en cours comme `git merge --abort` et oublie son état ; les fichiers dérivés que le kit a régénérés (`docs/behaviour/`, `CONTEXT.md`, la carte des contextes, ...) et modifiés après leur indexation par la fusion sont restaurés et nommés. `--continue` conclut le *commit* du tronc avec lequel la fusion a commencé : si la référence du tronc en nomme un autre maintenant, le rapport le dit (`trunkMoved: { merged, now }` en `--json`) et dit de relancer `merge-trunk` une fois la fusion validée. Chaque arrêt
|
|
2028
2032
|
dit quoi faire ensuite et garde la fusion en cours pour le `--continue` suivant. git 2.40 est
|
|
2029
2033
|
nécessaire pour une base que git ne calculerait pas ; un git plus ancien fusionne avec
|
|
2030
2034
|
`git merge` lui-même depuis `git merge-base` (`--since <merge base>`), et refuse `--dry-run`.
|
|
@@ -2164,7 +2168,12 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2164
2168
|
`ddd-ts-kit explain <rule-id>` affiche le même genre de mauvais et de bon exemple pour chaque
|
|
2165
2169
|
règle.
|
|
2166
2170
|
|
|
2167
|
-
- `paths` et `--changed-since` limitent ce qui est signalé, pas ce qui est analysé.
|
|
2171
|
+
- `paths` et `--changed-since` limitent ce qui est signalé, pas ce qui est analysé. `--changed-since`
|
|
2172
|
+
garde une violation quand le fichier où elle se trouve a changé, ou quand un fichier qu'elle nomme
|
|
2173
|
+
dans ses `subjects` (avec `--json`) a changé : un constat signalé sur un handler mais réparé dans le
|
|
2174
|
+
fichier de module (`events/consumer-idempotent`, `declarations/port-adapter-wired`, `authz/declared`,
|
|
2175
|
+
`authz/policy-asked`) apparaît quand seul ce fichier de module a changé. Les fichiers changés sont ceux
|
|
2176
|
+
modifiés depuis la base de fusion, commités ou non.
|
|
2168
2177
|
- `--baseline write` consigne les erreurs qu'un projet a déjà, comptées par fichier et par règle,
|
|
2169
2178
|
dans `ddd-ts-kit-baseline.json` (la forme de `eslint-suppressions.json`), pour un code existant
|
|
2170
2179
|
qui adopte le kit ; commitez-le. Dès lors, `check` et `check-file` (le *hook* de l'agent) taisent
|
package/README.md
CHANGED
|
@@ -1869,7 +1869,7 @@ ends with a commit), an unknown trunk.
|
|
|
1869
1869
|
|
|
1870
1870
|
| Class | Paths | Resolution |
|
|
1871
1871
|
|---|---|---|
|
|
1872
|
-
| derived | `openapi/`, `clients/`, `docs/integration/`, `.dependency-cruiser.cjs`, the barrels and lists of each context | trunk side, rewritten by `regenerate` |
|
|
1872
|
+
| derived | `openapi/`, `clients/`, `docs/integration/`, `docs/behaviour/`, `.dependency-cruiser.cjs`, the barrels and lists of each context | trunk side, rewritten by `regenerate` |
|
|
1873
1873
|
| mixed document | `CONTEXT.md`, `docs/context-map.md` | a conflict inside a `<!-- ddd-ts-kit:<region> -->` region: trunk side; outside: for you |
|
|
1874
1874
|
| registry | a conflict inside `// ddd-ts-kit:<region>` markers of any file | the base without what either side removed, plus what each added, ours first, once each; names imported from one module joined in one statement in `imports` |
|
|
1875
1875
|
| slices | `docs/architecture/slices.md` | row by row by `#`: the furthest status (done, in progress, todo), each other cell from the side that changed it; a cell both changed differently: for you |
|
|
@@ -1891,7 +1891,11 @@ ends with a commit), an unknown trunk.
|
|
|
1891
1891
|
names a table one of the branch names (generate it again on the trunk); a decision record of
|
|
1892
1892
|
the branch whose number the trunk took since the base gets the next free one (its files, its
|
|
1893
1893
|
`# ADR-NNNN` title, the links of its translations, recorded as `Lost-Accepted:` lines).
|
|
1894
|
-
6. **`regenerate`** (skipped without the config of the kit or the script); a failure stops.
|
|
1894
|
+
6. **`regenerate`** (skipped without the config of the kit or the script); a failure stops. With
|
|
1895
|
+
Prisma, when the merge changed a file under `prisma/schema/`, then `npm run db:client`: the
|
|
1896
|
+
git-ignored client and `generated/schema.sql`, which the in-process test database reads, are
|
|
1897
|
+
derived from it; a failure stops. Drizzle, Knex and TypeORM derive no such file (their test
|
|
1898
|
+
database reads the tracked sources), so they run nothing more.
|
|
1895
1899
|
7. **`verify-merge`** on the uncommitted result, on the base the trailer records: an error stops
|
|
1896
1900
|
(exit 1), with `file:line (ours|theirs) <text>`, the rows no longer done, the tests lost;
|
|
1897
1901
|
`--continue --accept-lost` records them in a `Lost-Accepted:` trailer and goes on.
|
|
@@ -1900,7 +1904,7 @@ ends with a commit), an unknown trunk.
|
|
|
1900
1904
|
stored-events lock). Any other changed path is listed as left out and blocks it until it is
|
|
1901
1905
|
staged or set aside. The hooks of the project run.
|
|
1902
1906
|
|
|
1903
|
-
`--abort` undoes the merge in progress as `git merge --abort` does and forgets its state. Each stop
|
|
1907
|
+
`--abort` undoes the merge in progress as `git merge --abort` does and forgets its state; the derived files the kit regenerated (`docs/behaviour/`, `CONTEXT.md`, the context map, ...) and modified after the merge staged them are restored and named. `--continue` concludes the trunk commit the merge started from: when the trunk ref names another commit now, the report says so (`trunkMoved: { merged, now }` in `--json`) and tells to run `merge-trunk` again once the merge is committed. Each stop
|
|
1904
1908
|
says what to do next and keeps the merge in progress for the next `--continue`. git 2.40 is needed
|
|
1905
1909
|
for a base git would not compute; an older git merges with `git merge` itself from
|
|
1906
1910
|
`git merge-base` (`--since <merge base>`), and refuses `--dry-run`. Exit 0 once committed, up to
|
|
@@ -1922,7 +1926,7 @@ next: resolve each hunk, `git add <file>`, then `npx ddd-ts-kit merge-trunk --co
|
|
|
1922
1926
|
```
|
|
1923
1927
|
|
|
1924
1928
|
`--json` prints the same report:
|
|
1925
|
-
`{ 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 }`,
|
|
1929
|
+
`{ 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 }`,
|
|
1926
1930
|
`status` being `up-to-date`, `dry-run`, `stopped` or `committed` and `evidence` `option`,
|
|
1927
1931
|
`landed`, `recorded` or `merge-base`. The guard of the plugin refuses `--to-land` to a sub-agent:
|
|
1928
1932
|
landing a branch is the conductor's step, just before its squash merge.
|
|
@@ -2039,7 +2043,11 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2039
2043
|
|
|
2040
2044
|
`ddd-ts-kit explain <rule-id>` prints the same kind of bad and good example for every rule.
|
|
2041
2045
|
|
|
2042
|
-
- `paths` and `--changed-since` limit what is reported, not what is analysed.
|
|
2046
|
+
- `paths` and `--changed-since` limit what is reported, not what is analysed. `--changed-since` keeps a
|
|
2047
|
+
violation when the file it sits on changed, or when a file it names as its `subjects` did (in `--json`):
|
|
2048
|
+
a finding reported on a handler but repaired in the module file (`events/consumer-idempotent`,
|
|
2049
|
+
`declarations/port-adapter-wired`, `authz/declared`, `authz/policy-asked`) shows when only that
|
|
2050
|
+
module file changed. The changed files are those since the merge base, committed or not.
|
|
2043
2051
|
- `--baseline write` records the errors a project already has, counted by file and by rule, in
|
|
2044
2052
|
`ddd-ts-kit-baseline.json` (the shape of `eslint-suppressions.json`), for a codebase that adopts
|
|
2045
2053
|
the kit; commit it. From then on `check` and `check-file` (the hook of the agent) leave quiet the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
3
|
+
* tracked files modified in the index or the working tree (committed or not), and new files git does not track yet, which a generator has just
|
|
4
4
|
* written and nothing has staged. The only place git is invoked, and only to read the user's own
|
|
5
5
|
* history.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CAanE"}
|
|
@@ -2,13 +2,14 @@ import { execFileSync } from 'node:child_process';
|
|
|
2
2
|
import { CliError } from '../../cli-error.js';
|
|
3
3
|
/**
|
|
4
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
|
|
5
|
+
* tracked files modified in the index or the working tree (committed or not), and new files git does not track yet, which a generator has just
|
|
6
6
|
* written and nothing has staged. The only place git is invoked, and only to read the user's own
|
|
7
7
|
* history.
|
|
8
8
|
*/
|
|
9
9
|
export function changedFiles(root, ref) {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
11
|
+
const [base = ref] = gitLines(root, ['merge-base', ref, 'HEAD']);
|
|
12
|
+
const changed = gitLines(root, ['diff', '--name-only', '--relative', base]);
|
|
12
13
|
const untracked = gitLines(root, ['ls-files', '--others', '--exclude-standard']);
|
|
13
14
|
return new Set([...changed, ...untracked]);
|
|
14
15
|
}
|
|
@@ -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,iBAAiB,CAAC;AAE3C;;;;;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,
|
|
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,iBAAiB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,IAAI,CAAC;QACH,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;QAC5E,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-command.d.ts","sourceRoot":"","sources":["../../../src/check/commands/check-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"check-command.d.ts","sourceRoot":"","sources":["../../../src/check/commands/check-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA2BtD,eAAO,MAAM,YAAY,EAAE,OA8B1B,CAAC"}
|
|
@@ -20,6 +20,7 @@ import { loadLooseProject } from '../project/load-loose-project.js';
|
|
|
20
20
|
import { loadProject } from '../project/load-project.js';
|
|
21
21
|
import { toPosix } from '../project/to-posix.js';
|
|
22
22
|
import { changedFiles } from './changed-files.js';
|
|
23
|
+
import { isReportedSince } from './is-reported-since.js';
|
|
23
24
|
import { knownRules } from './known-rules.js';
|
|
24
25
|
import { selfCheck } from './self-check.js';
|
|
25
26
|
const FORMATS = ['text', 'json', 'github', 'gitlab'];
|
|
@@ -68,7 +69,7 @@ function checkProject(args, rules) {
|
|
|
68
69
|
const scopes = args.positionals.map((entry) => toPosix(path.relative(root, path.resolve(cwd, entry))).replace(/\/$/, ''));
|
|
69
70
|
const ref = args.text('changed-since');
|
|
70
71
|
const changed = ref === undefined ? undefined : changedFiles(root, ref);
|
|
71
|
-
const reported = result.violations.filter((violation) => isInScope(violation, scopes) && (
|
|
72
|
+
const reported = result.violations.filter((violation) => isInScope(violation, scopes) && isReportedSince(violation, changed));
|
|
72
73
|
return summarize(reported, result);
|
|
73
74
|
}
|
|
74
75
|
/** The errors the baseline of the project records stay quiet; a count it no longer reaches is judged when every rule ran. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-command.js","sourceRoot":"","sources":["../../../src/check/commands/check-command.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAgB,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,O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AM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;IAEtE,OAAO,GAAG,aAAa,KAAK,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,gBAAgB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,QAAQ,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,+HAA+H,CAAC;AACrS,CAAC;AAED,SAAS,SAAS,CAAC,SAAoB,EAAE,MAAyB;IAChE,OAAO,CACL,MAAM,CAAC,MAAM,KAAK,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,IAAI,SAAS,CAAC,IAAI,KAAK,KAAK,IAAI,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAC3G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Violation } from '../model/violation.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether `check --changed-since` reports a violation: the file it sits on changed, or one of the
|
|
4
|
+
* files it names as its subjects (where it is repaired) did. Without a set of changed files,
|
|
5
|
+
* every violation is reported.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isReportedSince(violation: Violation, changed: ReadonlySet<string> | undefined): boolean;
|
|
8
|
+
//# sourceMappingURL=is-reported-since.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-reported-since.d.ts","sourceRoot":"","sources":["../../../src/check/commands/is-reported-since.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,OAAO,CAIvG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `check --changed-since` reports a violation: the file it sits on changed, or one of the
|
|
3
|
+
* files it names as its subjects (where it is repaired) did. Without a set of changed files,
|
|
4
|
+
* every violation is reported.
|
|
5
|
+
*/
|
|
6
|
+
export function isReportedSince(violation, changed) {
|
|
7
|
+
return (changed === undefined || changed.has(violation.file) || (violation.subjects ?? []).some((path) => changed.has(path)));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=is-reported-since.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-reported-since.js","sourceRoot":"","sources":["../../../src/check/commands/is-reported-since.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAoB,EAAE,OAAwC;IAC5F,OAAO,CACL,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CACrH,CAAC;AACJ,CAAC"}
|
|
@@ -3,5 +3,11 @@ export interface Finding {
|
|
|
3
3
|
readonly line: number;
|
|
4
4
|
readonly message: string;
|
|
5
5
|
readonly fix: string;
|
|
6
|
+
/**
|
|
7
|
+
* The other files this finding is repaired in, when it sits on a file that is not its cause (a
|
|
8
|
+
* handler reported because the module file does not register it). `check --changed-since`
|
|
9
|
+
* keeps the finding when one of them changed.
|
|
10
|
+
*/
|
|
11
|
+
readonly subjects?: readonly string[];
|
|
6
12
|
}
|
|
7
13
|
//# sourceMappingURL=finding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finding.d.ts","sourceRoot":"","sources":["../../../src/check/model/finding.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"finding.d.ts","sourceRoot":"","sources":["../../../src/check/model/finding.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC"}
|
|
@@ -3,6 +3,8 @@ import type { Violation } from './violation.js';
|
|
|
3
3
|
interface Place {
|
|
4
4
|
readonly file: string;
|
|
5
5
|
readonly line: number;
|
|
6
|
+
/** The other files the finding is repaired in. */
|
|
7
|
+
readonly subjects?: readonly string[] | undefined;
|
|
6
8
|
}
|
|
7
9
|
export type Report = (at: Place, message: string, fix: string) => Violation;
|
|
8
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/check/model/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,+EAA+E;AAC/E,UAAU,KAAK;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/check/model/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,+EAA+E;AAC/E,UAAU,KAAK;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CACnD;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC"}
|
|
@@ -6,5 +6,7 @@ export interface Violation {
|
|
|
6
6
|
readonly message: string;
|
|
7
7
|
/** One sentence saying what to do instead; written for whoever has to repair the code. */
|
|
8
8
|
readonly fix: string;
|
|
9
|
+
/** The other files the finding is repaired in; `check --changed-since` keeps it when one of them changed. */
|
|
10
|
+
readonly subjects?: readonly string[];
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=violation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"violation.d.ts","sourceRoot":"","sources":["../../../src/check/model/violation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"violation.d.ts","sourceRoot":"","sources":["../../../src/check/model/violation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6GAA6G;IAC7G,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC"}
|
|
@@ -37,7 +37,7 @@ export const authzDeclared = {
|
|
|
37
37
|
return [];
|
|
38
38
|
}
|
|
39
39
|
const declared = declaredUseCases(project);
|
|
40
|
-
return perFile(project, this.id, (file) => missingFromTheMap(file, declared));
|
|
40
|
+
return perFile(project, this.id, (file) => missingFromTheMap(file, declared, project));
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
function undeclaredRegistrations(file, project) {
|
|
@@ -52,7 +52,8 @@ function undeclaredRegistrations(file, project) {
|
|
|
52
52
|
if (DECLARATION.test(code.slice(match.index, Math.min(next, statementEnd(code, match.index))))) {
|
|
53
53
|
return [];
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
const declaring = sourceDeclaring(project, file, name);
|
|
56
|
+
if (declaresItsAccess(declaring, name)) {
|
|
56
57
|
return [];
|
|
57
58
|
}
|
|
58
59
|
const fix = `Chain .requires(<context>Permissions['<permission>']) or .public() between .${kind}(${name}) and .handledBy(...): nothing is reachable by default.`;
|
|
@@ -61,6 +62,7 @@ function undeclaredRegistrations(file, project) {
|
|
|
61
62
|
line: file.scan.lineAt(match.index),
|
|
62
63
|
message: `The ${kind} ${name} is registered without saying who may send it.`,
|
|
63
64
|
fix,
|
|
65
|
+
subjects: declaring.path === file.path ? [] : [declaring.path],
|
|
64
66
|
},
|
|
65
67
|
];
|
|
66
68
|
});
|
|
@@ -135,10 +137,7 @@ function declaredUseCases(project) {
|
|
|
135
137
|
const declared = new Map();
|
|
136
138
|
for (const file of project.files) {
|
|
137
139
|
const { location } = file;
|
|
138
|
-
if (!
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
if (location.layer !== 'module' && !(location.layer === 'application' && location.inside[0] === 'authorization')) {
|
|
140
|
+
if (!isAuthorizationMapFile(file) || !inContext(location)) {
|
|
142
141
|
continue;
|
|
143
142
|
}
|
|
144
143
|
const names = declared.get(location.context) ?? new Set();
|
|
@@ -149,7 +148,7 @@ function declaredUseCases(project) {
|
|
|
149
148
|
}
|
|
150
149
|
return declared;
|
|
151
150
|
}
|
|
152
|
-
function missingFromTheMap(file, declared) {
|
|
151
|
+
function missingFromTheMap(file, declared, project) {
|
|
153
152
|
const here = inLayer(file, 'application');
|
|
154
153
|
const kind = USE_CASE_FILE.exec(file.path)?.[1];
|
|
155
154
|
if (here === undefined || kind === undefined || !isUseCaseFolder(here.inside, kind)) {
|
|
@@ -166,6 +165,7 @@ function missingFromTheMap(file, declared) {
|
|
|
166
165
|
line: useCase.line,
|
|
167
166
|
message: `The ${kind} ${useCase.name} declares no permission and is not declared public.`,
|
|
168
167
|
fix: `Add requires(${useCase.name}, <context>Permissions['<permission>']) or publicUseCase(${useCase.name}) to the authorization entries of ${here.context}.module.ts (or of a file in application/authorization/).`,
|
|
168
|
+
subjects: authorizationMapFiles(project, here.context).map(({ path }) => path),
|
|
169
169
|
},
|
|
170
170
|
];
|
|
171
171
|
}
|
|
@@ -173,4 +173,14 @@ function missingFromTheMap(file, declared) {
|
|
|
173
173
|
function isUseCaseFolder(inside, kind) {
|
|
174
174
|
return inside.length === 3 && inside[0] === (kind === 'command' ? 'commands' : 'queries');
|
|
175
175
|
}
|
|
176
|
+
/** The module file of a context and the files of its authorization folder: where the use cases are declared in a module wired by hand. */
|
|
177
|
+
function isAuthorizationMapFile(file) {
|
|
178
|
+
const { location } = file;
|
|
179
|
+
return (inContext(location) &&
|
|
180
|
+
!file.isTest &&
|
|
181
|
+
(location.layer === 'module' || (location.layer === 'application' && location.inside[0] === 'authorization')));
|
|
182
|
+
}
|
|
183
|
+
function authorizationMapFiles(project, context) {
|
|
184
|
+
return project.files.filter((file) => isAuthorizationMapFile(file) && inContext(file.location) && file.location.context === context);
|
|
185
|
+
}
|
|
176
186
|
//# sourceMappingURL=authz-declared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-declared.js","sourceRoot":"","sources":["../../../src/check/rules/authz-declared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAKvD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,YAAY,GAAG,iDAAiD,CAAC;AACvE,MAAM,WAAW,GAAG,+BAA+B,CAAC;AACpD,MAAM,YAAY,GAAG,gDAAgD,CAAC;AACtE,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAC/C,MAAM,SAAS,GAAG,wDAAwD,CAAC;AAC3E,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEjD,MAAM,aAAa,GACjB,kMAAkM,CAAC;AA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ACL,SAAS,CAAC,QAAQ,CAAC;QACnB,CAAC,IAAI,CAAC,MAAM;QACZ,CAAC,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,aAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC,CAAC,CAC9G,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAgB,EAAE,OAAe;IAC9D,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CACzB,CAAC,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,KAAK,OAAO,CACxG,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-asked.d.ts","sourceRoot":"","sources":["../../../src/check/rules/authz-policy-asked.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAqB1C,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"authz-policy-asked.d.ts","sourceRoot":"","sources":["../../../src/check/rules/authz-policy-asked.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAqB1C,eAAO,MAAM,gBAAgB,EAAE,IAyB9B,CAAC"}
|
|
@@ -28,18 +28,18 @@ export const authzPolicyAsked = {
|
|
|
28
28
|
}
|
|
29
29
|
return requirements(project)
|
|
30
30
|
.filter(({ permission }) => refined.has(permission.key))
|
|
31
|
-
.flatMap((requirement) => handlersOf(project, requirement).flatMap((handler) => toViolations(report, handler.path, unasked(handler, requirement))));
|
|
31
|
+
.flatMap((requirement) => handlersOf(project, requirement).flatMap((handler) => toViolations(report, handler.path, unasked(handler, requirement, refined.get(requirement.permission.key) ?? []))));
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
/** The permissions some policy refines, by `@Policy(<permission>, ...)` or `definePolicy({ permission, ... })`. */
|
|
35
35
|
function refinedPermissions(project) {
|
|
36
|
-
const refined = new
|
|
36
|
+
const refined = new Map();
|
|
37
37
|
for (const file of project.files) {
|
|
38
38
|
if (inLayer(file, 'application')?.inside[0] !== 'authorization') {
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
41
|
for (const permission of [...decoratedPolicies(file), ...definedPolicies(file)]) {
|
|
42
|
-
refined.
|
|
42
|
+
refined.set(permission.key, [...(refined.get(permission.key) ?? []), file.path]);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return refined;
|
|
@@ -155,7 +155,7 @@ function messageSource(project, declaredIn, message) {
|
|
|
155
155
|
function declares(file, name) {
|
|
156
156
|
return classesOf(file.scan).some((candidate) => candidate.name === name);
|
|
157
157
|
}
|
|
158
|
-
function unasked(handler, { message, permission }) {
|
|
158
|
+
function unasked(handler, { message, permission, declaredIn }, policies) {
|
|
159
159
|
if (asks(handler, permission)) {
|
|
160
160
|
return [];
|
|
161
161
|
}
|
|
@@ -165,6 +165,7 @@ function unasked(handler, { message, permission }) {
|
|
|
165
165
|
line: handlerClass?.line ?? 1,
|
|
166
166
|
message: `A policy refines ${permission.written}, which ${message} requires, and ${handlerClass?.name ?? 'its handler'} never asks it: the bus checked the permission without the element, and the rule of the policy is skipped.`,
|
|
167
167
|
fix: `Load the element, then call \`await this.access.authorize(${/Query$/.test(message) ? 'query' : 'command'}.actor, ${permission.written}, <aggregate>)\` with the Access port of @ddd-ts-kit/auth, before the change.`,
|
|
168
|
+
subjects: [...new Set([declaredIn.path, ...policies])].filter((path) => path !== handler.path),
|
|
168
169
|
},
|
|
169
170
|
];
|
|
170
171
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-asked.js","sourceRoot":"","sources":["../../../src/check/rules/authz-policy-asked.ts"],"names":[],"mappings":"AAAA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KAAK,GAAG,IAAI,MAAM,CAAC,eAAe,GAAG,yBAAyB,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAEjH,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC9F,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QACtB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CACpC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,UAAU,CAAC,GAAG,CAC3F,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-port-adapter-wired.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-port-adapter-wired.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAgC1C,eAAO,MAAM,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"declarations-port-adapter-wired.d.ts","sourceRoot":"","sources":["../../../src/check/rules/declarations-port-adapter-wired.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAgC1C,eAAO,MAAM,4BAA4B,EAAE,IA2B1C,CAAC"}
|
|
@@ -23,6 +23,7 @@ export const declarationsPortAdapterWired = {
|
|
|
23
23
|
run(project) {
|
|
24
24
|
const composed = composedClasses(project);
|
|
25
25
|
const needed = neededPorts(project);
|
|
26
|
+
const roots = project.files.filter((file) => isCompositionRoot(file, project));
|
|
26
27
|
return perFile(project, this.id, (file) => {
|
|
27
28
|
const place = inLayer(file, 'infrastructure');
|
|
28
29
|
if (place === undefined || isLeftToDo(file)) {
|
|
@@ -30,7 +31,7 @@ export const declarationsPortAdapterWired = {
|
|
|
30
31
|
}
|
|
31
32
|
return implementations(file)
|
|
32
33
|
.filter(({ shape, port }) => needed(port) && !composed.has(`${file.path}#${shape.name}`) && !isDeclared(file, project, shape))
|
|
33
|
-
.map((implementation) => unwired(implementation, project, place.context));
|
|
34
|
+
.map((implementation) => unwired({ ...implementation, subjects: rootsOf(roots, place.context) }, project, place.context));
|
|
34
35
|
});
|
|
35
36
|
},
|
|
36
37
|
};
|
|
@@ -104,7 +105,7 @@ function isDeclared(file, project, shape) {
|
|
|
104
105
|
}
|
|
105
106
|
return shape.isExported && declaredRoleOf(pathInContext(project, file) ?? '', WITHOUT_MODULE) !== undefined;
|
|
106
107
|
}
|
|
107
|
-
function unwired({ shape, port, repository }, project, context) {
|
|
108
|
+
function unwired({ shape, port, repository, subjects }, project, context) {
|
|
108
109
|
const marker = `if it is kept unwired on purpose, write docs/adr/NNNN-<slug>.md and put \`// ddd-ts-kit-disable-next-line ${RULE_ID} -- ADR-NNNN: <why>\` above the class`;
|
|
109
110
|
if (isDeclaredStyle(project)) {
|
|
110
111
|
const decorator = repository ? `@Repository(${port})` : `@Gateway(${port}) or @Adapter(${port}, { kind })`;
|
|
@@ -113,12 +114,20 @@ function unwired({ shape, port, repository }, project, context) {
|
|
|
113
114
|
line: shape.line,
|
|
114
115
|
message: `${shape.name} implements the port ${port}, but carries no declaration and no file of the composition root imports it: nothing binds it, and the port is missing at run time.`,
|
|
115
116
|
fix: `Put ${decorator} from ${DECLARATIONS_ENTRY} above the class, in a role file (${files}), or bind it in the platform; ${marker}.`,
|
|
117
|
+
subjects,
|
|
116
118
|
};
|
|
117
119
|
}
|
|
118
120
|
return {
|
|
119
121
|
line: shape.line,
|
|
120
122
|
message: `${shape.name} implements the port ${port}, but no file of the composition root imports it: nothing binds it, and the port is missing at run time.`,
|
|
121
123
|
fix: `Bind it in ${context}.module.ts, \`builder.bind(${port}).toClass(${shape.name}, [..])\`, or in src/main.ts; ${marker}.`,
|
|
124
|
+
subjects,
|
|
122
125
|
};
|
|
123
126
|
}
|
|
127
|
+
/** The files that could bind the adapter: the composition root outside the contexts and the module files of its own context. */
|
|
128
|
+
function rootsOf(roots, context) {
|
|
129
|
+
return roots
|
|
130
|
+
.filter(({ location }) => location.area !== 'context' || location.context === context)
|
|
131
|
+
.map(({ path }) => path);
|
|
132
|
+
}
|
|
124
133
|
//# sourceMappingURL=declarations-port-adapter-wired.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-port-adapter-wired.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-port-adapter-wired.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAMxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,qGAAqG;AACrG,MAAM,kBAAkB,GAAG;IACzB,GAAG,IAAI,GAAG,CACR,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CACzG,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAC1B,CACF;CACF,CAAC;AAEF,MAAM,OAAO,GAAG,iCAAiC,CAAC;AAElD,+HAA+H;AAC/H,MAAM,UAAU,GAAG,+BAA+B,CAAC;AAQnD,MAAM,CAAC,MAAM,4BAA4B,GAAS;IAChD,EAAE,EAAE,OAAO;IACX,WAAW,EACT,+gBAA+gB;IACjhB,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"declarations-port-adapter-wired.js","sourceRoot":"","sources":["../../../src/check/rules/declarations-port-adapter-wired.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAMxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OA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