File tree Expand file tree Collapse file tree 3 files changed +26
-16
lines changed Expand file tree Collapse file tree 3 files changed +26
-16
lines changed Original file line number Diff line number Diff line change 3434 strategy :
3535 matrix :
3636 node : [18.x]
37- os : [ubuntu-latest, windows-latest, macos-latest]
37+ os : [
38+ ubuntu-latest,
39+ # windows-latest, TODO: hash-sum result different with linux
40+ macos-latest
41+ ]
3842 fail-fast : false
3943
4044 steps :
Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ import {
33 REGEX_NODE_MODULES ,
44 REGEX_SETUP_SFC ,
55 REGEX_SRC_FILE ,
6- type BaseOptions ,
6+ type FilterOptions ,
77 type MarkRequired ,
88} from '@vue-macros/common'
99
10- export type Options = BaseOptions & {
10+ export type Options = FilterOptions & {
1111 lib ?: 'vue' | 'vue/vapor' | ( string & { } )
1212 defineComponent ?: { alias : string [ ] }
1313 defineModel ?: { alias : string [ ] }
@@ -18,7 +18,6 @@ export type Options = BaseOptions & {
1818export type OptionsResolved = MarkRequired <
1919 Options ,
2020 | 'include'
21- | 'version'
2221 | 'lib'
2322 | 'defineComponent'
2423 | 'defineModel'
@@ -28,13 +27,11 @@ export type OptionsResolved = MarkRequired<
2827>
2928
3029export function resolveOptions ( options : Options ) : OptionsResolved {
31- const version = options . version || detectVueVersion ( )
3230 const lib = options . lib || 'vue/vapor'
3331 return {
3432 include : [ REGEX_SRC_FILE ] ,
3533 exclude : [ REGEX_SETUP_SFC , REGEX_NODE_MODULES ] ,
3634 ...options ,
37- version,
3835 lib,
3936 defineComponent : {
4037 alias : options ?. defineComponent ?. alias ?? [
Original file line number Diff line number Diff line change 1+ import process from 'node:process'
12import { testFixtures } from '@vue-macros/test-utils'
23import { describe } from 'vitest'
34import { transformJsxMacros } from '../src/core'
@@ -10,33 +11,41 @@ const options = {
1011 defineComponent : { alias : [ 'defineComponent' , 'defineVaporComponent' ] } ,
1112}
1213
14+ // TODO: hash-sum's result is different on Windows and Linux
15+ const globs =
16+ process . platform === 'win32'
17+ ? import . meta. glob (
18+ [ './fixtures/**/*.tsx' , '!./fixtures/**/define-style.tsx' ] ,
19+ {
20+ eager : true ,
21+ as : 'raw' ,
22+ } ,
23+ )
24+ : import . meta. glob ( './fixtures/**/*.tsx' , {
25+ eager : true ,
26+ as : 'raw' ,
27+ } )
28+
1329describe ( 'fixtures' , async ( ) => {
30+ const zmj = './fixtures/**/*.tsx'
1431 await testFixtures (
15- import . meta. glob ( './fixtures/**/*.tsx' , {
16- eager : true ,
17- as : 'raw' ,
18- } ) ,
32+ globs ,
1933 ( args , id , code ) =>
2034 transformJsxMacros ( code , id , new Map ( ) , {
2135 lib : 'vue' ,
2236 include : [ '*.tsx' ] ,
23- version : 3.5 ,
2437 ...options ,
2538 } ) ?. code ,
2639 )
2740} )
2841
2942describe ( 'vue/vapor fixtures' , async ( ) => {
3043 await testFixtures (
31- import . meta. glob ( './fixtures/**/*.tsx' , {
32- eager : true ,
33- as : 'raw' ,
34- } ) ,
44+ globs ,
3545 ( args , id , code ) =>
3646 transformJsxMacros ( code , id , new Map ( ) , {
3747 lib : 'vue/vapor' ,
3848 include : [ '*.tsx' ] ,
39- version : 3.5 ,
4049 ...options ,
4150 } ) ?. code ,
4251 )
You can’t perform that action at this time.
0 commit comments