Skip to content

Conversation

pbhogan
Copy link

@pbhogan pbhogan commented Sep 3, 2024

Addresses #138

  • app:stimulus:* tasks correctly run in test/dummy and put files in the right places.
  • stimulus:* tasks exist and put files under the engine namespace.
  • The stimulus controller generator, when run in the engine root, includes the engine namespace.
  • Namespaces are correctly handled in index.js and in terms of where files are placed.

Note: a small extension of Rake is included to make defining the top-level tasks possible.

…en working in a Rails engine.

app:stimulus:* tasks correctly run in test/dummy and put files in the right places.
stimulus:* tasks exist and puts files under the engine namespace.
The stimulus controller generator, when run in the engine root, includes the engine namespace.
Namespaces are correctly handled in index.js and in terms of where files are placed.
@wakproductions
Copy link

fwiw I was also working on a Rails engine and encountered the same problem. In my case, the problem manifested as this error:

$ rails app:javascript:install:esbuild
Unrecognized command "app:template" (Rails::Command::UnrecognizedCommandError)
Did you mean?  app:tmp:create

The task Stimulus was looking to run was namespaced as app:app:template because of Railties. The same problem also affects other rake tasks such as jsbundling-rails and turbo-rails. I hope this fix gets merged so that we can use the automated generators more easily. Lmk if there's anything I can do to assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants