Compare commits

...

23 Commits

Author SHA1 Message Date
renovate[bot]
f8468daeed Update dependency svelte to v5.53.6 2026-02-28 01:50:26 +00:00
91590b58f6 🔥 Remove --provenance flag from pnpm publish command in publish workflow. 2026-02-08 22:56:29 +01:00
renovate[bot]
ed73195948 Update dependency typescript to v5.9.3 (#12)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:47:42 +01:00
renovate[bot]
ad6cfba32e Update dependency @eslint/compat to v1.4.1 (#13)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:42:00 +01:00
renovate[bot]
1637a0c6f8 Update dependency svelte-check to v4.3.6 (#11)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:41:29 +01:00
renovate[bot]
2a03311cc5 Update dependency publint to v0.3.17 (#10)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:41:18 +01:00
renovate[bot]
31e6804a13 Update dependency prettier-plugin-svelte to v3.4.1 (#9)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:41:04 +01:00
renovate[bot]
4d90c2b52a Update dependency @sveltejs/package to v2.5.7 (#8)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:40:38 +01:00
renovate[bot]
cfa86966d0 Update dependency @sveltejs/adapter-auto to v6.1.1 (#6)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:39:32 +01:00
b84b8fbb68 🎨 Fix formatting issues in renovate.json and publish workflow. 2026-02-08 22:37:48 +01:00
renovate[bot]
878fc76602 Add renovate.json (#4)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-08 22:37:23 +01:00
f72676b535 🚀 Add prerelease tag handling and update Node.js/pnpm versions in workflows. 2026-02-08 22:36:26 +01:00
10c156ffdb ⬆️ Update Node.js version to 24 in publish workflow. 2026-02-08 22:31:58 +01:00
dependabot[bot]
1060ca8a5e ⬆️ Bump vite from 7.1.3 to 7.1.11 (#2)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.1.3 to 7.1.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.1.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.1.11
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-08 22:26:21 +01:00
cc6b0c5473 🔥 Remove unused NODE_AUTH_TOKEN environment variable from publish workflow. 2026-02-08 22:25:13 +01:00
0466b503fe 🐛 Remove unnecessary !important from min-height style in GitHubCalendar.svelte. 2026-02-08 22:19:16 +01:00
Paillat
ca88cbbca0 🎨 Format code 2025-08-28 19:09:27 +02:00
Paillat
d9e776683f 🐛 Fix css stuff again 2025-08-28 19:02:09 +02:00
Paillat
71af282bd2 🎨 Format... 2025-08-28 18:37:53 +02:00
Paillat
be3af1f676 💄 Fix css again 2025-08-28 18:35:00 +02:00
Paillat
bacfd12dfc 💄 Fix css 2025-08-28 18:19:08 +02:00
Paillat
d16e4b2f1f 🎨 Format README.md 2025-08-28 18:18:46 +02:00
Paillat
db1bc9803d 📖 Update README.md to reflect library name and usage examples for svelte-github-calendar 2025-08-28 17:49:29 +02:00
8 changed files with 727 additions and 621 deletions

View File

@@ -17,12 +17,12 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
@@ -36,6 +36,15 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"
if [[ $VERSION =~ - ]]; then
TAG=$(echo $VERSION | sed -E 's/.*-([^.]+).*/\1/')
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Prerelease detected, using tag: $TAG"
else
echo "tag=latest" >> $GITHUB_OUTPUT
echo "Stable release, using tag: latest"
fi
- name: Update package.json version
run: |
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version
@@ -43,12 +52,5 @@ jobs:
- name: Build package
run: pnpm build
- name: Set publishing auth config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish to NPM
run: pnpm publish --access public --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public --no-git-checks --tag ${{ steps.version.outputs.tag }}

View File

@@ -31,12 +31,12 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'pnpm'
- name: Install dependencies

View File

@@ -1,58 +1,79 @@
# Svelte library
# svelte-github-calendar
Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
A Svelte wrapper of the [github-calendar](https://github.com/Bloggify/github-calendar) library to displays GitHub contribution graphs in your Svelte applications.
Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
## Installation
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```sh
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
```bash
npm install svelte-github-calendar
```
## Developing
## Usage
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
### Basic Example
```sh
npm run dev
```svelte
<script>
import { GithubCalendar } from 'svelte-github-calendar';
</script>
# or start the server and open the app in a new browser tab
npm run dev -- --open
<GithubCalendar username="yourusername" />
```
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
### Advanced Example
## Building
```svelte
<script>
import { GithubCalendar } from 'svelte-github-calendar';
</script>
To build your library:
```sh
npm pack
<GithubCalendar
username="yourusername"
summary_text="Summary of {name}'s GitHub activity"
global_stats={true}
responsive={true}
tooltips={true}
cache={60}
class="my-custom-class"
/>
```
To create a production version of your showcase app:
## Props
```sh
npm run build
```
| Prop | Type | Default | Description |
| -------------- | ---------- | ------------ | ---------------------------------------- |
| `username` | `string` | **Required** | GitHub username to display calendar for |
| `summary_text` | `string` | `undefined` | Custom summary text template. |
| `proxy` | `function` | `undefined` | Custom proxy function for API requests |
| `global_stats` | `boolean` | `undefined` | Whether to show global statistics |
| `responsive` | `boolean` | `undefined` | Enable responsive design |
| `tooltips` | `boolean` | `undefined` | Enable hover tooltips |
| `cache` | `number` | `undefined` | Cache duration in seconds |
| `class` | `string` | `''` | Additional CSS classes for the container |
You can preview the production build with `npm run preview`.
You can read more about the props in the [original documentation](https://github.com/Bloggify/github-calendar).
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
## Credits
## Publishing
- Svelte wrapper of [github-calendar](https://github.com/Bloggify/github-calendar) by Bloggify
- Designed specifically for Svelte applications
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
## License
To publish your library to [npm](https://www.npmjs.com):
This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
```sh
npm publish
```
## Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
## Troubleshooting
### Calendar not loading
- Ensure the username is valid and public
- Verify network connectivity

View File

@@ -54,7 +54,7 @@
"svelte-check": "^4.0.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.20.0",
"vite": "^7.0.4"
"vite": "^7.1.11"
},
"keywords": [
"svelte"

798
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

4
renovate.json Normal file
View File

@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"]
}

View File

@@ -22,9 +22,7 @@
});
</script>
<div class={`calendar-holder ${className}`}>
<div class="calendar"></div>
</div>
<div class={`calendar ${className}`}></div>
<style global>
:root {
@@ -35,235 +33,242 @@
--color-calendar-graph-day-L4-bg: #0a4208 !important;
}
:global {
.calendar-holder {
.ContributionCalendar-day[data-level='0'] {
background-color: var(--color-calendar-graph-day-bg) !important;
}
.ContributionCalendar-day[data-level='0'] {
background-color: var(--color-calendar-graph-day-bg) !important;
}
.ContributionCalendar-day[data-level='1'] {
background-color: var(--color-calendar-graph-day-L1-bg) !important;
}
.ContributionCalendar-day[data-level='1'] {
background-color: var(--color-calendar-graph-day-L1-bg) !important;
}
.ContributionCalendar-day[data-level='2'] {
background-color: var(--color-calendar-graph-day-L2-bg) !important;
}
.ContributionCalendar-day[data-level='2'] {
background-color: var(--color-calendar-graph-day-L2-bg) !important;
}
.ContributionCalendar-day[data-level='3'] {
background-color: var(--color-calendar-graph-day-L3-bg) !important;
}
.ContributionCalendar-day[data-level='3'] {
background-color: var(--color-calendar-graph-day-L3-bg) !important;
}
.ContributionCalendar-day[data-level='4'] {
background-color: var(--color-calendar-graph-day-L4-bg) !important;
}
.ContributionCalendar-day[data-level='4'] {
background-color: var(--color-calendar-graph-day-L4-bg) !important;
}
table.ContributionCalendar-grid {
margin-bottom: 0pt !important;
}
table.ContributionCalendar-grid {
margin-bottom: 0pt !important;
border-collapse: separate !important;
}
table.ContributionCalendar-grid td {
padding: 4pt !important;
}
table.ContributionCalendar-grid td {
padding: 4pt !important;
}
table.ContributionCalendar-grid td span.sr-only {
display: none !important;
}
table.ContributionCalendar-grid td span.sr-only {
display: none !important;
}
td.ContributionCalendar-label span[aria-hidden='true'] {
font-size: 8pt !important;
left: -1pt !important;
}
td.ContributionCalendar-label span[aria-hidden='true'] {
font-size: 8pt !important;
left: -1pt !important;
}
tool-tip {
display: none !important;
}
tool-tip {
display: none !important;
}
.calendar .width-full > .float-left {
display: none !important;
}
.calendar .width-full > .float-left {
display: none !important;
}
.calendar {
font-family: Helvetica, arial !important;
border: 1px solid #dddddd !important;
border-radius: 3px !important;
min-height: 243px !important;
text-align: center !important;
margin: 0 auto !important;
}
.calendar {
font-family: Helvetica, arial !important;
border: 1px solid #dddddd !important;
border-radius: 3px !important;
min-height: 243px;
text-align: center !important;
margin: 0 auto !important;
}
.calendar-graph text.wday,
.calendar-graph text.month {
font-size: 10px !important;
fill: #aaa !important;
}
.calendar-graph text.wday,
.calendar-graph text.month {
font-size: 10px !important;
fill: #aaa !important;
}
div.px-md-5 {
height: 2rem !important;
}
div.px-md-5 {
height: 2rem !important;
}
div.float-right {
text-align: right !important;
padding: 0 14px 10px 0 !important;
display: inline-block !important;
float: right !important;
}
div.float-right {
text-align: right !important;
padding: 0 14px 10px 0 !important;
display: inline-block !important;
float: right !important;
}
div.float-right div {
display: inline-block !important;
list-style: none !important;
margin: 0 5px !important;
position: relative !important;
bottom: -1px !important;
padding: 0 !important;
}
div.float-right div {
display: inline-block !important;
list-style: none !important;
margin: 0 5px !important;
position: relative !important;
bottom: -1px !important;
padding: 0 !important;
}
div.float-right span.sr-only {
display: none !important;
}
div.float-right span.sr-only {
display: none !important;
}
.contrib-legend .legend li {
display: inline-block !important;
width: 10px !important;
height: 10px !important;
}
.contrib-legend .legend li {
display: inline-block !important;
width: 10px !important;
height: 10px !important;
}
.text-small {
font-size: 12px !important;
color: #767676 !important;
}
.text-small {
font-size: 12px !important;
color: #767676 !important;
}
.calendar-graph {
padding: 5px 0 0 !important;
text-align: center !important;
}
.calendar-graph {
padding: 5px 0 0 !important;
text-align: center !important;
}
.contrib-column {
padding: 15px 0 !important;
text-align: center !important;
border-left: 1px solid #ddd !important;
border-top: 1px solid #ddd !important;
font-size: 11px !important;
}
.contrib-column {
padding: 15px 0 !important;
text-align: center !important;
border-left: 1px solid #ddd !important;
border-top: 1px solid #ddd !important;
font-size: 11px !important;
}
.contrib-column-first {
border-left: 0 !important;
}
.contrib-column span {
color: #000 !important;
}
.contrib-column-first {
border-left: 0 !important;
}
.table-column {
box-sizing: border-box !important;
display: table-cell !important;
width: 1% !important;
padding-right: 10px !important;
padding-left: 10px !important;
vertical-align: top !important;
}
.contrib-number {
font-weight: 300 !important;
line-height: 1.3em !important;
font-size: 24px !important;
display: block !important;
color: #333 !important;
}
.calendar img.spinner {
width: 70px !important;
margin-top: 50px !important;
min-height: 70px !important;
}
.monospace {
text-align: center !important;
color: #000 !important;
font-family: monospace !important;
}
.monospace a {
color: #1d75ab !important;
text-decoration: none !important;
}
.contrib-footer {
font-size: 11px !important;
padding: 0 10px 12px !important;
text-align: left !important;
width: 100% !important;
box-sizing: border-box !important;
height: 26px !important;
}
.calendar .text-muted {
color: inherit !important;
}
.left.text-muted {
float: left !important;
margin-left: 9px !important;
color: #767676 !important;
}
.left.text-muted a {
color: #4078c0 !important;
text-decoration: none !important;
}
.left.text-muted a:hover,
.monospace a:hover {
text-decoration: underline !important;
}
h2.f4.text-normal.mb-3 {
display: none !important;
}
.float-left.text-gray {
float: left !important;
}
#user-activity-overview {
display: none !important;
}
.day-tooltip {
white-space: nowrap !important;
position: absolute !important;
z-index: 99999 !important;
padding: 10px !important;
font-size: 12px !important;
color: #959da5 !important;
text-align: center !important;
background: rgba(0, 0, 0, 0.85) !important;
border-radius: 3px !important;
display: none !important;
pointer-events: none !important;
}
.day-tooltip strong {
color: #dfe2e5 !important;
}
.day-tooltip.is-visible {
display: block !important;
}
.day-tooltip:after {
position: absolute !important;
bottom: -10px !important;
left: 50% !important;
width: 5px !important;
height: 5px !important;
box-sizing: border-box !important;
margin: 0 0 0 -5px !important;
content: ' ' !important;
border: 5px solid transparent !important;
border-top-color: rgba(0, 0, 0, 0.85);
}
text.ContributionCalendar-label {
fill: #ccc !important;
font-size: 11px !important;
}
@media screen and (max-width: 768px) {
.table-column {
box-sizing: border-box !important;
display: table-cell !important;
width: 1% !important;
padding-right: 10px !important;
padding-left: 10px !important;
vertical-align: top !important;
}
.contrib-number {
font-weight: 300 !important;
line-height: 1.3em !important;
font-size: 24px !important;
display: block !important;
color: #333 !important;
}
.calendar img.spinner {
width: 70px !important;
margin-top: 50px !important;
min-height: 70px !important;
}
.monospace {
text-align: center !important;
color: #000 !important;
font-family: monospace !important;
}
.monospace a {
color: #1d75ab !important;
text-decoration: none !important;
}
.contrib-footer {
font-size: 11px !important;
padding: 0 10px 12px !important;
text-align: left !important;
width: 100% !important;
box-sizing: border-box !important;
height: 26px !important;
}
.left.text-muted {
float: left !important;
margin-left: 9px !important;
color: #767676 !important;
}
.left.text-muted a {
color: #4078c0 !important;
text-decoration: none !important;
}
.left.text-muted a:hover,
.monospace a:hover {
text-decoration: underline !important;
}
h2.f4.text-normal.mb-3 {
display: none !important;
}
.float-left.text-gray {
float: left !important;
}
#user-activity-overview {
display: none !important;
}
.day-tooltip {
white-space: nowrap !important;
position: absolute !important;
z-index: 99999 !important;
padding: 10px !important;
font-size: 12px !important;
color: #959da5 !important;
text-align: center !important;
background: rgba(0, 0, 0, 0.85) !important;
border-radius: 3px !important;
display: none !important;
pointer-events: none !important;
}
.day-tooltip strong {
color: #dfe2e5 !important;
}
.day-tooltip.is-visible {
display: block !important;
}
.day-tooltip:after {
position: absolute !important;
bottom: -10px !important;
left: 50% !important;
width: 5px !important;
height: 5px !important;
box-sizing: border-box !important;
margin: 0 0 0 -5px !important;
content: ' ' !important;
border: 5px solid transparent !important;
border-top-color: rgba(0, 0, 0, 0.85);
}
text.ContributionCalendar-label {
fill: #ccc !important;
font-size: 11px !important;
}
@media screen and (max-width: 768px) {
.table-column {
display: block !important;
width: 100% !important;
}
}
}
}

View File

@@ -2,4 +2,6 @@
import { GitHubCalendar } from '../lib/index.js';
</script>
<GitHubCalendar username="Paillat-dev" class="w-full h-auto" />
<main>
<GitHubCalendar username="Paillat-dev" class="w-full h-auto" />
</main>