repo-contract 0.7.2 → 0.8.4

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 (44) hide show
  1. package/CHANGELOG.md +134 -73
  2. package/README.md +4 -0
  3. package/bin/preset-catalog.d.mts +9 -0
  4. package/bin/preset-catalog.mjs +42 -1
  5. package/bin/repo-contract.mjs +6 -2
  6. package/dist/.dts/helpers/exception-policy.d.ts +6 -6
  7. package/dist/.dts/helpers/exception-policy.d.ts.map +1 -1
  8. package/dist/.dts/helpers/glob-match.d.ts +29 -0
  9. package/dist/.dts/helpers/glob-match.d.ts.map +1 -0
  10. package/dist/.dts/helpers/index.d.ts +1 -1
  11. package/dist/.dts/parsing/parse-output.d.ts +1 -1
  12. package/dist/.dts/presets/dist-no-urls.d.ts +26 -0
  13. package/dist/.dts/presets/dist-no-urls.d.ts.map +1 -0
  14. package/dist/.dts/presets/index.d.ts +2 -0
  15. package/dist/.dts/presets/index.d.ts.map +1 -1
  16. package/dist/.dts/standard-schema/types.d.ts +2 -2
  17. package/dist/.dts/types.d.ts +5 -5
  18. package/dist/.dts/types.d.ts.map +1 -1
  19. package/dist/chunk-HDKSRSNF.js +108 -0
  20. package/dist/chunk-HDKSRSNF.js.map +1 -0
  21. package/dist/helpers.cjs +109 -3
  22. package/dist/helpers.cjs.map +1 -1
  23. package/dist/helpers.js +3 -4
  24. package/dist/helpers.js.map +1 -1
  25. package/dist/index.cjs +2 -2
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +2 -2
  28. package/dist/index.js.map +1 -1
  29. package/dist/presets.cjs +214 -0
  30. package/dist/presets.cjs.map +1 -1
  31. package/dist/presets.js +110 -1
  32. package/dist/presets.js.map +1 -1
  33. package/package.json +27 -22
  34. package/schemas/evidence.schema.json +2 -2
  35. package/schemas/verdict.schema.json +2 -2
  36. package/src/config/validate-config.ts +3 -3
  37. package/src/helpers/exception-policy.ts +9 -9
  38. package/src/helpers/glob-match.ts +203 -0
  39. package/src/helpers/index.ts +1 -1
  40. package/src/parsing/parse-output.ts +1 -1
  41. package/src/presets/dist-no-urls.ts +179 -0
  42. package/src/presets/index.ts +2 -0
  43. package/src/standard-schema/types.ts +2 -2
  44. package/src/types.ts +5 -5
package/CHANGELOG.md CHANGED
@@ -1,62 +1,133 @@
1
1
  # Changelog
2
2
 
3
- ## [0.7.2](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.7.1...repo-contract-v0.7.2) (2026-09-27)
3
+ ## 0.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 9549cf9: Accept npm 12's `npm pack --json` output (an object keyed by package name) as well as the older array form, so the consumer-install E2E suites and the `arethetypeswrong` check no longer fail under the latest npm during the release job.
8
+
9
+ ## 0.8.3
10
+
11
+ ### Patch Changes
12
+
13
+ - chore(benchmarks): refresh results.json
14
+ - 8bcc7d4: Send the publish-time contract run's report to stderr so a failing check is visible in the release job's log instead of being swallowed by the Changesets action.
15
+
16
+ ## 0.8.2
17
+
18
+ ### Patch Changes
19
+
20
+ - chore(benchmarks): refresh results.json
21
+ - e0f4cd4: Generate the gitignored `docs/api/` and `docs/benchmarks/` pages before the publish-time contract run, so the `docs` check no longer 404s on them in the release job's fresh checkout.
22
+
23
+ ## 0.8.1
4
24
 
25
+ ### Patch Changes
26
+
27
+ - chore(sbom): regenerate for 0.8.0
28
+ - chore(benchmarks): refresh results.json
29
+ - chore: sync generated API baseline for release
30
+
31
+ ## 0.8.0
32
+
33
+ ### Minor Changes
34
+
35
+ - feat(sbom): add a real CycloneDX SBOM generator check
36
+ - feat: consume internal-package-contract's ApiContract/ApiDocsReport engine
37
+ - feat(benchmarks): add repo-contract's own benchmark suite, wire into CI, add site nav
38
+ - 4cd248d: Add the `distNoUrls({ dir?, allow? })` preset (`repo-contract/presets`). It fails when any URL
39
+ (any scheme followed by a colon and two slashes) appears in any file of the build output --
40
+ code, declarations and sourcemaps included -- so supply-chain scanners such as Socket.dev have no
41
+ URL strings to flag. `allow` takes `{ url, reason }` entries (`url` may be a glob); a missing
42
+ `reason` fails the check. repo-contract's own build output is now URL-free and the check runs in
43
+ its own contract.
44
+ - 65b74f0: Remove the `minimatch` runtime dependency. Exception-policy category globs are now matched by a
45
+ dependency-free, environment-free matcher (`src/helpers/glob-match.ts`, ADR 0017), so the package
46
+ has zero runtime dependencies. **Breaking (0.x minor):** only `*`, `**`, `?`, `[...]` classes,
47
+ `{a,b}` alternation and `\` escapes are supported; extglobs, POSIX classes, dotfile exclusion and
48
+ case folding are no longer interpreted, and a malformed character class now throws.
49
+
50
+ ### Patch Changes
51
+
52
+ - fix(checks): read the crap4ts report from a file instead of a pipe
53
+ - fix(ci): prettier-ignore the generated release-bump file
54
+ - fix(sbom): derive generate.test.ts's expected paths via path.join
55
+ - fix: waive the OpenSSF-Scorecard docs-links false positive; re-pin IPC workflows to latest SHA
56
+ - chore(benchmarks): refresh results.json
57
+ - fix: prevent TypeDoc/marked GFM autolink from mangling bare VERSIONING.md mentions
58
+ - fix(checks): keep the crap report where a fresh checkout can write it
59
+ - docs: update remaining release-please mentions after the Changesets migration
60
+ - fix(sbom): exclude docs/sbom.cdx.json from Prettier reformatting
61
+ - chore(benchmarks): refresh results.json
62
+ - chore(benchmarks): refresh results.json
63
+ - fix(helpers): reject glob patterns over 1000 characters so brace expansion fails fast
64
+ - chore(main): release repo-contract 0.7.3 (#85)
65
+ - chore: regenerate schemas for the VERSIONING.md backtick fix
66
+ - docs: update prose referencing the old local api-contract/api-docs engine
67
+ - fix: generate docs/api/ before the docs check; fix a stale RELEASING.md anchor
68
+ - fix(benchmarks): strip trailing whitespace before nested blocks in RESULTS.md
69
+ - fix(openssf-scorecard): stop Dangerous-Workflow from misreading past its first run: block
70
+ - fix: skip TypeDoc's own unpushed-HEAD source links in the local pre-push docs crawl
71
+ - chore(benchmarks): refresh results.json
72
+ - chore(benchmarks): refresh results.json
73
+ - chore: remove iso-12207-alignment compliance-document generator
74
+ - a52a06d: The `openssf-scorecard` self-evaluation now computes a weighted aggregate (`Σ(score × weight) / Σ(weight)`), with per-check weights fetched live from `ossf/scorecard`'s own published `docs/checks/internal/checks.yaml` risk tiers and `pkg/scorecard/scorecard_result.go` risk-weight table, rather than a simple average -- mirroring upstream's own `Result.GetAggregateScore` for closer methodology fidelity. `docs/OpenSSF-Scorecard.md` also now records provenance metadata (run date, evaluated repo + commit, and this evaluator's own version -- explicitly distinguished from the upstream `scorecard` binary's version, since this evaluation never runs that binary). Internal tooling only (`checks/`, `scripts/`); no public API change.
75
+
76
+ ## [0.7.3](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.7.2...repo-contract-v0.7.3) (2026-09-27)
5
77
 
6
78
  ### Bug Fixes
7
79
 
8
- * badges/docs-evidence carry forward checks instead of failing every push ([#83](https://github.com/MaverickCER/repo-contract/issues/83)) ([215db16](https://github.com/MaverickCER/repo-contract/commit/215db1666ec334a2cc341a8eedba38cc343abd7c))
80
+ - exclude typescript@7 and vitest@5 from this dependency-group bump ([12b9ad0](https://github.com/MaverickCER/repo-contract/commit/12b9ad03bb808006612fc79f598252633ed4fd53))
9
81
 
10
- ## [0.7.1](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.7.0...repo-contract-v0.7.1) (2026-09-26)
82
+ ## [0.7.2](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.7.1...repo-contract-v0.7.2) (2026-09-27)
11
83
 
84
+ ### Bug Fixes
85
+
86
+ - badges/docs-evidence carry forward checks instead of failing every push ([#83](https://github.com/MaverickCER/repo-contract/issues/83)) ([215db16](https://github.com/MaverickCER/repo-contract/commit/215db1666ec334a2cc341a8eedba38cc343abd7c))
87
+
88
+ ## [0.7.1](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.7.0...repo-contract-v0.7.1) (2026-09-26)
12
89
 
13
90
  ### Bug Fixes
14
91
 
15
- * branch-protection-compatible CI, TS-compat check, dev-audit cleanup ([#78](https://github.com/MaverickCER/repo-contract/issues/78)) ([076461b](https://github.com/MaverickCER/repo-contract/commit/076461bb45b59a5859a3f4bef0da9828c95d10e6))
92
+ - branch-protection-compatible CI, TS-compat check, dev-audit cleanup ([#78](https://github.com/MaverickCER/repo-contract/issues/78)) ([076461b](https://github.com/MaverickCER/repo-contract/commit/076461bb45b59a5859a3f4bef0da9828c95d10e6))
16
93
 
17
94
  ## [0.7.0](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.6.0...repo-contract-v0.7.0) (2026-09-23)
18
95
 
19
-
20
96
  ### ⚠ BREAKING CHANGES
21
97
 
22
- * OutputFormat no longer includes "yaml", and ParserDependencyMissingError (thrown only for a missing "yaml" peer dependency) is removed from the public API. A config using output.format: "yaml" will now fail config validation.
98
+ - OutputFormat no longer includes "yaml", and ParserDependencyMissingError (thrown only for a missing "yaml" peer dependency) is removed from the public API. A config using output.format: "yaml" will now fail config validation.
23
99
 
24
100
  ### Features
25
101
 
26
- * drop first-class YAML output-format support ([99f7b6d](https://github.com/MaverickCER/repo-contract/commit/99f7b6db13ef60e159b2eb589317fdf0e99f0726))
27
- * **security-socket:** reject supplyChainRisk alerts on shipped dependencies outright ([bf7f2b3](https://github.com/MaverickCER/repo-contract/commit/bf7f2b32ed47c496aea4877b20adb474592b85ad))
28
- * **security-socket:** reject supplyChainRisk alerts on shipped dependencies outright ([d0a0563](https://github.com/MaverickCER/repo-contract/commit/d0a0563eb7f783577333291e94383408bb9e8c53))
29
-
102
+ - drop first-class YAML output-format support ([99f7b6d](https://github.com/MaverickCER/repo-contract/commit/99f7b6db13ef60e159b2eb589317fdf0e99f0726))
103
+ - **security-socket:** reject supplyChainRisk alerts on shipped dependencies outright ([bf7f2b3](https://github.com/MaverickCER/repo-contract/commit/bf7f2b32ed47c496aea4877b20adb474592b85ad))
104
+ - **security-socket:** reject supplyChainRisk alerts on shipped dependencies outright ([d0a0563](https://github.com/MaverickCER/repo-contract/commit/d0a0563eb7f783577333291e94383408bb9e8c53))
30
105
 
31
106
  ### Bug Fixes
32
107
 
33
- * **security-socket:** peerDependencies also count as shipped for supplyChainRisk ([e5db3cd](https://github.com/MaverickCER/repo-contract/commit/e5db3cd443c46c131ab0afc076451484132edede))
108
+ - **security-socket:** peerDependencies also count as shipped for supplyChainRisk ([e5db3cd](https://github.com/MaverickCER/repo-contract/commit/e5db3cd443c46c131ab0afc076451484132edede))
34
109
 
35
110
  ## [0.6.0](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.5.2...repo-contract-v0.6.0) (2026-09-20)
36
111
 
37
-
38
112
  ### Features
39
113
 
40
- * **docs:** waive known-good-but-flaky external links; release as 0.6.0 ([2ffdd8f](https://github.com/MaverickCER/repo-contract/commit/2ffdd8fbf9d767f537939da40cd750af2fb5d0b7))
41
-
114
+ - **docs:** waive known-good-but-flaky external links; release as 0.6.0 ([2ffdd8f](https://github.com/MaverickCER/repo-contract/commit/2ffdd8fbf9d767f537939da40cd750af2fb5d0b7))
42
115
 
43
116
  ### Miscellaneous Chores
44
117
 
45
- * release repo-contract as 0.6.0 ([8282f70](https://github.com/MaverickCER/repo-contract/commit/8282f70f7727ee7f2c517acf7e65e93fc51388c9))
118
+ - release repo-contract as 0.6.0 ([8282f70](https://github.com/MaverickCER/repo-contract/commit/8282f70f7727ee7f2c517acf7e65e93fc51388c9))
46
119
 
47
120
  ## [0.5.2](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.5.1...repo-contract-v0.5.2) (2026-09-18)
48
121
 
49
-
50
122
  ### Features
51
123
 
52
- * OpenSSF Scorecard + ISO 12207 alignment, mutation zero-tolerance ([#68](https://github.com/MaverickCER/repo-contract/issues/68)) ([76de4af](https://github.com/MaverickCER/repo-contract/commit/76de4af16cc681e88e3fe85439537848aad096ad))
124
+ - OpenSSF Scorecard + ISO 12207 alignment, mutation zero-tolerance ([#68](https://github.com/MaverickCER/repo-contract/issues/68)) ([76de4af](https://github.com/MaverickCER/repo-contract/commit/76de4af16cc681e88e3fe85439537848aad096ad))
53
125
 
54
126
  ## [0.5.1](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.5.0...repo-contract-v0.5.1) (2026-09-14)
55
127
 
56
-
57
128
  ### Bug Fixes
58
129
 
59
- * correct repository/bugs URL casing to match GitHub (MaverickCER) ([55d563c](https://github.com/MaverickCER/repo-contract/commit/55d563c06ec7b9fe1b26c73239e693f189aa31c8))
130
+ - correct repository/bugs URL casing to match GitHub (MaverickCER) ([55d563c](https://github.com/MaverickCER/repo-contract/commit/55d563c06ec7b9fe1b26c73239e693f189aa31c8))
60
131
 
61
132
  ## [0.5.0](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.4.0...repo-contract-v0.5.0) (2026-09-12)
62
133
 
@@ -64,109 +135,99 @@ Administrative republish -- 0.4.0 is already published on npm at its current con
64
135
 
65
136
  ## [0.4.0](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.3.2...repo-contract-v0.4.0) (2026-09-09)
66
137
 
67
-
68
138
  ### ⚠ BREAKING CHANGES
69
139
 
70
- * adds the new Experimental repo-contract/helpers subpath (exception-policy primitive). No existing export's shape changes; classified as minor per VERSIONING.md's "a new preset -> minor" convention for the Experimental tier, not a literal incompatibility.
140
+ - adds the new Experimental repo-contract/helpers subpath (exception-policy primitive). No existing export's shape changes; classified as minor per VERSIONING.md's "a new preset -> minor" convention for the Experimental tier, not a literal incompatibility.
71
141
 
72
142
  ### Features
73
143
 
74
- * add a narrow `repo-contract init` scaffolding command ([#63](https://github.com/MaverickCER/repo-contract/issues/63)) ([a1d4e4a](https://github.com/MaverickCER/repo-contract/commit/a1d4e4a242cb0253e0a62e486e86a475a5c8ddbd))
75
- * add a verified-exception waiver path to security-network ([94dbf43](https://github.com/MaverickCER/repo-contract/commit/94dbf4321b9288b10c65e7efc3e2596a40f4c628))
76
- * add security-socket and coderabbitai checks ([cb7d3ca](https://github.com/MaverickCER/repo-contract/commit/cb7d3cad8d8015e85c82731075abe48e12371b15))
77
- * add security-socket and coderabbitai checks ([31374ee](https://github.com/MaverickCER/repo-contract/commit/31374eebe5c35ff54e3efd37d5ed756cc8b8cdc4))
78
- * add the checks/shared exception-matching and identity layer ([0d711f5](https://github.com/MaverickCER/repo-contract/commit/0d711f5f17d382af507cfafab4a441d620a8b220))
79
- * add the generic exception-policy core primitive ([8d8f670](https://github.com/MaverickCER/repo-contract/commit/8d8f6704c20bc2c5a4b07e68dcb8e328ee48b9c7))
80
- * content-bound verification for suppression-governance ([fb6a838](https://github.com/MaverickCER/repo-contract/commit/fb6a838da76247cc42ab316ad9d420ff174a4124))
81
- * content-bound verification for suppression-governance (disable-comments.json) ([8da651a](https://github.com/MaverickCER/repo-contract/commit/8da651a0f76ab0464ed3b22ac5113b837ea3ecc1))
82
- * **helpers:** add the exception-registry lifecycle primitives ([de8e855](https://github.com/MaverickCER/repo-contract/commit/de8e8558a26ca238aafc69d736e576aafddd8fa0))
83
- * publish the repo-contract/helpers subpath ([35f168c](https://github.com/MaverickCER/repo-contract/commit/35f168ca9fbde4f46d1a29624f112e0d4d3b296d))
84
- * retrofit security-network onto the exception-policy primitive ([62b8d0a](https://github.com/MaverickCER/repo-contract/commit/62b8d0afae9f3958b60666531d58a25a6f5b796e))
85
-
144
+ - add a narrow `repo-contract init` scaffolding command ([#63](https://github.com/MaverickCER/repo-contract/issues/63)) ([a1d4e4a](https://github.com/MaverickCER/repo-contract/commit/a1d4e4a242cb0253e0a62e486e86a475a5c8ddbd))
145
+ - add a verified-exception waiver path to security-network ([94dbf43](https://github.com/MaverickCER/repo-contract/commit/94dbf4321b9288b10c65e7efc3e2596a40f4c628))
146
+ - add security-socket and coderabbitai checks ([cb7d3ca](https://github.com/MaverickCER/repo-contract/commit/cb7d3cad8d8015e85c82731075abe48e12371b15))
147
+ - add security-socket and coderabbitai checks ([31374ee](https://github.com/MaverickCER/repo-contract/commit/31374eebe5c35ff54e3efd37d5ed756cc8b8cdc4))
148
+ - add the checks/shared exception-matching and identity layer ([0d711f5](https://github.com/MaverickCER/repo-contract/commit/0d711f5f17d382af507cfafab4a441d620a8b220))
149
+ - add the generic exception-policy core primitive ([8d8f670](https://github.com/MaverickCER/repo-contract/commit/8d8f6704c20bc2c5a4b07e68dcb8e328ee48b9c7))
150
+ - content-bound verification for suppression-governance ([fb6a838](https://github.com/MaverickCER/repo-contract/commit/fb6a838da76247cc42ab316ad9d420ff174a4124))
151
+ - content-bound verification for suppression-governance (disable-comments.json) ([8da651a](https://github.com/MaverickCER/repo-contract/commit/8da651a0f76ab0464ed3b22ac5113b837ea3ecc1))
152
+ - **helpers:** add the exception-registry lifecycle primitives ([de8e855](https://github.com/MaverickCER/repo-contract/commit/de8e8558a26ca238aafc69d736e576aafddd8fa0))
153
+ - publish the repo-contract/helpers subpath ([35f168c](https://github.com/MaverickCER/repo-contract/commit/35f168ca9fbde4f46d1a29624f112e0d4d3b296d))
154
+ - retrofit security-network onto the exception-policy primitive ([62b8d0a](https://github.com/MaverickCER/repo-contract/commit/62b8d0afae9f3958b60666531d58a25a6f5b796e))
86
155
 
87
156
  ### Bug Fixes
88
157
 
89
- * address CodeRabbit findings on the security-network retrofit ([e53313e](https://github.com/MaverickCER/repo-contract/commit/e53313ecf2973649cc2dca045a220f27f0e205db))
90
- * address CodeRabbit findings on the two new checks ([255e495](https://github.com/MaverickCER/repo-contract/commit/255e49584a2b6622cee174f560221e731932d840))
91
- * address CodeRabbit findings on the verification retrofit ([3d91878](https://github.com/MaverickCER/repo-contract/commit/3d91878407dd006f82239d034cb319d3856a0c46))
92
- * address round-2 CodeRabbit findings on the helpers primitive ([fabb9df](https://github.com/MaverickCER/repo-contract/commit/fabb9df2261051cc35fbe15faf3e6df9317afdf5))
93
- * backfill verification baseline onto records merged in from main ([286e877](https://github.com/MaverickCER/repo-contract/commit/286e8775ad66d7d727f68c0ba269ad2cfa036d56))
94
- * harden exception-policy config validation and smoke/license accuracy ([e23c069](https://github.com/MaverickCER/repo-contract/commit/e23c069f422ac8967cf8c3a65605bdfb85c07abc))
95
- * reject impossible calendar dates in verifiedAt, sync ADR 0013 ([6df0911](https://github.com/MaverickCER/repo-contract/commit/6df0911c8bbbfe99bd97095e811b9d762aeb6438))
96
- * reject trailing newline in verifiedAt; PATH-aware socket probe in the integration test ([ef01ba6](https://github.com/MaverickCER/repo-contract/commit/ef01ba65950041838a3e43f8d8f440add6c4a97c))
97
- * remove duplicate StandardSchemaV1 re-export in src/helpers/index.ts ([a0d8ee7](https://github.com/MaverickCER/repo-contract/commit/a0d8ee7a490d05fc99d9cbb7150706f7c1494694))
98
- * skip the real-source drift test inside a Stryker mutation sandbox ([e9e64f6](https://github.com/MaverickCER/repo-contract/commit/e9e64f6dbe57a9e0612209bb568b584961d130cc))
99
- * validate exception registries on every run and tighten verification ([8d6993f](https://github.com/MaverickCER/repo-contract/commit/8d6993fb94299a50c7b2589d400e592e43767df5))
100
- * validate the coderabbit terminal event findings count ([a7acd09](https://github.com/MaverickCER/repo-contract/commit/a7acd0950b54f3bd2dbde3956a697d97d80daf9c))
158
+ - address CodeRabbit findings on the security-network retrofit ([e53313e](https://github.com/MaverickCER/repo-contract/commit/e53313ecf2973649cc2dca045a220f27f0e205db))
159
+ - address CodeRabbit findings on the two new checks ([255e495](https://github.com/MaverickCER/repo-contract/commit/255e49584a2b6622cee174f560221e731932d840))
160
+ - address CodeRabbit findings on the verification retrofit ([3d91878](https://github.com/MaverickCER/repo-contract/commit/3d91878407dd006f82239d034cb319d3856a0c46))
161
+ - address round-2 CodeRabbit findings on the helpers primitive ([fabb9df](https://github.com/MaverickCER/repo-contract/commit/fabb9df2261051cc35fbe15faf3e6df9317afdf5))
162
+ - backfill verification baseline onto records merged in from main ([286e877](https://github.com/MaverickCER/repo-contract/commit/286e8775ad66d7d727f68c0ba269ad2cfa036d56))
163
+ - harden exception-policy config validation and smoke/license accuracy ([e23c069](https://github.com/MaverickCER/repo-contract/commit/e23c069f422ac8967cf8c3a65605bdfb85c07abc))
164
+ - reject impossible calendar dates in verifiedAt, sync ADR 0013 ([6df0911](https://github.com/MaverickCER/repo-contract/commit/6df0911c8bbbfe99bd97095e811b9d762aeb6438))
165
+ - reject trailing newline in verifiedAt; PATH-aware socket probe in the integration test ([ef01ba6](https://github.com/MaverickCER/repo-contract/commit/ef01ba65950041838a3e43f8d8f440add6c4a97c))
166
+ - remove duplicate StandardSchemaV1 re-export in src/helpers/index.ts ([a0d8ee7](https://github.com/MaverickCER/repo-contract/commit/a0d8ee7a490d05fc99d9cbb7150706f7c1494694))
167
+ - skip the real-source drift test inside a Stryker mutation sandbox ([e9e64f6](https://github.com/MaverickCER/repo-contract/commit/e9e64f6dbe57a9e0612209bb568b584961d130cc))
168
+ - validate exception registries on every run and tighten verification ([8d6993f](https://github.com/MaverickCER/repo-contract/commit/8d6993fb94299a50c7b2589d400e592e43767df5))
169
+ - validate the coderabbit terminal event findings count ([a7acd09](https://github.com/MaverickCER/repo-contract/commit/a7acd0950b54f3bd2dbde3956a697d97d80daf9c))
101
170
 
102
171
  ## [0.3.2](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.3.1...repo-contract-v0.3.2) (2026-09-04)
103
172
 
104
-
105
173
  ### Features
106
174
 
107
- * validate and transform check output with a Standard Schema ([d53cb17](https://github.com/MaverickCER/repo-contract/commit/d53cb17a9e3a3f939cd403226ab5256be0de79ac))
108
- * validate and transform check output with a Standard Schema ([fbb7925](https://github.com/MaverickCER/repo-contract/commit/fbb79259f4a6cede1da64a0abd7e1f1541e1d505))
109
-
175
+ - validate and transform check output with a Standard Schema ([d53cb17](https://github.com/MaverickCER/repo-contract/commit/d53cb17a9e3a3f939cd403226ab5256be0de79ac))
176
+ - validate and transform check output with a Standard Schema ([fbb7925](https://github.com/MaverickCER/repo-contract/commit/fbb79259f4a6cede1da64a0abd7e1f1541e1d505))
110
177
 
111
178
  ### Bug Fixes
112
179
 
113
- * address CodeRabbit findings and close mutation-testing gaps in Standard Schema support ([53baf87](https://github.com/MaverickCER/repo-contract/commit/53baf877d367fd17dbe1ec2f312ab9ed790e6ae6))
114
- * **api-contract:** don't classify a required property on a brand-new container as breaking ([27ad5d5](https://github.com/MaverickCER/repo-contract/commit/27ad5d5c57811d90393b00f48ae8a8bbd413407b))
115
- * **test:** harden isRuntimeAvailable against spawnSync throwing under load ([60c76b6](https://github.com/MaverickCER/repo-contract/commit/60c76b642dfd6187888f02d31639e68468e77b17))
180
+ - address CodeRabbit findings and close mutation-testing gaps in Standard Schema support ([53baf87](https://github.com/MaverickCER/repo-contract/commit/53baf877d367fd17dbe1ec2f312ab9ed790e6ae6))
181
+ - **api-contract:** don't classify a required property on a brand-new container as breaking ([27ad5d5](https://github.com/MaverickCER/repo-contract/commit/27ad5d5c57811d90393b00f48ae8a8bbd413407b))
182
+ - **test:** harden isRuntimeAvailable against spawnSync throwing under load ([60c76b6](https://github.com/MaverickCER/repo-contract/commit/60c76b642dfd6187888f02d31639e68468e77b17))
116
183
 
117
184
  ## [0.3.1](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.3.0...repo-contract-v0.3.1) (2026-09-03)
118
185
 
119
-
120
186
  ### Bug Fixes
121
187
 
122
- * correct the release runbook that shipped types-less tarballs ([f56ea34](https://github.com/MaverickCER/repo-contract/commit/f56ea342606cfc92a09943ea5eb787936e7b7ba9))
123
- * published tarball missing types; simplify CI matrix ([7ec8fd9](https://github.com/MaverickCER/repo-contract/commit/7ec8fd946bd584098255c5d2ab3f07b98b55ba1f))
188
+ - correct the release runbook that shipped types-less tarballs ([f56ea34](https://github.com/MaverickCER/repo-contract/commit/f56ea342606cfc92a09943ea5eb787936e7b7ba9))
189
+ - published tarball missing types; simplify CI matrix ([7ec8fd9](https://github.com/MaverickCER/repo-contract/commit/7ec8fd946bd584098255c5d2ab3f07b98b55ba1f))
124
190
 
125
191
  ## [0.3.0](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.2.1...repo-contract-v0.3.0) (2026-09-03)
126
192
 
127
-
128
193
  ### ⚠ BREAKING CHANGES
129
194
 
130
- * defineRepoContract/runRepoContract now require spawn and env on the config (e.g. spawn: child_process.spawn, env: process.env). See ADR 0011 and README's "Supplying spawn/env" section for migration.
195
+ - defineRepoContract/runRepoContract now require spawn and env on the config (e.g. spawn: child_process.spawn, env: process.env). See ADR 0011 and README's "Supplying spawn/env" section for migration.
131
196
 
132
197
  ### Features
133
198
 
134
- * contract engine, self-hosting checks and CI workflows ([97ae128](https://github.com/MaverickCER/repo-contract/commit/97ae128bd96f2c631057f1150068af58cc66b224))
135
- * contract engine, self-hosting checks and CI workflows ([22b2a3b](https://github.com/MaverickCER/repo-contract/commit/22b2a3b03fe4e44ad7a01b82342d86583926416a))
136
- * make process spawning and env access consumer-supplied capabilities ([640a961](https://github.com/MaverickCER/repo-contract/commit/640a961b65fd73511586c3b4f6274284bf5172a9))
137
-
199
+ - contract engine, self-hosting checks and CI workflows ([97ae128](https://github.com/MaverickCER/repo-contract/commit/97ae128bd96f2c631057f1150068af58cc66b224))
200
+ - contract engine, self-hosting checks and CI workflows ([22b2a3b](https://github.com/MaverickCER/repo-contract/commit/22b2a3b03fe4e44ad7a01b82342d86583926416a))
201
+ - make process spawning and env access consumer-supplied capabilities ([640a961](https://github.com/MaverickCER/repo-contract/commit/640a961b65fd73511586c3b4f6274284bf5172a9))
138
202
 
139
203
  ### Bug Fixes
140
204
 
141
- * clear Socket supply-chain alerts (unminified dist, no prepare script) ([71c9230](https://github.com/MaverickCER/repo-contract/commit/71c92306fcf00e3858f0596c2d56f3272199339d))
142
- * publish the dist bundle unminified ([266ae47](https://github.com/MaverickCER/repo-contract/commit/266ae47919753c55f10364713fe0c7c5876815b7))
143
- * remove the prepare install script from the published package ([9153540](https://github.com/MaverickCER/repo-contract/commit/9153540e4f0f1a069e07c12ddfee8ba62827ce5b))
205
+ - clear Socket supply-chain alerts (unminified dist, no prepare script) ([71c9230](https://github.com/MaverickCER/repo-contract/commit/71c92306fcf00e3858f0596c2d56f3272199339d))
206
+ - publish the dist bundle unminified ([266ae47](https://github.com/MaverickCER/repo-contract/commit/266ae47919753c55f10364713fe0c7c5876815b7))
207
+ - remove the prepare install script from the published package ([9153540](https://github.com/MaverickCER/repo-contract/commit/9153540e4f0f1a069e07c12ddfee8ba62827ce5b))
144
208
 
145
209
  ## [0.2.1](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.2.0...repo-contract-v0.2.1) (2026-09-03)
146
210
 
147
-
148
211
  ### Documentation
149
212
 
150
- * add Socket security badge to README
213
+ - add Socket security badge to README
151
214
 
152
215
  ## [0.2.0](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.1.1...repo-contract-v0.2.0) (2026-09-03)
153
216
 
154
-
155
217
  ### ⚠ BREAKING CHANGES
156
218
 
157
- * defineRepoContract/runRepoContract now require spawn and env on the config (e.g. spawn: child_process.spawn, env: process.env). See ADR 0011 and README's "Supplying spawn/env" section for migration.
219
+ - defineRepoContract/runRepoContract now require spawn and env on the config (e.g. spawn: child_process.spawn, env: process.env). See ADR 0011 and README's "Supplying spawn/env" section for migration.
158
220
 
159
221
  ### Features
160
222
 
161
- * make process spawning and env access consumer-supplied capabilities ([640a961](https://github.com/MaverickCER/repo-contract/commit/640a961b65fd73511586c3b4f6274284bf5172a9))
223
+ - make process spawning and env access consumer-supplied capabilities ([640a961](https://github.com/MaverickCER/repo-contract/commit/640a961b65fd73511586c3b4f6274284bf5172a9))
162
224
 
163
225
  ## [0.1.1](https://github.com/MaverickCER/repo-contract/compare/repo-contract-v0.1.0...repo-contract-v0.1.1) (2026-09-01)
164
226
 
165
-
166
227
  ### Bug Fixes
167
228
 
168
- * clear Socket supply-chain alerts (unminified dist, no prepare script) ([71c9230](https://github.com/MaverickCER/repo-contract/commit/71c92306fcf00e3858f0596c2d56f3272199339d))
169
- * publish the dist bundle unminified ([266ae47](https://github.com/MaverickCER/repo-contract/commit/266ae47919753c55f10364713fe0c7c5876815b7))
170
- * remove the prepare install script from the published package ([9153540](https://github.com/MaverickCER/repo-contract/commit/9153540e4f0f1a069e07c12ddfee8ba62827ce5b))
229
+ - clear Socket supply-chain alerts (unminified dist, no prepare script) ([71c9230](https://github.com/MaverickCER/repo-contract/commit/71c92306fcf00e3858f0596c2d56f3272199339d))
230
+ - publish the dist bundle unminified ([266ae47](https://github.com/MaverickCER/repo-contract/commit/266ae47919753c55f10364713fe0c7c5876815b7))
231
+ - remove the prepare install script from the published package ([9153540](https://github.com/MaverickCER/repo-contract/commit/9153540e4f0f1a069e07c12ddfee8ba62827ce5b))
171
232
 
172
233
  ## Changelog
package/README.md CHANGED
@@ -203,6 +203,10 @@ new requirements land as `warn`, become `fail` on a date
203
203
 
204
204
  AI coding agents, CI bots, and release automation consume the same contract as human contributors. An actionable rationale gives automation a concrete thing to fix rather than a bare "a check failed" — making regenerate-until-green workflows much easier to converge.
205
205
 
206
+ ## Supply-chain transparency
207
+
208
+ This repository publishes its own dependency inventory: [`docs/sbom.cdx.json`](docs/sbom.cdx.json), a real [CycloneDX](https://cyclonedx.org/) 1.6 Software Bill of Materials, regenerated on every `npm run contract` run via [`@cyclonedx/cyclonedx-npm`](https://github.com/CycloneDX/cyclonedx-node-npm) (`checks/sbom.ts`). It covers every direct and transitive **npm** dependency resolved in `package-lock.json` — no other ecosystem — and is deterministic given an unchanged lockfile, so it stays a normal, diff-gated committed file rather than a special-cased exclusion.
209
+
206
210
  ## Status
207
211
 
208
212
  Pre-1.0. Per [VERSIONING.md](VERSIONING.md), a `0.x` minor may carry a breaking change to the Stable tier before 1.0 — pin accordingly and read the [CHANGELOG](CHANGELOG.md) on every minor upgrade.
@@ -9,6 +9,7 @@ export type PresetName =
9
9
  | "stylelint"
10
10
  | "markdownlint"
11
11
  | "brokenLinks"
12
+ | "distNoUrls"
12
13
  | "securityDeps"
13
14
  | "securitySecrets"
14
15
  | "license"
@@ -16,6 +17,8 @@ export type PresetName =
16
17
  | "publint"
17
18
  | "arethetypeswrong"
18
19
 
20
+ export declare const DIST_OUTPUT: "dist/"
21
+
19
22
  export declare const PRESET_DEPENDENCIES: Readonly<Record<PresetName, string | null>>
20
23
 
21
24
  export declare const FACTORY_PRESETS: ReadonlySet<PresetName>
@@ -36,4 +39,10 @@ export declare function detectPresets(packageJson: {
36
39
  // `devDependencies` (see preset-catalog.mjs's own doc comment for why).
37
40
  readonly dependencies?: Readonly<Record<string, string>>
38
41
  readonly devDependencies?: Readonly<Record<string, string>>
42
+ // Read only to detect a published `dist/` (the `distNoUrls` preset).
43
+ readonly main?: string
44
+ readonly module?: string
45
+ readonly types?: string
46
+ readonly files?: readonly string[]
47
+ readonly exports?: unknown
39
48
  }): DetectPresetsResult
@@ -9,10 +9,17 @@
9
9
  // -- it cannot prove each dependency mapping below is itself correct. That's a known, accepted
10
10
  // limit of a hand-maintained table, stated here rather than assumed away.
11
11
  //
12
+ // `distNoUrls` maps to `DIST_OUTPUT`, a pseudo-dependency: it needs no CLI at all, only a package that
13
+ // actually publishes a built `dist/`, so `detectPresets` detects it from package.json's own
14
+ // `main`/`module`/`types`/`files`/`exports` instead of from `devDependencies`.
15
+ //
12
16
  // `securityDeps` maps to `null`, not a real npm package name: it shells out to `npm` itself (see
13
17
  // GUIDE.md's preset table), which is always present because this script is already running via
14
18
  // `npx`/`npm exec`. It goes through the exact same detection loop as every other preset below,
15
19
  // with an always-true answer -- not a separate branch elsewhere.
20
+ /** The pseudo-dependency `distNoUrls` maps to -- see the comment above. */
21
+ export const DIST_OUTPUT = "dist/"
22
+
16
23
  export const PRESET_DEPENDENCIES = {
17
24
  test: "vitest",
18
25
  e2e: "@playwright/test",
@@ -24,6 +31,7 @@ export const PRESET_DEPENDENCIES = {
24
31
  stylelint: "stylelint",
25
32
  markdownlint: "markdownlint-cli2",
26
33
  brokenLinks: "linkinator",
34
+ distNoUrls: DIST_OUTPUT,
27
35
  securityDeps: null,
28
36
  securitySecrets: "secretlint",
29
37
  license: "licensee",
@@ -42,8 +50,38 @@ export const FACTORY_PRESETS = new Set([
42
50
  "markdownlint",
43
51
  "brokenLinks",
44
52
  "commitlint",
53
+ "distNoUrls",
45
54
  ])
46
55
 
56
+ /**
57
+ * Every string anywhere inside `value` (an `exports` map nests arbitrarily).
58
+ * @param value - Any parsed JSON value.
59
+ * @returns the strings it contains.
60
+ */
61
+ function allStrings(value) {
62
+ if (typeof value === "string") return [value]
63
+ if (Array.isArray(value)) return value.flatMap(allStrings)
64
+ if (value !== null && typeof value === "object") return Object.values(value).flatMap(allStrings)
65
+ return []
66
+ }
67
+
68
+ /**
69
+ * Whether package.json publishes a built `dist/` directory (its entry points or `files` allowlist
70
+ * name it).
71
+ * @param packageJson - Parsed package.json content.
72
+ * @returns `true` when any entry point or `files` entry is `dist` or lives under it.
73
+ */
74
+ function publishesDist(packageJson) {
75
+ const references = allStrings([
76
+ packageJson.main,
77
+ packageJson.module,
78
+ packageJson.types,
79
+ packageJson.files,
80
+ packageJson.exports,
81
+ ])
82
+ return references.some((reference) => /^(\.\/)?dist(\/|$)/.test(reference))
83
+ }
84
+
47
85
  /**
48
86
  * Detects which presets' underlying CLIs are already declared in a consumer's package.json.
49
87
  * Checks `devDependencies` only -- every published preset's own documentation (GUIDE.md's
@@ -60,7 +98,10 @@ export function detectPresets(packageJson) {
60
98
  const skipped = []
61
99
 
62
100
  for (const [preset, dependency] of Object.entries(PRESET_DEPENDENCIES)) {
63
- if (dependency === null || declared.has(dependency)) {
101
+ const present =
102
+ dependency === null ||
103
+ (dependency === DIST_OUTPUT ? publishesDist(packageJson) : declared.has(dependency))
104
+ if (present) {
64
105
  detected.push(preset)
65
106
  } else {
66
107
  skipped.push({ preset, dependency })
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs"
14
14
  import path from "node:path"
15
- import { detectPresets } from "./preset-catalog.mjs"
15
+ import { DIST_OUTPUT, detectPresets } from "./preset-catalog.mjs"
16
16
  import { buildConfigTemplate, CONTRACT_RUNNER_TEMPLATE } from "./templates.mjs"
17
17
  import { patchContractScript } from "./package-json-patch.mjs"
18
18
 
@@ -172,7 +172,11 @@ function report({ configResult, runnerResult, scriptStatus, detected, skipped })
172
172
  if (skipped.length > 0) {
173
173
  lines.push("Not detected (install the tool to add its check):")
174
174
  for (const { preset, dependency } of skipped)
175
- lines.push(` - ${preset} (${dependency} not installed)`)
175
+ lines.push(
176
+ dependency === DIST_OUTPUT
177
+ ? ` - ${preset} (package.json names no dist/ build output)`
178
+ : ` - ${preset} (${dependency} not installed)`,
179
+ )
176
180
  lines.push("")
177
181
  }
178
182
 
@@ -25,7 +25,7 @@ export type ExceptionPolicy = {
25
25
  * with no exact or glob match in `rules` (see `resolveExceptionPolicy` for the full exact > glob >
26
26
  * group-default > global-default precedence). Omit `default` to fall through to the caller-supplied
27
27
  * `globalDefault` instead. Each key of `rules` is either an exact `category` string or a
28
- * `minimatch` glob pattern -- `resolveExceptionPolicy` tries an exact match first and only
28
+ * glob pattern -- `resolveExceptionPolicy` tries an exact match first and only
29
29
  * consults glob matching once no exact key exists, so a glob can never shadow a more specific
30
30
  * exact entry.
31
31
  * @beta
@@ -33,7 +33,7 @@ export type ExceptionPolicy = {
33
33
  export interface ExceptionCategoryGroup {
34
34
  /** This group's fallback policy when `category` matches neither an exact nor a glob key in `rules`. Falls through to the caller's `globalDefault` when omitted. */
35
35
  readonly default?: ExceptionPolicy;
36
- /** Keyed by exact `category` string or `minimatch` glob pattern. A literal `"*"` key is rejected by `validateExceptionPolicyConfig` -- see that function's own doc comment for why. */
36
+ /** Keyed by exact `category` string or glob pattern. A literal `"*"` key is rejected by `validateExceptionPolicyConfig` -- see that function's own doc comment for why. */
37
37
  readonly rules?: Readonly<Record<string, ExceptionPolicy>>;
38
38
  }
39
39
  /**
@@ -110,7 +110,7 @@ export declare function stricterOf(a: ExceptionPolicy, b: ExceptionPolicy): Exce
110
110
  * 1. **Blanket category** -- `category === "*"` means every category this group could ever apply
111
111
  * to was matched at once, not one specific category literally named `"*"`. It resolves as the
112
112
  * strictest (`stricterOf`) policy across every entry in `group.rules` plus the group's own
113
- * default (or `globalDefault`) -- never via `minimatch`: `minimatch("*", pattern)` tests the
113
+ * default (or `globalDefault`) -- never via the glob matcher: `globMatch("*", pattern)` tests the
114
114
  * literal one-character string `"*"` as a path against `pattern`, which does not glob-match a
115
115
  * pattern like `"security/*"` (that would require the *pattern*, not the *target*, to be `"*"`),
116
116
  * so treating this case as an ordinary pattern match would silently let a blanket match fall
@@ -118,7 +118,7 @@ export declare function stricterOf(a: ExceptionPolicy, b: ExceptionPolicy): Exce
118
118
  * 2. **Exact match** -- `group.rules[category]`, if present. A glob is never even consulted once an
119
119
  * exact entry exists for `category`.
120
120
  * 3. **Glob match** -- the strictest (`stricterOf`) policy among every key in `group.rules` that is
121
- * not itself an exact match for `category` but does match it as a `minimatch` glob (e.g.
121
+ * not itself an exact match for `category` but does match it as a glob (e.g.
122
122
  * `"security/*"` matching `"security/detect-object-injection"`).
123
123
  * 4. **Group default** -- `group.default`, if `group` itself has an entry in `config` (whether or
124
124
  * not that entry defines its own `default`).
@@ -186,9 +186,9 @@ export declare function evaluateExceptionRecords<TRecord>(inputs: readonly Excep
186
186
  * no group's `rules` may use the literal `"*"` as a key. A literal `"*"` key is always a mistake,
187
187
  * never an intentional blanket policy: `resolveExceptionPolicy`'s own blanket-category handling is
188
188
  * triggered by the *input* `category` being `"*"`, not by a `"*"` entry in `rules` -- a `"*"` rules
189
- * key would instead be consulted only as an ordinary `minimatch` glob, which matches the literal
189
+ * key would instead be consulted only as an ordinary glob, which matches the literal
190
190
  * one-character string `"*"` as a *target*, not as a wildcard pattern matching every real category
191
- * name (`minimatch("*", pattern)` truthiness depends on `pattern`, not the other way around) --
191
+ * name (`globMatch("*", pattern)` truthiness depends on `pattern`, not the other way around) --
192
192
  * see `resolveExceptionPolicy`'s own doc comment, case 1, for the failure mode this prevents.
193
193
  * @param config - The exception policy configuration to validate.
194
194
  * @param validRequirements - The complete set of field names this consumer's policy may require, if the consumer wants that checked. Omit to skip that check entirely.
@@ -1 +1 @@
1
- {"version":3,"file":"exception-policy.d.ts","sourceRoot":"","sources":["../../../src/helpers/exception-policy.ts"],"names":[],"mappings":"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AC,EAAE,SAAS,MAAM,EAAE,GACpC,SAAS,MAAM,EAAE,CAkDnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,UAAU,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,GAC3D,MAAM,CASR"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A small, dependency-free glob matcher -- the replacement for the `minimatch` runtime dependency
3
+ * (see specs/decisions/0017-own-glob-matcher-replaces-minimatch.md). Pure string logic: it reads no
4
+ * environment variable, touches no filesystem, imports nothing, and builds no `RegExp` from its
5
+ * input -- a pattern is tokenized and matched by a position-set simulation that is polynomial in
6
+ * the sizes of the pattern and the value, so no pattern can cause catastrophic backtracking.
7
+ *
8
+ * Supported syntax (exactly what exception-policy category keys use, e.g. `"security/*"`):
9
+ * - `*` any run of characters except `/`
10
+ * - `**` any run of characters including `/`; a whole `**` + `/` segment also matches zero segments
11
+ * - `?` exactly one character except `/`
12
+ * - `[abc]`, `[a-z]`, `[!abc]` / `[^abc]` a character class (a reversed range matches nothing)
13
+ * - `{a,b}` alternation (nestable)
14
+ * - `\x` the literal character `x`
15
+ *
16
+ * Not supported (treated as literal text, never as a special form): extglobs (`+(a|b)`), POSIX
17
+ * classes (`[[:alpha:]]`), dotfile exclusion, case folding.
18
+ */
19
+ /**
20
+ * Whether `value` matches the glob `pattern` (see this module's own doc comment for the exact
21
+ * syntax). Nothing is cached: compiling a category glob costs microseconds, and a cache would make a
22
+ * pattern's code paths run only for the first caller.
23
+ * @param value - the string to test (an exception category such as `"security/xss"`).
24
+ * @param pattern - the glob to test it against.
25
+ * @returns `true` when the whole of `value` matches `pattern`.
26
+ * @throws {Error} when `pattern` is over 1000 characters, or its brace groups expand to too many alternatives.
27
+ */
28
+ export declare function globMatch(value: string, pattern: string): boolean;
29
+ //# sourceMappingURL=glob-match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glob-match.d.ts","sourceRoot":"","sources":["../../../src/helpers/glob-match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAwKH;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAQjE"}
@@ -12,7 +12,7 @@
12
12
  * specs/decisions/0013-reusable-exception-policy-helper.md for the full
13
13
  * rationale and the boundary this barrel deliberately does not cross.
14
14
  *
15
- * Published **Experimental** (see VERSIONING.md): its TypeScript signature
15
+ * Published **Experimental** (see `VERSIONING.md`): its TypeScript signature
16
16
  * and runtime behavior may both change in a minor or patch release, the same
17
17
  * classification `repo-contract/presets` already carries (see
18
18
  * specs/decisions/0004-public-surface-stays-narrow-no-cli-experimental-presets.md)
@@ -3,7 +3,7 @@ import type { OutputFormat, ParsedOutput } from "../types.js";
3
3
  /**
4
4
  * Dispatches to the parser for `format`, then -- only on a successful parse, and only if `schema`
5
5
  * is supplied -- runs `schema["~standard"].validate()` against the parsed value
6
- * (https://standardschema.dev). `parse-json.ts`/`parse-text.ts` stay entirely unaware of `schema`;
6
+ * (standardschema.dev). `parse-json.ts`/`parse-text.ts` stay entirely unaware of `schema`;
7
7
  * this is the sole orchestration point. `validate()` may return its `Result` synchronously or as a
8
8
  * `Promise` -- `await`ing either uniformly is a no-op for the synchronous case, but this function
9
9
  * still needs to be `async` for that awaited call. A successful `Result` (`issues === undefined`)
@@ -0,0 +1,26 @@
1
+ import type { CheckDefinitionConfig } from "../types.js";
2
+ /** One allowlisted URL (glob) and the reviewable reason it may ship. */
3
+ export interface DistNoUrlsAllowEntry {
4
+ /** A URL, or a glob (`*`, `**`, `?`, `[...]`, `{a,b}`; escape literals with `\`) matched against each whole URL found. */
5
+ readonly url: string;
6
+ /** Why this URL must ship in the build output. Required and non-empty -- an allowlist entry without one fails the check. */
7
+ readonly reason: string;
8
+ }
9
+ /** Options accepted by {@link distNoUrls}. */
10
+ export interface DistNoUrlsOptions {
11
+ /** Build-output directory to scan, relative to the working directory. Defaults to `"dist"`. */
12
+ readonly dir?: string;
13
+ /** URLs permitted in the output, each with a reason. Empty by default: the strictest policy is the default. */
14
+ readonly allow?: readonly DistNoUrlsAllowEntry[];
15
+ }
16
+ /**
17
+ * Fails when any URL (any scheme followed by a colon and two slashes) appears in any file of the build output directory, so
18
+ * supply-chain scanners that flag shipped URLs (Socket.dev's "URL strings" alert, for one) have
19
+ * nothing to flag. Scans every file, sourcemaps and declaration files included. Individual URLs can
20
+ * be allowed with a mandatory, reviewable `reason`; there is no blanket opt-out.
21
+ * @param options - configuration for this check; see {@link DistNoUrlsOptions}.
22
+ * @returns the configured check.
23
+ * @beta
24
+ */
25
+ export declare function distNoUrls(options?: DistNoUrlsOptions): CheckDefinitionConfig;
26
+ //# sourceMappingURL=dist-no-urls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-no-urls.d.ts","sourceRoot":"","sources":["../../../src/presets/dist-no-urls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGxD,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,0HAA0H;IAC1H,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,4HAA4H;IAC5H,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,+GAA+G;IAC/G,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAA;CACjD;AAsFD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,qBAAqB,CAiEjF"}
@@ -16,6 +16,8 @@ export { arethetypeswrong } from "./arethetypeswrong.js";
16
16
  export { brokenLinks } from "./broken-links.js";
17
17
  export { commitlint } from "./commitlint.js";
18
18
  export { deadCode } from "./dead-code.js";
19
+ export { distNoUrls } from "./dist-no-urls.js";
20
+ export type { DistNoUrlsAllowEntry, DistNoUrlsOptions } from "./dist-no-urls.js";
19
21
  export { duplication } from "./duplication.js";
20
22
  export { e2e } from "./e2e.js";
21
23
  export { format } from "./format.js";