fix(deps): upgrade astro to v7 and migrate content collections - #20
Merged
Conversation
Renovate could not land astro v7 (#18, a security update) or @astrojs/mdx v7 (#17): both only edited docs/package.json and failed the renovate/artifacts check because regenerating package-lock.json requires code changes that Renovate cannot make. astro v6 removed legacy content collections, so the build fails with LegacyContentConfigError until the Content Layer API migration is done: - src/content/config.ts -> src/content.config.ts - type: content -> loader: glob({ base, pattern }) - entry.slug -> entry.id - await entry.render() -> await render(entry) Collection ids resolve to the same values the old slugs had, so every generated URL is unchanged (verified against the build output). Also bumps CI node 20 -> 24 (supersedes #16). astro v7 requires Node 20.19+/22.12+/24+, and docs.yml/import.yml only run on push to main, so that bump was never exercised by PR CI on its own. Supersedes #16, #17 and #18.
This was referenced Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Renovate が自力で処理できなかった 3 件をまとめて解決します。
renovate/artifacts失敗renovate/artifacts失敗#17 / #18 は
docs/package.jsonだけを書き換えてpackage-lock.jsonの再生成に失敗していました。原因は astro v6 の破壊的変更にコード修正が必要で、Renovate にはそれができないためです。セキュリティ
#18 は Astro の
define:varsを使った<script>に SSR でリクエスト由来の値を渡すと、</Script>の大文字小文字を無視したマッチでスクリプトブロックが閉じられ XSS が成立する脆弱性の修正です。優先して取り込むべき更新です。Content Layer API への移行
astro v6 で legacy content collections が削除され、
LegacyContentConfigErrorでビルドが落ちます。src/content/config.ts→src/content.config.tstype: content→loader: glob({ base, pattern })entry.slug→entry.idawait entry.render()→await render(entry)URL は変わりません。 glob loader の
idは旧slugと同じ値に解決されるため、生成物のパスは同一です(ビルド出力で確認済み)。node 24
astro v7 の要求は Node 20.19+/22.12+/24+。#16 単体では
docs.yml/import.ymlが push トリガーのみで PR CI に出てこないため未検証でしたが、本 PR ではローカルで node 24 実行のビルドを通しています。テスト計画
npm installでロックファイル再生成(astro 7.1.3 / @astrojs/mdx 7.0.3)npm run build成功/contracts/{employment-contract-sample,nda-sample,service-agreement-sample}//regulations/{attendance-policy,caregiver-leave-policy,expense-policy,security-policy,work-rules}-sample/関連
Supersedes #16, #17, #18.