Skip to content

Conversation

@TheOptimisticFactory
Copy link

Main changes

  • Added option to enable support of inquirer plugins, which defaults to false when not provided. As the result, this PR preserves backward-compatibility.

@TheOptimisticFactory TheOptimisticFactory force-pushed the feature/optional-support-of-inquirer-plugins branch from 9405ba2 to 19aed8f Compare July 21, 2020 13:44
@TheOptimisticFactory TheOptimisticFactory force-pushed the feature/optional-support-of-inquirer-plugins branch from 19aed8f to f3f2d14 Compare July 22, 2020 17:12
@TheOptimisticFactory
Copy link
Author

Pinging @nanovazquez just in case, as it seems I cannot request a review :)

@MaximusHaximus
Copy link

I was just about to create a PR with something like this in it. Our use case is that we use various Inquirer plugins such as inquirer-fuzzy-path, etc. -- and because the existing code calls createPromptModule, any questions processed by Inquirer that were defined using yargs-interactive cannot use any modules that we have registered with Inquirer, even if we register them at the very top of the first file we load.

As far as backwards compatibility -- there's actually not even any real reason to use createPromptModule() at all in yargs-interactive, because yargs-interactive doesn't even call registerModule(). Even if it did. you only really need to use createPromptModule() if you are about to register other modules against inquirer and you don't want any other consumers of inquirer to be effected by your registerModule() call. In practice, this only matters if you are about to override an existing inquirer prompt with something that has a different API than the original did. If all you're doing is adding new modules, that would not be a breaking change anyway.

So IMO it would be perfectly safe to just remove L9 entirely (const prompt = inquirer.createPromptModule();) and just call inquirer.promp() directly.

@nanovazquez Is this project maintained anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants