@sveltejs/kit 1.0.0-next.37 → 1.0.0-next.370

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 (64) hide show
  1. package/README.md +12 -9
  2. package/assets/app/env.js +28 -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 +1796 -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 +3462 -0
  12. package/dist/chunks/_commonjsHelpers.js +3 -0
  13. package/dist/chunks/error.js +661 -0
  14. package/dist/chunks/index.js +15744 -0
  15. package/dist/chunks/index2.js +210 -0
  16. package/dist/chunks/multipart-parser.js +445 -0
  17. package/dist/chunks/sync.js +992 -0
  18. package/dist/chunks/write_tsconfig.js +274 -0
  19. package/dist/cli.js +66 -127
  20. package/dist/hooks.js +28 -0
  21. package/dist/node/polyfills.js +12237 -0
  22. package/dist/node.js +5869 -0
  23. package/dist/vite.js +3167 -0
  24. package/package.json +100 -55
  25. package/types/ambient.d.ts +345 -0
  26. package/types/index.d.ts +292 -0
  27. package/types/internal.d.ts +318 -0
  28. package/types/private.d.ts +235 -0
  29. package/CHANGELOG.md +0 -385
  30. package/assets/runtime/app/navigation.js +0 -23
  31. package/assets/runtime/app/navigation.js.map +0 -1
  32. package/assets/runtime/app/paths.js +0 -2
  33. package/assets/runtime/app/paths.js.map +0 -1
  34. package/assets/runtime/app/stores.js +0 -78
  35. package/assets/runtime/app/stores.js.map +0 -1
  36. package/assets/runtime/internal/singletons.js +0 -15
  37. package/assets/runtime/internal/singletons.js.map +0 -1
  38. package/assets/runtime/internal/start.js +0 -614
  39. package/assets/runtime/internal/start.js.map +0 -1
  40. package/assets/runtime/utils-85ebcc60.js +0 -18
  41. package/assets/runtime/utils-85ebcc60.js.map +0 -1
  42. package/dist/api.js +0 -28
  43. package/dist/api.js.map +0 -1
  44. package/dist/cli.js.map +0 -1
  45. package/dist/create_app.js +0 -502
  46. package/dist/create_app.js.map +0 -1
  47. package/dist/index.js +0 -327
  48. package/dist/index.js.map +0 -1
  49. package/dist/index2.js +0 -3497
  50. package/dist/index2.js.map +0 -1
  51. package/dist/index3.js +0 -295
  52. package/dist/index3.js.map +0 -1
  53. package/dist/index4.js +0 -311
  54. package/dist/index4.js.map +0 -1
  55. package/dist/index5.js +0 -221
  56. package/dist/index5.js.map +0 -1
  57. package/dist/index6.js +0 -732
  58. package/dist/index6.js.map +0 -1
  59. package/dist/renderer.js +0 -2429
  60. package/dist/renderer.js.map +0 -1
  61. package/dist/standard.js +0 -100
  62. package/dist/standard.js.map +0 -1
  63. package/dist/utils.js +0 -61
  64. package/dist/utils.js.map +0 -1
@@ -0,0 +1,235 @@
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
+ export type BodyValidator<T> = {
30
+ [P in keyof T]: T[P] extends { [k: string]: unknown }
31
+ ? BodyValidator<T[P]> // recurse when T[P] is an object
32
+ : T[P] extends BigInt | Function | Symbol
33
+ ? never
34
+ : T[P];
35
+ };
36
+
37
+ // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts
38
+ //
39
+ // MIT License
40
+ //
41
+ // Copyright (c) 2021-present, Joshua Hemphill
42
+ // Copyright (c) 2021, Tecnico Corporation
43
+ //
44
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
45
+ // of this software and associated documentation files (the "Software"), to deal
46
+ // in the Software without restriction, including without limitation the rights
47
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
+ // copies of the Software, and to permit persons to whom the Software is
49
+ // furnished to do so, subject to the following conditions:
50
+ //
51
+ // The above copyright notice and this permission notice shall be included in all
52
+ // copies or substantial portions of the Software.
53
+ //
54
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
+ // SOFTWARE.
61
+
62
+ export namespace Csp {
63
+ type ActionSource = 'strict-dynamic' | 'report-sample';
64
+ type BaseSource = 'self' | 'unsafe-eval' | 'unsafe-hashes' | 'unsafe-inline' | 'none';
65
+ type CryptoSource = `${'nonce' | 'sha256' | 'sha384' | 'sha512'}-${string}`;
66
+ type FrameSource = HostSource | SchemeSource | 'self' | 'none';
67
+ type HostNameScheme = `${string}.${string}` | 'localhost';
68
+ type HostSource = `${HostProtocolSchemes}${HostNameScheme}${PortScheme}`;
69
+ type HostProtocolSchemes = `${string}://` | '';
70
+ type HttpDelineator = '/' | '?' | '#' | '\\';
71
+ type PortScheme = `:${number}` | '' | ':*';
72
+ type SchemeSource = 'http:' | 'https:' | 'data:' | 'mediastream:' | 'blob:' | 'filesystem:';
73
+ type Source = HostSource | SchemeSource | CryptoSource | BaseSource;
74
+ type Sources = Source[];
75
+ type UriPath = `${HttpDelineator}${string}`;
76
+ }
77
+
78
+ export interface CspDirectives {
79
+ 'child-src'?: Csp.Sources;
80
+ 'default-src'?: Array<Csp.Source | Csp.ActionSource>;
81
+ 'frame-src'?: Csp.Sources;
82
+ 'worker-src'?: Csp.Sources;
83
+ 'connect-src'?: Csp.Sources;
84
+ 'font-src'?: Csp.Sources;
85
+ 'img-src'?: Csp.Sources;
86
+ 'manifest-src'?: Csp.Sources;
87
+ 'media-src'?: Csp.Sources;
88
+ 'object-src'?: Csp.Sources;
89
+ 'prefetch-src'?: Csp.Sources;
90
+ 'script-src'?: Array<Csp.Source | Csp.ActionSource>;
91
+ 'script-src-elem'?: Csp.Sources;
92
+ 'script-src-attr'?: Csp.Sources;
93
+ 'style-src'?: Array<Csp.Source | Csp.ActionSource>;
94
+ 'style-src-elem'?: Csp.Sources;
95
+ 'style-src-attr'?: Csp.Sources;
96
+ 'base-uri'?: Array<Csp.Source | Csp.ActionSource>;
97
+ sandbox?: Array<
98
+ | 'allow-downloads-without-user-activation'
99
+ | 'allow-forms'
100
+ | 'allow-modals'
101
+ | 'allow-orientation-lock'
102
+ | 'allow-pointer-lock'
103
+ | 'allow-popups'
104
+ | 'allow-popups-to-escape-sandbox'
105
+ | 'allow-presentation'
106
+ | 'allow-same-origin'
107
+ | 'allow-scripts'
108
+ | 'allow-storage-access-by-user-activation'
109
+ | 'allow-top-navigation'
110
+ | 'allow-top-navigation-by-user-activation'
111
+ >;
112
+ 'form-action'?: Array<Csp.Source | Csp.ActionSource>;
113
+ 'frame-ancestors'?: Array<Csp.HostSource | Csp.SchemeSource | Csp.FrameSource>;
114
+ 'navigate-to'?: Array<Csp.Source | Csp.ActionSource>;
115
+ 'report-uri'?: Csp.UriPath[];
116
+ 'report-to'?: string[];
117
+
118
+ 'require-trusted-types-for'?: Array<'script'>;
119
+ 'trusted-types'?: Array<'none' | 'allow-duplicates' | '*' | string>;
120
+ 'upgrade-insecure-requests'?: boolean;
121
+
122
+ /** @deprecated */
123
+ 'require-sri-for'?: Array<'script' | 'style' | 'script style'>;
124
+
125
+ /** @deprecated */
126
+ 'block-all-mixed-content'?: boolean;
127
+
128
+ /** @deprecated */
129
+ 'plugin-types'?: Array<`${string}/${string}` | 'none'>;
130
+
131
+ /** @deprecated */
132
+ referrer?: Array<
133
+ | 'no-referrer'
134
+ | 'no-referrer-when-downgrade'
135
+ | 'origin'
136
+ | 'origin-when-cross-origin'
137
+ | 'same-origin'
138
+ | 'strict-origin'
139
+ | 'strict-origin-when-cross-origin'
140
+ | 'unsafe-url'
141
+ | 'none'
142
+ >;
143
+ }
144
+
145
+ export type HttpMethod = 'get' | 'head' | 'post' | 'put' | 'delete' | 'patch';
146
+
147
+ export interface JSONObject {
148
+ [key: string]: JSONValue;
149
+ }
150
+
151
+ export type JSONValue =
152
+ | string
153
+ | number
154
+ | boolean
155
+ | null
156
+ | undefined
157
+ | ToJSON
158
+ | JSONValue[]
159
+ | JSONObject;
160
+
161
+ export interface Logger {
162
+ (msg: string): void;
163
+ success(msg: string): void;
164
+ error(msg: string): void;
165
+ warn(msg: string): void;
166
+ minor(msg: string): void;
167
+ info(msg: string): void;
168
+ }
169
+
170
+ export type MaybePromise<T> = T | Promise<T>;
171
+
172
+ export interface Prerendered {
173
+ pages: Map<
174
+ string,
175
+ {
176
+ /** The location of the .html file relative to the output directory */
177
+ file: string;
178
+ }
179
+ >;
180
+ assets: Map<
181
+ string,
182
+ {
183
+ /** The MIME type of the asset */
184
+ type: string;
185
+ }
186
+ >;
187
+ redirects: Map<
188
+ string,
189
+ {
190
+ status: number;
191
+ location: string;
192
+ }
193
+ >;
194
+ /** An array of prerendered paths (without trailing slashes, regardless of the trailingSlash config) */
195
+ paths: string[];
196
+ }
197
+
198
+ export interface PrerenderErrorHandler {
199
+ (details: {
200
+ status: number;
201
+ path: string;
202
+ referrer: string | null;
203
+ referenceType: 'linked' | 'fetched';
204
+ }): void;
205
+ }
206
+
207
+ export type PrerenderOnErrorValue = 'fail' | 'continue' | PrerenderErrorHandler;
208
+
209
+ export interface RequestOptions {
210
+ getClientAddress: () => string;
211
+ platform?: App.Platform;
212
+ }
213
+
214
+ /** `string[]` is only for set-cookie, everything else must be type of `string` */
215
+ export type ResponseHeaders = Record<string, string | number | string[]>;
216
+
217
+ export interface RouteDefinition {
218
+ id: string;
219
+ type: 'page' | 'endpoint';
220
+ pattern: RegExp;
221
+ segments: RouteSegment[];
222
+ methods: HttpMethod[];
223
+ }
224
+
225
+ export interface RouteSegment {
226
+ content: string;
227
+ dynamic: boolean;
228
+ rest: boolean;
229
+ }
230
+
231
+ export interface ToJSON {
232
+ toJSON(...args: any[]): Exclude<JSONValue, ToJSON>;
233
+ }
234
+
235
+ export type TrailingSlash = 'never' | 'always' | 'ignore';
package/CHANGELOG.md DELETED
@@ -1,385 +0,0 @@
1
- # @sveltejs/kit
2
-
3
- ## 1.0.0-next.37
4
-
5
- ### Patch Changes
6
-
7
- - 230c6d9: Indicate which request failed, if fetch fails inside load function
8
- - f1bc218: Run adapt via svelte-kit build
9
- - 6850ddc: Fix svelte-kit start for Windows
10
-
11
- ## 1.0.0-next.36
12
-
13
- ### Patch Changes
14
-
15
- - 7b70a33: Force version bump so that Kit uses updated vite-plugin-svelte
16
-
17
- ## 1.0.0-next.35
18
-
19
- ### Patch Changes
20
-
21
- - Use Vite
22
- - Fix Windows issues
23
- - Preserve load context during navigation
24
- - Return error from load
25
-
26
- ## 1.0.0-next.34
27
-
28
- ### Patch Changes
29
-
30
- - Fix adapters and convert to ES modules
31
-
32
- ## 1.0.0-next.33
33
-
34
- ### Patch Changes
35
-
36
- - 474070e: Better errors when modules cannot be found
37
-
38
- ## 1.0.0-next.32
39
-
40
- ### Patch Changes
41
-
42
- - Convert everything to ESM
43
-
44
- ## 1.0.0-next.31
45
-
46
- ### Patch Changes
47
-
48
- - b6c2434: app.js -> app.cjs
49
-
50
- ## 1.0.0-next.30
51
-
52
- ### Patch Changes
53
-
54
- - 00cbaf6: Rename _.config.js to _.config.cjs
55
-
56
- ## 1.0.0-next.29
57
-
58
- ### Patch Changes
59
-
60
- - 4c0edce: Use addEventListener instead of onload
61
-
62
- ## 1.0.0-next.28
63
-
64
- ### Patch Changes
65
-
66
- - 4353025: Prevent infinite loop when fetching bad URLs inside error responses
67
- - 2860065: Handle assets path when prerendering
68
-
69
- ## 1.0.0-next.27
70
-
71
- ### Patch Changes
72
-
73
- - Fail build if prerender errors
74
- - Hide logging behind --verbose option
75
-
76
- ## 1.0.0-next.26
77
-
78
- ### Patch Changes
79
-
80
- - Fix svelte-announcer CSS
81
-
82
- ## 1.0.0-next.25
83
-
84
- ### Patch Changes
85
-
86
- - Surface stack traces for endpoint/page rendering errors
87
-
88
- ## 1.0.0-next.24
89
-
90
- ### Patch Changes
91
-
92
- - 26643df: Account for config.paths when prerendering
93
-
94
- ## 1.0.0-next.23
95
-
96
- ### Patch Changes
97
-
98
- - 9b758aa: Upgrade to Snowpack 3
99
-
100
- ## 1.0.0-next.22
101
-
102
- ### Patch Changes
103
-
104
- - bb68595: use readFileSync instead of createReadStream
105
-
106
- ## 1.0.0-next.21
107
-
108
- ### Patch Changes
109
-
110
- - 217e4cc: Set paths to empty string before prerender
111
-
112
- ## 1.0.0-next.20
113
-
114
- ### Patch Changes
115
-
116
- - ccf4aa7: Implement prerender config
117
-
118
- ## 1.0.0-next.19
119
-
120
- ### Patch Changes
121
-
122
- - deda984: Make navigating store contain from and to properties
123
-
124
- ## 1.0.0-next.18
125
-
126
- ### Patch Changes
127
-
128
- - c29b61e: Announce page changes
129
- - 72da270: Reset focus properly
130
-
131
- ## 1.0.0-next.17
132
-
133
- ### Patch Changes
134
-
135
- - f7dea55: Set process.env.NODE_ENV when invoking via the CLI
136
-
137
- ## 1.0.0-next.16
138
-
139
- ### Patch Changes
140
-
141
- - Remove temporary logging
142
- - Add sveltekit:prefetch and sveltekit:noscroll
143
-
144
- ## 1.0.0-next.15
145
-
146
- ### Patch Changes
147
-
148
- - 6d1bb11: Fix AMP CSS
149
- - d8b53af: Ignore $layout and $error files when finding static paths
150
- - Better scroll tracking
151
-
152
- ## 1.0.0-next.14
153
-
154
- ### Patch Changes
155
-
156
- - Fix dev loader
157
-
158
- ## 1.0.0-next.13
159
-
160
- ### Patch Changes
161
-
162
- - 1ea4d6b: More robust CSS extraction
163
-
164
- ## 1.0.0-next.12
165
-
166
- ### Patch Changes
167
-
168
- - e7c88dd: Tweak AMP validation screen
169
-
170
- ## 1.0.0-next.11
171
-
172
- ### Patch Changes
173
-
174
- - a31f218: Fix SSR loader invalidation
175
-
176
- ## 1.0.0-next.10
177
-
178
- ### Patch Changes
179
-
180
- - 8b14d29: Omit svelte-data scripts from AMP pages
181
-
182
- ## 1.0.0-next.9
183
-
184
- ### Patch Changes
185
-
186
- - f5fa223: AMP support
187
- - 47f2ee1: Always remove trailing slashes
188
- - 1becb94: Replace preload with load
189
-
190
- ## 1.0.0-next.8
191
-
192
- ### Patch Changes
193
-
194
- - 15dd751: Use meta http-equiv=refresh
195
- - be7e031: Fix handling of static files
196
- - ed6b8fd: Implement \$app/env
197
-
198
- ## 1.0.0-next.7
199
-
200
- ### Patch Changes
201
-
202
- - 76705b0: make HMR work outside localhost
203
-
204
- ## 1.0.0-next.6
205
-
206
- ### Patch Changes
207
-
208
- - 0e45255: Move options behind kit namespace, change paths -> kit.files
209
- - fa7f2b2: Implement live bindings for SSR code
210
-
211
- ## 1.0.0-next.5
212
-
213
- ### Patch Changes
214
-
215
- - Return dependencies from render
216
-
217
- ## 1.0.0-next.4
218
-
219
- ### Patch Changes
220
-
221
- - af01b0d: Move renderer out of app assets folder
222
-
223
- ## 1.0.0-next.3
224
-
225
- ### Patch Changes
226
-
227
- - Add paths to manifest, for static prerendering
228
-
229
- ## 1.0.0-next.2
230
-
231
- ### Patch Changes
232
-
233
- - Fix typo causing misnamed assets folder
234
-
235
- ## 1.0.0-next.1
236
-
237
- ### Patch Changes
238
-
239
- - a4bc090: Transform exported functions correctly
240
- - 00bbf98: Fix nested layouts
241
-
242
- ## 0.0.31-next.0
243
-
244
- ### Patch Changes
245
-
246
- - ffd7bba: Fix SSR cache invalidation
247
-
248
- ## 0.0.30
249
-
250
- ### Patch Changes
251
-
252
- - Add back stores(), but with deprecation warning
253
- - Rename stores.preloading to stores.navigating
254
- - Rewrite routing logic
255
-
256
- ## 0.0.29
257
-
258
- ### Patch Changes
259
-
260
- - 10872cc: Normalize request.query
261
-
262
- ## 0.0.28
263
-
264
- ### Patch Changes
265
-
266
- - Add svelte-kit start command
267
-
268
- ## 0.0.27
269
-
270
- ### Patch Changes
271
-
272
- - rename CLI to svelte-kit
273
- - 0904e22: rename svelte CLI to svelte-kit
274
- - Validate route responses
275
- - Make paths and target configurable
276
-
277
- ## 0.0.26
278
-
279
- ### Patch Changes
280
-
281
- - b475ed4: Overhaul adapter API - fixes #166
282
- - Updated dependencies [b475ed4]
283
- - @sveltejs/app-utils@0.0.18
284
-
285
- ## 0.0.25
286
-
287
- ### Patch Changes
288
-
289
- - Updated dependencies [3bdf33b]
290
- - @sveltejs/app-utils@0.0.17
291
-
292
- ## 0.0.24
293
-
294
- ### Patch Changes
295
-
296
- - 67eaeea: Move app-utils stuff into subpackages
297
- - 7f8df30: Move kit runtime code, expose via \$app aliases
298
- - Updated dependencies [67eaeea]
299
- - @sveltejs/app-utils@0.0.16
300
-
301
- ## 0.0.23
302
-
303
- ### Patch Changes
304
-
305
- - a163000: Parse body on incoming requests
306
- - a346eab: Copy over latest Sapper router code
307
- - Updated dependencies [a163000]
308
- - @sveltejs/app-utils@0.0.15
309
-
310
- ## 0.0.22
311
-
312
- ### Patch Changes
313
-
314
- - Force bump version
315
-
316
- ## 0.0.21
317
-
318
- ### Patch Changes
319
-
320
- - Build setup entry point
321
- - Work around pkg.exports constraint
322
- - Respond with 500s if render fails
323
- - Updated dependencies [undefined]
324
- - Updated dependencies [undefined]
325
- - Updated dependencies [undefined]
326
- - @sveltejs/app-utils@0.0.14
327
-
328
- ## 0.0.20
329
-
330
- ### Patch Changes
331
-
332
- - Pass setup module to renderer
333
- - Bump Snowpack version
334
- - Updated dependencies [undefined]
335
- - Updated dependencies [96c06d8]
336
- - @sveltejs/app-utils@0.0.13
337
-
338
- ## 0.0.19
339
-
340
- ### Patch Changes
341
-
342
- - fa9d7ce: Handle import.meta in SSR module loader
343
- - 0320208: Rename 'server route' to 'endpoint'
344
- - b9444d2: Update to Snowpack 2.15
345
- - 5ca907c: Use shared mkdirp helper
346
- - Updated dependencies [0320208]
347
- - Updated dependencies [5ca907c]
348
- - @sveltejs/app-utils@0.0.12
349
-
350
- ## 0.0.18
351
-
352
- ### Patch Changes
353
-
354
- - Updated dependencies [undefined]
355
- - @sveltejs/app-utils@0.0.11
356
-
357
- ## 0.0.17
358
-
359
- ### Patch Changes
360
-
361
- - 19323e9: Update Snowpack
362
- - Updated dependencies [19323e9]
363
- - @sveltejs/app-utils@0.0.10
364
-
365
- ## 0.0.16
366
-
367
- ### Patch Changes
368
-
369
- - Updated dependencies [90a98ae]
370
- - @sveltejs/app-utils@0.0.9
371
-
372
- ## 0.0.15
373
-
374
- ### Patch Changes
375
-
376
- - Updated dependencies [undefined]
377
- - @sveltejs/app-utils@0.0.8
378
-
379
- ## 0.0.14
380
-
381
- ### Patch Changes
382
-
383
- - various
384
- - Updated dependencies [undefined]
385
- - @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":""}