vite_rails 3.0.0 → 3.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: d9378f7c4370df9ef747fce41e397f90a106ca3117c59750cdc6c17cc0799981
4
- data.tar.gz: 8c99cbfe0db03762f30d6c45c933549357599dc63f8c14b6e48c8fbf580ea4cc
3
+ metadata.gz: 769255d6138cadf72ef35e24b27b263ea5a3479926594b2b89c839bf5f5f0589
4
+ data.tar.gz: a9c177aea6373f4474d8ff95602bb84aabec2f14333cc92f7c06b1559555357d
5
5
  SHA512:
6
- metadata.gz: 146f5dfd12b2a9388569264944bef6f4a19f6c958a3d36dd2e42ef68848f669c214133c6ae4d0209b064f879abcd3a9f635fd1a46791b56590f9088b60fc3475
7
- data.tar.gz: 2df8f74a0b3d19aeb40bb889ff3d87131150b2ee60157bc556296f2660bd0aa83894d170b4fd6cf6e0141c04a426e04554cf3f8ce4dc4e9a963dfb3d1d0b02c9
6
+ metadata.gz: 9d70ff02a04c074ae7df6a10398ee839a96c9b5624ac946fa1b3ea055e1358db98509457ffcb36b688da363ada663f45f7f212428ec63190003df93818792606
7
+ data.tar.gz: d25f4269593124a968ad0a4b14d7db008709393c7b30d9da82933b3f55195980ac02310d48969075d89e9db7dd1e73bce849ed0a420f5a50f76c708776ffb61d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ ## [3.0.4](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.3...vite_rails@3.0.4) (2022-01-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * 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))
7
+
8
+
9
+
10
+ ## [3.0.3](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.2...vite_rails@3.0.3) (2021-12-22)
11
+
12
+
13
+
14
+ ## [3.0.2](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.1...vite_rails@3.0.2) (2021-12-12)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * 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))
20
+ * comment back glob import ([943e7f1](https://github.com/ElMassimo/vite_ruby/commit/943e7f1ca23a8abdee09c1495dc9e96494bc6202))
21
+
22
+
23
+
24
+ ## [3.0.1](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.0...vite_rails@3.0.1) (2021-10-29)
25
+
26
+
27
+ ### Features
28
+
29
+ * enable hmr when running tests in development with vite dev server ([e253bba](https://github.com/ElMassimo/vite_ruby/commit/e253bba26d164aabc7a9526df504c207ad2cf6f9))
30
+
31
+
32
+
1
33
  # [3.0.0](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.13...vite_rails@3.0.0) (2021-08-16)
2
34
 
3
35
  See https://github.com/ElMassimo/vite_ruby/pull/116 for features and breaking changes.
@@ -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.0'
4
+ VERSION = '3.0.4'
5
5
  end
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "test": {
12
12
  "autoBuild": true,
13
- "publicOutputDir": "vite-test"
13
+ "publicOutputDir": "vite-test",
14
+ "port": 3037
14
15
  }
15
16
  }
@@ -21,7 +21,7 @@ console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify
21
21
  // import ActiveStorage from '@rails/activestorage'
22
22
  //
23
23
  // // Import all channels.
24
- // import.meta.globEager('./**/*_channel.js')
24
+ // const channels = import.meta.globEager('./**/*_channel.js')
25
25
  //
26
26
  // Turbolinks.start()
27
27
  // ActiveStorage.start()
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.0
4
+ version: 3.0.4
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-08-16 00:00:00.000000000 Z
11
+ date: 2022-01-02 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.0/vite_rails
86
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.0/vite_rails/CHANGELOG.md
85
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.4/vite_rails
86
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.4/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.3.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Use Vite in Rails and bring joy to your JavaScript experience