feat(update): delete fresh.gen.ts in @fresh/update (#3028)

delete fresh.gen.ts
close #3022
- before:

![8dd2fb246bc33b206b4f50f3d8f7439](https://github.com/user-attachments/assets/fa45af2f-0241-4ad7-9837-6b14364756ed)



- after:

![50b9512afcd0f522dada0ab3f3b4cc0](https://github.com/user-attachments/assets/56539c41-3ee5-4d3a-a1ac-5c64e5d008b0)

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
This commit is contained in:
zhizheng
2025-06-12 12:30:46 +02:00
committed by GitHub
co-authored by 李嘉图·M·路
parent cb402b9839
commit 133d4bcfb5
+18
View File
@@ -150,6 +150,24 @@ export async function updateProject(dir: string) {
// deno-lint-ignore no-console
console.log(colors.green("✅ Configuration updated successfully"));
// Delete fresh.gen.ts if it exists (no longer needed in Fresh 2.0)
const freshGenPath = path.join(dir, "fresh.gen.ts");
try {
await Deno.remove(freshGenPath);
// deno-lint-ignore no-console
console.log(colors.cyan("🗑️ Deleted fresh.gen.ts (no longer needed)"));
} catch (err) {
if (!(err instanceof Deno.errors.NotFound)) {
// deno-lint-ignore no-console
console.error(
`Could not delete fresh.gen.ts: ${
err instanceof Error ? err.message : String(err)
}`,
);
}
// If file doesn't exist, that's fine - nothing to do
}
// deno-lint-ignore no-console
console.log(colors.cyan("🔍 Scanning for source files..."));