First off, thank you for considering contributing to this project! It's people like you that make open-source software such a great community.
This library is built with modern, pure Vanilla JS (ES Modules) and HTML5 Web Components. We purposely avoid heavy frameworks (like React or Vue) to keep the bundle size minimal.
- Node.js (version 20 or higher recommended)
npm(Node Package Manager)
- Fork this repository to your own GitHub account.
- Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/vanilla-js-github-calendar.git cd vanilla-js-github-calendar - Install dependencies:
npm install
To understand how to improve the code, here is a quick overview of our structure:
src/index.js: The main entry point. Defines the<github-calendar>Web Component.src/lib.js: Contains the core logic for fetching and transforming data from the GitHub Contributions API.src/styles.css: The library's stylesheet. Important: All classes must use thevghc-prefix (Vanilla GitHub Calendar) to prevent CSS collisions since we use Light DOM instead of Shadow DOM.index.html: Our interactive demo and playground.test/: Contains all our Unit Tests built with Vitest.
We use Vite for an ultra-fast development experience.
# Start the local development server (with Hot Module Replacement)
npm run devOpen http://localhost:5173 in your browser. Any changes you make in src/ will automatically refresh the page.
We maintain a high standard of code quality. Before submitting your code, please ensure it passes our linters and tests.
# 1. Run the Linter (ESLint)
npm run lint
# 2. Run the Test Suite (Vitest + JSDOM)
npm run testNote: If you are adding a new feature, please add a corresponding test in the
test/directory to prove that it works.
- Create a new branch for your feature:
git checkout -b feature/my-awesome-idea - Commit your changes with a descriptive message:
git commit -m "feat: add support for custom tooltip formatting" - Push your branch to your fork:
git push origin feature/my-awesome-idea - Open a Pull Request in our main repository: moonhuntercode/vanilla-js-github-calendar
We will review your code as quickly as possible. Thank you for your help!