@avi2dg/checks 0.12.0 → 0.14.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/CONTRIBUTING.md +89 -0
  3. package/README.md +137 -1230
  4. package/dist/feature-rules.js +14 -1
  5. package/docs/configs/commit-messages.md +43 -0
  6. package/docs/configs/dependency-rules.md +62 -0
  7. package/docs/configs/effect-rules.md +48 -0
  8. package/docs/configs/quality-file.md +99 -0
  9. package/docs/design.md +77 -0
  10. package/docs/gates/checks-backtest.md +50 -0
  11. package/docs/gates/checks-ci-wiring.md +122 -0
  12. package/docs/gates/checks-comment-gate.md +58 -0
  13. package/docs/gates/checks-commit-identity.md +63 -0
  14. package/docs/gates/checks-docs.md +98 -0
  15. package/docs/gates/checks-feature-owners.md +113 -0
  16. package/docs/gates/checks-flake.md +88 -0
  17. package/docs/gates/checks-lint-coverage.md +49 -0
  18. package/docs/gates/checks-lint.md +136 -0
  19. package/docs/gates/checks-mutation-compare.md +84 -0
  20. package/docs/gates/checks-quality.md +94 -0
  21. package/docs/gates/checks-size-budget.md +64 -0
  22. package/docs/gates/checks-suppressions-ratchet.md +51 -0
  23. package/docs/gates/checks-test-layout.md +77 -0
  24. package/docs/gates/checks-test.md +75 -0
  25. package/package.json +24 -3
  26. package/quality.schema.json +48 -0
  27. package/scripts/doc-outline.ts +215 -0
  28. package/scripts/doc-rules.ts +177 -0
  29. package/scripts/doc-templates.ts +208 -0
  30. package/scripts/docs.ts +90 -0
  31. package/scripts/gates.ts +1 -0
  32. package/scripts/quality-file.ts +22 -1
  33. package/templates/adr.md +29 -0
  34. package/templates/agents.md +17 -0
  35. package/templates/changelog.md +37 -0
  36. package/templates/claude.md +2 -0
  37. package/templates/explanation.md +15 -0
  38. package/templates/how-to.md +33 -0
  39. package/templates/readme.md +45 -0
  40. package/templates/reference.md +15 -0
  41. package/templates/tutorial.md +31 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,124 @@
1
+ # Changelog
2
+
3
+ Every release of `@avi2dg/checks`, newest first, written by the release from its conventional commits.
4
+
5
+ ## 0.14.0
6
+
7
+ Released 2026-09-25.
8
+
9
+ ### Features
10
+
11
+ - **scripts:** generate README blocks, check CONTRIBUTING.md, and give each bin a page (#39)
12
+ - **scripts:** generate CHANGELOG.md from conventional commits and ship it in the package (#40)
13
+
14
+ ## 0.13.0
15
+
16
+ Released 2026-09-25.
17
+
18
+ ### Features
19
+
20
+ - **scripts:** add checks-docs gate holding doc files to shared templates (#37)
21
+
22
+ ## 0.12.0
23
+
24
+ Released 2026-09-24.
25
+
26
+ ### Features
27
+
28
+ - **scripts:** add size budget, feature-owner rules and change-signal gates (#35)
29
+
30
+ ### Fixes
31
+
32
+ - release 0.12.0 and read local exports in checks-feature-owners (#36)
33
+
34
+ ## 0.11.0
35
+
36
+ Released 2026-09-24.
37
+
38
+ ### Features
39
+
40
+ - **scripts:** add quality.json with schema, loader and checks-quality fragment generator (#33)
41
+
42
+ ## 0.10.0
43
+
44
+ Released 2026-09-24.
45
+
46
+ ### Features
47
+
48
+ - **scripts:** add checks-test skip gate and checks-flake seed recorder (#31)
49
+
50
+ ## 0.9.0
51
+
52
+ Released 2026-09-24.
53
+
54
+ ### Features
55
+
56
+ - **scripts:** let ciWiring.lintGates select the gates checks-lint runs (#29)
57
+ - **oxlintrc:** turn on no-unsafe-type-assertion and no-non-null-assertion (#26)
58
+
59
+ ### Fixes
60
+
61
+ - **scripts:** split Effect-free comment matchers out for hosts without node_modules (#30)
62
+ - **scripts:** judge a repository's first commit against the empty tree in the range gates (#28)
63
+ - **lint:** cruise the whole repo; lint-coverage counts skips and exits 2 on a failed walk (#27)
64
+
65
+ ## 0.8.0
66
+
67
+ Released 2026-09-24.
68
+
69
+ ### Features
70
+
71
+ - **scripts:** add checks-lint to run every kit lint gate over one resolved range (#25)
72
+ - **scripts:** run the bins on Effect and hold scripts/ to Effect-native IO (#22)
73
+
74
+ ## 0.6.0
75
+
76
+ Released 2026-09-24.
77
+
78
+ ### Features
79
+
80
+ - add checks-suppressions-ratchet to refuse a raised oxlint suppression count (#21)
81
+
82
+ ## 0.5.0
83
+
84
+ Released 2026-09-24.
85
+
86
+ ### Features
87
+
88
+ - **effect-channel:** add opt-in no-throw and no-try-catch rules (#20)
89
+
90
+ ## 0.4.0
91
+
92
+ Released 2026-09-24.
93
+
94
+ ### Features
95
+
96
+ - add checks-ci-wiring to confirm CI runs each declared gate on pull requests (#19)
97
+
98
+ ### Fixes
99
+
100
+ - pin the quarantine pathIgnorePatterns in the test-layout bunfig check (#18)
101
+
102
+ ## 0.3.0
103
+
104
+ Released 2026-09-23.
105
+
106
+ ### Features
107
+
108
+ - add checks-mutation-compare no-regression gate for Stryker reports (#17)
109
+ - ship a shared Stryker mutation-testing preset (#16)
110
+
111
+ ## 0.2.0
112
+
113
+ Released 2026-09-23.
114
+
115
+ ### Features
116
+
117
+ - expose runnable scripts as checks- bins for consumer package scripts (#15)
118
+ - rename npm package from @avi2d/checks to @avi2dg/checks (#14)
119
+ - add a shared comment gate and backtest command (#12)
120
+ - publish @avi2d/checks to the public npm registry (#11)
121
+
122
+ ### Fixes
123
+
124
+ - count violation lines from file top, drop dead moduleStart (#10)
@@ -0,0 +1,89 @@
1
+ # Contribute to checks
2
+
3
+ Whoever changes the kit follows these steps in a clone of this repository, before opening a pull request and when cutting a release.
4
+
5
+ ## Before you begin
6
+
7
+ - Bun at the version `.bun-version` pins, since CI builds `dist/` with it and another version emits different bytes.
8
+
9
+ ## Check a change
10
+
11
+ To check a change the way CI does:
12
+
13
+ 1. Run `bun install`.
14
+ 1. Run `bun run build`, which rewrites the files it generates, as Regenerate what is committed lists.
15
+ 1. Run `bun run lint`, which runs oxlint, the kit's own gates through `scripts/lint.ts`, and the dependency cruise.
16
+ 1. Run `bun run typecheck`.
17
+ 1. Run `bun run test`, which runs the suite through `scripts/test.ts`.
18
+
19
+ CI runs the commands `gates.ci` lists in `quality.json`, which include `git diff --exit-code` over the whole tree after the build and the commit lint on the pull request title.
20
+
21
+ ## Regenerate what is committed
22
+
23
+ Each generated file is committed, and lint, the suite or CI's diff after the build fails on one left stale.
24
+
25
+ To regenerate after an edit:
26
+
27
+ 1. After editing `sources.effect` in `quality.json` or a file in `presets/`, run `bun scripts/quality.ts generate`, which rewrites `oxlintrc.quality.json` and `tsconfig.quality.json`.
28
+ 1. After editing `effect-channel/`, `scripts/feature-rules.ts`, the schema in `scripts/quality-file.ts` or the templates in `scripts/doc-templates.ts`, run `bun run build`.
29
+ It rewrites `dist/index.js`, `dist/feature-rules.js`, `quality.schema.json` and `templates/`.
30
+ 1. After editing anything a generated block names as its source in its opening marker, run `bun run build`, which rewrites every generated block.
31
+ 1. Commit what the command rewrote in the same commit as the edit.
32
+
33
+ ## Release a version
34
+
35
+ A release is a tag on `main`, which the `release` workflow publishes through npm trusted publishing, so no token is stored anywhere and GitHub mints the publish credential for each run.
36
+
37
+ To release a version:
38
+
39
+ 1. In a pull request that holds only the release, bump `version` in `package.json` and run `bun run build`.
40
+ The build writes the version's section into `CHANGELOG.md` from the conventional commits since the last release, so the changelog is never edited by hand.
41
+ 1. Commit both as `chore: release <version>` and title the pull request the same.
42
+ The squash merge lands the title as the commit's subject, and a `feat` or `fix` title would add an entry the committed changelog lacks.
43
+ 1. Rebase the pull request onto `main` right before it merges, since a commit merged in between belongs to the release and the committed section would lack it.
44
+ 1. Once it merges, tag that commit on `main` with the version and push the tag, since the version bump commit closes the release:
45
+
46
+ ```sh
47
+ tag="v$(bun -p 'require("./package.json").version')"
48
+ git tag "$tag" && git push origin "$tag"
49
+ ```
50
+
51
+ 1. Watch the `release` workflow.
52
+ It refuses a tag off `main` or one that disagrees with `package.json`, and reruns the build, the check that the build changed no committed file, lint, typecheck and the suite before it publishes.
53
+
54
+ `publishConfig.access` in `package.json` is what makes the scoped package public.
55
+ npm attaches a trusted publisher only to a package that already exists, so a package's first version goes out by hand.
56
+ That is `npm publish` from the tagged commit as `avi2dg`, then adding the trusted publisher in the package's npm settings, with the repository `avi2d/checks` and the workflow `release.yml`.
57
+ That first tag's `release` run fails on the already-published version, and every later tag publishes through the workflow.
58
+
59
+ ## Find where a change goes
60
+
61
+ To place a change:
62
+
63
+ 1. Find the path it belongs under:
64
+
65
+ | Path | What it holds |
66
+ | --- | --- |
67
+ | `scripts/` | every bin, and the modules they share |
68
+ | `effect-channel/` | the Effect error-channel oxlint plugin |
69
+ | `dist/` | the committed bundles of the plugin and of `featureRules` |
70
+ | `presets/` | the Effect presets `checks-quality` builds its fragments from |
71
+ | `templates/` | one template per kind of doc file, which `bun run build` renders |
72
+ | `CHANGELOG.md` | every release, which `bun run build` writes from the conventional commits |
73
+ | `tests/` | the suite, with the tests that spawn a process under `tests/e2e/` |
74
+ | `docs/gates/` | one reference page per bin |
75
+ | `docs/configs/` | one reference page per shipped config a bin does not own |
76
+ | `docs/design.md` | why the kit is shaped the way it is |
77
+ | the root configs | `oxlintrc.json`, `tsconfig.effect.json`, `bunfig.toml`, `commitlint.config.js`, `dependency-cruiser.config.js`, `stryker.preset.js` and `quality.schema.json`, which a consuming repository extends or copies |
78
+
79
+ 1. Change the page under `docs/` that describes the behaviour in the same commit as the behaviour.
80
+ A new bin gets its page under `docs/gates/`, and the suite fails until it has one.
81
+
82
+ This repository holds itself to the kit, with two exceptions of its own.
83
+ Its `.dependency-cruiser.cjs` redeclares `no-orphans` with the plugin entry added to its `pathNot`.
84
+ Its `.oxlintrc.json` lifts `effect-channel/no-throw` from `scripts/comment-matchers.ts`, the one file under its Effect path that a host loads without `node_modules`.
85
+
86
+ ## Related topics
87
+
88
+ - [checks](README.md)
89
+ - [Why it is shaped this way](docs/design.md)