stimulus-rails 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7b182fb2a48a9405b734b3d8180930f181cf115cb52b7d9061f3f92183d2f3e
|
4
|
+
data.tar.gz: 663e24b437761d3ff60ad7e78e8dc9ac9191ad91b83935ae95a04100dd6c66c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d84fd49c9ad55572e525b5239b289fbe9a01839f67a24453efa875357ab0a0ecb30f39bc43df447d565dd75cda282ab21c653e09ff7db36d1150136b53fcbb0
|
7
|
+
data.tar.gz: 9e3bfa7a5be5a8457a3612863d7b136fd3c3e514f04367ceacce7327050f2403b69f18305c598cc07311a89cb3fa55c1f4aeb667c0f73e0c76cc15bdc8e684c7
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Stimulus::StimulusHelper
|
2
|
-
def stimulus_include_tags
|
2
|
+
def stimulus_include_tags(importmap = "importmap.json")
|
3
3
|
safe_join [
|
4
4
|
javascript_include_tag("stimulus/libraries/es-module-shims", type: "module"),
|
5
|
-
tag.script(type: "importmap-shim", src: asset_path(
|
5
|
+
tag.script(type: "importmap-shim", src: asset_path(importmap)),
|
6
6
|
javascript_include_tag("stimulus/libraries/stimulus", type: "module-shim"),
|
7
7
|
javascript_include_tag("stimulus/loaders/autoloader", type: "module-shim")
|
8
8
|
], "\n"
|
@@ -1,9 +1,9 @@
|
|
1
1
|
// Load all the controllers within this directory and all subdirectories.
|
2
|
-
// Controller files must be named *_controller.js.
|
2
|
+
// Controller files must be named *_controller.js or *_controller.ts.
|
3
3
|
|
4
4
|
import { Application } from "stimulus"
|
5
5
|
import { definitionsFromContext } from "stimulus/webpack-helpers"
|
6
6
|
|
7
7
|
const application = Application.start()
|
8
|
-
const context = require.context("controllers", true, /_controller\.js$/)
|
8
|
+
const context = require.context("controllers", true, /_controller\.(js|ts)$/)
|
9
9
|
application.load(definitionsFromContext(context))
|
data/lib/stimulus/engine.rb
CHANGED
@@ -5,7 +5,9 @@ module Stimulus
|
|
5
5
|
config.autoload_once_paths = %w( #{root}/app/helpers )
|
6
6
|
|
7
7
|
initializer "stimulus.assets" do
|
8
|
-
Rails.application.config.assets
|
8
|
+
if Rails.application.config.respond_to?(:assets)
|
9
|
+
Rails.application.config.assets.precompile += %w( importmap.json stimulus/manifest )
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
initializer "stimulus.helpers" do
|
@@ -13,8 +15,10 @@ module Stimulus
|
|
13
15
|
helper Stimulus::StimulusHelper
|
14
16
|
end
|
15
17
|
|
16
|
-
Rails.application.config.assets
|
17
|
-
|
18
|
+
if Rails.application.config.respond_to?(:assets)
|
19
|
+
Rails.application.config.assets.configure do |env|
|
20
|
+
env.context_class.class_eval { include Stimulus::ImportmapHelper }
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
data/lib/stimulus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stimulus-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-06-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
rubygems_version: 3.1.
|
77
|
+
rubygems_version: 3.1.4
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: A modest JavaScript framework for the HTML you already have.
|