Skip to content

Commit

Permalink
Use the new install generators to get Sortable
Browse files Browse the repository at this point in the history
  • Loading branch information
taylor-steve committed Nov 9, 2024
1 parent 29db13e commit 0298800
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/spotlight/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//= require sir-trevor
//= require clipboard
//= require tiny-slider
//= require Sortable.min.js
//= require typeahead.bundle.min.js

//= require spotlight/spotlight
1 change: 0 additions & 1 deletion app/views/layouts/spotlight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/3.2.1/jquery.serializejson.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<%= javascript_include_tag 'nestable', "data-turbo-track": "reload", defer: false %>
<%= javascript_include_tag 'bootstrap-tagsinput', "data-turbo-track": "reload", defer: false %>
<%= javascript_include_tag 'typeahead.bundle.min', "data-turbo-track": "reload", defer: false %>
<%= javascript_include_tag 'leaflet-iiif', "data-turbo-track": "reload", defer: true %>
Expand Down
8 changes: 8 additions & 0 deletions lib/generators/spotlight/assets/importmap_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ class ImportmapGenerator < Rails::Generators::Base
via importmap/the asset pipeline without the need for bundling
DESCRIPTION

def import_javascript_assets
append_to_file 'config/importmap.rb' do
<<~CONTENT
pin "sortablejs", to: "https://cdn.skypack.dev/sortablejs"
CONTENT
end
end

def add_stylesheet_dependencies
run "yarn add blacklight-frontend@#{blacklight_yarn_version}"
run "yarn add bootstrap@\"^#{bootstrap_yarn_version}\""
Expand Down
1 change: 1 addition & 0 deletions lib/generators/spotlight/assets/propshaft_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def install_dependencies
run 'yarn add clipboard'
run 'yarn add leaflet'
run 'yarn add sir-trevor'
run 'yarn add sortablejs'
end

def add_blacklight_frontend
Expand Down
9 changes: 8 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"homepage": "https://github.com/projectblacklight/spotlight#readme",
"devDependencies": {
"rollup": "^4.0.0",
"@rollup/plugin-commonjs": "^26.0.1",
"rollup": "^4.0.0",
"rollup-plugin-includepaths": "^0.2.4"
},
"browserslist": [
Expand All @@ -39,6 +39,7 @@
"jquery-serializejson": "^3.2.1",
"leaflet": "^1.9.4",
"leaflet-iiif": "^3.0.0",
"sir-trevor": "^0.8.2"
"sir-trevor": "^0.8.2",
"sortablejs": "^1.15.3"
}
}
2 changes: 0 additions & 2 deletions vendor/assets/javascripts/Sortable.min.js

This file was deleted.

0 comments on commit 0298800

Please sign in to comment.