-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsponsorkit.config.ts
85 lines (82 loc) · 1.74 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
import {
defineConfig,
loadConfig,
presets,
resolveProviders,
guessProviders,
SponsorkitConfig,
Provider,
} from "sponsorkit";
import customSponsors from "./custom-sponsors";
import { consola } from "consola";
const config: SponsorkitConfig = {
github: {
login: "ModyQyW",
type: "user",
},
tiers: [
{
title: "Past Sponsors",
monthlyDollars: -1,
preset: presets.xs,
},
{
title: "Backers",
monthlyDollars: 0,
preset: presets.base,
},
{
title: "Sponsors",
monthlyDollars: 19.69,
preset: presets.medium,
},
{
title: "Silver Sponsors",
monthlyDollars: 39.38,
preset: presets.large,
},
{
title: "Gold Sponsors",
monthlyDollars: 78.77,
preset: presets.xl,
},
{
title: "Special Sponsors",
monthlyDollars: 157.54,
preset: {
avatar: {
size: 105,
},
boxWidth: 145,
boxHeight: 165,
container: {
sidePadding: 20,
},
name: {
maxLength: 30,
},
},
},
],
fallbackAvatar: "https://picsum.photos/256/256",
};
let providers: Provider[];
export default defineConfig({
...config,
onSponsorsFetched: async (sponsors, provider) => {
if (!providers) {
const loadedConfig = await loadConfig();
providers = resolveProviders(
loadedConfig.providers || guessProviders(loadedConfig)
);
}
// last one
if (provider === providers.at(-1)?.name) {
// add more sponsors like wechat, alipay, etc.
consola.info(
`Pushed ${customSponsors.length} custom sponsors into ${provider} provider.`
);
return [...sponsors, ...customSponsors];
}
},
});