- Remove OCR noise, credits, and duplicates from rules-database.json (288→255 rules) - Add clean_rules.py script for rule cleanup - Add CLAUDE.md, docs/, and update README with documentation links Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
5.0 KiB
5.0 KiB
Contributing Guide
Thank you for your interest in contributing to Deathwatch Roller! This guide will help you get started.
How to Contribute
Reporting Bugs
- Check if the bug already exists in issues
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
- Your environment (Node version, OS)
Suggesting Features
- Check issues for similar suggestions
- Create a feature request issue
- Include use case and expected behavior
Pull Requests
- Fork the repository
- Create a branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Update documentation
- Commit with descriptive messages
- Push to your branch
- Open a pull request
git checkout -b feature/amazing-feature
npm install
npm run dev
# Make changes
git add .
git commit -m "feat: add amazing feature"
git push origin feature/amazing-feature
Development Workflow
Setting Up Your Environment
# Clone the repository
git clone https://github.com/alexpolo1/dwroller.git
cd dwroller
# Install dependencies
npm install
# Start development servers
npm run dev
Code Style
We follow these style guidelines:
- TypeScript: Use TypeScript for all new code
- ESLint: Run
npm run lintbefore committing - Prettier: Auto-format with
npm run format - Testing: Add tests for all new features
Commit Guidelines
Use conventional commits:
feat: New feature
fix: Bug fix
docs: Documentation
style: Code style changes
refactor: Code refactoring
test: Adding tests
chore: Maintenance tasks
Code Review Process
All PRs go through:
- Initial Review: Automated checks (lint, tests)
- Technical Review: Code quality, design, performance
- Documentation: Are docs updated?
- Approval: Maintainer approval
Review Checklist
- Tests pass
- No lint errors
- Code follows style guide
- Documentation updated
- No security issues
- Performance considerations
Documentation
Documentation is in the docs/ folder:
SUMMARY.md- Table of contentsquick-start.md- Setup guideuser-guide.md- User documentationapi.md- API referencedeveloper-guide.md- Dev guide
When adding features:
- Update relevant documentation
- Add code examples
- Include usage instructions
Testing
Backend Tests
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Watch mode
npm run test:watch
Frontend Tests
# Run tests
cd frontend
npm test
# Run with coverage
npm run test:coverage
E2E Tests
# E2E testing (optional)
npm run test:e2e
Code Quality
Linting
# Check for issues
npm run lint
# Fix automatically fixable issues
npm run lint:fix
Formatting
# Format code
npm run format
Building
# Build for production
npm run build
# Check build
npm run build
Release Process
- Update
CHANGELOG.md - Bump version in
package.json - Create release branch
- Tag release
- Publish to npm (if applicable)
npm version patch
git push --follow-tags
Performance Guidelines
- Use indexing for database queries
- Implement caching for static data
- Lazy load heavy components
- Optimize bundle size
- Monitor performance metrics
Before/After Example
// ❌ BAD: N+1 query problem
const items = await db.items.findAll();
items.forEach(item => {
const owner = await db.owners.findOne({ where: { itemId: item.id } });
});
// ✅ GOOD: Use include for eager loading
const items = await db.items.findAll({
include: [{ model: Owner }]
});
Security Guidelines
- Never commit secrets or credentials
- Use environment variables for sensitive data
- Review third-party dependencies
- Use prepared statements for SQL
- Implement proper authentication
Secrets Management
# ✅ GOOD
export SESSION_SECRET=${SESSION_SECRET}
# ❌ BAD - Never do this
SESSION_SECRET="hardcoded-secret"
Accessibility
Make sure your changes:
- Support keyboard navigation
- Include ARIA labels where needed
- Maintain color contrast
- Support screen readers
- Are responsive
Browser Support
Test on:
- Chrome/Edge (Chromium)
- Firefox
- Safari
- Mobile browsers
Performance Benchmarks
- Initial load: < 2s
- API response: < 200ms
- Bundle size: < 500kb (gzipped)
- Lighthouse score: > 90
Community
- GitHub Issues
- Pull Requests
- Contributing guidelines:
CONTRIBUTING.md
Code of Conduct
- Be respectful
- Welcome newcomers
- Provide constructive feedback
- Focus on the project
License
By contributing, you agree that your contributions will be licensed under the MIT License.
Questions?
Open an issue or start a discussion on GitHub.