git-authors-cli
Advanced tools
Comparing version 1.0.18 to 1.0.19
@@ -16,9 +16,3 @@ #!/usr/bin/env node | ||
const BLACKLIST_KEYWORDS = [ | ||
'ImgBotApp', | ||
'greenkeeper', | ||
'noreply', | ||
'\\bbot\\b', | ||
'Travis CI' | ||
] | ||
const BLACKLIST_KEYWORDS = ['ImgBotApp', 'greenkeeper', 'noreply', '\\bbot\\b', 'Travis CI'] | ||
@@ -31,7 +25,5 @@ const REGEX_BLACKLIST_KEYWORDS = new RegExp(BLACKLIST_KEYWORDS.join('|'), 'i') | ||
const normalizeEmail = email => | ||
email.toLowerCase().replace(REGEX_EMAIL_VARIATIONS, '') | ||
const normalizeEmail = email => email.toLowerCase().replace(REGEX_EMAIL_VARIATIONS, '') | ||
const isSameEmail = (email1 = '', email2 = '') => | ||
normalizeEmail(email1) === normalizeEmail(email2) | ||
const isSameEmail = (email1 = '', email2 = '') => normalizeEmail(email1) === normalizeEmail(email2) | ||
@@ -109,3 +101,3 @@ const processError = err => { | ||
const getContributors = async () => { | ||
if (!await existsFile('.git')) { | ||
if (!(await existsFile('.git'))) { | ||
return processError({ | ||
@@ -119,3 +111,3 @@ message: 'Ops, not git directory detected!' | ||
const cmd = `git shortlog -sne < ${TTY}` | ||
const { stdout, stderr } = await execa.shell(cmd, { cwd }) | ||
const { stdout, stderr } = await execa.command(cmd, { cwd, shell: true }) | ||
@@ -128,5 +120,3 @@ if (stderr) return processError(stderr) | ||
.reduce((acc, contributor) => { | ||
const index = acc.findIndex(({ email }) => | ||
isSameEmail(email, contributor.email) | ||
) | ||
const index = acc.findIndex(({ email }) => isSameEmail(email, contributor.email)) | ||
const isPresent = index !== -1 | ||
@@ -145,13 +135,10 @@ if (!isPresent) return acc.concat(contributor) | ||
.filter(({ author }) => !REGEX_BLACKLIST_KEYWORDS.test(author)) | ||
.filter( | ||
({ email }) => | ||
isString(pkgAuthor) | ||
? !new RegExp(pkgAuthor, 'i').test(email) | ||
: !isSameEmail(pkgAuthor.email, email) | ||
.filter(({ email }) => | ||
isString(pkgAuthor) | ||
? !new RegExp(pkgAuthor, 'i').test(email) | ||
: !isSameEmail(pkgAuthor.email, email) | ||
) | ||
.sort((c1, c2) => c2.commits - c1.commits) | ||
const maxIndent = contributors.length | ||
? getMaxIndent(contributors, 'commits') | ||
: '' | ||
const maxIndent = contributors.length ? getMaxIndent(contributors, 'commits') : '' | ||
@@ -168,5 +155,3 @@ if (contributors.length) { | ||
console.log( | ||
`\n${indent(maxIndent)} ${chalk.gray( | ||
`Added into ${chalk.white('package.json')} ✨` | ||
)}` | ||
`\n${indent(maxIndent)} ${chalk.gray(`Added into ${chalk.white('package.json')} ✨`)}` | ||
) | ||
@@ -173,0 +158,0 @@ } |
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.0.19](https://github.com/Kikobeats/git-authors-cli/compare/v1.0.18...v1.0.19) (2020-01-20) | ||
### Bug Fixes | ||
* **package:** update execa to version 2.0.0 ([bdb9a97](https://github.com/Kikobeats/git-authors-cli/commit/bdb9a972e3469790e1ae25d645e96934d30d77a2)) | ||
### [1.0.18](https://github.com/Kikobeats/git-authors-cli/compare/v1.0.17...v1.0.18) (2019-06-19) | ||
@@ -7,0 +14,0 @@ |
@@ -5,4 +5,5 @@ { | ||
"homepage": "https://nicedoc.io/Kikobeats/git-authors-cli", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"bin": { | ||
"git-authors": "bin/index.js", | ||
"git-authors-cli": "bin/index.js" | ||
@@ -35,7 +36,7 @@ }, | ||
"dependencies": { | ||
"execa": "~1.0.0", | ||
"execa": "~4.0.0", | ||
"exists-file": "~3.0.2", | ||
"json-future": "~2.2.0", | ||
"meow": "~5.0.0", | ||
"update-notifier": "~3.0.0" | ||
"json-future": "~2.2.4", | ||
"meow": "~6.0.0", | ||
"update-notifier": "~4.0.0" | ||
}, | ||
@@ -42,0 +43,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16117
151
+ Added@types/minimist@1.2.5(transitive)
+ Added@types/normalize-package-data@2.4.4(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedboxen@4.2.0(transitive)
+ Addedcamelcase-keys@6.2.2(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconfigstore@5.0.1(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedcrypto-random-string@2.0.0(transitive)
+ Addeddot-prop@5.3.0(transitive)
+ Addedexeca@4.0.3(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedglobal-dirs@2.1.0(transitive)
+ Addedhard-rejection@2.1.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhuman-signals@1.1.1(transitive)
+ Addedindent-string@4.0.0(transitive)
+ Addedini@1.3.7(transitive)
+ Addedis-installed-globally@0.3.2(transitive)
+ Addedis-npm@4.0.0(transitive)
+ Addedis-obj@2.0.0(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedkind-of@6.0.3(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedmap-obj@4.3.0(transitive)
+ Addedmeow@6.0.1(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmin-indent@1.0.1(transitive)
+ Addedminimist-options@4.1.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedquick-lru@4.0.1(transitive)
+ Addedread-pkg@5.2.0(transitive)
+ Addedread-pkg-up@7.0.1(transitive)
+ Addedredent@3.0.0(transitive)
+ Addedsemver-diff@3.1.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedstrip-indent@3.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedterm-size@2.2.1(transitive)
+ Addedtrim-newlines@3.0.1(transitive)
+ Addedtype-fest@0.8.1(transitive)
+ Addedunique-string@2.0.0(transitive)
+ Addedupdate-notifier@4.0.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwidest-line@3.1.0(transitive)
+ Addedxdg-basedir@4.0.0(transitive)
+ Addedyargs-parser@16.1.0(transitive)
- Removedansi-regex@3.0.14.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedboxen@3.2.0(transitive)
- Removedcamelcase@4.1.0(transitive)
- Removedcamelcase-keys@4.2.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedconfigstore@4.0.0(transitive)
- Removedcross-spawn@5.1.06.0.6(transitive)
- Removedcrypto-random-string@1.0.0(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddot-prop@4.2.1(transitive)
- Removedemoji-regex@7.0.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedexeca@0.7.01.0.0(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedget-stream@3.0.0(transitive)
- Removedglobal-dirs@0.1.1(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedindent-string@3.2.0(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@2.0.0(transitive)
- Removedis-installed-globally@0.1.0(transitive)
- Removedis-npm@3.0.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedis-path-inside@1.0.1(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedload-json-file@4.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedmake-dir@1.3.0(transitive)
- Removedmap-obj@2.0.0(transitive)
- Removedmeow@5.0.0(transitive)
- Removedminimist-options@3.0.2(transitive)
- Removednice-try@1.0.5(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-is-inside@1.0.2(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedquick-lru@1.1.0(transitive)
- Removedread-pkg@3.0.0(transitive)
- Removedread-pkg-up@3.0.0(transitive)
- Removedredent@2.0.0(transitive)
- Removedsemver-diff@2.1.0(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedstring-width@2.1.13.1.0(transitive)
- Removedstrip-ansi@4.0.05.2.0(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removedstrip-indent@2.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedterm-size@1.2.0(transitive)
- Removedtrim-newlines@2.0.0(transitive)
- Removedtype-fest@0.3.1(transitive)
- Removedunique-string@1.0.0(transitive)
- Removedupdate-notifier@3.0.1(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwidest-line@2.0.1(transitive)
- Removedwrite-file-atomic@2.4.3(transitive)
- Removedxdg-basedir@3.0.0(transitive)
- Removedyallist@2.1.2(transitive)
- Removedyargs-parser@10.1.0(transitive)
Updatedexeca@~4.0.0
Updatedjson-future@~2.2.4
Updatedmeow@~6.0.0
Updatedupdate-notifier@~4.0.0