Thank you for your interest in contributing to SnapRun! This document provides guidelines and information for contributors to help make the process smooth and effective.
- Use GitHub Issues to report bugs
- Search existing issues before creating new ones
- Provide detailed reproduction steps
- Include system information and SnapRun version
- Use GitHub Discussions for feature ideas
- Explain the use case and benefits
- Consider implementation complexity
- Gather community feedback
- Fix typos and clarify instructions
- Add examples and tutorials
- Update API documentation
- Create user guides and walkthroughs
- Bug fixes and improvements
- New Rhai functions and APIs
- UI enhancements
- Performance optimizations
- Example scripts for common tasks
- Educational scripts for learning Rhai
- Template scripts for different use cases
- Advanced automation examples
Required Tools:
Optional Tools:
- Visual Studio Code with Rust extensions
- Inno Setup for building installers
-
Fork and Clone
git clone https://github.com/yourusername/winscript.git cd winscript -
Install Dependencies
# Frontend dependencies pnpm install # Rust dependencies (automatically handled by Cargo) cd src-tauri cargo check
-
Run Development Server
# From project root pnpm tauri dev -
Verify Installation
- Application should open with hot-reload enabled
- Changes to frontend code should reflect immediately
- Changes to Rust code require restart
SnapRun/
βββ src/ # React/TypeScript frontend
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ services/ # Frontend services
β βββ ThemedComponents/ # UI component library
βββ src-tauri/ # Rust backend
β βββ src/
β β βββ lib.rs # Main application logic
β β βββ script_manager.rs # Script handling
β β βββ fs_kit.rs # File system operations
β β βββ process_kit.rs # Process management
β β βββ rhai_engine.rs # Rhai integration
β βββ Cargo.toml # Rust dependencies
βββ public/ # Static assets
βββ installer/ # Installer resources
βββ scripts/ # Built-in example scripts
Rust Code:
- Follow Rust style guidelines
- Use
rustfmtfor formatting:cargo fmt - Use
clippyfor linting:cargo clippy - Write descriptive variable and function names
- Add documentation comments for public functions
/// Reads file content and returns it as a string
///
/// # Arguments
/// * `file_path` - Path to the file to read
///
/// # Returns
/// * `Result<String, String>` - File content or error message
fn read_file_content(file_path: &str) -> Result<String, String> {
// Implementation
}TypeScript/React Code:
- Use TypeScript for type safety
- Follow React best practices
- Use functional components with hooks
- Use meaningful component and variable names
- Add JSDoc comments for complex functions
/**
* Hook for managing keyboard shortcuts
* @param shortcuts - Object mapping keys to callback functions
*/
export const useKeyboardShortcuts = (
shortcuts: Record<string, () => void>
) => {
// Implementation
};General Guidelines:
- Keep functions small and focused
- Use descriptive commit messages
- Include tests when appropriate
- Update documentation for API changes
Use clear, descriptive commit messages:
feat: add new file encryption function to Rhai API
fix: resolve system tray icon not updating on Windows 11
docs: update API reference for process management functions
refactor: simplify script loading logic in script_manager
test: add unit tests for file system operations
Format: type: description
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Formatting changesrefactor: Code restructuringtest: Adding/updating testschore: Build process or tooling changes
-
Create Feature Branch
git checkout -b feature/your-feature-name
-
Make Changes
- Implement your changes
- Test thoroughly
- Update documentation
-
Test Your Changes
# Run development version pnpm tauri dev # Build and test pnpm tauri build # Run any tests cargo test
-
Create Pull Request
- Push your branch to your fork
- Create PR against
mainbranch - Fill out PR template completely
- Link related issues
-
PR Review Process
- Maintainers will review your code
- Address feedback and requested changes
- Keep PR updated with main branch
- PR will be merged when approved
Manual Testing:
- Test on Windows 10 and 11 if possible
- Verify system tray functionality
- Test global shortcuts
- Validate script execution
- Check UI responsiveness
Automated Testing:
# Rust tests
cd src-tauri
cargo test
# Frontend tests (if available)
pnpm testTesting Checklist:
- Feature works as expected
- No regression in existing functionality
- UI is responsive and accessible
- System tray and shortcuts work
- Scripts execute correctly
- Build process completes successfully
-
Define Function in Rust
// In appropriate kit file (fs_kit.rs, process_kit.rs, etc.) pub fn my_new_function(param: String) -> Result<String, Box<EvalAltResult>> { // Implementation Ok("result".to_string()) }
-
Register Function in Rhai Engine
// In rhai_engine.rs engine.register_fn("my_function", my_new_function);
-
Update Documentation
- Add function to API_REFERENCE.md
- Include usage examples
- Update FEATURES.md if appropriate
-
Create Example Script
// In scripts/built_in_scripts/ let result = my_function("test input"); print("Result: " + result);
-
Create/Modify Component
// In src/components/ export const MyComponent: React.FC<Props> = ({ prop1, prop2 }) => { return ( <div className="themed-component"> {/* Component content */} </div> ); };
-
Update Styles
/* In appropriate CSS file */ .themed-component { background: var(--glass-background); border: 1px solid var(--glass-border); border-radius: 8px; }
-
Test Responsiveness
- Test different window sizes
- Verify glass effects work
- Check dark theme compatibility
Development Build:
pnpm tauri buildProduction Release:
# Build all installer types
pnpm run release:fullIndividual Installers:
# MSI installer
pnpm run build:msi
# NSIS installer
pnpm run build:nsis
# Inno Setup installer
pnpm run build:inno- Tauri Documentation - Framework documentation
- Rhai Book - Scripting language reference
- React Documentation - Frontend framework
- Rust Book - Rust programming language
- Visual Studio Code with extensions:
- Rust Analyzer
- ES7+ React/Redux/React-Native snippets
- Prettier
- GitLens
- Rust Playground - Online Rust testing
- Rhai Playground - Online Rhai testing
- GitHub Discussions - Questions and ideas
- GitHub Issues - Bug reports and feature requests
- Tauri Discord - Framework support
- Rust Community - General Rust help
Positive behavior includes:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints
- Gracefully accepting constructive criticism
- Focusing on what's best for the community
- Showing empathy towards other community members
Unacceptable behavior includes:
- Harassment, discrimination, or offensive comments
- Public or private harassment
- Publishing private information without permission
- Other conduct inappropriate in a professional setting
Report inappropriate behavior to the project maintainers. All complaints will be reviewed and investigated promptly and fairly.
Project maintainers who don't follow the Code of Conduct may face temporary or permanent consequences.
Contributors are recognized in several ways:
All contributors are listed in CONTRIBUTORS.md with their contributions.
Significant contributions are highlighted in release notes and changelogs.
- First-time contributors get special welcome
- Regular contributors may be invited as collaborators
- Outstanding contributions are featured in project updates
- Read this guide thoroughly
- Check existing issues and PRs
- Ask questions in GitHub Discussions
- Reach out to maintainers for guidance
- Use GitHub Issues for bugs
- Use GitHub Discussions for questions
- Check FAQ.md for common questions
- Review documentation in DOCS.md
By contributing to SnapRun, you agree that your contributions will be licensed under the same MIT License that covers the project.
Thank you for contributing to SnapRun! Your efforts help make Windows automation more accessible and powerful for everyone. π