Commit 39a2715
fix: playwright chromium should use playwright mirror, not chrome-for-testing (#71)
## 背景
#67 新增了 `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST =
https://cdn.npmmirror.com/binaries/chrome-for-testing`,用于适配 playwright
1.58 起 chromium 改走 CFT。当时演示通过,是因为 **playwright 1.58.0** 的 `cftUrl` 路径是
`{browserVersion}/{platform}/...`,恰好命中 npmmirror 的 chrome-for-testing
布局。
但这个指向随后失效,且误伤了老版本:
| playwright | chromium 下载路径 | 需要的 host |
|---|---|---|
| ≤ 1.57.x | `builds/chromium/{rev}/chromium-mac-arm64.zip` |
`binaries/playwright` |
| 1.58.0 | `{browserVersion}/mac-arm64/chrome-mac-arm64.zip` |
`binaries/chrome-for-testing` ← #67 只对这一版对 |
| 1.58.1+ | `builds/cft/{browserVersion}/mac-arm64/chrome-mac-arm64.zip`
| `binaries/playwright` |
两个问题:
1. **playwright 1.58.1** 把 CFT 路径从 `{version}/...` 改成了
`builds/cft/{version}/...`,`chrome-for-testing` 指向随之 404。
2. **≥1.52 的所有版本都读 `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST`**(chromium
优先用它、再回退 `PLAYWRIGHT_DOWNLOAD_HOST`),所以该指向把 ≤1.57 也打挂了 —— `ut i` 装
playwright 1.57 直接 `NoSuchKey` 404。
## 改动
删除 `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST`,让 chromium 回退到
`PLAYWRIGHT_DOWNLOAD_HOST`(= `binaries/playwright`),与 firefox/webkit
一致。cnpmcore 的 `PlaywrightBinary` 无论老 `builds/chromium` 还是新 `builds/cft`
都发布在 `binaries/playwright` 下,故这是唯一对所有版本都成立的 host。
> 注:1.58+ 能真正下载还依赖 cnpmcore 把 `builds/cft/` 产物同步落盘(另有独立修复,见 cnpmcore 侧
PR)。本 PR 先修复 ≤1.57 的回归。
`npm test` 通过(8/8)。
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/cnpm/binary-mirror-config/71)
<!-- Reviewable:end -->
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5afdc1c commit 39a2715
2 files changed
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
| |||
248 | 247 | | |
249 | 248 | | |
250 | 249 | | |
251 | | - | |
252 | 250 | | |
253 | 251 | | |
254 | 252 | | |
| |||
344 | 342 | | |
345 | 343 | | |
346 | 344 | | |
347 | | - | |
348 | 345 | | |
349 | 346 | | |
350 | 347 | | |
| |||
0 commit comments