Thank you for your interest in contributing to Leptos-Sync! This document provides guidelines and information for contributors.
- Rust 1.75+
- Nightly Rust (for Leptos 0.8.x)
- Node.js 18+ with PNPM
- Nix (optional, for reproducible environment)
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/leptos-sync.git cd leptos-sync -
Install dependencies
pnpm install
-
Setup Rust toolchain
rustup toolchain install nightly rustup default nightly
-
Run tests to ensure everything works
cargo test
leptos-sync/
├── leptos-sync-core/ # Core synchronization library
├── leptos-sync-macros/ # Procedural macros
├── leptos-sync-components/ # Leptos UI components
├── leptos-sync-examples/ # Example applications
├── docs/ # Documentation
├── deployment/ # Production deployment configs
├── infrastructure/ # Infrastructure as code
└── tests/ # End-to-end tests
# All tests
cargo test
# Core library only
cargo test --package leptos-sync-core
# Specific modules
cargo test --package leptos-sync-core --lib sync::conflict
cargo test --package leptos-sync-core --lib sync::realtime
# With output
cargo test -- --nocapture
# End-to-end tests
pnpm test:e2e- Unit Tests: Test individual functions and methods
- Integration Tests: Test module interactions
- Property Tests: Use
proptestfor CRDT correctness - WASM Tests: Ensure browser compatibility
- Coverage: Aim for >90% test coverage
#[cfg(test)]
mod tests {
use super::*;
use proptest::prelude::*;
#[test]
fn test_basic_functionality() {
// Test implementation
}
proptest! {
#[test]
fn test_crdt_properties(a: u64, b: u64) {
// Property-based testing
}
}
}- Follow Rust API Guidelines
- Use
cargo fmtfor formatting - Use
cargo clippyfor linting - Document all public APIs with doc comments
/// Creates a new collection with the specified name and storage.
///
/// # Arguments
///
/// * `name` - The name of the collection
/// * `storage` - The storage backend to use
/// * `transport` - The transport layer for synchronization
///
/// # Examples
///
/// ```
/// use leptos_sync_core::{LocalFirstCollection, HybridStorage, HybridTransport};
///
/// let collection = LocalFirstCollection::new(
/// "todos".to_string(),
/// HybridStorage::new(),
/// HybridTransport::new()
/// );
/// ```
pub fn new(name: String, storage: HybridStorage, transport: HybridTransport) -> Self {
// Implementation
}Follow Conventional Commits:
feat: add new conflict resolution strategy
fix: resolve Send/Sync compatibility issue
docs: update architecture documentation
test: add property tests for CRDT operations
refactor: simplify storage abstraction
git checkout -b feature/your-feature-name- Write code following the style guidelines
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass
git add .
git commit -m "feat: add your feature description"git push origin feature/your-feature-name
# Create PR on GitHub- Performance Optimization: Improve CRDT merge algorithms
- Error Handling: Enhance error recovery strategies
- Testing: Add more comprehensive test coverage
- Documentation: Improve examples and guides
- New CRDT Types: Implement additional CRDT algorithms
- Transport Layer: Add new transport protocols
- Storage Backends: Support for additional storage systems
- Monitoring: Add metrics and observability
- Language Bindings: Python, JavaScript, etc.
- IDE Support: Language server, syntax highlighting
- Benchmarks: Performance comparison tools
- Migration Tools: Help users migrate from other systems
- Check if the issue is already reported
- Try to reproduce with the latest version
- Check if it's a platform-specific issue
**Description**
Brief description of the issue
**Steps to Reproduce**
1. Step 1
2. Step 2
3. Step 3
**Expected Behavior**
What should happen
**Actual Behavior**
What actually happens
**Environment**
- OS: [e.g., macOS, Linux, Windows]
- Rust Version: [e.g., 1.75.0]
- Leptos Version: [e.g., 0.8.0-rc2]
- Browser: [e.g., Chrome 108, Firefox 110]
**Additional Context**
Any other relevant information**Description**
Brief description of the feature
**Use Case**
Why this feature would be useful
**Proposed Solution**
How you think it should work
**Alternatives Considered**
Other approaches you've considered
**Additional Context**
Any other relevant informationIf you discover a security vulnerability, please:
- DO NOT create a public issue
- Email security@cloud-shuttle.com
- Include detailed information about the vulnerability
- Allow time for assessment and response
- Never commit sensitive information
- Follow secure coding practices
- Validate all inputs
- Use secure random number generation
- Implement proper access controls
Contributors will be recognized in:
- Project README
- Release notes
- Contributor hall of fame
- GitHub contributors list
By contributing to Leptos-Sync, you agree that your contributions will be licensed under the same license as the project (MIT OR Apache-2.0).
Thank you for contributing to Leptos-Sync! 🚀