# Contributing to n8n-nodes-priority

Thank you for your interest in contributing to the Priority community node for n8n! This document provides guidelines and information for contributors.

## Table of Contents

- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
- [Development Setup](#development-setup)
- [Making Changes](#making-changes)
- [Submitting Changes](#submitting-changes)
- [Reporting Issues](#reporting-issues)
- [Feature Requests](#feature-requests)

## Code of Conduct

This project follows the [n8n Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

## Getting Started

### Prerequisites

- Node.js 18+ 
- npm or yarn
- Git
- Basic knowledge of TypeScript and n8n

### Development Setup

1. **Fork the repository**
   ```bash
   # Fork on GitHub, then clone your fork
   git clone https://github.com/YOUR_USERNAME/n8n-nodes-priority.git
   cd n8n-nodes-priority
   ```

2. **Install dependencies**
   ```bash
   npm install
   ```

3. **Set up development environment**
   ```bash
   # Start development mode with hot reload
   npm run dev
   ```

4. **Run tests and linting**
   ```bash
   # Run linter
   npm run lint

   # Build the project
   npm run build
   ```

## Making Changes

### Branch Naming

Use descriptive branch names:
- `feature/add-new-operation` - for new features
- `fix/error-handling` - for bug fixes
- `docs/update-examples` - for documentation updates
- `refactor/improve-performance` - for code improvements

### Code Style

- Follow the existing TypeScript patterns
- Use meaningful variable and function names
- Add JSDoc comments for public functions
- Follow the existing error handling patterns
- Ensure all code passes linting

### Testing

Before submitting changes:

1. **Run the linter**
   ```bash
   npm run lint
   ```

2. **Build the project**
   ```bash
   npm run build
   ```

3. **Test with n8n**
   - Use `npm run dev` to test with n8n
   - Test all new functionality
   - Verify error handling works correctly

### Documentation

- Update relevant documentation files
- Add examples for new features
- Update the changelog if needed
- Ensure all public APIs are documented

## Submitting Changes

### Pull Request Process

1. **Create a pull request**
   - Use a descriptive title
   - Reference any related issues
   - Provide a clear description of changes

2. **Pull request template**
   ```markdown
   ## Description
   Brief description of changes

   ## Type of Change
   - [ ] Bug fix
   - [ ] New feature
   - [ ] Documentation update
   - [ ] Code refactoring

   ## Testing
   - [ ] Linter passes
   - [ ] Build succeeds
   - [ ] Tested with n8n
   - [ ] All existing functionality works

   ## Checklist
   - [ ] Code follows project style
   - [ ] Self-review completed
   - [ ] Documentation updated
   - [ ] Changelog updated (if needed)
   ```

3. **Review process**
   - Maintainers will review your PR
   - Address any feedback promptly
   - Keep PRs focused and reasonably sized

## Reporting Issues

### Bug Reports

When reporting bugs, please include:

1. **Environment information**
   - n8n version
   - Node.js version
   - Operating system
   - Priority system version

2. **Steps to reproduce**
   - Clear, numbered steps
   - Expected vs actual behavior
   - Screenshots if applicable

3. **Error details**
   - Full error messages
   - Stack traces
   - Log files if relevant

### Issue Template

```markdown
## Bug Description
Brief description of the bug

## Environment
- n8n version: 
- Node.js version: 
- OS: 
- Priority version: 

## Steps to Reproduce
1. 
2. 
3. 

## Expected Behavior
What should happen

## Actual Behavior
What actually happens

## Error Messages
```
Any error messages or stack traces
```

## Additional Context
Any other relevant information
```

## Feature Requests

### Suggesting Features

When suggesting new features:

1. **Check existing issues** - Make sure it hasn't been requested
2. **Provide use case** - Explain why this feature would be useful
3. **Describe implementation** - If you have ideas about how to implement it
4. **Consider scope** - Ensure it fits within the project's goals

### Feature Request Template

```markdown
## Feature Description
Brief description of the requested feature

## Use Case
Why would this feature be useful?

## Proposed Implementation
How do you think this could be implemented?

## Additional Context
Any other relevant information
```

## Development Guidelines

### Priority API Integration

When adding new Priority API functionality:

1. **Follow OData standards** - Use proper OData query syntax
2. **Handle errors gracefully** - Provide meaningful error messages
3. **Support all auth methods** - Basic, PAT, and OAuth2
4. **Add comprehensive examples** - Include real-world usage examples
5. **Document thoroughly** - Update all relevant documentation

### Code Organization

- Keep related functionality together
- Use descriptive file and folder names
- Follow the existing project structure
- Separate concerns appropriately

### Error Handling

- Use appropriate n8n error types
- Provide helpful error messages
- Include context information
- Handle edge cases gracefully

## Getting Help

- **GitHub Issues** - For bugs and feature requests
- **GitHub Discussions** - For questions and general discussion
- **n8n Community** - For general n8n questions
- **Priority Documentation** - For Priority API questions

## Recognition

Contributors will be recognized in:
- README.md contributors section
- Release notes
- Project documentation

Thank you for contributing to n8n-nodes-priority! 🚀


