web-print-pdf
Version:
A powerful web HTML printing library that converts HTML to PDF and prints. Support multiple formats, batch printing, and WebSocket communication. Perfect for web applications needing print functionality.
130 lines (92 loc) โข 3.38 kB
Markdown
# Contributing to web-print-pdf
Thank you for your interest in contributing to web-print-pdf! This document provides guidelines and information for contributors.
## ๐ Quick Start
1. **Fork** the repository
2. **Clone** your fork locally
3. **Create** a feature branch
4. **Make** your changes
5. **Test** your changes
6. **Commit** with a clear message
7. **Push** to your fork
8. **Submit** a Pull Request
## ๐ Development Setup
```bash
# Clone your fork
git clone https://github.com/YOUR_USERNAME/web-print-pdf.git
cd web-print-pdf
# Install dependencies
npm install
# Start development mode
npm run dev
# Build the project
npm run build
# Format code
npm run format
# Check formatting
npm run format:check
```
## ๐งช Testing
Before submitting your changes, please ensure:
- [ ] Code builds successfully (`npm run build`)
- [ ] Code is properly formatted (`npm run format:check`)
- [ ] No linting errors (`npm run lint`)
- [ ] Documentation is updated if needed
- [ ] Tests pass (if applicable)
## ๐ Commit Guidelines
We follow [Conventional Commits](https://www.conventionalcommits.org/) format:
```
type(scope): description
[optional body]
[optional footer]
```
### Types:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation changes
- `style`: Code style changes (formatting, etc.)
- `refactor`: Code refactoring
- `test`: Adding or updating tests
- `chore`: Maintenance tasks
### Examples:
```
feat(api): add new printHtmlByBase64 method
fix(websocket): resolve connection timeout issue
docs(readme): update installation instructions
style(src): format code with prettier
```
## ๐ง Pull Request Guidelines
1. **Title**: Use a clear, descriptive title
2. **Description**: Explain what the PR does and why
3. **Related Issues**: Link to any related issues
4. **Screenshots**: Include screenshots for UI changes
5. **Testing**: Describe how you tested the changes
## ๐ Bug Reports
When reporting bugs, please include:
- **Description**: Clear description of the bug
- **Steps to Reproduce**: Detailed steps to reproduce
- **Expected Behavior**: What you expected to happen
- **Actual Behavior**: What actually happened
- **Environment**: OS, browser, Node.js version, etc.
- **Code Example**: Minimal code that reproduces the issue
## ๐ก Feature Requests
When requesting features, please include:
- **Problem**: What problem does this solve?
- **Solution**: How should it work?
- **Alternatives**: What alternatives have you considered?
- **Use Case**: Provide a concrete use case
## ๐ Documentation
We welcome documentation improvements! This includes:
- README updates
- API documentation
- Code comments
- Examples and tutorials
- Translation improvements
## ๐ค Code of Conduct
Please be respectful and inclusive in all interactions. We welcome contributors from all backgrounds and experience levels.
## ๐ License
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
## ๐ Need Help?
- Open an [issue](https://github.com/weixiaoyi/web-print-pdf/issues)
- Check existing [discussions](https://github.com/weixiaoyi/web-print-pdf/discussions)
- Review the [documentation](README.md)
Thank you for contributing! ๐