From d143f54c186f95499a320ee94b705981ffccb5ce Mon Sep 17 00:00:00 2001 From: William Zujkowski Date: Mon, 15 Jun 2026 23:33:44 -0400 Subject: [PATCH] fix: typecheck the contract test file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tsconfig.json excludes **/*.test.ts so `tsc --noEmit` only checked schemas.ts, never schemas.test.ts — the repo's entire deliverable. A type-level drift in how the test consumes the schemas (the exact failure this repo exists to surface) passed the typecheck gate clean. Add tsconfig.test.json (extends base, noEmit, declaration off, re-includes test files) and run it as a second step in the `typecheck` script. `build` still uses tsconfig.json, so dist/ contains only schemas.js/.d.ts — no test declarations emitted. Verified: a deliberate type error in schemas.test.ts now fails `npm run typecheck`, and the full sequence (typecheck/test/build) is green. Fixes #6 Co-Authored-By: Claude Opus 4.8 (1M context) --- package.json | 2 +- tsconfig.test.json | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tsconfig.test.json diff --git a/package.json b/package.json index f868824..b4a9073 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "scripts": { "build": "tsc", "test": "vitest run", - "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit && tsc -p tsconfig.test.json" }, "devDependencies": { "@types/node": "^22.0.0", diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..2b538dd --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,13 @@ +{ + // Type-check the test files too. The base tsconfig.json excludes + // **/*.test.ts so `build` (tsc emit) never writes test declarations into + // dist/; this config re-includes them under --noEmit so `typecheck` actually + // verifies the contract test — the repo's whole deliverable. + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "declaration": false + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +}