nuxt-typed-router 3.0.0-beta.0 → 3.0.0-beta.2

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/README.md CHANGED
@@ -16,11 +16,12 @@
16
16
  [![npm downloads][npm-total-downloads-src]][npm-downloads-href]
17
17
  <img src='https://img.shields.io/npm/l/nuxt-typed-router.svg'>
18
18
 
19
- ## Provide a type safe router to Nuxt with auto-generated typed definitions for route names and autocompletion for route params
19
+ ## Provide a type safe router to Nuxt with auto-generated typed definitions for route path, name and params
20
20
 
21
- - `NuxtLink` route autocomplete and params type-check
22
- - `useRouter`, `useRoute` and `navigateTo` route autocomplete and params type-check
21
+ - Supports all programmatic navigation utils (`NuxtLink`, `useRouter`, `navigateTo`, `useRoute`, `useLocalePath`, etc...)
23
22
  - Supports optional params and catchAll routes
23
+ - Autocompletes routes paths, names and params
24
+ - Throw error if route path is invalid
24
25
  - Out of the box `i18n` support
25
26
  - Supports routes extended by config and modules
26
27
 
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "nuxt": "^3.0.0",
6
6
  "bridge": false
7
7
  },
8
- "version": "3.0.0-beta.0"
8
+ "version": "3.0.0-beta.2"
9
9
  }
package/dist/module.mjs CHANGED
@@ -527,8 +527,8 @@ function createTypedRouterDefinitionFile() {
527
527
  $props: TypedNuxtLinkProps<P>;
528
528
  };
529
529
 
530
- declare module '@vue/runtime-core' {
531
- export interface GlobalComponents {
530
+ declare module 'vue' {
531
+ interface GlobalComponents {
532
532
  NuxtLink: TypedNuxtLink;
533
533
  }
534
534
  }
@@ -1489,16 +1489,15 @@ const module = defineNuxtModule({
1489
1489
  ...nuxt.options.alias,
1490
1490
  "@typed-router": resolve(`${rootDir}/.nuxt/typed-router`)
1491
1491
  };
1492
- nuxt.options.typescript.tsConfig = {
1493
- include: ["./typed-router/typed-router.d.ts"],
1494
- ...moduleOptions.experimentalPathCheck && {
1495
- // Enable Volar components generics https://github.com/vuejs/rfcs/discussions/436
1496
- vueCompilerOptions: {
1492
+ nuxt.hook("prepare:types", (options) => {
1493
+ options.tsConfig.include?.push("./typed-router/typed-router.d.ts");
1494
+ if (moduleOptions.experimentalPathCheck) {
1495
+ options.tsConfig.vueCompilerOptions = {
1497
1496
  jsxTemplates: true,
1498
1497
  experimentalRfc436: true
1499
- }
1498
+ };
1500
1499
  }
1501
- };
1500
+ });
1502
1501
  if (nuxt.options.dev) {
1503
1502
  nuxt.hook("devtools:customTabs", (tabs) => {
1504
1503
  tabs.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-typed-router",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Provide autocompletion for paths, routes names and params in Nuxt apps",
5
5
  "type": "module",
6
6
  "main": "./dist/module.cjs",
@@ -24,7 +24,7 @@
24
24
  "test:prepare-fixtures": "nuxi prepare test/fixtures/simple && nuxi prepare test/fixtures/withOptions && nuxi prepare test/fixtures/complex",
25
25
  "test:fixtures": "vitest run --dir test",
26
26
  "test:types": "pnpm run typecheck && pnpm run test:vue",
27
- "test:vue": "vue-tsc -p test/fixtures/simple/tsconfig.json --noEmit && vue-tsc -p test/fixtures/complex/tsconfig.json --noEmit && vue-tsc -p test/fixtures/withOptions/tsconfig.json --noEmit",
27
+ "test:vue": "vue-tsc -p test/fixtures/simple/tsconfig.json --noEmit && vue-tsc -p test/fixtures/complex/tsconfig.json --noEmit",
28
28
  "test": "pnpm run dev:prepare && pnpm run test:types && pnpm run test:fixtures",
29
29
  "lint": "eslint --ext .ts --ext .vue .",
30
30
  "docs:dev": "cd docs && pnpm run dev",
@@ -59,7 +59,7 @@
59
59
  "url": "https://github.com/victorgarciaesgi/nuxt-typed-router/issues"
60
60
  },
61
61
  "dependencies": {
62
- "@nuxt/kit": "^3.2.0",
62
+ "@nuxt/kit": "^3.2.2",
63
63
  "chalk": "^5.2.0",
64
64
  "defu": "^6.1.2",
65
65
  "lodash-es": "^4.17.21",
@@ -70,32 +70,32 @@
70
70
  "prettier": "2.8.4"
71
71
  },
72
72
  "devDependencies": {
73
- "@nuxt/devtools": "^0.1.0",
73
+ "@nuxt/devtools": "^0.1.4",
74
74
  "@nuxt/module-builder": "^0.2.1",
75
- "@nuxt/test-utils": "^3.2.0",
75
+ "@nuxt/test-utils": "^3.2.2",
76
76
  "@nuxt/types": "^2.16.0",
77
77
  "@nuxtjs/eslint-config-typescript": "^12.0.0",
78
78
  "@nuxtjs/i18n": "8.0.0-beta.9",
79
79
  "@nuxtjs/web-vitals": "^0.2.2",
80
80
  "@types/lodash-es": "^4.17.6",
81
- "@types/mkdirp": "^1.0.2",
82
- "@types/node": "^18.13.0",
81
+ "@types/mkdirp": "^2.0.0",
82
+ "@types/node": "^18.14.0",
83
83
  "@types/prettier": "^2.7.2",
84
- "@typescript-eslint/eslint-plugin": "^5.51.0",
85
- "@typescript-eslint/parser": "^5.51.0",
86
- "@vue/test-utils": "^2.2.10",
84
+ "@typescript-eslint/eslint-plugin": "^5.52.0",
85
+ "@typescript-eslint/parser": "^5.52.0",
86
+ "@vue/test-utils": "^2.3.0",
87
87
  "cross-env": "^7.0.3",
88
- "eslint": "8.33.0",
88
+ "eslint": "8.34.0",
89
89
  "eslint-config-prettier": "^8.6.0",
90
90
  "eslint-plugin-vue": "^9.9.0",
91
- "nuxt": "3.2.0",
91
+ "nuxt": "3.2.2",
92
92
  "playwright": "1.30.0",
93
93
  "standard-version": "^9.5.0",
94
94
  "tsd": "^0.25.0",
95
95
  "typescript": "^4.9.5",
96
- "vitest": "^0.28.2",
96
+ "vitest": "^0.28.5",
97
97
  "vue-eslint-parser": "^9.1.0",
98
98
  "vue-router": "^4.1.6",
99
- "vue-tsc": "^1.0.24"
99
+ "vue-tsc": "^1.1.4"
100
100
  }
101
101
  }