Skip to content

fixes + brands#51

Open
bmdavis419 wants to merge 2 commits intomainfrom
davis/adding-more-brands
Open

fixes + brands#51
bmdavis419 wants to merge 2 commits intomainfrom
davis/adding-more-brands

Conversation

@bmdavis419
Copy link
Contributor

@bmdavis419 bmdavis419 commented Mar 11, 2026

Upgrade Astro to v6 and add typed blog post imports

  • Upgrades astro from 5.16.9 to 6.0.2 and related deps (@tailwindcss/vite, tailwindcss, prettier) in package.json; adds @astrojs/check and typescript as dev dependencies with a new check script
  • Adds src/types/blog.ts with BlogPost and BlogPostFrontmatter types, replacing untyped Astro.glob calls with typed import.meta.glob<BlogPost> in the blog index and post pages
  • Adds ambient JSX declarations for xmlns:serif and serif:id SVG attributes in src/env.d.ts to suppress type errors in SVG assets
  • Behavioral Change: blog post filtering (hidden !== true) now runs before sorting rather than after

Macroscope summarized b0f42ae.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added type-checking capabilities to development workflow.
    • Enhanced TypeScript support with improved type definitions.
  • Chores

    • Upgraded Astro framework to v6.0.2.
    • Updated Tailwind CSS and related tooling to latest versions.
    • Upgraded development dependencies including Prettier and TypeScript.
  • Style

    • Refined UI styling and layout consistency across pages and components.

@vercel
Copy link

vercel bot commented Mar 11, 2026

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

Project Deployment Actions Updated (UTC)
t3-astro Ready Ready Preview, Comment Mar 11, 2026 6:46am

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

This change updates core dependencies (Astro 5.16.9 → 6.0.2, Tailwind packages, Prettier), introduces type-safe blog data handling with new TypeScript definitions, refactors blog pages to use eager glob imports, and reorganizes CSS utility class sequences across page components without altering visual presentation.

Changes

Cohort / File(s) Summary
Dependency & Package Updates
package.json
Added @astrojs/check and typescript dev dependencies. Updated major dependencies: astro 5.16.9 → 6.0.2, Tailwind packages to v4.2.x, Prettier to 3.8.1. Added check npm script for type checking.
Type Definitions
src/types/blog.ts, src/env.d.ts
Introduced BlogPostFrontmatter and BlogPost types for blog content structure. Extended TypeScript declarations with SVG namespace attributes (xmlns:serif, serif:id).
Blog Data Loading & Typing
src/pages/blog/post/[slug].astro, src/pages/blog/index.astro, src/components/BlogPostPreview.astro
Converted async glob imports to eager glob with explicit BlogPost typing. Updated getStaticPaths() to use synchronous eager imports. Added type assertions for post data. Changed BlogPostPreview to accept typed BlogPost instead of any.
UI Component & Page Styling
src/components/BlogPostHeader.astro, src/components/SponsorGridSection.astro, src/layouts/BaseLayout.astro, src/pages/{404,index,sponsor-me,sponsors}.astro, src/assets/sponsors/temp.svg.astro
Reorganized CSS utility class sequences and adjusted element formatting across multiple components without changing visual behavior. Reordered hover states, animation classes, and spacing utilities. Reformatted SVG markup with multi-line attributes. Minor structural adjustments to script tags and main elements.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hopping through the deps with glee,
Astro six and types set free,
Tailwind glows in class array,
Blog posts typed the proper way,
Style rearranged, the beauty stays!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fixes + brands' is vague and does not clearly convey the main changes. While 'brands' aligns with the source branch name, the changeset includes significant dependency upgrades (Astro 5→6, Tailwind 4.1→4.2), type system improvements, and multiple component refactors—none of which are captured by this generic title. Use a more descriptive title that captures the primary changes, such as 'Upgrade Astro to v6, add type checking, and refactor components' or 'Add sponsor brands and modernize tooling.'
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch davis/adding-more-brands

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

@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.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/types/blog.ts (1)

8-12: Use proper Astro type for markdown glob imports.

In Astro 6.0.2, glob imports of markdown files should use the MarkdownInstance<Frontmatter> type instead of a custom type. This provides proper typing for the Content component and aligns with Astro's pattern.

♻️ Suggested improvement
+import type { MarkdownInstance } from "astro";
+
-export type BlogPostFrontmatter = {
-  title: string;
-  date: string;
-  description?: string;
-  hidden?: boolean;
-};
-
-export type BlogPost = {
-  file: string;
-  frontmatter: BlogPostFrontmatter;
-  Content: any;
-};
+export type BlogPostFrontmatter = {
+  title: string;
+  date: string;
+  description?: string;
+  hidden?: boolean;
+};
+
+export type BlogPost = MarkdownInstance<BlogPostFrontmatter>;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/types/blog.ts` around lines 8 - 12, The BlogPost type currently uses a
loose any for the Content property; replace it with Astro's
MarkdownInstance<BlogPostFrontmatter> for proper typing. Add an import (import
type { MarkdownInstance } from 'astro') and change the Content field on the
BlogPost type to MarkdownInstance<BlogPostFrontmatter>, keeping the existing
file and frontmatter fields unchanged so markdown glob imports are correctly
typed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 14: The package version for `@astrojs/check` is invalid; replace the
dependency version specifier "@astrojs/check": "^0.9.7" with a valid
release—either downgrade to "^0.9.6" or explicitly pin to an intended beta like
"0.9.7-beta.1" in package.json so npm install succeeds; update the dependency
entry for the `@astrojs/check` package accordingly.
- Line 17: The package.json currently pins "astro": "6.0.2" but upgrading to
Astro 6 requires several changes: add an "engines" entry with node >=22.12.0 to
package.json and update CI/deployment to use Node 22.12.0+; verify and update
Vite to a Vite 7-compatible version; scan code for removed/changed Astro APIs
(calls like Astro.glob(), usage of <ViewTransitions />, import.meta.env
coercion, endpoint URL assumptions, and i18n routing defaults) and update call
sites accordingly; if using Astro Content or Zod schemas, replace imports from
astro:content or astro:schema with astro/zod and adapt any Zod 4 breaking
changes. Ensure these changes are applied alongside the "astro": "6.0.2" bump.

In `@src/layouts/BaseLayout.astro`:
- Around line 65-66: Remove the redundant is:inline attribute from the <script>
element in BaseLayout.astro (the script tag with attributes defer,
data-domain="astro.t3.gg", and src="/js/script.js"); update the <script> tag to
omit is:inline so it becomes a standard deferred external script element.

In `@src/pages/blog/post/`[slug].astro:
- Around line 8-15: The getStaticPaths logic currently returns pages for every
markdown file; filter out posts with frontmatter.hidden === true before mapping.
After loading posts via
import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
apply a filter using each post's frontmatter (e.g., post.frontmatter &&
post.frontmatter.hidden !== true) and only then map to produce params/props
(referencing getSlugFromPath and the returned post object). This ensures hidden
posts are not included in the generated routes.

---

Nitpick comments:
In `@src/types/blog.ts`:
- Around line 8-12: The BlogPost type currently uses a loose any for the Content
property; replace it with Astro's MarkdownInstance<BlogPostFrontmatter> for
proper typing. Add an import (import type { MarkdownInstance } from 'astro') and
change the Content field on the BlogPost type to
MarkdownInstance<BlogPostFrontmatter>, keeping the existing file and frontmatter
fields unchanged so markdown glob imports are correctly typed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7972ca61-2236-42d2-86ff-2ccc38af6220

📥 Commits

Reviewing files that changed from the base of the PR and between c1973ea and b0f42ae.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • package.json
  • src/assets/sponsors/temp.svg.astro
  • src/components/BlogPostHeader.astro
  • src/components/BlogPostPreview.astro
  • src/components/SponsorGridSection.astro
  • src/env.d.ts
  • src/layouts/BaseLayout.astro
  • src/pages/404.astro
  • src/pages/blog/index.astro
  • src/pages/blog/post/[slug].astro
  • src/pages/index.astro
  • src/pages/sponsor-me.astro
  • src/pages/sponsors.astro
  • src/types/blog.ts

"format": "prettier --write **/*.{mjs,ts,md,json,astro,css} --ignore-path .gitignore"
},
"devDependencies": {
"@astrojs/check": "^0.9.7",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check peer dependencies for `@astrojs/check`
curl -s https://registry.npmjs.org/@astrojs/check/0.9.7 | jq '.peerDependencies // "No peer deps"'

Repository: T3-Content/t3.gg

Length of output: 88


🏁 Script executed:

cat package.json | grep -A2 -B2 '"astro"'

Repository: T3-Content/t3.gg

Length of output: 223


🌐 Web query:

@astrojs/check 0.9.7 Astro 6 compatibility requirements

💡 Result:

  • There is no stable @astrojs/check@0.9.7 on npm (the latest published stable version is 0.9.6). [1]
  • For Astro 6, the upgrade path has been using @astrojs/check@0.9.7-beta.1 (paired with astro@6.0.0-beta.x during the beta period). [2]
  • Astro 6 runtime requirement: Node.js 22+. [3]
  • @astrojs/check peer requirement: TypeScript ^5.0.0. [4]

If you specifically need “Astro 6 compatibility”, use the Astro 6–era @astrojs/check (currently the 0.9.7 beta line, or whatever version Astro 6’s upgrade tool installs) rather than expecting a stable 0.9.7 tarball to exist. [2]

Sources: [1] [2] [3] [4]


Update @astrojs/check to a stable release version.

@astrojs/check@0.9.7 does not exist as a stable release on npm—the latest stable version is 0.9.6. The version constraint ^0.9.7 will fail during npm install. Either downgrade to ^0.9.6 or explicitly pin to 0.9.7-beta.1 if intentional for Astro 6 beta testing.

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

In `@package.json` at line 14, The package version for `@astrojs/check` is invalid;
replace the dependency version specifier "@astrojs/check": "^0.9.7" with a valid
release—either downgrade to "^0.9.6" or explicitly pin to an intended beta like
"0.9.7-beta.1" in package.json so npm install succeeds; update the dependency
entry for the `@astrojs/check` package accordingly.

"astro": "5.16.9",
"prettier": "^3.7.4",
"@tailwindcss/vite": "^4.2.1",
"astro": "6.0.2",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Astro 6.0 release breaking changes migration

💡 Result:

Astro 6.0 upgrade/migration checklist (breaking changes & common fixes):

  • Upgrade command: run npx @astrojs/upgrade`` (preferred) or install astro@latest. [1]
  • Node.js requirement: Astro 6 drops Node 18 & 20 — you must use Node 22.12.0+ in dev and CI/deploy. [2]
  • Vite upgrade: Astro 6 upgrades to Vite 7 (update if you pin Vite). [1][2]
  • Config files: .cjs / .cts Astro config files are no longer supported → rename to .mjs, .js, .ts, or .mts. [3]
  • Remove now-stable experimental flags: delete flags like experimental.csp, fonts, liveContentCollections, preserveScriptOrder, staticImportMetaEnv, etc. from astro.config.*. [4]
  • Zod 4: Astro 6 uses Zod 4 (schemas may need updates). Also stop importing Zod via astro:schema or z from astro:content → import from astro/zod instead. [1][5]
  • import.meta.env behavior: values are now always inlined and never coerced; if you relied on boolean/number coercion or process.env fallback, update code/types accordingly. [6]
  • Endpoint URLs with file extensions: /sitemap.xml/ (trailing slash) no longer works—must be /sitemap.xml. [6]
  • i18n default change: i18n.routing.redirectToDefaultLocale now defaults to false and only works when prefixDefaultLocale: true; set explicitly if you relied on old behavior. [7]
  • <script> / <style> ordering: Astro now renders them in declared order (not reversed); you may need to reorder tags. [7]

For the full list (including removed APIs like Astro.glob(), <ViewTransitions />, adapter/integration API changes, image-service behavior changes, etc.), follow the official “Upgrade to Astro v6” guide. [2]

Sources: [1] [2] [3] [4] [5] [6] [7]


🏁 Script executed:

# Check if astro.config exists
find . -type f \( -name "astro.config.*" -o -name "astro.config.mjs" \) 2>/dev/null | head -20

Repository: T3-Content/t3.gg

Length of output: 78


🏁 Script executed:

# Check the current tsconfig or TypeScript configuration
find . -type f \( -name "tsconfig.json" -o -name "tsconfig.*.json" \) 2>/dev/null | head -10

Repository: T3-Content/t3.gg

Length of output: 75


🏁 Script executed:

# Look for Node.js version requirements (package.json engines field, .nvmrc, .node-version)
cat package.json | grep -A 5 '"engines"' || echo "No engines field found"

Repository: T3-Content/t3.gg

Length of output: 82


🏁 Script executed:

# Check for .nvmrc or .node-version files
ls -la .nvmrc .node-version 2>/dev/null || echo "No .nvmrc or .node-version files found"

Repository: T3-Content/t3.gg

Length of output: 98


🏁 Script executed:

# Read astro.config.mjs to check for experimental flags
cat astro.config.mjs

Repository: T3-Content/t3.gg

Length of output: 402


🏁 Script executed:

# Read tsconfig.json
cat tsconfig.json

Repository: T3-Content/t3.gg

Length of output: 595


🏁 Script executed:

# Check if Zod is used in the codebase (Astro 6 uses Zod 4)
grep -r "from \"astro" . --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --include="*.astro" 2>/dev/null | grep -E "(astro:content|astro:schema)" || echo "No Astro content/schema imports found"

Repository: T3-Content/t3.gg

Length of output: 97


🏁 Script executed:

# Check for any .cjs or .cts config files that would violate Astro 6
find . -type f \( -name "astro.config.cjs" -o -name "astro.config.cts" \) 2>/dev/null || echo "No deprecated config format found"

Repository: T3-Content/t3.gg

Length of output: 42


Major version upgrade: Astro 5 → 6 requires verifying breaking changes.

Astro 6 introduces significant breaking changes. Verify these key items:

  1. Node.js version: Astro 6 requires Node.js 22.12.0+—add "engines": { "node": ">=22.12.0" } to package.json and ensure CI/deployment uses this version or higher.
  2. Vite upgrade: Confirm Vite 7 compatibility (Astro 6 upgrades to Vite 7).
  3. Breaking API changes: Verify if the codebase uses removed APIs like Astro.glob(), <ViewTransitions />, import.meta.env coercion, or changes to endpoint URLs and i18n routing defaults.
  4. Zod 4: If using Astro Content, update imports from astro:content or astro:schema to astro/zod.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 17, The package.json currently pins "astro": "6.0.2"
but upgrading to Astro 6 requires several changes: add an "engines" entry with
node >=22.12.0 to package.json and update CI/deployment to use Node 22.12.0+;
verify and update Vite to a Vite 7-compatible version; scan code for
removed/changed Astro APIs (calls like Astro.glob(), usage of <ViewTransitions
/>, import.meta.env coercion, endpoint URL assumptions, and i18n routing
defaults) and update call sites accordingly; if using Astro Content or Zod
schemas, replace imports from astro:content or astro:schema with astro/zod and
adapt any Zod 4 breaking changes. Ensure these changes are applied alongside the
"astro": "6.0.2" bump.

Comment on lines +65 to +66
<script is:inline defer data-domain="astro.t3.gg" src="/js/script.js"
></script>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Astro 6 is:inline directive external script src behavior

💡 Result:

In Astro (including v6 docs), is:inline means Astro will not process/bundle the <script> tag—it will be emitted in the final HTML “as-is.” This matters a lot when you also use src. [1]

What happens with <script src="...">

  • Only src present (no other attributes): Astro treats it as a bundled module script (Astro processes the file, can compile TS, and outputs a built asset). [1][2]
  • is:inline present (or implied): Astro does not bundle. The browser will request exactly the src URL you wrote at runtime. If that path doesn’t exist in the built site (typically public/), you’ll get a 404. [1]

When is:inline is implied (even if you didn’t write it)

Astro implicitly treats a script as is:inline whenever you add any attribute other than src (e.g. type="module", async, defer, crossorigin, etc.). That disables bundling and changes behavior to “leave it alone.” [1][2]

Practical rule of thumb

  • If the script is in src/ and you want Astro to build it: use a plain <script src="./path/to/file.ts"></script> with no other attributes. [1][2]
  • If you want to load a file exactly from your built site (usually from public/) or an external CDN URL: use is:inline (or any other attribute) and make sure the src points to a real runtime URL. [1]

Sources: Astro directives reference (incl. is:inline + implicit behavior) [1], Astro client-side scripts guide (attributes disable bundling) [2].


Remove redundant is:inline directive.

The is:inline attribute is unnecessary here because Astro implicitly treats any <script> tag with additional attributes (like defer) as inline. Since your script already has defer, the explicit is:inline is redundant.

Remove the is:inline attribute to keep the markup cleaner:

Suggested change
<script defer data-domain="astro.t3.gg" src="/js/script.js"></script>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/layouts/BaseLayout.astro` around lines 65 - 66, Remove the redundant
is:inline attribute from the <script> element in BaseLayout.astro (the script
tag with attributes defer, data-domain="astro.t3.gg", and src="/js/script.js");
update the <script> tag to omit is:inline so it becomes a standard deferred
external script element.

Comment on lines +8 to 15
return Object.values(
import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
).map((post) => {
const slug = getSlugFromPath(post.file);

return {
params: {
slug,
},
params: { slug },
props: { post },
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Filter hidden posts out of getStaticPaths().

/blog now excludes frontmatter.hidden === true, but this route still generates pages for every markdown file. Hidden posts remain reachable by direct URL even though they no longer appear in the index.

Proposed fix
 export function getStaticPaths() {
   return Object.values(
     import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
-  ).map((post) => {
-    const slug = getSlugFromPath(post.file);
+  )
+    .filter((post) => post.frontmatter.hidden !== true)
+    .map((post) => {
+      const slug = getSlugFromPath(post.file);
 
-    return {
-      params: { slug },
-      props: { post },
-    };
-  });
+      return {
+        params: { slug },
+        props: { post },
+      };
+    });
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/blog/post/`[slug].astro around lines 8 - 15, The getStaticPaths
logic currently returns pages for every markdown file; filter out posts with
frontmatter.hidden === true before mapping. After loading posts via
import.meta.glob<BlogPost>("../../../content/posts/*.md", { eager: true }),
apply a filter using each post's frontmatter (e.g., post.frontmatter &&
post.frontmatter.hidden !== true) and only then map to produce params/props
(referencing getSlugFromPath and the returned post object). This ensures hidden
posts are not included in the generated routes.

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