bosia 0.6.25 → 0.7.0
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": "bosia",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A fast, batteries-included fullstack framework — SSR · Svelte 5 Runes · Bun · ElysiaJS. File-based routing inspired by SvelteKit. No Node.js, no Vite, no adapters.",
|
|
6
6
|
"keywords": [
|
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
// `page.url.pathname`. Backed by `router.currentRoute` (`$state` in
|
|
5
5
|
// router.svelte.ts), so the `$derived` URL re-runs on every nav.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// Bosia passes `params` as a prop to `+page.svelte` / `+layout.svelte` (see
|
|
8
|
+
// App.svelte), mirroring the modern SvelteKit `$app/state` direction. Route
|
|
9
|
+
// components should destructure `params` from `$props()`. `page.params` still
|
|
10
|
+
// exists as a deprecated, working fallback (reactive, backed by
|
|
11
|
+
// `appState.routeParams`) so legacy code keeps running — it will be removed in
|
|
12
|
+
// 1.0.0.
|
|
11
13
|
|
|
14
|
+
import { appState } from "./appState.svelte.ts";
|
|
12
15
|
import { router } from "./router.svelte.ts";
|
|
13
16
|
|
|
17
|
+
let paramsWarned = false;
|
|
18
|
+
|
|
14
19
|
class Page {
|
|
15
20
|
#url = $derived.by(() => {
|
|
16
21
|
if (typeof window === "undefined") return new URL("http://localhost/");
|
|
@@ -23,6 +28,21 @@ class Page {
|
|
|
23
28
|
get pathname() {
|
|
24
29
|
return this.#url.pathname;
|
|
25
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Read route params from `$props()` instead:
|
|
34
|
+
* `let { params } = $props()` in `+page.svelte` / `+layout.svelte`.
|
|
35
|
+
* `page.params` is a temporary fallback and will be removed in 1.0.0.
|
|
36
|
+
*/
|
|
37
|
+
get params() {
|
|
38
|
+
if (process.env.NODE_ENV !== "production" && !paramsWarned) {
|
|
39
|
+
paramsWarned = true;
|
|
40
|
+
console.warn(
|
|
41
|
+
"[bosia] page.params is deprecated — destructure `params` from $props() in your route component. It will be removed in 1.0.0.",
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return appState.routeParams;
|
|
45
|
+
}
|
|
26
46
|
}
|
|
27
47
|
|
|
28
48
|
export const page = new Page();
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"features": ["auth", "rbac", "file-upload", "shop"],
|
|
3
3
|
"featureOptions": {
|
|
4
|
-
"drizzle.dialect": "
|
|
5
|
-
"auth.dialect": "
|
|
6
|
-
"rbac.dialect": "
|
|
7
|
-
"file-upload.dialect": "
|
|
8
|
-
"shop.dialect": "
|
|
4
|
+
"drizzle.dialect": "sqlite",
|
|
5
|
+
"auth.dialect": "sqlite",
|
|
6
|
+
"rbac.dialect": "sqlite",
|
|
7
|
+
"file-upload.dialect": "sqlite",
|
|
8
|
+
"shop.dialect": "sqlite"
|
|
9
9
|
}
|
|
10
10
|
}
|