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

ci: use production release of Svelte 5 by default #405

Merged
merged 4 commits into from
Oct 22, 2024
Merged
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
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