diff --git a/CHANGELOG.md b/CHANGELOG.md index 253bafb..3dcaa4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ > 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。 > 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。 +## v3.26.104(2026-11-26)移除 PWA 图标面 + Windows 构建文档订正 + +- **构建修复**:根目录 `favicon.svg` / `icon-192.png` / `icon-512.png` / `apple-touch-icon.png` / `manifest.webmanifest` 已删除;`scripts/build.js` 不再拷贝/引用这些文件,避免 `beforeBuildCommand` 因 ENOENT 让 `app:build` 直接失败。 +- **保留 `sw.js`**:它不是纯 PWA 安装面,仍负责版本更新检测与 `/__iwb_cache__` 图片缓存直出;删了会破图/丢更新提示。 +- `scripts/check-dist.js` 新增断言:PWA 图标/manifest 不得进 dist、index.html 不得引用、sw.js 必须存在。 +- **Windows 文档订正**:`WIN_BUILD_SPEC.md §3` 改为无更新私钥时的正确构建命令(临时 `createUpdaterArtifacts:false` config,不再用会失败的 `npm run app:build`);Cargo 版本改用 PowerShell `Select-String`;win remote 统一为 `origin`;`AI-HANDOFF-WINDOWS.md` 更新为当前 `latest-windows.json` 更新源事实,并修正旧装机兼容说明与日志路径。 + ## v3.26.103(2026-11-26)相册重选文件夹与缩略图缓存自愈 - 相册插件 **1.1.5**:重选同一文件夹时按归一化路径**就地更新**,不再追加重复项(旧实现把坏格留在前面、重复项排到后面,看起来就是“重选也不出缩略图”);同时清 missing、删旧缩略图缓存并强制重读原图。 diff --git a/apple-touch-icon.png b/apple-touch-icon.png deleted file mode 100644 index 4a167e2..0000000 Binary files a/apple-touch-icon.png and /dev/null differ diff --git a/docs/AI-HANDOFF-WINDOWS.md b/docs/AI-HANDOFF-WINDOWS.md index 4c6a250..9fb7823 100644 --- a/docs/AI-HANDOFF-WINDOWS.md +++ b/docs/AI-HANDOFF-WINDOWS.md @@ -1,14 +1,14 @@ # 给 Windows 端 AI 的协作说明(Image Workbench 桌面版) > 这份文档是给 **Windows 构建端的 AI agent** 读的。读完你应理解:项目架构、为什么 Windows 之前开不了网页、发布链路、你的职责边界、这次踩过的坑。 -> 详细打包步骤见仓库 `docs/WIN_BUILD_SPEC.md`(gitea/main)。本文是「认知 + 边界」,那份是「操作清单」。 +> 详细打包步骤见仓库 `docs/WIN_BUILD_SPEC.md`(main;mac 的 remote 叫 `gitea`,win 叫 `origin`)。本文是「认知 + 边界」,那份是「操作清单」。 --- ## 1. 项目是什么 - Image Workbench:Tauri v2 桌面应用(本地优先的 AI 生图无限画布)。 -- 仓库:`/Users/qiqi/open/github/image-workbench-desktop`(mac 端),git remote 名为 `gitea`。 +- 仓库:`/Users/qiqi/open/github/image-workbench-desktop`(mac 端),mac 的 git remote 名为 `gitea`;win 构建机的 remote **只有 `origin`**,命令别照抄 `gitea`。 - 分发:自建 NAS,公网 `https://download.maqiart.eu.org`,根目录 `/vol8/web/iwb-download`。 - 版本线:以 `package.json` 为准(当前 `3.26.x`);历史 `3.25.x` 仅示例。**注意**:仓库里最高的 git tag `v3.87.65` 是历史遗留线,semver 更大但**不是**最新——判断最新版看 `package.json` / `CHANGELOG.md` 顶条 / `tauri.conf.json`,永远别按最高 tag。 @@ -38,8 +38,8 @@ ``` mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main` - → win `git fetch gitea && git reset --hard gitea/main` - → win 构建 setup.exe(npm ci && npm run app:build) + → win `git fetch origin && git reset --hard origin/main` + → win 构建 setup.exe(npm ci + WIN_BUILD_SPEC.md §3 的临时 nosign config) → win 自测矩阵通过 → win 把 setup.exe 放到 NAS `_inbox/`(权限700,公网403) → 通知 mac:版本 + size + sha256 @@ -54,9 +54,9 @@ mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main` ## 4. 你的职责边界(AI 必须遵守) ✅ 你该做: -- `git reset --hard gitea\main` 到最新 +- `git reset --hard origin/main` 到最新 - 核对三处版本一致(package.json / tauri.conf.json / Cargo.toml)+ 确认 lib.rs 里 6 个 `async fn canvas_webview_*` 都在 -- `npm ci && npm run app:build` +- `npm ci`,再按 `WIN_BUILD_SPEC.md §3` 用临时 nosign config 构建(`npm run app:build` 会因缺少更新私钥失败) - 跑自测矩阵(尤其第 2 项:画布网页节点能打开、不卡死) - 把 `image-workbench__x64-setup.exe` 放 NAS `_inbox/` - 记录 size + SHA256,通知 mac 端 @@ -65,7 +65,7 @@ mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main` - **自己签名 / 生成 .sig** —— 更新私钥只在 mac(`~/.config/iwb-updater.key`),win 签出来的 key ID 与项目公钥 `17ae57d0ac9f15f1` 不配对,客户端会拒绝安装(这次 win 放上来的临时 .sig 就被 mac 忽略重签了) - 改 `src-tauri\src\lib.rs` / `Cargo.toml` / `tauri.conf.json` 等任何源码 - 跑 `cargo fmt` 或让 IDE 保存即格式化 -- `git add -A` / `git push gitea main`(push 是 mac 端 `RELEASE=1` 的单独动作) +- `git add -A` / `git push`(push 是 mac 端 `RELEASE=1` 的单独动作;win 不 push) - 把 `target\`、`node_modules\`、`.msi`、`.sig` 提交进 git --- @@ -73,8 +73,8 @@ mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main` ## 5. 这次踩过的坑(让你少走弯路) 1. **win 自签 .sig 无效**:win 端没有正式私钥,签出来的 sig keyid 对不上,白签。只交 setup.exe,签名交给 mac。 -2. **`latest.json` 平台解耦 bug**:项目想做 mac/win 独立更新清单(mac→`latest.json`,win→`latest-windows.json`),但**应用的 `tauri.conf.json` endpoints 只配了 `latest.json`**,且 mac 发布脚本 `publish-update.sh` 写清单时**只硬编码 darwin 两平台、丢弃 windows 条目**。结果:win 用户的应用拉 `latest.json` 找不到 `windows-x86_64` → 更新无结果。**临时修**:mac 端把 windows 条目合并回 `latest.json`。**已修(v3.25.32)**:`publish-update.sh` 现从 `latest-windows.json` 合并 windows 条目,且**仅当 win version == 本次 mac version(同批)才合并**,否则拒绝并警告(防"声明新版、实际旧包"导致 updater 反复提示同一旧包的死循环)。 -3. **v3.25.30 旧 win 包 updater 卡「正在检查…」**:那是旧包的 updater 行为/网络,不是发布错。诊断法:浏览器打开 `https://download.maqiart.eu.org/updates/latest.json`,能看到 `windows-x86_64` 即发布侧没问题;旧包用户**直接用网页下载 setup.exe 手动升级**最稳,装上 v3.25.31 后以后就能应用内更新。 +2. **更新源平台解耦(已修复,旧装机例外)**:早期 win 客户端编译时写死读 `latest.json`,而 mac 发布脚本曾只写 darwin 条目,导致 win 更新无结果。自 `856e34a`(2025-11-18)起,`src-tauri/tauri.windows.conf.json` 已把 updater endpoints 覆盖成 `latest-windows.json`;**新构建的 win 应用直接读 `latest-windows.json`**。mac 仍会把 windows 条目合并进 `latest.json`,只为兼容**旧装机**(它们编译时写死旧源)。升级到新包后,旧装机也会改读 `latest-windows.json`。 +3. **v3.25.30 旧 win 包 updater 卡「正在检查…」**:那是旧包的 updater 行为/网络,不是发布错。诊断法:新包看 `https://download.maqiart.eu.org/updates/latest-windows.json`,旧包看 `latest.json`;能看到 `windows-x86_64` 即发布侧没问题。旧包用户**直接用网页下载 setup.exe 手动升级**最稳,装上包含 `856e34a` 的版本后就会改读 `latest-windows.json`。 4. **Windows 画布网页节点无圆角**:`cwv_round` 非 macOS 分支是空 stub,网页节点直角贴卡片。cosmetic,已知缺失,另排 backlog,不影响交付。 --- @@ -84,14 +84,15 @@ mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main` **结论**:win 客户端**支持在程序里「检查更新」自动升级**,机制和 mac 一样,但**依赖 mac 端配合签名 + 合并更新清单**,win 端自己做不到完整闭环。 **更新怎么触发** -- win 客户端 `tauri.conf.json` 的更新源写死指向 `https://download.maqiart.eu.org/updates/latest.json`(和 mac 共用一个源,**不是** `latest-windows.json`)。 -- 点「检查更新」→ 读 `latest.json` → 找 **`windows-x86_64`** 条目 → 下载它指向的 `setup.exe` → 用项目公钥校验签名 → 通过则运行安装、重启。 -- 能否更新取决于两点:① `latest.json` 里有没有 `windows-x86_64` 条目;② 那个包是不是 mac 正式私钥签的。 +- 当前 win 构建(`src-tauri/tauri.windows.conf.json`,自 `856e34a`)的更新源是 `https://download.maqiart.eu.org/updates/latest-windows.json`;mac 的 `tauri.conf.json` 才是 `latest.json`。**不要再按旧文档说“win 只读 latest.json”**。 +- 点「检查更新」→ 读 `latest-windows.json` → 找 **`windows-x86_64`** 条目 → 下载它指向的 `setup.exe` → 用项目公钥校验签名 → 通过则运行安装、重启。 +- 能否更新取决于两点:① `latest-windows.json` 里有没有 `windows-x86_64` 条目;② 那个包是不是 mac 正式私钥签的。 +- **旧装机**仍可能读 `latest.json`(编译时写死);所以 mac 仍把 win 条目合并进 `latest.json` 作为兼容。新装机不需要这条也能更新。 **每次 win 发版的完整链路** -1. win 端:拉最新 main → `npm ci && npm run app:build` → 得 `image-workbench_<版本>_x64-setup.exe` → 自测矩阵 → 放 NAS `_inbox/`(**只放 setup.exe,不放 .sig**)。 +1. win 端:拉最新 main → `npm ci` → 按 `WIN_BUILD_SPEC.md §3` 用临时 nosign config 构建(直接用 `npm run app:build` 会因没有更新私钥在签名阶段失败)→ 得 `image-workbench_<版本>_x64-setup.exe` → 自测矩阵 → 放 NAS `_inbox/`(**只放 setup.exe,不放 .sig**)。 2. mac 端:`publish-windows-update.sh `(正式私钥签名 + 上传 `updates/windows-x86_64/` + 写 `latest-windows.json`)。 -3. mac 端:重跑 `publish-update.sh`,把 win 条目合并进 `latest.json`(合并条件:win 版本 == mac 本次版本)。 +3. mac 端:重跑 `publish-update.sh`,把 win 条目合并进 `latest.json`(兼容旧装机;合并条件:win 版本 == mac 本次版本)。新装机读 `latest-windows.json`,不依赖这一步。 4. 完成后 win 用户即可在程序里检查更新到新版。 **硬性前提 / 规则** @@ -107,13 +108,15 @@ mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main` ## 7. 验证发布是否到位(win 用户/你都能查) ``` +浏览器打开 https://download.maqiart.eu.org/updates/latest-windows.json +→ version 应是目标版本,platforms 应含 windows-x86_64 浏览器打开 https://download.maqiart.eu.org/updates/latest.json -→ version 应是目标版本,platforms 应含 darwin-aarch64 / darwin-x86_64 / windows-x86_64 +→ mac 条目为目标版本;为兼容旧装机,也应含 windows-x86_64 浏览器打开 https://download.maqiart.eu.org/ → 三平台都应是「下载」按钮,不是「暂未提供」 ``` -`latest.json` 是 `cf-cache-status: DYNAMIC`(CF 不缓存),改完即时生效,不用等。 +`latest.json` / `latest-windows.json` 都是 `cf-cache-status: DYNAMIC`(CF 不缓存),改完即时生效,不用等。 --- diff --git a/docs/DESKTOP_UPDATE.md b/docs/DESKTOP_UPDATE.md index 435df24..3b742ae 100644 --- a/docs/DESKTOP_UPDATE.md +++ b/docs/DESKTOP_UPDATE.md @@ -9,7 +9,8 @@ | 组件 | 位置 | 说明 | |---|---|---| | 更新插件 | `src-tauri/Cargo.toml` → `tauri-plugin-updater` | Rust 侧用 `UpdaterExt` | -| 更新源 | `src-tauri/tauri.conf.json` → `plugins.updater.endpoints` | `https://download.maqiart.eu.org/updates/latest.json` | +| 更新源(macOS) | `src-tauri/tauri.conf.json` → `plugins.updater.endpoints` | `https://download.maqiart.eu.org/updates/latest.json` | +| 更新源(Windows) | `src-tauri/tauri.windows.conf.json` → `plugins.updater.endpoints` | `https://download.maqiart.eu.org/updates/latest-windows.json`(自 `856e34a`;旧装机仍可能读 latest.json) | | 签名公钥 | 同上 `plugins.updater.pubkey` | 私钥在 `~/.config/iwb-updater.key`(**务必备份**) | | 产物开关 | `bundle.createUpdaterArtifacts: true` | 构建 app 时额外产出 `.app.tar.gz` + `.sig` | | Rust 命令 | `check_update` / `install_update` | 前端通过 `__TAURI__.core.invoke` 调用 | diff --git a/docs/WIN_BUILD_SPEC.md b/docs/WIN_BUILD_SPEC.md index fe4ad51..0fe6839 100644 --- a/docs/WIN_BUILD_SPEC.md +++ b/docs/WIN_BUILD_SPEC.md @@ -12,7 +12,7 @@ win 构建 setup.exe → win 自测通过 → 把 setup.exe 放到 NAS `_inbox/` ## 0.1 版本与 CRLF(2026-11-24 教训,v3.26.54/55) - **版本号只认 `package.json`**:`node -e "console.log(require('./package.json').version)"`;文档里写死的版本一律视为历史示例。 -- 拉取 `gitea/main` 后先跑 `npm run tokens:check`,再 `npm run app:build`。 +- 拉取 `origin/main` 后先跑 `npm run tokens:check`,再按 §3 的临时 nosign config 构建。 - 若报 `src/design-tokens.css 与 derive() 不一致`:**先怀疑 Windows 检出把 CSS 转成了 CRLF**,不要直接 `tokens:write`。校验层(`gen-tokens.js` + `build.js`)自 v3.26.55 起已归一 `\r\n`;仍失败时把**第一处差异行**原样发回 mac 端。 - `.gitattributes` 的 `eol=lf` 只影响**新检出**,不会自动 renormalize 已存在工作区——所以不能只靠它。 - 不要改 `scripts/build.js` / `gen-tokens.js` 来绕过;构建脚本属于 mac 源码,改动先同步 mac 端。 @@ -44,18 +44,20 @@ rustc -V # 期望 >= 1.90 ## 2. 取代码(必须是最新 main) ```powershell -git fetch gitea +git fetch origin git checkout main -git reset --hard gitea\main +git reset --hard origin/main ``` +> win 机器的 remote 只有 `origin`;`gitea` 是 mac 端 remote,不要混用。 + **校验基线**(构建前必查,缺一不可): ```powershell # 2.1 三处版本号必须完全一致,且 = 目标版本(如 3.25.31) node -e "console.log(require('./package.json').version)" node -e "console.log(require('./src-tauri/tauri.conf.json').version)" -node -e "console.log(require('./src-tauri/Cargo.toml').version)" +(Select-String -Path .\src-tauri\Cargo.toml -Pattern '^version\s*=\s*"([^"]+)"' | Select-Object -First 1).Matches[0].Groups[1].Value # 2.2 确认含 Windows 死锁修复(v3.25.31 的关键改动) # 这 6 个命令必须是 async fn,不是同步 fn @@ -75,10 +77,18 @@ findstr /C:"async fn canvas_webview_close_all" src-tauri\src\lib.rs ```powershell npm ci -npm run app:build + +# 关键:win 没有正式更新私钥,而 tauri.conf.json 是 createUpdaterArtifacts:true。 +# 直接 npm run app:build 会在签名阶段失败(Rust/NSIS 都白编)。 +# 把 createUpdaterArtifacts 关掉,写到临时目录再构建;不要改仓库文件、不要产 .sig。 +$cfg = Join-Path $env:TEMP 'iwb-tauri-win-nosign.json' +'{"bundle":{"createUpdaterArtifacts":false}}' | Set-Content -Encoding ascii $cfg +.\node_modules\.bin\tauri.cmd build --config $cfg ``` +- **不要用** `npm run app:build` 替代上面这条:npm 不会把 `--config` 透传给 tauri,且 win 端不该自己签名。 - 首次会编译约 250 个 crate,2–5 分钟;之后增量很快。 +- 产物目录不变;因为关闭 updater artifacts,不会生成 `.sig`,这是预期的。mac 端会用自己的私钥重签。 - 产物: - `src-tauri\target\release\bundle\nsis\image-workbench__x64-setup.exe` ← **交付这个** - `src-tauri\target\release\bundle\msi\*.msi`(可选,备用) @@ -120,7 +130,7 @@ certutil -hashfile src-tauri\target\release\bundle\nsis\image-workbench_3.25.31_ | 4 | 节点 ✕ / 切工作区 / 退出应用 | cwv-* 子 webview 正常回收,不留残余进程 | | 5 | 独立浏览器窗口(插件「↗ 独立窗口」)| 能打开(这条本来就跨平台可用)| -第 2 项不过 → 别交付,把 `_%APPDATA%\com.malongan.imageworkbench\_cwv.log` 发回 mac 端排查。 +第 2 项不过 → 别交付,把 `%APPDATA%\com.malongan.imageworkbench\_cwv.log` 发回 mac 端排查。 已知缺失(不影响交付,但告知用户):Windows 画布网页节点**没有圆角**(直角贴卡片),属 cosmetic,另排 backlog。 @@ -148,7 +158,7 @@ mac 端收到通知后执行: 2. `./scripts/publish-windows-update.sh ` —— 本机正式私钥签名 + 上传 `updates/windows-x86_64/` + 写 `latest-windows.json` 3. `node scripts/update-releases.js --platform windows-x86_64 …` 登记网页下载 4. `gen-release-page.js` + `gen-site.js` 重生成页面 + scp 元数据 -5. 合并 windows 条目进 `latest.json`(应用内更新源) +5. 合并 windows 条目进 `latest.json`(兼容旧装机;新 win 构建读 `latest-windows.json`,见 `tauri.windows.conf.json`) 6. commit + `RELEASE=1 git push gitea main` --- @@ -160,16 +170,16 @@ mac 端收到通知后执行: - ❌ 在 win 上跑 `cargo fmt` / IDE 保存即格式化(会引入整文件 diff,污染 mac 端同步) - ❌ 把 `target\`、`node_modules\`、`.cargo`、`.msi` 提交进 git - ❌ 用 `git add -A`(只精确提交需要入库的文件) -- ❌ 直接 `git push gitea main`(push 需 mac 端 `RELEASE=1` 口令,win 端不 push) +- ❌ 直接 `git push`(push 需 mac 端 `RELEASE=1` 口令,win 端不 push;win 的 remote 是 `origin`,不是 `gitea`) --- ## 9. 快速核对清单(交付前打勾) -- [ ] `git reset --hard gitea\main` 到最新 +- [ ] `git reset --hard origin/main` 到最新 - [ ] package.json / tauri.conf / Cargo.toml 三处版本一致 = 目标版本 - [ ] lib.rs 里 6 个 `async fn canvas_webview_*` 都在 -- [ ] `npm ci && npm run app:build` 成功 +- [ ] §3 的 `tauri build --config <临时 nosign.json>` 成功(不是 `npm run app:build`) - [ ] 产物名 = `image-workbench__x64-setup.exe` - [ ] 记下 size + SHA256 - [ ] 自测矩阵 5 项全过(尤其第 2 项画布网页不卡死) diff --git a/docs/standards/project-engineering-standards.md b/docs/standards/project-engineering-standards.md index 5023849..c0c21a7 100644 --- a/docs/standards/project-engineering-standards.md +++ b/docs/standards/project-engineering-standards.md @@ -278,9 +278,10 @@ npm run verify dist/app.js = src/*.js(按 sourceModules 定序,逐文件 minify;自动发现的 src/plugin-*.js 追加于末尾) + app.js(先注入 APP_VERSION,再 minify),纯文本拼接 dist/style.css = style.css(minify) -dist/ += favicon.svg / _headers / THIRD_PARTY_NOTICES.md - / vendor/react*.js ×2 / sw.js(注入 __IWB_VERSION__) +dist/ += _headers / THIRD_PARTY_NOTICES.md + / vendor/react*.js ×2 / sw.js(注入 __IWB_VERSION__;保留更新检测 + 图片缓存,不是 PWA 安装面) / index.html(内联生成)/ version.json + (2026-11-26 起根目录 favicon/icon-*/apple-touch-icon/manifest 已删除) ``` - **规则:`sourceModules` 的顺序即加载顺序,绝不排序、绝不改动**(各模块通过 `window.IWB*` 在运行时互相依赖)。 diff --git a/favicon.svg b/favicon.svg deleted file mode 100644 index 9337f2e..0000000 --- a/favicon.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/icon-192.png b/icon-192.png deleted file mode 100644 index e689d1c..0000000 Binary files a/icon-192.png and /dev/null differ diff --git a/icon-512.png b/icon-512.png deleted file mode 100644 index aa8cbba..0000000 Binary files a/icon-512.png and /dev/null differ diff --git a/manifest.webmanifest b/manifest.webmanifest deleted file mode 100644 index a7ed5bf..0000000 --- a/manifest.webmanifest +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "无限画布 Image Workbench", - "short_name": "无限画布", - "description": "本地优先的 AI 生图画布:节点式编排、提示词库、图库与画板管理", - "start_url": "/", - "scope": "/", - "display": "standalone", - "orientation": "any", - "background_color": "#0f1115", - "theme_color": "#2563eb", - "lang": "zh-CN", - "icons": [ - { "src": "icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" }, - { "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" }, - { "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }, - { "src": "favicon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any" } - ] -} diff --git a/package.json b/package.json index 2cdf48d..3cb57b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "image-workbench-web", "private": true, - "version": "3.26.103", + "version": "3.26.104", "description": "Browser-based node canvas image workbench", "scripts": { "build": "node scripts/build.js && node scripts/copy-plugins.js", diff --git a/scripts/build.js b/scripts/build.js index 2b1c94e..1b27bc2 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -212,11 +212,8 @@ const minifiedCss = transformSync(cssRaw, { }).code fs.writeFileSync(path.join(dist, 'style.css'), minifiedCss) -fs.copyFileSync(path.join(root, 'favicon.svg'), path.join(dist, 'favicon.svg')) -// PWA(2026-11-07):可安装 —— manifest + 图标(iOS 额外要 apple-touch-icon 的 PNG) -for (const f of ['manifest.webmanifest', 'icon-192.png', 'icon-512.png', 'apple-touch-icon.png']) { - fs.copyFileSync(path.join(root, f), path.join(dist, f)) -} +// 2026-11-26:PWA 安装面已移除(根目录 favicon/icon-*/apple-touch-icon/manifest 已删)。 +// sw.js 保留:它不只服务 PWA,还负责版本更新检测和 /__iwb_cache__ 图片缓存直出,删了会破图。 // 第三方许可随部署产物一起分发(MIT 要求随软件保留版权与许可声明) fs.copyFileSync(path.join(root, 'THIRD_PARTY_NOTICES.md'), path.join(dist, 'THIRD_PARTY_NOTICES.md')) fs.copyFileSync(path.join(root, 'vendor/react.production.min.js'), path.join(dist, 'vendor/react.production.min.js')) @@ -234,12 +231,7 @@ const html = ` 无限画布 - - - - - diff --git a/scripts/check-dist.js b/scripts/check-dist.js index 97f77ab..17fa50f 100644 --- a/scripts/check-dist.js +++ b/scripts/check-dist.js @@ -60,3 +60,12 @@ for (const key of ['version', 'packageVersion', 'commit']) { if (!meta[key] || String(meta[key]).length === 0) fail('dist/version.json.' + key + ' 为空') } pass('dist/version.json 的 version/packageVersion/commit 均非空') + +// 6. PWA 安装面已移除(2026-11-26):根图标/manifest 不再进 dist,也不能再被 index.html 引用。 +// sw.js 必须保留:它负责更新检测和 /__iwb_cache__ 图片直出,不是纯 PWA 安装面。 +for (const f of ['favicon.svg', 'manifest.webmanifest', 'icon-192.png', 'icon-512.png', 'apple-touch-icon.png']) { + if (fs.existsSync(path.join(dist, f))) fail('dist/' + f + ' 不应存在(PWA 安装面已移除)') + if (html.includes(f)) fail('dist/index.html 仍引用已删除的 ' + f) +} +if (!fs.existsSync(path.join(dist, 'sw.js'))) fail('dist/sw.js 必须保留(更新检测 + 图片缓存)') +pass('PWA 图标/manifest 未进 dist,index.html 无引用;sw.js 保留') diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5000ba4..7258991 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "image-workbench" -version = "3.26.103" +version = "3.26.104" description = "无限画布 · 生图工作台桌面版" authors = ["malongan"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9219dff..1a33aa4 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "image-workbench", - "version": "3.26.103", + "version": "3.26.104", "identifier": "com.malongan.imageworkbench", "build": { "frontendDist": "../dist",