Convert a format to pattern in [githubpackagejson] (#3660)

This now relies on the order in which these are registered, though that seems okay. Exporting them as an array guarantees that.

Ref #3329
This commit is contained in:
Paul Melnikow
2019-07-07 12:41:30 -04:00
committed by GitHub
parent eec904c262
commit 9b6a51b61e

View File

@@ -171,6 +171,8 @@ class GithubPackageJsonDependencyVersion extends ConditionalGithubAuthService {
}
}
// This must be exported after GithubPackageJsonVersion in order for the
// former to work correctly.
class DynamicGithubPackageJson extends ConditionalGithubAuthService {
static get category() {
return 'other'
@@ -179,8 +181,7 @@ class DynamicGithubPackageJson extends ConditionalGithubAuthService {
static get route() {
return {
base: 'github/package-json',
format: '(?!v)([^/]+)/([^/]+)/([^/]+)/?([^/]+)?',
capture: ['key', 'user', 'repo', 'branch'],
pattern: ':key/:user/:repo/:branch*',
}
}
@@ -252,8 +253,8 @@ class DynamicGithubPackageJson extends ConditionalGithubAuthService {
}
}
module.exports = {
module.exports = [
GithubPackageJsonVersion,
GithubPackageJsonDependencyVersion,
DynamicGithubPackageJson,
}
]