fix(update): 更新检查改查本仓 Gitea,修复查不到新版 (v0.5.3-local.6)

本仓从上游 fork 后,更新检查仍查上游 GitHub,导致:
- 上游只发官方版(无本地补丁),本仓 -local.* 版本它不知道
- 国内网络访问 api.github.com 常失败,显示「上次检查未成功」
- 安装命令也指向上游 github.com

三处改动:
- updateCheck.ts(控制室):改为 Gitea API /api/v1/repos/xiaoqu/dsh-worktable/releases/latest
- index.tsx(设置面板,独立实现):同样改 Gitea API
- hostTransport.ts:安装命令改为带具体 tag 的本仓 tgz

注意 Gitea 不支持 /releases/latest/download 简写(实测 404),
安装命令必须带具体 tag,UPDATE_TGZ 每次发版需同步更新。

版本比较无需改动:cmpVer('v0.5.2-local.6','0.5.3-local.5') = -1,
core 段 0.5.2 < 0.5.3 已能正确判定有新版。

测试同步:sidebar-popup.test.mjs 的 releaseUrl 断言改为新 API 地址。

验证:npm run pack 全绿,双资产同源 sha256 95b2b6b1…。
This commit is contained in:
wangheng
2026-12-02 17:00:56 +08:00
parent 61711299ec
commit f65694516f
10 changed files with 76 additions and 29 deletions
+2 -1
View File
@@ -304,7 +304,8 @@ function testConsolePresentation() {
}
async function testUpdatePresentation() {
const releaseUrl = 'https://api.github.com/repos/Aisland-SJL/dsh-worktable/releases/latest'
// 更新源是本仓 Gitea(内部补丁分发仓),不是上游 GitHub
const releaseUrl = 'https://gitea.ququclean.com/api/v1/repos/xiaoqu/dsh-worktable/releases/latest'
for (const outcome of ['older', 'same', 'forbidden', 'invalid', 'invalid-prefix', 'skip']) {
let response = { status: 200, tag: 'v9.0.0' }
let requests = 0