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

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:
chrnx committed 2026-10-30 09:31:12 -05:00
1 parent 46cfa744a1
commit 18270779fc
9 files changed
+1711 -2

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
## API Report File for "@green-tea/core"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import http from 'http';
// @public
export interface BunServeOptions {
// (undocumented)
hostname?: string;
// (undocumented)
port?: number;
}
// @public
export interface BunServer {
// (undocumented)
port: number;
// (undocumented)
requestIP(request: Request): {
address: string;
family: string;
port: number;
} | null;
// (undocumented)
stop(closeActiveConnections?: boolean): Promise<void>;
// (undocumented)
upgrade(request: Request, options?: {
data?: unknown;
headers?: Record<string, string>;
}): boolean;
}
// @public
export interface BunServeResult extends BunServer {
close(options?: {
timeoutMs?: number;
}): Promise<void>;
}
// @public
export function serveBun(app: App, options?: BunServeOptions): Promise<BunServeResult>;
// (No @packageDocumentation comment for this package)
```
+44
View File
@@ -0,0 +1,44 @@
## API Report File for "@green-tea/core"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import http from 'http';
// @public
export interface DenoHttpServer {
// (undocumented)
finished: Promise<void>;
// (undocumented)
shutdown(): Promise<void>;
}
// @public
export interface DenoServeOptions {
// (undocumented)
hostname?: string;
// (undocumented)
onListen?: (addr: {
hostname: string;
port: number;
}) => void;
// (undocumented)
port?: number;
// (undocumented)
signal?: AbortSignal;
}
// @public
export interface DenoServer extends DenoHttpServer {
close(options?: {
timeoutMs?: number;
}): Promise<void>;
}
// @public
export function serveDeno(app: App, options?: DenoServeOptions): Promise<DenoServer>;
// (No @packageDocumentation comment for this package)
```
+20
View File
@@ -0,0 +1,20 @@
## API Report File for "@green-tea/core"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import http from 'http';
// @public
export interface EdgeCtx {
// (undocumented)
waitUntil(promise: Promise<unknown>): void;
}
// @public
export function edgeHandler(app: App): (request: Request, env?: unknown, ctx?: EdgeCtx) => Response | Promise<Response>;
// (No @packageDocumentation comment for this package)
```
+1081
View File
File diff suppressed because it is too large. Load diff