import Generator from 'yeoman-generator';
import _ from 'lodash/fp';
import {mergePackageJSON} from '../util';
import path from 'path';
import rootPkg from '../../package.json';

export default class BonestormBabel extends Generator {
  constructor (args, opts) {
    super(args, opts);

    this.sourceRoot(
      path.join(__dirname, '..', '..', 'templates', path.basename(__dirname)));

    this.props = opts;
  }

  writing () {
    mergePackageJSON(this, {
      devDependencies: _.pick([
        'babel-cli',
        'babel-plugin-add-module-exports',
        'babel-plugin-transform-runtime',
        'babel-preset-bluebird',
        'babel-preset-env',
        'babel-register'
      ], rootPkg.devDependencies),
      dependencies: _.pick([
        'babel-runtime',
        'source-map-support'
      ], rootPkg.dependencies),
      scripts: {
        build: 'babel --source-maps --out-dir dist src',
        'build:watch': 'babel --source-maps --watch --out-dir dist src'
      }
    });

    this.fs.copyTpl(this.templatePath('.babelrc'),
      this.destinationPath('.babelrc'), {
        engine: this.props.engine
      });
  }
}

@@ -571,256 +571,66 @@
 el-p
-lugin-transform-runtime',%0A        'babel-preset-bluebird',%0A        'babel-preset-env',%0A        'babel-register'%0A      %5D, rootPkg.devDependencies),%0A      dependencies: _.pick(%5B%0A        'babel-runtime',%0A        'source-map-support'%0A      %5D, rootPkg.d
+reset-env',%0A        'babel-register'%0A      %5D, rootPkg.devD
 epen

remove unused babel stuff