Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompt: add enum picker and prompts for fields #63

Open
huy-nguyen opened this issue Aug 17, 2017 · 3 comments
Open

prompt: add enum picker and prompts for fields #63

huy-nguyen opened this issue Aug 17, 2017 · 3 comments

Comments

@huy-nguyen
Copy link

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.

@marionebl
Copy link
Contributor

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?

@huy-nguyen
Copy link
Author

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.

@marionebl
Copy link
Contributor

marionebl commented Aug 21, 2017

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?

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

No branches or pull requests

2 participants