From 6f598cf90ced64e6c83c26eed608bcfc77de0e1c Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Tue, 4 Aug 2026 09:20:56 -0700 Subject: [PATCH] ci: gate packages/types on tsc, stacked on the frontend check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit packages/types defines `typecheck: tsc --noEmit` and nothing has ever invoked it — the same defined-but-uninvoked shape #826 fixes for the frontend. It is green today, which is the only moment a gate is free. Costs no install: the package has zero dependencies and zero external imports, so it typechecks with the compiler the backend step already installed. Two lines and a comment. packages/commonly-apps is deliberately left out. It has the identical uninvoked `tsc:check` script, but it needs @types/node and this job never npm ci's it, so gating it means adding an install step. Its real state is unknown rather than assumed green — reporting it as green off a TS2688 "cannot find type definition file for 'node'" would be reporting an environment gap as a result. Mutation-checked: a deliberate `const x: number = "str"` in src/user.ts fails the step with TS2322 (exit 2), and the step returns to exit 0 once reverted, so the gate can actually go red. Stacked on #826 (25e6de7e) because it is the only other open PR touching tests.yml; merging it first avoids a conflict in the same hunk. Co-Authored-By: Claude Opus 5 --- .github/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdc866c4..e5006a5b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,6 +59,20 @@ jobs: cd frontend npm run typecheck + # packages/types has zero dependencies and zero external imports, so it + # needs no install of its own — it typechecks with the compiler the + # backend step already installed. Gated now because it is green now; + # that is the only moment a gate is free. + # + # packages/commonly-apps is deliberately NOT gated here. It defines the + # same tsc:check script and is equally uninvoked, but it needs @types/node + # and is not npm ci'd by this job, so adding it means adding an install. + # Its actual state is unknown, not assumed green. Separate change. + - name: Shared types TypeScript check + run: | + cd packages/types + ../../backend/node_modules/.bin/tsc --noEmit -p tsconfig.json + - name: Run backend tests with coverage run: | cd backend