Skip to content

Commit 45e9e3e

Browse files
authored
Merge branch 'main' into docs-assets
2 parents bb32989 + 1aadc73 commit 45e9e3e

File tree

137 files changed

+717
-404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+717
-404
lines changed

apps/svelte.dev/content/docs/cli/20-commands/20-sv-add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ You can select multiple space-separated add-ons from [the list below](#Official-
3232
- [`drizzle`](drizzle)
3333
- [`eslint`](eslint)
3434
- [`lucia`](lucia)
35+
- [`mcp`](mcp)
3536
- [`mdsvex`](mdsvex)
3637
- [`paraglide`](paraglide)
3738
- [`playwright`](playwright)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts
3+
title: mcp
4+
---
5+
6+
[Svelte MCP](/docs/mcp/overview) can help your LLM write better Svelte code.
7+
8+
## Usage
9+
10+
```sh
11+
npx sv add mcp
12+
```
13+
14+
## What you get
15+
16+
- A good mcp configuration for your project depending on your IDE
17+
18+
## Options
19+
20+
### ide
21+
22+
The IDE you want to use like `'claude-code'`, `'cursor'`, `'gemini'`, `'opencode'`, `'vscode'`, `'other'`.
23+
24+
```sh
25+
npx sv add mcp=ide:cursor,vscode
26+
```
27+
28+
### setup
29+
30+
The setup you want to use.
31+
32+
```sh
33+
npx sv add mcp=setup:local
34+
```

apps/svelte.dev/content/docs/kit/20-core-concepts/60-remote-functions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ We can customize what happens when the form is submitted with the `enhance` meth
758758
</form>
759759
```
760760
761+
> When using `enhance`, the `<form>` is not automatically reset — you must call `form.reset()` if you want to clear the inputs.
762+
761763
The callback receives the `form` element, the `data` it contains, and a `submit` function.
762764
763765
To enable client-driven [single-flight mutations](#form-Single-flight-mutations), use `submit().updates(...)`. For example, if the `getPosts()` query was used on this page, we could refresh it like so:
@@ -1146,7 +1148,7 @@ export const getProfile = query(async () => {
11461148

11471149
// this query could be called from multiple places, but
11481150
// the function will only run once per request
1149-
const getUser = query(() => {
1151+
const getUser = query(async () => {
11501152
const { cookies } = getRequestEvent();
11511153

11521154
return await findUser(cookies.get('session_id'));

apps/svelte.dev/content/docs/kit/25-build-and-deploy/90-adapter-vercel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const config = {
4343

4444
The following options apply to all functions:
4545

46-
- `runtime`: `'edge'`, `'nodejs18.x'`, `'nodejs20.x'` or `'nodejs22.x'`. By default, the adapter will select the `'nodejs<version>.x'` corresponding to the Node version your project is configured to use on the Vercel dashboard
46+
- `runtime`: `'edge'`, `'nodejs20.x'` or `'nodejs22.x'`. By default, the adapter will select the `'nodejs<version>.x'` corresponding to the Node version your project is configured to use on the Vercel dashboard
4747
> [!NOTE] This option is deprecated and will be removed in a future version, at which point all your functions will use whichever Node version is specified in the project configuration on Vercel
4848
- `regions`: an array of [edge network regions](https://vercel.com/docs/concepts/edge-network/regions) (defaulting to `["iad1"]` for serverless functions) or `'all'` if `runtime` is `edge` (its default). Note that multiple regions for serverless functions are only supported on Enterprise plans
4949
- `split`: if `true`, causes a route to be deployed as an individual function. If `split` is set to `true` at the adapter level, all routes will be deployed as individual functions

apps/svelte.dev/content/docs/kit/98-reference/[email protected]

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,10 @@ type RemoteForm<
23572357
): RemoteForm<Input, Output>;
23582358
/** Validate the form contents programmatically */
23592359
validate(options?: {
2360+
/** Set this to `true` to also show validation issues of fields that haven't been touched yet. */
23602361
includeUntouched?: boolean;
2362+
/** Set this to `true` to only run the `preflight` validation. */
2363+
preflightOnly?: boolean;
23612364
/** Perform validation as if the form was submitted by the given button. */
23622365
submitter?: HTMLButtonElement | HTMLInputElement;
23632366
}): Promise<void>;
@@ -2459,6 +2462,37 @@ type RemoteFormFieldValue =
24592462

24602463
</div>
24612464

2465+
## RemoteFormFields
2466+
2467+
Recursive type to build form fields structure with proxy access
2468+
2469+
<div class="ts-block">
2470+
2471+
```dts
2472+
type RemoteFormFields<T> =
2473+
WillRecurseIndefinitely<T> extends true
2474+
? RecursiveFormFields
2475+
: NonNullable<T> extends
2476+
| string
2477+
| number
2478+
| boolean
2479+
| File
2480+
? RemoteFormField<NonNullable<T>>
2481+
: T extends string[] | File[]
2482+
? RemoteFormField<T> & {
2483+
[K in number]: RemoteFormField<T[number]>;
2484+
}
2485+
: T extends Array<infer U>
2486+
? RemoteFormFieldContainer<T> & {
2487+
[K in number]: RemoteFormFields<U>;
2488+
}
2489+
: RemoteFormFieldContainer<T> & {
2490+
[K in keyof T]-?: RemoteFormFields<T[K]>;
2491+
};
2492+
```
2493+
2494+
</div>
2495+
24622496
## RemoteFormInput
24632497

24642498
<div class="ts-block">

apps/svelte.dev/content/docs/kit/98-reference/20-$app-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function form<
118118
fn: (
119119
data: StandardSchemaV1.InferOutput<Schema>,
120120
invalid: import('@sveltejs/kit').Invalid<
121-
StandardSchemaV1.InferOutput<Schema>
121+
StandardSchemaV1.InferInput<Schema>
122122
>
123123
) => MaybePromise<Output>
124124
): RemoteForm<StandardSchemaV1.InferInput<Schema>, Output>;

apps/svelte.dev/content/docs/mcp/20-setup/20-local-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Here's how to set it up in some common MCP clients:
1616
To include the local MCP version in Claude Code, simply run the following command:
1717

1818
```bash
19-
claude mcp add -t stdio -s [scope] svelte npx -y @sveltejs/mcp
19+
claude mcp add -t stdio -s [scope] svelte -- npx -y @sveltejs/mcp
2020
```
2121

2222
The `[scope]` must be `user`, `project` or `local`.

apps/svelte.dev/content/docs/mcp/20-setup/30-remote-setup.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ It will open a file with your MCP servers where you can add the following config
9797
}
9898
```
9999

100+
## GitHub Coding Agent
101+
102+
- Open your repository in GitHub
103+
- Go to Settings
104+
- Open Copilot > Coding agent
105+
- Edit the MCP configuration
106+
107+
```json
108+
{
109+
"mcpServers": {
110+
"svelte": {
111+
"type": "http",
112+
"url": "https://mcp.svelte.dev/mcp",
113+
"tools": ["*"]
114+
}
115+
}
116+
}
117+
```
118+
119+
- Click _Save MCP configuration_
120+
100121
## Other clients
101122

102123
If we didn't include the MCP client you are using, refer to their documentation for `remote` servers and use `https://mcp.svelte.dev/mcp` as the URL.

0 commit comments

Comments
 (0)