Skip to content

Commit 873a09e

Browse files
authored
fix: revert tsconfig change, fix types (#11908)
The inclusion of `svelte.config.js` is a breaking change since it's type-checked now and that can break projects which did type-check without errors previously closes #11906 Also relaxes the report-uri types, fully qualified urls are also ok closes #11905
1 parent 30c78f2 commit 873a09e

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.changeset/afraid-ghosts-yell.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+
fix: revert tsconfig change that includes svelte.config.js

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export function get_tsconfig(kit) {
5858
'ambient.d.ts', // careful: changing this name would be a breaking change, because it's referenced in the service-workers documentation
5959
'non-ambient.d.ts',
6060
'./types/**/$types.d.ts',
61-
config_relative('svelte.config.js'),
6261
config_relative('vite.config.js'),
6362
config_relative('vite.config.ts')
6463
]);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ test('Creates tsconfig include from kit.files', () => {
7777
'ambient.d.ts',
7878
'non-ambient.d.ts',
7979
'./types/**/$types.d.ts',
80-
'../svelte.config.js',
8180
'../vite.config.js',
8281
'../vite.config.ts',
8382
'../app/**/*.js',

packages/kit/src/types/private.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export namespace Csp {
7373
type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
7474
type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
7575
type Sources = Source[];
76-
type UriPath = `${HttpDelineator}${string}`;
7776
}
7877

7978
export interface CspDirectives {
@@ -113,7 +112,7 @@ export interface CspDirectives {
113112
'form-action'?: Array<Csp.Source | Csp.ActionSource>;
114113
'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
115114
'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
116-
'report-uri'?: Csp.UriPath[];
115+
'report-uri'?: string[];
117116
'report-to'?: string[];
118117

119118
'require-trusted-types-for'?: Array<'script'>;

packages/kit/types/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,6 @@ declare module '@sveltejs/kit' {
14191419
type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
14201420
type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
14211421
type Sources = Source[];
1422-
type UriPath = `${HttpDelineator}${string}`;
14231422
}
14241423

14251424
interface CspDirectives {
@@ -1459,7 +1458,7 @@ declare module '@sveltejs/kit' {
14591458
'form-action'?: Array<Csp.Source | Csp.ActionSource>;
14601459
'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
14611460
'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
1462-
'report-uri'?: Csp.UriPath[];
1461+
'report-uri'?: string[];
14631462
'report-to'?: string[];
14641463

14651464
'require-trusted-types-for'?: Array<'script'>;

0 commit comments

Comments
 (0)