Skip to content

Show repo issue and PR count in package page #737

@bluwy

Description

@bluwy

Description

Currently, only the stars and forks count are shown. And a link to the repo issues. It would be nice to show the issue and PR count like on npm.

Image

Potential solution

Currently the repo data is backed by https://github.com/unjs/ungh, but it does not return open_issues_count from the main github api (e.g. https://api.github.com/repos/npmx-dev/npmx.dev).

Unfortunately that number includes both the issue and pr count, so you'd have to do another fetch to retrieve the pr count to subtract it, so I'm not sure if it's feasible to do this in ungh without doubling the request. Maybe it's fine upstream if it's behind a flag or something.

Alternatively we could fetch the data in the client side instead? Or a hybrid of returning open_issues_count in ungh, and calculating the PR count in the client side?

Notes

I have an implementation for fetching the PR count here, which is the same as what npm does under the hood because GitHub doesn't provide a nice API for it.

PS I would prefer not showing the forks count if we show these two data, as I feel they provide a more informed decision about the state of the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backServer, DatafrontFrontend, Design

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions