vite_ruby 3.0.9 → 3.1.1

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: 359e71c1ab4e22eb0b106b478e85687cc5ec5bdac963dcf070a54722957772bc
4
- data.tar.gz: 0b636225fb843443d2007cd9616aa937952d79f6764c1bd5576908e959bcfae6
3
+ metadata.gz: 272fe6da1fb380725808470d8a54d547343027d8f81df36f0535bda3a6a0f0db
4
+ data.tar.gz: 0d906d89d6f6d5ce8502555117013fc0a1f325e26533419972f089913ea8da69
5
5
  SHA512:
6
- metadata.gz: ed0d0628132fb27494d33e5fe6c6fcd472105c465b28b93cb356196e3d04440107a687663d432777c37ac930bace38afa3a9d2ff74495ab0342d39a7c4b33d33
7
- data.tar.gz: 51d0256a85c7865249de78f71544564b96f17eff871819e37efde21fff136eb95e90bf66c1fcae7a0c96a6fbc74e7e6b238d30fe9a6b33a0373dbcf77eab8844
6
+ metadata.gz: a094dd8a9123615b06e1266515015d5c2ef8a82842b006a6262f552e0412e68465b8c7a45c2a16749d23abba5577d9a4c89ec125b59b68bad5767db9f800750a
7
+ data.tar.gz: 765d8ddd8023f28029eeff363815257b3b1b1601c652f6df213a53c9a39a1f9bd47ee63af11b8c9dc6ab2c845843988aebec4195c3cb885c131c56e40c488615
data/CHANGELOG.md CHANGED
@@ -1,3 +1,45 @@
1
+ ## [3.1.1](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.1.0...vite_ruby@3.1.1) (2022-04-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * prevent error when using a proc in asset_host (close [#202](https://github.com/ElMassimo/vite_ruby/issues/202)) ([#203](https://github.com/ElMassimo/vite_ruby/issues/203)) ([cb23a81](https://github.com/ElMassimo/vite_ruby/commit/cb23a81037651ac01d993935f68cc526ec2c844d))
7
+
8
+
9
+
10
+ # [3.1.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.11...vite_ruby@3.1.0) (2022-04-01)
11
+
12
+
13
+ ### Features
14
+
15
+ * improve capistrano-rails integration by extending asset tasks ([#200](https://github.com/ElMassimo/vite_ruby/issues/200)) ([d5704ab](https://github.com/ElMassimo/vite_ruby/commit/d5704ab55abf27cbdb5b00841bce3136147a0200))
16
+
17
+
18
+
19
+ ## [3.0.11](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.10...vite_ruby@3.0.11) (2022-04-01)
20
+
21
+
22
+ ### Features
23
+
24
+ * bump the default vite version ([2cb8952](https://github.com/ElMassimo/vite_ruby/commit/2cb895246b3154322273989057bf9bdc67634bc6))
25
+
26
+
27
+
28
+ ## [3.0.10](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.9...vite_ruby@3.0.10) (2022-03-17)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * avoid proxying requests starting with @ ([93d071b](https://github.com/ElMassimo/vite_ruby/commit/93d071b2b807c2e09e24d5d7ea4228974b370960))
34
+ * MissingExecutableError when deploying with Capistrano (close [#192](https://github.com/ElMassimo/vite_ruby/issues/192)) ([22e1691](https://github.com/ElMassimo/vite_ruby/commit/22e1691a0685b1fdeec3904657be5e69a57e6456))
35
+
36
+
37
+ ### Features
38
+
39
+ * bump up default vite version to 2.8.6 ([fd53030](https://github.com/ElMassimo/vite_ruby/commit/fd5303017760dc176b3fb15908f08a16a175c22f))
40
+
41
+
42
+
1
43
  ## [3.0.9](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.8...vite_ruby@3.0.9) (2022-02-09)
2
44
 
3
45
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <h1 align="center">
2
2
  <a href="https://vite-ruby.netlify.app/">
3
- <img src="https://raw.githubusercontent.com/ElMassimo/vite_ruby/main/docs/public/logo.svg" width="120px"/>
3
+ <img src="https://raw.githubusercontent.com/ElMassimo/vite_ruby/main/logo.svg" width="120px"/>
4
4
  </a>
5
5
 
6
6
  <br>
data/lib/tasks/vite.rake CHANGED
@@ -44,11 +44,27 @@ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
44
44
  if Rake::Task.task_defined?('assets:precompile')
45
45
  Rake::Task['assets:precompile'].enhance do |task|
46
46
  prefix = task.name.split(/#|assets:precompile/).first
47
+ Rake::Task["#{ prefix }vite:install_dependencies"].invoke
47
48
  Rake::Task["#{ prefix }vite:build"].invoke
48
49
  end
49
50
  else
50
51
  Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build'])
51
52
  end
53
+
54
+ unless Rake::Task.task_defined?('assets:clean')
55
+ Rake::Task.define_task('assets:clean', [:keep, :age])
56
+ end
57
+ Rake::Task['assets:clean'].enhance do |_, args|
58
+ Rake::Task['vite:clean'].invoke(*args.to_h.values)
59
+ end
60
+
61
+ if Rake::Task.task_defined?('assets:clobber')
62
+ Rake::Task['assets:clobber'].enhance do
63
+ Rake::Task['vite:clobber'].invoke
64
+ end
65
+ else
66
+ Rake::Task.define_task('assets:clobber' => 'vite:clobber')
67
+ end
52
68
  end
53
69
 
54
70
  # Any prerequisite task that installs packages should also install build dependencies.
@@ -121,7 +121,7 @@ private
121
121
  'config_path' => option_from_env('config_path') || DEFAULT_CONFIG.fetch('config_path'),
122
122
  'mode' => option_from_env('mode') || mode,
123
123
  'root' => option_from_env('root') || root,
124
- }
124
+ }.select { |_, value| value }
125
125
  end
126
126
 
127
127
  # Internal: Used to load a JSON file from the specified path.
@@ -54,17 +54,22 @@ private
54
54
 
55
55
  def vite_should_handle?(env)
56
56
  path = normalize_uri(env['PATH_INFO'])
57
- return true if path.start_with?(vite_asset_url_prefix) # Vite asset
58
- return true if path.start_with?(VITE_DEPENDENCY_PREFIX) # Packages and imports
57
+ return true if path.start_with?(vite_url_prefix) # Vite asset
59
58
  return true if file_in_vite_root?(path) # Fallback if Vite can serve the file
60
59
  end
61
60
 
61
+ # NOTE: When using an empty 'public_output_dir', we need to rely on a
62
+ # filesystem check to check whether Vite should serve the request.
62
63
  def file_in_vite_root?(path)
63
64
  path.include?('.') && # Check for extension, avoid filesystem if possible.
64
65
  config.vite_root_dir.join(path.start_with?('/') ? path[1..-1] : path).file?
65
66
  end
66
67
 
67
- def vite_asset_url_prefix
68
- @vite_asset_url_prefix ||= config.public_output_dir.empty? ? "\0" : "/#{ config.public_output_dir }/"
68
+ # NOTE: Vite is configured to use 'public_output_dir' as the base, which can
69
+ # be customized by the user in development to not match any of the routes.
70
+ #
71
+ # If the path starts with that prefix, it will be redirected to Vite.
72
+ def vite_url_prefix
73
+ @vite_url_prefix ||= config.public_output_dir.empty? ? VITE_DEPENDENCY_PREFIX : "/#{ config.public_output_dir }/"
69
74
  end
70
75
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.0.9'
4
+ VERSION = '3.1.1'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
- DEFAULT_VITE_VERSION = '^2.7.7'
8
- DEFAULT_PLUGIN_VERSION = '^3.0.5'
7
+ DEFAULT_VITE_VERSION = '^2.9.1'
8
+ DEFAULT_PLUGIN_VERSION = '^3.0.9'
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.0.9
4
+ version: 3.1.1
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-02-09 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -201,8 +201,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
201
201
  licenses:
202
202
  - MIT
203
203
  metadata:
204
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.0.9/vite_ruby
205
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.9/vite_ruby/CHANGELOG.md
204
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.1.1/vite_ruby
205
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.1.1/vite_ruby/CHANGELOG.md
206
206
  post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
207
207
  manually, please run:\n\tbundle exec vite upgrade"
208
208
  rdoc_options: []
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  requirements: []
222
- rubygems_version: 3.3.3
222
+ rubygems_version: 3.3.7
223
223
  signing_key:
224
224
  specification_version: 4
225
225
  summary: Use Vite in Ruby and bring joy to your JavaScript experience