Skip to content

Commit

Permalink
add meaningful descriptions including keywords (#9715)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s authored Nov 8, 2023
1 parent 3ea96c3 commit bde30b2
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 14 deletions.
5 changes: 3 additions & 2 deletions services/amo/amo-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Joi from 'joi'
import { nonNegativeInteger } from '../validators.js'
import { BaseJsonService } from '../index.js'

const keywords = ['amo', 'firefox']
const description =
'[addons.mozilla.org](https://addons.mozilla.org) (AMO) publishes extensions for Mozilla Firefox'

const schema = Joi.object({
average_daily_users: nonNegativeInteger,
Expand All @@ -26,4 +27,4 @@ class BaseAmoService extends BaseJsonService {
}
}

export { BaseAmoService, keywords }
export { BaseAmoService, description }
5 changes: 3 additions & 2 deletions services/amo/amo-downloads.service.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { renderDownloadsBadge } from '../downloads.js'
import { redirector, pathParams } from '../index.js'
import { BaseAmoService } from './amo-base.js'
import { BaseAmoService, description as baseDescription } from './amo-base.js'

const description = `${baseDescription}
const description = `
Previously \`amo/d\` provided a “total downloads” badge. However,
[updates to the v3 API](https://github.com/badges/shields/issues/3079)
only give us weekly downloads. The route \`amo/d\` redirects to \`amo/dw\`.
Expand Down
4 changes: 3 additions & 1 deletion services/amo/amo-rating.service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { starRating } from '../text-formatters.js'
import { floorCount as floorCountColor } from '../color-formatters.js'
import { pathParams } from '../index.js'
import { BaseAmoService } from './amo-base.js'
import { BaseAmoService, description } from './amo-base.js'

export default class AmoRating extends BaseAmoService {
static category = 'rating'
Expand All @@ -11,12 +11,14 @@ export default class AmoRating extends BaseAmoService {
'/amo/rating/{addonId}': {
get: {
summary: 'Mozilla Add-on Rating',
description,
parameters: pathParams({ name: 'addonId', example: 'dustman' }),
},
},
'/amo/stars/{addonId}': {
get: {
summary: 'Mozilla Add-on Stars',
description,
parameters: pathParams({ name: 'addonId', example: 'dustman' }),
},
},
Expand Down
3 changes: 2 additions & 1 deletion services/amo/amo-users.service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderDownloadsBadge } from '../downloads.js'
import { pathParams } from '../index.js'
import { BaseAmoService } from './amo-base.js'
import { BaseAmoService, description } from './amo-base.js'

export default class AmoUsers extends BaseAmoService {
static category = 'downloads'
Expand All @@ -10,6 +10,7 @@ export default class AmoUsers extends BaseAmoService {
'/amo/users/{addonId}': {
get: {
summary: 'Mozilla Add-on Users',
description,
parameters: pathParams({ name: 'addonId', example: 'dustman' }),
},
},
Expand Down
3 changes: 2 additions & 1 deletion services/amo/amo-version.service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderVersionBadge } from '../version.js'
import { pathParams } from '../index.js'
import { BaseAmoService } from './amo-base.js'
import { BaseAmoService, description } from './amo-base.js'

export default class AmoVersion extends BaseAmoService {
static category = 'version'
Expand All @@ -10,6 +10,7 @@ export default class AmoVersion extends BaseAmoService {
'/amo/v/{addonId}': {
get: {
summary: 'Mozilla Add-on Version',
description,
parameters: pathParams({ name: 'addonId', example: 'dustman' }),
},
},
Expand Down
2 changes: 1 addition & 1 deletion services/bit/bit-components.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class BitComponents extends BaseJsonService {
static openApi = {
'/bit/collection/total-components/{owner}/{collection}': {
get: {
summary: 'Bit',
summary: 'Bit Components',
parameters: pathParams(
{
name: 'owner',
Expand Down
5 changes: 4 additions & 1 deletion services/coincap/coincap-base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { BaseJsonService } from '../index.js'

const description =
'[Coincap](https://coincap.io/) is a cryptocurrency exchange'

export default class BaseCoincapService extends BaseJsonService {
static category = 'other'

Expand All @@ -19,4 +22,4 @@ export default class BaseCoincapService extends BaseJsonService {
}
}

export { BaseCoincapService }
export { BaseCoincapService, description }
3 changes: 2 additions & 1 deletion services/coincap/coincap-changepercent24hr.service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Joi from 'joi'
import { pathParams } from '../index.js'
import { floorCount } from '../color-formatters.js'
import BaseCoincapService from './coincap-base.js'
import { BaseCoincapService, description } from './coincap-base.js'

const schema = Joi.object({
data: Joi.object({
Expand All @@ -19,6 +19,7 @@ export default class CoincapChangePercent24HrUsd extends BaseCoincapService {
'/coincap/change-percent-24hr/{assetId}': {
get: {
summary: 'Coincap (Change Percent 24Hr)',
description,
parameters: pathParams({
name: 'assetId',
example: 'bitcoin',
Expand Down
3 changes: 2 additions & 1 deletion services/coincap/coincap-priceusd.service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Joi from 'joi'
import { pathParams } from '../index.js'
import BaseCoincapService from './coincap-base.js'
import { BaseCoincapService, description } from './coincap-base.js'

const schema = Joi.object({
data: Joi.object({
Expand All @@ -18,6 +18,7 @@ export default class CoincapPriceUsd extends BaseCoincapService {
'/coincap/price-usd/{assetId}': {
get: {
summary: 'Coincap (Price USD)',
description,
parameters: pathParams({
name: 'assetId',
example: 'bitcoin',
Expand Down
3 changes: 2 additions & 1 deletion services/coincap/coincap-rank.service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Joi from 'joi'
import { pathParams } from '../index.js'
import BaseCoincapService from './coincap-base.js'
import { BaseCoincapService, description } from './coincap-base.js'

const schema = Joi.object({
data: Joi.object({
Expand All @@ -18,6 +18,7 @@ export default class CoincapRank extends BaseCoincapService {
'/coincap/rank/{assetId}': {
get: {
summary: 'Coincap (Rank)',
description,
parameters: pathParams({
name: 'assetId',
example: 'bitcoin',
Expand Down
1 change: 1 addition & 0 deletions services/conan/conan-version.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class ConanVersion extends ConditionalGithubAuthV3Service {
'/conan/v/{packageName}': {
get: {
summary: 'Conan Center',
description: '[Conan](https://conan.io/) is a package manager for C++',
parameters: pathParams({
name: 'packageName',
example: 'boost',
Expand Down
3 changes: 2 additions & 1 deletion services/cpan/cpan-license.service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pathParams } from '../index.js'
import BaseCpanService from './cpan.js'
import { BaseCpanService, description } from './cpan.js'

export default class CpanLicense extends BaseCpanService {
static category = 'license'
Expand All @@ -9,6 +9,7 @@ export default class CpanLicense extends BaseCpanService {
'/cpan/l/{packageName}': {
get: {
summary: 'CPAN License',
description,
parameters: pathParams({
name: 'packageName',
example: 'Config-Augeas',
Expand Down
3 changes: 2 additions & 1 deletion services/cpan/cpan-version.service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pathParams } from '../index.js'
import { renderVersionBadge } from '../version.js'
import BaseCpanService from './cpan.js'
import { BaseCpanService, description } from './cpan.js'

export default class CpanVersion extends BaseCpanService {
static category = 'version'
Expand All @@ -10,6 +10,7 @@ export default class CpanVersion extends BaseCpanService {
'/cpan/v/{packageName}': {
get: {
summary: 'CPAN Version',
description,
parameters: pathParams({
name: 'packageName',
example: 'Config-Augeas',
Expand Down
5 changes: 5 additions & 0 deletions services/cpan/cpan.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const schema = Joi.object({
license: Joi.array().items(Joi.string()).min(1).required(),
}).required()

const description =
'[CPAN](https://www.cpan.org/) is a package registry for Perl'

export default class BaseCpanService extends BaseJsonService {
static defaultBadgeData = { label: 'cpan' }

Expand All @@ -14,3 +17,5 @@ export default class BaseCpanService extends BaseJsonService {
return this._requestJson({ schema, url })
}
}

export { BaseCpanService, description }

0 comments on commit bde30b2

Please sign in to comment.