From 1d2d19df653962eb8f2d6697a3474f5d2d5e9394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Wed, 18 Dec 2024 18:42:06 +0800 Subject: [PATCH] fix: type --- auto-imports.d.ts | 14 +++++- package.json | 3 +- patches/vue-router@4.4.3.patch | 13 ----- pnpm-lock.yaml | 92 ++-------------------------------- src/components/send-sms.vue | 2 +- tsconfig.app.json | 4 +- vite.config.plugins.ts | 11 +--- 7 files changed, 23 insertions(+), 116 deletions(-) delete mode 100644 patches/vue-router@4.4.3.patch diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 168f61d..f647358 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -284,7 +284,6 @@ declare global { const useVModels: typeof import('@vueuse/core')['useVModels'] const useVibrate: typeof import('@vueuse/core')['useVibrate'] const useVirtualList: typeof import('@vueuse/core')['useVirtualList'] - const useVueCountdown: typeof import('utils4u/vue-use')['useCountdown'] const useWakeLock: typeof import('@vueuse/core')['useWakeLock'] const useWebNotification: typeof import('@vueuse/core')['useWebNotification'] const useWebSocket: typeof import('@vueuse/core')['useWebSocket'] @@ -293,6 +292,19 @@ declare global { const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus'] const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll'] const useWindowSize: typeof import('@vueuse/core')['useWindowSize'] + const utils4uBrowserChooseFile: typeof import('utils4u/browser')['chooseFile'] + const utils4uBrowserToBase64: typeof import('utils4u/browser')['toBase64'] + const utils4uBrowserViewportCompat: typeof import('utils4u/browser')['browserViewportCompat'] + const utils4uTdesignMobileVueOpenPicker: typeof import('utils4u/tdesign-mobile-vue')['openPicker'] + const utils4uTdesignMobileVueOpenPopup: typeof import('utils4u/tdesign-mobile-vue')['openPopup'] + const utils4uTdesignMobileVuePickDate: typeof import('utils4u/tdesign-mobile-vue')['pickDate'] + const utils4uVantConfirmDialog: typeof import('utils4u/vant')['confirmDialog'] + const utils4uViteCreateViteProxy: typeof import('utils4u/vite')['createViteProxy'] + const utils4uVueRouterCreateLogGuard: typeof import('utils4u/vue-router')['createLogGuard'] + const utils4uVueRouterCreateProgressGuard: typeof import('utils4u/vue-router')['createProgressGuard'] + const utils4uVueRouterCreateStackGuard: typeof import('utils4u/vue-router')['createStackGuard'] + const utils4uVueUseCountdown: typeof import('utils4u/vue-use')['useCountdown'] + const utils4uVueUseRefs: typeof import('utils4u/vue-use')['useRefs'] const watch: typeof import('vue')['watch'] const watchArray: typeof import('@vueuse/core')['watchArray'] const watchAtMost: typeof import('@vueuse/core')['watchAtMost'] diff --git a/package.json b/package.json index 9044741..c3a6909 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,8 @@ "radash": "^12.1.0", "taze": "^0.18.0", "tdesign-icons-vue-next": "^0.3.3", - "tdesign-mobile-vue": "^1.6.0", "ts-enum-util": "^4.1.0", - "utils4u": "^2.12.2", + "utils4u": "^2.14.0", "vant": "^4.9.10", "vite-plugin-webfont-dl": "^3.10.3", "vue": "^3.5.13", diff --git a/patches/vue-router@4.4.3.patch b/patches/vue-router@4.4.3.patch deleted file mode 100644 index ab852f6..0000000 --- a/patches/vue-router@4.4.3.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/dist/vue-router.d.ts b/dist/vue-router.d.ts -index a66b6e0c627a9221a5394066666da49597891d07..19aa9d5c2d42a7221017265225d08c4467f1a69b 100644 ---- a/dist/vue-router.d.ts -+++ b/dist/vue-router.d.ts -@@ -1751,7 +1751,7 @@ export { } - * NOTE: this used to be `@vue/runtime-core` but it should have been `vue` for a long time. Using both declaration at - * the same time breaks so using only one everywhere is the preferred way. - */ --declare module 'vue' { -+declare module '@vue/runtime-core' { - export interface ComponentCustomOptions { - /** - * Guard called when the router is navigating to the route that is rendering diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cdf030c..d590bfe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,15 +79,12 @@ importers: tdesign-icons-vue-next: specifier: ^0.3.3 version: 0.3.3(vue@3.5.13(typescript@5.7.2)) - tdesign-mobile-vue: - specifier: ^1.6.0 - version: 1.6.0(vue@3.5.13(typescript@5.7.2)) ts-enum-util: specifier: ^4.1.0 version: 4.1.0 utils4u: - specifier: ^2.12.2 - version: 2.12.2 + specifier: ^2.14.0 + version: 2.14.0 vant: specifier: ^4.9.10 version: 4.9.10(vue@3.5.13(typescript@5.7.2)) @@ -993,25 +990,21 @@ packages: resolution: {integrity: sha512-HTK/4ncZ2o54kpW7blJQ+bEEPASbGy2pdFauRiLmEE9H5p95DaraYBIsbGzflccEV0i2LZGnaF1m0yVTk8FZSQ==} cpu: [arm64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-arm64-musl@2.1.1': resolution: {integrity: sha512-SLEOcZ/57nw6cGZo/cDNw/H9RnfaqZ/Y5LN0sW3iiqWeHc/tS4AON2g5czoH4u5AIEnHPY/g5ARYj/2g6z0FrQ==} cpu: [arm64] os: [linux] - libc: [musl] '@oxc-resolver/binding-linux-x64-gnu@2.1.1': resolution: {integrity: sha512-1mPnQssbG3vZNaeFM+FJRQTJ8zTAleW7dCNWNImiRvd8ME7SJC0E/zKdnlqNNy1USlw0BQ8QhuHPLZaimtfXFQ==} cpu: [x64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-x64-musl@2.1.1': resolution: {integrity: sha512-02whsqBnEYrIWaSIXWq5lLi0WbI9jbQkmzUKdAM39xbosPCSTfo0refqHCJozfzmLCpK42hF6Ydi45pva8zQPg==} cpu: [x64] os: [linux] - libc: [musl] '@oxc-resolver/binding-wasm32-wasi@2.1.1': resolution: {integrity: sha512-r8o9E3zHoq9r/tIHDERhllXnMkqnq+zE+VyTJqPIw6/CKtqHfemqOdRet1YOxTnmVHCjJ8Ub7zGFczT9JTZYzw==} @@ -1121,61 +1114,51 @@ packages: resolution: {integrity: sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.28.1': resolution: {integrity: sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.28.1': resolution: {integrity: sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.28.1': resolution: {integrity: sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.28.1': resolution: {integrity: sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': resolution: {integrity: sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.28.1': resolution: {integrity: sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.28.1': resolution: {integrity: sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.28.1': resolution: {integrity: sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.28.1': resolution: {integrity: sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.28.1': resolution: {integrity: sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==} @@ -1417,12 +1400,6 @@ packages: peerDependencies: vite: ^6.0.3 - '@use-gesture/core@10.3.1': - resolution: {integrity: sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw==} - - '@use-gesture/vanilla@10.3.1': - resolution: {integrity: sha512-lT4scGLu59ovA3zmtUonukAGcA0AdOOh+iwNDS05Bsu7Lq9aZToDHhI6D8Q2qvsVraovtsLLYwPrWdG/noMAKw==} - '@vant/auto-import-resolver@1.2.1': resolution: {integrity: sha512-czGWW4UolNITkF3qQSQlpHDHAsI3/GHVKbRMmEEpry7NWdnU4p5a5jBi0VApbaLa5g80Hy10XVs3IB+UozoSUw==} @@ -1775,21 +1752,12 @@ packages: vue: optional: true - '@vueuse/core@10.7.0': - resolution: {integrity: sha512-4EUDESCHtwu44ZWK3Gc/hZUVhVo/ysvdtwocB5vcauSV4B7NiGY5972WnsojB3vRNdxvAt7kzJWE2h9h7C9d5w==} - '@vueuse/core@12.0.0': resolution: {integrity: sha512-C12RukhXiJCbx4MGhjmd/gH52TjJsc3G0E0kQj/kb19H3Nt6n1CA4DRWuTdWWcaFRdlTe0npWDS942mvacvNBw==} - '@vueuse/metadata@10.7.0': - resolution: {integrity: sha512-GlaH7tKP2iBCZ3bHNZ6b0cl9g0CJK8lttkBNUX156gWvNYhTKEtbweWLm9rxCPIiwzYcr/5xML6T8ZUEt+DkvA==} - '@vueuse/metadata@12.0.0': resolution: {integrity: sha512-Yzimd1D3sjxTDOlF05HekU5aSGdKjxhuhRFHA7gDWLn57PRbBIh+SF5NmjhJ0WRgF3my7T8LBucyxdFJjIfRJQ==} - '@vueuse/shared@10.7.0': - resolution: {integrity: sha512-kc00uV6CiaTdc3i1CDC4a3lBxzaBE9AgYNtFN87B5OOscqeWElj/uza8qVDmk7/U8JbqoONLbtqiLJ5LGRuqlw==} - '@vueuse/shared@12.0.0': resolution: {integrity: sha512-3i6qtcq2PIio5i/vVYidkkcgvmTjCqrf26u+Fd4LhnbBmIT6FN8y6q/GJERp8lfcB9zVEfjdV0Br0443qZuJpw==} @@ -4461,12 +4429,6 @@ packages: peerDependencies: vue: ^3.0.0 - tdesign-mobile-vue@1.6.0: - resolution: {integrity: sha512-ZVihId0BllAp15U1Au8qI17ZZsdIfgi/C4W7p9HjrwRmMYabx/F93G8ONP2YJvXLtXAXa+DVS/e4aYL4aCu7wQ==} - engines: {node: '>=12.0.0'} - peerDependencies: - vue: ^3.2.6 - through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -4790,8 +4752,8 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - utils4u@2.12.2: - resolution: {integrity: sha512-zPgrr0nALpCOefYwM9jjjriTIZBbd/6GK9Nk5gkv/Tizefd8cmbqhMo/6+ORUgSCyQD0dch+LiytOsTUaxsJqQ==} + utils4u@2.14.0: + resolution: {integrity: sha512-NqwoG4GXbQpdKrLUW6ZDuq9SMp2GmLXftyRB2ry3leVZTc22w7JZY9oAfxP8oMpBZzLd0RuPpPUvcXlawSuLkw==} uuid@3.3.2: resolution: {integrity: sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==} @@ -4806,10 +4768,6 @@ packages: v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - validator@13.12.0: - resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} - engines: {node: '>= 0.10'} - vant@4.9.10: resolution: {integrity: sha512-N+QwOuhDxrH2f6+kN05ot6DHBvaM0e1lcoXVvf12rad2KnlybPQ9gjm0d+R+Nz/zydZbe3Fz6bwTssHItri0sw==} peerDependencies: @@ -6333,12 +6291,6 @@ snapshots: - supports-color - vue - '@use-gesture/core@10.3.1': {} - - '@use-gesture/vanilla@10.3.1': - dependencies: - '@use-gesture/core': 10.3.1 - '@vant/auto-import-resolver@1.2.1': {} '@vant/popperjs@1.3.0': {} @@ -6958,16 +6910,6 @@ snapshots: typescript: 5.7.2 vue: 3.5.13(typescript@5.7.2) - '@vueuse/core@10.7.0(vue@3.5.13(typescript@5.7.2))': - dependencies: - '@types/web-bluetooth': 0.0.20 - '@vueuse/metadata': 10.7.0 - '@vueuse/shared': 10.7.0(vue@3.5.13(typescript@5.7.2)) - vue-demi: 0.14.10(vue@3.5.13(typescript@5.7.2)) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - '@vueuse/core@12.0.0(typescript@5.7.2)': dependencies: '@types/web-bluetooth': 0.0.20 @@ -6977,17 +6919,8 @@ snapshots: transitivePeerDependencies: - typescript - '@vueuse/metadata@10.7.0': {} - '@vueuse/metadata@12.0.0': {} - '@vueuse/shared@10.7.0(vue@3.5.13(typescript@5.7.2))': - dependencies: - vue-demi: 0.14.10(vue@3.5.13(typescript@5.7.2)) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - '@vueuse/shared@12.0.0(typescript@5.7.2)': dependencies: vue: 3.5.13(typescript@5.7.2) @@ -9750,19 +9683,6 @@ snapshots: '@babel/runtime': 7.26.0 vue: 3.5.13(typescript@5.7.2) - tdesign-mobile-vue@1.6.0(vue@3.5.13(typescript@5.7.2)): - dependencies: - '@babel/runtime': 7.26.0 - '@use-gesture/vanilla': 10.3.1 - '@vueuse/core': 10.7.0(vue@3.5.13(typescript@5.7.2)) - dayjs: 1.11.13 - lodash: 4.17.21 - tdesign-icons-vue-next: 0.3.3(vue@3.5.13(typescript@5.7.2)) - validator: 13.12.0 - vue: 3.5.13(typescript@5.7.2) - transitivePeerDependencies: - - '@vue/composition-api' - through@2.3.8: {} time-span@4.0.0: @@ -10181,7 +10101,7 @@ snapshots: util-deprecate@1.0.2: {} - utils4u@2.12.2: {} + utils4u@2.14.0: {} uuid@3.3.2: {} @@ -10189,8 +10109,6 @@ snapshots: v8-compile-cache-lib@3.0.1: {} - validator@13.12.0: {} - vant@4.9.10(vue@3.5.13(typescript@5.7.2)): dependencies: '@vant/popperjs': 1.3.0 diff --git a/src/components/send-sms.vue b/src/components/send-sms.vue index f25906a..052ccde 100644 --- a/src/components/send-sms.vue +++ b/src/components/send-sms.vue @@ -6,5 +6,5 @@ diff --git a/tsconfig.app.json b/tsconfig.app.json index b2f6180..317f1c4 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -4,8 +4,8 @@ "./typed-router.d.ts", "./auto-imports.d.ts", "./components.d.ts", - "node_modules/vant/es/index.d.ts", - "node_modules/tdesign-vue-next/global.d.ts", + // "node_modules/vant/es/index.d.ts", + // "node_modules/tdesign-vue-next/global.d.ts", "src/**/*", "src/**/*.vue" ], diff --git a/vite.config.plugins.ts b/vite.config.plugins.ts index aba8c8b..ebab06a 100644 --- a/vite.config.plugins.ts +++ b/vite.config.plugins.ts @@ -6,7 +6,6 @@ import Vue from '@vitejs/plugin-vue'; import VueJsx from '@vitejs/plugin-vue-jsx'; import path from 'node:path'; import UnoCSS from 'unocss/vite'; -import { type ImportsMap } from 'unplugin-auto-import/types'; import AutoImport from 'unplugin-auto-import/vite'; import { FileSystemIconLoader } from 'unplugin-icons/loaders'; import IconsResolver from 'unplugin-icons/resolver'; @@ -17,6 +16,7 @@ import VueMacros from 'unplugin-vue-macros/vite'; import Markdown from 'unplugin-vue-markdown/vite'; import { getPascalCaseRouteName, VueRouterAutoImports } from 'unplugin-vue-router'; import VueRouter from 'unplugin-vue-router/vite'; +import { Utils4uAutoImports } from 'utils4u'; import { PluginOption } from 'vite'; import cdnImport from 'vite-plugin-cdn-import'; import { vitePluginFakeServer } from 'vite-plugin-fake-server'; @@ -44,15 +44,6 @@ export function Plugins() { Markdown({ headEnabled: true }), ); - // TODO: import { Utils4uAutoImports } from 'utils4u'; - // https://github.com/unplugin/unplugin-auto-import?tab=readme-ov-file#configuration - const Utils4uAutoImports: ImportsMap = { - 'utils4u/vue-use': [ - // alias - ['useCountdown', 'useVueCountdown'], - ], - }; - plugins.push( AutoImport({ resolvers: [TDesignResolver({ library: 'mobile-vue', esm: true }), VantResolver({ importStyle: true })],