@sveltejs/kit 1.0.0-next.292 → 1.0.0-next.293

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.
@@ -1,6 +1,6 @@
1
1
  import { onMount, tick } from 'svelte';
2
2
  import { writable } from 'svelte/store';
3
- import { base, set_paths } from '../paths.js';
3
+ import { assets, set_paths } from '../paths.js';
4
4
  import Root from '__GENERATED__/root.svelte';
5
5
  import { routes, fallback } from '__GENERATED__/manifest.js';
6
6
  import { init } from './singletons.js';
@@ -198,7 +198,7 @@ function create_updated_store() {
198
198
 
199
199
  const file = import.meta.env.VITE_SVELTEKIT_APP_VERSION_FILE;
200
200
 
201
- const res = await fetch(`${base}/${file}`, {
201
+ const res = await fetch(`${assets}/${file}`, {
202
202
  headers: {
203
203
  pragma: 'no-cache',
204
204
  'cache-control': 'no-cache'
package/dist/cli.js CHANGED
@@ -870,7 +870,7 @@ async function launch(port, https) {
870
870
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
871
871
  }
872
872
 
873
- const prog = sade('svelte-kit').version('1.0.0-next.292');
873
+ const prog = sade('svelte-kit').version('1.0.0-next.293');
874
874
 
875
875
  prog
876
876
  .command('dev')
@@ -1043,7 +1043,7 @@ async function check_port(port) {
1043
1043
  function welcome({ port, host, https, open, loose, allow, cwd }) {
1044
1044
  if (open) launch(port, https);
1045
1045
 
1046
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.292'}\n`));
1046
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.293'}\n`));
1047
1047
 
1048
1048
  const protocol = https ? 'https:' : 'http:';
1049
1049
  const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.292",
3
+ "version": "1.0.0-next.293",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
package/types/index.d.ts CHANGED
@@ -5,27 +5,95 @@ import './ambient';
5
5
 
6
6
  import { CompileOptions } from 'svelte/types/compiler/interfaces';
7
7
  import {
8
+ AdapterEntry,
8
9
  Body,
9
- Builder,
10
10
  CspDirectives,
11
11
  Either,
12
12
  ErrorLoadInput,
13
13
  Fallthrough,
14
14
  LoadInput,
15
15
  LoadOutput,
16
+ Logger,
16
17
  MaybePromise,
18
+ Prerendered,
17
19
  PrerenderOnErrorValue,
18
20
  RequestEvent,
21
+ RequestOptions,
19
22
  ResolveOptions,
20
23
  ResponseHeaders,
24
+ RouteDefinition,
21
25
  TrailingSlash
22
26
  } from './private';
27
+ import { SSRNodeLoader, SSRRoute, ValidatedConfig } from './internal';
23
28
 
24
29
  export interface Adapter {
25
30
  name: string;
26
31
  adapt(builder: Builder): Promise<void>;
27
32
  }
28
33
 
34
+ export interface Builder {
35
+ log: Logger;
36
+ rimraf(dir: string): void;
37
+ mkdirp(dir: string): void;
38
+
39
+ config: ValidatedConfig;
40
+ prerendered: Prerendered;
41
+
42
+ /**
43
+ * Create entry points that map to individual functions
44
+ * @param fn A function that groups a set of routes into an entry point
45
+ */
46
+ createEntries(fn: (route: RouteDefinition) => AdapterEntry): void;
47
+
48
+ generateManifest: (opts: { relativePath: string; format?: 'esm' | 'cjs' }) => string;
49
+
50
+ getBuildDirectory(name: string): string;
51
+ getClientDirectory(): string;
52
+ getServerDirectory(): string;
53
+ getStaticDirectory(): string;
54
+
55
+ /**
56
+ * @param dest the destination folder to which files should be copied
57
+ * @returns an array of paths corresponding to the files that have been created by the copy
58
+ */
59
+ writeClient(dest: string): string[];
60
+ /**
61
+ *
62
+ * @param dest
63
+ */
64
+ writePrerendered(
65
+ dest: string,
66
+ opts?: {
67
+ fallback?: string;
68
+ }
69
+ ): string[];
70
+ /**
71
+ * @param dest the destination folder to which files should be copied
72
+ * @returns an array of paths corresponding to the files that have been created by the copy
73
+ */
74
+ writeServer(dest: string): string[];
75
+ /**
76
+ * @param dest the destination folder to which files should be copied
77
+ * @returns an array of paths corresponding to the files that have been created by the copy
78
+ */
79
+ writeStatic(dest: string): string[];
80
+ /**
81
+ * @param from the source file or folder
82
+ * @param to the destination file or folder
83
+ * @param opts.filter a function to determine whether a file or folder should be copied
84
+ * @param opts.replace a map of strings to replace
85
+ * @returns an array of paths corresponding to the files that have been created by the copy
86
+ */
87
+ copy(
88
+ from: string,
89
+ to: string,
90
+ opts?: {
91
+ filter?: (basename: string) => boolean;
92
+ replace?: Record<string, string>;
93
+ }
94
+ ): string[];
95
+ }
96
+
29
97
  export interface Config {
30
98
  compilerOptions?: CompileOptions;
31
99
  extensions?: string[];
@@ -164,3 +232,24 @@ export type RequestHandlerOutput<Output extends Body = Body> = MaybePromise<
164
232
  Fallthrough
165
233
  >
166
234
  >;
235
+
236
+ export class Server {
237
+ constructor(manifest: SSRManifest);
238
+ respond(request: Request, options?: RequestOptions): Promise<Response>;
239
+ }
240
+
241
+ export interface SSRManifest {
242
+ appDir: string;
243
+ assets: Set<string>;
244
+ /** private fields */
245
+ _: {
246
+ mime: Record<string, string>;
247
+ entry: {
248
+ file: string;
249
+ js: string[];
250
+ css: string[];
251
+ };
252
+ nodes: SSRNodeLoader[];
253
+ routes: SSRRoute[];
254
+ };
255
+ }
@@ -6,7 +6,9 @@ import {
6
6
  Handle,
7
7
  HandleError,
8
8
  Load,
9
- RequestHandler
9
+ RequestHandler,
10
+ Server,
11
+ SSRManifest
10
12
  } from './index';
11
13
  import {
12
14
  Either,
@@ -14,14 +16,11 @@ import {
14
16
  HttpMethod,
15
17
  JSONObject,
16
18
  MaybePromise,
17
- Prerendered,
18
19
  RequestEvent,
19
20
  RequestOptions,
20
21
  ResolveOptions,
21
22
  ResponseHeaders,
22
23
  RouteSegment,
23
- Server,
24
- SSRManifest,
25
24
  TrailingSlash
26
25
  } from './private';
27
26
 
@@ -2,7 +2,7 @@
2
2
  // but which cannot be imported from `@sveltejs/kit`. Care should
3
3
  // be taken to avoid breaking changes when editing this file
4
4
 
5
- import { SSRNodeLoader, SSRRoute, ValidatedConfig } from './internal';
5
+ import { ValidatedConfig } from './internal';
6
6
 
7
7
  export interface AdapterEntry {
8
8
  /**
@@ -30,69 +30,6 @@ export interface AdapterEntry {
30
30
 
31
31
  export type Body = JSONValue | Uint8Array | ReadableStream | import('stream').Readable;
32
32
 
33
- export interface Builder {
34
- log: Logger;
35
- rimraf(dir: string): void;
36
- mkdirp(dir: string): void;
37
-
38
- config: ValidatedConfig;
39
- prerendered: Prerendered;
40
-
41
- /**
42
- * Create entry points that map to individual functions
43
- * @param fn A function that groups a set of routes into an entry point
44
- */
45
- createEntries(fn: (route: RouteDefinition) => AdapterEntry): void;
46
-
47
- generateManifest: (opts: { relativePath: string; format?: 'esm' | 'cjs' }) => string;
48
-
49
- getBuildDirectory(name: string): string;
50
- getClientDirectory(): string;
51
- getServerDirectory(): string;
52
- getStaticDirectory(): string;
53
-
54
- /**
55
- * @param dest the destination folder to which files should be copied
56
- * @returns an array of paths corresponding to the files that have been created by the copy
57
- */
58
- writeClient(dest: string): string[];
59
- /**
60
- *
61
- * @param dest
62
- */
63
- writePrerendered(
64
- dest: string,
65
- opts?: {
66
- fallback?: string;
67
- }
68
- ): string[];
69
- /**
70
- * @param dest the destination folder to which files should be copied
71
- * @returns an array of paths corresponding to the files that have been created by the copy
72
- */
73
- writeServer(dest: string): string[];
74
- /**
75
- * @param dest the destination folder to which files should be copied
76
- * @returns an array of paths corresponding to the files that have been created by the copy
77
- */
78
- writeStatic(dest: string): string[];
79
- /**
80
- * @param from the source file or folder
81
- * @param to the destination file or folder
82
- * @param opts.filter a function to determine whether a file or folder should be copied
83
- * @param opts.replace a map of strings to replace
84
- * @returns an array of paths corresponding to the files that have been created by the copy
85
- */
86
- copy(
87
- from: string,
88
- to: string,
89
- opts?: {
90
- filter?: (basename: string) => boolean;
91
- replace?: Record<string, string>;
92
- }
93
- ): string[];
94
- }
95
-
96
33
  // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts
97
34
  //
98
35
  // MIT License
@@ -329,27 +266,6 @@ export interface RouteSegment {
329
266
  rest: boolean;
330
267
  }
331
268
 
332
- export class Server {
333
- constructor(manifest: SSRManifest);
334
- respond(request: Request, options?: RequestOptions): Promise<Response>;
335
- }
336
-
337
- export interface SSRManifest {
338
- appDir: string;
339
- assets: Set<string>;
340
- /** private fields */
341
- _: {
342
- mime: Record<string, string>;
343
- entry: {
344
- file: string;
345
- js: string[];
346
- css: string[];
347
- };
348
- nodes: SSRNodeLoader[];
349
- routes: SSRRoute[];
350
- };
351
- }
352
-
353
269
  export interface ToJSON {
354
270
  toJSON(...args: any[]): Exclude<JSONValue, ToJSON>;
355
271
  }