Repository navigation
feat: support Nuxt Content v4 - #61
benjamincanac wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review.
|
| 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:
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
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: 
5
-
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.
Comment @coderabbitai help to get the list of available commands.
commit: |
Docus on the Content v4 POC (nuxt-content/docus#1470) needed a patch on
moduleDependencies, a hand-written comark source and still failedcheck:vercel-output, because a custom source skips prerendering/sitemap.mdand/raw/index.md.The built-in source now reads the installed
@nuxt/contentmajor. v3 keeps the minimark path. On v4 it generates a source that callscreateComarkSource()with v4's servercontent, imported from the path v4 registers as a Nitro server import (server/content.ts, the v3content.config.tshub or the fallback). It stays a built-in source, so the twins and/sitemap.mdprerender as before.comark/renderis aliased to the copy@nuxt/contentdepends on, likeminimark/stringifyon 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/*.mdis byte-identical, along with negotiation, the section redirect and the 404.llms.txtdiffers only where it should, since allms.sectionsentry now needsnavigationinstead ofcontentCollectionon 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
llms.sectionsselection.Documentation