Skip to content

Commit

Permalink
fix: revert tsconfig change, fix types (#11908)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dummdidumm committed Mar 6, 2024
1 parent 30c78f2 commit 873a09e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-ghosts-yell.md
@@ -0,0 +1,5 @@
---
"@sveltejs/kit": patch
---

fix: revert tsconfig change that includes svelte.config.js
1 change: 0 additions & 1 deletion packages/kit/src/core/sync/write_tsconfig.js
Expand Up @@ -58,7 +58,6 @@ export function get_tsconfig(kit) {
'ambient.d.ts', // careful: changing this name would be a breaking change, because it's referenced in the service-workers documentation
'non-ambient.d.ts',
'./types/**/$types.d.ts',
config_relative('svelte.config.js'),
config_relative('vite.config.js'),
config_relative('vite.config.ts')
]);
Expand Down
1 change: 0 additions & 1 deletion packages/kit/src/core/sync/write_tsconfig.spec.js
Expand Up @@ -77,7 +77,6 @@ test('Creates tsconfig include from kit.files', () => {
'ambient.d.ts',
'non-ambient.d.ts',
'./types/**/$types.d.ts',
'../svelte.config.js',
'../vite.config.js',
'../vite.config.ts',
'../app/**/*.js',
Expand Down
3 changes: 1 addition & 2 deletions packages/kit/src/types/private.d.ts
Expand Up @@ -73,7 +73,6 @@ export namespace Csp {
type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
type Sources = Source[];
type UriPath = `${HttpDelineator}${string}`;
}

export interface CspDirectives {
Expand Down Expand Up @@ -113,7 +112,7 @@ export interface CspDirectives {
'form-action'?: Array<Csp.Source | Csp.ActionSource>;
'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
'report-uri'?: Csp.UriPath[];
'report-uri'?: string[];
'report-to'?: string[];

'require-trusted-types-for'?: Array<'script'>;
Expand Down
3 changes: 1 addition & 2 deletions packages/kit/types/index.d.ts
Expand Up @@ -1419,7 +1419,6 @@ declare module '@sveltejs/kit' {
type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
type Sources = Source[];
type UriPath = `${HttpDelineator}${string}`;
}

interface CspDirectives {
Expand Down Expand Up @@ -1459,7 +1458,7 @@ declare module '@sveltejs/kit' {
'form-action'?: Array<Csp.Source | Csp.ActionSource>;
'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
'report-uri'?: Csp.UriPath[];
'report-uri'?: string[];
'report-to'?: string[];

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

0 comments on commit 873a09e

Please sign in to comment.