From 5d0853301f4fd13d8fb66fdd6aa5094f91529863 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Wed, 4 Nov 2015 09:49:06 -0500 Subject: [PATCH 1/2] Update ember-resolver to NPM version. Fixes additional deprecation warnings for container-debug-adapter. --- app/app.js | 2 +- app/services/ember-cli.js | 2 -- bower.json | 1 - package.json | 1 + tests/helpers/resolver.js | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/app.js b/app/app.js index 8d66b958..bf84f877 100644 --- a/app/app.js +++ b/app/app.js @@ -1,5 +1,5 @@ import Ember from 'ember'; -import Resolver from 'ember/resolver'; +import Resolver from 'ember-resolver'; import loadInitializers from 'ember/load-initializers'; import config from './config/environment'; diff --git a/app/services/ember-cli.js b/app/services/ember-cli.js index 51f82dbe..1b190659 100644 --- a/app/services/ember-cli.js +++ b/app/services/ember-cli.js @@ -367,7 +367,6 @@ function contentForAppBoot (content, config) { // doesn't recognize them properly... var monkeyPatchModules = [ 'ember', - 'ember/resolver', 'ember/load-initializers' ]; @@ -392,4 +391,3 @@ function contentForAppBoot (content, config) { function calculateAppConfig(config) { return JSON.stringify(config.APP || {}); } - diff --git a/bower.json b/bower.json index 22d75623..79241eea 100644 --- a/bower.json +++ b/bower.json @@ -8,7 +8,6 @@ "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5", "ember-qunit": "0.4.9", "ember-qunit-notifications": "0.0.7", - "ember-resolver": "~0.1.18", "jquery": "^1.11.3", "loader.js": "ember-cli/loader.js#3.2.1", "qunit": "~1.18.0", diff --git a/package.json b/package.json index f9c74f43..f95c2366 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "ember-lodash": "0.0.5", "ember-moment": "4.0.1", "ember-notify": "4.0.1", + "ember-resolver": "^2.0.3", "ember-responsive": "1.1.1", "ivy-codemirror": "~1.2.0", "torii": "^0.6.0" diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js index 28f4ece4..e659e27d 100644 --- a/tests/helpers/resolver.js +++ b/tests/helpers/resolver.js @@ -1,4 +1,4 @@ -import Resolver from 'ember/resolver'; +import Resolver from 'ember-resolver'; import config from '../../config/environment'; var resolver = Resolver.create(); From 3fc82f0875df1e1cb22fd636f1fe93bc450ae107 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Wed, 4 Nov 2015 10:43:33 -0500 Subject: [PATCH 2/2] Update build system for ember-resolver from NPM. --- app/services/ember-cli.js | 3 ++- ember-cli-build.js | 22 ++++++++++++++++++++-- package.json | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/services/ember-cli.js b/app/services/ember-cli.js index 1b190659..060b31b7 100644 --- a/app/services/ember-cli.js +++ b/app/services/ember-cli.js @@ -367,7 +367,8 @@ function contentForAppBoot (content, config) { // doesn't recognize them properly... var monkeyPatchModules = [ 'ember', - 'ember/load-initializers' + 'ember/load-initializers', + 'ember-resolver/resolver' ]; if ("ember-data" in config.dependencies) { diff --git a/ember-cli-build.js b/ember-cli-build.js index 50c0cc24..bc2c51ca 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -5,6 +5,7 @@ module.exports = function() { var concat = require('broccoli-concat'); var mergeTrees = require('broccoli-merge-trees'); var pickFiles = require('broccoli-static-compiler'); + var babelTranspiler = require('broccoli-babel-transpiler'); var env = EmberApp.env(); var isProductionLikeBuild = ['production', 'staging'].indexOf(env) > -1; var prepend = null; @@ -58,12 +59,23 @@ module.exports = function() { destDir: '/assets' }); - var twiddleVendorTree = concat(funnel('bower_components'),{ + var bowerTree = funnel('bower_components'); + var baseResolverTree = funnel('node_modules/ember-resolver/addon', { + destDir: 'ember-resolver' + }); + + var transpiledResolverTree = babelTranspiler(baseResolverTree, { + loose: true, + moduleIds: true, + modules: 'amdStrict' + }); + + var twiddleVendorTree = concat(mergeTrees([bowerTree, transpiledResolverTree]), { inputFiles: [ 'loader.js/loader.js', - 'ember-resolver/dist/modules/ember-resolver.js', 'ember-cli-shims/app-shims.js', 'ember-load-initializers/ember-load-initializers.js', + 'ember-resolver/**/*.js' ], outputFile: '/assets/twiddle-deps.js', }); @@ -96,6 +108,12 @@ function getEmberCLIBlueprints() { fileMap[blueprintName] = fs.readFileSync(filePath).toString(); } + // ember-cli 1.13.x uses ember/resolver + fileMap['app'] = fileMap.app.replace('\'ember/resolver\'', '\'ember-resolver/resolver\''); + + // ember-cli 2.x uses ember-resolver + fileMap['app'] = fileMap.app.replace('\'ember-resolver\'', '\'ember-resolver/resolver\''); + fileMap['twiddle.json'] = fs.readFileSync('blueprints/twiddle.json').toString(); fileMap['initializers/router'] = fs.readFileSync('blueprints/router_initializer.js').toString(); fileMap['initializers/mouse-events'] = fs.readFileSync('blueprints/mouse_events_initializer.js').toString(); diff --git a/package.json b/package.json index f95c2366..7efec3b6 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "license": "MIT", "devDependencies": { "broccoli-asset-rev": "^2.1.2", + "broccoli-babel-transpiler": "^5.4.5", "broccoli-concat": "0.0.13", "broccoli-funnel": "0.2.8", "broccoli-merge-trees": "0.2.3",