From 1dbbdcf329b9fed5207c2c91f8d964abff35eca0 Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Wed, 30 Sep 2026 19:28:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAGC=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=87=86=E5=A4=87=E6=97=B6=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在启动Vite前完成随包资源staging,避免Windows监听目录导致rename返回EPERM。 同步更新开发入口生命周期测试。 --- apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs | 5 +++-- apps/ai-game-creator-shell/tests/start-tauri-dev.test.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs b/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs index 6c82e54cb..a5be013ac 100644 --- a/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs +++ b/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs @@ -152,6 +152,9 @@ async function runTauriDev( } try { + const devFeatures = readDevCargoFeatures(); + prepareResources(devFeatures); + // Windows 下 Vite 会监听资源目录;必须在启动前完成目录替换,避免 rename 被占用。 const preparation = prepareFrontend(endpoint, { signal: preparationAbort.signal, onChild(frontend) { @@ -163,8 +166,6 @@ async function runTauriDev( shutdownRequested.then(() => false), ]); if (!prepared || shutdownSignal) return 1; - const devFeatures = readDevCargoFeatures(); - prepareResources(devFeatures); const tauriArguments = buildTauriArguments( withDevCargoFeatures(argv, devFeatures), endpoint.url, diff --git a/apps/ai-game-creator-shell/tests/start-tauri-dev.test.ts b/apps/ai-game-creator-shell/tests/start-tauri-dev.test.ts index 5cfcd7d3f..1becc9303 100644 --- a/apps/ai-game-creator-shell/tests/start-tauri-dev.test.ts +++ b/apps/ai-game-creator-shell/tests/start-tauri-dev.test.ts @@ -181,8 +181,8 @@ describe('AI 游戏创作 Tauri dev 生命周期', () => { expect(result).toBe(1); expect(order).toEqual([ 'preflight', - 'frontend-ready', 'resources', + 'frontend-ready', 'spawn', 'exit', 'cleanup',