-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
docs: improve @nuxt/kit
documentation
#31793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
7d43836
to
5ab9a42
Compare
dd914a9
to
f5f6d14
Compare
WalkthroughThe documentation for various Nuxt Kit APIs has undergone extensive restructuring and clarification across multiple areas. For module utilities, verbose TypeScript interface declarations have been replaced with concise usage examples, markdown tables summarising parameters, and new sections on module compatibility and programmatic installation. Template utilities documentation now features practical examples, property tables, and introduces the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🪛 LanguageTooldocs/3.api/5.kit/5.components.md[misspelling] ~131-~131: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’. (EN_A_VS_AN) 🔇 Additional comments (5)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (11)
docs/3.api/5.kit/7.pages.md (1)
112-113
: Improve parameter descriptions and markdown formattingThe
route
andrule
descriptions are clear; however, consider replacing the trailing backslash (\
) used for the line break with two spaces at the end of the line to follow standard Markdown conventions.docs/3.api/5.kit/12.resolving.md (2)
67-77
: Clarify Default Options in the Example
The addeddefaults: { prefix: 'Headless' }
configuration object in the example is never referenced or used later in the snippet. Consider either demonstrating howprefix
influences component names or removing it to avoid confusion.
91-96
: Document AdditionaladdComponent
Options
The example now passesmode: 'all'
toaddComponent
, but there is no explanation or link to theaddComponent
API that definesmode
. It would be helpful to add a brief note or a link to theaddComponent
documentation to explain available modes and their effects.docs/3.api/5.kit/14.builder.md (2)
3-3
: Refine Documentation Description Grammar
Change the description fromNuxt Kit provides a set of utilities to help you work with the builder.
toNuxt Kit provides a set of utilities to help you work with builder configurations.
for clarity.
11-11
: Grammar Fix: Subject-Verb Agreement
ReplaceNuxt have builders based on...
withNuxt has builders based on...
orNuxt provides builders based on...
to correct the verb agreement.docs/3.api/5.kit/11.nitro.md (3)
15-17
: addServerHandler documentation is clear and well-structured.
The new description, usage example, parameter table, and code snippets provide a concise yet comprehensive overview of how to add Nitro handlers. Consider refining minor grammar in the parameters table for consistency, e.g., “Path to event handler” → “Path to the event handler” and “If an empty string used” → “If an empty string is used”.Also applies to: 19-32, 42-50, 52-56, 60-67, 75-85
92-99
: addDevServerHandler section looks good and informative.
The usage example and parameter definitions clearly differentiate dev-only handlers. You may want to standardise phrasing: change “Excluded from production build” → “Excluded from the production build” for consistency.Also applies to: 105-111, 124-130
197-204
: addServerPlugin documentation improvements.
The usage snippet and parameter table are well presented. One nit: ensure consistency in describing theplugin
path, e.g., “Path to the plugin.” → “Path to the plugin file.”Also applies to: 218-221
docs/3.api/5.kit/9.plugins.md (1)
11-12
: addPlugin section is well reorganised with clear usage and parameter tables.
The revised examples and structured tables significantly improve readability. As a small refinement, consider specifying “the plugin file” consistently in thesrc
description and adding “the” in phrases like “plugin array” → “the plugins array” for consistency.Also applies to: 15-16, 21-36, 39-42, 44-54, 56-58, 68-95
docs/3.api/5.kit/2.programmatic.md (1)
20-23
:loadNuxt
signature and parameter description are concise.
The switch to a simplefunction
returning a promise is clear. Consider refining the description at line 15 from “instantiate and return the promise with Nuxt instance” to better reflect returning a promise that resolves to the Nuxt instance.Also applies to: 25-31
docs/3.api/5.kit/3.compatibility.md (1)
17-24
:checkNuxtCompatibility
section is concise and informative.
The usage example, type signature, and constraints table clearly explain how to validate versions. Consider adding “the” in descriptions for uniformity, e.g., “If not provided, it will be retrieved from the context viauseNuxt()
call” → “If not provided, it will be retrieved from the context via theuseNuxt()
call.”Also applies to: 37-38, 42-48
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
docs/3.api/5.kit/1.modules.md
(2 hunks)docs/3.api/5.kit/10.runtime-config.md
(1 hunks)docs/3.api/5.kit/10.templates.md
(2 hunks)docs/3.api/5.kit/11.nitro.md
(11 hunks)docs/3.api/5.kit/12.resolving.md
(7 hunks)docs/3.api/5.kit/13.logging.md
(2 hunks)docs/3.api/5.kit/14.builder.md
(2 hunks)docs/3.api/5.kit/2.programmatic.md
(4 hunks)docs/3.api/5.kit/3.compatibility.md
(3 hunks)docs/3.api/5.kit/4.autoimports.md
(3 hunks)docs/3.api/5.kit/5.components.md
(3 hunks)docs/3.api/5.kit/6.context.md
(3 hunks)docs/3.api/5.kit/7.pages.md
(2 hunks)docs/3.api/5.kit/8.layout.md
(1 hunks)docs/3.api/5.kit/9.plugins.md
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/3.api/5.kit/13.logging.md
[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...aInstance ``` ### Parameters tag
: A tag to suffix all log messages with. ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~41-~41: Loose punctuation mark.
Context: ...ix all log messages with. options
: Consola configuration options. ### Exa...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/1.modules.md
[style] ~156-~156: To form a complete sentence, be sure to include a subject.
Context: ... | true
| The module to install. Can be either a string with the module name...
(MISSING_IT_THERE)
docs/3.api/5.kit/7.pages.md
[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)
[uncategorized] ~62-~62: Loose punctuation mark.
Context: ...patterns with specific route settings. ::tip You can read more about Nitro route...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~64-~64: Loose punctuation mark.
Context: ...tro.unjs.io/guide/routing#route-rules). :: ::tip{icon="i-lucide-video" to="https...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~66-~66: Loose punctuation mark.
Context: ...unjs.io/guide/routing#route-rules). :: ::tip{icon="i-lucide-video" to="https://v...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~68-~68: Loose punctuation mark.
Context: ...ding route rules and route middelwares. :: ### Usage ```ts twoslash import { cr...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~114-~114: Loose punctuation mark.
Context: ...uration to apply to the matched route. ::tip About route rules configurations, y...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~116-~116: Loose punctuation mark.
Context: .../guide/concepts/rendering#route-rules). :: options: A object to pass to the ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~129-~129: A different word order might sound more natural.
Context: ...specific routes. Route middlewares can be also defined in plugins via [`addRouteMiddle...
(AI_HYDRA_LEO_WORD_ORDER)
[uncategorized] ~130-~130: Loose punctuation mark.
Context: ...tils/add-route-middleware) composable. ::tip Read more about route middlewares i...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~132-~132: Loose punctuation mark.
Context: ...ting-started/routing#route-middleware). :: ::tip{icon="i-lucide-video" to="https...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~134-~134: Loose punctuation mark.
Context: ...-started/routing#route-middleware). :: ::tip{icon="i-lucide-video" to="https://v...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~136-~136: Loose punctuation mark.
Context: ...ding route rules and route middelwares. :: ### Usage ::code-group ```ts twosla...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~140-~140: Loose punctuation mark.
Context: ...s and route middelwares. :: ### Usage ::code-group ```ts twoslash [module.ts] ...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/8.layout.md
[uncategorized] ~46-~46: Loose punctuation mark.
Context: ...: void ``` ### Parameters layout
: A template object or a string with the ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~57-~57: Loose punctuation mark.
Context: ... | name
: The name to register the layout under (...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~96-~96: Loose punctuation mark.
Context: ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~98-~98: Loose punctuation mark.
Context: ...to the first argument of
addLayout`. ::
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/14.builder.md
[uncategorized] ~38-~38: Loose punctuation mark.
Context: ...s?: ExtendViteConfigOptions): void ``` ::read-more{to="https://vite.dev/config" ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...re information about its configuration. :: ### Parameters callback
: A cal...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~45-~45: Loose punctuation mark.
Context: ...tion. :: ### Parameters callback
: A callback function that will be called...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~47-~47: Loose punctuation mark.
Context: ...ite configuration object. options
: Options to pass to the callback functio...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~83-~83: Loose punctuation mark.
Context: ... ExtendWebpackConfigOptions): void ``` ::read-more{to="https://webpack.js.org/co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~85-~85: Loose punctuation mark.
Context: ...re information about its configuration. :: ### Parameters callback
: A cal...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~90-~90: Loose punctuation mark.
Context: ...tion. :: ### Parameters callback
: A callback function that will be called...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~92-~92: Loose punctuation mark.
Context: ...ack configuration object. options
: Options to pass to the callback functio...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~133-~133: Loose punctuation mark.
Context: ...s?: ExtendViteConfigOptions): void ``` ::tip See [Vite website](https://vite.dev...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~135-~135: Loose punctuation mark.
Context: ...to find a plugin that suits your needs. :: ### Parameters pluginOrGetter
:...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~140-~140: Loose punctuation mark.
Context: ...:: ### Parameters pluginOrGetter
: A Vite plugin instance or an array of V...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~142-~142: Loose punctuation mark.
Context: ...of Vite plugin instances. options
: Options to pass to the callback functio...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~188-~188: Loose punctuation mark.
Context: ... ExtendWebpackConfigOptions): void ``` ::tip See [webpack website](https://webpa...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~190-~190: Loose punctuation mark.
Context: ...to find a plugin that suits your needs. :: ### Parameters pluginOrGetter
:...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~195-~195: Loose punctuation mark.
Context: ...:: ### Parameters pluginOrGetter
: A webpack plugin instance or an array o...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~197-~197: Loose punctuation mark.
Context: ...webpack plugin instances. options
: Options to pass to the callback functio...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~219-~219: Loose punctuation mark.
Context: ...``` ### Parameters pluginFactory
: A factory function that returns an obje...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~219-~219: Possible missing comma found.
Context: ...gin instance or an array of Vite plugin instances and/or a webpack plugin instance or an ...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~221-~221: Loose punctuation mark.
Context: ...webpack plugin instances. options
: Options to pass to the callback functio...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/9.plugins.md
[uncategorized] ~16-~16: Loose punctuation mark.
Context: ...ugin and adds it to the plugins array. ::tip{icon="i-lucide-video" to="https://v...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~18-~18: Loose punctuation mark.
Context: ...tch Vue School video about addPlugin
. :: ### Usage ```ts twoslash import { ad...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~46-~46: Loose punctuation mark.
Context: ...Plugin ``` ### Parameters plugin
: A plugin object or a string with the pa...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~53-~53: You might be missing the article “the” here.
Context: ...and .server
modifiers when specifying src
option to use plugin only in client...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~53-~53: You might be missing the article “the” here.
Context: ...ers when specifying src
option to use plugin only in client or server side. | | `ord...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~53-~53: The preposition “on” seems more likely in this position than the preposition “in”.
Context: ...cifying src
option to use plugin only in client or server side. | | order
| `...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_IN_ON)
[uncategorized] ~53-~53: You might be missing the article “the” here.
Context: ...ying src
option to use plugin only in client or server side. | | order
| number
...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~55-~55: Loose punctuation mark.
Context: ...s that run after Nuxt plugins). | ::warning Avoid using order
unless nece...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~57-~57: Loose punctuation mark.
Context: ...o register plugins after Nuxt defaults. :: options
: Optional object with t...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~60-~60: Loose punctuation mark.
Context: ...s after Nuxt defaults. :: options
: Optional object with the following prop...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~67-~67: Loose punctuation mark.
Context: .... Defaults to false
. | ### Examples ::code-group ```ts [module.ts] import { ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~104-~104: Loose punctuation mark.
Context: ...School video about addPluginTemplate
. :: ### Usage ```ts twoslash import { ad...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~136-~136: Loose punctuation mark.
Context: ...``` ### Parameters pluginOptions
: A plugin template object with the follo...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~143-~143: You might be missing the article “the” here.
Context: ...and .server
modifiers when specifying src
option to use plugin only in client...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~143-~143: You might be missing the article “the” here.
Context: ...ers when specifying src
option to use plugin only in client or server side. | | `opt...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~143-~143: The preposition “on” seems more likely in this position than the preposition “in”.
Context: ...cifying src
option to use plugin only in client or server side. | | options
...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_IN_ON)
[uncategorized] ~143-~143: You might be missing the article “the” here.
Context: ...ying src
option to use plugin only in client or server side. | | options
| `Re...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~148-~148: Loose punctuation mark.
Context: ...s that run after Nuxt plugins). | ::warning Prefer using getContents
for ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~150-~150: Loose punctuation mark.
Context: ...Avoid setting order
unless necessary. :: options
: Optional object with t...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~153-~153: Loose punctuation mark.
Context: ...der unless necessary. :: **
options`**: Optional object with the following prop...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~192-~192: Loose punctuation mark.
Context: ...pending on the provided configuration. ::code-group ```ts [nuxt.config.ts] expo...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~215-~215: Loose punctuation mark.
Context: ...config["idPrefix"] = "nuxt" } }) ``` :: #### Using an EJS template to generat...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~221-~221: Loose punctuation mark.
Context: ...mplate to generate the plugin content. ::code-group ```ts [module.ts] import { ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~261-~261: Loose punctuation mark.
Context: ... firebaseApp) } <% } %> }) ``` :: ::warning If you set `compatibilityVersio...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~263-~263: Loose punctuation mark.
Context: ...ved entirely in the next major version. ::
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/12.resolving.md
[uncategorized] ~38-~38: Loose punctuation mark.
Context: ... ``` ### Parameters path
: A path to resolve. `options`: Opti...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...th**: A path to resolve. **
options`**: Options to pass to the resolver. This o...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~48-~48: The word “fallback” is a noun. The verb is spelled with a white space.
Context: ... | false
| Whether to fallback to the original path if the resolved pa...
(NOUN_VERB_CONFUSION)
[uncategorized] ~112-~112: Loose punctuation mark.
Context: ...: string ``` ### Parameters path
: A path to resolve. `alias`: An obj...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~114-~114: Loose punctuation mark.
Context: ...path**: A path to resolve. **
alias`**: An object of aliases. If not provided, ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~145-~145: Loose punctuation mark.
Context: ...| null> ``` ### Parameters paths
: A path or an array of paths to resolve....
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~147-~147: Loose punctuation mark.
Context: ...rray of paths to resolve. options
: Options to pass to the resolver. This o...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~155-~155: The word “fallback” is a noun. The verb is spelled with a white space.
Context: ... | false
| Whether to fallback to the original path if the resolved pa...
(NOUN_VERB_CONFUSION)
[uncategorized] ~185-~185: Loose punctuation mark.
Context: ...lver ``` ### Parameters basePath
: A base path to resolve from. It can be ...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/11.nitro.md
[uncategorized] ~50-~50: You might be missing the article “the” here.
Context: ... | false
| Router method matcher. If handler name contains method name, it will be u...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~50-~50: You might be missing the article “a” here.
Context: ...ethod matcher. If handler name contains method name, it will be used as a default valu...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~57-~57: Loose punctuation mark.
Context: ...add a server handler from your module. ::code-group ```ts twoslash [module.ts] ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~330-~330: Loose punctuation mark.
Context: ...ctions from a custom server directory. ::code-group ```ts twoslash [module.ts] ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~354-~354: Loose punctuation mark.
Context: ...ntimeConfig() return apiSecret } ``` :: You can then use the useApiSecret
f...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~370-370: Loose punctuation mark./server/rou...
Context: ...ed just like the ~/server
folder is. ::note Only ~/server/api
, `
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~372-372: Loose punctuation mark./server/utils` are scanned. :: ### Usage ```ts twoslash import { de...
Context: ...are, and
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~408-~408: Loose punctuation mark.
Context: ...want to add a custom server directory. ::code-group ```ts twoslash [module.ts] ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~430-~430: Loose punctuation mark.
Context: ...return 'Hello from server utils!' } ``` :: You can then use the hello
function...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/6.context.md
[uncategorized] ~12-~12: Loose punctuation mark.
Context: ...hout having to pass it as an argument. ::note When you're working with the `setu...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~14-~14: Loose punctuation mark.
Context: ...ly without needing to call useNuxt()
. :: ## useNuxt
Get the Nuxt instance f...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~53-~53: Loose punctuation mark.
Context: ... | ### Examples ::code-group ```ts twoslash [setupTransp...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~115-~115: Loose punctuation mark.
Context: ...n the useNuxt
section. ### Examples ::code-group ```ts twoslash [requireSite...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/2.programmatic.md
[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...> ``` ### Parameters loadOptions
: Loading conditions for Nuxt. `loadNuxt`...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~44-~44: Loose punctuation mark.
Context: ...ise ``` ### Parameters nuxt
: Nuxt instance to build. It can be retri...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~58-~58: Loose punctuation mark.
Context: ...ions> ``` ### Parameters options
: Options to pass in [`c12`](https://gith...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~72-~72: Loose punctuation mark.
Context: ...t): void ``` ### Parameters nuxt
: Nuxt instance to build. It can be retri...
(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/10.templates.md
[style] ~82-~82: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...a virtual file named meta.config.mjs
. In the runtime plugin, we can import it us...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
docs/3.api/5.kit/3.compatibility.md
[uncategorized] ~42-~42: Loose punctuation mark.
Context: ...; ``` ### Parameters constraints
: Version and builder constraints to chec...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~49-~49: Loose punctuation mark.
Context: .... Use false
to disable. | nuxt
: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~63-~63: Loose punctuation mark.
Context: ...; ``` ### Parameters constraints
: Version and builder constraints to chec...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~65-~65: Loose punctuation mark.
Context: ...](#parameters) for details. **
nuxt`**: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~96-~96: Loose punctuation mark.
Context: ...; ``` ### Parameters constraints
: Version and builder constraints to chec...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~98-~98: Loose punctuation mark.
Context: ...](#parameters) for details. **
nuxt`**: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...all. ## isNuxtMajorVersion
Check if current Nuxt instance is of specified major ver...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...` Check if current Nuxt instance is of specified major version ### Usage ```ts twoslas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~127-~127: Loose punctuation mark.
Context: ...oolean; ``` ### Parameters major
: Major version to check against. **`nux...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~129-~129: Loose punctuation mark.
Context: ...or version to check against. nuxt
: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~134-~134: Loose punctuation mark.
Context: ...ks if the current Nuxt version is 3.x. ::note Use isNuxtMajorVersion(2, nuxt)
...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~136-~136: Loose punctuation mark.
Context: ...@nuxt/kit v5 or a future major version. :: ### Type ```ts function isNuxt3(nuxt...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~147-~147: Loose punctuation mark.
Context: ...boolean; ``` ### Parameters nuxt
: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~152-~152: Loose punctuation mark.
Context: ...ks if the current Nuxt version is 2.x. ::note Use isNuxtMajorVersion(2, nuxt)
...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~154-~154: Loose punctuation mark.
Context: ...@nuxt/kit v5 or a future major version. :: ### Type ```ts function isNuxt2(nuxt...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~165-~165: Loose punctuation mark.
Context: ...boolean; ``` ### Parameters nuxt
: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~179-~179: Loose punctuation mark.
Context: ... string; ``` ### Parameters nuxt
: Nuxt instance. If not provided, it will...
(UNLIKELY_OPENING_PUNCTUATION)
🔇 Additional comments (53)
docs/3.api/5.kit/4.autoimports.md (1)
61-61
: Standardise table column headerRenamed the parameter table header from “Prop” to “Property” across
addImports
,addImportsDir
andaddImportsSources
for improved clarity and consistency with other Nuxt Kit docs.Also applies to: 101-101, 141-141
docs/3.api/5.kit/5.components.md (1)
49-49
: Consistent parameter table header renameThe column header has been updated from “Prop” to “Property” in both the
addComponentsDir
andaddComponent
parameter tables, aligning with the overall documentation style.Also applies to: 69-69, 113-113
docs/3.api/5.kit/10.runtime-config.md (1)
25-29
: Add explicit Type signatureThe new “Type” subsection clearly shows:
function updateRuntimeConfig (config: Record<string, unknown>): void | Promise<void>This aligns with other API sections and enhances clarity.
docs/3.api/5.kit/13.logging.md (1)
17-29
: AdduseLogger
Usage exampleThe newly introduced “Usage” section with a minimal
ts twoslash
code block demonstrates how to import and invokeuseLogger
, improving hands-on guidance.docs/3.api/5.kit/7.pages.md (12)
19-37
: AddextendPages
Usage exampleThe new
ts twoslash
example forextendPages
clearly illustrates how to register and modify routes within a Nuxt module.
42-43
: DocumentextendPages
Type signatureIncluding the explicit signature
function extendPages(callback: (pages: NuxtPage[]) => void): voidaligns with the rest of the Kit docs and aids discoverability.
47-48
: Clarifycallback
parameterThe description concisely explains how to mutate the provided
pages
array in-place, which is accurate and helpful.
49-57
: CreateNuxtPage
property tableThe property table for
NuxtPage
(name, path, file, meta, alias, redirect, children) is well-structured and enhances readability.🧰 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)
71-102
: AddextendRouteRules
Usage exampleThe new snippet demonstrates both redirect and cache rules in context, giving users a quickstart on route-level configuration.
107-108
: DocumentextendRouteRules
Type signatureExplicitly showing
function extendRouteRules(route: string, rule: NitroRouteConfig, options?: ExtendRouteRulesOptions): voidmaintains consistency across the API docs.
119-119
: Clarifyoptions
parameterThe concise description of the
options
object and itsoverride
flag is accurate and easy to understand.
121-123
: CreateExtendRouteRulesOptions
tableThe table neatly summarises the
override
property and its default, improving quick reference.
139-157
: AddaddRouteMiddleware
Usage exampleThe
code-group
containing both the module definition and the runtime middleware file gives a comprehensive view of how to register and implement custom route middleware.🧰 Tools
🪛 LanguageTool
[uncategorized] ~140-~140: Loose punctuation mark.
Context: ...s and route middelwares. :: ### Usage ::code-group ```ts twoslash [module.ts] ...(UNLIKELY_OPENING_PUNCTUATION)
172-174
: DocumentaddRouteMiddleware
Type signatureShowing
function addRouteMiddleware(input: NuxtMiddleware | NuxtMiddleware[], options?: AddRouteMiddlewareOptions): voidis consistent with the documentation style and clarifies expected inputs.
178-184
: Defineinput
parameter and tableThe table under
input
clearly outlines required middleware properties (name
,path
,global
), which is helpful for end-users.
186-192
: Defineoptions
parameter and tableThe table summarising the
override
andprepend
options with their defaults is concise and informative.docs/3.api/5.kit/8.layout.md (1)
21-36
: Usage Example Is Clear and Well-Structured
The new Usage section preceding the type signature provides a concise, copy-and-pasteable example that clearly demonstrates how to calladdLayout
within a Nuxt module. The imports andcreateResolver
usage are correct and align with the surrounding documentation style.docs/3.api/5.kit/12.resolving.md (1)
17-28
: Approve: First-Class Usage Example
The Usage block forresolvePath
now appears before the type and parameter tables, improving discoverability. The asynchronous example insidedefineNuxtModule
correctly showsawait resolvePath
with logging, which aligns with the PR’s pattern of usage-first documentation.docs/3.api/5.kit/14.builder.md (4)
17-30
: Approve:extendViteConfig
Usage
TheextendViteConfig
usage snippet clearly demonstrates how to manipulateoptimizeDeps
using the logical OR assignment operator (||=
). Its placement before the type section follows the PR’s usage-first pattern.
67-74
: Approve:extendWebpackConfig
Usage
TheextendWebpackConfig
example is concise and shows how to push a new rule for.txt
files. The indentation and code fence style remain consistent with the rest of the docs.
109-124
: Approve:addVitePlugin
Usage
This snippet clearly illustrates adding a Vite plugin usingaddVitePlugin
, and it remains consistent with the patterns for options and imports shown elsewhere.
160-179
: Approve:addWebpackPlugin
Usage
The webpack plugin example usingEslintWebpackPlugin
is well-formatted and correctly shows how to pass custom options and disable server linting.docs/3.api/5.kit/1.modules.md (7)
17-36
: Approve:defineNuxtModule
Usage Example
The new Usage section demonstrates a minimal module definition withmeta
,defaults
, andsetup
, matching the PR’s goal of concise, example-driven docs.
38-41
: Approve: Type Signature Clarity
The type signaturefunction defineNuxtModule (definition: ModuleDefinition | NuxtModule): NuxtModule
is concise and correctly presented.
44-46
: Approve: Parameters Table Introduction
Replacing the verbose interface declaration with a concise parameters table improves readability and maintenance.
71-74
: Approve:configKey
Example
The snippet showing how to useconfigKey
innuxt.config
is helpful, with clear property names and indentation.
85-89
: Approve:nuxt.config
Configuration Snippet
Displaying how users can disable the module vianuxt.config
under themyModule
key aligns well with the documentedconfigKey
feature.
97-103
: Approve: Compatibility Example
The compatibility example withcompatibility.nuxt
is clear; the semver snippet and warning message make it easy to understand version constraints.
126-129
: Approve:installModule
Example
This usage example demonstrates programmatic module installation with inline options, fulfilling the PR objective of richer usage scenarios.docs/3.api/5.kit/6.context.md (9)
11-14
: Approve: Introductory Paragraph Revision
The revised introduction succinctly highlightsuseNuxt
andtryUseNuxt
utilities, improving clarity over the previous verbose description.🧰 Tools
🪛 LanguageTool
[uncategorized] ~12-~12: Loose punctuation mark.
Context: ...hout having to pass it as an argument. ::note When you're working with the `setu...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~14-~14: Loose punctuation mark.
Context: ...ly without needing to calluseNuxt()
. :: ##useNuxt
Get the Nuxt instance f...(UNLIKELY_OPENING_PUNCTUATION)
21-27
: Approve:useNuxt
Usage Example
The new minimal usage snippet makes it easy to understand how to import and calluseNuxt()
in any context.
35-37
: Approve:useNuxt
Type Signature
The type block is concise and correctly showsfunction useNuxt(): Nuxt
.
42-42
: Approve: Return Value Description
The added description of the returned Nuxt instance properties clarifies the API without overwhelming readers.
56-67
: Approve:setupTranspilation
Example
The groupedsetupTranspilation
example effectively demonstrates conditional usage ofnuxt.options
and logical OR assignment.
85-96
: Approve:tryUseNuxt
Usage Example
The snippet clearly contrasts handling when Nuxt is unavailable, showcasing fallback logic.
104-105
: Approve:tryUseNuxt
Type Signature
The function signature block is presented consistently and correctly shows the return typeNuxt | null
.
110-112
: Approve:tryUseNuxt
Return Value Description
The clarification thattryUseNuxt
returnsnull
when Nuxt is not available aligns with developer expectations.
118-142
: Approve:requireSiteConfig
Examples
The combined examples forrequireSiteConfig
and how to consume its output in a module demonstrate real-world use cases and correctly reflect the updated nullabletitle
property.docs/3.api/5.kit/11.nitro.md (4)
166-172
: useNitro usage example is concise and accurate.
Great addition of a clear usage snippet. Approving.Also applies to: 175-178
255-259
: addPrerenderRoutes examples and type signature align well.
The usage scenario is clear. Approving changes.Also applies to: 262-265
295-300
: addServerImportsDir usage and parameter table are well formatted.
The examples and table improve clarity. No changes needed.Also applies to: 320-324
330-332
: addServerScanDir note and usage snippet are helpful.
The note clearly outlines default scan directories. Example usage is concise. Approving.Also applies to: 334-338
🧰 Tools
🪛 LanguageTool
[uncategorized] ~330-~330: Loose punctuation mark.
Context: ...ctions from a custom server directory. ::code-group ```ts twoslash [module.ts] ...(UNLIKELY_OPENING_PUNCTUATION)
docs/3.api/5.kit/9.plugins.md (1)
107-126
: addPluginTemplate section offers comprehensive examples and tables.
The dynamic generation and EJS template samples are valuable. For consistency, you might rephrase the warning at line 263 from “If you setcompatibilityVersion
to4
” to “WhencompatibilityVersion
is set to4
, …”. Otherwise, this is an excellent enhancement.Also applies to: 128-132, 136-148, 149-158, 165-189, 194-214, 218-236, 262-264
docs/3.api/5.kit/2.programmatic.md (2)
39-42
:buildNuxt
documentation is accurate and clear.
The type signature and parameter description clearly convey usage. No changes needed.Also applies to: 44-46
53-54
:loadNuxtConfig
signature and parameters look correct.
The concise table for options improves readability. Approving.Also applies to: 58-60
docs/3.api/5.kit/10.templates.md (4)
15-17
:addTemplate
section is clearer and more developer-friendly.
The new description, usage example, type signature, and concise parameter table effectively replace the verbose interface. Excellent work.Also applies to: 19-22, 30-33, 41-42, 44-55, 63-67
104-113
:addTypeTemplate
section improvements are excellent.
The added usage example and context parameter explanation enrich the documentation. Everything is spot on.Also applies to: 124-127, 131-138, 150-158
192-197
:addServerTemplate
documentation is comprehensive.
The new section with clear usage, type signature, and parameter details is highly beneficial. Approving.Also applies to: 199-208, 213-217, 223-227, 230-237
263-272
:updateTemplates
section is well-structured and clear.
The usage scenario, type signature, and parameter table cover all necessary details. No further changes needed.Also applies to: 285-289, 293-297
docs/3.api/5.kit/3.compatibility.md (4)
57-59
:assertNuxtCompatibility
signature and behaviour are well-documented.
The promise return value and error semantics are clear. Approving.
71-75
:hasNuxtCompatibility
usage and signature are correct.
The example helps illustrate real use. No changes needed.Also applies to: 91-92
101-104
:isNuxtMajorVersion
documentation is clear and precise.
The description and signature are accurately presented. Approving.Also applies to: 121-122
🧰 Tools
🪛 LanguageTool
[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...all. ##isNuxtMajorVersion
Check if current Nuxt instance is of specified major ver...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...` Check if current Nuxt instance is of specified major version ### Usage ```ts twoslas...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
133-137
: Deprecation notes forisNuxt3
andisNuxt2
are appropriate.
The guidance to preferisNuxtMajorVersion
is helpful. Approving.Also applies to: 149-153
🧰 Tools
🪛 LanguageTool
[uncategorized] ~134-~134: Loose punctuation mark.
Context: ...ks if the current Nuxt version is 3.x. ::note UseisNuxtMajorVersion(2, nuxt)
...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~136-~136: Loose punctuation mark.
Context: ...@nuxt/kit v5 or a future major version. :: ### Type ```ts function isNuxt3(nuxt...(UNLIKELY_OPENING_PUNCTUATION)
**`tag`**: A tag to suffix all log messages with. | ||
|
||
**Type**: `Partial<ConsolaOptions>` | ||
|
||
**Optional**: `true` | ||
|
||
Consola configuration options | ||
**`options`**: Consola configuration options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Parameter description for tag
seems inverted
The documentation states that tag
will suffix log messages, but in practice it prepends (prefixes) the tag to log entries. Please verify the intended behaviour and correct the description.
🏁 Script executed:
#!/bin/bash
# Search for usage of `withTag` or tag handling in the Kit logging implementation
rg -n "withTag" -A5 -B5 .
rg -n "tag" -A5 -B5 packages/kit
Length of output: 5612
Update tag
description from “suffix” to “prefix”
The useLogger(tag, options)
implementation calls consola.create(options).withTag(tag)
, which prefixes the tag to each message (it doesn’t suffix). Please adjust the docs accordingly:
• File: docs/3.api/5.kit/13.logging.md
Lines: 39–41
- **`tag`**: A tag to suffix all log messages with.
+ **`tag`**: A tag to prefix all log messages with.
**`options`**: Consola configuration options.
📝 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.
**`tag`**: A tag to suffix all log messages with. | |
**Type**: `Partial<ConsolaOptions>` | |
**Optional**: `true` | |
Consola configuration options | |
**`options`**: Consola configuration options. | |
**`tag`**: A tag to prefix all log messages with. | |
**`options`**: Consola configuration options. |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...aInstance ``` ### Parameters tag
: A tag to suffix all log messages with. ...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~41-~41: Loose punctuation mark.
Context: ...ix all log messages with. options
: Consola configuration options. ### Exa...
(UNLIKELY_OPENING_PUNCTUATION)
🔗 Linked issue
📚 Description
This PR refines the documentation for
@nuxt/kit
with the following improvements:Usage:
Adds a minimal usage example to help users quickly understand how to use the function.
Type (or Type Signature):
Replaces detailed type definitions with simplified syntax signatures. As mentioned in Standardizing section order in Nuxt documentation for better readability #30930 (comment), this helps prevent the documentation from becoming outdated as types evolve across versions.
Parameters:

Reformats the "Parameters" section using tables for improved readability. The new format will look like this:
Examples:
Adds more usage scenarios to demonstrate how these functions behave in context and how their parameters can be applied in different situations.
If there's anything incorrect or if you have any suggestions, please feel free to let me know. Thank you!