Skip to content

Commit 2b4ac48

Browse files
committed
Merge branch 'main' into print
2 parents 1377c40 + 92c936d commit 2b4ac48

File tree

886 files changed

+24445
-6201
lines changed

Some content is hidden

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

886 files changed

+24445
-6201
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,40 @@ jobs:
4343
- run: pnpm test
4444
env:
4545
CI: true
46+
TestNoAsync:
47+
permissions: {}
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 10
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: pnpm/action-setup@v4
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
cache: pnpm
57+
- run: pnpm install --frozen-lockfile
58+
- run: pnpm playwright install chromium
59+
- run: pnpm test runtime-runes
60+
env:
61+
CI: true
62+
SVELTE_NO_ASYNC: true
63+
TSGo:
64+
permissions: {}
65+
runs-on: ubuntu-latest
66+
timeout-minutes: 5
67+
steps:
68+
- uses: actions/checkout@v4
69+
- uses: pnpm/action-setup@v4
70+
- uses: actions/setup-node@v4
71+
with:
72+
node-version: 24
73+
cache: pnpm
74+
- name: install
75+
run: pnpm install --frozen-lockfile
76+
- name: install tsgo
77+
run: cd packages/svelte && pnpm i -D @typescript/native-preview
78+
- name: type check
79+
run: cd packages/svelte && pnpm check:tsgo
4680
Lint:
4781
permissions: {}
4882
runs-on: ubuntu-latest

.github/workflows/ecosystem-ci-trigger.yml

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ on:
44
issue_comment:
55
types: [created]
66

7+
permissions: {}
8+
79
jobs:
810
trigger:
911
runs-on: ubuntu-latest
1012
if: github.repository == 'sveltejs/svelte' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
13+
permissions:
14+
issues: write # to add / delete reactions, post comments
15+
pull-requests: write # to read PR data, and to add labels
16+
actions: read # to check workflow status
17+
contents: read # to clone the repo
1118
steps:
12-
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
13-
- uses: actions/github-script@v6
19+
- name: Check User Permissions
20+
uses: actions/github-script@v8
21+
id: check-permissions
1422
with:
1523
script: |
1624
const user = context.payload.sender.login
@@ -29,24 +37,26 @@ jobs:
2937
}
3038
3139
if (hasTriagePermission) {
32-
console.log('Allowed')
40+
console.log('User is allowed. Adding +1 reaction.')
3341
await github.rest.reactions.createForIssueComment({
3442
owner: context.repo.owner,
3543
repo: context.repo.repo,
3644
comment_id: context.payload.comment.id,
3745
content: '+1',
3846
})
3947
} else {
40-
console.log('Not allowed')
48+
console.log('User is not allowed. Adding -1 reaction.')
4149
await github.rest.reactions.createForIssueComment({
4250
owner: context.repo.owner,
4351
repo: context.repo.repo,
4452
comment_id: context.payload.comment.id,
4553
content: '-1',
4654
})
47-
throw new Error('not allowed')
55+
throw new Error('User does not have the necessary permissions.')
4856
}
49-
- uses: actions/github-script@v6
57+
58+
- name: Get PR Data
59+
uses: actions/github-script@v8
5060
id: get-pr-data
5161
with:
5262
script: |
@@ -56,27 +66,65 @@ jobs:
5666
repo: context.repo.repo,
5767
pull_number: context.issue.number
5868
})
69+
70+
const commentCreatedAt = new Date(context.payload.comment.created_at)
71+
const commitPushedAt = new Date(pr.head.repo.pushed_at)
72+
73+
console.log(`Comment created at: ${commentCreatedAt.toISOString()}`)
74+
console.log(`PR last pushed at: ${commitPushedAt.toISOString()}`)
75+
76+
// Check if any commits were pushed after the comment was created
77+
if (commitPushedAt > commentCreatedAt) {
78+
const errorMsg = [
79+
'⚠️ Security warning: PR was updated after the trigger command was posted.',
80+
'',
81+
`Comment posted at: ${commentCreatedAt.toISOString()}`,
82+
`PR last pushed at: ${commitPushedAt.toISOString()}`,
83+
'',
84+
'This could indicate an attempt to inject code after approval.',
85+
'Please review the latest changes and re-run /ecosystem-ci run if they are acceptable.'
86+
].join('\n')
87+
88+
core.setFailed(errorMsg)
89+
90+
await github.rest.issues.createComment({
91+
owner: context.repo.owner,
92+
repo: context.repo.repo,
93+
issue_number: context.issue.number,
94+
body: errorMsg
95+
})
96+
97+
throw new Error('PR was pushed to after comment was created')
98+
}
99+
59100
return {
60101
num: context.issue.number,
61102
branchName: pr.head.ref,
103+
commit: pr.head.sha,
62104
repo: pr.head.repo.full_name
63105
}
64-
- id: generate-token
65-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 #keep pinned for security reasons, currently 1.8.0
106+
107+
- name: Generate Token
108+
id: generate-token
109+
uses: actions/create-github-app-token@v2
66110
with:
67-
app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
68-
private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
69-
repository: '${{ github.repository_owner }}/svelte-ecosystem-ci'
70-
- uses: actions/github-script@v6
111+
app-id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
112+
private-key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
113+
repositories: |
114+
svelte
115+
svelte-ecosystem-ci
116+
117+
- name: Trigger Downstream Workflow
118+
uses: actions/github-script@v8
71119
id: trigger
72120
env:
73121
COMMENT: ${{ github.event.comment.body }}
122+
PR_DATA: ${{ steps.get-pr-data.outputs.result }}
74123
with:
75124
github-token: ${{ steps.generate-token.outputs.token }}
76-
result-encoding: string
77125
script: |
78126
const comment = process.env.COMMENT.trim()
79-
const prData = ${{ steps.get-pr-data.outputs.result }}
127+
const prData = JSON.parse(process.env.PR_DATA)
80128
81129
const suite = comment.split('\n')[0].replace(/^\/ecosystem-ci run/, '').trim()
82130
@@ -89,6 +137,7 @@ jobs:
89137
prNumber: '' + prData.num,
90138
branchName: prData.branchName,
91139
repo: prData.repo,
140+
commit: prData.commit,
92141
suite: suite === '' ? '-' : suite
93142
}
94143
})

.github/workflows/pkg.pr.new-comment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
name: 'Update comment'
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
1817
- name: Download artifact
1918
uses: actions/download-artifact@v4
2019
with:

.github/workflows/pkg.pr.new.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Publish Any Commit
22
on: [push, pull_request]
33

4+
permissions: {}
5+
46
jobs:
57
build:
68
permissions: {}

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
name: Release
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
2120
- name: Checkout Repo
2221
uses: actions/checkout@v4
2322
with:
@@ -27,7 +26,7 @@ jobs:
2726
- name: Setup Node.js
2827
uses: actions/setup-node@v4
2928
with:
30-
node-version: 18.x
29+
node-version: 24.x
3130
cache: pnpm
3231

3332
- name: Install
@@ -45,4 +44,3 @@ jobs:
4544
env:
4645
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4746
NPM_CONFIG_PROVENANCE: true
48-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.prettierignore

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages/svelte/src/internal/client/warnings.js
1515
packages/svelte/src/internal/shared/errors.js
1616
packages/svelte/src/internal/shared/warnings.js
1717
packages/svelte/src/internal/server/errors.js
18+
packages/svelte/src/internal/server/warnings.js
1819
packages/svelte/tests/migrate/samples/*/output.svelte
1920
packages/svelte/tests/**/*.svelte
2021
packages/svelte/tests/**/_expected*
@@ -28,15 +29,6 @@ packages/svelte/types
2829
packages/svelte/compiler/index.js
2930
playgrounds/sandbox/src/*
3031

31-
# sites/svelte.dev
32-
sites/svelte.dev/static/svelte-app.json
33-
sites/svelte.dev/scripts/svelte-app/
34-
sites/svelte.dev/src/routes/_components/Supporters/contributors.jpg
35-
sites/svelte.dev/src/routes/_components/Supporters/contributors.js
36-
sites/svelte.dev/src/routes/_components/Supporters/donors.jpg
37-
sites/svelte.dev/src/routes/_components/Supporters/donors.js
38-
sites/svelte.dev/src/lib/generated
39-
4032
**/node_modules
4133
**/.svelte-kit
4234
**/.vercel

.prettierrc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
"useTabs": false,
1818
"tabWidth": 2
1919
}
20-
},
21-
{
22-
"files": ["sites/svelte-5-preview/src/routes/docs/content/**/*.md"],
23-
"options": {
24-
"printWidth": 60
25-
}
2620
}
2721
]
2822
}

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"search.exclude": {
3-
"sites/svelte-5-preview/static/*": true
4-
},
52
"typescript.tsdk": "node_modules/typescript/lib"
63
}

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The [Open Source Guides](https://opensource.guide/) website has a collection of
99

1010
## Get involved
1111

12-
There are many ways to contribute to Svelte, and many of them do not involve writing any code. Here's a few ideas to get started:
12+
There are many ways to contribute to Svelte, and many of them do not involve writing any code. Here are a few ideas to get started:
1313

1414
- Simply start using Svelte. Go through the [Getting Started](https://svelte.dev/docs#getting-started) guide. Does everything work as expected? If not, we're always looking for improvements. Let us know by [opening an issue](#reporting-new-issues).
1515
- Look through the [open issues](https://github.com/sveltejs/svelte/issues). A good starting point would be issues tagged [good first issue](https://github.com/sveltejs/svelte/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). Provide workarounds, ask for clarification, or suggest labels. Help [triage issues](#triaging-issues-and-pull-requests).
@@ -90,9 +90,9 @@ A good test plan has the exact commands you ran and their output, provides scree
9090

9191
#### Writing tests
9292

93-
All tests are located in `/test` folder.
93+
All tests are located in the `/tests` folder.
9494

95-
Test samples are kept in `/test/xxx/samples` folder.
95+
Test samples are kept in `/tests/xxx/samples` folders.
9696

9797
#### Running tests
9898

@@ -101,14 +101,14 @@ Test samples are kept in `/test/xxx/samples` folder.
101101
1. To run test, run `pnpm test`.
102102
1. To run a particular test suite, use `pnpm test <suite-name>`, for example:
103103

104-
```bash
104+
```sh
105105
pnpm test validator
106106
```
107107

108-
1. To filter tests _within_ a test suite, use `pnpm test <suite-name> -- -t <test-name>`, for example:
108+
1. To filter tests _within_ a test suite, use `pnpm test <suite-name> -t <test-name>`, for example:
109109

110-
```bash
111-
pnpm test validator -- -t a11y-alt-text
110+
```sh
111+
pnpm test validator -t a11y-alt-text
112112
```
113113

114114
(You can also do `FILTER=<test-name> pnpm test <suite-name>` which removes other tests rather than simply skipping them — this will result in faster and more compact test results, but it's non-idiomatic. Choose your fighter.)

documentation/docs/01-introduction/02-getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Getting started
44

55
We recommend using [SvelteKit](../kit), which lets you [build almost anything](../kit/project-types). It's the official application framework from the Svelte team and powered by [Vite](https://vite.dev/). Create a new project with:
66

7-
```bash
7+
```sh
88
npx sv create myapp
99
cd myapp
1010
npm install
@@ -15,11 +15,11 @@ Don't worry if you don't know Svelte yet! You can ignore all the nice features S
1515

1616
## Alternatives to SvelteKit
1717

18-
You can also use Svelte directly with Vite by running `npm create vite@latest` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS, and CSS files inside the `dist` directory using [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte). In most cases, you will probably need to [choose a routing library](faq#Is-there-a-router) as well.
18+
You can also use Svelte directly with Vite by running `npm create vite@latest` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS, and CSS files inside the `dist` directory using [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte). In most cases, you will probably need to [choose a routing library](/packages#routing) as well.
1919

2020
>[!NOTE] Vite is often used in standalone mode to build [single page apps (SPAs)](../kit/glossary#SPA), which you can also [build with SvelteKit](../kit/single-page-apps).
2121
22-
There are also plugins for [Rollup](https://github.com/sveltejs/rollup-plugin-svelte), [Webpack](https://github.com/sveltejs/svelte-loader) [and a few others](https://sveltesociety.dev/packages?category=build-plugins), but we recommend Vite.
22+
There are also [plugins for other bundlers](/packages#bundler-plugins), but we recommend Vite.
2323

2424
## Editor tooling
2525

0 commit comments

Comments
 (0)