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 +4 -4
- data/lib/install/template.rb +3 -23
- data/lib/vite_rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09b3f9165e33562bd060ff1c5bc3cb2efb76a68d4de1bc3548a213110df6bba4'
|
4
|
+
data.tar.gz: 3aac713bfb90f0586c2309217b45d64bc394312ed5fb08be44391d3dcb68d459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08b9ee75915396e16078094f1870211e5667cc3f9edf9502844be884a556a6c9378bbcdef8374498761643fab94c0302930d18737d98ceaae013c0da0ac9f2d6'
|
7
|
+
data.tar.gz: 482461f60d07e91c99084f74089d10fe07ac2db20aad1c324a45f5b6fbb1f4f815dd436993c21798c4c18e116d5bee729b83abe08e85d02757637731a242d7b0
|
data/lib/install/template.rb
CHANGED
@@ -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 "
|
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 '
|
40
|
+
say 'Vite ⚡️ Rails successfully installed! 🎉', :green
|
data/lib/vite_rails/version.rb
CHANGED
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.
|
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.
|
190
|
-
changelog_uri: https://github.com/ElMassimo/vite_rails/blob/v1.0.
|
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:
|