diff --git a/CHANGELOG.md b/CHANGELOG.md index db46594bf843ca64dcdc76b7bed428a46cf4017b..cd89cf7cad74969be7523271fcc48200a3e56f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ + +WECHATY CONTRIBUTORS +-------------------- + +### Active Contributors + +1. [lijiarui](https://github.com/lijiarui) [\#816](https://github.com/Chatie/wechaty/pull/816),[\#812](https://github.com/Chatie/wechaty/pull/812),[\#805](https://github.com/Chatie/wechaty/pull/805),[\#798](https://github.com/Chatie/wechaty/pull/798),[\#757](https://github.com/Chatie/wechaty/pull/757),[\#729](https://github.com/Chatie/wechaty/pull/729),[\#725](https://github.com/Chatie/wechaty/pull/725),[\#651](https://github.com/Chatie/wechaty/pull/651),[\#627](https://github.com/Chatie/wechaty/pull/627),[\#619](https://github.com/Chatie/wechaty/pull/619),[\#604](https://github.com/Chatie/wechaty/pull/604),[\#515](https://github.com/Chatie/wechaty/pull/515),[\#490](https://github.com/Chatie/wechaty/pull/490),[\#440](https://github.com/Chatie/wechaty/pull/440),[\#370](https://github.com/Chatie/wechaty/pull/370),[\#364](https://github.com/Chatie/wechaty/pull/364),[\#362](https://github.com/Chatie/wechaty/pull/362),[\#328](https://github.com/Chatie/wechaty/pull/328),[\#324](https://github.com/Chatie/wechaty/pull/324),[\#323](https://github.com/Chatie/wechaty/pull/323),[\#321](https://github.com/Chatie/wechaty/pull/321),[\#318](https://github.com/Chatie/wechaty/pull/318),[\#303](https://github.com/Chatie/wechaty/pull/303),[\#292](https://github.com/Chatie/wechaty/pull/292),[\#275](https://github.com/Chatie/wechaty/pull/275),[\#266](https://github.com/Chatie/wechaty/pull/266),[\#264](https://github.com/Chatie/wechaty/pull/264),[\#249](https://github.com/Chatie/wechaty/pull/249),[\#239](https://github.com/Chatie/wechaty/pull/239),[\#234](https://github.com/Chatie/wechaty/pull/234),[\#211](https://github.com/Chatie/wechaty/pull/211),[\#199](https://github.com/Chatie/wechaty/pull/199),[\#182](https://github.com/Chatie/wechaty/pull/182),[\#162](https://github.com/Chatie/wechaty/pull/162),[\#139](https://github.com/Chatie/wechaty/pull/139),[\#112](https://github.com/Chatie/wechaty/pull/112),[\#110](https://github.com/Chatie/wechaty/pull/110),[\#93](https://github.com/Chatie/wechaty/pull/93),[\#92](https://github.com/Chatie/wechaty/pull/92),[\#91](https://github.com/Chatie/wechaty/pull/91),[\#87](https://github.com/Chatie/wechaty/pull/87),[\#38](https://github.com/Chatie/wechaty/pull/38) +1. [zixia](https://github.com/zixia) [\#841](https://github.com/Chatie/wechaty/pull/841),[\#831](https://github.com/Chatie/wechaty/pull/831),[\#810](https://github.com/Chatie/wechaty/pull/810),[\#644](https://github.com/Chatie/wechaty/pull/644),[\#643](https://github.com/Chatie/wechaty/pull/643),[\#608](https://github.com/Chatie/wechaty/pull/608),[\#569](https://github.com/Chatie/wechaty/pull/569),[\#560](https://github.com/Chatie/wechaty/pull/560),[\#542](https://github.com/Chatie/wechaty/pull/542),[\#496](https://github.com/Chatie/wechaty/pull/496),[\#495](https://github.com/Chatie/wechaty/pull/495),[\#469](https://github.com/Chatie/wechaty/pull/469),[\#462](https://github.com/Chatie/wechaty/pull/462),[\#455](https://github.com/Chatie/wechaty/pull/455),[\#449](https://github.com/Chatie/wechaty/pull/449),[\#396](https://github.com/Chatie/wechaty/pull/396),[\#351](https://github.com/Chatie/wechaty/pull/351),[\#317](https://github.com/Chatie/wechaty/pull/317),[\#316](https://github.com/Chatie/wechaty/pull/316),[\#315](https://github.com/Chatie/wechaty/pull/315),[\#314](https://github.com/Chatie/wechaty/pull/314),[\#313](https://github.com/Chatie/wechaty/pull/313),[\#312](https://github.com/Chatie/wechaty/pull/312),[\#311](https://github.com/Chatie/wechaty/pull/311),[\#168](https://github.com/Chatie/wechaty/pull/168),[\#158](https://github.com/Chatie/wechaty/pull/158),[\#149](https://github.com/Chatie/wechaty/pull/149),[\#146](https://github.com/Chatie/wechaty/pull/146),[\#143](https://github.com/Chatie/wechaty/pull/143),[\#142](https://github.com/Chatie/wechaty/pull/142),[\#141](https://github.com/Chatie/wechaty/pull/141),[\#25](https://github.com/Chatie/wechaty/pull/25) +1. [mukaiu](https://github.com/mukaiu) [\#337](https://github.com/Chatie/wechaty/pull/337),[\#470](https://github.com/Chatie/wechaty/pull/470),[\#438](https://github.com/Chatie/wechaty/pull/438),[\#421](https://github.com/Chatie/wechaty/pull/421),[\#420](https://github.com/Chatie/wechaty/pull/420),[\#415](https://github.com/Chatie/wechaty/pull/415),[\#376](https://github.com/Chatie/wechaty/pull/376) +1. [binsee](https://github.com/binsee) [\#844](https://github.com/Chatie/wechaty/pull/844),[\#811](https://github.com/Chatie/wechaty/pull/811),[\#771](https://github.com/Chatie/wechaty/pull/771),[\#744](https://github.com/Chatie/wechaty/pull/744),[\#727](https://github.com/Chatie/wechaty/pull/727),[\#714](https://github.com/Chatie/wechaty/pull/714) +1. [JasLin](https://github.com/JasLin) [\#404](https://github.com/Chatie/wechaty/pull/404),[\#358](https://github.com/Chatie/wechaty/pull/358),[\#105](https://github.com/Chatie/wechaty/pull/105),[\#100](https://github.com/Chatie/wechaty/pull/100),[\#78](https://github.com/Chatie/wechaty/pull/78),[\#76](https://github.com/Chatie/wechaty/pull/76) +1. [xinbenlv](https://github.com/xinbenlv) [\#388](https://github.com/Chatie/wechaty/pull/388),[\#361](https://github.com/Chatie/wechaty/pull/361),[\#280](https://github.com/Chatie/wechaty/pull/280) + +### Contributors + +1. [hczhcz](https://github.com/hczhcz) [\#684](https://github.com/Chatie/wechaty/pull/684),[\#640](https://github.com/Chatie/wechaty/pull/640) +1. [imerse](https://github.com/imerse) [\#578](https://github.com/Chatie/wechaty/pull/578) +1. [FlyingBlazer](https://github.com/FlyingBlazer) [\#531](https://github.com/Chatie/wechaty/pull/531) +1. [zhenyong](https://github.com/zhenyong) [\#770](https://github.com/Chatie/wechaty/pull/770) +1. [xjchengo](https://github.com/xjchengo) [\#416](https://github.com/Chatie/wechaty/pull/416) +1. [lpmi-13](https://github.com/lpmi-13) [\#681](https://github.com/Chatie/wechaty/pull/681) +1. [TingYinHelen](https://github.com/TingYinHelen) [\#605](https://github.com/Chatie/wechaty/pull/605) +1. [ax4](https://github.com/ax4) [\#380](https://github.com/Chatie/wechaty/pull/380) +1. [Gcaufy](https://github.com/Gcaufy) [\#310](https://github.com/Chatie/wechaty/pull/310) +1. [snyk-bot](https://github.com/snyk-bot) [\#169](https://github.com/Chatie/wechaty/pull/169) +1. [cherry-geqi](https://github.com/cherry-geqi) [\#97](https://github.com/Chatie/wechaty/pull/97) +1. [gitter-badger](https://github.com/gitter-badger) [\#3](https://github.com/Chatie/wechaty/pull/3) + # Change Log ## [v0.9.0](https://github.com/chatie/wechaty/tree/v0.9.0) (2017-10-04) diff --git a/package.json b/package.json index 7facbd44d2fe15687b8ba2cd5c85e70509bd367e..8ffdb12c00fb435ebbc51678825acec95b615479 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dist": "npm run clean && tsc && jq \"del (.files)\" < package.json > dist/package.json && shx cp src/puppet-web/*.js dist/src/puppet-web/", "doc": "npm run dist && echo '# Wechaty v'$(jq -r .version package.json)' Documentation\n' > docs/index.md && jsdoc2md dist/src/{wechaty,room,contact,friend-request,message}.js dist/src/puppet-web/friend-request.js>> docs/index.md", "coverage": "nyc report --reporter=text-lcov | coveralls", - "changelog": "github_changelog_generator -u chatie -p wechaty && sed -i'.bak' /greenkeeper/d CHANGELOG.md", + "changelog": "github_changelog_generator -u chatie -p wechaty && sed -i'.bak' /greenkeeper/d CHANGELOG.md && ts-node script/sort-contributiveness.ts < CHANGELOG.md > CHANGELOG.new.md && cat CHANGELOG.md >> CHANGELOG.new.md && mv CHANGELOG.new.md CHANGELOG.md", "doctor": "npm run check-node-version && ts-node bin/doctor", "clean": "shx rm -fr dist/*", "check-node-version": "check-node-version --node \">= 6.9\"", diff --git a/script/sort-contributiveness.ts b/script/sort-contributiveness.ts new file mode 100755 index 0000000000000000000000000000000000000000..acfe6401146dc70e1a11c28162a294df480b8685 --- /dev/null +++ b/script/sort-contributiveness.ts @@ -0,0 +1,100 @@ +#!/usr/bin/env ts-node + +import * as readline from 'readline' + +const contributeMap = {} + +function parseLine(line: string): string[] | null { + // [\#264](https://github.com/Chatie/wechaty/pull/264) ([lijiarui](https://github.com/lijiarui)) + // const regex = /(\[\\#\d+\]\([^\)]+\))\s+(\(\[[^]]+\]\([^)]+\)))/i + const regex = /(\[\\#\d+\])(\([^\)]+\))\s+\((\[[^\]]+\]\([^\)]+\))/ + const matches = regex.exec(line) + if (!matches) { + return null + } + // console.log('match!') + // console.log(matches[1]) // [\#264] + // console.log(matches[2]) // (https://github.com/Chatie/wechaty/pull/264) + // console.log(matches[3]) // ([lijiarui](https://github.com/lijiarui) + return matches +} + +function processLine(line: string): void { + const matches = parseLine(line) + if (matches) { + // console.log('match:', line) + // console.log(matches) + const link = matches[1] + matches[2] + const contributor = matches[3] + // console.log('link:', link) + // console.log('contributor:', contributor) + if (!(contributor in contributeMap)) { + contributeMap[contributor] = [] + } + contributeMap[contributor].push(link) + // console.log(contributiveness) + } else { + console.error('NO match:', line) + } +} + +function outputContributorMd() { + const MIN_MAINTAINER_COMMIT_NUM = 3 + function isMaintainer(committer: string): boolean { + return contributeMap[committer].length >= MIN_MAINTAINER_COMMIT_NUM + } + + const activeContributorList = Object.keys(contributeMap) + .filter(isMaintainer) + .sort(desc) + + function desc(committerA: string, committerB: string): number { + return contributeMap[committerB].length - contributeMap[committerA].length + } + + console.log([ + '', + 'WECHATY CONTRIBUTORS', + '--------------------', + '', + '### Active Contributors', + '', + ].join('\n')) + + for (const committer of activeContributorList) { + console.log('1.', committer, contributeMap[committer].join(',')) + } + + console.log([ + '', + '### Contributors', + '', + ].join('\n')) + + for (const contributor of Object.keys(contributeMap).sort(desc)) { + if (!activeContributorList.includes(contributor)) { + console.log('1.', contributor, contributeMap[contributor].join(',')) + } + } + console.log() + +} + +async function main() { + // https://stackoverflow.com/a/20087094/1123955 + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false, + }); + + rl.on('line', processLine) + await new Promise(r => rl.on('close', r)) + + outputContributorMd() + + return 0 +} + +main() +.then(process.exit) diff --git a/tsconfig.json b/tsconfig.json index 5d0c324f89856b9d86918289490d3fde53728e02..0bac76db793f76237970a1fb193c46714d52608e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,9 @@ , "noUnusedParameters": false , "noImplicitThis": false , "traceResolution": false + , "lib": [ + "es2016" + ] } , "exclude": [ "node_modules/" @@ -24,6 +27,7 @@ ] , "include": [ "bin/*.ts" + , "script/**/*.ts" , "example/**/*.ts" , "src/**/*.ts" , "test/**/*.spec.ts"