Skip to content

Commit ca24629

Browse files
authored
Merge pull request #1 from dev31sanghvi/copilot/create-smart-clipboard-manager
Implement Smart Clipboard Manager for Ubuntu with JSON storage, search, and Gist sync
2 parents abab10b + f4c43b7 commit ca24629

26 files changed

+5131
-1
lines changed

.env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Example .env file for Copybuffer
2+
# Copy this to .env and fill in your values
3+
4+
# GitHub Personal Access Token (with gist scope)
5+
# Get one at: https://github.com/settings/tokens
6+
GITHUB_TOKEN=your_github_token_here
7+
8+
# Optional: Specific Gist ID to sync with
9+
# GIST_ID=your_gist_id_here

.eslintrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended"
6+
],
7+
"plugins": ["@typescript-eslint"],
8+
"env": {
9+
"node": true,
10+
"es6": true
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 2020,
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"@typescript-eslint/no-explicit-any": "warn",
18+
"@typescript-eslint/explicit-function-return-type": "off",
19+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
20+
}
21+
}

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Node.js
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# TypeScript
8+
dist/
9+
build/
10+
*.tsbuildinfo
11+
12+
# Environment variables
13+
.env
14+
.env.local
15+
16+
# OS
17+
.DS_Store
18+
Thumbs.db
19+
20+
# IDE
21+
.vscode/
22+
.idea/
23+
*.swp
24+
*.swo
25+
26+
# Clipboard data
27+
clipboard-data/
28+
*.clipboard.json
29+
30+
# Logs
31+
logs/
32+
*.log
33+
34+
# Temporary files
35+
tmp/
36+
temp/

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"arrowParens": "always"
8+
}

CONTRIBUTING.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
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

Comments
 (0)