Skip to content
Snippets Groups Projects
  • Peter Valdemar Mørch's avatar
    c7a7ffbe
    feat(config): allow exporting async config (#13075) · c7a7ffbe
    Peter Valdemar Mørch authored
    
    * 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 9aa97af5
      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: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    
    * Update lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js
    
    Co-authored-by: default avatarHonkingGoose <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 9aa97af5 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: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    
    * Update docs/usage/getting-started/running.md
    
    Co-authored-by: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    
    Co-authored-by: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    Co-authored-by: default avatarMichael Kriese <michael.kriese@visualon.de>
    c7a7ffbe
    History
    feat(config): allow exporting async config (#13075)
    Peter Valdemar Mørch authored
    
    * 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 9aa97af5
      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: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    
    * Update lib/workers/global/config/parse/__fixtures__/fileFunctionPromise.js
    
    Co-authored-by: default avatarHonkingGoose <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 9aa97af5 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: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    
    * Update docs/usage/getting-started/running.md
    
    Co-authored-by: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    
    Co-authored-by: default avatarHonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
    Co-authored-by: default avatarMichael Kriese <michael.kriese@visualon.de>