fix: fixed client utils generation

This commit is contained in:
2025-10-30 20:52:24 +04:00
parent d38454f3af
commit e9c9f6b65d
4 changed files with 28 additions and 16 deletions

25
fix-client.ts Normal file
View File

@ -0,0 +1,25 @@
import * as fs from "fs";
const zodPath = "src/lib/client/zod.gen.ts";
let content = fs.readFileSync(zodPath, "utf8");
// Replace only for the upload schema
const zodTarget = "upload_file: z.string";
while (content.includes(zodTarget)) {
content = content.replace(zodTarget, "upload_file: z.any");
}
fs.writeFileSync(zodPath, content);
console.log("✅ Fixed zod schema for upload_file");
const utilsPath = "src/lib/client/client/utils.ts";
content = fs.readFileSync(utilsPath, "utf8");
const utilsTarget = "@ts-expect-error";
while (content.includes(utilsTarget)) {
content = content.replace(utilsTarget, "@ts-ignore");
}
content = content.replace(
"...(mergedHeaders[key] ?? []),",
"...(mergedHeaders[key] ?? []) as any,"
);
fs.writeFileSync(utilsPath, content);
console.log("✅ Fixed utils.ts");