Skip to content

Commit

Permalink
Merge branch 'main' into declaration-maps
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Jan 10, 2025
2 parents 59c8961 + 5b667e4 commit d869023
Show file tree
Hide file tree
Showing 811 changed files with 12,359 additions and 33,305 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"access": "public",
"baseBranch": "main",
"bumpVersionsWithWorkspaceProtocolOnly": true,
"ignore": ["!(@sveltejs/*|create-svelte|svelte-migrate)"]
"ignore": ["!(@sveltejs/*|create-svelte)"]
}
5 changes: 5 additions & 0 deletions .changeset/khaki-melons-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: upgrade esm-env to remove warning when NODE_ENV is not set
5 changes: 5 additions & 0 deletions .changeset/slimy-cows-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: make param matchers generated type import end with `.js`
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

6 changes: 4 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ permissions:

jobs:
Audit:
# prevents this action from running on forks
if: github.repository == 'sveltejs/kit'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
cache: pnpm
- run: pnpm install --frozen-lockfile
# check prod dependencies as these would affect users
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,25 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
pkg-pr-new:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/[email protected]
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpx pkg-pr-new publish --comment=off ./packages/*
lint-all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
Expand All @@ -45,12 +56,15 @@ jobs:
- node-version: 20
os: ubuntu-latest
e2e-browser: 'chromium'
- node-version: 22
os: ubuntu-latest
e2e-browser: 'chromium'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
Expand All @@ -59,6 +73,8 @@ jobs:
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm run sync-all
- run: pnpm test:kit
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
if: failure()
shell: bash
Expand Down Expand Up @@ -106,7 +122,7 @@ jobs:
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
Expand All @@ -115,6 +131,8 @@ jobs:
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm run sync-all
- run: pnpm test:cross-platform:${{ matrix.mode }}
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
if: failure()
shell: bash
Expand All @@ -130,7 +148,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3.0.0
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/docs-preview-create-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# https://github.com/sveltejs/svelte.dev/blob/main/apps/svelte.dev/scripts/sync-docs/README.md
name: Docs preview create request

on:
pull_request_target:
branches:
- main

jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SYNC_REQUEST_TOKEN }}
repository: sveltejs/svelte.dev
event-type: docs-preview-create
client-payload: |-
{
"package": "kit",
"repo": "${{ github.repository }}",
"owner": "${{ github.event.pull_request.head.repo.owner.login }}",
"branch": "${{ github.event.pull_request.head.ref }}",
"pr": ${{ github.event.pull_request.number }}
}
27 changes: 27 additions & 0 deletions .github/workflows/docs-preview-delete-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# https://github.com/sveltejs/svelte.dev/blob/main/apps/svelte.dev/scripts/sync-docs/README.md
name: Docs preview delete request

on:
pull_request_target:
branches:
- main
types: [closed]

jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SYNC_REQUEST_TOKEN }}
repository: sveltejs/svelte.dev
event-type: docs-preview-delete
client-payload: |-
{
"package": "kit",
"repo": "${{ github.repository }}",
"owner": "${{ github.event.pull_request.head.repo.owner.login }}",
"branch": "${{ github.event.pull_request.head.ref }}",
"pr": ${{ github.event.pull_request.number }}
}
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
if: github.repository == 'sveltejs/kit'
permissions:
contents: write # to create release (changesets/action)
id-token: write # OpenID Connect token needed for provenance
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest
Expand All @@ -21,11 +22,11 @@ jobs:
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v3.0.0
- uses: pnpm/action-setup@v4.0.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 22.x
cache: pnpm

- run: pnpm install --frozen-lockfile
Expand All @@ -39,8 +40,8 @@ jobs:
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
UPDATE_TEMPLATE_SSH_KEY: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }}

# TODO alert discord
# - name: Send a Slack notification if a publish happens
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/sync-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://github.com/sveltejs/svelte.dev/blob/main/apps/svelte.dev/scripts/sync-docs/README.md
name: Sync request

on:
push:
branches:
- main

jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SYNC_REQUEST_TOKEN }}
repository: sveltejs/svelte.dev
event-type: sync-request
client-payload: |-
{
"package": "kit"
}
8 changes: 5 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@
"**/CHANGELOG.md",
"**/vite.config.js.timestamp-*",
"**/.svelte-kit/**",
"**/.custom-out-dir/**",
"**/build/**",
"**/test-results/**",
"documentation/**/*.md",
"packages/package/test/fixtures/**/expected/**/*",
"packages/package/test/watch/expected/**/*",
"packages/package/test/watch/package/**/*",
"packages/kit/src/core/postbuild/fixtures/**/*",
"packages/migrate/migrations/routes/*/samples.md"
"packages/kit/src/core/postbuild/fixtures/**/*"
],
"options": {
"requirePragma": true
"rangeEnd": 0
}
}
]
Expand Down
14 changes: 11 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pnpm install

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

### Linking
### Linking local changes

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

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

### Testing PR changes

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:

```
npm add https://pkg.pr.new/sveltejs/kit/@sveltejs/kit@YOUR_PR_NUMBER_GOES_HERE
```

## Code structure

Entry points to be aware of are:

- [`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`
- [`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`
- [`packages/package`](https://github.com/sveltejs/kit/tree/main/packages/package) - for the `svelte-package` command
- [`packages/kit/src/core`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/core) - code that's called at dev/build-time
- [`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
Expand Down Expand Up @@ -101,7 +109,7 @@ If you would like to test local changes to Vite or another dependency, you can b

## Documentation changes

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.
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.

## Sending PRs

Expand Down
2 changes: 1 addition & 1 deletion FUNDING.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"drips": {
"ethereum": {
"ownedBy": "0x99D414693dD65E4a0664a16D155dB66283A162D1"
"ownedBy": "0xCE08E02c37d90d75C2bf7D9e55f7606C8DB80E70"
}
}
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# SvelteKit

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

### Packages

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

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

Expand Down
12 changes: 6 additions & 6 deletions documentation/docs/10-getting-started/10-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ title: Introduction

## Before we begin

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

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.
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.

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

## What is Svelte?

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).
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).

## SvelteKit vs Svelte

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.

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.
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.

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).
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Creating a project
---

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

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

There are two basic concepts:

- Each page of your app is a [Svelte](https://svelte.dev) component
- Each page of your app is a [Svelte](../svelte) component
- 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

Try editing the files to get a feel for how everything works.
Expand Down
Loading

0 comments on commit d869023

Please sign in to comment.