Thank you for your interest in contributing to Cheatron! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Commit Guidelines
- Pull Request Process
- Coding Standards
- Testing Guidelines
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
- Node.js >= 20.0.0
- npm >= 10.0.0
- Git
- Windows (for native functionality testing)
- Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/cheatron-core.git
cd cheatron-core- Install dependencies
npm install- Build all packages
npm run build- Run tests
npm testgit checkout -b feat/your-feature-name
# or
git checkout -b fix/your-bug-fixBranch naming convention:
feat/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions/changeschore/- Maintenance tasks
- Write clean, readable code
- Follow existing code style
- Add tests for new functionality
- Update documentation as needed
# Run linter
npm run lint
# Run type check
npm run typecheck
# Run tests
npm test
# Check code formatting
npm run format:checkWe use Conventional Commits:
git add .
git commit -m "feat(native): Add memory pattern scanning"Commit message format:
<type>(<scope>): <subject>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Test additions/changesbuild: Build system changesci: CI configuration changeschore: Other changes
Scopes:
core,native,nthread,capstone,keystone,log,native-bindings,win32-extdeps: Dependency updatesworkspace: Workspace/monorepo changes
git push origin feat/your-feature-nameThen create a Pull Request on GitHub.
- Update Documentation: Ensure documentation reflects your changes
- Add Tests: New features should include tests
- Update Changelog: Add entry to CHANGELOG.md if applicable
- Self-Review: Review your own PR first
- Request Review: Request review from maintainers
- Address Feedback: Respond to review comments
- Squash Commits: Clean up commit history if requested
Use the same format as commit messages:
feat(native): Add memory pattern scanning
The PR template is automatically loaded. Fill in all sections:
- Description of changes
- Type of change
- Related issues
- Checklist items
- Screenshots (if applicable)
- Use TypeScript strict mode
- Prefer
constoverlet - Use meaningful variable names
- Add JSDoc comments for public APIs
- Avoid
anytype when possible
- Indentation: 2 spaces
- Quotes: Single quotes for strings
- Semicolons: Always use them
- Line length: Max 80 characters (enforced by Prettier)
// 1. Imports
import { external } from 'package';
import { internal } from './internal';
// 2. Types/Interfaces
export interface MyInterface {
// ...
}
// 3. Constants
const CONSTANT_VALUE = 42;
// 4. Implementation
export class MyClass {
// ...
}- Files: kebab-case (
memory-scanner.ts) - Classes: PascalCase (
MemoryScanner) - Functions: camelCase (
scanPattern) - Constants: UPPER_SNAKE_CASE (
MAX_BUFFER_SIZE) - Private members: prefix with
_(_privateMethod)
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
- Test edge cases
- Mock external dependencies
- Aim for >70% code coverage
import { describe, test, expect } from 'vitest';
describe('MemoryScanner', () => {
describe('scanPattern', () => {
test('should find pattern in memory', () => {
// Arrange
const scanner = new MemoryScanner();
// Act
const result = scanner.scanPattern('48 8B 05');
// Assert
expect(result).toBeDefined();
});
test('should return null for invalid pattern', () => {
const scanner = new MemoryScanner();
const result = scanner.scanPattern('INVALID');
expect(result).toBeNull();
});
});
});# All tests
npm test
# Specific package
npm test -w @cheatron/native
# Watch mode
npm run test:watch
# Coverage
npm run test:coverageBefore requesting review, ensure:
- Code follows project style guidelines
- Tests are included and passing
- Documentation is updated
- No console.log or debug code
- Type safety is maintained
- Error handling is appropriate
- Performance considerations addressed
- Security implications considered
We use Changesets for version management:
# Create a changeset
npm run changeset
# Version packages
npm run version
# Publish to npm
npm run release- Open an issue for bug reports or feature requests
- Join our Discord for real-time discussion
- Check existing issues before creating new ones
Your contributions make Cheatron better for everyone. We appreciate your time and effort!