@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.
@@ -76,7 +76,7 @@ class Router {
76
76
  * base: string;
77
77
  * routes: import('types').CSRRoute[];
78
78
  * trailing_slash: import('types').TrailingSlash;
79
- * renderer: import('./renderer').Renderer
79
+ * renderer: import('./renderer').Renderer;
80
80
  * }} opts
81
81
  */
82
82
  constructor({ base, routes, trailing_slash, renderer }) {
@@ -310,8 +310,7 @@ class Router {
310
310
  id: url.pathname + url.search,
311
311
  routes: this.routes.filter(([pattern]) => pattern.test(path)),
312
312
  url,
313
- path,
314
- initial: !this.initialized
313
+ path
315
314
  };
316
315
  }
317
316
  }
@@ -876,6 +875,14 @@ class Renderer {
876
875
  const token = (this.token = {});
877
876
  let navigation_result = await this._get_navigation_result(info, no_cache);
878
877
 
878
+ if (!navigation_result && info.url.pathname === location.pathname) {
879
+ navigation_result = await this._load_error({
880
+ status: 404,
881
+ error: new Error(`Not found: ${info.url.pathname}`),
882
+ url: info.url
883
+ });
884
+ }
885
+
879
886
  if (!navigation_result) {
880
887
  location.href = info.url.href;
881
888
  return;
@@ -1083,14 +1090,6 @@ class Renderer {
1083
1090
  );
1084
1091
  if (result) return result;
1085
1092
  }
1086
-
1087
- if (info.initial) {
1088
- return await this._load_error({
1089
- status: 404,
1090
- error: new Error(`Not found: ${info.url.pathname}`),
1091
- url: info.url
1092
- });
1093
- }
1094
1093
  }
1095
1094
 
1096
1095
  /**
@@ -2543,7 +2543,6 @@ async function respond(request, options, state = {}) {
2543
2543
  request,
2544
2544
  url,
2545
2545
  params: {},
2546
- // @ts-expect-error this picks up types that belong to the tests
2547
2546
  locals: {},
2548
2547
  platform: state.platform
2549
2548
  };
@@ -1,5 +1,5 @@
1
1
  /** @type {import('amphtml-validator').Validator} */
2
- const amp = await (await import('./index8.js').then(function (n) { return n.i; })).getInstance();
2
+ const amp = await (await import('./index7.js').then(function (n) { return n.i; })).getInstance();
3
3
 
4
4
  /** @type {import('types').Handle} */
5
5
  async function handle({ event, resolve }) {
@@ -1,7 +1,7 @@
1
1
  import path__default from 'path';
2
2
  import { svelte } from '@sveltejs/vite-plugin-svelte';
3
3
  import vite from 'vite';
4
- import { c as create_manifest_data, a as create_app, d as deep_merge } from './index2.js';
4
+ import { c as create_manifest_data, a as create_app, g as generate_tsconfig, d as deep_merge } from './tsconfig.js';
5
5
  import { r as runtime, S as SVELTE_KIT_ASSETS, a as resolve_entry, $, b as SVELTE_KIT, l as load_template, c as coalesce_to_error, g as get_mime_lookup, d as copy_assets, e as get_aliases, p as print_config_conflicts } from '../cli.js';
6
6
  import fs__default from 'fs';
7
7
  import { URL } from 'url';
@@ -54,7 +54,7 @@ async function create_plugin(config, cwd) {
54
54
  function update_manifest() {
55
55
  const manifest_data = create_manifest_data({ config, cwd });
56
56
 
57
- create_app({ manifest_data, output: `${SVELTE_KIT}/generated`, cwd });
57
+ create_app({ config, manifest_data, cwd });
58
58
 
59
59
  manifest = {
60
60
  appDir: config.kit.appDir,
@@ -210,7 +210,6 @@ async function create_plugin(config, cwd) {
210
210
 
211
211
  /** @type {import('types').Hooks} */
212
212
  const hooks = {
213
- // @ts-expect-error this picks up types that belong to the tests
214
213
  getSession: user_hooks.getSession || (() => ({})),
215
214
  handle: amp ? sequence(amp, handle) : handle,
216
215
  handleError:
@@ -408,6 +407,8 @@ function find_deps(node, deps) {
408
407
  async function dev({ cwd, port, host, https, config }) {
409
408
  copy_assets(`${SVELTE_KIT}/runtime`);
410
409
 
410
+ generate_tsconfig(config);
411
+
411
412
  const [vite_config] = deep_merge(
412
413
  {
413
414
  server: {