vite_ruby 3.0.8 → 3.1.0

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: 98e2415b05cc089e1237df13a3151a52a617eb49d0e7d9564694c51ac23682f0
4
- data.tar.gz: ad96aa6343295e1a5c35ea9b76bd2bd3dc0db2a77c39107a7a4ef921e69381cf
3
+ metadata.gz: 0a2d47c2302c5fe8c1953fe3aad857410c283c2180dd1968790d8acd96354373
4
+ data.tar.gz: d2d608831e89c9c1ce810a88c0bda65ec9b3058367a4c226c58c3945fcae6e51
5
5
  SHA512:
6
- metadata.gz: '069e27dad5668424f05677db87b052f55794b205e19fd8ea866e47d0c5f81ab971a532c28e16a5a1f2998338ca03c1c818ff691293a65d47efd5a45156e691cf'
7
- data.tar.gz: d386f154d68dfa18616965e6aad2451e7d7e54e50b1964e675c58975900ae703fb95a55057ee7d237506c3e35ea34c290a96f1ef298f528f8beb9d9abfb8ad72
6
+ metadata.gz: 50cebcc87261452bcd189c0351c5637bf8ffd03d0e30ac02c3c2c4088974af2037f824d540fb66bf59246e4a0dcb57aa31a4584ee1e8390003fa389d819f885a
7
+ data.tar.gz: c23a337e708ee47380e3323a0bc45f787d3f1346f5c53ec2d95a69fb5c40b63884c05074dbd117e07e755a143a323d4afd91e9ee0a1ee9d14a0316bdb92fe59d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,45 @@
1
+ # [3.1.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.11...vite_ruby@3.1.0) (2022-04-01)
2
+
3
+
4
+ ### Features
5
+
6
+ * 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))
7
+
8
+
9
+
10
+ ## [3.0.11](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.10...vite_ruby@3.0.11) (2022-04-01)
11
+
12
+
13
+ ### Features
14
+
15
+ * bump the default vite version ([2cb8952](https://github.com/ElMassimo/vite_ruby/commit/2cb895246b3154322273989057bf9bdc67634bc6))
16
+
17
+
18
+
19
+ ## [3.0.10](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.9...vite_ruby@3.0.10) (2022-03-17)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * avoid proxying requests starting with @ ([93d071b](https://github.com/ElMassimo/vite_ruby/commit/93d071b2b807c2e09e24d5d7ea4228974b370960))
25
+ * MissingExecutableError when deploying with Capistrano (close [#192](https://github.com/ElMassimo/vite_ruby/issues/192)) ([22e1691](https://github.com/ElMassimo/vite_ruby/commit/22e1691a0685b1fdeec3904657be5e69a57e6456))
26
+
27
+
28
+ ### Features
29
+
30
+ * bump up default vite version to 2.8.6 ([fd53030](https://github.com/ElMassimo/vite_ruby/commit/fd5303017760dc176b3fb15908f08a16a175c22f))
31
+
32
+
33
+
34
+ ## [3.0.9](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.8...vite_ruby@3.0.9) (2022-02-09)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * support older versions of npm (v6) that ship with node 12 and 14 ([0accc36](https://github.com/ElMassimo/vite_ruby/commit/0accc36e9ef82fa0923af4f94253433433c0b074))
40
+
41
+
42
+
1
43
  ## [3.0.8](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.7...vite_ruby@3.0.8) (2022-01-18)
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
@@ -31,7 +31,7 @@ namespace :vite do
31
31
 
32
32
  desc 'Ensures build dependencies like Vite are installed when compiling assets'
33
33
  task :install_dependencies do
34
- system({ 'NODE_ENV' => 'development' }, 'npx --yes ci')
34
+ system({ 'NODE_ENV' => 'development' }, 'npx ci --yes')
35
35
  end
36
36
 
37
37
  desc "Provide information on ViteRuby's environment"
@@ -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.
@@ -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.8'
4
+ VERSION = '3.1.0'
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.8
4
+ version: 3.1.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: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2022-04-01 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.8/vite_ruby
205
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.8/vite_ruby/CHANGELOG.md
204
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.1.0/vite_ruby
205
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.1.0/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: []