Skip to content

Commit fce2966

Browse files
committed
fix(platform): type-check every embedded file and its tests
The app's tsconfig excluded all of platform/ and the zone's excluded embedded, so an embedded file that app/o does not reach was never compiled, and its tests escaped check:test-types. List the zone's paths instead, so both projects cover the tree.
1 parent 4bb8674 commit fce2966

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

‎apps/sim/tsconfig.json‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@
3232
"exclude": [
3333
"node_modules",
3434
".next",
35-
"platform",
35+
"platform/app",
36+
"platform/lib",
37+
"platform/fixtures",
38+
"platform/checks",
39+
"platform/preview",
40+
"platform/design-system",
41+
"platform/.next",
42+
"platform/node_modules",
43+
"platform/next-env.d.ts",
44+
"platform/next.config.ts",
45+
"platform/proxy.ts",
3646
"**/*.test.ts",
3747
"**/*.test.tsx",
3848
"vitest.config.ts",

‎apps/sim/tsconfig.tests.json‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
{
22
"extends": "./tsconfig.json",
3-
"exclude": ["node_modules", ".next", "platform", "vitest.config.ts", "vitest.setup.ts"]
3+
"exclude": [
4+
"node_modules",
5+
".next",
6+
"platform/app",
7+
"platform/lib",
8+
"platform/fixtures",
9+
"platform/checks",
10+
"platform/preview",
11+
"platform/design-system",
12+
"platform/.next",
13+
"platform/node_modules",
14+
"platform/next-env.d.ts",
15+
"platform/next.config.ts",
16+
"platform/proxy.ts",
17+
"vitest.config.ts",
18+
"vitest.setup.ts"
19+
]
420
}

‎scripts/check-test-types.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* Ratchets type errors in apps/sim's unit tests down, per file and per error code.
44
*
55
* `apps/sim/tsconfig.json` excludes `*.test.ts(x)`, so `bun run type-check` never sees the ~3.4k
6-
* test files, and they carry thousands of type errors nobody is asked to fix today. Without a
6+
* test files, and they carry thousands of type errors nobody is asked to fix today. That includes
7+
* the tests under `platform/embedded`. The Platform zone's own tests stay out: its project
8+
* (`platform/tsconfig.json`) compiles them in `type-check`, where any error fails. Without a
79
* gate, every new test can add more, and a test whose mocks no longer match the code they stand
810
* in for type-checks as fine as one that does. This check runs the native compiler (the root
911
* `tsc`, which `check:native-typecheck` pins to TypeScript 7) on `apps/sim/tsconfig.tests.json`,

0 commit comments

Comments
 (0)