@sveltejs/kit 1.0.0-next.288 → 1.0.0-next.289

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/dist/cli.js CHANGED
@@ -998,7 +998,7 @@ async function launch(port, https) {
998
998
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
999
999
  }
1000
1000
 
1001
- const prog = sade('svelte-kit').version('1.0.0-next.288');
1001
+ const prog = sade('svelte-kit').version('1.0.0-next.289');
1002
1002
 
1003
1003
  prog
1004
1004
  .command('dev')
@@ -1050,7 +1050,7 @@ prog
1050
1050
  process.env.NODE_ENV = process.env.NODE_ENV || 'production';
1051
1051
  const config = await load_config();
1052
1052
 
1053
- const { build } = await import('./chunks/index3.js');
1053
+ const { build } = await import('./chunks/index2.js');
1054
1054
  const build_data = await build(config);
1055
1055
 
1056
1056
  console.log(
@@ -1058,7 +1058,7 @@ prog
1058
1058
  );
1059
1059
 
1060
1060
  if (config.kit.adapter) {
1061
- const { adapt } = await import('./chunks/index5.js');
1061
+ const { adapt } = await import('./chunks/index4.js');
1062
1062
  await adapt(config, build_data, { verbose });
1063
1063
 
1064
1064
  // this is necessary to close any open db connections, etc
@@ -1093,7 +1093,7 @@ prog
1093
1093
  process.env.NODE_ENV = process.env.NODE_ENV || 'production';
1094
1094
  const config = await load_config();
1095
1095
 
1096
- const { preview } = await import('./chunks/index6.js');
1096
+ const { preview } = await import('./chunks/index5.js');
1097
1097
 
1098
1098
  await preview({ port, host, config, https });
1099
1099
 
@@ -1111,7 +1111,7 @@ prog
1111
1111
  try {
1112
1112
  const config = await load_config();
1113
1113
 
1114
- const { make_package } = await import('./chunks/index7.js');
1114
+ const { make_package } = await import('./chunks/index6.js');
1115
1115
 
1116
1116
  await make_package(config);
1117
1117
  } catch (error) {
@@ -1156,7 +1156,7 @@ async function check_port(port) {
1156
1156
  function welcome({ port, host, https, open, loose, allow, cwd }) {
1157
1157
  if (open) launch(port, https);
1158
1158
 
1159
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.288'}\n`));
1159
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.289'}\n`));
1160
1160
 
1161
1161
  const protocol = https ? 'https:' : 'http:';
1162
1162
  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.288",
3
+ "version": "1.0.0-next.289",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -79,7 +79,15 @@
79
79
  "build": "rollup -c && node scripts/cp.js src/runtime/components assets/components && npm run types",
80
80
  "dev": "rollup -cw",
81
81
  "lint": "eslint --ignore-path .gitignore --ignore-pattern \"src/packaging/test/**\" \"{src,test}/**/*.{ts,mjs,js,svelte}\" && npm run check-format",
82
- "check": "tsc && svelte-check --ignore test/prerendering,src/packaging/test",
82
+ "check": "tsc && npm run check:integration && npm run check:prerendering",
83
+ "check:integration": "npm run check:integration:amp && npm run check:integration:basics && npm run check:integration:options && npm run check:integration:options-2",
84
+ "check:integration:amp": "cd test/apps/amp && pnpm check",
85
+ "check:integration:basics": "cd test/apps/basics && pnpm check",
86
+ "check:integration:options": "cd test/apps/options && pnpm check",
87
+ "check:integration:options-2": "cd test/apps/options-2 && pnpm check",
88
+ "check:prerendering": "npm run check:prerendering:basics && npm run check:prerendering:options",
89
+ "check:prerendering:basics": "cd test/prerendering/basics && pnpm check",
90
+ "check:prerendering:options": "cd test/prerendering/options && pnpm check",
83
91
  "format": "npm run check-format -- --write",
84
92
  "check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
85
93
  "test": "npm run test:unit && npm run test:typings && npm run test:packaging && npm run test:prerendering && npm run test:integration",
package/types/index.d.ts CHANGED
@@ -110,10 +110,20 @@ export interface HandleError {
110
110
  (input: { error: Error & { frame?: string }; event: RequestEvent }): void;
111
111
  }
112
112
 
113
+ /**
114
+ * The type of a `load` function exported from `<script context="module">` in a page or layout.
115
+ *
116
+ * Note that you can use [generated types](/docs/types#generated-types) instead of manually specifying the Params generic argument.
117
+ */
113
118
  export interface Load<Params = Record<string, string>, Props = Record<string, any>> {
114
119
  (input: LoadInput<Params>): MaybePromise<Either<Fallthrough, LoadOutput<Props>>>;
115
120
  }
116
121
 
122
+ export interface Navigation {
123
+ from: URL;
124
+ to: URL;
125
+ }
126
+
117
127
  export interface Page<Params extends Record<string, string> = Record<string, string>> {
118
128
  url: URL;
119
129
  params: Params;
@@ -122,16 +132,14 @@ export interface Page<Params extends Record<string, string> = Record<string, str
122
132
  error: Error | null;
123
133
  }
124
134
 
125
- export interface Navigation {
126
- from: URL;
127
- to: URL;
128
- }
129
-
130
135
  /**
131
136
  * A function exported from an endpoint that corresponds to an
132
137
  * HTTP verb (`get`, `put`, `patch`, etc) and handles requests with
133
138
  * that method. Note that since 'delete' is a reserved word in
134
139
  * JavaScript, delete handles are called `del` instead.
140
+ *
141
+ * Note that you can use [generated types](/docs/types#generated)
142
+ * instead of manually specifying the `Params` generic argument.
135
143
  */
136
144
  export interface RequestHandler<Params = Record<string, string>, Output extends Body = Body> {
137
145
  (event: RequestEvent<Params>): RequestHandlerOutput<Output>;
@@ -1,12 +1,12 @@
1
1
  import { OutputAsset, OutputChunk } from 'rollup';
2
2
  import {
3
- RequestHandler,
4
- Load,
3
+ Config,
5
4
  ExternalFetch,
6
5
  GetSession,
7
6
  Handle,
8
7
  HandleError,
9
- Config
8
+ Load,
9
+ RequestHandler
10
10
  } from './index';
11
11
  import {
12
12
  Either,
@@ -139,6 +139,10 @@ export interface PageData {
139
139
  b: string[];
140
140
  }
141
141
 
142
+ export type PayloadScriptAttributes =
143
+ | { type: 'data'; url: string; body?: string }
144
+ | { type: 'props' };
145
+
142
146
  export interface PrerenderDependency {
143
147
  response: Response;
144
148
  body: null | string | Uint8Array;
@@ -126,7 +126,7 @@ export namespace Csp {
126
126
  type UriPath = `${HttpDelineator}${string}`;
127
127
  }
128
128
 
129
- export type CspDirectives = {
129
+ export interface CspDirectives {
130
130
  'child-src'?: Csp.Sources;
131
131
  'default-src'?: Array<Csp.Source | Csp.ActionSource>;
132
132
  'frame-src'?: Csp.Sources;
@@ -191,7 +191,7 @@ export type CspDirectives = {
191
191
  | 'unsafe-url'
192
192
  | 'none'
193
193
  >;
194
- };
194
+ }
195
195
 
196
196
  export type Either<T, U> = Only<T, U> | Only<U, T>;
197
197
 
@@ -206,7 +206,9 @@ export interface Fallthrough {
206
206
 
207
207
  export type HttpMethod = 'get' | 'head' | 'post' | 'put' | 'delete' | 'patch';
208
208
 
209
- export type JSONObject = { [key: string]: JSONValue };
209
+ export interface JSONObject {
210
+ [key: string]: JSONValue;
211
+ }
210
212
 
211
213
  export type JSONValue =
212
214
  | string
@@ -249,12 +251,6 @@ export type MaybePromise<T> = T | Promise<T>;
249
251
 
250
252
  export type Only<T, U> = { [P in keyof T]: T[P] } & { [P in Exclude<keyof U, keyof T>]?: never };
251
253
 
252
- export type PayloadScriptAttributes = PayloadScriptAttributesData | PayloadScriptAttributesProps;
253
-
254
- type PayloadScriptAttributesData = { type: 'data'; url: string; body?: string };
255
-
256
- type PayloadScriptAttributesProps = { type: 'props' };
257
-
258
254
  export interface Prerendered {
259
255
  pages: Map<
260
256
  string,
@@ -304,10 +300,10 @@ export interface RequestOptions {
304
300
  platform?: App.Platform;
305
301
  }
306
302
 
307
- export type ResolveOptions = {
303
+ export interface ResolveOptions {
308
304
  ssr?: boolean;
309
305
  transformPage?: ({ html }: { html: string }) => MaybePromise<string>;
310
- };
306
+ }
311
307
 
312
308
  /** `string[]` is only for set-cookie, everything else must be type of `string` */
313
309
  export type ResponseHeaders = Record<string, string | number | string[]>;
@@ -346,6 +342,8 @@ export interface SSRManifest {
346
342
  };
347
343
  }
348
344
 
349
- export type ToJSON = { toJSON(...args: any[]): Exclude<JSONValue, ToJSON> };
345
+ export interface ToJSON {
346
+ toJSON(...args: any[]): Exclude<JSONValue, ToJSON>;
347
+ }
350
348
 
351
349
  export type TrailingSlash = 'never' | 'always' | 'ignore';