forked from emberjs/ember.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
603 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "bower_components" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,4 @@ node_modules | |
bundle/ | ||
*~ | ||
publish_to_bower/ | ||
bower_components/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
var fs = require('fs'); | ||
var pickFiles = require('broccoli-static-compiler'); | ||
var compileES6 = require('broccoli-es6-concatenator'); | ||
var findBowerTrees = require('broccoli-bower'); | ||
var mergeTrees = require('broccoli-merge-trees'); | ||
var defeatureify = require('broccoli-defeatureify'); | ||
|
||
var configJson = JSON.parse(fs.readFileSync("features.json").toString()); | ||
|
||
var defeatureifyConfig = { | ||
enabled: configJson.features, | ||
debugStatements: configJson.debugStatements, | ||
namespace: configJson.namespace, | ||
enableStripDebug: configJson.enableStripDebug | ||
}; | ||
|
||
function moduleNameToPath(modulePath) { | ||
var pathParts = modulePath.split('/'); | ||
var outputPathParts = []; | ||
|
||
if (pathParts[0] !== 'packages_es6') { | ||
outputPathParts = ['packages_es6', pathParts[0]] | ||
if (pathParts[1] !== 'tests') { | ||
outputPathParts.push('lib'); | ||
} | ||
if (pathParts.length === 1) { | ||
outputPathParts.push('main'); | ||
} else { | ||
outputPathParts = outputPathParts.concat(pathParts.slice(1)) | ||
} | ||
} else { | ||
outputPathParts.push(modulePath); | ||
} | ||
|
||
return outputPathParts.join('/') + '.js'; | ||
} | ||
|
||
function pathToModuleName(path) { | ||
return moduleName = path | ||
.replace('packages_es6/', '') | ||
.replace('lib/', '') | ||
.replace(/\/main$/, '') | ||
.slice(0, -3); | ||
} | ||
|
||
var legacyFilesToAppend = [ | ||
'packages_es6/ember-metal/lib/vendor/backburner.amd.js', | ||
'packages_es6/ember-routing/lib/vendor/router.amd.js', | ||
'packages_es6/ember-routing/lib/vendor/route-recognizer.amd.js', | ||
'rsvp/main.js', | ||
'metamorph/main.js', | ||
]; | ||
|
||
var testConfig = pickFiles('tests', { | ||
srcDir: '/', | ||
files: ['**/*.*'], | ||
destDir: '/tests' | ||
}); | ||
|
||
//['container', 'ember-metal', 'ember-debug', | ||
// 'ember-runtime', 'ember-views', 'ember-extension-support', | ||
// 'ember-testing', 'ember-handlebars-compiler', 'ember-handlebars', | ||
// 'ember-routing', 'ember-application'] | ||
//.forEach(function(packageName) { | ||
// packages.push(pickFiles('packages_es6/' + packageName, { | ||
// srcDir: '/', | ||
// destDir: '/' | ||
// })) | ||
//}); | ||
|
||
var loader = pickFiles('packages/loader/lib', { | ||
files: ['main.js'], | ||
srcDir: '/', | ||
destDir: '/loader' | ||
}); | ||
|
||
var rsvp = pickFiles('packages/rsvp/lib', { | ||
files: ['main.js'], | ||
srcDir: '/', | ||
destDir: '/rsvp' | ||
}); | ||
|
||
var metamorph = pickFiles('packages/metamorph/lib', { | ||
files: ['main.js'], | ||
srcDir: '/', | ||
destDir: '/metamorph' | ||
}); | ||
|
||
var bowerFiles = [ | ||
pickFiles('bower_components/qunit/qunit', { | ||
srcDir: '/', | ||
destDir: '/qunit' | ||
}), | ||
|
||
pickFiles('bower_components/jquery', { | ||
files: ['jquery.js'], | ||
srcDir: '/', | ||
destDir: '/jquery' | ||
}), | ||
|
||
pickFiles('bower_components/handlebars', { | ||
files: ['handlebars.js'], | ||
srcDir: '/', | ||
destDir: '/handlebars' | ||
}), | ||
]; | ||
|
||
bowerFiles = mergeTrees(bowerFiles); | ||
|
||
var packages = pickFiles('packages_es6', { | ||
srcDir: '/', | ||
destDir: 'packages_es6' | ||
}); | ||
|
||
var sourceTrees = [packages, loader, rsvp, metamorph]; | ||
sourceTrees = mergeTrees(sourceTrees, {overwrite: true}); | ||
|
||
var packagesJs = compileES6(sourceTrees, { | ||
loaderFile: 'loader/main.js', | ||
ignoredModules: [ ], | ||
inputFiles: [ 'packages_es6/**/lib/**/*.js' ], | ||
legacyFilesToAppend: legacyFilesToAppend, | ||
wrapInEval: true, | ||
outputFile: '/dist/ember.js', | ||
moduleNameToPath: moduleNameToPath, | ||
pathToModuleName: pathToModuleName | ||
}); | ||
|
||
var testsJs = compileES6(sourceTrees, { | ||
loaderFile: 'loader/main.js', | ||
ignoredModules: [ ], | ||
inputFiles: [ 'packages_es6/**/tests/**/*.js' ], | ||
legacyFilesToAppend: legacyFilesToAppend, | ||
wrapInEval: true, | ||
outputFile: '/dist/ember-tests.js', | ||
moduleNameToPath: moduleNameToPath, | ||
pathToModuleName: pathToModuleName | ||
}); | ||
|
||
var defeaturedJs = defeatureify(mergeTrees([packagesJs, testsJs], {overwrite: true}), defeatureifyConfig); | ||
|
||
module.exports = mergeTrees([defeaturedJs, testConfig, bowerFiles]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "ember", | ||
"dependencies": { | ||
"handlebars": "~1.3.0", | ||
"jquery": "~1.9.1", | ||
"qunit": "~1.12.0", | ||
"loader": "git://github.com/stefanpenner/loader.js#1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Ember</title> | ||
<link rel="stylesheet" href="/qunit/qunit.css"> | ||
<script src="/qunit/qunit.js"></script> | ||
<script src="/tests/qunit_configuration.js"></script> | ||
<script src="/handlebars/handlebars.js"></script> | ||
|
||
<script type="text/javascript"> | ||
window.loadScript = function(url) { | ||
document.write(unescape('%3Cscript src="'+url+'"%3E%3C/script%3E')); | ||
}; | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
// Load custom version of jQuery if possible (assign to window so IE8 can use in later blocks) | ||
var jQueryVersion = QUnit.urlParams.jquery; | ||
if (jQueryVersion) { | ||
loadScript('https://code.jquery.com/jquery-'+jQueryVersion+'.js'); | ||
} | ||
// Close the script tag to make sure document.write happens | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
// Fallback to default jQuery | ||
if (jQueryVersion !== 'none' && !window.jQuery) { | ||
loadScript('/jquery/jquery.js'); | ||
} | ||
// Close the script tag to make sure document.write happens | ||
</script> | ||
|
||
<script src="/tests/ember_configuration.js"></script> | ||
<script src="/dist/ember-tests.js"></script> | ||
<script> | ||
var packages = (QUnit.urlParams.package || "*").split(","); | ||
var packageRegexp = new RegExp('^('+packages.join('|')+')/'); | ||
|
||
|
||
for (var moduleName in Ember.__loader.registry) { | ||
if (moduleName.match(packageRegexp) && moduleName.match(/_test$/)) { | ||
requireModule(moduleName); | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.