vite_ruby 1.2.2 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75c25f6f407996069ce830b7822b0d10041f930ce7ce6bc317a6413a73f66ae8
4
- data.tar.gz: c8e1bb8d969e408f0b21bdd3a4bb9d0e5a0a61e5d72635bb021c2f423676b170
3
+ metadata.gz: 3bd015b4a69f41ddc7d5bd53859232de29df842689945267c268942b98244e02
4
+ data.tar.gz: d84ed1dfa2ea7695c2396844ec2817391ca5f72796a28798c69ae0eb4b2947f4
5
5
  SHA512:
6
- metadata.gz: 913332a8629f8521a7af235951e761a103b167ed76f17021691835a8508c52d51e7ac9cdf39f46e73461a98c6d11de99900eccd4c4a45490ee23a405c7904f7c
7
- data.tar.gz: 91faeb4e8810c9b260d2dc91b0df4db41f50b3f533ca44c60859200ecfbfddccb3406814f651048f89f4f6e119f6d032cfbe85d603289be65399f9815e68cd34
6
+ metadata.gz: 0f883fecbf825e1acfd0e5b9f12db3da22e5831ed481538996bb630f14adb7316327017336f738d0b03bc781bdd39d34c984fcce98f70a0d9d34e5b8080d3c93
7
+ data.tar.gz: 58cdd3b818d7a28c8965c1776c582a3c2dce5eb5d8dc1e41842b04356b0f0c605176418ccf69209794329601fd01e63139af762d1d7e590a4dda1f2c63c83732
data/CHANGELOG.md CHANGED
@@ -1,3 +1,48 @@
1
+ ## [1.2.7](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.6...vite_ruby@1.2.7) (2021-04-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Support Rails 5.1 by avoiding monkeypatched `Array#append` ([1b59551](https://github.com/ElMassimo/vite_ruby/commit/1b5955170b33a528a2b13d7e7e308e8493d97a91)), closes [/github.com/rails/rails/blob/5-1-stable/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb#L2-L3](https://github.com//github.com/rails/rails/blob/5-1-stable/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb/issues/L2-L3)
7
+
8
+
9
+
10
+ ## [1.2.6](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.5...vite_ruby@1.2.6) (2021-04-26)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Update installation to use the latest version of the plugin ([#67](https://github.com/ElMassimo/vite_ruby/issues/67)) ([7e10636](https://github.com/ElMassimo/vite_ruby/commit/7e10636f5396f496bd099a03e069cf8572b9585b))
16
+
17
+
18
+
19
+ ## [1.2.5](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.4...vite_ruby@1.2.5) (2021-04-21)
20
+
21
+
22
+ ### Features
23
+
24
+ * Add helpers to enable HMR when using @vitejs/plugin-react-refresh ([a80f286](https://github.com/ElMassimo/vite_ruby/commit/a80f286d4305bbae29ea7cea42a4329a530f43fa))
25
+
26
+
27
+
28
+ ## [1.2.4](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.3...vite_ruby@1.2.4) (2021-04-21)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * Avoid removing `base` from proxied requests to avoid confusion. ([25f79a9](https://github.com/ElMassimo/vite_ruby/commit/25f79a9848df3e6c2ffbeb9bd4fbc44f73e4c68a))
34
+
35
+
36
+
37
+ ## [1.2.3](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.2...vite_ruby@1.2.3) (2021-04-15)
38
+
39
+
40
+ ### Features
41
+
42
+ * Add support for .scss, .less, and .styl entrypoints (close [#50](https://github.com/ElMassimo/vite_ruby/issues/50)) ([bb1d295](https://github.com/ElMassimo/vite_ruby/commit/bb1d2953b3a8c5862d26cdfcd5edc5cc918d1c5a))
43
+
44
+
45
+
1
46
  ## [1.2.2](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.1...vite_ruby@1.2.2) (2021-03-20)
2
47
 
3
48
 
data/lib/vite_ruby.rb CHANGED
@@ -17,8 +17,8 @@ class ViteRuby
17
17
  ENV_PREFIX = 'VITE_RUBY'
18
18
 
19
19
  # Internal: Versions used by default when running `vite install`.
20
- DEFAULT_VITE_VERSION = '^2.0.3'
21
- DEFAULT_PLUGIN_VERSION = '^1.0.13'
20
+ DEFAULT_VITE_VERSION = '^2.2.3'
21
+ DEFAULT_PLUGIN_VERSION = '^2.0.2'
22
22
 
23
23
  # Internal: Ruby Frameworks that have a companion library for Vite Ruby.
24
24
  SUPPORTED_FRAMEWORKS = %w[rails hanami roda padrino sinatra].freeze
@@ -31,9 +31,9 @@ private
31
31
 
32
32
  def rewrite_uri_for_vite(env)
33
33
  uri = env.fetch('REQUEST_URI') { [env['PATH_INFO'], env['QUERY_STRING']].reject { |str| str.to_s.strip.empty? }.join('?') }
34
- .sub(vite_asset_url_prefix, '/')
35
34
  .sub(HOST_WITH_PORT_REGEX, '/') # Hanami adds the host and port.
36
35
  .sub('.ts.js', '.ts') # Hanami's javascript helper always adds the extension.
36
+ .sub(/(\.\w+)\.css$/, '\1') # Rails' stylesheet_link_tag always adds the extension.
37
37
  env['PATH_INFO'], env['QUERY_STRING'] = (env['REQUEST_URI'] = uri).split('?')
38
38
  end
39
39
 
@@ -46,6 +46,21 @@ class ViteRuby::Manifest
46
46
  prefix_vite_asset('@vite/client') if dev_server_running?
47
47
  end
48
48
 
49
+ # Public: The content of the preamble needed by the React Refresh plugin.
50
+ def react_refresh_preamble
51
+ if dev_server_running?
52
+ <<~REACT_REFRESH
53
+ <script type="module">
54
+ import RefreshRuntime from '#{ prefix_vite_asset('@react-refresh') }'
55
+ RefreshRuntime.injectIntoGlobalHook(window)
56
+ window.$RefreshReg$ = () => {}
57
+ window.$RefreshSig$ = () => (type) => type
58
+ window.__vite_plugin_react_preamble_installed__ = true
59
+ </script>
60
+ REACT_REFRESH
61
+ end
62
+ end
63
+
49
64
  protected
50
65
 
51
66
  # Internal: Strict version of lookup.
@@ -28,11 +28,11 @@ private
28
28
  def command_for(args)
29
29
  [config.to_env].tap do |cmd|
30
30
  args = args.clone
31
- cmd.append('node', '--inspect-brk') if args.delete('--inspect')
32
- cmd.append('node', '--trace-deprecation') if args.delete('--trace_deprecation')
33
- cmd.append(vite_executable)
34
- cmd.append(*args)
35
- cmd.append('--mode', config.mode) unless args.include?('--mode') || args.include?('-m')
31
+ cmd.push('node', '--inspect-brk') if args.delete('--inspect')
32
+ cmd.push('node', '--trace-deprecation') if args.delete('--trace_deprecation')
33
+ cmd.push(vite_executable)
34
+ cmd.push(*args)
35
+ cmd.push('--mode', config.mode) unless args.include?('--mode') || args.include?('-m')
36
36
  end
37
37
  end
38
38
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '1.2.2'
4
+ VERSION = '1.2.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-20 00:00:00.000000000 Z
11
+ date: 2021-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -237,8 +237,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
237
237
  licenses:
238
238
  - MIT
239
239
  metadata:
240
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@1.2.2/vite_ruby
241
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@1.2.2/vite_ruby/CHANGELOG.md
240
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@1.2.7/vite_ruby
241
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@1.2.7/vite_ruby/CHANGELOG.md
242
242
  post_install_message:
243
243
  rdoc_options: []
244
244
  require_paths: