Generated: 2026-01-07 Commit: 06887f92 Branch: main
Zero-runtime CSS-in-JS preprocessor. Rust core (Oxc parser) → WASM → TypeScript plugins for Vite/Next/Webpack/Rsbuild/Bun. Build-time extraction, no client JS for styling.
devup-ui/
├── libs/ # Rust core - CSS extraction engine (SEE libs/AGENTS.md)
│ ├── extractor/ # JSX→CSS transformation (9k lines)
│ ├── sheet/ # CSS generation + theming
│ └── css/ # Utilities, selectors, optimization
├── bindings/ # WASM bridge (SEE bindings/devup-ui-wasm/AGENTS.md)
│ └── devup-ui-wasm/ # wasm-bindgen exports to JS
├── packages/ # NPM packages
│ ├── react/ # @devup-ui/react - Components + API (SEE packages/react/AGENTS.md)
│ ├── components/ # @devup-ui/components - Button, Input, Select...
│ ├── plugin-utils/ # Shared config loading
│ ├── *-plugin/ # Build tool plugins (vite, next, webpack, rsbuild, bun)
│ ├── eslint-plugin/ # Lint rules
│ └── reset-css/ # CSS reset
├── apps/ # Demo apps (vite, next, rsbuild, landing)
└── benchmark/ # Performance comparisons vs Tailwind, StyleX, etc.
| Task | Location | Notes |
|---|---|---|
| Add CSS property | libs/css/src/constant.rs |
Property mappings |
| Add pseudo selector | packages/react/src/types/props/selector/ |
TypeScript types |
| Modify extraction | libs/extractor/src/lib.rs |
Core logic + tests |
| Theme system | libs/sheet/src/theme.rs |
Color/typography |
| Plugin behavior | packages/*-plugin/src/plugin.ts |
All follow same pattern |
| Component API | packages/react/src/components/ |
Box, Flex, Text... |
| WASM exports | bindings/devup-ui-wasm/src/lib.rs |
JS-exposed functions |
| Module | File | Lines | Role |
|---|---|---|---|
| extractor | lib.rs |
9,094 | Main extraction + tests |
| sheet | lib.rs |
1,821 | CSS output generation |
| theme | theme.rs |
1,526 | Color/typography system |
| css_utils | css_utils.rs |
1,239 | Template literal parsing |
| visit | visit.rs |
669 | AST visitor pattern |
| Package | Entry | Exports |
|---|---|---|
| @devup-ui/react | src/index.ts |
Box, Flex, Text, styled, css, globalCss, keyframes |
| @devup-ui/components | src/index.ts |
Button, Input, Select, Checkbox, Toggle, Stepper |
| @devup-ui/wasm | pkg/index.js |
codeExtract, getCss, registerTheme |
oxccrate for JS/TS parsing (NOT swc)- Snapshot testing with
insta - Parameterized tests with
rstest - Serial tests with
serial_testwhen touching globals
- Bun as package manager AND test runner
- 100% coverage thresholds enforced
- ESM-first, dual CJS/ESM builds
bun-test-env-domfor component tests
- Shorthand:
bg,p,m,w,h(NOTbackground,padding...) - Responsive:
prop={[mobile, tablet, desktop]} - Theme tokens:
$primary,$textprefix - Selectors:
_hover,_focus,_before
- Base-37 encoding:
a,b...aa,ab - Prefix configurable via
setPrefix() - Minimal output size prioritized
- NEVER use runtime styling - all processed at build time
- NEVER use
as anyor@ts-ignore- strict types enforced - NEVER suppress Rust warnings -
clippy -D warningsin CI - NEVER skip tests - 100% coverage required
- AVOID adding dependencies - minimal footprint goal
All React components throw Error('Cannot run on the runtime') - they're compile-time only placeholders that get replaced with <div className="..." />.
devup.json at project root:
{
"theme": {
"colors": { "default": {...}, "dark": {...} },
"typography": { "heading": {...} }
}
}All plugins wrap bundler config:
// vite.config.ts
export default DevupUI(viteConfig, { singleCss: true })# Development
bun install # Install deps
bun run build # Build all packages (WASM first)
bun run dev # Dev mode all packages
# Testing
bun test # JS/TS tests
cargo test # Rust tests
cargo tarpaulin # Rust coverage
# Linting
bun run lint # ESLint + cargo fmt + clippy
bun run lint:fix # Auto-fix
# Benchmarks
bun benchmark # Compare vs other CSS-in-JS libs- Build order matters: WASM → plugin-utils → react → plugins
- Turbopack compatible: Use
singleCss: truefor best perf - RSC ready: No client-side JS, works with React Server Components
- TypeScript theme types: Auto-generated from
devup.json