Skip to content

Upgrade to Astro 6 with Content Layer API migration#44

Open
devin-ai-integration[bot] wants to merge 7 commits into
mainfrom
devin/1776029038-upgrade-astro-v6
Open

Upgrade to Astro 6 with Content Layer API migration#44
devin-ai-integration[bot] wants to merge 7 commits into
mainfrom
devin/1776029038-upgrade-astro-v6

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrades Astro from 5.17.2 to 6.1.5 with full Content Layer API migration, plus adds @astrojs/check and typescript for type checking.

Astro 6 Migration

  • Migrated content collections to Content Layer API with glob() loaders (src/content.config.ts)
  • Replaced entry.slugentry.id and entry.render()render(entry) throughout
  • Updated Zod schemas for Zod 4 (z.string().url()z.url(), removed .step())
  • Added .nvmrc and NODE_VERSION=22 in netlify.toml (Astro 6 requires Node 22)
  • Derived file extensions from entry.filePath for nav prompt (preserves .md, .org, etc.)

Type Checking

  • Added @astrojs/check and typescript as dev dependencies
  • Fixed all 13 pre-existing type errors caught by astro check:
    • verbatimModuleSyntax: use type-only imports for CollectionEntry
    • Optional body: handle body?: string in Content Layer API
    • astro-icon: spread typed props to avoid v0.x/v1.x type mismatch
    • og_image.tsx: wrap Buffer in Uint8Array for Response constructor
    • [project].astro: rename import to avoid conflict with local declaration

Review & Testing Checklist for Human

  • Verify deploy preview renders identically to live site: https://deploy-preview-44--davish-site.netlify.app
  • Check nav prompt shows file extensions (e.g. markov-ideas.md) — this is an intentional change
  • Spot-check blog post links, TIL links, reading entries, and RSS feed for correct URLs (no /undefined)
  • Consider running npx astro check locally to verify type checking works in your environment

Notes

  • The astro-icon package uses the v0.x runtime API (pack/name props) but ships v1.x types — worked around with typed spread props rather than migrating the Icon usage (which would require adding the icon() integration to astro.config.mjs)
  • Netlify uses pnpm, so pnpm-lock.yaml was updated alongside package-lock.json

Link to Devin session: https://app.devin.ai/sessions/79c3ab22e9a1430db50a92123c2c309c
Requested by: @davish


Open with Devin

- Bump astro from ^5.17.2 to ^6.1.5
- Bump @astrojs/react from ^4.4.2 to ^5.0.3
- Bump @astrojs/rss from ^4.0.15 to ^4.0.18
- Migrate content collections from legacy to Content Layer API with glob loaders
- Move collection definitions to src/content.config.ts
- Update Zod schemas for Zod 4 (z.string().url() -> z.url(), remove .step())
- Replace entry.slug with entry.id throughout codebase
- Replace entry.render() with imported render() from astro:content
- Update getEntry calls for ID-based lookup

Co-Authored-By: Davis Haupt <davis@davishaupt.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify

netlify Bot commented Apr 12, 2026

Copy link
Copy Markdown

Deploy Preview for davish-site ready!

Name Link
🔨 Latest commit fee91fe
🔍 Latest deploy log https://app.netlify.com/projects/davish-site/deploys/69dc1632be7f7500081ef8dc
😎 Deploy Preview https://deploy-preview-44--davish-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

devin-ai-integration Bot and others added 3 commits April 12, 2026 21:29
- Add .nvmrc with Node 22
- Add NODE_VERSION=22 to netlify.toml build environment
- Update package-lock.json for Astro 6 dependencies

Co-Authored-By: Davis Haupt <davis@davishaupt.com>
Derive the file extension from entry.filePath instead of
hardcoding .md, so .org and other formats display correctly.

Co-Authored-By: Davis Haupt <davis@davishaupt.com>
Co-Authored-By: Davis Haupt <davis@davishaupt.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Visual Comparison Test Results

Tested deploy preview vs live site across 7 page types. Found and fixed a bug — 5 components still used .slug (undefined in Astro 6) instead of .id, causing broken links. Fixed in 2bda02b.

All 7 tests passed after fix.

Bug Found & Fixed: slug→id in 5 components
🔴 Before Fix 🟢 After Fix
Before After
<h1> href = /blog/undefined <h1> href = /blog/2026/02/markov-ideas

Files fixed: Heading.astro, SnippetTable.astro, ReadingEntry.astro, AuthorEntry.astro, Project.astro

Test Results (7/7 passed)
  • Blog post title permalink — PASSED. <h1> links to /blog/2026/02/markov-ideas
  • TIL snippet links — PASSED. All 9 snippets link correctly (e.g. /til/nix/flake-update)
  • Reading entry links — PASSED. Book entries link correctly (e.g. /reading/2026/the-great-alone)
  • Reading detail page — PASSED. Nav shows ~/reading/red-rising.md, content and pagination correct
  • Weekly post — PASSED. Nav shows ~/weekly/2026-04-11.md, content and pagination correct
  • Resume projects — PASSED. Project link is /projects/obsidian-full-calendar
  • RSS feed — PASSED. Valid XML, 0 occurrences of "undefined", correct URLs

Devin session

devin-ai-integration Bot and others added 3 commits April 12, 2026 21:58
- Add @astrojs/check and typescript as dev dependencies for type checking
- Fix verbatimModuleSyntax errors: use type-only imports for CollectionEntry
- Fix optional body handling: body is string | undefined in Content Layer API
- Fix astro-icon import: use named import from astro-icon/components
- Fix Buffer type in og_image.tsx: wrap in Uint8Array for Response constructor
- Fix import conflict in [project].astro: rename Project to ProjectLayout

Co-Authored-By: Davis Haupt <davis@davishaupt.com>
Co-Authored-By: Davis Haupt <davis@davishaupt.com>
Co-Authored-By: Davis Haupt <davis@davishaupt.com>
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