Skip to content

升級 starter 鎖定的套件:astro 7.4.1、@astrojs/language-server 2.17.2,移除 canvaskit-wasm - #204

Merged
shyuan merged 1 commit into
mainfrom
deps-starter-pins
Oct 20, 2026
Merged

shyuan merged 1 commit into
mainfrom
deps-starter-pins

Conversation

@shyuan

@shyuan shyuan commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

背景

astro、@astrojs/language-server、canvaskit-wasm 的版本是 Nimbus starter 帶進來的。最新 starter(templates-v0.7.13)仍鎖在相同版本:

  • astro 7.3.1:Nimbus 自身開發用的版本,peer 範圍為 >=7.2.6 <8.0.0
  • @astrojs/language-server 2.16.13:上游 ae88945f 因 2.17.0 解析錯誤而暫時鎖定
  • canvaskit-wasm ^0.41.1:本站程式沒有使用,astro-og-canvas 用的是自己巢狀的 0.42.0

變更

  • astro 7.3.1 → 7.4.1
  • @astrojs/language-server 2.16.13 → 2.17.2。@astrojs/check 0.9.11 原本就巢狀使用 2.17.2,這裡改成只留一份。
  • 移除 canvaskit-wasm
  • bun.lock:把 vite 統一為 8.3.4。原本 lock 有 8.3.3 和 8.3.4 兩份,會讓 astro.config.ts 出現 Plugin<any>[] 型別錯誤。重新解析時,一些間接相依也升了 patch 版本。

驗證

  • lint:text、lint、format:check、typecheck(104 files, 0 errors)、build、lint:docs 和 nimbus-docs check 都通過。
  • 和 astro 7.3.1 的 build 比對:
    • 檔案數相同,都是 913 個;
    • 96 張 OG 圖逐 byte 相同;
    • HTML、md、txt 除了資源 hash 和 generator 版本字串以外沒有差異;
    • build 的 96 條 MODULE_LEVEL_DIRECTIVE 警告消失了。
  • 用 headless Chromium 做冒煙測試,結果與 7.3.1 一致:ClientRouter 換頁、GA page_view 次數、深淺色切換、搜尋、YouTube embed 和返回上一頁都正常,console 沒有錯誤。

generated by Claude Code

…skit-wasm

- astro 7.3.1 → 7.4.1(build 的 MODULE_LEVEL_DIRECTIVE 警告消失)
- @astrojs/language-server 2.16.13 → 2.17.2(@astrojs/check 0.9.11 原本就巢狀使用 2.17.2,改為單一份)
- 移除未使用的 canvaskit-wasm(astro-og-canvas 使用自己的 0.42.0)
- 重新解析 vite 為單一份 8.3.4,避免兩份 vite 造成 astro.config.ts 型別錯誤

generated by Claude Code
@shyuan

shyuan commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Code Review 結果

總結:沒有發現 bug。 這個 PR 也把 #203 遺留的 follow-up 處理掉了,而且驗證特別確實(build 對 build 的差異比對加上 headless 瀏覽器冒煙測試)。CI 已綠(Build + Code standards)。

已驗證項目

  • 移除 canvaskit-wasm 是安全的。 新的 lockfile 裡 [email protected] 還在——只是從嵌套的 astro-og-canvas/canvaskit-wasm 條目提升到頂層。原本直接宣告的 ^0.41.1 正是逼出嵌套副本的原因(astro-og-canvas 要 ^0.42.0,^0.41.1 永遠滿足不了),移除它簡化了樹、也沒有改變 OG 渲染實際用的版本。這與 96 張 OG 圖逐 byte 相同的結果一致。
  • [email protected] 滿足框架的 peer 範圍。 lockfile 確認 @cloudflare/nimbus-docs 的 peer 是 astro: ">=7.2.6 <8.0.0",與 PR 描述完全一致;astro-og-canvas(重解析時 0.13.0 → 0.13.2,在 ^0.13.0 範圍內)peer 是 ^7.0.0,也相容。
  • 升級開發工具小版本:@astrojs/check、eslint、prettier、typescript-eslint、wrangler 等 #203 的 language-server 分歧已解決。 頂層 @astrojs/language-server 現在是 2.17.2,@astrojs/check 底下的嵌套條目消失——回到只有一份,編輯器與 astro check 用同一版。
  • vite 統一為 8.3.4(單一頂層條目),與「原本 8.3.3 / 8.3.4 兩份造成 astro.config.ts 的 Plugin<any>[] 型別錯誤」的說法吻合。
  • 間接相依的大版本跳號都是父套件驅動,不是亂升。 obug 3、tinyclip 1、unifont 1.0.3、es-module-lexer 3.0.4、vscode-jsonrpc 9 / protocol 3.18.4 都能追溯到 [email protected]、@astrojs/[email protected] 和 mdx 宣告的範圍;bun 要滿足每個父套件的範圍才裝得起來。消失的 js-yaml / ohash / find-proc 則是隨舊版 astro 離開樹的依賴。astro、astro-eslint-parser 底下的 @astrojs/compiler-rs 嵌套副本是精確 pin 的版本分裂,屬正常 bun 行為。
  • 精確 pin 的慣例有保留。 astro 和 @astrojs/language-server 都維持精確版本(沒有 caret),與 starter 原本的做法一致。

備註(不擋 merge)

  1. MODULE_LEVEL_DIRECTIVE 警告消失是 build log 的改善,不是行為變更——之後若有人用警告數量比對 CI log,知道這件事即可。
  2. astro-og-canvas 順著重解析從 0.13.0 升到 0.13.2,在既有 ^0.13.0 範圍內;OG 圖逐 byte 比對正好覆蓋了這個風險。

沒有 merge 前需要處理的問題。

🚩 Generated by OpenCode

@shyuan
shyuan merged commit 7865fb3 into main Oct 20, 2026
2 checks passed
@shyuan
shyuan deleted the deps-starter-pins branch October 20, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant