From 6a8e67878dc1c7b450c7e2783afa1fda4a02cb6b Mon Sep 17 00:00:00 2001 From: Ramnique Singh <30795890+ramnique@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:27:06 +0530 Subject: [PATCH] =?UTF-8?q?ci(x):=20typecheck=20test=20files=20=E2=80=94?= =?UTF-8?q?=20the=20gap=20vitest=20and=20the=20build=20tsconfigs=20both=20?= =?UTF-8?q?miss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test files were typechecked by nothing: tsconfig.build.json excludes them (correctly — they must not land in dist), and vitest transforms with esbuild, which strips types without checking them. That gap is where the review's two tsc breaks and the fixture drift accumulated. Adds 'typecheck' scripts per package (dev tsconfigs, which include src/**/*.test.ts; renderer reuses its existing tsc -b), a root orchestrator mirroring the test script, and a CI step in the vitest job. All three packages are currently clean. Co-Authored-By: Claude Fable 5 --- .github/workflows/x-tests.yml | 6 ++++++ CLAUDE.md | 1 + apps/x/apps/renderer/package.json | 1 + apps/x/package.json | 6 +++++- apps/x/packages/core/package.json | 1 + apps/x/packages/shared/package.json | 1 + 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/x-tests.yml b/.github/workflows/x-tests.yml index 9e8b1c7d..c08c4095 100644 --- a/.github/workflows/x-tests.yml +++ b/.github/workflows/x-tests.yml @@ -34,6 +34,12 @@ jobs: - name: Run apps/x Vitest suites run: npm test + # Typechecks with the dev tsconfigs, which include test files — + # the build tsconfigs exclude them and vitest strips types without + # checking, so this is the only gate that sees type errors in tests. + - name: Typecheck apps/x packages + run: npm run typecheck + apps-x-electron-package: name: apps/x Electron package smoke test runs-on: ubuntu-latest diff --git a/CLAUDE.md b/CLAUDE.md index e0989688..a5fe24c8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -139,6 +139,7 @@ Long-form docs for specific features. Read the relevant file before making chang ### Verify compilation ```bash cd apps/x && npm run deps && npm run lint +cd apps/x && npm run typecheck # dev tsconfigs — the only gate that typechecks *.test.ts ``` ## Tech Stack diff --git a/apps/x/apps/renderer/package.json b/apps/x/apps/renderer/package.json index 0a8c9f9f..c0ad3480 100644 --- a/apps/x/apps/renderer/package.json +++ b/apps/x/apps/renderer/package.json @@ -5,6 +5,7 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", + "typecheck": "tsc -b", "lint": "eslint .", "preview": "vite preview", "test": "vitest run", diff --git a/apps/x/package.json b/apps/x/package.json index d0931dc7..fbead12c 100644 --- a/apps/x/package.json +++ b/apps/x/package.json @@ -16,7 +16,11 @@ "test": "npm run shared && npm run test:shared && npm run test:core && npm run test:renderer", "test:shared": "cd packages/shared && npm test", "test:core": "cd packages/core && npm test", - "test:renderer": "cd apps/renderer && npm test" + "test:renderer": "cd apps/renderer && npm test", + "typecheck": "npm run shared && npm run typecheck:shared && npm run typecheck:core && npm run typecheck:renderer", + "typecheck:shared": "cd packages/shared && npm run typecheck", + "typecheck:core": "cd packages/core && npm run typecheck", + "typecheck:renderer": "cd apps/renderer && npm run typecheck" }, "devDependencies": { "@eslint/js": "^9.39.2", diff --git a/apps/x/packages/core/package.json b/apps/x/packages/core/package.json index 5bd6d9b5..80b5b54d 100644 --- a/apps/x/packages/core/package.json +++ b/apps/x/packages/core/package.json @@ -7,6 +7,7 @@ "scripts": { "build": "rm -rf dist && tsc -p tsconfig.build.json", "dev": "tsc -w -p tsconfig.build.json", + "typecheck": "tsc --noEmit -p tsconfig.json", "test": "vitest run", "test:watch": "vitest", "inspect-turn": "node dist/runtime/turns/inspect-cli.js", diff --git a/apps/x/packages/shared/package.json b/apps/x/packages/shared/package.json index 31f99cdd..982f99dc 100644 --- a/apps/x/packages/shared/package.json +++ b/apps/x/packages/shared/package.json @@ -7,6 +7,7 @@ "scripts": { "build": "rm -rf dist && tsc -p tsconfig.build.json", "dev": "tsc -w", + "typecheck": "tsc --noEmit -p tsconfig.json", "test": "vitest run", "test:watch": "vitest" },