Skip to content

Commit 8f7ff5e

Browse files
committed
Use external wrapper for zod import
Import zod from './external/zod' wrapper instead of directly from 'zod'. This follows the same pattern as other external dependencies like cacache. The external/zod.js wrapper uses CommonJS module.exports pattern which: - Works correctly in regular Node.js environment - Gets bundled by build-externals.mjs for production - Still has resolution issues in vitest test environment Note: ipc.test.ts still fails due to vitest/CommonJS interop issue.
1 parent b249f91 commit 8f7ff5e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/external/zod.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export { z } from 'zod'
2-
export * from 'zod'
1+
module.exports = require('zod')

src/ipc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { promises as fs } from 'node:fs'
3333
import os from 'node:os'
3434
import path from 'node:path'
3535

36-
import { z } from 'zod'
36+
import { z } from './external/zod'
3737

3838
// Define BufferEncoding type for TypeScript compatibility.
3939
type BufferEncoding = globalThis.BufferEncoding

0 commit comments

Comments
 (0)