Skip to content

Commit c61331c

Browse files
committed
Migrate bun from Vitest
1 parent b38b60b commit c61331c

File tree

18 files changed

+360
-680
lines changed

18 files changed

+360
-680
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ codecov.*
1414
.DS_Store
1515
._.DS_Store
1616
**/.DS_Store
17-
**/._.DS_Store
17+
**/._.DS_Store
18+
.claude
19+
CLAUDE.md

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ braillify/
1919
├── apps/landing/ # Next.js 16 docs site (@devup-ui)
2020
├── test_cases/ # CSV rule test cases (61 files)
2121
├── test_case_inputs/ # Input-only test CSVs
22-
├── __tests__/ # Vitest JS integration tests
22+
├── __tests__/ # Bun JS integration tests
2323
├── py-test/ # Pytest Python tests
2424
└── braillove-case-collector/ # Windows automation tool
2525
```
@@ -53,7 +53,7 @@ braillify/
5353
- `strict: true`, `moduleResolution: bundler`
5454
- `@/*` path alias to `./src/*`
5555
- ESLint: `eslint-plugin-devup` recommended config
56-
- Vitest with `vite-plugin-wasm` for WASM tests
56+
- Bun test with a preload plugin for WASM tests
5757

5858
### Python
5959

@@ -77,7 +77,7 @@ bun install
7777
# Build all packages
7878
bun run build
7979

80-
# Run all tests (Rust coverage + Vitest + Pytest)
80+
# Run all tests (Rust coverage + Bun test + Pytest)
8181
bun run test
8282

8383
# Build landing site (requires test_status.json from test run)

apps/landing/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@devup-ui/components": "^0.1.36",
13-
"@devup-ui/react": "^1.0.28",
12+
"@devup-ui/components": "^0.1.43",
13+
"@devup-ui/react": "^1.0.34",
1414
"@mdx-js/loader": "^3.1.1",
1515
"@mdx-js/react": "^3.1.1",
16-
"@next/mdx": "^16.0.3",
16+
"@next/mdx": "^16.1.6",
1717
"@types/mdx": "^2.0.13",
1818
"braillify": "workspace:*",
19-
"katex": "^0.16.25",
20-
"next": "16.1.5",
21-
"react": "^19.2.0",
22-
"react-dom": "^19.2.0",
19+
"katex": "^0.16.38",
20+
"next": "16.1.6",
21+
"react": "^19.2.4",
22+
"react-dom": "^19.2.4",
2323
"react-latex-next": "^3.0.0",
24-
"react-syntax-highlighter": "16.1.0"
24+
"react-syntax-highlighter": "16.1.1"
2525
},
2626
"devDependencies": {
27-
"@devup-ui/next-plugin": "^1.0.57",
28-
"@types/node": "^24",
27+
"@devup-ui/next-plugin": "^1.0.73",
28+
"@types/node": "^25",
2929
"@types/react": "^19",
3030
"@types/react-dom": "^19",
3131
"@types/react-syntax-highlighter": "^15.5.13",

bun.lock

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

bunfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[test]
2+
preload = ["./plugin.ts"]

libs/braillify/src/char_struct.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use crate::{math_symbol_shortcut::is_math_symbol_char, symbol_shortcut::is_symbol_char, fraction::is_unicode_fraction};
1+
use crate::{
2+
fraction::is_unicode_fraction, math_symbol_shortcut::is_math_symbol_char,
3+
symbol_shortcut::is_symbol_char,
4+
};
25

36
/// Character in Korean
47
#[derive(Debug)]
@@ -58,7 +61,7 @@ pub enum CharType {
5861
Number(char),
5962
Symbol(char),
6063
MathSymbol(char),
61-
Fraction(char),
64+
Fraction(char),
6265
Space(char),
6366
}
6467

@@ -76,7 +79,7 @@ impl CharType {
7679
if is_math_symbol_char(c) {
7780
return Ok(Self::MathSymbol(c));
7881
}
79-
if is_unicode_fraction(c) {
82+
if is_unicode_fraction(c) {
8083
return Ok(Self::Fraction(c));
8184
}
8285
let code = c as u32;
@@ -116,7 +119,7 @@ mod test {
116119
));
117120
assert!(matches!(CharType::new(' ').unwrap(), CharType::Space(' ')));
118121
assert!(matches!(
119-
CharType::new('½').unwrap(),
122+
CharType::new('½').unwrap(),
120123
CharType::Fraction('½')
121124
));
122125
}

libs/braillify/src/english_logic.rs

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,57 @@ use crate::{symbol_shortcut, utils};
33
/// 규칙 33~35에서 종료표(⠲)를 생략해야 하는 기호 모음.
44
/// 기호 앞뒤에서는 로마자 종료표를 생략한다.
55
pub(crate) fn should_skip_terminator_for_symbol(symbol: char) -> bool {
6-
matches!(symbol, '.' | '?'| '!'| '…'| '⋯'| '"'| '\''| '”'| '’'| '」'| '』'
7-
| '〉'| '》'| '('| ')'| ']'| '}'| ','| ':'| ';'| '―')
6+
matches!(
7+
symbol,
8+
'.' | '?'
9+
| '!'
10+
| '…'
11+
| '⋯'
12+
| '"'
13+
| '\''
14+
| '”'
15+
| '’'
16+
| '」'
17+
| '』'
18+
| '〉'
19+
| '》'
20+
| '('
21+
| ')'
22+
| ']'
23+
| '}'
24+
| ','
25+
| ':'
26+
| ';'
27+
| '―'
28+
)
829
}
930

1031
/// 종료표를 생략한 뒤에도 연속표(⠐)로 이어야 하는 기호 모음.
1132
/// 여는 괄호 '(' 는 새 영어 구간을 열게 되므로 제외한다.
1233
/// 종료표를 생략했지만 이어지는 로마자에 연속표를 붙여야 하는지 판단한다.
1334
pub(crate) fn should_request_continuation(symbol: char) -> bool {
14-
matches!(symbol, '.' | '?'| '!'| '…'| '⋯'| '"'| '\''| '”'| '’'| '」'| '』'| '〉'
15-
| '》'| ')'| ']'| '}'| ','| ':'| ';'| '―')
35+
matches!(
36+
symbol,
37+
'.' | '?'
38+
| '!'
39+
| '…'
40+
| '⋯'
41+
| '"'
42+
| '\''
43+
| '”'
44+
| '’'
45+
| '」'
46+
| '』'
47+
| '〉'
48+
| '》'
49+
| ')'
50+
| ']'
51+
| '}'
52+
| ','
53+
| ':'
54+
| ';'
55+
| '―'
56+
)
1657
}
1758

1859
/// 제33항 [다만] : '/', '-', '~' 앞에는 종료표를 강제로 붙인다.
@@ -194,7 +235,13 @@ mod tests {
194235
fn should_render_symbol_as_english_for_parentheses() {
195236
let opener: Vec<char> = "(Hello".chars().collect();
196237
assert!(should_render_symbol_as_english(
197-
true, false, &[], '(', &opener, 0, &[]
238+
true,
239+
false,
240+
&[],
241+
'(',
242+
&opener,
243+
0,
244+
&[]
198245
));
199246

200247
let korean_before: Vec<char> = "가(".chars().collect();
@@ -209,7 +256,13 @@ mod tests {
209256
));
210257

211258
assert!(!should_render_symbol_as_english(
212-
false, false, &[], '(', &opener, 0, &[]
259+
false,
260+
false,
261+
&[],
262+
'(',
263+
&opener,
264+
0,
265+
&[]
213266
));
214267
}
215268

0 commit comments

Comments
 (0)