@sveltejs/kit 1.30.3 → 1.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/core/adapt/builder.js +1 -1
- package/src/core/sync/write_tsconfig.js +2 -2
- package/src/exports/hooks/sequence.js +1 -1
- package/src/exports/node/index.js +1 -1
- package/src/exports/public.d.ts +7 -7
- package/src/exports/vite/dev/index.js +1 -1
- package/src/exports/vite/preview/index.js +1 -1
- package/src/runtime/client/client.js +4 -4
- package/src/runtime/server/page/load_data.js +4 -4
- package/src/runtime/server/page/render.js +2 -2
- package/src/runtime/server/respond.js +2 -2
- package/src/utils/routing.js +1 -1
- package/src/version.js +1 -1
- package/types/index.d.ts +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.4",
|
|
4
4
|
"description": "The fastest way to build Svelte apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"set-cookie-parser": "^2.6.0",
|
|
24
24
|
"sirv": "^2.0.2",
|
|
25
25
|
"tiny-glob": "^0.2.9",
|
|
26
|
-
"undici": "
|
|
26
|
+
"undici": "^5.28.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@playwright/test": "1.30.0",
|
|
@@ -213,7 +213,7 @@ async function compress_file(file, format = 'gz') {
|
|
|
213
213
|
[zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY,
|
|
214
214
|
[zlib.constants.BROTLI_PARAM_SIZE_HINT]: statSync(file).size
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
})
|
|
217
217
|
: zlib.createGzip({ level: zlib.constants.Z_BEST_COMPRESSION });
|
|
218
218
|
|
|
219
219
|
const source = createReadStream(file);
|
|
@@ -182,8 +182,8 @@ function validate_user_config(kit, cwd, out, config) {
|
|
|
182
182
|
typeof extend === 'string'
|
|
183
183
|
? path.resolve(cwd, extend) === out
|
|
184
184
|
: Array.isArray(extend)
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
? extend.some((e) => path.resolve(cwd, e) === out)
|
|
186
|
+
: false;
|
|
187
187
|
|
|
188
188
|
const options = config.options.compilerOptions || {};
|
|
189
189
|
|
|
@@ -124,7 +124,7 @@ export async function setResponse(res, response) {
|
|
|
124
124
|
? set_cookie_parser.splitCookiesString(
|
|
125
125
|
// This is absurd but necessary, TODO: investigate why
|
|
126
126
|
/** @type {string}*/ (response.headers.get(key))
|
|
127
|
-
|
|
127
|
+
)
|
|
128
128
|
: value
|
|
129
129
|
);
|
|
130
130
|
} catch (error) {
|
package/src/exports/public.d.ts
CHANGED
|
@@ -42,12 +42,12 @@ export interface Adapter {
|
|
|
42
42
|
type AwaitedPropertiesUnion<input extends Record<string, any> | void> = input extends void
|
|
43
43
|
? undefined // needs to be undefined, because void will break intellisense
|
|
44
44
|
: input extends Record<string, any>
|
|
45
|
-
|
|
45
|
+
? {
|
|
46
46
|
[key in keyof input]: Awaited<input[key]>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
}
|
|
48
|
+
: {} extends input // handles the any case
|
|
49
|
+
? input
|
|
50
|
+
: unknown;
|
|
51
51
|
|
|
52
52
|
export type AwaitedProperties<input extends Record<string, any> | void> =
|
|
53
53
|
AwaitedPropertiesUnion<input> extends Record<string, any>
|
|
@@ -70,8 +70,8 @@ type OptionalUnion<
|
|
|
70
70
|
type UnpackValidationError<T> = T extends ActionFailure<infer X>
|
|
71
71
|
? X
|
|
72
72
|
: T extends void
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
? undefined // needs to be undefined, because void will corrupt union type
|
|
74
|
+
: T;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* This object is passed to the `adapt` function of adapters.
|
|
@@ -550,10 +550,10 @@ export function create_client(app, target) {
|
|
|
550
550
|
typeof data !== 'object'
|
|
551
551
|
? `a ${typeof data}`
|
|
552
552
|
: data instanceof Response
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
553
|
+
? 'a Response object'
|
|
554
|
+
: Array.isArray(data)
|
|
555
|
+
? 'an array'
|
|
556
|
+
: 'a non-plain object'
|
|
557
557
|
}, but must return a plain object at the top level (i.e. \`return {...}\`)`
|
|
558
558
|
);
|
|
559
559
|
}
|
|
@@ -398,10 +398,10 @@ function validate_load_response(data, id) {
|
|
|
398
398
|
typeof data !== 'object'
|
|
399
399
|
? `a ${typeof data}`
|
|
400
400
|
: data instanceof Response
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
401
|
+
? 'a Response object'
|
|
402
|
+
: Array.isArray(data)
|
|
403
|
+
? 'an array'
|
|
404
|
+
: 'a non-plain object'
|
|
405
405
|
}, but must return a plain object at the top level (i.e. \`return {...}\`)`
|
|
406
406
|
);
|
|
407
407
|
}
|
|
@@ -467,7 +467,7 @@ export async function render_response({
|
|
|
467
467
|
? text(transformed, {
|
|
468
468
|
status,
|
|
469
469
|
headers
|
|
470
|
-
|
|
470
|
+
})
|
|
471
471
|
: new Response(
|
|
472
472
|
new ReadableStream({
|
|
473
473
|
async start(controller) {
|
|
@@ -485,7 +485,7 @@ export async function render_response({
|
|
|
485
485
|
'content-type': 'text/html'
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
|
|
488
|
+
);
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
/**
|
|
@@ -341,8 +341,8 @@ export async function respond(request, options, manifest, state) {
|
|
|
341
341
|
const response = is_data_request
|
|
342
342
|
? redirect_json_response(e)
|
|
343
343
|
: route?.page && is_action_json_request(event)
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
? action_json_redirect(e)
|
|
345
|
+
: redirect_response(e.status, e.location);
|
|
346
346
|
add_cookies_to_headers(response.headers, Object.values(cookies_to_add));
|
|
347
347
|
return response;
|
|
348
348
|
}
|
package/src/utils/routing.js
CHANGED
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -22,12 +22,12 @@ declare module '@sveltejs/kit' {
|
|
|
22
22
|
type AwaitedPropertiesUnion<input extends Record<string, any> | void> = input extends void
|
|
23
23
|
? undefined // needs to be undefined, because void will break intellisense
|
|
24
24
|
: input extends Record<string, any>
|
|
25
|
-
|
|
25
|
+
? {
|
|
26
26
|
[key in keyof input]: Awaited<input[key]>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
}
|
|
28
|
+
: {} extends input // handles the any case
|
|
29
|
+
? input
|
|
30
|
+
: unknown;
|
|
31
31
|
|
|
32
32
|
export type AwaitedProperties<input extends Record<string, any> | void> =
|
|
33
33
|
AwaitedPropertiesUnion<input> extends Record<string, any>
|
|
@@ -50,8 +50,8 @@ declare module '@sveltejs/kit' {
|
|
|
50
50
|
type UnpackValidationError<T> = T extends ActionFailure<infer X>
|
|
51
51
|
? X
|
|
52
52
|
: T extends void
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
? undefined // needs to be undefined, because void will corrupt union type
|
|
54
|
+
: T;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* This object is passed to the `adapt` function of adapters.
|