Skip to content

feat: support Nuxt Content v4 - #61

Draft
benjamincanac wants to merge 1 commit into
mainfrom
feat/content-v4
Draft

benjamincanac wants to merge 1 commit into
mainfrom
feat/content-v4

Conversation

@benjamincanac

@benjamincanac benjamincanac commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Docus on the Content v4 POC (nuxt-content/docus#1470) needed a patch on moduleDependencies, a hand-written comark source and still failed check:vercel-output, because a custom source skips prerendering /sitemap.md and /raw/index.md.

The built-in source now reads the installed @nuxt/content major. v3 keeps the minimark path. On v4 it generates a source that calls createComarkSource() with v4's server content, imported from the path v4 registers as a Nitro server import (server/content.ts, the v3 content.config.ts hub or the fallback). It stays a built-in source, so the twins and /sitemap.md prerender as before. comark/render is aliased to the copy @nuxt/content depends on, like minimark/stringify on v3. v4 has no llms feature, so the removal is skipped there.

I checked this against a local build of nuxt/content-v4-temp@dbac272 with the same content on v3 and v4: every /raw/*.md is byte-identical, along with negotiation, the section redirect and the 404. llms.txt differs only where it should, since a llms.sections entry now needs navigation instead of contentCollection on v4. There's no v4 e2e fixture because CI can't install the private package. We can add one once v4 is published.

Summary by CodeRabbit

  • New Features

    • Added support for Nuxt Content v4 alongside v3, including its content rendering and prerendering behavior.
    • Updated compatibility guidance for v4 content hooks and llms.sections selection.
  • Documentation

    • Clarified that built-in content is fixed at build time for both supported versions.
    • Documented v4’s content adapter and navigation-based section selection.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d795d875-9f9d-44ff-ba64-4b66697a4219
Commits

Reviewing files that changed from the base of the PR and between 40cac49 and 100b1cc.

Files selected for processing: 5
  • README.md
  • package.json
  • src/build/content.ts
  • src/module.ts
  • test/unit/content.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The module now supports automatic detection of Nuxt Content v3 and v4. It selects the corresponding built-in content adapter, applies the resolver’s aliases, and documents the v4 content representation and prerendering behavior.

Changes: Nuxt Content adapter support

Layer / File(s) Summary
Version detection and source adapters
src/build/content.ts, test/unit/content.test.ts
The resolver reads the installed Nuxt Content major version and selects the existing runtime source or a Comark-backed v4 source. Tests check v4 template generation and the error when Nitro has no registered content import.
Module integration and documentation
src/module.ts, package.json, README.md
The module passes package metadata to the resolver and applies its aliases. The dependency range and documentation now include v4 behavior. The nuxt-llms feature is dropped only for versions other than v4.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant NuxtModule
  participant ContentResolver
  participant Nitro
  participant ComarkTemplate
  NuxtModule->>ContentResolver: Pass detected Content package
  ContentResolver->>Nitro: Register nitro:init hook
  Nitro->>ContentResolver: Provide registered content import
  ContentResolver->>ComarkTemplate: Generate source template using content import
Loading

Suggested reviewers: larbish

Merge Risk: Minimal · up to 100b1

No actionable merge-blocking issue is established. The v4 integration has not been independently exercised here, but the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: support for Nuxt Content v4. It matches the pull request objectives and changed files.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (2 skipped: 2 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (2 skipped: 2 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nuxt-agent-discovery@61

commit: 100b1cc

This branch was successfully deployed

1 active deployment
Preview — 100b1ccd Deployed Oct 26, 2026 by vercel[bot]
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