Skip to content

Commit 7185867

Browse files
committed
Add support for Svelte 5
1 parent 3ec3a81 commit 7185867

File tree

6 files changed

+173
-114
lines changed

6 files changed

+173
-114
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
name: Run end-to-end tests
2525
runs-on: ubuntu-latest
2626
needs: [lint]
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
# TODO: Fix tests for Svelte 5
31+
# svelte-version: ['4.2.12', '5.0.0']
32+
svelte-version: ['4.2.12']
2733

2834
steps:
2935
- uses: actions/checkout@v4
@@ -32,6 +38,8 @@ jobs:
3238
node-version: ${{ env.NODE_VERSION }}
3339
- name: Install Dependencies
3440
run: pnpm install
41+
- name: Install Svelte version ${{ matrix.svelte-version }}
42+
run: pnpm add -D svelte@${{ matrix.svelte-version }}
3543
- name: Install playwright browsers
3644
run: pnpm exec playwright install
3745
- name: Run tests
@@ -41,6 +49,12 @@ jobs:
4149
name: Run unit tests
4250
runs-on: ubuntu-latest
4351
needs: [lint]
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
# TODO: Fix tests for Svelte 5
56+
# svelte-version: ['4.2.12', '5.0.0']
57+
svelte-version: ['4.2.12']
4458

4559
steps:
4660
- uses: actions/checkout@v4
@@ -49,5 +63,7 @@ jobs:
4963
node-version: ${{ env.NODE_VERSION }}
5064
- name: Install Dependencies
5165
run: pnpm install
66+
- name: Install Svelte version ${{ matrix.svelte-version }}
67+
run: pnpm add -D svelte@${{ matrix.svelte-version }}
5268
- name: Run unit tests
5369
run: pnpm test:unit

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
1818
"test:unit": "vitest",
1919
"lint": "prettier --check . && eslint .",
20-
"format": "prettier --write . && eslint . --fix"
20+
"format": "prettier --write . && eslint . --fix",
21+
"test:svelte4": "pnpm add -D [email protected] && pnpm test:unit && pnpm test:ct",
22+
"test:svelte5": "pnpm add -D svelte@next && pnpm test:unit && pnpm test:ct",
23+
"test:all-versions": "pnpm test:svelte4 && pnpm test:svelte5"
2124
},
2225
"exports": {
2326
".": {
@@ -45,7 +48,7 @@
4548
"focus-trap": "^7.3.1"
4649
},
4750
"peerDependencies": {
48-
"svelte": "^3.54.0 || ^4.0.0"
51+
"svelte": "^3.54.0 || ^4.0.0 || ^5.0.0"
4952
},
5053
"devDependencies": {
5154
"@playwright/experimental-ct-svelte": "1.40.1",
@@ -58,7 +61,7 @@
5861
"@sveltejs/vite-plugin-svelte": "^3.0.0",
5962
"@testing-library/dom": "^9.0.0",
6063
"@testing-library/jest-dom": "^6.0.0",
61-
"@testing-library/svelte": "^4.0.0",
64+
"@testing-library/svelte": "^5.2.6",
6265
"@testing-library/user-event": "^14.4.3",
6366
"@types/prismjs": "^1.26.3",
6467
"@types/testing-library__jest-dom": "^5.14.5",

0 commit comments

Comments
 (0)