Repository: ember-cli/ember-cli
Pull request #6479 (2016-11-28 21:50:50)

docs: Blueprint:renamedFiles
This PR contains two small documentation updates broken into 2 commits.

The first commit simply corrects a typo in the property name used for `ember-cli/Blueprint:renameFiles`.

The second commit (which can be removed if folks object) adds some documentation for that property. I would like to contribute more documentation of this kind if folks are interested. The doc comment I have included is:

    /**
      Files that are renamed when installed into the target directory.
      This allows including files in the blueprint that would have an effect
      on another process, such as a file named `.gitignore`.

      The keys are the filenames used in the files folder.
      The values are the filenames used in the target directory.

      @static
      @property renamedFiles
      ```
    */


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 537461e9f..6666dc5fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,42 +1,5 @@
 # ember-cli Changelog
 
-### 2.10.0
-
-The following changes are required if you are upgrading from the previous
-version:
-
-- Users
-  + [`ember new` diff](https://github.com/ember-cli/ember-new-output/compare/v2.9.1...v2.10.0)
-  + Upgrade your project's ember-cli version - [docs](http://ember-cli.com/user-guide/#upgrading)
-- Addon Developers
-  + [`ember addon` diff](https://github.com/ember-cli/ember-addon-output/compare/v2.9.1...v2.10.0)
-  + No changes required
-- Core Contributors
-  + No changes required
-
-#### Notes:
-- This version of Ember CLI _no longer supports Node.js v0.10_ per the [Ember Node.js LTS Support policy](http://emberjs.com/blog/2016/09/07/ember-node-lts-support.html).
-- As part of this release we have experimental support for including Ember from npm via the `ember-source` npm package. We hope to discover the gaps during this release cycle and make that the default in a future release.
-
-#### Community Contributions
-
-- [#5994](https://github.com/ember-cli/ember-cli/pull/5994) No 'diff' option when binaries are involved (confirm-dialog). [@fpauser](https://github.com/fpauser)
-- [#6241](https://github.com/ember-cli/ember-cli/pull/6241) destroy deletes empty folders [@kellyselden](https://github.com/kellyselden)
-- [#6096](https://github.com/ember-cli/ember-cli/pull/6096) Fix and improve Watcher.detectWatcher [@stefanpenner](https://github.com/stefanpenner)
-- [#6081](https://github.com/ember-cli/ember-cli/pull/6081) [BUGFIX] Header files import concat [@stefanpenner](https://github.com/stefanpenner)
-- [#6296](https://github.com/ember-cli/ember-cli/pull/6296) Include relative path on ember asset-sizes [@josemarluedke](https://github.com/josemarluedke)
-- [#6301](https://github.com/ember-cli/ember-cli/pull/6301) [Fixes #6300] consistent concat, regardless of system EOL [@stefanpenner](https://github.com/stefanpenner)
-- [#6305](https://github.com/ember-cli/ember-cli/pull/6305) Use Ember.assign for start-app test helper.
-- [#6307](https://github.com/ember-cli/ember-cli/pull/6307) Node.js LTS updates. [@nathanhammond](https://github.com/nathanhammond)
-- [#6306](https://github.com/ember-cli/ember-cli/pull/6306) [ENHANCEMENT] Use npm 3 [@dfreeman](https://github.com/dfreeman)
-- [#6337](https://github.com/ember-cli/ember-cli/pull/6337) DOC: #addBowerPackagesToProject `source` option [@olleolleolle](https://github.com/olleolleolle)
-- [#6358](https://github.com/ember-cli/ember-cli/pull/6358) Use secure URLs in docs where possible [@xtian](https://github.com/xtian)
-- [#6363](https://github.com/ember-cli/ember-cli/pull/6363) [ENHANCEMENT] Add 2.8-lts scenario to default ember-try config [@BrianSipple](https://github.com/BrianSipple)
-- [#6369](https://github.com/ember-cli/ember-cli/pull/6369) Enable ember-source. [@nathanhammond](https://github.com/nathanhammond)
-
-Thank you to all who took the time to contribute!
-
-
 ### 2.10.0-beta.2
 
 The following changes are required if you are upgrading from the previous
diff --git a/blueprints/addon/files/.travis.yml b/blueprints/addon/files/.travis.yml
index 2d03e5134..b3be07e6a 100644
--- a/blueprints/addon/files/.travis.yml
+++ b/blueprints/addon/files/.travis.yml
@@ -17,7 +17,6 @@ env:
   - EMBER_TRY_SCENARIO=ember-release
   - EMBER_TRY_SCENARIO=ember-beta
   - EMBER_TRY_SCENARIO=ember-canary
-  - EMBER_TRY_SCENARIO=ember-default
 
 matrix:
   fast_finish: true
diff --git a/blueprints/addon/files/addon-config/ember-try.js b/blueprints/addon/files/addon-config/ember-try.js
index b1813d0d7..c58516b6f 100644
--- a/blueprints/addon/files/addon-config/ember-try.js
+++ b/blueprints/addon/files/addon-config/ember-try.js
@@ -10,11 +10,6 @@ module.exports = {
         resolutions: {
           'ember': 'lts-2-4'
         }
-      },
-      npm: {
-        devDependencies: {
-          'ember-source': null
-        }
       }
     },
     {
@@ -26,11 +21,6 @@ module.exports = {
         resolutions: {
           'ember': 'lts-2-8'
         }
-      },
-      npm: {
-        devDependencies: {
-          'ember-source': null
-        }
       }
     },
     {
@@ -42,11 +32,6 @@ module.exports = {
         resolutions: {
           'ember': 'release'
         }
-      },
-      npm: {
-        devDependencies: {
-          'ember-source': null
-        }
       }
     },
     {
@@ -58,11 +43,6 @@ module.exports = {
         resolutions: {
           'ember': 'beta'
         }
-      },
-      npm: {
-        devDependencies: {
-          'ember-source': null
-        }
       }
     },
     {
@@ -74,17 +54,6 @@ module.exports = {
         resolutions: {
           'ember': 'canary'
         }
-      },
-      npm: {
-        devDependencies: {
-          'ember-source': null
-        }
-      }
-    },
-    {
-      name: 'ember-default',
-      npm: {
-        devDependencies: {}
       }
     }
   ]
diff --git a/blueprints/app/files/bower.json b/blueprints/app/files/bower.json
index 7b6750637..f4bce654c 100644
--- a/blueprints/app/files/bower.json
+++ b/blueprints/app/files/bower.json
@@ -1,5 +1,7 @@
 {
   "name": "<%= name %>",
   "dependencies": {
+    "ember": "~2.10.0-beta.1",
+    "ember-cli-shims": "0.1.3"
   }
 }
diff --git a/blueprints/app/files/package.json b/blueprints/app/files/package.json
index c82fcac1a..6503a35ea 100644
--- a/blueprints/app/files/package.json
+++ b/blueprints/app/files/package.json
@@ -21,7 +21,7 @@
     "ember-cli-app-version": "^2.0.0",
     "ember-cli-babel": "^5.1.7",
     "ember-cli-dependency-checker": "^1.3.0",
-    "ember-cli-htmlbars": "^1.1.1",
+    "ember-cli-htmlbars": "^1.0.10",
     "ember-cli-htmlbars-inline-precompile": "^0.3.3",
     "ember-cli-inject-live-reload": "^1.4.1",
     "ember-cli-jshint": "^2.0.1",
@@ -30,11 +30,10 @@
     "ember-cli-sri": "^2.1.0",
     "ember-cli-test-loader": "^1.1.0",
     "ember-cli-uglify": "^1.2.0",
-    "ember-data": "^2.11.0-beta.1",
+    "ember-data": "^2.10.0-beta.1",
     "ember-export-application-global": "^1.0.5",
-    "ember-load-initializers": "^0.6.0",
+    "ember-load-initializers": "^0.5.1",
     "ember-resolver": "^2.0.3",
-    "ember-source": "^2.11.0-beta.1",
     "ember-welcome-page": "^2.0.2",
     "loader.js": "^4.0.10"
   },
diff --git a/lib/broccoli/ember-app.js b/lib/broccoli/ember-app.js
index 0abc94ce0..55e2af95d 100644
--- a/lib/broccoli/ember-app.js
+++ b/lib/broccoli/ember-app.js
@@ -334,11 +334,9 @@ EmberApp.prototype._initVendorFiles = function() {
     delete this.vendorFiles['ember-resolver.js'];
   }
 
-  // Warn if ember-cli-shims is not included.
-  // `ember-source` bundles them by default, so we must check if that is the
-  // load mechanism of ember before checking `bower`.
-  if (!ember && !bowerDeps['ember-cli-shims']) {
-    this.project.ui.writeWarnLine('You have not included `ember-cli-shims` in your project\'s `bower.json`. This only works if you provide an alternative yourself and unset `app.vendorFiles[\'app-shims.js\']`.');
+  // don't crash if ember-cli-shims is not included
+  if (!bowerDeps['ember-cli-shims']) {
+    delete this.vendorFiles['app-shims.js'];
   }
 
   // this is needed to support versions of Ember older than
@@ -894,11 +892,6 @@ EmberApp.prototype._processedBowerTree = function() {
     return;
   }
 
-    // Don't blow up if there is no bower_components folder.
-  if (!existsSync(this.bowerDirectory)) {
-    return;
-  }
-
   this._cachedBowerTree = new Funnel(this.trees.bower, {
     srcDir: '/',
     destDir: this.bowerDirectory + '/',
diff --git a/lib/broccoli/merge-trees.js b/lib/broccoli/merge-trees.js
index 1134b5f90..559ef6846 100644
--- a/lib/broccoli/merge-trees.js
+++ b/lib/broccoli/merge-trees.js
@@ -12,22 +12,10 @@ function getEmptyTree() {
     return EMPTY_MERGE_TREE;
   }
 
-  EMPTY_MERGE_TREE = upstreamMergeTrees([], {
+  return EMPTY_MERGE_TREE = upstreamMergeTrees([], {
     annotation: 'EMPTY_MERGE_TREE',
     description: 'EMPTY_MERGE_TREE'
   });
-
-  var originalCleanup = EMPTY_MERGE_TREE.cleanup;
-  EMPTY_MERGE_TREE.cleanup = function() {
-    // this tree is being cleaned up, we must
-    // ensure that our shared EMPTY_MERGE_TREE is
-    // reset (otherwise it will not have a valid
-    // `outputPath`)
-    EMPTY_MERGE_TREE = null;
-    return originalCleanup.apply(this, arguments);
-  };
-
-  return EMPTY_MERGE_TREE;
 }
 
 module.exports = function mergeTrees(_inputTrees, options) {
@@ -36,18 +24,18 @@ module.exports = function mergeTrees(_inputTrees, options) {
   });
 
   switch (inputTrees.length) {
-    case 0:
-      return getEmptyTree();
-    case 1:
-      return inputTrees[0];
-    default:
-      options = options || {};
-      options.description = options.annotation;
-      var tree = upstreamMergeTrees(inputTrees, options);
-
-      tree.description = options && options.description;
-
-      return tree;
+  case 0:
+    return getEmptyTree();
+  case 1:
+    return inputTrees[0];
+  default:
+    options = options || {};
+    options.description = options.annotation;
+    var tree = upstreamMergeTrees(inputTrees, options);
+
+    tree.description = options && options.description;
+
+    return tree;
   }
 };
 
diff --git a/lib/models/blueprint.js b/lib/models/blueprint.js
index ba05be120..7c5e8dbb6 100644
--- a/lib/models/blueprint.js
+++ b/lib/models/blueprint.js
@@ -1329,8 +1329,16 @@ Blueprint.list = function(options) {
 };
 
 /**
+  Files that are renamed when installed into the target directory.
+  This allows including files in the blueprint that would have an effect
+  on another process, such as a file named `.gitignore`.
+
+  The keys are the filenames used in the files folder.
+  The values are the filenames used in the target directory.
+
   @static
-  @property renameFiles
+  @property renamedFiles
+  ```
 */
 Blueprint.renamedFiles = {
   'gitignore': '.gitignore'
diff --git a/lib/models/builder.js b/lib/models/builder.js
index ee568a0be..8b4357b99 100644
--- a/lib/models/builder.js
+++ b/lib/models/builder.js
@@ -18,10 +18,9 @@ var signalsTrapped = false;
 var buildCount = 0;
 
 function _enableFSMonitorIfVizEnabled() {
-  var monitor;
+  var FSMonitor = require('heimdalljs-fs-monitor');
+  var monitor = new FSMonitor();
   if (vizEnabled()) {
-    var FSMonitor = require('heimdalljs-fs-monitor');
-    monitor = new FSMonitor();
     monitor.start();
   }
   return monitor;
diff --git a/lib/utilities/process-template.js b/lib/utilities/process-template.js
index 015fc8990..05e197fc1 100644
--- a/lib/utilities/process-template.js
+++ b/lib/utilities/process-template.js
@@ -1,5 +1,3 @@
-'use strict';
-
 module.exports = function processTemplate(content, context) {
   var options = {
     evaluate:    /<%([\s\S]+?)%>/g,
@@ -7,4 +5,4 @@ module.exports = function processTemplate(content, context) {
     escape:      /<%-([\s\S]+?)%>/g
   };
   return require('lodash.template')(content, options)(context);
-};
+}
diff --git a/package.json b/package.json
index 079dc0488..587214eca 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "ember-cli",
-  "version": "2.10.0",
+  "version": "2.10.0-beta.2",
   "description": "Command line tool for developing ambitious ember.js apps",
   "keywords": [
     "app",
@@ -52,7 +52,7 @@
     "broccoli-middleware": "^0.18.1",
     "broccoli-source": "^1.1.0",
     "broccoli-stew": "^1.2.0",
-    "capture-exit": "^1.0.4",
+    "capture-exit": "^1.0.3",
     "chalk": "^1.1.3",
     "clean-base-url": "^1.0.0",
     "compression": "^1.4.4",


Test patch:
diff --git a/blueprints/app/files/tests/helpers/start-app.js b/blueprints/app/files/tests/helpers/start-app.js
index e098f1d5b..54c33c16c 100644
--- a/blueprints/app/files/tests/helpers/start-app.js
+++ b/blueprints/app/files/tests/helpers/start-app.js
@@ -5,8 +5,8 @@ import config from '../../config/environment';
 export default function startApp(attrs) {
   let application;
 
-  let attributes = Ember.merge({}, config.APP);
-  attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
+  // use defaults, but you can override
+  let attributes = Ember.assign({}, config.APP, attrs);
 
   Ember.run(() => {
     application = Application.create(attributes);
diff --git a/tests/helpers/acceptance.js b/tests/helpers/acceptance.js
index 308f5e389..0974a99bb 100644
--- a/tests/helpers/acceptance.js
+++ b/tests/helpers/acceptance.js
@@ -145,11 +145,17 @@ function linkDependencies(projectName) {
     var bowerComponentsPath = targetPath + '/bower_components/';
 
     mvRm(nodeModulesPath, '.deps-tmp/node_modules');
+    mvRm(bowerComponentsPath, '.deps-tmp/bower_components');
+
 
     if (!existsSync(nodeModulesPath)) {
       symLinkDir(targetPath, '.deps-tmp/node_modules', 'node_modules');
     }
 
+    if (!existsSync(bowerComponentsPath)) {
+      symLinkDir(targetPath, '.deps-tmp/bower_components', 'bower_components');
+    }
+
     process.chdir(targetPath);
 
     var appsECLIPath = path.join('node_modules', 'ember-cli');
diff --git a/tests/runner.js b/tests/runner.js
index 3ba9c54bc..95a101a63 100644
--- a/tests/runner.js
+++ b/tests/runner.js
@@ -5,7 +5,6 @@ var Mocha = require('mocha');
 var RSVP = require('rsvp');
 var fs = require('fs-extra');
 var mochaOnlyDetector = require('mocha-only-detector');
-var exit = require('capture-exit');
 
 if (process.env.EOLNEWLINE) {
   require('os').EOL = '\n';
@@ -58,9 +57,10 @@ function checkOnlyInTests() {
 function runMocha() {
   console.time('Mocha Tests Running Time');
   mocha.run(function(failures) {
-    console.timeEnd('Mocha Tests Running Time');
-    exit.releaseExit();
-    process.exit(failures);
+    process.on('exit', function() {
+      console.timeEnd('Mocha Tests Running Time');
+      process.exit(failures);
+    });
   });
 }
 
@@ -79,6 +79,5 @@ ciVerificationStep()
   .catch(function(error) {
     console.error(error);
     console.error(error.stack);
-    exit.releaseExit();
     process.exit(1);
   });
diff --git a/tests/unit/broccoli/ember-app-test.js b/tests/unit/broccoli/ember-app-test.js
index f1bbb6201..8c6ae2471 100644
--- a/tests/unit/broccoli/ember-app-test.js
+++ b/tests/unit/broccoli/ember-app-test.js
@@ -193,7 +193,8 @@ describe('broccoli/ember-app', function() {
             availablePlugins: { 'loader.js': {} }
           }
         });
-        expect(app.vendorFiles['ember-resolver.js'][0]).to.equal('bower_components/ember-resolver/dist/modules/ember-resolver.js');
+
+        expect(app.vendorFiles['ember-resolver'][0]).to.equal('bower_components/ember-resolver/dist/modules/ember-resolver.js');
       });
 
       it('removes ember-resolver.js from vendorFiles when not in bower.json and NPM ember-resolver not installed', function() {
@@ -209,6 +210,14 @@ describe('broccoli/ember-app', function() {
         expect(app.vendorFiles['ember-resolver']).to.equal(undefined);
       });
     });
+
+    describe('ember-cli-shims', function() {
+      it('removes app-shims.js from vendorFiles when ember-cli-shims is not in bower.json', function() {
+        project.bowerDependencies = function() { return { 'ember': {} }; }
+        var app = new EmberApp({ project: project });
+        expect(app.vendorFiles['app-shims.js']).to.equal(undefined);
+      });
+    });
   });
 
   describe('contentFor', function() {
@@ -591,7 +600,7 @@ describe('broccoli/ember-app', function() {
       beforeEach(function() {
         projectPath = path.resolve(__dirname, '../../fixtures/addon/env-addons');
         var packageContents = require(path.join(projectPath, 'package.json'));
-        project = new Project(projectPath, packageContents, new MockUI());
+        project = new Project(projectPath, packageContents);
       });
 
       afterEach(function() {
diff --git a/tests/unit/broccoli/merge-trees-test.js b/tests/unit/broccoli/merge-trees-test.js
index 5b4fdc238..5c56c21fc 100644
--- a/tests/unit/broccoli/merge-trees-test.js
+++ b/tests/unit/broccoli/merge-trees-test.js
@@ -5,6 +5,7 @@
 var fs         = require('fs');
 var expect     = require('chai').expect;
 var proxyquire = require('proxyquire');
+var td = require('testdouble');
 
 var MockUI = require('console-ui/mock');
 
@@ -17,15 +18,7 @@ var mergeTrees = proxyquire('../../../lib/broccoli/merge-trees', {
 
 describe('broccoli/merge-trees', function() {
   beforeEach(function() {
-    mergeTreesStub = function() {
-      return {};
-    };
-  });
-
-  afterEach(function() {
-    // reset the shared EMPTY_MERGE_TREE to ensure
-    // we end up back in a consistent state
-    mergeTrees._overrideEmptyTree(null);
+    mergeTreesStub = td.function();
   });
 
   it('returns the first item when merging single item array', function() {
diff --git a/tests/unit/models/builder-test.js b/tests/unit/models/builder-test.js
index 8191cb354..801193d10 100644
--- a/tests/unit/models/builder-test.js
+++ b/tests/unit/models/builder-test.js
@@ -1,14 +1,13 @@
 'use strict';
 
-var fs              = require('fs');
-var fse             = require('fs-extra');
+var fs              = require('fs-extra');
 var path            = require('path');
 var Builder         = require('../../../lib/models/builder');
 var BuildCommand    = require('../../../lib/commands/build');
 var commandOptions  = require('../../factories/command-options');
 var Promise         = require('../../../lib/ext/promise');
 var MockProject     = require('../../helpers/mock-project');
-var remove          = Promise.denodeify(fse.remove);
+var remove          = Promise.denodeify(fs.remove);
 var mkTmpDirIn      = require('../../../lib/utilities/mk-tmp-dir-in');
 var td              = require('testdouble');
 
@@ -24,34 +23,25 @@ describe('models/builder.js', function() {
 
   describe('._enableFSMonitorIfVizEnabled', function() {
     var originalBroccoliViz = process.env.BROCCOLI_VIZ;
-    var originalStatSync = fs.statSync;
-
-    beforeEach(function () {
-      expect(!!process.env.BROCCOLI_VIZ).to.eql(false);
-    });
 
     afterEach(function() {
       delete process.env.BROCCOLI_VIZ;
     });
 
-    it('if VIZ is NOT enabled, do not monitor', function() {
+    it('if VIZ is enabled, monitor', function() {
+      process.env.BROCCOLI_VIZ = '1';
       var monitor = Builder._enableFSMonitorIfVizEnabled();
       try {
-        expect(fs.statSync).to.equal(originalStatSync);
-        expect(monitor).to.eql(undefined);
+        expect(monitor.state).to.eql('active');
       } finally {
-        if (monitor) {
-          monitor.stop();
-        }
+        monitor.stop();
       }
     });
 
-    it('if VIZ is enabled, monitor', function() {
-      process.env.BROCCOLI_VIZ = '1';
+    it('if VIZ is NOT enabled, monitor', function() {
       var monitor = Builder._enableFSMonitorIfVizEnabled();
       try {
-        expect(fs.statSync).to.not.equal(originalStatSync);
-        expect(monitor.state).to.eql('active');
+        expect(monitor.state).to.eql('idle');
       } finally {
         monitor.stop();
       }