convert some service classes to static fields, run [GitHubLernaJson GithubLicense GithubManifest GithubMilestoneDetail GithubMilestone GithubPackageJson] (#5595)

* refactor(githublernajson): convert to static fields

* refactor(githublicense): convert to static fields

* refactor(githubmanifest): convert to static fields

* refactor(githubmilestonedetail): convert to static fields

* refactor(githubmilestone): convert to static fields

* refactor(githubpackagejson): convert to static fields
This commit is contained in:
Caleb Cartwright
2020-09-23 22:41:36 -05:00
committed by GitHub
parent ec5b976c0d
commit b149659187
6 changed files with 328 additions and 422 deletions

View File

@@ -12,44 +12,33 @@ const versionSchema = Joi.object({
}).required()
module.exports = class GithubLernaJson extends ConditionalGithubAuthV3Service {
static get category() {
return 'version'
static category = 'version'
static route = {
base: 'github/lerna-json/v',
pattern: ':user/:repo/:branch*',
}
static get route() {
return {
base: 'github/lerna-json/v',
pattern: ':user/:repo/:branch*',
}
}
static examples = [
{
title: 'Github lerna version',
pattern: ':user/:repo',
namedParams: { user: 'babel', repo: 'babel' },
staticPreview: this.render({ version: '7.6.4' }),
documentation,
},
{
title: 'Github lerna version (branch)',
pattern: ':user/:repo/:branch',
namedParams: { user: 'jneander', repo: 'jneander', branch: 'colors' },
staticPreview: this.render({
version: 'independent',
branch: 'colors',
}),
documentation,
},
]
static get examples() {
return [
{
title: 'Github lerna version',
pattern: ':user/:repo',
namedParams: { user: 'babel', repo: 'babel' },
staticPreview: this.render({ version: '7.6.4' }),
documentation,
},
{
title: 'Github lerna version (branch)',
pattern: ':user/:repo/:branch',
namedParams: { user: 'jneander', repo: 'jneander', branch: 'colors' },
staticPreview: this.render({
version: 'independent',
branch: 'colors',
}),
documentation,
},
]
}
static get defaultBadgeData() {
return {
label: 'lerna',
}
}
static defaultBadgeData = { label: 'lerna' }
static render({ version, branch }) {
return renderVersionBadge({