Skip to content

Update to astro 6#44

Merged
RobbieTheWagner merged 3 commits intomainfrom
astro-6
Mar 27, 2026
Merged

Update to astro 6#44
RobbieTheWagner merged 3 commits intomainfrom
astro-6

Conversation

@RobbieTheWagner
Copy link
Copy Markdown
Member

@RobbieTheWagner RobbieTheWagner commented Mar 25, 2026

Summary by CodeRabbit

  • Chores

    • Upgraded Astro framework to version 6.0.3, including updates to Preact integration, Vercel adapter, and associated build tools
    • Reorganized font configuration in build settings
  • New Features

    • Added transcripts content collection to support new content structure
  • Bug Fixes

    • Enhanced image URL redirect handling for better asset resolution
    • Fixed transcript content generation to properly validate required data fields before processing

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
starpod Ready Ready Preview, Comment Mar 27, 2026 4:34pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 298e938d-9608-441f-a4e9-17f0080f783e

📥 Commits

Reviewing files that changed from the base of the PR and between e40cc5d and cf0778c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • astro.config.mjs
  • package.json
  • src/content.config.ts
  • src/content/config.ts
  • src/lib/optimize-episode-image.ts
  • src/pages/[episode].astro
  • src/pages/[episode].html.md.ts
💤 Files with no reviewable changes (1)
  • src/content/config.ts
✅ Files skipped from review due to trivial changes (1)
  • src/content.config.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • package.json
  • astro.config.mjs
  • src/lib/optimize-episode-image.ts

📝 Walkthrough

Walkthrough

This PR updates an Astro project configuration to use the new top-level fonts structure, bumps core dependencies and integrations to latest major versions, reorganizes content collection setup into a dedicated file, adds HTTP redirect resolution for episode images, and updates transcript rendering to use the new content API pattern.

Changes

Cohort / File(s) Summary
Configuration & Dependencies
astro.config.mjs, package.json
Migrated font setup from experimental.fonts to top-level fonts with fontProviders.google(), added formats: ['woff2'], and bumped Astro to v6.0.3, @astrojs/preact to v5.0.0, and @astrojs/vercel to v10.0.0.
Content Collection
src/content.config.ts, src/content/config.ts
Relocated transcripts collection definition from src/content/config.ts to new src/content.config.ts file with glob loader for *.md and *.mdx files.
Episode Image Optimization
src/lib/optimize-episode-image.ts
Added new resolveRedirects() helper to follow HTTP 3xx redirects by extracting Location header, integrated into optimizeImage() for resolved image URLs.
Page Components
src/pages/[episode].astro, src/pages/[episode].html.md.ts
Updated transcript rendering to call render(Transcript) instead of Transcript.render() and tightened body check from if (transcript) to if (transcript?.body).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 The config takes flight to a brighter new nest,
With fonts at the top and redirects that jest,
Collections reorganized, episodes rendered with grace,
Each hop brings new order to this bustling place!
~CodeRabbit's fuzzy friend 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change—updating the project from Astro 5 to Astro 6—which is evident across multiple files (astro.config.mjs restructuring, package.json version bumps, and content configuration updates).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astro-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

23-40: ⚠️ Potential issue | 🟡 Minor

Consider updating to latest patch versions for Astro 6.

All specified package versions exist and are compatible with Astro 6. However, newer patch versions are available:

  • astro: 6.0.3 → 6.0.8 (latest)
  • @astrojs/preact: 5.0.0 → 5.0.2
  • @astrojs/vercel: 10.0.0 → 10.0.2
  • @astrojs/db: 0.20.0 → 0.20.1

Update these to get bug fixes and improvements. Your Node 22.0.0+ requirement aligns with Astro 6's dropping of Node 18/20 support.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 23 - 40, Update the pinned package versions in
package.json to the latest Astro-6 patch releases: change "astro" from 6.0.3 to
6.0.8, "@astrojs/preact" from 5.0.0 to 5.0.2, "@astrojs/vercel" from 10.0.0 to
10.0.2, and "@astrojs/db" in devDependencies from 0.20.0 to 0.20.1; then run
your package manager (npm/yarn/pnpm) to install and update lockfile so the
project uses the patched releases.
🧹 Nitpick comments (1)
src/lib/optimize-episode-image.ts (1)

1-7: Consider using HEAD request for redirect resolution.

The current implementation uses GET which downloads the full response body just to check for redirects. A HEAD request would be more efficient since you only need the headers:

♻️ Proposed optimization
 export async function resolveRedirects(url: string): Promise<string> {
-  const response = await fetch(url, { method: 'GET', redirect: 'manual' });
+  const response = await fetch(url, { method: 'HEAD', redirect: 'manual' });
   if (response.status >= 300 && response.status < 400) {
     return response.headers.get('location') ?? url;
   }
   return url;
 }

Additionally, be aware of these edge cases:

  1. Relative Location headers: Some servers return relative paths (e.g., /new/path). The code returns these as-is, which may break if an absolute URL is expected downstream.
  2. Redirect chains: This only follows one hop. Multiple redirects (301 → 302 → 200) will return the first intermediate URL, not the final destination.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/optimize-episode-image.ts` around lines 1 - 7, resolveRedirects
currently issues a GET and only inspects one redirect hop and may return
relative Location headers; change it to use a HEAD request first (falling back
to GET if the server rejects HEAD) with redirect: 'manual', loop to follow
redirect chains up to a safe maxRedirects (e.g., 5) until a non-3xx status is
returned, and when reading response.headers.get('location') resolve any relative
Location values to absolute URLs using the original/current URL as the base (via
the URL constructor) before continuing the loop or returning the final URL;
update references to resolveRedirects to rely on this behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@package.json`:
- Around line 23-40: Update the pinned package versions in package.json to the
latest Astro-6 patch releases: change "astro" from 6.0.3 to 6.0.8,
"@astrojs/preact" from 5.0.0 to 5.0.2, "@astrojs/vercel" from 10.0.0 to 10.0.2,
and "@astrojs/db" in devDependencies from 0.20.0 to 0.20.1; then run your
package manager (npm/yarn/pnpm) to install and update lockfile so the project
uses the patched releases.

---

Nitpick comments:
In `@src/lib/optimize-episode-image.ts`:
- Around line 1-7: resolveRedirects currently issues a GET and only inspects one
redirect hop and may return relative Location headers; change it to use a HEAD
request first (falling back to GET if the server rejects HEAD) with redirect:
'manual', loop to follow redirect chains up to a safe maxRedirects (e.g., 5)
until a non-3xx status is returned, and when reading
response.headers.get('location') resolve any relative Location values to
absolute URLs using the original/current URL as the base (via the URL
constructor) before continuing the loop or returning the final URL; update
references to resolveRedirects to rely on this behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 19f74132-db9f-43f3-9eb5-5271b9b742b2

📥 Commits

Reviewing files that changed from the base of the PR and between 37959d0 and e40cc5d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • astro.config.mjs
  • package.json
  • src/content.config.ts
  • src/content/config.ts
  • src/lib/optimize-episode-image.ts
  • src/lib/rss.ts
  • src/pages/[episode].astro
💤 Files with no reviewable changes (1)
  • src/content/config.ts

@RobbieTheWagner RobbieTheWagner changed the title Attempt astro 6 Update to astro 6 Mar 27, 2026
@RobbieTheWagner RobbieTheWagner merged commit d6cf1e8 into main Mar 27, 2026
6 checks passed
@RobbieTheWagner RobbieTheWagner deleted the astro-6 branch March 27, 2026 16:40
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