bruno-garcia / badges.bar

Badges for Dart and Flutter packages on pub.dev

Home Page:https://twitter.com/brungarc/status/1537857817109053441

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

List supported platforms in badge

bruno-garcia opened this issue · comments

This endpoint provides the platform list: https://pub.dev/api/packages/pana/metrics?pretty

image

Create a badge such as:

image

This issue is now unblocked to use a single endpoint for all:

dart-lang/pub-dev#3996

Following the PR #17 we can now see the additional metrics:

Stats for sentry:
Likes: 171
Popularity: 98
Pub Points: 130
Max Points: 130
Last Updated: 2021-04-08 05:16:58.964692Z
Package Name: sentry
Package Version: 5.0.0
Runtime Version: null
Created: null
Version Created: 2021-03-31 08:45:59.398791Z
Derived Tags: [sdk:dart, sdk:flutter, platform:android, platform:ios, platform:windows, platform:linux, platform:macos, platform:web, runtime:native-aot, runtime:native-jit, runtime:web, is:null-safe]
Flags: [latest-stable]
Report Types: [dartdoc, pana]

Thanks @AldrinMathew

However, before we can close this issue, we still need to render a proper badge for the platforms as the issue suggest.

Currently, only the keys from scores can pass through to render the badge:

!scoreTypes.contains(request.requestedUri.pathSegments.last)) {

If we add to the list the keys from scorecardTypes, it's possible to get a badge for derived tags:
image

But that's not nice in raw format. Ideally we introduce new keys such as platforms, that renders the badge more in the way that pub.dev does:

image

One idea:

badges.bar/sentry/platforms

Renders: platforms: dart, flutter
And:

badges.bar/sentry/platforms/dart

Renders: dart: native, JS

badges.bar/sentry/platforms/flutter

Renders: dart: windows, android, ios, web, macos, linux