diff --git a/README.md b/README.md index f0a10af5..ff2de4be 100644 --- a/README.md +++ b/README.md @@ -14,20 +14,18 @@ This repository is the home of the following packages: We work hard to ensure that the packages inside this repository are safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). -## Sponsors - -The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our README and website. - +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

trunk.io

Silver Sponsors

JetBrains Liftoff American Express Workleap

Bronze Sponsors

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders Nextbase Starter Kit

- - - -

Technology Sponsors

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

- + diff --git a/package.json b/package.json index 650c49a6..5e715a54 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ ] }, "devDependencies": { - "common-tags": "^1.8.2", "eslint": "^9.11.1", "eslint-config-eslint": "^11.0.0", "eslint-plugin-chai-friendly": "^1.0.0", diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 9302a63d..49685d86 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -90,20 +90,18 @@ We work hard to ensure that ESLint Scope is safe for everyone and that security ESLint Scope is licensed under a permissive BSD 2-clause license. -## Sponsors - -The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our README and website. - +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

trunk.io

Silver Sponsors

JetBrains Liftoff American Express Workleap

Bronze Sponsors

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders Nextbase Starter Kit

- - - -

Technology Sponsors

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

- + diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index bd9dd3ef..409c82d6 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -102,20 +102,18 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer- [Node.js]: https://nodejs.org/ [ESTree]: https://github.com/estree/estree -## Sponsors - -The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our README and website. - +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

trunk.io

Silver Sponsors

JetBrains Liftoff American Express Workleap

Bronze Sponsors

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders Nextbase Starter Kit

- - - -

Technology Sponsors

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

- + diff --git a/packages/espree/README.md b/packages/espree/README.md index 1decea29..5201050f 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -243,20 +243,18 @@ See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finish In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. -## Sponsors - -The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our README and website. - +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

trunk.io

Silver Sponsors

JetBrains Liftoff American Express Workleap

Bronze Sponsors

WordHint Anagram Solver Icons8 Discord GitBook Nx HeroCoders Nextbase Starter Kit

- - - -

Technology Sponsors

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

- + diff --git a/tools/update-readme.js b/tools/update-readme.js index 520a268c..226a211e 100644 --- a/tools/update-readme.js +++ b/tools/update-readme.js @@ -11,98 +11,29 @@ //----------------------------------------------------------------------------- import { readFileSync, readdirSync, writeFileSync } from "node:fs"; -import { stripIndents } from "common-tags"; import got from "got"; //----------------------------------------------------------------------------- // Data //----------------------------------------------------------------------------- -const SPONSORS_URL = "https://raw.githubusercontent.com/eslint/eslint.org/main/src/_data/sponsors.json"; - -const TECH_SPONSORS_URL = "https://raw.githubusercontent.com/eslint/eslint.org/main/src/_data/techsponsors.json"; - -const TECH_SPONSORS_IMAGE_PATH = "https://raw.githubusercontent.com/eslint/eslint.org/main/src"; +const SPONSORS_URL = "https://raw.githubusercontent.com/eslint/eslint.org/main/includes/sponsors.md"; const README_FILE_PATHS = [ "./README.md", ...readdirSync("./packages").map(dir => `./packages/${dir}/README.md`) ]; -const heights = { - platinum: 128, - gold: 96, - silver: 64, - bronze: 32 -}; - //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- /** - * Fetches the latest sponsors data from the website. - * @returns {Object} The sponsors data object. + * Fetches the latest sponsors from the website. + * @returns {Promise}} Prerendered sponsors markdown. */ -async function fetchSponsorsData() { - const data = await got(SPONSORS_URL).json(); - - // remove backers from sponsors list - not shown on readme - delete data.backers; - - return data; -} - -/** - * Fetches the latest tech sponsors data from the website. - * @returns {Array} The tech sponsors array of data object. - */ -async function fetchTechSponsors() { - const data = await got(TECH_SPONSORS_URL).json(); - - return data; -} - -/** - * Formats an array of sponsors into HTML for the readme. - * @param {Object} sponsors The object of sponsors. - * @returns {string} The HTML for the readme. - */ -function formatSponsors(sponsors) { - const nonEmptySponsors = Object.keys(sponsors).filter( - tier => sponsors[tier].length > 0 - ); - - return stripIndents` - ${nonEmptySponsors - .map( - tier => `

${tier[0].toUpperCase()}${tier.slice(1)} Sponsors

-

${sponsors[tier] - .map( - sponsor => - `${sponsor.name}` - ) - .join(" ")}

` - ) - .join("")} - `; -} - -/** - * Formats an array of sponsors into HTML for the readme. - * @param {Array} sponsors The array of sponsors. - * @returns {string} The HTML for the readme. - */ -function formatTechSponsors(sponsors) { - return stripIndents` -

Technology Sponsors

-

${sponsors - .map( - sponsor => - `${sponsor.name}` - ) - .join(" ")}

- `; +async function fetchSponsorsMarkdown() { + return got(SPONSORS_URL).text(); } //----------------------------------------------------------------------------- @@ -110,10 +41,7 @@ function formatTechSponsors(sponsors) { //----------------------------------------------------------------------------- (async () => { - const [techSponsors, allSponsors] = await Promise.all([ - fetchTechSponsors(), - fetchSponsorsData() - ]); + const allSponsors = await fetchSponsorsMarkdown(); README_FILE_PATHS.forEach(filePath => { @@ -122,12 +50,7 @@ function formatTechSponsors(sponsors) { let newReadme = readme.replace( /[\w\W]*?/u, - formatSponsors(allSponsors) - ); - - newReadme = newReadme.replace( - /[\w\W]*?/u, - formatTechSponsors(techSponsors) + `\n${allSponsors}\n` ); // replace multiple consecutive blank lines with just one blank line