renovate/lib/datasource
renovate[bot] 4f59b62da4
chore(deps): update dependency prettier to v2 (#5952)
* chore(deps): update dependency prettier to v2

* Run prettier-fix

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
2020-04-12 18:09:36 +02:00
..
__snapshots__ feat: replace datasource constants with IDs (#5595) 2020-03-01 08:01:12 +01:00
cdnjs feat(internal): cached datasource lookups (#5870) 2020-04-04 17:34:43 +02:00
clojure fix: Revert "fix: Revert "feat(internal): datasource defaultRegistryUrls / appendRegistry… (#5686)"" 2020-04-07 16:14:41 +02:00
crate chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
dart refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00
docker chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
galaxy refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00
git-refs chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
git-submodules chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
git-tags chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
github-releases chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
github-tags chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
gitlab-tags refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00
go chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
gradle-version chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
helm chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
hex refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00
maven chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
npm chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
nuget chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
orb refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00
packagist chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
pod chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
pypi chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
ruby-version chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
rubygems chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
sbt-package chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
sbt-plugin chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
terraform-module chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
terraform-provider chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
cache.ts feat(internal): cached datasource lookups (#5870) 2020-04-04 17:34:43 +02:00
common.ts feat(internal): datasource defaultConfig (#5929) 2020-04-09 15:44:23 +02:00
index.spec.ts refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00
index.ts chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
metadata.spec.ts fix: revert datasource error handling changes 2020-03-12 12:48:57 +01:00
metadata.ts chore(deps): update dependency prettier to v2 (#5952) 2020-04-12 18:09:36 +02:00
readme.md refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02:00

Datasources

Datasources are used in Renovate primarily to fetch released versions of packages.

getReleases

The minimum exported interface for a datasource is a function called getReleases that takes a lookup config as input.

The config contains:

  • lookupName: the package's full name including scope if present (e.g. @foo/bar)
  • registryUrls: an array of registry Urls to try

getReleases should return an object containing:

  • releases: an array of strings of matched versions. This is the only mandatory field.
  • deprecationMessage: a string description of the package's deprecation notice, if applicable
  • sourceUrl: a HTTP URL pointing to the source code (e.g. on GitHub)
  • homepage: a HTTP URL for the package's homepage. Ideally should be empty if the homepage and sourceUrl are the same
  • changelogUrl: a URL pointing to the package's Changelog (could be a markdown file, for example). If not present then Renovate will search the sourceUrl for a changelog file.
  • tags: an object mapping tag -> version, e.g. tags: { latest: '3.0.0' }. This is only used by the followTags function.

getDigest

Datasources that support the concept of digests (e.g. docker digests and git commit hashes) also can export a getDigest function.

The getDigest function has two inputs:

  • config: the Renovate config for the package being updated, contains same fields as getReleases
  • newValue: the version or value to retrieve the digest for

The getDigest function returns a string output representing the digest value. If none is found then a return value of null should be returned.