Skip to content

给插件的prompts暴露内部的inquirer对象 #5167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
F-happy opened this issue Feb 9, 2020 · 0 comments · Fixed by #5498
Closed

给插件的prompts暴露内部的inquirer对象 #5167

F-happy opened this issue Feb 9, 2020 · 0 comments · Fixed by #5498
Labels
intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome. scope: plugin API

Comments

@F-happy
Copy link

F-happy commented Feb 9, 2020

What problem does this feature solve?

我们内部在使用vue-cli的时候有个需求是使用vue invoken generate 来生成一些代码,而在执行之前会使用prompts对用户进行一些询问,但是我想让用户进行一些搜索功能,类似于这样,但是我发现目前无法通过类似这样:inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt')); 拓展inquirer。

What does the proposed API look like?

如果prompts.js 返回的是一个函数的话,现在第一个参数是pkg,希望提供第二个参数inquirer,类似于下面

prompts.js 

module.exports = (pkg, inquirer) => {
    inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
    return [];
}
@haoqunjiang haoqunjiang added scope: plugin API intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome. labels May 16, 2020
haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this issue May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome. scope: plugin API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants