<commit_before>module Hauler
  module Generators
    #:nodoc:
    class InstallNpmGenerator < ::Rails::Generators::Base
      desc 'Setup hauler project'
      source_root File.expand_path('../templates', __FILE__)

      NPM_DEV_DEPENDENCIES = <<-TXT.freeze
        babel-core@6.11.4
        babel-loader@6.2.4
        babel-plugin-transform-class-properties@6.11.5
        babel-preset-es2015@6.9.0
        babel-preset-stage-2@6.11.0
        css-loader@0.23.1
        extract-text-webpack-plugin@1.0.1
        file-loader@0.9.0
        hauler@0.1.1
        image-webpack-loader@2.0.0
        immutable-devtools@0.0.7
        style-loader@0.13.1
        url-loader@0.5.7
        webpack@1.13.1
        webpack-dev-server@1.14.1
      TXT

      LINTER_DEV_DEPENDENCES = <<-TXT.freeze
        babel-eslint@6.1.2
        eslint@2.13.1
        eslint-config-airbnb@9.0.1
        eslint-import-resolver-webpack@0.4.0
        eslint-plugin-flowtype@2.4.0
        eslint-plugin-import@1.12.0
        eslint-plugin-jsx-a11y@1.5.5
        eslint-plugin-react@5.2.2
        sass-lint@1.8.2
      TXT

      REACT_NPM_DEV_DEPENDENCIES = <<-TXT.freeze
        babel-plugin-transform-react-constant-elements@6.9.1
        babel-plugin-transform-react-inline-elements@6.8.0
        babel-plugin-transform-react-remove-prop-types@0.2.8
        babel-preset-react@6.11.1
        react-hot-loader@2.0.0-alpha-4
        redux-logger@2.6.1
      TXT

      REACT_NPM_DEPENDENCIES = <<-TXT.freeze
        immutable@3.8.1
        react@15.2.1
        react-dom@15.2.1
        react-redux@4.4.5
        react-router@2.6.1
        react-router-redux@4.0.5
        react-router-scroll@0.2.1
        redux@3.5.2
        redux-immutable@3.0.6
        redux-saga@0.11.0
        reselect@2.5.3
      TXT

      SASS_NPM_DEV_DEPENDENCIES = <<-TXT.freeze
        node-sass@3.8.0
        sass-loader@4.0.0
      TXT

      NPM_DEPENDENCIES = <<-TXT.freeze
        babel-polyfill@6.9.1
        whatwg-fetch@1.0.0
      TXT

      def add_scripts_to_package
        `./node_modules/hauler/bin/update-scripts.js`
      end

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

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

      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

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

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

      private

      def install_deps(list, dev: true)
        flag = dev ? '--save-dev' : '--save'
        `npm install #{flag} #{list.gsub(/\s+/m, ' ')}`
      end
    end
  end<commit_msg>fix(npm): update scripts section after installing hauler package<commit_after>module Hauler
  module Generators
    #:nodoc:
    class InstallNpmGenerator < ::Rails::Generators::Base
      desc 'Setup hauler project'
      source_root File.expand_path('../templates', __FILE__)

      NPM_DEV_DEPENDENCIES = <<-TXT.freeze
        babel-core@6.11.4
        babel-loader@6.2.4
        babel-plugin-transform-class-properties@6.11.5
        babel-preset-es2015@6.9.0
        babel-preset-stage-2@6.11.0
        css-loader@0.23.1
        extract-text-webpack-plugin@1.0.1
        file-loader@0.9.0
        hauler@0.1.1
        image-webpack-loader@2.0.0
        immutable-devtools@0.0.7
        style-loader@0.13.1
        url-loader@0.5.7
        webpack@1.13.1
        webpack-dev-server@1.14.1
      TXT

      LINTER_DEV_DEPENDENCES = <<-TXT.freeze
        babel-eslint@6.1.2
        eslint@2.13.1
        eslint-config-airbnb@9.0.1
        eslint-import-resolver-webpack@0.4.0
        eslint-plugin-flowtype@2.4.0
        eslint-plugin-import@1.12.0
        eslint-plugin-jsx-a11y@1.5.5
        eslint-plugin-react@5.2.2
        sass-lint@1.8.2
      TXT

      REACT_NPM_DEV_DEPENDENCIES = <<-TXT.freeze
        babel-plugin-transform-react-constant-elements@6.9.1
        babel-plugin-transform-react-inline-elements@6.8.0
        babel-plugin-transform-react-remove-prop-types@0.2.8
        babel-preset-react@6.11.1
        react-hot-loader@2.0.0-alpha-4
        redux-logger@2.6.1
      TXT

      REACT_NPM_DEPENDENCIES = <<-TXT.freeze
        immutable@3.8.1
        react@15.2.1
        react-dom@15.2.1
        react-redux@4.4.5
        react-router@2.6.1
        react-router-redux@4.0.5
        react-router-scroll@0.2.1
        redux@3.5.2
        redux-immutable@3.0.6
        redux-saga@0.11.0
        reselect@2.5.3
      TXT

      SASS_NPM_DEV_DEPENDENCIES = <<-TXT.freeze
        node-sass@3.8.0
        sass-loader@4.0.0
      TXT

      NPM_DEPENDENCIES = <<-TXT.freeze
        babel-polyfill@6.9.1
        whatwg-fetch@1.0.0
      TXT

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

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

      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

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

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

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

      private

      def install_deps(list, dev: true)
        flag = dev ? '--save-dev' : '--save'
        run("npm install #{flag} #{list.gsub(/\s+/m, ' ')}")
      end
    end
  end
{'fraction_non_alphanumeric': 0.11254172627563186, 'fraction_numerical': 0.04959465903671912, 'mean_word_length': 1.9498359118612283, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1781127', 'n_tokens_mistral': 2413, 'n_tokens_neox': 2318, 'n_words': 314}