Skip to content

Commit

Permalink
Make leaflet an NPM dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 15, 2023
1 parent 501f536 commit 2033e5e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/spotlight/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//= require bootstrap-tagsinput
//= require jquery.serializejson
//= require clipboard/dist/clipboard
//= require leaflet
//= require leaflet/dist/leaflet-src
//= require leaflet-iiif
//= require Leaflet.Editable
//= require Path.Drag
Expand Down
1 change: 0 additions & 1 deletion blacklight-spotlight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ these collections.)
s.add_dependency 'i18n-active_record'
s.add_dependency 'iiif_manifest'
s.add_dependency 'iiif-presentation'
s.add_dependency 'leaflet-rails'
s.add_dependency 'legato'
s.add_dependency 'mini_magick'
s.add_dependency 'nokogiri'
Expand Down
8 changes: 5 additions & 3 deletions lib/generators/spotlight/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def add_js_rails6
# but since webpacker exists in the gemfile, we still need to run the
# install before rails will start
run 'bundle exec rails webpacker:install'

say 'Install Clipboard'
run 'yarn add [email protected]'
end

def add_js_rails7
Expand All @@ -38,6 +35,11 @@ def add_js_rails7
append_to_file 'app/assets/javascripts/application.js', "\n//= require_tree .\n"
end

def add_js_deps
say 'Install Clipboard & Leaflet'
run 'yarn add [email protected] leaflet@^1.9.3'
end

def add_manifest
append_to_file 'app/assets/config/manifest.js', "\n//= link spotlight/manifest.js"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/spotlight/templates/spotlight.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
@import 'spotlight/variables_bootstrap';
@import 'bootstrap';
@import 'sir-trevor/main';
@import 'leaflet';
@import 'leaflet/dist/leaflet';
@import 'spotlight/spotlight';
1 change: 0 additions & 1 deletion lib/spotlight/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
require 'faraday/follow_redirects'
require 'friendly_id'
require 'i18n/active_record'
require 'leaflet-rails'
require 'paper_trail'
require 'riiif'
require 'spotlight/riiif_service'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"not IE 11"
],
"dependencies": {
"clipboard": "1.7.1"
"clipboard": "1.7.1",
"leaflet": "^1.9.3"
}
}

0 comments on commit 2033e5e

Please sign in to comment.