Skip to content

Commit

Permalink
Update importmap-rails and importmap (SpinaCMS#788)
Browse files Browse the repository at this point in the history
* Update importmap-rails and importmap

* Update stimulus-rails and turbo-rails
  • Loading branch information
Bramjetten authored Aug 17, 2021
1 parent 0844288 commit f70cfc1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PATH
bcrypt
breadcrumbs_on_rails
image_processing
importmap-rails (= 0.2.2)
importmap-rails (= 0.2.7)
jsonapi-serializer
kaminari
mobility (>= 1.1.3)
Expand Down Expand Up @@ -111,7 +111,7 @@ GEM
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (0.2.2)
importmap-rails (0.2.7)
rails (>= 6.0.0)
json (2.5.1)
jsonapi-serializer (2.2.0)
Expand Down Expand Up @@ -228,11 +228,11 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
stimulus-rails (0.3.3)
stimulus-rails (0.3.7)
rails (>= 6.0.0)
thor (1.1.0)
tilt (2.0.10)
turbo-rails (0.7.2)
turbo-rails (0.7.3)
rails (>= 6.0.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
Expand Down
7 changes: 4 additions & 3 deletions app/helpers/spina/spina_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module Spina::SpinaHelper

def spina_importmap_tags
def spina_importmap_tags(entry_point = "application")
safe_join [
javascript_inline_importmap_tag(Spina.config.importmap),
javascript_inline_importmap_tag(Spina.config.importmap.to_json(resolver: self)),
javascript_importmap_module_preload_tags(Spina.config.importmap),
javascript_importmap_shim_tag,
javascript_include_tag("spina/libraries/trix"),
javascript_import_module_tag("application")
javascript_import_module_tag(entry_point)
], "\n"
end

Expand Down
6 changes: 5 additions & 1 deletion lib/spina/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ class Engine < ::Rails::Engine
pin "@hotwired/stimulus-autoloader", to: "stimulus-autoloader.js"
pin "@hotwired/turbo-rails", to: "turbo.js"

pin_all_from Spina::Engine.root.join("app/assets/javascripts/spina"), append_base_path: true
# Spina entrypoint
pin "application", to: "spina/application.js"

pin_all_from Spina::Engine.root.join("app/assets/javascripts/spina/controllers"), under: "controllers", to: "spina/controllers"
pin_all_from Spina::Engine.root.join("app/assets/javascripts/spina/libraries"), under: "libraries", to: "spina/libraries"
end
end

Expand Down
2 changes: 1 addition & 1 deletion spina.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'rack-rewrite', '>= 1.5.0'
gem.add_dependency 'attr_json'
gem.add_dependency 'view_component', '~> 2.32'
gem.add_dependency 'importmap-rails', '0.2.2'
gem.add_dependency 'importmap-rails', '0.2.7'
gem.add_dependency 'turbo-rails', '~> 0.7.2'
gem.add_dependency 'stimulus-rails', '~> 0.3.3'
gem.add_dependency 'babosa'
Expand Down

0 comments on commit f70cfc1

Please sign in to comment.