We welcome contributions to KompKit! This document provides guidelines for contributing to our cross-platform utility library.
- Node.js 20+ and npm
- JDK 17+ (for Kotlin development)
- Flutter 3.0+ and Dart 3.0+ (for Flutter development)
- Git for version control
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/KompKit.git cd KompKit -
Install dependencies
npm install
-
Create a feature branch
git checkout -b feature/your-feature-name
develop: Active development branch (target for PRs)release: Stable release branch (production)- Feature branches:
feature/feature-nameorfix/bug-name
We use Conventional Commits for consistent commit messages:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksci: CI/CD changes
Examples:
feat(web): add throttle utility function
fix(kotlin): resolve debounce memory leak
docs: update API reference for formatCurrency
test(web): add edge cases for email validation- Cross-platform API parity: Maintain identical APIs across TypeScript, Kotlin, and Dart implementations
- Zero dependencies: Avoid adding runtime dependencies unless absolutely necessary
- Comprehensive testing: Every feature must include tests for all platforms
- Documentation: Update API docs and examples for new features
- Type safety: Use TypeScript and Kotlin type systems effectively
# Build all packages
npm run build
# Build web package only
npm run build:web
# Build Kotlin package only
cd packages/core/android && ./gradlew assemble# Run all tests
npm test
# Run web tests only
npm run test:web
# Run Kotlin tests only
npm run test:android
# Run Flutter tests only
cd packages/core/flutter && flutter test# Generate all documentation
npm run docs:all
# Generate web docs (TypeDoc)
npm run docs:web
# Generate Kotlin docs (Dokka)
npm run docs:android# Kotlin linting
cd packages/core/android && ./gradlew ktlintCheck
# Kotlin static analysis
cd packages/core/android && ./gradlew detekt
# Auto-fix Kotlin formatting
cd packages/core/android && ./gradlew ktlintFormatWhen adding a new utility function:
-
Implement in all three platforms:
- TypeScript:
packages/core/web/src/ - Kotlin:
packages/core/android/src/main/kotlin/com/kompkit/core/ - Dart:
packages/core/flutter/lib/src/
- TypeScript:
-
Maintain API consistency:
// TypeScript export function myUtility(param: string): boolean { ... }
// Kotlin fun myUtility(param: String): Boolean { ... }
// Dart bool myUtility(String param) { ... }
-
Add comprehensive tests:
- Web:
packages/core/web/tests/ - Kotlin:
packages/core/android/src/test/kotlin/ - Flutter:
packages/core/flutter/test/
- Web:
-
Update exports:
- Add to
packages/core/web/src/index.ts - Add to
packages/core/flutter/lib/kompkit_core.dart - Kotlin exports are automatic via package structure
- Add to
-
Document with examples:
- Add JSDoc comments (TypeScript)
- Add KDoc comments (Kotlin)
- Add DartDoc comments (Dart)
- Use ESLint and Prettier configurations
- Prefer
constoverlet - Use explicit return types for public APIs
- Follow existing naming conventions
- Follow ktlint formatting rules
- Use detekt for static analysis
- Prefer
valovervar - Use explicit types for public APIs
- Follow Kotlin coding conventions
- Follow Dart formatting rules (
dart format) - Use
flutter analyzefor static analysis - Prefer
finalovervarwhen possible - Use explicit types for public APIs
- Follow Dart style guide conventions
-
Create a feature branch:
git checkout develop git pull origin develop git checkout -b feature/your-feature-name
-
Make your changes:
- Implement feature in all platforms (Web, Android, Flutter)
- Add comprehensive tests
- Update documentation
-
Test thoroughly:
npm test cd packages/core/android && ./gradlew test cd packages/core/flutter && flutter test
-
Commit with conventional messages:
git add . git commit -m "feat(core): add new utility function"
-
Push and create PR:
git push origin feature/your-feature-name
-
PR targets
developbranch
- ✅ Feature implemented in TypeScript, Kotlin, and Dart
- ✅ Tests added for all platforms with good coverage
- ✅ All existing tests pass (
npm test) - ✅ Code follows style guidelines (ktlint, ESLint)
- ✅ API documentation updated (JSDoc/KDoc)
- ✅ Conventional commit messages used
- ✅ No breaking changes (or clearly documented)
- ✅ PR description explains the change and motivation
Releases are managed by maintainers:
- Version bump: Update
package.jsonand createVERSIONfile - Changelog: Update
CHANGELOG.mdwith new features/fixes - Tag creation: Create and push version tag
- Branch merge: Merge
develop→release
- 📖 Documentation: ./docs/
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Maintainers: Open an issue for direct contact
See also: CONTRIBUTING.md is auto-linked by GitHub in the PR interface.
This project follows the Contributor Covenant Code of Conduct. Please be respectful and inclusive in all interactions.