Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat(site): make founding sponsorship a badge for all early backers

Andrej91829ab6ef86
diff --git a/apps/site/components/landing/sponsors.tsx b/apps/site/components/landing/sponsors.tsx
index 293795ac6..9c1e92af6 100644
--- a/apps/site/components/landing/sponsors.tsx
+++ b/apps/site/components/landing/sponsors.tsx
@@ -7,16 +7,12 @@ type Sponsor = {
name: string | null;
avatarUrl: string;
tier: number | null;
+ founding: boolean;
};
-const founding = sponsors.founding as Sponsor[];
const current = sponsors.current as Sponsor[];
const past = sponsors.past as Sponsor[];
-const featured = [...founding, ...current];
-const featuredLabel =
- current.length > 0 ? "Founding and current sponsors" : "Founding sponsor";
-
// Higher sponsorship tiers get larger placement, matching the tier rewards on
// GitHub Sponsors.
function avatarSize(tier: number | null) {
@@ -56,40 +52,44 @@ export function Sponsors() {
</p>
</FadeIn>
<FadeIn delay={160}>
- <div className="mt-12">
- <p className="font-medium text-muted-foreground text-sm">
- {featuredLabel}
- </p>
- <div className="mt-5 flex flex-wrap items-center gap-x-10 gap-y-5">
- {featured.map((sponsor) => (
- <a
- key={sponsor.login}
- className="flex items-center gap-3"
- href={`https://github.com/${sponsor.login}`}
- target="_blank"
- rel="noreferrer"
- >
- <img
- alt=""
- className={cn(
- "rounded-full border border-border/70",
- avatarSize(sponsor.tier),
- )}
- src={sponsor.avatarUrl}
- loading="lazy"
- />
- <span>
- <span className="block font-medium text-base">
- {sponsor.name ?? sponsor.login}
- </span>
- <span className="block text-muted-foreground text-sm">
- @{sponsor.login}
+ {current.length > 0 && (
+ <div className="mt-12">
+ <p className="font-medium text-muted-foreground text-sm">
+ Current sponsors
+ </p>
+ <div className="mt-5 flex flex-wrap items-center gap-x-10 gap-y-5">
+ {current.map((sponsor) => (
+ <a
+ key={sponsor.login}
+ className="flex items-center gap-3"
+ href={`https://github.com/${sponsor.login}`}
+ target="_blank"
+ rel="noreferrer"
+ >
+ <img
+ alt=""
+ className={cn(
+ "rounded-full border border-border/70",
+ avatarSize(sponsor.tier),
+ )}
+ src={sponsor.avatarUrl}
+ loading="lazy"
+ />
+ <span>
+ <span className="block font-medium text-base">
+ {sponsor.name ?? sponsor.login}
+ </span>
+ <span className="block text-muted-foreground text-sm">
+ {sponsor.founding
+ ? "Founding sponsor"
+ : `@${sponsor.login}`}
+ </span>
</span>
- </span>
- </a>
- ))}
+ </a>
+ ))}
+ </div>
</div>
- </div>
+ )}
{past.length > 0 && (
<div className="mt-10">
<p className="font-medium text-muted-foreground text-sm">
@@ -103,7 +103,9 @@ export function Sponsors() {
href={`https://github.com/${sponsor.login}`}
target="_blank"
rel="noreferrer"
- title={sponsor.name ?? `@${sponsor.login}`}
+ title={`${sponsor.name ?? `@${sponsor.login}`}${
+ sponsor.founding ? " · Founding sponsor" : ""
+ }`}
>
<img
alt={sponsor.name ?? sponsor.login}
diff --git a/apps/site/constants/sponsors.json b/apps/site/constants/sponsors.json
index aff1b902b..4054db4e9 100644
--- a/apps/site/constants/sponsors.json
+++ b/apps/site/constants/sponsors.json
@@ -1,49 +1,55 @@
{
- "founding": [
+ "current": [
{
"login": "danielsada",
"name": "Daniel Sada",
"avatarUrl": "https://avatars.githubusercontent.com/u/2849006?v=4",
- "tier": 5
+ "tier": 5,
+ "founding": true
}
],
- "current": [],
"past": [
{
"login": "achouvardas",
"name": "Angelos Chouvardas",
"avatarUrl": "https://avatars.githubusercontent.com/u/77693989?v=4",
- "tier": 10
+ "tier": 10,
+ "founding": true
},
{
"login": "alexgutjahr",
"name": "Alex Gutjahr",
"avatarUrl": "https://avatars.githubusercontent.com/u/58935?v=4",
- "tier": 10
+ "tier": 10,
+ "founding": true
},
{
"login": "KnudH",
"name": "Knud Hollander",
"avatarUrl": "https://avatars.githubusercontent.com/u/26556793?v=4",
- "tier": 10
+ "tier": 10,
+ "founding": true
},
{
"login": "MakoPhil",
"name": null,
"avatarUrl": "https://avatars.githubusercontent.com/u/36614366?v=4",
- "tier": 20
+ "tier": 20,
+ "founding": true
},
{
"login": "ndinevski",
"name": "Nikola Dinevski",
"avatarUrl": "https://avatars.githubusercontent.com/u/61565298?v=4",
- "tier": 5
+ "tier": 5,
+ "founding": true
},
{
"login": "TehMaat",
"name": null,
"avatarUrl": "https://avatars.githubusercontent.com/u/60507708?v=4",
- "tier": 10
+ "tier": 10,
+ "founding": true
}
]
}
diff --git a/apps/site/scripts/sync-sponsors.mjs b/apps/site/scripts/sync-sponsors.mjs
index dbcffa88a..c66d71097 100644
--- a/apps/site/scripts/sync-sponsors.mjs
+++ b/apps/site/scripts/sync-sponsors.mjs
@@ -2,8 +2,10 @@
// which drives the Sponsors section on the landing page.
//
// Only sponsorships GitHub reports as PUBLIC are written; private sponsors are
-// never included. Founding sponsors are pinned permanently and stay listed even
-// if their sponsorship ends.
+// never included. Sponsors are grouped strictly by activity (current vs past).
+// Founding is a permanent badge for the project's early backers: they keep the
+// badge in either group and stay on the wall even if the API stops returning
+// their sponsorship.
//
// Usage: GITHUB_TOKEN=<token with the read:user scope> node scripts/sync-sponsors.mjs
@@ -13,12 +15,43 @@ import { fileURLToPath } from "node:url";
const MAINTAINER = "andrejsshell";
+// The project's early backers. Pinned so they can never disappear from the
+// wall; the entries double as fallbacks if the API no longer returns them.
const FOUNDING = [
{
login: "danielsada",
name: "Daniel Sada",
avatarUrl: "https://avatars.githubusercontent.com/u/2849006?v=4",
- tier: null,
+ },
+ {
+ login: "achouvardas",
+ name: "Angelos Chouvardas",
+ avatarUrl: "https://avatars.githubusercontent.com/u/77693989?v=4",
+ },
+ {
+ login: "alexgutjahr",
+ name: "Alex Gutjahr",
+ avatarUrl: "https://avatars.githubusercontent.com/u/58935?v=4",
+ },
+ {
+ login: "KnudH",
+ name: "Knud Hollander",
+ avatarUrl: "https://avatars.githubusercontent.com/u/26556793?v=4",
+ },
+ {
+ login: "MakoPhil",
+ name: null,
+ avatarUrl: "https://avatars.githubusercontent.com/u/36614366?v=4",
+ },
+ {
+ login: "ndinevski",
+ name: "Nikola Dinevski",
+ avatarUrl: "https://avatars.githubusercontent.com/u/61565298?v=4",
+ },
+ {
+ login: "TehMaat",
+ name: null,
+ avatarUrl: "https://avatars.githubusercontent.com/u/60507708?v=4",
},
];
@@ -95,6 +128,8 @@ async function fetchSponsorships() {
return nodes;
}
+const foundingLogins = new Set(FOUNDING.map((sponsor) => sponsor.login));
+
function toEntry(node) {
const { login, name, databaseId } = node.sponsorEntity;
return {
@@ -102,14 +137,13 @@ function toEntry(node) {
name: name ?? null,
avatarUrl: `https://avatars.githubusercontent.com/u/${databaseId}?v=4`,
tier: node.tier?.monthlyPriceInDollars ?? null,
+ founding: foundingLogins.has(login),
};
}
const byLogin = (a, b) =>
a.login.localeCompare(b.login, "en", { sensitivity: "base" });
-const foundingLogins = new Set(FOUNDING.map((sponsor) => sponsor.login));
-const fromApi = new Map();
const current = [];
const past = [];
@@ -120,20 +154,22 @@ for (const node of await fetchSponsorships()) {
continue;
}
const entry = toEntry(node);
- if (foundingLogins.has(entry.login)) {
- fromApi.set(entry.login, entry);
- } else if (node.isActive) {
+ if (node.isActive) {
current.push(entry);
} else {
past.push(entry);
}
}
-// Founding sponsors are permanent: fall back to the pinned entry if the API
-// no longer returns their sponsorship.
-const founding = FOUNDING.map(
- (sponsor) => fromApi.get(sponsor.login) ?? sponsor,
-);
+// Founding sponsors are permanent: if the API no longer returns one of them,
+// keep them on the wall via the pinned fallback entry.
+const seen = new Set([...current, ...past].map((entry) => entry.login));
+for (const sponsor of FOUNDING) {
+ if (!seen.has(sponsor.login)) {
+ past.push({ ...sponsor, tier: null, founding: true });
+ }
+}
+
// Higher tiers come first so placement on the site follows tier promises.
current.sort((a, b) => (b.tier ?? 0) - (a.tier ?? 0) || byLogin(a, b));
past.sort(byLogin);
@@ -144,9 +180,9 @@ const outputPath = join(
"constants",
"sponsors.json",
);
-const data = { founding, current, past };
+const data = { current, past };
// Tab indentation matches how Biome formats JSON in this repo.
await writeFile(outputPath, `${JSON.stringify(data, null, "\t")}\n`);
console.log(
- `Wrote ${founding.length} founding, ${current.length} current, and ${past.length} past sponsors to constants/sponsors.json`,
+ `Wrote ${current.length} current and ${past.length} past sponsors to constants/sponsors.json`,
);