From 133d4bcfb5fff1c196277cf258b9e58289577a5f Mon Sep 17 00:00:00 2001 From: zhizheng Date: Thu, 12 Jun 2025 18:30:46 +0800 Subject: [PATCH] feat(update): delete fresh.gen.ts in @fresh/update (#3028) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- update/src/update.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/update/src/update.ts b/update/src/update.ts index a73cf622..3ff209e1 100644 --- a/update/src/update.ts +++ b/update/src/update.ts @@ -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..."));