From 546d355ace65631e27de859baea3ffcc50e0ad2c Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Mon, 11 Feb 2019 17:16:39 -0700 Subject: [PATCH] Docs: Update README with latest sponsors/team data (#11378) * Docs: Update README with latest sponsors/team data * Fix markdown formatting * Realign team members table --- README.md | 222 ++++++++++++----------------------------- package.json | 1 + tools/update-readme.js | 96 ++++++++++++++++++ 3 files changed, 163 insertions(+), 156 deletions(-) create mode 100644 tools/update-readme.js diff --git a/README.md b/README.md index e1855ec3f49..847f5ac34de 100644 --- a/README.md +++ b/README.md @@ -197,170 +197,80 @@ These folks keep the project moving and are resources for help. The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. - - - - - - - - - - - - - - -
- -
- Nicholas C. Zakas
-
- -
- Ilya Volodin
-
- -
- Brandon Mills
-
- -
- Gyandeep Singh
-
- -
- Toru Nagashima
-
- -
- Alberto Rodríguez
-
- -
- Kai Cataldo
-
- -
- Teddy Katz
-
- -
- Kevin Partington
-
+ + +
+ +
+Nicholas C. Zakas +
+
+ +
+Kevin Partington +
+
+ +
+Ilya Volodin +
+
+ +
+Brandon Mills +
+
+ +
+Toru Nagashima +
+
+ +
+Gyandeep Singh +
+
+ +
+Kai Cataldo +
+
+ +
+Teddy Katz +
+
### Committers The people who review and fix bugs and help triage issues. - - - - - - - -
- -
- 薛定谔的猫
-
- -
- Pig Fang
-
- - -### Alumni - -Former TSC members and committers who previously helped maintain ESLint. - - - - - - - - - - - - - - - - - - - - - - - -
- -
- Mathias Schreck
-
- -
- Jamund Ferguson
-
- -
- Ian VanSchooten
-
- -
- Burak Yiğit Kaya
-
- -
- Michael Ficarra
-
- -
- Mark Pedrotti
-
- -
- Oleg Gaidarenko
-
- -
- Mike Sherov
-
- -
- Henry Zhu
-
- -
- Marat Dulin
-
- -
- Alexej Yaroshevich
-
- -
- Vitor Balocco
-
- -
- James Henry
-
- -
- Reyad Attiyat
-
- -
- Victor Hom
-
+ + +
+ +
+薛定谔的猫 +
+
+ +
+Pig Fang +
+
## Sponsors +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website. + + + +

Gold Sponsors

+

Facebook Open Source Airbnb

+ + +## Technology Sponsors + * Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com) diff --git a/package.json b/package.json index f1776d80495..ad279062224 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "browserify": "^16.2.2", "chai": "^4.0.1", "cheerio": "^0.22.0", + "common-tags": "^1.8.0", "coveralls": "^3.0.1", "dateformat": "^3.0.3", "ejs": "^2.6.1", diff --git a/tools/update-readme.js b/tools/update-readme.js new file mode 100644 index 00000000000..9b0f96d76b5 --- /dev/null +++ b/tools/update-readme.js @@ -0,0 +1,96 @@ +/** + * @fileoverview Script to update the README with team and sponsors. + * Note that this requires eslint.github.io to be available in the same + * directory as the eslint repo. + * + * node tools/update-readme.js + * + * @author Nicholas C. Zakas + */ +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const path = require("path"); +const fs = require("fs"); +const { stripIndents } = require("common-tags"); + +//----------------------------------------------------------------------------- +// Data +//----------------------------------------------------------------------------- + +const README_FILE_PATH = path.resolve(__dirname, "../README.md"); +const WEBSITE_DATA_PATH = path.resolve(__dirname, "../../eslint.github.io/_data"); + +const team = JSON.parse(fs.readFileSync(path.join(WEBSITE_DATA_PATH, "team.json"))); +const allSponsors = JSON.parse(fs.readFileSync(path.join(WEBSITE_DATA_PATH, "sponsors.json"))); +const readme = fs.readFileSync(README_FILE_PATH, "utf8"); + +const heights = { + gold: 96, + silver: 64, + bronze: 32 +}; + +// remove backers from sponsors list - not shown on readme +delete allSponsors.backers; + + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +/** + * Formats an array of team members for inclusion in the readme. + * @param {Array} members The array of members to format. + * @param {string} label The label for the section of the readme. + * @returns {string} The HTML for the members list. + */ +function formatTeamMembers(members, label) { + /* eslint-disable indent*/ + return stripIndents` + ${ + members.map((member, index) => `${(index + 1) % 9 === 0 ? "" : ""}`).join("") + }
+ +
+ ${member.name} +
+
`; + /* eslint-enable indent*/ +} + +/** + * 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 formatSponsors(sponsors) { + const nonEmptySponsors = Object.keys(sponsors).filter(tier => sponsors[tier].length > 0); + + /* eslint-disable indent*/ + return stripIndents` + ${ + nonEmptySponsors.map(tier => `

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

+

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

`).join("") + } + `; + /* eslint-enable indent*/ +} + +//----------------------------------------------------------------------------- +// Main +//----------------------------------------------------------------------------- + +// replace all of the section +let newReadme = readme.replace(/[\w\W]*?/, formatTeamMembers(team.tsc, "tsc")); + +newReadme = newReadme.replace(/[\w\W]*?/, formatTeamMembers(team.committers, "committers")); +newReadme = newReadme.replace(/[\w\W]*?/, formatSponsors(allSponsors)); + +// output to the file +fs.writeFileSync(README_FILE_PATH, newReadme, "utf8");