stimulus-rails 0.3.6 → 0.3.10

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.
@@ -1,13 +1,13 @@
1
1
  APP_JS_ROOT = Rails.root.join("app/javascript")
2
2
  APP_JS_PATH = APP_JS_ROOT.join("application.js")
3
- IMPORTMAP_PATH = Rails.root.join("config/initializers/importmap.rb")
3
+ IMPORTMAP_PATH = Rails.root.join("config/importmap.rb")
4
4
 
5
5
  if APP_JS_PATH.exist?
6
6
  say "Import Stimulus importmap autoloader in existing app/javascript/application.js"
7
7
  append_to_file APP_JS_PATH, %(\nimport "@hotwired/stimulus-importmap-autoloader"\n)
8
8
  else
9
9
  say <<~INSTRUCTIONS, :red
10
- You must import @hotwire/stimulus and @hotwire/stimulus-importmap-autoloader in your application.js.
10
+ You must import @hotwired/stimulus and @hotwired/stimulus-importmap-autoloader in your application.js.
11
11
  INSTRUCTIONS
12
12
  end
13
13
 
@@ -15,13 +15,13 @@ say "Creating controllers directory"
15
15
  copy_file "#{__dir__}/app/javascript/controllers/hello_controller.js", APP_JS_ROOT.join("controllers/hello_controller.js")
16
16
 
17
17
  if IMPORTMAP_PATH.exist?
18
- say "Pin @hotwired/stimulus and @hotwired/stimulus-importmap-autoloader in config/initializers/importmap.rb"
18
+ say "Pin @hotwired/stimulus and @hotwired/stimulus-importmap-autoloader in config/importmap.rb"
19
19
  insert_into_file \
20
20
  IMPORTMAP_PATH.to_s,
21
21
  %( pin "@hotwired/stimulus", to: "stimulus.js"\n pin "@hotwired/stimulus-importmap-autoloader", to: "stimulus-importmap-autoloader.js"\n pin_all_from "app/javascript/controllers", under: "controllers"\n\n),
22
22
  after: "Rails.application.config.importmap.draw do\n"
23
23
  else
24
24
  say <<~INSTRUCTIONS, :red
25
- You must add @rails/actiontext and trix to your importmap to reference them via ESM.
25
+ You must add @hotwired/stimulus and @hotwired/stimulus-importmap-autoloader to your importmap to reference them via ESM.
26
26
  INSTRUCTIONS
27
27
  end
@@ -2,7 +2,7 @@ module Stimulus
2
2
  class Engine < ::Rails::Engine
3
3
  initializer "stimulus.assets" do
4
4
  if Rails.application.config.respond_to?(:assets)
5
- Rails.application.config.assets.precompile += %w( stimulus stimulus-autoloader stimulus-importmap-autoloader )
5
+ Rails.application.config.assets.precompile += %w( stimulus )
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Stimulus
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.10"
3
3
  end
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.3.6
4
+ version: 0.3.10
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-08-16 00:00:00.000000000 Z
13
+ date: 2021-08-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -39,6 +39,7 @@ files:
39
39
  - app/assets/javascripts/stimulus-importmap-autoloader.js
40
40
  - app/assets/javascripts/stimulus.js
41
41
  - app/assets/javascripts/stimulus@2.js
42
+ - app/assets/javascripts/stimulus@3.0.0-beta.1.js
42
43
  - lib/install/app/javascript/controllers/hello_controller.js
43
44
  - lib/install/app/javascript/controllers/index.js
44
45
  - lib/install/stimulus_with_asset_pipeline.rb