# Contributing to WingLog

Thank you for your interest in contributing to WingLog! This document provides guidelines and information for contributors.

## Table of Contents

- [Code of Conduct](#code-of-conduct)
- [How Can I Contribute?](#how-can-i-contribute)
- [Development Setup](#development-setup)
- [Pull Request Process](#pull-request-process)
- [Style Guides](#style-guides)
- [Additional Notes](#additional-notes)

## Code of Conduct

This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

## How Can I Contribute?

### Reporting Bugs

- Use the GitHub issue tracker
- Include a clear and descriptive title
- Provide detailed steps to reproduce the issue
- Include your operating system and Node.js version
- Include any relevant error messages or stack traces
- Describe the expected behavior vs. actual behavior

### Suggesting Enhancements

- Use the GitHub issue tracker with the "enhancement" label
- Provide a clear and descriptive title
- Describe the proposed functionality in detail
- Explain why this enhancement would be useful
- Include any mockups or examples if applicable

### Pull Requests

- Fork the repository
- Create a feature branch from `main`
- Make your changes following the style guide
- Add tests for new functionality
- Ensure all tests pass
- Update documentation as needed
- Submit a pull request with a clear description

## Development Setup

### Prerequisites

- Node.js (version 18 or higher)
- pnpm (recommended) or npm
- Git

### Installation

1. Fork and clone the repository:
   ```bash
   git clone https://github.com/your-username/winglog.git
   cd winglog
   ```

2. Install dependencies:
   ```bash
   pnpm install
   ```

3. Run tests to ensure everything is working:
   ```bash
   pnpm test
   ```

### Available Scripts

- `pnpm test` - Run the test suite
- `pnpm test:watch` - Run tests in watch mode
- `pnpm test:coverage` - Run tests with coverage report
- `pnpm build` - Build the project
- `pnpm dev` - Development mode with TypeScript compilation
- `pnpm lint` - Run linting (if configured)
- `pnpm format` - Format code (if configured)

## Pull Request Process

1. **Create a feature branch**: Branch from `main` with a descriptive name
2. **Make your changes**: Follow the style guide and add tests
3. **Test your changes**: Ensure all tests pass and add new tests for new functionality
4. **Update documentation**: Update README, CHANGELOG, or other docs as needed
5. **Submit the PR**: Create a pull request with a clear description

### Pull Request Guidelines

- Use a clear and descriptive title
- Provide a detailed description of the changes
- Reference any related issues
- Include screenshots or examples if applicable
- Ensure the PR passes all CI checks
- Request reviews from maintainers

## Style Guides

### TypeScript/JavaScript

- Use TypeScript for all new code
- Follow the existing code style and formatting
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Use proper error handling

### Git Commit Messages

- 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 after the first line
- Use conventional commit format when possible:
  - `feat:` for new features
  - `fix:` for bug fixes
  - `docs:` for documentation changes
  - `style:` for formatting changes
  - `refactor:` for code refactoring
  - `test:` for adding tests
  - `chore:` for maintenance tasks

### Code Style

- Use 2 spaces for indentation
- Use semicolons at the end of statements
- Use single quotes for strings
- Use trailing commas in objects and arrays
- Use meaningful variable names
- Keep line length under 100 characters
- Add spaces around operators

## Additional Notes

### Issue and Pull Request Labels

- `bug` - Something isn't working
- `enhancement` - New feature or request
- `documentation` - Improvements or additions to documentation
- `good first issue` - Good for newcomers
- `help wanted` - Extra attention is needed
- `question` - Further information is requested

### Release Process

- Maintainers will review and merge pull requests
- Releases are made following semantic versioning
- The CHANGELOG.md file is updated for each release
- Releases are tagged in Git

### Getting Help

If you need help with contributing:

- Check existing issues and pull requests
- Ask questions in GitHub issues
- Review the documentation
- Check the test files for examples

## License

By contributing to WingLog, you agree that your contributions will be licensed under the Apache License 2.0.

Thank you for contributing to WingLog! 🚀 