|
| 1 | +# Contributing to pg-bg-job-queue |
| 2 | + |
| 3 | +Thank you for your interest in contributing to **pg-bg-job-queue**! Your help is greatly appreciated. This guide will help you get started with contributing, from setting up your environment to submitting your first pull request. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Getting Started](#getting-started) |
| 8 | +- [Development Workflow](#development-workflow) |
| 9 | +- [Coding Standards](#coding-standards) |
| 10 | +- [Testing](#testing) |
| 11 | +- [Submitting Changes](#submitting-changes) |
| 12 | +- [Reporting Issues](#reporting-issues) |
| 13 | +- [Code of Conduct](#code-of-conduct) |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +1. **Fork the repository** on GitHub and clone your fork locally: |
| 20 | + ```bash |
| 21 | + git clone https://github.com/your-username/pg-bg-job-queue.git |
| 22 | + cd pg-bg-job-queue |
| 23 | + ``` |
| 24 | +2. **Install dependencies**: |
| 25 | + ```bash |
| 26 | + npm install |
| 27 | + ``` |
| 28 | +3. **Set up your environment**: |
| 29 | + - Copy `.env.example` to `.env` and update the variables as needed (e.g., `DATABASE_URL`). |
| 30 | + - Make sure you have a PostgreSQL instance running and accessible. |
| 31 | + |
| 32 | +## Development Workflow |
| 33 | + |
| 34 | +- Create a new branch for your feature or bugfix: |
| 35 | + ```bash |
| 36 | + git checkout -b feature/your-feature-name |
| 37 | + # or |
| 38 | + git checkout -b fix/your-bugfix |
| 39 | + ``` |
| 40 | +- Make your changes, following the coding standards below. |
| 41 | +- Add or update tests as needed. |
| 42 | +- Run the test suite to ensure everything works: |
| 43 | + ```bash |
| 44 | + npm test |
| 45 | + ``` |
| 46 | +- Commit your changes with a clear, descriptive message. |
| 47 | +- Push your branch and open a pull request (PR) against the `main` branch. |
| 48 | + |
| 49 | +## Coding Standards |
| 50 | + |
| 51 | +- Use **TypeScript** for all code. |
| 52 | +- Follow the existing code style. We use [Prettier](https://prettier.io/) for formatting. |
| 53 | +- Run `npm run format` before submitting your PR. |
| 54 | +- Write clear, concise comments and documentation. |
| 55 | +- Avoid using the `any` type; prefer strict typing. |
| 56 | +- Group related code (components, hooks, utils) together for easier maintenance. |
| 57 | + |
| 58 | +## Testing |
| 59 | + |
| 60 | +- All new features and bug fixes should include relevant tests. |
| 61 | +- First run `docker-compose up` to start the PostgreSQL container which will be used for testing. |
| 62 | +- Run the test suite with: |
| 63 | + ```bash |
| 64 | + npm run test |
| 65 | + ``` |
| 66 | +- Add tests in the `src/` directory, following the existing test structure. |
| 67 | +- Tests should be deterministic and not depend on external state. |
| 68 | + |
| 69 | +## Submitting Changes |
| 70 | + |
| 71 | +- Ensure your branch is up to date with `main` before opening a PR. |
| 72 | +- Provide a clear description of your changes in the PR. |
| 73 | +- Reference any related issues (e.g., `Closes #123`). |
| 74 | +- Be responsive to feedback and make requested changes promptly. |
| 75 | +- PRs should pass all CI checks before merging. |
| 76 | + |
| 77 | +## Reporting Issues |
| 78 | + |
| 79 | +If you find a bug or have a feature request: |
| 80 | + |
| 81 | +- Search [existing issues](https://github.com/your-username/pg-bg-job-queue/issues) to avoid duplicates. |
| 82 | +- Open a new issue with a clear title and detailed description. |
| 83 | +- Include steps to reproduce, expected behavior, and relevant logs or screenshots. |
| 84 | + |
| 85 | +## Code of Conduct |
| 86 | + |
| 87 | +- Be respectful and inclusive in all interactions. |
| 88 | +- Provide constructive feedback and be open to feedback on your contributions. |
| 89 | +- See [Contributor Covenant](https://www.contributor-covenant.org/) for general guidelines. |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +Thank you for helping make **pg-bg-job-queue** better! |
0 commit comments