Contribution Guide
This guide outlines the development workflow, commit standards, and code quality requirements for contributing to the project.
Repositories
This project has two repositories, one for the Card Factory package itself, and one for this website.
Card Game Package
This contains the source code for the project, and determines what is installed to for the NPM package.
Home page
This home page has two main functions:
- To serve as a demonstration of the project
- To provide documentation for setup and use of Card Factory.
Branches
Main Branch
- Production environment
- Requires two reviewer approvals for PRs
- No direct pushes allowed
- All changes must pass CI/CD pipelines
Develop Branch
- Staging environment
- Requires one reviewer approval for PRs
- Merges into main after QA testing
- All automated tests must pass
Feature Branches
- Branch naming:
type/description - Types: feature/, bugfix/, hotfix/, release/
- Example:
feature/add-user-authentication - Branch from and merge back to develop
Commits
The project uses conventional commit messages following this format: type(scope?): subject
Types
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testsperf: Performance improvementsbuild: Build system changesci: CI configuration changeschore: Regular maintenancerevert: Reverting changes
Examples
Good:
feat(auth): add JWT authentication
fix(navbar): resolve mobile overflow issue
docs(api): update endpoint documentationBad:
update stuff
fixed bug
WIPGit Hooks
The project uses pre-commit hooks to enforce standards:
- Install dependencies:
npm install - Hooks are automatically configured via husky
Code Quality
Prettier
- Runs automatically on staged files
- Configuration in
.prettierrc - To run manually:
npm run format
ESLint
- Enforces code quality rules
- Configuration in
.eslintrc - To run manually:
npm run lint - Common rules:
- No unused variables
- No console statements in production
- Consistent import order
Pull Requests
Template
PRs must include:
- Description of changes
- Related issue numbers
- Testing completed
- Screenshots (if UI changes)
Review Process
- Open PR against develop
- Pass automated checks
- Get required approvals
- Merge after resolution of feedback
Testing Requirements
- Unit tests for new features
- Integration tests where applicable
- Manual QA before merging to main
Troubleshooting
Common issues and solutions:
- Commit rejected: Run
npm run lint:fix - Hook installation: Remove and reinstall husky
- ESLint errors: Check
.eslintignore