Skip to content

Commit 57fdfcf

Browse files
committed
feat: 增加属性测试用力、修改swc版本,统一从swc_core获取
1 parent af28f66 commit 57fdfcf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4236
-1270
lines changed

Cargo.lock

Lines changed: 653 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,11 @@ lightningcss = {version = "1.0.0-alpha.45", features = ["visitor", "into_owned"]
1919
once_cell = "1.18.0"
2020
selectors = "0.25.0"
2121
smallvec = "1.11.0"
22+
serde = { version = "1.0.130" }
2223
style = "0.1.0"
2324
pcre2 = "0.2.6"
2425
regex = "1.10.3"
25-
swc_core = "0.90.11"
26-
swc_common = {version = "0.33.0", features = ["tty-emitter", "sourcemap"]}
27-
swc_ecma_ast = {version = "0.110.0"}
28-
swc_ecma_utils = "0.125.4"
29-
swc_ecma_codegen = "0.146.0"
30-
swc_ecma_parser = "0.141.0"
31-
swc_ecma_visit = "0.96.0"
32-
swc_ecmascript = {version = "0.235.1", features = ["transforms", "typescript"]}
33-
swc_ecma_transforms_base = "0.134.0"
34-
swc_atoms = "0.6.0"
26+
swc_core = { version = "0.90.24", features = ["__common", "ecma_transforms_typescript", "ecma_ast", "ecma_plugin_transform", "ecma_utils", "ecma_parser", "ecma_visit", "ecma_codegen", "__testing_transform"]}
3527

3628
[build-dependencies]
3729
napi-build = "2.0.1"

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@ export function combineCssVariables(variables: Array<string>): string | null;
101101
| flex-direction | 'row','row-reverse','column','column-reverse' | ✔️ |
102102
| justify-content | 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly' | ✔️ |
103103
| align-content | 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly' | ✔️ |
104-
| alignitems | 'flex-start', 'flex-end', 'center', 'baseline', 'stretch' , 'auto' | ✔️ |
104+
| align-items | 'flex-start', 'flex-end', 'center', 'baseline', 'stretch' | ✔️ |
105105
| align-self | 'flex-start', 'flex-end', 'center', 'baseline', 'stretch' , 'auto' | ✔️ |
106106
| flex-wrap | 'nowrap', 'wrap', 'wrap-reverse' ||
107107
| position | 'relative', 'absolute' | ✔️ |
108108
| position | 'flex' ||
109109
| left | Length | ✔️ |
110-
| top | Length ||
110+
| top | Length | ✔️ |
111+
| bottom | Length ||
111112
| right | Length ||
112113
| z-zndex | Number | ✔️ |
113114
| bottom | Length | ✔️ |
@@ -158,7 +159,7 @@ export function combineCssVariables(variables: Array<string>): string | null;
158159
| display | 'inline-block', 'inline-flex', 'inline' ||
159160
| overflow | 'hidden', 'visible' | ✔️ |
160161
| transform | translate、translateX、translateY、translateZ、translate2d、translate3d、scale、scaleX、scaleY、scale3d、rotate、rotateX、rotateY、rotate3d | ✔️ |
161-
| transform-origin | Length Length | ✔️ |
162+
| transform-origin | Length(top/center/bottom) Length(left/center/right) | ✔️ |
162163
| animation | | 后续支持 |
163164
| content | | ✔️ |
164165

@@ -175,11 +176,12 @@ export function combineCssVariables(variables: Array<string>): string | null;
175176
| font-size | Length | ✔️ |
176177
| font-family | | ✔️ |
177178
| font-style | 'normal', 'italic' | ✔️ |
178-
| font-weight | 100~900, 'bold','bolder','light','lighter','normal' | ✔️ |
179+
| font-weight | 100~900, 'bold','bolder','lighter','normal' | ✔️ |
179180
| line-height | 'XXpx' (需要指定具体指,不支持 Number) | ✔️ |
180181
| text-align | 'center', 'left', 'right' | ✔️ |
181182
| text-decoration | ('none', 'underline', 'line-through', 'overline') Color | ✔️ |
182183
| text-overflow | 'ellipsis', 'clip' | ✔️ |
184+
| vertical-align | 'middle', 'top', 'bottom' | ✔️ |
183185
| color | Color | ✔️ |
184186
| -webkit-line-clamp | Number | ✔️ |
185187

__test__/fixure/normal.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { View } from '@tarojs/components';
2+
3+
const Index = () => {
4+
return (
5+
<View className='index' />
6+
)
7+
};
8+
9+
export default Index;

__test__/fixure/pesudo.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
:root {
2-
--angle: 30deg;
3-
--var: var(--aaa, #00f);
4-
--color: #f00;
5-
}
6-
71
.container {
82
height: 200px;
93
width: 200px;
10-
background-color: var(--var, --color);
114
}

__test__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ process.env.platform = 'arm64'
44
const { parse } = require('../index.js')
55
const component = fs.readFileSync(path.resolve(__dirname, 'fixure/pesudo.jsx'), 'utf8')
66
const css1 = fs.readFileSync(path.resolve(__dirname, 'fixure/pesudo.scss'), 'utf8')
7-
const code = parse(component, [css1], {
7+
const { code } = parse(component, [css1], {
88
platformString: 'Harmony',
99
isEnableNesting: true
1010
})

0 commit comments

Comments
 (0)