(code: string)
| 75 | } |
| 76 | |
| 77 | export function patternParser(code: string) { |
| 78 | const project = getProject(code, { |
| 79 | patterns: { |
| 80 | extend: { |
| 81 | stack: { |
| 82 | properties: { |
| 83 | align: { type: 'property', value: 'alignItems' }, |
| 84 | justify: { type: 'property', value: 'justifyContent' }, |
| 85 | direction: { type: 'property', value: 'flexDirection' }, |
| 86 | gap: { type: 'property', value: 'gap' }, |
| 87 | }, |
| 88 | transform(props: any) { |
| 89 | const { align = 'flex-start', justify, direction = 'column', gap = '10px', ...rest } = props |
| 90 | return { |
| 91 | display: 'flex', |
| 92 | flexDirection: direction, |
| 93 | alignItems: align, |
| 94 | justifyContent: justify, |
| 95 | gap, |
| 96 | ...rest, |
| 97 | } |
| 98 | }, |
| 99 | }, |
| 100 | }, |
| 101 | }, |
| 102 | }) |
| 103 | const data = project.parseSourceFile(filePath)! |
| 104 | return data.pattern |
| 105 | } |
| 106 | |
| 107 | export function jsxRecipeParser(code: string) { |
| 108 | const project = getProject(code, { |
no test coverage detected