-
Notifications
You must be signed in to change notification settings - Fork 262
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
Broccoli fun #349
Merged
Merged
Broccoli fun #349
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7de6ac3
upgrade tooling
stefanpenner 1d32ff6
Ember test and npm run test:node passing
chadhietala 86412d9
Fix merge
chadhietala e780b15
test non-minified (we can add a flag to test minified next)
stefanpenner 36111ad
remove old task
stefanpenner 7a74d50
remove accidentally imported map file
stefanpenner dc07b9c
some cleanup + refactoring
stefanpenner d2ab6ed
more broccoli fun
stefanpenner c49043b
Merge remote-tracking branch 'origin/master' into broccoli-fun
stefanpenner 936a7ac
remove unused deps
stefanpenner 86cd3be
bump broccoli-stew which now supports globs
stefanpenner e6ccf8d
move stuff around + bump to broccoli-stew 0.0.3
stefanpenner a1a42e8
node 0.10.x doesn’t like this. Its not really needed just run `npm ru…
stefanpenner 8b29a9c
Revert "node 0.10.x doesn’t like this. Its not really needed just run…
stefanpenner 861cfe4
install latest npm
stefanpenner 6f7b713
Merge remote-tracking branch 'origin/master' into broccoli-fun
stefanpenner 6d648da
prepend license
stefanpenner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,72 +1,67 @@ | ||
/* jshint node:true, undef:true, unused:true */ | ||
var AMDFormatter = require('es6-module-transpiler-amd-formatter'); | ||
var compileModules = require('broccoli-es6-module-transpiler'); | ||
var merge = require('broccoli-merge-trees'); | ||
var uglify = require('broccoli-uglify-js'); | ||
var compileModules = require('broccoli-compile-modules'); | ||
var mergeTrees = require('broccoli-merge-trees'); | ||
var moveFile = require('broccoli-file-mover'); | ||
var es3Recast = require('broccoli-es3-safe-recast'); | ||
var concat = require('broccoli-concat'); | ||
var replace = require('broccoli-string-replace'); | ||
var calculateVersion = require('git-repo-version'); | ||
var path = require('path'); | ||
var trees = []; | ||
var env = process.env.EMBER_ENV || 'development'; | ||
var browserify = require('broccoli-watchify'); | ||
var fs = require('fs'); | ||
|
||
var bundle = compileModules('lib', { | ||
inputFiles: ['rsvp.umd.js'], | ||
output: '/rsvp.js', | ||
formatter: 'bundle', | ||
|
||
var stew = require('broccoli-stew'); | ||
|
||
var find = stew.find; | ||
var mv = stew.mv; | ||
var rename = stew.rename; | ||
var env = stew.env; | ||
var map = stew.map; | ||
|
||
var lib = find('lib'); | ||
var testDir = find('test'); | ||
var testFiles = find('test/{index.html,worker.js}'); | ||
|
||
// should be mv | ||
var json3 = rename(find('node_modules/json3/lib/{json3.js}'), 'node_modules/json3/lib', 'test/'); | ||
var mocha = rename(find('node_modules/mocha/mocha.{js,css}'), 'node_modules/mocha/', 'test/'); | ||
|
||
var testVendor = merge([ json3, mocha ]); | ||
|
||
var rsvp = compileModules(lib, { | ||
format: 'bundle', | ||
entry: 'rsvp.umd.js', | ||
output: 'rsvp.js' | ||
}); | ||
|
||
trees.push(bundle); | ||
trees.push(compileModules('lib', { | ||
inputFiles: ['**/*.js'], | ||
output: '/amd/', | ||
formatter: new AMDFormatter() | ||
})); | ||
var testBundle = browserify(merge([ | ||
mv(rsvp, 'test'), | ||
testDir | ||
]), { | ||
browserify: { entries: ['./test/index.js'] }, | ||
init: function (b) { b.external('vertx'); } | ||
}); | ||
|
||
if (process.env.EMBER_ENV === 'production') { | ||
trees.push(uglify(moveFile(bundle, { | ||
srcFile: 'rsvp.js', | ||
destFile: 'rsvp.min.js' | ||
}), { | ||
mangle: true, | ||
compress: true | ||
})); | ||
} | ||
var dist = rsvp; | ||
|
||
var distTree = mergeTrees(trees.concat('config')); | ||
var distTrees = []; | ||
env('production', function() { | ||
dist = merge([ | ||
rename(uglify(dist), '.js', '.min.js'), | ||
dist | ||
]); | ||
}); | ||
|
||
distTrees.push(concat(distTree, { | ||
inputFiles: [ | ||
'versionTemplate.txt', | ||
'rsvp.js' | ||
], | ||
outputFile: '/rsvp.js' | ||
})); | ||
function prependLicense(content) { | ||
var version = JSON.parse(fs.readFileSync('./package.json')).version; | ||
var license = fs.readFileSync('./config/versionTemplate.txt').toString().replace(/VERSION_PLACEHOLDER_STRING/, version); | ||
|
||
if (process.env.EMBER_ENV === 'production') { | ||
distTrees.push(concat(distTree, { | ||
inputFiles: [ | ||
'versionTemplate.txt', | ||
'rsvp.min.js' | ||
], | ||
outputFile: '/rsvp.min.js' | ||
})); | ||
return license + '\n' + content; | ||
} | ||
|
||
if (env !== 'development') { | ||
distTrees = distTrees.map(es3Recast); | ||
} | ||
// exclude source maps for now, until map/cat supports source maps | ||
dist = find(dist, '!*.map'); | ||
|
||
module.exports = replace(mergeTrees(distTrees), { | ||
files: [ | ||
'rsvp.js', | ||
'rsvp.min.js' | ||
], | ||
pattern: { | ||
match: /VERSION_PLACEHOLDER_STRING/g, | ||
replacement: calculateVersion(10) | ||
} | ||
}); | ||
module.exports = merge([ | ||
map(dist, prependLicense), | ||
testFiles, | ||
testVendor, | ||
mv(rsvp, 'test'), | ||
mv(testBundle, 'test') | ||
]); |
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 |
---|---|---|
|
@@ -18,5 +18,8 @@ | |
"tests", | ||
"vendor", | ||
"tasks" | ||
] | ||
], | ||
"devDependencies": { | ||
"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
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
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 @@ | ||
require('./test-adapter.js'); | ||
require('./extension-test.js'); | ||
require('promises-aplus-tests-phantom/lib/testFiles'); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,16 @@ | ||
/*global RSVP*/ | ||
|
||
var assert = require('assert'); | ||
var g = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this; | ||
|
||
var RSVP = require('../dist/rsvp'); | ||
var RSVP = g.RSVP || require('./rsvp.js'); | ||
var defer = RSVP.defer; | ||
var resolve = RSVP.resolve; | ||
var reject = RSVP.reject; | ||
|
||
var g = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this; | ||
|
||
module.exports = g.adapter = { | ||
resolved: resolve, | ||
rejected: reject, | ||
deferred: defer, | ||
RSVP: RSVP | ||
}; | ||
|
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{ | ||
"test_page": "test/index.html", | ||
"parallel": 5, | ||
"before_tests": "npm run build-all", | ||
"framework": "mocha", | ||
"before_tests": "npm run build", | ||
"launchers": { | ||
"Mocha": { | ||
"command": "./node_modules/.bin/mocha test/main.js" | ||
"command": "./node_modules/.bin/mocha dist/test/browserify.js" | ||
} | ||
}, | ||
"launch_in_ci": ["PhantomJS", "Mocha"] | ||
"launch_in_ci": [ | ||
"PhantomJS", | ||
"Mocha" | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never going to get called. See stefanpenner/broccoli-stew#6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed