Skip to content

Commit 27bd09a

Browse files
committed
[fix] add test folder to includes
Also add some notes to tsconfig/jsonfig Fixes #5833
1 parent 4eacb4d commit 27bd09a

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

.changeset/hot-lions-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
Add notes about includes/excludes and path aliases

.changeset/warm-pots-melt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Add test folder to generated tsconfig

packages/create-svelte/shared/+checkjs/jsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
"sourceMap": true,
1111
"strict": true
1212
}
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
1317
}

packages/create-svelte/shared/+typescript/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
"sourceMap": true,
1111
"strict": true
1212
}
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
1317
}

packages/kit/src/core/sync/write_tsconfig.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export function write_tsconfig(config, cwd = process.cwd()) {
5353
include.push(config_relative(`${relative}/**/*.ts`));
5454
include.push(config_relative(`${relative}/**/*.svelte`));
5555
}
56+
// Test folder is a special case - we advocate putting tests in a top-level test folder
57+
// and it's not configurable (should we make it?)
58+
const test_folder = project_relative('test');
59+
include.push(config_relative(`${test_folder}/**/*.js`));
60+
include.push(config_relative(`${test_folder}/**/*.ts`));
61+
include.push(config_relative(`${test_folder}/**/*.svelte`));
5662

5763
write_if_changed(
5864
out,

0 commit comments

Comments
 (0)