Sha256: 2552b0e903065e5be78571b1d10cd6a011cfba3beeb0742cd495f0cc5f22ea3c

Contents?: true

Size: 795 Bytes

Versions: 6

Compression:

Stored size: 795 Bytes

Contents

say "Create controllers directory"
empty_directory "app/javascript/controllers"
copy_file "#{__dir__}/app/javascript/controllers/index_for_node.js",
  "app/javascript/controllers/index.js"
copy_file "#{__dir__}/app/javascript/controllers/application.js",
  "app/javascript/controllers/application.js"
copy_file "#{__dir__}/app/javascript/controllers/hello_controller.js",
  "app/javascript/controllers/hello_controller.js"

if (Rails.root.join("app/javascript/application.js")).exist?
  say "Import Stimulus controllers"
  append_to_file "app/javascript/application.js", %(import "./controllers"\n)
else
  say %(Couldn't find "app/javascript/application.js".\nYou must import "./controllers" in your JavaScript entrypoint file), :red
end

say "Install Stimulus"
run "bun add @hotwired/stimulus"

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
stimulus-rails-1.3.4 lib/install/stimulus_with_bun.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/stimulus-rails-1.3.3/lib/install/stimulus_with_bun.rb
stimulus-rails-1.3.3 lib/install/stimulus_with_bun.rb
stimulus-rails-1.3.2 lib/install/stimulus_with_bun.rb
stimulus-rails-1.3.1 lib/install/stimulus_with_bun.rb
stimulus-rails-1.3.0 lib/install/stimulus_with_bun.rb