diff --git a/lib/manager/ansible-galaxy/extract.spec.ts b/lib/manager/ansible-galaxy/extract.spec.ts index 1e2b80d0a62666e58f9599f86149e6f42f350036..c445492aa28e9732d2b8a994ff294e621111b52a 100644 --- a/lib/manager/ansible-galaxy/extract.spec.ts +++ b/lib/manager/ansible-galaxy/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../test/util'; -import extractPackageFile, { getSliceEndNumber } from './extract'; +import { extractPackageFile, getSliceEndNumber } from './extract'; const yamlFile1 = loadFixture('requirements01.yml'); const yamlFile2 = loadFixture('requirements02.yml'); diff --git a/lib/manager/ansible-galaxy/extract.ts b/lib/manager/ansible-galaxy/extract.ts index b1ac37cc44f73c33d19ab00eb06fcb467f3ff449..8ce428608f72bae3fe67d11e230cbd50209641ae 100644 --- a/lib/manager/ansible-galaxy/extract.ts +++ b/lib/manager/ansible-galaxy/extract.ts @@ -22,7 +22,7 @@ export function getSliceEndNumber( return nearestEnd; } -export default function extractPackageFile( +export function extractPackageFile( content: string, fileName: string ): PackageFile | null { diff --git a/lib/manager/ansible-galaxy/index.ts b/lib/manager/ansible-galaxy/index.ts index ffde8df477ad889814537aa539f3809931a14831..fc92ebe669faeaeb717b5b98d3defacf68dd6d74 100644 --- a/lib/manager/ansible-galaxy/index.ts +++ b/lib/manager/ansible-galaxy/index.ts @@ -1,7 +1,15 @@ -import extractPackageFile from './extract'; +import { GalaxyCollectionDatasource } from '../../datasource/galaxy-collection'; +import { GitTagsDatasource } from '../../datasource/git-tags'; +import * as datasourceGithubTags from '../../datasource/github-tags'; -export { extractPackageFile }; +export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: ['(^|/)requirements\\.ya?ml$', '(^|/)galaxy\\.ya?ml$'], }; + +export const supportedDatasources = [ + GalaxyCollectionDatasource.id, + GitTagsDatasource.id, + datasourceGithubTags.id, +]; diff --git a/lib/manager/ansible/extract.spec.ts b/lib/manager/ansible/extract.spec.ts index f7217a3500a71377b37fce831d2234162b635f8b..aedbcc2c1e4841f880c8f49ca4a63001c49d8f2b 100644 --- a/lib/manager/ansible/extract.spec.ts +++ b/lib/manager/ansible/extract.spec.ts @@ -1,5 +1,5 @@ import { loadFixture } from '../../../test/util'; -import extractPackageFile from './extract'; +import { extractPackageFile } from './extract'; const yamlFile1 = loadFixture('main1.yaml'); const yamlFile2 = loadFixture('main2.yaml'); diff --git a/lib/manager/ansible/extract.ts b/lib/manager/ansible/extract.ts index 4ee13ef36f048aa92b4a765ee5eb8f72dbbeefc2..740921fbc6bcf912d70e973bfa77c525071735ea 100644 --- a/lib/manager/ansible/extract.ts +++ b/lib/manager/ansible/extract.ts @@ -4,9 +4,7 @@ import * as dockerVersioning from '../../versioning/docker'; import { getDep } from '../dockerfile/extract'; import type { PackageDependency, PackageFile } from '../types'; -export default function extractPackageFile( - content: string -): PackageFile | null { +export function extractPackageFile(content: string): PackageFile | null { logger.trace('ansible.extractPackageFile()'); let deps: PackageDependency[] = []; const re = regEx(/^\s*image:\s*'?"?([^\s'"]+)'?"?\s*$/); diff --git a/lib/manager/ansible/index.ts b/lib/manager/ansible/index.ts index 0af8b33e33cbee9c250f33c601de92b4b4a9cc29..cbe22b450165cde911421bb78d1cece7ea1f452e 100644 --- a/lib/manager/ansible/index.ts +++ b/lib/manager/ansible/index.ts @@ -1,10 +1,11 @@ import { ProgrammingLanguage } from '../../constants'; -import extractPackageFile from './extract'; +import * as datasourceDocker from '../../datasource/docker'; +export { extractPackageFile } from './extract'; -const language = ProgrammingLanguage.Docker; - -export { extractPackageFile, language }; +export const language = ProgrammingLanguage.Docker; export const defaultConfig = { fileMatch: ['(^|/)tasks/[^/]+\\.ya?ml$'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/argocd/index.ts b/lib/manager/argocd/index.ts index 1012c71468dbc48b337475d9c06e8a2591ee13b4..a02db98b72a445f4cd740a1ca47917e3c40d6bea 100644 --- a/lib/manager/argocd/index.ts +++ b/lib/manager/argocd/index.ts @@ -1,5 +1,9 @@ +import { GitTagsDatasource } from '../../datasource/git-tags'; +import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: [], }; + +export const supportedDatasources = [GitTagsDatasource.id, HelmDatasource.id]; diff --git a/lib/manager/azure-pipelines/index.ts b/lib/manager/azure-pipelines/index.ts index adbfba940a0e4158be1d67e9454d0bf1d9c706e9..bf14289b5456781adcc526588e44419d72dfa32d 100644 --- a/lib/manager/azure-pipelines/index.ts +++ b/lib/manager/azure-pipelines/index.ts @@ -1,5 +1,8 @@ +import { GitTagsDatasource } from '../../datasource/git-tags'; export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: ['azure.*pipelines?.*\\.ya?ml$'], }; + +export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/manager/batect-wrapper/index.ts b/lib/manager/batect-wrapper/index.ts index 3c3359a888440202d9e04d3b4cbd008fd25d6064..dcaa1c1e63f28ba08c7a4dd378d2faecb17cf2d2 100644 --- a/lib/manager/batect-wrapper/index.ts +++ b/lib/manager/batect-wrapper/index.ts @@ -1,3 +1,4 @@ +import { id as githubReleaseDatasource } from '../../datasource/github-releases'; import { id as versioning } from '../../versioning/semver'; export { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const defaultConfig = { fileMatch: ['(^|/)batect$'], versioning, }; + +export const supportedDatasources = [githubReleaseDatasource]; diff --git a/lib/manager/batect/index.ts b/lib/manager/batect/index.ts index 708f9392195c590b7f471865d119fd2db177ad1d..b8fd77a5e8aa0d327d8a55803a2ea5162dd749f5 100644 --- a/lib/manager/batect/index.ts +++ b/lib/manager/batect/index.ts @@ -1,3 +1,4 @@ +import { GitTagsDatasource } from '../../datasource/git-tags'; import { extractAllPackageFiles, extractPackageFile } from './extract'; export { extractAllPackageFiles, extractPackageFile }; @@ -5,3 +6,5 @@ export { extractAllPackageFiles, extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)batect(-bundle)?\\.yml$'], }; + +export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/manager/bazel/index.ts b/lib/manager/bazel/index.ts index 61b6798640db93fcca9a3bc1a7d87d9d3300fcd9..b487be7da6e2b9bf16a0d90a7647fcaf5fa60bda 100644 --- a/lib/manager/bazel/index.ts +++ b/lib/manager/bazel/index.ts @@ -1,3 +1,7 @@ +import * as datasourceDocker from '../../datasource/docker'; +import * as datasourceGithubReleases from '../../datasource/github-releases'; +import * as datasourceGithubTags from '../../datasource/github-tags'; +import * as datasourceGo from '../../datasource/go'; import { extractPackageFile } from './extract'; import { updateDependency } from './update'; @@ -6,3 +10,10 @@ export { extractPackageFile, updateDependency }; export const defaultConfig = { fileMatch: ['(^|/)WORKSPACE(|\\.bazel)$', '\\.bzl$'], }; + +export const supportedDatasources = [ + datasourceDocker.id, + datasourceGithubReleases.id, + datasourceGithubTags.id, + datasourceGo.id, +]; diff --git a/lib/manager/bitbucket-pipelines/index.ts b/lib/manager/bitbucket-pipelines/index.ts index acf2524bd45a43d506a6b8870a5cc935741c0009..a51d837bc58277d6d50e43d3d32cf5a1e74a9efc 100644 --- a/lib/manager/bitbucket-pipelines/index.ts +++ b/lib/manager/bitbucket-pipelines/index.ts @@ -1,3 +1,4 @@ +import * as datasourceDocker from '../../datasource/docker'; import { extractPackageFile } from './extract'; export { extractPackageFile }; @@ -5,3 +6,5 @@ export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)\\.?bitbucket-pipelines\\.ya?ml$'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/buildkite/index.ts b/lib/manager/buildkite/index.ts index d678d7fd3c206dd5298128605dd980241cff8e4d..3350b60ce64d49e0d52159a65d5490cfd8cc1c01 100644 --- a/lib/manager/buildkite/index.ts +++ b/lib/manager/buildkite/index.ts @@ -1,3 +1,4 @@ +import * as datasourceGithubTags from '../../datasource/github-tags'; import { extractPackageFile } from './extract'; export { extractPackageFile }; @@ -8,3 +9,5 @@ export const defaultConfig = { commitMessageExtra: 'to {{#if isMajor}}v{{{newMajor}}}{{else}}{{{newValue}}}{{/if}}', }; + +export const supportedDatasources = [datasourceGithubTags.id]; diff --git a/lib/manager/bundler/index.ts b/lib/manager/bundler/index.ts index 3ef026f8b798efe70908bc340f0e79d101c47716..310e0f63ec0b5c7211c3760b928d48bc3ced31c8 100644 --- a/lib/manager/bundler/index.ts +++ b/lib/manager/bundler/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { RubyGemsDatasource } from '../../datasource/rubygems'; import * as rubyVersioning from '../../versioning/ruby'; import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; @@ -25,3 +26,5 @@ export const defaultConfig = { fileMatch: ['(^|/)Gemfile$'], versioning: rubyVersioning.id, }; + +export const supportedDatasources = [RubyGemsDatasource.id]; diff --git a/lib/manager/cake/index.ts b/lib/manager/cake/index.ts index 5d2a05166c602d4459c699faeb64fe6db3fb7967..68e0d1d3dc7e77b9be1b979069f40547d8cb3ec5 100644 --- a/lib/manager/cake/index.ts +++ b/lib/manager/cake/index.ts @@ -69,3 +69,5 @@ export function extractPackageFile(content: string): PackageFile { } return { deps }; } + +export const supportedDatasources = [datasource]; diff --git a/lib/manager/cargo/index.ts b/lib/manager/cargo/index.ts index 37f2b4bd7c69dd17637bbdb418688eef4bf2e10f..b308ca9227ca8363dbb7682adc3f0ae049a69f68 100644 --- a/lib/manager/cargo/index.ts +++ b/lib/manager/cargo/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { CrateDatasource } from '../../datasource/crate'; import * as cargoVersioning from '../../versioning/cargo'; import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; @@ -14,3 +15,5 @@ export const defaultConfig = { versioning: cargoVersioning.id, rangeStrategy: 'bump', }; + +export const supportedDatasources = [CrateDatasource.id]; diff --git a/lib/manager/cdnurl/index.ts b/lib/manager/cdnurl/index.ts index edf2106e6533e37d13ad502c1273d8ed572ffd17..5480906fbf9d533459d12513a7c4db054e531501 100644 --- a/lib/manager/cdnurl/index.ts +++ b/lib/manager/cdnurl/index.ts @@ -1,3 +1,4 @@ +import { CdnJsDatasource } from '../../datasource/cdnjs'; import * as semverVersioning from '../../versioning/semver'; import { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const defaultConfig = { fileMatch: [], versioning: semverVersioning.id, }; + +export const supportedDatasources = [CdnJsDatasource.id]; diff --git a/lib/manager/circleci/index.ts b/lib/manager/circleci/index.ts index afef6591c1f8ad89291b6c1423f0b831d8c9ce06..705099e16def2ceb91482b1361f6db9abc019e60 100644 --- a/lib/manager/circleci/index.ts +++ b/lib/manager/circleci/index.ts @@ -1,3 +1,5 @@ +import * as datasourceDocker from '../../datasource/docker'; +import { OrbDatasource } from '../../datasource/orb'; import { extractPackageFile } from './extract'; export { extractPackageFile }; @@ -5,3 +7,5 @@ export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/).circleci/config.yml$'], }; + +export const supportedDatasources = [datasourceDocker.id, OrbDatasource.id]; diff --git a/lib/manager/cloudbuild/index.ts b/lib/manager/cloudbuild/index.ts index 3b96731222b8b95085dce1b15622fc0fda5ace49..cb4dc10014fd2f88ce4cea757e439a0a823910c2 100644 --- a/lib/manager/cloudbuild/index.ts +++ b/lib/manager/cloudbuild/index.ts @@ -1,3 +1,4 @@ +import * as datasourceDocker from '../../datasource/docker'; import { extractPackageFile } from './extract'; export { extractPackageFile }; @@ -5,3 +6,5 @@ export { extractPackageFile }; export const defaultConfig = { fileMatch: ['(^|/)cloudbuild.ya?ml'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/cocoapods/index.ts b/lib/manager/cocoapods/index.ts index 783738d2bc720961f23a3e1a3c1f1a821cf11216..48284b915fe3680c0377dc59c53723622924e70a 100644 --- a/lib/manager/cocoapods/index.ts +++ b/lib/manager/cocoapods/index.ts @@ -1,3 +1,7 @@ +import { GitTagsDatasource } from '../../datasource/git-tags'; +import * as datasourceGithubTags from '../../datasource/github-tags'; +import * as datasourceGitlabTags from '../../datasource/gitlab-tags'; +import * as datasourcePod from '../../datasource/pod'; import * as rubyVersioning from '../../versioning/ruby'; export { extractPackageFile } from './extract'; @@ -7,3 +11,10 @@ export const defaultConfig = { fileMatch: ['(^|/)Podfile$'], versioning: rubyVersioning.id, }; + +export const supportedDatasources = [ + GitTagsDatasource.id, + datasourceGithubTags.id, + datasourceGitlabTags.id, + datasourcePod.id, +]; diff --git a/lib/manager/composer/index.ts b/lib/manager/composer/index.ts index 2a6f551852f5fc24c1f504096b18a3b93a3ac773..5295d55db7ea26ddfd8e299c0b441856eab31fc9 100644 --- a/lib/manager/composer/index.ts +++ b/lib/manager/composer/index.ts @@ -1,4 +1,6 @@ import { ProgrammingLanguage } from '../../constants'; +import { GitTagsDatasource } from '../../datasource/git-tags'; +import * as datasourcePackagist from '../../datasource/packagist'; import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; import { getRangeStrategy } from './range'; @@ -20,3 +22,8 @@ export const defaultConfig = { fileMatch: ['(^|/)([\\w-]*)composer.json$'], versioning: composerVersioningId, }; + +export const supportedDatasources = [ + GitTagsDatasource.id, + datasourcePackagist.id, +]; diff --git a/lib/manager/deps-edn/index.ts b/lib/manager/deps-edn/index.ts index 25df4094495b6c4f812c4d797dda15c87c0d30a7..599293213a68415d0132b2c0394467e1bab876f8 100644 --- a/lib/manager/deps-edn/index.ts +++ b/lib/manager/deps-edn/index.ts @@ -1,3 +1,4 @@ +import { ClojureDatasource } from '../../datasource/clojure'; import * as mavenVersioning from '../../versioning/maven'; import { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const defaultConfig = { fileMatch: ['(^|/)deps\\.edn$'], versioning: mavenVersioning.id, }; + +export const supportedDatasources = [ClojureDatasource.id]; diff --git a/lib/manager/docker-compose/index.ts b/lib/manager/docker-compose/index.ts index d89cad0cf059c1e88cb40720664de0810b1bafe5..d2314c5b646bf7edf331736409ceaadb62cfac09 100644 --- a/lib/manager/docker-compose/index.ts +++ b/lib/manager/docker-compose/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceDocker from '../../datasource/docker'; import { extractPackageFile } from './extract'; const language = ProgrammingLanguage.Docker; @@ -8,3 +9,5 @@ export { extractPackageFile, language }; export const defaultConfig = { fileMatch: ['(^|/)docker-compose[^/]*\\.ya?ml$'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/dockerfile/index.ts b/lib/manager/dockerfile/index.ts index b9b8ed54f9ea7731cac7661344002ce5c93eb816..7ebec5c8773dc180293a40d59f5a8e1c64c67df8 100644 --- a/lib/manager/dockerfile/index.ts +++ b/lib/manager/dockerfile/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceDocker from '../../datasource/docker'; import { extractPackageFile } from './extract'; const language = ProgrammingLanguage.Docker; @@ -8,3 +9,5 @@ export { extractPackageFile, language }; export const defaultConfig = { fileMatch: ['(^|/|\\.)Dockerfile$', '(^|/)Dockerfile\\.[^/]*$'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/droneci/index.ts b/lib/manager/droneci/index.ts index 8bf495e68ba414b0f666bcf14768027559ddeb14..a46b91d3f3752cd141c619a14bf0dd6e86f16496 100644 --- a/lib/manager/droneci/index.ts +++ b/lib/manager/droneci/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceDocker from '../../datasource/docker'; import { extractPackageFile } from './extract'; const language = ProgrammingLanguage.Docker; @@ -8,3 +9,5 @@ export { extractPackageFile, language }; export const defaultConfig = { fileMatch: ['(^|/).drone.yml$'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/git-submodules/index.ts b/lib/manager/git-submodules/index.ts index 22dde889eec8d7d10637092e5e3ea69e9b5668d7..a420292c7c9fcba381bfd6ad5feae440e6f5f67f 100644 --- a/lib/manager/git-submodules/index.ts +++ b/lib/manager/git-submodules/index.ts @@ -1,3 +1,4 @@ +import { GitRefsDatasource } from '../../datasource/git-refs'; import * as gitVersioning from '../../versioning/git'; export { default as extractPackageFile } from './extract'; @@ -9,3 +10,5 @@ export const defaultConfig = { versioning: gitVersioning.id, fileMatch: ['(^|/).gitmodules$'], }; + +export const supportedDatasources = [GitRefsDatasource.id]; diff --git a/lib/manager/github-actions/index.ts b/lib/manager/github-actions/index.ts index 7899690d2b26426a8c99ede660e0da434d45e17e..5d39f85406867bb87213d4760915ea8cb1334971 100644 --- a/lib/manager/github-actions/index.ts +++ b/lib/manager/github-actions/index.ts @@ -1,6 +1,7 @@ -import { extractPackageFile } from './extract'; +import * as githubTagsDatasource from '../../datasource/github-tags'; +import * as dockerVersioning from '../../versioning/docker'; -export { extractPackageFile }; +export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: [ @@ -8,3 +9,8 @@ export const defaultConfig = { '(^|\\/)action\\.ya?ml$', ], }; + +export const supportedDatasources = [ + githubTagsDatasource.id, + dockerVersioning.id, +]; diff --git a/lib/manager/gitlabci-include/index.ts b/lib/manager/gitlabci-include/index.ts index 9fa1f4d99fe3e41744dcf9eeb4203a3ba0d0ce43..77119f696a3fb48fa522e473a12cb954361154a4 100644 --- a/lib/manager/gitlabci-include/index.ts +++ b/lib/manager/gitlabci-include/index.ts @@ -1,3 +1,4 @@ +import * as datasourceGitlabTags from '../../datasource/gitlab-tags'; import { extractPackageFile } from './extract'; export { extractPackageFile }; @@ -5,3 +6,5 @@ export { extractPackageFile }; export const defaultConfig = { fileMatch: ['\\.gitlab-ci\\.yml$'], }; + +export const supportedDatasources = [datasourceGitlabTags.id]; diff --git a/lib/manager/gitlabci/index.ts b/lib/manager/gitlabci/index.ts index 44f7928318348e9717b33f0d0093d924ed27ec97..802c5072bb62f4e2dc3eca148d3a99ff3ad46f36 100644 --- a/lib/manager/gitlabci/index.ts +++ b/lib/manager/gitlabci/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceDocker from '../../datasource/docker'; import { extractAllPackageFiles, extractPackageFile } from './extract'; const language = ProgrammingLanguage.Docker; @@ -8,3 +9,5 @@ export { extractAllPackageFiles, extractPackageFile, language }; export const defaultConfig = { fileMatch: ['\\.gitlab-ci\\.yml$'], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/gomod/index.ts b/lib/manager/gomod/index.ts index f5283a240d4e6155b2ee7dffb68ac2f724455277..979f955d89cad43fcddcb1f60d1bbb64dbeb1d12 100644 --- a/lib/manager/gomod/index.ts +++ b/lib/manager/gomod/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceGo from '../../datasource/go'; import { updateArtifacts } from './artifacts'; import { extractPackageFile } from './extract'; import { updateDependency } from './update'; @@ -9,3 +10,5 @@ export { extractPackageFile, updateDependency, updateArtifacts }; export const defaultConfig = { fileMatch: ['(^|/)go.mod$'], }; + +export const supportedDatasources = [datasourceGo.id]; diff --git a/lib/manager/gradle-wrapper/index.ts b/lib/manager/gradle-wrapper/index.ts index f65174938dd047dac0b273aa0d39e9b9288284ee..f3b90c2237f19e67a8ebbdf3bbdc57eca343644a 100644 --- a/lib/manager/gradle-wrapper/index.ts +++ b/lib/manager/gradle-wrapper/index.ts @@ -1,3 +1,4 @@ +import { GradleVersionDatasource } from '../../datasource/gradle-version'; import { id as versioning } from '../../versioning/gradle'; export { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const defaultConfig = { fileMatch: ['(^|/)gradle/wrapper/gradle-wrapper.properties$'], versioning, }; + +export const supportedDatasources = [GradleVersionDatasource.id]; diff --git a/lib/manager/gradle/index.ts b/lib/manager/gradle/index.ts index b3ff818c5eaa6eb7308d353fd93c073d4a214021..2dd67902e1999dd567b81572623303d4dfa689d5 100644 --- a/lib/manager/gradle/index.ts +++ b/lib/manager/gradle/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceMaven from '../../datasource/maven'; import * as gradleVersioning from '../../versioning/gradle'; import type { ExtractConfig, @@ -38,3 +39,5 @@ export const defaultConfig = { timeout: 600, versioning: gradleVersioning.id, }; + +export const supportedDatasources = [datasourceMaven.id]; diff --git a/lib/manager/helm-requirements/index.ts b/lib/manager/helm-requirements/index.ts index e8cf05e2bff2dacf70167d7b923c8bb22b52f874..186ec412d9ed8dafef057539a0049419050660d6 100644 --- a/lib/manager/helm-requirements/index.ts +++ b/lib/manager/helm-requirements/index.ts @@ -1,3 +1,4 @@ +import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { @@ -7,3 +8,5 @@ export const defaultConfig = { commitMessageTopic: 'helm chart {{depName}}', fileMatch: ['(^|/)requirements\\.yaml$'], }; + +export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/manager/helm-values/index.ts b/lib/manager/helm-values/index.ts index 1ef75d28735ecae5d4846c3f3c10bf8bc8263394..2e2672550000429a9bc45081128297d71f92447e 100644 --- a/lib/manager/helm-values/index.ts +++ b/lib/manager/helm-values/index.ts @@ -1,3 +1,4 @@ +import * as datasourceDocker from '../../datasource/docker'; export { extractPackageFile } from './extract'; export const defaultConfig = { @@ -5,3 +6,5 @@ export const defaultConfig = { fileMatch: ['(^|/)values.yaml$'], pinDigests: false, }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/helmfile/index.ts b/lib/manager/helmfile/index.ts index d8d3e54196265383a96e439f65c469487acea017..915cbcf5b01c7d7dcdddf8d676d258490b3b5c79 100644 --- a/lib/manager/helmfile/index.ts +++ b/lib/manager/helmfile/index.ts @@ -1,3 +1,4 @@ +import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { @@ -7,3 +8,5 @@ export const defaultConfig = { commitMessageTopic: 'helm chart {{depName}}', fileMatch: ['(^|/)helmfile.yaml$'], }; + +export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/manager/helmsman/index.ts b/lib/manager/helmsman/index.ts index 1012c71468dbc48b337475d9c06e8a2591ee13b4..9f0cf9c133872299bfeea8bb90efba48e6c1db31 100644 --- a/lib/manager/helmsman/index.ts +++ b/lib/manager/helmsman/index.ts @@ -1,5 +1,8 @@ +import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: [], }; + +export const supportedDatasources = [HelmDatasource.id]; diff --git a/lib/manager/helmv3/index.ts b/lib/manager/helmv3/index.ts index 21a0ccd14f9e754ab6a357f5c1f4557300627688..de5feaa3731a6e87f3f06cefc54b05de084e5145 100644 --- a/lib/manager/helmv3/index.ts +++ b/lib/manager/helmv3/index.ts @@ -1,3 +1,5 @@ +import * as datasourceDocker from '../../datasource/docker'; +import { HelmDatasource } from '../../datasource/helm'; export { updateArtifacts } from './artifacts'; export { extractPackageFile } from './extract'; export { bumpPackageVersion } from './update'; @@ -11,3 +13,5 @@ export const defaultConfig = { commitMessageTopic: 'helm chart {{depName}}', fileMatch: ['(^|/)Chart.yaml$'], }; + +export const supportedDatasources = [datasourceDocker.id, HelmDatasource.id]; diff --git a/lib/manager/homebrew/index.ts b/lib/manager/homebrew/index.ts index b45e932cf7f9a7c18759df89214f566560d3b537..f41a1a84064d78a62341ed11f633737d0dc0a9e2 100644 --- a/lib/manager/homebrew/index.ts +++ b/lib/manager/homebrew/index.ts @@ -1,3 +1,4 @@ +import * as datasourceGithubTags from '../../datasource/github-tags'; export { extractPackageFile } from './extract'; export { updateDependency } from './update'; @@ -5,3 +6,5 @@ export const defaultConfig = { commitMessageTopic: 'Homebrew Formula {{depName}}', fileMatch: ['^Formula/[^/]+[.]rb$'], }; + +export const supportedDatasources = [datasourceGithubTags.id]; diff --git a/lib/manager/html/index.ts b/lib/manager/html/index.ts index 5b19123f0f68a1bdb9fae7dd7a39291eb9cfa94f..c196d4af869ec4fba08c93801ba7a00ec30c461a 100644 --- a/lib/manager/html/index.ts +++ b/lib/manager/html/index.ts @@ -1,3 +1,4 @@ +import { CdnJsDatasource } from '../../datasource/cdnjs'; import * as semverVersioning from '../../versioning/semver'; import { extractPackageFile } from './extract'; @@ -11,3 +12,5 @@ export const defaultConfig = { }, pinDigests: false, }; + +export const supportedDatasources = [CdnJsDatasource.id]; diff --git a/lib/manager/index.spec.ts b/lib/manager/index.spec.ts index 53da1cc52719f50e4052ec115e2275aaeb10dba2..009979be19054f4ef3e925e33c3ccdc4d7c2a4e3 100644 --- a/lib/manager/index.spec.ts +++ b/lib/manager/index.spec.ts @@ -1,10 +1,28 @@ +import { getDatasourceList } from '../datasource'; import { loadModules } from '../util/modules'; import type { ManagerApi } from './types'; import * as manager from '.'; jest.mock('../util/fs'); +const datasources = getDatasourceList(); + describe('manager/index', () => { + describe('supportedDatasources', () => { + for (const m of manager.getManagerList()) { + if (m === 'regex') { + // regex supports any + continue; + } + const supportedDatasources = manager.get(m, 'supportedDatasources'); + it(`has valid supportedDatasources for ${m}`, () => { + expect(supportedDatasources).toBeNonEmptyArray(); + supportedDatasources.every((d) => { + expect(datasources.includes(d)).toBeTrue(); + }); + }); + } + }); describe('get()', () => { it('gets something', () => { expect(manager.get('dockerfile', 'extractPackageFile')).not.toBeNull(); @@ -55,6 +73,7 @@ describe('manager/index', () => { it('returns null', async () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], }); expect( await manager.extractAllPackageFiles('unknown', {} as any, []) @@ -66,6 +85,7 @@ describe('manager/index', () => { it('returns non-null', async () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], extractAllPackageFiles: () => Promise.resolve([]), }); expect( @@ -81,6 +101,7 @@ describe('manager/index', () => { it('returns null', () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], }); expect(manager.extractPackageFile('unknown', null)).toBeNull(); expect(manager.extractPackageFile('dummy', null)).toBeNull(); @@ -88,6 +109,7 @@ describe('manager/index', () => { it('returns non-null', () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], extractPackageFile: () => Promise.resolve({ deps: [] }), }); @@ -102,6 +124,7 @@ describe('manager/index', () => { it('returns null', () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], }); expect( manager.getRangeStrategy({ manager: 'unknown', rangeStrategy: 'auto' }) @@ -110,6 +133,7 @@ describe('manager/index', () => { it('returns non-null', () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], getRangeStrategy: () => 'replace', }); expect( @@ -118,6 +142,7 @@ describe('manager/index', () => { manager.getManagers().set('dummy', { defaultConfig: {}, + supportedDatasources: [], }); expect( manager.getRangeStrategy({ manager: 'dummy', rangeStrategy: 'auto' }) diff --git a/lib/manager/jenkins/index.ts b/lib/manager/jenkins/index.ts index 6b8b845d29a5ee9ca0117f78021e3d30b567bea3..afe5c649940d34711281dcff175fbff6f21336e6 100644 --- a/lib/manager/jenkins/index.ts +++ b/lib/manager/jenkins/index.ts @@ -1,5 +1,8 @@ +import { JenkinsPluginsDatasource } from '../../datasource/jenkins-plugins'; export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: ['(^|/)plugins\\.(txt|ya?ml)$'], }; + +export const supportedDatasources = [JenkinsPluginsDatasource.id]; diff --git a/lib/manager/jsonnet-bundler/index.ts b/lib/manager/jsonnet-bundler/index.ts index aa3fd5480c994490450fcf45fdf0b9cb521643ff..df3ddd9a4d64e70e8cf80b1a7050d7798ca7b689 100644 --- a/lib/manager/jsonnet-bundler/index.ts +++ b/lib/manager/jsonnet-bundler/index.ts @@ -8,3 +8,5 @@ export const defaultConfig = { fileMatch: ['(^|/)jsonnetfile.json$'], datasource: GitTagsDatasource.id, }; + +export const supportedDatasources = [GitTagsDatasource.id]; diff --git a/lib/manager/kubernetes/index.ts b/lib/manager/kubernetes/index.ts index bc2ce7d3bb2326c736a7d9890e3a73cf108e4614..053562ef183ae29340f2d836e46270f098b9fe44 100644 --- a/lib/manager/kubernetes/index.ts +++ b/lib/manager/kubernetes/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceDocker from '../../datasource/docker'; export { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const language = ProgrammingLanguage.Docker; export const defaultConfig = { fileMatch: [], }; + +export const supportedDatasources = [datasourceDocker.id]; diff --git a/lib/manager/kustomize/index.ts b/lib/manager/kustomize/index.ts index d28c8186e0b315f5db49ac66d1b704083fea4224..c3ac88cd6e180cedab461d045673675be4602e53 100644 --- a/lib/manager/kustomize/index.ts +++ b/lib/manager/kustomize/index.ts @@ -1,6 +1,17 @@ +import * as datasourceDocker from '../../datasource/docker'; +import { GitTagsDatasource } from '../../datasource/git-tags'; +import * as datasourceGitHubTags from '../../datasource/github-tags'; +import { HelmDatasource } from '../../datasource/helm'; export { extractPackageFile } from './extract'; export const defaultConfig = { fileMatch: ['(^|/)kustomization\\.yaml'], pinDigests: false, }; + +export const supportedDatasources = [ + datasourceDocker.id, + GitTagsDatasource.id, + datasourceGitHubTags.id, + HelmDatasource.id, +]; diff --git a/lib/manager/leiningen/index.ts b/lib/manager/leiningen/index.ts index f501592d2cfe6ccda2001515cd1d05dd01a8d149..831fa32857badf934b5fe4f409d84aa2aa90a35c 100644 --- a/lib/manager/leiningen/index.ts +++ b/lib/manager/leiningen/index.ts @@ -1,3 +1,4 @@ +import { ClojureDatasource } from '../../datasource/clojure'; import * as mavenVersioning from '../../versioning/maven'; export { extractPackageFile } from './extract'; @@ -6,3 +7,5 @@ export const defaultConfig = { fileMatch: ['(^|/)project\\.clj$'], versioning: mavenVersioning.id, }; + +export const supportedDatasources = [ClojureDatasource.id]; diff --git a/lib/manager/maven/index.ts b/lib/manager/maven/index.ts index 3c6c02bfe10b7e36f7875e890e2b9a49057d2ec4..b53ff3213328a21449e3b6766cc1182cc7688857 100644 --- a/lib/manager/maven/index.ts +++ b/lib/manager/maven/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceMaven from '../../datasource/maven'; import * as mavenVersioning from '../../versioning/maven'; export { extractAllPackageFiles } from './extract'; @@ -10,3 +11,5 @@ export const defaultConfig = { fileMatch: ['\\.pom\\.xml$', '(^|/)pom\\.xml$'], versioning: mavenVersioning.id, }; + +export const supportedDatasources = [datasourceMaven.id]; diff --git a/lib/manager/meteor/index.ts b/lib/manager/meteor/index.ts index 81f312736e704657d013ad3af4b33791c8453426..63a1000f81414fd1f0e8916ae7c49d8edacd2410 100644 --- a/lib/manager/meteor/index.ts +++ b/lib/manager/meteor/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { id as npmId } from '../../datasource/npm'; export { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const language = ProgrammingLanguage.JavaScript; export const defaultConfig = { fileMatch: ['(^|/)package.js$'], }; + +export const supportedDatasources = [npmId]; diff --git a/lib/manager/mix/index.ts b/lib/manager/mix/index.ts index ca250c6fe9ab71b3c5e210cad3a1fb1d3b91690d..fc2ce8347a8fe60a46b8c569c95c75cfc3100623 100644 --- a/lib/manager/mix/index.ts +++ b/lib/manager/mix/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { HexDatasource } from '../../datasource/hex'; import * as hexVersioning from '../../versioning/hex'; export { extractPackageFile } from './extract'; @@ -10,3 +11,5 @@ export const defaultConfig = { fileMatch: ['(^|/)mix\\.exs$'], versioning: hexVersioning.id, }; + +export const supportedDatasources = [HexDatasource.id]; diff --git a/lib/manager/nodenv/index.ts b/lib/manager/nodenv/index.ts index d25368b739ad2136f041ad6d9bf06357e65ec4e6..cf206a758f8f98c4a2b4cead1b51694d1b634ccd 100644 --- a/lib/manager/nodenv/index.ts +++ b/lib/manager/nodenv/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceGithubTags from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; export { extractPackageFile } from './extract'; @@ -9,3 +10,5 @@ export const defaultConfig = { fileMatch: ['(^|/).node-version$'], versioning: nodeVersioning.id, }; + +export const supportedDatasources = [datasourceGithubTags.id]; diff --git a/lib/manager/npm/index.ts b/lib/manager/npm/index.ts index 35286fb455b45b637f355ebf5baf3eb7e46ae9ab..0d5bdbf49de3f9f2c7606b18c14ad0ad30f96a7c 100644 --- a/lib/manager/npm/index.ts +++ b/lib/manager/npm/index.ts @@ -1,4 +1,6 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceGithubTags from '../../datasource/github-tags'; +import { id as npmId } from '../../datasource/npm'; import * as npmVersioning from '../../versioning/npm'; export { detectGlobalConfig } from './detect'; @@ -28,3 +30,5 @@ export const defaultConfig = { "[{{#if displayFrom}}`{{{displayFrom}}}` -> {{else}}{{#if currentValue}}`{{{currentValue}}}` -> {{/if}}{{/if}}{{#if displayTo}}`{{{displayTo}}}`{{else}}`{{{newValue}}}`{{/if}}]({{#if depName}}https://renovatebot.com/diffs/npm/{{replace '/' '%2f' depName}}/{{{currentVersion}}}/{{{newVersion}}}{{/if}})", }, }; + +export const supportedDatasources = [datasourceGithubTags.id, npmId]; diff --git a/lib/manager/nuget/index.ts b/lib/manager/nuget/index.ts index 35f875646841c361197f6f8073ea212965dc1650..0fbdfe63c41d7d70d370a533b4197e7ccc716205 100644 --- a/lib/manager/nuget/index.ts +++ b/lib/manager/nuget/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceNuget from '../../datasource/nuget'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; @@ -13,3 +14,5 @@ export const defaultConfig = { '(^|\\/)global\\.json$', ], }; + +export const supportedDatasources = [datasourceNuget.id]; diff --git a/lib/manager/nvm/index.ts b/lib/manager/nvm/index.ts index 2bdae0516724573de7a294a7590d25dbfc317087..337f088cac9a10d3ac6f81f27a1cdcc2741496ff 100644 --- a/lib/manager/nvm/index.ts +++ b/lib/manager/nvm/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceGithubTags from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; export { extractPackageFile } from './extract'; @@ -10,3 +11,5 @@ export const defaultConfig = { versioning: nodeVersioning.id, pinDigests: false, }; + +export const supportedDatasources = [datasourceGithubTags.id]; diff --git a/lib/manager/pip-compile/index.ts b/lib/manager/pip-compile/index.ts index 99266a9dbecee144dd656ff797b9a49dab6c0bb0..0e9c0613532f55b3a0585d9bc59bc4e39c74c360 100644 --- a/lib/manager/pip-compile/index.ts +++ b/lib/manager/pip-compile/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from '../pip_requirements/extract'; export { updateArtifacts } from './artifacts'; @@ -6,6 +7,8 @@ export { updateArtifacts } from './artifacts'; export const language = ProgrammingLanguage.Python; export const supportsLockFileMaintenance = true; +export const supportedDatasources = [PypiDatasource.id]; + export const defaultConfig = { fileMatch: [], lockFileMaintenance: { diff --git a/lib/manager/pip_requirements/index.ts b/lib/manager/pip_requirements/index.ts index 351c36b7d765184cc286517e0eff1a625a739129..a2bf950ff25bca93cb7b11e670b4198c235bf343 100644 --- a/lib/manager/pip_requirements/index.ts +++ b/lib/manager/pip_requirements/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { PypiDatasource } from '../../datasource/pypi'; export { updateArtifacts } from './artifacts'; export { extractPackageFile } from './extract'; @@ -9,3 +10,5 @@ export const language = ProgrammingLanguage.Python; export const defaultConfig = { fileMatch: ['(^|/)([\\w-]*)requirements\\.(txt|pip)$'], }; + +export const supportedDatasources = [PypiDatasource.id]; diff --git a/lib/manager/pip_setup/index.ts b/lib/manager/pip_setup/index.ts index 643123288b2db37645fec31f7aacb4efa6fb2c46..9219cd5026c1e5991c19a0a983a58e1587889052 100644 --- a/lib/manager/pip_setup/index.ts +++ b/lib/manager/pip_setup/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; @@ -7,3 +8,5 @@ export const language = ProgrammingLanguage.Python; export const defaultConfig = { fileMatch: ['(^|/)setup.py$'], }; + +export const supportedDatasources = [PypiDatasource.id]; diff --git a/lib/manager/pipenv/index.ts b/lib/manager/pipenv/index.ts index 3f4726a3623a19c27ddd620189193625b53257aa..acb2766bc355f3ea515b848724f3f84d6befbbcf 100644 --- a/lib/manager/pipenv/index.ts +++ b/lib/manager/pipenv/index.ts @@ -1,4 +1,5 @@ import { ProgrammingLanguage } from '../../constants'; +import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; @@ -6,6 +7,8 @@ export { updateArtifacts } from './artifacts'; export const language = ProgrammingLanguage.Python; export const supportsLockFileMaintenance = true; +export const supportedDatasources = [PypiDatasource.id]; + export const defaultConfig = { fileMatch: ['(^|/)Pipfile$'], }; diff --git a/lib/manager/poetry/index.ts b/lib/manager/poetry/index.ts index 9ce8080082fae277f09c00d739021d4928d8f911..3440d2cbaa6f172d3239a8acb508ea402811d77b 100644 --- a/lib/manager/poetry/index.ts +++ b/lib/manager/poetry/index.ts @@ -1,8 +1,11 @@ import { ProgrammingLanguage } from '../../constants'; +import { PypiDatasource } from '../../datasource/pypi'; export { extractPackageFile } from './extract'; export { updateArtifacts } from './artifacts'; +export const supportedDatasources = [PypiDatasource.id]; + export const language = ProgrammingLanguage.Python; export const supportsLockFileMaintenance = true; diff --git a/lib/manager/pre-commit/index.ts b/lib/manager/pre-commit/index.ts index f8d1af666821f6d2bbf2719def2bb2869a016ad6..e596a408168ad7085386e4d24e37eac0cb8dc534 100644 --- a/lib/manager/pre-commit/index.ts +++ b/lib/manager/pre-commit/index.ts @@ -1,5 +1,9 @@ +import { id as githubTagsId } from '../../datasource/github-tags'; +import { id as gitlabTagsId } from '../../datasource/gitlab-tags'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [githubTagsId, gitlabTagsId]; + export const defaultConfig = { commitMessageTopic: 'pre-commit hook {{depName}}', enabled: false, diff --git a/lib/manager/pub/index.ts b/lib/manager/pub/index.ts index dcdceecd7fd3a9d009aeb2dc60d3965fa949bc99..1fde801f57a505e3fa83461ca072a75bea04fa88 100644 --- a/lib/manager/pub/index.ts +++ b/lib/manager/pub/index.ts @@ -1,7 +1,10 @@ +import { DartDatasource } from '../../datasource/dart'; import * as npmVersioning from '../../versioning/npm'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [DartDatasource.id]; + export const defaultConfig = { fileMatch: ['(^|/)pubspec\\.ya?ml$'], versioning: npmVersioning.id, diff --git a/lib/manager/pyenv/index.ts b/lib/manager/pyenv/index.ts index a569478bcb8f21ff828b489986efaf396e84a6a7..3be9c1f5836ee6ea53f80258f5f52100ad55b531 100644 --- a/lib/manager/pyenv/index.ts +++ b/lib/manager/pyenv/index.ts @@ -1,10 +1,13 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceDocker from '../../datasource/docker'; import * as dockerVersioning from '../../versioning/docker'; export { extractPackageFile } from './extract'; export const language = ProgrammingLanguage.Python; +export const supportedDatasources = [datasourceDocker.id]; + export const defaultConfig = { fileMatch: ['(^|/).python-version$'], versioning: dockerVersioning.id, diff --git a/lib/manager/regex/index.ts b/lib/manager/regex/index.ts index 7557012ad67dc5dea1709ce9a766081876b0fb54..0856607cff1eec44ab0310fc9071796a1408ecbb 100644 --- a/lib/manager/regex/index.ts +++ b/lib/manager/regex/index.ts @@ -11,6 +11,8 @@ export const defaultConfig = { pinDigests: false, }; +export const supportedDatasources = ['*']; + export function extractPackageFile( content: string, packageFile: string, diff --git a/lib/manager/regex/readme.md b/lib/manager/regex/readme.md index 71d5337bb073a514e3167b768a7b7b84f73c472a..75becb1c6f63951104e7a4f75f585ffa2ff794a5 100644 --- a/lib/manager/regex/readme.md +++ b/lib/manager/regex/readme.md @@ -3,7 +3,8 @@ The `regex` manager is designed to allow users to manually configure Renovate fo This manager is unique in Renovate in that: - It is configurable via regex named capture groups -- Through the use of the `regexManagers` config, multiple "regex managers" can be created for the same repository. +- Through the use of the `regexManagers` config, multiple "regex managers" can be created for the same repository +- It can extract any `datasource` ### Required Fields diff --git a/lib/manager/ruby-version/index.ts b/lib/manager/ruby-version/index.ts index dd4c7214153f3c0847fc8c656e9af83d14598b4b..757ef8d8009843f210ab206f946f316e433f9516 100644 --- a/lib/manager/ruby-version/index.ts +++ b/lib/manager/ruby-version/index.ts @@ -1,8 +1,11 @@ import { ProgrammingLanguage } from '../../constants'; +import { RubyVersionDatasource } from '../../datasource/ruby-version'; import * as rubyVersioning from '../../versioning/ruby'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [RubyVersionDatasource.id]; + export const language = ProgrammingLanguage.Ruby; export const defaultConfig = { diff --git a/lib/manager/sbt/index.ts b/lib/manager/sbt/index.ts index 017a1a8acb28c1a12b3222d328f2908aae91c476..e281179a86cb21896f8cd29b072f5035492375b3 100644 --- a/lib/manager/sbt/index.ts +++ b/lib/manager/sbt/index.ts @@ -1,8 +1,17 @@ +import * as datasourceMaven from '../../datasource/maven'; +import * as datasourceSbtPackage from '../../datasource/sbt-package'; +import * as datasourceSbtPlugin from '../../datasource/sbt-plugin'; import * as ivyVersioning from '../../versioning/ivy'; export { extractPackageFile } from './extract'; export { bumpPackageVersion } from './update'; +export const supportedDatasources = [ + datasourceMaven.id, + datasourceSbtPackage.id, + datasourceSbtPlugin.id, +]; + export const defaultConfig = { fileMatch: ['\\.sbt$', 'project/[^/]*.scala$'], versioning: ivyVersioning.id, diff --git a/lib/manager/setup-cfg/index.ts b/lib/manager/setup-cfg/index.ts index 270df5da4dcd40807259b480d84d2f066bc5ddec..d954804eb5f80147e6b4311392fa65fd91743020 100644 --- a/lib/manager/setup-cfg/index.ts +++ b/lib/manager/setup-cfg/index.ts @@ -1,9 +1,12 @@ import { ProgrammingLanguage } from '../../constants'; +import { PypiDatasource } from '../../datasource/pypi'; import { id as versioning } from '../../versioning/pep440'; export { extractPackageFile } from './extract'; export { getRangeStrategy } from './range'; +export const supportedDatasources = [PypiDatasource.id]; + export const language = ProgrammingLanguage.Python; export const defaultConfig = { diff --git a/lib/manager/swift/index.ts b/lib/manager/swift/index.ts index e9102b4cf28e42203b91f7608b9d22b33c64f5a7..4d5967e2f5dc83e7270248f881d85ab377ae0324 100644 --- a/lib/manager/swift/index.ts +++ b/lib/manager/swift/index.ts @@ -1,7 +1,10 @@ +import { GitTagsDatasource } from '../../datasource/git-tags'; import * as swiftVersioning from '../../versioning/swift'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [GitTagsDatasource.id]; + export const defaultConfig = { fileMatch: ['(^|/)Package\\.swift'], versioning: swiftVersioning.id, diff --git a/lib/manager/terraform-version/index.ts b/lib/manager/terraform-version/index.ts index 9a55bdbd5c3eb7dc6e39b1fd049804ceded7485c..718e39968c88ab6b20e3f4a4fcf537aa4fb9de1c 100644 --- a/lib/manager/terraform-version/index.ts +++ b/lib/manager/terraform-version/index.ts @@ -1,7 +1,10 @@ +import * as datasourceGitHubRelease from '../../datasource/github-releases'; import * as hashicorpVersioning from '../../versioning/hashicorp'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [datasourceGitHubRelease.id]; + export const defaultConfig = { fileMatch: ['(^|/)\\.terraform-version$'], versioning: hashicorpVersioning.id, diff --git a/lib/manager/terraform/index.ts b/lib/manager/terraform/index.ts index 17107d2b17b8bd77ea0975bf5186c24ef18ed687..cea16def596a0f253d6e17f2938b37c8071d768e 100644 --- a/lib/manager/terraform/index.ts +++ b/lib/manager/terraform/index.ts @@ -1,8 +1,23 @@ +import { BitBucketTagsDatasource } from '../../datasource/bitbucket-tags'; +import { GitTagsDatasource } from '../../datasource/git-tags'; +import * as datasourceGithubTags from '../../datasource/github-tags'; +import { HelmDatasource } from '../../datasource/helm'; +import { TerraformModuleDatasource } from '../../datasource/terraform-module'; +import { TerraformProviderDatasource } from '../../datasource/terraform-provider'; import * as hashicorpVersioning from '../../versioning/hashicorp'; export { updateArtifacts } from './lockfile'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [ + BitBucketTagsDatasource.id, + GitTagsDatasource.id, + datasourceGithubTags.id, + HelmDatasource.id, + TerraformModuleDatasource.id, + TerraformProviderDatasource.id, +]; + export const supportsLockFileMaintenance = true; export const defaultConfig = { commitMessageTopic: diff --git a/lib/manager/terragrunt-version/index.ts b/lib/manager/terragrunt-version/index.ts index fe24c1f17b48ad248565d7651b396ee5c8d4b86d..1b6aa3b029f620d07bf584b32d03c7daf509cb17 100644 --- a/lib/manager/terragrunt-version/index.ts +++ b/lib/manager/terragrunt-version/index.ts @@ -1,7 +1,10 @@ +import * as datasourceGitHubRelease from '../../datasource/github-releases'; import * as hashicorpVersioning from '../../versioning/hashicorp'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [datasourceGitHubRelease.id]; + export const defaultConfig = { fileMatch: ['(^|/)\\.terragrunt-version$'], versioning: hashicorpVersioning.id, diff --git a/lib/manager/terragrunt/index.ts b/lib/manager/terragrunt/index.ts index 61960a825bc735936eb302a4eb9e9e98f7df3cd4..ac5b5a06287f32d50cc809cd32fae1a60286631c 100644 --- a/lib/manager/terragrunt/index.ts +++ b/lib/manager/terragrunt/index.ts @@ -1,7 +1,16 @@ +import { GitTagsDatasource } from '../../datasource/git-tags'; +import * as datasourceGithubTags from '../../datasource/github-tags'; +import { TerraformModuleDatasource } from '../../datasource/terraform-module'; import * as hashicorpVersioning from '../../versioning/hashicorp'; export { extractPackageFile } from './extract'; +export const supportedDatasources = [ + GitTagsDatasource.id, + datasourceGithubTags.id, + TerraformModuleDatasource.id, +]; + export const defaultConfig = { commitMessageTopic: 'Terragrunt dependency {{depName}}', fileMatch: ['(^|/)terragrunt\\.hcl$'], diff --git a/lib/manager/travis/index.ts b/lib/manager/travis/index.ts index 14e453374c0990fb882ad639cc43243e0aa06fee..ee13640188eefbf5c172a76bbd51ec00e2014263 100644 --- a/lib/manager/travis/index.ts +++ b/lib/manager/travis/index.ts @@ -1,10 +1,13 @@ import { ProgrammingLanguage } from '../../constants'; +import * as datasourceGithubTags from '../../datasource/github-tags'; import * as nodeVersioning from '../../versioning/node'; export { extractPackageFile } from './extract'; export const language = ProgrammingLanguage.NodeJS; +export const supportedDatasources = [datasourceGithubTags.id]; + export const defaultConfig = { fileMatch: ['^.travis.yml$'], major: { diff --git a/lib/manager/types.ts b/lib/manager/types.ts index 6bfecd4489b711bada9e15286469049238cf6863..0ce2162f2647c60c3deaf26a3ff2bad9fdfbd4bf 100644 --- a/lib/manager/types.ts +++ b/lib/manager/types.ts @@ -246,6 +246,8 @@ export interface ManagerApi extends ModuleApi { language?: ProgrammingLanguage; supportsLockFileMaintenance?: boolean; + supportedDatasources: string[]; + bumpPackageVersion?( content: string, currentValue: string, diff --git a/tools/docs/manager.ts b/tools/docs/manager.ts index bf3bbd4323f2daa98726d05aed2a9454acedd88d..b4eb71109f8207d71e741eac14ea6c9a9f059648 100644 --- a/tools/docs/manager.ts +++ b/tools/docs/manager.ts @@ -21,7 +21,7 @@ export async function generateManagers(dist: string): Promise<void> { const language = definition.language || 'other'; allLanguages[language] = allLanguages[language] || []; allLanguages[language].push(manager); - const { defaultConfig } = definition; + const { defaultConfig, supportedDatasources } = definition; const { fileMatch } = defaultConfig as RenovateConfig; const displayName = getDisplayName(manager, definition); let md = `--- @@ -56,8 +56,15 @@ sidebar_label: ${displayName} } } md += `For details on how to extend a manager's \`fileMatch\` value, please follow [this link](/modules/manager/#file-matching).\n\n`; + md += '## Supported datasources\n\n'; + const escapedDatasources = (supportedDatasources || []) + .map( + (datasource) => + `[\`${datasource}\`](../datasource/#${datasource}-datasource)` + ) + .join(', '); + md += `This manager supports extracting the following datasources: ${escapedDatasources}.\n\n`; } - const managerReadmeContent = await readFile( `lib/manager/${manager}/readme.md` );