From f923eff038f105ffa1828695e871e9ed5b323e19 Mon Sep 17 00:00:00 2001
From: Amaresh S M <30730124+amareshsm@users.noreply.github.com>
Date: Fri, 25 Oct 2024 01:56:40 +0530
Subject: [PATCH 1/2] chore: Add sponsors to README
---
README.md | 18 ++++++++++++++++
tools/generate-sponsors.js | 43 ++++++++++++++++++++++++++++++--------
2 files changed, 52 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 53b85a05c3..e05428f374 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,24 @@ In order to create a new translation:
The ESLint team will create a new domain name, set up analytics and ads, and otherwise prepare the website for deployment.
+
+
+
+## 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
+
Gold Sponsors
+
Silver Sponsors
+
Bronze 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.
+
+
+
## License
[Apache 2.0](LICENSE)
diff --git a/tools/generate-sponsors.js b/tools/generate-sponsors.js
index dc81e36af0..b7f8948f2e 100644
--- a/tools/generate-sponsors.js
+++ b/tools/generate-sponsors.js
@@ -3,6 +3,7 @@
* This script generates a markdown file containing sponsor information.
* It fetches sponsor data from specified JSON files, formats
* the data into HTML sections, and writes the output to a new markdown file.
+ * Additionally, it updates the README file with the latest sponsor information.
*
* Usage:
* Run the script using Node.js:
@@ -51,6 +52,8 @@ The following companies, organizations, and individuals support ESLint's ongoing
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
`;
+const README_FILE_PATH = path.resolve(__dirname, "../README.md");
+
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
@@ -63,7 +66,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
async function readData(filePath) {
try {
const data = await fs.readFile(filePath, "utf8");
- return JSON.parse(data);
+ return data;
} catch (err) {
console.error("Error reading or parsing the file:", err);
return null;
@@ -76,10 +79,11 @@ async function readData(filePath) {
*/
async function fetchSponsorsData() {
const sponsorsData = await readData(SPONSORS_FILE_PATH);
- if (sponsorsData) {
- delete sponsorsData.backers;
+ const parsedSponsorData = JSON.parse(sponsorsData);
+ if (parsedSponsorData) {
+ delete parsedSponsorData.backers;
}
- return sponsorsData;
+ return parsedSponsorData;
}
/**
@@ -87,7 +91,9 @@ async function fetchSponsorsData() {
* @returns {Array