Skip to content

fix(docs): migrate to astro 6 content collection config - #1345

Merged
tamirdresher merged 1 commit into
github:devfrom
tamirdresher:tamirdresher/astro6-content-config
Jun 15, 2026
Merged

tamirdresher merged 1 commit into
github:devfrom
tamirdresher:tamirdresher/astro6-content-config

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

What changed

  • Moved docs/src/content/config.ts → docs/src/content.config.ts
    Astro 6 expects the content collection config at src/content.config.ts (at the src/ root), not inside src/content/. Leaving the file in the old location triggers a fatal LegacyContentConfigError and aborts the build.
  • Replaced deprecated ViewTransitions import with ClientRouter from astro:transitions
    ViewTransitions was removed in Astro 6; ClientRouter is the replacement.
  • Updated generated docs/.astro/ type stubs to reflect the new collection layout.

Why

PR #1332 bumped Astro from 5.18.0 to 6.4.7. dev CI has been failing since 19:35 UTC on 2026-06-15:

[LegacyContentConfigError] Found legacy content config file in "src/content/config.ts". Please move this file to "src/content.config.ts" and ensure each collection has a loader defined.

Failing run: https://github.com/bradygaster/squad/actions/runs/27571236144

What is NOT in this PR

The markdown.remarkPlugins / rehypePlugins deprecation warning visible in the build output is a soft warning — it does not fail the build. It is intentionally deferred to a follow-up PR to keep this change scoped.

Local validation

All 22 tests in test/docs-build.test.ts pass:

RUN  v3.2.4

 ✓ test/docs-build.test.ts > Docs Structure Validation > Markdown Files > guide directory contains all expected markdown files
 ✓ test/docs-build.test.ts > Docs Structure Validation > Markdown Files > all markdown files have proper headings
 ✓ test/docs-build.test.ts > Docs Structure Validation > Markdown Files > all code blocks are properly fenced (even count of ```)
 ✓ test/docs-build.test.ts > Docs Structure Validation > Markdown Files > no empty markdown files
 ✓ test/docs-build.test.ts > Docs Structure Validation > Code Example Validation > code blocks contain language specification or valid content
 ✓ test/docs-build.test.ts > Docs Structure Validation > Code Example Validation > bash examples have non-empty content
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > Astro config exists
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > build runs without errors (exit code 0)
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > all expected doc pages produce HTML in dist/
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > blog posts produce HTML in dist/blog/
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > Astro output: code blocks with syntax highlighting > fenced code blocks are rendered with Shiki highlighting
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > Astro output: table markup > tables render as proper <table> HTML
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > Astro output: inline formatting > bold text renders as <strong>
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > Astro output: inline formatting > inline code renders as <code>
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > Astro output: inline formatting > links render as <a> with href
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > index.html is generated as landing page
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > blog index page is generated
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > doc pages contain sidebar navigation
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > all HTML files have proper DOCTYPE and closing tags
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > doc pages contain <article> content area
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > pagefind index is generated in dist/
 ✓ test/docs-build.test.ts > Docs Build Script (Astro) > doc pages include search UI in header

 Test Files  1 passed (1)
      Tests  22 passed (22)
   Duration  27.42s

- Move docs/src/content/config.ts -> docs/src/content.config.ts
  (Astro 6 requires the content config at src/content.config.ts, not
  inside src/content/)
- Replace deprecated ViewTransitions import with ClientRouter from
  astro:transitions (also removed in Astro 6)
- Update generated .astro/ type stubs to match new collection layout

Fixes the LegacyContentConfigError introduced by PR github#1332 (astro 6.4.7
bump). dev CI has been failing since 19:35 UTC 2026-06-15 at:
https://github.com/bradygaster/squad/actions/runs/27571236144

Note: the markdown.remarkPlugins / rehypePlugins deprecation warning
visible in the build output is intentionally NOT addressed in this PR
(separate concern).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 20:06
@github-actions

Copy link
Copy Markdown
Contributor

🟢 Impact Analysis — PR #1345

Risk tier: 🟢 LOW

📊 Summary

Metric Count
Files changed 5
Files added 0
Files modified 5
Files deleted 0
Modules touched 1

🎯 Risk Factors

  • 5 files changed (≤5 → LOW)
  • 1 module(s) touched (≤1 → LOW)

📦 Modules Affected

docs (5 files)
  • docs/.astro/collections/blog.schema.json
  • docs/.astro/collections/docs.schema.json
  • docs/.astro/content.d.ts
  • docs/src/content.config.ts
  • docs/src/layouts/BaseLayout.astro

This report is generated automatically for every PR. See #733 for details.

@github-actions

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 387706a

PR Scope: 🔧 Infrastructure

⚠️ 2 item(s) to address before review

Status Check Details
✅ Single commit 1 commit — clean history
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present No source files changed — changeset not required
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved No Copilot review threads
❌ CI passing 6 check(s) still running

Files Changed (5 files, +99 −179)

File +/−
docs/.astro/collections/blog.schema.json +31 −49
docs/.astro/collections/docs.schema.json +31 −49
docs/.astro/content.d.ts +35 −79
docs/src/content.config.ts +0 −0
docs/src/layouts/BaseLayout.astro +2 −2

Total: +99 −179


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the docs site build after the Astro 6 upgrade by migrating the content collection config to Astro 6’s expected location and updating transitions usage, along with regenerating the Astro content type/schema stubs.

Changes:

  • Move content collection config to docs/src/content.config.ts and define docs + blog collections using astro/loaders.
  • Replace removed ViewTransitions with ClientRouter from astro:transitions.
  • Update generated docs/.astro/ content typings and JSON schemas to match the new config/layout.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/src/layouts/BaseLayout.astro Switch transitions component from ViewTransitions to ClientRouter for Astro 6 compatibility.
docs/src/content.config.ts Introduce Astro 6-compatible content collection config at the src/ root using loader-based collections.
docs/.astro/content.d.ts Regenerated content-collection type stubs to match the new config path and collection model.
docs/.astro/collections/docs.schema.json Regenerated docs collection schema reflecting the updated config/tooling output.
docs/.astro/collections/blog.schema.json Regenerated blog collection schema reflecting the updated config/tooling output.

@tamirdresher
tamirdresher merged commit a23e9b2 into github:dev Jun 15, 2026
14 checks passed
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.

2 participants