prompt: add enum picker and prompts for fields
I've been using cz-cli and have just tried out commitlint/prompt. Something that commitlint/prompt offers that I wish existed in cz-cli is the character count for the type/scope/subject. On the other hand, I really like cz-cli's ability to prompt for every part of the commit message (type, scope, subject etc) with individualized instructions. cz-cli also offers a picker for the commit type with explanation of each option. It'd be fantastic if commitlint can incorporate those great features from cz-cli.
Thanks for the suggestion @huy-nguyen. I like to think about @commitlint/prompt as the smaller brother of most cz-cli adapters, opting for the versatility tab-completion instead of forcing everyone to step through the option interfaces.
Perhaps there is some possibility to combine the two, say by displaying tab completion entries as said picker?
What's indeed missing are explanations to the different entry types. I am not quite sure where to put that information yet. Ideas?
I think we can replace tab completion for enums with the picker and adopt cz-cli's approach of putting the explanation next to each choice. Maybe a better solution is to allow for configurations so that people can choose if they want tab completion or picker for each field within the commit message?
Another shortcoming of cz-cli is that it doesn't allow for paragraphs within the body. Maybe @commitlint/prompt can allow for that capability?
I think handling command line input in NodeJS has gotten better over the years. I really like how Facebook's jest test runner makes inputting stuff in the terminal a delight. @commitlint/prompt can become the leader in this field if it addresses those usability issues.
I rolled around the idea a bit.
-
Explanation for rules should definitely be added. We will use those while linting, too.
-
I chose tab-completion to accomodate very long option lists better. Those are produced frequently by my projects using the lerna and patternplate presets. If we add cz-cli style selectors they should be strictly optional and only be activated for a manageable number of items. Does jest apply an appropriate ux pattern for this?
-
multiline is really hard. I tried to solve this and wound up implementing a crappy text editor. Perhaps ink makes things easy enough to make this worthwhile?