Closed knownasilya closed 5 years ago
Isn't this available via myAddon.ui.prompt
?
@davewasmer yes it looks like inquirer.js is exposed, but I think we need an addon hook for this, with the ability to specify generators by name for yes/no options, etc. Still thinking on the API/design, feedback welcome!
during what phase of an addons life-cycle should this prompt appear. I am apposed to this happening during the install phase, if an add-on author would like to add a command or special purpose generator. I think that is alright.
for example
ember deploy:divshot
or ember g divhsot:setup
I believe could reasonably prompt the user for information here.
ember install ember-divshot
I don't feel comfortable with this prompting, as it would create a pretty horrible experience if 20 addons all pause the installation process to prompt the user.
@stefanpenner having a --skip-prompts
option would mitigate issues like that, and prompts should have defaults, so skipping would just do the default.
Having prompts at install is probably one of the most useful features, since most work is done there, hence the default generator for ember install:addon
.
Actually You may be correct about this. I'll enumerare my hesitations later this mornjnf
@runspired i believe this has some overlap with your work. I would love to see us flesh this out, evolve it and implement something once its ready.
This is right up my alley, I do a lot with prompting during installation of the default blueprint, it's an ideal time to ask the user to configure additional things to be installed. For instance, installing ember-bootstrap might be segmented into "just css" "also fonts" "also js components" and the like. Many addons use this time to prompt the user for configuration of whether they would like to import the addon's default CSS.
@knownasilya @stefanpenner the question I have here is if this isn't an unnecessary complication. As it stands, at least beforeInstall
and afterInstall
are promise aware and have access to this.ui.prompt
, what does the prompts hook gain us here?
@runspired I wasn't aware of those hooks. Maybe those hooks along with the locals
hook would be enough? I guess the only thing left to do is make it work and document it.
I believe we need a real example in the motivations sections, otherwise abstractly its hard to agree/disagree or know for-sure.
@stefanpenner mind having a look at the updates?
We are working on closing the ember-cli/rfcs repo in favor of using a single central RFC's repo for everything. This was laid out in https://emberjs.github.io/rfcs/0300-rfc-process-update.html.
Sorry for the troubles, but would you mind reviewing to see if this is still something we need, and if so migrating this over to emberjs/rfcs?
Thank you!
Similar to what Yeoman does.
Rendered
Current implementation is happening in https://github.com/ember-cli/ember-cli/pull/5708