stimulus_reflex 3.5.0.rc4 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +19 -13
  3. data/app/assets/javascripts/stimulus_reflex.js +1 -1
  4. data/app/assets/javascripts/stimulus_reflex.umd.js +1 -1
  5. data/lib/generators/stimulus_reflex/stimulus_reflex_generator.rb +2 -2
  6. data/lib/generators/stimulus_reflex/templates/app/javascript/config/cable_ready.js.tt +1 -1
  7. data/lib/generators/stimulus_reflex/templates/app/javascript/config/index.js.tt +1 -1
  8. data/lib/generators/stimulus_reflex/templates/app/javascript/config/stimulus_reflex.js.tt +1 -1
  9. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/%file_name%_controller.js.tt +1 -1
  10. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/application.js.tt +1 -1
  11. data/lib/install/action_cable.rb +30 -30
  12. data/lib/install/broadcaster.rb +11 -11
  13. data/lib/install/bundle.rb +9 -9
  14. data/lib/install/compression.rb +5 -5
  15. data/lib/install/config.rb +22 -22
  16. data/lib/install/development.rb +19 -19
  17. data/lib/install/esbuild.rb +28 -28
  18. data/lib/install/example.rb +3 -3
  19. data/lib/install/importmap.rb +29 -29
  20. data/lib/install/initializers.rb +3 -3
  21. data/lib/install/mrujs.rb +25 -25
  22. data/lib/install/npm_packages.rb +7 -7
  23. data/lib/install/reflexes.rb +2 -2
  24. data/lib/install/shakapacker.rb +23 -23
  25. data/lib/install/spring.rb +7 -7
  26. data/lib/install/updatable.rb +7 -7
  27. data/lib/install/vite.rb +22 -22
  28. data/lib/install/webpacker.rb +27 -27
  29. data/lib/install/yarn.rb +9 -9
  30. data/lib/stimulus_reflex/html/document_fragment.rb +5 -3
  31. data/lib/stimulus_reflex/installer.rb +303 -277
  32. data/lib/stimulus_reflex/version.rb +1 -1
  33. data/lib/stimulus_reflex.rb +2 -0
  34. data/lib/tasks/stimulus_reflex/stimulus_reflex.rake +8 -8
  35. data/package.json +1 -1
  36. data/stimulus_reflex.gemspec +2 -0
  37. data/yarn.lock +7 -7
  38. metadata +30 -2
@@ -3,11 +3,13 @@
3
3
  require "uri"
4
4
  require "open-uri"
5
5
  require "rack"
6
+ require "ostruct"
6
7
  require "active_support/all"
7
8
  require "action_dispatch"
8
9
  require "action_cable"
9
10
  require "action_view"
10
11
  require "nokogiri"
12
+ require "nokogiri/html5/inference"
11
13
  require "cable_ready"
12
14
  require "stimulus_reflex/version"
13
15
  require "stimulus_reflex/open_struct_fix"
@@ -53,8 +53,8 @@ end
53
53
  namespace :stimulus_reflex do
54
54
  desc "✨ Install StimulusReflex and CableReady ✨"
55
55
  task :install do
56
- create_dir_if_not_exists(Rails.root.join("tmp/stimulus_reflex_installer/templates"))
57
- create_dir_if_not_exists(Rails.root.join("tmp/stimulus_reflex_installer/working"))
56
+ StimulusReflex::Installer.create_dir_if_not_exists(Rails.root.join("tmp/stimulus_reflex_installer/templates"))
57
+ StimulusReflex::Installer.create_dir_if_not_exists(Rails.root.join("tmp/stimulus_reflex_installer/working"))
58
58
 
59
59
  install_complete = Rails.root.join("tmp/stimulus_reflex_installer/complete")
60
60
 
@@ -93,8 +93,8 @@ namespace :stimulus_reflex do
93
93
  end
94
94
 
95
95
  # if there is an installation in progress, continue where we left off
96
- if installer_entrypoint_path.exist?
97
- entrypoint = installer_entrypoint_path.read
96
+ if StimulusReflex::Installer.installer_entrypoint_path.exist?
97
+ entrypoint = StimulusReflex::Installer.installer_entrypoint_path.read
98
98
 
99
99
  puts "✨ Resuming \e[38;5;220mStimulusReflex\e[0m and \e[38;5;220mCableReady\e[0m installation ✨"
100
100
  puts
@@ -118,18 +118,18 @@ namespace :stimulus_reflex do
118
118
  entrypoint = if options.key? "entrypoint"
119
119
  options["entrypoint"]
120
120
  else
121
- auto_detect_entrypoint
121
+ StimulusReflex::Installer.auto_detect_entrypoint
122
122
  end
123
123
 
124
- installer_entrypoint_path.write(entrypoint)
124
+ StimulusReflex::Installer.installer_entrypoint_path.write(entrypoint)
125
125
  end
126
126
 
127
127
  # verify their bundler before starting, unless they explicitly specified on CLI
128
128
  if !used_bundler
129
- used_bundler = bundler
129
+ used_bundler = StimulusReflex::Installer.bundler
130
130
  end
131
131
 
132
- installer_bundler_path.write(used_bundler)
132
+ StimulusReflex::Installer.installer_bundler_path.write(used_bundler)
133
133
 
134
134
  FileUtils.touch("tmp/stimulus_reflex_installer/backups")
135
135
  File.write("tmp/stimulus_reflex_installer/template_src", File.expand_path("../../generators/stimulus_reflex/templates/", __dir__))
data/package.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "dependencies": {
58
58
  "@hotwired/stimulus": "^3",
59
59
  "@rails/actioncable": "^6 || ^7",
60
- "cable_ready": "^5.0.0"
60
+ "cable_ready": "^5.0.4"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@open-wc/testing": "^3.1.7",
@@ -50,6 +50,7 @@ Gem::Specification.new do |gem|
50
50
  gem.add_dependency "nokogiri", "~> 1.0"
51
51
  gem.add_dependency "rack", ">= 2", "< 4"
52
52
  gem.add_dependency "redis", ">= 4.0", "< 6.0"
53
+ gem.add_dependency "nokogiri-html5-inference", "~> 0.3"
53
54
 
54
55
  gem.add_development_dependency "bundler", "~> 2.0"
55
56
  gem.add_development_dependency "magic_frozen_string_literal", "~> 1.2"
@@ -57,4 +58,5 @@ Gem::Specification.new do |gem|
57
58
  gem.add_development_dependency "rails", *rails_version
58
59
  gem.add_development_dependency "rake", "~> 13.0"
59
60
  gem.add_development_dependency "standard", "~> 1.24"
61
+ gem.add_development_dependency "minitest", "5.18.1"
60
62
  end
data/yarn.lock CHANGED
@@ -1452,10 +1452,10 @@ bytes@3.1.2:
1452
1452
  resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
1453
1453
  integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==
1454
1454
 
1455
- cable_ready@^5.0.0:
1456
- version "5.0.1"
1457
- resolved "https://registry.yarnpkg.com/cable_ready/-/cable_ready-5.0.1.tgz#1cef5991cf7a064d09971ed7d87c614dec2ee1e1"
1458
- integrity sha512-+t9rKTgYwW5XBx113y97qC8MNEtBZZL84Isdec23HWvjMx0icOQsMzHJE75ycjevgjACTeWZqjRcCdtCHxgZ9g==
1455
+ cable_ready@^5.0.4:
1456
+ version "5.0.4"
1457
+ resolved "https://registry.yarnpkg.com/cable_ready/-/cable_ready-5.0.4.tgz#88b5bff27871be402f6ea049d65126bb1995d147"
1458
+ integrity sha512-HZLj3SjgEDB4H2GqtKHmg2lOu8YCti0hsPR9XC2mMfz6WOkHK4FWt1/NJ0OIKAcQAEnxEJEtlIgBv6tP1m958g==
1459
1459
  dependencies:
1460
1460
  morphdom "2.6.1"
1461
1461
 
@@ -4966,9 +4966,9 @@ vfile@^4.0.0:
4966
4966
  vfile-message "^2.0.0"
4967
4967
 
4968
4968
  vite@^4.3.8:
4969
- version "4.5.2"
4970
- resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.2.tgz#d6ea8610e099851dad8c7371599969e0f8b97e82"
4971
- integrity sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==
4969
+ version "4.5.3"
4970
+ resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a"
4971
+ integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==
4972
4972
  dependencies:
4973
4973
  esbuild "^0.18.10"
4974
4974
  postcss "^8.4.27"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0.rc4
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-12 00:00:00.000000000 Z
11
+ date: 2024-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "<"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '6.0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: nokogiri-html5-inference
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.3'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.3'
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: bundler
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -268,6 +282,20 @@ dependencies:
268
282
  - - "~>"
269
283
  - !ruby/object:Gem::Version
270
284
  version: '1.24'
285
+ - !ruby/object:Gem::Dependency
286
+ name: minitest
287
+ requirement: !ruby/object:Gem::Requirement
288
+ requirements:
289
+ - - '='
290
+ - !ruby/object:Gem::Version
291
+ version: 5.18.1
292
+ type: :development
293
+ prerelease: false
294
+ version_requirements: !ruby/object:Gem::Requirement
295
+ requirements:
296
+ - - '='
297
+ - !ruby/object:Gem::Version
298
+ version: 5.18.1
271
299
  description:
272
300
  email:
273
301
  - natehop@gmail.com