yeoman / yo

CLI tool for running Yeoman generators
http://yeoman.io
BSD 2-Clause "Simplified" License
3.85k stars 399 forks source link

New Yeoman Workflow #59

Closed stephenplusplus closed 6 years ago

stephenplusplus commented 11 years ago

I think a nice workflow could look like:

$ mkdir angular-app && cd $_

$ yo

What type of application would you like to create?

[x] Angular
[ ] Backbone
[ ] Update your generators
[ ] Install a generator
[ ] Find help
[ ] Get me out of here!

Would you like to ___ ? (Y/n) Yes
Would you like ___? (y/N) No

I am now installing a bunch of stuff that will make you happy . . . . . . . .

Bye from us!

$ yo

What would you like to do?

[ ] Create a service
[x] Create a directive
[ ] Add features to your project
[ ] Back to the main menu

What would you like to call the directive? shoop-a-doop

Done! Anything else?

[ ] Create a service
[ ] Create a directive
[x] Add features to your project
[ ] Back to the main menu

Here are some things you can drop into your project. Note that these
might require additional configuration.

[x] CoffeeScript
[ ] PhantomJS
[ ] grunt-modernizr
[ ] Nevermind

... Installing required dependencies ...

Affected files:
> M Gruntfile.js
> A app/scripts/main.coffee

We've successfully dropped in CoffeeScript! Would you like anything else?

[ ] PhantomJS
[ ] grunt-modernizr
[ ] Nevermind

As Sindre taught me, hiding the technology underneath a prompt in this manner isn't ideal, as it doesn't help a developer learn their craft. However, it would be darn cool to let users interact with Yo this way. I just wanted to throw this out there to get feedback/inspire ideas and discussion.

I personally find the yo generator:subgenerator Something --but-not-this style non-optimal. Before I understood the difference between yo, a generator, and a subgenerator, I couldn't remember that syntax for the life of me. There are ways to get help (readmes, usage), but it still creates an undesirable delay. In the end, yo generator:subgenerator Something just isn't pretty. It might just be me, but I think just saying yo for scaffolding, using a subgenerator, installing something, getting help, etc. would be much more interactive, friendly, and awesome.

stephenplusplus commented 11 years ago

Passy:

+1! This is great!

As Sindre taught me, hiding the technology underneath a prompt in this manner isn't ideal, as it doesn't help a developer learn their craft.

We could show them the command they can use to achieve the same without the interactive prompt before running it. On the other hand, I don't know if the differentiation between flags and prompts makes a whole lot of sense in general when we use this format.

rcstr commented 11 years ago

+1

sindresorhus commented 11 years ago

Huge :+1: from me.

addyosmani commented 11 years ago

:+1:

csantanapr commented 10 years ago

I created a generator yo dude that its based on other generators

It's mainly to create Mobile Web Apps using Apache Cordova. User first selects one web app generators from a list (dapp, webapp, angular, mobile, polymer, backbone, jquery-mobile) then it runs the generator-cordovacli

In short dude is a generator created of two other generators.

I'm having difficulty on the unit testing side to pass parameters to the other generators from the the main one.

Would the new workflow help make it easier to compose generators of other generators and take testing into account?

SBoudrias commented 10 years ago

@csantanapr Checkout this dicussion over here: https://github.com/yeoman/generator/issues/345

csantanapr commented 10 years ago

@SBoudrias Thanks for the pointer looked around and didn't find it.

addyosmani commented 10 years ago

It would be great to revisit implementing this workflow at some point.