Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test ember-data-2.3 in addon mode. #148

Merged
merged 7 commits into from
Jan 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
},
"devDependencies": {
"qunit": "^1.15.0",
"ember-data": "^2.2.0",
"pretender": "~0.10.1",
"loader.js": "ember-cli/loader.js#3.0.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.6",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"jquery": "~2.1.1"
Expand Down
21 changes: 14 additions & 7 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,21 @@ module.exports = {
},
{
name: 'ember-data-2.3',
dependencies: {
"ember": "components/ember#release",
},
devDependencies: {
"ember-data": "~2.3"
bower: {
dependencies: {
"ember": "release"
},
devDependencies: {
"ember-cli-shims": "ember-cli/ember-cli-shims#0.1.0"
},
resolutions: {
"ember": "release"
}
},
resolutions: {
"ember": "release"
npm: {
devDependencies: {
"ember-data": "~2.3"
}
}
}
]
Expand Down
49 changes: 36 additions & 13 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ var mergeTrees = require('broccoli-merge-trees');
var Babel = require('broccoli-babel-transpiler');
var concat = require('broccoli-sourcemap-concat');
var JSHint = require('broccoli-jshint');
var existsSync = require('exists-sync');

module.exports = function(options) {
var project = options.project;
project.initializeAddons();

function addonTreesFor(type) {
return project.addons.map(function(addon) {
if (addon.treeFor) {
return addon.treeFor(type);
}
}).filter(Boolean);
}

module.exports = function() {
// --- Dependencies ---
var loader = new Funnel('bower_components', {
srcDir: 'loader.js',
files: ['loader.js'],
destDir: '/assets'
var addonVendorTrees = mergeTrees(addonTreesFor('vendor'));
var loader = new Funnel(addonVendorTrees, {
destDir: '/assets',
files: ['loader.js']
});

var klassy = new Funnel('node_modules', {
Expand All @@ -35,8 +47,14 @@ module.exports = function() {
var libJSHint = new JSHint(lib);
var testJSHint = new JSHint(tests);

var main = mergeTrees([klassy, lib, tests, libJSHint, testJSHint]);
var mainTrees = [klassy, lib, tests, libJSHint, testJSHint];
var addonTree = mergeTrees(addonTreesFor('addon'));
var addonModulesTree = new Funnel(addonTree, {
srcDir: 'modules',
destDir: '/'
});

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

main = new Babel(main, {
Expand All @@ -52,14 +70,19 @@ module.exports = function() {

// --- Select and concat vendor / support files ---

var inputFiles = ['jquery/dist/jquery.js',
'ember/ember-template-compiler.js',
'ember/ember.debug.js',
'FakeXMLHttpRequest/fake_xml_http_request.js',
'route-recognizer/dist/route-recognizer.js',
'pretender/pretender.js'];

if (existsSync('bower_components/ember-data/ember-data.js')) {
inputFiles.push('ember-data/ember-data.js');
}

var vendor = concat('bower_components', {
inputFiles: ['jquery/dist/jquery.js',
'ember/ember-template-compiler.js',
'ember/ember.debug.js',
'ember-data/ember-data.js',
'FakeXMLHttpRequest/fake_xml_http_request.js',
'route-recognizer/dist/route-recognizer.js',
'pretender/pretender.js'],
inputFiles: inputFiles,
outputFile: '/assets/vendor.js'
});

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"broccoli-sourcemap-concat": "^0.4.3",
"ember-cli": "1.13.13",
"ember-cli-release": "^1.0.0-beta.1",
"ember-try": "0.0.8"
"ember-try": "^0.1.0",
"exists-sync": "0.0.3",
"loader.js": "^4.0.0"
},
"dependencies": {
"klassy": "^0.1.3"
Expand Down