Commit 24fd2e6
committed
Fix zod import and resolve all test failures
Create proper TypeScript wrapper for zod to avoid ESM/CommonJS interop issues.
The Problem:
- Directly importing from 'src/external/zod.js' (CommonJS) using ESM import
syntax in TypeScript doesn't work reliably in vitest's module system
- This caused 'z' to be undefined at runtime in tests
The Solution:
- Created src/zod.ts that cleanly re-exports z from 'zod' package
- Updated src/ipc.ts to import from './zod' instead of './external/zod'
- Fixed incorrect import path in ipc.test.ts (../../utils → ../utils)
This follows the established pattern where:
1. src/external/*.js wraps the npm package (for build bundling)
2. src/*.ts provides clean TypeScript interface (for code usage)
3. Code imports from src/*.ts, never directly from src/external/*.js
Result: All 6 test suites now pass (212 tests total)!1 parent 78acf73 commit 24fd2e6
3 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments