feat(schema): add augmentable NuxtPageMeta interface for NuxtPage.meta#34816
feat(schema): add augmentable NuxtPageMeta interface for NuxtPage.meta#34816
NuxtPageMeta interface for NuxtPage.meta#34816Conversation
|
|
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
WalkthroughA new 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/4.api/5.kit/7.pages.md`:
- Line 54: Update the table description for the `meta` entry so the sentence is
complete: change the fragment "Can be used in layouts, middlewares, or
navigation guards." to "It can be used in layouts, middlewares, or navigation
guards." in the row that lists `meta` with type `NuxtPageMeta`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d0fb1c67-f918-4e4d-ae76-533a7df76818
📒 Files selected for processing (4)
docs/4.api/5.kit/7.pages.mdpackages/nuxt/src/pages/utils.tspackages/schema/src/index.tspackages/schema/src/types/hooks.ts
| | `path` | `string` | `false` | The route URL path. If not set, Nuxt will infer it from the file location. | | ||
| | `file` | `string` | `false` | Path to the Vue file that should be used as the component for the route. | | ||
| | `meta` | `Record<string, any>`{lang="ts"} | `false` | Custom metadata for the route. Can be used in layouts, middlewares, or navigation guards. | | ||
| | `meta` | `NuxtPageMeta`{lang="ts"} | `false` | Custom metadata for the route. Can be used in layouts, middlewares, or navigation guards. | |
There was a problem hiding this comment.
Minor wording fix for sentence completeness.
Please change “Can be used …” to “It can be used …” for a complete sentence in the table description.
✏️ Suggested edit
-| `meta` | `NuxtPageMeta`{lang="ts"} | `false` | Custom metadata for the route. Can be used in layouts, middlewares, or navigation guards. |
+| `meta` | `NuxtPageMeta`{lang="ts"} | `false` | Custom metadata for the route. It can be used in layouts, middlewares, or navigation guards. |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | `meta` | `NuxtPageMeta`{lang="ts"} | `false` | Custom metadata for the route. Can be used in layouts, middlewares, or navigation guards. | | |
| | `meta` | `NuxtPageMeta`{lang="ts"} | `false` | Custom metadata for the route. It can be used in layouts, middlewares, or navigation guards. | |
🧰 Tools
🪛 LanguageTool
[style] ~54-~54: To form a complete sentence, be sure to include a subject.
Context: ...alse` | Custom metadata for the route. Can be used in layouts, middlewares, or nav...
(MISSING_IT_THERE)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/4.api/5.kit/7.pages.md` at line 54, Update the table description for the
`meta` entry so the sentence is complete: change the fragment "Can be used in
layouts, middlewares, or navigation guards." to "It can be used in layouts,
middlewares, or navigation guards." in the row that lists `meta` with type
`NuxtPageMeta`.
Merging this PR will not alter performance
Comparing Footnotes
|
🔗 Linked issue
Resolves: #34795
📚 Description
Introduce a
NuxtPageMetainterface that replaces the hardcodedRecord<string, any>on NuxtPage.meta.This allows module authors to augment the
metatype. Example: