vite_rails 3.0.2 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/lib/vite_rails/installation.rb +5 -1
- data/lib/vite_rails/tag_helpers.rb +12 -1
- data/lib/vite_rails/version.rb +1 -1
- data/templates/entrypoints/application.js +3 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae7313c888c156ad4339418c4f959d58e19982b5c385eb27666cfb674b74ace6
|
4
|
+
data.tar.gz: 4807b2ad1775adad6e623d93314e7578cea3f8b9f22a9d205cdeccb747e57ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 514c5258487253ee409c141d01ae76f48b577ce31bfc4a91b2f3d4850342c4b0d2f1678daa64f8b79e08a7a38e9f1147bc00410a70256bd1978a2f73a0500409
|
7
|
+
data.tar.gz: fcab6762518180d3824dc6d875842a1a195c424d054c7f04fe8bd67caa0def73395cd7d11a6d7d79d62ea2d10a1b61f985df6dadbe39b11100026717981cbff0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
## [3.0.6](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.5...vite_rails@3.0.6) (2022-02-04)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* don't add crossorigin to included stylesheet tags (close [#189](https://github.com/ElMassimo/vite_ruby/issues/189)) ([#190](https://github.com/ElMassimo/vite_ruby/issues/190)) ([575c731](https://github.com/ElMassimo/vite_ruby/commit/575c73192fb485e8844f67b821c856d1a09db8f5))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [3.0.5](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.4...vite_rails@3.0.5) (2022-01-18)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* update example setup from turbolinks to @hotwired/turbo ([e1750bf](https://github.com/ElMassimo/vite_ruby/commit/e1750bfb4b22a9a73a2b86950fb203d3e489ced6))
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
## [3.0.4](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.3...vite_rails@3.0.4) (2022-01-02)
|
20
|
+
|
21
|
+
|
22
|
+
### Features
|
23
|
+
|
24
|
+
* add style-src to suggestion Content Security Policy changes ([#169](https://github.com/ElMassimo/vite_ruby/issues/169)) ([ec7f4f7](https://github.com/ElMassimo/vite_ruby/commit/ec7f4f7a030a852115b38748dd3cdb22ec3b7e47))
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
## [3.0.3](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.2...vite_rails@3.0.3) (2021-12-22)
|
29
|
+
|
30
|
+
|
31
|
+
|
1
32
|
## [3.0.2](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.1...vite_rails@3.0.2) (2021-12-12)
|
2
33
|
|
3
34
|
|
@@ -30,9 +30,13 @@ module ViteRails::Installation
|
|
30
30
|
# policy.connect_src *policy.connect_src, "ws://\#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
31
31
|
CSP
|
32
32
|
inject_line_after csp_file, 'policy.script_src', <<~CSP
|
33
|
-
# Allow @vite/client to hot reload changes in development
|
33
|
+
# Allow @vite/client to hot reload javascript changes in development
|
34
34
|
# policy.script_src *policy.script_src, :unsafe_eval, "http://\#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
35
35
|
CSP
|
36
|
+
inject_line_after csp_file, 'policy.style_src', <<~CSP
|
37
|
+
# Allow @vite/client to hot reload style changes in development
|
38
|
+
# policy.style_src *policy.style_src, :unsafe_inline if Rails.env.development?
|
39
|
+
CSP
|
36
40
|
end
|
37
41
|
|
38
42
|
# Override: Create a sample JS file and attempt to inject it in an HTML template.
|
@@ -34,7 +34,7 @@ module ViteRails::TagHelpers
|
|
34
34
|
entries = vite_manifest.resolve_entries(*names, type: asset_type)
|
35
35
|
tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, extname: false, **options)
|
36
36
|
tags << vite_preload_tag(*entries.fetch(:imports), crossorigin: crossorigin, **options) unless skip_preload_tags
|
37
|
-
tags << stylesheet_link_tag(*entries.fetch(:stylesheets), media: media,
|
37
|
+
tags << stylesheet_link_tag(*entries.fetch(:stylesheets), media: media, **options) unless skip_style_tags
|
38
38
|
tags
|
39
39
|
end
|
40
40
|
|
@@ -49,6 +49,17 @@ module ViteRails::TagHelpers
|
|
49
49
|
stylesheet_link_tag(*style_paths, **options)
|
50
50
|
end
|
51
51
|
|
52
|
+
# Public: Renders an <img> tag for the specified Vite asset.
|
53
|
+
def vite_image_tag(name, **options)
|
54
|
+
if options[:srcset] && !options[:srcset].is_a?(String)
|
55
|
+
options[:srcset] = options[:srcset].map do |src_name, size|
|
56
|
+
"#{ vite_asset_path(src_name) } #{ size }"
|
57
|
+
end.join(', ')
|
58
|
+
end
|
59
|
+
|
60
|
+
image_tag(vite_asset_path(name), options)
|
61
|
+
end
|
62
|
+
|
52
63
|
private
|
53
64
|
|
54
65
|
# Internal: Returns the current manifest loaded by Vite Ruby.
|
data/lib/vite_rails/version.rb
CHANGED
@@ -15,16 +15,14 @@ console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify
|
|
15
15
|
|
16
16
|
// Example: Load Rails libraries in Vite.
|
17
17
|
//
|
18
|
-
// import '@
|
18
|
+
// import * as Turbo from '@hotwired/turbo'
|
19
|
+
// Turbo.start()
|
19
20
|
//
|
20
|
-
// import Turbolinks from 'turbolinks'
|
21
21
|
// import ActiveStorage from '@rails/activestorage'
|
22
|
+
// ActiveStorage.start()
|
22
23
|
//
|
23
24
|
// // Import all channels.
|
24
25
|
// const channels = import.meta.globEager('./**/*_channel.js')
|
25
|
-
//
|
26
|
-
// Turbolinks.start()
|
27
|
-
// ActiveStorage.start()
|
28
26
|
|
29
27
|
// Example: Import a stylesheet in app/frontend/index.css
|
30
28
|
// import '~/index.css'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vite_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Máximo Mussini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -82,8 +82,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
82
82
|
licenses:
|
83
83
|
- MIT
|
84
84
|
metadata:
|
85
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.
|
86
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.
|
85
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.6/vite_rails
|
86
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.6/vite_rails/CHANGELOG.md
|
87
87
|
post_install_message:
|
88
88
|
rdoc_options: []
|
89
89
|
require_paths:
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
102
|
+
rubygems_version: 3.2.32
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Use Vite in Rails and bring joy to your JavaScript experience
|