Summary
packages/stx-native is 8,012 lines with no tests. The compiler works — it is the most valuable thing in the package — and nothing protects it.
Evidence
$ find packages/stx-native -name "*.test.ts" -not -path "*/node_modules/*" | wc -l
0Line counts:
| File | Lines |
|---|---|
src/renderers/android.kt | 1,305 |
src/cli/index.ts | 799 |
src/renderers/ios.swift | 765 |
src/compiler/parser.ts | 742 |
src/compiler/headwind-to-style.ts | 708 |
src/bridge/protocol.ts | 682 |
src/bridge/android-bridge.kt | 627 |
src/hot-reload/client.ts | 547 |
src/components/primitives.ts | 491 |
src/bridge/ios-bridge.swift | 484 |
src/runtime/index.ts | 361 |
src/compiler/ir.ts | 319 |
Untested code that has never run is not a head start; it is inventory. The CLI's syntax error is the proof — it sat in the repo because nothing executed it.
What to test first
compileSTX produces correct IR today, and its output is a JSON tree — ideal for golden tests. A verified starting fixture:
<View class="flex-1 flex-col justify-center items-center p-4 bg-blue-500">
<Text class="text-white text-lg font-bold">Wildloop</Text>
</View>{ "type": "View", "style": { "flex": 1, "flexDirection": "column", "justifyContent": "center",
"alignItems": "center", "padding": 16, "backgroundColor": "#3b82f6" }, "children": [
{ "type": "Text", "style": { "color": "#ffffff", "fontSize": 18, "fontWeight": "bold" } } ] }Ask
- Golden tests over
compileHeadwindToStylefor each supported class family — spacing, flex, colour, radius, typography. This is the part a refactor breaks silently. - Golden tests over
compileSTXfor a handful of representative trees, asserting the IR shape. - A test that every component type in
mapToNativeComponenthas a renderer branch in bothios.swiftandandroid.kt, so the two platforms cannot drift apart unnoticed.