ci(api): commit an API report per entry point and fail CI on drift
CARD-22 / D20. api-extractor 7.59.4 is now a dev dependency.
scripts/api-report.mjs reads the declarations that tsup emits for each
export-map entry (".", "./deno", "./bun", "./edge") and writes
api/<entry>.api.md.
`npm run api` regenerates the reports. `npm run api:check` runs in the
CI build job and fails when a report differs from the build, so a
public type change has to arrive with its regenerated report in the
same PR.
The check also fails on ae-forgotten-export: a public signature that
names a type its entry does not export. In the adapter entries, a root
type such as App or Logger is accepted, because it is importable from
@green-tea/core; any other unexported type still fails. Both failure
paths were verified locally, by adding a field to TlsOptions and by
un-exporting DenoServeOptions.
The reports are not published: npm ships dist/ and JSR ships src/.
CONTRIBUTING documents the check and the additions-only rule.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
9 files changed
+1711
-2
No files matched your search
@@ -49,6 +49,10 @@ jobs:
|
||||
- run: npm run typecheck
|
||||
- run: npm test
|
||||
- run: npm run build
|
||||
# The committed reports in api/ are the frozen surface (CARD-22, D20). A PR that changes a
|
||||
# public type fails here until it regenerates them with `npm run api`, so the change shows up
|
||||
# in the diff a reviewer reads instead of only in the published declarations.
|
||||
- run: npm run api:check
|
||||
# Supply chain, deliberately after the code gates: an advisory published by a third party
|
||||
# must never decide whether a contributor gets to see their own lint and typecheck output.
|
||||
# Only what we ship blocks — with `reflect-metadata` as the sole runtime dependency, a
|
||||
|
||||
Reference in new issue
Block a user