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

ember help generate #952

Merged
merged 2 commits into from
Jun 15, 2014
Merged

ember help generate #952

merged 2 commits into from
Jun 15, 2014

Conversation

jgwhite
Copy link
Contributor

@jgwhite jgwhite commented Jun 9, 2014

$ ember help generate
ember generate <blueprint> <options...>
  Generates new code from blueprints
  aliases: g
  --dry-run (Default: false)
  --verbose (Default: false)

  Available blueprints:
    my-app:
      foo
      bar
    ember-cli:
      acceptance-test
      adapter
      api-stub
      app
      blueprint
      component
      controller
      helper
      initializer
      mixin
      model
      resource
      route
      serializer
      service
      template
      transform
      util
      view

@rwjblue
Copy link
Member

rwjblue commented Jun 9, 2014

Definitely 👍.

I would love to see the same output from ember help generate, but I think that will take a bit of refactoring of the help command which could be part of another PR.

@stefanpenner
Copy link
Contributor

RebAse

@stefanpenner
Copy link
Contributor

So why add list. When help is already present?

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 9, 2014

@stefanpenner seemed like it would take a little refactoring to get it into help, and that this would be the most expedient why to provide these docs. Aiming to integrate with help eventually.

@stefanpenner
Copy link
Contributor

i would prefer to hold of an interim feature like this, if it will be entirely replaced with help in the future. I fear adding/removing flags is a great way to confuse people.

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 9, 2014

@stefanpenner cool. I'll push ahead integrating it with help.

@jgwhite jgwhite changed the title Add generate --list [WIP] Add generate --list Jun 9, 2014
@jgwhite jgwhite changed the title [WIP] Add generate --list [WIP] ember help generate Jun 9, 2014
@stefanpenner
Copy link
Contributor

cc @njj023

@jgwhite jgwhite changed the title [WIP] ember help generate ember help generate Jun 15, 2014
@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 15, 2014

@stefanpenner @rjackson this is ready for another pass.

Refactored printUsageInstructions into printBasicHelp and printDetailedHelp.

Not tied to the naming of those methods, though it seems appropriate they match up with the help command. Should they be basicHelp and detailedHelp and return documentation strings rather then doing the printing themselves?

@rwjblue
Copy link
Member

rwjblue commented Jun 15, 2014

Looks good. I like the name change (makes it much clearer what each thing does).

👍

@rwjblue
Copy link
Member

rwjblue commented Jun 15, 2014

This got me thinking: should a blueprint also have the ability to print information? I'm thinking that a blueprint named easyForm or validations may not actually be descriptive enough (or provide information on the requirements). Perhaps the Blueprint.list function could be extended to instantiate the blueprint, and call the printBasicHelp on each (which could be listed alongside the name).

I do not think that this proposal should block this PR though. I think this is absolutely a step in the right direction, and I'd like this available in the next release. Then as we have time, we can add the blueprint level printouts.

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 15, 2014

@rjackson been thinking exactly the same.

$ ember help generate
ember-cli:
  model <attr:type...>
  route <type:(resource|route)>
  ...

@rwjblue
Copy link
Member

rwjblue commented Jun 15, 2014

Yes, exactly! But I think that could be a second PR building on this one (so as not to hold this up from the next release), unless of course you disagree and want to tackle it here...

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 15, 2014

Let’s add it in a second PR.

@rwjblue
Copy link
Member

rwjblue commented Jun 15, 2014

Sadly, due to CHANGELOG shenanigans this will need to be rebased.

@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 15, 2014

Rebased.

assert.include(output, ' controller');
assert.include(output, ' helper');
assert.include(output, ' initializer');
assert.include(output, ' integration');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis is not happy, and I'm pretty sure it's because this needs to be updated (due to the rename from integration to acceptance).

jgwhite added 2 commits June 15, 2014 16:47
Refactor help API around `printBasicHelp` and `printDetailedHelp`.

`ember help` uses `printBasicHelp`

`ember help <command-name>` prints basic and detailed help.

Implement `printDetailedHelp` in the generate command to list out
available blueprints, grouped by package.
@jgwhite
Copy link
Contributor Author

jgwhite commented Jun 15, 2014

Whoops! Forgot about that. Should be good now.

@stefanpenner
Copy link
Contributor

this is awesome!!

stefanpenner added a commit that referenced this pull request Jun 15, 2014
@stefanpenner stefanpenner merged commit 5060fb3 into ember-cli:master Jun 15, 2014
@jgwhite jgwhite deleted the generate-list branch June 15, 2014 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants