Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
422 changes: 184 additions & 238 deletions app/[locale]/contributors/page.tsx

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions components/ContributorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,19 @@ export function ContributorBadge({
img,
profileUrl,
name,
role,
sponsorLink,
}: {
img: string;
profileUrl: string;
name: string;
role?: string;
sponsorLink?: string;
}) {
return (
<a
href={profileUrl}
target="_blank"
rel="noopener noreferrer"
className="group flex items-center gap-3 rounded-full border border-aurora-darkblue bg-zinc-900/80 p-2 px-4 transition-all duration-300 hover:scale-105 hover:border-aurora-blue hover:bg-zinc-800"
className="group flex items-center gap-3 rounded-full border border-aurora-darkblue bg-zinc-900/80 p-1.5 pr-5 transition-all duration-300 hover:scale-105 hover:border-aurora-blue hover:bg-zinc-800"
>
<img
width={48}
Expand Down
7 changes: 7 additions & 0 deletions data/contributors.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"repositories": [
"ublue-os/aurora",
"get-aurora-dev/aurora-web",
"get-aurora-dev/common",
"get-aurora-dev/branding",
"get-aurora-dev/iso"
],
"contributors": [
{
"github": "inffy",
Expand Down
9 changes: 7 additions & 2 deletions messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"designers": "Designer",
"translators": "Übersetzer",
"all-contributors": "Alle Repository-Mitwirkenden",
"all-contributors-subtitle": "Alle, die Code zum Aurora-Repository beigetragen haben.",
"all-contributors-subtitle": "Alle, die Code zu den Aurora-Repositories beigetragen haben.",
"loading": "Mitwirkende werden geladen...",
"join-title": "Möchtest du beitragen?",
"join-subtitle": "Wir freuen uns über Beiträge aller Art - Code, Dokumentation, Übersetzungen und mehr!",
Expand All @@ -285,7 +285,12 @@
"contributor": "Mitwirkender",
"designer": "Designer",
"translator": "Übersetzer"
}
},
"all-repos": "Alle Repositories",
"stats-contributors": "Mitwirkende",
"stats-repos": "Repositories",
"stats-contributions": "Beiträge",
"no-other-contributors": "Alle Mitwirkenden dieses Repositories sind bereits oben aufgeführt."
},
"Art-Page": {
"title": "Aurora Kunstgalerie",
Expand Down
9 changes: 7 additions & 2 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"designers": "Designers",
"translators": "Translators",
"all-contributors": "All Repository Contributors",
"all-contributors-subtitle": "Everyone who has contributed code to the Aurora repository.",
"all-contributors-subtitle": "Everyone who has contributed code across the Aurora repositories.",
"loading": "Loading contributors...",
"join-title": "Want to Contribute?",
"join-subtitle": "We welcome contributions of all kinds - code, documentation, translations, and more!",
Expand All @@ -285,7 +285,12 @@
"contributor": "Contributor",
"designer": "Designer",
"translator": "Translator"
}
},
"all-repos": "All repositories",
"stats-contributors": "Contributors",
"stats-repos": "Repositories",
"stats-contributions": "Contributions",
"no-other-contributors": "All contributors to this repository are already featured above."
},
"Art-Page": {
"title": "Aurora Art Gallery",
Expand Down
9 changes: 7 additions & 2 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"designers": "Diseñadores",
"translators": "Traductores",
"all-contributors": "Todos los contribuidores del Repositorio",
"all-contributors-subtitle": "Todos los que han contribuido código al repositorio de Aurora.",
"all-contributors-subtitle": "Todos los que han contribuido código a los repositorios de Aurora.",
"loading": "Cargando contribuidores...",
"join-title": "¿Quieres contribuir?",
"join-subtitle": "Aceptamos contribuciones de todo tipo - código, documentación, traducción, ¡y más!",
Expand All @@ -283,7 +283,12 @@
"contributor": "Contribuidor",
"designer": "Diseñador",
"translator": "Traductor"
}
},
"all-repos": "Todos los repositorios",
"stats-contributors": "Contribuidores",
"stats-repos": "Repositorios",
"stats-contributions": "Contribuciones",
"no-other-contributors": "Todos los contribuidores de este repositorio ya aparecen destacados arriba."
},
"Art-Page": {
"title": "Galería de Arte de Aurora",
Expand Down
9 changes: 7 additions & 2 deletions messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"designers": "Designers",
"translators": "Traducteurs",
"all-contributors": "Tous les contributeurs du dépôt",
"all-contributors-subtitle": "Tous ceux qui ont contribué du code au dépôt Aurora.",
"all-contributors-subtitle": "Tous ceux qui ont contribué du code aux dépôts d'Aurora.",
"loading": "Chargement des contributeurs...",
"join-title": "Vous voulez contribuer ?",
"join-subtitle": "Les contributions de toutes sortes sont les bienvenues : code, documentation, traductions, et plus !",
Expand All @@ -284,7 +284,12 @@
"contributor": "Contributeur",
"designer": "Designer",
"translator": "Traducteur"
}
},
"all-repos": "Tous les dépôts",
"stats-contributors": "Contributeurs",
"stats-repos": "Dépôts",
"stats-contributions": "Contributions",
"no-other-contributors": "Tous les contributeurs de ce dépôt sont déjà présentés ci-dessus."
},
"Art-Page": {
"title": "Galerie d'art Aurora",
Expand Down
9 changes: 7 additions & 2 deletions messages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"designers": "Projektanci",
"translators": "Tłumacze",
"all-contributors": "Wszyscy współtwórcy repozytorium",
"all-contributors-subtitle": "Każdy, kto dołożył cegiełkę kodu do Aurory.",
"all-contributors-subtitle": "Każdy, kto dołożył cegiełkę kodu do repozytoriów Aurory.",
"loading": "Ładowanie listy...",
"join-title": "Chcesz pomóc?",
"join-subtitle": "Czekamy na każdą pomoc – kod, dokumentację, tłumaczenia i nie tylko!",
Expand All @@ -283,7 +283,12 @@
"contributor": "Współtwórca",
"designer": "Designer",
"translator": "Tłumacz"
}
},
"all-repos": "Wszystkie repozytoria",
"stats-contributors": "Współtwórcy",
"stats-repos": "Repozytoria",
"stats-contributions": "Kontrybucje",
"no-other-contributors": "Wszyscy współtwórcy tego repozytorium są już wyróżnieni powyżej."
},
"Art-Page": {
"title": "Galeria sztuki Aurory",
Expand Down
9 changes: 7 additions & 2 deletions messages/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"designers": "Designers",
"translators": "Tradutores",
"all-contributors": "Todos os Contribuidores do Repositório",
"all-contributors-subtitle": "Todos os que contribuíram com código para o repositório Aurora.",
"all-contributors-subtitle": "Todos os que contribuíram com código para os repositórios Aurora.",
"loading": "A carregar contribuidores...",
"join-title": "Queres Contribuir?",
"join-subtitle": "Agradecemos contribuições de todos os tipos - código, documentação, traduções e muito mais!",
Expand All @@ -285,7 +285,12 @@
"contributor": "Contribuidor",
"designer": "Designer",
"translator": "Tradutor"
}
},
"all-repos": "Todos os repositórios",
"stats-contributors": "Contribuidores",
"stats-repos": "Repositórios",
"stats-contributions": "Contribuições",
"no-other-contributors": "Todos os contribuidores deste repositório já estão em destaque acima."
},
"Art-Page": {
"title": "Galeria de Arte Aurora",
Expand Down
9 changes: 7 additions & 2 deletions messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"designers": "Designers",
"translators": "Translators",
"all-contributors": "Все вкладчики репозиторий",
"all-contributors-subtitle": "Все участники, кто внёс свой код в репозиторий Aurora.",
"all-contributors-subtitle": "Все участники, кто внёс свой код в репозитории Aurora.",
"loading": "Загрузка вкладчиков...",
"join-title": "Хотите внести вклад?",
"join-subtitle": "Мы приветствуем любые вклады — код, документация, перевод и многое другое!",
Expand All @@ -285,7 +285,12 @@
"contributor": "Contributor",
"designer": "Designer",
"translator": "Translator"
}
},
"all-repos": "Все репозитории",
"stats-contributors": "Участники",
"stats-repos": "Репозитории",
"stats-contributions": "Вклады",
"no-other-contributors": "Все участники этого репозитория уже представлены выше."
},
"Art-Page": {
"title": "Арт-галерея Aurora",
Expand Down
42 changes: 35 additions & 7 deletions scripts/cache-contributors.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function fetchGitHubUser(username) {
}
}

async function fetchRepoContributors() {
async function fetchRepoContributors(repo) {
try {
// Fetch all pages of contributors
const allContributors = [];
Expand All @@ -80,7 +80,7 @@ async function fetchRepoContributors() {

while (true) {
const data = await fetchWithRetry(
`https://api.github.com/repos/ublue-os/aurora/contributors?per_page=${perPage}&page=${page}`
`https://api.github.com/repos/${repo}/contributors?per_page=${perPage}&page=${page}`
);
if (!data || data.length === 0) break;
allContributors.push(...data);
Expand All @@ -96,11 +96,36 @@ async function fetchRepoContributors() {
contributions: c.contributions,
}));
} catch (error) {
console.warn("Failed to fetch repo contributors:", error.message);
console.warn(`Failed to fetch contributors for ${repo}:`, error.message);
return [];
}
}

async function fetchAllRepoContributors(repositories) {
const byLogin = new Map();
const repos = [];

for (const repo of repositories) {
const list = await fetchRepoContributors(repo);
console.log(` ${repo}: ${list.length} contributors`);
repos.push({ name: repo, contributorCount: list.length });
for (const c of list) {
const existing = byLogin.get(c.login);
if (existing) {
existing.contributions += c.contributions;
existing.repos.push(repo);
} else {
byLogin.set(c.login, { ...c, repos: [repo] });
}
}
}

const merged = [...byLogin.values()].sort(
(a, b) => b.contributions - a.contributions
);
return { repos, repoContributors: merged };
}

async function loadExistingCache() {
try {
const data = await fs.readFile(CACHE_FILE, "utf-8");
Expand Down Expand Up @@ -172,10 +197,11 @@ async function main() {
}
}

// Fetch repo contributors
console.log("Fetching repository contributors...");
let repoContributors = await fetchRepoContributors();
console.log(` Found ${repoContributors.length} repo contributors`);
// Fetch contributors across all configured repositories
const repositories = contributorsData.repositories || ["ublue-os/aurora"];
console.log(`Fetching contributors for ${repositories.length} repositories...`);
let { repos, repoContributors } = await fetchAllRepoContributors(repositories);
console.log(` Found ${repoContributors.length} unique repo contributors`);

// Use existing cache as fallback for missing data
if (existingCache) {
Expand All @@ -191,13 +217,15 @@ async function main() {
if (repoContributors.length === 0 && existingCache.repoContributors?.length > 0) {
console.log(" Using cached repo contributors (API unavailable)");
repoContributors = existingCache.repoContributors;
repos = existingCache.repos || [];
}
}

// Build cache object
const cache = {
generatedAt: new Date().toISOString(),
githubUsers,
repos,
repoContributors,
};

Expand Down