Skip to content

Feature: target destination option for the install generator #459

@aCandidMind

Description

@aCandidMind

First of all thanks for what appears to be an excellent gem (we're just starting with it) which is properly documented (huge plus)!

For context: Our admin backend is an engine living in a separate subfolder. After using the install generator react_on_rails:install I had to do several things to configure react_on_rails to use the backend subfolder instead of RAILS_ROOT.

I must admit, I'm not 100% sure whether things wouldn't be all along smoother for react_on_rails and other gems if we were to add them to the Gemfile of the backend subfolder instead of to the one in RAILS_ROOT. But I haven't had time to figure this out yet.

Running the install generator inside of the subfolder doesn't work for us, because then a lot of other relative paths would need to be adjusted. Currently we're running tasks, generators, etc. from RAILS_ROOT.

Here's what I had to do:

  1. Delete the created app/assets/javascripts/application.js file and move the one new line in it to the appropriate file in the backend subfolder.
  2. Move the hello world controller and view to the backend subfolder.
  3. Change output.path in client/webpack.config.js to include that subfolder.
  4. Change the assets initializer path
  5. Change config.generated_assets_dir in the react_on_rails initializer.
  6. Move the hello world route from the routes file in RAILS_ROOT to the one in the backend subfolder.
  7. Change ignore path in .gitignore
  8. Change cleanup path in Procfile.dev

This isn't important stuff, the things that need to be changed are still reasonable, but a target option changing essentially the root directory for the generator accelerates startup and might prevent initial debugging of what's not working.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions