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

ViewComponent generator #42

Open
hjhart opened this issue Jun 22, 2021 · 2 comments
Open

ViewComponent generator #42

hjhart opened this issue Jun 22, 2021 · 2 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@hjhart
Copy link
Collaborator

hjhart commented Jun 22, 2021

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?

@jonspalmer
Copy link
Owner

I agree this would be awesome. I don't think you can extend generators but adding a new one that wraps the VC generator is certainly possible. I don't have a lot of time to work on this personally but a PR would be welcomed.

@jonspalmer jonspalmer added the help wanted Extra attention is needed label Jun 26, 2021
@jonspalmer jonspalmer added this to the 1.0.0 milestone Jul 24, 2021
@williamkennedy
Copy link

I can tackle this after the install generator PR is finished. I have a bit of time in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants