postcss-plugins
postcss-plugins copied to clipboard
Adding GitHub meta data
It would be nice if we could add GitHub meta data (e.g. stars, contributers, last commit time...) to the JSON file, that way we could show that information on postcss.parts and have some sorting options!
How is this coming along? 👀
Ummmmmmmmmmmmm.......
...yeah I've been super busy with other stuff man! I am getting to this because other people have requested similar stuff that would also require doing some things wth GitHub data.
I’d love to contribute to this. Here’s some info on how it would be accomplished.
Collecting GitHub data is as simple as fetching the JSON of https://api.github.com/repos/${ user }/${ name }
. From here, we can get the last updated time as Date.parse(updated_at)
, or we can get the number of forks as forks_count
, the number of stars as stargazers_count
, and the number of open issues as open_issues_count
.
As a matter of relevancy, would we want to collect the last updated time from GitHub or from npm? The later matters a lot more to anyone using npm install
.
We can also fetch the JSON of https://api.github.com/repos/${ user }/${ name }/contributors
to get an Array of contributors, which includes their GitHub username as login
, and their number of contributions as contributions
.
@jonathantneal this all sounds sensible to me, and we already grab stargazers_count
from the GH API. For the 'Last Updated' field, I think the NPM option is better. I will create a todo-list for this issue:
- [ ] Add
forks
field usingforks_count
from GH API - [ ] Add
contributors
array which lists all contributor'sname
andnumber_of_contributions
(this should address #47) - [ ] Add
last_updated
as the last date/time it was updated (from NPM)
Not sure if it's beneficial to add the number of open issues, but I'm okay with it, what is the value in adding that?
Actually it looks like what you've proposed in #164 would clear a lot of this up.