stimulus-rails 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/install/stimulus.rb +1 -1
- data/lib/stimulus/importmap_helper.rb +2 -0
- data/lib/stimulus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 723e63c957d1d8a4ab833a4edb197f2379d4604ee68b7587e8bb85560f568ecb
|
4
|
+
data.tar.gz: efe60efa445d404fdf3faf067223eb6ff187d4d41665cc7c78129b54abb94632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8ea0462b55efd12f2cee6c70fd08a4efeafbb2840deb91fcfb3e2dba7fd7e2c014ec0f1a5b0c5f9906aa997a26fa7db1cb21620412d86faab0b7078226399c7
|
7
|
+
data.tar.gz: 51300cbb38d24cbd24acc9a835e97bd744702325e18396af174e2c3601597319574860e0c318373c632951e9e81f605c0cecd18d0fb63ded358fbb9d538cd0ee
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ The last command will:
|
|
17
17
|
1. Create an example controller in `app/assets/javascripts/controllers/hello_controller.js`
|
18
18
|
2. Append the include tags to the `<head>` of your `app/views/layouts/application.html.erb`.
|
19
19
|
3. Initialize your `importmap.json` in `app/assets/javascripts/importmap.json.erb`.
|
20
|
-
4. Ensure JavaScript is included in your `app/config/manifest.js` file for compilation.
|
20
|
+
4. Ensure JavaScript is included in your `app/assets/config/manifest.js` file for compilation.
|
21
21
|
|
22
22
|
|
23
23
|
## Usage
|
data/lib/install/stimulus.rb
CHANGED
@@ -2,7 +2,7 @@ say "Copying Stimulus JavaScript"
|
|
2
2
|
directory "#{__dir__}/app/assets/javascripts", "app/assets/javascripts"
|
3
3
|
empty_directory_with_keep_file "app/assets/javascripts/libraries"
|
4
4
|
|
5
|
-
say "Add app/javascripts to asset pipeline manifest"
|
5
|
+
say "Add app/assets/javascripts to asset pipeline manifest"
|
6
6
|
append_to_file Rails.root.join("app/assets/config/manifest.js").to_s, "//= link_tree ../javascripts\n"
|
7
7
|
|
8
8
|
APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
|
@@ -7,6 +7,8 @@ module Stimulus::ImportmapHelper
|
|
7
7
|
Array(paths).flat_map do |path|
|
8
8
|
if (absolute_path = Rails.root.join(path)).exist?
|
9
9
|
absolute_path.children.collect do |module_filename|
|
10
|
+
next unless module_filename.extname =~ /js(m)?$/
|
11
|
+
|
10
12
|
module_name = importmap_module_name_from(module_filename)
|
11
13
|
module_path = asset_path("#{absolute_path.basename.to_s}/#{module_filename.basename}")
|
12
14
|
|
data/lib/stimulus/version.rb
CHANGED