Thank you for your interest in contributing to Tick Tack Timer! This document provides guidelines and instructions for contributing to the project.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Node.js 20 or higher
- Yarn package manager
- Git
- A modern browser (Chrome 66+, Edge 79+, Safari 14.1+, or Firefox 76+)
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/Tick26.git cd Tick26 -
Add upstream remote:
git remote add upstream https://github.com/Scolavisa/Tick26.git
-
Install dependencies:
yarn install
-
Build WASM module:
yarn build:wasm
-
Start development server:
yarn dev
-
Run tests:
yarn test:run
git checkout -b feature/your-feature-nameUse descriptive branch names:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatestest/- Test additions or modificationsrefactor/- Code refactoring
Follow the project's coding standards:
- Use TypeScript strict mode
- Provide type annotations for all functions
- Avoid
anytypes - Use interfaces for object shapes
- Use Composition API with
<script setup> - Keep components focused and single-purpose
- Use composables for shared logic
- Follow Vue 3 best practices
- Use 2 spaces for indentation
- Use single quotes for strings
- Add semicolons
- Use meaningful variable names
- Add JSDoc comments for public APIs
All new features must include tests.
Create unit tests in tests/unit/ for:
- Specific scenarios with known inputs/outputs
- Edge cases and boundary conditions
- Error handling
Example:
describe('MyComponent', () => {
it('should do something specific', () => {
// Arrange
const input = 'test'
// Act
const result = myFunction(input)
// Assert
expect(result).toBe('expected')
})
})Create property tests in tests/property/ for:
- Universal properties that should hold for all inputs
- Validating correctness properties from design
Example:
import fc from 'fast-check'
// Feature: tick-tack-timer, Property X: Description
test('property description', () => {
fc.assert(
fc.property(
fc.integer(), // Generator
(value) => {
// Property that should always hold
expect(myFunction(value)).toBeGreaterThan(0)
}
),
{ numRuns: 100 }
)
})# Run all tests
yarn test:run
# Run tests in watch mode
yarn test
# Run specific test file
yarn test path/to/test.spec.ts
# Generate coverage report
yarn coverageAll tests must pass before submitting a PR.
# Build WASM module
yarn build:wasm
# Build application
yarn build
# Verify build
yarn verify:build
# Preview production build
yarn previewUse conventional commit messages:
type(scope): subject
body (optional)
footer (optional)
Types:
feat:- New featurefix:- Bug fixdocs:- Documentation changestest:- Test additions or modificationsrefactor:- Code refactoringstyle:- Code style changes (formatting, etc.)perf:- Performance improvementschore:- Build process or auxiliary tool changes
Examples:
git commit -m "feat(audio): add external microphone support"
git commit -m "fix(calibration): correct threshold calculation"
git commit -m "docs(readme): update installation instructions"
git commit -m "test(counter): add property tests for idle detection"# Push to your fork
git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
Use the same format as commit messages:
type(scope): description
Include:
- What - What changes does this PR introduce?
- Why - Why are these changes needed?
- How - How were the changes implemented?
- Testing - What tests were added/modified?
- Screenshots - If UI changes, include before/after screenshots
- Code follows project style guidelines
- All tests pass (
yarn test:run) - New tests added for new features
- Documentation updated if needed
- Build succeeds (
yarn build:all) - Build verification passes (
yarn verify:build) - No TypeScript errors
- Commit messages follow conventional format
tests/
├── unit/
│ ├── audio/ # Audio system tests
│ ├── components/ # Component tests
│ ├── composables/ # Composable tests
│ └── router/ # Router tests
└── property/ # Property-based tests
-
Test behavior, not implementation
- Focus on what the code does, not how it does it
- Test public APIs, not internal details
-
Use descriptive test names
// Good it('should increment counter when tick is detected') // Bad it('test counter')
-
Follow AAA pattern
- Arrange: Set up test data
- Act: Execute the code being tested
- Assert: Verify the results
-
Keep tests independent
- Each test should run in isolation
- Use
beforeEachfor setup - Use
afterEachfor cleanup
-
Test edge cases
- Null/undefined values
- Empty arrays/strings
- Boundary values
- Error conditions
Property tests validate universal properties:
// Property: For any valid input, output should satisfy X
fc.assert(
fc.property(
fc.array(fc.float()), // Generate random arrays of floats
(samples) => {
const result = processAudio(samples)
// Property: Result should always be non-negative
expect(result).toBeGreaterThanOrEqual(0)
}
),
{ numRuns: 100 }
)-
Automated Checks
- All tests must pass
- Build must succeed
- No TypeScript errors
-
Manual Review
- Code quality and style
- Test coverage
- Documentation completeness
- Performance considerations
-
Feedback
- Address reviewer comments
- Push additional commits to the same branch
- Request re-review when ready
- Use AudioWorklet for real-time processing
- Keep WASM module focused on performance-critical code
- Handle errors gracefully with user-friendly messages
- Use Vue composables for shared state
- Keep composables focused and single-purpose
- Use localStorage for persistence
- Keep components small and focused
- Use props for input, events for output
- Avoid prop drilling - use composables instead
- Minimize bundle size
- Use code splitting for routes
- Optimize WASM module size
- Cache static assets in service worker
- Add JSDoc comments for public APIs
- Include parameter descriptions and return types
- Add usage examples for complex functions
- Update README.md for user-facing changes
- Add/update docs in
docs/directory - Include screenshots for UI changes
- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Security: Email security concerns privately
Contributors will be recognized in:
- GitHub contributors list
- Release notes for significant contributions
- Project documentation
Thank you for contributing to Tick Tack Timer! 🎉