From 2cad07914ce6bd3ec25936a16566f847f98834dd Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 15 Nov 2022 21:31:28 -0500 Subject: [PATCH] chore(website): explained and auto-balanced homepage sponsors list --- .github/SPONSORSHIPS.md | 20 +++++++++-- packages/website/data/sponsors.json | 25 ------------- .../FinancialContributors/Sponsors/index.tsx | 21 ++++++----- .../Sponsors/styles.module.css | 36 +++++++++++-------- .../FinancialContributors/index.tsx | 10 ++++-- tools/generate-sponsors.ts | 36 +++---------------- 6 files changed, 59 insertions(+), 89 deletions(-) diff --git a/.github/SPONSORSHIPS.md b/.github/SPONSORSHIPS.md index 15638be935c5..48d8ae5fc743 100644 --- a/.github/SPONSORSHIPS.md +++ b/.github/SPONSORSHIPS.md @@ -15,6 +15,23 @@ Sponsoring TypeScript ESLint helps keep our development process running reliably - Fix bugs and add new features to existing rules - Write more advanced rules to solve more areas of application correctness +### Sponsorship Benefits + +In addition to benefitting the TypeScript ecosystem, sponsoring us on Open Collective helps promote your company and development brand. +Our top sponsors may have their link, logo, and/or name featured on the homepage of [typescript-eslint.io](https://typescript-eslint.io). + +At present, sponsors must have given at least $100 to be featured on the homepage. +Placement tiers are based on total donations: + +- Platinum sponsors: Top 6 donators +- Gold supporters: The next 10 donators +- Silver supporters: The next 18 donators + +You can always view all financial contributors on [opencollective.com/typescript-eslint](https://opencollective.com/typescript-eslint). + +> Got an idea for how to make sponsorship work for you? +> Let us know at `typescripteslint@gmail.com`! + ## Sponsorship Limitations ### Project Direction @@ -25,7 +42,6 @@ If you have a need to push forward an area of work in TypeScript ESLint more urg ### Website Placement -Our top sponsors may have their link, logo, and/or name featured on the homepage of https://typescript-eslint.io. We are inclusive by default and allow all organizations that newly meet a monetary threshold to be added. However, at our discretion, we may remove organizations we feel we cannot promote in good conscience. Organizations would most commonly be removed if their core charter and/or repeated organization-wide intentional activities: @@ -35,5 +51,3 @@ Organizations would most commonly be removed if their core charter and/or repeat - Finance and/or promote other organizations that match these issues If you disagree with a choice made by the maintenance team, or would like a refund for your sponsorship, please let us know by emailing `typescripteslint@gmail.com`. - -> You can always view all financial contributors on [opencollective.com/typescript-eslint](https://opencollective.com/typescript-eslint). diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index fd44d68e52b9..49d7576bf770 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -3,7 +3,6 @@ "id": "Indeed", "image": "https://images.opencollective.com/indeed/4b8725e/logo.png", "name": "Indeed", - "tier": "sponsor", "totalDonations": 1005000, "website": "https://Indeed.com" }, @@ -11,7 +10,6 @@ "id": "Nx (by Nrwl)", "image": "https://images.opencollective.com/nx/0efbe42/logo.png", "name": "Nx (by Nrwl)", - "tier": "sponsor", "totalDonations": 550000, "website": "https://nx.dev" }, @@ -19,7 +17,6 @@ "id": "ESLint", "image": "https://images.opencollective.com/eslint/96b09dc/logo.png", "name": "ESLint", - "tier": "sponsor", "totalDonations": 215000, "website": "https://eslint.org/" }, @@ -27,7 +24,6 @@ "id": "Airbnb", "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", "name": "Airbnb", - "tier": "sponsor", "totalDonations": 140800, "website": "https://www.airbnb.com/" }, @@ -35,7 +31,6 @@ "id": "Coinbase", "image": "https://images.opencollective.com/coinbase/a202856/logo.png", "name": "Coinbase", - "tier": "sponsor", "totalDonations": 120000, "website": "https://blog.coinbase.com/engineering-and-security/home" }, @@ -43,7 +38,6 @@ "id": "n8n.io - n8n GmbH", "image": "https://images.opencollective.com/n8n/dca2f0c/logo.png", "name": "n8n.io - n8n GmbH", - "tier": "sponsor", "totalDonations": 115000, "website": "https://n8n.io" }, @@ -51,7 +45,6 @@ "id": "Sentry", "image": "https://images.opencollective.com/sentry/9620d33/logo.png", "name": "Sentry", - "tier": "sponsor", "totalDonations": 114800, "website": "https://sentry.io/welcome/" }, @@ -59,7 +52,6 @@ "id": "GitBook", "image": "https://images.opencollective.com/gitbook/d35a8e7/logo.png", "name": "GitBook", - "tier": "sponsor", "totalDonations": 110000, "website": "https://www.gitbook.com" }, @@ -67,7 +59,6 @@ "id": "Codecademy", "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", "name": "Codecademy", - "tier": "sponsor", "totalDonations": 100000, "website": "https://codecademy.com" }, @@ -75,7 +66,6 @@ "id": "EY Doberman", "image": "https://images.opencollective.com/ey-doberman/b269462/logo.png", "name": "EY Doberman", - "tier": "supporter", "totalDonations": 80400, "website": "https://doberman.co" }, @@ -83,7 +73,6 @@ "id": "Future Processing", "image": "https://images.opencollective.com/future-processing/1410d26/logo.png", "name": "Future Processing", - "tier": "supporter", "totalDonations": 54000, "website": "https://www.future-processing.com/" }, @@ -91,7 +80,6 @@ "id": "Sourcegraph", "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", "name": "Sourcegraph", - "tier": "supporter", "totalDonations": 50000, "website": "https://about.sourcegraph.com" }, @@ -99,7 +87,6 @@ "id": "Whitebox", "image": "https://images.opencollective.com/whiteboxinc/ef0d11d/logo.png", "name": "Whitebox", - "tier": "contributor", "totalDonations": 40000, "website": "https://whitebox.com" }, @@ -107,7 +94,6 @@ "id": "Monito", "image": "https://images.opencollective.com/monito/50fc878/logo.png", "name": "Monito", - "tier": "contributor", "totalDonations": 30000, "website": "https://www.monito.com" }, @@ -115,7 +101,6 @@ "id": "Codiga", "image": "https://images.opencollective.com/codiga/1065f9f/logo.png", "name": "Codiga", - "tier": "contributor", "totalDonations": 30000, "website": "https://www.codiga.io" }, @@ -123,7 +108,6 @@ "id": "STORIS", "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", "name": "STORIS", - "tier": "contributor", "totalDonations": 27000, "website": "https://www.storis.com/" }, @@ -131,7 +115,6 @@ "id": "revo.js", "image": "https://images.opencollective.com/revojsro/82623a7/logo.png", "name": "revo.js", - "tier": "contributor", "totalDonations": 23000, "website": "https://revojs.ro" }, @@ -139,7 +122,6 @@ "id": "Ian MacLeod", "image": "https://images.opencollective.com/nevir/35c52ef/avatar.png", "name": "Ian MacLeod", - "tier": "contributor", "totalDonations": 22000, "website": "https://twitter.com/nevir" }, @@ -147,7 +129,6 @@ "id": "David Johnston", "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", "name": "David Johnston", - "tier": "contributor", "totalDonations": 15000, "website": "https://blacksheepcode.com" }, @@ -155,7 +136,6 @@ "id": "Joe Alden", "image": "https://images.opencollective.com/joealden/44a6738/avatar.png", "name": "Joe Alden", - "tier": "contributor", "totalDonations": 14000, "website": "https://joealden.com" }, @@ -163,7 +143,6 @@ "id": "Gianfranco Palumbo", "image": "https://images.opencollective.com/gianpaj/5d62d25/avatar.png", "name": "Gianfranco Palumbo", - "tier": "contributor", "totalDonations": 10000, "website": "http://gian.xyz" }, @@ -171,7 +150,6 @@ "id": "Evil Martians", "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", "name": "Evil Martians", - "tier": "contributor", "totalDonations": 10000, "website": "https://evilmartians.com/" }, @@ -179,7 +157,6 @@ "id": "The Guardian", "image": "https://images.opencollective.com/gdndevelopers/0b72bf0/logo.png", "name": "The Guardian", - "tier": "contributor", "totalDonations": 10000, "website": "https://www.theguardian.com/" }, @@ -187,7 +164,6 @@ "id": "Balsa", "image": "https://images.opencollective.com/balsa/77de498/logo.png", "name": "Balsa", - "tier": "contributor", "totalDonations": 10000, "website": "https://balsa.com" }, @@ -195,7 +171,6 @@ "id": "Laserhub", "image": "https://images.opencollective.com/laserhub/bae6275/logo.png", "name": "Laserhub", - "tier": "contributor", "totalDonations": 10000, "website": "https://laserhub.com/" } diff --git a/packages/website/src/components/FinancialContributors/Sponsors/index.tsx b/packages/website/src/components/FinancialContributors/Sponsors/index.tsx index c175cdc26158..dfcdad8c7b96 100644 --- a/packages/website/src/components/FinancialContributors/Sponsors/index.tsx +++ b/packages/website/src/components/FinancialContributors/Sponsors/index.tsx @@ -1,36 +1,35 @@ -import sponsors from '@site/data/sponsors.json'; import clsx from 'clsx'; import React from 'react'; import { Sponsor } from '../Sponsor'; -import type { SponsorIncludeOptions } from '../types'; +import type { SponsorData, SponsorIncludeOptions } from '../types'; import styles from './styles.module.css'; interface SponsorsProps { className: string; include?: SponsorIncludeOptions; expanded?: boolean; - tier?: string; + sponsors: SponsorData[]; title: string; + tier: string; } export function Sponsors({ className, include, - tier, title, + tier, + sponsors, }: SponsorsProps): JSX.Element { return (

{title}

); diff --git a/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css b/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css index e740c76f8bd1..08e99b16488d 100644 --- a/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css +++ b/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css @@ -15,7 +15,7 @@ .sponsorsTier li { list-style: none; margin: 5px; - max-width: 120px; + max-width: 130px; } .sponsorsTier img { @@ -29,40 +29,42 @@ border: none; } -.tier-sponsor { +.tier-platinum-sponsor { gap: 32px 16px; } -.tier-sponsor img { +.tier-platinum-sponsor img { display: inline-block; - max-height: 120px; - max-width: 120px; - width: 120px; + max-height: 130px; + max-width: 130px; + width: 130px; } -.tier-supporter, -.tier-contributor { +.tier-gold-supporter, +.tier-silver-supporter { align-items: center; } -.tier-supporter { +.tier-gold-supporter { font-size: 0.95rem; line-height: 1; - gap: 24px; - padding-top: 16px; + gap: 12px; + padding-top: 12px; } -.tier-supporter img { +.tier-gold-supporter img { max-height: 75px; max-width: 75px; width: 75px; } -.tier-contributor { - gap: 4px 24px; +.tier-silver-supporter { + gap: 4px 16px; + margin: auto; + max-width: 75%; } -.tier-contributor img { +.tier-silver-supporter img { max-height: 45px; max-width: 45px; width: 45px; @@ -81,4 +83,8 @@ width: auto; padding: 0 60px; } + + .tier-gold-supporter { + margin-bottom: 0; + } } diff --git a/packages/website/src/components/FinancialContributors/index.tsx b/packages/website/src/components/FinancialContributors/index.tsx index 609de140c9a1..f952a5a42354 100644 --- a/packages/website/src/components/FinancialContributors/index.tsx +++ b/packages/website/src/components/FinancialContributors/index.tsx @@ -1,4 +1,5 @@ import Link from '@docusaurus/Link'; +import sponsors from '@site/data/sponsors.json'; import clsx from 'clsx'; import React from 'react'; @@ -16,19 +17,22 @@ export function FinancialContributors(): JSX.Element {
diff --git a/tools/generate-sponsors.ts b/tools/generate-sponsors.ts index eadeb1bb4501..cbec8141ddc1 100644 --- a/tools/generate-sponsors.ts +++ b/tools/generate-sponsors.ts @@ -92,10 +92,6 @@ interface MemberAccount { website: string; } -interface MemberAccountAndTier extends MemberAccount { - tier?: Tier; -} - const excludedNames = new Set([ 'Guest', // Apparent anonymous donor equivalent without an avatar 'Josh Goldberg', // Team member 💖 @@ -121,13 +117,12 @@ async function main(): Promise { ]); const accountsById = account.orders.nodes.reduce< - Record + Record >((accumulator, account) => { const name = account.fromAccount.name || account.fromAccount.id; accumulator[name] = { ...accumulator[name], ...account.fromAccount, - tier: account.tier, }; return accumulator; }, {}); @@ -145,7 +140,7 @@ async function main(): Promise { const allSponsorsConfig = collective.members.nodes .map(member => { const name = member.account.name || member.account.id; - const fromAccount: MemberAccountAndTier = { + const fromAccount = { ...member.account, ...accountsById[name], }; @@ -156,14 +151,13 @@ async function main(): Promise { id: name, image: fromAccount.imageUrl, name: fromAccount.name, - tier: getReportedTierSlug(totalDonations, website), totalDonations, twitterHandle: fromAccount.twitterHandle, website, }; }) - .filter(({ id, tier }) => { - if (uniqueNames.has(id) || !tier) { + .filter(({ id, totalDonations, website }) => { + if (uniqueNames.has(id) || totalDonations < 10000 || !website) { return false; } @@ -196,28 +190,6 @@ async function stringifyObject( }); } -function getReportedTierSlug( - totalDonations: number, - website: string, -): string | undefined { - if (!website) { - return undefined; - } - - if (totalDonations >= 1_000_00) { - return 'sponsor'; - } - if (totalDonations >= 500_00) { - return 'supporter'; - } - - if (totalDonations >= 100_00) { - return 'contributor'; - } - - return undefined; -} - main().catch(error => { console.error(error); process.exitCode = 1;