vite_ruby 3.4.0 → 3.6.0

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: 91b619b1d7813eea11ef1f6a9a0c7950801e194d82daab5688e63b837f76ff46
4
- data.tar.gz: ea993f8bdc8264307970584257a20a6a05fbc2a9492c4174e261ce9b23cca440
3
+ metadata.gz: 184968fc31cdfdcafe5fea4b2ba393155ae968df6a7ffb11fd9ff7c6b30da671
4
+ data.tar.gz: 1cdbbef05db2234af7496421fad1569d3c3a81d86dd5b88ca8fa27fe19159aaa
5
5
  SHA512:
6
- metadata.gz: 8054ec74fe9106dce8c808262953830c3f59afd9c71db9cc22c1f078d5b6cf8e1780627c1e696edd21a2d4efbd7d852f250ad47f91f505e15012aef867775022
7
- data.tar.gz: 835a6e695afc3f6c2df427e216267a080ccfc2abb3a6577f1717bbbefbd5ec930ba5f9bab13a85e4d278a209b09d96a1c48ca732f8bc5069ff4b5ac3695b66e7
6
+ metadata.gz: 54c6f374fb5254bad6eccadfc21928f7bceb7871fdc9077261f52837203d1c85855519c824f24d9bbbff243bd2f02bd8ec300fd3323451ea09902b7cd12bf63a
7
+ data.tar.gz: 31c1ab4e450b3ce0619ebffeda6565868fea3f2b197ffec35a5abddc3101940d6fc856967f568fd2196628a3e2171cfd21313ee4ecbe23ca732f79696da055bc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ # [3.6.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.5.0...vite_ruby@3.6.0) (2024-06-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * allow skipping dependency install in assets:precompile ([#451](https://github.com/ElMassimo/vite_ruby/issues/451)) ([5a922b2](https://github.com/ElMassimo/vite_ruby/commit/5a922b2071446e3880b17503474a0c7806eab6a7))
7
+
8
+
9
+
10
+ # [3.5.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.4.0...vite_ruby@3.5.0) (2023-11-16)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * prevent clean from deleting assets referenced in the manifests ([8a581c1](https://github.com/ElMassimo/vite_ruby/commit/8a581c15ff480049bbb14dab1b5a3497308521b5))
16
+
17
+
18
+ ### Features
19
+
20
+ * use vite 5 in new installations ([f063f28](https://github.com/ElMassimo/vite_ruby/commit/f063f283f939d15b3c48c1a9b6efcd589fafbaf1))
21
+
22
+
23
+
1
24
  # [3.4.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.4...vite_ruby@3.4.0) (2023-11-16)
2
25
 
3
26
 
data/lib/tasks/vite.rake CHANGED
@@ -59,12 +59,18 @@ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
59
59
  if Rake::Task.task_defined?('assets:precompile')
60
60
  Rake::Task['assets:precompile'].enhance do |task|
61
61
  prefix = task.name.split(/#|assets:precompile/).first
62
- Rake::Task["#{ prefix }vite:install_dependencies"].invoke
62
+ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_INSTALL'] == 'true'
63
+ Rake::Task["#{ prefix }vite:install_dependencies"].invoke
64
+ end
63
65
  Rake::Task["#{ prefix }vite:build_all"].invoke
64
66
  end
65
67
  else
66
68
  desc 'Bundle Vite assets'
67
- Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build_all'])
69
+ if ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_INSTALL'] == 'true'
70
+ Rake::Task.define_task('assets:precompile' => 'vite:build_all')
71
+ else
72
+ Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build_all'])
73
+ end
68
74
  end
69
75
 
70
76
  unless Rake::Task.task_defined?('assets:clean')
@@ -50,7 +50,7 @@ class ViteRuby::Commands
50
50
 
51
51
  versions
52
52
  .each_with_index
53
- .drop_while { |(mtime, _), index|
53
+ .drop_while { |(mtime, _files), index|
54
54
  max_age = [0, Time.now - Time.at(mtime)].max
55
55
  max_age < age_in_seconds || index < keep_up_to
56
56
  }
@@ -143,14 +143,16 @@ private
143
143
 
144
144
  def versions
145
145
  all_files = Dir.glob("#{ config.build_output_dir }/**/*")
146
- entries = all_files - config.manifest_paths - current_version_files
146
+ entries = all_files - config.manifest_paths - files_referenced_in_manifests
147
147
  entries.reject { |file| File.directory?(file) }
148
148
  .group_by { |file| File.mtime(file).utc.to_i }
149
149
  .sort.reverse
150
150
  end
151
151
 
152
- def current_version_files
153
- Dir.glob(manifest.refresh.values.map { |value| config.build_output_dir.join("#{ value['file'] }*") })
152
+ def files_referenced_in_manifests
153
+ config.manifest_paths.flat_map { |path|
154
+ JSON.parse(path.read).map { |_, entry| entry['file'] }
155
+ }.compact.uniq.map { |path| config.build_output_dir.join(path).to_s }
154
156
  end
155
157
 
156
158
  def with_node_env(env)
@@ -195,6 +195,7 @@ private
195
195
  postcss.config.js
196
196
  tailwind.config.js
197
197
  vite.config.js
198
+ vite.config.mjs
198
199
  vite.config.ts
199
200
  windi.config.ts
200
201
  yarn.lock
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ostruct'
4
+
3
5
  # Public: Registry for accessing resources managed by Vite, using a generated
4
6
  # manifest file which maps entrypoint names to file paths.
5
7
  #
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.4.0'
4
+ VERSION = '3.6.0'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
- DEFAULT_VITE_VERSION = '^4.3.0'
8
- DEFAULT_PLUGIN_VERSION = '^3.2.0'
7
+ DEFAULT_VITE_VERSION = '^5.0.0'
8
+ DEFAULT_PLUGIN_VERSION = '^5.0.0'
9
9
  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: 3.4.0
4
+ version: 3.6.0
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-16 00:00:00.000000000 Z
11
+ date: 2024-06-07 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.4.0/vite_ruby
212
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.4.0/vite_ruby/CHANGELOG.md
211
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.6.0/vite_ruby
212
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.6.0/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: []