@sveltejs/kit 1.0.0-next.99 → 1.0.0
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/README.md +5 -1
- package/package.json +91 -77
- package/postinstall.js +47 -0
- package/src/cli.js +44 -0
- package/src/constants.js +5 -0
- package/src/core/adapt/builder.js +221 -0
- package/src/core/adapt/index.js +31 -0
- package/src/core/config/default-error.html +56 -0
- package/src/core/config/index.js +100 -0
- package/src/core/config/options.js +387 -0
- package/src/core/config/types.d.ts +1 -0
- package/src/core/env.js +138 -0
- package/src/core/generate_manifest/index.js +116 -0
- package/src/core/prerender/crawl.js +207 -0
- package/src/core/prerender/entities.js +2252 -0
- package/src/core/prerender/fallback.js +43 -0
- package/src/core/prerender/prerender.js +459 -0
- package/src/core/prerender/queue.js +80 -0
- package/src/core/sync/create_manifest_data/conflict.js +0 -0
- package/src/core/sync/create_manifest_data/index.js +523 -0
- package/src/core/sync/create_manifest_data/sort.js +161 -0
- package/src/core/sync/create_manifest_data/types.d.ts +37 -0
- package/src/core/sync/sync.js +59 -0
- package/src/core/sync/utils.js +33 -0
- package/src/core/sync/write_ambient.js +58 -0
- package/src/core/sync/write_client_manifest.js +107 -0
- package/src/core/sync/write_matchers.js +25 -0
- package/src/core/sync/write_root.js +91 -0
- package/src/core/sync/write_tsconfig.js +195 -0
- package/src/core/sync/write_types/index.js +809 -0
- package/src/core/utils.js +67 -0
- package/src/exports/hooks/index.js +1 -0
- package/src/exports/hooks/sequence.js +44 -0
- package/src/exports/index.js +55 -0
- package/src/exports/node/index.js +172 -0
- package/src/exports/node/polyfills.js +28 -0
- package/src/exports/vite/build/build_server.js +359 -0
- package/src/exports/vite/build/build_service_worker.js +85 -0
- package/src/exports/vite/build/utils.js +230 -0
- package/src/exports/vite/dev/index.js +597 -0
- package/src/exports/vite/graph_analysis/index.js +99 -0
- package/src/exports/vite/graph_analysis/types.d.ts +5 -0
- package/src/exports/vite/graph_analysis/utils.js +6 -0
- package/src/exports/vite/index.js +708 -0
- package/src/exports/vite/preview/index.js +194 -0
- package/src/exports/vite/types.d.ts +3 -0
- package/src/exports/vite/utils.js +184 -0
- package/src/runtime/app/env.js +1 -0
- package/src/runtime/app/environment.js +13 -0
- package/src/runtime/app/forms.js +135 -0
- package/src/runtime/app/navigation.js +22 -0
- package/src/runtime/app/paths.js +1 -0
- package/src/runtime/app/stores.js +57 -0
- package/src/runtime/client/ambient.d.ts +30 -0
- package/src/runtime/client/client.js +1725 -0
- package/src/runtime/client/constants.js +10 -0
- package/src/runtime/client/fetcher.js +127 -0
- package/src/runtime/client/parse.js +60 -0
- package/src/runtime/client/singletons.js +21 -0
- package/src/runtime/client/start.js +45 -0
- package/src/runtime/client/types.d.ts +86 -0
- package/src/runtime/client/utils.js +257 -0
- package/src/runtime/components/error.svelte +6 -0
- package/{assets → src/runtime}/components/layout.svelte +0 -0
- package/src/runtime/control.js +45 -0
- package/src/runtime/env/dynamic/private.js +1 -0
- package/src/runtime/env/dynamic/public.js +1 -0
- package/src/runtime/env-private.js +6 -0
- package/src/runtime/env-public.js +6 -0
- package/src/runtime/env.js +12 -0
- package/src/runtime/hash.js +20 -0
- package/src/runtime/paths.js +11 -0
- package/src/runtime/server/cookie.js +228 -0
- package/src/runtime/server/data/index.js +158 -0
- package/src/runtime/server/endpoint.js +86 -0
- package/src/runtime/server/fetch.js +175 -0
- package/src/runtime/server/index.js +405 -0
- package/src/runtime/server/page/actions.js +267 -0
- package/src/runtime/server/page/crypto.js +239 -0
- package/src/runtime/server/page/csp.js +250 -0
- package/src/runtime/server/page/index.js +326 -0
- package/src/runtime/server/page/load_data.js +270 -0
- package/src/runtime/server/page/render.js +393 -0
- package/src/runtime/server/page/respond_with_error.js +103 -0
- package/src/runtime/server/page/serialize_data.js +87 -0
- package/src/runtime/server/page/types.d.ts +35 -0
- package/src/runtime/server/utils.js +179 -0
- package/src/utils/array.js +9 -0
- package/src/utils/error.js +22 -0
- package/src/utils/escape.js +46 -0
- package/src/utils/exports.js +54 -0
- package/src/utils/filesystem.js +178 -0
- package/src/utils/functions.js +16 -0
- package/src/utils/http.js +72 -0
- package/src/utils/misc.js +1 -0
- package/src/utils/promises.js +17 -0
- package/src/utils/routing.js +201 -0
- package/src/utils/unit_test.js +11 -0
- package/src/utils/url.js +161 -0
- package/svelte-kit.js +1 -1
- package/types/ambient.d.ts +451 -0
- package/types/index.d.ts +1168 -5
- package/types/internal.d.ts +348 -159
- package/types/private.d.ts +237 -0
- package/types/synthetic/$env+dynamic+private.md +10 -0
- package/types/synthetic/$env+dynamic+public.md +8 -0
- package/types/synthetic/$env+static+private.md +19 -0
- package/types/synthetic/$env+static+public.md +7 -0
- package/types/synthetic/$lib.md +5 -0
- package/CHANGELOG.md +0 -825
- package/assets/components/error.svelte +0 -21
- package/assets/runtime/app/env.js +0 -16
- package/assets/runtime/app/navigation.js +0 -53
- package/assets/runtime/app/paths.js +0 -1
- package/assets/runtime/app/stores.js +0 -87
- package/assets/runtime/chunks/utils.js +0 -13
- package/assets/runtime/env.js +0 -8
- package/assets/runtime/internal/singletons.js +0 -20
- package/assets/runtime/internal/start.js +0 -1061
- package/assets/runtime/paths.js +0 -12
- package/dist/chunks/_commonjsHelpers.js +0 -8
- package/dist/chunks/cert.js +0 -29079
- package/dist/chunks/constants.js +0 -3
- package/dist/chunks/index.js +0 -3532
- package/dist/chunks/index2.js +0 -583
- package/dist/chunks/index3.js +0 -31
- package/dist/chunks/index4.js +0 -1004
- package/dist/chunks/index5.js +0 -327
- package/dist/chunks/index6.js +0 -325
- package/dist/chunks/standard.js +0 -99
- package/dist/chunks/utils.js +0 -149
- package/dist/cli.js +0 -711
- package/dist/http.js +0 -66
- package/dist/install-fetch.js +0 -1699
- package/dist/ssr.js +0 -1523
- package/types/ambient-modules.d.ts +0 -115
- package/types/config.d.ts +0 -101
- package/types/endpoint.d.ts +0 -23
- package/types/helper.d.ts +0 -19
- package/types/hooks.d.ts +0 -21
- package/types/page.d.ts +0 -30
package/types/internal.d.ts
CHANGED
|
@@ -1,203 +1,392 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import { SvelteComponent } from 'svelte/internal';
|
|
3
|
+
import {
|
|
4
|
+
Config,
|
|
5
|
+
ServerLoad,
|
|
6
|
+
Handle,
|
|
7
|
+
HandleServerError,
|
|
8
|
+
KitConfig,
|
|
9
|
+
Load,
|
|
10
|
+
RequestEvent,
|
|
11
|
+
RequestHandler,
|
|
12
|
+
ResolveOptions,
|
|
13
|
+
Server,
|
|
14
|
+
ServerInitOptions,
|
|
15
|
+
SSRManifest,
|
|
16
|
+
HandleFetch,
|
|
17
|
+
Actions,
|
|
18
|
+
HandleClientError
|
|
19
|
+
} from './index.js';
|
|
20
|
+
import {
|
|
21
|
+
HttpMethod,
|
|
22
|
+
MaybePromise,
|
|
23
|
+
PrerenderOption,
|
|
24
|
+
RequestOptions,
|
|
25
|
+
TrailingSlash
|
|
26
|
+
} from './private.js';
|
|
4
27
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
env: Record<string, string>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
28
|
+
export interface ServerModule {
|
|
29
|
+
Server: typeof InternalServer;
|
|
10
30
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type Logger = {
|
|
14
|
-
(msg: string): void;
|
|
15
|
-
success: (msg: string) => void;
|
|
16
|
-
error: (msg: string) => void;
|
|
17
|
-
warn: (msg: string) => void;
|
|
18
|
-
minor: (msg: string) => void;
|
|
19
|
-
info: (msg: string) => void;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type App = {
|
|
23
|
-
init: ({
|
|
24
|
-
paths,
|
|
25
|
-
prerendering,
|
|
26
|
-
read
|
|
27
|
-
}: {
|
|
31
|
+
override(options: {
|
|
32
|
+
building: boolean;
|
|
28
33
|
paths: {
|
|
29
34
|
base: string;
|
|
30
35
|
assets: string;
|
|
31
36
|
};
|
|
32
|
-
|
|
33
|
-
read
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
incoming: Incoming,
|
|
37
|
-
options?: {
|
|
38
|
-
prerender: {
|
|
39
|
-
fallback: string;
|
|
40
|
-
all: boolean;
|
|
41
|
-
dependencies: Map<string, ServerResponse>;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
) => ServerResponse;
|
|
45
|
-
};
|
|
37
|
+
protocol?: 'http' | 'https';
|
|
38
|
+
read(file: string): Buffer;
|
|
39
|
+
}): void;
|
|
40
|
+
}
|
|
46
41
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
export interface Asset {
|
|
43
|
+
file: string;
|
|
44
|
+
size: number;
|
|
45
|
+
type: string | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface BuildData {
|
|
49
|
+
app_dir: string;
|
|
50
|
+
app_path: string;
|
|
51
|
+
manifest_data: ManifestData;
|
|
52
|
+
service_worker: string | null;
|
|
53
|
+
client: {
|
|
54
|
+
assets: OutputAsset[];
|
|
55
|
+
chunks: OutputChunk[];
|
|
56
|
+
entry: {
|
|
57
|
+
file: string;
|
|
58
|
+
imports: string[];
|
|
59
|
+
stylesheets: string[];
|
|
60
|
+
fonts: string[];
|
|
61
61
|
};
|
|
62
|
+
vite_manifest: import('vite').Manifest;
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
server: {
|
|
65
|
+
chunks: OutputChunk[];
|
|
66
|
+
methods: Record<string, HttpMethod[]>;
|
|
67
|
+
vite_manifest: import('vite').Manifest;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
66
70
|
|
|
67
|
-
export
|
|
71
|
+
export interface CSRPageNode {
|
|
72
|
+
component: typeof SvelteComponent;
|
|
73
|
+
universal: {
|
|
74
|
+
load?: Load;
|
|
75
|
+
trailingSlash?: TrailingSlash;
|
|
76
|
+
};
|
|
77
|
+
server: boolean;
|
|
78
|
+
}
|
|
68
79
|
|
|
69
|
-
export type
|
|
80
|
+
export type CSRPageNodeLoader = () => Promise<CSRPageNode>;
|
|
70
81
|
|
|
71
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Definition of a client side route.
|
|
84
|
+
* The boolean in the tuples indicates whether the route has a server load.
|
|
85
|
+
*/
|
|
86
|
+
export type CSRRoute = {
|
|
72
87
|
id: string;
|
|
73
|
-
|
|
88
|
+
exec(path: string): undefined | Record<string, string>;
|
|
89
|
+
errors: Array<CSRPageNodeLoader | undefined>;
|
|
90
|
+
layouts: Array<[boolean, CSRPageNodeLoader] | undefined>;
|
|
91
|
+
leaf: [boolean, CSRPageNodeLoader];
|
|
74
92
|
};
|
|
75
93
|
|
|
76
94
|
export type GetParams = (match: RegExpExecArray) => Record<string, string>;
|
|
77
95
|
|
|
78
|
-
export
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// by a leaf component. if one of them fails in `load`, we
|
|
84
|
-
// backtrack until we find the nearest error component —
|
|
85
|
-
// plan b — and render that instead
|
|
86
|
-
a: PageId[];
|
|
87
|
-
b: PageId[];
|
|
88
|
-
};
|
|
96
|
+
export interface ServerHooks {
|
|
97
|
+
handleFetch: HandleFetch;
|
|
98
|
+
handle: Handle;
|
|
99
|
+
handleError: HandleServerError;
|
|
100
|
+
}
|
|
89
101
|
|
|
90
|
-
export
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
params: GetParams;
|
|
94
|
-
load: () => Promise<{
|
|
95
|
-
[method: string]: RequestHandler;
|
|
96
|
-
}>;
|
|
97
|
-
};
|
|
102
|
+
export interface ClientHooks {
|
|
103
|
+
handleError: HandleClientError;
|
|
104
|
+
}
|
|
98
105
|
|
|
99
|
-
export
|
|
106
|
+
export class InternalServer extends Server {
|
|
107
|
+
init(options: ServerInitOptions): Promise<void>;
|
|
108
|
+
respond(
|
|
109
|
+
request: Request,
|
|
110
|
+
options: RequestOptions & {
|
|
111
|
+
prerendering?: PrerenderOptions;
|
|
112
|
+
}
|
|
113
|
+
): Promise<Response>;
|
|
114
|
+
}
|
|
100
115
|
|
|
101
|
-
export
|
|
116
|
+
export interface ManifestData {
|
|
117
|
+
assets: Asset[];
|
|
118
|
+
nodes: PageNode[];
|
|
119
|
+
routes: RouteData[];
|
|
120
|
+
matchers: Record<string, string>;
|
|
121
|
+
}
|
|
102
122
|
|
|
103
|
-
export
|
|
123
|
+
export interface PageNode {
|
|
124
|
+
depth: number;
|
|
125
|
+
component?: string; // TODO supply default component if it's missing (bit of an edge case)
|
|
126
|
+
universal?: string;
|
|
127
|
+
server?: string;
|
|
128
|
+
parent_id?: string;
|
|
129
|
+
parent?: PageNode;
|
|
130
|
+
/**
|
|
131
|
+
* Filled with the pages that reference this layout (if this is a layout)
|
|
132
|
+
*/
|
|
133
|
+
child_pages?: PageNode[];
|
|
134
|
+
}
|
|
104
135
|
|
|
105
|
-
export
|
|
136
|
+
export interface PrerenderDependency {
|
|
137
|
+
response: Response;
|
|
138
|
+
body: null | string | Uint8Array;
|
|
139
|
+
}
|
|
106
140
|
|
|
107
|
-
export
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
141
|
+
export interface PrerenderOptions {
|
|
142
|
+
cache?: string; // including this here is a bit of a hack, but it makes it easy to add <meta http-equiv>
|
|
143
|
+
fallback?: boolean;
|
|
144
|
+
dependencies: Map<string, PrerenderDependency>;
|
|
145
|
+
}
|
|
113
146
|
|
|
114
|
-
export type
|
|
115
|
-
|
|
116
|
-
|
|
147
|
+
export type RecursiveRequired<T> = {
|
|
148
|
+
// Recursive implementation of TypeScript's Required utility type.
|
|
149
|
+
// Will recursively continue until it reaches a primitive or Function
|
|
150
|
+
[K in keyof T]-?: Extract<T[K], Function> extends never // If it does not have a Function type
|
|
151
|
+
? RecursiveRequired<T[K]> // recursively continue through.
|
|
152
|
+
: T[K]; // Use the exact type for everything else
|
|
117
153
|
};
|
|
118
154
|
|
|
119
|
-
export type
|
|
120
|
-
module: SSRComponent;
|
|
121
|
-
entry: string; // client-side module corresponding to this component
|
|
122
|
-
css: string[];
|
|
123
|
-
js: string[];
|
|
124
|
-
styles: string[];
|
|
125
|
-
};
|
|
155
|
+
export type RequiredResolveOptions = Required<ResolveOptions>;
|
|
126
156
|
|
|
127
|
-
export
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
157
|
+
export interface Respond {
|
|
158
|
+
(request: Request, options: SSROptions, state: SSRState): Promise<Response>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface RouteParam {
|
|
162
|
+
name: string;
|
|
163
|
+
matcher: string;
|
|
164
|
+
optional: boolean;
|
|
165
|
+
rest: boolean;
|
|
166
|
+
chained: boolean;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Represents a route segment in the app. It can either be an intermediate node
|
|
171
|
+
* with only layout/error pages, or a leaf, at which point either `page` and `leaf`
|
|
172
|
+
* or `endpoint` is set.
|
|
173
|
+
*/
|
|
174
|
+
export interface RouteData {
|
|
175
|
+
id: string;
|
|
176
|
+
parent: RouteData | null;
|
|
177
|
+
|
|
178
|
+
segment: string;
|
|
179
|
+
pattern: RegExp;
|
|
180
|
+
params: RouteParam[];
|
|
181
|
+
|
|
182
|
+
layout: PageNode | null;
|
|
183
|
+
error: PageNode | null;
|
|
184
|
+
leaf: PageNode | null;
|
|
185
|
+
|
|
186
|
+
page: {
|
|
187
|
+
layouts: Array<number | undefined>;
|
|
188
|
+
errors: Array<number | undefined>;
|
|
189
|
+
leaf: number;
|
|
190
|
+
} | null;
|
|
191
|
+
|
|
192
|
+
endpoint: {
|
|
131
193
|
file: string;
|
|
132
|
-
|
|
133
|
-
|
|
194
|
+
} | null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type ServerData =
|
|
198
|
+
| {
|
|
199
|
+
type: 'redirect';
|
|
200
|
+
location: string;
|
|
201
|
+
}
|
|
202
|
+
| {
|
|
203
|
+
type: 'data';
|
|
204
|
+
/**
|
|
205
|
+
* If `null`, then there was no load function
|
|
206
|
+
*/
|
|
207
|
+
nodes: Array<ServerDataNode | ServerDataSkippedNode | ServerErrorNode | null>;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Signals a successful response of the server `load` function.
|
|
212
|
+
* The `uses` property tells the client when it's possible to reuse this data
|
|
213
|
+
* in a subsequent request.
|
|
214
|
+
*/
|
|
215
|
+
export interface ServerDataNode {
|
|
216
|
+
type: 'data';
|
|
217
|
+
data: Record<string, any> | null;
|
|
218
|
+
uses: Uses;
|
|
219
|
+
slash?: TrailingSlash;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Signals that the server `load` function was not run, and the
|
|
224
|
+
* client should use what it has in memory
|
|
225
|
+
*/
|
|
226
|
+
export interface ServerDataSkippedNode {
|
|
227
|
+
type: 'skip';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Signals that the server `load` function failed
|
|
232
|
+
*/
|
|
233
|
+
export interface ServerErrorNode {
|
|
234
|
+
type: 'error';
|
|
235
|
+
error: App.Error;
|
|
236
|
+
/**
|
|
237
|
+
* Only set for HttpErrors
|
|
238
|
+
*/
|
|
239
|
+
status?: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface SSRComponent {
|
|
243
|
+
default: {
|
|
244
|
+
render(props: Record<string, any>): {
|
|
245
|
+
html: string;
|
|
246
|
+
head: string;
|
|
247
|
+
css: {
|
|
248
|
+
code: string;
|
|
249
|
+
map: any; // TODO
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export type SSRComponentLoader = () => Promise<SSRComponent>;
|
|
256
|
+
|
|
257
|
+
export interface SSRNode {
|
|
258
|
+
component: SSRComponentLoader;
|
|
259
|
+
/** index into the `components` array in client-manifest.js */
|
|
260
|
+
index: number;
|
|
261
|
+
/** client-side module URL for this component */
|
|
262
|
+
file: string;
|
|
263
|
+
/** external JS files */
|
|
264
|
+
imports: string[];
|
|
265
|
+
/** external CSS files */
|
|
266
|
+
stylesheets: string[];
|
|
267
|
+
/** external font files */
|
|
268
|
+
fonts: string[];
|
|
269
|
+
/** inlined styles */
|
|
270
|
+
inline_styles?(): MaybePromise<Record<string, string>>;
|
|
271
|
+
|
|
272
|
+
universal: {
|
|
273
|
+
load?: Load;
|
|
274
|
+
prerender?: PrerenderOption;
|
|
275
|
+
ssr?: boolean;
|
|
276
|
+
csr?: boolean;
|
|
277
|
+
trailingSlash?: TrailingSlash;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
server: {
|
|
281
|
+
load?: ServerLoad;
|
|
282
|
+
prerender?: PrerenderOption;
|
|
283
|
+
ssr?: boolean;
|
|
284
|
+
csr?: boolean;
|
|
285
|
+
trailingSlash?: TrailingSlash;
|
|
286
|
+
actions?: Actions;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// store this in dev so we can print serialization errors
|
|
290
|
+
universal_id?: string;
|
|
291
|
+
server_id?: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export type SSRNodeLoader = () => Promise<SSRNode>;
|
|
295
|
+
|
|
296
|
+
export interface SSROptions {
|
|
297
|
+
csp: ValidatedConfig['kit']['csp'];
|
|
298
|
+
csrf: {
|
|
299
|
+
check_origin: boolean;
|
|
134
300
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
handle_error
|
|
138
|
-
hooks:
|
|
139
|
-
hydrate: boolean;
|
|
140
|
-
load_component: (id: PageId) => Promise<SSRNode>;
|
|
301
|
+
dev: boolean;
|
|
302
|
+
embedded: boolean;
|
|
303
|
+
handle_error(error: Error & { frame?: string }, event: RequestEvent): MaybePromise<App.Error>;
|
|
304
|
+
hooks: ServerHooks;
|
|
141
305
|
manifest: SSRManifest;
|
|
142
306
|
paths: {
|
|
143
307
|
base: string;
|
|
144
308
|
assets: string;
|
|
145
309
|
};
|
|
146
|
-
|
|
310
|
+
public_env: Record<string, string>;
|
|
311
|
+
read(file: string): Buffer;
|
|
147
312
|
root: SSRComponent['default'];
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
313
|
+
service_worker: boolean;
|
|
314
|
+
app_template({
|
|
315
|
+
head,
|
|
316
|
+
body,
|
|
317
|
+
assets,
|
|
318
|
+
nonce
|
|
319
|
+
}: {
|
|
320
|
+
head: string;
|
|
321
|
+
body: string;
|
|
322
|
+
assets: string;
|
|
323
|
+
nonce: string;
|
|
324
|
+
}): string;
|
|
325
|
+
app_template_contains_nonce: boolean;
|
|
326
|
+
error_template({ message, status }: { message: string; status: number }): string;
|
|
327
|
+
version: string;
|
|
328
|
+
}
|
|
153
329
|
|
|
154
|
-
export
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
prerender?: {
|
|
158
|
-
fallback: string;
|
|
159
|
-
all: boolean;
|
|
160
|
-
dependencies: Map<string, ServerResponse>;
|
|
161
|
-
error: Error;
|
|
162
|
-
};
|
|
163
|
-
fallback?: string;
|
|
164
|
-
};
|
|
330
|
+
export interface SSRErrorPage {
|
|
331
|
+
id: '__error';
|
|
332
|
+
}
|
|
165
333
|
|
|
166
|
-
export
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
334
|
+
export interface PageNodeIndexes {
|
|
335
|
+
errors: Array<number | undefined>;
|
|
336
|
+
layouts: Array<number | undefined>;
|
|
337
|
+
leaf: number;
|
|
338
|
+
}
|
|
171
339
|
|
|
172
|
-
export type
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
params: string[];
|
|
176
|
-
path: string;
|
|
177
|
-
a: string[];
|
|
178
|
-
b: string[];
|
|
340
|
+
export type SSREndpoint = Partial<Record<HttpMethod, RequestHandler>> & {
|
|
341
|
+
prerender?: PrerenderOption;
|
|
342
|
+
trailingSlash?: TrailingSlash;
|
|
179
343
|
};
|
|
180
344
|
|
|
181
|
-
export
|
|
182
|
-
|
|
345
|
+
export interface SSRRoute {
|
|
346
|
+
id: string;
|
|
183
347
|
pattern: RegExp;
|
|
184
|
-
params:
|
|
185
|
-
|
|
186
|
-
|
|
348
|
+
params: RouteParam[];
|
|
349
|
+
page: PageNodeIndexes | null;
|
|
350
|
+
endpoint: (() => Promise<SSREndpoint>) | null;
|
|
351
|
+
endpoint_id?: string;
|
|
352
|
+
}
|
|
187
353
|
|
|
188
|
-
export
|
|
354
|
+
export interface SSRState {
|
|
355
|
+
fallback?: string;
|
|
356
|
+
getClientAddress(): string;
|
|
357
|
+
initiator?: SSRRoute | SSRErrorPage;
|
|
358
|
+
platform?: any;
|
|
359
|
+
prerendering?: PrerenderOptions;
|
|
360
|
+
/**
|
|
361
|
+
* When fetching data from a +server.js endpoint in `load`, the page's
|
|
362
|
+
* prerender option is inherited by the endpoint, unless overridden
|
|
363
|
+
*/
|
|
364
|
+
prerender_default?: PrerenderOption;
|
|
365
|
+
}
|
|
189
366
|
|
|
190
|
-
export type
|
|
191
|
-
assets: Asset[];
|
|
192
|
-
layout: string;
|
|
193
|
-
error: string;
|
|
194
|
-
components: string[];
|
|
195
|
-
routes: RouteData[];
|
|
196
|
-
};
|
|
367
|
+
export type StrictBody = string | ArrayBufferView;
|
|
197
368
|
|
|
198
|
-
export
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
369
|
+
export interface Uses {
|
|
370
|
+
dependencies: Set<string>;
|
|
371
|
+
params: Set<string>;
|
|
372
|
+
parent: boolean;
|
|
373
|
+
route: boolean;
|
|
374
|
+
url: boolean;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export type ValidatedConfig = RecursiveRequired<Config>;
|
|
378
|
+
|
|
379
|
+
export type ValidatedKitConfig = RecursiveRequired<KitConfig>;
|
|
380
|
+
|
|
381
|
+
export * from './index';
|
|
382
|
+
export * from './private';
|
|
383
|
+
|
|
384
|
+
declare global {
|
|
385
|
+
const __SVELTEKIT_ADAPTER_NAME__: string;
|
|
386
|
+
const __SVELTEKIT_APP_VERSION__: string;
|
|
387
|
+
const __SVELTEKIT_APP_VERSION_FILE__: string;
|
|
388
|
+
const __SVELTEKIT_APP_VERSION_POLL_INTERVAL__: number;
|
|
389
|
+
const __SVELTEKIT_BROWSER__: boolean;
|
|
390
|
+
const __SVELTEKIT_DEV__: boolean;
|
|
391
|
+
const __SVELTEKIT_EMBEDDED__: boolean;
|
|
392
|
+
}
|