|
| 1 | +# Contributing to Payload Auditor |
| 2 | + |
| 3 | +👋 Thank you for your interest in contributing to **Payload Auditor**! |
| 4 | +Your contributions help make this plugin more useful, secure, and stable for the Payload CMS community. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 🧩 Development Setup |
| 9 | + |
| 10 | +To develop, you need to follow these steps: |
| 11 | + |
| 12 | +- Click the **Fork** button on GitHub to create your own copy. |
| 13 | + |
| 14 | +- Clone your fork locally |
| 15 | + |
| 16 | +```bash |
| 17 | +git clone https://github.com/<your-username>/payload-auditor.git |
| 18 | +cd payload-auditor |
| 19 | +``` |
| 20 | + |
| 21 | +* Install dependencies |
| 22 | + |
| 23 | +```bash |
| 24 | +npm install |
| 25 | +``` |
| 26 | + |
| 27 | +* Connect to the main repo(Just once): This is very important. To get the latest changes, you must run the following command |
| 28 | + |
| 29 | +```bash |
| 30 | +git remote add upstream https://github.com/shaadcode/payload-auditor.git |
| 31 | +``` |
| 32 | + |
| 33 | +> You only need to run this command once after each clone. |
| 34 | +
|
| 35 | +* Create a Branch |
| 36 | + |
| 37 | +To develop, you need to create a branch. Note that the branch name must include the following three parts: |
| 38 | + |
| 39 | +```bash |
| 40 | +type/the-purpose-of-the-branch |
| 41 | +``` |
| 42 | + |
| 43 | +for example: |
| 44 | + |
| 45 | +```bash |
| 46 | +doc/combined-afterhook-logs |
| 47 | +``` |
| 48 | + |
| 49 | +* Get the latest changes: Before you commit, you need to get the latest changes from the main code. This step is very important because it will make your changes get into the main repo faster. Run the following command: |
| 50 | + |
| 51 | +```bash |
| 52 | +npm run sync-main:fork |
| 53 | +``` |
| 54 | + |
| 55 | +* Write code & commit using Conventional Commits |
| 56 | + |
| 57 | +To commit, you must run the `commit` script as follows: |
| 58 | + |
| 59 | +```bash |
| 60 | +npm run commit |
| 61 | +``` |
| 62 | + |
| 63 | +By executing this command, an environment for writing commits will be created for you, in the following order: |
| 64 | + |
| 65 | +1. Commit type: What is the purpose of your current code that you are about to commit? |
| 66 | + |
| 67 | +2. commit scope: You need to specify which area of the plugin your code is for.If you cannot select an item, select the empty option. |
| 68 | + |
| 69 | +3. commit message |
| 70 | + |
| 71 | +4. description(optional): Please provide more details about your commit |
| 72 | + |
| 73 | +5. breaking change(optional): If your changes result in breaking changes, you can list them. |
| 74 | + |
| 75 | +6. close issue: Do not enter anything in this section |
| 76 | +* Open a Pull Request: Open a PR to the main branch and enter an appropriate name and description. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## 🧪Plugin testing environment |
| 81 | + |
| 82 | +You can test your changes locally in the same repo. |
| 83 | + |
| 84 | +```bash |
| 85 | +cd dev |
| 86 | +npm run dev |
| 87 | +``` |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## 🧠 Commit Message Format (Conventional Commits) |
| 92 | + |
| 93 | +Examples: |
| 94 | + |
| 95 | +```bash |
| 96 | +feat: add audit log cleanup scheduler |
| 97 | +fix: handle missing user object in afterChange hook |
| 98 | +docs: update plugin usage section |
| 99 | +chore: bump dependency versions |
| 100 | +``` |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## 📬 Contact |
| 105 | + |
| 106 | +If you have any questions or want to discuss an idea before coding: |
| 107 | + |
| 108 | +- Open a [Discussion](https://github.com/shaadcode/payload-auditor/discussions) |
| 109 | + |
| 110 | +- Or create an [Issue](https://github.com/shaadcode/payload-auditor/issues) |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +Thank you again for helping improve **Payload Auditor**! |
0 commit comments