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
+5
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@green-tea/core",
|
||||
"version": "26.9.0-beta.2",
|
||||
"description": "A zen, opinionated, type-safe framework \u2014 your API is a graph, not a middleware chain.",
|
||||
"description": "A zen, opinionated, type-safe framework — your API is a graph, not a middleware chain.",
|
||||
"license": "MIT",
|
||||
"author": "green-tea contributors <projects@expressive-tea.io>",
|
||||
"repository": {
|
||||
@@ -86,6 +86,8 @@
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"api": "node scripts/api-report.mjs",
|
||||
"api:check": "node scripts/api-report.mjs --check",
|
||||
"test": "vitest run",
|
||||
"test:dev": "vitest",
|
||||
"test:deno": "deno test --allow-net --allow-read --allow-run --allow-env --no-check test/deno/",
|
||||
@@ -137,6 +139,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.5",
|
||||
"@microsoft/api-extractor": "^7.59.4",
|
||||
"@nestjs/common": "^11.1.28",
|
||||
"@nestjs/core": "^11.1.28",
|
||||
"@nestjs/platform-express": "^11.1.28",
|
||||
@@ -150,8 +153,8 @@
|
||||
"autocannon": "^8.0.0",
|
||||
"busboy": "^1.6.0",
|
||||
"cognitive-complexity-ts": "^0.8.2",
|
||||
"eslint": "^9.39.5",
|
||||
"esbuild": "0.27.2",
|
||||
"eslint": "^9.39.5",
|
||||
"express": "^5.2.1",
|
||||
"fastify": "^5.12.5",
|
||||
"graphql": "^16.9.0",
|
||||
|
||||
Reference in new issue
Block a user