File tree Expand file tree Collapse file tree 8 files changed +88
-26
lines changed Expand file tree Collapse file tree 8 files changed +88
-26
lines changed Original file line number Diff line number Diff line change 1111 runs-on : ubuntu-latest
1212 strategy :
1313 matrix :
14- node-version : [18 .x, 20 .x, 22 .x]
14+ node-version : [20 .x, 22 .x, 24 .x]
1515
1616 steps :
1717 - uses : actions/checkout@v4
3030 - name : Run Svelte check
3131 run : npm run check
3232
33+ - name : Run tsc check
34+ run : npm run tsc
35+
3336 - name : Build
3437 run : npm run build
3538
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ This template is derived from [the official template](https://github.com/sveltej
77Some notable customizations are:
88
990 . ` package-lock.json ` is NOT committed on purpose
10- 1 . Vite 6.0 and Vitest 3.0 is included
11- 2 . The included adapter is changed from ` auto ` to ` @sveltejs/adapter-node ` , assuming that you are not targeting [ any specific deployment target ] ( https://svelte.dev/docs/kit/adapter-auto ) .
10+ 1 . The included adapter is changed from ` auto ` to ` @sveltejs/adapter-node ` , assuming that you are not targeting [ any specific deployment target ] ( https://svelte.dev/docs/kit/adapter-auto ) .
11+ 2 . Split tsconfig of web/test/node environments via cascading ` jsconfig.*.json ` to avoid lib pollution .
1212
1313## Instructions
1414
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./jsconfig.base.json" ,
3+ "compilerOptions" : {
4+ "sourceMap" : true ,
5+ "tsBuildInfoFile" : " node_modules/.tmp/app.tsbuildinfo"
6+ },
7+ // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
8+ // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
9+ //
10+ // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
11+ // from the referenced tsconfig.json - TypeScript does not merge them in
12+ "exclude" : [
13+ // copied from .svelte-kit/tsconfig.json
14+ " ./node_modules/**" ,
15+ " ./src/service-worker.js" ,
16+ " ./src/service-worker/**/*.js" ,
17+ " ./src/service-worker.ts" ,
18+ " ./src/service-worker/**/*.ts" ,
19+ " ./src/service-worker.d.ts" ,
20+ " ./src/service-worker/**/*.d.ts" ,
21+ // exclude tests
22+ " ./src/**/*.spec.js" ,
23+ " ./src/**/*.spec.ts" ,
24+ " ./src/**/*.test.js" ,
25+ " ./src/**/*.test.ts"
26+ ]
27+ }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./.svelte-kit/tsconfig.json" ,
3+ "compilerOptions" : {
4+ "allowJs" : true ,
5+ "checkJs" : true ,
6+ "esModuleInterop" : true ,
7+ "forceConsistentCasingInFileNames" : true ,
8+ "resolveJsonModule" : true ,
9+ "skipLibCheck" : true ,
10+ "sourceMap" : false ,
11+ "strict" : true ,
12+ "moduleResolution" : " bundler" ,
13+ "composite" : true
14+ }
15+ }
Original file line number Diff line number Diff line change 11{
22 "extends" : " ./.svelte-kit/tsconfig.json" ,
3- "compilerOptions" : {
4- "allowJs" : true ,
5- "checkJs" : true ,
6- "esModuleInterop" : true ,
7- "forceConsistentCasingInFileNames" : true ,
8- "resolveJsonModule" : true ,
9- "skipLibCheck" : true ,
10- "sourceMap" : true ,
11- "strict" : true ,
12- "moduleResolution" : " bundler"
13- }
14- // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
15- // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
16- //
17- // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
18- // from the referenced tsconfig.json - TypeScript does not merge them in
3+ "references" : [
4+ { "path" : " ./jsconfig.app.json" },
5+ { "path" : " ./jsconfig.vitest.json" },
6+ { "path" : " ./jsconfig.node.json" }
7+ ],
8+ // ensure it a dummy config
9+ "include" : [],
10+ "exclude" : [],
11+ "files" : []
1912}
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./jsconfig.base.json" ,
3+ "compilerOptions" : {
4+ "tsBuildInfoFile" : " node_modules/.tmp/node.tsbuildinfo" ,
5+ "lib" : [" esnext" ]
6+ },
7+ "include" : [
8+ " ./vite.config.js"
9+ ]
10+ }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./jsconfig.base.json" ,
3+ "compilerOptions" : {
4+ "tsBuildInfoFile" : " node_modules/.tmp/vitest.tsbuildinfo"
5+ },
6+ "include" : [
7+ " ./src/**/*.spec.js" ,
8+ " ./src/**/*.spec.ts" ,
9+ " ./src/**/*.test.js" ,
10+ " ./src/**/*.test.ts"
11+ ]
12+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " @qbane/sveltekit-template" ,
3- "version" : " 0.0.4 " ,
3+ "version" : " 0.0.5 " ,
44 "description" : " My opinionated SvelteKit template in pure JavaScript." ,
55 "author" : " qbane" ,
66 "type" : " module" ,
99 "dev" : " vite dev" ,
1010 "build" : " vite build" ,
1111 "preview" : " vite preview" ,
12- "check" : " svelte-kit sync && svelte-check --tsconfig ./jsconfig.json" ,
12+ "check" : " svelte-kit sync && svelte-check --tsconfig ./jsconfig.app.json" ,
13+ "tsc" : " tsc -b jsconfig.json" ,
1314 "check:watch" : " svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch" ,
1415 "test:unit" : " vitest" ,
1516 "test" : " npm run test:unit -- --run"
1617 },
1718 "devDependencies" : {
1819 "@sveltejs/adapter-node" : " ^5.2.12" ,
19- "@sveltejs/kit" : " ^2.21.4 " ,
20+ "@sveltejs/kit" : " ^2.22.2 " ,
2021 "@sveltejs/vite-plugin-svelte" : " ^5.1.0" ,
21- "svelte" : " ^5.34.1" ,
22- "svelte-check" : " ^4.2.1" ,
22+ "@types/node" : " ^22.15.34" ,
23+ "svelte" : " ^5.34.9" ,
24+ "svelte-check" : " ^4.2.2" ,
2325 "typescript" : " ^5.8.3" ,
2426 "vite" : " ^6.3.5" ,
25- "vitest" : " ^3.2.3 "
27+ "vitest" : " ^3.2.4 "
2628 },
2729 "engines" : {
28- "node" : " >=18 .0.0 <23 .0.0"
30+ "node" : " >=20 .0.0 <25 .0.0"
2931 }
3032}
You can’t perform that action at this time.
0 commit comments