vite_rails 3.0.1 → 3.0.5

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: 40fa20a6ed4f4f708d760086d15701248d753b46efc4eb679898b9c48602fe2c
4
- data.tar.gz: b38147a758c90a6e08d3b6176010de06e6b23ae82ec55b32b1e955fcafbd3c67
3
+ metadata.gz: c87996666ec3539001f3df454f8dbd7d7b20acd6cdc231f5bcfef06d763280b0
4
+ data.tar.gz: c80aa99a365b9fc8208453ec3d07587b5b98524306cbaeaac6bd5c1e46859184
5
5
  SHA512:
6
- metadata.gz: c5ba249f0d931e15ec99c5139cb90ad46d3e20429a81335e3e0eaa13bae02bacf4b181fc0c4dc7ca510ba31160addf5166a4407264242da01dd312d92ecf65f7
7
- data.tar.gz: 3c3dd21dfdd38aa7f204b9857d6a8191b05382a7a8cf32c2470943abea7b9d7812c578bd4d714c5d1197ca18cf977025080fd14d7653fcdfe95c5c7c0aac7620
6
+ metadata.gz: 7d9fd4ee0e5927cc15f8d9857a747e0222613fdbbb06c6ace6a13bdbe88084848d19471baf70e8d3c59ad63222ecda6832d8245bf64f82baf03348eddbf840d5
7
+ data.tar.gz: 749a3fb089e0b40f615305eddd63c12249e1b7f5406fc2afd8a7533cda2fd389a3a66addf3ba01cb05eb193236d995711fd66252f725a4c7a65b09a41f5a79d1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ ## [3.0.5](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.4...vite_rails@3.0.5) (2022-01-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update example setup from turbolinks to @hotwired/turbo ([e1750bf](https://github.com/ElMassimo/vite_ruby/commit/e1750bfb4b22a9a73a2b86950fb203d3e489ced6))
7
+
8
+
9
+
10
+ ## [3.0.4](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.3...vite_rails@3.0.4) (2022-01-02)
11
+
12
+
13
+ ### Features
14
+
15
+ * 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))
16
+
17
+
18
+
19
+ ## [3.0.3](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.2...vite_rails@3.0.3) (2021-12-22)
20
+
21
+
22
+
23
+ ## [3.0.2](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.1...vite_rails@3.0.2) (2021-12-12)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * add variable declaration to import.meta.globEager (close [#154](https://github.com/ElMassimo/vite_ruby/issues/154)) ([#155](https://github.com/ElMassimo/vite_ruby/issues/155)) ([9ada2e8](https://github.com/ElMassimo/vite_ruby/commit/9ada2e87c68899e8e1bad368c875f8214036abcc))
29
+ * comment back glob import ([943e7f1](https://github.com/ElMassimo/vite_ruby/commit/943e7f1ca23a8abdee09c1495dc9e96494bc6202))
30
+
31
+
32
+
1
33
  ## [3.0.1](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.0...vite_rails@3.0.1) (2021-10-29)
2
34
 
3
35
 
@@ -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.
@@ -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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.5'
5
5
  end
@@ -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 '@rails/ujs'
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
- // import.meta.globEager('./**/*_channel.js')
25
- //
26
- // Turbolinks.start()
27
- // ActiveStorage.start()
25
+ // const channels = import.meta.globEager('./**/*_channel.js')
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.1
4
+ version: 3.0.5
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: 2021-10-29 00:00:00.000000000 Z
11
+ date: 2022-01-18 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.1/vite_rails
86
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.1/vite_rails/CHANGELOG.md
85
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.5/vite_rails
86
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.5/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.1.4
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