@sveltejs/kit 1.0.0-next.544 → 1.0.0-next.545

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.544",
3
+ "version": "1.0.0-next.545",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -19,9 +19,11 @@ export function generate_manifest({ build_data, relative_path, routes, format =
19
19
  */
20
20
  const reindexed = new Map();
21
21
  /**
22
- * @type {Set<any>} All nodes actually used in the routes definition (prerendered routes are omitted)
22
+ * All nodes actually used in the routes definition (prerendered routes are omitted).
23
+ * Root layout/error is always included as they are needed for 404 and root errors.
24
+ * @type {Set<any>}
23
25
  */
24
- const used_nodes = new Set();
26
+ const used_nodes = new Set([0, 1]);
25
27
 
26
28
  for (const route of routes) {
27
29
  if (route.page) {
@@ -5,7 +5,7 @@ import { pathToFileURL } from 'url';
5
5
  import { getRequest, setResponse } from '../../../exports/node/index.js';
6
6
  import { installPolyfills } from '../../../exports/node/polyfills.js';
7
7
  import { SVELTE_KIT_ASSETS } from '../../../constants.js';
8
- import { loadEnv } from 'vite';
8
+ import { loadEnv, normalizePath } from 'vite';
9
9
 
10
10
  /** @typedef {import('http').IncomingMessage} Req */
11
11
  /** @typedef {import('http').ServerResponse} Res */
@@ -100,7 +100,9 @@ export async function preview(vite, vite_config, svelte_config) {
100
100
 
101
101
  const { pathname } = new URL(/** @type {string} */ (req.url), 'http://dummy');
102
102
 
103
- let filename = join(svelte_config.kit.outDir, 'output/prerendered/pages' + pathname);
103
+ let filename = normalizePath(
104
+ join(svelte_config.kit.outDir, 'output/prerendered/pages' + pathname)
105
+ );
104
106
  let prerendered = is_file(filename);
105
107
 
106
108
  if (!prerendered) {
@@ -95,6 +95,8 @@ declare module '$app/environment' {
95
95
  declare module '$app/forms' {
96
96
  import type { ActionResult } from '@sveltejs/kit';
97
97
 
98
+ type MaybePromise<T> = T | Promise<T>;
99
+
98
100
  export type SubmitFunction<
99
101
  Success extends Record<string, unknown> | undefined = Record<string, any>,
100
102
  Invalid extends Record<string, unknown> | undefined = Record<string, any>
@@ -104,7 +106,7 @@ declare module '$app/forms' {
104
106
  form: HTMLFormElement;
105
107
  controller: AbortController;
106
108
  cancel(): void;
107
- }) =>
109
+ }) => MaybePromise<
108
110
  | void
109
111
  | ((opts: {
110
112
  form: HTMLFormElement;
@@ -115,7 +117,8 @@ declare module '$app/forms' {
115
117
  * @param options Set `reset: false` if you don't want the `<form>` values to be reset after a successful submission.
116
118
  */
117
119
  update(options?: { reset: boolean }): Promise<void>;
118
- }) => void);
120
+ }) => void)
121
+ >;
119
122
 
120
123
  /**
121
124
  * This action enhances a `<form>` element that otherwise would work without JavaScript.