Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Svelte 5 support #121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
- pull_request

env:
PNPM_VERSION: 8.10.5
NODE_VERSION: 20

jobs:
lint:
Expand All @@ -12,14 +12,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.4.0
- uses: wyvox/action-setup-pnpm@v3
with:
version: ${{ env.PNPM_VERSION }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: pnpm
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: pnpm install
- name: Run lint
Expand All @@ -29,19 +24,22 @@ jobs:
name: Run end-to-end tests
runs-on: ubuntu-latest
needs: [lint]
strategy:
fail-fast: false
matrix:
# TODO: Fix tests for Svelte 5
# svelte-version: ['4.2.12', '5.0.0']
svelte-version: ['4.2.12']

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.4.0
with:
version: ${{ env.PNPM_VERSION }}
- name: Install Node
uses: actions/setup-node@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.x
cache: pnpm
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 @@ -51,18 +49,21 @@ jobs:
name: Run unit tests
runs-on: ubuntu-latest
needs: [lint]
strategy:
fail-fast: false
matrix:
# TODO: Fix tests for Svelte 5
# svelte-version: ['4.2.12', '5.0.0']
svelte-version: ['4.2.12']

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.4.0
with:
version: ${{ env.PNPM_VERSION }}
- name: Install Node
uses: actions/setup-node@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: 18.x
cache: pnpm
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
12 changes: 3 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

env:
PNPM_VERSION: 8.10.5
NODE_VERSION: 20

jobs:
build-and-deploy:
Expand All @@ -17,15 +17,9 @@ jobs:
uses: actions/checkout@v4.1.6

- name: Setup 📦
uses: pnpm/action-setup@v2.4.0
uses: wyvox/action-setup-pnpm@v3
with:
version: ${{ env.PNPM_VERSION }}

- name: Install Node 📦
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: pnpm
node-version: ${{ env.NODE_VERSION }}

- name: Install and Build 🔧
run: |
Expand Down
12 changes: 9 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 svelte@4.2.12 && 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 All @@ -37,12 +40,15 @@
"engines": {
"node": ">=16"
},
"pnpm": {
"packageManager": "pnpm@^9.7.0"
},
"dependencies": {
"deepmerge": "^4.3.0",
"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 @@ -55,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
Loading