diff --git a/package.json b/package.json index 00d84562d..71eeb529f 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,12 @@ "import": "./dist/data-loaders/pinia-colada.js", "require": "./dist/data-loaders/pinia-colada.cjs" }, + "./volar/sfc-route-blocks": { + "require": "./dist/volar/sfc-route-blocks.cjs" + }, + "./volar/sfc-typed-router": { + "require": "./dist/volar/sfc-typed-router.cjs" + }, "./client": { "types": "./client.d.ts" } @@ -134,6 +140,7 @@ "dependencies": { "@babel/types": "^7.26.8", "@vue-macros/common": "^1.16.1", + "@vue/language-core": "^2.2.4", "ast-walker-scope": "^0.6.2", "chokidar": "^4.0.3", "fast-glob": "^3.3.3", @@ -141,6 +148,7 @@ "local-pkg": "^1.0.0", "magic-string": "^0.30.17", "mlly": "^1.7.4", + "muggle-string": "^0.4.1", "pathe": "^2.0.2", "picomatch": "^4.0.2", "scule": "^1.3.0", @@ -165,7 +173,6 @@ "@types/picomatch": "^3.0.2", "@vitest/coverage-v8": "^3.0.5", "@vitest/ui": "^3.0.5", - "@vue/language-core": "^2.2.4", "@vue/test-utils": "^2.4.6", "chalk": "^5.4.1", "conventional-changelog-cli": "^5.0.0", diff --git a/playground/src/pages/@[profileId].vue b/playground/src/pages/@[profileId].vue index 9237c490d..fed806fda 100644 --- a/playground/src/pages/@[profileId].vue +++ b/playground/src/pages/@[profileId].vue @@ -1,6 +1,6 @@ - + { "props": true } diff --git a/playground/src/pages/[...path].vue b/playground/src/pages/[...path].vue index e8bf8e24e..7efacb197 100644 --- a/playground/src/pages/[...path].vue +++ b/playground/src/pages/[...path].vue @@ -1,13 +1,11 @@ - + { "props": true } diff --git a/playground/src/pages/[name].vue b/playground/src/pages/[name].vue index 1631b08b9..b97b87a80 100644 --- a/playground/src/pages/[name].vue +++ b/playground/src/pages/[name].vue @@ -49,6 +49,7 @@ import { onBeforeRouteUpdate, type RouteLocationNormalized, } from 'vue-router' +import type { RouteNamedMap } from 'vue-router/auto-routes' const thing = 'THING' @@ -90,8 +91,8 @@ if (routeLocation.name === '/[name]') { routeLocation.params.id } -const route = useRoute('/[name]') -const anyRoute = useRoute() +const route = useRoute() +const anyRoute = useRoute() if (anyRoute.name == '/articles/[id]') { console.log('anyRoute.params', anyRoute.params.id) } @@ -133,7 +134,7 @@ definePage({