diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b40873a..258b92d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,3 +87,19 @@ jobs: - if: matrix.runtime == 'bun' uses: oven-sh/setup-bun@v2 - run: npm run test:${{ matrix.runtime }} + # JSR's gate, moved off the release tag. `release.yml` runs this too and keeps doing so — + # that copy protects an immutable JSR version and is the last thing standing between a tag + # and a version number that can never be replaced. This copy exists because that one runs + # too late to be useful as feedback: a slow type or a Deno type error would otherwise land + # on `main` in silence and surface while cutting a release, which is the same "least time + # to judge a fix" the audit steps above are ordered to avoid. + # + # It is a second compiler over the same source, not a formality. `npm run typecheck` is tsc + # with this repo's tsconfig; this is Deno's checker with Deno's lib, and it is what found + # the `BodyInit` hole on the fetch path that tsc accepted. JSR serves `src/` directly, so + # anything it rejects is something a JSR consumer would have received. + # + # 0.68s against 2.0s for the whole vitest suite. No `--allow-dirty`: a checkout is clean, + # and if it somehow is not, that is worth failing on. + - if: matrix.runtime == 'deno' + run: deno publish --dry-run diff --git a/README.md b/README.md index 8fa21ea..454dfc6 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,8 @@ green-tea is **beta**, on the road to a release candidate. Express and Fastify h ```bash npm install -npm test # vitest (Node only — CI additionally runs the three below on every push) +npm test # vitest (Node only) — the fast loop, ~2s +npm run test:all # everything below, plus the JSR gate — the pre-push check npm run test:deno # deno test } a change to shared code can pass `npm test` npm run test:bun # bun test } and still be broken on one of these npm run test:edge # workerd via miniflare @@ -268,6 +269,16 @@ npm run build # emit dist/ (tsup: dual ESM + CJS) npm run bench # regenerate BENCHMARKS.md ``` +`npm test` stays Node-only on purpose: it is the loop you run constantly, and booting Deno, Bun and +workerd into it would tax every run to catch what CI already catches on every push. Nothing here is +unguarded — the `runtimes` job runs all three, and `deno publish --dry-run` gates JSR. `test:all` is +for the moment before you push, when you would rather find out locally. + +That last one is a second type-checker, not a packaging formality: `npm run typecheck` is `tsc` with +this repository's config, while `deno publish --dry-run` is Deno's checker with Deno's lib plus JSR's +slow-types rules over the public API. JSR serves `src/` directly, so what it rejects is what a JSR +consumer would have received. + ## Roadmap - ✅ **transport security** — native TLS/wss, CORS, secure-by-default headers, `trustProxy`. diff --git a/package.json b/package.json index f88ff05..40b08a6 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "test:deno": "deno test --allow-net --allow-read --allow-run --allow-env --no-check test/deno/", "test:bun": "bun test test/bun/", "test:edge": "tsx test/edge/run.ts", + "test:all": "npm test && npm run test:deno && npm run test:bun && npm run test:edge && deno publish --dry-run --allow-dirty", "typecheck": "tsc --noEmit -p tsconfig.json", "typecheck:bench": "tsc --noEmit -p bench/tsconfig.json", "lint": "eslint src",