File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,12 @@ import type { NuxtModule } from '@nuxt/schema';
33import { isPackageExists } from 'local-pkg' ;
44
55type ComponentName = 'Field' | 'Form' | 'ErrorMessage' | 'FieldArray' ;
6+ type TypedSchemaPackage = 'yup' | 'zod' | 'valibot' | 'none' ;
7+
68export interface VeeValidateNuxtOptions {
79 autoImports ?: boolean ;
810 componentNames ?: Partial < Record < ComponentName , string > > ;
11+ typedSchemaPackage ?: TypedSchemaPackage ;
912}
1013
1114const components : ComponentName [ ] = [ 'Field' , 'Form' , 'ErrorMessage' , 'FieldArray' ] ;
@@ -67,9 +70,30 @@ export default defineNuxtModule<VeeValidateNuxtOptions>({
6770 } ) ;
6871 }
6972
70- checkForYup ( options ) ;
71- checkForZod ( options ) ;
72- checkForValibot ( options ) ;
73+ if ( options . typedSchemaPackage === 'none' ) {
74+ return ;
75+ }
76+
77+ if ( options . typedSchemaPackage === 'yup' ) {
78+ checkForYup ( options ) ;
79+ return ;
80+ }
81+
82+ if ( options . typedSchemaPackage === 'zod' ) {
83+ checkForZod ( options ) ;
84+ return ;
85+ }
86+
87+ if ( options . typedSchemaPackage === 'valibot' ) {
88+ checkForValibot ( options ) ;
89+ return ;
90+ }
91+
92+ if ( ! checkForYup ( options ) ) {
93+ if ( ! checkForZod ( options ) ) {
94+ checkForValibot ( options ) ;
95+ }
96+ }
7397 } ,
7498} ) as NuxtModule < VeeValidateNuxtOptions > ;
7599
You can’t perform that action at this time.
0 commit comments