Skip to content

Commit

Permalink
feat(projects): update @elegant-router/vue and fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Nov 4, 2023
1 parent 110fce6 commit b76329b
Show file tree
Hide file tree
Showing 16 changed files with 1,022 additions and 967 deletions.
10 changes: 5 additions & 5 deletions build/plugins/router.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RouteMeta } from 'vue-router';
import ElegantVueRouter from '@elegant-router/vue/vite';
import type { AutoRouteKey } from '@elegant-router/types';
import type { RouteKey } from '@elegant-router/types';

export function setupElegantRouter() {
return ElegantVueRouter({
Expand All @@ -9,7 +9,7 @@ export function setupElegantRouter() {
blank: 'src/layouts/blank-layout/index.vue'
},
routePathTransformer(routeName, routePath) {
const key = routeName as AutoRouteKey;
const key = routeName as RouteKey;

if (key === 'login') {
const modules: UnionKey.LoginModule[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat'];
Expand All @@ -22,13 +22,13 @@ export function setupElegantRouter() {
return routePath;
},
onRouteMetaGen(routeName) {
const key = routeName as AutoRouteKey;
const key = routeName as RouteKey;

const constantRoutes: AutoRouteKey[] = ['login', '403', '404', '500'];
const constantRoutes: RouteKey[] = ['login', '403', '404', '500'];

const meta: Partial<RouteMeta> = {
title: key,
i18nKey: `route.${key}`
i18nKey: `route.${key}` as App.I18n.I18nKey
};

if (constantRoutes.includes(key)) {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,30 @@
"lodash-es": "4.17.21",
"nprogress": "0.2.0",
"pinia": "2.1.7",
"vue": "3.3.6",
"vue-i18n": "9.5.0",
"vue": "3.3.7",
"vue-i18n": "9.6.5",
"vue-router": "4.2.5"
},
"devDependencies": {
"@elegant-router/vue": "0.2.6",
"@elegant-router/vue": "0.3.0-beta.0",
"@iconify-json/heroicons": "1.1.13",
"@iconify-json/ic": "1.1.14",
"@iconify-json/icon-park-outline": "1.1.12",
"@iconify-json/line-md": "1.1.33",
"@iconify-json/logos": "1.1.37",
"@iconify-json/material-symbols": "1.1.60",
"@iconify-json/material-symbols": "1.1.61",
"@iconify-json/ph": "1.1.6",
"@iconify-json/tabler": "1.1.95",
"@iconify-json/tabler": "1.1.96",
"@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*",
"@types/lodash-es": "4.17.10",
"@types/node": "20.8.7",
"@types/node": "20.8.10",
"@types/nprogress": "0.2.2",
"@unocss/preset-icons": "0.57.0",
"@unocss/preset-uno": "0.57.0",
"@unocss/transformer-directives": "0.57.0",
"@unocss/transformer-variant-group": "0.57.0",
"@unocss/vite": "0.57.0",
"@unocss/preset-icons": "0.57.2",
"@unocss/preset-uno": "0.57.2",
"@unocss/transformer-directives": "0.57.2",
"@unocss/transformer-variant-group": "0.57.2",
"@unocss/vite": "0.57.2",
"@vitejs/plugin-vue": "4.4.0",
"@vitejs/plugin-vue-jsx": "3.0.2",
"cross-env": "7.0.3",
Expand All @@ -63,13 +63,13 @@
"simple-git-hooks": "2.9.0",
"typescript": "5.2.2",
"unocss-preset-scrollbar": "0.3.0",
"unplugin-icons": "0.17.1",
"unplugin-icons": "0.17.3",
"unplugin-vue-components": "0.25.2",
"vite": "4.5.0",
"vite-plugin-progress": "0.0.7",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-devtools": "1.0.0-rc.5",
"vue-tsc": "1.8.20"
"vue-tsc": "1.8.22"
},
"simple-git-hooks": {
"commit-msg": "pnpm sa git-commit-verify",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"serve": "vitepress serve"
},
"devDependencies": {
"vitepress": "1.0.0-rc.23"
"vitepress": "1.0.0-rc.24"
}
}
8 changes: 4 additions & 4 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
},
"devDependencies": {
"@types/eslint": "8.44.6",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.8.0",
"eslint": "8.52.0",
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1",
"eslint": "8.53.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-n": "16.2.0",
"eslint-plugin-prettier": "5.0.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-vue": "9.17.0",
"eslint-plugin-vue": "9.18.1",
"prettier": "3.0.3"
}
}
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"consola": "3.2.3",
"enquirer": "2.4.1",
"execa": "8.0.1",
"jiti": "1.20.0",
"jiti": "1.21.0",
"lint-staged": "15.0.2",
"npm-check-updates": "16.14.6",
"rimraf": "5.0.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"colord": "2.9.3",
"crypto-js": "4.1.1",
"crypto-js": "4.2.0",
"localforage": "1.10.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit b76329b

Please sign in to comment.