@sveltejs/kit 1.0.0-next.32 → 1.0.0-next.320

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.
Files changed (73) hide show
  1. package/README.md +12 -9
  2. package/assets/app/env.js +20 -0
  3. package/assets/app/navigation.js +24 -0
  4. package/assets/app/paths.js +1 -0
  5. package/assets/app/stores.js +97 -0
  6. package/assets/client/singletons.js +13 -0
  7. package/assets/client/start.js +1687 -0
  8. package/assets/components/error.svelte +18 -2
  9. package/assets/env.js +8 -0
  10. package/assets/paths.js +13 -0
  11. package/assets/server/index.js +3411 -0
  12. package/dist/chunks/amp_hook.js +56 -0
  13. package/dist/chunks/cert.js +28154 -0
  14. package/dist/chunks/constants.js +663 -0
  15. package/dist/chunks/filesystem.js +110 -0
  16. package/dist/chunks/index.js +515 -0
  17. package/dist/chunks/index2.js +1335 -0
  18. package/dist/chunks/index3.js +118 -0
  19. package/dist/chunks/index4.js +186 -0
  20. package/dist/chunks/index5.js +251 -0
  21. package/dist/chunks/index6.js +15737 -0
  22. package/dist/chunks/index7.js +4207 -0
  23. package/dist/chunks/misc.js +78 -0
  24. package/dist/chunks/multipart-parser.js +449 -0
  25. package/dist/chunks/object.js +83 -0
  26. package/dist/chunks/sync.js +974 -0
  27. package/dist/chunks/url.js +56 -0
  28. package/dist/cli.js +1024 -65
  29. package/dist/hooks.js +28 -0
  30. package/dist/install-fetch.js +6518 -0
  31. package/dist/node.js +94 -0
  32. package/package.json +95 -62
  33. package/svelte-kit.js +0 -1
  34. package/types/ambient.d.ts +298 -0
  35. package/types/index.d.ts +278 -0
  36. package/types/internal.d.ts +320 -0
  37. package/types/private.d.ts +242 -0
  38. package/CHANGELOG.md +0 -350
  39. package/assets/runtime/app/navigation.js +0 -23
  40. package/assets/runtime/app/navigation.js.map +0 -1
  41. package/assets/runtime/app/paths.js +0 -2
  42. package/assets/runtime/app/paths.js.map +0 -1
  43. package/assets/runtime/app/stores.js +0 -78
  44. package/assets/runtime/app/stores.js.map +0 -1
  45. package/assets/runtime/internal/singletons.js +0 -15
  46. package/assets/runtime/internal/singletons.js.map +0 -1
  47. package/assets/runtime/internal/start.js +0 -591
  48. package/assets/runtime/internal/start.js.map +0 -1
  49. package/assets/runtime/utils-85ebcc60.js +0 -18
  50. package/assets/runtime/utils-85ebcc60.js.map +0 -1
  51. package/dist/api.js +0 -32
  52. package/dist/api.js.map +0 -1
  53. package/dist/cli.js.map +0 -1
  54. package/dist/create_app.js +0 -577
  55. package/dist/create_app.js.map +0 -1
  56. package/dist/index.js +0 -329
  57. package/dist/index.js.map +0 -1
  58. package/dist/index2.js +0 -14363
  59. package/dist/index2.js.map +0 -1
  60. package/dist/index3.js +0 -544
  61. package/dist/index3.js.map +0 -1
  62. package/dist/index4.js +0 -71
  63. package/dist/index4.js.map +0 -1
  64. package/dist/index5.js +0 -465
  65. package/dist/index5.js.map +0 -1
  66. package/dist/index6.js +0 -727
  67. package/dist/index6.js.map +0 -1
  68. package/dist/renderer.js +0 -2413
  69. package/dist/renderer.js.map +0 -1
  70. package/dist/standard.js +0 -100
  71. package/dist/standard.js.map +0 -1
  72. package/dist/utils.js +0 -57
  73. package/dist/utils.js.map +0 -1
@@ -0,0 +1,242 @@
1
+ // This module contains types that are visible in the documentation,
2
+ // but which cannot be imported from `@sveltejs/kit`. Care should
3
+ // be taken to avoid breaking changes when editing this file
4
+
5
+ export interface AdapterEntry {
6
+ /**
7
+ * A string that uniquely identifies an HTTP service (e.g. serverless function) and is used for deduplication.
8
+ * For example, `/foo/a-[b]` and `/foo/[c]` are different routes, but would both
9
+ * be represented in a Netlify _redirects file as `/foo/:param`, so they share an ID
10
+ */
11
+ id: string;
12
+
13
+ /**
14
+ * A function that compares the candidate route with the current route to determine
15
+ * if it should be treated as a fallback for the current route. For example, `/foo/[c]`
16
+ * is a fallback for `/foo/a-[b]`, and `/[...catchall]` is a fallback for all routes
17
+ */
18
+ filter: (route: RouteDefinition) => boolean;
19
+
20
+ /**
21
+ * A function that is invoked once the entry has been created. This is where you
22
+ * should write the function to the filesystem and generate redirect manifests.
23
+ */
24
+ complete: (entry: {
25
+ generateManifest: (opts: { relativePath: string; format?: 'esm' | 'cjs' }) => string;
26
+ }) => MaybePromise<void>;
27
+ }
28
+
29
+ // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts
30
+ //
31
+ // MIT License
32
+ //
33
+ // Copyright (c) 2021-present, Joshua Hemphill
34
+ // Copyright (c) 2021, Tecnico Corporation
35
+ //
36
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
37
+ // of this software and associated documentation files (the "Software"), to deal
38
+ // in the Software without restriction, including without limitation the rights
39
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ // copies of the Software, and to permit persons to whom the Software is
41
+ // furnished to do so, subject to the following conditions:
42
+ //
43
+ // The above copyright notice and this permission notice shall be included in all
44
+ // copies or substantial portions of the Software.
45
+ //
46
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
52
+ // SOFTWARE.
53
+
54
+ export namespace Csp {
55
+ type ActionSource = 'strict-dynamic' | 'report-sample';
56
+ type BaseSource = 'self' | 'unsafe-eval' | 'unsafe-hashes' | 'unsafe-inline' | 'none';
57
+ type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`;
58
+ type FrameSource = HostSource | SchemeSource | 'self' | 'none';
59
+ type HostNameScheme = `${string}.${string}` | 'localhost';
60
+ type HostSource = `${HostProtocolSchemes}${HostNameScheme}${PortScheme}`;
61
+ type HostProtocolSchemes = `${string}://` | '';
62
+ type HttpDelineator = '/' | '?' | '#' | '\\';
63
+ type PortScheme = `:${number}` | '' | ':*';
64
+ type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
65
+ type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
66
+ type Sources = Source[];
67
+ type UriPath = `${HttpDelineator}${string}`;
68
+ }
69
+
70
+ export interface CspDirectives {
71
+ 'child-src'?: Csp.Sources;
72
+ 'default-src'?: Array<Csp.Source | Csp.ActionSource>;
73
+ 'frame-src'?: Csp.Sources;
74
+ 'worker-src'?: Csp.Sources;
75
+ 'connect-src'?: Csp.Sources;
76
+ 'font-src'?: Csp.Sources;
77
+ 'img-src'?: Csp.Sources;
78
+ 'manifest-src'?: Csp.Sources;
79
+ 'media-src'?: Csp.Sources;
80
+ 'object-src'?: Csp.Sources;
81
+ 'prefetch-src'?: Csp.Sources;
82
+ 'script-src'?: Array<Csp.Source | Csp.ActionSource>;
83
+ 'script-src-elem'?: Csp.Sources;
84
+ 'script-src-attr'?: Csp.Sources;
85
+ 'style-src'?: Array<Csp.Source | Csp.ActionSource>;
86
+ 'style-src-elem'?: Csp.Sources;
87
+ 'style-src-attr'?: Csp.Sources;
88
+ 'base-uri'?: Array<Csp.Source | Csp.ActionSource>;
89
+ sandbox?: Array<
90
+ | 'allow-downloads-without-user-activation'
91
+ | 'allow-forms'
92
+ | 'allow-modals'
93
+ | 'allow-orientation-lock'
94
+ | 'allow-pointer-lock'
95
+ | 'allow-popups'
96
+ | 'allow-popups-to-escape-sandbox'
97
+ | 'allow-presentation'
98
+ | 'allow-same-origin'
99
+ | 'allow-scripts'
100
+ | 'allow-storage-access-by-user-activation'
101
+ | 'allow-top-navigation'
102
+ | 'allow-top-navigation-by-user-activation'
103
+ >;
104
+ 'form-action'?: Array<Csp.Source | Csp.ActionSource>;
105
+ 'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
106
+ 'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
107
+ 'report-uri'?: Csp.UriPath[];
108
+ 'report-to'?: string[];
109
+
110
+ 'require-trusted-types-for'?: Array<'script'>;
111
+ 'trusted-types'?: Array<'none' | 'allow-duplicates' | '*' | string>;
112
+ 'upgrade-insecure-requests'?: boolean;
113
+
114
+ /** @deprecated */
115
+ 'require-sri-for'?: Array<'script' | 'style' | 'script style'>;
116
+
117
+ /** @deprecated */
118
+ 'block-all-mixed-content'?: boolean;
119
+
120
+ /** @deprecated */
121
+ 'plugin-types'?: Array<`${string}/${string}` | 'none'>;
122
+
123
+ /** @deprecated */
124
+ referrer?: Array<
125
+ | 'no-referrer'
126
+ | 'no-referrer-when-downgrade'
127
+ | 'origin'
128
+ | 'origin-when-cross-origin'
129
+ | 'same-origin'
130
+ | 'strict-origin'
131
+ | 'strict-origin-when-cross-origin'
132
+ | 'unsafe-url'
133
+ | 'none'
134
+ >;
135
+ }
136
+
137
+ export type HttpMethod = 'get' | 'head' | 'post' | 'put' | 'delete' | 'patch';
138
+
139
+ export interface JSONObject {
140
+ [key: string]: JSONValue;
141
+ }
142
+
143
+ export type JSONValue =
144
+ | string
145
+ | number
146
+ | boolean
147
+ | null
148
+ | undefined
149
+ | ToJSON
150
+ | JSONValue[]
151
+ | JSONObject;
152
+
153
+ export interface Logger {
154
+ (msg: string): void;
155
+ success(msg: string): void;
156
+ error(msg: string): void;
157
+ warn(msg: string): void;
158
+ minor(msg: string): void;
159
+ info(msg: string): void;
160
+ }
161
+
162
+ export type MaybePromise<T> = T | Promise<T>;
163
+
164
+ export interface Prerendered {
165
+ pages: Map<
166
+ string,
167
+ {
168
+ /** The location of the .html file relative to the output directory */
169
+ file: string;
170
+ }
171
+ >;
172
+ assets: Map<
173
+ string,
174
+ {
175
+ /** The MIME type of the asset */
176
+ type: string;
177
+ }
178
+ >;
179
+ redirects: Map<
180
+ string,
181
+ {
182
+ status: number;
183
+ location: string;
184
+ }
185
+ >;
186
+ /** An array of prerendered paths (without trailing slashes, regardless of the trailingSlash config) */
187
+ paths: string[];
188
+ }
189
+
190
+ export interface PrerenderErrorHandler {
191
+ (details: {
192
+ status: number;
193
+ path: string;
194
+ referrer: string | null;
195
+ referenceType: 'linked' | 'fetched';
196
+ }): void;
197
+ }
198
+
199
+ export type PrerenderOnErrorValue = 'fail' | 'continue' | PrerenderErrorHandler;
200
+
201
+ export interface RequestEvent<Params extends Record<string, string> = Record<string, string>> {
202
+ clientAddress: string;
203
+ locals: App.Locals;
204
+ params: Params;
205
+ platform: Readonly<App.Platform>;
206
+ request: Request;
207
+ routeId: string | null;
208
+ url: URL;
209
+ }
210
+
211
+ export interface RequestOptions {
212
+ getClientAddress: () => string;
213
+ platform?: App.Platform;
214
+ }
215
+
216
+ export interface ResolveOptions {
217
+ ssr?: boolean;
218
+ transformPage?: ({ html }: { html: string }) => MaybePromise<string>;
219
+ }
220
+
221
+ /** `string[]` is only for set-cookie, everything else must be type of `string` */
222
+ export type ResponseHeaders = Record<string, string | number | string[]>;
223
+
224
+ export interface RouteDefinition {
225
+ id: string;
226
+ type: 'page' | 'endpoint';
227
+ pattern: RegExp;
228
+ segments: RouteSegment[];
229
+ methods: HttpMethod[];
230
+ }
231
+
232
+ export interface RouteSegment {
233
+ content: string;
234
+ dynamic: boolean;
235
+ rest: boolean;
236
+ }
237
+
238
+ export interface ToJSON {
239
+ toJSON(...args: any[]): Exclude<JSONValue, ToJSON>;
240
+ }
241
+
242
+ export type TrailingSlash = 'never' | 'always' | 'ignore';
package/CHANGELOG.md DELETED
@@ -1,350 +0,0 @@
1
- # @sveltejs/kit
2
-
3
- ## 1.0.0-next.32
4
-
5
- ### Patch Changes
6
-
7
- - Convert everything to ESM
8
-
9
- ## 1.0.0-next.31
10
-
11
- ### Patch Changes
12
-
13
- - b6c2434: app.js -> app.cjs
14
-
15
- ## 1.0.0-next.30
16
-
17
- ### Patch Changes
18
-
19
- - 00cbaf6: Rename _.config.js to _.config.cjs
20
-
21
- ## 1.0.0-next.29
22
-
23
- ### Patch Changes
24
-
25
- - 4c0edce: Use addEventListener instead of onload
26
-
27
- ## 1.0.0-next.28
28
-
29
- ### Patch Changes
30
-
31
- - 4353025: Prevent infinite loop when fetching bad URLs inside error responses
32
- - 2860065: Handle assets path when prerendering
33
-
34
- ## 1.0.0-next.27
35
-
36
- ### Patch Changes
37
-
38
- - Fail build if prerender errors
39
- - Hide logging behind --verbose option
40
-
41
- ## 1.0.0-next.26
42
-
43
- ### Patch Changes
44
-
45
- - Fix svelte-announcer CSS
46
-
47
- ## 1.0.0-next.25
48
-
49
- ### Patch Changes
50
-
51
- - Surface stack traces for endpoint/page rendering errors
52
-
53
- ## 1.0.0-next.24
54
-
55
- ### Patch Changes
56
-
57
- - 26643df: Account for config.paths when prerendering
58
-
59
- ## 1.0.0-next.23
60
-
61
- ### Patch Changes
62
-
63
- - 9b758aa: Upgrade to Snowpack 3
64
-
65
- ## 1.0.0-next.22
66
-
67
- ### Patch Changes
68
-
69
- - bb68595: use readFileSync instead of createReadStream
70
-
71
- ## 1.0.0-next.21
72
-
73
- ### Patch Changes
74
-
75
- - 217e4cc: Set paths to empty string before prerender
76
-
77
- ## 1.0.0-next.20
78
-
79
- ### Patch Changes
80
-
81
- - ccf4aa7: Implement prerender config
82
-
83
- ## 1.0.0-next.19
84
-
85
- ### Patch Changes
86
-
87
- - deda984: Make navigating store contain from and to properties
88
-
89
- ## 1.0.0-next.18
90
-
91
- ### Patch Changes
92
-
93
- - c29b61e: Announce page changes
94
- - 72da270: Reset focus properly
95
-
96
- ## 1.0.0-next.17
97
-
98
- ### Patch Changes
99
-
100
- - f7dea55: Set process.env.NODE_ENV when invoking via the CLI
101
-
102
- ## 1.0.0-next.16
103
-
104
- ### Patch Changes
105
-
106
- - Remove temporary logging
107
- - Add sveltekit:prefetch and sveltekit:noscroll
108
-
109
- ## 1.0.0-next.15
110
-
111
- ### Patch Changes
112
-
113
- - 6d1bb11: Fix AMP CSS
114
- - d8b53af: Ignore $layout and $error files when finding static paths
115
- - Better scroll tracking
116
-
117
- ## 1.0.0-next.14
118
-
119
- ### Patch Changes
120
-
121
- - Fix dev loader
122
-
123
- ## 1.0.0-next.13
124
-
125
- ### Patch Changes
126
-
127
- - 1ea4d6b: More robust CSS extraction
128
-
129
- ## 1.0.0-next.12
130
-
131
- ### Patch Changes
132
-
133
- - e7c88dd: Tweak AMP validation screen
134
-
135
- ## 1.0.0-next.11
136
-
137
- ### Patch Changes
138
-
139
- - a31f218: Fix SSR loader invalidation
140
-
141
- ## 1.0.0-next.10
142
-
143
- ### Patch Changes
144
-
145
- - 8b14d29: Omit svelte-data scripts from AMP pages
146
-
147
- ## 1.0.0-next.9
148
-
149
- ### Patch Changes
150
-
151
- - f5fa223: AMP support
152
- - 47f2ee1: Always remove trailing slashes
153
- - 1becb94: Replace preload with load
154
-
155
- ## 1.0.0-next.8
156
-
157
- ### Patch Changes
158
-
159
- - 15dd751: Use meta http-equiv=refresh
160
- - be7e031: Fix handling of static files
161
- - ed6b8fd: Implement \$app/env
162
-
163
- ## 1.0.0-next.7
164
-
165
- ### Patch Changes
166
-
167
- - 76705b0: make HMR work outside localhost
168
-
169
- ## 1.0.0-next.6
170
-
171
- ### Patch Changes
172
-
173
- - 0e45255: Move options behind kit namespace, change paths -> kit.files
174
- - fa7f2b2: Implement live bindings for SSR code
175
-
176
- ## 1.0.0-next.5
177
-
178
- ### Patch Changes
179
-
180
- - Return dependencies from render
181
-
182
- ## 1.0.0-next.4
183
-
184
- ### Patch Changes
185
-
186
- - af01b0d: Move renderer out of app assets folder
187
-
188
- ## 1.0.0-next.3
189
-
190
- ### Patch Changes
191
-
192
- - Add paths to manifest, for static prerendering
193
-
194
- ## 1.0.0-next.2
195
-
196
- ### Patch Changes
197
-
198
- - Fix typo causing misnamed assets folder
199
-
200
- ## 1.0.0-next.1
201
-
202
- ### Patch Changes
203
-
204
- - a4bc090: Transform exported functions correctly
205
- - 00bbf98: Fix nested layouts
206
-
207
- ## 0.0.31-next.0
208
-
209
- ### Patch Changes
210
-
211
- - ffd7bba: Fix SSR cache invalidation
212
-
213
- ## 0.0.30
214
-
215
- ### Patch Changes
216
-
217
- - Add back stores(), but with deprecation warning
218
- - Rename stores.preloading to stores.navigating
219
- - Rewrite routing logic
220
-
221
- ## 0.0.29
222
-
223
- ### Patch Changes
224
-
225
- - 10872cc: Normalize request.query
226
-
227
- ## 0.0.28
228
-
229
- ### Patch Changes
230
-
231
- - Add svelte-kit start command
232
-
233
- ## 0.0.27
234
-
235
- ### Patch Changes
236
-
237
- - rename CLI to svelte-kit
238
- - 0904e22: rename svelte CLI to svelte-kit
239
- - Validate route responses
240
- - Make paths and target configurable
241
-
242
- ## 0.0.26
243
-
244
- ### Patch Changes
245
-
246
- - b475ed4: Overhaul adapter API - fixes #166
247
- - Updated dependencies [b475ed4]
248
- - @sveltejs/app-utils@0.0.18
249
-
250
- ## 0.0.25
251
-
252
- ### Patch Changes
253
-
254
- - Updated dependencies [3bdf33b]
255
- - @sveltejs/app-utils@0.0.17
256
-
257
- ## 0.0.24
258
-
259
- ### Patch Changes
260
-
261
- - 67eaeea: Move app-utils stuff into subpackages
262
- - 7f8df30: Move kit runtime code, expose via \$app aliases
263
- - Updated dependencies [67eaeea]
264
- - @sveltejs/app-utils@0.0.16
265
-
266
- ## 0.0.23
267
-
268
- ### Patch Changes
269
-
270
- - a163000: Parse body on incoming requests
271
- - a346eab: Copy over latest Sapper router code
272
- - Updated dependencies [a163000]
273
- - @sveltejs/app-utils@0.0.15
274
-
275
- ## 0.0.22
276
-
277
- ### Patch Changes
278
-
279
- - Force bump version
280
-
281
- ## 0.0.21
282
-
283
- ### Patch Changes
284
-
285
- - Build setup entry point
286
- - Work around pkg.exports constraint
287
- - Respond with 500s if render fails
288
- - Updated dependencies [undefined]
289
- - Updated dependencies [undefined]
290
- - Updated dependencies [undefined]
291
- - @sveltejs/app-utils@0.0.14
292
-
293
- ## 0.0.20
294
-
295
- ### Patch Changes
296
-
297
- - Pass setup module to renderer
298
- - Bump Snowpack version
299
- - Updated dependencies [undefined]
300
- - Updated dependencies [96c06d8]
301
- - @sveltejs/app-utils@0.0.13
302
-
303
- ## 0.0.19
304
-
305
- ### Patch Changes
306
-
307
- - fa9d7ce: Handle import.meta in SSR module loader
308
- - 0320208: Rename 'server route' to 'endpoint'
309
- - b9444d2: Update to Snowpack 2.15
310
- - 5ca907c: Use shared mkdirp helper
311
- - Updated dependencies [0320208]
312
- - Updated dependencies [5ca907c]
313
- - @sveltejs/app-utils@0.0.12
314
-
315
- ## 0.0.18
316
-
317
- ### Patch Changes
318
-
319
- - Updated dependencies [undefined]
320
- - @sveltejs/app-utils@0.0.11
321
-
322
- ## 0.0.17
323
-
324
- ### Patch Changes
325
-
326
- - 19323e9: Update Snowpack
327
- - Updated dependencies [19323e9]
328
- - @sveltejs/app-utils@0.0.10
329
-
330
- ## 0.0.16
331
-
332
- ### Patch Changes
333
-
334
- - Updated dependencies [90a98ae]
335
- - @sveltejs/app-utils@0.0.9
336
-
337
- ## 0.0.15
338
-
339
- ### Patch Changes
340
-
341
- - Updated dependencies [undefined]
342
- - @sveltejs/app-utils@0.0.8
343
-
344
- ## 0.0.14
345
-
346
- ### Patch Changes
347
-
348
- - various
349
- - Updated dependencies [undefined]
350
- - @sveltejs/app-utils@0.0.7
@@ -1,23 +0,0 @@
1
- import { router, renderer } from '../internal/singletons.js';
2
- import { g as get_base_uri } from '../utils-85ebcc60.js';
3
-
4
- async function goto(href, opts) {
5
- return router.goto(href, opts);
6
- }
7
-
8
- function prefetch(href) {
9
- return renderer.prefetch(new URL(href, get_base_uri(document)));
10
- }
11
-
12
- async function prefetchRoutes(pathnames) {
13
- const path_routes = pathnames
14
- ? router.pages.filter((page) => pathnames.some((pathname) => page.pattern.test(pathname)))
15
- : router.pages;
16
-
17
- const promises = path_routes.map((r) => Promise.all(r.parts.map((load) => load())));
18
-
19
- await Promise.all(promises);
20
- }
21
-
22
- export { goto, prefetch, prefetchRoutes };
23
- //# sourceMappingURL=navigation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation.js","sources":["../../../src/runtime/app/navigation/index.js"],"sourcesContent":["import { router, renderer } from '../../internal/singletons';\nimport { get_base_uri } from '../../internal/utils';\n\nexport async function goto(href, opts) {\n\treturn router.goto(href, opts);\n}\n\nexport function prefetch(href) {\n\treturn renderer.prefetch(new URL(href, get_base_uri(document)));\n}\n\nexport async function prefetchRoutes(pathnames) {\n\tconst path_routes = pathnames\n\t\t? router.pages.filter((page) => pathnames.some((pathname) => page.pattern.test(pathname)))\n\t\t: router.pages;\n\n\tconst promises = path_routes.map((r) => Promise.all(r.parts.map((load) => load())));\n\n\tawait Promise.all(promises);\n}\n"],"names":[],"mappings":";;;AAGO,eAAe,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;AACvC,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AACD;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC/B,CAAC,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AACD;AACO,eAAe,cAAc,CAAC,SAAS,EAAE;AAChD,CAAC,MAAM,WAAW,GAAG,SAAS;AAC9B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5F,IAAI,MAAM,CAAC,KAAK,CAAC;AACjB;AACA,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF;AACA,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC7B;;;;"}
@@ -1,2 +0,0 @@
1
- export { assets, base } from '../internal/singletons.js';
2
- //# sourceMappingURL=paths.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,78 +0,0 @@
1
- import { getContext } from 'svelte';
2
-
3
- // const ssr = (import.meta as any).env.SSR;
4
- const ssr = typeof window === 'undefined'; // TODO why doesn't previous line work in build?
5
-
6
- // TODO remove this (for 1.0? after 1.0?)
7
- let warned = false;
8
- function stores() {
9
- if (!warned) {
10
- console.error('stores() is deprecated; use getStores() instead');
11
- warned = true;
12
- }
13
- return getStores();
14
- }
15
-
16
- const getStores = () => {
17
- const stores = getContext('__svelte__');
18
-
19
- return {
20
- page: {
21
- subscribe: stores.page.subscribe
22
- },
23
- navigating: {
24
- subscribe: stores.navigating.subscribe
25
- },
26
- get preloading() {
27
- console.error('stores.preloading is deprecated; use stores.navigating instead');
28
- return {
29
- subscribe: stores.navigating.subscribe
30
- };
31
- },
32
- session: stores.session
33
- };
34
- };
35
-
36
- const page = {
37
- subscribe(fn) {
38
- const store = getStores().page;
39
- return store.subscribe(fn);
40
- }
41
- };
42
-
43
- const navigating = {
44
- subscribe(fn) {
45
- const store = getStores().navigating;
46
- return store.subscribe(fn);
47
- }
48
- };
49
-
50
- const error = (verb) => {
51
- throw new Error(
52
- ssr
53
- ? `Can only ${verb} session store in browser`
54
- : `Cannot ${verb} session store before subscribing`
55
- );
56
- };
57
-
58
- const session = {
59
- subscribe(fn) {
60
- const store = getStores().session;
61
-
62
- if (!ssr) {
63
- session.set = store.set;
64
- session.update = store.update;
65
- }
66
-
67
- return store.subscribe(fn);
68
- },
69
- set: (value) => {
70
- error('set');
71
- },
72
- update: (updater) => {
73
- error('update');
74
- }
75
- };
76
-
77
- export { getStores, navigating, page, session, stores };
78
- //# sourceMappingURL=stores.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stores.js","sources":["../../../src/runtime/app/stores/index.js"],"sourcesContent":["import { getContext } from 'svelte';\n\n// const ssr = (import.meta as any).env.SSR;\nconst ssr = typeof window === 'undefined'; // TODO why doesn't previous line work in build?\n\n// TODO remove this (for 1.0? after 1.0?)\nlet warned = false;\nexport function stores() {\n\tif (!warned) {\n\t\tconsole.error('stores() is deprecated; use getStores() instead');\n\t\twarned = true;\n\t}\n\treturn getStores();\n}\n\nexport const getStores = () => {\n\tconst stores = getContext('__svelte__');\n\n\treturn {\n\t\tpage: {\n\t\t\tsubscribe: stores.page.subscribe\n\t\t},\n\t\tnavigating: {\n\t\t\tsubscribe: stores.navigating.subscribe\n\t\t},\n\t\tget preloading() {\n\t\t\tconsole.error('stores.preloading is deprecated; use stores.navigating instead');\n\t\t\treturn {\n\t\t\t\tsubscribe: stores.navigating.subscribe\n\t\t\t};\n\t\t},\n\t\tsession: stores.session\n\t};\n};\n\nexport const page = {\n\tsubscribe(fn) {\n\t\tconst store = getStores().page;\n\t\treturn store.subscribe(fn);\n\t}\n};\n\nexport const navigating = {\n\tsubscribe(fn) {\n\t\tconst store = getStores().navigating;\n\t\treturn store.subscribe(fn);\n\t}\n};\n\nconst error = (verb) => {\n\tthrow new Error(\n\t\tssr\n\t\t\t? `Can only ${verb} session store in browser`\n\t\t\t: `Cannot ${verb} session store before subscribing`\n\t);\n};\n\nexport const session = {\n\tsubscribe(fn) {\n\t\tconst store = getStores().session;\n\n\t\tif (!ssr) {\n\t\t\tsession.set = store.set;\n\t\t\tsession.update = store.update;\n\t\t}\n\n\t\treturn store.subscribe(fn);\n\t},\n\tset: (value) => {\n\t\terror('set');\n\t},\n\tupdate: (updater) => {\n\t\terror('update');\n\t}\n};\n"],"names":[],"mappings":";;AAEA;AACA,MAAM,GAAG,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