@poveste/app 0.19.0 → 0.19.1
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/dist/bundled/router.js +15 -12
- package/package.json +4 -4
- package/src/app/router.ts +26 -15
package/dist/bundled/router.js
CHANGED
|
@@ -8,17 +8,20 @@ function createRouterHistory() {
|
|
|
8
8
|
default: return createWebHistory(base);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
11
|
+
function newRouter() {
|
|
12
|
+
return createRouter({
|
|
13
|
+
history: createRouterHistory(),
|
|
14
|
+
routes: [{
|
|
15
|
+
path: "/",
|
|
16
|
+
name: "home",
|
|
17
|
+
component: () => import("./components/HomeView.js")
|
|
18
|
+
}, {
|
|
19
|
+
path: "/story/:storyId",
|
|
20
|
+
name: "story",
|
|
21
|
+
component: () => import("./components/story/StoryView.js")
|
|
22
|
+
}]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
var router = import.meta.hot ? import.meta.hot.data.router ??= newRouter() : newRouter();
|
|
23
26
|
//#endregion
|
|
24
27
|
export { base, router };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poveste/app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.1",
|
|
5
5
|
"description": "Pre-bundled UI for Poveste",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Sorin Gitlan",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"node": ">=22.22.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@poveste/controls": "^0.19.
|
|
40
|
-
"@poveste/shared": "^0.19.
|
|
41
|
-
"@poveste/vendors": "^0.19.
|
|
39
|
+
"@poveste/controls": "^0.19.1",
|
|
40
|
+
"@poveste/shared": "^0.19.1",
|
|
41
|
+
"@poveste/vendors": "^0.19.1",
|
|
42
42
|
"fuse.js": "^7.0.0",
|
|
43
43
|
"shiki": "^4.4.3"
|
|
44
44
|
},
|
package/src/app/router.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Router } from 'vue-router'
|
|
1
2
|
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
|
|
2
3
|
import { povesteConfig } from './util/config'
|
|
3
4
|
|
|
@@ -12,18 +13,28 @@ function createRouterHistory() {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
function newRouter(): Router {
|
|
17
|
+
return createRouter({
|
|
18
|
+
history: createRouterHistory(),
|
|
19
|
+
routes: [
|
|
20
|
+
{
|
|
21
|
+
path: '/',
|
|
22
|
+
name: 'home',
|
|
23
|
+
component: () => import('./components/HomeView.vue'),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: '/story/:storyId',
|
|
27
|
+
name: 'story',
|
|
28
|
+
component: () => import('./components/story/StoryView.vue'),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// A page in `poveste dev` can hold two copies of this module: each importer's
|
|
35
|
+
// URL is stamped when the server serves it, and a story edit stamps most of the
|
|
36
|
+
// chrome. Every copy hands out the router the app installed, or the story store
|
|
37
|
+
// read one still at `/` and the page showed no story until reloaded (#1320).
|
|
38
|
+
export const router: Router = import.meta.hot
|
|
39
|
+
? (import.meta.hot.data.router ??= newRouter())
|
|
40
|
+
: newRouter()
|