Skip to content

Commit 3696626

Browse files
committed
chore: use latest vue-router
1 parent c81de37 commit 3696626

File tree

10 files changed

+231
-889
lines changed

10 files changed

+231
-889
lines changed

docs/.vitepress/twoslash-files.ts

-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ declare module 'vue-router/auto-routes' {
66
ParamValueOneOrMore,
77
ParamValueZeroOrMore,
88
ParamValueZeroOrOne,
9-
RouteMeta,
109
} from 'vue-router'
1110
1211
/**
@@ -18,31 +17,27 @@ declare module 'vue-router/auto-routes' {
1817
'/',
1918
Record<never, never>,
2019
Record<never, never>,
21-
RouteMeta,
2220
never
2321
>
2422
'/users': RouteRecordInfo<
2523
'/users',
2624
'/users',
2725
Record<never, never>,
2826
Record<never, never>,
29-
RouteMeta,
3027
never
3128
>
3229
'/users/[id]': RouteRecordInfo<
3330
'/users/[id]',
3431
'/users/:id',
3532
{ id: ParamValue<true> },
3633
{ id: ParamValue<false> },
37-
RouteMeta,
3834
'/users/[id]/edit'
3935
>
4036
'/users/[id]/edit': RouteRecordInfo<
4137
'/users/[id]/edit',
4238
'/users/:id/edit',
4339
{ id: ParamValue<true> },
4440
{ id: ParamValue<false> },
45-
RouteMeta,
4641
never
4742
>
4843
}

docs/.vitepress/twoslash/code/typed-router.ts

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ declare module 'vue-router/auto-routes' {
55
ParamValueOneOrMore,
66
ParamValueZeroOrMore,
77
ParamValueZeroOrOne,
8-
RouteMeta,
98
} from 'vue-router'
109

1110
export interface RouteNamedMap {
@@ -14,31 +13,27 @@ declare module 'vue-router/auto-routes' {
1413
'/',
1514
Record<never, never>,
1615
Record<never, never>,
17-
RouteMeta,
1816
never
1917
>
2018
'/users': RouteRecordInfo<
2119
'/users',
2220
'/users',
2321
Record<never, never>,
2422
Record<never, never>,
25-
RouteMeta,
2623
never
2724
>
2825
'/users/[id]': RouteRecordInfo<
2926
'/users/[id]',
3027
'/users/:id',
3128
{ id: ParamValue<true> },
3229
{ id: ParamValue<false> },
33-
RouteMeta,
3430
'/users/[id]/edit'
3531
>
3632
'/users/[id]/edit': RouteRecordInfo<
3733
'/users/[id]/edit',
3834
'/users/:id/edit',
3935
{ id: ParamValue<true> },
4036
{ id: ParamValue<false> },
41-
RouteMeta,
4237
never
4338
>
4439
}

docs/guide/typescript.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ import type {
5050
ParamValueOneOrMore,
5151
ParamValueZeroOrMore,
5252
ParamValueZeroOrOne,
53-
RouteMeta,
5453
} from 'vue-router'
5554
declare module 'vue-router/auto-routes' {
5655
export interface RouteNamedMap {
@@ -62,8 +61,6 @@ declare module 'vue-router/auto-routes' {
6261
{ path: ParamValue<true> },
6362
// these are the normalized params as found in useRoute().params
6463
{ path: ParamValue<false> },
65-
// these are the `meta` fields
66-
RouteMeta,
6764
// this is a union of all children route names
6865
// if the route does not have nested routes, pass `never` or omit this generic entirely
6966
'custom-dynamic-child-name'
@@ -73,7 +70,6 @@ declare module 'vue-router/auto-routes' {
7370
'/added-during-runtime/[...path]/child',
7471
{ path: ParamValue<true> },
7572
{ path: ParamValue<false> },
76-
RouteMeta,
7773
never
7874
>
7975
}
@@ -96,7 +92,8 @@ import { useRoute, type RouteLocationNormalizedLoaded } from 'vue-router'
9692
// of `/users/[id]` in this example.
9793

9894
// Not recommended, since this leaves out any child routes' typings.
99-
const userRouteWithIdCasted = useRoute() as RouteLocationNormalizedLoaded<'/users/[id]'>
95+
const userRouteWithIdCasted =
96+
useRoute() as RouteLocationNormalizedLoaded<'/users/[id]'>
10097
userRouteWithIdCasted.params.id
10198
// Better way, but no autocompletion.
10299
const userRouteWithIdTypeParam = useRoute<'/users/[id]'>()

docs/introduction.md

-4
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ declare module 'vue-router/auto-routes' {
109109
ParamValueOneOrMore,
110110
ParamValueZeroOrMore,
111111
ParamValueZeroOrOne,
112-
RouteMeta,
113112
} from 'vue-router'
114113

115114
/**
@@ -121,23 +120,20 @@ declare module 'vue-router/auto-routes' {
121120
'/',
122121
Record<never, never>,
123122
Record<never, never>,
124-
RouteMeta,
125123
never
126124
>
127125
'/about': RouteRecordInfo<
128126
'/about',
129127
'/about',
130128
Record<never, never>,
131129
Record<never, never>,
132-
RouteMeta,
133130
never
134131
>
135132
'/users/[id]': RouteRecordInfo<
136133
'/users/[id]',
137134
'/users/:id',
138135
{ id: ParamValue<true> },
139136
{ id: ParamValue<false> },
140-
RouteMeta,
141137
never
142138
>
143139
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"yaml": "^2.7.0"
151151
},
152152
"peerDependencies": {
153-
"vue-router": "^4.4.0"
153+
"vue-router": "^4.5.1"
154154
},
155155
"peerDependenciesMeta": {
156156
"vue-router": {
@@ -193,7 +193,7 @@
193193
"vitepress": "1.6.3",
194194
"vitest": "^3.0.4",
195195
"vue": "^3.5.13",
196-
"vue-router": "https://pkg.pr.new/vue-router@2475",
196+
"vue-router": "^4.5.1",
197197
"vue-router-mock": "^1.1.0",
198198
"vue-tsc": "^2.2.8",
199199
"vuefire": "^3.2.1",

playground/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"mande": "^2.0.9",
2121
"pinia": "^3.0.1",
2222
"vue": "^3.5.13",
23-
"vue-router": "^4.5.0"
23+
"vue-router": "^4.5.1"
2424
}
2525
}

playground/typed-router.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare module 'vue-router/auto-routes' {
1919
* Route name map generated by unplugin-vue-router
2020
*/
2121
export interface RouteNamedMap {
22-
'/(test-group)': RouteRecordInfo<'/(test-group)', '/', Record<never, never>, Record<never, never>, RouteMeta, '/(test-group)/test-group-child'>,
22+
'/(test-group)': RouteRecordInfo<'/(test-group)', '/', Record<never, never>, Record<never, never>, '/(test-group)/test-group-child'>,
2323
'/(test-group)/test-group-child': RouteRecordInfo<'/(test-group)/test-group-child', '/test-group-child', Record<never, never>, Record<never, never>>,
2424
'home': RouteRecordInfo<'home', '/', Record<never, never>, Record<never, never>>,
2525
'/[name]': RouteRecordInfo<'/[name]', '/:name', { name: ParamValue<true> }, { name: ParamValue<false> }>,
@@ -28,7 +28,7 @@ declare module 'vue-router/auto-routes' {
2828
'/@[profileId]': RouteRecordInfo<'/@[profileId]', '/@:profileId', { profileId: ParamValue<true> }, { profileId: ParamValue<false> }>,
2929
'/about': RouteRecordInfo<'/about', '/about', Record<never, never>, Record<never, never>>,
3030
'/about.extra.nested': RouteRecordInfo<'/about.extra.nested', '/about/extra/nested', Record<never, never>, Record<never, never>>,
31-
'/articles': RouteRecordInfo<'/articles', '/articles', Record<never, never>, Record<never, never>, RouteMeta, '/articles/' | '/articles/[id]' | '/articles/[id]+'>,
31+
'/articles': RouteRecordInfo<'/articles', '/articles', Record<never, never>, Record<never, never>, '/articles/' | '/articles/[id]' | '/articles/[id]+'>,
3232
'/articles/': RouteRecordInfo<'/articles/', '/articles', Record<never, never>, Record<never, never>>,
3333
'/articles/[id]': RouteRecordInfo<'/articles/[id]', '/articles/:id', { id: ParamValue<true> }, { id: ParamValue<false> }>,
3434
'/articles/[id]+': RouteRecordInfo<'/articles/[id]+', '/articles/:id+', { id: ParamValueOneOrMore<true> }, { id: ParamValueOneOrMore<false> }>,

0 commit comments

Comments
 (0)