From baada377c39f7dd97fe0b0a064cea962b780e130 Mon Sep 17 00:00:00 2001 From: Felix Schneider <99918022+trueberryless@users.noreply.github.com> Date: Sat, 21 Mar 2026 20:41:42 +0100 Subject: [PATCH] feat: upgrade to vue-router v5 to migrate away from unplugin-vue-router --- CONTRIBUTING.md | 2 +- knip.ts | 2 - package.json | 1 - pnpm-lock.yaml | 38 ++++++++++++------- .../npm-registry/packuments/nuxt.json | 38 +++++++------------ 5 files changed, 39 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc6afeb794..672256f5c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -347,7 +347,7 @@ Ideally, extract utilities into separate files so they can be unit tested. 🙏 ### Internal linking -Always use **object syntax with named routes** for internal navigation. This makes links resilient to URL structure changes and provides type safety via `unplugin-vue-router`. +Always use **object syntax with named routes** for internal navigation. This makes links resilient to URL structure changes and provides type safety via `vue-router`. ```vue diff --git a/knip.ts b/knip.ts index b40fc70b0d..b453656046 100644 --- a/knip.ts +++ b/knip.ts @@ -25,8 +25,6 @@ const config: KnipConfig = { ignoreDependencies: [ '@iconify-json/*', 'puppeteer', - /** Needs to be explicitly installed, even though it is not imported, to avoid type errors. */ - 'unplugin-vue-router', 'vite-plugin-pwa', '@vueuse/shared', diff --git a/package.json b/package.json index 6812ebc6a7..279814e872 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,6 @@ "tinyglobby": "0.2.15", "ufo": "1.6.3", "unocss": "66.6.7", - "unplugin-vue-router": "0.19.2", "valibot": "1.3.0", "validate-npm-package-name": "7.0.2", "virtua": "0.48.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62896004f4..43aa0ecf71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -213,9 +213,6 @@ importers: unocss: specifier: 66.6.7 version: 66.6.7(@unocss/webpack@66.6.7(webpack@5.104.1(esbuild@0.27.3)))(vite@8.0.0(@types/node@24.12.0)(esbuild@0.27.3)(jiti@2.6.1)(terser@5.46.1)(tsx@4.21.0)(yaml@2.8.2)) - unplugin-vue-router: - specifier: 0.19.2 - version: 0.19.2(@vue/compiler-sfc@3.5.30)(vue-router@4.6.4(vue@3.5.30(typescript@5.9.3)))(vue@3.5.30(typescript@5.9.3)) valibot: specifier: 1.3.0 version: 1.3.0(typescript@5.9.3) @@ -9886,11 +9883,11 @@ packages: resolution: {integrity: sha512-QXqwfEl9ddlGBaRFXIvNKK6OhipSiLXuRuLJX5DErz0o0Q0rYxulWLdFryTkV5PkdZct5iMInwYEGe/eR++1AA==} hasBin: true - tldts-core@7.0.26: - resolution: {integrity: sha512-5WJ2SqFsv4G2Dwi7ZFVRnz6b2H1od39QME1lc2y5Ew3eWiZMAeqOAfWpRP9jHvhUl881406QtZTODvjttJs+ew==} + tldts-core@7.0.27: + resolution: {integrity: sha512-YQ7uPjgWUibIK6DW5lrKujGwUKhLevU4hcGbP5O6TcIUb+oTjJYJVWPS4nZsIHrEEEG6myk/oqAJUEQmpZrHsg==} - tldts@7.0.26: - resolution: {integrity: sha512-WiGwQjr0qYdNNG8KpMKlSvpxz652lqa3Rd+/hSaDcY4Uo6SKWZq2LAF+hsAhUewTtYhXlorBKgNF3Kk8hnjGoQ==} + tldts@7.0.27: + resolution: {integrity: sha512-I4FZcVFcqCRuT0ph6dCDpPuO4Xgzvh+spkcTr1gK7peIvxWauoloVO0vuy1FQnijT63ss6AsHB6+OIM4aXHbPg==} hasBin: true to-buffer@1.2.2: @@ -10828,6 +10825,18 @@ packages: utf-8-validate: optional: true + ws@8.20.0: + resolution: {integrity: sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + wsl-utils@0.1.0: resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==} engines: {node: '>=18'} @@ -18454,7 +18463,7 @@ snapshots: '@types/ws': 8.18.1 entities: 4.5.0 whatwg-mimetype: 3.0.0 - ws: 8.19.0 + ws: 8.20.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -19146,7 +19155,7 @@ snapshots: webidl-conversions: 8.0.1 whatwg-mimetype: 4.0.0 whatwg-url: 15.1.0 - ws: 8.19.0 + ws: 8.20.0 xml-name-validator: 5.0.0 transitivePeerDependencies: - '@noble/hashes' @@ -22498,12 +22507,12 @@ snapshots: tlds@1.261.0: {} - tldts-core@7.0.26: + tldts-core@7.0.27: optional: true - tldts@7.0.26: + tldts@7.0.27: dependencies: - tldts-core: 7.0.26 + tldts-core: 7.0.27 optional: true to-buffer@1.2.2: @@ -22528,7 +22537,7 @@ snapshots: tough-cookie@6.0.1: dependencies: - tldts: 7.0.26 + tldts: 7.0.27 optional: true tr46@0.0.3: {} @@ -23698,6 +23707,9 @@ snapshots: ws@8.19.0: {} + ws@8.20.0: + optional: true + wsl-utils@0.1.0: dependencies: is-wsl: 3.1.0 diff --git a/test/fixtures/npm-registry/packuments/nuxt.json b/test/fixtures/npm-registry/packuments/nuxt.json index b4222f259a..27c9a926bc 100644 --- a/test/fixtures/npm-registry/packuments/nuxt.json +++ b/test/fixtures/npm-registry/packuments/nuxt.json @@ -100,10 +100,9 @@ "unctx": "^2.5.0", "unimport": "^5.6.0", "unplugin": "^3.0.0", - "unplugin-vue-router": "^0.19.2", "untyped": "^2.0.0", "vue": "^3.5.27", - "vue-router": "^4.6.4", + "vue-router": "^5.0.4", "@nuxt/kit": "4.3.1", "@nuxt/schema": "4.3.1", "@nuxt/vite-builder": "4.3.1", @@ -324,7 +323,7 @@ "oxc-parser": "^0.112.0", "oxc-walker": "^0.7.0", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.4", + "vue-router": "^5.0.4", "@unhead/vue": "^2.1.3", "@vue/shared": "^3.5.27", "@nuxt/schema": "3.21.1", @@ -335,7 +334,6 @@ "perfect-debounce": "^2.1.0", "@nuxt/nitro-server": "3.21.1", "@nuxt/vite-builder": "3.21.1", - "unplugin-vue-router": "^0.19.2", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -504,7 +502,7 @@ "oxc-parser": "^0.110.0", "oxc-walker": "^0.7.0", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.4", + "vue-router": "^5.0.4", "@unhead/vue": "^2.1.2", "@vue/shared": "^3.5.27", "@nuxt/schema": "3.21.0", @@ -515,7 +513,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "3.21.0", "@nuxt/vite-builder": "3.21.0", - "unplugin-vue-router": "^0.19.2", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -683,7 +680,7 @@ "oxc-parser": "^0.110.0", "oxc-walker": "^0.7.0", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.4", + "vue-router": "^5.0.4", "@unhead/vue": "^2.1.2", "@vue/shared": "^3.5.27", "@nuxt/schema": "4.3.0", @@ -694,7 +691,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "4.3.0", "@nuxt/vite-builder": "4.3.0", - "unplugin-vue-router": "^0.19.2", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -877,7 +873,7 @@ "oxc-parser": "^0.102.0", "oxc-walker": "^0.6.0", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.3", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.19", "@vue/shared": "^3.5.25", "@nuxt/schema": "4.2.2", @@ -888,7 +884,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "4.2.2", "@nuxt/vite-builder": "4.2.2", - "unplugin-vue-router": "^0.19.0", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -1075,7 +1070,7 @@ "oxc-parser": "^0.102.0", "oxc-walker": "^0.6.0", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.3", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.19", "@vue/shared": "^3.5.25", "@nuxt/schema": "3.20.2", @@ -1086,7 +1081,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "3.20.2", "@nuxt/vite-builder": "3.20.2", - "unplugin-vue-router": "^0.19.0", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -1270,7 +1264,7 @@ "oxc-parser": "^0.96.0", "oxc-walker": "^0.5.2", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.3", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.19", "@vue/shared": "^3.5.23", "@nuxt/schema": "4.2.1", @@ -1281,7 +1275,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "4.2.1", "@nuxt/vite-builder": "4.2.1", - "unplugin-vue-router": "^0.16.1", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -1468,7 +1461,7 @@ "oxc-parser": "^0.96.0", "oxc-walker": "^0.5.2", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.3", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.19", "@vue/shared": "^3.5.23", "@nuxt/schema": "3.20.1", @@ -1479,7 +1472,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "3.20.1", "@nuxt/vite-builder": "3.20.1", - "unplugin-vue-router": "^0.16.1", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -1667,7 +1659,7 @@ "oxc-parser": "^0.94.0", "oxc-walker": "^0.5.2", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.3", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.14", "@vue/shared": "^3.5.22", "@nuxt/schema": "3.20.0", @@ -1678,7 +1670,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "3.20.0", "@nuxt/vite-builder": "3.20.0", - "unplugin-vue-router": "^0.16.0", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -1862,7 +1853,7 @@ "oxc-parser": "^0.95.0", "oxc-walker": "^0.5.2", "tinyglobby": "^0.2.15", - "vue-router": "^4.6.3", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.19", "@vue/shared": "^3.5.22", "@nuxt/schema": "4.2.0", @@ -1873,7 +1864,6 @@ "perfect-debounce": "^2.0.0", "@nuxt/nitro-server": "4.2.0", "@nuxt/vite-builder": "4.2.0", - "unplugin-vue-router": "^0.16.0", "escape-string-regexp": "^5.0.0" }, "_hasShrinkwrap": false, @@ -2028,7 +2018,7 @@ "source-map": "^0.7.0", "url-loader": "^0.6.2", "vue-loader": "^13.7.2", - "vue-router": "^3.0.1", + "vue-router": "^5.0.4", "compression": "^1.7.1", "es6-promise": "^4.2.4", "file-loader": "^1.1.6", @@ -2343,7 +2333,7 @@ "oxc-parser": "^0.74.0", "oxc-walker": "^0.3.0", "tinyglobby": "0.2.14", - "vue-router": "^4.5.1", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.10", "@vue/shared": "^3.5.17", "@nuxt/schema": "4.0.0-alpha.4", @@ -2358,7 +2348,6 @@ "perfect-debounce": "^1.0.0", "vue-devtools-stub": "^0.1.0", "@nuxt/vite-builder": "4.0.0-alpha.4", - "unplugin-vue-router": "^0.12.0", "vue-bundle-renderer": "^2.1.1", "escape-string-regexp": "^5.0.0" }, @@ -2551,7 +2540,7 @@ "oxc-parser": "^0.75.1", "oxc-walker": "^0.3.0", "tinyglobby": "0.2.14", - "vue-router": "^4.5.1", + "vue-router": "^5.0.4", "@unhead/vue": "^2.0.12", "@vue/shared": "^3.5.17", "@nuxt/schema": "4.0.0-rc.0", @@ -2566,7 +2555,6 @@ "perfect-debounce": "^1.0.0", "vue-devtools-stub": "^0.1.0", "@nuxt/vite-builder": "4.0.0-rc.0", - "unplugin-vue-router": "^0.14.0", "vue-bundle-renderer": "^2.1.1", "escape-string-regexp": "^5.0.0" },