Move remaining badge examples into services/ [cpan] (#2349)

Except NuGet; leaving those for the last pass.
This commit is contained in:
Paul Melnikow
2018-11-19 15:25:34 -05:00
committed by GitHub
parent c9057266ea
commit ccfac2eab3
22 changed files with 1078 additions and 275 deletions

View File

@@ -58,30 +58,6 @@ const allBadgeExamples = [
title: 'PowerShell Gallery',
previewUrl: '/powershellgallery/dt/ACMESharp.svg',
},
{
title: 'Crates.io',
previewUrl: '/crates/d/rustc-serialize.svg',
keywords: ['Rust'],
},
{
title: 'Crates.io',
previewUrl: '/crates/dv/rustc-serialize.svg',
keywords: ['Rust'],
},
{
title: 'Puppet Forge',
previewUrl: '/puppetforge/dt/camptocamp/openldap.svg',
},
{
title: 'Mozilla Add-on',
previewUrl: '/amo/d/dustman.svg',
keywords: ['amo', 'firefox'],
},
{
title: 'Visual Studio Marketplace',
previewUrl: '/vscode-marketplace/d/ritwickdey.LiveServer.svg',
keywords: ['vscode-marketplace'],
},
{
title: 'JetBrains ReSharper plugins',
previewUrl: '/resharper/dt/ReSharper.Nuke.svg',
@@ -94,14 +70,7 @@ const allBadgeExamples = [
id: 'funding',
name: 'Funding',
},
examples: [
{
title: 'Chrome Web Store',
previewUrl:
'/chrome-web-store/price/ogffaloegjglncjfehdfplabnoondfjo.svg',
keywords: ['chrome'],
},
],
examples: [],
},
{
category: {
@@ -115,114 +84,14 @@ const allBadgeExamples = [
id: 'license',
name: 'License',
},
examples: [
{
title: 'Crates.io',
previewUrl: '/crates/l/rustc-serialize.svg',
keywords: ['Rust'],
},
{
title: 'Packagist',
previewUrl: '/packagist/l/doctrine/orm.svg',
keywords: ['PHP'],
},
{
title: 'Bower',
previewUrl: '/bower/l/bootstrap.svg',
},
{
title: 'CPAN',
previewUrl: '/cpan/l/Config-Augeas.svg',
keywords: ['perl'],
},
{
title: 'CRAN',
previewUrl: '/cran/l/devtools.svg',
keywords: ['R'],
},
{
title: 'DUB',
previewUrl: '/dub/l/vibe-d.svg',
keywords: ['dub'],
},
],
examples: [],
},
{
category: {
id: 'rating',
name: 'Rating',
},
examples: [
{
title: 'Chrome Web Store',
previewUrl:
'/chrome-web-store/rating/ogffaloegjglncjfehdfplabnoondfjo.svg',
keywords: ['chrome'],
},
{
title: 'Chrome Web Store',
previewUrl:
'/chrome-web-store/stars/ogffaloegjglncjfehdfplabnoondfjo.svg',
keywords: ['chrome'],
},
{
title: 'Chrome Web Store',
previewUrl:
'/chrome-web-store/rating-count/ogffaloegjglncjfehdfplabnoondfjo.svg',
keywords: ['chrome'],
},
{
title: 'Mozilla Add-on',
previewUrl: '/amo/rating/dustman.svg',
keywords: ['amo', 'firefox'],
},
{
title: 'Mozilla Add-on',
previewUrl: '/amo/stars/dustman.svg',
keywords: ['amo', 'firefox'],
},
{
title: 'Plugin on redmine.org',
previewUrl:
'/redmine/plugin/rating/redmine_xlsx_format_issue_exporter.svg',
keywords: ['redmine', 'plugin'],
},
{
title: 'Plugin on redmine.org',
previewUrl:
'/redmine/plugin/stars/redmine_xlsx_format_issue_exporter.svg',
keywords: ['redmine', 'plugin'],
},
{
title: 'Vaadin Directory',
previewUrl: '/vaadin-directory/rating/vaadinvaadin-grid.svg',
keywords: ['vaadin-directory', 'vaadin directory', 'rating'],
},
{
title: 'Vaadin Directory',
previewUrl: '/vaadin-directory/stars/vaadinvaadin-grid.svg',
keywords: ['vaadin-directory', 'vaadin directory', 'star', 'stars'],
},
{
title: 'Vaadin Directory',
previewUrl: '/vaadin-directory/rating-count/vaadinvaadin-grid.svg',
keywords: [
'vaadin-directory',
'vaadin directory',
'rating-count',
'rating count',
],
},
{
title: 'Visual Studio Marketplace',
previewUrl: '/vscode-marketplace/r/ritwickdey.LiveServer.svg',
keywords: ['vscode-marketplace'],
},
{
title: 'StackExchange',
previewUrl: '/stackexchange/tex/r/951.svg',
},
],
examples: [],
},
{
category: {
@@ -237,30 +106,6 @@ const allBadgeExamples = [
name: 'Version',
},
examples: [
{
title: 'LuaRocks',
previewUrl: '/luarocks/v/mpeterv/luacheck.svg',
keywords: ['lua'],
},
{
title: 'Hackage',
previewUrl: '/hackage/v/lens.svg',
},
{
title: 'Crates.io',
previewUrl: '/crates/v/rustc-serialize.svg',
keywords: ['Rust'],
},
{
title: 'Packagist',
previewUrl: '/packagist/v/symfony/symfony.svg',
keywords: ['PHP'],
},
{
title: 'Packagist Pre Release',
previewUrl: '/packagist/vpre/symfony/symfony.svg',
keywords: ['PHP'],
},
{
title: 'NuGet',
previewUrl: '/nuget/v/Nuget.Core.svg',
@@ -290,51 +135,6 @@ const allBadgeExamples = [
title: 'PowerShell Gallery',
previewUrl: '/powershellgallery/v/Zyborg.Vault.svg',
},
{
title: 'Puppet Forge',
previewUrl: '/puppetforge/v/vStone/percona.svg',
},
{
title: 'Sonatype Nexus (Releases)',
previewUrl:
'/nexus/r/https/oss.sonatype.org/com.google.guava/guava.svg',
},
{
title: 'Sonatype Nexus (Snapshots)',
previewUrl:
'/nexus/s/https/oss.sonatype.org/com.google.guava/guava.svg',
},
{
title: 'CPAN',
previewUrl: '/cpan/v/Config-Augeas.svg',
keywords: ['perl'],
},
{
title: 'CRAN',
previewUrl: '/cran/v/devtools.svg',
keywords: ['R'],
},
{
title: 'DUB',
previewUrl: '/dub/v/vibe-d.svg',
keywords: ['dub'],
},
{
title: 'Chrome Web Store',
previewUrl: '/chrome-web-store/v/ogffaloegjglncjfehdfplabnoondfjo.svg',
keywords: ['chrome'],
},
{
title: 'Mozilla Add-on',
previewUrl: '/amo/v/dustman.svg',
keywords: ['amo', 'firefox'],
},
{
title: 'Visual Studio Marketplace',
previewUrl: '/vscode-marketplace/v/ritwickdey.LiveServer.svg',
keywords: ['vscode-marketplace'],
},
{
title: 'JetBrains ReSharper Plugins',
previewUrl: '/resharper/v/ReSharper.Nuke.svg',
@@ -343,16 +143,6 @@ const allBadgeExamples = [
title: 'JetBrains ReSharper Plugins Pre-release',
previewUrl: '/resharper/vpre/ReSharper.Nuke.svg',
},
{
title: 'Vaadin Directory',
previewUrl: '/vaadin-directory/v/vaadinvaadin-grid.svg',
keywords: [
'vaadin-directory',
'vaadin directory',
'version',
'latest version',
],
},
],
},
{
@@ -374,54 +164,7 @@ const allBadgeExamples = [
id: 'other',
name: 'Other',
},
examples: [
{
title: 'Puppet Forge',
previewUrl: '/puppetforge/e/camptocamp/openssl.svg',
},
{
title: 'Puppet Forge',
previewUrl: '/puppetforge/f/camptocamp/openssl.svg',
},
{
title: 'Puppet Forge',
previewUrl: '/puppetforge/rc/camptocamp.svg',
},
{
title: 'Puppet Forge',
previewUrl: '/puppetforge/mc/camptocamp.svg',
},
{
title: 'Chrome Web Store',
previewUrl:
'/chrome-web-store/users/ogffaloegjglncjfehdfplabnoondfjo.svg',
keywords: ['chrome'],
},
{
title: 'Mozilla Add-on',
previewUrl: '/amo/users/dustman.svg',
keywords: ['amo', 'firefox'],
},
{
title: 'Vaadin Directory',
previewUrl: '/vaadin-directory/status/vaadinvaadin-grid.svg',
keywords: ['vaadin-directory', 'vaadin directory', 'status'],
},
{
title: 'Vaadin Directory',
previewUrl: '/vaadin-directory/release-date/vaadinvaadin-grid.svg',
keywords: [
'vaadin-directory',
'vaadin directory',
'date',
'latest release date',
],
},
{
title: 'StackExchange',
previewUrl: '/stackexchange/stackoverflow/t/augeas.svg',
},
],
examples: [],
},
]

View File

@@ -17,7 +17,108 @@ const {
floorCount: floorCountColor,
} = require('../../lib/color-formatters')
module.exports = class Amo extends LegacyService {
class AmoDownloads extends LegacyService {
static get category() {
return 'downloads'
}
static get route() {
return {
base: 'amo/d',
}
}
static get examples() {
return [
{
title: 'Mozilla Add-on',
previewUrl: 'dustman',
keywords: ['amo', 'firefox'],
},
]
}
static registerLegacyRouteHandler() {}
}
class AmoVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'amo/v',
}
}
static get examples() {
return [
{
title: 'Mozilla Add-on',
previewUrl: 'dustman',
keywords: ['amo', 'firefox'],
},
]
}
static registerLegacyRouteHandler() {}
}
class AmoRating extends LegacyService {
static get category() {
return 'rating'
}
static get route() {
return {
base: 'amo',
}
}
static get examples() {
return [
{
title: 'Mozilla Add-on',
previewUrl: 'rating/dustman',
keywords: ['amo', 'firefox'],
},
{
title: 'Mozilla Add-on',
previewUrl: 'stars/dustman',
keywords: ['amo', 'firefox'],
},
]
}
static registerLegacyRouteHandler() {}
}
class AmoUsers extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'amo/users',
}
}
static get examples() {
return [
{
title: 'Mozilla Add-on',
previewUrl: 'dustman',
keywords: ['amo', 'firefox'],
},
]
}
static registerLegacyRouteHandler() {}
}
class Amo extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/amo\/(v|d|rating|stars|users)\/(.*)\.(svg|png|gif|jpg|json)$/,
@@ -90,3 +191,11 @@ module.exports = class Amo extends LegacyService {
)
}
}
module.exports = {
AmoDownloads,
AmoVersion,
AmoRating,
AmoUsers,
Amo,
}

View File

@@ -5,6 +5,25 @@ const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
const serverSecrets = require('../../lib/server-secrets')
module.exports = class BowerLicense extends LegacyService {
static get category() {
return 'license'
}
static get route() {
return {
base: 'bower/l',
}
}
static get examples() {
return [
{
title: 'Bower',
previewUrl: 'bootstrap',
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/bower\/l\/(.*)\.(svg|png|gif|jpg|json)$/,

View File

@@ -16,7 +16,137 @@ const {
currencyFromCode,
} = require('../../lib/text-formatters')
module.exports = class ChromeWebStore extends LegacyService {
class ChromeWebStoreDownloads extends LegacyService {
static get category() {
return 'downloads'
}
static get route() {
return {
base: 'chrome-web-store/d',
}
}
static get examples() {
return [
{
title: 'Chrome Web Store',
previewUrl: 'ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
]
}
static registerLegacyRouteHandler() {}
}
class ChromeWebStoreVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'chrome-web-store/v',
}
}
static get examples() {
return [
{
title: 'Chrome Web Store',
previewUrl: 'ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
]
}
static registerLegacyRouteHandler() {}
}
class ChromeWebStorePrice extends LegacyService {
static get category() {
return 'funding'
}
static get route() {
return {
base: 'chrome-web-store/price',
}
}
static get examples() {
return [
{
title: 'Chrome Web Store',
previewUrl: 'ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
]
}
static registerLegacyRouteHandler() {}
}
class ChromeWebStoreRating extends LegacyService {
static get category() {
return 'rating'
}
static get route() {
return {
base: 'chrome-web-store',
}
}
static get examples() {
return [
{
title: 'Chrome Web Store',
previewUrl: 'rating/ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
{
title: 'Chrome Web Store',
previewUrl: 'stars/ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
{
title: 'Chrome Web Store',
previewUrl: 'rating-count/ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
]
}
static registerLegacyRouteHandler() {}
}
class ChromeWebStoreUsers extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'chrome-web-store/users',
}
}
static get examples() {
return [
{
title: 'Chrome Web Store',
previewUrl: 'ogffaloegjglncjfehdfplabnoondfjo',
keywords: ['chrome'],
},
]
}
static registerLegacyRouteHandler() {}
}
class ChromeWebStore extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/chrome-web-store\/(v|d|users|price|rating|stars|rating-count)\/(.*)\.(svg|png|gif|jpg|json)$/,
@@ -95,3 +225,12 @@ module.exports = class ChromeWebStore extends LegacyService {
)
}
}
module.exports = {
ChromeWebStoreDownloads,
ChromeWebStoreVersion,
ChromeWebStorePrice,
ChromeWebStoreRating,
ChromeWebStoreUsers,
ChromeWebStore,
}

View File

@@ -0,0 +1,27 @@
'use strict'
const LegacyService = require('../legacy-service')
module.exports = class CpanLicense extends LegacyService {
static get category() {
return 'license'
}
static get route() {
return {
base: 'cpan/l',
}
}
static get examples() {
return [
{
title: 'CPAN',
previewUrl: 'Config-Augeas',
keywords: ['perl'],
},
]
}
static registerLegacyRouteHandler() {}
}

View File

@@ -5,7 +5,7 @@ const t = createServiceTester()
module.exports = t
t.create('license')
.get('/l/Config-Augeas.json')
.get('/Config-Augeas.json')
.expectJSON({
name: 'license',
value: 'lgpl_2_1',

View File

@@ -0,0 +1,27 @@
'use strict'
const LegacyService = require('../legacy-service')
module.exports = class CpanVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'cpan/v',
}
}
static get examples() {
return [
{
title: 'CPAN',
previewUrl: 'Config-Augeas',
keywords: ['perl'],
},
]
}
static registerLegacyRouteHandler() {}
}

View File

@@ -8,8 +8,55 @@ const {
const { addv: versionText } = require('../../lib/text-formatters')
const { version: versionColor } = require('../../lib/color-formatters')
// For CRAN/METACRAN.
module.exports = class Cran extends LegacyService {
class CranLicense extends LegacyService {
static get category() {
return 'license'
}
static get route() {
return {
base: 'cran/l',
}
}
static get examples() {
return [
{
title: 'CRAN/METACRAN',
previewUrl: 'devtools',
keywords: ['R'],
},
]
}
static registerLegacyRouteHandler() {}
}
class CranVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'cran/v',
}
}
static get examples() {
return [
{
title: 'CRAN/METACRAN',
previewUrl: 'devtools',
keywords: ['R'],
},
]
}
static registerLegacyRouteHandler() {}
}
class Cran extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/cran\/([vl])\/([^/]+)\.(svg|png|gif|jpg|json)$/,
@@ -60,3 +107,9 @@ module.exports = class Cran extends LegacyService {
)
}
}
module.exports = {
CranLicense,
CranVersion,
Cran,
}

View File

@@ -8,7 +8,84 @@ const {
} = require('../../lib/color-formatters')
const { metric, addv: versionText } = require('../../lib/text-formatters')
module.exports = class Crates extends LegacyService {
class CratesDownloads extends LegacyService {
static get category() {
return 'downloads'
}
static get route() {
return {
base: 'crates',
}
}
static get examples() {
return [
{
title: 'Crates.io',
previewUrl: 'd/rustc-serialize',
keywords: ['Rust'],
},
{
title: 'Crates.io',
previewUrl: 'dv/rustc-serialize',
keywords: ['Rust'],
},
]
}
static registerLegacyRouteHandler() {}
}
class CratesVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'crates/v',
}
}
static get examples() {
return [
{
title: 'Crates.io',
previewUrl: 'rustc-serialize',
keywords: ['Rust'],
},
]
}
static registerLegacyRouteHandler() {}
}
class CratesLicense extends LegacyService {
static get category() {
return 'license'
}
static get route() {
return {
base: 'crates/l',
}
}
static get examples() {
return [
{
title: 'Crates.io',
previewUrl: 'rustc-serialize',
keywords: ['Rust'],
},
]
}
static registerLegacyRouteHandler() {}
}
class Crates extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/crates\/(d|v|dv|l)\/([A-Za-z0-9_-]+)(?:\/([0-9.]+))?\.(svg|png|gif|jpg|json)$/,
@@ -93,3 +170,10 @@ module.exports = class Crates extends LegacyService {
)
}
}
module.exports = {
CratesDownloads,
CratesVersion,
CratesLicense,
Crates,
}

View File

@@ -9,7 +9,55 @@ const { checkErrorResponse } = require('../../lib/error-helper')
const { addv: versionText } = require('../../lib/text-formatters')
const { version: versionColor } = require('../../lib/color-formatters')
module.exports = class DubLicenseVersion extends LegacyService {
class DubVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'dub/v',
}
}
static get examples() {
return [
{
title: 'DUB',
previewUrl: 'vibe-d',
keywords: ['dub'],
},
]
}
static registerLegacyRouteHandler() {}
}
class DubLicense extends LegacyService {
static get category() {
return 'license'
}
static get route() {
return {
base: 'dub/l',
}
}
static get examples() {
return [
{
title: 'DUB',
previewUrl: 'vibe-d',
keywords: ['dub'],
},
]
}
static registerLegacyRouteHandler() {}
}
class DubLicenseVersion extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/dub\/(v|l)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
@@ -55,3 +103,9 @@ module.exports = class DubLicenseVersion extends LegacyService {
)
}
}
module.exports = {
DubVersion,
DubLicense,
DubLicenseVersion,
}

View File

@@ -7,6 +7,25 @@ const { addv: versionText } = require('../../lib/text-formatters')
const { version: versionColor } = require('../../lib/color-formatters')
module.exports = class HackageVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'hackage/v',
}
}
static get examples() {
return [
{
title: 'Hackage',
previewUrl: 'lens',
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/hackage\/v\/(.*)\.(svg|png|gif|jpg|json)$/,

View File

@@ -9,6 +9,26 @@ const {
} = require('./luarocks-version')
module.exports = class Luarocks extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'luarocks/v',
}
}
static get examples() {
return [
{
title: 'LuaRocks',
previewUrl: 'mpeterv/luacheck',
keywords: ['lua'],
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/luarocks\/v\/([^/]+)\/([^/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,

View File

@@ -7,6 +7,29 @@ const { addv: versionText } = require('../../lib/text-formatters')
const { version: versionColor } = require('../../lib/color-formatters')
module.exports = class Nexus extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'nexus',
}
}
static get examples() {
return [
{
title: 'Sonatype Nexus (Releases)',
previewUrl: 'r/https/oss.sonatype.org/com.google.guava/guava',
},
{
title: 'Sonatype Nexus (Snapshots)',
previewUrl: 's/https/oss.sonatype.org/com.google.guava/guava',
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
// standalone sonatype nexus installation
// API pattern:

View File

@@ -1,10 +1,9 @@
'use strict'
const Joi = require('joi')
const ServiceTester = require('../service-tester')
const { invalidJSON } = require('../response-fixtures')
const t = new ServiceTester({ id: 'nexus', title: 'Nexus' })
const t = require('../create-service-tester')()
module.exports = t
t.create('search release version')

View File

@@ -4,6 +4,26 @@ const LegacyService = require('../legacy-service')
const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
module.exports = class PackagistLicense extends LegacyService {
static get category() {
return 'license'
}
static get route() {
return {
base: 'packagist/l',
}
}
static get examples() {
return [
{
title: 'Packagist',
previewUrl: 'doctrine/orm',
keywords: ['PHP'],
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/packagist\/l\/(.*)\.(svg|png|gif|jpg|json)$/,

View File

@@ -11,6 +11,31 @@ const {
} = require('../../lib/php-version')
module.exports = class PackagistVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'packagist',
}
}
static get examples() {
return [
{
title: 'Packagist',
previewUrl: 'v/symfony/symfony',
keywords: ['PHP'],
},
{
title: 'Packagist Pre Release',
previewUrl: 'vpre/symfony/symfony',
keywords: ['PHP'],
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/packagist\/(v|vpre)\/(.*)\.(svg|png|gif|jpg|json)$/,

View File

@@ -12,7 +12,99 @@ const {
downloadCount: downloadCountColor,
} = require('../../lib/color-formatters')
module.exports = class PuppetforgeModules extends LegacyService {
class PuppetforgeModuleVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'puppetforge/v',
}
}
static get examples() {
return [
{
title: 'Puppet Forge',
previewUrl: 'vStone/percona',
},
]
}
static registerLegacyRouteHandler() {}
}
class PuppetforgeModuleDownloads extends LegacyService {
static get category() {
return 'downloads'
}
static get route() {
return {
base: 'puppetforge/dt',
}
}
static get examples() {
return [
{
title: 'Puppet Forge',
previewUrl: 'camptocamp/openldap',
},
]
}
static registerLegacyRouteHandler() {}
}
class PuppetforgeModuleEndorsement extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'puppetforge/e',
}
}
static get examples() {
return [
{
title: 'Puppet Forge',
previewUrl: 'camptocamp/openssl',
},
]
}
static registerLegacyRouteHandler() {}
}
class PuppetforgeModuleFeedback extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'puppetforge/f',
}
}
static get examples() {
return [
{
title: 'Puppet Forge',
previewUrl: 'camptocamp/openssl',
},
]
}
static registerLegacyRouteHandler() {}
}
class PuppetforgeModules extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/puppetforge\/([^/]+)\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
@@ -83,3 +175,11 @@ module.exports = class PuppetforgeModules extends LegacyService {
)
}
}
module.exports = {
PuppetforgeModuleVersion,
PuppetforgeModuleDownloads,
PuppetforgeModuleFeedback,
PuppetforgeModuleEndorsement,
PuppetforgeModules,
}

View File

@@ -8,7 +8,53 @@ const {
const { metric } = require('../../lib/text-formatters')
const { floorCount: floorCountColor } = require('../../lib/color-formatters')
module.exports = class PuppetforgeUsers extends LegacyService {
class PuppetforgeUserReleases extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'puppetforge/rc',
}
}
static get examples() {
return [
{
title: 'Puppet Forge',
previewUrl: 'camptocamp',
},
]
}
static registerLegacyRouteHandler() {}
}
class PuppetforgeUserModules extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'puppetforge/mc',
}
}
static get examples() {
return [
{
title: 'Puppet Forge',
previewUrl: 'camptocamp',
},
]
}
static registerLegacyRouteHandler() {}
}
class PuppetforgeUsers extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/puppetforge\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
@@ -49,3 +95,9 @@ module.exports = class PuppetforgeUsers extends LegacyService {
)
}
}
module.exports = {
PuppetforgeUserReleases,
PuppetforgeUserModules,
PuppetforgeUsers,
}

View File

@@ -7,6 +7,31 @@ const { starRating } = require('../../lib/text-formatters')
const { floorCount: floorCountColor } = require('../../lib/color-formatters')
module.exports = class Redmine extends LegacyService {
static get category() {
return 'rating'
}
static get route() {
return {
base: 'redmine/plugin',
}
}
static get examples() {
return [
{
title: 'Plugin on redmine.org',
previewUrl: 'rating/redmine_xlsx_format_issue_exporter',
keywords: ['redmine', 'plugin'],
},
{
title: 'Plugin on redmine.org',
previewUrl: 'stars/redmine_xlsx_format_issue_exporter',
keywords: ['redmine', 'plugin'],
},
]
}
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/redmine\/plugin\/(rating|stars)\/(.*)\.(svg|png|gif|jpg|json)$/,

View File

@@ -8,7 +8,53 @@ const {
const { metric } = require('../../lib/text-formatters')
const { floorCount: floorCountColor } = require('../../lib/color-formatters')
module.exports = class StackExchange extends LegacyService {
class StackExchangeReputation extends LegacyService {
static get category() {
return 'rating'
}
static get route() {
return {
base: 'stackexchange',
}
}
static get examples() {
return [
{
title: 'StackExchange',
previewUrl: 'tex/r/951',
},
]
}
static registerLegacyRouteHandler() {}
}
class StackExchangeQuestions extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'stackexchange',
}
}
static get examples() {
return [
{
title: 'StackExchange',
previewUrl: 'stackoverflow/t/augeas',
},
]
}
static registerLegacyRouteHandler() {}
}
class StackExchange extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/stackexchange\/([^/]+)\/([^/])\/([^/]+)\.(svg|png|gif|jpg|json)$/,
@@ -64,3 +110,9 @@ module.exports = class StackExchange extends LegacyService {
)
}
}
module.exports = {
StackExchangeReputation,
StackExchangeQuestions,
StackExchange,
}

View File

@@ -12,7 +12,128 @@ const {
age: ageColor,
} = require('../../lib/color-formatters')
module.exports = class VaadinDirectory extends LegacyService {
class VaadinDirectoryRating extends LegacyService {
static get category() {
return 'rating'
}
static get route() {
return {
base: 'vaadin-directory',
}
}
static get examples() {
return [
{
title: 'Vaadin Directory',
previewUrl: 'rating/vaadinvaadin-grid',
keywords: ['vaadin-directory', 'vaadin directory', 'rating'],
},
{
title: 'Vaadin Directory',
previewUrl: 'stars/vaadinvaadin-grid',
keywords: ['vaadin-directory', 'vaadin directory', 'star', 'stars'],
},
{
title: 'Vaadin Directory',
previewUrl: 'rating-count/vaadinvaadin-grid',
keywords: [
'vaadin-directory',
'vaadin directory',
'rating-count',
'rating count',
],
},
]
}
static registerLegacyRouteHandler() {}
}
class VaadinDirectoryVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'vaadin-directory/v',
}
}
static get examples() {
return [
{
title: 'Vaadin Directory',
previewUrl: 'vaadinvaadin-grid',
keywords: [
'vaadin-directory',
'vaadin directory',
'version',
'latest version',
],
},
]
}
static registerLegacyRouteHandler() {}
}
class VaadinDirectoryStatus extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'vaadin-directory/status',
}
}
static get examples() {
return [
{
title: 'Vaadin Directory',
previewUrl: 'vaadinvaadin-grid',
keywords: ['vaadin-directory', 'vaadin directory', 'status'],
},
]
}
static registerLegacyRouteHandler() {}
}
class VaadinDirectoryReleaseDate extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'vaadin-directory/release-date',
}
}
static get examples() {
return [
{
title: 'Vaadin Directory',
previewUrl: 'vaadinvaadin-grid',
keywords: [
'vaadin-directory',
'vaadin directory',
'date',
'latest release date',
],
},
]
}
static registerLegacyRouteHandler() {}
}
class VaadinDirectory extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/vaadin-directory\/(star|stars|status|rating|rc|rating-count|v|version|rd|release-date)\/(.*).(svg|png|gif|jpg|json)$/,
@@ -101,3 +222,11 @@ module.exports = class VaadinDirectory extends LegacyService {
)
}
}
module.exports = {
VaadinDirectoryRating,
VaadinDirectoryVersion,
VaadinDirectoryStatus,
VaadinDirectoryReleaseDate,
VaadinDirectory,
}

View File

@@ -48,7 +48,84 @@ function getVscodeStatistic(data, statisticName) {
}
}
module.exports = class VscodeMarketplace extends LegacyService {
class VscodeMarketplaceDownloads extends LegacyService {
static get category() {
return 'downloads'
}
static get route() {
return {
base: 'vscode-marketplace/d',
}
}
static get examples() {
return [
{
title: 'Visual Studio Marketplace',
previewUrl: 'ritwickdey.LiveServer',
keywords: ['vscode-marketplace'],
},
]
}
static registerLegacyRouteHandler() {}
}
class VscodeMarketplaceRating extends LegacyService {
static get category() {
return 'rating'
}
static get route() {
return {
base: 'vscode-marketplace',
}
}
static get examples() {
return [
{
title: 'Visual Studio Marketplace',
previewUrl: 'r/ritwickdey.LiveServer',
keywords: ['vscode-marketplace'],
},
{
title: 'Visual Studio Marketplace',
previewUrl: 'stars/ritwickdey.LiveServer',
keywords: ['vscode-marketplace'],
},
]
}
static registerLegacyRouteHandler() {}
}
class VscodeMarketplaceVersion extends LegacyService {
static get category() {
return 'version'
}
static get route() {
return {
base: 'vscode-marketplace/v',
}
}
static get examples() {
return [
{
title: 'Visual Studio Marketplace',
previewUrl: 'ritwickdey.LiveServer',
keywords: ['vscode-marketplace'],
},
]
}
static registerLegacyRouteHandler() {}
}
class VscodeMarketplace extends LegacyService {
static registerLegacyRouteHandler({ camp, cache }) {
camp.route(
/^\/vscode-marketplace\/(d|v|r|stars)\/(.*)\.(svg|png|gif|jpg|json)$/,
@@ -116,3 +193,10 @@ module.exports = class VscodeMarketplace extends LegacyService {
)
}
}
module.exports = {
VscodeMarketplaceDownloads,
VscodeMarketplaceRating,
VscodeMarketplaceVersion,
VscodeMarketplace,
}