Skip to content

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

Closed
@F-happy

Description

@F-happy

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 [];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    intend to implementThe team has the intention to implement this feature at some point. Contribution is also welcome.scope: plugin API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions