@sveltejs/kit 3.0.0-next.8 → 3.0.0-next.9
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 +5 -2
- package/src/core/config/index.js +1 -2
- package/src/core/config/options.js +4 -1
- package/src/core/sync/write_tsconfig.js +14 -4
- package/src/core/sync/write_tsconfig_test/package.json +7 -0
- package/src/exports/hooks/sequence.js +3 -2
- package/src/exports/index.js +1 -1
- package/src/exports/public.d.ts +1 -9
- package/src/exports/vite/dev/index.js +1 -4
- package/src/exports/vite/index.js +46 -15
- package/src/exports/vite/utils.js +10 -10
- package/src/runtime/app/environment/index.js +3 -3
- package/src/runtime/app/server/remote/prerender.js +1 -2
- package/src/runtime/client/client.js +1 -1
- package/src/runtime/client/state.svelte.js +0 -1
- package/src/runtime/env/dynamic/private.js +7 -0
- package/src/runtime/env/dynamic/public.js +7 -0
- package/src/runtime/env/static/private.js +6 -0
- package/src/runtime/env/static/public.js +6 -0
- package/src/runtime/server/cookie.js +34 -16
- package/src/runtime/server/csrf.js +1 -1
- package/src/runtime/server/data/index.js +8 -12
- package/src/runtime/server/respond.js +1 -1
- package/src/types/internal.d.ts +4 -1
- package/src/utils/imports.js +83 -0
- package/src/version.js +1 -1
- package/types/index.d.ts +4 -246
- package/types/index.d.ts.map +1 -25
- package/src/types/synthetic/$lib.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.9",
|
|
4
4
|
"description": "SvelteKit is the fastest way to build Svelte apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
35
35
|
"@types/connect": "^3.4.38",
|
|
36
36
|
"@types/node": "^22.19.19",
|
|
37
|
-
"dts-buddy": "^0.8.
|
|
37
|
+
"dts-buddy": "^0.8.2",
|
|
38
38
|
"jsdom": "^29.1.1",
|
|
39
39
|
"rolldown": "^1.1.2",
|
|
40
40
|
"svelte": "^5.56.3",
|
|
@@ -72,14 +72,17 @@
|
|
|
72
72
|
],
|
|
73
73
|
"imports": {
|
|
74
74
|
"#app/paths": {
|
|
75
|
+
"workerd": "./src/runtime/app/paths/server.js",
|
|
75
76
|
"browser": "./src/runtime/app/paths/client.js",
|
|
76
77
|
"default": "./src/runtime/app/paths/server.js"
|
|
77
78
|
},
|
|
78
79
|
"#app/env/public": {
|
|
80
|
+
"workerd": "./src/runtime/app/env/public/server.js",
|
|
79
81
|
"browser": "./src/runtime/app/env/public/client.js",
|
|
80
82
|
"default": "./src/runtime/app/env/public/server.js"
|
|
81
83
|
},
|
|
82
84
|
"#internal": {
|
|
85
|
+
"workerd": "./src/exports/internal/server/index.js",
|
|
83
86
|
"browser": "./src/exports/internal/client.js",
|
|
84
87
|
"default": "./src/exports/internal/server/index.js"
|
|
85
88
|
}
|
package/src/core/config/index.js
CHANGED
|
@@ -161,7 +161,7 @@ export function process_config(config, cwd) {
|
|
|
161
161
|
config.kit.files.hooks.client = path.resolve(cwd, config.kit.files.hooks.client);
|
|
162
162
|
config.kit.files.hooks.server = path.resolve(cwd, config.kit.files.hooks.server);
|
|
163
163
|
config.kit.files.hooks.universal = path.resolve(cwd, config.kit.files.hooks.universal);
|
|
164
|
-
} else {
|
|
164
|
+
} else if (key !== 'lib' /* TODO remove when we remove the `lib` option altogether */) {
|
|
165
165
|
// @ts-expect-error
|
|
166
166
|
config.kit.files[key] = path.resolve(cwd, config.kit.files[key]);
|
|
167
167
|
}
|
|
@@ -191,7 +191,6 @@ export function validate_config(config) {
|
|
|
191
191
|
files.hooks.client ??= path.join(files.src, 'hooks.client');
|
|
192
192
|
files.hooks.server ??= path.join(files.src, 'hooks.server');
|
|
193
193
|
files.hooks.universal ??= path.join(files.src, 'hooks');
|
|
194
|
-
files.lib ??= path.join(files.src, 'lib');
|
|
195
194
|
files.params ??= path.join(files.src, 'params');
|
|
196
195
|
files.routes ??= path.join(files.src, 'routes');
|
|
197
196
|
files.serviceWorker ??= path.join(files.src, 'service-worker');
|
|
@@ -140,7 +140,10 @@ export const validate_kit_options = object({
|
|
|
140
140
|
server: string(null),
|
|
141
141
|
universal: string(null)
|
|
142
142
|
}),
|
|
143
|
-
lib:
|
|
143
|
+
lib: removed(
|
|
144
|
+
(keypath) =>
|
|
145
|
+
`\`${keypath}\` has been removed. Use #lib instead of $lib: https://svelte.dev/docs/kit/$lib`
|
|
146
|
+
),
|
|
144
147
|
params: string(null),
|
|
145
148
|
routes: string(null),
|
|
146
149
|
serviceWorker: string(null),
|
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { styleText } from 'node:util';
|
|
4
4
|
import { posixify } from '../../utils/os.js';
|
|
5
|
+
import { read_package_imports, normalize_import_value } from '../../utils/imports.js';
|
|
5
6
|
import { write_if_changed } from './utils.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -65,7 +66,7 @@ export function get_tsconfig(kit, cwd) {
|
|
|
65
66
|
config_relative('vite.config.js'),
|
|
66
67
|
config_relative('vite.config.ts')
|
|
67
68
|
]);
|
|
68
|
-
const src_includes = [kit.files.routes, kit.files.
|
|
69
|
+
const src_includes = [kit.files.routes, kit.files.src].filter((dir) => {
|
|
69
70
|
const relative = path.relative(kit.files.src, dir);
|
|
70
71
|
return !relative || relative.startsWith('..');
|
|
71
72
|
});
|
|
@@ -198,7 +199,7 @@ const alias_regex = /^(.+?)(\/\*)?$/;
|
|
|
198
199
|
const value_regex = /^(.*?)((\/\*)|(\.\w+))?$/;
|
|
199
200
|
|
|
200
201
|
/**
|
|
201
|
-
* Generates tsconfig path aliases from kit's aliases.
|
|
202
|
+
* Generates tsconfig path aliases from kit's aliases and the package.json `imports` field.
|
|
202
203
|
* Related to vite alias creation.
|
|
203
204
|
*
|
|
204
205
|
* @param {import('types').ValidatedKitConfig} config
|
|
@@ -215,8 +216,17 @@ function get_tsconfig_paths(config, cwd) {
|
|
|
215
216
|
};
|
|
216
217
|
|
|
217
218
|
const alias = { ...config.alias };
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
|
|
220
|
+
// Add all `#`-prefixed imports from package.json as path aliases
|
|
221
|
+
const imports = read_package_imports(cwd);
|
|
222
|
+
if (imports) {
|
|
223
|
+
for (const [key, raw_value] of Object.entries(imports)) {
|
|
224
|
+
if (!key.startsWith('#')) continue;
|
|
225
|
+
const value = normalize_import_value(raw_value);
|
|
226
|
+
if (value) {
|
|
227
|
+
alias[key] = value;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
220
230
|
}
|
|
221
231
|
|
|
222
232
|
/** @type {Record<string, string[]>} */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** @import { Handle, RequestEvent, ResolveOptions } from '@sveltejs/kit' */
|
|
2
|
-
/** @import { MaybePromise } from 'types' */
|
|
3
2
|
import {
|
|
4
3
|
merge_tracing,
|
|
5
4
|
get_request_store,
|
|
@@ -74,6 +73,8 @@ import {
|
|
|
74
73
|
* first post-processing
|
|
75
74
|
* ```
|
|
76
75
|
*
|
|
76
|
+
* Calling `resolve` invokes the next handler in the sequence (or SvelteKit itself, if it is the last one). To pass data between handlers, use `event.locals`.
|
|
77
|
+
*
|
|
77
78
|
* @param {...Handle} handlers The chain of `handle` functions
|
|
78
79
|
* @returns {Handle}
|
|
79
80
|
*/
|
|
@@ -89,7 +90,7 @@ export function sequence(...handlers) {
|
|
|
89
90
|
* @param {number} i
|
|
90
91
|
* @param {RequestEvent} event
|
|
91
92
|
* @param {ResolveOptions | undefined} parent_options
|
|
92
|
-
* @returns {
|
|
93
|
+
* @returns {Promise<Response>}
|
|
93
94
|
*/
|
|
94
95
|
function apply_handle(i, event, parent_options) {
|
|
95
96
|
const handle = handlers[i];
|
package/src/exports/index.js
CHANGED
|
@@ -234,7 +234,7 @@ export function isActionFailure(e) {
|
|
|
234
234
|
* ```ts
|
|
235
235
|
* import { invalid } from '@sveltejs/kit';
|
|
236
236
|
* import { form } from '$app/server';
|
|
237
|
-
* import { tryLogin } from '
|
|
237
|
+
* import { tryLogin } from '#lib/server/auth';
|
|
238
238
|
* import * as v from 'valibot';
|
|
239
239
|
*
|
|
240
240
|
* export const login = form(
|
package/src/exports/public.d.ts
CHANGED
|
@@ -435,8 +435,6 @@ export interface KitConfig {
|
|
|
435
435
|
*
|
|
436
436
|
* > [!NOTE] When `mode` is `'auto'`, SvelteKit will use nonces for dynamically rendered pages and hashes for prerendered pages. Using nonces with prerendered pages is insecure and therefore forbidden.
|
|
437
437
|
*
|
|
438
|
-
* > [!NOTE] Note that most [Svelte transitions](https://svelte.dev/tutorial/svelte/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
|
|
439
|
-
*
|
|
440
438
|
* If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) to roll your own CSP.
|
|
441
439
|
*/
|
|
442
440
|
csp?: {
|
|
@@ -550,12 +548,6 @@ export interface KitConfig {
|
|
|
550
548
|
*/
|
|
551
549
|
universal?: string;
|
|
552
550
|
};
|
|
553
|
-
/**
|
|
554
|
-
* Your app's internal library, accessible throughout the codebase as `$lib`.
|
|
555
|
-
* @deprecated this feature is still supported, but it's generally recommended to use [monorepos](https://levelup.video/tutorials/monorepos-with-pnpm) instead
|
|
556
|
-
* @default "src/lib"
|
|
557
|
-
*/
|
|
558
|
-
lib?: string;
|
|
559
551
|
/**
|
|
560
552
|
* A directory containing [parameter matchers](https://svelte.dev/docs/kit/advanced-routing#Matching).
|
|
561
553
|
* @deprecated this feature is still supported, but it's generally recommended to use [monorepos](https://levelup.video/tutorials/monorepos-with-pnpm) instead
|
|
@@ -962,7 +954,7 @@ export interface KitConfig {
|
|
|
962
954
|
*/
|
|
963
955
|
export type Handle = (input: {
|
|
964
956
|
event: RequestEvent;
|
|
965
|
-
resolve: (event: RequestEvent, opts?: ResolveOptions) =>
|
|
957
|
+
resolve: (event: RequestEvent, opts?: ResolveOptions) => Promise<Response>;
|
|
966
958
|
}) => MaybePromise<Response>;
|
|
967
959
|
|
|
968
960
|
/**
|
|
@@ -407,10 +407,7 @@ export async function dev(vite, vite_config, svelte_config, get_remotes, root) {
|
|
|
407
407
|
dev: true,
|
|
408
408
|
etag: true,
|
|
409
409
|
maxAge: 0,
|
|
410
|
-
extensions: []
|
|
411
|
-
setHeaders: (res) => {
|
|
412
|
-
res.setHeader('access-control-allow-origin', '*');
|
|
413
|
-
}
|
|
410
|
+
extensions: []
|
|
414
411
|
});
|
|
415
412
|
|
|
416
413
|
vite.middlewares.use((req, res, next) => {
|
|
@@ -43,6 +43,7 @@ import analyse from '../../core/postbuild/analyse.js';
|
|
|
43
43
|
import { s } from '../../utils/misc.js';
|
|
44
44
|
import { hash } from '../../utils/hash.js';
|
|
45
45
|
import { dedent } from '../../core/sync/utils.js';
|
|
46
|
+
import { get_import_aliases, get_hash_import_keys } from '../../utils/imports.js';
|
|
46
47
|
import {
|
|
47
48
|
app_env_private,
|
|
48
49
|
app_server,
|
|
@@ -97,7 +98,7 @@ const enforced_config = {
|
|
|
97
98
|
resolve: {
|
|
98
99
|
alias: {
|
|
99
100
|
$app: true,
|
|
100
|
-
$
|
|
101
|
+
$env: true,
|
|
101
102
|
'$service-worker': true
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -303,10 +304,14 @@ function kit({ svelte_config }) {
|
|
|
303
304
|
|
|
304
305
|
/** @type {string} */
|
|
305
306
|
let normalized_cwd;
|
|
306
|
-
/** @type {string} */
|
|
307
|
-
let
|
|
307
|
+
/** @type {Array<{ alias: string, path: string }>} */
|
|
308
|
+
let normalized_aliases;
|
|
308
309
|
/** @type {string} */
|
|
309
310
|
let normalized_node_modules;
|
|
311
|
+
/** @type {string} */
|
|
312
|
+
let normalized_routes;
|
|
313
|
+
/** @type {string} */
|
|
314
|
+
let normalized_assets;
|
|
310
315
|
/**
|
|
311
316
|
* A map showing which features (such as `$app/server:read`) are defined
|
|
312
317
|
* in which chunks, so that we can later determine which routes use which features
|
|
@@ -352,11 +357,21 @@ function kit({ svelte_config }) {
|
|
|
352
357
|
vite = await import_peer('vite', root);
|
|
353
358
|
|
|
354
359
|
normalized_cwd = vite.normalizePath(root);
|
|
355
|
-
|
|
360
|
+
normalized_aliases = get_import_aliases(root, vite.normalizePath.bind(vite));
|
|
356
361
|
normalized_node_modules = vite.normalizePath(path.resolve(root, 'node_modules'));
|
|
362
|
+
normalized_routes = vite.normalizePath(path.resolve(root, kit.files.routes));
|
|
363
|
+
normalized_assets = vite.normalizePath(path.resolve(root, kit.files.assets));
|
|
364
|
+
|
|
365
|
+
// Add `#`-prefixed import keys to the enforced config so users are warned
|
|
366
|
+
// if they try to set them in their Vite config's resolve.alias
|
|
367
|
+
const enforced_alias = /** @type {Record<string, true>} */ (
|
|
368
|
+
/** @type {any} */ (enforced_config.resolve).alias
|
|
369
|
+
);
|
|
370
|
+
for (const key of get_hash_import_keys(root)) {
|
|
371
|
+
enforced_alias[key] = true;
|
|
372
|
+
}
|
|
357
373
|
|
|
358
374
|
const allow = new Set([
|
|
359
|
-
kit.files.lib,
|
|
360
375
|
kit.files.routes,
|
|
361
376
|
kit.files.src,
|
|
362
377
|
kit.outDir,
|
|
@@ -372,6 +387,11 @@ function kit({ svelte_config }) {
|
|
|
372
387
|
path.resolve(vite.searchForWorkspaceRoot(process.cwd()), 'node_modules')
|
|
373
388
|
]);
|
|
374
389
|
|
|
390
|
+
// Add directories from `#`-prefixed package.json imports to the allow list
|
|
391
|
+
for (const { path: alias_path } of normalized_aliases) {
|
|
392
|
+
allow.add(alias_path);
|
|
393
|
+
}
|
|
394
|
+
|
|
375
395
|
// We can only add directories to the allow list, so we find out
|
|
376
396
|
// if there's a client hooks file and pass its directory
|
|
377
397
|
const client_hooks = resolve_entry(kit.files.hooks.client);
|
|
@@ -386,6 +406,7 @@ function kit({ svelte_config }) {
|
|
|
386
406
|
alias: [
|
|
387
407
|
{ find: '__SERVER__', replacement: `${generated}/server` },
|
|
388
408
|
{ find: '$app', replacement: `${runtime_directory}/app` },
|
|
409
|
+
{ find: '$env', replacement: `${runtime_directory}/env` },
|
|
389
410
|
...get_config_aliases(kit, root)
|
|
390
411
|
]
|
|
391
412
|
},
|
|
@@ -678,7 +699,7 @@ function kit({ svelte_config }) {
|
|
|
678
699
|
|
|
679
700
|
/**
|
|
680
701
|
* Ensures that client-side code can't accidentally import server-side code,
|
|
681
|
-
* whether in `*.server.js` files, `$app/server`,
|
|
702
|
+
* whether in `*.server.js` files, `$app/server`, any `/server/` directory, or `$app/env/private`
|
|
682
703
|
* @type {Plugin}
|
|
683
704
|
*/
|
|
684
705
|
const plugin_guard = {
|
|
@@ -704,7 +725,7 @@ function kit({ svelte_config }) {
|
|
|
704
725
|
const resolved = await this.resolve(id, importer, { ...options, skipSelf: true });
|
|
705
726
|
|
|
706
727
|
if (resolved) {
|
|
707
|
-
const normalized = normalize_id(resolved.id,
|
|
728
|
+
const normalized = normalize_id(resolved.id, normalized_aliases, normalized_cwd);
|
|
708
729
|
|
|
709
730
|
let importers = import_map.get(normalized);
|
|
710
731
|
|
|
@@ -713,7 +734,7 @@ function kit({ svelte_config }) {
|
|
|
713
734
|
import_map.set(normalized, importers);
|
|
714
735
|
}
|
|
715
736
|
|
|
716
|
-
importers.add(normalize_id(importer,
|
|
737
|
+
importers.add(normalize_id(importer, normalized_aliases, normalized_cwd));
|
|
717
738
|
}
|
|
718
739
|
}
|
|
719
740
|
}
|
|
@@ -735,12 +756,19 @@ function kit({ svelte_config }) {
|
|
|
735
756
|
const is_internal =
|
|
736
757
|
id.startsWith(normalized_cwd) && !id.startsWith(normalized_node_modules);
|
|
737
758
|
|
|
738
|
-
const normalized = normalize_id(id,
|
|
759
|
+
const normalized = normalize_id(id, normalized_aliases, normalized_cwd);
|
|
760
|
+
|
|
761
|
+
// server-only directories: any file in a `/server/` folder inside the cwd,
|
|
762
|
+
// except those inside the routes or assets directories
|
|
763
|
+
const is_in_routes = id.startsWith(normalized_routes + '/');
|
|
764
|
+
const is_in_assets = id.startsWith(normalized_assets + '/');
|
|
765
|
+
const is_server_only_directory =
|
|
766
|
+
is_internal && !is_in_routes && !is_in_assets && server_only_directory_pattern.test(id);
|
|
739
767
|
|
|
740
768
|
const is_server_only =
|
|
741
769
|
normalized === '$app/env/private' ||
|
|
742
770
|
normalized === '$app/server' ||
|
|
743
|
-
|
|
771
|
+
is_server_only_directory ||
|
|
744
772
|
(is_internal && server_only_module_pattern.test(id));
|
|
745
773
|
|
|
746
774
|
if (!is_server_only) return;
|
|
@@ -863,7 +891,7 @@ function kit({ svelte_config }) {
|
|
|
863
891
|
},
|
|
864
892
|
|
|
865
893
|
async transform(code, id) {
|
|
866
|
-
const normalized = normalize_id(id,
|
|
894
|
+
const normalized = normalize_id(id, normalized_aliases, normalized_cwd);
|
|
867
895
|
if (!svelte_config.kit.moduleExtensions.some((ext) => normalized.endsWith(`.remote${ext}`))) {
|
|
868
896
|
return;
|
|
869
897
|
}
|
|
@@ -1084,7 +1112,7 @@ function kit({ svelte_config }) {
|
|
|
1084
1112
|
throw new Error(
|
|
1085
1113
|
`Cannot import ${normalize_id(
|
|
1086
1114
|
id,
|
|
1087
|
-
|
|
1115
|
+
normalized_aliases,
|
|
1088
1116
|
normalized_cwd
|
|
1089
1117
|
)} into service-worker code. Only the modules $service-worker and $app/env/public are available in service workers.`
|
|
1090
1118
|
);
|
|
@@ -1178,9 +1206,12 @@ function kit({ svelte_config }) {
|
|
|
1178
1206
|
);
|
|
1179
1207
|
}
|
|
1180
1208
|
|
|
1181
|
-
const
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1209
|
+
const sw_normalized_cwd = vite.normalizePath(vite_config.root);
|
|
1210
|
+
const sw_normalized_aliases = get_import_aliases(
|
|
1211
|
+
vite_config.root,
|
|
1212
|
+
vite.normalizePath.bind(vite)
|
|
1213
|
+
);
|
|
1214
|
+
const relative = normalize_id(id, sw_normalized_aliases, sw_normalized_cwd);
|
|
1184
1215
|
const stripped = strip_virtual_prefix(relative);
|
|
1185
1216
|
throw new Error(
|
|
1186
1217
|
`Cannot import ${stripped} into service-worker code. Only the modules $service-worker and $app/env/public are available in service workers.`
|
|
@@ -21,11 +21,7 @@ import {
|
|
|
21
21
|
*/
|
|
22
22
|
export function get_config_aliases(config, root) {
|
|
23
23
|
/** @type {import('vite').Alias[]} */
|
|
24
|
-
const alias = [
|
|
25
|
-
// For now, we handle `$lib` specially here rather than make it a default value for
|
|
26
|
-
// `config.alias` since it has special meaning for packaging, etc.
|
|
27
|
-
{ find: '$lib', replacement: posixify(config.files.lib) }
|
|
28
|
-
];
|
|
24
|
+
const alias = [];
|
|
29
25
|
|
|
30
26
|
for (let [key, value] of Object.entries(config.alias)) {
|
|
31
27
|
value = posixify(value);
|
|
@@ -118,16 +114,20 @@ export function not_found(req, res, base) {
|
|
|
118
114
|
const query_pattern = /\?.*$/s;
|
|
119
115
|
|
|
120
116
|
/**
|
|
121
|
-
* Removes cwd
|
|
117
|
+
* Removes cwd path from the start of the id and replaces any `#`-prefixed
|
|
118
|
+
* import alias target paths with their alias names.
|
|
122
119
|
* @param {string} id
|
|
123
|
-
* @param {string}
|
|
120
|
+
* @param {Array<{ alias: string, path: string }>} aliases — sorted by path length descending
|
|
124
121
|
* @param {string} cwd
|
|
125
122
|
*/
|
|
126
|
-
export function normalize_id(id,
|
|
123
|
+
export function normalize_id(id, aliases, cwd) {
|
|
127
124
|
id = id.replace(query_pattern, '');
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
id
|
|
126
|
+
for (const { alias, path } of aliases) {
|
|
127
|
+
if (id === path || id.startsWith(path + '/')) {
|
|
128
|
+
id = id.replace(path, alias);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
if (id.startsWith(cwd)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEV } from 'esm-env';
|
|
2
2
|
export * from '../env/index.js';
|
|
3
3
|
|
|
4
|
-
if (
|
|
5
|
-
console.warn('`$app/environment` is
|
|
4
|
+
if (DEV) {
|
|
5
|
+
console.warn('`$app/environment` is deprecated, use `$app/env` instead');
|
|
6
6
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/** @import { RemotePrerenderInputsGenerator, RemotePrerenderInternals, MaybePromise } from 'types' */
|
|
3
3
|
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
|
4
4
|
import { json, error } from '@sveltejs/kit';
|
|
5
|
-
import { DEV } from 'esm-env';
|
|
6
5
|
import { get_request_store } from '@sveltejs/kit/internal/server';
|
|
7
6
|
import { stringify, stringify_remote_arg } from '../../../shared.js';
|
|
8
7
|
import { noop } from '../../../../utils/functions.js';
|
|
@@ -99,7 +98,7 @@ export function prerender(validate_or_fn, fn_or_options, maybe_options) {
|
|
|
99
98
|
const id = __.id;
|
|
100
99
|
const url = `${base}/${app_dir}/remote/${id}${payload ? `/${payload}` : ''}`;
|
|
101
100
|
|
|
102
|
-
if (!state.prerendering && !
|
|
101
|
+
if (!state.prerendering && !__SVELTEKIT_DEV__ && !event.isRemoteRequest) {
|
|
103
102
|
try {
|
|
104
103
|
// TODO adapters can provide prerendered data more efficiently than
|
|
105
104
|
// fetching from the public internet
|
|
@@ -429,7 +429,7 @@ async function _invalidate(reset_page_state = true) {
|
|
|
429
429
|
// is running because subsequent invalidations may make earlier ones outdated,
|
|
430
430
|
// but batch multiple synchronous invalidations.
|
|
431
431
|
await (pending_invalidate ||= Promise.resolve());
|
|
432
|
-
if (
|
|
432
|
+
if (pending_invalidate === null) return;
|
|
433
433
|
pending_invalidate = null;
|
|
434
434
|
|
|
435
435
|
const token = (invalidation_token = {});
|
|
@@ -43,6 +43,25 @@ export function get_cookies(request, url) {
|
|
|
43
43
|
parseCookie(header, { decode: (value) => value })
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
+
/** @type {ReturnType<typeof parseCookie> | undefined} */
|
|
47
|
+
let default_cookies;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The header never changes during the request, so the default-decode parse is cached
|
|
51
|
+
* @param {import('cookie').ParseOptions} [opts]
|
|
52
|
+
*/
|
|
53
|
+
function parse_header(opts) {
|
|
54
|
+
return opts?.decode ? parseCookie(header, opts) : (default_cookies ??= parseCookie(header));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @param {import('./page/types.js').Cookie} cookie */
|
|
58
|
+
function matches_url(cookie) {
|
|
59
|
+
return (
|
|
60
|
+
domain_matches(url.hostname, cookie.options.domain) &&
|
|
61
|
+
path_matches(url.pathname, cookie.options.path)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
46
65
|
/** @type {string | undefined} */
|
|
47
66
|
let normalized_url;
|
|
48
67
|
|
|
@@ -66,22 +85,23 @@ export function get_cookies(request, url) {
|
|
|
66
85
|
|
|
67
86
|
get(name, opts) {
|
|
68
87
|
// Look for the most specific matching cookie from new_cookies
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
/** @type {import('./page/types.js').Cookie | undefined} */
|
|
89
|
+
let best_match;
|
|
90
|
+
for (const c of new_cookies.values()) {
|
|
91
|
+
if (
|
|
92
|
+
c.name === name &&
|
|
93
|
+
matches_url(c) &&
|
|
94
|
+
(!best_match || c.options.path.length > best_match.options.path.length)
|
|
95
|
+
) {
|
|
96
|
+
best_match = c;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
78
99
|
|
|
79
100
|
if (best_match) {
|
|
80
101
|
return best_match.options.maxAge === 0 ? undefined : best_match.value;
|
|
81
102
|
}
|
|
82
103
|
|
|
83
|
-
const
|
|
84
|
-
const cookie = req_cookies[name]; // the decoded string or undefined
|
|
104
|
+
const cookie = parse_header(opts)[name]; // the decoded string or undefined
|
|
85
105
|
|
|
86
106
|
// in development, if the cookie was set during this session with `cookies.set`,
|
|
87
107
|
// but at a different path, warn the user. (ignore cookies from request headers,
|
|
@@ -104,16 +124,14 @@ export function get_cookies(request, url) {
|
|
|
104
124
|
},
|
|
105
125
|
|
|
106
126
|
getAll(opts) {
|
|
107
|
-
|
|
127
|
+
// copy, so the cached parse isn't mutated below
|
|
128
|
+
const cookies = { ...parse_header(opts) };
|
|
108
129
|
|
|
109
130
|
// Group cookies by name and find the most specific one for each name
|
|
110
131
|
const lookup = new Map();
|
|
111
132
|
|
|
112
133
|
for (const c of new_cookies.values()) {
|
|
113
|
-
if (
|
|
114
|
-
domain_matches(url.hostname, c.options.domain) &&
|
|
115
|
-
path_matches(url.pathname, c.options.path)
|
|
116
|
-
) {
|
|
134
|
+
if (matches_url(c)) {
|
|
117
135
|
const existing = lookup.get(c.name);
|
|
118
136
|
|
|
119
137
|
// If no existing cookie or this one has a more specific (longer) path, use this one
|
|
@@ -36,7 +36,7 @@ export function get_self_origin(paths_origin, url_origin) {
|
|
|
36
36
|
*/
|
|
37
37
|
export function is_csrf_forbidden({ request, request_origin, self_origin, trusted_origins }) {
|
|
38
38
|
return (
|
|
39
|
-
is_form_content_type(request) &&
|
|
39
|
+
(!request.headers.get('content-type') || is_form_content_type(request)) &&
|
|
40
40
|
mutating_form_methods.has(request.method) &&
|
|
41
41
|
request_origin !== self_origin &&
|
|
42
42
|
(!request_origin || !trusted_origins.includes(request_origin))
|
|
@@ -96,29 +96,25 @@ export async function render_data(
|
|
|
96
96
|
return fn();
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
promises.map((p, i) =>
|
|
102
|
-
p.catch(async (error) => {
|
|
99
|
+
const data_serializer = server_data_serializer_json(event, event_state, options);
|
|
100
|
+
await Promise.all(
|
|
101
|
+
promises.map(async (p, i) => {
|
|
102
|
+
const node = await p.catch(async (error) => {
|
|
103
103
|
if (error instanceof Redirect) {
|
|
104
104
|
throw error;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
// Math.min because array isn't guaranteed to resolve in order
|
|
108
|
-
length = Math.min(length, i + 1);
|
|
109
|
-
|
|
110
107
|
const transformed = await handle_error_and_jsonify(event, event_state, options, error);
|
|
111
108
|
|
|
112
109
|
return /** @type {import('types').ServerErrorNode} */ ({
|
|
113
110
|
type: 'error',
|
|
114
111
|
error: transformed
|
|
115
112
|
});
|
|
116
|
-
})
|
|
117
|
-
)
|
|
118
|
-
);
|
|
113
|
+
});
|
|
119
114
|
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
data_serializer.add_node(i, node);
|
|
116
|
+
})
|
|
117
|
+
);
|
|
122
118
|
const { data, chunks } = data_serializer.get_data();
|
|
123
119
|
|
|
124
120
|
if (!chunks) {
|
|
@@ -70,7 +70,7 @@ export async function internal_respond(request, options, manifest, state) {
|
|
|
70
70
|
const is_data_request = has_data_suffix(url.pathname);
|
|
71
71
|
const remote_id = get_remote_id(url);
|
|
72
72
|
|
|
73
|
-
if (!
|
|
73
|
+
if (!__SVELTEKIT_DEV__) {
|
|
74
74
|
const request_origin = request.headers.get('origin');
|
|
75
75
|
const self_origin = get_self_origin(options.paths_origin, url.origin);
|
|
76
76
|
|
package/src/types/internal.d.ts
CHANGED
|
@@ -456,7 +456,10 @@ export interface SSRNode {
|
|
|
456
456
|
|
|
457
457
|
/**
|
|
458
458
|
* During development, all styles are inlined for the page to avoid FOUC.
|
|
459
|
-
* But in production, this stores styles that are below the inline threshold
|
|
459
|
+
* But in production, this stores styles that are below the inline threshold.
|
|
460
|
+
* It returns a Promise during development because Vite needs to load the
|
|
461
|
+
* modules on demand. But in production, the contents have been precomputed
|
|
462
|
+
* during the build, so it can return synchronously.
|
|
460
463
|
*/
|
|
461
464
|
inline_styles?(): MaybePromise<
|
|
462
465
|
Record<string, string | ((assets: string, base: string) => string)>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Reads the `imports` field from the package.json at the given directory.
|
|
6
|
+
* @param {string} cwd
|
|
7
|
+
* @returns {Record<string, string | Record<string, string>> | undefined}
|
|
8
|
+
*/
|
|
9
|
+
export function read_package_imports(cwd) {
|
|
10
|
+
const pkg_path = path.resolve(cwd, 'package.json');
|
|
11
|
+
if (fs.existsSync(pkg_path)) {
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(fs.readFileSync(pkg_path, 'utf-8')).imports;
|
|
14
|
+
} catch {
|
|
15
|
+
// malformed package.json — ignore, the user will see other errors
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Normalizes an import value to a string path, handling both string values
|
|
22
|
+
* and conditional export objects (using the `default` key).
|
|
23
|
+
* @param {string | Record<string, string>} value
|
|
24
|
+
* @returns {string | null}
|
|
25
|
+
*/
|
|
26
|
+
export function normalize_import_value(value) {
|
|
27
|
+
if (typeof value === 'string') {
|
|
28
|
+
return value.replace(/^\.\//, '');
|
|
29
|
+
}
|
|
30
|
+
if (value && typeof value === 'object' && typeof value.default === 'string') {
|
|
31
|
+
return value.default.replace(/^\.\//, '');
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns the `#`-prefixed import keys from the package.json `imports` field.
|
|
38
|
+
* @param {string} cwd
|
|
39
|
+
* @returns {string[]}
|
|
40
|
+
*/
|
|
41
|
+
export function get_hash_import_keys(cwd) {
|
|
42
|
+
const imports = read_package_imports(cwd);
|
|
43
|
+
if (!imports) return [];
|
|
44
|
+
return Object.keys(imports).filter((key) => key.startsWith('#'));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Computes alias entries for `normalize_id` from the package.json `imports` field.
|
|
49
|
+
* Each entry maps a `#xx` alias to its absolute target path. Entries are sorted
|
|
50
|
+
* by path length descending so that longer/more-specific paths are matched first.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} root
|
|
53
|
+
* @param {(p: string) => string} [normalize] - optional path normalizer (e.g. `vite.normalizePath`)
|
|
54
|
+
* @returns {Array<{ alias: string, path: string }>}
|
|
55
|
+
*/
|
|
56
|
+
export function get_import_aliases(root, normalize) {
|
|
57
|
+
const imports = read_package_imports(root);
|
|
58
|
+
if (!imports) return [];
|
|
59
|
+
|
|
60
|
+
/** @type {Array<{ alias: string, path: string }>} */
|
|
61
|
+
const aliases = [];
|
|
62
|
+
|
|
63
|
+
for (const [key, raw_value] of Object.entries(imports)) {
|
|
64
|
+
if (!key.startsWith('#')) continue;
|
|
65
|
+
|
|
66
|
+
const value = normalize_import_value(raw_value);
|
|
67
|
+
if (!value) continue;
|
|
68
|
+
|
|
69
|
+
// For `#xx/*` imports, the target directory is the value without `/*`
|
|
70
|
+
// For `#xx` imports, the target is the file itself
|
|
71
|
+
const target = value.endsWith('/*') ? value.slice(0, -2) : value;
|
|
72
|
+
if (target.includes('*')) continue; // not sure if this is even allowed in Node, anyway it's too niche/complex to support here
|
|
73
|
+
const abs = path.resolve(root, target);
|
|
74
|
+
const alias = key.endsWith('/*') ? key.slice(0, -2) : key;
|
|
75
|
+
|
|
76
|
+
aliases.push({ alias, path: normalize ? normalize(abs) : abs });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Sort by path length descending so longer/more-specific paths match first
|
|
80
|
+
aliases.sort((a, b) => b.path.length - a.path.length);
|
|
81
|
+
|
|
82
|
+
return aliases;
|
|
83
|
+
}
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ declare module '@sveltejs/kit' {
|
|
|
6
6
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
7
|
import type { Plugin } from 'vite';
|
|
8
8
|
import type { RouteId as AppRouteId, LayoutParams as AppLayoutParams, ResolvedPathname } from '$app/types';
|
|
9
|
-
import type { Component } from 'svelte';
|
|
10
9
|
// @ts-ignore this is an optional peer dependency so could be missing. Written like this so dts-buddy preserves the ts-ignore
|
|
11
10
|
type Span = import('@opentelemetry/api').Span;
|
|
12
11
|
|
|
@@ -408,8 +407,6 @@ declare module '@sveltejs/kit' {
|
|
|
408
407
|
*
|
|
409
408
|
* > [!NOTE] When `mode` is `'auto'`, SvelteKit will use nonces for dynamically rendered pages and hashes for prerendered pages. Using nonces with prerendered pages is insecure and therefore forbidden.
|
|
410
409
|
*
|
|
411
|
-
* > [!NOTE] Note that most [Svelte transitions](https://svelte.dev/tutorial/svelte/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
|
|
412
|
-
*
|
|
413
410
|
* If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) to roll your own CSP.
|
|
414
411
|
*/
|
|
415
412
|
csp?: {
|
|
@@ -523,12 +520,6 @@ declare module '@sveltejs/kit' {
|
|
|
523
520
|
*/
|
|
524
521
|
universal?: string;
|
|
525
522
|
};
|
|
526
|
-
/**
|
|
527
|
-
* Your app's internal library, accessible throughout the codebase as `$lib`.
|
|
528
|
-
* @deprecated this feature is still supported, but it's generally recommended to use [monorepos](https://levelup.video/tutorials/monorepos-with-pnpm) instead
|
|
529
|
-
* @default "src/lib"
|
|
530
|
-
*/
|
|
531
|
-
lib?: string;
|
|
532
523
|
/**
|
|
533
524
|
* A directory containing [parameter matchers](https://svelte.dev/docs/kit/advanced-routing#Matching).
|
|
534
525
|
* @deprecated this feature is still supported, but it's generally recommended to use [monorepos](https://levelup.video/tutorials/monorepos-with-pnpm) instead
|
|
@@ -935,7 +926,7 @@ declare module '@sveltejs/kit' {
|
|
|
935
926
|
*/
|
|
936
927
|
export type Handle = (input: {
|
|
937
928
|
event: RequestEvent;
|
|
938
|
-
resolve: (event: RequestEvent, opts?: ResolveOptions) =>
|
|
929
|
+
resolve: (event: RequestEvent, opts?: ResolveOptions) => Promise<Response>;
|
|
939
930
|
}) => MaybePromise<Response>;
|
|
940
931
|
|
|
941
932
|
/**
|
|
@@ -1753,19 +1744,6 @@ declare module '@sveltejs/kit' {
|
|
|
1753
1744
|
/** Static files from `config.files.assets` and the service worker (if any). */
|
|
1754
1745
|
assets: Set<string>;
|
|
1755
1746
|
mimeTypes: Record<string, string>;
|
|
1756
|
-
|
|
1757
|
-
/** @internal private fields */
|
|
1758
|
-
_: {
|
|
1759
|
-
client: BuildData['client'];
|
|
1760
|
-
nodes: SSRNodeLoader[];
|
|
1761
|
-
/** hashed filename -> import to that file */
|
|
1762
|
-
remotes: Record<string, () => Promise<{ default: Record<string, any> }>>;
|
|
1763
|
-
routes: SSRRoute[];
|
|
1764
|
-
prerendered_routes: Set<string>;
|
|
1765
|
-
matchers: () => Promise<Record<string, ParamMatcher>>;
|
|
1766
|
-
/** A `[file]: size` map of all assets imported by server code. */
|
|
1767
|
-
server_assets: Record<string, number>;
|
|
1768
|
-
};
|
|
1769
1747
|
}
|
|
1770
1748
|
|
|
1771
1749
|
/**
|
|
@@ -2699,9 +2677,6 @@ declare module '@sveltejs/kit' {
|
|
|
2699
2677
|
rest: boolean;
|
|
2700
2678
|
}
|
|
2701
2679
|
|
|
2702
|
-
/** @default 'never' */
|
|
2703
|
-
type TrailingSlash = 'never' | 'always' | 'ignore';
|
|
2704
|
-
|
|
2705
2680
|
type DeepPartial<T> = T extends Record<PropertyKey, unknown> | unknown[]
|
|
2706
2681
|
? {
|
|
2707
2682
|
[K in keyof T]?: T[K] extends Record<PropertyKey, unknown> | unknown[]
|
|
@@ -2711,87 +2686,6 @@ declare module '@sveltejs/kit' {
|
|
|
2711
2686
|
: T | undefined;
|
|
2712
2687
|
|
|
2713
2688
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
2714
|
-
interface Asset {
|
|
2715
|
-
file: string;
|
|
2716
|
-
size: number;
|
|
2717
|
-
type: string | null;
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
|
-
interface BuildData {
|
|
2721
|
-
app_dir: string;
|
|
2722
|
-
app_path: string;
|
|
2723
|
-
manifest_data: ManifestData;
|
|
2724
|
-
out_dir: string;
|
|
2725
|
-
service_worker: string | null;
|
|
2726
|
-
client: {
|
|
2727
|
-
/** Path to the client entry point. */
|
|
2728
|
-
start: string;
|
|
2729
|
-
/** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'`. */
|
|
2730
|
-
app?: string;
|
|
2731
|
-
/** JS files that the client entry point relies on. */
|
|
2732
|
-
imports: string[];
|
|
2733
|
-
/**
|
|
2734
|
-
* JS files that represent the entry points of the layouts/pages.
|
|
2735
|
-
* An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file).
|
|
2736
|
-
* Only set in case of `router.resolution === 'server'`.
|
|
2737
|
-
*/
|
|
2738
|
-
nodes?: Array<string | undefined>;
|
|
2739
|
-
/**
|
|
2740
|
-
* CSS files referenced in the entry points of the layouts/pages.
|
|
2741
|
-
* An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file) or if has no CSS.
|
|
2742
|
-
* Only set in case of `router.resolution === 'server'`.
|
|
2743
|
-
*/
|
|
2744
|
-
css?: Array<string[] | undefined>;
|
|
2745
|
-
/**
|
|
2746
|
-
* Contains the client route manifest in a form suitable for the server which is used for server-side route resolution.
|
|
2747
|
-
* Notably, it contains all routes, regardless of whether they are prerendered or not (those are missing in the optimized server route manifest).
|
|
2748
|
-
* Only set in case of `router.resolution === 'server'`.
|
|
2749
|
-
*/
|
|
2750
|
-
routes?: SSRClientRoute[];
|
|
2751
|
-
stylesheets: string[];
|
|
2752
|
-
fonts: string[];
|
|
2753
|
-
/**
|
|
2754
|
-
* Whether the client uses public dynamic env vars — `$env/dynamic/public` or `$app/env/public`.
|
|
2755
|
-
*/
|
|
2756
|
-
uses_env_dynamic_public: boolean;
|
|
2757
|
-
/** Only set in case of `bundleStrategy === 'inline'`. */
|
|
2758
|
-
inline?: {
|
|
2759
|
-
script: string;
|
|
2760
|
-
style: string | undefined;
|
|
2761
|
-
};
|
|
2762
|
-
} | null;
|
|
2763
|
-
server_manifest: import('vite').Manifest;
|
|
2764
|
-
}
|
|
2765
|
-
|
|
2766
|
-
interface ManifestData {
|
|
2767
|
-
/** Static files from `config.files.assets`. */
|
|
2768
|
-
assets: Asset[];
|
|
2769
|
-
hooks: {
|
|
2770
|
-
client: string | null;
|
|
2771
|
-
server: string | null;
|
|
2772
|
-
universal: string | null;
|
|
2773
|
-
};
|
|
2774
|
-
nodes: PageNode[];
|
|
2775
|
-
routes: RouteData[];
|
|
2776
|
-
params: string | null;
|
|
2777
|
-
}
|
|
2778
|
-
|
|
2779
|
-
interface PageNode {
|
|
2780
|
-
depth: number;
|
|
2781
|
-
/** The `+page/layout.svelte`. */
|
|
2782
|
-
component?: string; // TODO supply default component if it's missing (bit of an edge case)
|
|
2783
|
-
/** The `+page/layout.js/.ts`. */
|
|
2784
|
-
universal?: string;
|
|
2785
|
-
/** The `+page/layout.server.js/ts`. */
|
|
2786
|
-
server?: string;
|
|
2787
|
-
parent_id?: string;
|
|
2788
|
-
parent?: PageNode;
|
|
2789
|
-
/** Filled with the pages that reference this layout (if this is a layout). */
|
|
2790
|
-
child_pages?: PageNode[];
|
|
2791
|
-
/** The final page options for a node if it was statically analysable */
|
|
2792
|
-
page_options?: PageOptions | null;
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
2689
|
type RecursiveRequired<T> = {
|
|
2796
2690
|
// Recursive implementation of TypeScript's Required utility type.
|
|
2797
2691
|
// Will recursively continue until it reaches a primitive or Function
|
|
@@ -2801,132 +2695,6 @@ declare module '@sveltejs/kit' {
|
|
|
2801
2695
|
: T[K]; // Use the exact type for everything else
|
|
2802
2696
|
};
|
|
2803
2697
|
|
|
2804
|
-
interface RouteParam {
|
|
2805
|
-
name: string;
|
|
2806
|
-
matcher: string;
|
|
2807
|
-
optional: boolean;
|
|
2808
|
-
rest: boolean;
|
|
2809
|
-
chained: boolean;
|
|
2810
|
-
}
|
|
2811
|
-
|
|
2812
|
-
/**
|
|
2813
|
-
* Represents a route segment in the app. It can either be an intermediate node
|
|
2814
|
-
* with only layout/error pages, or a leaf, at which point either `page` and `leaf`
|
|
2815
|
-
* or `endpoint` is set.
|
|
2816
|
-
*/
|
|
2817
|
-
interface RouteData {
|
|
2818
|
-
id: string;
|
|
2819
|
-
parent: RouteData | null;
|
|
2820
|
-
|
|
2821
|
-
segment: string;
|
|
2822
|
-
pattern: RegExp;
|
|
2823
|
-
params: RouteParam[];
|
|
2824
|
-
|
|
2825
|
-
layout: PageNode | null;
|
|
2826
|
-
error: PageNode | null;
|
|
2827
|
-
leaf: PageNode | null;
|
|
2828
|
-
|
|
2829
|
-
page: {
|
|
2830
|
-
layouts: Array<number | undefined>;
|
|
2831
|
-
errors: Array<number | undefined>;
|
|
2832
|
-
leaf: number;
|
|
2833
|
-
} | null;
|
|
2834
|
-
|
|
2835
|
-
endpoint: {
|
|
2836
|
-
file: string;
|
|
2837
|
-
/** The final page options for the endpoint if it was statically analysable */
|
|
2838
|
-
page_options: PageOptions | null;
|
|
2839
|
-
} | null;
|
|
2840
|
-
}
|
|
2841
|
-
|
|
2842
|
-
type SSRComponentLoader = () => Promise<Component>;
|
|
2843
|
-
|
|
2844
|
-
interface UniversalNode {
|
|
2845
|
-
/** Is `null` in case static analysis succeeds but the node is ssr=false */
|
|
2846
|
-
load?: Load;
|
|
2847
|
-
prerender?: PrerenderOption;
|
|
2848
|
-
ssr?: boolean;
|
|
2849
|
-
csr?: boolean;
|
|
2850
|
-
trailingSlash?: TrailingSlash;
|
|
2851
|
-
config?: any;
|
|
2852
|
-
entries?: PrerenderEntryGenerator;
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
|
-
interface ServerNode {
|
|
2856
|
-
load?: ServerLoad;
|
|
2857
|
-
prerender?: PrerenderOption;
|
|
2858
|
-
ssr?: boolean;
|
|
2859
|
-
csr?: boolean;
|
|
2860
|
-
trailingSlash?: TrailingSlash;
|
|
2861
|
-
actions?: Actions;
|
|
2862
|
-
config?: any;
|
|
2863
|
-
entries?: PrerenderEntryGenerator;
|
|
2864
|
-
}
|
|
2865
|
-
|
|
2866
|
-
interface SSRNode {
|
|
2867
|
-
/** index into the `nodes` array in the generated `client/app.js`. */
|
|
2868
|
-
index: number;
|
|
2869
|
-
/** external JS files that are loaded on the client. `imports[0]` is the entry point (e.g. `client/nodes/0.js`) */
|
|
2870
|
-
imports: string[];
|
|
2871
|
-
/** external CSS files that are loaded on the client */
|
|
2872
|
-
stylesheets: string[];
|
|
2873
|
-
/** external font files that are loaded on the client */
|
|
2874
|
-
fonts: string[];
|
|
2875
|
-
|
|
2876
|
-
universal_id?: string;
|
|
2877
|
-
server_id?: string;
|
|
2878
|
-
|
|
2879
|
-
/**
|
|
2880
|
-
* During development, all styles are inlined for the page to avoid FOUC.
|
|
2881
|
-
* But in production, this stores styles that are below the inline threshold
|
|
2882
|
-
*/
|
|
2883
|
-
inline_styles?(): MaybePromise<
|
|
2884
|
-
Record<string, string | ((assets: string, base: string) => string)>
|
|
2885
|
-
>;
|
|
2886
|
-
/** Svelte component */
|
|
2887
|
-
component?: SSRComponentLoader;
|
|
2888
|
-
/** +page.js or +layout.js */
|
|
2889
|
-
universal?: UniversalNode;
|
|
2890
|
-
/** +page.server.js, +layout.server.js, or +server.js */
|
|
2891
|
-
server?: ServerNode;
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
type SSRNodeLoader = () => Promise<SSRNode>;
|
|
2895
|
-
|
|
2896
|
-
interface PageNodeIndexes {
|
|
2897
|
-
errors: Array<number | undefined>;
|
|
2898
|
-
layouts: Array<number | undefined>;
|
|
2899
|
-
leaf: number;
|
|
2900
|
-
}
|
|
2901
|
-
|
|
2902
|
-
type PrerenderEntryGenerator = () => MaybePromise<Array<Record<string, string>>>;
|
|
2903
|
-
|
|
2904
|
-
type SSREndpoint = Partial<Record<HttpMethod, RequestHandler>> & {
|
|
2905
|
-
prerender?: PrerenderOption;
|
|
2906
|
-
trailingSlash?: TrailingSlash;
|
|
2907
|
-
config?: any;
|
|
2908
|
-
entries?: PrerenderEntryGenerator;
|
|
2909
|
-
fallback?: RequestHandler;
|
|
2910
|
-
};
|
|
2911
|
-
|
|
2912
|
-
interface SSRRoute {
|
|
2913
|
-
id: string;
|
|
2914
|
-
pattern: RegExp;
|
|
2915
|
-
params: RouteParam[];
|
|
2916
|
-
page: PageNodeIndexes | null;
|
|
2917
|
-
endpoint: (() => Promise<SSREndpoint>) | null;
|
|
2918
|
-
endpoint_id?: string;
|
|
2919
|
-
}
|
|
2920
|
-
|
|
2921
|
-
interface SSRClientRoute {
|
|
2922
|
-
id: string;
|
|
2923
|
-
pattern: RegExp;
|
|
2924
|
-
params: RouteParam[];
|
|
2925
|
-
errors: Array<number | undefined>;
|
|
2926
|
-
layouts: Array<[has_server_load: boolean, node_id: number] | undefined>;
|
|
2927
|
-
leaf: [has_server_load: boolean, node_id: number];
|
|
2928
|
-
}
|
|
2929
|
-
|
|
2930
2698
|
type ValidatedConfig = Omit<Config, 'kit'> & {
|
|
2931
2699
|
kit: ValidatedKitConfig;
|
|
2932
2700
|
extensions: string[];
|
|
@@ -3045,7 +2813,7 @@ declare module '@sveltejs/kit' {
|
|
|
3045
2813
|
* ```ts
|
|
3046
2814
|
* import { invalid } from '@sveltejs/kit';
|
|
3047
2815
|
* import { form } from '$app/server';
|
|
3048
|
-
* import { tryLogin } from '
|
|
2816
|
+
* import { tryLogin } from '#lib/server/auth';
|
|
3049
2817
|
* import * as v from 'valibot';
|
|
3050
2818
|
*
|
|
3051
2819
|
* export const login = form(
|
|
@@ -3087,19 +2855,7 @@ declare module '@sveltejs/kit' {
|
|
|
3087
2855
|
wasNormalized: boolean;
|
|
3088
2856
|
denormalize: (url?: string | URL) => URL;
|
|
3089
2857
|
};
|
|
3090
|
-
type ValidPageOption = (typeof valid_page_options_array)[number];
|
|
3091
|
-
|
|
3092
|
-
type PageOptions = Partial<{
|
|
3093
|
-
[K in ValidPageOption]: K extends 'ssr' | 'csr'
|
|
3094
|
-
? boolean
|
|
3095
|
-
: K extends 'prerender'
|
|
3096
|
-
? PrerenderOption
|
|
3097
|
-
: K extends 'trailingSlash'
|
|
3098
|
-
? TrailingSlash
|
|
3099
|
-
: any;
|
|
3100
|
-
}>;
|
|
3101
2858
|
export const VERSION: string;
|
|
3102
|
-
const valid_page_options_array: readonly ["ssr", "prerender", "csr", "trailingSlash", "config", "entries", "load"];
|
|
3103
2859
|
|
|
3104
2860
|
export {};
|
|
3105
2861
|
}
|
|
@@ -3179,6 +2935,8 @@ declare module '@sveltejs/kit/hooks' {
|
|
|
3179
2935
|
* first post-processing
|
|
3180
2936
|
* ```
|
|
3181
2937
|
*
|
|
2938
|
+
* Calling `resolve` invokes the next handler in the sequence (or SvelteKit itself, if it is the last one). To pass data between handlers, use `event.locals`.
|
|
2939
|
+
*
|
|
3182
2940
|
* @param handlers The chain of `handle` functions
|
|
3183
2941
|
* */
|
|
3184
2942
|
export function sequence(...handlers: Handle[]): Handle;
|
package/types/index.d.ts.map
CHANGED
|
@@ -128,26 +128,9 @@
|
|
|
128
128
|
"PrerenderOption",
|
|
129
129
|
"RequestOptions",
|
|
130
130
|
"RouteSegment",
|
|
131
|
-
"TrailingSlash",
|
|
132
131
|
"DeepPartial",
|
|
133
132
|
"IsAny",
|
|
134
|
-
"Asset",
|
|
135
|
-
"BuildData",
|
|
136
|
-
"ManifestData",
|
|
137
|
-
"PageNode",
|
|
138
133
|
"RecursiveRequired",
|
|
139
|
-
"RouteParam",
|
|
140
|
-
"RouteData",
|
|
141
|
-
"SSRComponentLoader",
|
|
142
|
-
"UniversalNode",
|
|
143
|
-
"ServerNode",
|
|
144
|
-
"SSRNode",
|
|
145
|
-
"SSRNodeLoader",
|
|
146
|
-
"PageNodeIndexes",
|
|
147
|
-
"PrerenderEntryGenerator",
|
|
148
|
-
"SSREndpoint",
|
|
149
|
-
"SSRRoute",
|
|
150
|
-
"SSRClientRoute",
|
|
151
134
|
"ValidatedConfig",
|
|
152
135
|
"ValidatedKitConfig",
|
|
153
136
|
"isHttpError",
|
|
@@ -159,10 +142,7 @@
|
|
|
159
142
|
"invalid",
|
|
160
143
|
"isValidationError",
|
|
161
144
|
"normalizeUrl",
|
|
162
|
-
"ValidPageOption",
|
|
163
|
-
"PageOptions",
|
|
164
145
|
"VERSION",
|
|
165
|
-
"valid_page_options_array",
|
|
166
146
|
"defineEnvVars",
|
|
167
147
|
"sequence",
|
|
168
148
|
"getRequest",
|
|
@@ -207,9 +187,7 @@
|
|
|
207
187
|
"../src/types/private.d.ts",
|
|
208
188
|
"../src/types/internal.d.ts",
|
|
209
189
|
"../src/exports/index.js",
|
|
210
|
-
"../src/exports/vite/static_analysis/types.d.ts",
|
|
211
190
|
"../src/version.js",
|
|
212
|
-
"../src/exports/vite/static_analysis/index.js",
|
|
213
191
|
"../src/exports/hooks/index.js",
|
|
214
192
|
"../src/exports/hooks/sequence.js",
|
|
215
193
|
"../src/exports/node/index.js",
|
|
@@ -240,10 +218,8 @@
|
|
|
240
218
|
null,
|
|
241
219
|
null,
|
|
242
220
|
null,
|
|
243
|
-
null,
|
|
244
|
-
null,
|
|
245
221
|
null
|
|
246
222
|
],
|
|
247
|
-
"mappings": "
|
|
223
|
+
"mappings": ";;;;;;;;;MAmCKA,IAAIA;;MAEJC,0BAA0BA;;;;;kBAKdC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAwCZC,cAAcA;;;;;;aAMdC,cAAcA;;;;;;;;MAQrBC,aAAaA;;;;;OAKJC,YAAYA;;kBAETC,aAAaA;;;;;;MAMzBC,qBAAqBA;;;;;;;;;;;kBAWTC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,iBAAiBA;;;;;;MAMVC,WAAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCKPC,IAAIA;;;;;;;;iBCSJC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Mb6TnBC,qCAAqCA;;;;;;;;MAoKrCC,8BAA8BA;MDrV9B/D,YAAYA;;MA2GZgB,KAAKA;;MAELgD,qBAAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cenOpBC,IAAIA;;;;;cAQJC,UAAUA;;;;;;;;;;;cAMVC,OAAOA",
|
|
248
224
|
"ignoreList": []
|
|
249
225
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
This is a simple alias to `src/lib`, or whatever directory is specified as [`config.files.lib`](https://svelte.dev/docs/kit/configuration#files). It allows you to access common components and utility modules without `../../../../` nonsense.
|
|
2
|
-
|
|
3
|
-
### `$lib/server`
|
|
4
|
-
|
|
5
|
-
A subdirectory of `$lib`. SvelteKit will prevent you from importing any modules in `$lib/server` into client-side code. See [server-only modules](https://svelte.dev/docs/kit/server-only-modules).
|