docs: contributing guide

This commit is contained in:
Simon
2025-09-29 16:41:10 +08:00
parent 847620b5e8
commit 9501dc4b51

View File

@@ -8,7 +8,7 @@ Thank you for your interest in contributing to Page-Agent! We welcome contributi
1. **Prerequisites** 1. **Prerequisites**
- Node.js 20+ - Node.js 20+
- npm - npm 10+
2. **Install Dependencies** 2. **Install Dependencies**
```bash ```bash
@@ -17,9 +17,7 @@ Thank you for your interest in contributing to Page-Agent! We welcome contributi
3. **Development Commands** 3. **Development Commands**
```bash ```bash
npm run dev # Start documentation site npm start # Start documentation site
npm run build:lib:watch # Library development with auto-rebuild
npm run lint # Run linting
``` ```
### Project Structure ### Project Structure
@@ -42,14 +40,13 @@ This project has **two separate parts**:
1. **Fork and Clone** 1. **Fork and Clone**
```bash ```bash
git fork https://github.com/your-username/page-agent
git clone https://github.com/your-username/page-agent.git git clone https://github.com/your-username/page-agent.git
cd page-agent cd page-agent
``` ```
2. **Create Feature Branch** 2. **Create Feature Branch**
```bash ```bash
git checkout -b feature/your-feature-name git checkout -b feat/your-feature-name
``` ```
3. **Make Changes** 3. **Make Changes**
@@ -59,16 +56,14 @@ This project has **two separate parts**:
4. **Test Your Changes** 4. **Test Your Changes**
```bash ```bash
npm run lint # TODO
npm run build
npm run build:lib
``` ```
5. **Commit and Push** 5. **Commit and Push**
```bash ```bash
git add . git add .
git commit -m "feat: add awesome feature" git commit -m "feat: add awesome feature"
git push origin feature/your-feature-name git push origin feat/your-feature-name
``` ```
6. **Create Pull Request** 6. **Create Pull Request**
@@ -104,16 +99,20 @@ This project has **two separate parts**:
### Library Development ### Library Development
```bash - Config your LLM API
npm run build:lib:watch # Auto-rebuild on changes - Start a local script
# Test via: <script src="dist/lib/page-agent.umd.js"></script> ```bash
``` npm run build:lib:watch # Auto-rebuild on changes
```
- Add a new bookmark enable it on other website
```
javascript:(function(){var s=document.createElement('script');s.src=`http://localhost:5173/dist/lib/page-agent.umd.cjs?t=${Math.random()}`;s.onload=()=>console.log(%27PageAgent ready!%27);document.head.appendChild(s);})();
```
### Website Development ### Website Development
```bash ```bash
npm run dev # React development server npm start # React development server
# Import from src/ via @/ alias to demo library features
``` ```
### Adding Documentation ### Adding Documentation
@@ -136,7 +135,7 @@ We especially welcome contributions in:
## 🚫 What We Don't Accept ## 🚫 What We Don't Accept
- Changes that break existing API compatibility - Changes that break existing API compatibility
- Features that add React dependencies to core library - Heavy dependencies to core library
- Contributions without proper testing - Contributions without proper testing
- Code that doesn't follow project conventions - Code that doesn't follow project conventions
@@ -144,6 +143,8 @@ We especially welcome contributions in:
By contributing to this project, you agree that your contributions will be licensed under the MIT License. By contributing to this project, you agree that your contributions will be licensed under the MIT License.
You may need to sign a github CLA before you create a PR.
### Browser-Use Attribution ### Browser-Use Attribution
Parts of this project are derived from the [browser-use](https://github.com/browser-use/browser-use) project (MIT License). When contributing to DOM-related functionality: Parts of this project are derived from the [browser-use](https://github.com/browser-use/browser-use) project (MIT License). When contributing to DOM-related functionality: