Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4b94019

Browse files
authored
ci: use production release of Svelte 5 by default (#405)
1 parent b5e0f3d commit 4b94019

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

‎.github/workflows/release.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ jobs:
3333
include:
3434
# We only need to lint once, so do it on latest Node and Svelte
3535
- { node: '20', svelte: '4', check: 'lint' }
36-
# `SvelteComponent` is not generic in Svelte 3, so type-checking only passes in >= 4
36+
# Run type checks in latest node
37+
- { node: '20', svelte: '3', check: 'types:legacy' }
3738
- { node: '20', svelte: '4', check: 'types:legacy' }
38-
- { node: '20', svelte: 'next', check: 'types' }
39+
- { node: '20', svelte: '5', check: 'types' }
3940
# Only run Svelte 5 checks on latest Node
40-
- { node: '20', svelte: 'next', check: 'test:vitest:jsdom' }
41-
- { node: '20', svelte: 'next', check: 'test:vitest:happy-dom' }
42-
- { node: '20', svelte: 'next', check: 'test:jest' }
41+
- { node: '20', svelte: '5', check: 'test:vitest:jsdom' }
42+
- { node: '20', svelte: '5', check: 'test:vitest:happy-dom' }
43+
- { node: '20', svelte: '5', check: 'test:jest' }
4344

4445
steps:
4546
- name: ⬇️ Checkout repo
@@ -51,9 +52,7 @@ jobs:
5152
node-version: ${{ matrix.node }}
5253

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

5857
- name: ▶️ Run ${{ matrix.check }}
5958
run: npm run ${{ matrix.check }}

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
},
9696
"devDependencies": {
9797
"@jest/globals": "^29.7.0",
98-
"@sveltejs/vite-plugin-svelte": "^3.1.1",
98+
"@sveltejs/vite-plugin-svelte": "^2.0.0 || ^3.0.0 || ^4.0.0",
9999
"@testing-library/jest-dom": "^6.3.0",
100100
"@testing-library/user-event": "^14.5.2",
101101
"@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -111,7 +111,7 @@
111111
"eslint-plugin-promise": "^6.4.0",
112112
"eslint-plugin-simple-import-sort": "^12.1.1",
113113
"eslint-plugin-svelte": "^2.42.0",
114-
"expect-type": "^0.20.0",
114+
"expect-type": "^1.1.0",
115115
"happy-dom": "^15.7.3",
116116
"jest": "^29.7.0",
117117
"jest-environment-jsdom": "^29.7.0",

‎scripts/install-dependencies

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# Install dependencies for a given version of Svelte
3+
set -euo pipefail
4+
5+
svelte_version=${1}
6+
7+
rm -rf node_modules
8+
npm install --no-package-lock
9+
10+
if [[ "${svelte_version}" == "4" ]]; then
11+
npm uninstall --no-save @sveltejs/vite-plugin-svelte svelte
12+
npm install --no-save @sveltejs/vite-plugin-svelte@3 svelte@4
13+
elif [[ "${svelte_version}" == "3" ]]; then
14+
npm uninstall --no-save vite vitest @vitest/coverage-v8 @sveltejs/vite-plugin-svelte svelte-check svelte
15+
npm install --no-save vite@4 vitest@1 @vitest/coverage-v8@1 @sveltejs/vite-plugin-svelte@2 svelte-check@3 svelte@3
16+
fi
17+
18+
npm ls --depth=0 svelte

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /