diff --git a/landing/app/page.tsx b/landing/app/page.tsx
index 931fc1c584..b9074708ff 100644
--- a/landing/app/page.tsx
+++ b/landing/app/page.tsx
@@ -71,6 +71,7 @@ export default async function HomePage() {
stats={{
npmDownloads: communityStats.npmDownloads,
githubStars: communityStats.githubStars,
+ contributors: communityStats.contributors,
}}
/>
diff --git a/landing/components/landing/hero-readme.tsx b/landing/components/landing/hero-readme.tsx
index cdabad796e..56cb0d3551 100644
--- a/landing/components/landing/hero-readme.tsx
+++ b/landing/components/landing/hero-readme.tsx
@@ -1216,10 +1216,18 @@ function SentinelSection() {
const EMPTY_CONTRIBUTORS: ContributorInfo[] = [];
+type CommunityHeroStats = {
+ npmDownloads: number;
+ githubStars: number;
+ contributors: number;
+};
+
function ContributorsSection({
contributors = EMPTY_CONTRIBUTORS,
+ contributorCount,
}: {
contributors: ContributorInfo[];
+ contributorCount: number;
}) {
if (contributors.length === 0) return null;
@@ -1245,7 +1253,7 @@ function ContributorsSection({
Built by a community of{" "}
- 746+
+ {contributorCount}+
{" "}
contributors.
@@ -1335,11 +1343,7 @@ const footerLinks = [
{ label: "Changelog", href: "/changelog" },
];
-function ReadmeFooter({
- stats,
-}: {
- stats: { npmDownloads: number; githubStars: number };
-}) {
+function ReadmeFooter({ stats }: { stats: CommunityHeroStats }) {
return (
{/* Watermark logo */}
@@ -1516,7 +1520,7 @@ export function HeroReadMe({
stats,
}: {
contributors: ContributorInfo[];
- stats: { npmDownloads: number; githubStars: number };
+ stats: CommunityHeroStats;
}) {
const [socialHovered, setSocialHovered] = useState(false);
@@ -2522,7 +2526,10 @@ export function HeroReadMe({
-
+
diff --git a/landing/lib/community-stats.ts b/landing/lib/community-stats.ts
index 87005f05ad..0be45cba58 100644
--- a/landing/lib/community-stats.ts
+++ b/landing/lib/community-stats.ts
@@ -18,6 +18,8 @@ export function getContributors(): ContributorInfo[] {
return staticContributors as ContributorInfo[];
}
+const staticContributorsCount = staticContributors.length;
+
// Fetch NPM download stats for the last year
async function fetchNpmDownloads(): Promise {
try {
@@ -75,7 +77,7 @@ async function fetchGitHubStats(): Promise<{
console.error("Failed to fetch GitHub repo stats:", repoResponse.status);
}
- let contributorsCount = 100;
+ let contributorsCount = staticContributorsCount;
if (contributorsResponse.ok) {
const linkHeader = contributorsResponse.headers.get("Link");
if (linkHeader) {
@@ -94,7 +96,7 @@ async function fetchGitHubStats(): Promise<{
return { stars, contributors: contributorsCount };
} catch (error) {
console.error("Error fetching GitHub stats:", error);
- return { stars: 26000, contributors: 100 };
+ return { stars: 26000, contributors: staticContributorsCount };
}
}