vite_ruby 2.0.0.beta.4 → 2.0.0.beta.5

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: 4958a06ce37c85ac97dda22ba69f7e65b4c75e0398bd65c3889821b766d9bf76
4
- data.tar.gz: 3bd1b130ff9ddb0ae9a2e8108b2263922b9eba12493acaa7a40d87335ceddeaf
3
+ metadata.gz: b84f0e81ff003b7c0dc9495f7b35384d34c74a84e9cfea55a8ff1fa3da40e64a
4
+ data.tar.gz: ad86dd77dd25f5efae581d29e08895dc9ddb98f7d64d3bfeee97c98765312746
5
5
  SHA512:
6
- metadata.gz: db3357ac2c2290bc2002434b4391bff4cc0690b84ce151aa70c48f7e3b10ab7cdc46f6b90b485685fbc47e9208a243dfa896b9679301f18c9bd75589d21425b5
7
- data.tar.gz: 4097a262af50ccec4e3b802d0e77e387eb22ca065036dc207583b2e4ea423902447ad056ba0d06081c85a71022922f240d03c76d11a912e5bd2b21f055d03d62
6
+ metadata.gz: be0de852e41af8fa13fb732cbb3e8bf4f867190a55db754f83426b5198768e5de266b64e525df3bbc94dffcfd92826ce5f7413473c232a7456196735cef6da8e
7
+ data.tar.gz: 625ca754ef6027b7cb61120b33985365dc994384f62b46b96eafecc043fc888c4851c685f2c65f67cf7ba318cdbe5e4abe2af3cf8daab35f0541fa733871f2cf
@@ -113,6 +113,11 @@ private
113
113
  $stdout.puts(*args)
114
114
  end
115
115
 
116
+ def run_with_capture(*args, **options)
117
+ _, stderr, status = ViteRuby::IO.capture(*args, **options)
118
+ say(err) unless status.success? || stderr.to_s.empty?
119
+ end
120
+
116
121
  # Internal: Avoid printing warning about missing vite.json, we will create one.
117
122
  def silent_warnings
118
123
  old_stderr = $stderr
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ViteRuby::CLI::Upgrade < ViteRuby::CLI::Install
4
+ desc 'Updates Vite Ruby related gems and npm packages.'
5
+
6
+ def call(**)
7
+ upgrade_ruby_gems
8
+ upgrade_npm_packages
9
+ end
10
+
11
+ protected
12
+
13
+ def upgrade_ruby_gems
14
+ say 'Updating gems'
15
+
16
+ libraries = ViteRuby.framework_libraries.map { |_f, library| library.name }
17
+
18
+ run_with_capture("bundle update #{ libraries.join(' ') }")
19
+ end
20
+
21
+ # NOTE: Spawn a new process so that it uses the updated vite_ruby.
22
+ def upgrade_npm_packages
23
+ Kernel.exec('bundle exec vite upgrade_packages')
24
+ end
25
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ViteRuby::CLI::UpgradePackages < ViteRuby::CLI::Install
4
+ desc 'Upgrades the npm packages to the recommended versions.'
5
+
6
+ def call(**)
7
+ say 'Upgrading npm packages'
8
+
9
+ Dir.chdir(root) do
10
+ deps = js_dependencies.join(' ')
11
+ run_with_capture("npx --package @antfu/ni -- ni -D #{ deps }")
12
+ end
13
+ end
14
+ end
data/lib/vite_ruby/cli.rb CHANGED
@@ -10,6 +10,8 @@ class ViteRuby::CLI
10
10
  register 'build', Build, aliases: ['b']
11
11
  register 'clobber', Clobber, aliases: %w[clean clear]
12
12
  register 'dev', Dev, aliases: %w[d serve]
13
- register 'install', Install, aliases: %w[setup init]
13
+ register 'install', Install
14
14
  register 'version', Version, aliases: ['v', '-v', '--version', 'info']
15
+ register 'upgrade', Upgrade, aliases: ['update']
16
+ register 'upgrade_packages', UpgradePackages, aliases: ['update_packages']
15
17
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '2.0.0.beta.4'
4
+ VERSION = '2.0.0.beta.5'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
7
  DEFAULT_VITE_VERSION = '^2.5.0-beta.2'
8
- DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.3'
8
+ DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.2'
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: 2.0.0.beta.4
4
+ version: 2.0.0.beta.5
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: 2021-08-12 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -179,6 +179,8 @@ files:
179
179
  - lib/vite_ruby/cli/dev.rb
180
180
  - lib/vite_ruby/cli/file_utils.rb
181
181
  - lib/vite_ruby/cli/install.rb
182
+ - lib/vite_ruby/cli/upgrade.rb
183
+ - lib/vite_ruby/cli/upgrade_packages.rb
182
184
  - lib/vite_ruby/cli/version.rb
183
185
  - lib/vite_ruby/cli/vite.rb
184
186
  - lib/vite_ruby/commands.rb
@@ -198,12 +200,10 @@ homepage: https://github.com/ElMassimo/vite_ruby
198
200
  licenses:
199
201
  - MIT
200
202
  metadata:
201
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@2.0.0.beta.4/vite_ruby
202
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@2.0.0.beta.4/vite_ruby/CHANGELOG.md
203
- post_install_message: |-
204
- Thanks for installing Vite Ruby!
205
-
206
- When upgrading, please verify package.json to ensure you have installed the recommended versions of vite (^2.5.0-beta.2) and vite-plugin-ruby (^3.0.0-beta.3).
203
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@2.0.0.beta.5/vite_ruby
204
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@2.0.0.beta.5/vite_ruby/CHANGELOG.md
205
+ post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
206
+ manually, please run:\n\tbundle exec vite upgrade"
207
207
  rdoc_options: []
208
208
  require_paths:
209
209
  - lib