ci(api): commit an API report per entry point and fail CI on drift #182

Merged
chrnx merged 2 commits from ci/api-report into develop 2026-10-30 14:39:38 +00:00
Owner

This closes finding 1 of the RC.1 API audit: CARD-22, decision D20.

  • Reports: api/index.api.md, deno.api.md, bun.api.md and edge.api.md. api-extractor 7.59.4 generates them from the .d.ts files that tsup emits. I chose 7.59.4 over 7.60.0 because 7.60.0 was published only three days ago.
  • Scripts: npm run api regenerates the reports. npm run api:check runs in the CI build job, right after build, and fails when a report no longer matches the build.
  • Missing exports: the check also fails when a public signature uses a type that its entry point does not export (ae-forgotten-export). In the adapter entries, types that @green-tea/core exports (App, Logger, …) are allowed.
  • Gate verified: I tested it locally both ways. Adding a field to TlsOptions fails the check because the report is stale. Removing the export of DenoServeOptions fails it with ae-forgotten-export. After restoring both, the check passes.
  • Publishing: the reports are not published. npm ships dist/, and JSR ships src/.
  • CONTRIBUTING: documents the new check and the additions-only rule until stable.

CARD-22 items still open: the inventory in .specs/, the deprecation policy (D18), the matrix on the freeze commit, and owner sign-off.

This closes finding 1 of the RC.1 API audit: CARD-22, decision D20. - **Reports:** `api/index.api.md`, `deno.api.md`, `bun.api.md` and `edge.api.md`. api-extractor 7.59.4 generates them from the `.d.ts` files that tsup emits. I chose 7.59.4 over 7.60.0 because 7.60.0 was published only three days ago. - **Scripts:** `npm run api` regenerates the reports. `npm run api:check` runs in the CI `build` job, right after `build`, and fails when a report no longer matches the build. - **Missing exports:** the check also fails when a public signature uses a type that its entry point does not export (`ae-forgotten-export`). In the adapter entries, types that `@green-tea/core` exports (`App`, `Logger`, …) are allowed. - **Gate verified:** I tested it locally both ways. Adding a field to `TlsOptions` fails the check because the report is stale. Removing the export of `DenoServeOptions` fails it with `ae-forgotten-export`. After restoring both, the check passes. - **Publishing:** the reports are not published. npm ships `dist/`, and JSR ships `src/`. - **CONTRIBUTING:** documents the new check and the additions-only rule until stable. CARD-22 items still open: the inventory in `.specs/`, the deprecation policy (D18), the matrix on the freeze commit, and owner sign-off.
chrnx added 1 commit 2026-10-30 14:31:19 +00:00
ci(api): commit an API report per entry point and fail CI on drift
CI / dco (pull_request) Successful in 6s
CI / runtimes (bun) (pull_request) Successful in 20s
CI / build (pull_request) Successful in 32s
CI / runtimes (edge) (pull_request) Successful in 23s
CI / runtimes (deno) (pull_request) Failing after 34s
18270779fc
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>
chrnx added 1 commit 2026-10-30 14:33:28 +00:00
chore(deno): record api-extractor in deno.lock
CI / dco (pull_request) Successful in 6s
CI / runtimes (bun) (pull_request) Successful in 21s
CI / build (pull_request) Successful in 31s
CI / runtimes (edge) (pull_request) Successful in 24s
CI / runtimes (deno) (pull_request) Successful in 33s
085e3c01d1
Deno lists package.json's dependencies in deno.lock, so the new dev
dependency added a line on the first deno test. CI's deno publish
--dry-run then aborted on the dirty tree.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx merged commit 56ee10cc23 into develop 2026-10-30 14:39:38 +00:00
Sign in to join this conversation.