Skip to content

Commit

Permalink
Add support for Svelte 5
Browse files Browse the repository at this point in the history
  • Loading branch information
zeppelin committed Dec 1, 2024
1 parent 3ec3a81 commit bc3d986
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 114 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
name: Run end-to-end tests
runs-on: ubuntu-latest
needs: [lint]
strategy:
fail-fast: false
matrix:
svelte-version: ['4.2.12', '5.0.0']

steps:
- uses: actions/checkout@v4
Expand All @@ -32,6 +36,8 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: pnpm install
- name: Install Svelte version ${{ matrix.svelte-version }}
run: pnpm add -D svelte@${{ matrix.svelte-version }}
- name: Install playwright browsers
run: pnpm exec playwright install
- name: Run tests
Expand All @@ -41,6 +47,10 @@ jobs:
name: Run unit tests
runs-on: ubuntu-latest
needs: [lint]
strategy:
fail-fast: false
matrix:
svelte-version: ['4.2.12', '5.0.0']

steps:
- uses: actions/checkout@v4
Expand All @@ -49,5 +59,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: pnpm install
- name: Install Svelte version ${{ matrix.svelte-version }}
run: pnpm add -D svelte@${{ matrix.svelte-version }}
- name: Run unit tests
run: pnpm test:unit
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "vitest",
"lint": "prettier --check . && eslint .",
"format": "prettier --write . && eslint . --fix"
"format": "prettier --write . && eslint . --fix",
"test:svelte4": "pnpm add -D [email protected] && pnpm test:unit && pnpm test:ct",
"test:svelte5": "pnpm add -D svelte@next && pnpm test:unit && pnpm test:ct",
"test:all-versions": "pnpm test:svelte4 && pnpm test:svelte5"
},
"exports": {
".": {
Expand Down Expand Up @@ -45,7 +48,7 @@
"focus-trap": "^7.3.1"
},
"peerDependencies": {
"svelte": "^3.54.0 || ^4.0.0"
"svelte": "^3.54.0 || ^4.0.0 || ^5.0.0"
},
"devDependencies": {
"@playwright/experimental-ct-svelte": "1.40.1",
Expand All @@ -58,7 +61,7 @@
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/svelte": "^4.0.0",
"@testing-library/svelte": "^5.2.6",
"@testing-library/user-event": "^14.4.3",
"@types/prismjs": "^1.26.3",
"@types/testing-library__jest-dom": "^5.14.5",
Expand Down
Loading

0 comments on commit bc3d986

Please sign in to comment.