remove contributors from package.json in favour of AUTHORS (#1774)

* remove contributors from package.json in favour of AUTHORS

The contributors section of our package.json is _very_ long and
manually updating can (?) be a pain.

I took a leaf out of nodejs's book and copied their update-authors
script [1].

[1]: https://github.com/nodejs/node/blob/master/tools/update-authors.js

* remove some of my many emails

* add a couple more mail mappings

* get lint passing

* add instruction to update-authors

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
This commit is contained in:
Harry Sarson 2020-03-23 18:57:20 +00:00 committed by GitHub
parent 1dbae6e755
commit 08feb7fc79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 274 additions and 99 deletions

28
.mailmap Normal file
View File

@ -0,0 +1,28 @@
Bartosz Leoniak <leoniak.bartosz@gmail.com>
Benjamin Lucas <bnlcas@gmail.com>
Eric Mansfield <ericman314@gmail.com>
Finn Pauls <derfinn@gmail.com>
Gary Passero <gary.passero@rolemodelsoftware.com>
Harsh Gupta <w327AJUdMV2yGVq5dkNX>
Karl Lew <karl@firepick.org>
Horatiu Lazu <horatiulazu@gmail.com>
Michael M. <mm151@og4-pool-23.ub.privat>
Oleg <koshelnikov@gmail.com>
Pat Grasso <pgrasso@stevens.edu>
Saket Saurabh <contact@saketsaurabh.me>
Sathish Kumar Subramani <kartheeswarison3@gmail.com>
Slava Ganzin <slava.ganzin@gmail.com>
Stu Blair <elstoo@gmail.com>
Harry Sarson <harry.sarson@hotmail.co.uk> H.D. Sarson <hds28@cam.ac.uk>
<harry.sarson@hotmail.co.uk> <harry@home.home>
<harry.sarson@hotmail.co.uk> <harry.sason@hotmail.co.uk>
<harry.sarson@hotmail.co.uk> <harry.sarson@utterberry.com>
Timothy Lee <tetslee@gmail.com>
Tóth Róbert <nekomajin42@gmail.com>
Todd Morse <todd@morsecodist.io>
<rogelio.javier@baucells.net> <rjbaucells@users.noreply.github.com>
Rogelio J. Baucells <rogelio.javier@baucells.net> rjbaucells <rjbaucells@gmail.com>
<wjosdejong@gmail.com> <jos@almende.org>
<pbuchsbaum@globo.com> <30529574+paulobuchsbaum@users.noreply.github.com>
Paulo Buchsbaum <pbuchsbaum@globo.com>
<devanp92@ufl.edu> <devanp92@users.noreply.github.com>

132
AUTHORS Normal file
View File

@ -0,0 +1,132 @@
# Authors ordered by first contribution.
Jos de Jong <wjosdejong@gmail.com>
Bart Kiers <bkiers@gmail.com>
Bryan Cuccioli <blc72@cornell.edu>
Zak Zibrat <zakzibrat@gmail.com>
Jim Garrison <jim@garrison.cc>
Sebastien Piquemal <sebpiq@gmail.com>
Guillermo Indalecio <guillermobox@gmail.com>
Waldir Pimenta <waldir@email.com>
Elijah Insua <tmpvar@gmail.com>
Marcus André <hello@marcusandre.de>
Daniel Levin <daniellevin2607@gmail.com>
hama_du <dercll1020@gmail.com>
Finn Pauls <derfinn@gmail.com>
Matt Traynham <mrt6467@alum.uncw.edu>
Fabrice Colas <pub@grano-salis.net>
Rogelio J. Baucells <rogelio.javier@baucells.net>
Niels Heisterkamp <niels@ineffable.nl>
Mitchel Kelonye <kelonyemitchel@gmail.com>
Pavel Panchekha <me@pavpanchekha.com>
Owen Versteeg <me@owenversteeg.com>
Andy Pan <andy0130tw@yahoo.com.tw>
Ryan Seys <ryan@ryanseys.com>
Favian Contreras <fnc4@cornell.edu>
Kenan Yildirim <kenan@kenany.me>
Pete Corey <petecorey@gmail.com>
Max Bruckner <max@maxbruckner.de>
Ole Kröger <o.kroeger@wikunia.de>
J. Harshbarger <hypercubed@gmail.com>
James Herdman <james.herdman@gmail.com>
Nick Foti <nfoti01@gmail.com>
Devan Patel <devanp92@ufl.edu>
Kunal Vyas <kv.kunalvyas@gmail.com>
Liam Newman <bitwiseman@gmail.com>
Alex Edgcomb <alex.edgcomb@zyante.com>
Ganga Christopher <ganga.chris@outlook.com>
Ubuntu <ubuntu@ip-172-31-35-162.us-west-2.compute.internal>
Sergey Romanov <xxsmotur@gmail.com>
Eric Mansfield <ericman314@gmail.com>
Veaceslav Grimalschi <grimalschi@yandex.ru>
Holman Gao <holman@golmansax.com>
Robert Eisele <robert@xarg.org>
Tomek Wiszniewski <t.wiszniewski@gmail.com>
Ben Nelson <Ben.Nelson@inin.com>
devdevdata222 <devdevdata222@gmail.com>
David Simons <12e.david@gmail.com>
john marinelli <jonmarinelli@hotmail.com>
paulmasson <paulmasson@comcast.net>
Keunhong Park <kpar@cs.washington.edu>
Brett Jurgens <brett.jurgens@avant.com>
oyvindjam <oyvindjam@gmail.com>
Harsh Gupta <w327AJUdMV2yGVq5dkNX>
Stu Blair <elstoo@gmail.com>
Priidik Vaikla <priidik.vaikla@gmail.com>
Mathias Polligkeit <potoroo@posteo.de>
Horatiu Lazu <horatiulazu@gmail.com>
Thomas Brierley <tomxor@gmail.com>
Ekin Koc <ekin@eknkc.com>
Pat Grasso <pgrasso@stevens.edu>
Adam Butler <adam@lab.io>
Timothy Lee <tetslee@gmail.com>
woylie <woylie@users.noreply.github.com>
Harry Sarson <harry.sarson@hotmail.co.uk>
Sebastian Ruhleder <sebastian.ruhleder@nterra.com>
Maxired (Maxence Dalmais) <github@maxired.fr>
Adam Kelly <adam.guitar12@gmail.com>
Troy Alford <TroyAlford@users.noreply.github.com>
Todd Morse <todd@morsecodist.io>
Dzmitry Litskalau <litmit@gmail.com>
Max Kramer <mckramer@gmail.com>
Slava Ganzin <slava.ganzin@gmail.com>
Gulfaraz Yasin <gulfarazyasin@gmail.com>
Tóth Róbert <nekomajin42@gmail.com>
Victor <viclai@users.noreply.github.com>
viclai <victor1.lai@gmail.com>
PJ Hampton <pjhampton@protonmail.com>
Alexander Beyn <malex@fatelectrons.org>
Vincent Lee <ancienlee@live.com>
Karl Lew <karl@firepick.org>
mocking <mocking@gmail.com>
Michael M. <mm151@og4-pool-23.ub.privat>
Ivan Vergiliev <ivan.vergiliev@gmail.com>
Paulo Buchsbaum <pbuchsbaum@globo.com>
jeffreyshen19 <jshen@andover.edu>
Oleg <koshelnikov@gmail.com>
Joel Hoover <joelahoover@gmail.com>
denisx <github@denisx.ru>
Clément P <yukulele@users.noreply.github.com>
jean-emmanuel <jean-emmanuel.doucet@groolot.net>
pokeball99 <pokeball99@users.noreply.github.com>
Robin Wieruch <wrobin@gmx.net>
Dakota Blair <dakota@tensen.net>
Henrique Ferrolho <ferrolho@users.noreply.github.com>
Jack Schmidt <github@mowsey.org>
Daniel Ruf <daniel@daniel-ruf.de>
Saket Saurabh <contact@saketsaurabh.me>
Gary Passero <gary.passero@rolemodelsoftware.com>
Chris Chudzicki <christopher.chudzicki@gmail.com>
Daniel Kostro <kostro.d@gmail.com>
Ben Weinshel <ben@weinshel.net>
Honeybar <verina_jean@hotmail.com>
Amin Abdul Manaf <afolanyaaminu@gmail.com>
Jason Shin <yong.j.shin@student.uts.edu.au>
Mathias Rasmussen <mathiasvr@gmail.com>
Sathish Kumar Subramani <kartheeswarison3@gmail.com>
dkenul <damon.kenul@gmail.com>
Gold Holk <85619andy@gmail.com>
Benjamin Lucas <bnlcas@gmail.com>
Albert Emil <albert.emil@posteo.co.uk>
Maximilian <mcschempp@gmx.de>
Rian McGuire <rian@rian.id.au>
Jack Mason <42824992+jackcmason@users.noreply.github.com>
SzechuanSage <chris.hadgis@gmail.com>
sam-19 <sampsa.lohi@gmail.com>
Chris Hadgis <SzechuanSage@users.noreply.github.com>
Jackie Han <han.guokai@gmail.com>
Kevin J <qaz111id@gmail.com>
Vlad Levitskiy <swimer96@mail.ru>
Tom MacWright <tmcw@users.noreply.github.com>
0xflotus <0xflotus@gmail.com>
Waseem Yusuf <waseem.yusuf.hossain@gmail.com>
Tanmay <maytan.thegeek@gmail.com>
Clinton Curry <github@clintoncurry.net>
Arthur Guiot <arguiot@gmail.com>
Bartosz Leoniak <leoniak.bartosz@gmail.com>
Veeloxfire <58116051+Veeloxfire@users.noreply.github.com>
Arkajit Mandal <arkajitmandal@gmail.com>
David Bramwell <13053834+dbramwell@users.noreply.github.com>
Cameron Tacklind <cameron@tacklind.com>
# Generated by tools/update-authors.js

View File

@ -16,6 +16,13 @@ Update the date and version number in the file `HISTORY.md`. Verify whether all
changes in the new version are described.
## Update authors
Run:
npm run update-authors
## Build and test
Build the distribution files in folders `dist` and `lib`, and test everything by running:

View File

@ -3,104 +3,6 @@
"version": "6.6.1",
"description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.",
"author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
"contributors": [
"Adam Kelly (https://github.com/adamisntdead)",
"Albert Emil (https://github.com/AlbertEmil)",
"Alexander Beyn (https://github.com/AlexanderBeyn)",
"Andy Pan (https://github.com/andy0130tw)",
"Arkajit Mandal (https://github.com/arkajitmandal)",
"Arthur Guiot (https://github.com/arguiot)",
"Bart Kiers (https://github.com/bkiers)",
"Bartosz Leoniak (https://github.com/kmdrGroch)",
"Ben Weinshel (https://github.com/weinshel)",
"Benjamin Lucas (https://github.com/bnlcas)",
"Brett Jurgens (https://github.com/brettjurgens)",
"Bryan Cuccioli (https://github.com/bcuccioli)",
"Cameron Tacklind (https://github.com/cinderblock)",
"Chris Chudzicki (https://github.com/ChristopherChudzicki)",
"Chris Hadgis (https://github.com/SzechuanSage)",
"Clinton Curry (https://github.com/clintonc)",
"Dakota Blair (https://github.com/dakotablair)",
"David Bramwell (https://github.com/dbramwell)",
"Daniel Kostro (https://github.com/stropitek)",
"Daniel Levin (https://github.com/daniel-levin)",
"David Simons (https://github.com/SwamWithTurtles)",
"denisx (https://github.com/denisx)",
"dkenul (https://github.com/dkenul)",
"Devan Patel (https://github.com/devanp92)",
"devdevdata222 (https://github.com/devdevdata222)",
"Dzmitry Litskalau (https://github.com/litmit)",
"Ekin Koc (https://github.com/eknkc)",
"Elijah Insua (https://github.com/tmpvar)",
"Eric Mansfield (https://github.com/ericman314)",
"Fabrice Colas (https://github.com/fabricecolas)",
"Favian Contreras (https://github.com/BigFav)",
"Finn Pauls (https://github.com/finnp)",
"Ganga Christopher (https://github.com/gangachris)",
"Gary Passero (https://github.com/gap777)",
"Gold Holk (https://github.com/GHolk)",
"Harry Sarson (https://github.com/HarrySarson)",
"Holman Gao (https://github.com/golmansax)",
"Honybar (https://github.com/honeybar)",
"Guillermo Indalecio Fernández (https://github.com/guillermobox)",
"Gulfaraz (https://github.com/gulfaraz)",
"hamadu (https://github.com/hamadu)",
"Harsh Gupta (https://github.com/hgupta9)",
"Henrique Ferrolho (https://github.com/ferrolho)",
"Huseyn Guliyev (https://github.com/husayt)",
"Ivan Vergiliev (IvanVergiliev)",
"jean-emmanuel (https://github.com/jean-emmanuel)",
"Jack Schmidt (https://github.com/jackschmidt)",
"Jackie Han (https://github.com/hanguokai)",
"Jason Shin (https://github.com/JasonShin)",
"Jim Garrison (https://github.com/garrison)",
"Joel Hoover (https://github.com/joelhoover)",
"Karl Lew (https://github.com/firepick1)",
"Kenan Yildirim (https://github.com/KenanY)",
"Keunhong Park (https://github.com/void42)",
"Keunhong Park (https://github.com/kevjin)",
"Kevin J (https://github.com/kv-kunalvyas)",
"Marcus Andre (https://github.com/marcusandre)",
"Horatiu Lazu (https://github.com/MathBunny)",
"Mathias Polligkeit (https://github.com/woylie)",
"Mathias Rasmussen (https://github.com/mathiasvr)",
"Max Bruckner (https://github.com/FSMaxB)",
"Maxence Dalmais (https://github.com/maxired)",
"Michael M. (https://github.com/Schnark)",
"Mitchel Kelonye (https://github.com/kelonye)",
"mtraynham (https://github.com/mtraynham)",
"Niels Heisterkamp (https://github.com/nheisterkamp)",
"Oleg (https://github.com/ovk)",
"Owen Versteeg (https://github.com/owenversteeg)",
"Pavel Panchekha (https://github.com/pavpanchekha)",
"Pat Grasso (https://github.com/patgrasso)",
"Paulo Buchsbaum (https://github.com/paulobuchsbaum)",
"Pete Corey (https://github.com/pcorey)",
"PJ Hampton (https://github.com/pjhampton )",
"Retsam (https://github.com/Retsam)",
"Rian McGuire (https://github.com/rianmcguire)",
"Robert Eisele (https://github.com/infusion)",
"Rogelio J. Baucells (https://github.com/rjbaucells)",
"Ryan Seys (https://github.com/ryanseys)",
"Saket Saurabh (https://github.com/ssaket)",
"Sathish Kumar Subramani (https://github.com/Sathish-kumar-Subramani )",
"Sebastien Piquemal (https://github.com/sebpiq)",
"Sebastian Ruhleder (https://github.com/ruhleder)",
"Sergey Romanov (https://github.com/saromanov)",
"Slava Ganzin (https://github.com/slavaGanzin)",
"Stu Blair (https://github.com/stu-blair)",
"Tanmay (https://github.com/maytanthegeek)",
"Thomas Brierley (https://github.com/ThomasBrierley)",
"Timothy Lee (https://github.com/tetslee)",
"Tom MacWright (https://github.com/tmcw)",
"Tóth Róbert (https://github.com/Nekomajin42)",
"Todd Morse (https://github.com/morsecodist)",
"Veeloxfire (https://github.com/Veeloxfire)",
"Vlad Levitskiy (https://github.com/mcvladthegoat)",
"Waldir Pimenta (https://github.com/waldyrious)",
"Waseem Yusuf (https://github.com/waseemyusuf)",
"Zach Zibrat (https://github.com/palimpsests)"
],
"homepage": "https://mathjs.org",
"repository": {
"type": "git",
@ -211,7 +113,8 @@
"test:browserstack": "karma start test/browser-test-config/browserstack-karma.js",
"coverage": "nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests --recursive --require @babel/register && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"",
"prepublishOnly": "npm run test:all && npm run lint",
"prepare": "npm run build"
"prepare": "npm run build",
"update-authors": "node ./tools/update-authors.js"
},
"bin": {
"mathjs": "./bin/cli.js"

105
tools/update-authors.js Normal file
View File

@ -0,0 +1,105 @@
#!/usr/bin/env node
// Attribution:
// This file is based on https://github.com/nodejs/node/blob/master/tools/update-authors.js.
// It is licensed according to https://github.com/nodejs/node/blob/master/LICENSE
// Usage: tools/update-author.js [--dry]
// Passing --dry will redirect output to stdout rather than write to 'AUTHORS'.
'use strict'
const { spawn } = require('child_process')
const path = require('path')
const fs = require('fs')
const readline = require('readline')
class CaseIndifferentMap {
constructor () {
this._map = new Map()
}
get (key) { return this._map.get(key.toLowerCase()) }
set (key, value) { return this._map.set(key.toLowerCase(), value) }
}
const log = spawn(
'git',
// Inspect author name/email and body.
['log', '--reverse', '--format=Author: %aN <%aE>\n%b'], {
stdio: ['inherit', 'pipe', 'inherit']
})
const rl = readline.createInterface({ input: log.stdout })
let output
if (process.argv.includes('--dry')) { output = process.stdout } else { output = fs.createWriteStream('AUTHORS') }
output.write('# Authors ordered by first contribution.\n\n')
const mailmap = new CaseIndifferentMap()
{
const lines = fs.readFileSync(path.resolve(__dirname, '../', '.mailmap'),
{ encoding: 'utf8' }).split('\n')
for (let line of lines) {
line = line.trim()
if (line.startsWith('#') || line === '') continue
// Replaced Name <original@example.com>
const match1 = line.match(/^([^<]+)\s+(<[^>]+>)$/)
if (match1) {
mailmap.set(match1[2], { author: match1[1] })
continue
}
// <replaced@example.com> <original@example.com>
const match2 = line.match(/^<([^>]+)>\s+(<[^>]+>)$/)
if (match2) {
mailmap.set(match2[2], { email: match2[1] })
continue
}
// Replaced Name <replaced@example.com> <original@example.com>
const match3 = line.match(/^([^<]+)\s+(<[^>]+>)\s+(<[^>]+>)$/)
if (match3) {
mailmap.set(match3[3], {
author: match3[1], email: match3[2]
})
continue
}
// Replaced Name <replaced@example.com> Original Name <original@example.com>
const match4 = line.match(/^([^<]+)\s+(<[^>]+>)\s+([^<]+)\s+(<[^>]+>)$/)
if (match4) {
mailmap.set(match4[3] + '\0' + match4[4], {
author: match4[1], email: match4[2]
})
continue
}
console.warn('Unknown .mailmap format:', line)
}
}
const seen = new Set()
// Support regular git author metadata, as well as `Author:` and
// `Co-authored-by:` in the message body. Both have been used in the past
// to indicate multiple authors per commit, with the latter standardized
// by GitHub now.
const authorRe =
/(^Author:|^Co-authored-by:)\s+(?<author>[^<]+)\s+(?<email><[^>]+>)/i
rl.on('line', (line) => {
const match = line.match(authorRe)
if (!match) return
const { author, email } = match.groups
if (seen.has(email) ||
/@chromium\.org/.test(email) ||
/greenkeeper\[bot\]/.test(email) ||
email === '<erik.corry@gmail.com>') {
return
}
seen.add(email)
output.write(`${author} ${email}\n`)
})
rl.on('close', () => {
output.end('\n# Generated by tools/update-authors.js\n')
})