Skip to content

ViewComponent generator  #42

@hjhart

Description

@hjhart

I'm using the CLI to create components, e.g.

$ rails g component link classes size --preview                                                                                                                                                                                                                                                                     
      create  app/components/link_component.rb
      invoke  rspec
      create    spec/components/link_component_spec.rb
      invoke  preview
      create    spec/components/previews/link_component_preview.rb
      invoke  erb
      create    app/components/link_component.html.erb

It would be awesome, instead of a preview argument, if we could pass in a --storybook which would create spec/components/stories/link_component_stories.rb.

Is that on anyone's radar? Is there a way to extend generators like that? If not, we could potentially create our own generator which calls out to ViewComponent and also creates a story?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions