fix: fixed client utils generation
This commit is contained in:
25
fix-client.ts
Normal file
25
fix-client.ts
Normal 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");
|
||||
Reference in New Issue
Block a user