Sha256: d6d1c413fc1e46a005ffb0127d3c30507095dc494adca35e9f6af8d95d61e48b

Contents?: true

Size: 743 Bytes

Versions: 14

Compression:

Stored size: 743 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 %(You must import "./controllers" in your JavaScript entrypoint), :red
end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
stimulus-rails-1.0.2 lib/install/stimulus_with_node.rb
stimulus-rails-1.0.0 lib/install/stimulus_with_node.rb
stimulus-rails-0.7.3 lib/install/stimulus_with_node.rb
stimulus-rails-0.7.2 lib/install/stimulus_with_node.rb
stimulus-rails-0.7.1 lib/install/stimulus_with_node.rb
stimulus-rails-0.7.0 lib/install/stimulus_with_node.rb
stimulus-rails-0.6.2 lib/install/stimulus_with_node.rb
stimulus-rails-0.6.1 lib/install/stimulus_with_node.rb
stimulus-rails-0.6.0 lib/install/stimulus_with_node.rb
stimulus-rails-0.5.4 lib/install/stimulus_with_node.rb
stimulus-rails-0.5.3 lib/install/stimulus_with_node.rb
stimulus-rails-0.5.2 lib/install/stimulus_with_node.rb
stimulus-rails-0.5.1 lib/install/stimulus_with_node.rb
stimulus-rails-0.5.0 lib/install/stimulus_with_node.rb