Skip to content

Commit

Permalink
ci: use production release of Svelte 5 by default (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous authored Oct 22, 2024
1 parent b5e0f3d commit 4b94019
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:
include:
# We only need to lint once, so do it on latest Node and Svelte
- { node: '20', svelte: '4', check: 'lint' }
# `SvelteComponent` is not generic in Svelte 3, so type-checking only passes in >= 4
# Run type checks in latest node
- { node: '20', svelte: '3', check: 'types:legacy' }
- { node: '20', svelte: '4', check: 'types:legacy' }
- { node: '20', svelte: 'next', check: 'types' }
- { node: '20', svelte: '5', check: 'types' }
# Only run Svelte 5 checks on latest Node
- { node: '20', svelte: 'next', check: 'test:vitest:jsdom' }
- { node: '20', svelte: 'next', check: 'test:vitest:happy-dom' }
- { node: '20', svelte: 'next', check: 'test:jest' }
- { node: '20', svelte: '5', check: 'test:vitest:jsdom' }
- { node: '20', svelte: '5', check: 'test:vitest:happy-dom' }
- { node: '20', svelte: '5', check: 'test:jest' }

steps:
- name: ⬇️ Checkout repo
Expand All @@ -51,9 +52,7 @@ jobs:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
run: |
npm install --no-package-lock
npm install --no-save svelte@${{ matrix.svelte }}
run: ./scripts/install-dependencies ${{ matrix.svelte }}

- name: ▶️ Run ${{ matrix.check }}
run: npm run ${{ matrix.check }}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@sveltejs/vite-plugin-svelte": "^2.0.0 || ^3.0.0 || ^4.0.0",
"@testing-library/jest-dom": "^6.3.0",
"@testing-library/user-event": "^14.5.2",
"@typescript-eslint/eslint-plugin": "^8.0.0",
Expand All @@ -111,7 +111,7 @@
"eslint-plugin-promise": "^6.4.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-svelte": "^2.42.0",
"expect-type": "^0.20.0",
"expect-type": "^1.1.0",
"happy-dom": "^15.7.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
18 changes: 18 additions & 0 deletions scripts/install-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Install dependencies for a given version of Svelte
set -euo pipefail

svelte_version=${1}

rm -rf node_modules
npm install --no-package-lock

if [[ "${svelte_version}" == "4" ]]; then
npm uninstall --no-save @sveltejs/vite-plugin-svelte svelte
npm install --no-save @sveltejs/vite-plugin-svelte@3 svelte@4
elif [[ "${svelte_version}" == "3" ]]; then
npm uninstall --no-save vite vitest @vitest/coverage-v8 @sveltejs/vite-plugin-svelte svelte-check svelte
npm install --no-save vite@4 vitest@1 @vitest/coverage-v8@1 @sveltejs/vite-plugin-svelte@2 svelte-check@3 svelte@3
fi

npm ls --depth=0 svelte

0 comments on commit 4b94019

Please sign in to comment.