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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user