Welcome Contributors!
Thank you for considering contributing to Lumo UI! We are happy to have you here.About This Repository
This repository holds the UI components, the Gradle plugin, Android and Compose Multiplatform samples.Repository Structure
Key Components
lumo-ui/components-lab/
Contains the actual UI component implementations in Kotlin. These are the source components that get converted into templates. Location:lumo-ui/components-lab/src/commonMain/kotlin/com/nomanr/lumo/ui/
lumo-ui/plugin/
The Gradle plugin source code written in Kotlin. Key Files:LumoGradlePlugin.kt- Main plugin entry pointLumoTask.kt- Task implementation with CLI optionsComponentGenerator.kt- Component generation logicTemplate.kt- Template data structuresSupportedComponents.kt- Enum of available components
Templates
Template files are automatically generated from the components incomponents-lab using the generate_templates.sh script. They are embedded in the plugin resources.
Development Workflow
Prerequisites
- JDK 11 or higher
- Git
- Android Studio or IntelliJ IDEA (recommended)
- Basic knowledge of Kotlin and Jetpack Compose
Fork the Repository
- Click the ‘Fork’ button at the top right of the repository page
- This creates a copy of the repository in your GitHub account
Clone Your Fork
Create a New Branch
Always create a new branch for your changes:feature/component-name- For new componentsfix/issue-description- For bug fixesdocs/description- For documentation changesrefactor/description- For code refactoring
Make Your Changes
Make the necessary changes to the codebase. Ensure that your code follows the project’s coding standards and guidelines. Important: You don’t need to generate templates for your changes. Templates are regenerated automatically when a PR is merged.Code Style
The project uses Spotless for code formatting:spotlessApply before committing to ensure consistent formatting.
Test Your Changes
Test the Plugin Locally
- Publish the plugin to Maven Local:
- In a test project, use the local version:
- Test the plugin commands:
Test Sample Apps
Run the sample applications to verify components work correctly: Android Sample:Commit Your Changes
Write clear, descriptive commit messages:feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Push to Your Fork
Create a Pull Request
- Go to the original repository on GitHub
- Click “New Pull Request”
- Select your fork and branch
- Fill in the PR description:
- What changes did you make?
- Why did you make them?
- Any related issues?
- Screenshots (for UI changes)
- Ensure checks pass
- Allow maintainer edits
- Submit the pull request
Contributing Different Types of Changes
Adding a New Component
- Create the Component in
lumo-ui/components-lab/src/commonMain/kotlin/com/nomanr/lumo/ui/components/:
-
Add Platform-Specific Implementations if needed in respective source sets:
androidMain/kotlin/.../MyNewComponent.android.ktiosMain/kotlin/.../MyNewComponent.ios.kt- etc.
-
Add to SupportedComponents Enum in
lumo-ui/plugin/src/main/java/com/nomanr/lumo/plugin/template/templateregistry/SupportedComponents.kt:
- Register in Template Registry:
AndroidTemplates.kt, MultiplatformTemplates.kt, or CommonTemplates.kt:
-
Create a Sample in
sample-android/catalogue/orsample-multiplatform/common/showing usage - Test thoroughly across platforms
- Submit PR - Templates will be generated automatically
Fixing a Bug
-
Identify the Issue:
- Check if an issue exists on GitHub
- If not, create one describing the bug
-
Locate the Bug:
- Plugin bugs:
lumo-ui/plugin/ - Component bugs:
lumo-ui/components-lab/
- Plugin bugs:
-
Fix and Test:
- Make the fix
- Add tests if applicable
- Verify fix works in sample apps
-
Document the Fix:
- Update CHANGELOG if needed
- Reference issue number in commit
-
Submit PR:
Improving Documentation
- Documentation is in the main website repository, not this one
- For README or CONTRIBUTING.md changes in this repo:
- Edit the markdown files directly
- Preview your changes
- Submit PR
Refactoring Code
-
Discuss First:
- For large refactors, open an issue first
- Explain the benefits
- Get maintainer approval
-
Make Changes:
- Keep PRs focused
- Don’t mix refactoring with new features
- Ensure all tests pass
-
Document:
- Explain what changed and why
- Update relevant documentation
Component Guidelines
Component Requirements
- Composable: Must be a
@Composablefunction - Customizable: Provide parameters for common customizations
- Themeable: Use theme colors and typography
- Accessible: Consider accessibility (content descriptions, etc.)
- Documented: Include KDoc comments
- Cross-platform: Work on all platforms (for multiplatform components)
Component Structure
Follow this structure for consistency:Template Placeholders
Use these placeholders in component code:{{packageName}}- Replaced with user’s package name{{themeName}}- Replaced with user’s theme name
Testing Guidelines
Manual Testing Checklist
- Component renders correctly
- All parameters work as expected
- Theme integration works
- Works on all target platforms (for multiplatform)
- No compilation errors
- Code style is correct (
./gradlew spotlessCheck) - Sample app demonstrates the component
- Plugin generates the component correctly
Testing the Plugin
- Publish locally:
- Test in a sample project:
- Verify generated files:
- Check file locations
- Verify placeholders are replaced
- Ensure code compiles
- Test the component works
Request for New Components
Want a new component but don’t want to implement it yourself?- Go to https://github.com/nomanr/lumo-ui/issues
- Click “New Issue”
- Describe the component:
- What it should do
- How it should look
- Examples from other libraries
- Use cases
- Add the
component-requestlabel - Wait for maintainer response
Pull Request Guidelines
Before Submitting
- Code follows project style (run
./gradlew spotlessApply) - All existing tests pass
- New features include appropriate tests
- Commit messages are clear and descriptive
- PR description explains changes
- Breaking changes are clearly documented
PR Description Template
Review Process
-
Automated Checks:
- Code style
- Build success
- Tests passing
-
Maintainer Review:
- Code quality
- Design decisions
- Testing coverage
- Documentation
-
Feedback:
- Address review comments
- Push updates to the same branch
- Re-request review
-
Merge:
- Once approved, maintainers will merge
- Templates will be regenerated automatically
- Changes will be in the next release
Building and Testing
Build the Project
Run Tests
Clean Build
Code of Conduct
Be respectful and constructive:- Be welcoming to new contributors
- Be respectful of differing opinions
- Focus on what is best for the project
- Show empathy towards other community members
Questions?
If you have questions:- General questions: Open a GitHub Discussion
- Bug reports: Open an issue
- Feature requests: Open an issue
- Security issues: Email [email protected]
License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.Recognition
Contributors are recognized in:- GitHub contributors list
- Release notes (for significant contributions)
- Project README (for major contributions)
Happy coding! 🚀 Thank you for contributing to Lumo UI and making it better for everyone!