const blueprintHelper = require('ember-frost-core/blueprint-helper')

const addonsToAdd = [
  {name: 'ember-frost-date-picker', target: '^8.0.0'},
  {name: 'ember-frost-fields', target: '^6.0.0'},
  {name: 'ember-frost-table', target: '^1.0.0'}
]

const packagesToRemove = [
  'ember-bunsen-core',
  'ember-redux-thunk'
]
  .map((packageName) => {
    return {name: packageName}
  })

module.exports = {
  afterInstall: function (options) {
    return this.removePackagesFromProject(packagesToRemove)
      .then(() => {
        // Get the packages installed in the consumer app/addon. Packages that are already installed in the consumer within
        // the required semver range will not be re-installed or have blueprints re-run.
        const consumerPackages = blueprintHelper.consumer.getPackages(options)

        // Get the packages to install (not already installed) from a list of potential packages
        return blueprintHelper.packageHandler.getPkgsToInstall(addonsToAdd, consumerPackages).then((pkgsToInstall) => {
          if (pkgsToInstall.length !== 0) {
            // Call the blueprint hook
            return this.addAddonsToProject({
              packages: pkgsToInstall
            })
          }
        })
      })
      .then(() => {
        const isAddon = this.project.isEmberCLIAddon()
        const pathPrefix = isAddon ? 'tests/dummy/' : ''

        return this.insertIntoFile(
          `${pathPrefix}app/styles/app.scss`,
          "@import 'ember-frost-bunsen';"
        )
      })
  },

  normalizeEntityName: function () {
    // this prevents an error when the entityName is
    // not specified (since that doesn't actually matter
    // to us
  }
}

@@ -1,252 +1,4 @@
-const blueprintHelper = require('ember-frost-core/blueprint-helper')%0A%0Aconst addonsToAdd = %5B%0A  %7Bname: 'ember-frost-date-picker', target: '%5E8.0.0'%7D,%0A  %7Bname: 'ember-frost-fields', target: '%5E6.0.0'%7D,%0A  %7Bname: 'ember-frost-table', target: '%5E1.0.0'%7D%0A%5D%0A%0A
 cons
@@ -270,751 +270,8 @@
 %3E %7B%0A
-        // Get the packages installed in the consumer app/addon. Packages that are already installed in the consumer within%0A        // the required semver range will not be re-installed or have blueprints re-run.%0A        const consumerPackages = blueprintHelper.consumer.getPackages(options)%0A%0A        // Get the packages to install (not already installed) from a list of potential packages%0A        return blueprintHelper.packageHandler.getPkgsToInstall(addonsToAdd, consumerPackages).then((pkgsToInstall) =%3E %7B%0A          if (pkgsToInstall.length !== 0) %7B%0A            // Call the blueprint hook%0A            return this.addAddonsToProject(%7B%0A              packages: pkgsToInstall%0A            %7D)%0A          %7D%0A        %7D)%0A      %7D)%0A      .then(() =%3E %7B%0A
     

remove adding of packages via blueprints since they are now dependencies