Skip to content

Commit

Permalink
Merge pull request #220 from solidusio/gsmendoza/eng-296-solidus-app-…
Browse files Browse the repository at this point in the history
…use-case-update

Fix: frontend assets should be added to vendor
  • Loading branch information
George Mendoza authored Feb 24, 2022
2 parents 35a8c20 + 0950fca commit 0b6137e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ def copy_solidus_starter_frontend_files
prepend_file 'config/routes.rb', File.read('tmp/routes.rb')

directory 'spec'
directory 'vendor', force: forcefully_replace_any_solidus_frontend_assets?
end

# In CI, the Rails environment is test. In that Rails environment,
# `Solidus::InstallGenerator#setup_assets` adds `solidus_frontend` assets to
# vendor. We'd want to forcefully replace those `solidus_frontend` assets with
# SolidusStarterFrontend assets in CI.
def forcefully_replace_any_solidus_frontend_assets?
Rails.env.test?
end

def update_asset_files
Expand Down
Empty file.
9 changes: 9 additions & 0 deletions templates/vendor/assets/javascripts/spree/frontend/all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require rails-ujs
//= require spree/frontend
//= require_tree .
9 changes: 9 additions & 0 deletions templates/vendor/assets/stylesheets/spree/frontend/all.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*
*= require spree/frontend
*= require_self
*= require_tree .
*/

0 comments on commit 0b6137e

Please sign in to comment.