refactor: update capabilities:create command to use new inquirer#761
Conversation
|
| validate: unitOfMeasureValidator, | ||
| })).unitOfMeasure | ||
| const choices: Type[] = ['integer', 'number', 'string', 'boolean'] | ||
| return await select({ message: `Select an ${message} type:`, choices }) |
There was a problem hiding this comment.
I recognize that this is unchanged from the previous version, and the things that we're asking for type for both start with vowels, but I wonder if it might be a more robust solution to include the indefinite article in the message that's passed in rather than the wrapper. So message might be "an attribute" and the wrapper would be Select ${message} type:. That way, if we ever want to use this function in the future for something that doesn't start with a vowel, the message presented to the viewer won't be weird.
There was a problem hiding this comment.
I almost did that when I was refactoring but decided it wasn't worth it since we need to re-do this whole file to use the input-item module anyway. I probably shouldn't have done half the things I did.
| message: 'If you want to add argument, enter a name for it now (enter to finish): ', | ||
| })).argumentName | ||
| argumentName = | ||
| await optionalStringInput('If you want to add argument, enter a name for it now (enter to finish): ') |
There was a problem hiding this comment.
Also a carry-over from the previous version, but: "an argument"?
There was a problem hiding this comment.
Good catch, fixed.
ca762e9 to
04cb6a2
Compare
capabilities:createcommand to use new inquirer