<commit_before>'use strict';

var generators = require('yeoman-generator');
var _ = require('lodash');
var extend = _.merge;

module.exports = generators.Base.extend({
  constructor: function() {
    generators.Base.apply(this, arguments);

    this.option('router', {
      type: Boolean,
      required: false,
      default: true,
      desc: 'Use React-router'
    });

    this.option('redux', {
      type: Boolean,
      required: false,
      default: true,
      desc: 'Use React-redux'
    });

    this.option('radium', {
      type: Boolean,
      required: false,
      default: true,
      desc: 'Use Radium'
    });

    this.option('type', {
      type: String,
      required: false,
      desc: 'Type'
    });
  },

  writing: function() {
    this.fs.copyTpl(
      this.templatePath('webpack.config.js'),
      this.destinationPath('webpack.config.js'), {
        router: this.options.router,
        redux: this.options.redux,
        radium: this.options.radium
      }
    );

    var currentPkg = this.fs.readJSON(this.destinationPath('package.json'), {});
    var pkg = extend({
      scripts: {
        'webpack-server': 'webpack-dev-server --content-base src --hot --progress --inline',
        webpack: 'NODE_ENV=1 webpack'
      },
      'pre-commit': []
    }, currentPkg);

    if(pkg['pre-commit'].indexOf('webpack') === -1 && this.options.type === 'static') {
      pkg['pre-commit'].push('webpack');
    }

    this.fs.writeJSON(this.destinationPath('package.json'), pkg);
  },

  install: function() {<commit_msg>fix webpack<commit_after>'use strict';

var generators = require('yeoman-generator');
var _ = require('lodash');
var extend = _.merge;

module.exports = generators.Base.extend({
  constructor: function() {
    generators.Base.apply(this, arguments);

    this.option('router', {
      type: Boolean,
      required: false,
      default: true,
      desc: 'Use React-router'
    });

    this.option('redux', {
      type: Boolean,
      required: false,
      default: true,
      desc: 'Use React-redux'
    });

    this.option('radium', {
      type: Boolean,
      required: false,
      default: true,
      desc: 'Use Radium'
    });

    this.option('type', {
      type: String,
      required: false,
      desc: 'Type'
    });
  },

  writing: function() {
    this.fs.copyTpl(
      this.templatePath('webpack.config.js'),
      this.destinationPath('webpack.config.js'), {
        router: this.options.router,
        redux: this.options.redux,
        radium: this.options.radium
      }
    );

    var currentPkg = this.fs.readJSON(this.destinationPath('package.json'), {});
    var pkg = extend({
      scripts: {
        'webpack-server': 'webpack-dev-server --content-base src --hot --progress --inline',
        webpack: 'NODE_ENV=1 webpack'
      },
      'pre-commit': []
    }, currentPkg);

    if(pkg['pre-commit'].indexOf('webpack') === -1 && this.options.type === 'Static pages') {
      pkg['pre-commit'].push('webpack');
    }

    this.fs.writeJSON(this.destinationPath('package.json'), pkg);
  },

  install: function() {
{'fraction_non_alphanumeric': 0.16774193548387098, 'fraction_numerical': 0.0012903225806451613, 'mean_word_length': 2.511891279728199, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4596655', 'n_tokens_mistral': 988, 'n_tokens_neox': 955, 'n_words': 186}