diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..c05798b96 --- /dev/null +++ b/.mailmap @@ -0,0 +1,28 @@ +Bartosz Leoniak +Benjamin Lucas +Eric Mansfield +Finn Pauls +Gary Passero +Harsh Gupta +Karl Lew +Horatiu Lazu +Michael M. +Oleg +Pat Grasso +Saket Saurabh +Sathish Kumar Subramani +Slava Ganzin +Stu Blair +Harry Sarson H.D. Sarson + + + +Timothy Lee +Tóth Róbert +Todd Morse + +Rogelio J. Baucells rjbaucells + + <30529574+paulobuchsbaum@users.noreply.github.com> +Paulo Buchsbaum + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..14cdcf78b --- /dev/null +++ b/AUTHORS @@ -0,0 +1,132 @@ +# Authors ordered by first contribution. + +Jos de Jong +Bart Kiers +Bryan Cuccioli +Zak Zibrat +Jim Garrison +Sebastien Piquemal +Guillermo Indalecio +Waldir Pimenta +Elijah Insua +Marcus André +Daniel Levin +hama_du +Finn Pauls +Matt Traynham +Fabrice Colas +Rogelio J. Baucells +Niels Heisterkamp +Mitchel Kelonye +Pavel Panchekha +Owen Versteeg +Andy Pan +Ryan Seys +Favian Contreras +Kenan Yildirim +Pete Corey +Max Bruckner +Ole Kröger +J. Harshbarger +James Herdman +Nick Foti +Devan Patel +Kunal Vyas +Liam Newman +Alex Edgcomb +Ganga Christopher +Ubuntu +Sergey Romanov +Eric Mansfield +Veaceslav Grimalschi +Holman Gao +Robert Eisele +Tomek Wiszniewski +Ben Nelson +devdevdata222 +David Simons <12e.david@gmail.com> +john marinelli +paulmasson +Keunhong Park +Brett Jurgens +oyvindjam +Harsh Gupta +Stu Blair +Priidik Vaikla +Mathias Polligkeit +Horatiu Lazu +Thomas Brierley +Ekin Koc +Pat Grasso +Adam Butler +Timothy Lee +woylie +Harry Sarson +Sebastian Ruhleder +Maxired (Maxence Dalmais) +Adam Kelly +Troy Alford +Todd Morse +Dzmitry Litskalau +Max Kramer +Slava Ganzin +Gulfaraz Yasin +Tóth Róbert +Victor +viclai +PJ Hampton +Alexander Beyn +Vincent Lee +Karl Lew +mocking +Michael M. +Ivan Vergiliev +Paulo Buchsbaum +jeffreyshen19 +Oleg +Joel Hoover +denisx +Clément P +jean-emmanuel +pokeball99 +Robin Wieruch +Dakota Blair +Henrique Ferrolho +Jack Schmidt +Daniel Ruf +Saket Saurabh +Gary Passero +Chris Chudzicki +Daniel Kostro +Ben Weinshel +Honeybar +Amin Abdul Manaf +Jason Shin +Mathias Rasmussen +Sathish Kumar Subramani +dkenul +Gold Holk <85619andy@gmail.com> +Benjamin Lucas +Albert Emil +Maximilian +Rian McGuire +Jack Mason <42824992+jackcmason@users.noreply.github.com> +SzechuanSage +sam-19 +Chris Hadgis +Jackie Han +Kevin J +Vlad Levitskiy +Tom MacWright +0xflotus <0xflotus@gmail.com> +Waseem Yusuf +Tanmay +Clinton Curry +Arthur Guiot +Bartosz Leoniak +Veeloxfire <58116051+Veeloxfire@users.noreply.github.com> +Arkajit Mandal +David Bramwell <13053834+dbramwell@users.noreply.github.com> +Cameron Tacklind + +# Generated by tools/update-authors.js diff --git a/misc/how_to_publish.md b/misc/how_to_publish.md index 048aaaa3a..050a1f86c 100644 --- a/misc/how_to_publish.md +++ b/misc/how_to_publish.md @@ -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: diff --git a/package.json b/package.json index 8b724901c..d1c9e1973 100644 --- a/package.json +++ b/package.json @@ -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 (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" diff --git a/tools/update-authors.js b/tools/update-authors.js new file mode 100644 index 000000000..17dac727c --- /dev/null +++ b/tools/update-authors.js @@ -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 + const match1 = line.match(/^([^<]+)\s+(<[^>]+>)$/) + if (match1) { + mailmap.set(match1[2], { author: match1[1] }) + continue + } + // + const match2 = line.match(/^<([^>]+)>\s+(<[^>]+>)$/) + if (match2) { + mailmap.set(match2[2], { email: match2[1] }) + continue + } + // Replaced Name + const match3 = line.match(/^([^<]+)\s+(<[^>]+>)\s+(<[^>]+>)$/) + if (match3) { + mailmap.set(match3[3], { + author: match3[1], email: match3[2] + }) + continue + } + // Replaced Name Original Name + 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+(?[^<]+)\s+(?<[^>]+>)/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 === '') { + return + } + + seen.add(email) + output.write(`${author} ${email}\n`) +}) + +rl.on('close', () => { + output.end('\n# Generated by tools/update-authors.js\n') +})