"message" does not appear to be supporting 'typeof Function', contrary to docs.
According to the docs, message can take either a String or a Function:
message: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers.
So, I would expect the following question object to print the previous answers in the prompt:
{
type: 'confirm',
name: 'confirmCreateComponent',
message: function (answers) {
return (
`Are you sure you would like to create the following component?
name: <${answers.ComponentName} />
type: ${answers.componentType}
location: ${path.join(__dirname, answers.dir)}
`
);
},
Instead, it prints the function body in the prompt:
? [COMPONENT] function (answers) {
return (
`Are you sure you would like to create the following component?
name: <${answers.ComponentName} />
type: ${answers.componentType}
location: ${path.join(__dirname, answers.dir)}
`
);
} (Y/n)
Am I misunderstanding the docs?
Looks like this should work. It's possible we broke something at some point during a release and no one realized? (might even just be a bug with the confirm prompt...)
is this something that was fixed in a previous version? I just realized that Plop.js is using [email protected]
Oh quite possible then, would you mind testing on the latest release?