Going through CLI is slow
It seems like the CLI does something after I answer each question it asks. I'm getting tired of how long it takes; I create a lot of packages. Couldn't it just ask all the questions upfront, and then do all of the work afterward so that we don't have to sit and wait for each question?
Did you try
semantic-release-cli setup --gh-token=... --npm-token=...
That should speed up things
Yeah...but that requires remembering all the arguments. Going through prompts is easier on the brain except for the waiting. Though I guess since I pretty much always pass the same arguments I could just make a little script that calls it.
Would you be willing to accept a PR? I see that this is happening because the code basically requires the modules in sequence, which means each one prompts and then does its stuff before moving onto the next prompt:
await require('./lib/repository')(pkg, info);
await require('./lib/npm')(pkg, info);
await require('./lib/github')(pkg, info);
await require('./lib/ci')(pkg, info);
I could refactor this to store all the input first and then pass it in when it does the real work afterward:
const steps = [
'./lib/repository',
'./lib/npm',
'./lib/github',
'./lib/ci',
]
const userInput = {}
for (let step of steps) {
const {prompt} = require(step)
if (prompt) userInput[step] = await prompt(pkg, info)
}
for (let step of steps) {
await require(step)(pkg, info, userInput[step])
}
That doesn't really matter. I tried requiring everything first locally, and that hardly makes any difference. Apparently the biggest impact is from the actions it performs after the questions.
@kbrandwijk I was suggesting separating the inquirer prompts from the action steps so that I could do all the questions first before doing any of the actions