From a83b2aee6b4dcc55f855d156076a2b2b4458f1dd Mon Sep 17 00:00:00 2001 From: Bashamega Date: Wed, 16 Apr 2025 07:11:52 +0200 Subject: [PATCH 1/3] feat: add contributors script and update package.json --- .mailMap | 118 +++------------ AUTHORS.md | 352 +++++++++++++++++++++++++++++++++++++------- package.json | 3 +- src/contributors.ts | 84 +++++++++++ 4 files changed, 403 insertions(+), 154 deletions(-) create mode 100644 src/contributors.ts diff --git a/.mailMap b/.mailMap index 0722bb9f5..871126ea0 100644 --- a/.mailMap +++ b/.mailMap @@ -1,97 +1,21 @@ -Aaron Holmes Aaron Holmes -Akshar Patel -Ali Sabzevari -Aliaksandr Radzivanovich -BuildTools # Franklin Tse -ChogyDan # Daniel Hollocher -Daniel Rosenwasser Daniel Rosenwasser Daniel Rosenwasser -David Kmenta -E020873 # Nicolas Henry -Elisée Maurer -Emilio García-Pumarino dashaus -Guilherme Oenning -Herrington Darkholme -Ivo Gabe de Wolff -Joey Wilson -Jonathon Smith -Juan Luis Boya García -Kagami Sascha Rosylight -Lucien Greathouse -Martin Vseticka -Mattias Buelens -Michael Bromley -Mohamed Hegazy -Nathan Shively-Sanders -Paul Jolly -Perry Jiang -Peter Burns -Robert Coie -Ryan Cavanaugh -Thomas Loubiou -Tim Perry -Vidar Tonaas Fauske -Viktor Zozulyak -York Yao york yao yaoyao york yao -Yuichi Nukiyama YuichiNukiyama -Zhengbo Li Zhengbo Li zhengbli tinza123 -falsandtru # @falsandtru -rix # Richard Sentino -rohitverma007 # Rohit Verma -Akinmade Bond -alfaslash # Artem Roshko -Andy Hanson -Argelius Andreas -arjunyel # @arjunyel -Christian Silver -cronon # @cronon -Diullei Gomes -Gabriel Pena Calero -Logan Mzz -Luc-Edmond Gaspard -Nico Kemnitz -Stanislav Vasilev -Tuure Savuoja -VincentBel # Vincent Bel - -Adam Hines Adam J. Hines -Alex Eagle -alexlur -Carlos Galarza -Diogo Franco (Kovensky) -Eugene Timokhov -Heejong Ahn -Marco Aurélio Marco Buono -Michael James -Pablo Rodríguez -Pedro Ferreira -Philip Bulley -Sid Raval -Tanguy Krotoff -Tudor Gergely -Wesley Wigham - -Vincent -Simon -t_ -yokomotod - -1000ch # Shogo Sensui -Andrei Volchenko -Benjamin Solum -Cheung Chifung -Ciro k1r0s -Dylan Cutler -Elliott Marquez -Jiří Pudil -John Patterson -Josh Thomas Josh Thomas -Kakeru Ishii -Marius Schulz -Mihal Malostanidis qm3ster # Mihal Malostanidis -muj-beg Muj.Beg Muj.Beg # Muj Beg -Oussama Ben Brahim -Robert Hill Pappa # Robert Hill -Priyantha Lankapura -vvakame # Masahiro Wakame -Yin Zhikai -薛定谔的猫 # Aladdin ADD \ No newline at end of file +Kagami Sascha Rosylight +René +Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> +Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> +Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> +ExE Boss <3889017+ExE-Boss@users.noreply.github.com> +Song Gao <158983297@qq.com> +Orta Therox +Orta Therox +Orta +Daniel Rosenwasser +Daniel Rosenwasser +Niklas Mollenhauer +Ingvar Stepanyan +Steven Dorries +Denis Bozhyk +arjunyel +Muj.Beg +Josh Thomas +Zhengbo Li +Aaron Holmes diff --git a/AUTHORS.md b/AUTHORS.md index e6ad42dfb..a28ec148e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,57 +1,297 @@ -TypeScript library is authored by: +# Authors -* Aaron Holmes -* Akinmade Bond -* Akshar Patel -* Ali Sabzevari -* Aliaksandr Radzivanovich -* Andy Hanson -* Argelius Andreas -* @arjunyel -* Artem Roshko -* Christian Silver -* @cronon -* Daniel Hollocher -* Daniel Rosenwasser -* David Kmenta -* Diullei Gomes -* Elisée Maurer -* Emilio García-Pumarino -* @falsandtru -* Franklin Tse -* Gabriel Pena Calero -* Guilherme Oenning -* Herrington Darkholme -* Ivo Gabe de Wolff -* Joey Wilson -* Jonathon Smith -* Juan Luis Boya García -* Kagami Sascha Rosylight -* Logan Mzz -* Luc-Edmond Gaspard -* Lucien Greathouse -* Martin Vseticka -* Mattias Buelens -* Michael Bromley -* Mohamed Hegazy -* Natalie Coley -* Nathan Shively-Sanders -* Nico Kemnitz -* Nicolas Henry -* Paul Jolly -* Perry Jiang -* Peter Burns -* Richard Sentino -* Robert Coie -* Rohit Verma -* Ryan Cavanaugh -* Stanislav Vasilev -* Thomas Loubiou -* Tim Perry -* Tuure Savuoja -* Vidar Tonaas Fauske -* Viktor Zozulyak -* Vincent Bel -* York Yao -* Yuichi Nukiyama -* Zhengbo Li \ No newline at end of file +- Adam Basha <110662505+Bashamega@users.noreply.github.com> +- Kagami Sascha Rosylight +- Jake Bailey <5341706+jakebailey@users.noreply.github.com> +- Kyohei Sonokawa <70838736+kyohei-23@users.noreply.github.com> +- Shogo Sensui +- the letter L <134443988+turbocrime@users.noreply.github.com> +- Tito +- René +- Tomislav Jovanovic +- Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> +- Kræn Hansen +- Luca Casonato +- idango10 <75563024+idango10@users.noreply.github.com> +- Steven Luscher +- Juan Pablo Rinaldi +- Noel Kim (김민혁) +- lionel-rowe +- Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> +- Lyra Naeseth +- Ron Buckton +- Kenta Moriuchi +- René +- Anders Kaseorg +- Hong Xu +- Theodore Kruczek +- Jirawat Boonkumnerd +- Doma +- fa-sharp <82074176+fa-sharp@users.noreply.github.com> +- Yann Brelière +- Damien Simonin Feugas +- castholm +- ExE Boss <3889017+ExE-Boss@users.noreply.github.com> +- Kyℓe Hensel +- Conor Linehan +- Sam Estep +- Qilin Yang +- Yamato Sasaki +- Tianlan Zhou +- Sten Arthur Laane <21343173+StenAL@users.noreply.github.com> +- Harry Allen <66224939+HarryAllen1@users.noreply.github.com> +- Homyee King +- Michael Rienstra +- Jake Archibald +- Sebastian Krüger <2pi_r2@gmx.de> +- Filip Skokan +- Song Gao <158983297@qq.com> +- Mateusz Burzyński +- susiwen8 +- Huy +- Jakub Wolny +- Lachlan Arthur +- Livia Medeiros <74449973+LiviaMedeiros@users.noreply.github.com> +- Simon Chan <1330321+yume-chan@users.noreply.github.com> +- Orta Therox +- Orta +- joe matune <44626877+joematune@users.noreply.github.com> +- dhaig <1359404+dhaig@users.noreply.github.com> +- Matt Day <4596559+m-day@users.noreply.github.com> +- Alex Macleod +- ExE Boss +- Orta Therox +- Paul Galow +- 华 +- Jan Kühle +- Neo Tan +- Martin Johns +- 滑 <1395348685z@gmail.com> +- Friendseeker <66892505+Friendseeker@users.noreply.github.com> +- Daniel Rosenwasser +- Matas Rastenis +- Oscar Dominguez +- Maye Edwin +- Keith Cirkel +- Your Name +- Tim Hwang +- Sapfir0 +- Yousef Amar +- Marijn Haverbeke +- Noé Lebrun +- Evgeniy Timokhov +- Job +- Elyse Yao +- Randolf C <34705014+jun-sheaf@users.noreply.github.com> +- Daniel Cassidy +- Hancheng Zhou +- Aaron Reisman +- Song Gao +- Tao, Zeyu (Troy) +- Connie Fan +- Ryan Cavanaugh +- Josh Goldberg +- Mattias Buelens +- Colin Jones +- Thomas +- kahirokunn +- hisomura +- Mitchell Wills +- ShuiRuTian <158983297@qq.com> +- Sukant Pal +- taejs +- Song <158983297@qq.com> +- William Furr +- jun-sheaf <34705014+jun-sheaf@users.noreply.github.com> +- Manu MA +- Saúl Ibarra Corretgé +- Orta +- Avi Vahl +- Alex Kozack +- Shareef Ali +- 二手掉包工程师 <1196089730@qq.com> +- Taymon A. Beal +- Orta Therox +- Mathieu Dutour +- Sebastian Silbermann +- Manu Mtz.-Almeida +- Qiyu8 +- Andrii Dieiev +- Masataka Yoshimura +- Martin Blackburn +- Jiří Pudil +- Xiaoru Li +- Matthias Kunnen +- Niklas Mollenhauer +- Micah Zoltu +- Kristóf Poduszló +- BuckAMayzing +- drivron +- Philip Walton +- Vladislav Korbut +- Ingvar Stepanyan +- Ingvar Stepanyan +- Derek Sifford +- Jeffry Angtoni +- Federico Brigante +- Fabiano Brito +- Aoi Irie +- Mischala +- Jonas Amundsen +- mihailik +- Patrick Przystolik +- pp +- Aziz Khambati +- Brian Williams +- SpaceIm <30052553+SpaceIm@users.noreply.github.com> +- Michael Lehenbauer +- Darío Hereñú +- Timo Sand +- Justin Bay +- krk +- FrogTheFrog +- Tim van der Lippe +- Jasper St. Pierre +- Lukas Senionis +- nd-02110114 +- emraa +- lgoenner +- PunKeel +- Andy Hanson +- Brian Birtles +- Blixt +- Mohamed Hegazy +- Abhijeet Prasad +- Eugene Timokhov +- Akihiko Odaki +- Niklas Mollenhauer +- Linus Unnebäck +- James Garbutt <43081j@users.noreply.github.com> +- 43081j <43081j@users.noreply.github.com> +- Alexander T +- mgquan@myseneca.ca +- nrcoley <8762012+nrcoley@users.noreply.github.com> +- Steven Dorries +- Steven Dorries +- Krzysztof Grzybek +- Alexader +- Robert Grindeland +- Michael Kriese +- Kagami Sascha Rosylight +- Luke Dary +- Colton J. Provias +- Huy Nguyen +- rch850 +- Fathy Boundjadj +- Silas Rech +- Denis Bozhyk +- Denis Bozhyk +- Priyantha Lankapura +- Alan Agius +- arjunyel +- Elliott Marquez +- Oussama Ben Brahim +- Daniel Rosenwasser +- Dylan Cutler +- YuichiNukiyama +- k1r0s +- Ciro +- Jiří Pudil +- Vincent +- Robert Hill +- Pappa +- Mihal Malostanidis +- Marius Schulz +- Muj.Beg +- qm3ster +- Yin Zhikai +- falsandtru +- Andrei Volchenko +- Cheung Chifung +- Kakeru Ishii +- Josh Thomas +- Josh Thomas +- 1000ch +- John Patterson +- Benjamin Solum +- Adam J. Hines +- Adam Hines +- Muj.Beg +- muj-beg +- vvakame +- Simon +- Ali Sabzevari +- alexlur +- Heejong Ahn +- Pablo Rodríguez +- ncoley +- Wesley Wigham +- Sid Raval +- Diogo Franco (Kovensky) +- yokomotod +- 薛定谔的猫 +- Yuichi Nukiyama +- Tudor Gergely +- t_ +- Marco Buono +- Marco Aurélio +- Tanguy Krotoff +- VincentBel +- Carlos Galarza +- Michael James +- Pedro Ferreira +- Philip Bulley +- Alex Eagle +- Diullei Gomes +- Logan Mzz +- Nico Kemnitz +- arjunyel +- alfaslash +- Akinmade Bond +- E020873 +- Argelius Andreas +- Tuure Savuoja +- Christian Silver +- Zhengbo Li +- Luc-Edmond Gaspard +- Gabriel Pena Calero +- BuildTools +- zhengbli +- Stanislav Vasilev +- Perry Jiang +- cronon +- Peter Burns +- Guilherme Oenning +- Vidar Tonaas Fauske +- ChogyDan +- Aliaksandr Radzivanovich +- Joey Wilson +- David Kmenta +- Nathan Shively-Sanders +- tinza123 +- Viktor Zozulyak +- york yao +- Robert Coie +- Elisée Maurer +- Ivo Gabe de Wolff +- Juan Luis Boya García +- rohitverma007 +- Paul Jolly +- Aaron Holmes +- Aaron Holmes +- Zhengbo Li +- Michael Bromley +- Tim Perry +- Herrington Darkholme +- yaoyao +- York Yao +- Daniel Rosenwasser +- Martin Vseticka +- Jonathon Smith +- Mattias Buelens +- rix +- Lucien Greathouse +- Akshar Patel +- Thomas Loubiou +- Emilio García-Pumarino +- dashaus \ No newline at end of file diff --git a/package.json b/package.json index 147a27ca1..cb8e45a3c 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "ts-changelog": "node ./deploy/versionChangelog.js", "migrate": "node ./deploy/migrate.js", "version": "npm i && tsc && node ./lib/version.js", - "generate": "npm run build && npm run baseline-accept" + "generate": "npm run build && npm run baseline-accept", + "contributors": "tsc && node ./lib/contributors.js" }, "author": { "name": "Kagami Sascha Rosylight", diff --git a/src/contributors.ts b/src/contributors.ts new file mode 100644 index 000000000..569bd3224 --- /dev/null +++ b/src/contributors.ts @@ -0,0 +1,84 @@ +import { execSync } from "child_process"; +import { writeFileSync } from "fs"; + +type Contributor = { + name: string; + email: string; +}; + +const EXCLUDED_USERS = [ + "TypeScript Bot", + "microsoft-github-policy-service[bot]", + "dependabot[bot]", + "github-actions[bot]", +]; + +function getContributors(): Contributor[] { + const log = execSync(`git log --format="%aN <%aE>"`, { encoding: "utf-8" }); + + const unique = new Map(); + + log.split("\n").forEach((line) => { + const match = line.match(/^(.*?) <(.*?)>$/); + if (match) { + const name = match[1].trim(); + const email = match[2].trim(); + + const shouldExclude = EXCLUDED_USERS.some( + (u) => + name.toLowerCase().includes(u.toLowerCase()) || + email.toLowerCase().includes(u.toLowerCase()), + ); + + if (!shouldExclude && !unique.has(`${name} <${email}>`)) { + unique.set(`${name} <${email}>`, { name, email }); + } + } + }); + + return Array.from(unique.values()); +} + +function generateAuthorsMd(contributors: Contributor[]) { + const content = + "# Authors\n\n" + + contributors.map((c) => `- ${c.name} <${c.email}>`).join("\n"); + + writeFileSync("AUTHORS.md", content, { encoding: "utf-8" }); + console.log("✅ AUTHORS.md generated"); +} + +function generateMailmap(contributors: Contributor[]) { + const emailMap = new Map>(); + + for (const { name, email } of contributors) { + if (!emailMap.has(name)) { + emailMap.set(name, new Set()); + } + emailMap.get(name)!.add(email); + } + + const lines: string[] = []; + + for (const [name, emails] of emailMap.entries()) { + const emailList = Array.from(emails); + if (emailList.length > 1) { + const primary = emailList[0]; + emailList.slice(1).forEach((alias) => { + lines.push(`${name} <${primary}> <${alias}>`); + }); + } + } + + if (lines.length > 0) { + writeFileSync(".mailMap", lines.join("\n") + "\n", { encoding: "utf-8" }); + console.log("✅ .mailMap generated"); + } else { + console.log("ℹ️ No email aliases found, .mailMap not needed"); + } +} + +// Run +const contributors = getContributors(); +generateAuthorsMd(contributors); +generateMailmap(contributors); From 00b6a92f0382ae15a4cabaca43a19f8e8d17a377 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Wed, 16 Apr 2025 07:33:26 +0200 Subject: [PATCH 2/3] feat: add GitHub Actions workflow to generate authors and mailmap on PR merge --- .github/workflows/generate.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/generate.yml diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml new file mode 100644 index 000000000..f60f2888c --- /dev/null +++ b/.github/workflows/generate.yml @@ -0,0 +1,41 @@ +name: Generate Authors and Mailmap on PR Merge + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + generate-authors-mailmap: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Run the script to generate authors file and mailmap + run: | + npm run generate + + - name: Commit and push changes + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + git add AUTHORS.md .mailMap + git commit -m "Generate authors and mailmap" + git push origin HEAD + + - name: Create a pull request + uses: peter-evans/create-pull-request@v4 + with: + title: "Update authors and mailmap" + body: "This PR updates the authors file and mailmap." + base: main + head: "generate-authors-mailmap" From b33f07ea242f26fe2778598a4c6482cd056780a0 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Wed, 16 Apr 2025 07:47:54 +0200 Subject: [PATCH 3/3] chore: remove contributors details --- .github/workflows/generate.yml | 41 ----- .mailMap | 21 --- AUTHORS.md | 297 --------------------------------- package.json | 3 +- src/contributors.ts | 84 ---------- 5 files changed, 1 insertion(+), 445 deletions(-) delete mode 100644 .github/workflows/generate.yml delete mode 100644 .mailMap delete mode 100644 AUTHORS.md delete mode 100644 src/contributors.ts diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml deleted file mode 100644 index f60f2888c..000000000 --- a/.github/workflows/generate.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Generate Authors and Mailmap on PR Merge - -on: - pull_request: - types: - - closed - branches: - - main - -jobs: - generate-authors-mailmap: - runs-on: ubuntu-latest - - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Run the script to generate authors file and mailmap - run: | - npm run generate - - - name: Commit and push changes - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - git add AUTHORS.md .mailMap - git commit -m "Generate authors and mailmap" - git push origin HEAD - - - name: Create a pull request - uses: peter-evans/create-pull-request@v4 - with: - title: "Update authors and mailmap" - body: "This PR updates the authors file and mailmap." - base: main - head: "generate-authors-mailmap" diff --git a/.mailMap b/.mailMap deleted file mode 100644 index 871126ea0..000000000 --- a/.mailMap +++ /dev/null @@ -1,21 +0,0 @@ -Kagami Sascha Rosylight -René -Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> -Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> -Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> -ExE Boss <3889017+ExE-Boss@users.noreply.github.com> -Song Gao <158983297@qq.com> -Orta Therox -Orta Therox -Orta -Daniel Rosenwasser -Daniel Rosenwasser -Niklas Mollenhauer -Ingvar Stepanyan -Steven Dorries -Denis Bozhyk -arjunyel -Muj.Beg -Josh Thomas -Zhengbo Li -Aaron Holmes diff --git a/AUTHORS.md b/AUTHORS.md deleted file mode 100644 index a28ec148e..000000000 --- a/AUTHORS.md +++ /dev/null @@ -1,297 +0,0 @@ -# Authors - -- Adam Basha <110662505+Bashamega@users.noreply.github.com> -- Kagami Sascha Rosylight -- Jake Bailey <5341706+jakebailey@users.noreply.github.com> -- Kyohei Sonokawa <70838736+kyohei-23@users.noreply.github.com> -- Shogo Sensui -- the letter L <134443988+turbocrime@users.noreply.github.com> -- Tito -- René -- Tomislav Jovanovic -- Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> -- Kræn Hansen -- Luca Casonato -- idango10 <75563024+idango10@users.noreply.github.com> -- Steven Luscher -- Juan Pablo Rinaldi -- Noel Kim (김민혁) -- lionel-rowe -- Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> -- Lyra Naeseth -- Ron Buckton -- Kenta Moriuchi -- René -- Anders Kaseorg -- Hong Xu -- Theodore Kruczek -- Jirawat Boonkumnerd -- Doma -- fa-sharp <82074176+fa-sharp@users.noreply.github.com> -- Yann Brelière -- Damien Simonin Feugas -- castholm -- ExE Boss <3889017+ExE-Boss@users.noreply.github.com> -- Kyℓe Hensel -- Conor Linehan -- Sam Estep -- Qilin Yang -- Yamato Sasaki -- Tianlan Zhou -- Sten Arthur Laane <21343173+StenAL@users.noreply.github.com> -- Harry Allen <66224939+HarryAllen1@users.noreply.github.com> -- Homyee King -- Michael Rienstra -- Jake Archibald -- Sebastian Krüger <2pi_r2@gmx.de> -- Filip Skokan -- Song Gao <158983297@qq.com> -- Mateusz Burzyński -- susiwen8 -- Huy -- Jakub Wolny -- Lachlan Arthur -- Livia Medeiros <74449973+LiviaMedeiros@users.noreply.github.com> -- Simon Chan <1330321+yume-chan@users.noreply.github.com> -- Orta Therox -- Orta -- joe matune <44626877+joematune@users.noreply.github.com> -- dhaig <1359404+dhaig@users.noreply.github.com> -- Matt Day <4596559+m-day@users.noreply.github.com> -- Alex Macleod -- ExE Boss -- Orta Therox -- Paul Galow -- 华 -- Jan Kühle -- Neo Tan -- Martin Johns -- 滑 <1395348685z@gmail.com> -- Friendseeker <66892505+Friendseeker@users.noreply.github.com> -- Daniel Rosenwasser -- Matas Rastenis -- Oscar Dominguez -- Maye Edwin -- Keith Cirkel -- Your Name -- Tim Hwang -- Sapfir0 -- Yousef Amar -- Marijn Haverbeke -- Noé Lebrun -- Evgeniy Timokhov -- Job -- Elyse Yao -- Randolf C <34705014+jun-sheaf@users.noreply.github.com> -- Daniel Cassidy -- Hancheng Zhou -- Aaron Reisman -- Song Gao -- Tao, Zeyu (Troy) -- Connie Fan -- Ryan Cavanaugh -- Josh Goldberg -- Mattias Buelens -- Colin Jones -- Thomas -- kahirokunn -- hisomura -- Mitchell Wills -- ShuiRuTian <158983297@qq.com> -- Sukant Pal -- taejs -- Song <158983297@qq.com> -- William Furr -- jun-sheaf <34705014+jun-sheaf@users.noreply.github.com> -- Manu MA -- Saúl Ibarra Corretgé -- Orta -- Avi Vahl -- Alex Kozack -- Shareef Ali -- 二手掉包工程师 <1196089730@qq.com> -- Taymon A. Beal -- Orta Therox -- Mathieu Dutour -- Sebastian Silbermann -- Manu Mtz.-Almeida -- Qiyu8 -- Andrii Dieiev -- Masataka Yoshimura -- Martin Blackburn -- Jiří Pudil -- Xiaoru Li -- Matthias Kunnen -- Niklas Mollenhauer -- Micah Zoltu -- Kristóf Poduszló -- BuckAMayzing -- drivron -- Philip Walton -- Vladislav Korbut -- Ingvar Stepanyan -- Ingvar Stepanyan -- Derek Sifford -- Jeffry Angtoni -- Federico Brigante -- Fabiano Brito -- Aoi Irie -- Mischala -- Jonas Amundsen -- mihailik -- Patrick Przystolik -- pp -- Aziz Khambati -- Brian Williams -- SpaceIm <30052553+SpaceIm@users.noreply.github.com> -- Michael Lehenbauer -- Darío Hereñú -- Timo Sand -- Justin Bay -- krk -- FrogTheFrog -- Tim van der Lippe -- Jasper St. Pierre -- Lukas Senionis -- nd-02110114 -- emraa -- lgoenner -- PunKeel -- Andy Hanson -- Brian Birtles -- Blixt -- Mohamed Hegazy -- Abhijeet Prasad -- Eugene Timokhov -- Akihiko Odaki -- Niklas Mollenhauer -- Linus Unnebäck -- James Garbutt <43081j@users.noreply.github.com> -- 43081j <43081j@users.noreply.github.com> -- Alexander T -- mgquan@myseneca.ca -- nrcoley <8762012+nrcoley@users.noreply.github.com> -- Steven Dorries -- Steven Dorries -- Krzysztof Grzybek -- Alexader -- Robert Grindeland -- Michael Kriese -- Kagami Sascha Rosylight -- Luke Dary -- Colton J. Provias -- Huy Nguyen -- rch850 -- Fathy Boundjadj -- Silas Rech -- Denis Bozhyk -- Denis Bozhyk -- Priyantha Lankapura -- Alan Agius -- arjunyel -- Elliott Marquez -- Oussama Ben Brahim -- Daniel Rosenwasser -- Dylan Cutler -- YuichiNukiyama -- k1r0s -- Ciro -- Jiří Pudil -- Vincent -- Robert Hill -- Pappa -- Mihal Malostanidis -- Marius Schulz -- Muj.Beg -- qm3ster -- Yin Zhikai -- falsandtru -- Andrei Volchenko -- Cheung Chifung -- Kakeru Ishii -- Josh Thomas -- Josh Thomas -- 1000ch -- John Patterson -- Benjamin Solum -- Adam J. Hines -- Adam Hines -- Muj.Beg -- muj-beg -- vvakame -- Simon -- Ali Sabzevari -- alexlur -- Heejong Ahn -- Pablo Rodríguez -- ncoley -- Wesley Wigham -- Sid Raval -- Diogo Franco (Kovensky) -- yokomotod -- 薛定谔的猫 -- Yuichi Nukiyama -- Tudor Gergely -- t_ -- Marco Buono -- Marco Aurélio -- Tanguy Krotoff -- VincentBel -- Carlos Galarza -- Michael James -- Pedro Ferreira -- Philip Bulley -- Alex Eagle -- Diullei Gomes -- Logan Mzz -- Nico Kemnitz -- arjunyel -- alfaslash -- Akinmade Bond -- E020873 -- Argelius Andreas -- Tuure Savuoja -- Christian Silver -- Zhengbo Li -- Luc-Edmond Gaspard -- Gabriel Pena Calero -- BuildTools -- zhengbli -- Stanislav Vasilev -- Perry Jiang -- cronon -- Peter Burns -- Guilherme Oenning -- Vidar Tonaas Fauske -- ChogyDan -- Aliaksandr Radzivanovich -- Joey Wilson -- David Kmenta -- Nathan Shively-Sanders -- tinza123 -- Viktor Zozulyak -- york yao -- Robert Coie -- Elisée Maurer -- Ivo Gabe de Wolff -- Juan Luis Boya García -- rohitverma007 -- Paul Jolly -- Aaron Holmes -- Aaron Holmes -- Zhengbo Li -- Michael Bromley -- Tim Perry -- Herrington Darkholme -- yaoyao -- York Yao -- Daniel Rosenwasser -- Martin Vseticka -- Jonathon Smith -- Mattias Buelens -- rix -- Lucien Greathouse -- Akshar Patel -- Thomas Loubiou -- Emilio García-Pumarino -- dashaus \ No newline at end of file diff --git a/package.json b/package.json index cb8e45a3c..147a27ca1 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "ts-changelog": "node ./deploy/versionChangelog.js", "migrate": "node ./deploy/migrate.js", "version": "npm i && tsc && node ./lib/version.js", - "generate": "npm run build && npm run baseline-accept", - "contributors": "tsc && node ./lib/contributors.js" + "generate": "npm run build && npm run baseline-accept" }, "author": { "name": "Kagami Sascha Rosylight", diff --git a/src/contributors.ts b/src/contributors.ts deleted file mode 100644 index 569bd3224..000000000 --- a/src/contributors.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { execSync } from "child_process"; -import { writeFileSync } from "fs"; - -type Contributor = { - name: string; - email: string; -}; - -const EXCLUDED_USERS = [ - "TypeScript Bot", - "microsoft-github-policy-service[bot]", - "dependabot[bot]", - "github-actions[bot]", -]; - -function getContributors(): Contributor[] { - const log = execSync(`git log --format="%aN <%aE>"`, { encoding: "utf-8" }); - - const unique = new Map(); - - log.split("\n").forEach((line) => { - const match = line.match(/^(.*?) <(.*?)>$/); - if (match) { - const name = match[1].trim(); - const email = match[2].trim(); - - const shouldExclude = EXCLUDED_USERS.some( - (u) => - name.toLowerCase().includes(u.toLowerCase()) || - email.toLowerCase().includes(u.toLowerCase()), - ); - - if (!shouldExclude && !unique.has(`${name} <${email}>`)) { - unique.set(`${name} <${email}>`, { name, email }); - } - } - }); - - return Array.from(unique.values()); -} - -function generateAuthorsMd(contributors: Contributor[]) { - const content = - "# Authors\n\n" + - contributors.map((c) => `- ${c.name} <${c.email}>`).join("\n"); - - writeFileSync("AUTHORS.md", content, { encoding: "utf-8" }); - console.log("✅ AUTHORS.md generated"); -} - -function generateMailmap(contributors: Contributor[]) { - const emailMap = new Map>(); - - for (const { name, email } of contributors) { - if (!emailMap.has(name)) { - emailMap.set(name, new Set()); - } - emailMap.get(name)!.add(email); - } - - const lines: string[] = []; - - for (const [name, emails] of emailMap.entries()) { - const emailList = Array.from(emails); - if (emailList.length > 1) { - const primary = emailList[0]; - emailList.slice(1).forEach((alias) => { - lines.push(`${name} <${primary}> <${alias}>`); - }); - } - } - - if (lines.length > 0) { - writeFileSync(".mailMap", lines.join("\n") + "\n", { encoding: "utf-8" }); - console.log("✅ .mailMap generated"); - } else { - console.log("ℹ️ No email aliases found, .mailMap not needed"); - } -} - -// Run -const contributors = getContributors(); -generateAuthorsMd(contributors); -generateMailmap(contributors);