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

If Webpack is not being used, user is not asked if they are using Stimulus; no index.js files are created by custom generator #17

Open
unikitty37 opened this issue Aug 5, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@unikitty37
Copy link
Contributor

unikitty37 commented Aug 5, 2022

What did you do?

Created a Rails app using the template.

What did you expect to happen?

I should have been asked if I used Stimulus, and the custom generator should have created the relevant .js files.

What actually happened?

I was not asked if I used Stimulus, because all the USE_STIMULUS code is wrapped in an if USE_WEBPACK block; I instead got a reference to #14.

Additional context

It would be better to ask the user if they're using Stimulus in all cases, then install the relevant config if Webpack is being used, otherwise give the reference to #14.

As a result, the custom generator does not have an option to create index.js, and the user must do it themselves each time.

Environment

Ruby Version:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux]

Framework Version (Rails, whatever):
Rails 7.0.3.1

View Component Contrib Version:
view_component-contrib (0.1.1)

@unikitty37 unikitty37 changed the title Custom generator does not create Stimulus controller if Stimulus is being used (and does not even ask this is Webpack is not being used) If Webpack is not being used, user is not asked if they are using Stimulus; no index.js files are created by custom generator Aug 5, 2022
@palkan
Copy link
Owner

palkan commented Aug 5, 2022

Thanks for the report!

Agree, we should ask a user if they want to add Stimulus-related stuff to generators independently of whether Webpack is being used. Would you like to prepare a PR?

@palkan palkan added the enhancement New feature or request label Aug 5, 2022
@helpotters
Copy link

Would you like me to tackle this?

@palkan
Copy link
Owner

palkan commented Sep 15, 2023

Hey @helpotters! Yes, please (if you're still interested)

@helpotters
Copy link

I'll check it out this weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants