nuxt-typed-router 3.5.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "nuxt": "^3.0.0",
6
6
  "bridge": false
7
7
  },
8
- "version": "3.5.1"
8
+ "version": "3.6.0"
9
9
  }
package/dist/module.mjs CHANGED
@@ -214,13 +214,15 @@ function pascalCase(str) {
214
214
  return startCase(camelCase(str)).replace(/ /g, "");
215
215
  }
216
216
  function createRoutePathSchema(routePaths) {
217
+ const paths = routePaths.filter((f) => !!f.path);
217
218
  return `export type RoutePathSchema =
218
- ${routePaths.filter((f) => !!f.path).map((route) => `"${route.path}"`).join("|")}
219
+ ${paths.length ? paths.map((route) => `"${route.path}"`).join("|") : "any"}
219
220
  `;
220
221
  }
221
222
  function createLocaleRoutePathSchema(routePaths) {
223
+ const paths = routePaths.filter((f) => !!f.path && !f.isLocale);
222
224
  return `export type LocaleRoutePathSchema =
223
- ${routePaths.filter((f) => !!f.path && !f.isLocale).map((route) => `"${route.path}"`).join("|")}
225
+ ${paths.length ? paths.map((route) => `"${route.path}"`).join("|") : "any"}
224
226
  `;
225
227
  }
226
228
  function createValidatePathTypes(pathElements, routesList, withLocale = false) {
@@ -253,7 +255,7 @@ function createValidatePathTypes(pathElements, routesList, withLocale = false) {
253
255
  )}Path<T extends string> = T extends string
254
256
  ? T extends '/'
255
257
  ? "index"
256
- ${pathConditions.length ? `: ${pathConditions.filter((f) => routesList.includes(f.routeName)).map((t) => `${t.typeName}<T> extends true ? "${t.routeName}"`).join(": ")} : never` : ": never"}
258
+ ${pathConditions.length ? `: ${pathConditions.filter((f) => routesList.includes(f.routeName)).length ? pathConditions.filter((f) => routesList.includes(f.routeName)).map((t) => `${t.typeName}<T> extends true ? "${t.routeName}"`).join(": ") : "any"} : never` : ": never"}
257
259
  : never;
258
260
 
259
261
  `;
@@ -931,8 +933,7 @@ function createi18nRouterFile() {
931
933
  /* typescript */
932
934
  `
933
935
  import type { RouteLocationRaw } from 'vue-router';
934
- import { useLocalePath as _useLocalePath, useLocaleRoute as _useLocaleRoute} from 'vue-i18n-routing';
935
- import type {I18nCommonRoutingOptionsWithComposable} from 'vue-i18n-routing';
936
+ import { useLocalePath as _useLocalePath, useLocaleRoute as _useLocaleRoute} from '#imports';
936
937
  import type {TypedRouteLocationRawFromName, TypedLocationAsRelativeRaw, TypedRouteFromName} from './__router';
937
938
  import type {RoutesNamesList} from './__routes';
938
939
  ${returnIfTrue(
@@ -968,8 +969,8 @@ function createi18nRouterFile() {
968
969
  )}
969
970
  }
970
971
 
971
- export function useLocalePath(options?: I18nCommonRoutingOptionsWithComposable): TypedToLocalePath {
972
- return _useLocalePath(options) as any;
972
+ export function useLocalePath(): TypedToLocalePath {
973
+ return _useLocalePath() as any;
973
974
  }
974
975
 
975
976
  export interface TypedLocaleRoute {
@@ -981,8 +982,8 @@ function createi18nRouterFile() {
981
982
  }
982
983
 
983
984
 
984
- export function useLocaleRoute(options?: I18nCommonRoutingOptionsWithComposable): TypedLocaleRoute {
985
- return _useLocaleRoute(options) as any;
985
+ export function useLocaleRoute(): TypedLocaleRoute {
986
+ return _useLocaleRoute() as any;
986
987
  }
987
988
 
988
989
  `
package/dist/types.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import type { ModuleOptions } from './module'
2
+ import type { ModuleOptions } from './module.js'
3
3
 
4
4
 
5
5
  declare module '@nuxt/schema' {
@@ -13,4 +13,4 @@ declare module 'nuxt/schema' {
13
13
  }
14
14
 
15
15
 
16
- export type { ModuleOptions, default } from './module'
16
+ export type { ModuleOptions, default } from './module.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-typed-router",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "description": "Provide autocompletion for routes paths, names and params in Nuxt apps",
5
5
  "type": "module",
6
6
  "main": "./dist/module.cjs",
@@ -49,7 +49,7 @@
49
49
  "homepage": "https://nuxt-typed-router.vercel.app/",
50
50
  "repository": {
51
51
  "type": "git",
52
- "url": "git+https://victorgarciaesgi@github.com/victorgarciaesgi/nuxt-typed-router.git"
52
+ "url": "git+https://github.com/victorgarciaesgi/nuxt-typed-router.git"
53
53
  },
54
54
  "author": {
55
55
  "name": "Victor Garcia",
@@ -63,9 +63,9 @@
63
63
  "prettier": "^2.5.x || 3.x"
64
64
  },
65
65
  "dependencies": {
66
- "@nuxt/kit": "3.8.2",
66
+ "@nuxt/kit": "3.10.2",
67
67
  "chalk": "5.3.0",
68
- "defu": "6.1.3",
68
+ "defu": "6.1.4",
69
69
  "lodash-es": "4.17.21",
70
70
  "log-symbols": "6.0.0",
71
71
  "mkdirp": "3.0.1",
@@ -74,43 +74,42 @@
74
74
  "prettier": "3.1.0"
75
75
  },
76
76
  "devDependencies": {
77
- "@nuxt/devtools": "1.0.3",
78
- "@nuxt/schema": "3.8.2",
79
- "@nuxt/module-builder": "0.5.4",
80
- "@nuxt/test-utils": "3.8.1",
81
- "@nuxt/types": "2.17.2",
77
+ "@intlify/core-base": "9.9.1",
78
+ "@intlify/message-compiler": "9.9.1",
79
+ "@intlify/shared": "9.9.1",
80
+ "@intlify/vue-i18n-bridge": "1.1.0",
81
+ "@intlify/vue-router-bridge": "1.1.0",
82
+ "@nuxt/content": "2.12.0",
83
+ "@nuxt/devtools": "1.0.8",
84
+ "@nuxt/module-builder": "0.5.5",
85
+ "@nuxt/schema": "3.10.2",
86
+ "@nuxt/test-utils": "3.11.0",
87
+ "@nuxt/types": "2.17.3",
82
88
  "@nuxtjs/eslint-config-typescript": "12.1.0",
83
- "@nuxt/content": "2.9.0",
84
- "@nuxtjs/i18n": "8.0.0-rc.5",
89
+ "@nuxtjs/i18n": "8.1.1",
85
90
  "@nuxtjs/web-vitals": "0.2.6",
91
+ "@playwright/test": "1.41.2",
86
92
  "@types/lodash-es": "4.17.12",
87
- "@types/node": "20.10.0",
88
- "@typescript-eslint/eslint-plugin": "6.12.0",
89
- "@typescript-eslint/parser": "6.12.0",
90
- "@vue/test-utils": "2.4.2",
91
- "bumpp": "9.2.0",
92
- "changelogithub": "0.13.2",
93
+ "@types/node": "20.11.19",
94
+ "@typescript-eslint/eslint-plugin": "7.0.2",
95
+ "@typescript-eslint/parser": "7.0.2",
96
+ "@vue/test-utils": "2.4.4",
97
+ "bumpp": "9.3.0",
98
+ "changelogithub": "0.13.3",
93
99
  "cross-env": "7.0.3",
94
- "eslint": "8.54.0",
95
- "eslint-config-prettier": "9.0.0",
96
- "eslint-plugin-vue": "9.18.1",
97
- "nuxt": "3.8.2",
100
+ "eslint": "8.56.0",
101
+ "eslint-config-prettier": "9.1.0",
102
+ "eslint-plugin-vue": "9.21.1",
103
+ "nuxt": "3.10.2",
98
104
  "nuxt-seo-kit": "1.3.13",
99
- "playwright": "1.40.1",
100
- "@playwright/test": "1.40.1",
101
- "tsd": "0.29.0",
102
- "typescript": "5.3.2",
103
- "vitest": "0.34.6",
104
- "vue": "3.3.10",
105
- "vue-eslint-parser": "9.3.2",
105
+ "playwright": "1.41.2",
106
+ "tsd": "0.30.5",
107
+ "typescript": "5.3.3",
108
+ "vitest": "1.3.1",
109
+ "vue": "3.4.19",
110
+ "vue-eslint-parser": "9.4.2",
111
+ "vue-i18n": "9.9.1",
106
112
  "vue-router": "4.2.5",
107
- "vue-tsc": "1.8.22",
108
- "vue-i18n": "9.8.0",
109
- "@intlify/shared": "9.8.0",
110
- "@intlify/message-compiler": "9.8.0",
111
- "@intlify/core-base": "9.8.0",
112
- "@intlify/vue-router-bridge": "1.1.0",
113
- "@intlify/vue-i18n-bridge": "1.1.0",
114
- "vue-i18n-routing": "1.2.0"
113
+ "vue-tsc": "1.8.27"
115
114
  }
116
115
  }