From a9bc355a2280659cdccae7217107cbb6fadd0591 Mon Sep 17 00:00:00 2001 From: shaadcode Date: Wed, 29 Oct 2025 15:52:45 +0330 Subject: [PATCH 1/3] docs: add contributing guide --- CONTRIBUTING.md | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e3c242b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,99 @@ +# Contributing to Payload Auditor + +👋 Thank you for your interest in contributing to **Payload Auditor**! +Your contributions help make this plugin more useful, secure, and stable for the Payload CMS community. + +--- + +## 🧩 Development Setup + +To develop, you need to follow these steps: + +- Click the **Fork** button on GitHub to create your own copy. + +- Clone your fork locally + +```bash +git clone https://github.com//payload-auditor.git +cd payload-auditor +``` + +* Install dependencies + +```bash +npm install +``` + +* Create a Branch + +To develop, you need to create a branch. Note that the branch name must include the following three parts: + +```bash +type/the-purpose-of-the-branch +``` + +for example: + +```bash +doc/combined-afterhook-logs +``` + +* Write code & commit using Conventional Commits + +To commit, you must run the `commit` script as follows: + +```bash +npm run commit +``` + +By executing this command, an environment for writing commits will be created for you, in the following order: + +1. Commit type: What is the purpose of your current code that you are about to commit? + +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. + +3. commit message + +4. description(optional): Please provide more details about your commit + +5. breaking change(optional): If your changes result in breaking changes, you can list them. + +6. close issue: Do not enter anything in this section + +--- + +## 🧪Plugin testing environment + +You can test your changes locally in the same repo. + +```bash +cd dev +npm run dev +``` + +--- + +## 🧠 Commit Message Format (Conventional Commits) + +Examples: + +```bash +feat: add audit log cleanup scheduler +fix: handle missing user object in afterChange hook +docs: update plugin usage section +chore: bump dependency versions +``` + +--- + +## 📬 Contact + +If you have any questions or want to discuss an idea before coding: + +- Open a [Discussion](https://github.com/shaadcode/payload-auditor/discussions) + +- Or create an [Issue](https://github.com/shaadcode/payload-auditor/issues) + +--- + +Thank you again for helping improve **Payload Auditor**! From 017aeb5000e4fc6c8f882757d64c5dad04c6a65e Mon Sep 17 00:00:00 2001 From: shaadcode Date: Wed, 29 Oct 2025 16:15:49 +0330 Subject: [PATCH 2/3] docs: add sync-main:fork script for get latest changes --- .husky/post-commit | 2 -- CONTRIBUTING.md | 20 ++++++++++++++++++++ package.json | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) delete mode 100644 .husky/post-commit diff --git a/.husky/post-commit b/.husky/post-commit deleted file mode 100644 index caaf69c..0000000 --- a/.husky/post-commit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -npm run sync-main diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e3c242b..f0d265f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,6 +24,14 @@ cd payload-auditor npm install ``` +* Connect to the main repo(Just once): This is very important. To get the latest changes, you must run the following command + +```bash +git remote add upstream https://github.com/shaadcode/payload-auditor.git +``` + +> You only need to run this command once after each clone. + * Create a Branch To develop, you need to create a branch. Note that the branch name must include the following three parts: @@ -38,6 +46,12 @@ for example: doc/combined-afterhook-logs ``` +* 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: + +```bash +npm run sync-main:fork +``` + * Write code & commit using Conventional Commits To commit, you must run the `commit` script as follows: @@ -60,6 +74,12 @@ By executing this command, an environment for writing commits will be created fo 6. close issue: Do not enter anything in this section +> ⚠ Note +> +> ```bash +> git fetch origin main && git rebase origin/main +> ``` + --- ## 🧪Plugin testing environment diff --git a/package.json b/package.json index fea0455..5b074c4 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "prepare": "husky", "commit": "cz", "sync-main": "git fetch origin main && git rebase origin/main", + "sync-main:fork": "git fetch upstream main && git rebase upstream/main", "release": "release-it --config .release-it.ts", "lint-staged": "lint-staged", "pre-release": "release-it --config .release-it.prerelease.ts --preRelease=beta" From 8ebae333a6e8fcc4ae16be2f54a0cad714c11e7b Mon Sep 17 00:00:00 2001 From: shaadcode Date: Wed, 29 Oct 2025 16:21:32 +0330 Subject: [PATCH 3/3] docs: add open pull request section --- CONTRIBUTING.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f0d265f..101ee3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,12 +73,7 @@ By executing this command, an environment for writing commits will be created fo 5. breaking change(optional): If your changes result in breaking changes, you can list them. 6. close issue: Do not enter anything in this section - -> ⚠ Note -> -> ```bash -> git fetch origin main && git rebase origin/main -> ``` +* Open a Pull Request: Open a PR to the main branch and enter an appropriate name and description. ---