diff --git a/package.json b/package.json index d2df363bc502..9618174990fe 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "make-dir": "^3.1.0", "markdownlint-cli": "^0.29.0", "ncp": "^2.0.0", - "node-fetch": "^3.0.0", + "cross-fetch": "^3.1.4", "prettier": "^2.5.0", "pretty-format": "^27.3.1", "rimraf": "^3.0.2", diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index 0dc27aa51a3b..4e3f36f3c844 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -1,82 +1,137 @@ [ { - "tier": "sponsor", - "name": "Nx (by Nrwl)", - "slug": "nx", - "website": "https://nx.dev", - "image": "https://images.opencollective.com/nx/0efbe42/logo.png", - "description": "Nx is an extensible development toolkit that helps teams of all sizes easily create and scale their Web applications using modern tools." + "description": "Accelerate your development work on iOS, Android and beyond with the power of ARM-based virtual devices.", + "id": "gm9bnk80-437xqryv-89jpvzeo-ljdayw5r", + "image": "https://images.opencollective.com/corellium/aa8c228/logo.png", + "name": "Corellium", + "slug": "corellium", + "tier": "supporter", + "website": "https://www.corellium.com" }, { + "description": "Penalty.com is your number one source of football live scores, results and stats.", + "id": "3z8arxve-ymko60ya-xgbqgl5n-bj9w704d", + "image": "https://images.opencollective.com/penalty/56b629e/avatar.png", + "name": "Penalty.com", + "slug": "penalty", "tier": "supporter", - "name": "n8n.io - n8n GmbH", - "slug": "n8n", - "website": "https://n8n.io", - "image": "https://images.opencollective.com/n8n/dca2f0c/logo.png", - "description": "Free and open Workflow Automation tool which can be self-hosted and easily extended" + "website": "https://penalty.com" }, { + "description": null, + "id": "ov349mrw-gz75lpyx-elzqa08d-jeybknox", + "image": "https://images.opencollective.com/gaetan-bloch/c5cfcb2/avatar.png", + "name": "Gaëtan Bloch", + "slug": "gaetan-bloch", "tier": "supporter", - "name": "Florian Studio", - "slug": "florian-studio", - "website": "https://www.ceodata.com", - "image": "https://images.opencollective.com/florian-studio/ee9d649/logo.png", - "description": null + "website": null }, { + "description": "The pluggable linting utility for JavaScript and JSX", + "id": "k3z8arxv-eymko60y-73wqgl5n-bj9w704d", + "image": "https://images.opencollective.com/eslint/96b09dc/logo.png", + "name": "ESLint", + "slug": "eslint", + "tier": "sponsor", + "website": "https://eslint.org/" + }, + { + "description": "Our mission is to create an open financial system for the world. ", + "id": "7ywz9j4a-vgod8pgn-996mr35n-xklb0e7a", + "image": "https://images.opencollective.com/coinbase/a202856/logo.png", + "name": "Coinbase", + "slug": "coinbase", + "tier": "sponsor", + "website": "https://blog.coinbase.com/engineering-and-security/home" + }, + { + "description": null, + "id": "vjrkx5lm-nv904qjv-k0bq8bwa-7zdygoe3", + "image": "https://images.opencollective.com/jeffrey-rennie/avatar.png", + "name": "Jeffrey Rennie", + "slug": "jeffrey-rennie", "tier": "supporter", - "name": "Andrey Sitnik", - "slug": "andrey-sitnik", - "website": "https://sitnik.ru", - "image": "https://images.opencollective.com/andrey-sitnik/11aeb28/avatar.png", - "description": "The creator of Autoprefixer, PostCSS, and Logux" + "website": null }, { + "description": "We're Balsa, and we're building tools for builders.", + "id": "nmlo94zn-7x08dpov-y0e6ewga-3vjbrky5", + "image": "https://images.opencollective.com/balsa/77de498/logo.png", + "name": "Balsa", + "slug": "balsa", "tier": "supporter", - "name": "Loyalty Leo", - "slug": "loyalty-leo", - "website": "https://www.loyaltyleo.com", - "image": "https://images.opencollective.com/loyalty-leo/22d6ea0/logo.png", - "description": null + "website": "https://balsa.com" }, { + "description": "Evil Martians is a distributed product development consultancy that works with startups and established businesses, and creates open source-based products and services.", + "id": "53kzxy4v-07wlr6md-7ve6mj9n-o8agdbe5", + "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", + "name": "Evil Martians", + "slug": "evilmartians", "tier": "supporter", - "name": "David Johnston", - "slug": "blacksheepcode", - "website": "https://blacksheepcode.com", - "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", - "description": "Full Stack JavaScript Developer" + "website": "https://evilmartians.com/" }, { + "description": null, + "id": "nmlo94zn-7x08dpo5-nyoqewga-3vjbrky5", + "image": "https://images.opencollective.com/tripwire/7599e30/logo.png", + "name": "Tripwire, Inc.", + "slug": "tripwire", "tier": "supporter", - "name": "Airbnb", - "slug": "airbnb", - "website": "https://www.airbnb.com/", - "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", - "description": "Book unique homes and experience a city like a local." + "website": "https://tripwire.com" }, { + "description": "Nx is an extensible development toolkit that helps teams of all sizes easily create and scale their Web applications using modern tools.", + "id": "bvrgbk35-7l4x96e0-nlaqomew-a0jdyzn8", + "image": "https://images.opencollective.com/nx/0efbe42/logo.png", + "name": "Nx (by Nrwl)", + "slug": "nx", + "tier": "sponsor", + "website": "https://nx.dev" + }, + { + "description": "Free and open Workflow Automation tool which can be self-hosted and easily extended", + "id": "7ywz9j4a-vgod8pgv-d8ypmr35-nxklb0e7", + "image": "https://images.opencollective.com/n8n/dca2f0c/logo.png", + "name": "n8n.io - n8n GmbH", + "slug": "n8n", + "tier": "supporter", + "website": "https://n8n.io" + }, + { + "description": null, + "id": "ov349mrw-gz75lpyz-0l86a08d-jeybknox", + "image": "https://images.opencollective.com/florian-studio/ee9d649/logo.png", + "name": "Florian Studio", + "slug": "florian-studio", "tier": "supporter", - "name": "Joe Alden", - "slug": "joealden", - "website": "https://joealden.com", - "image": "https://images.opencollective.com/joealden/44a6738/avatar.png", - "description": "Software Developer" + "website": "https://www.ceodata.com" }, { + "description": "Full Stack JavaScript Developer", + "id": "03k0exgz-nm8yj64r-wjjp5wao-9r7b4dlv", + "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", + "name": "David Johnston", + "slug": "blacksheepcode", "tier": "supporter", - "name": "Josh Goldberg", - "slug": "joshuakgoldberg", - "website": "https://joshuakgoldberg.com", - "image": "https://images.opencollective.com/joshuakgoldberg/9ad1bcb/avatar.png", - "description": null + "website": "https://blacksheepcode.com" }, { + "description": "Book unique homes and experience a city like a local.", + "id": "88rzownx-l9e50pxw-rwqymvbd-gk7j43a9", + "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", + "name": "Airbnb", + "slug": "airbnb", "tier": "supporter", + "website": "https://www.airbnb.com/" + }, + { + "description": "I write code sometimes and support stuff I like on here.", + "id": "53kzxy4v-07wlr6mv-wob6mj9n-o8agdbe5", + "image": "https://images.opencollective.com/michael-ranciglio/avatar.png", "name": "Michael Ranciglio", "slug": "michael-ranciglio", - "website": null, - "image": "https://images.opencollective.com/michael-ranciglio/avatar.png", - "description": "I write code sometimes and support stuff I like on here." + "tier": "supporter", + "website": null } ] diff --git a/packages/website/src/components/FinancialContributors.module.css b/packages/website/src/components/FinancialContributors.module.css new file mode 100644 index 000000000000..47249f798e86 --- /dev/null +++ b/packages/website/src/components/FinancialContributors.module.css @@ -0,0 +1,62 @@ +.tierArea { + margin: 32px 0; +} + +.sponsorsTier { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: end; + max-width: 800px; + margin: 10px auto; + padding: 0; +} + +.sponsorsTier li { + list-style: none; + margin: 5px; +} + +.sponsorsTier a, +.sponsorsTier a:hover { + background: none; + border: none; +} + +.tier-sponsor { + gap: 16px; +} + +.tier-sponsor img { + max-height: 110px; + width: 110px; +} + +.tier-supporter img { + max-height: 60px; + width: 60px; +} + +.sponsorLink { + display: inline-flex; + flex-direction: column; + gap: 8px; +} + +.become { + margin: 8px 0 24px; + font-size: 1rem; +} + +@media screen and (min-width: 1150px) { + .sponsorsContainer { + display: flex; + gap: 32px; + margin: auto; + max-width: 75%; + } + + .tierArea { + width: 50%; + } +} diff --git a/packages/website/src/components/FinancialContributors.tsx b/packages/website/src/components/FinancialContributors.tsx new file mode 100644 index 000000000000..400442239d84 --- /dev/null +++ b/packages/website/src/components/FinancialContributors.tsx @@ -0,0 +1,68 @@ +import Link from '@docusaurus/Link'; +import sponsors from '@site/data/sponsors.json'; +import clsx from 'clsx'; +import React from 'react'; + +import styles from './FinancialContributors.module.css'; + +function Sponsors(props: { + description: string; + showName?: boolean; + tier: string; + title: string; +}): JSX.Element { + const tierSponsors = sponsors.filter(sponsor => sponsor.tier === props.tier); + return ( +
+

{props.title}

+

{props.description}

+ +
+ ); +} + +export function FinancialContributors(): JSX.Element { + return ( + <> +

+ The TypeScript ESLint project would not be possible without the generous + support of our financial contributors. +

+
+ + +
+ + Become a financial contributor + + + ); +} diff --git a/packages/website/src/pages/index.tsx b/packages/website/src/pages/index.tsx index 1ec16db111bb..74ce3c4a306b 100644 --- a/packages/website/src/pages/index.tsx +++ b/packages/website/src/pages/index.tsx @@ -4,10 +4,9 @@ import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; +import { FinancialContributors } from '../components/FinancialContributors'; import styles from './styles.module.css'; -import sponsors from '@site/data/sponsors.json'; - interface FeatureItem { title: string; description: JSX.Element; @@ -121,32 +120,6 @@ function Feature({ title, description }: FeatureItem): JSX.Element { ); } -function Sponsors(props: { - tier: string; - title: string; - className?: string; -}): JSX.Element { - const tierSponsors = sponsors.filter(sponsor => sponsor.tier === props.tier); - return ( -
- -
- ); -} - function Home(): JSX.Element { const { siteConfig } = useDocusaurusContext(); return ( @@ -187,15 +160,7 @@ function Home(): JSX.Element {

Financial Contributors

- - - - Become a sponsor - +
diff --git a/packages/website/src/pages/styles.module.css b/packages/website/src/pages/styles.module.css index 2e181af01382..4553800e8ad8 100644 --- a/packages/website/src/pages/styles.module.css +++ b/packages/website/src/pages/styles.module.css @@ -52,32 +52,3 @@ height: 7rem; width: 7rem; } - -.sponsorsTier { - display: flex; - flex-wrap: wrap; - justify-content: center; - align-items: center; - max-width: 800px; - margin: 10px auto; - padding: 0; -} - -.sponsorsTier li { - list-style: none; - margin: 5px; -} - -.sponsorsTier a, -.sponsorsTier a:hover { - background: none; - border: none; -} -.tier-sponsor img { - max-height: 90px; - width: 90px; -} -.tier-supporter img { - max-height: 60px; - width: 60px; -} diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts index c668ecf3da4a..69692cab586b 100644 --- a/tools/generate-contributors.ts +++ b/tools/generate-contributors.ts @@ -3,7 +3,7 @@ // this endpoint returns a list of contributors sorted by number of contributions import * as fs from 'fs'; -import fetch from 'node-fetch'; +import fetch from 'cross-fetch'; import * as path from 'path'; const IGNORED_USERS = new Set([ diff --git a/tools/generate-sponsors.ts b/tools/generate-sponsors.ts index 4d5d6f385c2a..79f472879a32 100644 --- a/tools/generate-sponsors.ts +++ b/tools/generate-sponsors.ts @@ -1,5 +1,5 @@ +import fetch from 'cross-fetch'; import * as fs from 'fs'; -import fetch from 'node-fetch'; import * as path from 'path'; const graphqlEndpoint = 'https://api.opencollective.com/graphql/v2'; @@ -13,6 +13,7 @@ const graphqlQuery = `{ slug } fromAccount { + id name slug website @@ -24,6 +25,10 @@ const graphqlQuery = `{ } }`; +const excludedIds = new Set([ + '53kzxy4v-07wlr6mr-o9epmj9n-o8agdbe5', // Josh Goldberg +]); + interface SponsorsData { data: { account: { @@ -37,6 +42,7 @@ interface SponsorsData { interface SponsorNode { fromAccount: { description: string; + id: string; imageUrl: string; name: string; slug: string; @@ -55,17 +61,27 @@ async function main(): Promise { body: JSON.stringify({ query: graphqlQuery }), }); const data = (await response.json()) as SponsorsData; + const uniqueIds = new Set(excludedIds); const allSponsorsConfig = data.data.account.orders.nodes .filter(node => !!node.tier) .map(node => ({ description: node.fromAccount.description, + id: node.fromAccount.id, image: node.fromAccount.imageUrl, name: node.fromAccount.name, slug: node.fromAccount.slug, tier: node.tier.slug, twitterHandle: node.fromAccount.twitterHandle, website: node.fromAccount.website, - })); + })) + .filter(({ id }) => { + if (uniqueIds.has(id)) { + return false; + } + + uniqueIds.add(id); + return true; + }); const rcPath = path.resolve( __dirname, diff --git a/tools/generate-website-dts.ts b/tools/generate-website-dts.ts index d0ac96c684c6..4a09e1b65263 100644 --- a/tools/generate-website-dts.ts +++ b/tools/generate-website-dts.ts @@ -1,5 +1,5 @@ import * as fs from 'fs'; -import fetch from 'node-fetch'; +import fetch from 'cross-fetch'; import * as path from 'path'; const baseHost = 'https://www.staging-typescript.org'; diff --git a/yarn.lock b/yarn.lock index 3c305e231a21..140ab768f38b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5605,7 +5605,7 @@ cross-env@^7.0.3: dependencies: cross-spawn "^7.0.1" -cross-fetch@^3.0.4: +cross-fetch@^3.0.4, cross-fetch@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== @@ -5928,11 +5928,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b" - integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== - data-urls@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" @@ -7097,13 +7092,6 @@ feed@^4.2.2: dependencies: xml-js "^1.6.11" -fetch-blob@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.2.tgz#6bc438675f3851ecea51758ac91f6a1cd1bacabd" - integrity sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ== - dependencies: - web-streams-polyfill "^3.0.3" - figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -7305,13 +7293,6 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== - dependencies: - fetch-blob "^3.1.2" - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -10466,15 +10447,6 @@ node-fetch@^2.6.0, node-fetch@^2.6.1: dependencies: whatwg-url "^5.0.0" -node-fetch@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.1.0.tgz#714f4922dc270239487654eaeeab86b8206cb52e" - integrity sha512-QU0WbIfMUjd5+MUzQOYhenAazakV7Irh1SGkWCsRzBwvm4fAhzEUaHMJ6QLP7gWT6WO9/oH2zhKMMGMuIrDyKw== - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.2" - formdata-polyfill "^4.0.10" - node-forge@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" @@ -14400,11 +14372,6 @@ web-namespaces@^1.0.0, web-namespaces@^1.1.2: resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== -web-streams-polyfill@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz#1516f2d4ea8f1bdbfed15eb65cb2df87098c8364" - integrity sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"