Contributing to Hikari
Thank you for your interest in contributing to Hikari! This document provides guidelines and instructions for contributing to the project.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Code Style Guidelines
- Git Workflow
- Testing Guidelines
- Documentation Standards
- Pull Request Process
- Community Guidelines
Code of Conduct
Our Pledge
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful, constructive, and professional in all interactions.
Standards
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
Getting Started
Prerequisites
Before contributing, ensure you have:
- Rust 1.85+ (edition 2024, enforced by rust-version in Cargo.toml): Install from rustup.rs
- Node.js 22.13+ with pnpm 11: Required for the Vue package (packages/vue); enable via corepack enable
- Python 3.11+: For development tooling
- Just: Install with cargo install just
- Git: For version control
Fork and Clone
- Fork the repository on GitHub
- Clone your fork locally:
- Add upstream remote:
Development Setup
Install Dependencies
# Install Rust toolchain
# Install Just
# Install Python dependencies (for tooling)
# Install Vue package dependencies (packages/vue is its own pnpm workspace)
Build the Project
# Build all packages
# Or use cargo directly
Run Examples
The in-repo Rust demo applications were retired with the Rust E2E crate. The rendered component gallery lives in the tairitsu website example (../tairitsu/examples/website); visual checks run through the Python framework — just e2e-health, then just e2e-batch.
Development Mode
# Start development server (if configured)
Code Style Guidelines
Rust Code Style
We follow standard Rust conventions:
- Formatting: Use rustfmt
# or
- Linting: Use clippy
# or
- Naming Conventions:
- Structs/Enums: PascalCase
- Functions/Variables: snake_case
- Constants: SCREAMING_SNAKE_CASE
- Chinese Constants: Use Chinese characters (e.g., 石青)
// PascalCase
// snake_case
pub const MAX_SIZE: usize = 100; // SCREAMING_SNAKE_CASE
pub const 石青: Color = Color ; // Chinese (for palette)
Tairitsu Component Style
Components should follow these patterns:
// Always use component attribute
SCSS Style
Follow SCSS best practices:
// Use variables for all values
.my-component {
background-color: var(--hi-color-surface);
padding: var(--hi-spacing-md);
border-radius: var(--hi-radius-lg);
}
// Use nesting for related styles
.my-component {
&.modifier {
// Modifier styles
}
&:hover {
// Hover styles
}
.child-element {
// Child styles
}
}
Documentation Style
All public items must be documented:
/// Button component with multiple variants.
///
/// # Examples
///
/// ```rust
/// use hikari_components::Button;
///
/// rsx! {
/// Button { variant: ButtonVariant::Primary, "Click Me" }
/// }
/// ```
///
/// # Props
///
/// - `variant`: Button style variant
/// - `size`: Button size (Small, Medium, Large)
/// - `disabled`: Whether the button is disabled
/// - `loading`: Show loading spinner
Git Workflow
Branch Naming
Use descriptive branch names:
- feature/add-table-component
- fix/button-loading-state
- docs/update-readme
- refactor/theme-system
Commit Messages
Follow the <gitmoji> <Capitalized English sentence ending with a period.> format — this is enforced by the repository's commit-lint CI:
✨ Add a table component with pagination.
The gitmoji carries the change type: no feat: / fix: prefix, no colon before the summary, and the summary is a single English sentence ending with a period.
Examples:
- ✨ Add a table component with pagination.
- 🐛 Resolve the button disabled-state regression.
- 📝 Update the installation instructions.
- ♻️ Improve the theme provider performance.
Common emojis:
- ✨ - New feature
- 🐛 - Bug fix
- 📝 - Documentation changes
- 🎨 - Code style changes (formatting)
- ♻️ - Code refactoring
- ✅ - Adding or updating tests
- 🔧 - Maintenance tasks
Commit Workflow
- Create a feature branch:
- Make changes and commit:
- Push to your fork:
- Create Pull Request: Go to GitHub and create a PR
Keeping Your Fork Updated
Testing Guidelines
Write Tests
All new features must include tests:
Run Tests
# Run all Rust tests
# or
# Run tests for specific package
# Run tests with output
The Vue package (packages/vue) has its own Vitest suite — colocated *.test.ts(x) files run in a happy-dom environment:
Test Coverage
- Aim for >80% code coverage
- Test edge cases and error conditions
- Test component props and state
- Test async code properly
Documentation Standards
Code Documentation
- All public items must have doc comments
- Include examples for complex APIs
- Document panics, errors, and safety considerations
- Use proper Markdown formatting
README Documentation
Each package should have a README with:
- Overview: What the package does
- Installation: How to add as dependency
- Quick Start: Basic usage example
- API Reference: Detailed API docs
- Examples: Advanced usage patterns
Example Applications
Examples should be:
- Complete: Fully functional applications
- Documented: Well-commented code
- Idiomatic: Follow best practices
- Independent: Can run standalone
Pull Request Process
Before Submitting
- Code Quality:
- Run just fmt to format code
- Run just lint to check for issues
- Run just test to ensure tests pass
- Update documentation if needed
- Commits:
- Squash related commits
- Ensure commit messages follow guidelines
- Remove outdated or debug commits
- Documentation:
- Update relevant README files
- Add/update code documentation
- Do not add changelog files — the merged pull request history is the changelog
Creating a Pull Request
- Go to the Hikari repository on GitHub
- Click "New Pull Request"
- Select your feature branch
- Fill in the PR template:
- ---
- -
- --Review Process
- Automated Checks: CI will run tests and linters
- Code Review: Maintainers will review your code
- Feedback: Address review comments
- Approval: Once approved, your PR will be merged
After Merge
- Delete your feature branch
- Update your local master branch
- Celebrate! Thank you for your contribution
Project Structure Guidelines
Adding a New Component
When adding a new component:
- Location: Place in appropriate module (basic, feedback, navigation, data)
- File Structure:text1234
packages/hikari-components/src/ ├── category/ │ ├── mod.rs # Export the component │ └── component.rs # Component implementation - Exports: Add to mod.rs and lib.rs
- Documentation: Document in package README
- Example: Add to website or create dedicated example
Adding a New Package
When adding a new package:
- Update Workspace: Add to Cargo.toml
- Create Structure: Follow existing package structure
- Documentation: Create comprehensive README
- Examples: Provide usage examples
- Tests: Include thorough tests
Community Guidelines
Communication Channels
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and ideas
- Pull Requests: Code contributions
Getting Help
- Check existing documentation
- Search existing issues
- Ask in GitHub Discussions
- Join community chat (if available)
Reporting Issues
When reporting bugs:
- Use Issue Template: Fill out all required fields
- Minimal Reproduction: Provide code that reproduces the issue
- Environment: Include Rust version, OS, etc.
- Expected vs Actual: Describe what you expected vs what happened
Feature Requests
When requesting features:
- Use Case: Describe the problem you're solving
- Proposed Solution: How you envision it working
- Alternatives: Other approaches you considered
- Willingness to Contribute: Indicate if you can implement it
Recognition
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Credited in relevant documentation
- Invited to become maintainers (for consistent contributors)
License
By contributing, you agree that your contributions will be licensed under the Synthetic Source License (SySL), Version 1.0.
Questions?
If you have questions:
- Check this document
- Review existing issues and PRs
- Start a GitHub Discussion
- Contact maintainers
Thank you for contributing to Hikari! Your contributions help make Hikari better for everyone.