Feature request: wrap enquirer for questions
Currently the question() function is awkward to use when you need a user prompt other than basic text input. Will it be a lot of work to wrap enquirer instead? This will bring a lot of elegance and power to the UI, allowing for example, select and multi-select prompts.
Maybe I'm missing something here but why don't you import it yourself? That's what I do in my scripts (with inquirer instead of enquirer though). You can even replace question() if you really want to.
import { prompt } from 'enquirer'
global.question = prompt
const response = await question({
type: 'input',
name: 'username',
message: 'What is your username?'
});
echo(response);
@pizzafroide that is actually what we currently do as well, but we have uncompiled hosted scripts that we want to share with a recipe like:
if you have zx installed you can scaffold a new project with:
zx --install https://raw.githubusercontent.com/path/to/script/init.mjs
Trying to avoid a recipe like:
if you have zx and enquirer and chalk and fs installed you can scaffold a new project with ...
still relevant? Pull request welcome?
If there is solid indication that the maintainers are interested in this direction, then I would be keen to have a go at a PR. For now, we have settled on dax and have not bumped into any limitations for our use case.