File tree 4 files changed +20
-6
lines changed
app/views/layouts/spotlight
spec/test_app_templates/lib/generators 4 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 33
33
blacklight_version : " ~> 8.0"
34
34
bootstrap_version : ~> 4.0
35
35
additional_name : Blacklight 8
36
- additional_engine_cart_rails_options : " -j rollup -a sprockets"
36
+ additional_engine_cart_rails_options : " -j importmap -a sprockets"
37
37
env :
38
38
RAILS_VERSION : ${{ matrix.rails_version }}
39
39
BLACKLIGHT_VERSION : ${{ matrix.blacklight_version }}
Original file line number Diff line number Diff line change 13
13
<% else %>
14
14
<%= stylesheet_link_tag "application" %>
15
15
<% end %>
16
- <%= javascript_include_tag "application" %>
16
+ <% if defined? Importmap %>
17
+ < script
18
+ src ="https://code.jquery.com/jquery-3.7.1.slim.min.js "
19
+ integrity ="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8= "
20
+ crossorigin ="anonymous "> </ script >
21
+ <%= javascript_importmap_tags %>
22
+ <% else %>
23
+ <%= javascript_include_tag "application" , "data-turbo-track" : "reload" , defer : true %>
24
+ <% end %>
17
25
<%= csrf_meta_tags %>
18
26
<%= content_for ( :head ) %>
19
27
<%= description %>
Original file line number Diff line number Diff line change @@ -11,11 +11,17 @@ class Install < Rails::Generators::Base
11
11
class_option :mailer_default_url_host , type : :string , default : '' # e.g. localhost:3000
12
12
13
13
def add_manifest
14
- append_to_file 'app/assets/javascripts/application.js' , "\n //= require_tree .\n "
15
14
append_to_file 'app/assets/config/manifest.js' , "\n //= link spotlight/manifest.js"
16
15
17
- # Rails installed importmap by default, but we don't have importmap + Blacklight 7 working yet.
18
- remove_file 'app/javascript/application.js'
16
+ if Blacklight . version . to_i > 7 && defined? Importmap
17
+ append_to_file 'app/javascripts/application.js' , "\n import Spotlight from \" spotlight\" \n "
18
+ else
19
+ append_to_file 'app/assets/javascripts/application.js' , "\n //= require_tree .\n "
20
+
21
+ # Rails installed importmap by default, but Blacklight 7 doesn't support importmap.
22
+ # We must remove the importmap entrypoint or Sprockets will have a double link error with two files named application.js
23
+ remove_file 'app/javascript/application.js'
24
+ end
19
25
end
20
26
21
27
def inject_spotlight_routes
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def use_capybara3
10
10
end
11
11
12
12
def add_gems
13
- gem 'blacklight' , ENV [ 'BLACKLIGHT_VERSION' ] || '~> 7.17 ' unless Bundler . locked_gems . dependencies . key? 'blacklight'
13
+ gem 'blacklight' , ENV [ 'BLACKLIGHT_VERSION' ] || '~> 8.4 ' unless Bundler . locked_gems . dependencies . key? 'blacklight'
14
14
gem 'blacklight-gallery' , '~> 4.5' unless Bundler . locked_gems . dependencies . key? 'blacklight-gallery'
15
15
16
16
unless Bundler . locked_gems . dependencies . key? 'bootstrap_form'
You can’t perform that action at this time.
0 commit comments