示例工程 55-installers-and-channels

55-installers-and-channels/app/README.md

markdown · 1.4 KB

# 55-installers-and-channels / app

渠道与安装器矩阵:8 个分发渠道(直下/GitHub/MAS/Store/Flathub/Snap/AUR/Homebrew)、
9 种安装器的安装位置/卸载/静默/残留,以及 4 个场景的渠道建议。

## 运行

```bash
pnpm --filter @tutorial/55-installers-and-channels-app start
pnpm --filter @tutorial/55-installers-and-channels-app smoke
pnpm --filter @tutorial/55-installers-and-channels-app shots
```

## smoke 输出

```json
{"evt":"smoke","ok":true,"score":100,"checks":10,"passed":10,
 "channels":8,"installers":9,"storeOff":true,"directOn":true,
 "enterpriseArtifact":"msi / pkg","personalChannel":"direct",
 "storeMac":"mas","storeLinux":"flathub","decisions":4}
```

## 结构

- `shared/channels.ts`:渠道、安装器与 `recommend` 纯函数
- `main/index.ts`:场景计算与 10 项自检
- `src/App.ts`:渠道表、安装器表、场景建议

## testid

| testid | 用途 |
| --- | --- |
| `score` / `channel-count` | 自检与渠道数 |
| `channels` / `channel-row` | 8 个渠道 |
| `installers` / `installer-row` | 9 种安装器 |
| `decisions` / `decision-row` | 4 个场景建议 |
| `checks` / `events` | 自检与日志 |

## 已知限制

- 渠道审核时长与费用以官方页面为准,正文不写死。
- 商店沙箱与安装器静默参数只给常见值,未逐平台实机验证。
- 建议函数是演示逻辑,不覆盖多平台同时发布。