kopia lustrzana https://github.com/badgen/badgen.net
Remove legacy examples data
rodzic
b1055a7cd6
commit
787180333b
|
@ -1,29 +1,33 @@
|
|||
import examplesLive from '../libs/examples-live.js'
|
||||
import examplesStatic from '../libs/examples-static.js'
|
||||
import badgeList from '../static/.gen/badges.json'
|
||||
|
||||
const egs = Object.entries({ ...examplesLive, ...examplesStatic })
|
||||
.reduce((accu, curr) => {
|
||||
return accu.concat(curr[1].map(eg => eg.concat(curr[0])))
|
||||
}, [])
|
||||
const examples = [...badgeList.live, ...badgeList.static].reduce((accu, curr) => {
|
||||
return accu.concat(Object.entries(curr.examples))
|
||||
}, [])
|
||||
|
||||
export default ({ badgeURL, onSelect }) => {
|
||||
const matched = badgeURL.length > 1 && egs.filter(eg => {
|
||||
return eg.find(str => str.includes(badgeURL))
|
||||
})
|
||||
if (badgeURL.length < 2) {
|
||||
return <div className='helper' />
|
||||
}
|
||||
|
||||
const hints = matched.length === 1 && matched[0][1] === '/' + badgeURL ? [] : matched
|
||||
const matched = examples.filter(eg => eg[0].includes(badgeURL))
|
||||
|
||||
const hints = matched.length === 1 && matched[0][0] === '/' + badgeURL ? null : (
|
||||
<table><tbody>
|
||||
{
|
||||
matched.map(eg => (
|
||||
<Hint
|
||||
key={eg[0]}
|
||||
info={eg}
|
||||
onSelect={e => onSelect(eg[0].replace(/^\//, ''))}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</tbody></table>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className='helper'>
|
||||
{ hints.length ? (
|
||||
<table><tbody>
|
||||
{ hints.map(eg => (
|
||||
<Hint key={eg[1]} info={eg} onSelect={e => onSelect(eg[1].replace(/^\//, ''))} />
|
||||
)) }
|
||||
</tbody></table>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{ hints }
|
||||
<style jsx>{`
|
||||
.helper {
|
||||
height: 50vh;
|
||||
|
@ -44,8 +48,8 @@ export default ({ badgeURL, onSelect }) => {
|
|||
|
||||
const Hint = ({ info, onSelect }) => (
|
||||
<tr onClick={onSelect}>
|
||||
<th>{info[2]}</th>
|
||||
<td>{info[1]}</td>
|
||||
<th>{info[1]}</th>
|
||||
<td>{info[0]}</td>
|
||||
<style jsx>{`
|
||||
tr {
|
||||
font-size: 15px;
|
||||
|
|
|
@ -59,12 +59,12 @@ const PreviewBadge = debounceRender(({ host, url }) => {
|
|||
|
||||
const genBadgeSrc = (host, url) => {
|
||||
if (!url) {
|
||||
return host + 'badge/badgen/preview'
|
||||
return host + 'badge/%20/%20'
|
||||
}
|
||||
if (url.split('/').length > 2) {
|
||||
return host + url
|
||||
} else {
|
||||
return host + 'badge/badgen/preview'
|
||||
return host + 'badge/%20/%20'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,238 +0,0 @@
|
|||
module.exports = {
|
||||
/* source control */
|
||||
github: [
|
||||
['latest release', '/github/release/babel/babel'],
|
||||
['latest stable release', '/github/release/babel/babel/stable'],
|
||||
['latest tag', '/github/tag/micromatch/micromatch'],
|
||||
['watchers', '/github/watchers/micromatch/micromatch'],
|
||||
['status', '/github/status/micromatch/micromatch'],
|
||||
['status (branch)', '/github/status/tunnckoCore/badgen-service/github-status'],
|
||||
['status (branch)', '/github/status/micromatch/micromatch/gh-pages'],
|
||||
['status (commit)', '/github/status/micromatch/micromatch/f4809eb6df80b'],
|
||||
['stars', '/github/stars/micromatch/micromatch'],
|
||||
['forks', '/github/forks/micromatch/micromatch'],
|
||||
['issues', '/github/issues/micromatch/micromatch'],
|
||||
['open issues', '/github/open-issues/micromatch/micromatch'],
|
||||
['closed issues', '/github/closed-issues/micromatch/micromatch'],
|
||||
['issues by label', '/github/label-issues/nodejs/node/ES%20Modules'],
|
||||
['open issues by label', '/github/label-issues/atom/atom/help-wanted/open'],
|
||||
['closed issues by label', '/github/label-issues/rust-lang/rust/B-RFC-approved/closed'],
|
||||
['PRs', '/github/prs/micromatch/micromatch'],
|
||||
['open PRs', '/github/open-prs/micromatch/micromatch'],
|
||||
['closed PRs', '/github/closed-prs/micromatch/micromatch'],
|
||||
['merged PRs', '/github/merged-prs/micromatch/micromatch'],
|
||||
['contributors', '/github/contributors/micromatch/micromatch'],
|
||||
['commits', '/github/commits/micromatch/micromatch'],
|
||||
['branches', '/github/branches/micromatch/micromatch'],
|
||||
['releases', '/github/releases/micromatch/micromatch'],
|
||||
['tags', '/github/tags/micromatch/micromatch'],
|
||||
['license', '/github/license/micromatch/micromatch'],
|
||||
['last commit', '/github/last-commit/micromatch/micromatch'],
|
||||
['latest assets downloads', '/github/assets-dl/electron/electron'],
|
||||
['repository dependents', '/github/dependents-repo/micromatch/micromatch'],
|
||||
['package dependents', '/github/dependents-pkg/micromatch/micromatch']
|
||||
],
|
||||
/* release registries */
|
||||
npm: [
|
||||
['version', '/npm/v/express'],
|
||||
['version', '/npm/v/babel-core'],
|
||||
['version', '/npm/v/ava'],
|
||||
['version (tag)', '/npm/v/ava/next'],
|
||||
['version (tag)', '/npm/v/next/canary'],
|
||||
['version (scoped)', '/npm/v/@babel/core'],
|
||||
['version (scoped & tag)', '/npm/v/@nestjs/core/beta'],
|
||||
['weekly downloads', '/npm/dw/express'],
|
||||
['monthly downloads', '/npm/dm/express'],
|
||||
['yearly downloads', '/npm/dy/express'],
|
||||
['total downloads', '/npm/dt/express'],
|
||||
['license', '/npm/license/lodash'],
|
||||
['engines (node)', '/npm/node/express'],
|
||||
['dependents', '/npm/dependents/got']
|
||||
],
|
||||
'david-dm': [
|
||||
['dependencies', '/david/dep/zeit/pkg'],
|
||||
['dev dependencies', '/david/dev/zeit/pkg'],
|
||||
['peer dependencies', '/david/peer/epoberezkin/ajv-keywords'],
|
||||
['optional dependencies', '/david/optional/epoberezkin/ajv-keywords'],
|
||||
['dependencies (sub path)', '/david/dep/babel/babel/packages/babel-cli']
|
||||
],
|
||||
packagephobia: [
|
||||
['install size', '/packagephobia/install/webpack'],
|
||||
['publish size', '/packagephobia/publish/webpack'],
|
||||
['publish size (scoped)', '/packagephobia/publish/@tusbar/cache-control']
|
||||
],
|
||||
bundlephobia: [
|
||||
['minified', '/bundlephobia/min/react'],
|
||||
['minified + gzip', '/bundlephobia/minzip/react'],
|
||||
['(scoped) minified + gzip', '/bundlephobia/minzip/@material-ui/core']
|
||||
],
|
||||
xo: [
|
||||
['status', '/xo/status/badgen'],
|
||||
['status', '/xo/status/chalk'],
|
||||
['indent', '/xo/indent/@tusbar/cache-control'],
|
||||
['semicolons', '/xo/semi/got']
|
||||
],
|
||||
crates: [
|
||||
['version', '/crates/v/regex'],
|
||||
['downloads', '/crates/d/regex'],
|
||||
['downloads (latest)', '/crates/dl/regex']
|
||||
],
|
||||
docker: [
|
||||
['pulls (library)', '/docker/pulls/library/ubuntu'],
|
||||
['stars (library)', '/docker/stars/library/ubuntu'],
|
||||
['pulls (scoped)', '/docker/pulls/amio/node-chrome'],
|
||||
['stars (icon & label)', '/docker/stars/library/mongo?icon=docker&label=stars']
|
||||
],
|
||||
homebrew: [
|
||||
['version', '/homebrew/v/fish'],
|
||||
['version', '/homebrew/v/cake']
|
||||
],
|
||||
'chrome extension': [
|
||||
['version', '/chrome-web-store/v/ckkdlimhmcjmikdlpkmbgfkaikojcbjk'],
|
||||
['users', '/chrome-web-store/users/ckkdlimhmcjmikdlpkmbgfkaikojcbjk'],
|
||||
['price', '/chrome-web-store/price/ckkdlimhmcjmikdlpkmbgfkaikojcbjk'],
|
||||
['rating', '/chrome-web-store/rating/ckkdlimhmcjmikdlpkmbgfkaikojcbjk'],
|
||||
['stars', '/chrome-web-store/stars/ckkdlimhmcjmikdlpkmbgfkaikojcbjk'],
|
||||
['rating count', '/chrome-web-store/rating-count/ckkdlimhmcjmikdlpkmbgfkaikojcbjk']
|
||||
],
|
||||
'mozilla add-on': [
|
||||
['version', '/amo/v/markdown-viewer-chrome'],
|
||||
['users', '/amo/users/markdown-viewer-chrome'],
|
||||
['rating', '/amo/rating/markdown-viewer-chrome'],
|
||||
['stars', '/amo/stars/markdown-viewer-chrome'],
|
||||
['reviews', '/amo/reviews/markdown-viewer-chrome']
|
||||
],
|
||||
pypi: [
|
||||
['version', '/pypi/v/pip'],
|
||||
['version', '/pypi/v/docutils'],
|
||||
['license', '/pypi/license/pip']
|
||||
],
|
||||
nuget: [
|
||||
['version (stable)', '/nuget/v/newtonsoft.json'],
|
||||
['version (pre)', '/nuget/v/newtonsoft.json/pre'],
|
||||
['version (latest)', '/nuget/v/newtonsoft.json/latest']
|
||||
],
|
||||
packagist: [
|
||||
['version (stable)', '/packagist/v/monolog/monolog'],
|
||||
['version (pre)', '/packagist/v/monolog/monolog/pre'],
|
||||
['version (latest)', '/packagist/v/monolog/monolog/latest'],
|
||||
['total downloads', '/packagist/dt/monolog/monolog'],
|
||||
['daily downloads', '/packagist/dd/monolog/monolog'],
|
||||
['monthly downloads', '/packagist/dm/monolog/monolog'],
|
||||
['favers', '/packagist/favers/monolog/monolog'],
|
||||
['dependents', '/packagist/dependents/monolog/monolog'],
|
||||
['suggesters', '/packagist/suggesters/monolog/monolog'],
|
||||
['name', '/packagist/n/monolog/monolog'],
|
||||
['github stars', '/packagist/ghs/monolog/monolog'],
|
||||
['github watchers', '/packagist/ghw/monolog/monolog'],
|
||||
['github forks', '/packagist/ghf/monolog/monolog'],
|
||||
['github issues', '/packagist/ghi/monolog/monolog'],
|
||||
['language', '/packagist/lang/monolog/monolog'],
|
||||
['license', '/packagist/license/monolog/monolog']
|
||||
],
|
||||
rubygems: [
|
||||
['version (stable)', '/rubygems/v/rails'],
|
||||
['version (pre)', '/rubygems/v/rails/pre'],
|
||||
['version (latest)', '/rubygems/v/rails/latest'],
|
||||
['total downloads', '/rubygems/dt/rails'],
|
||||
['version downloads', '/rubygems/dv/rails'],
|
||||
['name', '/rubygems/n/rails'],
|
||||
['platform', '/rubygems/p/rails']
|
||||
],
|
||||
apm: [
|
||||
['version', '/apm/v/linter'],
|
||||
['license', '/apm/license/linter'],
|
||||
['downloads', '/apm/dl/linter'],
|
||||
['stars', '/apm/stars/linter']
|
||||
],
|
||||
hackage: [
|
||||
['version', '/hackage/v/abt'],
|
||||
['version', '/hackage/v/Cabal'],
|
||||
['license', '/hackage/license/Cabal']
|
||||
],
|
||||
'visual studio marketplace': [
|
||||
['version', '/vs-marketplace/v/vscodevim.vim'],
|
||||
['installs', '/vs-marketplace/i/vscodevim.vim'],
|
||||
['downloads', '/vs-marketplace/d/vscodevim.vim'],
|
||||
['rating', '/vs-marketplace/rating/vscodevim.vim']
|
||||
],
|
||||
/* CIs */
|
||||
travis: [
|
||||
['build', '/travis/babel/babel'],
|
||||
['build (branch)', '/travis/babel/babel/6.x']
|
||||
],
|
||||
circleci: [
|
||||
['build', '/circleci/github/nuxt/nuxt.js'],
|
||||
['build (branch)', '/circleci/github/nuxt/nuxt.js/master']
|
||||
],
|
||||
appveyor: [
|
||||
['build', '/appveyor/ci/gruntjs/grunt'],
|
||||
['build (branch)', '/appveyor/ci/gruntjs/grunt/deprecate']
|
||||
],
|
||||
codecov: [
|
||||
['coverage (github)', '/codecov/c/github/tunnckoCoreLabs/gitcommit'],
|
||||
['coverage (github, branch)', '/codecov/c/github/babel/babel/6.x'],
|
||||
['coverage (bitbucket)', '/codecov/c/bitbucket/ignitionrobotics/ign-math'],
|
||||
['coverage (bitbucket, branch)', '/codecov/c/bitbucket/ignitionrobotics/ign-math/master'],
|
||||
['coverage (gitlab)', '/codecov/c/gitlab/gitlab-org/gitaly'],
|
||||
['coverage (gitlab, branch)', '/codecov/c/gitlab/gitlab-org/gitaly/master']
|
||||
],
|
||||
coveralls: [
|
||||
['coverage (github)', '/coveralls/c/github/jekyll/jekyll'],
|
||||
['coverage (github, branch)', '/coveralls/c/github/jekyll/jekyll/master'],
|
||||
['coverage (bitbucket)', '/coveralls/c/bitbucket/pyKLIP/pyklip'],
|
||||
['coverage (bitbucket, branch)', '/coveralls/c/bitbucket/pyKLIP/pyklip/master']
|
||||
],
|
||||
/* quality & metrics */
|
||||
'code climate': [
|
||||
['lines of code', '/codeclimate/loc/codeclimate/codeclimate'],
|
||||
['issues', '/codeclimate/issues/codeclimate/codeclimate'],
|
||||
['technical debt', '/codeclimate/tech-debt/codeclimate/codeclimate'],
|
||||
['maintainability', '/codeclimate/maintainability/codeclimate/codeclimate'],
|
||||
['maintainability (percentage)', '/codeclimate/maintainability-percentage/codeclimate/codeclimate'],
|
||||
['coverage', '/codeclimate/coverage/codeclimate/codeclimate'],
|
||||
['coverage (letter)', '/codeclimate/coverage-letter/codeclimate/codeclimate']
|
||||
],
|
||||
'lgtm': [
|
||||
['number of alerts', '/lgtm/alerts/g/apache/cloudstack'],
|
||||
['java code quality', '/lgtm/grade/java/g/apache/cloudstack'],
|
||||
['C/C++ code quality', '/lgtm/grade/cpp/g/systemd/systemd']
|
||||
],
|
||||
'uptime robot': [
|
||||
['status', '/uptime-robot/status/m780862024-50db2c44c703e5c68d6b1ebb'],
|
||||
['(24 hours) uptime', '/uptime-robot/day/m780862024-50db2c44c703e5c68d6b1ebb'],
|
||||
['(past week) uptime', '/uptime-robot/week/m780862024-50db2c44c703e5c68d6b1ebb'],
|
||||
['(past month) uptime', '/uptime-robot/month/m780862024-50db2c44c703e5c68d6b1ebb'],
|
||||
['(last hours) response', '/uptime-robot/response/m780862024-50db2c44c703e5c68d6b1ebb']
|
||||
],
|
||||
badgesize: [
|
||||
['normal size', '/badgesize/normal/amio/emoji.json/master/emoji-compact.json'],
|
||||
['brotli size', '/badgesize/brotli/amio/emoji.json/master/emoji-compact.json'],
|
||||
['gzip size', '/badgesize/gzip/amio/emoji.json/master/emoji-compact.json'],
|
||||
['arbitrary url', '/badgesize/normal/https://unpkg.com/snarkdown/dist/snarkdown.js']
|
||||
],
|
||||
jsdelivr: [
|
||||
['hits (per month)', '/jsdelivr/hits/gh/jquery/jquery'],
|
||||
['hits (per month)', '/jsdelivr/hits/npm/lodash'],
|
||||
['rank', '/jsdelivr/rank/npm/lodash'],
|
||||
['version', '/jsdelivr/v/npm/lodash']
|
||||
],
|
||||
'azure pipelines': [
|
||||
['build', '/azure-pipelines/yarnpkg/yarn/Yarn Acceptance Tests'],
|
||||
['build (branch)', '/azure-pipelines/yarnpkg/yarn/Yarn Acceptance Tests/azure-pipelines']
|
||||
],
|
||||
/* utilities */
|
||||
'opencollective': [
|
||||
['backers', '/opencollective/backers/webpack'],
|
||||
['contributors', '/opencollective/contributors/webpack'],
|
||||
['balance', '/opencollective/balance/webpack'],
|
||||
['yearly income', '/opencollective/yearly/webpack']
|
||||
],
|
||||
keybase: [
|
||||
['pgp', '/keybase/pgp/lukechilds']
|
||||
],
|
||||
twitter: [
|
||||
['follower count', '/twitter/follow/rustlang'],
|
||||
['follower count', '/twitter/follow/golang']
|
||||
]
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
module.exports = {
|
||||
'license': [
|
||||
['license mit', '/badge/license/MIT/blue']
|
||||
],
|
||||
'code style': [
|
||||
['standard', '/badge/code%20style/standard/f2a'],
|
||||
['airbnb', '/badge/code%20style/airbnb/FF5A60'],
|
||||
['xo', '/badge/code%20style/xo/5ED9C7']
|
||||
],
|
||||
'chat': [
|
||||
['gitter', '/badge/chat/on%20gitter/cyan']
|
||||
],
|
||||
'else': [
|
||||
['swift version', '/badge/Swift/4.2/orange'],
|
||||
['star rating', '/badge/stars/★★★★☆'],
|
||||
['patreon', '/badge/become/a%20patron/F96854'],
|
||||
['platform', '/badge/platform/ios,macos,tvos?list=1']
|
||||
]
|
||||
}
|
Ładowanie…
Reference in New Issue