Skip to content

Commit b4dfa2f

Browse files
committed
Merge branch 'main' into workers-types-docs
2 parents e11449f + 8749894 commit b4dfa2f

File tree

706 files changed

+11347
-32404
lines changed

Some content is hidden

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

706 files changed

+11347
-32404
lines changed

.changeset/angry-pumas-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-node': patch
3+
---
4+
5+
chore: append http on listening address

.changeset/brown-bats-mate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: correctly resolve hooks file when a similarly named directory exists

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"access": "public",
77
"baseBranch": "main",
88
"bumpVersionsWithWorkspaceProtocolOnly": true,
9-
"ignore": ["!(@sveltejs/*|create-svelte|svelte-migrate)"]
9+
"ignore": ["!(@sveltejs/*|create-svelte)"]
1010
}

.eslintrc.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/audit.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ permissions:
1313

1414
jobs:
1515
Audit:
16+
# prevents this action from running on forks
17+
if: github.repository == 'sveltejs/kit'
1618
runs-on: ubuntu-latest
1719
steps:
1820
- uses: actions/checkout@v4
19-
- uses: pnpm/action-setup@v2.4.0
21+
- uses: pnpm/action-setup@v4.0.0
2022
- uses: actions/setup-node@v4
2123
with:
22-
node-version: '20.x'
24+
node-version: '22.x'
2325
cache: pnpm
2426
- run: pnpm install --frozen-lockfile
2527
# check prod dependencies as these would affect users

.github/workflows/ci.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,25 @@ permissions:
1919
contents: read # to fetch code (actions/checkout)
2020

2121
jobs:
22+
pkg-pr-new:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: pnpm/action-setup@v4.0.0
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
cache: pnpm
31+
- run: pnpm install --frozen-lockfile
32+
- run: pnpx pkg-pr-new publish --comment=off ./packages/*
2233
lint-all:
2334
runs-on: ubuntu-latest
2435
steps:
2536
- uses: actions/checkout@v4
26-
- uses: pnpm/action-setup@v2.4.0
37+
- uses: pnpm/action-setup@v4.0.0
2738
- uses: actions/setup-node@v4
2839
with:
29-
node-version: '18.x'
40+
node-version: 22
3041
cache: pnpm
3142
- run: pnpm install --frozen-lockfile
3243
- run: pnpm run lint
@@ -45,12 +56,15 @@ jobs:
4556
- node-version: 20
4657
os: ubuntu-latest
4758
e2e-browser: 'chromium'
59+
- node-version: 22
60+
os: ubuntu-latest
61+
e2e-browser: 'chromium'
4862
env:
4963
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
5064
steps:
5165
- run: git config --global core.autocrlf false
5266
- uses: actions/checkout@v4
53-
- uses: pnpm/action-setup@v2.4.0
67+
- uses: pnpm/action-setup@v4.0.0
5468
- uses: actions/setup-node@v4
5569
with:
5670
node-version: ${{ matrix.node-version }}
@@ -59,6 +73,8 @@ jobs:
5973
- run: pnpm playwright install ${{ matrix.e2e-browser }}
6074
- run: pnpm run sync-all
6175
- run: pnpm test:kit
76+
- name: Print flaky test report
77+
run: node scripts/print-flaky-test-report.js
6278
- name: Archive test results
6379
if: failure()
6480
shell: bash
@@ -106,7 +122,7 @@ jobs:
106122
steps:
107123
- run: git config --global core.autocrlf false
108124
- uses: actions/checkout@v4
109-
- uses: pnpm/action-setup@v2.4.0
125+
- uses: pnpm/action-setup@v4.0.0
110126
- uses: actions/setup-node@v4
111127
with:
112128
node-version: ${{ matrix.node-version }}
@@ -115,6 +131,8 @@ jobs:
115131
- run: pnpm playwright install ${{ matrix.e2e-browser }}
116132
- run: pnpm run sync-all
117133
- run: pnpm test:cross-platform:${{ matrix.mode }}
134+
- name: Print flaky test report
135+
run: node scripts/print-flaky-test-report.js
118136
- name: Archive test results
119137
if: failure()
120138
shell: bash
@@ -130,7 +148,7 @@ jobs:
130148
runs-on: ubuntu-latest
131149
steps:
132150
- uses: actions/checkout@v4
133-
- uses: pnpm/action-setup@v2.4.0
151+
- uses: pnpm/action-setup@v4.0.0
134152
- uses: actions/setup-node@v4
135153
with:
136154
node-version: 18
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://github.com/sveltejs/svelte.dev/blob/main/apps/svelte.dev/scripts/sync-docs/README.md
2+
name: Docs preview create request
3+
4+
on:
5+
pull_request_target:
6+
branches:
7+
- main
8+
9+
jobs:
10+
dispatch:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Repository Dispatch
14+
uses: peter-evans/repository-dispatch@v3
15+
with:
16+
token: ${{ secrets.SYNC_REQUEST_TOKEN }}
17+
repository: sveltejs/svelte.dev
18+
event-type: docs-preview-create
19+
client-payload: |-
20+
{
21+
"package": "kit",
22+
"repo": "${{ github.repository }}",
23+
"owner": "${{ github.event.pull_request.head.repo.owner.login }}",
24+
"branch": "${{ github.event.pull_request.head.ref }}",
25+
"pr": ${{ github.event.pull_request.number }}
26+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# https://github.com/sveltejs/svelte.dev/blob/main/apps/svelte.dev/scripts/sync-docs/README.md
2+
name: Docs preview delete request
3+
4+
on:
5+
pull_request_target:
6+
branches:
7+
- main
8+
types: [closed]
9+
10+
jobs:
11+
dispatch:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Repository Dispatch
15+
uses: peter-evans/repository-dispatch@v3
16+
with:
17+
token: ${{ secrets.SYNC_REQUEST_TOKEN }}
18+
repository: sveltejs/svelte.dev
19+
event-type: docs-preview-delete
20+
client-payload: |-
21+
{
22+
"package": "kit",
23+
"repo": "${{ github.repository }}",
24+
"owner": "${{ github.event.pull_request.head.repo.owner.login }}",
25+
"branch": "${{ github.event.pull_request.head.ref }}",
26+
"pr": ${{ github.event.pull_request.number }}
27+
}

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
if: github.repository == 'sveltejs/kit'
1313
permissions:
1414
contents: write # to create release (changesets/action)
15+
id-token: write # OpenID Connect token needed for provenance
1516
pull-requests: write # to create pull request (changesets/action)
1617
name: Release
1718
runs-on: ubuntu-latest
@@ -21,11 +22,11 @@ jobs:
2122
with:
2223
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2324
fetch-depth: 0
24-
- uses: pnpm/action-setup@v2.4.0
25+
- uses: pnpm/action-setup@v4.0.0
2526
- name: Setup Node.js
2627
uses: actions/setup-node@v4
2728
with:
28-
node-version: 16.x
29+
node-version: 22.x
2930
cache: pnpm
3031

3132
- run: pnpm install --frozen-lockfile
@@ -39,8 +40,8 @@ jobs:
3940
version: pnpm changeset:version
4041
env:
4142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
NPM_CONFIG_PROVENANCE: true
4244
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43-
UPDATE_TEMPLATE_SSH_KEY: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }}
4445

4546
# TODO alert discord
4647
# - name: Send a Slack notification if a publish happens

.github/workflows/sync-request.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# https://github.com/sveltejs/svelte.dev/blob/main/apps/svelte.dev/scripts/sync-docs/README.md
2+
name: Sync request
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
dispatch:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Repository Dispatch
14+
uses: peter-evans/repository-dispatch@v3
15+
with:
16+
token: ${{ secrets.SYNC_REQUEST_TOKEN }}
17+
repository: sveltejs/svelte.dev
18+
event-type: sync-request
19+
client-payload: |-
20+
{
21+
"package": "kit"
22+
}

.prettierrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@
2323
"**/CHANGELOG.md",
2424
"**/vite.config.js.timestamp-*",
2525
"**/.svelte-kit/**",
26+
"**/.custom-out-dir/**",
27+
"**/build/**",
28+
"**/test-results/**",
2629
"documentation/**/*.md",
2730
"packages/package/test/fixtures/**/expected/**/*",
2831
"packages/package/test/watch/expected/**/*",
2932
"packages/package/test/watch/package/**/*",
30-
"packages/kit/src/core/postbuild/fixtures/**/*",
31-
"packages/migrate/migrations/routes/*/samples.md"
33+
"packages/kit/src/core/postbuild/fixtures/**/*"
3234
],
3335
"options": {
34-
"requirePragma": true
36+
"rangeEnd": 0
3537
}
3638
}
3739
]

CONTRIBUTING.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pnpm install
2222

2323
You can use the playground at [`playgrounds/basic`](./playgrounds/basic/) to experiment with your changes to SvelteKit locally.
2424

25-
### Linking
25+
### Linking local changes
2626

2727
If you want to test against an existing project, you can use [pnpm `overrides`](https://pnpm.io/package_json#pnpmoverrides) in that project:
2828

@@ -39,11 +39,19 @@ If you want to test against an existing project, you can use [pnpm `overrides`](
3939
}
4040
```
4141

42+
### Testing PR changes
43+
44+
Each pull request will be built and published via [pkg.pr.new/](https://pkg.pr.new/). You can test the change by installing the package with your PR number:
45+
46+
```
47+
npm add https://pkg.pr.new/sveltejs/kit/@sveltejs/kit@YOUR_PR_NUMBER_GOES_HERE
48+
```
49+
4250
## Code structure
4351

4452
Entry points to be aware of are:
4553

46-
- [`packages/create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte) - code that's run when you create a new project with `npm create svelte@latest`
54+
- [`packages/create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte) - code that's run when you create a new project with `npx sv create`
4755
- [`packages/package`](https://github.com/sveltejs/kit/tree/main/packages/package) - for the `svelte-package` command
4856
- [`packages/kit/src/core`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/core) - code that's called at dev/build-time
4957
- [`packages/kit/src/core/sync`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/core/sync) - for `svelte-kit sync`, which regenerates routing info and type definitions
@@ -101,7 +109,7 @@ If you would like to test local changes to Vite or another dependency, you can b
101109

102110
## Documentation changes
103111

104-
All documentation for SvelteKit is in the [`documentation` directory](https://github.com/sveltejs/kit/tree/main/documentation), and any improvements should be made as a Pull Request to this repository. The site itself is located in the [`sites/kit.svelte.dev` directory](https://github.com/sveltejs/kit/tree/main/sites/kit.svelte.dev) and can be run locally to preview changes.
112+
All documentation for SvelteKit is in the [`documentation` directory](https://github.com/sveltejs/kit/tree/main/documentation), and any improvements should be made as a Pull Request to this repository. The site itself is located in the [`sveltejs/svelte.dev` repo](https://github.com/sveltejs/svelte.dev) and can be run locally to preview changes.
105113

106114
## Sending PRs
107115

FUNDING.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"drips": {
33
"ethereum": {
4-
"ownedBy": "0x99D414693dD65E4a0664a16D155dB66283A162D1"
4+
"ownedBy": "0xCE08E02c37d90d75C2bf7D9e55f7606C8DB80E70"
55
}
66
}
77
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# SvelteKit
44

5-
Web development, streamlined. Read the [documentation](https://kit.svelte.dev/docs) to get started.
5+
Web development, streamlined. Read the [documentation](https://svelte.dev/docs/kit) to get started.
66

77
### Packages
88

@@ -20,7 +20,6 @@ Web development, streamlined. Read the [documentation](https://kit.svelte.dev/do
2020
| [@sveltejs/enhanced-img](packages/enhanced-img) | [Changelog](packages/enhanced-img/CHANGELOG.md) |
2121
| [@sveltejs/package](packages/package) | [Changelog](packages/package/CHANGELOG.md) |
2222
| [create-svelte](packages/create-svelte) | [Changelog](packages/create-svelte/CHANGELOG.md) |
23-
| [svelte-migrate](packages/migrate) | [Changelog](packages/migrate/CHANGELOG.md) |
2423

2524
[Additional adapters](https://sveltesociety.dev/packages?category=sveltekit-adapters) are maintained by the community.
2625

documentation/docs/10-getting-started/10-introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ title: Introduction
44

55
## Before we begin
66

7-
> If you're new to Svelte or SvelteKit we recommend checking out the [interactive tutorial](https://learn.svelte.dev).
7+
> [!NOTE] If you're new to Svelte or SvelteKit we recommend checking out the [interactive tutorial](/tutorial/kit).
88
>
99
> If you get stuck, reach out for help in the [Discord chatroom](https://svelte.dev/chat).
1010
1111
## What is SvelteKit?
1212

13-
SvelteKit is a framework for rapidly developing robust, performant web applications using [Svelte](https://svelte.dev/). If you're coming from React, SvelteKit is similar to Next. If you're coming from Vue, SvelteKit is similar to Nuxt.
13+
SvelteKit is a framework for rapidly developing robust, performant web applications using [Svelte](../svelte). If you're coming from React, SvelteKit is similar to Next. If you're coming from Vue, SvelteKit is similar to Nuxt.
1414

15-
To learn more about the kinds of applications you can build with SvelteKit, see the [FAQ](/docs/faq#what-can-i-make-with-sveltekit).
15+
To learn more about the kinds of applications you can build with SvelteKit, see the [FAQ](faq#What-can-I-make-with-SvelteKit).
1616

1717
## What is Svelte?
1818

19-
In short, Svelte is a way of writing user interface components — like a navigation bar, comment section, or contact form — that users see and interact with in their browsers. The Svelte compiler converts your components to JavaScript that can be run to render the HTML for the page and to CSS that styles the page. You don't need to know Svelte to understand the rest of this guide, but it will help. If you'd like to learn more, check out [the Svelte tutorial](https://svelte.dev/tutorial).
19+
In short, Svelte is a way of writing user interface components — like a navigation bar, comment section, or contact form — that users see and interact with in their browsers. The Svelte compiler converts your components to JavaScript that can be run to render the HTML for the page and to CSS that styles the page. You don't need to know Svelte to understand the rest of this guide, but it will help. If you'd like to learn more, check out [the Svelte tutorial](/tutorial).
2020

2121
## SvelteKit vs Svelte
2222

2323
Svelte renders UI components. You can compose these components and render an entire page with just Svelte, but you need more than just Svelte to write an entire app.
2424

25-
SvelteKit helps you build web apps while following modern best practices and providing solutions to common development challenges. It offers everything from basic functionalities — like a [router](glossary#routing) that updates your UI when a link is clicked — to more advanced capabilities. Its extensive list of features includes [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations) to load only the minimal required code; [offline support](service-workers); [preloading](link-options#data-sveltekit-preload-data) pages before user navigation; [configurable rendering](page-options) to handle different parts of your app on the server via [SSR](glossary#ssr), in the browser through [client-side rendering](glossary#csr), or at build-time with [prerendering](glossary#prerendering); [image optimization](images); and much more. Building an app with all the modern best practices is fiendishly complicated, but SvelteKit does all the boring stuff for you so that you can get on with the creative part.
25+
SvelteKit helps you build web apps while following modern best practices and providing solutions to common development challenges. It offers everything from basic functionalities — like a [router](glossary#Routing) that updates your UI when a link is clicked — to more advanced capabilities. Its extensive list of features includes [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations) to load only the minimal required code; [offline support](service-workers); [preloading](link-options#data-sveltekit-preload-data) pages before user navigation; [configurable rendering](page-options) to handle different parts of your app on the server via [SSR](glossary#SSR), in the browser through [client-side rendering](glossary#CSR), or at build-time with [prerendering](glossary#Prerendering); [image optimization](images); and much more. Building an app with all the modern best practices is fiendishly complicated, but SvelteKit does all the boring stuff for you so that you can get on with the creative part.
2626

2727
It reflects changes to your code in the browser instantly to provide a lightning-fast and feature-rich development experience by leveraging [Vite](https://vitejs.dev/) with a [Svelte plugin](https://github.com/sveltejs/vite-plugin-svelte) to do [Hot Module Replacement (HMR)](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#hot).

documentation/docs/10-getting-started/20-creating-a-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Creating a project
33
---
44

5-
The easiest way to start building a SvelteKit app is to run `npm create`:
5+
The easiest way to start building a SvelteKit app is to run `npx sv create`:
66

77
```bash
8-
npm create svelte@latest my-app
8+
npx sv create my-app
99
cd my-app
1010
npm install
1111
npm run dev
@@ -15,7 +15,7 @@ The first command will scaffold a new project in the `my-app` directory asking y
1515

1616
There are two basic concepts:
1717

18-
- Each page of your app is a [Svelte](https://svelte.dev) component
18+
- Each page of your app is a [Svelte](../svelte) component
1919
- You create pages by adding files to the `src/routes` directory of your project. These will be server-rendered so that a user's first visit to your app is as fast as possible, then a client-side app takes over
2020

2121
Try editing the files to get a feel for how everything works.

0 commit comments

Comments
 (0)