Repository: ember-cli/ember-cli
Pull request #8873 (2019-10-03 18:15:57)

App and addon blueprint updates to match octane blueprints
I basically diffed the output from app & addon blueprints between ember-cli and [ember-octane-blueprint](https://github.com/ember-cli/ember-octane-blueprint) pulling out the important differences and including them in this PR. (I did the [same thing with the octane blueprints started](https://github.com/ember-cli/ember-octane-blueprint/pull/105).)

NullVoxPopuli: idk -- it should use the blueprint repo/package, right? leaving the classic one alone?
Panman8201: > idk -- it should use the octane blueprint repo/package, right? leaving the classic one alone?

This PR is just finishing up the "sync" with the Octane blueprints, which was already started & merged by @rwjblue. 
rwjblue: > idk -- it should use the octane blueprint repo/package, right? leaving the classic one alone?

I think we've discussed this a bit, but for 3.14 I think the `app` and `addon` blueprints should continue to be provided by ember-cli directly. I think most of us (cli team, framework team) are 👍 on the conceptual idea of moving these blueprints to be external packages, but there is a bit of thought that needs to go into how to manage things (like versioning). I don't think any of us wants this to turn into an Octane blocker, so decoupling that separation from Octane seems much preferable to me.
ef4: > @rwjblue I'm a little hesitant to add it to the dummy apps by default too, because it would make it seem that it works in the addon code itself too. Similar issue to using `ember-maybe-import-regenerator`, I guess.

ember-auto-import itself guards against this risk. If you use it as a devDependency, it will only function inside the dummy app's files. The addon's files aren't able to auto-import anything.
Turbo87: okay, if that's the case then I'm fine with it 👍 

Panman8201: Ok, changed PR to leave `ember-auto-import` in `devDependencies` for the addon as well (tests running now). Is "Squash & Merge" enabled for this repo or should I `git rebase -i` to combine all my commits (if needed)?
rwjblue: @Panman8201 - I'll take care of the rebase, thank you for working on this!

Patch:
diff --git a/blueprints/addon/files/npmignore b/blueprints/addon/files/npmignore
index bd09adff9..81cd0a633 100644
--- a/blueprints/addon/files/npmignore
+++ b/blueprints/addon/files/npmignore
@@ -8,7 +8,7 @@
 # misc
 /.bowerrc
 /.editorconfig
-/.ember-cli
+/.ember-cli.js
 /.env*
 /.eslintignore
 /.eslintrc.js
diff --git a/blueprints/app/files/.ember-cli.js b/blueprints/app/files/.ember-cli.js
index 5e5e1489a..6be591bcd 100644
--- a/blueprints/app/files/.ember-cli.js
+++ b/blueprints/app/files/.ember-cli.js
@@ -1,3 +1,5 @@
+'use strict';
+
 const { setEdition } = require('@ember/edition-utils');
 
 setEdition('octane');
diff --git a/blueprints/app/files/app/app.js b/blueprints/app/files/app/app.js
index b3b2bd677..8df91db56 100644
--- a/blueprints/app/files/app/app.js
+++ b/blueprints/app/files/app/app.js
@@ -3,12 +3,10 @@ import Resolver from './resolver';
 import loadInitializers from 'ember-load-initializers';
 import config from './config/environment';
 
-const App = Application.extend({
-  modulePrefix: config.modulePrefix,
-  podModulePrefix: config.podModulePrefix,
-  Resolver
-});
+export default class App extends Application {
+  modulePrefix = config.modulePrefix;
+  podModulePrefix = config.podModulePrefix;
+  Resolver = Resolver;
+}
 
 loadInitializers(App, config.modulePrefix);
-
-export default App;
diff --git a/blueprints/app/files/app/router.js b/blueprints/app/files/app/router.js
index d0bb00952..224ca426a 100644
--- a/blueprints/app/files/app/router.js
+++ b/blueprints/app/files/app/router.js
@@ -1,12 +1,10 @@
 import EmberRouter from '@ember/routing/router';
 import config from './config/environment';
 
-const Router = EmberRouter.extend({
-  location: config.locationType,
-  rootURL: config.rootURL
-});
+export default class Router extends EmberRouter {
+  location = config.locationType;
+  rootURL = config.rootURL;
+}
 
 Router.map(function() {
 });
-
-export default Router;
diff --git a/blueprints/app/files/package.json b/blueprints/app/files/package.json
index 306d45837..ce6042bc0 100644
--- a/blueprints/app/files/package.json
+++ b/blueprints/app/files/package.json
@@ -23,6 +23,7 @@
     "@glimmer/component": "^0.14.0-alpha.13",
     "babel-eslint": "^10.0.3",
     "broccoli-asset-rev": "^3.0.0",
+    "ember-auto-import": "^1.5.2",
     "ember-cli": "~<%= emberCLIVersion %>",
     "ember-cli-app-version": "^3.2.0",
     "ember-cli-babel": "^7.11.1",


Test patch:
diff --git a/tests/fixtures/addon/npm/package.json b/tests/fixtures/addon/npm/package.json
index ec6546e26..209727043 100644
--- a/tests/fixtures/addon/npm/package.json
+++ b/tests/fixtures/addon/npm/package.json
@@ -30,6 +30,7 @@
     "@glimmer/component": "^0.14.0-alpha.13",
     "babel-eslint": "^10.0.3",
     "broccoli-asset-rev": "^3.0.0",
+    "ember-auto-import": "^1.5.2",
     "ember-cli": "~<%= emberCLIVersion %>",
     "ember-cli-dependency-checker": "^3.1.0",
     "ember-cli-eslint": "^5.1.0",
diff --git a/tests/fixtures/addon/yarn/package.json b/tests/fixtures/addon/yarn/package.json
index e241200ac..0ddf3cb8f 100644
--- a/tests/fixtures/addon/yarn/package.json
+++ b/tests/fixtures/addon/yarn/package.json
@@ -30,6 +30,7 @@
     "@glimmer/component": "^0.14.0-alpha.13",
     "babel-eslint": "^10.0.3",
     "broccoli-asset-rev": "^3.0.0",
+    "ember-auto-import": "^1.5.2",
     "ember-cli": "~<%= emberCLIVersion %>",
     "ember-cli-dependency-checker": "^3.1.0",
     "ember-cli-eslint": "^5.1.0",
diff --git a/tests/fixtures/app/npm/package.json b/tests/fixtures/app/npm/package.json
index 9e47cb7ec..815b857f8 100644
--- a/tests/fixtures/app/npm/package.json
+++ b/tests/fixtures/app/npm/package.json
@@ -23,6 +23,7 @@
     "@glimmer/component": "^0.14.0-alpha.13",
     "babel-eslint": "^10.0.3",
     "broccoli-asset-rev": "^3.0.0",
+    "ember-auto-import": "^1.5.2",
     "ember-cli": "~<%= emberCLIVersion %>",
     "ember-cli-app-version": "^3.2.0",
     "ember-cli-babel": "^7.11.1",
diff --git a/tests/fixtures/app/yarn/package.json b/tests/fixtures/app/yarn/package.json
index 5d019f2b7..5b6571a74 100644
--- a/tests/fixtures/app/yarn/package.json
+++ b/tests/fixtures/app/yarn/package.json
@@ -23,6 +23,7 @@
     "@glimmer/component": "^0.14.0-alpha.13",
     "babel-eslint": "^10.0.3",
     "broccoli-asset-rev": "^3.0.0",
+    "ember-auto-import": "^1.5.2",
     "ember-cli": "~<%= emberCLIVersion %>",
     "ember-cli-app-version": "^3.2.0",
     "ember-cli-babel": "^7.11.1",
diff --git a/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js b/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js
index 886c8976c..07328a0e6 100644
--- a/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js
+++ b/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js
@@ -2,12 +2,10 @@ import Application from '@ember/application';
 import Resolver from 'ember-resolver';
 import loadInitializers from 'ember-load-initializers';
 
-const App = Application.extend({
-  modulePrefix: 'some-cool-app',
-  podModulePrefix: 'some-cool-app/pods',
-  Resolver: Resolver
-});
+export default class App extends Application {
+  modulePrefix = 'some-cool-app';
+  podModulePrefix = 'some-cool-app/pods';
+  Resolver = Resolver;
+}
 
 loadInitializers(App, 'some-cool-app');
-
-export default App;
diff --git a/tests/fixtures/brocfile-tests/query/app/app.js b/tests/fixtures/brocfile-tests/query/app/app.js
index 0bf285d84..9417e1509 100644
--- a/tests/fixtures/brocfile-tests/query/app/app.js
+++ b/tests/fixtures/brocfile-tests/query/app/app.js
@@ -2,12 +2,10 @@ import Application from '@ember/application';
 import Resolver from 'ember-resolver';
 import loadInitializers from 'ember-load-initializers';
 
-const App = Application.extend({
-  modulePrefix: 'query',
-  podModulePrefix: 'app/pods',
-  Resolver: Resolver
-});
+export default class App extends Application {
+  modulePrefix = 'query';
+  podModulePrefix = 'app/pods';
+  Resolver = Resolver;
+}
 
 loadInitializers(App, 'query');
-
-export default App;