class ViteRuby::CLI::Upgrade

def call(**)

def call(**)
  upgrade_ruby_gems
  upgrade_npm_packages
end

def upgrade_npm_packages

NOTE: Spawn a new process so that it uses the updated vite_ruby.
def upgrade_npm_packages
  Kernel.exec('bundle exec vite upgrade_packages')
end

def upgrade_ruby_gems

def upgrade_ruby_gems
  say 'Updating gems'
  libraries = ViteRuby.framework_libraries.map { |_f, library| library.name }
  run_with_capture("bundle update #{ libraries.join(' ') }")
end