Skip to content

Commit 2300dd9

Browse files
authored
feat!: Svelte 5 (#723)
* svelte 5: bump all deps * svelte 5: migrate apps/web * svelte 5: migrate storybook * complete svelte 5 migration * little format * keep some legacy * chore: lockfile * ui: try adding patch script (temp sol) * pls work * patch storybook addon svelte csf package * change default port of apps * remove redundant patch scripts * chore: bump deps again * storybook import patches * storybook: fix all invalid import
1 parent 3bec867 commit 2300dd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1676
-1147
lines changed

.github/workflows/deploy-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
steps:
6060
- name: Checkout with tags
61-
uses: actions/checkout@v3
61+
uses: actions/checkout@v4
6262
with:
6363
fetch-depth: 0
6464
ref: ${{ matrix.packages.ref }}

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Checkout
1212

1313
- name: Install pnpm
14-
uses: pnpm/action-setup@v2
14+
uses: pnpm/action-setup@v4
1515
id: pnpm-install
1616
with:
1717
run_install: false

.github/workflows/release-without-versioning.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
node-version-file: .nvmrc
4949

5050
- name: Install pnpm
51-
uses: pnpm/action-setup@v2
51+
uses: pnpm/action-setup@v4
5252
id: pnpm-install
5353
with:
5454
run_install: false

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
node-version-file: .nvmrc
7777

7878
- name: Install pnpm
79-
uses: pnpm/action-setup@v2
79+
uses: pnpm/action-setup@v4
8080
id: pnpm-install
8181
with:
8282
run_install: false

.github/workflows/reusable-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Install pnpm
25-
uses: pnpm/action-setup@v2
25+
uses: pnpm/action-setup@v4
2626
id: pnpm-install
2727
with:
2828
run_install: false

apps/analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@repo/database": "workspace:*",
13-
"dotenv-cli": "^7.4.4",
13+
"dotenv-cli": "^8.0.0",
1414
"drizzle-orm": "^0.38.1",
1515
"postgres": "^3.4.5",
1616
"tsx": "^4.19.2"

apps/storybook/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "storybook dev -p 6006",
7+
"dev": "storybook dev -p 5342",
88
"build": "storybook build",
99
"check": "svelte-check --tsconfig ./tsconfig.json",
1010
"lint": "eslint . && prettier --check \"src/**/*.mdx\"",
@@ -18,22 +18,22 @@
1818
"@storybook/addon-essentials": "^8.4.7",
1919
"@storybook/addon-interactions": "^8.4.7",
2020
"@storybook/addon-links": "^8.4.7",
21-
"@storybook/addon-svelte-csf": "^4.2.0",
21+
"@storybook/addon-svelte-csf": "^5.0.0-next.21",
2222
"@storybook/addon-themes": "^8.4.7",
2323
"@storybook/blocks": "^8.4.7",
2424
"@storybook/svelte": "^8.4.7",
2525
"@storybook/svelte-vite": "^8.4.7",
2626
"@storybook/test": "^8.4.7",
27-
"@sveltejs/vite-plugin-svelte": "^3.1.2",
27+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
2828
"@tsconfig/svelte": "^5.0.4",
29-
"eslint": "^9.16.0",
29+
"eslint": "^9.17.0",
3030
"sass-embedded": "^1.83.0",
3131
"storybook": "^8.4.7",
32-
"svelte": "^4.2.18",
32+
"svelte": "^5.15.0",
3333
"svelte-check": "^4.1.1",
34-
"tailwindcss": "^3.4.16",
34+
"tailwindcss": "^3.4.17",
3535
"tslib": "^2.8.1",
3636
"typescript": "^5.7.2",
37-
"vite": "^6.0.3"
37+
"vite": "^6.0.5"
3838
}
3939
}

apps/web/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "vite dev",
7+
"dev": "vite dev --clearScreen false",
88
"build": "vite build",
99
"preview": "vite preview",
1010
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
@@ -21,24 +21,24 @@
2121
"devDependencies": {
2222
"@playwright/test": "^1.49.1",
2323
"@repo/config": "workspace:^",
24-
"@sveltejs/adapter-auto": "^3.3.1",
25-
"@sveltejs/kit": "^2.11.1",
26-
"@sveltejs/vite-plugin-svelte": "^3.1.2",
27-
"@typescript-eslint/eslint-plugin": "^8.18.0",
28-
"@typescript-eslint/parser": "^8.18.0",
24+
"@sveltejs/adapter-node": "^5.2.11",
25+
"@sveltejs/kit": "^2.15.0",
26+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
27+
"@typescript-eslint/eslint-plugin": "^8.18.2",
28+
"@typescript-eslint/parser": "^8.18.2",
2929
"autoprefixer": "^10.4.20",
3030
"drizzle-orm": "^0.38.1",
31-
"eslint": "^9.16.0",
31+
"eslint": "^9.17.0",
3232
"postcss": "^8.4.49",
3333
"postgres": "^3.4.5",
3434
"prettier": "^3.4.2",
3535
"prettier-plugin-svelte": "^3.3.2",
36-
"svelte": "^4.2.18",
36+
"svelte": "^5.15.0",
3737
"svelte-check": "^4.1.1",
38-
"tailwindcss": "^3.4.16",
38+
"tailwindcss": "^3.4.17",
3939
"tslib": "^2.8.1",
4040
"typescript": "^5.7.2",
41-
"vite": "^5.4.11",
41+
"vite": "^6.0.5",
4242
"vitest": "^2.1.8"
4343
}
4444
}

apps/web/src/routes/+layout.svelte

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
<script>
1+
<script lang="ts">
22
import '@repo/ui/css'
3+
4+
import type { Snippet } from 'svelte'
5+
6+
interface Props {
7+
children: Snippet
8+
}
9+
10+
let { children }: Props = $props()
311
</script>
412

5-
<slot />
13+
{@render children()}

apps/web/src/routes/+page.server.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/web/src/routes/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { Input } from '@repo/ui/input'
99
import { RecommendedTag } from '@repo/ui/recommended-tag'
1010
11-
let counter = 0
11+
let counter = $state(0)
1212
1313
const onButtonClick = () => {
1414
counter++
@@ -17,7 +17,7 @@
1717

1818
<h1>Web</h1>
1919

20-
<Button on:click="{onButtonClick}">Button</Button>
20+
<Button onclick={onButtonClick}>Button</Button>
2121

2222
{counter}
2323

@@ -30,15 +30,17 @@
3030
<Chip>รหัสผ่าน</Chip>
3131
<Chip
3232
closable
33-
onClose="{() => {
33+
onClose={() => {
3434
console.log('close')
35-
}}">Closable</Chip
35+
}}
3636
>
37+
Closable
38+
</Chip>
3739
<DayChip day="SA" />
3840
<GenedChip type="SC" />
3941

4042
<h1>Testtsetst</h1>
41-
<CourseCard recommended="{true}" class="mt-4" />
43+
<CourseCard recommended={true} class="mt-4" />
4244

4345
<h1>RecommendedTag</h1>
4446
<RecommendedTag />

apps/web/svelte.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import adapter from '@sveltejs/adapter-auto'
1+
import adapter from '@sveltejs/adapter-node'
22
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
33

44
/** @type {import('@sveltejs/kit').Config} */
@@ -7,8 +7,6 @@ const config = {
77
// for more information about preprocessors
88
preprocess: vitePreprocess(),
99
kit: {
10-
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
11-
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
1210
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
1311
adapter: adapter(),
1412
},

apps/web/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ export default defineConfig({
1212
},
1313
},
1414
server: {
15-
port: 5173,
15+
port: 5343,
1616
fs: {
1717
allow: ['../../packages/ui/src'],
1818
},
1919
},
20+
preview: {
21+
port: 4343,
22+
},
2023
})

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"build": "turbo run build",
77
"dev": "turbo run dev",
88
"lint": "turbo run --continue lint",
9-
"format": "turbo run --continue format"
9+
"format": "turbo run --continue format",
10+
"storybook:dev": "turbo run --filter=@app/storybook dev"
1011
},
1112
"devDependencies": {
1213
"@changesets/changelog-github": "^0.5.0",
13-
"@changesets/cli": "^2.27.10",
14+
"@changesets/cli": "^2.27.11",
1415
"@repo/config": "workspace:^",
15-
"@types/eslint": "^9.6.1",
16-
"eslint": "^9.16.0",
16+
"eslint": "^9.17.0",
1717
"prettier": "^3.4.2",
1818
"turbo": "^2.3.3"
1919
},
20-
"packageManager": "pnpm@9.15.0"
20+
"packageManager": "pnpm@9.15.1"
2121
}

packages/config/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"format": "eslint . --fix"
99
},
1010
"dependencies": {
11-
"@typescript-eslint/eslint-plugin": "^8.18.0",
12-
"@typescript-eslint/parser": "^8.18.0",
11+
"@typescript-eslint/eslint-plugin": "^8.18.2",
12+
"@typescript-eslint/parser": "^8.18.2",
1313
"eslint-config-prettier": "^9.1.0",
1414
"eslint-config-turbo": "^2.3.3",
1515
"eslint-plugin-prettier": "^5.2.1",
@@ -20,12 +20,10 @@
2020
"prettier-plugin-svelte": "^3.3.2"
2121
},
2222
"devDependencies": {
23-
"@eslint/js": "^9.16.0",
24-
"@types/eslint": "^9.6.1",
25-
"@types/eslint__js": "^8.42.3",
26-
"eslint": "^9.16.0",
27-
"globals": "^15.13.0",
23+
"@eslint/js": "^9.17.0",
24+
"eslint": "^9.17.0",
25+
"globals": "^15.14.0",
2826
"typescript": "^5.7.2",
29-
"typescript-eslint": "^8.18.0"
27+
"typescript-eslint": "^8.18.2"
3028
}
3129
}

packages/database/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@types/cli-progress": "^3.11.6",
2222
"@types/node": "^22.10.2",
2323
"cli-progress": "^3.12.0",
24-
"dotenv-cli": "^7.4.4",
24+
"dotenv-cli": "^8.0.0",
2525
"drizzle-kit": "^0.30.0",
2626
"tsx": "^4.19.2",
2727
"typescript": "^5.7.2"

packages/ui/package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,25 @@
1414
},
1515
"scripts": {
1616
"lint": "eslint .",
17-
"format": "eslint . --fix"
17+
"format": "eslint . --fix",
18+
"postinstall": "node scripts/patch-sb-csf.js"
1819
},
1920
"devDependencies": {
2021
"@repo/config": "workspace:^",
21-
"@storybook/addon-svelte-csf": "^4.2.0",
22+
"@storybook/addon-svelte-csf": "^5.0.0-next.21",
2223
"@storybook/svelte": "^8.4.7",
23-
"@sveltejs/adapter-node": "^5.2.10",
24-
"@sveltejs/kit": "^2.11.1",
25-
"@sveltejs/vite-plugin-svelte": "^3.1.2",
26-
"svelte": "^4.2.18",
24+
"@sveltejs/adapter-node": "^5.2.11",
25+
"@sveltejs/kit": "^2.15.0",
26+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
27+
"svelte": "^5.15.0",
2728
"vitest": "^2.1.8"
2829
},
2930
"dependencies": {
3031
"bits-ui": "^0.22.0",
3132
"clsx": "^2.1.1",
32-
"lucide-svelte": "^0.468.0",
33-
"tailwind-merge": "^2.5.5",
33+
"lucide-svelte": "^0.469.0",
34+
"tailwind-merge": "^2.6.0",
3435
"tailwind-variants": "^0.3.0",
35-
"tailwindcss": "^3.4.16"
36+
"tailwindcss": "^3.4.17"
3637
}
3738
}

0 commit comments

Comments
 (0)