Skip to content

Commit 9063613

Browse files
JusterZhuclaude
andcommitted
fix: address Copilot review comments — 5 items resolved
1. uninstall.ts: Replace 'as Exclude' type assertions with runtime narrowing via Array.filter() and control-flow type narrowing 2. bowl_notice.cs.template: BackupDirectory now points to previous version (not current version), preventing auto-restore failures 3. BUGS.md: Reconcile Core+Bowl conflict guidance — v10.5.0-beta.4 has no CS0433 conflict, Bowl is a standalone package 4. All 7 docs updated: remove 'Core+Bowl mutual exclusion' guidance, replace with 'no conflict, reference both' for v10.5.0-beta.4 5. cli/package.json: Clarify version is independent from skill version Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c3f6e8e commit 9063613

13 files changed

Lines changed: 54 additions & 47 deletions

File tree

.claude/scripts/generate/templates/bowl_notice.cs.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// ⚠️ Bowl 崩溃守护 — 使用 GeneralUpdate.Bowl,不单独引用 Core
1+
// ⚠️ Bowl 崩溃守护
22
// dotnet add package GeneralUpdate.Bowl
3+
// NuGet v10.5.0-beta.4: Bowl 与 Core 无类型冲突,可按需同时引用
34
// Refer to generalupdate-advanced/templates/BowlIntegration.cs for full example
45
var context = new GeneralUpdate.Bowl.BowlContext
56
{
@@ -9,7 +10,9 @@ var context = new GeneralUpdate.Bowl.BowlContext
910
DumpFileName = "{{CLIENT_VERSION}}_fail.dmp",
1011
FailFileName = "{{CLIENT_VERSION}}_fail.json",
1112
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail", "{{CLIENT_VERSION}}"),
12-
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "{{CLIENT_VERSION}}"),
13+
// BackupDirectory 必须指向前一版本的备份目录,而非当前版本
14+
// 例如当前版本为 {{CLIENT_VERSION}},备份来自上一版本的 BackupDirectory
15+
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "previous_version_backup"),
1316
WorkModel = "Upgrade",
1417
DumpType = GeneralUpdate.Bowl.DumpType.Mini,
1518
AutoRestore = true,

.claude/skills/generalupdate-advanced/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Console.WriteLine($"Result: Success={result.Success}, Restored={result.Restored}
157157
| `DumpType` | DumpType | Mini / Full | Full |
158158
| `OnCrash` | delegate | 崩溃回调 | null |
159159

160-
> ⚠️ Bowl 和 Core 不能同时引用(CS0433)。使用 Bowl 时**只引用 `GeneralUpdate.Bowl`**它传递依赖 Core 的所有功能
160+
> ⚠️ NuGet v10.5.0-beta.4 中 Bowl 和 Core **无类型冲突**可以同时引用
161161
162162
---
163163

@@ -332,7 +332,7 @@ var result = GeneralDrivelution.InstallDriver(driverPath);
332332
## ✅ 高级定制验证清单
333333

334334
### Bowl 崩溃守护
335-
- [ ] 只引用了 `GeneralUpdate.Bowl`不单独引用 Core
335+
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core``GeneralUpdate.Bowl`v10.5.0-beta.4 无冲突
336336
- [ ] `MonitorParameter``ProcessNameOrId` 与实际进程名匹配
337337
- [ ] `TargetPath` 设置为应用安装根目录,非子目录
338338
- [ ] `WorkModel` 根据场景选择 Correct(Normal/Upgrade)

.claude/skills/generalupdate-init/SKILL.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,10 @@ publish/
323323

324324
## ⚠️ 已知问题
325325

326-
### NuGet 类型冲突
327-
`GeneralUpdate.Core``GeneralUpdate.Bowl` **不能同时引用**(CS0433 类型冲突)。
328-
请根据需求选择:
326+
### NuGet 注意事项(v10.5.0-beta.4)
327+
`GeneralUpdate.Core``GeneralUpdate.Bowl` **可以同时引用**(v10.5.0-beta.4 中无 CS0433 冲突)。
329328
- 使用 Core:`dotnet add package GeneralUpdate.Core`
330-
- 使用 Bowl:**只引用** `GeneralUpdate.Bowl`它传递依赖 Core 所有功能
329+
- 使用 Bowl:`dotnet add package GeneralUpdate.Bowl`****传递依赖 Core,需要同时引用 Core
331330
- 差分类型已内嵌在 Core,**无需额外** `GeneralUpdate.Differential`
332331

333332
### 稳定版功能增强
@@ -354,7 +353,7 @@ v10.5.0-beta.4 新增以下功能:
354353

355354
### NuGet & 编译
356355
- [ ] Client 和 Upgrade 项目使用**完全相同**的 GeneralUpdate NuGet 版本
357-
- [ ] 如果用 Bowl:项目中只能有 `GeneralUpdate.Bowl`,不能同时有 `GeneralUpdate.Core`
356+
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core``GeneralUpdate.Bowl`(v10.5.0-beta.4 无冲突)
358357
- [ ] 项目能正常 `dotnet build`(0 errors)
359358
- [ ] 无需额外引用 `GeneralUpdate.Differential`(已嵌入 Core)
360359

@@ -376,14 +375,15 @@ v10.5.0-beta.4 新增以下功能:
376375

377376
| # | 反模式 | 后果 | 正确做法 |
378377
|---|--------|------|---------|
379-
| 1 | **Core 和 Bowl 引用到同一个项目** | CS0433 类型冲突,编译失败 | 用 Bowl 时只引 Bowl(传递依赖 Core) |
380-
| 2 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
381-
| 3 | **UpgradeApp.exe 不随首个版本发布** | 第一次更新时 FileNotFoundException | 首个版本就包含 UpgradeApp |
382-
| 4 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
383-
| 5 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
384-
| 6 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
385-
| 7 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
386-
| 8 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
378+
| 1 | **Core 和 Bowl NuGet 版本不一致** | 运行时 MethodNotFoundException | 使用相同 NuGet 版本 |
379+
| 2 | **Bowl 缺少 `GeneralUpdate.Core` 引用** | 编译失败,缺少 Core 类型 | Bowl 不传递依赖 Core,需同时引用 Core |
380+
| 3 | **Bowl 传递依赖 Core 的误解** | 编译失败 | v10.5.0-beta.4 中 Bowl 是独立包,需单独引用 Core |
381+
| 4 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
382+
| 5 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
383+
| 6 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
384+
| 7 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
385+
| 8 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
386+
| 9 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
387387

388388
---
389389

.claude/skills/generalupdate-init/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
| `GeneralUpdate.Extension` | 插件管理系统 | ❌ 可选 | net8.0;net10.0 | ≥ 10.5.0 |
1515
| `GeneralUpdate.Drivelution` | Windows 驱动更新 | ❌ 可选 | net8.0;net10.0 | 10.5.0-beta.4 |
1616

17-
> ⚠️ **NuGet 类型冲突**
17+
> ⚠️ **NuGet 注意事项**(v10.5.0-beta.4)
1818
> - `GeneralUpdate.Differential``DifferentialCore` 等类型已内嵌在 `GeneralUpdate.Core` 中,**不需额外引用**(直接使用 Core 即可)
19-
> - `GeneralUpdate.Bowl``GeneralUpdate.Core` **不能同时引用**两者都发布了 `GeneralUpdate.Common` 导致 CS0433
20-
> - 使用 Bowl **只引用 `GeneralUpdate.Bowl`**(它传递依赖 Core 的所有功能
19+
> - `GeneralUpdate.Bowl``GeneralUpdate.Core` **可以同时引用**v10.5.0-beta.4 中 Bowl 与 Core 无共用类型,不再冲突
20+
> - 使用 Bowl 时仍需引用 `GeneralUpdate.Bowl`(它****传递依赖 Core)
2121
2222
## UpdateRequest 字段完整说明
2323

.claude/skills/generalupdate-migration/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ await new GeneralUpdateBootstrap()
118118
### 编译验证
119119
- [ ] `dotnet build` 无错误
120120
- [ ]`MissingMethodException` 的风险(检查所有方法名是否存在于 v10.4.6)
121-
- [ ]`CS0433` 类型冲突(Core + Bowl 不同时引用
121+
- [ ]`CS0433` 类型冲突(v10.5.0-beta.4 中 Core + Bowl 无冲突,可同时引用
122122

123123
### 架构验证
124124
- [ ] 项目已拆分为 Client + Upgrade 两个独立项目

RULES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
## NuGet Package Rules
2323
- Core only: `dotnet add package GeneralUpdate.Core --version 10.5.0-beta.4`
24-
- With Bowl: **reference only** `GeneralUpdate.Bowl` (transitively includes Core, the two conflict)
24+
- With Bowl: reference **both** `GeneralUpdate.Core` and `GeneralUpdate.Bowl` (v10.5.0-beta.4: Bowl is standalone, no type conflict)
2525
- Differential: types are **embedded in Core**, no extra package needed
2626
- Extension, Drivelution: standalone, no conflicts
2727

cli/assets/scripts/generate/templates/bowl_notice.cs.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// ⚠️ Bowl 崩溃守护 — 使用 GeneralUpdate.Bowl,不单独引用 Core
1+
// ⚠️ Bowl 崩溃守护
22
// dotnet add package GeneralUpdate.Bowl
3+
// NuGet v10.5.0-beta.4: Bowl 与 Core 无类型冲突,可按需同时引用
34
// Refer to generalupdate-advanced/templates/BowlIntegration.cs for full example
45
var context = new GeneralUpdate.Bowl.BowlContext
56
{
@@ -9,7 +10,9 @@ var context = new GeneralUpdate.Bowl.BowlContext
910
DumpFileName = "{{CLIENT_VERSION}}_fail.dmp",
1011
FailFileName = "{{CLIENT_VERSION}}_fail.json",
1112
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail", "{{CLIENT_VERSION}}"),
12-
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "{{CLIENT_VERSION}}"),
13+
// BackupDirectory 必须指向前一版本的备份目录,而非当前版本
14+
// 例如当前版本为 {{CLIENT_VERSION}},备份来自上一版本的 BackupDirectory
15+
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "previous_version_backup"),
1316
WorkModel = "Upgrade",
1417
DumpType = GeneralUpdate.Bowl.DumpType.Mini,
1518
AutoRestore = true,

cli/assets/skills/generalupdate-advanced/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Console.WriteLine($"Result: Success={result.Success}, Restored={result.Restored}
157157
| `DumpType` | DumpType | Mini / Full | Full |
158158
| `OnCrash` | delegate | 崩溃回调 | null |
159159

160-
> ⚠️ Bowl 和 Core 不能同时引用(CS0433)。使用 Bowl 时**只引用 `GeneralUpdate.Bowl`**它传递依赖 Core 的所有功能
160+
> ⚠️ NuGet v10.5.0-beta.4 中 Bowl 和 Core **无类型冲突**可以同时引用
161161
162162
---
163163

@@ -332,7 +332,7 @@ var result = GeneralDrivelution.InstallDriver(driverPath);
332332
## ✅ 高级定制验证清单
333333

334334
### Bowl 崩溃守护
335-
- [ ] 只引用了 `GeneralUpdate.Bowl`不单独引用 Core
335+
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core``GeneralUpdate.Bowl`v10.5.0-beta.4 无冲突
336336
- [ ] `MonitorParameter``ProcessNameOrId` 与实际进程名匹配
337337
- [ ] `TargetPath` 设置为应用安装根目录,非子目录
338338
- [ ] `WorkModel` 根据场景选择 Correct(Normal/Upgrade)

cli/assets/skills/generalupdate-init/SKILL.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,10 @@ publish/
323323

324324
## ⚠️ 已知问题
325325

326-
### NuGet 类型冲突
327-
`GeneralUpdate.Core``GeneralUpdate.Bowl` **不能同时引用**(CS0433 类型冲突)。
328-
请根据需求选择:
326+
### NuGet 注意事项(v10.5.0-beta.4)
327+
`GeneralUpdate.Core``GeneralUpdate.Bowl` **可以同时引用**(v10.5.0-beta.4 中无 CS0433 冲突)。
329328
- 使用 Core:`dotnet add package GeneralUpdate.Core`
330-
- 使用 Bowl:**只引用** `GeneralUpdate.Bowl`它传递依赖 Core 所有功能
329+
- 使用 Bowl:`dotnet add package GeneralUpdate.Bowl`****传递依赖 Core,需要同时引用 Core
331330
- 差分类型已内嵌在 Core,**无需额外** `GeneralUpdate.Differential`
332331

333332
### 稳定版功能增强
@@ -354,7 +353,7 @@ v10.5.0-beta.4 新增以下功能:
354353

355354
### NuGet & 编译
356355
- [ ] Client 和 Upgrade 项目使用**完全相同**的 GeneralUpdate NuGet 版本
357-
- [ ] 如果用 Bowl:项目中只能有 `GeneralUpdate.Bowl`,不能同时有 `GeneralUpdate.Core`
356+
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core``GeneralUpdate.Bowl`(v10.5.0-beta.4 无冲突)
358357
- [ ] 项目能正常 `dotnet build`(0 errors)
359358
- [ ] 无需额外引用 `GeneralUpdate.Differential`(已嵌入 Core)
360359

@@ -376,14 +375,15 @@ v10.5.0-beta.4 新增以下功能:
376375

377376
| # | 反模式 | 后果 | 正确做法 |
378377
|---|--------|------|---------|
379-
| 1 | **Core 和 Bowl 引用到同一个项目** | CS0433 类型冲突,编译失败 | 用 Bowl 时只引 Bowl(传递依赖 Core) |
380-
| 2 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
381-
| 3 | **UpgradeApp.exe 不随首个版本发布** | 第一次更新时 FileNotFoundException | 首个版本就包含 UpgradeApp |
382-
| 4 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
383-
| 5 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
384-
| 6 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
385-
| 7 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
386-
| 8 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
378+
| 1 | **Core 和 Bowl NuGet 版本不一致** | 运行时 MethodNotFoundException | 使用相同 NuGet 版本 |
379+
| 2 | **Bowl 缺少 `GeneralUpdate.Core` 引用** | 编译失败,缺少 Core 类型 | Bowl 不传递依赖 Core,需同时引用 Core |
380+
| 3 | **Bowl 传递依赖 Core 的误解** | 编译失败 | v10.5.0-beta.4 中 Bowl 是独立包,需单独引用 Core |
381+
| 4 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
382+
| 5 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
383+
| 6 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
384+
| 7 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
385+
| 8 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
386+
| 9 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
387387

388388
---
389389

cli/assets/skills/generalupdate-init/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
| `GeneralUpdate.Extension` | 插件管理系统 | ❌ 可选 | net8.0;net10.0 | ≥ 10.5.0 |
1515
| `GeneralUpdate.Drivelution` | Windows 驱动更新 | ❌ 可选 | net8.0;net10.0 | 10.5.0-beta.4 |
1616

17-
> ⚠️ **NuGet 类型冲突**
17+
> ⚠️ **NuGet 注意事项**(v10.5.0-beta.4)
1818
> - `GeneralUpdate.Differential``DifferentialCore` 等类型已内嵌在 `GeneralUpdate.Core` 中,**不需额外引用**(直接使用 Core 即可)
19-
> - `GeneralUpdate.Bowl``GeneralUpdate.Core` **不能同时引用**两者都发布了 `GeneralUpdate.Common` 导致 CS0433
20-
> - 使用 Bowl **只引用 `GeneralUpdate.Bowl`**(它传递依赖 Core 的所有功能
19+
> - `GeneralUpdate.Bowl``GeneralUpdate.Core` **可以同时引用**v10.5.0-beta.4 中 Bowl 与 Core 无共用类型,不再冲突
20+
> - 使用 Bowl 时仍需引用 `GeneralUpdate.Bowl`(它****传递依赖 Core)
2121
2222
## UpdateRequest 字段完整说明
2323

0 commit comments

Comments
 (0)