@sveltejs/kit 1.0.0-next.35 → 1.0.0-next.352
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/README.md +12 -9
- package/assets/app/env.js +16 -0
- package/assets/app/navigation.js +24 -0
- package/assets/app/paths.js +1 -0
- package/assets/app/stores.js +97 -0
- package/assets/client/singletons.js +13 -0
- package/assets/client/start.js +1787 -0
- package/assets/components/error.svelte +18 -2
- package/assets/env.js +8 -0
- package/assets/paths.js +13 -0
- package/assets/server/index.js +3380 -0
- package/dist/chunks/constants.js +663 -0
- package/dist/chunks/filesystem.js +110 -0
- package/dist/chunks/index.js +1363 -0
- package/dist/chunks/index2.js +120 -0
- package/dist/chunks/index3.js +183 -0
- package/dist/chunks/index4.js +215 -0
- package/dist/chunks/index5.js +15748 -0
- package/dist/chunks/misc.js +78 -0
- package/dist/chunks/multipart-parser.js +444 -0
- package/dist/chunks/object.js +83 -0
- package/dist/chunks/plugin.js +558 -0
- package/dist/chunks/sync.js +856 -0
- package/dist/chunks/write_tsconfig.js +169 -0
- package/dist/cli.js +1028 -87
- package/dist/hooks.js +28 -0
- package/dist/node/polyfills.js +6654 -0
- package/dist/node.js +301 -0
- package/package.json +95 -55
- package/types/ambient.d.ts +307 -0
- package/types/index.d.ts +294 -0
- package/types/internal.d.ts +326 -0
- package/types/private.d.ts +235 -0
- package/CHANGELOG.md +0 -371
- package/assets/runtime/app/navigation.js +0 -23
- package/assets/runtime/app/navigation.js.map +0 -1
- package/assets/runtime/app/paths.js +0 -2
- package/assets/runtime/app/paths.js.map +0 -1
- package/assets/runtime/app/stores.js +0 -78
- package/assets/runtime/app/stores.js.map +0 -1
- package/assets/runtime/internal/singletons.js +0 -15
- package/assets/runtime/internal/singletons.js.map +0 -1
- package/assets/runtime/internal/start.js +0 -614
- package/assets/runtime/internal/start.js.map +0 -1
- package/assets/runtime/utils-85ebcc60.js +0 -18
- package/assets/runtime/utils-85ebcc60.js.map +0 -1
- package/dist/api.js +0 -28
- package/dist/api.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/create_app.js +0 -502
- package/dist/create_app.js.map +0 -1
- package/dist/index.js +0 -327
- package/dist/index.js.map +0 -1
- package/dist/index2.js +0 -3497
- package/dist/index2.js.map +0 -1
- package/dist/index3.js +0 -296
- package/dist/index3.js.map +0 -1
- package/dist/index4.js +0 -311
- package/dist/index4.js.map +0 -1
- package/dist/index5.js +0 -221
- package/dist/index5.js.map +0 -1
- package/dist/index6.js +0 -730
- package/dist/index6.js.map +0 -1
- package/dist/renderer.js +0 -2429
- package/dist/renderer.js.map +0 -1
- package/dist/standard.js +0 -100
- package/dist/standard.js.map +0 -1
- package/dist/utils.js +0 -61
- package/dist/utils.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# The fastest way to build Svelte apps
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is the [SvelteKit](https://kit.svelte.dev) framework and CLI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The quickest way to get started is via the [create-svelte](https://github.com/sveltejs/kit/tree/master/packages/create-svelte) package:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm init svelte my-app
|
|
9
|
+
cd my-app
|
|
10
|
+
npm install
|
|
11
|
+
npm run dev
|
|
12
|
+
```
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
See the [documentation](https://kit.svelte.dev/docs) to learn more.
|
|
10
15
|
|
|
11
|
-
##
|
|
16
|
+
## Changelog
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Then, clone the corresponding [svelte-app-demo](https://github.com/sveltejs/svelte-app-demo) repo and follow the instructions therein.
|
|
18
|
+
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { prerendering } from '../env.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type {import('$app/env').browser}
|
|
5
|
+
*/
|
|
6
|
+
const browser = !import.meta.env.SSR;
|
|
7
|
+
/**
|
|
8
|
+
* @type {import('$app/env').dev}
|
|
9
|
+
*/
|
|
10
|
+
const dev = !!import.meta.env.DEV;
|
|
11
|
+
/**
|
|
12
|
+
* @type {import('$app/env').mode}
|
|
13
|
+
*/
|
|
14
|
+
const mode = import.meta.env.MODE;
|
|
15
|
+
|
|
16
|
+
export { browser, dev, mode };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { client } from '../client/singletons.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} name
|
|
5
|
+
*/
|
|
6
|
+
function guard(name) {
|
|
7
|
+
return () => {
|
|
8
|
+
throw new Error(`Cannot call ${name}(...) on the server`);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const ssr = import.meta.env.SSR;
|
|
13
|
+
|
|
14
|
+
const disableScrollHandling = ssr
|
|
15
|
+
? guard('disableScrollHandling')
|
|
16
|
+
: client.disable_scroll_handling;
|
|
17
|
+
const goto = ssr ? guard('goto') : client.goto;
|
|
18
|
+
const invalidate = ssr ? guard('invalidate') : client.invalidate;
|
|
19
|
+
const prefetch = ssr ? guard('prefetch') : client.prefetch;
|
|
20
|
+
const prefetchRoutes = ssr ? guard('prefetchRoutes') : client.prefetch_routes;
|
|
21
|
+
const beforeNavigate = ssr ? () => {} : client.before_navigate;
|
|
22
|
+
const afterNavigate = ssr ? () => {} : client.after_navigate;
|
|
23
|
+
|
|
24
|
+
export { afterNavigate, beforeNavigate, disableScrollHandling, goto, invalidate, prefetch, prefetchRoutes };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { assets, base } from '../paths.js';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { getContext } from 'svelte';
|
|
2
|
+
import { browser } from './env.js';
|
|
3
|
+
import '../env.js';
|
|
4
|
+
|
|
5
|
+
// TODO remove this (for 1.0? after 1.0?)
|
|
6
|
+
let warned = false;
|
|
7
|
+
function stores() {
|
|
8
|
+
if (!warned) {
|
|
9
|
+
console.error('stores() is deprecated; use getStores() instead');
|
|
10
|
+
warned = true;
|
|
11
|
+
}
|
|
12
|
+
return getStores();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @type {import('$app/stores').getStores}
|
|
17
|
+
*/
|
|
18
|
+
const getStores = () => {
|
|
19
|
+
const stores = getContext('__svelte__');
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
page: {
|
|
23
|
+
subscribe: stores.page.subscribe
|
|
24
|
+
},
|
|
25
|
+
navigating: {
|
|
26
|
+
subscribe: stores.navigating.subscribe
|
|
27
|
+
},
|
|
28
|
+
// TODO remove this (for 1.0? after 1.0?)
|
|
29
|
+
// @ts-expect-error - deprecated, not part of type definitions, but still callable
|
|
30
|
+
get preloading() {
|
|
31
|
+
console.error('stores.preloading is deprecated; use stores.navigating instead');
|
|
32
|
+
return {
|
|
33
|
+
subscribe: stores.navigating.subscribe
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
session: stores.session,
|
|
37
|
+
updated: stores.updated
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @type {typeof import('$app/stores').page} */
|
|
42
|
+
const page = {
|
|
43
|
+
/** @param {(value: any) => void} fn */
|
|
44
|
+
subscribe(fn) {
|
|
45
|
+
const store = getStores().page;
|
|
46
|
+
return store.subscribe(fn);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @type {typeof import('$app/stores').navigating} */
|
|
51
|
+
const navigating = {
|
|
52
|
+
subscribe(fn) {
|
|
53
|
+
const store = getStores().navigating;
|
|
54
|
+
return store.subscribe(fn);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @param {string} verb */
|
|
59
|
+
const throw_error = (verb) => {
|
|
60
|
+
throw new Error(
|
|
61
|
+
browser
|
|
62
|
+
? `Cannot ${verb} session store before subscribing`
|
|
63
|
+
: `Can only ${verb} session store in browser`
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @type {typeof import('$app/stores').session} */
|
|
68
|
+
const session = {
|
|
69
|
+
subscribe(fn) {
|
|
70
|
+
const store = getStores().session;
|
|
71
|
+
|
|
72
|
+
if (browser) {
|
|
73
|
+
session.set = store.set;
|
|
74
|
+
session.update = store.update;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return store.subscribe(fn);
|
|
78
|
+
},
|
|
79
|
+
set: () => throw_error('set'),
|
|
80
|
+
update: () => throw_error('update')
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @type {typeof import('$app/stores').updated} */
|
|
84
|
+
const updated = {
|
|
85
|
+
subscribe(fn) {
|
|
86
|
+
const store = getStores().updated;
|
|
87
|
+
|
|
88
|
+
if (browser) {
|
|
89
|
+
updated.check = store.check;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return store.subscribe(fn);
|
|
93
|
+
},
|
|
94
|
+
check: () => throw_error('check')
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { getStores, navigating, page, session, stores, updated };
|