vite_ruby 3.2.5 → 3.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 +4 -4
- data/CHANGELOG.md +23 -0
- data/lib/vite_ruby/builder.rb +1 -1
- data/lib/vite_ruby/commands.rb +1 -1
- data/lib/vite_ruby/config.rb +5 -0
- data/lib/vite_ruby/manifest.rb +1 -1
- data/lib/vite_ruby/runner.rb +8 -2
- 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: 504e30d024c6fe224de798f30f95894924af489116d3fbcd98cbd207e971a01d
|
4
|
+
data.tar.gz: 94d5c6d005c405799f1ab0dc9e8f31f52d29f16e9a30ed9c1b16fb2b25c50e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86e19071580f77b04c83c28f9d905051debff7170f2a81ce52d82c2d5a9028e198ba70c5a924abfcbc2f83d468b3d503fe2cfa0bd52f85628b2950fd244a35e3
|
7
|
+
data.tar.gz: d1e4d3e30f38a2b233c83edc27962ee9a6a61b4b73295a0fda900c9f906ab4759e357959cce7d326b267cab0f3aaffb3f2ae57f23307f5cc51660cb5d2634b4a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
## [3.2.7](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.6...vite_ruby@3.2.7) (2022-10-19)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* yarn berry pnp mode support ([#278](https://github.com/ElMassimo/vite_ruby/issues/278)) ([1890447](https://github.com/ElMassimo/vite_ruby/commit/189044746e536847cb33fb471cc7c42251a61072))
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* create vite-plugin-rails, an opinionated version of `vite-plugin-ruby` ([#282](https://github.com/ElMassimo/vite_ruby/issues/282)) ([16375fb](https://github.com/ElMassimo/vite_ruby/commit/16375fb1f6f2bf86dff935ca3aaf91c333a796ff))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
## [3.2.6](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.5...vite_ruby@3.2.6) (2022-10-07)
|
16
|
+
|
17
|
+
|
18
|
+
### Features
|
19
|
+
|
20
|
+
* always trigger a build if the manifest is missing ([#275](https://github.com/ElMassimo/vite_ruby/issues/275)) ([53ffdb9](https://github.com/ElMassimo/vite_ruby/commit/53ffdb9559409cb813198b4fd8a7a5ccb0c3cd21))
|
21
|
+
|
22
|
+
|
23
|
+
|
1
24
|
## [3.2.5](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.4...vite_ruby@3.2.5) (2022-10-07)
|
2
25
|
|
3
26
|
|
data/lib/vite_ruby/builder.rb
CHANGED
@@ -13,7 +13,7 @@ class ViteRuby::Builder
|
|
13
13
|
def build(*args)
|
14
14
|
last_build = last_build_metadata(ssr: args.include?('--ssr'))
|
15
15
|
|
16
|
-
if args.delete('--force') || last_build.stale?
|
16
|
+
if args.delete('--force') || last_build.stale? || config.manifest_paths.empty?
|
17
17
|
stdout, stderr, success = build_with_vite(*args)
|
18
18
|
log_build_result(stdout, stderr, success)
|
19
19
|
record_build_metadata(last_build, errors: stderr, success: success)
|
data/lib/vite_ruby/commands.rb
CHANGED
@@ -143,7 +143,7 @@ private
|
|
143
143
|
|
144
144
|
def versions
|
145
145
|
all_files = Dir.glob("#{ config.build_output_dir }/**/*")
|
146
|
-
entries = all_files -
|
146
|
+
entries = all_files - config.manifest_paths - current_version_files
|
147
147
|
entries.reject { |file| File.directory?(file) }
|
148
148
|
.group_by { |file| File.mtime(file).utc.to_i }
|
149
149
|
.sort.reverse
|
data/lib/vite_ruby/config.rb
CHANGED
@@ -23,6 +23,11 @@ class ViteRuby::Config
|
|
23
23
|
build_output_dir.join('manifest-assets.json')
|
24
24
|
end
|
25
25
|
|
26
|
+
# Internal: Path to the manifest files generated by Vite and vite-plugin-ruby.
|
27
|
+
def manifest_paths
|
28
|
+
[manifest_path, assets_manifest_path].select(&:exist?)
|
29
|
+
end
|
30
|
+
|
26
31
|
# Public: The directory where Vite will store the built assets.
|
27
32
|
def build_output_dir
|
28
33
|
root.join(public_dir, public_output_dir)
|
data/lib/vite_ruby/manifest.rb
CHANGED
@@ -119,7 +119,7 @@ private
|
|
119
119
|
|
120
120
|
# Internal: Loads and merges the manifest files, resolving the asset paths.
|
121
121
|
def load_manifest
|
122
|
-
files =
|
122
|
+
files = config.manifest_paths
|
123
123
|
files.map { |path| JSON.parse(path.read) }.inject({}, &:merge).tap(&method(:resolve_references))
|
124
124
|
end
|
125
125
|
|
data/lib/vite_ruby/runner.rb
CHANGED
@@ -31,7 +31,7 @@ private
|
|
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')
|
34
|
-
cmd.push(vite_executable)
|
34
|
+
cmd.push(*vite_executable)
|
35
35
|
cmd.push(*args)
|
36
36
|
cmd.push('--mode', config.mode) unless args.include?('--mode') || args.include?('-m')
|
37
37
|
end
|
@@ -40,6 +40,12 @@ private
|
|
40
40
|
# Internal: Resolves to an executable for Vite.
|
41
41
|
def vite_executable
|
42
42
|
bin_path = config.vite_bin_path
|
43
|
-
File.exist?(bin_path)
|
43
|
+
return [bin_path] if File.exist?(bin_path)
|
44
|
+
|
45
|
+
if config.root.join('yarn.lock').exist?
|
46
|
+
%w[yarn vite]
|
47
|
+
else
|
48
|
+
["#{ `npm bin`.chomp }/vite"]
|
49
|
+
end
|
44
50
|
end
|
45
51
|
end
|
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.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: 2022-10-
|
11
|
+
date: 2022-10-19 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.7/vite_ruby
|
206
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.2.7/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: []
|