Contributing¶
Guidelines for contributing to Dial Code.
Getting Started¶
- Fork the repository
- Clone your fork
- Install dependencies
- Create a feature branch
git clone https://github.com/your-username/dial-coder.git
cd dial-coder
npm install
git checkout -b feature/my-feature
Development Workflow¶
Before Making Changes¶
- Check for existing issues or PRs
- For new features, open an issue first
- Discuss approach in the issue
Making Changes¶
- Write code following the style guide
- Add tests for new functionality
- Update documentation if needed
Before Submitting¶
Run the preflight checks:
This runs:
- Formatting check
- Linting
- Type checking
- Unit tests
Code Style¶
TypeScript¶
- Use strict mode
- Prefer explicit types
- Use interfaces for public APIs
// Good
interface UserOptions {
name: string;
timeout?: number;
}
function createUser(options: UserOptions): User {
// ...
}
// Avoid
function createUser(options: any) {
// ...
}
Formatting¶
Prettier handles formatting automatically:
Linting¶
ESLint enforces code quality:
Testing¶
Unit Tests¶
Writing Tests¶
Use Vitest:
import { describe, it, expect } from 'vitest';
describe('myFunction', () => {
it('should return expected result', () => {
expect(myFunction('input')).toBe('expected');
});
});
Integration Tests¶
Pull Request Process¶
PR Requirements¶
- [ ] Linked to an issue (bug or approved feature)
- [ ] Tests added/updated
- [ ] Documentation updated (if user-facing)
- [ ] Preflight checks pass
- [ ] Clear description of changes
PR Title Format¶
type: brief description
Examples:
fix: resolve authentication timeout issue
feat: add custom command support
docs: update installation guide
refactor: simplify mode selection logic
Types¶
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change (no feature/fix) |
test |
Test additions |
chore |
Build/tooling changes |
Contributor License Agreement¶
Before your first contribution is merged, you'll need to sign the CLA.
Issue Guidelines¶
Bug Reports¶
Include:
- Dial Code version
- Node.js version
- Operating system
- Steps to reproduce
- Expected vs actual behavior
Feature Requests¶
Include:
- Use case description
- Proposed solution
- Alternatives considered
Review Process¶
- Automated checks run on PR
- Maintainer review for code quality
- Feedback addressed by contributor
- Approval and merge
Getting Help¶
- Open an issue for questions
- Check existing issues/PRs
- Read the documentation
Next Steps¶
- Building - Development setup
- Architecture - System design