From 1f67b28dca58bb09daba802f2a9b04a2121ca3a3 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Mon, 11 Feb 2019 08:56:02 -0800 Subject: [PATCH 1/3] Docs: Update README with latest sponsors/team data --- README.md | 214 +++++++++++------------------------------ tools/update-readme.js | 88 +++++++++++++++++ 2 files changed, 146 insertions(+), 156 deletions(-) create mode 100644 tools/update-readme.js diff --git a/README.md b/README.md index e1855ec3f49..53e920f827e 100644 --- a/README.md +++ b/README.md @@ -197,170 +197,72 @@ 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/tools/update-readme.js b/tools/update-readme.js new file mode 100644 index 00000000000..afc162bb808 --- /dev/null +++ b/tools/update-readme.js @@ -0,0 +1,88 @@ +/** + * @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"); + +//----------------------------------------------------------------------------- +// 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) { + return ` + ${ + members.map((member, index) => `${(index + 1) % 9 ? "" : ""}`).join("") +}
+ +
+ ${member.name}
+
+ `; +} + +/** + * 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) { + return ` + ${ + Object.keys(sponsors).filter(tier => sponsors[tier].length > 0).map(tier => `### ${tier[0].toUpperCase()}${tier.slice(1)} Sponsors +

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

`).join("") +} + `; +} + +//----------------------------------------------------------------------------- +// 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"); From be9893888781ba435a4f3a988e33b88a6c5d2333 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Mon, 11 Feb 2019 09:35:17 -0800 Subject: [PATCH 2/3] Fix markdown formatting --- README.md | 104 ++++++++++++++++++++++------------------- package.json | 1 + tools/update-readme.js | 36 ++++++++------ 3 files changed, 78 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 53e920f827e..e472bc44ed8 100644 --- a/README.md +++ b/README.md @@ -198,58 +198,64 @@ 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
-
- -
- Kevin Partington
-
- -
- Ilya Volodin
-
- -
- Brandon Mills
-
- -
- Toru Nagashima
-
- -
- Gyandeep Singh
-
- -
- Kai Cataldo
-
- -
- Teddy Katz
-
- +
+ +
+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
-
- +
+ +
+薛定谔的猫 +
+
+ +
+Pig Fang +
+
## Sponsors @@ -257,9 +263,9 @@ The following companies, organizations, and individuals support ESLint's ongoing - ### Gold Sponsors -

Facebook Open Source Airbnb

- +

Gold Sponsors

+

Facebook Open Source Airbnb

+ ## Technology Sponsors 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 index afc162bb808..ca58783f7ba 100644 --- a/tools/update-readme.js +++ b/tools/update-readme.js @@ -15,6 +15,7 @@ const path = require("path"); const fs = require("fs"); +const { stripIndents } = require("common-tags"); //----------------------------------------------------------------------------- // Data @@ -36,6 +37,7 @@ const heights = { // remove backers from sponsors list - not shown on readme delete allSponsors.backers; + //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- @@ -47,15 +49,17 @@ delete allSponsors.backers; * @returns {string} The HTML for the members list. */ function formatTeamMembers(members, label) { - return ` + /* eslint-disable indent*/ + return stripIndents` ${ - members.map((member, index) => `${(index + 1) % 9 ? "" : ""}`).join("") -}
- -
- ${member.name}
-
- `; + members.map((member, index) => ` + +
+ ${member.name} +
+ ${(index + 1) % 9 ? "" : ""}`).join("") + }`; + /* eslint-enable indent*/ } /** @@ -64,14 +68,18 @@ function formatTeamMembers(members, label) { * @returns {string} The HTML for the readme. */ function formatSponsors(sponsors) { - return ` + const nonEmptySponsors = Object.keys(sponsors).filter(tier => sponsors[tier].length > 0); + + /* eslint-disable indent*/ + return stripIndents` ${ - Object.keys(sponsors).filter(tier => sponsors[tier].length > 0).map(tier => `### ${tier[0].toUpperCase()}${tier.slice(1)} Sponsors -

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

`).join("") -} + nonEmptySponsors.map(tier => `

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

+

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

`).join("") + } `; + /* eslint-enable indent*/ } //----------------------------------------------------------------------------- From e9d4facc0b17de2e70b80a5b4f6e939ce209aba6 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Mon, 11 Feb 2019 09:37:44 -0800 Subject: [PATCH 3/3] Realign team members table --- README.md | 26 ++++++++++++++------------ tools/update-readme.js | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e472bc44ed8..847f5ac34de 100644 --- a/README.md +++ b/README.md @@ -198,64 +198,66 @@ 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
-
+
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
-
+
## Sponsors diff --git a/tools/update-readme.js b/tools/update-readme.js index ca58783f7ba..9b0f96d76b5 100644 --- a/tools/update-readme.js +++ b/tools/update-readme.js @@ -57,7 +57,7 @@ function formatTeamMembers(members, label) {
${member.name} - ${(index + 1) % 9 ? "" : ""}`).join("") + ${(index + 1) % 9 === 0 ? "" : ""}`).join("") }`; /* eslint-enable indent*/ }