Contributing Guide
Thank you for your interest in contributing to Elaris.UI! This guide will help you get started.
How to Contribute
Section titled “How to Contribute”Contributions are welcome! You can contribute in several ways:
- Bug Reports: Report bugs by opening an issue
- Feature Requests: Suggest new features
- Code Contributions: Submit pull requests
- Documentation: Improve documentation
- Examples: Add example applications
Development Setup
Section titled “Development Setup”Prerequisites
Section titled “Prerequisites”- .NET SDK 8.0 or 9.0
- Git
- A code editor (Visual Studio, VS Code, Rider, etc.)
Getting the Source
Section titled “Getting the Source”git clone https://github.com/ambystechcom/Ambystech.Elaris.UI.gitcd Ambystech.Elaris.UI/libBuilding from Source
Section titled “Building from Source”# Restore dependenciesdotnet restore
# Build the librarydotnet build
# Run testsdotnet testProject Structure
Section titled “Project Structure”lib/├── src/ # Source code│ ├── Core/ # Core utilities│ ├── Enums/ # Enumerations│ ├── Input/ # Input handling│ ├── Rendering/ # Rendering system│ └── Widgets/ # Widget implementations├── examples/ # Example applications└── tests/ # Unit testsCode Style Guidelines
Section titled “Code Style Guidelines”General
Section titled “General”- Use C# 13.0 features where appropriate
- Follow .NET naming conventions
- Use meaningful variable and method names
- Add XML documentation comments for public members
Formatting
Section titled “Formatting”- Use 4 spaces for indentation
- Use
varwhen the type is obvious - Use primary constructors where appropriate
- Keep methods focused and small
Example
Section titled “Example”/// <summary>/// Creates a new widget with the specified text./// </summary>/// <param name="text">The widget text</param>public Widget(string text){ _text = text ?? string.Empty;}Testing Requirements
Section titled “Testing Requirements”Writing Tests
Section titled “Writing Tests”- Add unit tests for new features
- Test edge cases and error conditions
- Use descriptive test names
- Follow the existing test structure
Running Tests
Section titled “Running Tests”dotnet testTest Structure
Section titled “Test Structure”public class MyWidgetTests{ [Fact] public void MyWidget_Should_Do_Something() { // Arrange var widget = new MyWidget();
// Act widget.DoSomething();
// Assert Assert.True(widget.SomeProperty); }}Pull Request Process
Section titled “Pull Request Process”- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Add tests for new functionality
- Update documentation if needed
- Run tests:
dotnet test - Commit your changes:
git commit -m "Add feature" - Push to your fork:
git push origin feature/my-feature - Open a Pull Request
Pull Request Guidelines
Section titled “Pull Request Guidelines”- Provide a clear description of changes
- Reference related issues
- Ensure all tests pass
- Update documentation as needed
- Keep PRs focused and reasonably sized
Issue Reporting
Section titled “Issue Reporting”When reporting issues, please include:
- Description: Clear description of the issue
- Steps to Reproduce: How to reproduce the issue
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: .NET version, OS, terminal type
- Screenshots: If applicable
Documentation Contributions
Section titled “Documentation Contributions”Documentation improvements are always welcome:
- Fix typos or errors
- Add missing documentation
- Improve examples
- Add new examples
- Clarify confusing sections
Building the Documentation Site
Section titled “Building the Documentation Site”The documentation site is built with Astro Starlight:
cd sitenpm installnpm run dev # Development servernpm run build # Build for productionCode of Conduct
Section titled “Code of Conduct”- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Help others learn
Questions?
Section titled “Questions?”If you have questions about contributing:
- Open an issue for discussion
- Check existing issues and PRs
- Review the codebase to understand patterns
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the MIT License.
Thank You!
Section titled “Thank You!”Your contributions help make Elaris.UI better for everyone. Thank you for taking the time to contribute!