@sveltejs/kit 1.27.4 → 1.27.5
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 +1 -1
- package/src/core/config/options.js +1 -1
- package/src/core/sync/create_manifest_data/index.js +1 -1
- package/src/core/sync/write_tsconfig.js +1 -0
- package/src/exports/vite/build/build_server.js +1 -1
- package/src/exports/vite/graph_analysis/index.js +1 -1
- package/src/exports/vite/index.js +4 -4
- package/src/exports/vite/preview/index.js +1 -4
- package/src/runtime/client/client.js +31 -30
- package/src/runtime/client/parse.js +1 -1
- package/src/runtime/client/singletons.js +2 -2
- package/src/runtime/client/start.js +2 -2
- package/src/runtime/client/types.d.ts +2 -2
- package/src/runtime/client/utils.js +4 -2
- package/src/runtime/server/cookie.js +2 -2
- package/src/runtime/server/page/csp.js +2 -2
- package/src/runtime/server/page/index.js +1 -1
- package/src/runtime/server/page/load_data.js +2 -2
- package/src/runtime/server/page/render.js +2 -2
- package/src/runtime/server/page/respond_with_error.js +1 -1
- package/src/runtime/server/respond.js +1 -1
- package/src/types/internal.d.ts +1 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -444,7 +444,7 @@ function create_routes_and_nodes(cwd, config, fallback) {
|
|
|
444
444
|
* @param {string} file
|
|
445
445
|
* @param {string[]} component_extensions
|
|
446
446
|
* @param {string[]} module_extensions
|
|
447
|
-
* @returns {import('./types').RouteFile}
|
|
447
|
+
* @returns {import('./types.js').RouteFile}
|
|
448
448
|
*/
|
|
449
449
|
function analyze(project_relative, file, component_extensions, module_extensions) {
|
|
450
450
|
const component_extension = component_extensions.find((ext) => file.endsWith(ext));
|
|
@@ -88,6 +88,7 @@ export function get_tsconfig(kit, include_base_url) {
|
|
|
88
88
|
const include = new Set([
|
|
89
89
|
'ambient.d.ts',
|
|
90
90
|
'./types/**/$types.d.ts',
|
|
91
|
+
config_relative('vite.config.js'),
|
|
91
92
|
config_relative('vite.config.ts')
|
|
92
93
|
]);
|
|
93
94
|
// TODO(v2): find a better way to include all src files. We can't just use routes/lib only because
|
|
@@ -10,7 +10,7 @@ import { normalizePath } from 'vite';
|
|
|
10
10
|
* @param {import('types').ManifestData} manifest_data
|
|
11
11
|
* @param {import('vite').Manifest} server_manifest
|
|
12
12
|
* @param {import('vite').Manifest | null} client_manifest
|
|
13
|
-
* @param {import('
|
|
13
|
+
* @param {import('vite').Rollup.OutputAsset[] | null} css
|
|
14
14
|
*/
|
|
15
15
|
export function build_server_nodes(out, kit, manifest_data, server_manifest, client_manifest, css) {
|
|
16
16
|
mkdirp(`${out}/server/nodes`);
|
|
@@ -25,7 +25,7 @@ export function is_illegal(id, dirs) {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates a guard that checks that no id imports a module that is not allowed to be imported into client-side code.
|
|
28
|
-
* @param {import('
|
|
28
|
+
* @param {import('vite').Rollup.PluginContext} context
|
|
29
29
|
* @param {{ cwd: string; lib: string }} paths
|
|
30
30
|
*/
|
|
31
31
|
export function module_guard(context, { cwd, lib }) {
|
|
@@ -30,7 +30,7 @@ export { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
|
30
30
|
|
|
31
31
|
const cwd = process.cwd();
|
|
32
32
|
|
|
33
|
-
/** @type {import('./types').EnforcedConfig} */
|
|
33
|
+
/** @type {import('./types.js').EnforcedConfig} */
|
|
34
34
|
const enforced_config = {
|
|
35
35
|
appType: true,
|
|
36
36
|
base: true,
|
|
@@ -702,7 +702,7 @@ function kit({ svelte_config }) {
|
|
|
702
702
|
|
|
703
703
|
secondary_build_started = true;
|
|
704
704
|
|
|
705
|
-
const { output } = /** @type {import('
|
|
705
|
+
const { output } = /** @type {import('vite').Rollup.RollupOutput} */ (
|
|
706
706
|
await vite.build({
|
|
707
707
|
configFile: vite_config.configFile,
|
|
708
708
|
// CLI args
|
|
@@ -742,7 +742,7 @@ function kit({ svelte_config }) {
|
|
|
742
742
|
};
|
|
743
743
|
|
|
744
744
|
const css = output.filter(
|
|
745
|
-
/** @type {(value: any) => value is import('
|
|
745
|
+
/** @type {(value: any) => value is import('vite').Rollup.OutputAsset} */
|
|
746
746
|
(value) => value.type === 'asset' && value.fileName.endsWith('.css')
|
|
747
747
|
);
|
|
748
748
|
|
|
@@ -863,7 +863,7 @@ function warn_overridden_config(config, resolved_config) {
|
|
|
863
863
|
/**
|
|
864
864
|
* @param {Record<string, any>} config
|
|
865
865
|
* @param {Record<string, any>} resolved_config
|
|
866
|
-
* @param {import('./types').EnforcedConfig} enforced_config
|
|
866
|
+
* @param {import('./types.js').EnforcedConfig} enforced_config
|
|
867
867
|
* @param {string} path
|
|
868
868
|
* @param {string[]} out used locally to compute the return value
|
|
869
869
|
*/
|
|
@@ -15,10 +15,7 @@ import { not_found } from '../utils.js';
|
|
|
15
15
|
/** @typedef {(req: Req, res: Res, next: () => void) => void} Handler */
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @param {{
|
|
19
|
-
* middlewares: import('connect').Server;
|
|
20
|
-
* httpServer: import('http').Server;
|
|
21
|
-
* }} vite
|
|
18
|
+
* @param {{ middlewares: import('connect').Server }} vite
|
|
22
19
|
* @param {import('vite').ResolvedConfig} vite_config
|
|
23
20
|
* @param {import('types').ValidatedConfig} svelte_config
|
|
24
21
|
*/
|
|
@@ -22,7 +22,8 @@ import {
|
|
|
22
22
|
get_link_info,
|
|
23
23
|
get_router_options,
|
|
24
24
|
is_external_url,
|
|
25
|
-
scroll_state
|
|
25
|
+
scroll_state,
|
|
26
|
+
origin
|
|
26
27
|
} from './utils.js';
|
|
27
28
|
|
|
28
29
|
import { base } from '__sveltekit/paths';
|
|
@@ -55,9 +56,9 @@ function update_scroll_positions(index) {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
|
-
* @param {import('./types').SvelteKitApp} app
|
|
59
|
+
* @param {import('./types.js').SvelteKitApp} app
|
|
59
60
|
* @param {HTMLElement} target
|
|
60
|
-
* @returns {import('./types').Client}
|
|
61
|
+
* @returns {import('./types.js').Client}
|
|
61
62
|
*/
|
|
62
63
|
export function create_client(app, target) {
|
|
63
64
|
const routes = parse(app);
|
|
@@ -82,7 +83,7 @@ export function create_client(app, target) {
|
|
|
82
83
|
*/
|
|
83
84
|
const components = [];
|
|
84
85
|
|
|
85
|
-
/** @type {{id: string, promise: Promise<import('./types').NavigationResult>} | null} */
|
|
86
|
+
/** @type {{id: string, promise: Promise<import('./types.js').NavigationResult>} | null} */
|
|
86
87
|
let load_cache = null;
|
|
87
88
|
|
|
88
89
|
const callbacks = {
|
|
@@ -96,7 +97,7 @@ export function create_client(app, target) {
|
|
|
96
97
|
after_navigate: []
|
|
97
98
|
};
|
|
98
99
|
|
|
99
|
-
/** @type {import('./types').NavigationState} */
|
|
100
|
+
/** @type {import('./types.js').NavigationState} */
|
|
100
101
|
let current = {
|
|
101
102
|
branch: [],
|
|
102
103
|
error: null,
|
|
@@ -247,7 +248,7 @@ export function create_client(app, target) {
|
|
|
247
248
|
});
|
|
248
249
|
}
|
|
249
250
|
|
|
250
|
-
/** @param {import('./types').NavigationIntent} intent */
|
|
251
|
+
/** @param {import('./types.js').NavigationIntent} intent */
|
|
251
252
|
async function preload_data(intent) {
|
|
252
253
|
load_cache = {
|
|
253
254
|
id: intent.id,
|
|
@@ -274,7 +275,7 @@ export function create_client(app, target) {
|
|
|
274
275
|
await Promise.all(promises);
|
|
275
276
|
}
|
|
276
277
|
|
|
277
|
-
/** @param {import('./types').NavigationFinished} result */
|
|
278
|
+
/** @param {import('./types.js').NavigationFinished} result */
|
|
278
279
|
function initialize(result) {
|
|
279
280
|
if (DEV && result.state.error && document.querySelector('vite-error-overlay')) return;
|
|
280
281
|
|
|
@@ -315,7 +316,7 @@ export function create_client(app, target) {
|
|
|
315
316
|
* @param {{
|
|
316
317
|
* url: URL;
|
|
317
318
|
* params: Record<string, string>;
|
|
318
|
-
* branch: Array<import('./types').BranchNode | undefined>;
|
|
319
|
+
* branch: Array<import('./types.js').BranchNode | undefined>;
|
|
319
320
|
* status: number;
|
|
320
321
|
* error: App.Error | null;
|
|
321
322
|
* route: import('types').CSRRoute | null;
|
|
@@ -340,7 +341,7 @@ export function create_client(app, target) {
|
|
|
340
341
|
// eslint-disable-next-line
|
|
341
342
|
url.search = url.search; // turn `/?` into `/`
|
|
342
343
|
|
|
343
|
-
/** @type {import('./types').NavigationFinished} */
|
|
344
|
+
/** @type {import('./types.js').NavigationFinished} */
|
|
344
345
|
const result = {
|
|
345
346
|
type: 'loaded',
|
|
346
347
|
state: {
|
|
@@ -417,9 +418,9 @@ export function create_client(app, target) {
|
|
|
417
418
|
* url: URL;
|
|
418
419
|
* params: Record<string, string>;
|
|
419
420
|
* route: { id: string | null };
|
|
420
|
-
* server_data_node: import('./types').DataNode | null;
|
|
421
|
+
* server_data_node: import('./types.js').DataNode | null;
|
|
421
422
|
* }} options
|
|
422
|
-
* @returns {Promise<import('./types').BranchNode>}
|
|
423
|
+
* @returns {Promise<import('./types.js').BranchNode>}
|
|
423
424
|
*/
|
|
424
425
|
async function load_node({ loader, parent, url, params, route, server_data_node }) {
|
|
425
426
|
/** @type {Record<string, any> | null} */
|
|
@@ -589,8 +590,8 @@ export function create_client(app, target) {
|
|
|
589
590
|
|
|
590
591
|
/**
|
|
591
592
|
* @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node
|
|
592
|
-
* @param {import('./types').DataNode | null} [previous]
|
|
593
|
-
* @returns {import('./types').DataNode | null}
|
|
593
|
+
* @param {import('./types.js').DataNode | null} [previous]
|
|
594
|
+
* @returns {import('./types.js').DataNode | null}
|
|
594
595
|
*/
|
|
595
596
|
function create_data_node(node, previous) {
|
|
596
597
|
if (node?.type === 'data') return node;
|
|
@@ -599,8 +600,8 @@ export function create_client(app, target) {
|
|
|
599
600
|
}
|
|
600
601
|
|
|
601
602
|
/**
|
|
602
|
-
* @param {import('./types').NavigationIntent} intent
|
|
603
|
-
* @returns {Promise<import('./types').NavigationResult>}
|
|
603
|
+
* @param {import('./types.js').NavigationIntent} intent
|
|
604
|
+
* @returns {Promise<import('./types.js').NavigationResult>}
|
|
604
605
|
*/
|
|
605
606
|
async function load_route({ id, invalidating, url, params, route }) {
|
|
606
607
|
if (load_cache?.id === id) {
|
|
@@ -664,7 +665,7 @@ export function create_client(app, target) {
|
|
|
664
665
|
const branch_promises = loaders.map(async (loader, i) => {
|
|
665
666
|
if (!loader) return;
|
|
666
667
|
|
|
667
|
-
/** @type {import('./types').BranchNode | undefined} */
|
|
668
|
+
/** @type {import('./types.js').BranchNode | undefined} */
|
|
668
669
|
const previous = current.branch[i];
|
|
669
670
|
|
|
670
671
|
const server_data_node = server_data_nodes?.[i];
|
|
@@ -707,7 +708,7 @@ export function create_client(app, target) {
|
|
|
707
708
|
// if we don't do this, rejections will be unhandled
|
|
708
709
|
for (const p of branch_promises) p.catch(() => {});
|
|
709
710
|
|
|
710
|
-
/** @type {Array<import('./types').BranchNode | undefined>} */
|
|
711
|
+
/** @type {Array<import('./types.js').BranchNode | undefined>} */
|
|
711
712
|
const branch = [];
|
|
712
713
|
|
|
713
714
|
for (let i = 0; i < loaders.length; i += 1) {
|
|
@@ -781,9 +782,9 @@ export function create_client(app, target) {
|
|
|
781
782
|
|
|
782
783
|
/**
|
|
783
784
|
* @param {number} i Start index to backtrack from
|
|
784
|
-
* @param {Array<import('./types').BranchNode | undefined>} branch Branch to backtrack
|
|
785
|
+
* @param {Array<import('./types.js').BranchNode | undefined>} branch Branch to backtrack
|
|
785
786
|
* @param {Array<import('types').CSRPageNodeLoader | undefined>} errors All error pages for this branch
|
|
786
|
-
* @returns {Promise<{idx: number; node: import('./types').BranchNode} | undefined>}
|
|
787
|
+
* @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>}
|
|
787
788
|
*/
|
|
788
789
|
async function load_nearest_error_page(i, branch, errors) {
|
|
789
790
|
while (i--) {
|
|
@@ -815,7 +816,7 @@ export function create_client(app, target) {
|
|
|
815
816
|
* url: URL;
|
|
816
817
|
* route: { id: string | null }
|
|
817
818
|
* }} opts
|
|
818
|
-
* @returns {Promise<import('./types').NavigationFinished>}
|
|
819
|
+
* @returns {Promise<import('./types.js').NavigationFinished>}
|
|
819
820
|
*/
|
|
820
821
|
async function load_root_error_page({ status, error, url, route }) {
|
|
821
822
|
/** @type {Record<string, string>} */
|
|
@@ -843,7 +844,7 @@ export function create_client(app, target) {
|
|
|
843
844
|
} catch {
|
|
844
845
|
// at this point we have no choice but to fall back to the server, if it wouldn't
|
|
845
846
|
// bring us right back here, turning this into an endless loop
|
|
846
|
-
if (url.origin !==
|
|
847
|
+
if (url.origin !== origin || url.pathname !== location.pathname || hydrated) {
|
|
847
848
|
await native_navigation(url);
|
|
848
849
|
}
|
|
849
850
|
}
|
|
@@ -858,7 +859,7 @@ export function create_client(app, target) {
|
|
|
858
859
|
server_data_node: create_data_node(server_data_node)
|
|
859
860
|
});
|
|
860
861
|
|
|
861
|
-
/** @type {import('./types').BranchNode} */
|
|
862
|
+
/** @type {import('./types.js').BranchNode} */
|
|
862
863
|
const root_error = {
|
|
863
864
|
node: await default_error_loader(),
|
|
864
865
|
loader: default_error_loader,
|
|
@@ -891,7 +892,7 @@ export function create_client(app, target) {
|
|
|
891
892
|
|
|
892
893
|
if (params) {
|
|
893
894
|
const id = url.pathname + url.search;
|
|
894
|
-
/** @type {import('./types').NavigationIntent} */
|
|
895
|
+
/** @type {import('./types.js').NavigationIntent} */
|
|
895
896
|
const intent = { id, invalidating, route, params: decode_params(params), url };
|
|
896
897
|
return intent;
|
|
897
898
|
}
|
|
@@ -907,7 +908,7 @@ export function create_client(app, target) {
|
|
|
907
908
|
* @param {{
|
|
908
909
|
* url: URL;
|
|
909
910
|
* type: import('@sveltejs/kit').Navigation["type"];
|
|
910
|
-
* intent?: import('./types').NavigationIntent;
|
|
911
|
+
* intent?: import('./types.js').NavigationIntent;
|
|
911
912
|
* delta?: number;
|
|
912
913
|
* }} opts
|
|
913
914
|
*/
|
|
@@ -1170,10 +1171,10 @@ export function create_client(app, target) {
|
|
|
1170
1171
|
* @param {{ id: string | null }} route
|
|
1171
1172
|
* @param {App.Error} error
|
|
1172
1173
|
* @param {number} status
|
|
1173
|
-
* @returns {Promise<import('./types').NavigationFinished>}
|
|
1174
|
+
* @returns {Promise<import('./types.js').NavigationFinished>}
|
|
1174
1175
|
*/
|
|
1175
1176
|
async function server_fallback(url, route, error, status) {
|
|
1176
|
-
if (url.origin ===
|
|
1177
|
+
if (url.origin === origin && url.pathname === location.pathname && !hydrated) {
|
|
1177
1178
|
// We would reload the same page we're currently on, which isn't hydrated,
|
|
1178
1179
|
// which means no SSR, which means we would end up in an endless loop
|
|
1179
1180
|
return await load_root_error_page({
|
|
@@ -1765,7 +1766,7 @@ export function create_client(app, target) {
|
|
|
1765
1766
|
({ params = {}, route = { id: null } } = get_navigation_intent(url, false) || {});
|
|
1766
1767
|
}
|
|
1767
1768
|
|
|
1768
|
-
/** @type {import('./types').NavigationFinished | undefined} */
|
|
1769
|
+
/** @type {import('./types.js').NavigationFinished | undefined} */
|
|
1769
1770
|
let result;
|
|
1770
1771
|
|
|
1771
1772
|
try {
|
|
@@ -1792,7 +1793,7 @@ export function create_client(app, target) {
|
|
|
1792
1793
|
});
|
|
1793
1794
|
});
|
|
1794
1795
|
|
|
1795
|
-
/** @type {Array<import('./types').BranchNode | undefined>} */
|
|
1796
|
+
/** @type {Array<import('./types.js').BranchNode | undefined>} */
|
|
1796
1797
|
const branch = await Promise.all(branch_promises);
|
|
1797
1798
|
|
|
1798
1799
|
const parsed_route = routes.find(({ id }) => id === route.id);
|
|
@@ -2018,8 +2019,8 @@ function reset_focus() {
|
|
|
2018
2019
|
}
|
|
2019
2020
|
|
|
2020
2021
|
/**
|
|
2021
|
-
* @param {import('./types').NavigationState} current
|
|
2022
|
-
* @param {import('./types').NavigationIntent | undefined} intent
|
|
2022
|
+
* @param {import('./types.js').NavigationState} current
|
|
2023
|
+
* @param {import('./types.js').NavigationIntent | undefined} intent
|
|
2023
2024
|
* @param {URL | null} url
|
|
2024
2025
|
* @param {Exclude<import('@sveltejs/kit').NavigationType, 'enter'>} type
|
|
2025
2026
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { exec, parse_route_id } from '../../utils/routing.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @param {import('./types').SvelteKitApp} app
|
|
4
|
+
* @param {import('./types.js').SvelteKitApp} app
|
|
5
5
|
* @returns {import('types').CSRRoute[]}
|
|
6
6
|
*/
|
|
7
7
|
export function parse({ nodes, server_loads, dictionary, matchers }) {
|
|
@@ -2,12 +2,12 @@ import { writable } from 'svelte/store';
|
|
|
2
2
|
import { create_updated_store, notifiable_store } from './utils.js';
|
|
3
3
|
import { BROWSER } from 'esm-env';
|
|
4
4
|
|
|
5
|
-
/** @type {import('./types').Client} */
|
|
5
|
+
/** @type {import('./types.js').Client} */
|
|
6
6
|
export let client;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {{
|
|
10
|
-
* client: import('./types').Client;
|
|
10
|
+
* client: import('./types.js').Client;
|
|
11
11
|
* }} opts
|
|
12
12
|
*/
|
|
13
13
|
export function init(opts) {
|
|
@@ -3,9 +3,9 @@ import { create_client } from './client.js';
|
|
|
3
3
|
import { init } from './singletons.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @param {import('./types').SvelteKitApp} app
|
|
6
|
+
* @param {import('./types.js').SvelteKitApp} app
|
|
7
7
|
* @param {HTMLElement} target
|
|
8
|
-
* @param {Parameters<import('./types').Client['_hydrate']>[0]} [hydrate]
|
|
8
|
+
* @param {Parameters<import('./types.js').Client['_hydrate']>[0]} [hydrate]
|
|
9
9
|
*/
|
|
10
10
|
export async function start(app, target, hydrate) {
|
|
11
11
|
if (DEV && target === document.body) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applyAction } from '../app/forms';
|
|
1
|
+
import { applyAction } from '../app/forms.js';
|
|
2
2
|
import {
|
|
3
3
|
afterNavigate,
|
|
4
4
|
beforeNavigate,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
invalidateAll,
|
|
9
9
|
preloadCode,
|
|
10
10
|
preloadData
|
|
11
|
-
} from '../app/navigation';
|
|
11
|
+
} from '../app/navigation.js';
|
|
12
12
|
import { SvelteComponent } from 'svelte';
|
|
13
13
|
import { ClientHooks, CSRPageNode, CSRPageNodeLoader, CSRRoute, TrailingSlash, Uses } from 'types';
|
|
14
14
|
import { Page, ParamMatcher } from '@sveltejs/kit';
|
|
@@ -6,6 +6,8 @@ import { PRELOAD_PRIORITIES } from './constants.js';
|
|
|
6
6
|
|
|
7
7
|
/* global __SVELTEKIT_APP_VERSION_FILE__, __SVELTEKIT_APP_VERSION_POLL_INTERVAL__ */
|
|
8
8
|
|
|
9
|
+
export const origin = BROWSER ? location.origin : '';
|
|
10
|
+
|
|
9
11
|
/** @param {HTMLDocument} doc */
|
|
10
12
|
export function get_base_uri(doc) {
|
|
11
13
|
let baseURI = doc.baseURI;
|
|
@@ -135,7 +137,7 @@ export function get_link_info(a, base) {
|
|
|
135
137
|
is_external_url(url, base) ||
|
|
136
138
|
(a.getAttribute('rel') || '').split(/\s+/).includes('external');
|
|
137
139
|
|
|
138
|
-
const download = url?.origin ===
|
|
140
|
+
const download = url?.origin === origin && a.hasAttribute('download');
|
|
139
141
|
|
|
140
142
|
return { url, external, target, download };
|
|
141
143
|
}
|
|
@@ -290,5 +292,5 @@ export function create_updated_store() {
|
|
|
290
292
|
* @param {string} base
|
|
291
293
|
*/
|
|
292
294
|
export function is_external_url(url, base) {
|
|
293
|
-
return url.origin !==
|
|
295
|
+
return url.origin !== origin || !url.pathname.startsWith(base);
|
|
294
296
|
}
|
|
@@ -27,7 +27,7 @@ export function get_cookies(request, url, trailing_slash) {
|
|
|
27
27
|
// Emulate browser-behavior: if the cookie is set at '/foo/bar', its path is '/foo'
|
|
28
28
|
const default_path = normalized_url.split('/').slice(0, -1).join('/') || '/';
|
|
29
29
|
|
|
30
|
-
/** @type {Record<string, import('./page/types').Cookie>} */
|
|
30
|
+
/** @type {Record<string, import('./page/types.js').Cookie>} */
|
|
31
31
|
const new_cookies = {};
|
|
32
32
|
|
|
33
33
|
/** @type {import('cookie').CookieSerializeOptions} */
|
|
@@ -232,7 +232,7 @@ export function path_matches(path, constraint) {
|
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* @param {Headers} headers
|
|
235
|
-
* @param {import('./page/types').Cookie[]} cookies
|
|
235
|
+
* @param {import('./page/types.js').Cookie[]} cookies
|
|
236
236
|
*/
|
|
237
237
|
export function add_cookies_to_headers(headers, cookies) {
|
|
238
238
|
for (const new_cookie of cookies) {
|
|
@@ -223,8 +223,8 @@ export class Csp {
|
|
|
223
223
|
report_only_provider;
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* @param {import('./types').CspConfig} config
|
|
227
|
-
* @param {import('./types').CspOpts} opts
|
|
226
|
+
* @param {import('./types.js').CspConfig} config
|
|
227
|
+
* @param {import('./types.js').CspOpts} opts
|
|
228
228
|
*/
|
|
229
229
|
constructor({ mode, directives, reportOnly }, { prerender }) {
|
|
230
230
|
const use_hashes = mode === 'hash' || (mode === 'auto' && prerender);
|
|
@@ -96,7 +96,7 @@ export async function render_page(event, page, options, manifest, state, resolve
|
|
|
96
96
|
// inherit the prerender option of the page
|
|
97
97
|
state.prerender_default = should_prerender;
|
|
98
98
|
|
|
99
|
-
/** @type {import('./types').Fetched[]} */
|
|
99
|
+
/** @type {import('./types.js').Fetched[]} */
|
|
100
100
|
const fetched = [];
|
|
101
101
|
|
|
102
102
|
if (get_option(nodes, 'ssr') === false && !state.prerendering) {
|
|
@@ -144,7 +144,7 @@ export async function load_server_data({
|
|
|
144
144
|
* Calls the user's `load` function.
|
|
145
145
|
* @param {{
|
|
146
146
|
* event: import('@sveltejs/kit').RequestEvent;
|
|
147
|
-
* fetched: import('./types').Fetched[];
|
|
147
|
+
* fetched: import('./types.js').Fetched[];
|
|
148
148
|
* node: import('types').SSRNode | undefined;
|
|
149
149
|
* parent: () => Promise<Record<string, any>>;
|
|
150
150
|
* resolve_opts: import('types').RequiredResolveOptions;
|
|
@@ -192,7 +192,7 @@ export async function load_data({
|
|
|
192
192
|
/**
|
|
193
193
|
* @param {Pick<import('@sveltejs/kit').RequestEvent, 'fetch' | 'url' | 'request' | 'route'>} event
|
|
194
194
|
* @param {import('types').SSRState} state
|
|
195
|
-
* @param {import('./types').Fetched[]} fetched
|
|
195
|
+
* @param {import('./types.js').Fetched[]} fetched
|
|
196
196
|
* @param {boolean} csr
|
|
197
197
|
* @param {Pick<Required<import('@sveltejs/kit').ResolveOptions>, 'filterSerializedResponseHeaders'>} resolve_opts
|
|
198
198
|
*/
|
|
@@ -26,8 +26,8 @@ const encoder = new TextEncoder();
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates the HTML response.
|
|
28
28
|
* @param {{
|
|
29
|
-
* branch: Array<import('./types').Loaded>;
|
|
30
|
-
* fetched: Array<import('./types').Fetched>;
|
|
29
|
+
* branch: Array<import('./types.js').Loaded>;
|
|
30
|
+
* fetched: Array<import('./types.js').Fetched>;
|
|
31
31
|
* options: import('types').SSROptions;
|
|
32
32
|
* manifest: import('@sveltejs/kit').SSRManifest;
|
|
33
33
|
* state: import('types').SSRState;
|
|
@@ -33,7 +33,7 @@ export async function respond_with_error({
|
|
|
33
33
|
return static_error_page(options, status, /** @type {Error} */ (error).message);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/** @type {import('./types').Fetched[]} */
|
|
36
|
+
/** @type {import('./types.js').Fetched[]} */
|
|
37
37
|
const fetched = [];
|
|
38
38
|
|
|
39
39
|
try {
|
|
@@ -134,7 +134,7 @@ export async function respond(request, options, manifest, state) {
|
|
|
134
134
|
/** @type {Record<string, string>} */
|
|
135
135
|
const headers = {};
|
|
136
136
|
|
|
137
|
-
/** @type {Record<string, import('./page/types').Cookie>} */
|
|
137
|
+
/** @type {Record<string, import('./page/types.js').Cookie>} */
|
|
138
138
|
let cookies_to_add = {};
|
|
139
139
|
|
|
140
140
|
/** @type {import('@sveltejs/kit').RequestEvent} */
|
package/src/types/internal.d.ts
CHANGED
package/src/version.js
CHANGED