File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import {
2+ detectVueVersion ,
23 REGEX_NODE_MODULES ,
34 REGEX_SETUP_SFC ,
45 REGEX_SRC_FILE ,
5- type FilterOptions ,
6+ type BaseOptions ,
67 type MarkRequired ,
78} from '@vue-macros/common'
89
9- export type Options = FilterOptions & {
10+ export type Options = BaseOptions & {
1011 lib ?: 'vue' | 'vue/vapor' | ( string & { } )
1112 defineComponent ?: { alias : string [ ] }
1213 defineModel ?: { alias : string [ ] }
@@ -17,6 +18,7 @@ export type Options = FilterOptions & {
1718export type OptionsResolved = MarkRequired <
1819 Options ,
1920 | 'include'
21+ | 'version'
2022 | 'lib'
2123 | 'defineComponent'
2224 | 'defineModel'
@@ -26,11 +28,13 @@ export type OptionsResolved = MarkRequired<
2628>
2729
2830export function resolveOptions ( options : Options ) : OptionsResolved {
31+ const version = options . version || detectVueVersion ( )
2932 const lib = options . lib || 'vue/vapor'
3033 return {
3134 include : [ REGEX_SRC_FILE ] ,
3235 exclude : [ REGEX_SETUP_SFC , REGEX_NODE_MODULES ] ,
3336 ...options ,
37+ version,
3438 lib,
3539 defineComponent : {
3640 alias : options ?. defineComponent ?. alias ?? [
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ describe('fixtures', async () => {
3333 transformJsxMacros ( code , id , new Map ( ) , {
3434 lib : 'vue' ,
3535 include : [ '*.tsx' ] ,
36+ version : 3.6 ,
3637 ...options ,
3738 } ) ?. code ,
3839 )
@@ -45,6 +46,7 @@ describe('vue/vapor fixtures', async () => {
4546 transformJsxMacros ( code , id , new Map ( ) , {
4647 lib : 'vue/vapor' ,
4748 include : [ '*.tsx' ] ,
49+ version : 3.6 ,
4850 ...options ,
4951 } ) ?. code ,
5052 )
You can’t perform that action at this time.
0 commit comments