diff --git a/README.md b/README.md index 14de4ab1094..7e8d7a7e05a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ - [简体中文](locales/zh-CN/README.md) - [繁體中文](locales/zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ We love community contributions! Get started by reading our [CONTRIBUTING.md](CO --- -## Contributors - -Thanks to all our contributors who have helped make Roo Code better! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## License [Apache 2.0 © 2025 Roo Code, Inc.](./LICENSE) diff --git a/locales/ca/README.md b/locales/ca/README.md index 2c7d1788f77..f5c33b0c676 100644 --- a/locales/ca/README.md +++ b/locales/ca/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Ens encanten les contribucions de la comunitat! Comença llegint el nostre [CONT --- -## Col·laboradors - -Gràcies a tots els nostres col·laboradors que han ajudat a millorar Roo Code! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Llicència [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/de/README.md b/locales/de/README.md index 22b4db6399a..e0322da970e 100644 --- a/locales/de/README.md +++ b/locales/de/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Wir lieben Community-Beiträge! Lies unsere [CONTRIBUTING.md](CONTRIBUTING.md), --- -## Mitwirkende - -Danke an alle unsere Mitwirkenden, die geholfen haben, Roo Code besser zu machen! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Lizenz [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/es/README.md b/locales/es/README.md index 3f0135c1d83..90e3af4b7d0 100644 --- a/locales/es/README.md +++ b/locales/es/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Usamos [changesets](https://github.com/changesets/changesets) para el versionado --- -## Colaboradores - -¡Gracias a todos nuestros colaboradores que han ayudado a mejorar Roo Code! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Licencia [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/fr/README.md b/locales/fr/README.md index 9596d9cbae7..5eb2b42a576 100644 --- a/locales/fr/README.md +++ b/locales/fr/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Nous adorons les contributions de la communauté ! Commencez par lire notre [CON --- -## Contributeurs - -Merci à tous nos contributeurs qui ont aidé à améliorer Roo Code ! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Licence [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/hi/README.md b/locales/hi/README.md index 53939eb8021..a9b3153d776 100644 --- a/locales/hi/README.md +++ b/locales/hi/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ pnpm install:vsix [-y] [--editor=] --- -## योगदानकर्ता - -हमारे सभी योगदानकर्ताओं को धन्यवाद जिन्होंने Roo Code को बेहतर बनाने में मदद की है! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## लाइसेंस [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/id/README.md b/locales/id/README.md index 8ec72301fc2..feeff54c5ed 100644 --- a/locales/id/README.md +++ b/locales/id/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Kami menyukai kontribusi komunitas! Mulailah dengan membaca [CONTRIBUTING.md](CO --- -## Kontributor - -Terima kasih kepada semua kontributor kami yang telah membantu membuat Roo Code lebih baik! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Lisensi [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/it/README.md b/locales/it/README.md index e3687df010b..a67dbd74f46 100644 --- a/locales/it/README.md +++ b/locales/it/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Adoriamo i contributi della community! Inizia leggendo il nostro [CONTRIBUTING.m --- -## Contributori - -Grazie a tutti i nostri contributori che hanno aiutato a migliorare Roo Code! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Licenza [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/ja/README.md b/locales/ja/README.md index 16e2f0d59d7..f17bc615fe1 100644 --- a/locales/ja/README.md +++ b/locales/ja/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ VSIXパッケージを手動でインストールしたい場合: --- -## 貢献者 - -Roo Codeをより良くするために協力してくれたすべての貢献者に感謝します! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## ライセンス [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/ko/README.md b/locales/ko/README.md index 6ad585859be..9740a09567a 100644 --- a/locales/ko/README.md +++ b/locales/ko/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ VSIX 패키지를 수동으로 설치하려면: --- -## 기여자 - -Roo Code를 더 좋게 만드는 데 도움을 준 모든 기여자들에게 감사합니다! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## 라이선스 [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/nl/README.md b/locales/nl/README.md index c8b660dfb0d..eb0c1701482 100644 --- a/locales/nl/README.md +++ b/locales/nl/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ We houden van bijdragen uit de community! Begin met het lezen van onze [CONTRIBU --- -## Bijdragers - -Dank aan al onze bijdragers die hebben geholpen Roo Code beter te maken! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Licentie [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/pl/README.md b/locales/pl/README.md index 099c4154571..dcc77205f11 100644 --- a/locales/pl/README.md +++ b/locales/pl/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Uwielbiamy wkłady społeczności! Zacznij od przeczytania naszego pliku [CONTRI --- -## Współtwórcy - -Dziękujemy wszystkim naszym współtwórcom, którzy pomogli ulepszyć Roo Code! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Licencja [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/pt-BR/README.md b/locales/pt-BR/README.md index ea27fb3a14f..f40ddabd246 100644 --- a/locales/pt-BR/README.md +++ b/locales/pt-BR/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Adoramos contribuições da comunidade! Comece lendo nosso [CONTRIBUTING.md](CON --- -## Contribuidores - -Obrigado a todos os nossos contribuidores que ajudaram a tornar o Roo Code melhor! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Licença [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/ru/README.md b/locales/ru/README.md index 70f1f8cd903..1a596bc7b5f 100644 --- a/locales/ru/README.md +++ b/locales/ru/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ pnpm install:vsix [-y] [--editor=] --- -## Участники - -Спасибо всем нашим участникам, которые помогли сделать Roo Code лучше! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Лицензия [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/tr/README.md b/locales/tr/README.md index a540061325a..d480560e08e 100644 --- a/locales/tr/README.md +++ b/locales/tr/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Topluluk katkılarını çok seviyoruz! [CONTRIBUTING.md](CONTRIBUTING.md) dosya --- -## Katkıda Bulunanlar - -Roo Code'u daha iyi hale getirmemize yardımcı olan tüm katkıda bulunanlarımıza teşekkür ederiz! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Lisans [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/vi/README.md b/locales/vi/README.md index 3c846d9c965..f9eef31447e 100644 --- a/locales/vi/README.md +++ b/locales/vi/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ Chúng tôi yêu thích những đóng góp của cộng đồng! Bắt đầu b --- -## Những người đóng góp - -Cảm ơn tất cả những người đóng góp đã giúp Roo Code trở nên tốt hơn! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## Giấy phép [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/zh-CN/README.md b/locales/zh-CN/README.md index 5a4f5e77c14..de95ee3a82e 100644 --- a/locales/zh-CN/README.md +++ b/locales/zh-CN/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ pnpm install:vsix [-y] [--editor=] --- -## 贡献者 - -感谢所有帮助改进 Roo Code 的贡献者! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## 许可证 [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/locales/zh-TW/README.md b/locales/zh-TW/README.md index 240d6794c40..dfa65152a13 100644 --- a/locales/zh-TW/README.md +++ b/locales/zh-TW/README.md @@ -35,7 +35,7 @@ - [简体中文](../zh-CN/README.md) - [繁體中文](../zh-TW/README.md) - ... - + --- @@ -167,16 +167,6 @@ pnpm install:vsix [-y] [--editor=] --- -## 貢獻者 - -感謝所有幫助改進 Roo Code 的貢獻者! - - - -[![Contributors](https://contrib.rocks/image?repo=RooCodeInc/roo-code&max=120&columns=12&cacheBust=0000000000)](https://github.com/RooCodeInc/roo-code/graphs/contributors) - - - ## 授權 [Apache 2.0 © 2025 Roo Code, Inc.](../../LICENSE) diff --git a/package.json b/package.json index f7f351d3fc2..badfdef578b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "install:vsix": "pnpm install --frozen-lockfile && pnpm clean && pnpm vsix && node scripts/install-vsix.js", "changeset:version": "cp CHANGELOG.md src/CHANGELOG.md && changeset version && cp -vf src/CHANGELOG.md .", "knip": "knip --include files", - "update-contributors": "node scripts/update-contributors.js", "evals": "dotenvx run -f packages/evals/.env.development packages/evals/.env.local -- docker compose -f packages/evals/docker-compose.yml --profile server --profile runner up --build --scale runner=0", "npm:publish:types": "pnpm --filter @roo-code/types npm:publish" }, diff --git a/scripts/update-contributors.js b/scripts/update-contributors.js deleted file mode 100644 index 6bd4c35f0ca..00000000000 --- a/scripts/update-contributors.js +++ /dev/null @@ -1,384 +0,0 @@ -#!/usr/bin/env node - -/** - * This script fetches contributor data from GitHub and updates the README.md file - * with a contributors section showing avatars and usernames. - * It also updates all localized README files in the locales directory. - */ - -const https = require("https") -const fs = require("fs") -const { promisify } = require("util") -const path = require("path") - -// Promisify filesystem operations -const readFileAsync = promisify(fs.readFile) -const writeFileAsync = promisify(fs.writeFile) - -// GitHub API URL for fetching contributors -const GITHUB_API_URL = "https://api.github.com/repos/RooCodeInc/Roo-Code/contributors?per_page=100" -const README_PATH = path.join(__dirname, "..", "README.md") -const LOCALES_DIR = path.join(__dirname, "..", "locales") - -// Sentinel markers for contributors section -const START_MARKER = "" -const END_MARKER = "" - -// HTTP options for GitHub API request -const options = { - headers: { - "User-Agent": "Roo-Code-Contributors-Script", - }, -} - -// Add GitHub token for authentication if available -if (process.env.GITHUB_TOKEN) { - options.headers.Authorization = `token ${process.env.GITHUB_TOKEN}` - console.log("Using GitHub token from environment variable") -} - -/** - * Parses the GitHub API Link header to extract pagination URLs - * Based on RFC 5988 format for the Link header - * @param {string} header The Link header from GitHub API response - * @returns {Object} Object containing URLs for next, prev, first, last pages (if available) - */ -function parseLinkHeader(header) { - // Return empty object if no header is provided - if (!header || header.trim() === "") return {} - - // Initialize links object - const links = {} - - // Split the header into individual link entries - // Example: ; rel="next", ; rel="last" - const entries = header.split(/,\s*/) - - // Process each link entry - for (const entry of entries) { - // Extract the URL (between < and >) and the parameters (after >) - const segments = entry.split(";") - if (segments.length < 2) continue - - // Extract URL from the first segment, removing < and > - const urlMatch = segments[0].match(/<(.+)>/) - if (!urlMatch) continue - const url = urlMatch[1] - - // Find the rel="value" parameter - let rel = null - for (let i = 1; i < segments.length; i++) { - const relMatch = segments[i].match(/\s*rel\s*=\s*"?([^"]+)"?/) - if (relMatch) { - rel = relMatch[1] - break - } - } - - // Only add to links if both URL and rel were found - if (rel) { - links[rel] = url - } - } - - return links -} - -/** - * Performs an HTTP GET request and returns the response - * @param {string} url The URL to fetch - * @param {Object} options Request options - * @returns {Promise} Response object with status, headers and body - */ -function httpGet(url, options) { - return new Promise((resolve, reject) => { - https - .get(url, options, (res) => { - let data = "" - res.on("data", (chunk) => { - data += chunk - }) - - res.on("end", () => { - resolve({ - statusCode: res.statusCode, - headers: res.headers, - body: data, - }) - }) - }) - .on("error", (error) => { - reject(error) - }) - }) -} - -/** - * Fetches a single page of contributors from GitHub API - * @param {string} url The API URL to fetch - * @returns {Promise} Object containing contributors and pagination links - */ -async function fetchContributorsPage(url) { - try { - // Make the HTTP request - const response = await httpGet(url, options) - - // Check for successful response - if (response.statusCode !== 200) { - throw new Error(`GitHub API request failed with status code: ${response.statusCode}`) - } - - // Parse the Link header for pagination - const linkHeader = response.headers.link - const links = parseLinkHeader(linkHeader) - - // Parse the JSON response - const contributors = JSON.parse(response.body) - - return { contributors, links } - } catch (error) { - throw new Error(`Failed to fetch contributors page: ${error.message}`) - } -} - -/** - * Fetches all contributors data from GitHub API (handling pagination) - * @returns {Promise} Array of all contributor objects - */ -async function fetchContributors() { - let allContributors = [] - let currentUrl = GITHUB_API_URL - let pageCount = 1 - - // Loop through all pages of contributors - while (currentUrl) { - console.log(`Fetching contributors page ${pageCount}...`) - const { contributors, links } = await fetchContributorsPage(currentUrl) - - allContributors = allContributors.concat(contributors) - - // Move to the next page if it exists - currentUrl = links.next - pageCount++ - } - - console.log(`Fetched ${allContributors.length} contributors from ${pageCount - 1} pages`) - return allContributors -} - -/** - * Reads the README.md file - * @returns {Promise} README content - */ -async function readReadme() { - try { - return await readFileAsync(README_PATH, "utf8") - } catch (err) { - throw new Error(`Failed to read README.md: ${err.message}`) - } -} - -/** - * Creates HTML for the contributors section - * @param {Array} contributors Array of contributor objects from GitHub API - * @returns {string} HTML for contributors section - */ -const EXCLUDED_LOGIN_SUBSTRINGS = ['[bot]', 'R00-B0T']; -const EXCLUDED_LOGIN_EXACTS = ['cursor', 'roomote']; - -function formatContributorsSection(contributors) { - // Filter out GitHub Actions bot, cursor, and roomote - const filteredContributors = contributors.filter((c) => - !EXCLUDED_LOGIN_SUBSTRINGS.some(sub => c.login.includes(sub)) && - !EXCLUDED_LOGIN_EXACTS.includes(c.login) - ) - - // Start building with Markdown table format - let markdown = `${START_MARKER} -` - // Number of columns in the table - const COLUMNS = 6 - - // Create contributor cell HTML - const createCell = (contributor) => { - return `${contributor.login}
${contributor.login}
` - } - - if (filteredContributors.length > 0) { - // Table header is the first row of contributors - const headerCells = filteredContributors.slice(0, COLUMNS).map(createCell) - - // Fill any empty cells in header row - while (headerCells.length < COLUMNS) { - headerCells.push(" ") - } - - // Add header row - markdown += `|${headerCells.join("|")}|\n` - - // Add alignment row - markdown += "|" - for (let i = 0; i < COLUMNS; i++) { - markdown += ":---:|" - } - markdown += "\n" - - // Add remaining contributor rows starting with the second batch - for (let i = COLUMNS; i < filteredContributors.length; i += COLUMNS) { - const rowContributors = filteredContributors.slice(i, i + COLUMNS) - - // Create cells for each contributor in this row - const cells = rowContributors.map(createCell) - - // Fill any empty cells to maintain table structure - while (cells.length < COLUMNS) { - cells.push(" ") - } - - // Add row to the table - markdown += `|${cells.join("|")}|\n` - } - } - - markdown += `${END_MARKER}` - return markdown -} - -/** - * Updates the README.md file with contributors section - * @param {string} readmeContent Original README content - * @param {string} contributorsSection HTML for contributors section - * @returns {Promise} - */ -async function updateReadme(readmeContent, contributorsSection) { - // Find existing contributors section markers - const startPos = readmeContent.indexOf(START_MARKER) - const endPos = readmeContent.indexOf(END_MARKER) - - if (startPos === -1 || endPos === -1) { - console.warn("Warning: Could not find contributors section markers in README.md") - console.warn("Skipping update - please add markers to enable automatic updates.") - return - } - - // Replace existing section, trimming whitespace at section boundaries - const beforeSection = readmeContent.substring(0, startPos).trimEnd() - const afterSection = readmeContent.substring(endPos + END_MARKER.length).trimStart() - // Ensure single newline separators between sections - const updatedContent = beforeSection + "\n\n" + contributorsSection.trim() + "\n\n" + afterSection - - await writeReadme(updatedContent) -} - -/** - * Writes updated content to README.md - * @param {string} content Updated README content - * @returns {Promise} - */ -async function writeReadme(content) { - try { - await writeFileAsync(README_PATH, content, "utf8") - } catch (err) { - throw new Error(`Failed to write updated README.md: ${err.message}`) - } -} -/** - * Finds all localized README files in the locales directory - * @returns {Promise} Array of README file paths - */ -async function findLocalizedReadmes() { - const readmeFiles = [] - - // Check if locales directory exists - if (!fs.existsSync(LOCALES_DIR)) { - // No localized READMEs found - return readmeFiles - } - - // Get all language subdirectories - const languageDirs = fs - .readdirSync(LOCALES_DIR, { withFileTypes: true }) - .filter((dirent) => dirent.isDirectory()) - .map((dirent) => dirent.name) - - // Add all localized READMEs to the list - for (const langDir of languageDirs) { - const readmePath = path.join(LOCALES_DIR, langDir, "README.md") - if (fs.existsSync(readmePath)) { - readmeFiles.push(readmePath) - } - } - - return readmeFiles -} - -/** - * Updates a localized README file with contributors section - * @param {string} filePath Path to the README file - * @param {string} contributorsSection HTML for contributors section - * @returns {Promise} - */ -async function updateLocalizedReadme(filePath, contributorsSection) { - try { - // Read the file content - const readmeContent = await readFileAsync(filePath, "utf8") - - // Find existing contributors section markers - const startPos = readmeContent.indexOf(START_MARKER) - const endPos = readmeContent.indexOf(END_MARKER) - - if (startPos === -1 || endPos === -1) { - console.warn(`Warning: Could not find contributors section markers in ${filePath}`) - console.warn(`Skipping update for ${filePath}`) - return - } - - // Replace existing section, trimming whitespace at section boundaries - const beforeSection = readmeContent.substring(0, startPos).trimEnd() - const afterSection = readmeContent.substring(endPos + END_MARKER.length).trimStart() - // Ensure single newline separators between sections - const updatedContent = beforeSection + "\n\n" + contributorsSection.trim() + "\n\n" + afterSection - - // Write the updated content - await writeFileAsync(filePath, updatedContent, "utf8") - console.log(`Updated ${filePath}`) - } catch (err) { - console.warn(`Warning: Could not update ${filePath}: ${err.message}`) - } -} - -/** - * Main function that orchestrates the update process - */ -async function main() { - try { - // Fetch contributors from GitHub (now handles pagination) - const contributors = await fetchContributors() - console.log(`Total contributors: ${contributors.length}`) - - // Generate contributors section - const contributorsSection = formatContributorsSection(contributors) - - // Update main README - const readmeContent = await readReadme() - await updateReadme(readmeContent, contributorsSection) - console.log(`Updated ${README_PATH}`) - - // Find and update all localized README files - const localizedReadmes = await findLocalizedReadmes() - console.log(`Found ${localizedReadmes.length} localized README files`) - - // Update each localized README - for (const readmePath of localizedReadmes) { - await updateLocalizedReadme(readmePath, contributorsSection) - } - - console.log("Contributors section update complete") - } catch (error) { - console.error(`Error: ${error.message}`) - process.exit(1) - } -} - -// Run the script -main()