Skip to content

Commit baa34ca

Browse files
committed
Upgrade to @sveltejs/kit@2
1 parent 4873e18 commit baa34ca

File tree

6 files changed

+34
-54
lines changed

6 files changed

+34
-54
lines changed

jsconfig.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
{
22
"extends": "./.svelte-kit/tsconfig.json",
33
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": true,
64
"esModuleInterop": true,
75
"forceConsistentCasingInFileNames": true,
86
"resolveJsonModule": true,
97
"skipLibCheck": true,
108
"sourceMap": true,
11-
"strict": true
9+
"module": "NodeNext",
10+
"moduleResolution": "NodeNext"
1211
}
13-
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
14-
//
15-
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16-
// from the referenced tsconfig.json - TypeScript does not merge them in
1712
}

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,34 @@
1616
"package": "zx build.mjs --packageOnly"
1717
},
1818
"peerDependencies": {
19-
"svelte": "^3.57.0 || ^4.0.0"
19+
"svelte": "^4.0.0"
2020
},
2121
"devDependencies": {
22-
"@fontsource-variable/inter": "^5.0.3",
23-
"@playwright/test": "^1.35.1",
24-
"@sveltejs/adapter-static": "^2.0.2",
25-
"@sveltejs/kit": "^1.21.0",
26-
"@sveltejs/package": "^2.1.0",
27-
"@sveltejs/vite-plugin-svelte": "^2.4.2",
28-
"autoprefixer": "^10.4.14",
22+
"@fontsource-variable/inter": "^5.1.0",
23+
"@playwright/test": "^1.47.1",
24+
"@sveltejs/adapter-static": "^3.0.4",
25+
"@sveltejs/kit": "^2.5.27",
26+
"@sveltejs/package": "^2.3.5",
27+
"@sveltejs/vite-plugin-svelte": "^3.1.2",
28+
"autoprefixer": "^10.4.20",
2929
"camelcase": "^7.0.1",
30-
"daisyui": "^3.1.7",
31-
"eslint": "^8.44.0",
32-
"eslint-config-prettier": "^8.8.0",
33-
"eslint-plugin-svelte": "^2.32.2",
30+
"daisyui": "^3.9.4",
31+
"eslint": "^8.57.0",
32+
"eslint-config-prettier": "^8.10.0",
33+
"eslint-plugin-svelte": "^2.44.0",
3434
"is-port-reachable": "^4.0.0",
35-
"postcss": "^8.4.24",
36-
"postcss-load-config": "^4.0.1",
35+
"postcss": "^8.4.47",
36+
"postcss-load-config": "^4.0.2",
3737
"prettier": "^2.8.8",
3838
"prettier-plugin-svelte": "^2.10.1",
3939
"prismjs": "^1.29.0",
40-
"svelte-check": "^3.4.4",
41-
"svelte-preprocess": "^5.0.4",
42-
"tailwindcss": "^3.3.2",
43-
"terser": "^5.18.2",
44-
"tslib": "^2.6.0",
45-
"typescript": "^5.1.6",
46-
"vite": "^4.3.9"
40+
"svelte": "^4.2.19",
41+
"svelte-check": "^4.0.2",
42+
"tailwindcss": "^3.4.11",
43+
"terser": "^5.32.0",
44+
"tslib": "^2.7.0",
45+
"typescript": "^5.6.2",
46+
"vite": "^5.4.5"
4747
},
4848
"type": "module",
4949
"exports": {

src/app.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ declare global {
55
// interface Error {}
66
// interface Locals {}
77
// interface PageData {}
8+
// interface PageState {}
89
// interface Platform {}
910
}
10-
var __VERSION__
1111
var toast
1212
var gtag
1313
var TEST_MODE

src/routes/+page.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
<script>
22
/* eslint no-useless-escape: "off" */
3-
/* global __VERSION__ */
43
54
import { SvelteToast, toast } from '$lib'
65
import { tick } from 'svelte'
7-
import { browser, dev } from '$app/environment'
6+
import { browser, dev, version } from '$app/environment'
87
import DummyComponent from './Dummy.svelte'
98
import camelCase from 'camelcase'
109
import Prism from 'prismjs'
1110
1211
// Hoist to `window` for tests
1312
if (browser) window.toast = toast
1413
15-
const version = __VERSION__
16-
1714
let selected = ''
1815
let code = '// Tap a button below'
1916
let colors = false

svelte.config.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
import preprocess from 'svelte-preprocess'
1+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
22
import adapter from '@sveltejs/adapter-static'
3+
import { readFileSync } from 'node:fs'
34

4-
const dev = process.argv.includes('dev')
5+
const { version: name } = JSON.parse(readFileSync(new URL('package.json', import.meta.url), 'utf8'))
56

67
/** @type {import('@sveltejs/kit').Config} */
78
const config = {
89
kit: {
9-
adapter: adapter(),
10+
adapter: adapter({ fallback: '404.html' }),
1011
paths: {
11-
base: dev ? '' : '/svelte-toast'
12-
}
12+
base: process.argv.includes('dev') ? '' : '/svelte-toast'
13+
},
14+
version: { name }
1315
},
14-
compilerOptions: {
15-
dev,
16-
css: 'external'
17-
},
18-
preprocess: [
19-
preprocess({
20-
postcss: true
21-
})
22-
]
16+
preprocess: [vitePreprocess()]
2317
}
2418

2519
export default config

vite.config.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { sveltekit } from '@sveltejs/kit/vite'
22
import { defineConfig } from 'vite'
3-
import fs from 'node:fs/promises'
4-
5-
const { version } = JSON.parse(await fs.readFile('package.json'))
63

74
export default defineConfig({
8-
plugins: [sveltekit()],
9-
define: {
10-
__VERSION__: JSON.stringify(version)
11-
}
5+
plugins: [sveltekit()]
126
})

0 commit comments

Comments
 (0)