4.1 KiB
4.1 KiB
Contributing to ClipForge
Thank you for your interest in contributing to ClipForge! This document provides guidelines for contributing to the project.
Getting Started
Prerequisites
- Rust (stable toolchain) - install via rustup
- Node.js (v22+) and pnpm (v11+) - install via corepack
- Windows (Windows 10/11) - ClipForge is Windows-first
- Visual Studio 2022 with C++ workload (for MSVC toolchain)
Building from Source
# Clone the repository
git clone https://github.com/Alvin-Zilverstand/clipforge-game-clipper.git
cd clipforge-game-clipper
# Install frontend dependencies
pnpm install
# Build the frontend
pnpm run build
# Build the Tauri app (debug)
pnpm run desktop:dev
# Build the Tauri app (release installers)
pnpm run desktop:build
Installers will be created in src-tauri/target/release/bundle/.
Running Tests
# Run all Rust tests
cargo test
# Run only library tests
cargo test --lib
# Run specific test
cargo test test_name
Development Workflow
Branching Strategy
master- Protected branch, only updated via PR merges- Feature branches:
feat/descriptionorfeature/description - Bug fix branches:
fix/descriptionorbugfix/description - Documentation:
docs/description
Commit Messages
Follow Conventional Commits:
type(scope): short description
Longer description if needed.
Fixes #123
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style (formatting, etc.)refactor: Code refactoringtest: Adding/updating testschore: Maintenance tasks
Pull Request Process
- Fork the repository
- Create a feature branch from
master - Make your changes with tests
- Ensure all tests pass (
cargo test) - Ensure code is formatted (
cargo fmt) - Ensure clippy is clean (
cargo clippy) - Open a PR against
master - Wait for review and CI checks
Code Style
- Rust:
cargo fmt(standard rustfmt) - TypeScript:
pnpm run build(Vite runs the frontend build). There is currently no lint script inpackage.json. - Run
cargo clippybefore committing
Architecture Overview
clipforge-game-clipper/
├── src/ # Rust library (core logic)
│ ├── capture.rs # FFmpeg capture backends
│ ├── native_wgc.rs # Windows Graphics Capture
│ ├── native_audio.rs # WASAPI audio capture
│ ├── recorder.rs # Replay buffer, auto-clipping
│ ├── integrations.rs # League/Valve GSI events
│ ├── library.rs # Clip library (SQLite)
│ ├── upload.rs # Upload providers
│ ├── settings.rs # Versioned settings
│ └── ...
├── src-tauri/ # Tauri desktop shell
│ └── src/main.rs # Tauri commands, app setup
├── ui/ # TypeScript/Vite frontend
│ └── src/main.ts # Single-page UI
└── scripts/ # Build scripts
Adding Features
New Capture Backend
- Implement
CaptureBackendtrait insrc/capture.rs - Add to
start_best_capture_backendinsrc-tauri/src/main.rs - Add tests
New Game Integration
- Add game profile in
src/game_detection.rs - Implement
GameIntegrationtrait insrc/integrations.rs - Add event normalization
- Update
default_auto_clip_events_for_gameinsrc-tauri/src/main.rs - Add UI entries in
ui/src/main.ts
New Upload Provider
- Implement
Uploadertrait insrc/upload.rs - Add to
upload_clip_with_settingsinsrc-tauri/src/main.rs - Add UI in
ui/src/main.ts(Uploads view)
Reporting Issues
Use the GitHub issue templates:
Security
See SECURITY.md for reporting security vulnerabilities.
License
By contributing, you agree that your contributions will be licensed under the MIT License.