cz-cli
                                
                                 cz-cli copied to clipboard
                                
                                    cz-cli copied to clipboard
                            
                            
                            
                        Provide easier access to commitizen config to prompters
Currently when writing a prompter, e.g., cz-conventional-commit, if you wish to integrate with commitizen configuration then you need to do the following:
var configLoader = require('commitizen').configLoader;
configLoader.load() // synchronous, not a promise
I think it'd be nicer to actually have commitizen inject said configuration into prompters, e.g.,
module.exports = {
  prompter: function myAdapter(inquirer, config, commit) {
  }
}
This would remove the backwards dependency from prompters to commitizen, and reduce the need to test that config actually was loaded correctly when testing prompters, and allow for standardised configuration between all prompters. It could also be done in a backwards compatible manner by checking the length of the prompter function (that tells you how many arguments it expects)
I agree. I think this is a good idea. It'd be a breaking change but certainly would be an improvement.
@jimthedev I don't think it'd be a breaking change, as you can check if the prompter function has an arity of 2 or 3, by using function#length, e.g.,
function current(cz, commit) { }
function proposed(inquirer, config, commit) { }
console.log(current.length == 2)
console.log(proposed.length == 3)
Allowing you to switch between the previous API and the new one.