@sveltejs/kit 1.0.0-next.304 → 1.0.0-next.305

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.
@@ -833,21 +833,6 @@ function write_types(config, manifest_data) {
833
833
  /** @type {Map<string, { params: string[], type: 'page' | 'endpoint' | 'both' }>} */
834
834
  const shadow_types = new Map();
835
835
 
836
- /** @param {string} key */
837
- function extract_params(key) {
838
- /** @type {string[]} */
839
- const params = [];
840
-
841
- const pattern = /\[(?:\.{3})?([^\]]+)\]/g;
842
- let match;
843
-
844
- while ((match = pattern.exec(key))) {
845
- params.push(match[1]);
846
- }
847
-
848
- return params;
849
- }
850
-
851
836
  manifest_data.routes.forEach((route) => {
852
837
  const file = route.type === 'endpoint' ? route.file : route.shadow;
853
838
 
@@ -857,7 +842,7 @@ function write_types(config, manifest_data) {
857
842
  );
858
843
  const key = file.slice(0, -ext.length);
859
844
  shadow_types.set(key, {
860
- params: extract_params(key),
845
+ params: parse_route_id(key).names,
861
846
  type: route.type === 'endpoint' ? 'endpoint' : 'both'
862
847
  });
863
848
  }
@@ -870,7 +855,7 @@ function write_types(config, manifest_data) {
870
855
  const key = component.slice(0, -ext.length);
871
856
 
872
857
  if (!shadow_types.has(key)) {
873
- shadow_types.set(key, { params: extract_params(key), type: 'page' });
858
+ shadow_types.set(key, { params: parse_route_id(key).names, type: 'page' });
874
859
  }
875
860
  });
876
861
 
package/dist/cli.js CHANGED
@@ -869,7 +869,7 @@ async function launch(port, https) {
869
869
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
870
870
  }
871
871
 
872
- const prog = sade('svelte-kit').version('1.0.0-next.304');
872
+ const prog = sade('svelte-kit').version('1.0.0-next.305');
873
873
 
874
874
  prog
875
875
  .command('dev')
@@ -1047,7 +1047,7 @@ async function check_port(port) {
1047
1047
  function welcome({ port, host, https, open, loose, allow, cwd }) {
1048
1048
  if (open) launch(port, https);
1049
1049
 
1050
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.304'}\n`));
1050
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.305'}\n`));
1051
1051
 
1052
1052
  const protocol = https ? 'https:' : 'http:';
1053
1053
  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.304",
3
+ "version": "1.0.0-next.305",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
package/types/index.d.ts CHANGED
@@ -184,7 +184,7 @@ export interface HandleError {
184
184
  }
185
185
 
186
186
  /**
187
- * The type of a `load` function exported from `<script context="module">` in a page or layout.
187
+ * The `(input: LoadInput) => LoadOutput` `load` function exported from `<script context="module">` in a page or layout.
188
188
  *
189
189
  * Note that you can use [generated types](/docs/types#generated-types) instead of manually specifying the Params generic argument.
190
190
  */
@@ -215,13 +215,9 @@ export interface ParamMatcher {
215
215
  }
216
216
 
217
217
  /**
218
- * A function exported from an endpoint that corresponds to an
219
- * HTTP verb (`get`, `put`, `patch`, etc) and handles requests with
220
- * that method. Note that since 'delete' is a reserved word in
221
- * JavaScript, delete handles are called `del` instead.
218
+ * A `(event: RequestEvent) => RequestHandlerOutput` function exported from an endpoint that corresponds to an HTTP verb (`get`, `put`, `patch`, etc) and handles requests with that method. Note that since 'delete' is a reserved word in JavaScript, delete handles are called `del` instead.
222
219
  *
223
- * Note that you can use [generated types](/docs/types#generated-types)
224
- * instead of manually specifying the `Params` generic argument.
220
+ * Note that you can use [generated types](/docs/types#generated-types) instead of manually specifying the `Params` generic argument.
225
221
  */
226
222
  export interface RequestHandler<
227
223
  Params extends Record<string, string> = Record<string, string>,