@sveltejs/kit 1.0.0-next.40 → 1.0.0-next.402

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.
Files changed (48) hide show
  1. package/README.md +12 -9
  2. package/assets/app/env.js +13 -0
  3. package/assets/app/navigation.js +24 -0
  4. package/assets/app/paths.js +1 -0
  5. package/assets/{runtime/app → app}/stores.js +33 -29
  6. package/assets/client/singletons.js +13 -0
  7. package/assets/client/start.js +1845 -0
  8. package/assets/components/error.svelte +18 -2
  9. package/assets/env/dynamic/private.js +1 -0
  10. package/assets/env/dynamic/public.js +1 -0
  11. package/assets/env-private.js +9 -0
  12. package/assets/env-public.js +9 -0
  13. package/assets/env.js +8 -0
  14. package/assets/{runtime/chunks/paths.js → paths.js} +4 -3
  15. package/assets/server/index.js +3579 -0
  16. package/dist/chunks/error.js +12 -0
  17. package/dist/chunks/filesystem.js +110 -0
  18. package/dist/chunks/index.js +541 -3385
  19. package/dist/chunks/index2.js +15631 -473
  20. package/dist/chunks/index3.js +189 -217
  21. package/dist/chunks/multipart-parser.js +458 -0
  22. package/dist/chunks/sync.js +1366 -0
  23. package/dist/chunks/utils.js +40 -57
  24. package/dist/chunks/write_tsconfig.js +273 -0
  25. package/dist/cli.js +85 -513
  26. package/dist/hooks.js +28 -0
  27. package/dist/node/polyfills.js +17778 -0
  28. package/dist/node.js +348 -0
  29. package/dist/prerender.js +788 -0
  30. package/dist/vite.js +2520 -0
  31. package/package.json +98 -64
  32. package/svelte-kit.js +10 -1
  33. package/types/ambient.d.ts +375 -0
  34. package/types/index.d.ts +298 -0
  35. package/types/internal.d.ts +335 -0
  36. package/types/private.d.ts +235 -0
  37. package/CHANGELOG.md +0 -411
  38. package/assets/runtime/app/env.js +0 -5
  39. package/assets/runtime/app/navigation.js +0 -41
  40. package/assets/runtime/app/paths.js +0 -1
  41. package/assets/runtime/chunks/utils.js +0 -19
  42. package/assets/runtime/internal/singletons.js +0 -23
  43. package/assets/runtime/internal/start.js +0 -770
  44. package/dist/chunks/index4.js +0 -526
  45. package/dist/chunks/index5.js +0 -761
  46. package/dist/chunks/index6.js +0 -322
  47. package/dist/chunks/standard.js +0 -99
  48. package/dist/ssr.js +0 -2523
@@ -1,13 +1,29 @@
1
+ <script context="module">
2
+ /** @type {import('@sveltejs/kit').Load} */
3
+ export function load({ error, status }) {
4
+ return {
5
+ props: { error, status }
6
+ };
7
+ }
8
+ </script>
9
+
1
10
  <script>
11
+ /** @type {number} */
2
12
  export let status;
13
+
14
+ /** @type {Error & {frame?: string} & {loc?: object}} */
3
15
  export let error;
4
16
  </script>
5
17
 
6
18
  <h1>{status}</h1>
7
19
 
8
- <p>{error.message}</p>
20
+ <pre>{error.message}</pre>
9
21
 
10
- <!-- TODO figure out what to do with stacktraces in prod -->
22
+ <!-- TODO figure out what to do with frames/stacktraces in prod -->
23
+ <!-- frame is populated by Svelte in its CompileError and is a Rollup/Vite convention -->
24
+ {#if error.frame}
25
+ <pre>{error.frame}</pre>
26
+ {/if}
11
27
  {#if error.stack}
12
28
  <pre>{error.stack}</pre>
13
29
  {/if}
@@ -0,0 +1 @@
1
+ export { env } from '../../env-private.js';
@@ -0,0 +1 @@
1
+ export { env } from '../../env-public.js';
@@ -0,0 +1,9 @@
1
+ /** @type {App.PrivateEnv} */
2
+ let env = {};
3
+
4
+ /** @type {(environment: Record<string, string>) => void} */
5
+ function set_private_env(environment) {
6
+ env = environment;
7
+ }
8
+
9
+ export { env, set_private_env };
@@ -0,0 +1,9 @@
1
+ /** @type {App.PublicEnv} */
2
+ let env = {};
3
+
4
+ /** @type {(environment: Record<string, string>) => void} */
5
+ function set_public_env(environment) {
6
+ env = environment;
7
+ }
8
+
9
+ export { env, set_public_env };
package/assets/env.js ADDED
@@ -0,0 +1,8 @@
1
+ let prerendering = false;
2
+
3
+ /** @param {boolean} value */
4
+ function set_prerendering(value) {
5
+ prerendering = value;
6
+ }
7
+
8
+ export { prerendering, set_prerendering };
@@ -2,11 +2,12 @@
2
2
  let base = '';
3
3
 
4
4
  /** @type {string} */
5
- let assets = '/.';
5
+ let assets = '';
6
6
 
7
7
  /** @param {{ base: string, assets: string }} paths */
8
8
  function set_paths(paths) {
9
- ({ base, assets } = paths);
9
+ base = paths.base;
10
+ assets = paths.assets || base;
10
11
  }
11
12
 
12
- export { assets as a, base as b, set_paths as s };
13
+ export { assets, base, set_paths };