Skip to content

Commit fb8f96f

Browse files
feat(contributors): add contributor graphs
1 parent 6c2eb3f commit fb8f96f

8 files changed

Lines changed: 132 additions & 28 deletions

File tree

.github/workflows/scheduler.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
workflow_dispatch:
1818

1919
jobs:
20-
update-sponsors:
20+
update:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
@@ -34,23 +34,36 @@ jobs:
3434
with:
3535
node-version: lts/*
3636

37-
- run: npm install
37+
- name: Install dependencies
38+
run: npm install
3839

39-
- name: Update sponsors
40-
run: npm run build
41-
env:
42-
CONTRIBKIT_GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
43-
CONTRIBKIT_GITHUB_LOGIN: ${{ github.repository_owner }}
44-
CONTRIBKIT_GITHUB_TYPE: organization
45-
CONTRIBKIT_PATREON_TOKEN: ${{ secrets.PATREON_CREATOR_TOKEN }}
40+
- name: Setup env
41+
run: |
42+
# sponsors
43+
echo "CONTRIBKIT_GITHUB_TOKEN=${{ secrets.GH_BOT_TOKEN }}" >> ./configs/sponsors/.env
44+
echo "CONTRIBKIT_GITHUB_LOGIN=${{ github.repository_owner }}" >> ./configs/sponsors/.env
45+
echo "CONTRIBKIT_PATREON_TOKEN=${{ secrets.PATREON_CREATOR_TOKEN }}" >> ./configs/sponsors/.env
46+
47+
# crowdin contributors
48+
echo "CONTRIBKIT_CROWDIN_TOKEN=${{ secrets.CROWDIN_TOKEN }}" >> ./configs/crowdin/.env
49+
50+
# github contributors
51+
echo "CONTRIBKIT_GITHUB_CONTRIBUTORS_TOKEN=${{ secrets.GH_BOT_TOKEN }}" >> ./configs/github/.env
52+
echo "CONTRIBKIT_GITHUB_CONTRIBUTORS_LOGIN=${{ github.repository_owner }}" >> ./configs/github/.env
4653
4754
- name: Setup dist
4855
run: |
4956
# empty dist directory
50-
rm -rf dist/sponsors.*
57+
rm -rf dist/*
58+
59+
# setup .gitignore
60+
echo ".cache.json" >> dist/.gitignore
5161
52-
# move new files
53-
mv -f sponsors.* dist/
62+
- name: Update
63+
run: npm run build
64+
env:
65+
CONTRIBKIT_CROWDIN_PROJECT_ID: 606145
66+
CONTRIBKIT_GITHUB_TYPE: organization
5467

5568
- name: Upload artifacts
5669
if: github.event_name == 'pull_request'

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Ignore JetBrains IDE files
22
.idea/
33

4-
.cache.json
54
.env
6-
node_modules
5+
node_modules/
76
package-lock.json
8-
sponsorkit
97

10-
sponsors.*
8+
dist/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# SponsorKit for LizardByte
1+
# ContribKit for LizardByte
22

33
## About
44

55
This repository was generated from [sponsorkit-starter](https://github.com/Open-reSource/sponsorkit-starter)
6-
and uses [SponsorKit](https://github.com/antfu/sponsorkit/) toolkit for automatically generating sponsors images from
7-
GitHub Sponsors.
6+
and uses [ContribKit](https://github.com/LizardByte/contribkit/) toolkit for automatically generating contributor
7+
images from sponsors, and contributors.
88

99
## Sponsors
1010

1111
<p align="center">
1212
<a href="https://app.lizardbyte.dev" aria-label="Sponsor LizardByte">
13-
<img src='https://raw.githubusercontent.com/LizardByte/sponsors/refs/heads/dist/sponsors.svg'/>
13+
<img src='https://raw.githubusercontent.com/LizardByte/sponsors/refs/heads/dist/sponsors/sponsors.svg'/>
1414
</a>
1515
</p>

build.sh

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
1-
npx contribkit --dir=. -w=800
2-
npx contribkit --dir=. -w=1800 --name=sponsors.wide
3-
npx contribkit --dir=. -w=800 --name=sponsors.part1 --filter=">=9.9"
4-
npx contribkit --dir=. -w=800 --name=sponsors.part2 --filter="<9.9"
1+
repos=(
2+
"build-deps"
3+
"contribkit"
4+
"Sunshine"
5+
)
6+
7+
output_dir="$(pwd)/dist"
8+
9+
echo "Building sponsors..."
10+
pushd configs/sponsors || exit 1
11+
out_dir="${output_dir}/sponsors"
12+
npx contribkit --outputDir="${out_dir}" -w=800 --name=sponsors --force
13+
npx contribkit --outputDir="${out_dir}" -w=1800 --name=sponsors.wide
14+
npx contribkit --outputDir="${out_dir}" -w=800 --name=sponsors.part1 --filter=">=9.9"
15+
npx contribkit --outputDir="${out_dir}" -w=800 --name=sponsors.part2 --filter="<9.9"
16+
popd || exit 1
17+
18+
echo "Building GitHub contributors..."
19+
pushd configs/github || exit 1
20+
21+
for repo in "${repos[@]}"; do
22+
echo "Building GitHub contributors for ${repo}..."
23+
export CONTRIBKIT_GITHUB_CONTRIBUTORS_REPO="${repo}"
24+
out_dir="${output_dir}/github"
25+
26+
npx contribkit --outputDir="${out_dir}" -w=800 --name="${repo}" --force
27+
done
28+
29+
popd || exit 1
30+
31+
echo "Building CrowdIn contributors..."
32+
pushd configs/crowdin || exit 1
33+
out_dir="${output_dir}/crowdin"
34+
npx contribkit --outputDir="${out_dir}" -w=800 --name=crowdin --force
35+
popd || exit 1
36+
37+
echo "Done!"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { defineConfig, tierPresets } from '@lizardbyte/contribkit'
2+
3+
export default defineConfig({
4+
tiers: [
5+
{
6+
title: 'Beginners',
7+
preset: tierPresets.base,
8+
},
9+
{
10+
title: 'Intermediate',
11+
monthlyDollars: 100,
12+
preset: tierPresets.medium,
13+
},
14+
{
15+
title: 'Advanced',
16+
monthlyDollars: 500,
17+
preset: tierPresets.large,
18+
},
19+
{
20+
title: 'Experts',
21+
monthlyDollars: 1000,
22+
preset: tierPresets.xl,
23+
},
24+
{
25+
title: 'Masters',
26+
monthlyDollars: 3000,
27+
preset: tierPresets.xl,
28+
},
29+
],
30+
})
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { defineConfig, tierPresets } from '@lizardbyte/contribkit'
2+
3+
export default defineConfig({
4+
tiers: [
5+
{
6+
title: 'Noobs',
7+
preset: tierPresets.base,
8+
},
9+
{
10+
title: 'Hackers',
11+
monthlyDollars: 10,
12+
preset: tierPresets.medium,
13+
},
14+
{
15+
title: 'Wizards',
16+
monthlyDollars: 50,
17+
preset: tierPresets.large,
18+
},
19+
{
20+
title: 'Elites',
21+
monthlyDollars: 100,
22+
preset: tierPresets.xl,
23+
},
24+
{
25+
title: 'Legends',
26+
monthlyDollars: 300,
27+
preset: tierPresets.xl,
28+
},
29+
],
30+
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function createWrappedSponsorSvg(
7777
const scaledHeight = svgHeight * scale;
7878

7979
return `
80-
<a xlink:href="${sponsor.url}" class="sponsorkit-link" target="_blank" id="${sponsor.name.replace(/\s+/g, '')}">
80+
<a xlink:href="${sponsor.url}" class="contribkit-link" target="_blank" id="${sponsor.name.replace(/\s+/g, '')}">
8181
<svg x="${x}" y="${y}" width="${scaledWidth}" height="${scaledHeight}" viewBox="0 0 ${svgWidth} ${svgHeight}">
8282
${svgContent}
8383
</svg>
@@ -164,7 +164,7 @@ export default defineConfig({
164164

165165
if (config.filter?.({ monthlyDollars: Infinity } as any, []) !== false) {
166166
compose.addSpan(20);
167-
compose.addText('Special Supporters', 'sponsorkit-tier-title');
167+
compose.addText('Special Supporters', 'contribkit-tier-title');
168168
compose.addSpan(30);
169169

170170
const padding = 20; // Padding between supporters

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"type": "module",
33
"scripts": {
4-
"build": "sh build.sh"
4+
"build": "bash build.sh"
55
},
66
"dependencies": {
7-
"@lizardbyte/contribkit": "2025.315.185528"
7+
"@lizardbyte/contribkit": "2025.316.4339"
88
},
99
"devDependencies": {
1010
"@types/node": "^22.13.8"

0 commit comments

Comments
 (0)