Skip to content

Commit 198662a

Browse files
committed
Merge branch 'main' into feat-components
2 parents 6a06e5c + d24bab6 commit 198662a

File tree

13 files changed

+101
-11
lines changed

13 files changed

+101
-11
lines changed

bindings/devup-ui-wasm/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @devup-ui/wasm
22

3+
## 1.0.9
4+
5+
### Patch Changes
6+
7+
- 43dcfa5: Fix classname issue
8+
39
## 1.0.8
410

511
### Patch Changes

bindings/devup-ui-wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"react",
1818
"wasm"
1919
],
20-
"version": "1.0.8",
20+
"version": "1.0.9",
2121
"scripts": {
2222
"build": "wasm-pack build --target nodejs --out-dir ./pkg --out-name index && node script.js",
2323
"test": "wasm-pack test --node"

libs/extractor/src/lib.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,39 @@ mod tests {
604604
)
605605
.unwrap()
606606
));
607+
608+
reset_class_map();
609+
assert_debug_snapshot!(ToBTreeSet::from(
610+
extract(
611+
"test.tsx",
612+
r#"import { Box, Button as DevupButton, Center, css } from '@devup-ui/core'
613+
import clsx from 'clsx'
614+
615+
<DevupButton
616+
boxSizing="border-box"
617+
className={clsx(
618+
variants[variant],
619+
isError && variant === 'default' && errorClassNames,
620+
className,
621+
)}
622+
typography={
623+
isPrimary
624+
? {
625+
sm: 'buttonS',
626+
md: 'buttonM',
627+
}[size]
628+
: undefined
629+
}
630+
{...props}
631+
/>
632+
"#,
633+
ExtractOption {
634+
package: "@devup-ui/core".to_string(),
635+
css_file: None
636+
}
637+
)
638+
.unwrap()
639+
));
607640
}
608641

609642
#[test]

libs/extractor/src/prop_modify_utils.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,19 @@ fn merge_string_expressions<'a>(
318318
raw: ast_builder.atom(&{
319319
let trimmed = s.trim();
320320
if trimmed.is_empty() {
321-
"".to_string()
322-
} else if idx == string_literals.len() - 1 {
321+
if idx == 0 {
322+
"".to_string()
323+
} else {
324+
" ".to_string()
325+
}
326+
} else {
323327
let prefix = if idx == 0 { "" } else { " " };
324328
let suffix = if string_literals.len() == other_expressions.len() {
325329
" "
326330
} else {
327331
""
328332
};
329333
format!("{prefix}{trimmed}{suffix}")
330-
} else if idx == string_literals.len() - 1 {
331-
trimmed.to_string()
332-
} else {
333-
format!("{trimmed} ")
334334
}
335335
}),
336336
cooked: None,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
source: libs/extractor/src/lib.rs
3+
expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { Box, Button as DevupButton, Center, css } from '@devup-ui/core'\nimport clsx from 'clsx'\n\n<DevupButton\n boxSizing=\"border-box\"\n className={clsx(\n variants[variant],\n isError && variant === 'default' && errorClassNames,\n className,\n )}\n typography={\n isPrimary\n ? {\n sm: 'buttonS',\n md: 'buttonM',\n }[size]\n : undefined\n }\n {...props}\n />\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())"
4+
---
5+
ToBTreeSet {
6+
styles: {
7+
Static(
8+
ExtractStaticStyle {
9+
property: "boxSizing",
10+
value: "border-box",
11+
level: 0,
12+
selector: None,
13+
style_order: None,
14+
},
15+
),
16+
Typography(
17+
"buttonM",
18+
),
19+
Typography(
20+
"buttonS",
21+
),
22+
},
23+
code: "import \"@devup-ui/core/devup-ui.css\";\nimport clsx from \"clsx\";\n<button {...props} className={`${clsx(variants[variant], isError && variant === \"default\" && errorClassNames, className) ?? \"\"} d0 ${isPrimary ? {\n\t\"md\": \"typo-buttonM\",\n\t\"sm\": \"typo-buttonS\"\n}[size] : \"\"} ${props?.className ?? \"\"}`} style={props?.style} />;\n",
24+
}

packages/next-plugin/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @devup-ui/next-plugin
22

3+
## 1.0.9
4+
5+
### Patch Changes
6+
7+
- @devup-ui/webpack-plugin@1.0.9
8+
39
## 1.0.8
410

511
### Patch Changes

packages/next-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"webpack"
2020
],
2121
"type": "module",
22-
"version": "1.0.8",
22+
"version": "1.0.9",
2323
"scripts": {
2424
"lint": "eslint",
2525
"build": "tsc && vite build"

packages/rsbuild-plugin/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @devup-ui/rsbuild-plugin
22

3+
## 1.0.5
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [43dcfa5]
8+
- @devup-ui/wasm@1.0.9
9+
310
## 1.0.4
411

512
### Patch Changes

packages/rsbuild-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"rsbuild"
1919
],
2020
"type": "module",
21-
"version": "1.0.4",
21+
"version": "1.0.5",
2222
"scripts": {
2323
"lint": "eslint",
2424
"build": "tsc && vite build"

packages/vite-plugin/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @devup-ui/vite-plugin
22

3+
## 1.0.9
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [43dcfa5]
8+
- @devup-ui/wasm@1.0.9
9+
310
## 1.0.8
411

512
### Patch Changes

0 commit comments

Comments
 (0)