-
Notifications
You must be signed in to change notification settings - Fork 28
Make the default app generator prompt user for choice #67
Conversation
…ther app generators. * Support for direct usage via npx.
What is the benefit of showing warnings when generating? We get quite a few which is not confidence-inspiring. For example:
Could we suppress the warnings instead for better user experience? Many of our developers are not super experienced and those warnings can be intimidating. |
type: 'list', | ||
name: 'generator_type', | ||
message: 'Select Blockstack app output type', | ||
choices: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The (Use arrow keys)
disappears after the one use. Is there any reason to make them disappear?
(Use arrow keys to select and press ENTER)
Many of our app mining users are beginner programmers from other countries. It helps to use complete sentences and instructions and to leave the instructions in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is behavior and messaging hardcoded by what yo
prompt
uses: https://github.com/SBoudrias/Inquirer.js/blob/d3d632a7d94b3d719152c109f1865a8a9a2a2432/packages/inquirer/lib/prompts/list.js#L84-L86
One work around is to use raw index lists which let us customize that message, but then forces a number-based UI (arrow keys do still work):
Those appear to be our 2 options, I'm fine with either -- what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I suspected this might be the case. Um, I think the number based thing is a lot more obvious than the keyboard input. Let's go with that if you can do it easy. Thanks for adjusting this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with that change ^
Yeah I hate these warnings, they are in almost all of our projects as a result of bitcoinjs-lib dependencies.
Hmm, possibly. However, On a positive note -- the plans I have so far for |
@zone117x The prompting system should be tested on Windows and Ubuntu. I attempted some tests in Windows VM but hard to tell if the issues I encountered were related to Windows or the env I was running in. Specifically, arrow keys did not work to navigate the prompts. Though, arrow keys did work in general throughout my VM. Aborting the interactive prompts resulted in this: I did use ENTER to take the default React generation in my next test. The npm succeeded with odd errors: Then, after the We should be testing this in Windows/Ubuntu as well as Mac OS, this generator should work in all three and produce a generated app the compiles in all three. It could be the env in one or the other needs to be prettty specific to actually succeeded. I had limited time to do a full test run in Windows and none at all in Ubuntu. cc: @timstackblock |
Looks like a problem with your environment. Installation and running works just fine for me with Windows support is widely considered to be cmd.exe and Powershell, both of which work. Also tested with Ubuntu 18.04. |
Thanks for testing. My env was definitely suspect, I was just using Git Bash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great for me 👍
Signed-off-by: Mary Anthony <mary@blockstack.com>
Closes issue:
The default app generator now prompts user for choice:
Results in:
![image](https://user-images.githubusercontent.com/1447546/64650343-f48af200-d3ec-11e9-9604-f9edb3c2d975.png)
Additionally, the yeoman-environment is now integrated into the package.json bin script. This now allows non-global usage and a single command.
Examples:
npx generator-blockstack --react # The above command is equivalent to running: npm -g yo generator-blockstack yo blockstack:react
Testing
The above commands referencing
generator-blockstack
won't work until the package is published to npm. This github branch must be fully specified. Example:npx blockstack/blockstack-app-generator#feature/change-defaults # or npm install -g npx blockstack/blockstack-app-generator#feature/change-defaults