Thank you for your interest in contributing to Dynamic Weather Card! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Pull Request Process
- Coding Standards
- Testing
- Translation Contributions
Please be respectful and constructive in all interactions. We aim to maintain a welcoming and inclusive community.
- Bun (latest version)
- Git
- A GitHub account
-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR-USERNAME/dynamic-weather-card.git cd dynamic-weather-card -
Add upstream remote:
git remote add upstream https://github.com/teuchezh/dynamic-weather-card.git
-
Install dependencies:
bun install
-
Start development mode:
bun run dev
main- Production-ready code, protected branchdev- Development branch, all PRs should target this branch- Feature branches - Create from
devfor new features or bug fixes
git checkout dev
git pull upstream dev
git checkout -b feature/your-feature-namefeature/- New features (e.g.,feature/add-wind-speed)fix/- Bug fixes (e.g.,fix/forecast-rendering)docs/- Documentation updates (e.g.,docs/update-readme)chore/- Maintenance tasks (e.g.,chore/update-dependencies)
-
Update your branch with the latest changes from
dev:git checkout dev git pull upstream dev git checkout your-branch git rebase dev
-
Make your changes following the coding standards
-
Test your changes:
bun run lint # Check code style bun run typecheck # Check TypeScript types bun run build # Build the project
-
Commit your changes using Conventional Commits:
git commit -m "feat: add new weather animation" git commit -m "fix: correct forecast time display" git commit -m "docs: update installation instructions"
-
Push to your fork:
git push origin your-branch
-
Create a Pull Request on GitHub:
- Target the
devbranch - Fill out the PR template
- Link any related issues
- Add screenshots for UI changes
- Target the
- ✅ All CI checks must pass (linting, type checking, build)
- ✅ Code follows project conventions
- ✅ Commits follow Conventional Commits format
- ✅ PR description clearly explains the changes
- ✅ No unnecessary dependencies added
- Use TypeScript for all code
- Define proper types, avoid
any - Use existing types from
src/types.ts
- Follow existing code patterns
- Use ESLint configuration (run
bun run lint) - Use meaningful variable and function names
- Add comments for complex logic
When adding new animations:
import { BaseAnimation } from './base';
import type { TimeOfDay } from '../types';
export class MyAnimation extends BaseAnimation {
draw(time: number, width: number, height: number, timeOfDay: TimeOfDay): void {
// Animation logic here
}
}- Animations:
src/animations/ - Components:
src/components/ - Utilities:
src/utils.ts - Types:
src/types.ts - Constants:
src/constants.ts - Translations:
src/internationalization/locales/
- Open
demo.htmlin your browser - Test various weather conditions
- Test different configurations
- Check browser console for errors
- Build the project:
bun run build - Copy
dynamic-weather-card.jsto your Home Assistantwwwfolder - Add the card to a dashboard
- Test with real weather data
Run all checks:
bun run lint # ESLint
bun run typecheck # TypeScript
bun run build # Production buildWe welcome translations for new languages!
- Create a new folder:
src/internationalization/locales/[lang-code]/ - Add
translation.tsfile with all translation keys - Import in
src/internationalization/index.ts - Add language to
WeatherCardConfigtype insrc/types.ts - Update README.md and README.ru.md with the new language
export default {
weather: 'Weather',
feels_like: 'Feels like',
humidity: 'Humidity',
wind_speed: 'Wind speed',
wind_gust: 'Gusts',
wind_direction: 'Wind direction',
pressure: 'Pressure',
visibility: 'Visibility',
sunrise: 'Sunrise',
sunset: 'Sunset',
// ... all other keys
};Check existing translations in src/internationalization/locales/ for the complete list of keys.
- Create animation class in
src/animations/new-animation.ts - Extend
BaseAnimation - Implement
draw()method - Register in
src/components/card.ts(initializeAnimations + draw method) - Test with
demo.html - Update documentation
- Add to
WeatherCardConfiginterface insrc/types.ts - Add to
DEFAULT_CONFIGinsrc/constants.ts - Implement the feature in
src/components/card.ts - Update README.md and README.ru.md
- Test thoroughly
- 📖 Read the AGENTS.md for architecture overview
- 💬 Ask questions in GitHub Discussions
- 🐛 Report bugs via GitHub Issues
- 📧 Contact: Create an issue for questions
All contributors will be recognized in the project. Thank you for making Dynamic Weather Card better!
Happy Contributing! 🎉