Skip to content

Commit 71e3d5a

Browse files
committed
Merge branch 'main' into environment-api
2 parents f77bc70 + 497f616 commit 71e3d5a

File tree

95 files changed

+773
-459
lines changed

Some content is hidden

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

95 files changed

+773
-459
lines changed

.changeset/happy-beers-remain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-cloudflare': patch
3+
---
4+
5+
fix: correctly warn users when assets key is missing

.changeset/tricky-pants-kick.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: log when no Svelte config file has been found to avoid confusion

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
- run: pnpm playwright install ${{ matrix.e2e-browser }}
7575
- run: pnpm run sync-all
7676
- run: pnpm test:kit
77+
env:
78+
NODE_OPTIONS: ${{matrix.node-version == 22 && '--experimental-strip-types' || ''}} # allows loading svelte.config.ts
7779
- name: Print flaky test report
7880
run: node scripts/print-flaky-test-report.js
7981
- name: Archive test results
@@ -181,14 +183,19 @@ jobs:
181183
path: test-results-server-side-route-resolution-${{ matrix.mode }}.tar.gz
182184
test-others:
183185
runs-on: ubuntu-latest
186+
strategy:
187+
matrix:
188+
node-version: [18, 20, 22, 24]
184189
steps:
185190
- uses: actions/checkout@v4
186191
- uses: pnpm/[email protected]
187192
- uses: actions/setup-node@v4
188193
with:
189-
node-version: 18
194+
node-version: ${{matrix.node-version}}
190195
cache: pnpm
191196
- run: pnpm install --frozen-lockfile
192197
- run: pnpm playwright install chromium
193198
- run: cd packages/kit && pnpm prepublishOnly
194199
- run: pnpm run test:others
200+
env:
201+
NODE_OPTIONS: ${{matrix.node-version == 22 && '--experimental-strip-types' || ''}} # allows loading svelte.config.ts

documentation/docs/20-core-concepts/20-load.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Universal `load` functions are called with a `LoadEvent`, which has a `data` pro
206206

207207
A universal `load` function can return an object containing any values, including things like custom classes and component constructors.
208208

209-
A server `load` function must return data that can be serialized with [devalue](https://github.com/rich-harris/devalue) — anything that can be represented as JSON plus things like `BigInt`, `Date`, `Map`, `Set` and `RegExp`, or repeated/cyclical references — so that it can be transported over the network. Your data can include [promises](#Streaming-with-promises), in which case it will be streamed to browsers.
209+
A server `load` function must return data that can be serialized with [devalue](https://github.com/rich-harris/devalue) — anything that can be represented as JSON plus things like `BigInt`, `Date`, `Map`, `Set` and `RegExp`, or repeated/cyclical references — so that it can be transported over the network. Your data can include [promises](#Streaming-with-promises), in which case it will be streamed to browsers. If you need to serialize/deserialize custom types, use [transport hooks](https://svelte.dev/docs/kit/hooks#Universal-hooks-transport).
210210

211211
### When to use which
212212

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export default [
1414
'**/test-results',
1515
'**/build',
1616
'**/.custom-out-dir',
17-
'packages/adapter-*/files'
17+
'packages/adapter-*/files',
18+
'packages/kit/src/core/config/fixtures/multiple', // dir contains svelte config with multiple extensions tripping eslint
19+
'packages/package/test/fixtures/typescript-svelte-config/expected'
1820
]
1921
},
2022
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"prettier-plugin-svelte": "^3.4.0",
3232
"typescript-eslint": "^8.35.0"
3333
},
34-
"packageManager": "pnpm@10.12.4",
34+
"packageManager": "pnpm@10.13.1",
3535
"engines": {
3636
"pnpm": ">=9.0.0"
3737
},

packages/adapter-auto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"devDependencies": {
4343
"@sveltejs/kit": "workspace:^",
4444
"@sveltejs/vite-plugin-svelte": "catalog:",
45-
"@types/node": "^18.19.48",
45+
"@types/node": "^18.19.119",
4646
"typescript": "^5.3.3",
4747
"vitest": "catalog:"
4848
},

packages/adapter-cloudflare/index.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { copyFileSync, existsSync, writeFileSync } from 'node:fs';
22
import path from 'node:path';
3-
import process from 'node:process';
43
import { fileURLToPath } from 'node:url';
54
import { unstable_readConfig } from 'wrangler';
5+
import { is_building_for_cloudflare_pages } from './utils.js';
66

77
/** @type {import('./index.js').default} */
88
export default function (options = {}) {
@@ -302,20 +302,6 @@ function validate_config(config_file = undefined) {
302302
return wrangler_config;
303303
}
304304

305-
/**
306-
* @param {import('wrangler').Unstable_Config} wrangler_config
307-
* @returns {boolean}
308-
*/
309-
function is_building_for_cloudflare_pages(wrangler_config) {
310-
return (
311-
!!process.env.CF_PAGES ||
312-
!wrangler_config.configPath ||
313-
!!wrangler_config.pages_build_output_dir ||
314-
!wrangler_config.main ||
315-
!wrangler_config.assets
316-
);
317-
}
318-
319305
/** @param {string} str */
320306
function posixify(str) {
321307
return str.replace(/\\/g, '/');

packages/adapter-cloudflare/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
"format": "pnpm lint --write",
4242
"check": "tsc --skipLibCheck",
4343
"prepublishOnly": "pnpm build",
44-
"test": "pnpm build && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test"
44+
"test:unit": "vitest run",
45+
"test:e2e": "pnpm build && pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test",
46+
"test": "pnpm test:unit && pnpm test:e2e"
4547
},
4648
"dependencies": {
4749
"@cloudflare/workers-types": "^4.20250507.0",
@@ -50,9 +52,10 @@
5052
"devDependencies": {
5153
"@playwright/test": "catalog:",
5254
"@sveltejs/kit": "workspace:^",
53-
"@types/node": "^18.19.48",
55+
"@types/node": "^18.19.119",
5456
"esbuild": "^0.25.4",
55-
"typescript": "^5.3.3"
57+
"typescript": "^5.3.3",
58+
"vitest": "catalog:"
5659
},
5760
"peerDependencies": {
5861
"@sveltejs/kit": "^2.0.0",

packages/adapter-cloudflare/test/apps/pages/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@sveltejs/kit": "workspace:^",
1414
"@sveltejs/vite-plugin-svelte": "catalog:",
1515
"server-side-dep": "file:server-side-dep",
16-
"svelte": "^5.23.1",
16+
"svelte": "^5.35.5",
1717
"vite": "catalog:",
1818
"wrangler": "^4.14.3"
1919
},

0 commit comments

Comments
 (0)