Skip to content

Conversation

@maximepvrt
Copy link
Contributor

@farnabaz I realized I forgot to commit everything in my PR #3661. With this update, I was wondering if we could also simplify the usage when it’s combined with inherit?

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Jan 7, 2026

@maximepvrt is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

Line 92 still uses the old property(z.object({})).inherit() syntax while line 38 was updated to the new simplified property().inherit() syntax in the same file. This appears to be an incomplete refactoring.

View Details
📝 Patch Details
diff --git a/playground/content.config.ts b/playground/content.config.ts
index 618fa5a4..bff602b5 100644
--- a/playground/content.config.ts
+++ b/playground/content.config.ts
@@ -89,7 +89,7 @@ const collections = {
   buttons: defineCollection({
     type: 'data',
     source: 'testd/**',
-    schema: property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),
+    schema: property().inherit('@nuxt/ui/components/Button.vue'),
   }),
   contentV2: defineCollection({
     type: 'page',

Analysis

Incomplete refactoring: property(z.object({})).inherit() in playground/content.config.ts

What fails: Inconsistent use of the property() API - line 38 uses the new simplified property().inherit() syntax while line 92 still uses the old property(z.object({})).inherit() syntax, despite both having identical usage patterns.

How to reproduce: Line 38 (content collection):

testd: property().inherit('components/TestD.vue'),

Line 92 (buttons collection):

schema: property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),

Both lines use .inherit() with a component path, but employ different property() syntax.

Result: Recent commit e3ddbb5 (Jan 7, 2026) updated the playground to use the simplified syntax on line 38, but line 92 was missed. The property() function signature in src/utils/schema/index.ts shows the input parameter is optional (input?: T), and both syntaxes are functionally equivalent when using .inherit().

Expected: Both lines should use the consistent new simplified syntax property().inherit() per the API refactoring in commit e3ddbb5.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 7, 2026

npm i https://pkg.pr.new/@nuxt/content@3675

commit: 5990423

@farnabaz
Copy link
Member

Do you mean using inherit with property() like property().inherit(....)? Or you have another proposal?

@maximepvrt
Copy link
Contributor Author

@farnabaz Yes, exactly ! the goal is to avoid having to write z.object({}) when there’s nothing to define, and just use property().editor() or property().inherit() directly.

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