vite_rails 1.0.3 → 1.0.4

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: b4596570b8e1f1df1839336f50463239af3bb3c251769b7bfa7be112d245a0f3
4
- data.tar.gz: 226884d61c9e133381b025e14dbbd1c9cca922cac7bf52cd9fe5ae77ec2d6550
3
+ metadata.gz: '09b3f9165e33562bd060ff1c5bc3cb2efb76a68d4de1bc3548a213110df6bba4'
4
+ data.tar.gz: 3aac713bfb90f0586c2309217b45d64bc394312ed5fb08be44391d3dcb68d459
5
5
  SHA512:
6
- metadata.gz: 405f84061588ece09e3f52d4137c27421d80f74826c5e6c7fe82ec7691abf703236a1cc13a265006c6f99673511f6ab0ae236028aa9a225c41a7595dde4218fb
7
- data.tar.gz: cc212a87a1b4a5f678866d3e42d1c751465544badff3ecb58d462b59a6dbedc339e89d6e3b9b1fc43f14d4171d4a4115bc580f7493f992ad03a0cae086a9bb8f
6
+ metadata.gz: '08b9ee75915396e16078094f1870211e5667cc3f9edf9502844be884a556a6c9378bbcdef8374498761643fab94c0302930d18737d98ceaae013c0da0ac9f2d6'
7
+ data.tar.gz: 482461f60d07e91c99084f74089d10fe07ac2db20aad1c324a45f5b6fbb1f4f815dd436993c21798c4c18e116d5bee729b83abe08e85d02757637731a242d7b0
@@ -3,7 +3,7 @@
3
3
  # Install Vite Rails
4
4
  say 'Creating configuration files'
5
5
  copy_file "#{ __dir__ }/config/vite.json", ViteRails.config.config_path
6
- copy_file "#{ __dir__ }/config/vite.config.ts", Rails.root
6
+ copy_file "#{ __dir__ }/config/vite.config.ts", Rails.root.join('vite.config.ts')
7
7
 
8
8
  say 'Creating entrypoints directory'
9
9
  directory "#{ __dir__ }/javascript/entrypoints", ViteRails.config.source_code_dir.join(ViteRails.config.entrypoints_dir)
@@ -26,14 +26,6 @@ if git_ignore_path.exist?
26
26
  }
27
27
  end
28
28
 
29
- install = if Rails.root.join('yarn.lock').exist?
30
- 'yarn add'
31
- elsif Rails.root.join('pnpm-lock.yaml').exist?
32
- 'pnpm install'
33
- else
34
- 'npm install'
35
- end
36
-
37
29
  Dir.chdir(Rails.root) do
38
30
  say 'Installing JavaScript dependencies for Vite Rails'
39
31
  package_json = File.read("#{ __dir__ }/../../package.json")
@@ -42,19 +34,7 @@ Dir.chdir(Rails.root) do
42
34
  plugin_version = package_json.match(/"vite-plugin-ruby": "(.*)"/)[1]
43
35
 
44
36
  say 'Installing vite as direct dependencies'
45
- run "#{ install } vite@#{ vite_version } vite-plugin-ruby@#{ plugin_version }"
46
- end
47
-
48
- if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR > 1
49
- src = begin
50
- "#{ ViteRails.config.protocol }://#{ ViteRails.config.host_with_port }"
51
- rescue StandardError
52
- 'http://localhost:3036'
53
- end
54
- say 'You need to allow vite-dev-server host as allowed origin for connect-src.', :yellow
55
- say 'This can be done in Rails 5.2+ for development environment in the CSP initializer', :yellow
56
- say 'config/initializers/content_security_policy.rb with a snippet like this:', :yellow
57
- say %(policy.connect_src :self, :https, "http://#{ src }", "ws://#{ src }" if Rails.env.development?), :yellow
37
+ run "yarn add vite@#{ vite_version } vite-plugin-ruby@#{ plugin_version }"
58
38
  end
59
39
 
60
- say 'ViteRails successfully installed 🎉 🍰', :green
40
+ say 'Vite ⚡️ Rails successfully installed! 🎉', :green
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRails
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
@@ -186,8 +186,8 @@ homepage: https://github.com/ElMassimo/vite_rails
186
186
  licenses:
187
187
  - MIT
188
188
  metadata:
189
- source_code_uri: https://github.com/ElMassimo/vite_rails/tree/v1.0.3
190
- changelog_uri: https://github.com/ElMassimo/vite_rails/blob/v1.0.3/CHANGELOG.md
189
+ source_code_uri: https://github.com/ElMassimo/vite_rails/tree/v1.0.4
190
+ changelog_uri: https://github.com/ElMassimo/vite_rails/blob/v1.0.4/CHANGELOG.md
191
191
  post_install_message:
192
192
  rdoc_options: []
193
193
  require_paths: