Sha256: b30005aee3a2e2ef5a2c6b4796e02c9753ee416ec2efac3e01c4cc2516a84d9a

Contents?: true

Size: 648 Bytes

Versions: 9

Compression:

Stored size: 648 Bytes

Contents

# frozen_string_literal: true

module Quilt
  class ReactSetupGenerator < Rails::Generators::Base
    source_root File.expand_path('templates', __dir__)
    class_option :skip_yarn, type: :boolean, default: false

    desc "This generator adds a React app."

    def install_js_dependencies
      return if options.skip_yarn?

      say("Installing react and types dependencies")
      system("yarn add "\
        "typescript@~3.8.0 "\
        "react@~16.11.0 "\
        "react-dom@~16.11.0 "\
        "@types/react@~16.9.0 "\
        "@types/react-dom@~16.9.0 ")
    end

    def create_tsconfig
      copy_file("tsconfig.json")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
quilt_rails-3.5.5 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.5.4 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.5.2 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.5.1 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.5.0 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.4.2 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.4.1 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.4.0 lib/generators/quilt/react_setup/react_setup_generator.rb
quilt_rails-3.3.1 lib/generators/quilt/react_setup/react_setup_generator.rb