chore: 迁移到 pnpm 并更新打包与测试文档

- 用 pnpm 替换 npm,锁定 pnpm@10.33.0,删除 package-lock.json 相关说明
- package.json 将渲染层依赖移入 devDependencies,减小 app.asar 体积
- 新增 electron:smoke 冒烟脚本与 icon 生成脚本
- win 平台设置 AppUserModelID,修复任务栏图标归组
- 清理 tsBuildInfoFile 输出路径至 node_modules/.tmp
- 更新测试断言以匹配画幅遮罩、取景器缩放与模型库外部资产行为
- README 与打包指南补充 pnpm、镜像与常见问题说明
This commit is contained in:
2026-09-16 20:03:57 +08:00
parent 2ad176be4e
commit b9fd289caf
27 changed files with 5538 additions and 8452 deletions

View File

@@ -1,4 +1,8 @@
@echo off
setlocal
cd /d "%~dp0"
rem Electron / electron-builder 二进制下载走国内镜像
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
set ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
@@ -7,7 +11,7 @@ echo StoryAI 3D Director Desk - Package Tool
echo ========================================
echo.
echo [0/4] Cleaning old files...
echo [0/4] Cleaning old output...
if exist "release" (
rmdir /s /q "release" 2>nul
if exist "release" (
@@ -16,21 +20,22 @@ if exist "release" (
exit /b 1
)
)
if exist "node_modules\electron" (
rmdir /s /q "node_modules\electron" 2>nul
)
echo [1/4] Installing dependencies...
call npm install
rem 不要再单独删除 node_modules 里的某个包(例如 node_modules\electron)。
rem 绕过包管理器删包,会让 pnpm 仍以为该依赖已安装,反而产出缺失/空壳的依赖目录。
rem 需要重装时统一执行 pnpm install。
echo [1/4] Installing dependencies with pnpm...
call pnpm install
if errorlevel 1 (
echo Install failed!
echo Install failed! Install pnpm first: npm i -g pnpm
pause
exit /b 1
)
echo.
echo [2/4] Building frontend...
call npm run build
call pnpm run build
if errorlevel 1 (
echo Build failed!
pause
@@ -39,7 +44,7 @@ if errorlevel 1 (
echo.
echo [3/4] Packaging to exe...
call npx electron-builder --win
call pnpm exec electron-builder --win
if errorlevel 1 (
echo Package failed!
pause