|
| 1 | +# Contributing to MonoDog |
| 2 | + |
| 3 | +We welcome and appreciate your contribution to MonoDog. These guidelines will help ensure a smooth and collaborative process for everyone. |
| 4 | + |
| 5 | +## How Can You Contribute? |
| 6 | + |
| 7 | +Here are some ways you can contribute to the project: |
| 8 | + |
| 9 | +- Reporting bugs or issues |
| 10 | +- Submitting feature requests |
| 11 | +- Writing or improving documentation |
| 12 | +- Fixing bugs |
| 13 | +- Implementing new features |
| 14 | + |
| 15 | +## Steps for Contributing |
| 16 | + |
| 17 | +1. **Fork** the repository to your GitHub account. |
| 18 | + |
| 19 | +2. **Clone** the forked repository to your local machine. |
| 20 | + |
| 21 | +3. Create a new **branch** for your change: `git checkout -b <type>/<issue-id>-<description>`. See [branching guidelines](#branching-strategy) below. |
| 22 | + |
| 23 | +4. **Make changes** and **test** to ensure they work as expected. |
| 24 | + |
| 25 | +5. **Commit** your changes following our [commit message format](#commit-message-format): `git commit -m 'type(scope): subject'` |
| 26 | + |
| 27 | +6. **Push** your branch to your GitHub repository: `git push origin <type>/<issue-id>-<description>`. |
| 28 | + |
| 29 | +7. Create a **Pull Request** from your branch to the original repository's `dev` |
| 30 | + |
| 31 | +## Branching Strategy |
| 32 | + |
| 33 | +### Branch Types |
| 34 | + |
| 35 | +- **main**: Production-ready code. |
| 36 | +- **dev**: Integration branch for features and bug fixes. |
| 37 | +- **feature/\***: New features. |
| 38 | +- **bug/\***: Bug fixes. |
| 39 | +- **hotfix/\***: Critical fixes. |
| 40 | +- **fixes/\***: General fixes that do not need to be immediately addressed. |
| 41 | +- **docs/\***: Documentation-related changes (e.g., README updates, new docs). |
| 42 | +- **other/\***: For any other changes that do not fall into the above categories. |
| 43 | +- **enhancement/\***: Improvements that are not categorized as features or bug fixes. |
| 44 | +- **patch/\***: General maintenance tasks that don't fit into feature or bug fix categories. |
| 45 | + |
| 46 | +### Branching Guidelines |
| 47 | + |
| 48 | +- Always create a new branch from the **dev** branch. |
| 49 | +- When raising a pull request (PR), it should always be merged into the **dev** branch. |
| 50 | + |
| 51 | +### Naming Convention |
| 52 | + |
| 53 | +Branches should follow the format: |
| 54 | + |
| 55 | +- Format: `<type>/<issue-id>-<description>` |
| 56 | +- Example: `feature/12345-add-login-button` |
| 57 | + |
| 58 | +### Merge Strategy |
| 59 | + |
| 60 | +- Use pull requests for all merges. |
| 61 | +- Code must be reviewed and approved before merging to `main` or `dev`. |
| 62 | + |
| 63 | +### Conflict Resolution |
| 64 | + |
| 65 | +1. Pull the latest changes from the base branch. |
| 66 | +2. Resolve conflicts locally. |
| 67 | +3. Rebase the branch and push changes. |
| 68 | + |
| 69 | +## Commit Message Format |
| 70 | + |
| 71 | +We follow a conventional commit message format to ensure consistent and meaningful messages. This format helps in automated versioning, changelog generation, and release management in our monorepo structure. |
| 72 | + |
| 73 | +### Commit Structure |
| 74 | + |
| 75 | +``` |
| 76 | +type(scope): subject |
| 77 | +``` |
| 78 | + |
| 79 | +- **type**: The type of change being made (see types below) |
| 80 | +- **scope**: The package name from the monorepo being affected (required) |
| 81 | +- **subject**: A brief description of the change |
| 82 | + |
| 83 | +### Release Management |
| 84 | + |
| 85 | +Commit messages directly influence our automated release process: |
| 86 | + |
| 87 | +1. MAJOR version (1.0.0 → 2.0.0) |
| 88 | + |
| 89 | + - Any commit with a breaking change (`!` or `BREAKING CHANGE` in body) |
| 90 | + |
| 91 | +2. MINOR version (1.1.0 → 1.2.0) |
| 92 | + |
| 93 | + - Commits with `feat` type |
| 94 | + |
| 95 | +3. PATCH version (1.1.1 → 1.1.2) |
| 96 | + |
| 97 | + - Commits with `fix` or `perf` type |
| 98 | + |
| 99 | +4. No version change |
| 100 | + - Commits with `docs`, `chore`, `style`, `refactor`, `test`, or `ci` types |
| 101 | + |
| 102 | +## Setting up Husky for Git Hooks |
| 103 | + |
| 104 | +Husky is used for running pre-commit checks and enforcing commit message conventions. Follow these steps to set up Husky in the project: |
| 105 | + |
| 106 | +1. Install Husky: After cloning the repository, install the project dependencies by running: `pnpm install` |
| 107 | + |
| 108 | +2. Enable Husky Hooks: |
| 109 | + Once dependencies are installed, enable Git hooks with Husky: `pnpm husky install` |
| 110 | + |
| 111 | +3. Verify Husky Setup: |
| 112 | + After Husky is installed, you can test the hooks by making a commit. For more information, refer to [husky documentation](https://typicode.github.io/husky/get-started.html). |
| 113 | + |
| 114 | +## Pull Request Guidelines |
| 115 | + |
| 116 | +- Make sure your PR addresses an issue or feature request. |
| 117 | +- Describe your PR and provide context in the description. |
| 118 | +- Keep your PR focused on a single change to make reviewing easier. |
| 119 | +- Ensure your code follows the project's coding style and conventions. |
| 120 | + |
| 121 | +## Code of Conduct and Licensing |
| 122 | + |
| 123 | +Please ensure your contributions adhere to the project's [Code of Conduct](./CODE_OF_CONDUCT.md) and are licensed under the project's [License](./LICENSE). |
| 124 | + |
| 125 | +## Need Help? |
| 126 | + |
| 127 | +If you need further clarification or help, feel free to reach out by creating an issue or directly contacting the maintainers. |
| 128 | + |
| 129 | +Thank you for your interest in contributing to PIVOTHEAD! We appreciate your efforts in making this project better. |
| 130 | + |
| 131 | +Happy contributing! |
0 commit comments