Skip to content

Commit

Permalink
Merge pull request #271 from rwjblue/update-resolver
Browse files Browse the repository at this point in the history
Update ember-resolver to NPM version.
  • Loading branch information
rwjblue committed Nov 4, 2015
2 parents 979f639 + 3fc82f0 commit d2d9d71
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/app.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
5 changes: 2 additions & 3 deletions app/services/ember-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ function contentForAppBoot (content, config) {
// doesn't recognize them properly...
var monkeyPatchModules = [
'ember',
'ember/resolver',
'ember/load-initializers'
'ember/load-initializers',
'ember-resolver/resolver'
];

if ("ember-data" in config.dependencies) {
Expand All @@ -392,4 +392,3 @@ function contentForAppBoot (content, config) {
function calculateAppConfig(config) {
return JSON.stringify(config.APP || {});
}

1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 20 additions & 2 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
});
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -61,6 +62,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"
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/resolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Resolver from 'ember/resolver';
import Resolver from 'ember-resolver';
import config from '../../config/environment';

var resolver = Resolver.create();
Expand Down

0 comments on commit d2d9d71

Please sign in to comment.