Skip to content

Commit 3391ae4

Browse files
fix(examples): TypeScript in with-svelte example (#10450)
### Description Inspired by @DoctorRyner in #10437, a set of changes to make TypeScript work better for the `with-svelte` example. ### Testing Instructions This set of changes works correctly in my editor. --------- Co-authored-by: Rainer Reinhardt <[email protected]>
1 parent da98c10 commit 3391ae4

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

examples/with-svelte/packages/ui/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.0.0",
44
"type": "module",
55
"scripts": {
6-
"dev": "svelte-package --watch --input=src",
7-
"build": "svelte-package --input=src",
6+
"dev": "svelte-kit sync && svelte-package --watch --input=src",
7+
"build": "svelte-kit sync && svelte-package --input=src",
88
"lint": "eslint .",
99
"check-types": "svelte-check --tsconfig ./tsconfig.json"
1010
},
@@ -31,6 +31,7 @@
3131
"devDependencies": {
3232
"@repo/eslint-config": "workspace:*",
3333
"@repo/typescript-config": "workspace:*",
34+
"@sveltejs/kit": "^2.20.0",
3435
"@sveltejs/package": "^2.0.0",
3536
"@sveltejs/vite-plugin-svelte": "^5.0.0",
3637
"eslint": "^9.25.0",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
2+
3+
/** @type {import('@sveltejs/kit').Config} */
4+
const config = {
5+
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
6+
// for more information about preprocessors
7+
preprocess: vitePreprocess()
8+
};
9+
10+
export default config;
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
2-
"extends": "@repo/typescript-config/svelte.json",
2+
"extends": ["@repo/typescript-config/svelte.json", "./.svelte-kit/tsconfig.json"],
33
"compilerOptions": {
44
"declaration": true,
55
"declarationMap": true,
6+
"allowArbitraryExtensions": true
67
},
7-
"include": [
8-
"src"
9-
],
10-
"exclude": [
11-
"node_modules",
12-
"dist",
13-
".svelte-kit"
14-
]
15-
}
8+
"include": ["dist", "./src/**/*.svelte", "./src/**/*.ts"],
9+
"exclude": ["node_modules", ".svelte-kit"]
10+
}

examples/with-svelte/pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)