@nuxt/docs-nightly 4.2.2-29382831.243261ed → 4.2.2-29385650.ab3dd9a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1.getting-started/01.introduction.md +1 -1
- package/1.getting-started/03.configuration.md +5 -5
- package/1.getting-started/04.views.md +5 -5
- package/1.getting-started/05.assets.md +7 -7
- package/1.getting-started/06.styling.md +5 -5
- package/1.getting-started/07.routing.md +7 -7
- package/1.getting-started/08.seo-meta.md +3 -3
- package/1.getting-started/09.transitions.md +6 -6
- package/1.getting-started/10.data-fetching.md +2 -2
- package/1.getting-started/11.state-management.md +2 -2
- package/1.getting-started/12.error-handling.md +3 -3
- package/1.getting-started/13.server.md +2 -2
- package/1.getting-started/14.layers.md +3 -3
- package/1.getting-started/16.deployment.md +1 -1
- package/1.getting-started/17.testing.md +1 -1
- package/1.getting-started/18.upgrade.md +6 -6
- package/2.directory-structure/0.nuxt.md +1 -1
- package/2.directory-structure/0.output.md +1 -1
- package/2.directory-structure/1.app/1.assets.md +2 -2
- package/2.directory-structure/1.app/1.components.md +2 -2
- package/2.directory-structure/1.app/1.composables.md +2 -2
- package/2.directory-structure/1.app/1.layouts.md +3 -3
- package/2.directory-structure/1.app/1.middleware.md +1 -1
- package/2.directory-structure/1.app/1.pages.md +7 -7
- package/2.directory-structure/1.app/1.plugins.md +2 -2
- package/2.directory-structure/1.app/1.utils.md +3 -3
- package/2.directory-structure/1.app/3.app.md +4 -4
- package/2.directory-structure/1.content.md +1 -1
- package/2.directory-structure/1.modules.md +1 -1
- package/2.directory-structure/1.node_modules.md +1 -1
- package/2.directory-structure/1.server.md +3 -3
- package/2.directory-structure/1.shared.md +3 -3
- package/2.directory-structure/2.env.md +2 -2
- package/2.directory-structure/2.nuxtignore.md +1 -1
- package/2.directory-structure/2.nuxtrc.md +1 -1
- package/2.directory-structure/3.nuxt-config.md +1 -1
- package/2.directory-structure/3.package.md +1 -1
- package/2.directory-structure/index.md +24 -24
- package/3.guide/1.concepts/{3.rendering.md → 1.rendering.md} +1 -27
- package/3.guide/1.concepts/{2.vuejs-development.md → 10.vuejs-development.md} +4 -3
- package/3.guide/1.concepts/{10.nuxt-lifecycle.md → 2.nuxt-lifecycle.md} +32 -25
- package/3.guide/1.concepts/{1.auto-imports.md → 3.auto-imports.md} +5 -5
- package/3.guide/1.concepts/4.server-engine.md +3 -3
- package/3.guide/1.concepts/5.modules.md +1 -1
- package/3.guide/1.concepts/7.esm.md +1 -0
- package/3.guide/1.concepts/8.typescript.md +4 -4
- package/3.guide/2.best-practices/performance.md +2 -2
- package/3.guide/3.ai/.navigation.yml +3 -0
- package/3.guide/3.ai/1.mcp.md +255 -0
- package/3.guide/3.ai/2.llms-txt.md +65 -0
- package/3.guide/{3.recipes → 4.recipes}/1.custom-routing.md +1 -1
- package/3.guide/{3.recipes → 4.recipes}/2.vite-plugin.md +1 -1
- package/3.guide/{3.recipes → 4.recipes}/3.custom-usefetch.md +1 -1
- package/3.guide/{3.recipes → 4.recipes}/4.sessions-and-authentication.md +1 -1
- package/3.guide/{4.going-further → 5.going-further}/1.events.md +2 -3
- package/3.guide/{4.going-further → 5.going-further}/1.experimental-features.md +4 -4
- package/3.guide/{4.going-further → 5.going-further}/1.internals.md +3 -2
- package/3.guide/{4.going-further → 5.going-further}/10.runtime-config.md +2 -2
- package/3.guide/{4.going-further → 5.going-further}/2.hooks.md +2 -2
- package/3.guide/{4.going-further → 5.going-further}/3.modules.md +2 -2
- package/3.guide/{4.going-further → 5.going-further}/6.nuxt-app.md +3 -3
- package/3.guide/{4.going-further → 5.going-further}/7.layers.md +11 -11
- package/4.api/1.components/12.nuxt-route-announcer.md +1 -1
- package/4.api/1.components/2.nuxt-page.md +2 -2
- package/4.api/1.components/3.nuxt-layout.md +5 -5
- package/4.api/1.components/5.nuxt-loading-indicator.md +1 -1
- package/4.api/1.components/7.nuxt-welcome.md +2 -2
- package/4.api/2.composables/use-app-config.md +1 -1
- package/4.api/2.composables/use-nuxt-app.md +4 -4
- package/4.api/2.composables/use-response-header.md +1 -1
- package/4.api/2.composables/use-route.md +1 -1
- package/4.api/2.composables/use-router.md +2 -2
- package/4.api/2.composables/use-runtime-config.md +1 -1
- package/4.api/3.utils/$fetch.md +1 -1
- package/4.api/3.utils/abort-navigation.md +1 -1
- package/4.api/3.utils/add-route-middleware.md +1 -1
- package/4.api/3.utils/define-nuxt-plugin.md +2 -2
- package/4.api/3.utils/define-nuxt-route-middleware.md +1 -1
- package/4.api/3.utils/define-page-meta.md +6 -6
- package/4.api/3.utils/navigate-to.md +1 -1
- package/4.api/3.utils/update-app-config.md +2 -2
- package/4.api/4.commands/module.md +3 -3
- package/4.api/4.commands/prepare.md +1 -1
- package/4.api/4.commands/preview.md +1 -1
- package/4.api/4.commands/typecheck.md +1 -1
- package/4.api/5.kit/1.modules.md +1 -1
- package/4.api/5.kit/2.programmatic.md +2 -2
- package/4.api/6.advanced/1.hooks.md +1 -1
- package/4.api/6.nuxt-config.md +4 -4
- package/5.community/6.roadmap.md +4 -4
- package/6.bridge/1.overview.md +1 -1
- package/6.bridge/2.typescript.md +1 -1
- package/6.bridge/3.bridge-composition-api.md +1 -1
- package/6.bridge/4.plugins-and-middleware.md +2 -2
- package/7.migration/11.server.md +1 -1
- package/7.migration/2.configuration.md +2 -2
- package/7.migration/20.module-authors.md +1 -1
- package/7.migration/3.auto-imports.md +1 -1
- package/7.migration/5.plugins-and-middleware.md +2 -2
- package/7.migration/6.pages-and-layouts.md +6 -6
- package/package.json +1 -1
- /package/3.guide/{3.recipes → 4.recipes}/.navigation.yml +0 -0
- /package/3.guide/{4.going-further → 5.going-further}/.navigation.yml +0 -0
- /package/3.guide/{4.going-further → 5.going-further}/1.features.md +0 -0
- /package/3.guide/{4.going-further → 5.going-further}/11.nightly-release-channel.md +0 -0
- /package/3.guide/{4.going-further → 5.going-further}/4.kit.md +0 -0
- /package/3.guide/{4.going-further → 5.going-further}/9.debugging.md +0 -0
- /package/3.guide/{4.going-further → 5.going-further}/index.md +0 -0
|
@@ -16,7 +16,7 @@ It is shipped with many features:
|
|
|
16
16
|
|
|
17
17
|
## API Layer
|
|
18
18
|
|
|
19
|
-
Server [API endpoints](/docs/4.x/
|
|
19
|
+
Server [API endpoints](/docs/4.x/directory-structure/server#server-routes) and [Middleware](/docs/4.x/directory-structure/server#server-middleware) are added by Nitro that internally uses [h3](https://github.com/h3js/h3).
|
|
20
20
|
|
|
21
21
|
Key features include:
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ Key features include:
|
|
|
26
26
|
|
|
27
27
|
Check out [the h3 docs](https://github.com/h3js/h3) for more information.
|
|
28
28
|
|
|
29
|
-
::read-more{to="/docs/4.x/
|
|
29
|
+
::read-more{to="/docs/4.x/directory-structure/server#server-routes"}
|
|
30
30
|
Learn more about the API layer in the `server/` directory.
|
|
31
31
|
::
|
|
32
32
|
|
|
@@ -53,7 +53,7 @@ Nitro produces a standalone server dist that is independent of `node_modules`.
|
|
|
53
53
|
|
|
54
54
|
The server in Nuxt 2 is not standalone and requires part of Nuxt core to be involved by running `nuxt start` (with the [`nuxt-start`](https://www.npmjs.com/package/nuxt-start) or [`nuxt`](https://www.npmjs.com/package/nuxt) distributions) or custom programmatic usage, which is fragile and prone to breakage and not suitable for serverless and service worker environments.
|
|
55
55
|
|
|
56
|
-
Nuxt generates this dist when running `nuxt build` into a [`.output`](/docs/4.x/
|
|
56
|
+
Nuxt generates this dist when running `nuxt build` into a [`.output`](/docs/4.x/directory-structure/output) directory.
|
|
57
57
|
|
|
58
58
|
The output contains runtime code to run your Nuxt server in any environment (including experimental browser service workers!) and serve your static files, making it a true hybrid framework for the JAMstack. In addition, Nuxt implements a native storage layer, supporting multi-source drivers and local assets.
|
|
59
59
|
|
|
@@ -17,7 +17,7 @@ Explore Nuxt Modules
|
|
|
17
17
|
|
|
18
18
|
## Add Nuxt Modules
|
|
19
19
|
|
|
20
|
-
Once you have installed the modules you can add them to your [`nuxt.config.ts`](/docs/4.x/
|
|
20
|
+
Once you have installed the modules you can add them to your [`nuxt.config.ts`](/docs/4.x/directory-structure/nuxt-config) file under the `modules` property. Module developers usually provide additional steps and details for usage.
|
|
21
21
|
|
|
22
22
|
```ts twoslash [nuxt.config.ts]
|
|
23
23
|
export default defineNuxtConfig({
|
|
@@ -47,12 +47,12 @@ export default defineNuxtConfig({
|
|
|
47
47
|
|
|
48
48
|
## Auto-generated Types
|
|
49
49
|
|
|
50
|
-
Nuxt projects rely on auto-generated types to work properly. These types are stored in the [`.nuxt`](/docs/4.x/
|
|
50
|
+
Nuxt projects rely on auto-generated types to work properly. These types are stored in the [`.nuxt`](/docs/4.x/directory-structure/nuxt) directory and are generated when you run the dev server or build your application. You can also generate these files manually by running `nuxt prepare`.
|
|
51
51
|
|
|
52
|
-
The generated `tsconfig.json` files inside the [`.nuxt`](/docs/4.x/
|
|
52
|
+
The generated `tsconfig.json` files inside the [`.nuxt`](/docs/4.x/directory-structure/nuxt) directory include **recommended basic TypeScript configuration** for your project, references to [auto-imports](/docs/4.x/guide/concepts/auto-imports), [API route types](/docs/4.x/guide/concepts/server-engine#typed-api-routes), path aliases like `#imports`, `~/file`, or `#build/file`, and more.
|
|
53
53
|
|
|
54
54
|
::warning
|
|
55
|
-
Nuxt relies on this configuration, and [Nuxt Modules](/docs/4.x/guide/going-further/modules) can extend it as well. For this reason, it is not recommended to modify your `tsconfig.json` file directly, as doing so could overwrite important settings. Instead, extend it via `nuxt.config.ts`. [Learn more about extending the configuration here](/docs/4.x/
|
|
55
|
+
Nuxt relies on this configuration, and [Nuxt Modules](/docs/4.x/guide/going-further/modules) can extend it as well. For this reason, it is not recommended to modify your `tsconfig.json` file directly, as doing so could overwrite important settings. Instead, extend it via `nuxt.config.ts`. [Learn more about extending the configuration here](/docs/4.x/directory-structure/tsconfig).
|
|
56
56
|
::
|
|
57
57
|
|
|
58
58
|
::tip{icon="i-lucide-video" to="https://youtu.be/umLI7SlPygY" target="_blank"}
|
|
@@ -75,7 +75,7 @@ When you run `nuxt dev`, `nuxt build` or `nuxt prepare`, Nuxt will generate mult
|
|
|
75
75
|
Each of these files is configured to reference the appropriate dependencies and provide optimal type-checking for their specific context.
|
|
76
76
|
|
|
77
77
|
::note
|
|
78
|
-
For backward compatibility, Nuxt still generates `.nuxt/tsconfig.json`. However, we recommend using [TypeScript project references](/docs/4.x/
|
|
78
|
+
For backward compatibility, Nuxt still generates `.nuxt/tsconfig.json`. However, we recommend using [TypeScript project references](/docs/4.x/directory-structure/tsconfig) with the new configuration files (`.nuxt/tsconfig.app.json`, `.nuxt/tsconfig.server.json`, etc.) for better type safety and performance. This legacy file will be removed in a future version of Nuxt.
|
|
79
79
|
::
|
|
80
80
|
|
|
81
81
|
### Benefits of Project References
|
|
@@ -90,7 +90,7 @@ const show = ref(false)
|
|
|
90
90
|
|
|
91
91
|
By using the Lazy prefix you can delay loading the component code until the right moment, which can be helpful for optimizing your JavaScript bundle size.
|
|
92
92
|
|
|
93
|
-
:read-more{title="Lazy loading components" to="/docs/4.x/
|
|
93
|
+
:read-more{title="Lazy loading components" to="/docs/4.x/directory-structure/app/components#dynamic-imports"}
|
|
94
94
|
|
|
95
95
|
### Lazy Hydration
|
|
96
96
|
|
|
@@ -106,7 +106,7 @@ It is not always necessary to hydrate (or make interactive) all the components o
|
|
|
106
106
|
|
|
107
107
|
To optimize your app, you may want to delay the hydration of some components until they're visible, or until the browser is done with more important tasks.
|
|
108
108
|
|
|
109
|
-
:read-more{title="Lazy hydration" to="/docs/4.x/
|
|
109
|
+
:read-more{title="Lazy hydration" to="/docs/4.x/directory-structure/app/components#delayed-or-lazy-hydration"}
|
|
110
110
|
|
|
111
111
|
### Fetching data
|
|
112
112
|
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Nuxt MCP Server
|
|
3
|
+
description: Use Nuxt documentation in your AI assistants with Model Context Protocol support.
|
|
4
|
+
navigation.title: MCP Server
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What is MCP?
|
|
8
|
+
|
|
9
|
+
MCP (Model Context Protocol) is a standardized protocol that enables AI assistants to access external data sources and tools. Nuxt provides an MCP server that allows AI assistants like Claude Code, Cursor, and Windsurf to access documentation, blog posts, and deployment guides directly.
|
|
10
|
+
|
|
11
|
+
The MCP server provides structured access to the Nuxt documentation, making it easy for AI tools to understand and assist with Nuxt development.
|
|
12
|
+
|
|
13
|
+
## Resources
|
|
14
|
+
|
|
15
|
+
The Nuxt MCP server provides the following resources for discovery:
|
|
16
|
+
|
|
17
|
+
- **`resource://nuxt-com/documentation-pages`**: Browse all available documentation pages (defaults to v4.x)
|
|
18
|
+
- **`resource://nuxt-com/blog-posts`**: Browse all Nuxt blog posts including releases and tutorials
|
|
19
|
+
- **`resource://nuxt-com/deploy-providers`**: Browse all deployment providers and hosting platforms
|
|
20
|
+
|
|
21
|
+
You're able to access these resources with tools like Claude Code by using `@`.
|
|
22
|
+
|
|
23
|
+
## Tools
|
|
24
|
+
|
|
25
|
+
The Nuxt MCP server provides the following tools organized by category:
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
- **`list_documentation_pages`**: Lists all available Nuxt documentation pages with their categories and basic information. Supports version filtering (3.x, 4.x, or all)
|
|
30
|
+
- **`get_documentation_page`**: Retrieves documentation page content and details by path
|
|
31
|
+
- **`get_getting_started_guide`**: Gets the getting started guide for a specific Nuxt version
|
|
32
|
+
|
|
33
|
+
### Blog
|
|
34
|
+
|
|
35
|
+
- **`list_blog_posts`**: Lists all Nuxt blog posts with metadata including dates, categories, and tags
|
|
36
|
+
- **`get_blog_post`**: Retrieves blog post content and details by path
|
|
37
|
+
|
|
38
|
+
### Deployment
|
|
39
|
+
|
|
40
|
+
- **`list_deploy_providers`**: Lists all deployment providers and hosting platforms for Nuxt applications
|
|
41
|
+
- **`get_deploy_provider`**: Retrieves deployment provider details and instructions by path
|
|
42
|
+
|
|
43
|
+
## Prompts
|
|
44
|
+
|
|
45
|
+
The Nuxt MCP server provides guided prompts for common workflows:
|
|
46
|
+
|
|
47
|
+
- **`find_documentation_for_topic`**: Find the best Nuxt documentation for a specific topic or feature
|
|
48
|
+
- **`deployment_guide`**: Get deployment instructions for a specific hosting provider
|
|
49
|
+
- **`migration_help`**: Get help with migrating between Nuxt versions
|
|
50
|
+
|
|
51
|
+
You're able to access these resources with tools like Claude Code by using `/`.
|
|
52
|
+
|
|
53
|
+
## Setup
|
|
54
|
+
|
|
55
|
+
The Nuxt MCP server uses HTTP transport and can be installed in different AI assistants.
|
|
56
|
+
|
|
57
|
+
### ChatGPT
|
|
58
|
+
|
|
59
|
+
::note{icon="i-lucide-info"}
|
|
60
|
+
**Custom connectors using MCP are available on ChatGPT for Pro and Plus accounts** on the web.
|
|
61
|
+
::
|
|
62
|
+
|
|
63
|
+
Follow these steps to set up Nuxt as a connector within ChatGPT:
|
|
64
|
+
|
|
65
|
+
1. **Enable Developer mode:**
|
|
66
|
+
- Go to Settings → Connectors → Advanced settings → Developer mode
|
|
67
|
+
|
|
68
|
+
2. **Open ChatGPT settings**
|
|
69
|
+
|
|
70
|
+
3. **In the Connectors tab, Create a new connector:**
|
|
71
|
+
- Give it a name: `Nuxt`
|
|
72
|
+
- MCP server URL: `https://nuxt.com/mcp`
|
|
73
|
+
- Authentication: `None`
|
|
74
|
+
|
|
75
|
+
4. **Click Create**
|
|
76
|
+
|
|
77
|
+
The Nuxt connector will appear in the composer's "Developer mode" tool later during conversations.
|
|
78
|
+
|
|
79
|
+
### Claude Code
|
|
80
|
+
|
|
81
|
+
::note{icon="i-lucide-info"}
|
|
82
|
+
**Ensure Claude Code is installed** - Visit [Anthropic's documentation](https://docs.claude.com/en/docs/claude-code/quickstart) for installation instructions.
|
|
83
|
+
::
|
|
84
|
+
|
|
85
|
+
Add the server using the CLI command:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
claude mcp add --transport http nuxt-remote https://nuxt.com/mcp
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Cursor
|
|
92
|
+
|
|
93
|
+
Click the button below to install the Nuxt MCP server directly in Cursor:
|
|
94
|
+
|
|
95
|
+
::u-button
|
|
96
|
+
---
|
|
97
|
+
to: "cursor://anysphere.cursor-deeplink/mcp/install?name=nuxt&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbnV4dC5jb20vbWNwIn0%3D"
|
|
98
|
+
label: Install MCP Server
|
|
99
|
+
color: neutral
|
|
100
|
+
icon: i-custom-cursor
|
|
101
|
+
---
|
|
102
|
+
::
|
|
103
|
+
|
|
104
|
+
For manual setup, follow these steps:
|
|
105
|
+
|
|
106
|
+
1. Open Cursor and go to "Settings" > "Tools & MCP"
|
|
107
|
+
2. Add the Nuxt MCP server configuration
|
|
108
|
+
|
|
109
|
+
Or manually create/update `.cursor/mcp.json` in your project root:
|
|
110
|
+
|
|
111
|
+
```json [.cursor/mcp.json]
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"nuxt": {
|
|
115
|
+
"type": "http",
|
|
116
|
+
"url": "https://nuxt.com/mcp"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Le Chat Mistral
|
|
123
|
+
|
|
124
|
+
1. Navigate to "Intelligence" > "Connectors"
|
|
125
|
+
2. Click on "Add Connector" button, then select "Custom MCP Connector"
|
|
126
|
+
3. Create your Custom MCP Connector:
|
|
127
|
+
- Connector Name : `Nuxt`
|
|
128
|
+
- Connector Server : `https://nuxt.com/mcp`
|
|
129
|
+
|
|
130
|
+
### Visual Studio Code
|
|
131
|
+
|
|
132
|
+
::note{icon="i-lucide-info"}
|
|
133
|
+
**Install required extensions** - Ensure you have [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) and [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extensions installed.
|
|
134
|
+
::
|
|
135
|
+
|
|
136
|
+
1. Open VS Code and access the Command Palette (Ctrl/Cmd + Shift + P)
|
|
137
|
+
2. Type "Preferences: Open Workspace Settings (JSON)" and select it
|
|
138
|
+
3. Navigate to your project's `.vscode` folder or create one if it doesn't exist
|
|
139
|
+
4. Create or edit the `mcp.json` file with the following configuration:
|
|
140
|
+
|
|
141
|
+
```json [.vscode/mcp.json]
|
|
142
|
+
{
|
|
143
|
+
"servers": {
|
|
144
|
+
"nuxt": {
|
|
145
|
+
"type": "http",
|
|
146
|
+
"url": "https://nuxt.com/mcp"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### GitHub Copilot Agent
|
|
153
|
+
|
|
154
|
+
::note{icon="i-lucide-info"}
|
|
155
|
+
**Repository administrator access required** to configure MCP servers for GitHub Copilot coding agent.
|
|
156
|
+
::
|
|
157
|
+
|
|
158
|
+
If you have already configured MCP servers in VS Code (replace the `servers` key with `mcpServers` for GitHub Copilot Agent), you can leverage a similar configuration for GitHub Copilot coding agent. You will need to add a `tools` key specifying which tools are available to Copilot.
|
|
159
|
+
|
|
160
|
+
1. Navigate to your GitHub repository
|
|
161
|
+
2. Go to **Settings** > **Code & automation** > **Copilot** > **Coding agent**
|
|
162
|
+
3. In the **MCP configuration** section, add the following configuration:
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"nuxt": {
|
|
167
|
+
"type": "http",
|
|
168
|
+
"url": "https://nuxt.com/mcp",
|
|
169
|
+
"tools": ["*"]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
4. Click **Save**
|
|
175
|
+
|
|
176
|
+
#### Validating the Configuration
|
|
177
|
+
|
|
178
|
+
To verify the MCP server is configured correctly:
|
|
179
|
+
|
|
180
|
+
1. Create an issue in your repository and assign it to Copilot
|
|
181
|
+
2. Wait for Copilot to create a pull request
|
|
182
|
+
3. In the pull request, click **View session** in the "Copilot started work" timeline event
|
|
183
|
+
4. Click the ellipsis button (**...**) at the top right, then click **Copilot** in the sidebar
|
|
184
|
+
5. Expand the **Start MCP Servers** step to see the configured Nuxt tools
|
|
185
|
+
|
|
186
|
+
For more information on using MCP with GitHub Copilot coding agent, see [Extend coding agent with MCP](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp).
|
|
187
|
+
|
|
188
|
+
### Windsurf
|
|
189
|
+
|
|
190
|
+
1. Open Windsurf and navigate to "Settings" > "Windsurf Settings" > "Cascade"
|
|
191
|
+
2. Click the "Manage MCPs" button, then select the "View raw config" option
|
|
192
|
+
3. Add the following configuration to your MCP settings:
|
|
193
|
+
|
|
194
|
+
```json [.codeium/windsurf/mcp_config.json]
|
|
195
|
+
{
|
|
196
|
+
"mcpServers": {
|
|
197
|
+
"nuxt": {
|
|
198
|
+
"type": "http",
|
|
199
|
+
"url": "https://nuxt.com/mcp"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Zed
|
|
206
|
+
|
|
207
|
+
1. Open Zed and go to "Settings" > "Open Settings"
|
|
208
|
+
2. Navigate to the JSON settings file
|
|
209
|
+
3. Add the following context server configuration to your settings:
|
|
210
|
+
|
|
211
|
+
```json [.config/zed/settings.json]
|
|
212
|
+
{
|
|
213
|
+
"context_servers": {
|
|
214
|
+
"nuxt": {
|
|
215
|
+
"source": "custom",
|
|
216
|
+
"command": "npx",
|
|
217
|
+
"args": ["mcp-remote", "https://nuxt.com/mcp"],
|
|
218
|
+
"env": {}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Opencode
|
|
225
|
+
|
|
226
|
+
1. In your project root, create `opencode.json`
|
|
227
|
+
2. Add the following configuration:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"$schema": "https://opencode.ai/config.json",
|
|
232
|
+
"mcp": {
|
|
233
|
+
"nuxt": {
|
|
234
|
+
"type": "remote",
|
|
235
|
+
"url": "https://nuxt.com/mcp",
|
|
236
|
+
"enabled": true
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Prompts Examples
|
|
243
|
+
|
|
244
|
+
Once configured, you can ask your AI assistant questions like:
|
|
245
|
+
|
|
246
|
+
- "List all available Nuxt documentation pages"
|
|
247
|
+
- "Get the introduction documentation"
|
|
248
|
+
- "What's the difference between v3 and v4?"
|
|
249
|
+
- "How do I deploy to Vercel?"
|
|
250
|
+
- "Show me the latest blog posts"
|
|
251
|
+
- "Help me migrate from Nuxt 3 to Nuxt 4"
|
|
252
|
+
- "Search documentation about composables"
|
|
253
|
+
- "Find deployment guides for Cloudflare"
|
|
254
|
+
|
|
255
|
+
The AI assistant will use the MCP server to fetch structured JSON data and provide guided assistance for Nuxt development.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Nuxt LLMs.txt
|
|
3
|
+
description: How to get AI tools like Cursor, Windsurf, GitHub Copilot, ChatGPT, and Claude to understand Nuxt concepts, APIs, and best practices.
|
|
4
|
+
navigation.title: LLMs.txt
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What is LLMs.txt?
|
|
8
|
+
|
|
9
|
+
LLMs.txt is a structured documentation format specifically designed for large language models (LLMs). Nuxt provides LLMs.txt files that contain comprehensive information about the framework, making it easy for AI tools to understand and assist with Nuxt development.
|
|
10
|
+
|
|
11
|
+
These files are optimized for AI consumption and contain structured information about concepts, APIs, usage patterns, and best practices.
|
|
12
|
+
|
|
13
|
+
## Available routes
|
|
14
|
+
|
|
15
|
+
We provide LLMs.txt routes to help AI tools access our documentation:
|
|
16
|
+
|
|
17
|
+
- **`/llms.txt`** - Contains a structured overview of all documentation pages and their links (~5K tokens)
|
|
18
|
+
- **`/llms-full.txt`** - Provides comprehensive documentation including getting started guides, API references, blog posts, and deployment guides (~1M+ tokens)
|
|
19
|
+
|
|
20
|
+
## Choosing the Right File
|
|
21
|
+
|
|
22
|
+
::note{icon="i-lucide-info"}
|
|
23
|
+
**Most users should start with `/llms.txt`** - it contains all essential information and works with standard LLM context windows.
|
|
24
|
+
|
|
25
|
+
Use `/llms-full.txt` only if you need comprehensive implementation details and your AI tool supports large contexts (200K+ tokens).
|
|
26
|
+
::
|
|
27
|
+
|
|
28
|
+
## Important usage notes
|
|
29
|
+
|
|
30
|
+
::warning{icon="i-lucide-alert-triangle"}
|
|
31
|
+
**@-symbol must be typed manually** - When using tools like Cursor or Windsurf, the `@` symbol must be typed by hand in the chat interface. Copy-pasting breaks the tool's ability to recognize it as a context reference.
|
|
32
|
+
::
|
|
33
|
+
|
|
34
|
+
## Usage with AI Tools
|
|
35
|
+
|
|
36
|
+
### Cursor
|
|
37
|
+
|
|
38
|
+
Nuxt provides specialized LLMs.txt files that you can reference in Cursor for better AI assistance with Nuxt development.
|
|
39
|
+
|
|
40
|
+
#### How to use
|
|
41
|
+
|
|
42
|
+
1. **Direct reference**: Mention the LLMs.txt URLs when asking questions
|
|
43
|
+
2. Add these specific URLs to your project context using `@docs`
|
|
44
|
+
|
|
45
|
+
[Read more about Cursor Web and Docs Search](https://cursor.com/docs/context/symbols)
|
|
46
|
+
|
|
47
|
+
### Windsurf
|
|
48
|
+
|
|
49
|
+
Windsurf can directly access the Nuxt LLMs.txt files to understand framework usage and best practices.
|
|
50
|
+
|
|
51
|
+
#### Using LLMs.txt with Windsurf
|
|
52
|
+
|
|
53
|
+
- Use `@docs` to reference specific LLMs.txt URLs
|
|
54
|
+
- Create persistent rules referencing these URLs in your workspace
|
|
55
|
+
|
|
56
|
+
[Read more about Windsurf Web and Docs Search](https://docs.windsurf.com/windsurf/cascade/web-search)
|
|
57
|
+
|
|
58
|
+
### Other AI Tools
|
|
59
|
+
|
|
60
|
+
Any AI tool that supports LLMs.txt can use these routes to better understand Nuxt.
|
|
61
|
+
|
|
62
|
+
#### Examples for ChatGPT, Claude, or other LLMs
|
|
63
|
+
|
|
64
|
+
- "Using Nuxt documentation from https://nuxt.com/llms.txt"
|
|
65
|
+
- "Follow complete Nuxt guidelines from https://nuxt.com/llms-full.txt"
|
|
@@ -5,7 +5,7 @@ description: "In Nuxt, your routing is defined by the structure of your files in
|
|
|
5
5
|
|
|
6
6
|
## Adding custom routes
|
|
7
7
|
|
|
8
|
-
In Nuxt, your routing is defined by the structure of your files inside the [app/pages directory](/docs/4.x/
|
|
8
|
+
In Nuxt, your routing is defined by the structure of your files inside the [app/pages directory](/docs/4.x/directory-structure/app/pages). However, since it uses [vue-router](https://router.vuejs.org) under the hood, Nuxt offers you several ways to add custom routes in your project.
|
|
9
9
|
|
|
10
10
|
### Router Config
|
|
11
11
|
|
|
@@ -28,7 +28,7 @@ First, we need to install the Vite plugin, for our example, we'll use `@rollup/p
|
|
|
28
28
|
|
|
29
29
|
::
|
|
30
30
|
|
|
31
|
-
Next, we need to import and add it to our [`nuxt.config.ts`](/docs/4.x/
|
|
31
|
+
Next, we need to import and add it to our [`nuxt.config.ts`](/docs/4.x/directory-structure/nuxt-config) file:
|
|
32
32
|
|
|
33
33
|
```ts [nuxt.config.ts]
|
|
34
34
|
import yaml from '@rollup/plugin-yaml'
|
|
@@ -12,7 +12,7 @@ However, Nuxt provides a way to create a custom fetcher for your API (or multipl
|
|
|
12
12
|
|
|
13
13
|
## Custom `$fetch`
|
|
14
14
|
|
|
15
|
-
Let's create a custom `$fetch` instance with a [Nuxt plugin](/docs/4.x/
|
|
15
|
+
Let's create a custom `$fetch` instance with a [Nuxt plugin](/docs/4.x/directory-structure/app/plugins).
|
|
16
16
|
|
|
17
17
|
::note
|
|
18
18
|
`$fetch` is a configured instance of [ofetch](https://github.com/unjs/ofetch) which supports adding the base URL of your Nuxt server as well as direct function calls during SSR (avoiding HTTP roundtrips).
|
|
@@ -155,7 +155,7 @@ export default defineEventHandler(async (event) => {
|
|
|
155
155
|
|
|
156
156
|
## Protect App Routes
|
|
157
157
|
|
|
158
|
-
Our data is safe with the server-side route in place, but without doing anything else, unauthenticated users would probably get some odd data when trying to access the `/users` page. We should create a [client-side middleware](https://nuxt.com/docs/4.x/
|
|
158
|
+
Our data is safe with the server-side route in place, but without doing anything else, unauthenticated users would probably get some odd data when trying to access the `/users` page. We should create a [client-side middleware](https://nuxt.com/docs/4.x/directory-structure/app/middleware) to protect the route on the client side and redirect users to the login page.
|
|
159
159
|
|
|
160
160
|
`nuxt-auth-utils` provides a convenient `useUserSession` composable which we'll use to check if the user is logged in, and redirect them if they are not.
|
|
161
161
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Events"
|
|
2
|
+
title: "Creating Custom Events"
|
|
3
3
|
description: "Nuxt provides a powerful event system powered by hookable."
|
|
4
|
+
navigation.title: "Custom Events"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# Events
|
|
7
|
-
|
|
8
7
|
Using events is a great way to decouple your application and allow for more flexible and modular communication between different parts of your code. Events can have multiple listeners that do not depend on each other. For example, you may wish to send an email to your user each time an order has shipped. Instead of coupling your order processing code to your email code, you can emit an event which a listener can receive and use to dispatch an email.
|
|
9
8
|
|
|
10
9
|
The Nuxt event system is powered by [unjs/hookable](https://github.com/unjs/hookable), which is the same library that powers the Nuxt hooks system.
|
|
@@ -131,7 +131,7 @@ Emits `app:chunkError` hook when there is an error loading vite/webpack chunks.
|
|
|
131
131
|
|
|
132
132
|
By default, Nuxt will also perform a reload of the new route when a chunk fails to load when navigating to a new route (`automatic`).
|
|
133
133
|
|
|
134
|
-
Setting `automatic-immediate` will lead Nuxt to perform a reload of the current route right when a chunk fails to load (instead of waiting for navigation). This is useful for chunk errors that are not triggered by navigation, e.g., when your Nuxt app fails to load a [lazy component](/docs/4.x/
|
|
134
|
+
Setting `automatic-immediate` will lead Nuxt to perform a reload of the current route right when a chunk fails to load (instead of waiting for navigation). This is useful for chunk errors that are not triggered by navigation, e.g., when your Nuxt app fails to load a [lazy component](/docs/4.x/directory-structure/app/components#dynamic-imports). A potential downside of this behavior is undesired reloads, e.g., when your app does not need the chunk that caused the error.
|
|
135
135
|
|
|
136
136
|
You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`.
|
|
137
137
|
|
|
@@ -318,7 +318,7 @@ export default defineNuxtConfig({
|
|
|
318
318
|
})
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
-
:read-more{to="/docs/4.x/
|
|
321
|
+
:read-more{to="/docs/4.x/directory-structure/app/components#server-components"}
|
|
322
322
|
|
|
323
323
|
::read-more{icon="i-simple-icons-github" to="https://github.com/nuxt/nuxt/issues/19772" target="_blank"}
|
|
324
324
|
You can follow the server components roadmap on GitHub.
|
|
@@ -541,7 +541,7 @@ export default defineNuxtConfig({
|
|
|
541
541
|
})
|
|
542
542
|
```
|
|
543
543
|
|
|
544
|
-
This allows modules to access additional metadata from the page metadata in the build context. If you are using this within a module, it's recommended also to [augment the `NuxtPage` types with your keys](/docs/4.x/
|
|
544
|
+
This allows modules to access additional metadata from the page metadata in the build context. If you are using this within a module, it's recommended also to [augment the `NuxtPage` types with your keys](/docs/4.x/directory-structure/app/pages#typing-custom-metadata).
|
|
545
545
|
|
|
546
546
|
## navigationRepaint
|
|
547
547
|
|
|
@@ -665,7 +665,7 @@ export default defineNuxtConfig({
|
|
|
665
665
|
})
|
|
666
666
|
```
|
|
667
667
|
|
|
668
|
-
::read-more{icon="i-simple-icons-github" color="gray" to="/docs/4.x/
|
|
668
|
+
::read-more{icon="i-simple-icons-github" color="gray" to="/docs/4.x/directory-structure/app/components#delayed-or-lazy-hydration"}
|
|
669
669
|
Read more about lazy hydration.
|
|
670
670
|
::
|
|
671
671
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "How Nuxt Works?"
|
|
3
3
|
description: "Nuxt is a minimal but highly customizable framework to build web applications."
|
|
4
|
+
navigation: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
This guide helps you better understand Nuxt internals to develop new solutions and module integrations on top of Nuxt.
|
|
@@ -30,7 +31,7 @@ Global usage is possible for the browser but not on the server, to avoid sharing
|
|
|
30
31
|
|
|
31
32
|
Since [`useNuxtApp`](/docs/4.x/api/composables/use-nuxt-app) throws an exception if context is currently unavailable, if your composable does not always require `nuxtApp`, you can use [`tryUseNuxtApp`](/docs/4.x/api/composables/use-nuxt-app#tryusenuxtapp) instead, which will return `null` instead of throwing an exception.
|
|
32
33
|
|
|
33
|
-
To extend the `nuxtApp` interface and hook into different stages or access contexts, we can use [Nuxt Plugins](/docs/4.x/
|
|
34
|
+
To extend the `nuxtApp` interface and hook into different stages or access contexts, we can use [Nuxt Plugins](/docs/4.x/directory-structure/app/plugins).
|
|
34
35
|
|
|
35
36
|
Check [Nuxt App](/docs/4.x/api/composables/use-nuxt-app) for more information about this interface.
|
|
36
37
|
|
|
@@ -76,6 +77,6 @@ Nuxt builds and bundles project using Node.js but also has a runtime side.
|
|
|
76
77
|
|
|
77
78
|
While both areas can be extended, that runtime context is isolated from build-time. Therefore, they are not supposed to share state, code, or context other than runtime configuration!
|
|
78
79
|
|
|
79
|
-
`nuxt.config` and [Nuxt Modules](/docs/4.x/guide/going-further/modules) can be used to extend the build context, and [Nuxt Plugins](/docs/4.x/
|
|
80
|
+
`nuxt.config` and [Nuxt Modules](/docs/4.x/guide/going-further/modules) can be used to extend the build context, and [Nuxt Plugins](/docs/4.x/directory-structure/app/plugins) can be used to extend runtime.
|
|
80
81
|
|
|
81
82
|
When building an application for production, `nuxt build` will generate a standalone build in the `.output` directory, independent of `nuxt.config` and [Nuxt modules](/docs/4.x/guide/going-further/modules).
|
|
@@ -5,7 +5,7 @@ description: "Nuxt provides a runtime config API to expose configuration and sec
|
|
|
5
5
|
|
|
6
6
|
## Exposing
|
|
7
7
|
|
|
8
|
-
To expose config and environment variables to the rest of your app, you will need to define runtime configuration in your [`nuxt.config`](/docs/4.x/
|
|
8
|
+
To expose config and environment variables to the rest of your app, you will need to define runtime configuration in your [`nuxt.config`](/docs/4.x/directory-structure/nuxt-config) file, using the [`runtimeConfig`](/docs/4.x/api/nuxt-config#runtimeconfig) option.
|
|
9
9
|
|
|
10
10
|
```ts [nuxt.config.ts]
|
|
11
11
|
export default defineNuxtConfig({
|
|
@@ -45,7 +45,7 @@ The most common way to provide configuration is by using [Environment Variables]
|
|
|
45
45
|
|
|
46
46
|
::note
|
|
47
47
|
The Nuxt CLI has built-in support for reading your `.env` file in development, build and generate. But when you run your built server, **your `.env` file will not be read**.
|
|
48
|
-
:read-more{to="/docs/4.x/
|
|
48
|
+
:read-more{to="/docs/4.x/directory-structure/env"}
|
|
49
49
|
::
|
|
50
50
|
|
|
51
51
|
Runtime config values are **automatically replaced by matching environment variables at runtime**.
|
|
@@ -39,7 +39,7 @@ Explore all available Nuxt hooks.
|
|
|
39
39
|
|
|
40
40
|
## App Hooks (Runtime)
|
|
41
41
|
|
|
42
|
-
App hooks can be mainly used by [Nuxt Plugins](/docs/4.x/
|
|
42
|
+
App hooks can be mainly used by [Nuxt Plugins](/docs/4.x/directory-structure/app/plugins) to hook into rendering lifecycle but could also be used in Vue composables.
|
|
43
43
|
|
|
44
44
|
```ts [app/plugins/test.ts]
|
|
45
45
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
@@ -55,7 +55,7 @@ Explore all available App hooks.
|
|
|
55
55
|
|
|
56
56
|
## Server Hooks (Runtime)
|
|
57
57
|
|
|
58
|
-
These hooks are available for [server plugins](/docs/4.x/
|
|
58
|
+
These hooks are available for [server plugins](/docs/4.x/directory-structure/server#server-plugins) to hook into Nitro's runtime behavior.
|
|
59
59
|
|
|
60
60
|
```ts [~/server/plugins/test.ts]
|
|
61
61
|
export default defineNitroPlugin((nitroApp) => {
|
|
@@ -117,7 +117,7 @@ Nuxt Modules come with a variety of powerful APIs and patterns allowing them to
|
|
|
117
117
|
We can consider two kinds of Nuxt Modules:
|
|
118
118
|
|
|
119
119
|
- published modules are distributed on npm - you can see a list of some community modules on [the Nuxt website](/modules).
|
|
120
|
-
- "local" modules, they exist within a Nuxt project itself, either [inlined in Nuxt config](/docs/4.x/api/nuxt-config#modules) or as part of [the `modules` directory](/docs/4.x/
|
|
120
|
+
- "local" modules, they exist within a Nuxt project itself, either [inlined in Nuxt config](/docs/4.x/api/nuxt-config#modules) or as part of [the `modules` directory](/docs/4.x/directory-structure/modules).
|
|
121
121
|
|
|
122
122
|
In either case, their anatomy is similar.
|
|
123
123
|
|
|
@@ -224,7 +224,7 @@ Modules, like everything in a Nuxt configuration, aren't included in your applic
|
|
|
224
224
|
Inside the runtime directory, you can provide any kind of assets related to the Nuxt App:
|
|
225
225
|
- Vue components
|
|
226
226
|
- Composables
|
|
227
|
-
- [Nuxt plugins](/docs/4.x/
|
|
227
|
+
- [Nuxt plugins](/docs/4.x/directory-structure/app/plugins)
|
|
228
228
|
|
|
229
229
|
To the [server engine](/docs/4.x/guide/concepts/server-engine), Nitro:
|
|
230
230
|
- API routes
|
|
@@ -23,7 +23,7 @@ Jump over the `NuxtApp` interface documentation.
|
|
|
23
23
|
|
|
24
24
|
Many composables and utilities, both built-in and user-made, may require access to the Nuxt instance. This doesn't exist everywhere on your application, because a fresh instance is created on every request.
|
|
25
25
|
|
|
26
|
-
Currently, the Nuxt context is only accessible in [plugins](/docs/4.x/
|
|
26
|
+
Currently, the Nuxt context is only accessible in [plugins](/docs/4.x/directory-structure/app/plugins), [Nuxt hooks](/docs/4.x/guide/going-further/hooks), [Nuxt middleware](/docs/4.x/directory-structure/app/middleware) (if wrapped in `defineNuxtRouteMiddleware`), and [setup functions](https://vuejs.org/api/composition-api-setup) (in pages and components).
|
|
27
27
|
|
|
28
28
|
If a composable is called without access to the context, you may get an error stating that 'A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function.' In that case, you can also explicitly call functions within this context by using [`nuxtApp.runWithContext`](/docs/4.x/api/composables/use-nuxt-app#runwithcontext).
|
|
29
29
|
|
|
@@ -42,7 +42,7 @@ If your composable does not always need `nuxtApp` or you simply want to check if
|
|
|
42
42
|
|
|
43
43
|
Plugins also receive `nuxtApp` as the first argument for convenience.
|
|
44
44
|
|
|
45
|
-
:read-more{to="/docs/4.x/
|
|
45
|
+
:read-more{to="/docs/4.x/directory-structure/app/plugins"}
|
|
46
46
|
|
|
47
47
|
## Providing Helpers
|
|
48
48
|
|
|
@@ -55,7 +55,7 @@ nuxtApp.provide('hello', name => `Hello ${name}!`)
|
|
|
55
55
|
console.log(nuxtApp.$hello('name')) // Prints "Hello name!"
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
::read-more{to="/docs/4.x/
|
|
58
|
+
::read-more{to="/docs/4.x/directory-structure/app/plugins#providing-helpers"}
|
|
59
59
|
It is possible to inject helpers by returning an object with a `provide` key in plugins.
|
|
60
60
|
::
|
|
61
61
|
|