Skip to content

chore: upgrade Astro 5 to Astro 6#159

Merged
masuP9 merged 4 commits intomainfrom
chore/astro6-upgrade
Mar 14, 2026
Merged

chore: upgrade Astro 5 to Astro 6#159
masuP9 merged 4 commits intomainfrom
chore/astro6-upgrade

Conversation

@masuP9
Copy link
Copy Markdown
Owner

@masuP9 masuP9 commented Mar 14, 2026

Summary

  • Upgrade Astro from v5.18.0 to v6.0.4 with all official integrations (MDX v5, React v5, Svelte v8, Vue v6)
  • Migrate Vite config for Vite 7 (rollupOptionsenvironments.client.build, ESM compatibility fixes)
  • Update Node.js requirement to >=22.12.0 and CI to Node 22
  • Migrate z import to astro/zod and Astro.site to import.meta.env.SITE

Breaking Changes Addressed

  • vite.build.rollupOptionsvite.environments.client.build.rollupOptions (Vite 7)
  • import { z } from 'astro:content'import { z } from 'astro/zod' (Astro 6)
  • Astro.siteimport.meta.env.SITE (Astro 6 deprecation)
  • Node.js >=22.12.0 required (Astro 6 requirement)

Additional Fixes (not in original plan)

  • lucide-svelte ESM workaround: Added resolve.alias to fix extensionless internal imports that fail with Tailwind's ESM cache loader in Vite 7 (marked as WORKAROUND with TODO for upstream fix)
  • Vitest 4.0.16 → 4.1.0: Required for Vite 7 CJS interop fix (cookie package exports is not defined error)

Test plan

  • npm run build passes with no errors
  • npm run lint:astro — 0 errors, 0 warnings
  • npm run lint:types — passes
  • npm run test:react — 29 files, 1257 tests passed
  • npm run test:vue — 23 files, 700 tests passed
  • npm run test:svelte — 23 files, 667 tests passed
  • npm run test:astro — 6 files, 144 tests passed
  • Chunk splitting verified (react-vendor, vue-vendor, svelte-vendor)
  • getStaticPaths params verified as string type in all 8 files
  • E2E tests pass on CI with Node 22
  • GitHub Pages deploy succeeds

🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 14, 2026

Deploying apg-patterns-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2196b43
Status: ✅  Deploy successful!
Preview URL: https://da5c7105.apg-patterns-examples.pages.dev
Branch Preview URL: https://chore-astro6-upgrade.apg-patterns-examples.pages.dev

View logs

masuP9 and others added 4 commits March 15, 2026 01:47
- Upgrade astro to v6.0.4 with all official integrations (@astrojs/mdx v5,
  @astrojs/react v5, @astrojs/svelte v8, @astrojs/vue v6)
- Migrate vite.build.rollupOptions to vite.environments.client.build for Vite 7
- Migrate z import from astro:content to astro/zod (Astro 6 requirement)
- Migrate Astro.site to import.meta.env.SITE in BaseLayout
- Update CI Node.js version from 20 to 22 across all 7 jobs
- Update engines.node to >=22.12.0
- Update Vitest 4.0.16 to 4.1.0 for Vite 7 CJS interop fix
- Add resolve.alias workaround for lucide-svelte ESM compatibility with
  Vite 7's Tailwind ESM cache loader

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous lock file was generated with --legacy-peer-deps which
caused missing entries (vue-eslint-parser, eslint-visitor-keys),
failing npm ci in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix Prettier formatting in astro.config.mjs
- Add .node-version (22) so Cloudflare Pages uses Node 22 instead of
  the default Node 20, which is required by Astro 6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align with local development environment (v24.12.0).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@masuP9 masuP9 force-pushed the chore/astro6-upgrade branch from 40541fa to 2196b43 Compare March 14, 2026 16:47
@masuP9 masuP9 merged commit bc8e358 into main Mar 14, 2026
17 checks passed
@masuP9 masuP9 deleted the chore/astro6-upgrade branch March 14, 2026 16: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