fix(preload): keep zod out of sandbox bundle

This commit is contained in:
ZacharyZhang-NY committed 2026-04-22 18:31:24 -04:00
1 parent fa006524c2
commit 710448a75f
4 files changed
+19 -7

No files matched your search

@@ -0,0 +1,14 @@
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
describe("preload bundling contract", () => {
it("keeps Zod validation on the main-process IPC boundary", () => {
const configSource = readFileSync(join(process.cwd(), "electron.vite.config.ts"), "utf8");
const preloadSource = readFileSync(join(process.cwd(), "src/preload/index.ts"), "utf8");
expect(configSource).not.toContain('exclude: ["zod"]');
expect(preloadSource).not.toContain('from "@shared/contracts"');
expect(preloadSource).not.toMatch(/from ["']zod["']|require\(["']zod["']\)/);
});
});