Skip to content

fix: support generic content hook providers - #319

Open
harlan-zw wants to merge 1 commit into
mainfrom
fix/generic-content-hook-provider
Open

fix: support generic content hook providers#319
harlan-zw wants to merge 1 commit into
mainfrom
fix/generic-content-hook-provider

Conversation

@harlan-zw

Copy link
Copy Markdown
Contributor

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Robots frontmatter was ignored when a provider implemented the Nuxt Content hooks without registering @nuxt/content. Register the v3-shaped hook independently from Nuxt Content version detection, while keeping the v2 runtime path unchanged.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/robots@319

commit: 63e072e

@github-actions

Copy link
Copy Markdown

📦 Package Size

No notable size changes

All tracked output (10)
Package output Gzipped Raw
@nuxtjs/robots · dependency @fingerprintjs/botd 13 kB 55 kB
@nuxtjs/robots · dependency h3 34 kB 146 kB
@nuxtjs/robots · dependency nuxt-site-config 9.8 kB 24 kB
@nuxtjs/robots · dependency nuxtseo-shared 20 kB 65 kB
@nuxtjs/robots · export . 5.3 kB 20 kB
@nuxtjs/robots · export ./content 292 B 503 B
@nuxtjs/robots · export ./util 6.6 kB 25 kB
@nuxtjs/robots · published payload 36 kB 120 kB
@nuxtjs/robots · app runtime 2.5 kB 6.2 kB
@nuxtjs/robots · server runtime 8.6 kB 22 kB
Runtime dependencies (10)
Package Dependency Requested Resolved Cost
@nuxtjs/robots @fingerprintjs/botd ^2.0.0 2.0.0 📦 13 kB gzip
@nuxtjs/robots @nuxt/kit ^4.5.2 4.5.2 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots consola ^3.4.2 3.4.2 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots defu ^6.1.7 6.1.7 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots h3 ^1.15.11 1.15.11 📦 34 kB gzip
@nuxtjs/robots nuxt-site-config ^4.2.0 4.2.0 📦 9.8 kB gzip
@nuxtjs/robots nuxtseo-shared ^5.3.11 5.3.11 📦 20 kB gzip
@nuxtjs/robots pathe ^2.0.3 2.0.3 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots pkg-types ^2.3.1 2.3.1 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots ufo ^1.6.4 1.6.4 ♻️ free via Nuxt 4.5.2

Baseline: main_@_ab34ffa___2026-08-12 · gzip is the comparison metric · changes below 16 B gzip are ignored

@harlan-zw

harlan-zw commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

🤖 BLOCKED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Human merge decision still required.

▓▓▓▓▓ 100%

  • Open: Documented public option disableNuxtContentIntegration is never read, and this PR makes the content:file:afterParse hook registration unconditional, so users who set the documented opt-out still get the integration and there is no way t. Next: Guard the unconditional registration with if (!config.disableNuxtContentIntegration) (or read the option where the integration is set up) and add a regression test that disables the integration and asserts no robots meta is produced; othe

  • Open: The now-always-registered content:file:afterParse handler reads ctx.content.robots without guarding ctx.content. Any generic provider that fires the Nuxt-level hook with a v2-shaped payload (the parsed document as the first argument,. Next: Use an optional guard (e.g., if (typeof ctx.content?.robots === 'undefined') return) and add a test for a hook context with a missing or null content to prove the handler is a no-op rather than a throw.

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