I don't think doing it automagically in composer.json is a good idea, as the file pollutes the global namespace.