stimulus-rails 1.3.1 → 1.3.2

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: 69b084be3551f786f8c2a0cb0c6cd0f098e5c2064e81f0a9de90ff700cce6e3d
4
- data.tar.gz: c1a0c4e89b409e57cef7cd3e717c3c1c3ad53ba1576e23a2e36d1b9e2ae0b39a
3
+ metadata.gz: 26b4c5a3a8ad8343e36257e5dadadb2a455638b563e778cb3c91c2f6eb711f45
4
+ data.tar.gz: 3cf5b9afc555a09d520622390b3acf67c5c5da746c1e2a79380a2100269e6966
5
5
  SHA512:
6
- metadata.gz: 640d28e1cd8348e222f2e04b73048ec337752304b1cd70d9dea29a9e6f9818b3ee4821ba32da6bdce07a4147150673e56954adabc86f1360dc8bdc8590102ddf
7
- data.tar.gz: 8547fe5f060ecbe8d9a2235154f83285aa02b5ffabf2e69f93c5a9b9fde386f1759051fc67f400002e35d74e1dc0b804b9d3b6d0489de320ffbba955e140768f
6
+ metadata.gz: caf8589004d8e06afc3bc0faef28c38052353bb468702690c3166ad12ca5c8e2ab8c3e46c6c851d2211f244cf9e0869985d929f6363b705b1f281f765d062bd9
7
+ data.tar.gz: f046788a1b1523cd34da3303c8bb5b010173a9db9778509b36d67b671ba2d9181e748358feba6a05e390e0993f3107d16e9a2db46685556d1b7ccf3557c68da3
@@ -11,7 +11,7 @@ say "Import Stimulus controllers"
11
11
  append_to_file "app/javascript/application.js", %(import "controllers"\n)
12
12
 
13
13
  say "Pin Stimulus"
14
- say %(Appending: pin "@hotwired/stimulus", to: "stimulus.min.js"")
14
+ say %(Appending: pin "@hotwired/stimulus", to: "stimulus.min.js")
15
15
  append_to_file "config/importmap.rb", %(pin "@hotwired/stimulus", to: "stimulus.min.js"\n)
16
16
 
17
17
  say %(Appending: pin "@hotwired/stimulus-loading", to: "stimulus-loading.js")
@@ -15,4 +15,8 @@ else
15
15
  end
16
16
 
17
17
  say "Install Stimulus"
18
- run "yarn add @hotwired/stimulus"
18
+ if Rails.root.join("bun.config.js")).exist?
19
+ run "bun add @hotwired/stimulus"
20
+ else
21
+ run "yarn add @hotwired/stimulus"
22
+ end
@@ -12,7 +12,7 @@ module Stimulus::Manifest
12
12
  def import_and_register_controller(controllers_path, controller_path)
13
13
  controller_path = controller_path.relative_path_from(controllers_path).to_s
14
14
  module_path = controller_path.split('.').first
15
- controller_class_name = module_path.camelize.gsub(/::/, "__")
15
+ controller_class_name = module_path.underscore.camelize.gsub(/::/, "__")
16
16
  tag_name = module_path.remove(/_controller/).gsub(/_/, "-").gsub(/\//, "--")
17
17
 
18
18
  <<-JS
@@ -1,3 +1,3 @@
1
1
  module Stimulus
2
- VERSION = "1.3.1"
2
+ VERSION = "1.3.2"
3
3
  end
@@ -45,10 +45,12 @@ namespace :stimulus do
45
45
  end
46
46
 
47
47
  namespace :manifest do
48
+ desc "Show the current Stimulus manifest (all installed controllers)"
48
49
  task :display do
49
50
  puts Stimulus::Manifest.generate_from(Rails.root.join("app/javascript/controllers"))
50
51
  end
51
52
 
53
+ desc "Update the Stimulus manifest (will overwrite controllers/index.js)"
52
54
  task :update do
53
55
  manifest =
54
56
  Stimulus::Manifest.generate_from(Rails.root.join("app/javascript/controllers"))
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: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson