Permalink
Browse files

Place Spree assets at vendor/assets so that 'require_tree .' in appli…

…cation's assets does not load Spree's assets

This *definitely* breaks existing behaviour.

Assets should now be renamed:

* app/assets/stylesheets/store/all[css|js] => app/assets/stylesheets/spree/frontend/all.[css|js]

Fixes #4050
  • Loading branch information...
radar committed Dec 9, 2013
1 parent f6c45af commit cfbd0f346ee89ea252ef3dfe8f7779ebacc3b875
Showing with 83 additions and 45 deletions.
  1. +21 −0 backend/app/assets/javascripts/spree/backend.js
  2. 0 backend/app/assets/javascripts/{admin → spree/backend}/address_states.js
  3. 0 backend/app/assets/javascripts/{admin → spree/backend}/adjustments.js.coffee
  4. +7 −7 backend/app/assets/javascripts/{admin → spree/backend}/admin.js.erb
  5. 0 backend/app/assets/javascripts/{admin → spree/backend}/calculator.js
  6. 0 backend/app/assets/javascripts/{admin → spree/backend}/checkouts/edit.js
  7. 0 backend/app/assets/javascripts/{admin → spree/backend}/gateway.js
  8. 0 .../assets/javascripts/admin → backend/app/assets/javascripts/spree/backend}/handlebar_extensions.js
  9. 0 backend/app/assets/javascripts/{admin → spree/backend}/image_settings.js.erb
  10. 0 backend/app/assets/javascripts/{admin → spree/backend}/images/index.js.coffee
  11. 0 backend/app/assets/javascripts/{admin → spree/backend}/images/new.js.coffee
  12. 0 backend/app/assets/javascripts/{admin → spree/backend}/index.html
  13. 0 backend/app/assets/javascripts/{admin → spree/backend}/nested-attribute.js
  14. 0 backend/app/assets/javascripts/{admin → spree/backend}/option_type_autocomplete.js.erb
  15. 0 backend/app/assets/javascripts/{admin → spree/backend}/orders/edit.js
  16. 0 backend/app/assets/javascripts/{admin → spree/backend}/orders/edit_form.js
  17. 0 backend/app/assets/javascripts/{admin → spree/backend}/payments/edit.js.coffee
  18. 0 backend/app/assets/javascripts/{admin → spree/backend}/payments/new.js
  19. 0 backend/app/assets/javascripts/{admin → spree/backend}/product_picker.js
  20. 0 backend/app/assets/javascripts/{admin → spree/backend}/progress.coffee
  21. 0 backend/app/assets/javascripts/{admin → spree/backend}/promotions.js
  22. 0 backend/app/assets/javascripts/{admin → spree/backend}/shipments.js.erb
  23. 0 backend/app/assets/javascripts/{admin → spree/backend}/spree-select2.js.erb
  24. +1 −1 backend/app/assets/javascripts/{admin → spree/backend}/spree_backend.js
  25. 0 backend/app/assets/javascripts/{admin → spree/backend}/states.js
  26. 0 backend/app/assets/javascripts/{admin → spree/backend}/stock_management.js.coffee
  27. 0 backend/app/assets/javascripts/{admin → spree/backend}/stock_movement.js.coffee
  28. 0 backend/app/assets/javascripts/{admin → spree/backend}/stock_transfer.js.coffee
  29. 0 backend/app/assets/javascripts/{admin → spree/backend}/taxon_autocomplete.js.erb
  30. 0 backend/app/assets/javascripts/{admin → spree/backend}/taxon_tree_menu.js.coffee
  31. 0 backend/app/assets/javascripts/{admin → spree/backend}/taxonomy.js.coffee
  32. 0 backend/app/assets/javascripts/{admin → spree/backend}/taxons.js.coffee
  33. 0 backend/app/assets/javascripts/{admin → spree/backend}/underscore-min.js
  34. 0 backend/app/assets/javascripts/{admin → spree/backend}/user_picker.js
  35. 0 backend/app/assets/javascripts/{admin → spree/backend}/variant_autocomplete.js.erb
  36. 0 backend/app/assets/javascripts/{admin → spree/backend}/variant_management.js.coffee
  37. 0 backend/app/assets/javascripts/{admin → spree/backend}/zone.js.coffee
  38. 0 backend/app/assets/javascripts/{store → spree/frontend}/backend.js
  39. +17 −0 backend/app/assets/stylesheets/spree/backend.css
  40. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_actions.scss
  41. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_date-picker.scss
  42. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_messages.scss
  43. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_navigation.scss
  44. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_pagination.scss
  45. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_product_autocomplete.scss
  46. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_progress.scss
  47. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_sidebar.scss
  48. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_states.scss
  49. 0 backend/app/assets/stylesheets/{admin → spree/backend}/components/_table-filter.scss
  50. 0 backend/app/assets/stylesheets/{admin → spree/backend}/globals/_functions.scss
  51. 0 backend/app/assets/stylesheets/{admin → spree/backend}/globals/_mixins.scss
  52. 0 backend/app/assets/stylesheets/{admin → spree/backend}/globals/_variables.scss
  53. 0 backend/app/assets/stylesheets/{admin → spree/backend}/globals/_variables_override.scss
  54. 0 backend/app/assets/stylesheets/{admin → spree/backend}/hacks/_ie.scss
  55. 0 backend/app/assets/stylesheets/{admin → spree/backend}/hacks/_mozilla.scss
  56. 0 backend/app/assets/stylesheets/{admin → spree/backend}/hacks/_opera.scss
  57. 0 backend/app/assets/stylesheets/{admin → spree/backend}/plugins/_jstree.scss
  58. 0 backend/app/assets/stylesheets/{admin → spree/backend}/plugins/_powertip.scss
  59. 0 backend/app/assets/stylesheets/{admin → spree/backend}/plugins/_select2.scss
  60. 0 backend/app/assets/stylesheets/{admin → spree/backend}/plugins/_token-input.scss
  61. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_alerts.scss
  62. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_bulk_transfer.scss
  63. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_edit_checkouts.scss
  64. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_image_settings.scss
  65. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_log_entries.scss
  66. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_orders.scss
  67. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_overview.scss
  68. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_products.scss
  69. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_promotions.scss
  70. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_tax_zones.scss
  71. 0 backend/app/assets/stylesheets/{admin → spree/backend}/sections/_taxons.scss
  72. 0 backend/app/assets/stylesheets/{admin → spree/backend}/shared/_forms.scss
  73. 0 backend/app/assets/stylesheets/{admin → spree/backend}/shared/_icons.scss
  74. 0 backend/app/assets/stylesheets/{admin → spree/backend}/shared/_layout.scss
  75. 0 backend/app/assets/stylesheets/{admin → spree/backend}/shared/_tables.scss
  76. 0 backend/app/assets/stylesheets/{admin → spree/backend}/shared/_typography.scss
  77. 0 backend/app/assets/stylesheets/{admin → spree/backend}/spree_admin.scss
  78. 0 backend/app/assets/stylesheets/{admin → spree/backend}/spree_backend.css
  79. 0 backend/app/assets/stylesheets/{store → spree/frontend}/backend.css
  80. +2 −2 backend/app/views/spree/admin/shared/_head.html.erb
  81. +1 −1 cmd/lib/spree_cmd/templates/extension/app/assets/javascripts/store/%file_name%.js
  82. +1 −1 cmd/lib/spree_cmd/templates/extension/app/assets/stylesheets/store/%file_name%.css
  83. +4 −4 cmd/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
  84. +6 −6 core/lib/generators/spree/install/install_generator.rb
  85. +3 −3 ...install/templates/{app/assets/javascripts/admin → vendor/assets/javascripts/spree/backend}/all.js
  86. +3 −3 ...nstall/templates/{app/assets/javascripts/store → vendor/assets/javascripts/spree/frontend}/all.js
  87. +3 −3 ...nstall/templates/{app/assets/stylesheets/store → vendor/assets/stylesheets/spree/backend}/all.css
  88. +3 −3 ...stall/templates/{app/assets/stylesheets/admin → vendor/assets/stylesheets/spree/frontend}/all.css
  89. +5 −0 frontend/app/assets/javascripts/spree/frontend.js
  90. 0 frontend/app/assets/javascripts/{store → spree/frontend}/cart.js.coffee
  91. +2 −2 frontend/app/assets/javascripts/{store → spree/frontend}/checkout.js.coffee
  92. 0 frontend/app/assets/javascripts/{store → spree/frontend}/checkout/address.js.coffee
  93. 0 frontend/app/assets/javascripts/{store → spree/frontend}/checkout/payment.js.coffee
  94. 0 frontend/app/assets/javascripts/{store → spree/frontend}/product.js.coffee
  95. +0 −5 frontend/app/assets/javascripts/store/spree_frontend.js
  96. +1 −1 frontend/app/assets/stylesheets/{store/spree_frontend.css → spree/frontend.css}
  97. 0 frontend/app/assets/stylesheets/{store → spree/frontend}/_variables.scss
  98. 0 frontend/app/assets/stylesheets/{store → spree/frontend}/screen.css.scss
  99. +2 −2 frontend/app/views/spree/shared/_head.html.erb
  100. +1 −1 frontend/lib/spree/frontend/engine.rb
@@ -0,0 +1,21 @@
//= require jquery
//= require jquery-migrate-1.0.0
//= require jquery.ui.datepicker
//= require jquery.ui.sortable
//= require jquery.ui.autocomplete
//= require modernizr
//= require jquery.cookie
//= require jquery.delayedobserver
//= require jquery.jstree/jquery.jstree
//= require jquery.alerts/jquery.alerts
//= require jquery.powertip
//= require jquery.vAlign
//= require css_browser_selector_dev
//= require spin
//= require trunk8
//= require jquery.adaptivemenu
//= require equalize
//= require responsive-tables
//= require spree
//= require spree/backend/spree-select2
//= require_tree .
@@ -1,11 +1,11 @@
//= require_self
//= require admin/handlebar_extensions
//= require admin/variant_autocomplete
//= require admin/taxon_autocomplete
//= require admin/option_type_autocomplete
//= require admin/user_picker
//= require admin/product_picker
//= require admin/taxons
//= require spree/backend/handlebar_extensions
//= require spree/backend/variant_autocomplete
//= require spree/backend/taxon_autocomplete
//= require spree/backend/option_type_autocomplete
//= require spree/backend/user_picker
//= require spree/backend/product_picker
//= require spree/backend/taxons
/**
This is a collection of javascript functions and whatnot
@@ -16,5 +16,5 @@
//= require equalize
//= require responsive-tables
//= require spree
//= require admin/spree-select2
//= require spree/backend/spree-select2
//= require_tree .
@@ -0,0 +1,17 @@
/*
* 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 jquery.alerts/jquery.alerts
*= require jquery.alerts/jquery.alerts.spree
*= require responsive-tables
*= require normalize
*= require skeleton
*= require jquery.ui.datepicker
*= require jquery.ui.autocomplete
*= require jquery.powertip
*= require select2
*= require spree/backend/spree_admin
*/
@@ -10,9 +10,9 @@
<!-- Get "Open Sans" font from Google -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag 'admin/all' %>
<%= stylesheet_link_tag 'spree/backend' %>
<%= javascript_include_tag 'admin/all' %>
<%= javascript_include_tag 'spree/backend' %>
<%= render "spree/admin/shared/translations" %>
<%= render "spree/admin/shared/routes" %>
@@ -1 +1 @@
//= require store/spree_frontend
//= require spree/frontend
@@ -1,3 +1,3 @@
/*
*= require store/spree_frontend
*= require spree/frontend
*/
@@ -5,13 +5,13 @@ module <%= class_name %>
class_option :auto_run_migrations, :type => :boolean, :default => false
def add_javascripts
append_file 'app/assets/javascripts/store/all.js', "//= require store/<%= file_name %>\n"
append_file 'app/assets/javascripts/admin/all.js', "//= require admin/<%= file_name %>\n"
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/<%= file_name %>\n"
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/<%= file_name %>\n"
end
def add_stylesheets
inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/<%= file_name %>\n", :before => /\*\//, :verbose => true
inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/<%= file_name %>\n", :before => /\*\//, :verbose => true
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/<%= file_name %>\n", :before => /\*\//, :verbose => true
inject_into_file 'vendor/assets/stylesheets/backend/all.css', " *= require spree/backend/<%= file_name %>\n", :before => /\*\//, :verbose => true
end
def add_migrations
@@ -70,18 +70,18 @@ def additional_tweaks
def setup_assets
@lib_name = 'spree'
%w{javascripts stylesheets images}.each do |path|
empty_directory "app/assets/#{path}/store" if defined? Spree::Frontend || Rails.env.test?
empty_directory "app/assets/#{path}/admin" if defined? Spree::Backend || Rails.env.test?
empty_directory "vendor/assets/#{path}/store" if defined? Spree::Frontend || Rails.env.test?
empty_directory "vendor/assets/#{path}/admin" if defined? Spree::Backend || Rails.env.test?
end
if defined? Spree::Frontend || Rails.env.test?
template "app/assets/javascripts/store/all.js"
template "app/assets/stylesheets/store/all.css"
template "vendor/assets/javascripts/spree/frontend/all.js"
template "vendor/assets/stylesheets/spree/frontend/all.css"
end
if defined? Spree::Backend || Rails.env.test?
template "app/assets/javascripts/admin/all.js"
template "app/assets/stylesheets/admin/all.css"
template "vendor/assets/javascripts/spree/frontend/all.js"
template "vendor/assets/stylesheets/spree/frontend/all.css"

This comment has been minimized.

Show comment
Hide comment
@alepore

alepore Dec 15, 2013

Contributor

it's ok to be "frontend" and not "backend" here?

@alepore

alepore Dec 15, 2013

Contributor

it's ok to be "frontend" and not "backend" here?

This comment has been minimized.

Show comment
Hide comment
@radar

radar Dec 16, 2013

Member

Nope, this should be backend. Thanks for catching this.

@radar

radar Dec 16, 2013

Member

Nope, this should be backend. Thanks for catching this.

end
end
@@ -6,9 +6,9 @@
//
//= require jquery
//= require jquery_ujs
<% if options[:lib_name] == 'spree' %>
//= require admin/spree_backend
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/backend' %>
//= require spree/backend
<% else %>
//= require admin/<%= options[:lib_name].gsub("/", "_") %>
//= require spree/backend/<%= options[:lib_name].gsub("/", "_") %>
<% end %>
//= require_tree .
@@ -6,9 +6,9 @@
//
//= require jquery
//= require jquery_ujs
<% if options[:lib_name] == 'spree' %>
//= require store/spree_frontend
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/frontend' %>
//= require spree/frontend
<% else %>
//= require store/<%= options[:lib_name].gsub("/", "_") %>
//= require spree/frontend/<%= options[:lib_name].gsub("/", "_") %>
<% end %>
//= require_tree .
@@ -3,10 +3,10 @@
* 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.
*
<% if options[:lib_name] == 'spree' %>
*= require store/spree_frontend
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/backend' %>
*= require spree/backend
<% else %>
*= require store/<%= options[:lib_name].gsub("/", "_") %>
*= require spree/backend/<%= options[:lib_name].gsub("/", "_") %>
<% end %>
*= require_self
*= require_tree .
@@ -3,10 +3,10 @@
* 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.
*
<% if options[:lib_name] == 'spree' %>
*= require admin/spree_backend
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/frontend' %>
*= require spree/frontend
<% else %>
*= require admin/<%= options[:lib_name].gsub("/", "_") %>
*= require spree/frontend/<%= options[:lib_name].gsub("/", "_") %>
<% end %>
*= require_self
*= require_tree .
@@ -0,0 +1,5 @@
//= require jquery.validate/jquery.validate.min
//= require spree
//= require spree/frontend/checkout
//= require spree/frontend/product
//= require spree/frontend/cart
@@ -1,7 +1,7 @@
//= require jquery.payment
//= require_self
//= require store/checkout/address
//= require store/checkout/payment
//= require spree/frontend/checkout/address
//= require spree/frontend/checkout/payment
Spree.disableSaveOnClick = ->
($ 'form.edit_order').submit ->
@@ -1,5 +0,0 @@
//= require jquery.validate/jquery.validate.min
//= require spree
//= require store/checkout
//= require store/product
//= require store/cart
@@ -2,5 +2,5 @@
* This is a manifest file that includes stylesheets for spree_frontend
*= require normalize
*= require skeleton
*= require store/screen
*= require spree/frontend/screen
*/
@@ -5,9 +5,9 @@
<%== meta_data_tags %>
<%= canonical_tag %>
<%= favicon_link_tag image_path('favicon.ico') %>
<%= stylesheet_link_tag 'store/all', :media => 'screen' %>
<%= stylesheet_link_tag 'spree/frontend/all', :media => 'screen' %>
<%= csrf_meta_tags %>
<%= javascript_include_tag 'store/all' %>
<%= javascript_include_tag 'spree/frontend/all' %>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6/html5shiv.min.js"></script>
<![endif]-->
@@ -6,7 +6,7 @@ class Engine < ::Rails::Engine
# sets the manifests / assets to be precompiled, even when initialize_on_precompile is false
initializer "spree.assets.precompile", :group => :all do |app|
app.config.assets.precompile += %w[
store/all.*
spree/frontend/all.*
]
end

3 comments on commit cfbd0f3

@GeekOnCoffee

This comment has been minimized.

Show comment
Hide comment
@GeekOnCoffee

GeekOnCoffee Dec 10, 2013

Contributor

@radar this looks like something that would break things in odd and unexpected ways... a Changelog entry would probably be good to go with this.

Contributor

GeekOnCoffee replied Dec 10, 2013

@radar this looks like something that would break things in odd and unexpected ways... a Changelog entry would probably be good to go with this.

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Dec 13, 2013

Member

Definitely agree. Fixed in radar/spree@51c78b8.

Member

radar replied Dec 13, 2013

Definitely agree. Fixed in radar/spree@51c78b8.

Please sign in to comment.