Skip to content

Commit

Permalink
Merge pull request #200 from rwjblue/update-for-latest-ember-data
Browse files Browse the repository at this point in the history
Updates to ensure ember-data from npm works properly.
  • Loading branch information
rwjblue authored Apr 3, 2017
2 parents 376d38d + e89d4e1 commit 9b5b4b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo: false
language: node_js
node_js:
- 'stable'
- '6'

install:
- npm install -g npm
Expand Down
29 changes: 19 additions & 10 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@ module.exports = function(options) {
var project = options.project;
project.initializeAddons();

function addonTreesFor(type) {
function eachAddonInvoke(method, args) {
return project.addons.map(function(addon) {
if (addon.treeFor) {
return addon.treeFor(type);
if (addon[method]) {
return addon[method].apply(addon, args);
}
}).filter(Boolean);
});
}

function addonTreesFor(type) {
return eachAddonInvoke('treeFor', [type]).filter(Boolean);
}

var fakeApp = {
import() { }
};

project.addons.map(function(addon) { addon.app = fakeApp; });

eachAddonInvoke('included', [{ import() { }}]);

// --- Dependencies ---
var addonVendorTrees = mergeTrees(addonTreesFor('vendor'));
var loader = new Funnel(addonVendorTrees, {
Expand Down Expand Up @@ -44,13 +56,8 @@ module.exports = function(options) {

var mainTrees = [lib, tests, libESLint, testESLint];
var addonTree = mergeTrees(addonTreesFor('addon'));
var addonModulesTree = new Funnel(addonTree, {
srcDir: 'modules',
destDir: '/',
allowEmpty: true,
});

var main = mergeTrees(mainTrees.concat(addonModulesTree));
var main = mergeTrees(mainTrees);
// --- Compile ES6 modules ---

main = new Babel(main, {
Expand All @@ -59,6 +66,8 @@ module.exports = function(options) {
modules: 'amdStrict'
});

main = mergeTrees([main, addonTree]);

main = concat(main, {
inputFiles: ['**/*.js'],
outputFile: '/assets/ember-test-helpers-tests.amd.js'
Expand Down

0 comments on commit 9b5b4b6

Please sign in to comment.