Sha256: e9c6f264cde57e821bd88345b6c2b2e37afe006b95ce2c5016f1b6bbb07361fd

Contents?: true

Size: 1.05 KB

Versions: 30

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'dry/cli'

# Public: Command line interface that allows to install the library, and run
# simple commands.
class ViteRuby::CLI
  extend Dry::CLI::Registry

  register 'build', Build, aliases: ['b']
  register 'clobber', Clobber, aliases: %w[clean clear]
  register 'dev', Dev, aliases: %w[d serve]
  register 'install', Install
  register 'ssr', SSR
  register 'version', Version, aliases: ['v', '-v', '--version', 'info']
  register 'upgrade', Upgrade, aliases: ['update']
  register 'upgrade_packages', UpgradePackages, aliases: ['update_packages']

  # Internal: Allows framework-specific variants to extend the CLI.
  def self.require_framework_libraries(path = 'cli')
    ViteRuby.framework_libraries.each do |_framework, library|
      require [library.name.tr('-', '/').to_s, path].compact.join('/')
    end
  rescue LoadError
    require_framework_libraries 'installation' unless path == 'installation'
  end
end

# NOTE: This allows framework-specific variants to extend the CLI.
ViteRuby::CLI.require_framework_libraries('cli')

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
vite_ruby-3.9.0 lib/vite_ruby/cli.rb
vite_ruby-3.8.3 lib/vite_ruby/cli.rb
vite_ruby-3.8.2 lib/vite_ruby/cli.rb
vite_ruby-3.8.1 lib/vite_ruby/cli.rb
vite_ruby-3.8.0 lib/vite_ruby/cli.rb
vite_ruby-3.7.0 lib/vite_ruby/cli.rb
vite_ruby-3.6.2 lib/vite_ruby/cli.rb
vite_ruby-3.6.1 lib/vite_ruby/cli.rb
vite_ruby-3.6.0 lib/vite_ruby/cli.rb
vite_ruby-3.5.0 lib/vite_ruby/cli.rb
vite_ruby-3.4.0 lib/vite_ruby/cli.rb
vite_ruby-3.3.4 lib/vite_ruby/cli.rb
vite_ruby-3.3.3 lib/vite_ruby/cli.rb
vite_ruby-3.3.2 lib/vite_ruby/cli.rb
vite_ruby-3.3.1 lib/vite_ruby/cli.rb
vite_ruby-3.3.0 lib/vite_ruby/cli.rb
vite_ruby-3.2.15 lib/vite_ruby/cli.rb
vite_ruby-3.2.14 lib/vite_ruby/cli.rb
vite_ruby-3.2.13 lib/vite_ruby/cli.rb
vite_ruby-3.2.12 lib/vite_ruby/cli.rb