-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsponsorkit.config.ts
96 lines (90 loc) · 2.04 KB
/
sponsorkit.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import { defineConfig, tierPresets, fetchSponsors, Sponsorship } from 'sponsorkit'
export default defineConfig({
formats: ['svg', 'png', 'json'],
includePastSponsors: true,
afdian: {
exechangeRate: 6.8,
},
github: {
login: 'LittleSound',
token: process.env.SPONSORKIT_GITHUB_TOKEN_LITTLESOUND,
},
async onSponsorsAllFetched(sponsors) {
const res = await fetchSponsors({
github: {
login: 'nekomeowww',
token: process.env.SPONSORKIT_GITHUB_TOKEN_NEKOMEOWWW,
},
})
sponsors.push(...res)
const sponsorMap = new Map<string, Sponsorship>()
for (const sponsor of sponsors) {
const key = sponsor.sponsor.login || Math.random().toString()
const theSame = sponsorMap.get(key)
if (theSame) {
theSame.monthlyDollars += sponsor.monthlyDollars
} else {
sponsorMap.set(key, sponsor)
}
}
return Array.from(sponsorMap.values())
},
tiers: [
{
title: 'Past Sponsors',
monthlyDollars: -1,
preset: tierPresets.xs,
},
{
title: '❤️ Backers',
preset: tierPresets.base,
},
{
title: '💖 Sponsors',
monthlyDollars: 8,
preset: tierPresets.medium,
composeAfter: (composer, tierSponsors, config) => {
composer.addSpan(10)
},
},
{
title: '💓 Bronze Sponsors',
monthlyDollars: 32,
preset: tierPresets.large,
},
{
title: '💗 Silver Sponsors',
monthlyDollars: 64,
preset: tierPresets.xl,
},
{
title: '💞 Gold Sponsors',
monthlyDollars: 256,
preset: tierPresets.xl,
},
{
title: '💝 Platinum Sponsors',
monthlyDollars: 512,
preset: tierPresets.xl,
},
{
title: '💘 Diamond Sponsors',
monthlyDollars: 1024,
preset: tierPresets.xl,
},
],
renders: [
{
name: 'sponsors',
renderer: 'tiers',
},
{
name: 'sponsors.wide',
width: 1000,
},
{
name: 'sponsors.circles',
renderer: 'circles',
},
],
})