Thank you for your interest in contributing to ColorAssembly! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Submitting Changes
- Style Guide
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
- Go 1.21 or later
- Node.js 18 or later
- npm 9 or later
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/ColorAssembly.git cd ColorAssembly - Add the upstream remote:
git remote add upstream https://github.com/CymbolTech/ColorAssembly.git
-
Install Go dependencies:
go mod download
-
Install Node.js dependencies:
npm install
-
Build the project:
make build
-
Verify everything works:
make ci
Create a branch with a descriptive name:
feature/add-color-mixing- New featuresfix/hex-parsing-issue- Bug fixesdocs/improve-readme- Documentationrefactor/optimize-conversion- Code refactoring
Follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Formatting, no code changerefactor: Code refactoringtest: Adding testschore: Maintenance
Examples:
feat(converters): add CIELUV color space support
fix(hex): handle 3-character hex codes correctly
docs(readme): add usage examples
# Compile tests (no runtime execution)
make test-compile
# Run full test suite (requires Node.js WASM environment)
make test
# Run with coverage
make test-coverage- Place tests in the
tests/directory - Use descriptive test names
- Include edge cases
- Test both valid and invalid inputs
Example test:
func TestRGBToHex(t *testing.T) {
tests := []struct {
name string
rgb models.RGB
want string
}{
{"black", models.RGB{R: 0, G: 0, B: 0}, "000000"},
{"white", models.RGB{R: 255, G: 255, B: 255}, "FFFFFF"},
{"red", models.RGB{R: 255, G: 0, B: 0}, "FF0000"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := converters.RGBToHex(tt.rgb)
if got.Hex != tt.want {
t.Errorf("RGBToHex() = %v, want %v", got.Hex, tt.want)
}
})
}
}-
Update your branch with the latest upstream:
git fetch upstream git rebase upstream/main
-
Ensure all tests pass:
make ci
-
Push to your fork:
git push origin your-branch-name
-
Create a Pull Request on GitHub
- Fill out the PR template completely
- Link related issues using keywords (e.g., "Fixes #123")
- Keep PRs focused on a single concern
- Include tests for new functionality
- Update documentation as needed
- Ensure CI passes
- A maintainer will review your PR
- Address any requested changes
- Once approved, a maintainer will merge
- Follow Effective Go
- Use
gofmtfor formatting - Run
go vetbefore committing - Keep functions small and focused
- Document exported functions
- Use TypeScript strict mode
- Prefer
constoverlet - Use explicit types for function parameters
- Document public APIs with JSDoc
ColorAssembly/
├── pkg/
│ ├── models/ # Color type definitions
│ ├── converters/ # Color space conversions
│ ├── generators/ # Color generation tools
│ ├── analyzers/ # Accessibility analysis
│ ├── helpers/ # Utility functions
│ ├── api/ # JavaScript API layer
│ └── binding/ # WASM bindings
├── src/ # TypeScript source
├── tests/ # Test files
├── tools/ # Build tools
└── dist/ # Build output
Feel free to open an issue for questions or discussions. We're happy to help!