vite_ruby 3.3.2 → 3.3.4
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 +4 -4
- data/CHANGELOG.md +19 -0
- data/lib/tasks/vite.rake +3 -3
- data/lib/vite_ruby/manifest.rb +14 -5
- data/lib/vite_ruby/version.rb +1 -1
- data/lib/vite_ruby.rb +10 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 579d77a9b6f100195112e6ee0fc66d445f35aca1d079c24c9548ea6b708af472
|
4
|
+
data.tar.gz: 13b18e4418675330c2d974b41a56b4dac97a4b4f3f10cffb1216d9370b386a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf5e33d054b13211aeccbcccd96c2c03e8bae08c56c5ad52ffbac39a045b423a393b5e80fec15a7ad56929d4f8db09230b7d71260bd7fd0dd05478b0db661b54
|
7
|
+
data.tar.gz: 334056f48cbf9799e3522aaf575e657b6f7c6b7d825adf59ed602a45d1654d5d97a362b80aec578a836b4bd6ad084b740c4822ba1d99dab1c6ef2ce8a1343f2d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
## [3.3.4](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.3...vite_ruby@3.3.4) (2023-06-27)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* check only once per second when dev server is not running ([#377](https://github.com/ElMassimo/vite_ruby/issues/377)) ([fb33f0a](https://github.com/ElMassimo/vite_ruby/commit/fb33f0a28077f9912deed257b7be3a7e050c2d94))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [3.3.3](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.2...vite_ruby@3.3.3) (2023-06-19)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* allow skipping dev dependencies on install ([#374](https://github.com/ElMassimo/vite_ruby/issues/374)) ([a309f4f](https://github.com/ElMassimo/vite_ruby/commit/a309f4f9fc62fb7b9d0728b66b30ad90e68ba7bf))
|
16
|
+
* Use javascript_tag helper for vite_react_refresh_tag ([#372](https://github.com/ElMassimo/vite_ruby/issues/372)) ([238c6bd](https://github.com/ElMassimo/vite_ruby/commit/238c6bd211c0fafaa6170f0bdd631a0f6e41d992)), closes [#249](https://github.com/ElMassimo/vite_ruby/issues/249)
|
17
|
+
|
18
|
+
|
19
|
+
|
1
20
|
## [3.3.2](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.1...vite_ruby@3.3.2) (2023-05-09)
|
2
21
|
|
3
22
|
|
data/lib/tasks/vite.rake
CHANGED
@@ -42,11 +42,11 @@ namespace :vite do
|
|
42
42
|
|
43
43
|
desc 'Ensure build dependencies like Vite are installed before bundling'
|
44
44
|
task :install_dependencies do
|
45
|
+
install_env_args = ENV['VITE_RUBY_SKIP_INSTALL_DEV_DEPENDENCIES'] == 'true' ? {} : { 'NODE_ENV' => 'development' }
|
45
46
|
cmd = ViteRuby.commands.legacy_npm_version? ? 'npx ci --yes' : 'npx --yes ci'
|
46
|
-
result = system(
|
47
|
-
|
47
|
+
result = system(install_env_args, cmd)
|
48
48
|
# Fallback to `yarn` if `npx` is not available.
|
49
|
-
system(
|
49
|
+
system(install_env_args, 'yarn install --frozen-lockfile') if result.nil?
|
50
50
|
end
|
51
51
|
|
52
52
|
desc "Provide information on ViteRuby's environment"
|
data/lib/vite_ruby/manifest.rb
CHANGED
@@ -51,16 +51,25 @@ class ViteRuby::Manifest
|
|
51
51
|
if dev_server_running?
|
52
52
|
<<~REACT_REFRESH
|
53
53
|
<script type="module">
|
54
|
-
|
55
|
-
RefreshRuntime.injectIntoGlobalHook(window)
|
56
|
-
window.$RefreshReg$ = () => {}
|
57
|
-
window.$RefreshSig$ = () => (type) => type
|
58
|
-
window.__vite_plugin_react_preamble_installed__ = true
|
54
|
+
#{ react_preamble_code }
|
59
55
|
</script>
|
60
56
|
REACT_REFRESH
|
61
57
|
end
|
62
58
|
end
|
63
59
|
|
60
|
+
# Public: Source script for the React Refresh plugin.
|
61
|
+
def react_preamble_code
|
62
|
+
if dev_server_running?
|
63
|
+
<<~REACT_PREAMBLE_CODE
|
64
|
+
import RefreshRuntime from '#{ prefix_asset_with_host('@react-refresh') }'
|
65
|
+
RefreshRuntime.injectIntoGlobalHook(window)
|
66
|
+
window.$RefreshReg$ = () => {}
|
67
|
+
window.$RefreshSig$ = () => (type) => type
|
68
|
+
window.__vite_plugin_react_preamble_installed__ = true
|
69
|
+
REACT_PREAMBLE_CODE
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
64
73
|
protected
|
65
74
|
|
66
75
|
# Internal: Strict version of lookup.
|
data/lib/vite_ruby/version.rb
CHANGED
data/lib/vite_ruby.rb
CHANGED
@@ -85,13 +85,16 @@ class ViteRuby
|
|
85
85
|
# NOTE: Checks only once every second since every lookup calls this method.
|
86
86
|
def dev_server_running?
|
87
87
|
return false unless run_proxy?
|
88
|
-
return
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
88
|
+
return @running if defined?(@running) && Time.now - @running_checked_at < 1
|
89
|
+
|
90
|
+
begin
|
91
|
+
Socket.tcp(config.host, config.port, connect_timeout: config.dev_server_connect_timeout).close
|
92
|
+
@running = true
|
93
|
+
rescue StandardError
|
94
|
+
@running = false
|
95
|
+
ensure
|
96
|
+
@running_checked_at = Time.now
|
97
|
+
end
|
95
98
|
end
|
96
99
|
|
97
100
|
# Public: Additional environment variables to pass to Vite.
|
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: 3.3.
|
4
|
+
version: 3.3.4
|
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: 2023-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -208,8 +208,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
208
208
|
licenses:
|
209
209
|
- MIT
|
210
210
|
metadata:
|
211
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.3.
|
212
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.3.
|
211
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.3.4/vite_ruby
|
212
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.3.4/vite_ruby/CHANGELOG.md
|
213
213
|
post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
|
214
214
|
manually, please run:\n\tbundle exec vite upgrade"
|
215
215
|
rdoc_options: []
|