From fdd7356a42d423deee59ccfae6346e7e7963b179 Mon Sep 17 00:00:00 2001 From: Tim Smart Date: Mon, 2 Nov 2026 21:07:11 +0000 Subject: [PATCH 1/3] Run tsrs for local type checks, keep tsc in CI --- .agents/AGENTS.md | 3 +++ .github/workflows/check.yml | 3 ++- CONTRIBUTING.md | 14 ++++++++++++++ package.json | 3 ++- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index e6450c28e1d..a832390fa2a 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -30,6 +30,9 @@ assignability, rejection, or displayed public types. An ordinary source edit or exported declaration is covered by `pnpm check` unless compiler behavior is part of the task. +`pnpm check` runs tsrs (`effect-tsgo tsrs`), which tracks TypeScript 7.1. CI runs `pnpm check-tsc`, the +official `tsc`. Use `pnpm check-tsc` on Linux musl, or to reproduce a CI-only type error. See `CONTRIBUTING.md`. + Never run bare `pnpm test` or `pnpm doctest`; both start the full suite in watch mode. Always pass `--run` and the specific files covering the change. CI runs the full suite. diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bd8a84b2b14..9503c220515 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -51,9 +51,10 @@ jobs: fail-fast: false matrix: include: + # CI type checks with the official compiler; `pnpm check` runs tsrs locally. - name: Check deno: "" - command: pnpm check + command: pnpm check-tsc - name: Deno deno: v2.9.6 command: deno check . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..3045e7c5027 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,14 @@ +# Contributing + +## Type checking + +`pnpm check` type checks the whole repository with tsrs, through the `effect-tsgo tsrs` command that `@effect/tsgo` ships. It is about twice as fast as `tsc` and uses about a third of the memory. It runs the same Effect language service diagnostics. + +CI does not use tsrs. It runs `pnpm check-tsc`, which is `tsc -b tsconfig.json` with the `typescript` version in `package.json`. `pnpm build`, `pnpm check-recursive` and `pnpm check-dist-types` also use `tsc`, because published output must come from the official compiler. + +Two things to know: + +- The packaged tsrs binary only exists for macOS (arm64 and x64), Linux glibc (x64 and arm64) and Windows x64. On Linux musl, or any other platform, use `pnpm check-tsc`. +- tsrs is built against TypeScript 7.1, and the repository's `typescript` is 7.0. The two compilers can't reuse each other's `.tsbuildinfo` files. Switching between `pnpm check` and `pnpm check-tsc` (or `pnpm build`) rebuilds every project the first time. The rebuild costs about a minute on a fast machine. This goes away once `typescript` moves to 7.1. + +When `pnpm check` and `pnpm check-tsc` disagree, CI follows `pnpm check-tsc`. A tree that passes only one of them still needs fixing before it merges. diff --git a/package.json b/package.json index 4531035d66b..57dcd56a22c 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "test-cluster": "vitest run --project cluster-integration", "doctest": "vitest --config vitest.docs.ts", "coverage": "vitest --coverage", - "check": "tsc -b tsconfig.json", + "check": "effect-tsgo tsrs -b tsconfig.json", + "check-tsc": "tsc -b tsconfig.json", "typeperf": "pnpm --dir packages/effect exec node typeperf/run.mjs", "typeperf-compare": "pnpm --dir packages/effect exec node typeperf/compare.mjs", "runtimeperf": "pnpm --dir packages/effect exec node runtimeperf/run.mts", From be21db5c3ec4cf5a5c4dbe96bf6ec1cd4119b1b7 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 3 Nov 2026 10:09:06 +1300 Subject: [PATCH 2/3] Delete CONTRIBUTING.md --- CONTRIBUTING.md | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 3045e7c5027..00000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,14 +0,0 @@ -# Contributing - -## Type checking - -`pnpm check` type checks the whole repository with tsrs, through the `effect-tsgo tsrs` command that `@effect/tsgo` ships. It is about twice as fast as `tsc` and uses about a third of the memory. It runs the same Effect language service diagnostics. - -CI does not use tsrs. It runs `pnpm check-tsc`, which is `tsc -b tsconfig.json` with the `typescript` version in `package.json`. `pnpm build`, `pnpm check-recursive` and `pnpm check-dist-types` also use `tsc`, because published output must come from the official compiler. - -Two things to know: - -- The packaged tsrs binary only exists for macOS (arm64 and x64), Linux glibc (x64 and arm64) and Windows x64. On Linux musl, or any other platform, use `pnpm check-tsc`. -- tsrs is built against TypeScript 7.1, and the repository's `typescript` is 7.0. The two compilers can't reuse each other's `.tsbuildinfo` files. Switching between `pnpm check` and `pnpm check-tsc` (or `pnpm build`) rebuilds every project the first time. The rebuild costs about a minute on a fast machine. This goes away once `typescript` moves to 7.1. - -When `pnpm check` and `pnpm check-tsc` disagree, CI follows `pnpm check-tsc`. A tree that passes only one of them still needs fixing before it merges. From a8509465342c2b6ed854509015c731de0e14ff5b Mon Sep 17 00:00:00 2001 From: Tim Smart Date: Mon, 2 Nov 2026 21:10:26 +0000 Subject: [PATCH 3/3] Drop AGENTS.md reference to removed CONTRIBUTING.md --- .agents/AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index a832390fa2a..86f8a3b1bd6 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -31,7 +31,7 @@ exported declaration is covered by `pnpm check` unless compiler behavior is part of the task. `pnpm check` runs tsrs (`effect-tsgo tsrs`), which tracks TypeScript 7.1. CI runs `pnpm check-tsc`, the -official `tsc`. Use `pnpm check-tsc` on Linux musl, or to reproduce a CI-only type error. See `CONTRIBUTING.md`. +official `tsc`. Use `pnpm check-tsc` on Linux musl, or to reproduce a CI-only type error. Never run bare `pnpm test` or `pnpm doctest`; both start the full suite in watch mode. Always pass `--run` and the specific files covering the change. CI runs the full suite.