feross / thanks

πŸ™Œ Give thanks to the open source maintainers you depend on! ✨
2.76k stars 113 forks source link

Distinguishing maintainers of direct vs transitive dependencies #149

Closed zeke closed 5 years ago

zeke commented 5 years ago

I'm looking at the output of thanks and trying to decide how to allocate monetary donations to the individuals, teams, and organizations on the list:

Author                Where to Donate                                                    Dependencies
sindresorhus          patreon.com/sindresorhus                                           del, supports-color, strip-ansi, ansi-regex, camelcase, chalk + 137 more
hzoo                  patreon.com/henryzhu                                               @babel/core, @babel/preset-env, @babel/types, @babel/parser + 64 more
feross                patreon.com/feross                                                 browserify, standard, resolve, safe-buffer, is-buffer, util, buffer + 29 more
thlorenz              patreon.com/thlorenz                                               browserify, resolve, util, convert-source-map, readdirp, deep-is + 21 more
hughsk                hughsk.io/donate                                                   browserify, flat, resolve, util, component-emitter, is-typedarray + 20 more
yoshuawuyts           patreon.com/yoshuawuyts                                            browserify, standard, resolve, util, path-browserify, vm-browserify + 17 more
balupton              balupton.com/donate                                                browserify, resolve, util, path-browserify, vm-browserify, assert + 16 more
lukechilds            blockchair.com/bitcoin/address/1LukeQU5jwebXbMLDVydeH4vFSobRV9rkj  browserify, resolve, util, assert, module-deps, stream-splicer + 2 more
zeke                  zeke.sikelianos.com/donations                                      browser-date-formatter, check-for-leaks, count-array-values, hubdown + 4 more
juliangruber          patreon.com/juliangruber                                           isarray, balanced-match, component-emitter, brace-expansion + 3 more
gr2m                  railsgirlssummerofcode.org/campaign                                @octokit/rest, before-after-hook, universal-user-agent + 4 more
nzakas                paypal.me/nczonline                                                globals, doctrine, eslint-scope, estraverse, eslint, espree + 1 more
marijn                patreon.com/marijn                                                 acorn, acorn-walk
typicode              patreon.com/typicode                                               husky, please-upgrade-node
shellscape            patreon.com/shellscape                                             csv-parser
bevryme               bevry.me/donate                                                    domain-browser
olstenlarck           paypal.me/tunnckoCore                                              formidable
andrewnez             en.liberapay.com/andrew                                            node-sass-middleware
hueniverse            patreon.com/eranhammer                                             qs
jayphelps             patreon.com/jayphelps                                              symbol-observable
babel (organization)  opencollective.com/babel                                           @babel/core, @babel/preset-env, @babel/types, @babel/parser + 62 more
jest (organization)   opencollective.com/jest                                            @jest/types, @jest/test-result, @jest/fake-timers, @jest/transform + 5 more
debug (team)          opencollective.com/debug                                           debug
vfile (team)          opencollective.com/unified                                         vfile
cheerio (team)        opencollective.com/cheerio                                         cheerio
unified (team)        opencollective.com/unified                                         unified
sinon (team)          opencollective.com/sinon                                           sinon
nodemon (team)        opencollective.com/nodemon                                         nodemon
remark (team)         opencollective.com/unified                                         remark
preact (team)         opencollective.com/preact                                          preact

thanks already highlights the direct dependencies (displayed here in green) which is pretty helpful:

Screen Shot 2019-08-30 at 6 53 33 PM

Looking at the output of thanks, I recognize many of the package names because I explicitly installed them. But others I don't recognize by name. For example:

preact (team)         opencollective.com/preact  

I didn't know we were using preact!?

$ npm ls preact
└─┬ instantsearch.js@3.2.1
  β”œβ”€β”€ preact@8.4.2 
  └─┬ preact-rheostat@2.1.1
    └── preact@8.4.2  deduped

Ah I see it's a dependency of our Algolia search client. Knowing where that dependency came from is useful.

I'm wondering if there's a way that thanks could display npm ls-style hierarchy in its output.

Some part of me wants to know who's maintaining our more direct dependencies. That seems more personal to me. Like one degree of separation. But maybe the degree of separation doesn't actually matter? Should all dependencies, no matter how many levels deep, be treated with equal regard when it comes to dividing and disbursing "thanks"? πŸ€”

feross commented 5 years ago

It seems like the green highlighting is already doing a good job of pointing out the direct dependencies vs. indirect ones. I don't think there's much room in the interface to add npm ls style output unless we want to change the dependency list from the succint "camelcase, chalk + 137 more" to something that takes many lines.

Would a --direct flag help you? It could list only maintainers and organizations responsible for packages you directly depend on.

zeke commented 5 years ago

Hey @feross! Thanks for the reply. I think you're right that the current output does a good job of differentiating direct vs transitive deps. The color is enough. I also think the descending sorting of authors by the number of dependencies is really helpful for determining which authors are most deserving of our support.

Apologies for the rambling stream-of-consciousness issue! Closing.

feross commented 5 years ago

No worries! I always love to read the thoughtful issues you open ❀️