Welcome to the Leptos ShadCN UI project! This guide will help you get started as a contributor.
- Rust 1.75+ with Cargo
- Node.js 18+ (for frontend tooling)
- Git for version control
- Basic knowledge of Leptos v0.8+ and Rust
# Clone the repository
git clone https://github.com/cloud-shuttle/leptos-shadcn-ui.git
cd leptos-shadcn-ui
# Install dependencies
cargo build --workspace
# Verify setup with TDD tests
cargo nextest run --package leptos-shadcn-contract-testingThis project follows Test-Driven Development (TDD) principles:
# 1. Run contract tests before making changes
cargo nextest run --package leptos-shadcn-contract-testing
# 2. Make your changes
# 3. Run tests again to ensure nothing broke
cargo nextest run --package leptos-shadcn-contract-testing
# 4. Run full workspace check
cargo check --workspace# Test individual component
cargo build --package leptos-shadcn-button
# Test main package with specific features
cargo build --package leptos-shadcn-ui --features button,input,card,dialogleptos-shadcn-ui/
├── packages/
│ ├── leptos/ # Individual component packages
│ │ ├── button/ # Button component
│ │ ├── input/ # Input component
│ │ └── ...
│ ├── contract-testing/ # TDD framework
│ ├── signal-management/ # Signal lifecycle management
│ └── tailwind-rs-core/ # Type-safe Tailwind CSS
├── examples/leptos/ # Example applications
├── docs/ # Documentation
└── scripts/ # Automation scripts
# Use the component generator
cargo run --package leptos-shadcn-component-generator -- --name my-component// In your component's tests/
#[cfg(test)]
mod tests {
use super::*;
use leptos_shadcn_contract_testing::*;
#[test]
fn test_component_contracts() {
let tester = ContractTester::new();
tester.validate_component_contracts("my-component");
}
}Add your component to Cargo.toml workspace members and dependencies.
All components must meet these performance contracts:
- Bundle Size: < 500KB per component
- Render Time: < 16ms initial render
- WASM Compatibility: Full compatibility with WebAssembly targets
# Validate performance contracts
cargo run --package leptos-shadcn-contract-testing --bin validate_performance- Use
cargo fmtfor formatting - Use
cargo clippyfor linting - Follow Rust naming conventions
- Document all public APIs
- Implement both
defaultandnew_yorkvariants - Include comprehensive prop documentation
- Support signal-based state management
- Include accessibility features
# Run all contract tests
cargo nextest run --package leptos-shadcn-contract-testing
# Run specific test categories
cargo nextest run --package leptos-shadcn-contract-testing --test-threads 1# Test example applications
cd examples/leptos
cargo run# Fix dependency issues automatically
cargo run --package leptos-shadcn-contract-testing --bin fix_dependenciesAll packages must use version 0.8.0 and workspace dependencies.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Implement your changes with tests
- Run the full test suite:
cargo nextest run --workspace - Update documentation if needed
- Submit a pull request with a clear description
# Clean and rebuild
cargo clean
cargo build --workspace
# Check for dependency issues
cargo run --package leptos-shadcn-contract-testing --bin fix_dependencies# Run tests with verbose output
cargo nextest run --package leptos-shadcn-contract-testing -- --nocapture
# Check specific test
cargo test --package leptos-shadcn-contract-testing test_name# Profile bundle size
cargo run --package leptos-shadcn-contract-testing --bin profile_bundle_size
# Check render performance
cargo run --package leptos-shadcn-contract-testing --bin profile_render_time- Documentation: Check
docs/directory - Issues: Open a GitHub issue
- Discussions: Use GitHub Discussions
- Examples: Look at
examples/leptos/for usage patterns
Releases are automated through CI/CD. To trigger a release:
- Update version numbers in
Cargo.toml - Update
CHANGELOG.md - Create a release tag
- CI/CD will handle publishing
- Quality: Maintain 100% test pass rate
- Performance: Meet all performance contracts
- Compatibility: Full Leptos v0.8+ compatibility
- Documentation: Comprehensive API documentation
- Accessibility: WCAG 2.1 AA compliance
Happy Contributing! 🚀
For questions or support, please open an issue or start a discussion.