From b0704d69caa499b6e190b8a7b1dfee2a108c7140 Mon Sep 17 00:00:00 2001 From: IceyWu <3128006406@qq.com> Date: Thu, 14 Mar 2024 22:56:12 +0800 Subject: [PATCH] chore: update deps --- package.json | 62 +++++------ pnpm-lock.yaml | 227 +++++++++++++++++++++------------------- presets/index.ts | 15 ++- presets/types/vite.d.ts | 1 - src/plugins/router.ts | 27 ++--- tsconfig.json | 12 ++- typed-router.d.ts | 25 +++++ 7 files changed, 202 insertions(+), 167 deletions(-) create mode 100644 typed-router.d.ts diff --git a/package.json b/package.json index 8ec2b73..90884fa 100644 --- a/package.json +++ b/package.json @@ -31,41 +31,41 @@ "packageManager": "pnpm@8.15.1", "devDependencies": { "@iceywu/utils": "^0.0.37", - "@iconify-json/carbon": "^1.1.30", - "@intlify/unplugin-vue-i18n": "^2.0.0", + "@iconify-json/carbon": "^1.1.31", + "@intlify/unplugin-vue-i18n": "^3.0.1", "@types/ityped": "^1.0.3", "@types/js-cookie": "^3.0.6", - "@types/node": "^20.11.17", - "@typescript-eslint/parser": "^6.21.0", + "@types/node": "^20.11.27", + "@typescript-eslint/parser": "^7.2.0", "@unocss/eslint-config": "^0.58.5", "@unocss/reset": "^0.58.5", "@unocss/transformer-directives": "^0.58.5", "@unocss/transformer-variant-group": "^0.58.5", - "@vitejs/plugin-legacy": "^5.3.0", + "@vitejs/plugin-legacy": "^5.3.2", "@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue-jsx": "^3.1.0", - "@vueuse/components": "^10.7.2", - "@vueuse/core": "^10.7.2", - "@vueuse/integrations": "^10.7.2", - "@vueuse/motion": "^2.0.0", + "@vueuse/components": "^10.9.0", + "@vueuse/core": "^10.9.0", + "@vueuse/integrations": "^10.9.0", + "@vueuse/motion": "^2.1.0", "axios": "^1.6.7", - "browserslist": "^4.22.3", + "browserslist": "^4.23.0", "c8": "^9.1.0", "changelogen": "^0.5.5", "consola": "^3.2.3", "cross-env": "^7.0.3", "defu": "^6.1.4", - "echarts": "^5.4.3", - "eslint": "^8.56.0", + "echarts": "^5.5.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-vue": "^9.21.1", + "eslint-plugin-vue": "^9.23.0", "fs-extra": "^11.2.0", - "husky": "^9.0.10", + "husky": "^9.0.11", "ityped": "^1.0.3", "js-cookie": "^3.0.5", "kolorist": "^1.8.0", - "lightningcss": "^1.23.0", + "lightningcss": "^1.24.0", "lint-staged": "^15.2.2", "local-pkg": "^0.5.0", "lottie-web": "^5.12.2", @@ -80,32 +80,32 @@ "prism-theme-vars": "^0.2.4", "simple-git": "^3.22.0", "taze": "^0.13.3", - "terser": "^5.27.0", - "typescript": "^5.3.3", + "terser": "^5.29.2", + "typescript": "^5.4.2", "unocss": "^0.58.5", - "unocss-preset-useful": "^0.4.0", + "unocss-preset-useful": "^0.4.1", "unplugin-auto-import": "^0.17.5", "unplugin-vue-components": "^0.26.0", "unplugin-vue-markdown": "^0.26.0", - "unplugin-vue-router": "^0.7.0", - "vite": "^5.1.1", - "vite-auto-import-resolvers": "^3.2.0", - "vite-layers": "^0.5.1", + "unplugin-vue-router": "^0.8.5", + "vite": "^5.1.6", + "vite-auto-import-resolvers": "^3.2.1", + "vite-layers": "^0.5.2", "vite-plugin-compression": "^0.5.1", - "vite-plugin-env-types": "^0.1.3", + "vite-plugin-env-types": "^0.1.4", "vite-plugin-legacy-swc": "^1.0.0", "vite-plugin-mock": "2.9.8", "vite-plugin-removelog": "^0.2.2", - "vite-plugin-use-modules": "^1.4.7", - "vite-plugin-vue-devtools": "^7.0.14", - "vite-plugin-vue-meta-layouts": "^0.4.1", - "vitest": "^1.2.2", - "vue": "^3.4.18", + "vite-plugin-use-modules": "^1.4.8", + "vite-plugin-vue-devtools": "^7.0.17", + "vite-plugin-vue-layouts": "^0.11.0", + "vitest": "^1.3.1", + "vue": "^3.4.21", "vue-dark-switch": "^1.0.6", - "vue-echarts": "^6.6.8", - "vue-i18n": "^9.9.1", + "vue-echarts": "^6.6.9", + "vue-i18n": "^9.10.1", "vue-request": "2.0.4", - "vue-router": "^4.2.5", + "vue-router": "^4.3.0", "vue-toastification": "2.0.0-rc.5" }, "lint-staged": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6260763..6085f93 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,11 +9,11 @@ devDependencies: specifier: ^0.0.37 version: 0.0.37 '@iconify-json/carbon': - specifier: ^1.1.30 + specifier: ^1.1.31 version: 1.1.31 '@intlify/unplugin-vue-i18n': - specifier: ^2.0.0 - version: 2.0.0(vue-i18n@9.10.1) + specifier: ^3.0.1 + version: 3.0.1(vue-i18n@9.10.1) '@types/ityped': specifier: ^1.0.3 version: 1.0.3 @@ -21,11 +21,11 @@ devDependencies: specifier: ^3.0.6 version: 3.0.6 '@types/node': - specifier: ^20.11.17 + specifier: ^20.11.27 version: 20.11.27 '@typescript-eslint/parser': - specifier: ^6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.4.2) + specifier: ^7.2.0 + version: 7.2.0(eslint@8.57.0)(typescript@5.4.2) '@unocss/eslint-config': specifier: ^0.58.5 version: 0.58.5(eslint@8.57.0)(typescript@5.4.2) @@ -39,7 +39,7 @@ devDependencies: specifier: ^0.58.5 version: 0.58.5 '@vitejs/plugin-legacy': - specifier: ^5.3.0 + specifier: ^5.3.2 version: 5.3.2(terser@5.29.2)(vite@5.1.6) '@vitejs/plugin-vue': specifier: ^5.0.4 @@ -48,22 +48,22 @@ devDependencies: specifier: ^3.1.0 version: 3.1.0(vite@5.1.6)(vue@3.4.21) '@vueuse/components': - specifier: ^10.7.2 + specifier: ^10.9.0 version: 10.9.0(vue@3.4.21) '@vueuse/core': - specifier: ^10.7.2 + specifier: ^10.9.0 version: 10.9.0(vue@3.4.21) '@vueuse/integrations': - specifier: ^10.7.2 + specifier: ^10.9.0 version: 10.9.0(axios@1.6.7)(nprogress@0.2.0)(vue@3.4.21) '@vueuse/motion': - specifier: ^2.0.0 + specifier: ^2.1.0 version: 2.1.0(vue@3.4.21) axios: specifier: ^1.6.7 version: 1.6.7 browserslist: - specifier: ^4.22.3 + specifier: ^4.23.0 version: 4.23.0 c8: specifier: ^9.1.0 @@ -81,10 +81,10 @@ devDependencies: specifier: ^6.1.4 version: 6.1.4 echarts: - specifier: ^5.4.3 + specifier: ^5.5.0 version: 5.5.0 eslint: - specifier: ^8.56.0 + specifier: ^8.57.0 version: 8.57.0 eslint-config-prettier: specifier: ^9.1.0 @@ -93,13 +93,13 @@ devDependencies: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) eslint-plugin-vue: - specifier: ^9.21.1 + specifier: ^9.23.0 version: 9.23.0(eslint@8.57.0) fs-extra: specifier: ^11.2.0 version: 11.2.0 husky: - specifier: ^9.0.10 + specifier: ^9.0.11 version: 9.0.11 ityped: specifier: ^1.0.3 @@ -111,7 +111,7 @@ devDependencies: specifier: ^1.8.0 version: 1.8.0 lightningcss: - specifier: ^1.23.0 + specifier: ^1.24.0 version: 1.24.0 lint-staged: specifier: ^15.2.2 @@ -156,16 +156,16 @@ devDependencies: specifier: ^0.13.3 version: 0.13.3 terser: - specifier: ^5.27.0 + specifier: ^5.29.2 version: 5.29.2 typescript: - specifier: ^5.3.3 + specifier: ^5.4.2 version: 5.4.2 unocss: specifier: ^0.58.5 version: 0.58.5(postcss@8.4.35)(vite@5.1.6) unocss-preset-useful: - specifier: ^0.4.0 + specifier: ^0.4.1 version: 0.4.1(unocss@0.58.5) unplugin-auto-import: specifier: ^0.17.5 @@ -177,22 +177,22 @@ devDependencies: specifier: ^0.26.0 version: 0.26.0(vite@5.1.6) unplugin-vue-router: - specifier: ^0.7.0 - version: 0.7.0(vue-router@4.3.0)(vue@3.4.21) + specifier: ^0.8.5 + version: 0.8.5(vue-router@4.3.0)(vue@3.4.21) vite: - specifier: ^5.1.1 + specifier: ^5.1.6 version: 5.1.6(@types/node@20.11.27)(lightningcss@1.24.0)(terser@5.29.2) vite-auto-import-resolvers: - specifier: ^3.2.0 + specifier: ^3.2.1 version: 3.2.1(unplugin-auto-import@0.17.5)(vite@5.1.6) vite-layers: - specifier: ^0.5.1 + specifier: ^0.5.2 version: 0.5.2(vite@5.1.6) vite-plugin-compression: specifier: ^0.5.1 version: 0.5.1(vite@5.1.6) vite-plugin-env-types: - specifier: ^0.1.3 + specifier: ^0.1.4 version: 0.1.4(vite@5.1.6) vite-plugin-legacy-swc: specifier: ^1.0.0 @@ -204,34 +204,34 @@ devDependencies: specifier: ^0.2.2 version: 0.2.2(vue@3.4.21) vite-plugin-use-modules: - specifier: ^1.4.7 + specifier: ^1.4.8 version: 1.4.8(vite@5.1.6)(vue@3.4.21) vite-plugin-vue-devtools: - specifier: ^7.0.14 + specifier: ^7.0.17 version: 7.0.17(vite@5.1.6)(vue@3.4.21) - vite-plugin-vue-meta-layouts: - specifier: ^0.4.1 - version: 0.4.2(vite@5.1.6)(vue-router@4.3.0) + vite-plugin-vue-layouts: + specifier: ^0.11.0 + version: 0.11.0(vite@5.1.6)(vue-router@4.3.0)(vue@3.4.21) vitest: - specifier: ^1.2.2 + specifier: ^1.3.1 version: 1.3.1(@types/node@20.11.27)(lightningcss@1.24.0)(terser@5.29.2) vue: - specifier: ^3.4.18 + specifier: ^3.4.21 version: 3.4.21(typescript@5.4.2) vue-dark-switch: specifier: ^1.0.6 version: 1.0.6(vite@5.1.6)(vue@3.4.21) vue-echarts: - specifier: ^6.6.8 + specifier: ^6.6.9 version: 6.6.9(echarts@5.5.0)(vue@3.4.21) vue-i18n: - specifier: ^9.9.1 + specifier: ^9.10.1 version: 9.10.1(vue@3.4.21) vue-request: specifier: 2.0.4 version: 2.0.4(vue@3.4.21) vue-router: - specifier: ^4.2.5 + specifier: ^4.3.0 version: 4.3.0(vue@3.4.21) vue-toastification: specifier: 2.0.0-rc.5 @@ -294,7 +294,7 @@ packages: '@babel/parser': 7.23.9 '@babel/template': 7.23.9 '@babel/traverse': 7.23.9 - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -318,7 +318,7 @@ packages: resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true /@babel/helper-builder-binary-assignment-operator-visitor@7.22.15: @@ -415,7 +415,7 @@ packages: resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.9): @@ -1479,7 +1479,7 @@ packages: dependencies: '@babel/code-frame': 7.23.5 '@babel/parser': 7.23.9 - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true /@babel/traverse@7.23.9: @@ -1493,7 +1493,7 @@ packages: '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.9 - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -1871,8 +1871,8 @@ packages: engines: {node: '>= 16'} dev: true - /@intlify/unplugin-vue-i18n@2.0.0(vue-i18n@9.10.1): - resolution: {integrity: sha512-1oKvm92L9l2od2H9wKx2ZvR4tzn7gUtd7bPLI7AWUmm7U9H1iEypndt5d985ypxGsEs0gToDaKTrytbBIJwwSg==} + /@intlify/unplugin-vue-i18n@3.0.1(vue-i18n@9.10.1): + resolution: {integrity: sha512-q1zJhA/WpoLBzAAuKA5/AEp0e+bMOM10ll/HxT4g1VAw/9JhC4TTobP9KobKH90JMZ4U2daLFlYQfKNd29lpqw==} engines: {node: '>= 14.16'} peerDependencies: petite-vue-i18n: '*' @@ -2612,20 +2612,20 @@ packages: resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} dev: true - /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} + /@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.2) - '@typescript-eslint/visitor-keys': 6.21.0 + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4 eslint: 8.57.0 typescript: 5.4.2 @@ -2641,11 +2641,24 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true + /@typescript-eslint/scope-manager@7.2.0: + resolution: {integrity: sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/visitor-keys': 7.2.0 + dev: true + /@typescript-eslint/types@6.21.0: resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true + /@typescript-eslint/types@7.2.0: + resolution: {integrity: sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.2): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2668,6 +2681,28 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.2): + resolution: {integrity: sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/visitor-keys': 7.2.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.6.0 + ts-api-utils: 1.2.1(typescript@5.4.2) + typescript: 5.4.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} @@ -2695,6 +2730,14 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@7.2.0: + resolution: {integrity: sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 7.2.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true @@ -3138,16 +3181,6 @@ packages: source-map-js: 1.0.2 dev: true - /@vue/compiler-core@3.4.18: - resolution: {integrity: sha512-F7YK8lMK0iv6b9/Gdk15A67wM0KKZvxDxed0RR60C1z9tIJTKta+urs4j0RTN5XqHISzI3etN3mX0uHhjmoqjQ==} - dependencies: - '@babel/parser': 7.23.9 - '@vue/shared': 3.4.18 - entities: 4.5.0 - estree-walker: 2.0.2 - source-map-js: 1.0.2 - dev: true - /@vue/compiler-core@3.4.21: resolution: {integrity: sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==} dependencies: @@ -3172,13 +3205,6 @@ packages: '@vue/shared': 3.4.16 dev: true - /@vue/compiler-dom@3.4.18: - resolution: {integrity: sha512-24Eb8lcMfInefvQ6YlEVS18w5Q66f4+uXWVA+yb7praKbyjHRNuKVWGuinfSSjM0ZIiPi++QWukhkgznBaqpEA==} - dependencies: - '@vue/compiler-core': 3.4.18 - '@vue/shared': 3.4.18 - dev: true - /@vue/compiler-dom@3.4.21: resolution: {integrity: sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==} dependencies: @@ -3311,10 +3337,6 @@ packages: resolution: {integrity: sha512-HKCjeaxR+R95dCw1BDaytcHdlzZj9lxj7RlFnxWtcKq670t8oSeMsbPlkzkNc2V6IUzHaMtUxdBcdREAhb+7NA==} dev: true - /@vue/shared@3.4.18: - resolution: {integrity: sha512-CxouGFxxaW5r1WbrSmWwck3No58rApXgRSBxrqgnY1K+jk20F6DrXJkHdH9n4HVT+/B6G2CAn213Uq3npWiy8Q==} - dev: true - /@vue/shared@3.4.21: resolution: {integrity: sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==} dev: true @@ -3403,7 +3425,7 @@ packages: vue: '>=3.0.0' dependencies: '@vueuse/core': 10.9.0(vue@3.4.21) - '@vueuse/shared': 10.7.2(vue@3.4.21) + '@vueuse/shared': 10.9.0(vue@3.4.21) csstype: 3.1.3 framesync: 6.1.2 popmotion: 11.0.5 @@ -3417,15 +3439,6 @@ packages: - supports-color dev: true - /@vueuse/shared@10.7.2(vue@3.4.21): - resolution: {integrity: sha512-qFbXoxS44pi2FkgFjPvF4h7c9oMDutpyBdcJdMYIMg9XyXli2meFMuaKn+UMgsClo//Th6+beeCgqweT/79BVA==} - dependencies: - vue-demi: 0.14.7(vue@3.4.21) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - dev: true - /@vueuse/shared@10.9.0(vue@3.4.21): resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==} dependencies: @@ -3589,17 +3602,6 @@ packages: - rollup dev: true - /ast-kit@0.9.5: - resolution: {integrity: sha512-kbL7ERlqjXubdDd+szuwdlQ1xUxEz9mCz1+m07ftNVStgwRb2RWw+U6oKo08PAvOishMxiqz1mlJyLl8yQx2Qg==} - engines: {node: '>=16.14.0'} - dependencies: - '@babel/parser': 7.23.9 - '@rollup/pluginutils': 5.1.0 - pathe: 1.1.2 - transitivePeerDependencies: - - rollup - dev: true - /ast-types-yx@0.14.2: resolution: {integrity: sha512-lre9vXZvn5azJcNM60Ub19NzoXsaGS/vJ76ral4BbGSOYJoBo/OrXOXI2uClYzDSzDfRR6D8K+FJrYT3BHUM8w==} engines: {node: '>=4'} @@ -3607,12 +3609,12 @@ packages: tslib: 2.6.2 dev: true - /ast-walker-scope@0.5.0: - resolution: {integrity: sha512-NsyHMxBh4dmdEHjBo1/TBZvCKxffmZxRYhmclfu0PP6Aftre47jOHYaYaNqJcV0bxihxFXhDkzLHUwHc0ocd0Q==} + /ast-walker-scope@0.6.0: + resolution: {integrity: sha512-p+5g400eD1wGLfrEGQIAWtLTT4OBUDWKABrYp1e+xNTNkPniCqXJVfjd7QPTRbt0clm3G71ZMjx/X47DOWpCUQ==} engines: {node: '>=16.14.0'} dependencies: '@babel/parser': 7.23.9 - ast-kit: 0.9.5 + ast-kit: 0.11.3 transitivePeerDependencies: - rollup dev: true @@ -7171,7 +7173,7 @@ packages: dependencies: icss-utils: 5.1.0(postcss@8.1.10) postcss: 8.1.10 - postcss-selector-parser: 6.0.4 + postcss-selector-parser: 6.0.15 postcss-value-parser: 4.2.0 dev: true @@ -7182,7 +7184,7 @@ packages: postcss: ^8.1.0 dependencies: postcss: 8.1.10 - postcss-selector-parser: 6.0.4 + postcss-selector-parser: 6.0.15 dev: true /postcss-modules-values@4.0.0(postcss@8.1.10): @@ -8215,12 +8217,12 @@ packages: fast-glob: 3.3.2 local-pkg: 0.5.0 magic-string: 0.30.7 - mlly: 1.5.0 + mlly: 1.6.1 pathe: 1.1.2 pkg-types: 1.0.3 scule: 1.3.0 strip-literal: 1.3.0 - unplugin: 1.7.1 + unplugin: 1.10.0 transitivePeerDependencies: - rollup dev: true @@ -8393,10 +8395,10 @@ packages: - rollup dev: true - /unplugin-vue-router@0.7.0(vue-router@4.3.0)(vue@3.4.21): - resolution: {integrity: sha512-ddRreGq0t5vlSB7OMy4e4cfU1w2AwBQCwmvW3oP/0IHQiokzbx4hd3TpwBu3eIAFVuhX2cwNQwp1U32UybTVCw==} + /unplugin-vue-router@0.8.5(vue-router@4.3.0)(vue@3.4.21): + resolution: {integrity: sha512-OBoHV24JXSiYH6qEEYT2YayoXh3C0Ma0rDX06+H9fmYXgwcBhEAZVfFt/lbJcBH7f86wCNti59pM4+E/3PjzBA==} peerDependencies: - vue-router: ^4.1.0 + vue-router: ^4.3.0 peerDependenciesMeta: vue-router: optional: true @@ -8404,11 +8406,11 @@ packages: '@babel/types': 7.24.0 '@rollup/pluginutils': 5.1.0 '@vue-macros/common': 1.10.1(vue@3.4.21) - ast-walker-scope: 0.5.0 + ast-walker-scope: 0.6.0 chokidar: 3.6.0 fast-glob: 3.3.2 json5: 2.2.3 - local-pkg: 0.4.3 + local-pkg: 0.5.0 mlly: 1.6.1 pathe: 1.1.2 scule: 1.3.0 @@ -8723,7 +8725,7 @@ packages: '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.9) '@babel/plugin-transform-typescript': 7.23.6(@babel/core@7.23.9) '@vue/babel-plugin-jsx': 1.2.1(@babel/core@7.23.9) - '@vue/compiler-dom': 3.4.18 + '@vue/compiler-dom': 3.4.21 kolorist: 1.8.0 magic-string: 0.30.7 vite: 5.1.6(@types/node@20.11.27)(lightningcss@1.24.0)(terser@5.29.2) @@ -8731,15 +8733,20 @@ packages: - supports-color dev: true - /vite-plugin-vue-meta-layouts@0.4.2(vite@5.1.6)(vue-router@4.3.0): - resolution: {integrity: sha512-KTXIPprcO+FP3xeFKHK8UY37Wwd197boGVQ4HH3ruWMIEu4VopmTmWOYUBw1Qv8q05pzs1RUzO8QsVyUCD06JA==} + /vite-plugin-vue-layouts@0.11.0(vite@5.1.6)(vue-router@4.3.0)(vue@3.4.21): + resolution: {integrity: sha512-uh6NW7lt+aOXujK4eHfiNbeo55K9OTuB7fnv+5RVc4OBn/cZull6ThXdYH03JzKanUfgt6QZ37NbbtJ0og59qw==} peerDependencies: - vite: '>=2.0.0' - vue-router: '>=4.0.14' + vite: ^4.0.0 || ^5.0.0 + vue: ^3.2.4 + vue-router: ^4.0.11 dependencies: - local-pkg: 0.5.0 + debug: 4.3.4 + fast-glob: 3.3.2 vite: 5.1.6(@types/node@20.11.27)(lightningcss@1.24.0)(terser@5.29.2) + vue: 3.4.21(typescript@5.4.2) vue-router: 4.3.0(vue@3.4.21) + transitivePeerDependencies: + - supports-color dev: true /vite@5.1.6(@types/node@20.11.27)(lightningcss@1.24.0)(terser@5.29.2): diff --git a/presets/index.ts b/presets/index.ts index ab63f0e..a0d6317 100644 --- a/presets/index.ts +++ b/presets/index.ts @@ -23,7 +23,7 @@ import { import Components from 'unplugin-vue-components/vite' import Markdown from 'unplugin-vue-markdown/vite' import { VueRouterAutoImports } from 'unplugin-vue-router' -import Router from 'unplugin-vue-router/vite' +import VueRouter from 'unplugin-vue-router/vite' import { AutoGenerateImports, vue3Presets } from 'vite-auto-import-resolvers' import Compression from 'vite-plugin-compression' @@ -32,7 +32,7 @@ import { viteMockServe as Mock } from 'vite-plugin-mock' import Removelog from 'vite-plugin-removelog' import Modules from 'vite-plugin-use-modules' import VueDevTools from 'vite-plugin-vue-devtools' -import Layouts from 'vite-plugin-vue-meta-layouts' +import Layouts from 'vite-plugin-vue-layouts' import I18N from '@intlify/unplugin-vue-i18n/vite' import Legacy from 'vite-plugin-legacy-swc' @@ -93,7 +93,7 @@ export default function () { * 文件路由 * https://github.com/posva/unplugin-vue-router */ - Router({ + VueRouter({ routesFolder: r('src/pages'), dts: r('presets/types/type-router.d.ts'), extensions: ['.md', '.vue', '.tsx', '.jsx'], @@ -116,10 +116,10 @@ export default function () { }), /** * 布局系统 - * https://github.com/dishait/vite-plugin-vue-meta-layouts + * https://github.com/dishait/vite-plugin-vue-layouts */ Layouts({ - skipTopLevelRouteLayout: true, + // skipTopLevelRouteLayout: true, }), /** * mock 服务 @@ -254,7 +254,12 @@ export default function () { include: [...vue3Presets], exclude: ['vue-router'], }), + VueRouterAutoImports, + { + // add any other imports you were relying on + 'vue-router/auto': ['useLink'], + }, ], resolvers: detectResolvers({ onlyExist: [ diff --git a/presets/types/vite.d.ts b/presets/types/vite.d.ts index 27fcd79..caab7c5 100644 --- a/presets/types/vite.d.ts +++ b/presets/types/vite.d.ts @@ -1,7 +1,6 @@ /// /// /// -/// /// declare module "*.vue" { diff --git a/src/plugins/router.ts b/src/plugins/router.ts index 9cdc949..e37fbed 100644 --- a/src/plugins/router.ts +++ b/src/plugins/router.ts @@ -1,24 +1,17 @@ -import { createGetRoutes, setupLayouts } from 'virtual:meta-layouts' -import { createRouter, createWebHistory } from 'vue-router' -import { routes as fileRoutes } from 'vue-router/auto/routes' - -declare module 'vue-router' { - // 在这里定义你的 meta 类型 - // eslint-disable-next-line no-unused-vars - interface RouteMeta { - title?: string - layout?: string - } -} +import { createGetRoutes, setupLayouts } from 'virtual:generated-layouts' +import { createRouter, createWebHashHistory } from 'vue-router/auto' +// import { routes } from 'vue-router/auto-routes' +// import { routes as fileRoutes } from 'vue-router/auto-routes' // 重定向 BASE_URL -fileRoutes.flat(Infinity).forEach((route) => { - route.path = safeResolve(route.path) -}) +// fileRoutes.flat(Infinity).forEach((route) => { +// route.path = safeResolve(route.path) +// }) export const router = createRouter({ - history: createWebHistory(), - routes: setupLayouts(fileRoutes), + history: createWebHashHistory(), + // routes, + extendRoutes: (routes) => setupLayouts(routes), }) export const getRoutes = createGetRoutes(router) diff --git a/tsconfig.json b/tsconfig.json index b31d1f8..21cb239 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,13 +11,18 @@ "esModuleInterop": true, "lib": ["esnext", "dom"], "resolveJsonModule": true, - "moduleResolution": "node", + // "moduleResolution": "node", "useDefineForClassFields": true, "baseUrl": ".", "paths": { "~/*": ["src/*"], "@/*": ["src/*"] - } + }, + "moduleResolution": "Bundler", + "types": [ + "unplugin-vue-router/client", + "vite-plugin-vue-layouts/client", + ] }, "include": [ "srcipts", @@ -26,7 +31,8 @@ "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", - "./vite.config.ts" + "./vite.config.ts", + "./typed-router.d.ts" ], "exclude": ["node_modules", "dist"] } diff --git a/typed-router.d.ts b/typed-router.d.ts new file mode 100644 index 0000000..5d94591 --- /dev/null +++ b/typed-router.d.ts @@ -0,0 +1,25 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️ +// It's recommended to commit this file. +// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry. + +declare module 'vue-router/auto-routes' { + import type { + RouteRecordInfo, + ParamValue, + ParamValueOneOrMore, + ParamValueZeroOrMore, + ParamValueZeroOrOne, + } from 'unplugin-vue-router/types' + + /** + * Route name map generated by unplugin-vue-router + */ + export interface RouteNamedMap { + '/E:/MyDev/MyGitHub/cloud-template/src/pages/': RouteRecordInfo<'/E:/MyDev/MyGitHub/cloud-template/src/pages/', '/E:/MyDev/MyGitHub/cloud-template/src/pages', Record, Record>, + '/E:/MyDev/MyGitHub/cloud-template/src/pages/[...notFound]': RouteRecordInfo<'/E:/MyDev/MyGitHub/cloud-template/src/pages/[...notFound]', '/E:/MyDev/MyGitHub/cloud-template/src/pages/:notFound(.*)', { notFound: ParamValue }, { notFound: ParamValue }>, + '/E:/MyDev/MyGitHub/cloud-template/src/pages/echarts': RouteRecordInfo<'/E:/MyDev/MyGitHub/cloud-template/src/pages/echarts', '/E:/MyDev/MyGitHub/cloud-template/src/pages/echarts', Record, Record>, + } +}