-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix issues #10 and #12 #13
Conversation
@@ -1,6 +1,9 @@ | |||
source_paths.unshift(File.dirname(__FILE__)) | |||
|
|||
run "mv app/assets app/frontend" | |||
run "mkdir app/assets" | |||
run "mv app/frontend/config app/assets/config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This moves app/assets/config/manifest.js
back to the place Sprockets requires it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that just Sprockets? I did find putting things in app/frontend
to be by far the most brittle part of this template, so I wonder if we should just stick with Rails defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sprockets hard codes this path. rails/sprockets-rails#369 is open to see if it can be made customisable. I take your point on the defaults. I'm loathe to give it up because the default feels gross but accepting the default might be the most pragmatic.
2945c53
to
3b15fd0
Compare
# The block passed to "after_bundle" seems to run after `bundle install` | ||
# but also after `webpacker:install` and after Rails has initialized the git | ||
# repo | ||
after_bundle do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff is a bit messy but basically I moved lots of commands inside the after_bundle
hook. This allowed me to remove our git repo setup and our call to webpacker:install
.
This reverts commit fc1c4f7.
@@ -23,7 +23,7 @@ | |||
# directory. Alternatively, in the individual `*_spec.rb` files, manually | |||
# require only the support files necessary. | |||
# | |||
Dir[Rails.root.join("spec", "support", "**", "*.rb")].each { |f| require f } | |||
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rubocop has changed it's mind about separators because /
is normalised by Ruby to be whatever the separator on the platform is (e.g. it becomes \
on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 TIL
All scripts are marked executable during the installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a Webpacker ManifestPlugin
route 'root "home#index"' | ||
route %Q(mount Sidekiq::Web => "/sidekiq" # monitoring console\n) | ||
route "require 'sidekiq/web'" | ||
route <<-EO_ROUTES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that since this route definition includes three different routes:
- Lighthouse workaround
- Sidekiq/web
- root route
I think we should probably define these with three different route definitions, so that they are inherently three different routes
@@ -1,5 +1,5 @@ | |||
namespace :test do | |||
task :coverage do | |||
task coverage: :environment do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does loading the environment influence the coverage at all? I was under the impression that simplecov needed to be loaded before the application to corrrectly calculate the coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I did this because rubocop yelled at me about it. I take your point about coverage tho. I'll look into this.
@@ -23,7 +23,7 @@ | |||
# directory. Alternatively, in the individual `*_spec.rb` files, manually | |||
# require only the support files necessary. | |||
# | |||
Dir[Rails.root.join("spec", "support", "**", "*.rb")].each { |f| require f } | |||
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 TIL
@@ -1,6 +1,9 @@ | |||
source_paths.unshift(File.dirname(__FILE__)) | |||
|
|||
run "mv app/assets app/frontend" | |||
run "mkdir app/assets" | |||
run "mv app/frontend/config app/assets/config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that just Sprockets? I did find putting things in app/frontend
to be by far the most brittle part of this template, so I wonder if we should just stick with Rails defaults.
This fixes issues #10 and #12 in under Rails 6