Thank you for your interest in contributing to WeatherFlow! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- How Can I Contribute?
- Development Workflow
- Coding Standards
- Pull Request Process
- Reporting Bugs
- Design Guidelines
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues to avoid duplicates.
Guidelines for bug reports:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples and error messages
- Include screenshots if applicable
- Mention your browser, OS, and device information
- Describe the behavior you observed and the behavior you expected
Feature requests are welcome! Please follow these guidelines:
- Use a clear and descriptive title
- Provide a detailed description of the feature
- Explain why this feature would be useful
- Include examples or mockups if applicable
- Describe alternatives you've considered
Click the "Fork" button on the GitHub repository page.
git clone https://github.com/YOUR_USERNAME/weather-app.git
cd weather-app# Install dependencies
npm install
# Start development server
npm run devgit checkout -b feat/amazing-feature
# or
git checkout -b fix/specific-bug
# or
git checkout -b docs/documentation-update- Follow the Coding Standards
- Write clear, self-documenting code
- Add comments where necessary
- Update documentation if needed
# Format code
npm run format
# Run linter
npm run lint
# Build the project
npm run build
# Test in browser
npm run previewFollow the Conventional Commits specification:
feat: add new weather animation
fix: resolve geolocation permission issue
docs: update README with new screenshots
style: format CSS files
refactor: improve weather service architecture
test: add unit tests for validators
chore: update dependenciesExample:
git add .
git commit -m "feat: add keyboard shortcuts for favorites"git push origin feat/amazing-feature1. Go to the original repository on GitHub
2. Click "Compare & pull request"
3. Fill out the PR template
4. Submit your pull request
- Use ES6+ features
- Follow the ESLint configuration (
.eslintrc.js) - Use 4 spaces for indentation
- Use single quotes for strings
- Use semicolons
- Prefer
constoverlet, avoidvar - Use arrow functions for callbacks
- Add JSDoc comments for public functions and classes
Example:
/**
* Fetches weather data from the API
* @param {Object} params - Location parameters
* @returns {Promise<Object>} Weather data
*/
async function fetchWeather(params) {
const response = await fetch(`/api/weather?${new URLSearchParams(params)}`);
return response.json();
}- Use BEM methodology for class naming
- Use CSS custom properties for theming
- Use 2 spaces for indentation
- Organize styles logically (base, components, layout, utilities)
- Avoid !important unless absolutely necessary
.weather-card {
padding: var(--spacing-lg);
background-color: var(--color-background);
border-radius: var(--border-radius-lg);
}
.weather-card__title {
font-size: var(--font-size-xl);
color: var(--color-text);
}- Use semantic HTML5 elements
- Add proper ARIA attributes for accessibility
- Ensure proper nesting and indentation
- Use descriptive class names
- Include alt text for images Example:
<article class="weather-card" aria-labelledby="weather-title">
<h2 id="weather-title" class="weather-card__title">Current Weather</h2>
<div class="weather-card__content">
<!-- Content here -->
</div>
</article>Follow these guidelines:
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally
- Consider starting the commit message with a tag:
feat: - New featurefix: - Bug fixdocs: - Documentation changesstyle: - Code style changes (formatting, etc.)refactor: - Code refactoringtest: - Adding or updating testschore: - Maintenance tasks
- Update Documentation: Ensure README.md and relevant documentation is updated
- Add Tests: Include tests for new functionality
- Check Accessibility: Verify WCAG 2.1 AA compliance
- Test Across Browsers: Test in Chrome, Firefox, Safari, and Edge
- Performance Check: Ensure no performance regressions
- Security Review: Verify no security vulnerabilities introduced
- Code Review: Be prepared to make changes based on feedback
- When reporting bugs, please include:
- Clear Title: Summarize the issue
- Steps to Reproduce: Detailed steps to recreate the bug
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Screenshots: Visual evidence if applicable
- Environment: Browser, OS, device information
- Console Errors: Any error messages from browser console
- Clear Title: Describe the feature
- Detailed Description: Explain what it does
- Use Cases: Why is this useful?
- Examples: Mockups or examples
- Alternatives: Other approaches considered
- Maintain WCAG 2.1 AA compliance
- Ensure keyboard navigation works
- Add proper ARIA labels
- Test with screen readers
- Support high contrast mode
- Optimize images and assets
- Minimize bundle size
- Implement lazy loading
- Use efficient algorithms
- Avoid unnecessary re-renders
- Never expose API keys
- Sanitize all user inputs
- Validate all data
- Use HTTPS
- Implement CSP headers
Your contributions are greatly appreciated! Every contribution helps make WeatherFlow better for everyone.
If you have any questions, feel free to open an issue or contact the maintainers.
Happy coding! 🚀