nuxt-typed-router 1.1.2 → 1.2.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 +2 -6
- package/dist/module.json +2 -2
- package/dist/module.mjs +7 -3
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -57,10 +57,8 @@ npm install -D nuxt-typed-router@legacy
|
|
|
57
57
|
First, register the module in the `nuxt.config.ts`
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
|
-
import TypedRouter from 'nuxt-typed-router';
|
|
61
|
-
|
|
62
60
|
export default defineNuxtConfig({
|
|
63
|
-
buildModules: [
|
|
61
|
+
buildModules: ['nuxt-typed-router'],
|
|
64
62
|
nuxtTypedRouter: {
|
|
65
63
|
// options
|
|
66
64
|
},
|
|
@@ -101,10 +99,8 @@ The module will generate 4 files each time you modify the `pages` folder :
|
|
|
101
99
|
You can specify the output dir of the generated files in your configuration. It defaults to `<srcDir>/generated`
|
|
102
100
|
|
|
103
101
|
```ts
|
|
104
|
-
import TypedRouter from 'nuxt-typed-router';
|
|
105
|
-
|
|
106
102
|
export default defineNuxtConfig({
|
|
107
|
-
buildModules: [
|
|
103
|
+
buildModules: ['nuxt-typed-router'],
|
|
108
104
|
nuxtTypedRouter: {
|
|
109
105
|
outDir: './generated',
|
|
110
106
|
},
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -274,7 +274,7 @@ const staticDeclarations = `
|
|
|
274
274
|
): Promise<NavigationFailure | void | undefined>;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
declare module '
|
|
277
|
+
declare module 'nuxt/dist/app/nuxt' {
|
|
278
278
|
export interface NuxtApp {
|
|
279
279
|
$typedRouter: TypedRouter;
|
|
280
280
|
$routesList: RouteListDecl;
|
|
@@ -415,11 +415,15 @@ const module = defineNuxtModule({
|
|
|
415
415
|
meta: {
|
|
416
416
|
name: "nuxt-typed-router",
|
|
417
417
|
configKey: "nuxtTypedRouter",
|
|
418
|
-
compatibility: { nuxt: "^3.0.0", bridge: false }
|
|
418
|
+
compatibility: { nuxt: "^3.0.0-rc.1", bridge: false }
|
|
419
|
+
},
|
|
420
|
+
defaults: {
|
|
421
|
+
outDir: `./generated`,
|
|
422
|
+
routesObjectName: "routerPagesNames"
|
|
419
423
|
},
|
|
420
424
|
setup(moduleOptions, nuxt) {
|
|
421
425
|
const srcDir = nuxt.options.srcDir;
|
|
422
|
-
const { outDir
|
|
426
|
+
const { outDir, routesObjectName } = moduleOptions;
|
|
423
427
|
nuxt.hook("pages:extend", () => routeHook(outDir, routesObjectName, srcDir, nuxt));
|
|
424
428
|
routeHook(outDir, routesObjectName, srcDir, nuxt);
|
|
425
429
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-typed-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Provide autocompletion for pages route names generated by Nuxt router",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -51,28 +51,28 @@
|
|
|
51
51
|
"url": "https://github.com/victorgarciaesgi/nuxt-typed-router/issues"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@nuxt/kit": "
|
|
54
|
+
"@nuxt/kit": "^3.0.0-rc.9",
|
|
55
55
|
"chalk": "^4.1.2",
|
|
56
56
|
"lodash-es": "^4.17.21",
|
|
57
57
|
"log-symbols": "^5.1.0",
|
|
58
58
|
"mkdirp": "^1.0.4",
|
|
59
59
|
"pathe": "^0.2.0",
|
|
60
|
-
"prettier": "^2.
|
|
60
|
+
"prettier": "^2.7.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@nuxt/module-builder": "latest",
|
|
64
64
|
"@nuxt/types": "^2.15.8",
|
|
65
|
-
"@nuxtjs/eslint-config-typescript": "
|
|
65
|
+
"@nuxtjs/eslint-config-typescript": "latest",
|
|
66
66
|
"@types/lodash-es": "^4.17.6",
|
|
67
67
|
"@types/mkdirp": "^1.0.2",
|
|
68
68
|
"@types/node": "^17.0.23",
|
|
69
|
-
"@types/prettier": "^2.
|
|
69
|
+
"@types/prettier": "^2.7.0",
|
|
70
70
|
"cross-env": "^7.0.3",
|
|
71
|
-
"eslint": "8.
|
|
71
|
+
"eslint": "8.23.0",
|
|
72
72
|
"eslint-config-prettier": "^8.5.0",
|
|
73
|
-
"
|
|
73
|
+
"nuxt": "^3.0.0-rc.9",
|
|
74
74
|
"typescript": "^4.6.3",
|
|
75
|
-
"vitest": "^0.
|
|
76
|
-
"vue-router": "^4.
|
|
75
|
+
"vitest": "^0.22.1",
|
|
76
|
+
"vue-router": "^4.1.5"
|
|
77
77
|
}
|
|
78
78
|
}
|