@sveltejs/kit 1.0.0-next.22 → 1.0.0-next.223

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 (82) hide show
  1. package/README.md +12 -9
  2. package/assets/components/error.svelte +19 -3
  3. package/assets/kit.js +1996 -0
  4. package/assets/runtime/app/env.js +20 -0
  5. package/assets/runtime/app/navigation.js +55 -13
  6. package/assets/runtime/app/paths.js +1 -2
  7. package/assets/runtime/app/stores.js +19 -15
  8. package/assets/runtime/chunks/utils.js +13 -0
  9. package/assets/runtime/env.js +8 -0
  10. package/assets/runtime/internal/singletons.js +12 -9
  11. package/assets/runtime/internal/start.js +1015 -354
  12. package/assets/runtime/paths.js +13 -0
  13. package/dist/chunks/cert.js +29255 -0
  14. package/dist/chunks/constants.js +8 -0
  15. package/dist/chunks/error.js +12 -0
  16. package/dist/chunks/index.js +476 -0
  17. package/dist/chunks/index2.js +817 -0
  18. package/dist/chunks/index3.js +640 -0
  19. package/dist/chunks/index4.js +109 -0
  20. package/dist/chunks/index5.js +635 -0
  21. package/dist/chunks/index6.js +827 -0
  22. package/dist/chunks/index7.js +15575 -0
  23. package/dist/chunks/index8.js +4207 -0
  24. package/dist/chunks/misc.js +3 -0
  25. package/dist/chunks/multipart-parser.js +449 -0
  26. package/dist/chunks/url.js +62 -0
  27. package/dist/cli.js +996 -83
  28. package/dist/hooks.js +28 -0
  29. package/dist/install-fetch.js +6514 -0
  30. package/dist/node.js +51 -0
  31. package/dist/ssr.js +1926 -0
  32. package/package.json +96 -54
  33. package/svelte-kit.js +2 -0
  34. package/types/ambient-modules.d.ts +191 -0
  35. package/types/app.d.ts +45 -0
  36. package/types/config.d.ts +168 -0
  37. package/types/endpoint.d.ts +20 -0
  38. package/types/helper.d.ts +53 -0
  39. package/types/hooks.d.ts +55 -0
  40. package/types/index.d.ts +18 -0
  41. package/types/internal.d.ts +237 -0
  42. package/types/page.d.ts +73 -0
  43. package/CHANGELOG.md +0 -288
  44. package/assets/runtime/app/navigation.js.map +0 -1
  45. package/assets/runtime/app/paths.js.map +0 -1
  46. package/assets/runtime/app/stores.js.map +0 -1
  47. package/assets/runtime/internal/singletons.js.map +0 -1
  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 -44
  52. package/dist/api.js.map +0 -1
  53. package/dist/build.js +0 -246
  54. package/dist/build.js.map +0 -1
  55. package/dist/cli.js.map +0 -1
  56. package/dist/colors.js +0 -37
  57. package/dist/colors.js.map +0 -1
  58. package/dist/create_app.js +0 -578
  59. package/dist/create_app.js.map +0 -1
  60. package/dist/index.js +0 -12042
  61. package/dist/index.js.map +0 -1
  62. package/dist/index2.js +0 -544
  63. package/dist/index2.js.map +0 -1
  64. package/dist/index3.js +0 -71
  65. package/dist/index3.js.map +0 -1
  66. package/dist/index4.js +0 -466
  67. package/dist/index4.js.map +0 -1
  68. package/dist/index5.js +0 -729
  69. package/dist/index5.js.map +0 -1
  70. package/dist/index6.js +0 -730
  71. package/dist/index6.js.map +0 -1
  72. package/dist/logging.js +0 -43
  73. package/dist/logging.js.map +0 -1
  74. package/dist/package.js +0 -432
  75. package/dist/package.js.map +0 -1
  76. package/dist/renderer.js +0 -2391
  77. package/dist/renderer.js.map +0 -1
  78. package/dist/standard.js +0 -101
  79. package/dist/standard.js.map +0 -1
  80. package/dist/utils.js +0 -54
  81. package/dist/utils.js.map +0 -1
  82. package/svelte-kit +0 -3
@@ -0,0 +1,55 @@
1
+ import { ParameterizedBody, RawBody } from './app';
2
+ import { MaybePromise, RequestHeaders, ResponseHeaders } from './helper';
3
+
4
+ export type StrictBody = string | Uint8Array;
5
+
6
+ export interface ServerRequest<Locals = Record<string, any>, Body = unknown> {
7
+ url: URL;
8
+ method: string;
9
+ headers: RequestHeaders;
10
+ rawBody: RawBody;
11
+ params: Record<string, string>;
12
+ body: ParameterizedBody<Body>;
13
+ locals: Locals;
14
+ }
15
+
16
+ export interface ServerResponse {
17
+ status: number;
18
+ headers: Partial<ResponseHeaders>;
19
+ body?: StrictBody;
20
+ }
21
+
22
+ export interface GetSession<Locals = Record<string, any>, Body = unknown, Session = any> {
23
+ (request: ServerRequest<Locals, Body>): MaybePromise<Session>;
24
+ }
25
+
26
+ export interface ResolveOpts {
27
+ ssr?: boolean;
28
+ }
29
+
30
+ export interface Handle<Locals = Record<string, any>, Body = unknown> {
31
+ (input: {
32
+ request: ServerRequest<Locals, Body>;
33
+ resolve(request: ServerRequest<Locals, Body>, opts?: ResolveOpts): MaybePromise<ServerResponse>;
34
+ }): MaybePromise<ServerResponse>;
35
+ }
36
+
37
+ // internally, `resolve` could return `undefined`, so we differentiate InternalHandle
38
+ // from the public Handle type
39
+ export interface InternalHandle<Locals = Record<string, any>, Body = unknown> {
40
+ (input: {
41
+ request: ServerRequest<Locals, Body>;
42
+ resolve(
43
+ request: ServerRequest<Locals, Body>,
44
+ opts?: ResolveOpts
45
+ ): MaybePromise<ServerResponse | undefined>;
46
+ }): MaybePromise<ServerResponse | undefined>;
47
+ }
48
+
49
+ export interface HandleError<Locals = Record<string, any>, Body = unknown> {
50
+ (input: { error: Error & { frame?: string }; request: ServerRequest<Locals, Body> }): void;
51
+ }
52
+
53
+ export interface ExternalFetch {
54
+ (req: Request): Promise<Response>;
55
+ }
@@ -0,0 +1,18 @@
1
+ /// <reference types="svelte" />
2
+ /// <reference types="vite/client" />
3
+
4
+ import './ambient-modules';
5
+
6
+ export { App, IncomingRequest, RawBody, SSRManifest } from './app';
7
+ export { Adapter, Builder, Config, PrerenderErrorHandler, ValidatedConfig } from './config';
8
+ export { EndpointOutput, RequestHandler } from './endpoint';
9
+ export { ErrorLoad, ErrorLoadInput, Load, LoadInput, LoadOutput } from './page';
10
+ export {
11
+ ExternalFetch,
12
+ GetSession,
13
+ Handle,
14
+ HandleError,
15
+ ServerRequest as Request,
16
+ ServerResponse as Response,
17
+ ResolveOpts
18
+ } from './hooks';
@@ -0,0 +1,237 @@
1
+ import { OutputAsset, OutputChunk } from 'rollup';
2
+ import { RequestHandler } from './endpoint';
3
+ import { InternalApp, SSRManifest } from './app';
4
+ import {
5
+ ExternalFetch,
6
+ GetSession,
7
+ HandleError,
8
+ InternalHandle,
9
+ ServerRequest,
10
+ ServerResponse
11
+ } from './hooks';
12
+ import { Load } from './page';
13
+ import { Either, Fallthrough } from './helper';
14
+
15
+ type PageId = string;
16
+
17
+ export interface PrerenderOptions {
18
+ fallback?: string;
19
+ all: boolean;
20
+ dependencies: Map<string, ServerResponse>;
21
+ }
22
+
23
+ export interface AppModule {
24
+ App: typeof InternalApp;
25
+
26
+ override(options: {
27
+ paths: {
28
+ base: string;
29
+ assets: string;
30
+ };
31
+ prerendering: boolean;
32
+ protocol?: 'http' | 'https';
33
+ read(file: string): Buffer;
34
+ }): void;
35
+ }
36
+
37
+ export interface Logger {
38
+ (msg: string): void;
39
+ success(msg: string): void;
40
+ error(msg: string): void;
41
+ warn(msg: string): void;
42
+ minor(msg: string): void;
43
+ info(msg: string): void;
44
+ }
45
+
46
+ export interface SSRComponent {
47
+ router?: boolean;
48
+ hydrate?: boolean;
49
+ prerender?: boolean;
50
+ load: Load;
51
+ default: {
52
+ render(props: Record<string, any>): {
53
+ html: string;
54
+ head: string;
55
+ css: {
56
+ code: string;
57
+ map: any; // TODO
58
+ };
59
+ };
60
+ };
61
+ }
62
+
63
+ export type SSRComponentLoader = () => Promise<SSRComponent>;
64
+
65
+ export type CSRComponent = any; // TODO
66
+
67
+ export type CSRComponentLoader = () => Promise<CSRComponent>;
68
+
69
+ export interface SSRPagePart {
70
+ id: string;
71
+ load: SSRComponentLoader;
72
+ }
73
+
74
+ export type GetParams = (match: RegExpExecArray) => Record<string, string>;
75
+
76
+ export interface SSRPage {
77
+ type: 'page';
78
+ pattern: RegExp;
79
+ params: GetParams;
80
+ /**
81
+ * plan a is to render 1 or more layout components followed by a leaf component.
82
+ */
83
+ a: number[];
84
+ /**
85
+ * plan b — if one of them components fails in `load` we backtrack until we find
86
+ * the nearest error component.
87
+ */
88
+ b: number[];
89
+ }
90
+
91
+ export interface SSREndpoint {
92
+ type: 'endpoint';
93
+ pattern: RegExp;
94
+ params: GetParams;
95
+ load(): Promise<{
96
+ [method: string]: RequestHandler;
97
+ }>;
98
+ }
99
+
100
+ export type SSRRoute = SSREndpoint | SSRPage;
101
+
102
+ export type CSRRoute = [RegExp, CSRComponentLoader[], CSRComponentLoader[], GetParams?];
103
+
104
+ export type SSRNodeLoader = () => Promise<SSRNode>;
105
+
106
+ export interface Hooks {
107
+ externalFetch: ExternalFetch;
108
+ getSession: GetSession;
109
+ handle: InternalHandle;
110
+ handleError: HandleError;
111
+ }
112
+
113
+ export interface SSRNode {
114
+ module: SSRComponent;
115
+ /** client-side module URL for this component */
116
+ entry: string;
117
+ /** external CSS files */
118
+ css: string[];
119
+ /** external JS files */
120
+ js: string[];
121
+ /** inlined styles */
122
+ styles: string[];
123
+ }
124
+
125
+ export interface SSRRenderOptions {
126
+ amp: boolean;
127
+ dev: boolean;
128
+ floc: boolean;
129
+ get_stack: (error: Error) => string | undefined;
130
+ handle_error(error: Error & { frame?: string }, request: ServerRequest<any>): void;
131
+ hooks: Hooks;
132
+ hydrate: boolean;
133
+ manifest: SSRManifest;
134
+ method_override: MethodOverride;
135
+ paths: {
136
+ base: string;
137
+ assets: string;
138
+ };
139
+ prefix: string;
140
+ prerender: boolean;
141
+ read(file: string): Buffer;
142
+ root: SSRComponent['default'];
143
+ router: boolean;
144
+ service_worker?: string;
145
+ target: string;
146
+ template({ head, body, assets }: { head: string; body: string; assets: string }): string;
147
+ trailing_slash: TrailingSlash;
148
+ }
149
+
150
+ export interface SSRRenderState {
151
+ fetched?: string;
152
+ initiator?: SSRPage | null;
153
+ prerender?: PrerenderOptions;
154
+ fallback?: string;
155
+ }
156
+
157
+ export interface Asset {
158
+ file: string;
159
+ size: number;
160
+ type: string | null;
161
+ }
162
+
163
+ export interface RouteSegment {
164
+ content: string;
165
+ dynamic: boolean;
166
+ rest: boolean;
167
+ }
168
+
169
+ export type HttpMethod = 'get' | 'head' | 'post' | 'put' | 'delete' | 'patch';
170
+
171
+ export interface PageData {
172
+ type: 'page';
173
+ segments: RouteSegment[];
174
+ pattern: RegExp;
175
+ params: string[];
176
+ path: string;
177
+ a: string[];
178
+ b: string[];
179
+ }
180
+
181
+ export interface EndpointData {
182
+ type: 'endpoint';
183
+ segments: RouteSegment[];
184
+ pattern: RegExp;
185
+ params: string[];
186
+ file: string;
187
+ }
188
+
189
+ export type RouteData = PageData | EndpointData;
190
+
191
+ export interface ManifestData {
192
+ assets: Asset[];
193
+ layout: string;
194
+ error: string;
195
+ components: string[];
196
+ routes: RouteData[];
197
+ }
198
+
199
+ export interface BuildData {
200
+ app_dir: string;
201
+ manifest_data: ManifestData;
202
+ client: {
203
+ assets: OutputAsset[];
204
+ chunks: OutputChunk[];
205
+ entry: {
206
+ file: string;
207
+ js: string[];
208
+ css: string[];
209
+ };
210
+ vite_manifest: import('vite').Manifest;
211
+ };
212
+ server: {
213
+ chunks: OutputChunk[];
214
+ methods: Record<string, HttpMethod[]>;
215
+ vite_manifest: import('vite').Manifest;
216
+ };
217
+ static: string[];
218
+ entries: string[];
219
+ }
220
+
221
+ export type NormalizedLoadOutput = Either<
222
+ {
223
+ status: number;
224
+ error?: Error;
225
+ redirect?: string;
226
+ props?: Record<string, any> | Promise<Record<string, any>>;
227
+ stuff?: Record<string, any>;
228
+ maxage?: number;
229
+ },
230
+ Fallthrough
231
+ >;
232
+
233
+ export type TrailingSlash = 'never' | 'always' | 'ignore';
234
+ export interface MethodOverride {
235
+ parameter: string;
236
+ allowed: string[];
237
+ }
@@ -0,0 +1,73 @@
1
+ import { InferValue, MaybePromise, Rec, Either, Fallthrough } from './helper';
2
+
3
+ export interface LoadInput<
4
+ PageParams extends Rec<string> = Rec<string>,
5
+ Stuff extends Rec = Rec,
6
+ Session = any
7
+ > {
8
+ url: URL;
9
+ params: PageParams;
10
+ fetch(info: RequestInfo, init?: RequestInit): Promise<Response>;
11
+ session: Session;
12
+ stuff: Stuff;
13
+ }
14
+
15
+ export interface ErrorLoadInput<
16
+ PageParams extends Rec<string> = Rec<string>,
17
+ Stuff extends Rec = Rec,
18
+ Session = any
19
+ > extends LoadInput<PageParams, Stuff, Session> {
20
+ status?: number;
21
+ error?: Error;
22
+ }
23
+
24
+ export interface LoadOutput<Props extends Rec = Rec, Stuff extends Rec = Rec> {
25
+ status?: number;
26
+ error?: string | Error;
27
+ redirect?: string;
28
+ props?: Props;
29
+ stuff?: Stuff;
30
+ maxage?: number;
31
+ }
32
+
33
+ interface LoadInputExtends {
34
+ stuff?: Rec;
35
+ pageParams?: Rec<string>;
36
+ session?: any;
37
+ }
38
+
39
+ interface LoadOutputExtends {
40
+ stuff?: Rec;
41
+ props?: Rec;
42
+ }
43
+
44
+ export interface Load<
45
+ Input extends LoadInputExtends = Required<LoadInputExtends>,
46
+ Output extends LoadOutputExtends = Required<LoadOutputExtends>
47
+ > {
48
+ (
49
+ input: LoadInput<
50
+ InferValue<Input, 'pageParams', Rec<string>>,
51
+ InferValue<Input, 'stuff', Rec>,
52
+ InferValue<Input, 'session', any>
53
+ >
54
+ ): MaybePromise<
55
+ Either<
56
+ LoadOutput<InferValue<Output, 'props', Rec>, InferValue<Output, 'stuff', Rec>>,
57
+ Fallthrough
58
+ >
59
+ >;
60
+ }
61
+
62
+ export interface ErrorLoad<
63
+ Input extends LoadInputExtends = Required<LoadInputExtends>,
64
+ Output extends LoadOutputExtends = Required<LoadOutputExtends>
65
+ > {
66
+ (
67
+ input: ErrorLoadInput<
68
+ InferValue<Input, 'pageParams', Rec<string>>,
69
+ InferValue<Input, 'stuff', Rec>,
70
+ InferValue<Input, 'session', any>
71
+ >
72
+ ): MaybePromise<LoadOutput<InferValue<Output, 'props', Rec>, InferValue<Output, 'stuff', Rec>>>;
73
+ }
package/CHANGELOG.md DELETED
@@ -1,288 +0,0 @@
1
- # @sveltejs/kit
2
-
3
- ## 1.0.0-next.22
4
-
5
- ### Patch Changes
6
-
7
- - bb68595: use readFileSync instead of createReadStream
8
-
9
- ## 1.0.0-next.21
10
-
11
- ### Patch Changes
12
-
13
- - 217e4cc: Set paths to empty string before prerender
14
-
15
- ## 1.0.0-next.20
16
-
17
- ### Patch Changes
18
-
19
- - ccf4aa7: Implement prerender config
20
-
21
- ## 1.0.0-next.19
22
-
23
- ### Patch Changes
24
-
25
- - deda984: Make navigating store contain from and to properties
26
-
27
- ## 1.0.0-next.18
28
-
29
- ### Patch Changes
30
-
31
- - c29b61e: Announce page changes
32
- - 72da270: Reset focus properly
33
-
34
- ## 1.0.0-next.17
35
-
36
- ### Patch Changes
37
-
38
- - f7dea55: Set process.env.NODE_ENV when invoking via the CLI
39
-
40
- ## 1.0.0-next.16
41
-
42
- ### Patch Changes
43
-
44
- - Remove temporary logging
45
- - Add sveltekit:prefetch and sveltekit:noscroll
46
-
47
- ## 1.0.0-next.15
48
-
49
- ### Patch Changes
50
-
51
- - 6d1bb11: Fix AMP CSS
52
- - d8b53af: Ignore $layout and $error files when finding static paths
53
- - Better scroll tracking
54
-
55
- ## 1.0.0-next.14
56
-
57
- ### Patch Changes
58
-
59
- - Fix dev loader
60
-
61
- ## 1.0.0-next.13
62
-
63
- ### Patch Changes
64
-
65
- - 1ea4d6b: More robust CSS extraction
66
-
67
- ## 1.0.0-next.12
68
-
69
- ### Patch Changes
70
-
71
- - e7c88dd: Tweak AMP validation screen
72
-
73
- ## 1.0.0-next.11
74
-
75
- ### Patch Changes
76
-
77
- - a31f218: Fix SSR loader invalidation
78
-
79
- ## 1.0.0-next.10
80
-
81
- ### Patch Changes
82
-
83
- - 8b14d29: Omit svelte-data scripts from AMP pages
84
-
85
- ## 1.0.0-next.9
86
-
87
- ### Patch Changes
88
-
89
- - f5fa223: AMP support
90
- - 47f2ee1: Always remove trailing slashes
91
- - 1becb94: Replace preload with load
92
-
93
- ## 1.0.0-next.8
94
-
95
- ### Patch Changes
96
-
97
- - 15dd751: Use meta http-equiv=refresh
98
- - be7e031: Fix handling of static files
99
- - ed6b8fd: Implement \$app/env
100
-
101
- ## 1.0.0-next.7
102
-
103
- ### Patch Changes
104
-
105
- - 76705b0: make HMR work outside localhost
106
-
107
- ## 1.0.0-next.6
108
-
109
- ### Patch Changes
110
-
111
- - 0e45255: Move options behind kit namespace, change paths -> kit.files
112
- - fa7f2b2: Implement live bindings for SSR code
113
-
114
- ## 1.0.0-next.5
115
-
116
- ### Patch Changes
117
-
118
- - Return dependencies from render
119
-
120
- ## 1.0.0-next.4
121
-
122
- ### Patch Changes
123
-
124
- - af01b0d: Move renderer out of app assets folder
125
-
126
- ## 1.0.0-next.3
127
-
128
- ### Patch Changes
129
-
130
- - Add paths to manifest, for static prerendering
131
-
132
- ## 1.0.0-next.2
133
-
134
- ### Patch Changes
135
-
136
- - Fix typo causing misnamed assets folder
137
-
138
- ## 1.0.0-next.1
139
-
140
- ### Patch Changes
141
-
142
- - a4bc090: Transform exported functions correctly
143
- - 00bbf98: Fix nested layouts
144
-
145
- ## 0.0.31-next.0
146
-
147
- ### Patch Changes
148
-
149
- - ffd7bba: Fix SSR cache invalidation
150
-
151
- ## 0.0.30
152
-
153
- ### Patch Changes
154
-
155
- - Add back stores(), but with deprecation warning
156
- - Rename stores.preloading to stores.navigating
157
- - Rewrite routing logic
158
-
159
- ## 0.0.29
160
-
161
- ### Patch Changes
162
-
163
- - 10872cc: Normalize request.query
164
-
165
- ## 0.0.28
166
-
167
- ### Patch Changes
168
-
169
- - Add svelte-kit start command
170
-
171
- ## 0.0.27
172
-
173
- ### Patch Changes
174
-
175
- - rename CLI to svelte-kit
176
- - 0904e22: rename svelte CLI to svelte-kit
177
- - Validate route responses
178
- - Make paths and target configurable
179
-
180
- ## 0.0.26
181
-
182
- ### Patch Changes
183
-
184
- - b475ed4: Overhaul adapter API - fixes #166
185
- - Updated dependencies [b475ed4]
186
- - @sveltejs/app-utils@0.0.18
187
-
188
- ## 0.0.25
189
-
190
- ### Patch Changes
191
-
192
- - Updated dependencies [3bdf33b]
193
- - @sveltejs/app-utils@0.0.17
194
-
195
- ## 0.0.24
196
-
197
- ### Patch Changes
198
-
199
- - 67eaeea: Move app-utils stuff into subpackages
200
- - 7f8df30: Move kit runtime code, expose via \$app aliases
201
- - Updated dependencies [67eaeea]
202
- - @sveltejs/app-utils@0.0.16
203
-
204
- ## 0.0.23
205
-
206
- ### Patch Changes
207
-
208
- - a163000: Parse body on incoming requests
209
- - a346eab: Copy over latest Sapper router code
210
- - Updated dependencies [a163000]
211
- - @sveltejs/app-utils@0.0.15
212
-
213
- ## 0.0.22
214
-
215
- ### Patch Changes
216
-
217
- - Force bump version
218
-
219
- ## 0.0.21
220
-
221
- ### Patch Changes
222
-
223
- - Build setup entry point
224
- - Work around pkg.exports constraint
225
- - Respond with 500s if render fails
226
- - Updated dependencies [undefined]
227
- - Updated dependencies [undefined]
228
- - Updated dependencies [undefined]
229
- - @sveltejs/app-utils@0.0.14
230
-
231
- ## 0.0.20
232
-
233
- ### Patch Changes
234
-
235
- - Pass setup module to renderer
236
- - Bump Snowpack version
237
- - Updated dependencies [undefined]
238
- - Updated dependencies [96c06d8]
239
- - @sveltejs/app-utils@0.0.13
240
-
241
- ## 0.0.19
242
-
243
- ### Patch Changes
244
-
245
- - fa9d7ce: Handle import.meta in SSR module loader
246
- - 0320208: Rename 'server route' to 'endpoint'
247
- - b9444d2: Update to Snowpack 2.15
248
- - 5ca907c: Use shared mkdirp helper
249
- - Updated dependencies [0320208]
250
- - Updated dependencies [5ca907c]
251
- - @sveltejs/app-utils@0.0.12
252
-
253
- ## 0.0.18
254
-
255
- ### Patch Changes
256
-
257
- - Updated dependencies [undefined]
258
- - @sveltejs/app-utils@0.0.11
259
-
260
- ## 0.0.17
261
-
262
- ### Patch Changes
263
-
264
- - 19323e9: Update Snowpack
265
- - Updated dependencies [19323e9]
266
- - @sveltejs/app-utils@0.0.10
267
-
268
- ## 0.0.16
269
-
270
- ### Patch Changes
271
-
272
- - Updated dependencies [90a98ae]
273
- - @sveltejs/app-utils@0.0.9
274
-
275
- ## 0.0.15
276
-
277
- ### Patch Changes
278
-
279
- - Updated dependencies [undefined]
280
- - @sveltejs/app-utils@0.0.8
281
-
282
- ## 0.0.14
283
-
284
- ### Patch Changes
285
-
286
- - various
287
- - Updated dependencies [undefined]
288
- - @sveltejs/app-utils@0.0.7
@@ -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 +0,0 @@
1
- {"version":3,"file":"paths.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -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,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AAC1C;AACA;AACA,IAAI,MAAM,GAAG,KAAK,CAAC;AACZ,SAAS,MAAM,GAAG;AACzB,CAAC,IAAI,CAAC,MAAM,EAAE;AACd,EAAE,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACnE,EAAE,MAAM,GAAG,IAAI,CAAC;AAChB,EAAE;AACF,CAAC,OAAO,SAAS,EAAE,CAAC;AACpB,CAAC;AACD;AACY,MAAC,SAAS,GAAG,MAAM;AAC/B,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AACzC;AACA,CAAC,OAAO;AACR,EAAE,IAAI,EAAE;AACR,GAAG,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;AACnC,GAAG;AACH,EAAE,UAAU,EAAE;AACd,GAAG,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;AACzC,GAAG;AACH,EAAE,IAAI,UAAU,GAAG;AACnB,GAAG,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;AACnF,GAAG,OAAO;AACV,IAAI,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;AAC1C,IAAI,CAAC;AACL,GAAG;AACH,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO;AACzB,EAAE,CAAC;AACH,EAAE;AACF;AACY,MAAC,IAAI,GAAG;AACpB,CAAC,SAAS,CAAC,EAAE,EAAE;AACf,EAAE,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC;AACjC,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC7B,EAAE;AACF,EAAE;AACF;AACY,MAAC,UAAU,GAAG;AAC1B,CAAC,SAAS,CAAC,EAAE,EAAE;AACf,EAAE,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,UAAU,CAAC;AACvC,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC7B,EAAE;AACF,EAAE;AACF;AACA,MAAM,KAAK,GAAG,CAAC,IAAI,KAAK;AACxB,CAAC,MAAM,IAAI,KAAK;AAChB,EAAE,GAAG;AACL,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,CAAC;AAChD,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,iCAAiC,CAAC;AACtD,EAAE,CAAC;AACH,CAAC,CAAC;AACF;AACY,MAAC,OAAO,GAAG;AACvB,CAAC,SAAS,CAAC,EAAE,EAAE;AACf,EAAE,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC;AACpC;AACA,EAAE,IAAI,CAAC,GAAG,EAAE;AACZ,GAAG,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;AAC3B,GAAG,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AACjC,GAAG;AACH;AACA,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC7B,EAAE;AACF,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK;AACjB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;AACf,EAAE;AACF,CAAC,MAAM,EAAE,CAAC,OAAO,KAAK;AACtB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClB,EAAE;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"singletons.js","sources":["../../../src/runtime/internal/singletons.js"],"sourcesContent":["export let router;\nexport let renderer;\nexport let base;\nexport let assets;\n\nexport function init(opts) {\n\t({ router, renderer } = opts);\n}\n\nexport function set_paths(paths) {\n\t({ base, assets } = paths);\n}\n"],"names":[],"mappings":"AAAU,IAAC,OAAO;AACR,IAAC,SAAS;AACV,IAAC,KAAK;AACN,IAAC,OAAO;AAClB;AACO,SAAS,IAAI,CAAC,IAAI,EAAE;AAC3B,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE;AAC/B,CAAC;AACD;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE;AAC5B;;;;"}