Browse Source

chore: add genetate authors and update authors (#27060)

* chore: update authors

* Update AUTHORS.txt

* add generate-authors.js

Co-authored-by: xrk <xrkffgg@gmail.com>
pull/27062/head
Tom Xu 4 years ago
committed by GitHub
parent
commit
60e35181fc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 462
      AUTHORS.txt
  2. 2
      package.json
  3. 36
      scripts/generate-authors.js

462
AUTHORS.txt

File diff suppressed because it is too large

2
package.json

@ -47,7 +47,7 @@
"typings": "lib/index.d.ts",
"scripts": {
"api-collection": "antd-tools run api-collection",
"authors": "git log --format='%aN <%aE>' | sort -u | grep -v 'users.noreply.github.com' | grep -v 'gitter.im' | grep -v '.local>' | grep -v 'alibaba-inc.com' | grep -v 'alipay.com' | grep -v 'taobao.com' > AUTHORS.txt",
"authors": "node ./scripts/generate-authors",
"build": "npm run compile && NODE_OPTIONS='--max-old-space-size=4096' npm run dist",
"bundlesize": "bundlesize",
"check-commit": "node ./scripts/check-commit",

36
scripts/generate-authors.js

@ -0,0 +1,36 @@
const path = require('path');
const fs = require('fs');
const simpleGit = require('simple-git/promise');
const _ = require('lodash');
const cwd = process.cwd();
const git = simpleGit(cwd);
const excludes = [
'users.noreply.github.com',
'gitter.im',
'.local',
'alibaba-inc.com',
'alipay.com',
'taobao.com',
];
async function execute() {
let logs = (await git.log()).all;
logs = _.remove(logs, ({ author_email: email }) => {
for (let i = 0; i < excludes.length; i++) {
const item = excludes[i];
if (email.indexOf(item) !== -1) {
return false;
}
}
return true;
});
logs = _.sortBy(_.unionBy(logs, 'author_email'), 'author_name');
fs.writeFileSync(
path.join(cwd, 'AUTHORS.txt'),
logs.map(item => `${item.author_name} <${item.author_email}>`).join('\n'),
);
}
execute();
Loading…
Cancel
Save