renovate/lib
Peter Valdemar Mørch c7a7ffbeed
feat(config): allow exporting async config (#13075)
* feat(config): allow exporting async config (#13035)

module.exports can now be a function and it can be/return a Promise,
allowing the results of asynchronous operations to be used in the
configuration.

The discussion leading up to this PR in #13035 assumed that
module.exports had to be a plain object.

But this commit:

  commit 9aa97af5b3
  Author: Nejc Habjan <hab.nejc@gmail.com>
  Date:   Thu Dec 9 13:45:48 2021 +0100

      feat(config)!: parse JSON5/YAML self-hosted admin config (#12644)

      Adds support for alternative admin config file formats.

      BREAKING CHANGE: Renovate will now fail if RENOVATE_CONFIG_FILE is specified without a file extension

Had as an undocumented side effect, that it also handled transparenty
if module.exports was assigned a Promise. With that commit, the
promise will be await-ed so the resolved value is returned from
getConfig(). That was not the case before that commit.

So in this commit, configs that export functions are handled, and
test cases for both promises and functions have been added.

* Update lib/workers/global/config/parse/__fixtures__/fileAsyncFunction.js

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* feat(config): Fixed linter problems (#13035)

* feat(config)!: Add doc for JSON5/YAML self-hosted admin config (#12644)

The code was introduced in 9aa97af5b and here is the documentation to
go with it

* feat(config): Document config.js exports (#13035)

* feat(config): Rename file*.js to config*.js because they really are config (#13035)

* Update docs/usage/getting-started/running.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update docs/usage/getting-started/running.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-12-13 21:51:36 +00:00
..
config chore: sort keys replacement presets (#13090) 2021-12-13 20:31:25 +00:00
constants refactor: introduce enum programming-language (#12052) 2021-10-13 10:54:40 +00:00
datasource fix: don't semver filter git-refs and git-tags (#13043) 2021-12-10 09:12:21 +00:00
logger fix: modify regex to be re2 compatbile (#12778) 2021-11-29 19:16:05 +00:00
manager test(manager/cargo): migrate to fs.readLocalFile (#13063) 2021-12-13 09:46:55 +00:00
platform feat!: remove node v12 and node v15 support (#12658) 2021-12-09 13:44:42 +01:00
types docs: release as asset (#11429) 2021-12-09 21:12:49 +01:00
util refactor(util/exec): Fix strict null errors (#12909) 2021-12-10 15:07:02 +01:00
versioning refactor(versioning/nuget): simplify by using class (#13059) 2021-12-11 17:16:56 +00:00
workers feat(config): allow exporting async config (#13075) 2021-12-13 21:51:36 +00:00
config-validator.ts feat(config)!: parse JSON5/YAML self-hosted admin config (#12644) 2021-12-09 13:45:48 +01:00
globals.d.ts fix: remove global.gitAuthor (#11536) 2021-09-02 14:08:12 +02:00
proxy.spec.ts feat(proxy): lowercase proxy env (#10025) 2021-05-19 13:37:27 +02:00
proxy.ts feat(proxy): lowercase proxy env (#10025) 2021-05-19 13:37:27 +02:00
renovate.spec.ts fix: move tests into lib (#5635) 2020-03-05 21:57:24 +01:00
renovate.ts fix: unhandledRejection (#9472) 2021-04-09 16:16:00 +02:00