kopia lustrzana https://github.com/badgen/badgen.net
feat: migrate /open-vsx (#634)
rodzic
cee7dcfca0
commit
58c8fd5efa
|
@ -28,7 +28,6 @@ export const liveBadgeList = [
|
|||
'pub',
|
||||
'shards',
|
||||
'wapm',
|
||||
'open-vsx',
|
||||
'snapcraft',
|
||||
// CI
|
||||
'circleci',
|
||||
|
|
|
@ -13,6 +13,7 @@ import codecov from '../pages/api/codecov'
|
|||
import travis from '../pages/api/travis'
|
||||
import chromeWebStore from '../pages/api/chrome-web-store'
|
||||
import vsMarketplace from '../pages/api/vs-marketplace'
|
||||
import openVsx from '../pages/api/open-vsx'
|
||||
import hackage from '../pages/api/hackage'
|
||||
import pypi from '../pages/api/pypi'
|
||||
import peertube from '../pages/api/peertube'
|
||||
|
@ -31,6 +32,7 @@ export default {
|
|||
npm: npm.meta,
|
||||
crates: crates.meta,
|
||||
docker: docker.meta,
|
||||
'open-vsx': openVsx.meta,
|
||||
'chrome-web-store': chromeWebStore.meta,
|
||||
'vs-marketplace': vsMarketplace.meta,
|
||||
hackage: hackage.meta,
|
||||
|
|
|
@ -51,6 +51,7 @@ const nextConfig = {
|
|||
'/crates',
|
||||
'/winget',
|
||||
'/docker',
|
||||
'/open-vsx',
|
||||
'/chrome-web-store',
|
||||
'/vs-marketplace',
|
||||
'/hackage',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import millify from 'millify'
|
||||
import got from '../libs/got'
|
||||
import { version, versionColor } from '../libs/utils'
|
||||
import { createBadgenHandler, PathArgs } from '../libs/create-badgen-handler'
|
||||
import got from '../../libs/got'
|
||||
import { version, versionColor } from '../../libs/utils'
|
||||
import { createBadgenHandler, PathArgs } from '../../libs/create-badgen-handler-next'
|
||||
|
||||
export default createBadgenHandler({
|
||||
title: 'Open VSX',
|
||||
|
@ -17,7 +17,7 @@ export default createBadgenHandler({
|
|||
}
|
||||
})
|
||||
|
||||
async function handler ({ topic, pkg, namespace }: PathArgs) {
|
||||
async function handler({ topic, pkg, namespace }: PathArgs) {
|
||||
const endpoint = `https://open-vsx.org/api/${namespace}/${pkg}`
|
||||
const data = await got(endpoint).json<any>()
|
||||
|
||||
|
@ -54,5 +54,11 @@ async function handler ({ topic, pkg, namespace }: PathArgs) {
|
|||
status: millify(data.reviewCount),
|
||||
color: 'green'
|
||||
}
|
||||
default:
|
||||
return {
|
||||
subject: 'open-vsx',
|
||||
status: 'unknown topic',
|
||||
color: 'grey'
|
||||
}
|
||||
}
|
||||
}
|
|
@ -120,10 +120,6 @@
|
|||
"source": "/opam/:match*",
|
||||
"destination": "https://v2022.badgen.net/opam/:match*"
|
||||
},
|
||||
{
|
||||
"source": "/open-vsx/:match*",
|
||||
"destination": "https://v2022.badgen.net/open-vsx/:match*"
|
||||
},
|
||||
{
|
||||
"source": "/opencollective/:match*",
|
||||
"destination": "https://v2022.badgen.net/opencollective/:match*"
|
||||
|
|
Ładowanie…
Reference in New Issue