ember-cli / rfcs

Archive of RFCs for changes to ember-cli (for current RFC repo see https://github.com/emberjs/rfcs)
45 stars 54 forks source link

Addon Options #7

Closed knownasilya closed 5 years ago

knownasilya commented 9 years ago

Similar to what Yeoman does.

Rendered


Current implementation is happening in https://github.com/ember-cli/ember-cli/pull/5708

davewasmer commented 9 years ago

Isn't this available via myAddon.ui.prompt?

knownasilya commented 9 years ago

@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!

stefanpenner commented 9 years ago

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.

knownasilya commented 9 years ago

@stefanpenner having a --skip-prompts option would mitigate issues like that, and prompts should have defaults, so skipping would just do the default.

knownasilya commented 9 years ago

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.

stefanpenner commented 9 years ago

Actually You may be correct about this. I'll enumerare my hesitations later this mornjnf

stefanpenner commented 8 years ago

@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.

runspired commented 8 years ago

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.

runspired commented 8 years ago

@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?

knownasilya commented 8 years ago

@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.

stefanpenner commented 8 years ago

I believe we need a real example in the motivations sections, otherwise abstractly its hard to agree/disagree or know for-sure.

knownasilya commented 8 years ago

@stefanpenner mind having a look at the updates?

rwjblue commented 5 years ago

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!