Repository navigation
Description
背景
#3 の依存ライブラリ更新のうち、ほかのパッケージのリリース待ちで止まっている残りの作業です。
作業
prettier-plugin-astro 0.14.1 → 1.x
- 待っているもの:
.astroのクラス並べ替えを v1 に対応させる修正(fix: support prettier-plugin-astro v1 tailwindlabs/prettier-plugin-tailwindcss#473)を含む prettier-plugin-tailwindcss のリリース- #473 は 2026-09-29 にマージ済みですが、2026-11-02 時点の最新は 0.8.1(2026-07-15 リリース)で、まだ含まれていません(試験版の insiders 版にしか入っていません)
- prettier-plugin-astro 1.1.2 と prettier-plugin-tailwindcss 0.8.1 の組み合わせでは、
.astroのクラスが並べ替えられないことを確認済み(prettier-plugin-tailwindcssを0.8.1に更新 (#3 Step 2) #7)
- #473 を含む prettier-plugin-tailwindcss に更新する
- prettier-plugin-astro を 1.x に更新する
-
.prettierrc.mjsにastroCompressHTML: trueを追加する(astro.config.mjsのcompressHTML: trueに合わせる。v1 の CHANGELOG より) - 更新前後で全ファイルの Prettier の出力を比べ、クラスの並べ替えが動くことと、意図しない差分がないことを確認する
TypeScript 5.9 → 6
@astrojs/check 0.9.12 の peer は typescript: ^5.0.0 || ^6.0.0 なので、TypeScript 6 には今すぐ更新できます。
- TypeScript を 6.x に更新する(TypeScript を 5.9 から 6.0 に更新する (#8) #25)
-
pnpm run build(astro checkを含む)が通ることを確認する
TypeScript 6 → 7
@astrojs/check の TypeScript 7 対応は、来ない見込みです(2026-11-02 時点で @astrojs/check は 0.9.12 のまま)。
-
astro checkを TypeScript 7 で実行すると、「TypeScript 7 には対応していないので TypeScript 6 を使ってほしい」というエラーになる(fix(check): explain TypeScript 7 support withastro/astro#18053) -
そのエラーメッセージによると、
astro checkは今後のリリースで非推奨になる予定 -
代わりに、
@astrojs/ts-content-mapper(2026-11-02 時点で 0.2.0)を入れてtscで型チェックする方式が、試験的に用意されている。この方式には TypeScript 7.1 以上が必要 -
待っているもの: TypeScript 7.1 の正式版(2026-11-02 時点で正式版の最新は 7.0.2、7.1 はベータ版)
-
参考: astro/check thinks typescript is not installed when using TypeScript 7 withastro/astro#17268
-
TypeScript 7.1 の正式版が出たら、
@astrojs/ts-content-mapperを入れ、astro checkからtscでの型チェックに切り替える -
TypeScript を 7 に更新する
-
package.jsonのbuildスクリプト(astro check && astro build)と、AGENTS.mdの「pnpm run build(astro checkを含む)」の記述を、切り替え後の形に合わせる -
pnpm run buildが通り、CI(.github/workflows/ci.yml)も通ることを確認する
確認方法
リリースされたかどうかは、次のコマンドで確認できます。
pnpm outdated
npm view prettier-plugin-tailwindcss version
npm view typescript dist-tags
npm view @astrojs/ts-content-mapper version
Activity