Skip to content

chore: add github sponsors on supporters#8531

Open
bjohansebas wants to merge 8 commits intomainfrom
github_sponsors
Open

chore: add github sponsors on supporters#8531
bjohansebas wants to merge 8 commits intomainfrom
github_sponsors

Conversation

@bjohansebas
Copy link
Member

@bjohansebas bjohansebas commented Jan 9, 2026

Description

Note that there’s no REST API for GitHub Sponsors, only a GraphQL API. I’m still working on this.

Preview:
imagen

Validation

Related Issues

closes #8199

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Feb 8, 2026 4:41am

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

@codecov

This comment was marked as off-topic.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

📦 Build Size Comparison

Summary

Metric Value
Old Total Size 3.75 MB
New Total Size 3.75 MB
Delta 0 B (0.00%)

Changes

➕ Added Assets (1)
Name Size
.next/static/chunks/bbe6030054b22438.js 207.00 KB
➖ Removed Assets (1)
Name Size
.next/static/chunks/2ad848510aee1f66.js 207.00 KB

Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
@bjohansebas
Copy link
Member Author

@nodejs/web-infra I think the new environment variable should also be set in Vercel, since that’s where the website is built, both for production and for previews

imagen

@bjohansebas bjohansebas marked this pull request as ready for review February 8, 2026 04:22
@bjohansebas bjohansebas requested a review from a team as a code owner February 8, 2026 04:22
Copilot AI review requested due to automatic review settings February 8, 2026 04:22
Comment on lines +92 to +102
const mapped = nodes.map(n => {
const s = n.sponsor || n.sponsorEntity || n.sponsorEntity; // support different field names
return {
name: s?.name || s?.login || null,
image: s?.avatarUrl || null,
url: s?.url || null,
source: 'github',
};
});

sponsors.push(...mapped);

This comment was marked as outdated.

Comment on lines 89 to 91
const nodeRes = data.data.organization?.sponsorsActivities;

const { nodes } = nodeRes;

This comment was marked as outdated.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds GitHub Sponsors as an additional data source for the “Supporters” section, alongside OpenCollective, by updating the data generator and wiring the UI/docs to the new combined dataset.

Changes:

  • Add GitHub Sponsors supporter type and update the Supporters UI to use a unified url field.
  • Add GitHub GraphQL endpoint constant and implement GitHub Sponsors GraphQL fetching + shuffling in the supporters data generator.
  • Update partners/supporters copy to mention GitHub Sponsors.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
apps/site/types/supporters.ts Introduces a GitHub sponsors supporter type alias.
apps/site/pages/en/about/partners.mdx Updates “Supporters” copy to include GitHub Sponsors.
apps/site/next.constants.mjs Adds GitHub GraphQL API endpoint constant.
apps/site/next-data/generators/supportersData.mjs Expands generator to fetch/merge OpenCollective + GitHub Sponsors and shuffle results.
apps/site/components/Common/Supporters/index.tsx Updates list rendering to use url (and support both sources).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


sponsors.push(...mapped);

return sponsors;
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two GitHub queries (sponsorshipsAsMaintainer and sponsorsActivities) will likely return overlapping sponsors, but the code concatenates both result sets without de-duplication. Consider de-duping by a stable key (e.g., sponsor databaseId/login/url) before shuffling to avoid repeated avatars.

Suggested change
return sponsors;
// De-duplicate sponsors from both queries using a stable key
const seen = new Set();
const uniqueSponsors = [];
for (const sponsor of sponsors) {
const key = sponsor.url || `${sponsor.name || ''}::${sponsor.image || ''}`;
if (seen.has(key)) {
continue;
}
seen.add(key);
uniqueSponsors.push(sponsor);
}
return uniqueSponsors;

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, even though it’s a good idea to try to deduplicate it, I don’t think this is the right approach. I’ll have to look into the logic of https://github.com/antfu-collective/sponsorkit33

};

export type OpenCollectiveSupporter = Supporter<'opencollective'>;
export type GithubSponsorSupporter = Supporter<'github'>;
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type name uses Github... capitalization. Elsewhere the codebase predominantly uses GitHub (e.g., GitHubApiFile, GitHubIcon). Consider renaming this to GitHubSponsorSupporter for consistency (and update JSDoc imports/usages accordingly).

Suggested change
export type GithubSponsorSupporter = Supporter<'github'>;
export type GitHubSponsorSupporter = Supporter<'github'>;

Copilot uses AI. Check for mistakes.

Supporters are individuals and organizations that provide financial support through
[OpenCollective](https://opencollective.com/nodejs) of the Node.js project.
[OpenCollective](https://opencollective.com/nodejs) and [GitHub Sponsors](https://github.com/sponsors/nodejs) of the Node.js project.
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence reads a bit ungrammatically as written (“through … and … of the Node.js project”). Consider rephrasing to “through … and … for the Node.js project” (or similar) to make the relationship clear.

Copilot uses AI. Check for mistakes.
Comment on lines +179 to +187
const graphql = async (query, variables = {}) => {
const res = await fetch(GITHUB_GRAPHQL_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${GITHUB_API_KEY}`,
},
body: JSON.stringify({ query, variables }),
});
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency/reliability, consider using fetchWithRetry for the GitHub GraphQL POST as well (this file already uses it for OpenCollective). That would reduce transient build/runtime failures due to network timeouts when generating supporters data.

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +131
sponsorshipsAsMaintainer (first: 100, includePrivate: false, after: "${cursor}", activeOnly: false) {
nodes {
sponsor: sponsorEntity {
...on User {
id: databaseId,
name,
login,
avatarUrl,
url,
websiteUrl
}
...on Organization {
id: databaseId,
name,
login,
avatarUrl,
url,
websiteUrl
}
},
}
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GraphQL query strings contain trailing commas after fields (e.g., id: databaseId,, name,, and a comma after the sponsorEntity { ... } block). GitHub’s GraphQL API does not accept comma-separated field selections, so this query will fail to parse. Remove the commas (and any trailing commas) from the query documents.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Comment on lines +113 to +114
organization(login: "nodejs") {
sponsorshipsAsMaintainer (first: 100, includePrivate: false, after: "${cursor}", activeOnly: false) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely, I’d prefer that we only show sponsors that are active, but why do we want to show everyone? see #8268.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt @nodejs/nodejs-website @nodejs/marketing ?

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement GitHub Sponsors data fetching

4 participants