Skip to content

Commit ddf1c31

Browse files
authored
Merge branch 'main' into issue-14835
2 parents 5458ba5 + 8b32b6c commit ddf1c31

File tree

35 files changed

+271
-37
lines changed

35 files changed

+271
-37
lines changed

.changeset/eager-experts-roll.md

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

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: pnpm/action-setup@v4.2.0
2222
- uses: actions/setup-node@v6
2323
with:
24-
node-version: '22.x'
24+
node-version: '24.x'
2525
cache: pnpm
2626
- run: pnpm install --frozen-lockfile
2727
# check prod dependencies as these would affect users

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: pnpm/action-setup@v4.2.0
2727
- uses: actions/setup-node@v6
2828
with:
29-
node-version: 22
29+
node-version: 24
3030
cache: pnpm
3131
- run: pnpm install --frozen-lockfile
3232
- run: pnpm build
@@ -38,7 +38,7 @@ jobs:
3838
- uses: pnpm/action-setup@v4.2.0
3939
- uses: actions/setup-node@v6
4040
with:
41-
node-version: 22
41+
node-version: 24
4242
cache: pnpm
4343
- run: pnpm install --frozen-lockfile
4444
- run: pnpm run lint
@@ -84,7 +84,7 @@ jobs:
8484
run: find packages -type d -name test-results -not -empty | tar -czf test-results.tar.gz --files-from=-
8585
- name: Upload test results
8686
if: failure()
87-
uses: actions/upload-artifact@v4
87+
uses: actions/upload-artifact@v5
8888
with:
8989
retention-days: 3
9090
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
@@ -142,7 +142,7 @@ jobs:
142142
run: find packages -type d -name test-results -not -empty | tar -czf test-results-cross-platform-${{ matrix.mode }}.tar.gz --files-from=-
143143
- name: Upload test results
144144
if: failure()
145-
uses: actions/upload-artifact@v4
145+
uses: actions/upload-artifact@v5
146146
with:
147147
retention-days: 3
148148
name: test-failure-cross-platform-${{ matrix.mode }}-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
@@ -162,7 +162,7 @@ jobs:
162162
- uses: pnpm/action-setup@v4.2.0
163163
- uses: actions/setup-node@v6
164164
with:
165-
node-version: 22
165+
node-version: 24
166166
cache: pnpm
167167
- run: pnpm install --frozen-lockfile
168168
- run: pnpm playwright install chromium
@@ -176,7 +176,7 @@ jobs:
176176
run: find packages -type d -name test-results -not -empty | tar -czf test-results-server-side-route-resolution-${{ matrix.mode }}.tar.gz --files-from=-
177177
- name: Upload test results
178178
if: failure()
179-
uses: actions/upload-artifact@v4
179+
uses: actions/upload-artifact@v5
180180
with:
181181
retention-days: 3
182182
name: test-failure-server-side-route-resolution-${{ matrix.mode }}-${{ github.run_id }}

packages/adapter-static/test/apps/spa/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"test": "playwright test"
1010
},
1111
"devDependencies": {
12-
"@sveltejs/adapter-node": "workspace:^",
1312
"@sveltejs/kit": "workspace:^",
1413
"@sveltejs/vite-plugin-svelte": "catalog:",
1514
"sirv-cli": "catalog:",

packages/adapter-vercel/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @sveltejs/adapter-vercel
22

3+
## 6.1.0
4+
### Minor Changes
5+
6+
7+
- feat: Add experimental support for Bun runtime ([#14817](https://github.com/sveltejs/kit/pull/14817))
8+
9+
10+
### Patch Changes
11+
12+
- Updated dependencies [[`102aecf`](https://github.com/sveltejs/kit/commit/102aecfd228dd632664d748b9e87bc6d219294c4)]:
13+
- @sveltejs/kit@2.48.1
14+
315
## 6.0.0
416
### Major Changes
517

packages/adapter-vercel/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ export interface ServerlessConfig {
77
/**
88
* Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs18.x'`, `'nodejs20.x'` etc).
99
* @default Same as the build environment
10-
* @deprecated
1110
*/
12-
runtime?: `nodejs${number}.x`;
11+
runtime?: `nodejs${number}.x` | `experimental_bun1.x`;
1312
/**
1413
* To which regions to deploy the app. A list of regions.
1514
* More info: https://vercel.com/docs/concepts/edge-network/regions

packages/adapter-vercel/index.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,11 @@ const plugin = function (defaults = {}) {
294294

295295
// group routes by config
296296
for (const route of builder.routes) {
297-
const runtime = route.config?.runtime ?? defaults?.runtime ?? get_default_runtime();
297+
const runtime = (
298+
route.config?.runtime ??
299+
defaults?.runtime ??
300+
get_default_runtime()
301+
).replace('experimental_', '');
298302
const config = { runtime, ...defaults, ...route.config };
299303

300304
if (is_prerendered(route)) {
@@ -305,19 +309,24 @@ const plugin = function (defaults = {}) {
305309
}
306310

307311
const node_runtime = /nodejs([0-9]+)\.x/.exec(runtime);
308-
if (runtime !== 'edge' && (!node_runtime || parseInt(node_runtime[1]) < 20)) {
312+
const bun_runtime = /^bun/.exec(runtime);
313+
if (
314+
runtime !== 'edge' &&
315+
!bun_runtime &&
316+
(!node_runtime || parseInt(node_runtime[1]) < 20)
317+
) {
309318
throw new Error(
310-
`Invalid runtime '${runtime}' for route ${route.id}. Valid runtimes are 'edge' and 'nodejs20.x' or higher ` +
319+
`Invalid runtime '${runtime}' for route ${route.id}. Valid runtimes are 'edge', 'experimental_bun1.x', 'nodejs20.x' or 'nodejs22.x' ` +
311320
'(see the Node.js Version section in your Vercel project settings for info on the currently supported versions).'
312321
);
313322
}
314323

315324
if (config.isr) {
316325
const directory = path.relative('.', builder.config.kit.files.routes + route.id);
317326

318-
if (!runtime.startsWith('nodejs')) {
327+
if (!runtime.startsWith('nodejs') && !bun_runtime) {
319328
throw new Error(
320-
`${directory}: Routes using \`isr\` must use a Node.js runtime (for example 'nodejs20.x')`
329+
`${directory}: Routes using \`isr\` must use a Node.js or Bun runtime (for example 'nodejs22.x' or 'experimental_bun1.x')`
321330
);
322331
}
323332

@@ -400,7 +409,7 @@ const plugin = function (defaults = {}) {
400409
// we need to create a catch-all route so that 404s are handled
401410
// by SvelteKit rather than Vercel
402411

403-
const runtime = defaults.runtime ?? get_default_runtime();
412+
const runtime = (defaults.runtime ?? get_default_runtime()).replace('experimental_', '');
404413
const generate_function =
405414
runtime === 'edge' ? generate_edge_function : generate_serverless_function;
406415

packages/adapter-vercel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sveltejs/adapter-vercel",
3-
"version": "6.0.0",
3+
"version": "6.1.0",
44
"description": "A SvelteKit adapter that creates a Vercel app",
55
"keywords": [
66
"adapter",

packages/enhanced-img/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"lint": "prettier --check .",
2525
"check": "tsc",
2626
"format": "prettier --write .",
27-
"test": "vitest run"
27+
"test": "pnpm test:unit && pnpm test:integration",
28+
"test:unit": "vitest run",
29+
"test:integration": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test"
2830
},
2931
"files": [
3032
"src",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
node_modules
3+
/.svelte-kit
4+
/build
5+
/functions

0 commit comments

Comments
 (0)