Skip to content

feat: discovery-based .classes.ts parsing#42

Merged
ssilvius merged 2 commits intomainfrom
feat/fix-jsx-blockers
Apr 6, 2026
Merged

feat: discovery-based .classes.ts parsing#42
ssilvius merged 2 commits intomainfrom
feat/fix-jsx-blockers

Conversation

@ssilvius
Copy link
Copy Markdown
Contributor

@ssilvius ssilvius commented Apr 6, 2026

Summary

  • Replaces convention-based .classes.ts parsing with discovery-based approach using oxc AST -- reads every export const, classifies by name pattern (variant/size/base/disabled/other) and value shape (record/scalar), builds component records from whatever actually exists
  • Extracts shared oxc helpers (extract_string_value, unwrap_type_expressions, normalize_whitespace, extract_nested_object_classes) into ts_helpers.rs to eliminate duplication between react.rs and registry.rs
  • Adds eprintln! warnings for parse errors in discover_exports instead of silently returning empty results
  • Collapses DiscoveredExport from 4-variant enum to struct { name, shape: Record|Scalar }, cutting match complexity in half

Test plan

  • 174 tests pass (65 adapters, 12 mdx, 19 registry, 5 server, 63 service-design, 10 static)
  • Clippy clean
  • 7 integration tests cover: flat records, nested records, structural components, arrays with .join(), kebab-case filenames, multiple records, typography objects

🤖 Generated with Claude Code

ssilvius and others added 2 commits April 5, 2026 22:57
…pproach

Instead of requiring specific variable naming conventions, the registry now
reads every `export const` in a .classes.ts file, classifies by name pattern
and value shape, and builds component records from whatever exists. Shared
oxc helpers extracted to ts_helpers.rs to eliminate duplication between
react.rs and registry.rs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ssilvius ssilvius merged commit c2d6e70 into main Apr 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant