nuxt-typed-router 3.0.9 → 3.1.0-beta.1
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 +1 -10
- package/dist/module.d.ts +1 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +64 -53
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ npm install -D nuxt-typed-router
|
|
|
66
66
|
pnpm install -D nuxt-typed-router
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
### Nuxt 2 legacy
|
|
69
|
+
### Nuxt 2 legacy (not maintained)
|
|
70
70
|
|
|
71
71
|
Nuxt 2 version is no longer maintained, but still available in [`nuxt2` branch](https://github.com/victorgarciaesgi/nuxt-typed-router/tree/nuxt2)
|
|
72
72
|
It only has route name autocomplete functionnality
|
|
@@ -86,15 +86,6 @@ export default defineNuxtConfig({
|
|
|
86
86
|
});
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
# Roadmap
|
|
91
|
-
|
|
92
|
-
- [x] Add `path` autocomplete with TS string templates
|
|
93
|
-
- [x] Add support for `validate` and `redirect` in `definePageMeta`
|
|
94
|
-
- [x] Add `strict` option to prevent path navigation
|
|
95
|
-
- [ ] Enforce strong params typing depending of origin route
|
|
96
|
-
|
|
97
|
-
|
|
98
89
|
## Development
|
|
99
90
|
|
|
100
91
|
1. Clone this repository
|
package/dist/module.d.ts
CHANGED
|
@@ -2,13 +2,12 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
2
2
|
|
|
3
3
|
interface ModuleOptions {
|
|
4
4
|
/**
|
|
5
|
-
* ⛔️ Experimental, disable it if you encounter problems
|
|
6
5
|
*
|
|
7
6
|
* Enables path autocomplete and path validity for programmatic validation
|
|
8
7
|
*
|
|
9
8
|
* @default true
|
|
10
9
|
*/
|
|
11
|
-
|
|
10
|
+
pathCheck?: boolean;
|
|
12
11
|
/**
|
|
13
12
|
* Set to false if you don't want a plugin generated
|
|
14
13
|
* @default false
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -16,7 +16,7 @@ class ModuleOptionsStore {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
this.plugin = false;
|
|
18
18
|
this.strict = false;
|
|
19
|
-
this.
|
|
19
|
+
this.pathCheck = true;
|
|
20
20
|
this.autoImport = false;
|
|
21
21
|
this.rootDir = "";
|
|
22
22
|
this.buildDir = "";
|
|
@@ -49,8 +49,8 @@ class ModuleOptionsStore {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
if (options.
|
|
53
|
-
this.
|
|
52
|
+
if (options.pathCheck != null) {
|
|
53
|
+
this.pathCheck = options.pathCheck;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
getResolvedStrictOptions() {
|
|
@@ -317,7 +317,7 @@ function createRoutesTypesFile({
|
|
|
317
317
|
|
|
318
318
|
function createTypedRouterFile() {
|
|
319
319
|
const strictOptions = moduleOptionStore.getResolvedStrictOptions();
|
|
320
|
-
const { i18n,
|
|
320
|
+
const { i18n, pathCheck } = moduleOptionStore;
|
|
321
321
|
return (
|
|
322
322
|
/* typescript */
|
|
323
323
|
`
|
|
@@ -339,7 +339,7 @@ function createTypedRouterFile() {
|
|
|
339
339
|
RoutesParamsRecordResolved,
|
|
340
340
|
} from './__routes';
|
|
341
341
|
${returnIfTrue(
|
|
342
|
-
|
|
342
|
+
pathCheck,
|
|
343
343
|
`import type {TypedPathParameter, RouteNameFromPath} from './__paths';`
|
|
344
344
|
)}
|
|
345
345
|
import type { HasOneRequiredParameter } from './__types_utils';
|
|
@@ -355,24 +355,29 @@ function createTypedRouterFile() {
|
|
|
355
355
|
| (Omit<Exclude<RouteLocationRaw, string>, 'name' | 'params'> & RoutesNamedLocations)
|
|
356
356
|
| Omit<RouteLocationPathRaw, 'path'>
|
|
357
357
|
${returnIfTrue(
|
|
358
|
-
|
|
358
|
+
pathCheck && !strictOptions.router.strictRouteLocation,
|
|
359
359
|
`& {path?: TypedPathParameter<T>}`
|
|
360
360
|
)}
|
|
361
|
-
${returnIfTrue(!
|
|
361
|
+
${returnIfTrue(!pathCheck && !strictOptions.router.strictToArgument, ` | string`)}
|
|
362
362
|
;
|
|
363
363
|
|
|
364
364
|
|
|
365
365
|
/**
|
|
366
366
|
* Alternative version of {@link TypedRouteLocationRaw} but with a name generic
|
|
367
367
|
*/
|
|
368
|
-
export type TypedRouteLocationRawFromName<T extends RoutesNamesList, P extends string = string> =
|
|
368
|
+
export type TypedRouteLocationRawFromName<T extends RoutesNamesList, P extends string = string, E extends boolean = false> =
|
|
369
369
|
| (Omit<Exclude<RouteLocationRaw, string>, 'name' | 'params'> & TypedLocationAsRelativeRaw<T>)
|
|
370
370
|
| Omit<RouteLocationPathRaw, 'path'>
|
|
371
371
|
${returnIfTrue(
|
|
372
|
-
|
|
372
|
+
pathCheck && !strictOptions.router.strictRouteLocation,
|
|
373
373
|
`& {path?: TypedPathParameter<P>}`
|
|
374
374
|
)}
|
|
375
|
-
${returnIfTrue(!
|
|
375
|
+
${returnIfTrue(!pathCheck && !strictOptions.router.strictToArgument, ` | string`)}
|
|
376
|
+
${returnIfTrue(
|
|
377
|
+
pathCheck && strictOptions.router.strictToArgument,
|
|
378
|
+
`| (E extends true ? string : void)`
|
|
379
|
+
)}
|
|
380
|
+
|
|
376
381
|
|
|
377
382
|
/**
|
|
378
383
|
* Generic providing inference and dynamic inclusion of \`params\` property
|
|
@@ -419,7 +424,7 @@ function createTypedRouterFile() {
|
|
|
419
424
|
currentLocation?: TypedRouteLocationRaw
|
|
420
425
|
): TypedRouteLocationFromName<T>;
|
|
421
426
|
${returnIfTrue(
|
|
422
|
-
|
|
427
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
423
428
|
`resolve<T extends string>(to: TypedPathParameter<T>, currentLocation?: TypedRouteLocationRaw): TypedRouteLocationFromName<RouteNameFromPath<T>>;`
|
|
424
429
|
)}
|
|
425
430
|
/**
|
|
@@ -430,7 +435,7 @@ function createTypedRouterFile() {
|
|
|
430
435
|
*/
|
|
431
436
|
push<T extends RoutesNamesList, P extends string>(to: TypedRouteLocationRawFromName<T, P>): Promise<NavigationFailure | void | undefined>;
|
|
432
437
|
${returnIfTrue(
|
|
433
|
-
|
|
438
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
434
439
|
`push<T extends string>(to: TypedPathParameter<T>): Promise<NavigationFailure | void | undefined>;`
|
|
435
440
|
)}
|
|
436
441
|
/**
|
|
@@ -441,7 +446,7 @@ function createTypedRouterFile() {
|
|
|
441
446
|
*/
|
|
442
447
|
replace<T extends RoutesNamesList, P extends string>(to: TypedRouteLocationRawFromName<T, P>): Promise<NavigationFailure | void | undefined>;
|
|
443
448
|
${returnIfTrue(
|
|
444
|
-
|
|
449
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
445
450
|
`replace<T extends string>(to: TypedPathParameter<T>): Promise<NavigationFailure | void | undefined>;`
|
|
446
451
|
)}
|
|
447
452
|
}
|
|
@@ -487,7 +492,7 @@ function createTypedRouterFile() {
|
|
|
487
492
|
|
|
488
493
|
function createTypedRouterDefinitionFile() {
|
|
489
494
|
const strictOptions = moduleOptionStore.getResolvedStrictOptions();
|
|
490
|
-
const { plugin, autoImport, i18n,
|
|
495
|
+
const { plugin, autoImport, i18n, pathCheck } = moduleOptionStore;
|
|
491
496
|
return (
|
|
492
497
|
/* typescript */
|
|
493
498
|
`
|
|
@@ -507,7 +512,7 @@ function createTypedRouterDefinitionFile() {
|
|
|
507
512
|
|
|
508
513
|
import {definePageMeta as _definePageMeta} from './__definePageMeta';
|
|
509
514
|
|
|
510
|
-
${returnIfTrue(
|
|
515
|
+
${returnIfTrue(pathCheck, `import type {TypedPathParameter} from './__paths';`)}
|
|
511
516
|
|
|
512
517
|
|
|
513
518
|
declare global {
|
|
@@ -533,32 +538,34 @@ function createTypedRouterDefinitionFile() {
|
|
|
533
538
|
)}
|
|
534
539
|
}
|
|
535
540
|
|
|
536
|
-
type TypedNuxtLinkProps<T extends string> = Omit<NuxtLinkProps, 'to'> &
|
|
541
|
+
type TypedNuxtLinkProps<T extends string, E extends boolean = false> = Omit<NuxtLinkProps, 'to' | 'external'> &
|
|
537
542
|
{
|
|
538
543
|
to:
|
|
539
544
|
| Omit<Exclude<RouteLocationRaw, string>, 'name' | 'params'> & RoutesNamedLocations
|
|
540
545
|
| Omit<RouteLocationPathRaw, 'path'>
|
|
541
546
|
${returnIfTrue(
|
|
542
|
-
|
|
543
|
-
`& {path?: TypedPathParameter<T>}`
|
|
547
|
+
pathCheck && !strictOptions.NuxtLink.strictRouteLocation,
|
|
548
|
+
`& {path?: (E extends true ? string : TypedPathParameter<T>)}`
|
|
544
549
|
)}
|
|
550
|
+
${returnIfTrue(!pathCheck && !strictOptions.NuxtLink.strictToArgument, ` | string`)}
|
|
545
551
|
${returnIfTrue(
|
|
546
|
-
|
|
547
|
-
` | string`
|
|
552
|
+
pathCheck && strictOptions.NuxtLink.strictToArgument,
|
|
553
|
+
` | (E extends true ? string : void)`
|
|
548
554
|
)}
|
|
549
555
|
${returnIfTrue(
|
|
550
|
-
|
|
551
|
-
` | TypedPathParameter<T
|
|
552
|
-
)}
|
|
556
|
+
pathCheck && !strictOptions.NuxtLink.strictToArgument,
|
|
557
|
+
` | (E extends true ? string : TypedPathParameter<T>)`
|
|
558
|
+
)},
|
|
559
|
+
external?: E
|
|
553
560
|
}
|
|
554
561
|
|
|
555
562
|
|
|
556
563
|
|
|
557
|
-
export type TypedNuxtLink = new <P extends string>(props: TypedNuxtLinkProps<P>) => Omit<
|
|
564
|
+
export type TypedNuxtLink = new <P extends string, E extends boolean = false>(props: TypedNuxtLinkProps<P, E>) => Omit<
|
|
558
565
|
typeof NuxtLink,
|
|
559
566
|
'$props'
|
|
560
567
|
> & {
|
|
561
|
-
$props: TypedNuxtLinkProps<P>;
|
|
568
|
+
$props: TypedNuxtLinkProps<P, E>;
|
|
562
569
|
};
|
|
563
570
|
|
|
564
571
|
// Declare runtime-core instead of vue for compatibility issues with pnpm
|
|
@@ -590,7 +597,7 @@ function createTypedRouterDefinitionFile() {
|
|
|
590
597
|
}
|
|
591
598
|
|
|
592
599
|
function createIndexFile() {
|
|
593
|
-
const { i18n,
|
|
600
|
+
const { i18n, pathCheck } = moduleOptionStore;
|
|
594
601
|
return (
|
|
595
602
|
/* typescript */
|
|
596
603
|
`
|
|
@@ -622,7 +629,7 @@ function createIndexFile() {
|
|
|
622
629
|
export { helpers } from './__helpers';
|
|
623
630
|
|
|
624
631
|
${returnIfTrue(
|
|
625
|
-
|
|
632
|
+
pathCheck,
|
|
626
633
|
`export type { ValidatePath, RoutePathSchema, TypedPathParameter, RouteNameFromPath } from './__paths';`
|
|
627
634
|
)}
|
|
628
635
|
${returnIfTrue(i18n, `export {useLocalePath, useLocaleRoute} from './__i18n-router';`)}
|
|
@@ -725,7 +732,7 @@ function createUseTypedRouterFile() {
|
|
|
725
732
|
|
|
726
733
|
function createNavigateToFile() {
|
|
727
734
|
const { router } = moduleOptionStore.getResolvedStrictOptions();
|
|
728
|
-
const {
|
|
735
|
+
const { pathCheck } = moduleOptionStore;
|
|
729
736
|
return (
|
|
730
737
|
/* typescript */
|
|
731
738
|
`
|
|
@@ -735,10 +742,14 @@ function createNavigateToFile() {
|
|
|
735
742
|
import type { TypedRouteLocationRawFromName, TypedRouteFromName, TypedRoute } from './__router';
|
|
736
743
|
import type { RoutesNamesList } from './__routes';
|
|
737
744
|
${returnIfTrue(
|
|
738
|
-
|
|
745
|
+
pathCheck,
|
|
739
746
|
`import type {TypedPathParameter, RouteNameFromPath} from './__paths';`
|
|
740
747
|
)}
|
|
741
748
|
|
|
749
|
+
type TypedNavigateToOptions<E extends boolean> = Omit<NavigateToOptions, 'external'> & {
|
|
750
|
+
external?: E
|
|
751
|
+
}
|
|
752
|
+
|
|
742
753
|
/**
|
|
743
754
|
* Typed clone of \`navigateTo\`
|
|
744
755
|
*
|
|
@@ -751,15 +762,15 @@ function createNavigateToFile() {
|
|
|
751
762
|
|
|
752
763
|
|
|
753
764
|
interface NavigateToFunction {
|
|
754
|
-
<T extends RoutesNamesList, P extends string>(
|
|
755
|
-
to: TypedRouteLocationRawFromName<T, P>,
|
|
756
|
-
options?:
|
|
765
|
+
<T extends RoutesNamesList, P extends string, E extends boolean = false>(
|
|
766
|
+
to: TypedRouteLocationRawFromName<T, P, E>,
|
|
767
|
+
options?: TypedNavigateToOptions<E>
|
|
757
768
|
) : Promise<void | NavigationFailure | TypedRouteFromName<T>>
|
|
758
769
|
${returnIfTrue(
|
|
759
|
-
|
|
760
|
-
`<T extends string>(
|
|
761
|
-
to: TypedPathParameter<T
|
|
762
|
-
options?:
|
|
770
|
+
pathCheck && !router.strictToArgument,
|
|
771
|
+
`<T extends string, E extends boolean = false>(
|
|
772
|
+
to: (E extends true ? string : TypedPathParameter<T>),
|
|
773
|
+
options?: TypedNavigateToOptions<E>
|
|
763
774
|
) : Promise<void | NavigationFailure | TypedRouteFromName<RouteNameFromPath<T>>>`
|
|
764
775
|
)}
|
|
765
776
|
}
|
|
@@ -795,7 +806,7 @@ function createTypeUtilsRuntimeFile() {
|
|
|
795
806
|
|
|
796
807
|
function createi18nRouterFile() {
|
|
797
808
|
const { router } = moduleOptionStore.getResolvedStrictOptions();
|
|
798
|
-
const { i18nOptions,
|
|
809
|
+
const { i18nOptions, pathCheck, i18nLocales } = moduleOptionStore;
|
|
799
810
|
return (
|
|
800
811
|
/* typescript */
|
|
801
812
|
`
|
|
@@ -804,7 +815,7 @@ function createi18nRouterFile() {
|
|
|
804
815
|
import type {TypedRouteLocationRawFromName, TypedLocationAsRelativeRaw, TypedRouteFromName} from './__router';
|
|
805
816
|
import type {RoutesNamesList} from './__routes';
|
|
806
817
|
${returnIfTrue(
|
|
807
|
-
|
|
818
|
+
pathCheck,
|
|
808
819
|
`import type {TypedLocalePathParameter, RouteNameFromLocalePath} from './__paths';`
|
|
809
820
|
)}
|
|
810
821
|
|
|
@@ -818,7 +829,7 @@ function createi18nRouterFile() {
|
|
|
818
829
|
(Omit<Exclude<RouteLocationRaw, string>, 'name' | 'params'> & TypedLocationAsRelativeRaw<T>)
|
|
819
830
|
>
|
|
820
831
|
${returnIfTrue(
|
|
821
|
-
|
|
832
|
+
pathCheck && !router.strictToArgument,
|
|
822
833
|
`<T extends string>(
|
|
823
834
|
to: TypedLocalePathParameter<T>,
|
|
824
835
|
locale?: I18nLocales | undefined
|
|
@@ -833,7 +844,7 @@ function createi18nRouterFile() {
|
|
|
833
844
|
export interface TypedLocaleRoute {
|
|
834
845
|
<T extends RoutesNamesList, P extends string>(to: TypedRouteLocationRawFromName<T, P>, locale?: I18nLocales | undefined) : TypedRouteFromName<T>
|
|
835
846
|
${returnIfTrue(
|
|
836
|
-
|
|
847
|
+
pathCheck && !router.strictToArgument,
|
|
837
848
|
` <T extends string>(to: TypedLocalePathParameter<T>, locale?: I18nLocales | undefined) : TypedRouteFromName<RouteNameFromLocalePath<T>>;`
|
|
838
849
|
)}
|
|
839
850
|
}
|
|
@@ -1057,7 +1068,7 @@ function createPathsFiles({ routesPaths }) {
|
|
|
1057
1068
|
|
|
1058
1069
|
function createDefinePageMetaFile() {
|
|
1059
1070
|
const strictOptions = moduleOptionStore.getResolvedStrictOptions();
|
|
1060
|
-
const {
|
|
1071
|
+
const { pathCheck } = moduleOptionStore;
|
|
1061
1072
|
return (
|
|
1062
1073
|
/* typescript */
|
|
1063
1074
|
`
|
|
@@ -1066,7 +1077,7 @@ function createDefinePageMetaFile() {
|
|
|
1066
1077
|
import type {PageMeta, NuxtError} from '#app'
|
|
1067
1078
|
import type {TypedRouteFromName, TypedRoute, TypedRouteLocationRawFromName, TypedRouteLocationRaw} from './__router';
|
|
1068
1079
|
import type {RoutesNamesList} from './__routes';
|
|
1069
|
-
${returnIfTrue(
|
|
1080
|
+
${returnIfTrue(pathCheck, `import type {TypedPathParameter} from './__paths';`)}
|
|
1070
1081
|
|
|
1071
1082
|
type FilteredPageMeta = {
|
|
1072
1083
|
[T in keyof PageMeta as [unknown] extends [PageMeta[T]] ? never : T]: PageMeta[T];
|
|
@@ -1118,7 +1129,7 @@ export function definePageMeta<P extends string, U extends RoutesNamesList>(
|
|
|
1118
1129
|
meta: TypedPageMeta<never> & { redirect: TypedRouteLocationRawFromName<U, P> }
|
|
1119
1130
|
): void;
|
|
1120
1131
|
${returnIfTrue(
|
|
1121
|
-
|
|
1132
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
1122
1133
|
`export function definePageMeta<P extends string>(
|
|
1123
1134
|
meta: TypedPageMeta<never> & { redirect: TypedPathParameter<P> }
|
|
1124
1135
|
): void;`
|
|
@@ -1126,7 +1137,7 @@ ${returnIfTrue(
|
|
|
1126
1137
|
export function definePageMeta<P extends string = string>(
|
|
1127
1138
|
meta: TypedPageMeta<never> & {
|
|
1128
1139
|
redirect?: (to: TypedRoute) => TypedRouteLocationRaw<P> ${returnIfTrue(
|
|
1129
|
-
|
|
1140
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
1130
1141
|
` | TypedPathParameter<P>`
|
|
1131
1142
|
)};
|
|
1132
1143
|
}
|
|
@@ -1134,7 +1145,7 @@ export function definePageMeta<P extends string = string>(
|
|
|
1134
1145
|
export function definePageMeta<P extends string = string>(
|
|
1135
1146
|
meta: TypedPageMeta<never> & {
|
|
1136
1147
|
redirect?: () => TypedRouteLocationRaw<P> ${returnIfTrue(
|
|
1137
|
-
|
|
1148
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
1138
1149
|
` | TypedPathParameter<P>`
|
|
1139
1150
|
)};
|
|
1140
1151
|
}
|
|
@@ -1145,7 +1156,7 @@ export function definePageMeta<
|
|
|
1145
1156
|
U extends RoutesNamesList
|
|
1146
1157
|
>(routeName: T, meta: TypedPageMeta<T> & { redirect: TypedRouteLocationRawFromName<U, P> }): void;
|
|
1147
1158
|
${returnIfTrue(
|
|
1148
|
-
|
|
1159
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
1149
1160
|
`export function definePageMeta<T extends RoutesNamesList, P extends string>(
|
|
1150
1161
|
routeName: T,
|
|
1151
1162
|
meta: TypedPageMeta<T> & { redirect: TypedPathParameter<P> }
|
|
@@ -1159,7 +1170,7 @@ export function definePageMeta<
|
|
|
1159
1170
|
routeName: T,
|
|
1160
1171
|
meta: TypedPageMeta<T> & {
|
|
1161
1172
|
redirect?: (to: TypedRouteFromName<T>) => TypedRouteLocationRaw<P> ${returnIfTrue(
|
|
1162
|
-
|
|
1173
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
1163
1174
|
` | TypedPathParameter<P>`
|
|
1164
1175
|
)};
|
|
1165
1176
|
}
|
|
@@ -1168,7 +1179,7 @@ export function definePageMeta<T extends RoutesNamesList, P extends string>(
|
|
|
1168
1179
|
routeName: T,
|
|
1169
1180
|
meta: TypedPageMeta<T> & {
|
|
1170
1181
|
redirect?: () => TypedRouteLocationRaw<P> ${returnIfTrue(
|
|
1171
|
-
|
|
1182
|
+
pathCheck && !strictOptions.router.strictToArgument,
|
|
1172
1183
|
` | TypedPathParameter<P>`
|
|
1173
1184
|
)};
|
|
1174
1185
|
}
|
|
@@ -1187,7 +1198,7 @@ export function definePageMeta(metaOrName: any, meta?: any): void {
|
|
|
1187
1198
|
}
|
|
1188
1199
|
|
|
1189
1200
|
function createHelpersFile() {
|
|
1190
|
-
const {
|
|
1201
|
+
const { pathCheck } = moduleOptionStore;
|
|
1191
1202
|
return (
|
|
1192
1203
|
/* typescript */
|
|
1193
1204
|
`
|
|
@@ -1198,7 +1209,7 @@ function createHelpersFile() {
|
|
|
1198
1209
|
import type { TypedRouteLocationRawFromName, TypedLocationAsRelativeRaw } from './__router';
|
|
1199
1210
|
import type { RoutesNamesList } from './__routes';
|
|
1200
1211
|
${returnIfTrue(
|
|
1201
|
-
|
|
1212
|
+
pathCheck,
|
|
1202
1213
|
`import type {TypedPathParameter, RouteNameFromPath} from './__paths';`
|
|
1203
1214
|
)}
|
|
1204
1215
|
|
|
@@ -1381,7 +1392,7 @@ async function saveGeneratedFiles({ outputData }) {
|
|
|
1381
1392
|
console.log(
|
|
1382
1393
|
logSymbols.warning,
|
|
1383
1394
|
chalk.yellow(
|
|
1384
|
-
`Route path autocomplete is still experimental. You can disable it with the "nuxtTypedRouter.
|
|
1395
|
+
`Route path autocomplete is still experimental. You can disable it with the "nuxtTypedRouter.pathCheck: false" option`
|
|
1385
1396
|
)
|
|
1386
1397
|
);
|
|
1387
1398
|
}
|
|
@@ -1666,7 +1677,7 @@ const module = defineNuxtModule({
|
|
|
1666
1677
|
defaults: {
|
|
1667
1678
|
plugin: false,
|
|
1668
1679
|
strict: false,
|
|
1669
|
-
|
|
1680
|
+
pathCheck: true,
|
|
1670
1681
|
experimentalRemoveNuxtDefs: true
|
|
1671
1682
|
},
|
|
1672
1683
|
setup(moduleOptions, nuxt) {
|
|
@@ -1700,7 +1711,7 @@ const module = defineNuxtModule({
|
|
|
1700
1711
|
};
|
|
1701
1712
|
nuxt.hook("prepare:types", (options) => {
|
|
1702
1713
|
options.tsConfig.include?.unshift("./typed-router/typed-router.d.ts");
|
|
1703
|
-
if (moduleOptions.
|
|
1714
|
+
if (moduleOptions.pathCheck) {
|
|
1704
1715
|
options.tsConfig.vueCompilerOptions = {
|
|
1705
1716
|
jsxTemplates: true,
|
|
1706
1717
|
experimentalRfc436: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-typed-router",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.1.0-beta.1",
|
|
4
4
|
"description": "Provide autocompletion for routes paths, names and params in Nuxt apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/module.cjs",
|
|
@@ -59,43 +59,43 @@
|
|
|
59
59
|
"url": "https://github.com/victorgarciaesgi/nuxt-typed-router/issues"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@nuxt/kit": "^3.3.
|
|
62
|
+
"@nuxt/kit": "^3.3.2",
|
|
63
63
|
"chalk": "^5.2.0",
|
|
64
64
|
"defu": "^6.1.2",
|
|
65
65
|
"lodash-es": "^4.17.21",
|
|
66
66
|
"log-symbols": "^5.1.0",
|
|
67
|
-
"mkdirp": "^2.1.
|
|
68
|
-
"nanoid": "^4.0.
|
|
67
|
+
"mkdirp": "^2.1.6",
|
|
68
|
+
"nanoid": "^4.0.2",
|
|
69
69
|
"pathe": "1.1.0",
|
|
70
|
-
"prettier": "2.8.
|
|
70
|
+
"prettier": "2.8.7"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@nuxt/devtools": "^0.
|
|
73
|
+
"@nuxt/devtools": "^0.3.1",
|
|
74
74
|
"@nuxt/module-builder": "^0.2.1",
|
|
75
|
-
"@nuxt/test-utils": "^3.3.
|
|
75
|
+
"@nuxt/test-utils": "^3.3.2",
|
|
76
76
|
"@nuxt/types": "^2.16.3",
|
|
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.4",
|
|
80
80
|
"@types/lodash-es": "^4.17.7",
|
|
81
|
-
"@types/node": "^18.15.
|
|
81
|
+
"@types/node": "^18.15.11",
|
|
82
82
|
"@types/prettier": "^2.7.2",
|
|
83
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
84
|
-
"@typescript-eslint/parser": "^5.
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
84
|
+
"@typescript-eslint/parser": "^5.57.0",
|
|
85
85
|
"@vue/test-utils": "^2.3.2",
|
|
86
|
-
"bumpp": "9.
|
|
86
|
+
"bumpp": "9.1.0",
|
|
87
87
|
"changelogithub": "0.12.7",
|
|
88
88
|
"cross-env": "^7.0.3",
|
|
89
|
-
"eslint": "8.
|
|
89
|
+
"eslint": "8.37.0",
|
|
90
90
|
"eslint-config-prettier": "^8.8.0",
|
|
91
|
-
"eslint-plugin-vue": "^9.
|
|
92
|
-
"nuxt": "3.3.
|
|
91
|
+
"eslint-plugin-vue": "^9.10.0",
|
|
92
|
+
"nuxt": "3.3.2",
|
|
93
93
|
"nuxt-seo-kit": "1.3.5",
|
|
94
|
-
"playwright": "1.
|
|
95
|
-
"tsd": "^0.28.
|
|
96
|
-
"typescript": "^5.0.
|
|
97
|
-
"vitest": "^0.29.
|
|
98
|
-
"vue-eslint-parser": "^9.1.
|
|
94
|
+
"playwright": "1.32.1",
|
|
95
|
+
"tsd": "^0.28.1",
|
|
96
|
+
"typescript": "^5.0.3",
|
|
97
|
+
"vitest": "^0.29.8",
|
|
98
|
+
"vue-eslint-parser": "^9.1.1",
|
|
99
99
|
"vue-router": "^4.1.6",
|
|
100
100
|
"vue-tsc": "^1.1.7"
|
|
101
101
|
}
|