Thank you for your interest in contributing to GitHub Quick Metadata! This document provides guidelines and instructions for contributing.
- Be respectful and inclusive
- Focus on constructive feedback
- Help create a welcoming environment for all contributors
If you find a bug, please create an issue with:
- Clear title: Describe the bug in one sentence
- Description: What happened vs. what you expected
- Steps to reproduce:
1. Go to '...' 2. Click on '...' 3. See error - Environment:
- Browser and version (e.g., Chrome 120)
- Extension/Userscript version
- Operating System (e.g., macOS 14, Windows 11)
- Screenshots: If applicable
- Console errors: Open DevTools → Console, copy any errors
Before submitting: Search existing issues to avoid duplicates.
Feature requests are welcome! Please create an issue with:
- Clear title: Describe the feature in one sentence
- Problem: What problem does this solve?
- Proposed solution: How would you like it to work?
- Alternatives: Have you considered alternatives?
- Additional context: Screenshots, mockups, or examples
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR-USERNAME/github-quick-metadata.git
cd github-quick-metadata# Create a feature branch from main
git checkout -b feature/your-feature-name
# Or for bug fixes
git checkout -b fix/bug-descriptionBranch naming:
feature/- New featuresfix/- Bug fixesdocs/- Documentation onlyrefactor/- Code refactoringtest/- Adding testschore/- Maintenance tasks
# Install dependencies
npm install
# Start development mode (watches for changes)
npm run devCode Style Guidelines:
- JavaScript: ES6+ syntax, no semicolons (consistent with existing code)
- Functions: Pure functions where possible, avoid mutation
- Naming:
- Variables:
camelCase - Functions:
camelCasewith descriptive verbs - Constants:
UPPER_SNAKE_CASE
- Variables:
- Comments: JSDoc for all exported functions
- File organization: Many small files > few large files (max 400 lines)
- Error handling: Always handle errors explicitly
Example:
/**
* Fetch repository metadata from GitHub API
* @param {string} owner - Repository owner
* @param {string} repo - Repository name
* @returns {Promise<object>} Repository metadata
*/
export async function fetchRepoMetadata(owner, repo) {
// Implementation
}# Build all targets
npm run build
# Build specific target
npm run build:chrome
npm run build:firefox
npm run build:userscript
# Lint your code
npm run lintManual Testing:
- Load the extension in your browser (see README.md installation)
- Navigate to a GitHub repository
- Test the feature/fix works as expected
- Test edge cases (slow network, API errors, etc.)
- Test on multiple repositories (small/large, active/inactive)
git add .
git commit -m "type: description"Commit message format:
type: brief description (max 50 chars)
Detailed explanation if needed (wrap at 72 chars).
- Bullet points for multiple changes
- Reference issues: Fixes #123
Types:
feat- New featurefix- Bug fixdocs- Documentation onlyrefactor- Code refactoring (no behavior change)test- Adding testschore- Maintenance (deps, build, etc.)perf- Performance improvement
Examples:
feat: add weekly commit chart visualization
Implements a 52-week bar chart showing commit activity.
Uses CSS-only rendering for performance.
Fixes #42
fix: handle 404 errors for empty repositories
Previously crashed when fetching commits from repos with
no commits. Now shows "N/A" for first commit date.
Fixes #56
# Push to your fork
git push origin feature/your-feature-nameThen create a Pull Request on GitHub with:
- Clear title: Same as commit message format
- Description:
- What does this PR do?
- Why is this change needed?
- How did you test it?
- Screenshots: If UI changes
- Related issues: Fixes #123, Relates to #456
PR Checklist:
- Code follows existing style
- All exported functions have JSDoc comments
- Tested manually in Chrome/Firefox
- No console errors or warnings
- Lint passes (
npm run lint) - Build succeeds (
npm run build) - Commit messages follow format
- Branch is up to date with main
- Respond to feedback promptly
- Make requested changes in new commits (don't force-push)
- Mark conversations as resolved when addressed
- Be patient - maintainers review PRs in their free time
# Update your local main branch
git checkout main
git pull upstream main
# Delete your feature branch
git branch -d feature/your-feature-name
git push origin --delete feature/your-feature-namesrc/
├── core/ # Business logic (API, caching, parsing, stats)
├── ui/ # UI components (panel, popup, settings)
└── utils/ # Utility functions (date, DOM, GitHub detection)
When adding new files:
- Place in appropriate directory based on purpose
- Export functions explicitly
- Add JSDoc comments to all exports
- Keep files focused (single responsibility)
- Import only what you need
API Client (src/core/api.js):
- All GitHub API calls go through
githubFetch() - Handles rate limiting, retries, and errors
- Never make direct
fetch()calls to GitHub API
Caching (src/core/cache.js):
- Cache all API responses with 1-hour TTL
- Use
buildCacheKey()for consistent keys - LRU eviction is automatic
Navigation (src/core/navigation.js):
- All repo page detection uses
isRepoPage()andparseRepoFromUrl() - SPA navigation handled by
initNavigationHandlers()
UI Components:
- Use
createElement()helper fromutils/dom.js - Follow existing CSS class naming:
gqm-* - Keep components small and focused
-
Add function to
src/core/api.js:export async function fetchNewEndpoint(owner, repo, options = {}) { const result = await githubFetch(`/repos/${owner}/${repo}/endpoint`, options); return result.data; }
-
Add caching wrapper where used:
const cacheKey = buildCacheKey(owner, repo, 'endpoint_name'); const cached = cacheGet(cacheKey); if (cached) return cached; const data = await fetchNewEndpoint(owner, repo); cacheSet(cacheKey, data); return data;
- Create file in
src/ui/your-component.js - Export initialization function
- Import and call from
src/extension.jsorsrc/userscript.js
Extension styles are bundled in the build process. Modify:
- Chrome/Firefox: Extension-specific CSS in dist folders (regenerated on build)
- Userscript: Inline styles in the component files
- Questions: Open a GitHub Discussion
- Bugs: Open an Issue
- Real-time: Join the community chat (link TBD)
Contributors will be recognized in:
- README.md acknowledgments section
- Release notes for their contributions
Thank you for contributing to GitHub Quick Metadata!