chore: upgrade astro to v7 and playwright to 1.61.1 - #169
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades Astro to v7 (plus Playwright/Vitest) and adapts the site build pipeline to remain stable under the new toolchain, including improved Markdown rendering behavior and cover generation reliability.
Changes:
- Upgraded key dependencies (Astro 7, Vitest 4, Playwright 1.61.1) and removed the obsolete Playwright-core patch / Vite override.
- Updated Astro Markdown config to keep the unified remark/rehype pipeline, added throttling for Mermaid rendering, and introduced GitHub-style callout rendering via a local rehype plugin.
- Improved cover generation stability by sharing a Playwright browser context (cache reuse) and adding retry logic.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/rehype-callouts.mjs | New rehype plugin to convert GitHub-style callout blockquotes into structured callout markup. |
| src/utils/locale.test.ts | Updates a Vitest assertion style for compatibility with newer Vitest. |
| src/utils/cover.ts | Switches cover rendering to use a shared BrowserContext and ensures pages are closed via finally. |
| src/pages/[slug].astro | Adds styles for rendered callouts (light/dark). |
| src/pages/[lang]/[...slug]/cover.png.ts | Adds retry logic and reuses a shared Playwright context during static path generation. |
| src/content.config.ts | Updates Zod import to astro/zod per Astro 7 changes. |
| patches/playwright-core@1.48.2.patch | Removes the no-longer-needed Playwright-core patch. |
| package.json | Dependency upgrades and pnpm config updates (peer rules, removed patched deps). |
| astro.config.mjs | Migrates Markdown processing to unified pipeline, adds Mermaid concurrency gating, enables compressHTML, and wires in callouts plugin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
xiaoyijun
temporarily deployed
to
cloudflare-pages
July 5, 2026 01:24 — with
GitHub Actions
Inactive
Deploying auth-wiki with
|
| Latest commit: |
07b8d09
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e61aeb7f.auth-wiki.pages.dev |
| Branch Preview URL: | https://xiaoyijun-chore-upgrade-astr.auth-wiki.pages.dev |
xiaoyijun
temporarily deployed
to
cloudflare-pages
July 5, 2026 01:44 — with
GitHub Actions
Inactive
xiaoyijun
temporarily deployed
to
cloudflare-pages
July 5, 2026 02:12 — with
GitHub Actions
Inactive
wangsijie
approved these changes
Jul 6, 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.
Summary
Upgrade Astro from 5.16.5 to 7.0.6 (across two majors) along with related tooling, and fix the build stability issues surfaced by the upgrade.
Dependency upgrades
astro5.16.5 → 7.0.6,@astrojs/mdx4.3.13 → 7.0.2,@astrojs/markdown-remark6.3.10 → 7.2.1,@astrojs/sitemap3.6.0 → 3.7.3,@astrojs/check0.9.6 → 0.9.9vitest/@vitest/coverage-v83.2.4 → 4.1.9 (required for Vite 8)playwright1.48.2 → 1.61.1, dropping theplaywright-corepatch since the insecurecurl -kusage was fixed upstreamvitepnpm override; addedpeerDependencyRulesforastro-i18n-aut/@astrolib/seo(their hooks and APIs work fine on Astro 7, they just haven't updated peer ranges)Astro 7 adaptations
markdown.processor: unified({...})since rehype-mermaid, remark-custom-header-id, and the footnote label option depend on itcompressHTML: trueto keep the pre-v7 HTML-aware whitespace behavior (the new'jsx'default strips spaces between inline elements)zfromastro/zodinstead of the deprecatedastro:contentexportBuild stability fixes
browser.newPage()created an isolated context per cover, re-downloading Google Fonts assets for every one of ~1070 covers, which eventually hit rate limiting and timed out the build. A shared context reuses the HTTP cache; full build now completes in ~3.5 minutes.New: GitHub-style callouts
> [!Note]blockquotes were rendered as literal text (also on production). A small local rehype plugin now renders them as styled callouts, using the bracketed keyword as the title so localized markers ([!注意],[!Hinweis],[!Nota], …) work without a keyword whitelist. Styled for both light and dark modes.Verification
astro check0 errors; all unit tests pass/en/*redirect stubs, sitemap (897 URLs, default locale unprefixed), 872 covers, Mermaid light/dark SVGs, Shiki dual themes, custom heading anchors, footnotesenandzhpages after normalizing Astro scope hashes)Supersedes #150, #158, #164, #166, #168.
Testing
Tested locally; unit tests added for the callout rehype plugin.
Checklist
.changeset