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 +4 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -9
- package/package.json +14 -14
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
|
|
19
|
+
## Provide a type safe router to Nuxt with auto-generated typed definitions for route path, name and params
|
|
20
20
|
|
|
21
|
-
- `NuxtLink`
|
|
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
package/dist/module.mjs
CHANGED
|
@@ -527,8 +527,8 @@ function createTypedRouterDefinitionFile() {
|
|
|
527
527
|
$props: TypedNuxtLinkProps<P>;
|
|
528
528
|
};
|
|
529
529
|
|
|
530
|
-
declare module '
|
|
531
|
-
|
|
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
|
|
1493
|
-
include
|
|
1494
|
-
|
|
1495
|
-
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
73
|
+
"@nuxt/devtools": "^0.1.4",
|
|
74
74
|
"@nuxt/module-builder": "^0.2.1",
|
|
75
|
-
"@nuxt/test-utils": "^3.2.
|
|
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": "^
|
|
82
|
-
"@types/node": "^18.
|
|
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.
|
|
85
|
-
"@typescript-eslint/parser": "^5.
|
|
86
|
-
"@vue/test-utils": "^2.
|
|
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.
|
|
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.
|
|
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.
|
|
96
|
+
"vitest": "^0.28.5",
|
|
97
97
|
"vue-eslint-parser": "^9.1.0",
|
|
98
98
|
"vue-router": "^4.1.6",
|
|
99
|
-
"vue-tsc": "^1.
|
|
99
|
+
"vue-tsc": "^1.1.4"
|
|
100
100
|
}
|
|
101
101
|
}
|