|
| 1 | +# Contributing to Copybuffer |
| 2 | + |
| 3 | +Thank you for your interest in contributing to Copybuffer! This project is primarily for personal use, but contributions are welcome. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- Node.js 18 or higher |
| 10 | +- npm |
| 11 | +- Ubuntu/Linux (for full clipboard and hotkey support) |
| 12 | +- Git |
| 13 | + |
| 14 | +### Setup Development Environment |
| 15 | + |
| 16 | +1. Fork the repository |
| 17 | +2. Clone your fork: |
| 18 | + ```bash |
| 19 | + git clone https://github.com/YOUR_USERNAME/Copybuffer.git |
| 20 | + cd Copybuffer |
| 21 | + ``` |
| 22 | + |
| 23 | +3. Install dependencies: |
| 24 | + ```bash |
| 25 | + npm install |
| 26 | + ``` |
| 27 | + |
| 28 | +4. Build the project: |
| 29 | + ```bash |
| 30 | + npm run build |
| 31 | + ``` |
| 32 | + |
| 33 | +## Development Workflow |
| 34 | + |
| 35 | +### Project Structure |
| 36 | + |
| 37 | +``` |
| 38 | +Copybuffer/ |
| 39 | +├── src/ |
| 40 | +│ ├── clipboard/ # Clipboard monitoring logic |
| 41 | +│ ├── config/ # Configuration management |
| 42 | +│ ├── hotkeys/ # Global hotkey handling |
| 43 | +│ ├── search/ # Search functionality |
| 44 | +│ ├── storage/ # JSON file storage |
| 45 | +│ ├── sync/ # GitHub Gist sync |
| 46 | +│ ├── cli.ts # CLI interface |
| 47 | +│ ├── index.ts # Main entry point |
| 48 | +│ ├── types.ts # TypeScript type definitions |
| 49 | +│ └── exports.ts # Public API exports |
| 50 | +├── dist/ # Compiled JavaScript (gitignored) |
| 51 | +├── package.json # Project configuration |
| 52 | +├── tsconfig.json # TypeScript configuration |
| 53 | +└── README.md # Documentation |
| 54 | +``` |
| 55 | + |
| 56 | +### Making Changes |
| 57 | + |
| 58 | +1. Create a new branch: |
| 59 | + ```bash |
| 60 | + git checkout -b feature/your-feature-name |
| 61 | + ``` |
| 62 | + |
| 63 | +2. Make your changes in the `src/` directory |
| 64 | + |
| 65 | +3. Build and test: |
| 66 | + ```bash |
| 67 | + npm run build |
| 68 | + npm run lint |
| 69 | + ``` |
| 70 | + |
| 71 | +4. Test your changes: |
| 72 | + ```bash |
| 73 | + # Test CLI commands |
| 74 | + node dist/cli.js --help |
| 75 | + node dist/cli.js list |
| 76 | + |
| 77 | + # Run the demo |
| 78 | + ./demo.sh |
| 79 | + ``` |
| 80 | + |
| 81 | +### Code Style |
| 82 | + |
| 83 | +- Follow existing code style |
| 84 | +- Use TypeScript for all new code |
| 85 | +- Run linter before committing: |
| 86 | + ```bash |
| 87 | + npm run lint |
| 88 | + ``` |
| 89 | +- Format code with Prettier: |
| 90 | + ```bash |
| 91 | + npm run format |
| 92 | + ``` |
| 93 | + |
| 94 | +### Commit Messages |
| 95 | + |
| 96 | +Use clear, descriptive commit messages: |
| 97 | + |
| 98 | +``` |
| 99 | +Add feature: Brief description |
| 100 | +
|
| 101 | +Detailed explanation of what changed and why. |
| 102 | +``` |
| 103 | + |
| 104 | +Examples: |
| 105 | +- `Add clipboard image support` |
| 106 | +- `Fix: Handle empty clipboard gracefully` |
| 107 | +- `Docs: Update installation instructions` |
| 108 | + |
| 109 | +## Testing |
| 110 | + |
| 111 | +Currently, the project uses manual testing. To test your changes: |
| 112 | + |
| 113 | +1. Build the project: |
| 114 | + ```bash |
| 115 | + npm run build |
| 116 | + ``` |
| 117 | + |
| 118 | +2. Test CLI commands: |
| 119 | + ```bash |
| 120 | + node dist/cli.js config |
| 121 | + node dist/cli.js list |
| 122 | + node dist/cli.js search "test" |
| 123 | + ``` |
| 124 | + |
| 125 | +3. Test monitoring (in a safe environment): |
| 126 | + ```bash |
| 127 | + node dist/cli.js start |
| 128 | + # Copy some text |
| 129 | + # Ctrl+C to stop |
| 130 | + node dist/cli.js list |
| 131 | + ``` |
| 132 | + |
| 133 | +4. Run the demo script: |
| 134 | + ```bash |
| 135 | + ./demo.sh |
| 136 | + ``` |
| 137 | + |
| 138 | +## Pull Request Process |
| 139 | + |
| 140 | +1. Ensure your code builds without errors: |
| 141 | + ```bash |
| 142 | + npm run build |
| 143 | + npm run lint |
| 144 | + ``` |
| 145 | + |
| 146 | +2. Update documentation if needed: |
| 147 | + - README.md for user-facing changes |
| 148 | + - EXAMPLES.md for new features |
| 149 | + - Code comments for complex logic |
| 150 | + |
| 151 | +3. Create a pull request with: |
| 152 | + - Clear title describing the change |
| 153 | + - Detailed description of what and why |
| 154 | + - Any related issues referenced |
| 155 | + |
| 156 | +4. Wait for review and address feedback |
| 157 | + |
| 158 | +## Areas for Contribution |
| 159 | + |
| 160 | +### High Priority |
| 161 | +- Cross-platform support (macOS, Windows) |
| 162 | +- Automated tests |
| 163 | +- Better hotkey support with modifier keys |
| 164 | +- Clipboard image/file support |
| 165 | + |
| 166 | +### Medium Priority |
| 167 | +- GUI interface |
| 168 | +- Encrypted clipboard entries |
| 169 | +- Plugin system |
| 170 | +- Advanced search filters |
| 171 | + |
| 172 | +### Documentation |
| 173 | +- More usage examples |
| 174 | +- Video tutorials |
| 175 | +- Troubleshooting guides |
| 176 | +- API documentation |
| 177 | + |
| 178 | +## Questions or Issues? |
| 179 | + |
| 180 | +- Open an issue for bugs or feature requests |
| 181 | +- Check existing issues before creating new ones |
| 182 | +- Provide detailed information: |
| 183 | + - OS and version |
| 184 | + - Node.js version |
| 185 | + - Steps to reproduce (for bugs) |
| 186 | + - Expected vs actual behavior |
| 187 | + |
| 188 | +## Code of Conduct |
| 189 | + |
| 190 | +### Be Respectful |
| 191 | +- Treat everyone with respect |
| 192 | +- Be constructive in feedback |
| 193 | +- Focus on the code, not the person |
| 194 | + |
| 195 | +### Be Collaborative |
| 196 | +- Help others learn |
| 197 | +- Share knowledge |
| 198 | +- Welcome newcomers |
| 199 | + |
| 200 | +### Be Professional |
| 201 | +- Use inclusive language |
| 202 | +- Stay on topic |
| 203 | +- Keep discussions productive |
| 204 | + |
| 205 | +## License |
| 206 | + |
| 207 | +By contributing to Copybuffer, you agree that your contributions will be licensed under the MIT License. |
| 208 | + |
| 209 | +## Thank You! |
| 210 | + |
| 211 | +Your contributions help make Copybuffer better for everyone! |
0 commit comments