@declareuihq/core
v0.1.0-alpha.1
Published
DeclareUI core engine — parser, validator, AST, and code generators
Downloads
110
Maintainers
Readme
@declareuihq/core
The engine behind DeclareUI — parser, schema validator, AST, and multi-target code generators.
What it does
@declareuihq/core takes .ui.yaml (or .ui.json) component declarations and compiles them into native, idiomatic code for any supported framework:
- React — functional components with hooks, proper JSX
- Vue — Composition API with
<script setup> - Angular — standalone components with signals
- Svelte — runes-based
.sveltefiles - Web Components — Custom Elements with Shadow DOM
- Vanilla JS/TS — framework-free, zero dependencies
Installation
pnpm add @declareuihq/coreUsage
import { parse, validate, generate } from '@declareuihq/core';
// Parse a .ui.yaml file into AST
const ast = parse('button.ui.yaml');
// Validate against the DeclareUI schema
const result = validate(ast);
// Generate native code for target frameworks
const output = generate(ast, {
targets: ['react', 'vue', 'svelte'],
typescript: true,
});Architecture
.ui.yaml → Parser → AST → Validator → Code Generator → Native Code
↓
React | Vue | Angular | Svelte | WC | VanillaRelated packages
| Package | Description |
|:--------|:------------|
| @declareuihq/cli | CLI tool for building and managing components |
| @declareuihq/mcp | MCP server for AI-driven component development |
| @declareuihq/components | Pre-built component library |
| @declareuihq/tailwind-plugin | Tailwind CSS integration |
Contributing
See CONTRIBUTING.md for guidelines.
License
MIT
