vite_ruby 3.2.8 → 3.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/vite_ruby/builder.rb +7 -6
- data/lib/vite_ruby/cli/install.rb +1 -1
- data/lib/vite_ruby/commands.rb +1 -1
- data/lib/vite_ruby/config.rb +7 -2
- data/lib/vite_ruby/io.rb +1 -1
- data/lib/vite_ruby/runner.rb +3 -3
- data/lib/vite_ruby/version.rb +1 -1
- 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: ab06a4efd04d62e09333db89214fe8d6eaac0fb88507b46c4e25e9d070a539c0
|
4
|
+
data.tar.gz: 674c4ef27be39e0c96cdb7cfb5fdb418a7d9e0b74a72f7226292651b1da596a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 938d55be3f091c91b5986fe3dbcfee2a82072b2b19bf3eb1f808d8759461c9bcecb9f51b4324114d7c81b39871c5832364a3f546a088cf910226d9416db5b1fe
|
7
|
+
data.tar.gz: 2de9f52d3c0aa36667f1f155c8411c72b1cd2ec2d9439b85a7eea2334d68789d7ab683c549d94a4ed37277caf88a5e2ae447991759e0f6300c7159cbc0221ea1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## [3.2.10](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.9...vite_ruby@3.2.10) (2022-11-03)
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
## [3.2.9](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.8...vite_ruby@3.2.9) (2022-11-02)
|
6
|
+
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* allow different ViteRuby instances to set different env vars ([25628a7](https://github.com/ElMassimo/vite_ruby/commit/25628a752cbd4828547c1f454cc4cb2217a591e0))
|
11
|
+
* output exit code when vite process fails ([#294](https://github.com/ElMassimo/vite_ruby/issues/294)) ([eb8f678](https://github.com/ElMassimo/vite_ruby/commit/eb8f678248a02b693fffe5a49309984fed92a051)), closes [#292](https://github.com/ElMassimo/vite_ruby/issues/292)
|
12
|
+
|
13
|
+
|
14
|
+
|
1
15
|
## [3.2.8](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.7...vite_ruby@3.2.8) (2022-10-28)
|
2
16
|
|
3
17
|
|
data/lib/vite_ruby/builder.rb
CHANGED
@@ -14,10 +14,10 @@ class ViteRuby::Builder
|
|
14
14
|
last_build = last_build_metadata(ssr: args.include?('--ssr'))
|
15
15
|
|
16
16
|
if args.delete('--force') || last_build.stale? || config.manifest_paths.empty?
|
17
|
-
stdout, stderr,
|
18
|
-
log_build_result(stdout, stderr,
|
19
|
-
record_build_metadata(last_build, errors: stderr, success: success)
|
20
|
-
success
|
17
|
+
stdout, stderr, status = build_with_vite(*args)
|
18
|
+
log_build_result(stdout, stderr, status)
|
19
|
+
record_build_metadata(last_build, errors: stderr, success: status.success?)
|
20
|
+
status.success?
|
21
21
|
elsif last_build.success
|
22
22
|
logger.debug "Skipping vite build. Watched files have not changed since the last build at #{ last_build.timestamp }"
|
23
23
|
true
|
@@ -52,7 +52,7 @@ private
|
|
52
52
|
# Internal: Returns a digest of all the watched files, allowing to detect
|
53
53
|
# changes, and skip Vite builds if no files have changed.
|
54
54
|
def watched_files_digest
|
55
|
-
|
55
|
+
config.within_root do
|
56
56
|
files = Dir[*config.watched_paths].reject { |f| File.directory?(f) }
|
57
57
|
file_ids = files.sort.map { |f| "#{ File.basename(f) }/#{ Digest::SHA1.file(f).hexdigest }" }
|
58
58
|
Digest::SHA1.hexdigest(file_ids.join('/'))
|
@@ -70,11 +70,12 @@ private
|
|
70
70
|
#
|
71
71
|
# NOTE: By default it also outputs the manifest entries.
|
72
72
|
def log_build_result(_stdout, stderr, status)
|
73
|
-
if status
|
73
|
+
if status.success?
|
74
74
|
logger.info "Build with Vite complete: #{ config.build_output_dir }"
|
75
75
|
logger.error stderr unless stderr.empty?
|
76
76
|
else
|
77
77
|
logger.error stderr
|
78
|
+
logger.error status
|
78
79
|
logger.error 'Build with Vite failed! ❌'
|
79
80
|
logger.error '❌ Check that vite and vite-plugin-ruby are in devDependencies and have been installed. ' if stderr.include?('ERR! canceled')
|
80
81
|
end
|
@@ -111,7 +111,7 @@ private
|
|
111
111
|
def run_with_capture(*args, **options)
|
112
112
|
Dir.chdir(root) do
|
113
113
|
_, stderr, status = ViteRuby::IO.capture(*args, **options)
|
114
|
-
say(stderr) unless status || stderr.empty?
|
114
|
+
say(stderr) unless status.success? || stderr.empty?
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
data/lib/vite_ruby/commands.rb
CHANGED
@@ -100,7 +100,7 @@ class ViteRuby::Commands
|
|
100
100
|
|
101
101
|
# Internal: Prints information about ViteRuby's environment.
|
102
102
|
def print_info
|
103
|
-
|
103
|
+
config.within_root do
|
104
104
|
$stdout.puts "bin/vite present?: #{ File.exist? 'bin/vite' }"
|
105
105
|
|
106
106
|
$stdout.puts "vite_ruby: #{ ViteRuby::VERSION }"
|
data/lib/vite_ruby/config.rb
CHANGED
@@ -55,12 +55,12 @@ class ViteRuby::Config
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Public: Sets additional environment variables for vite-plugin-ruby.
|
58
|
-
def to_env
|
58
|
+
def to_env(env_vars = ViteRuby.env)
|
59
59
|
CONFIGURABLE_WITH_ENV.each_with_object({}) do |option, env|
|
60
60
|
unless (value = @config[option]).nil?
|
61
61
|
env["#{ ViteRuby::ENV_PREFIX }_#{ option.upcase }"] = value.to_s
|
62
62
|
end
|
63
|
-
end.merge(
|
63
|
+
end.merge(env_vars)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Internal: Files and directories that should be watched for changes.
|
@@ -75,6 +75,11 @@ class ViteRuby::Config
|
|
75
75
|
].freeze
|
76
76
|
end
|
77
77
|
|
78
|
+
# Internal: Changes the current directory to the root dir.
|
79
|
+
def within_root(&block)
|
80
|
+
Dir.chdir(File.expand_path(root), &block)
|
81
|
+
end
|
82
|
+
|
78
83
|
private
|
79
84
|
|
80
85
|
# Internal: Coerces all the configuration values, in case they were passed
|
data/lib/vite_ruby/io.rb
CHANGED
data/lib/vite_ruby/runner.rb
CHANGED
@@ -8,7 +8,7 @@ class ViteRuby::Runner
|
|
8
8
|
|
9
9
|
# Public: Executes Vite with the specified arguments.
|
10
10
|
def run(argv, exec: false)
|
11
|
-
|
11
|
+
config.within_root {
|
12
12
|
cmd = command_for(argv)
|
13
13
|
return Kernel.exec(*cmd) if exec
|
14
14
|
|
@@ -23,11 +23,11 @@ private
|
|
23
23
|
|
24
24
|
extend Forwardable
|
25
25
|
|
26
|
-
def_delegators :@vite_ruby, :config, :logger
|
26
|
+
def_delegators :@vite_ruby, :config, :logger, :env
|
27
27
|
|
28
28
|
# Internal: Returns an Array with the command to run.
|
29
29
|
def command_for(args)
|
30
|
-
[config.to_env].tap do |cmd|
|
30
|
+
[config.to_env(env)].tap do |cmd|
|
31
31
|
args = args.clone
|
32
32
|
cmd.push('node', '--inspect-brk') if args.delete('--inspect')
|
33
33
|
cmd.push('node', '--trace-deprecation') if args.delete('--trace_deprecation')
|
data/lib/vite_ruby/version.rb
CHANGED
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.2.
|
4
|
+
version: 3.2.10
|
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: 2022-
|
11
|
+
date: 2022-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -202,8 +202,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
202
202
|
licenses:
|
203
203
|
- MIT
|
204
204
|
metadata:
|
205
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.2.
|
206
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.2.
|
205
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.2.10/vite_ruby
|
206
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.2.10/vite_ruby/CHANGELOG.md
|
207
207
|
post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
|
208
208
|
manually, please run:\n\tbundle exec vite upgrade"
|
209
209
|
rdoc_options: []
|