Class: Hauler::Generators::InstallNpmGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/hauler/install_npm_generator.rb

Overview

:nodoc:

Constant Summary collapse

NPM_DEV_DEPENDENCIES =
<<-TXT.freeze
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  babel-preset-react-hmre
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
TXT
NPM_DEPENDENCIES =
<<-TXT.freeze
  [email protected]
  [email protected]
TXT
REACT_NPM_DEPENDENCIES =
<<-TXT.freeze
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
TXT
SASS_NPM_DEV_DEPENDENCIES =
<<-TXT.freeze
  [email protected]
  [email protected]
TXT
LINTER_DEV_DEPENDENCES =
<<-TXT.freeze
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
TXT
REACT_NPM_DEV_DEPENDENCIES =
<<-TXT.freeze
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
TXT

Instance Method Summary collapse

Instance Method Details

#add_scripts_to_packageObject



99
100
101
# File 'lib/generators/hauler/install_npm_generator.rb', line 99

def add_scripts_to_package
  run('hauler-update-scripts')
end

#install_dependenciesObject



76
77
78
79
# File 'lib/generators/hauler/install_npm_generator.rb', line 76

def install_dependencies
  puts 'Installing NPM dependencies...'
  install_deps(NPM_DEPENDENCIES, dev: false)
end

#install_dev_dependenciesObject



71
72
73
74
# File 'lib/generators/hauler/install_npm_generator.rb', line 71

def install_dev_dependencies
  puts 'Installing NPM dev dependencies...'
  install_deps(NPM_DEV_DEPENDENCIES)
end

#install_linter_dev_dependenciesObject



94
95
96
97
# File 'lib/generators/hauler/install_npm_generator.rb', line 94

def install_linter_dev_dependencies
  puts 'Installing Linter NPM dev dependencies...'
  install_deps(LINTER_DEV_DEPENDENCES)
end

#install_react_dependenciesObject



81
82
83
84
85
86
87
# File 'lib/generators/hauler/install_npm_generator.rb', line 81

def install_react_dependencies
  puts 'Installing React NPM dev dependencies...'
  install_deps(REACT_NPM_DEV_DEPENDENCIES)

  puts 'Installing React NPM dependencies...'
  install_deps(REACT_NPM_DEPENDENCIES, dev: false)
end

#install_sass_dependenciesObject



89
90
91
92
# File 'lib/generators/hauler/install_npm_generator.rb', line 89

def install_sass_dependencies
  puts 'Installing Sass NPM dependencies...'
  install_deps(SASS_NPM_DEV_DEPENDENCIES)
end