Skip to content

Commit 15c0222

Browse files
author
benholloway
committed
changed how traceur runtime is included to fix problems with cli
1 parent 1419baf commit 15c0222

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

bin/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/local/bin/node
22

3-
'use strict'
3+
'use strict';
44

55
var gulp = require('gulp');
66
var gutil = require('gulp-util');
@@ -22,4 +22,5 @@ gulp.on('task_stop', function (e) {
2222
});
2323

2424
var taskName = process.argv[1];
25+
console.log(progress.argv);
2526
gulp.start(gulp.hasTask(taskName) ? taskName : 'default');

index.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,14 @@ function scssSrcStream(opts) {
9090
.pipe(semiflat(CSS_SRC));
9191
}
9292

93-
function bowerJsStream(opts) {
93+
function testDependencyStream(opts) {
9494
return bowerFiles(CONSOLE_WIDTH)
9595
.prepend(browserify.RUNTIME)
9696
.js(opts);
9797
}
9898

99-
function bowerJsCssStream(opts) {
99+
function bowerStream(opts) {
100100
return bowerFiles(CONSOLE_WIDTH)
101-
.prepend(browserify.RUNTIME)
102101
.all(opts);
103102
}
104103

@@ -120,8 +119,7 @@ function routes() {
120119
JS_LIB_LOCAL,
121120
CSS_SRC,
122121
CSS_BUILD,
123-
CSS_LIB_LOCAL,
124-
browserify.RUNTIME
122+
CSS_LIB_LOCAL
125123
].forEach(function(path) {
126124
result['/' + slash(path)] = path;
127125
});
@@ -171,8 +169,8 @@ gulp.task('reload', function() {
171169
gulp.task('js', function(done) {
172170
console.log(hr('-', CONSOLE_WIDTH, 'javascript'));
173171
runSequence(
174-
[ 'js:clean', 'js:init' ],
175-
'js:build',
172+
[ 'js:clean', 'js:init' ],
173+
[ 'js:build', 'js:runtime' ],
176174
done
177175
);
178176
});
@@ -216,7 +214,7 @@ gulp.task('js:unit', function() {
216214
.pipe(bundler.compile(preJasmine, bundler.es6ifyTransform).all('test/karma-main.js'))
217215
.pipe(gulp.dest(JS_BUILD))
218216
.pipe(karma({
219-
files: bowerJsStream({ dev: true }).list,
217+
files: testDependencyStream({ dev: true }).list,
220218
frameworks: [ 'jasmine' ],
221219
reporters: [ 'spec' ],
222220
browsers: [ 'Chrome' ],
@@ -231,6 +229,13 @@ gulp.task('js:build', function() {
231229
.pipe(gulp.dest(JS_BUILD));
232230
});
233231

232+
// copy the traceur runtime to the build directory
233+
// have previously tried to include with bower components gives too many problems
234+
gulp.task('js:runtime', function() {
235+
return gulp.src(browserify.RUNTIME)
236+
.pipe(gulp.dest(JS_BUILD));
237+
});
238+
234239
// CSS ---------------------------------
235240
gulp.task('css', function(done) {
236241
console.log(hr('-', CONSOLE_WIDTH, 'css'));
@@ -308,7 +313,7 @@ gulp.task('html:inject', function() {
308313
.pipe(plumber())
309314
.pipe(injectAdjacent('js', JS_BUILD))
310315
.pipe(injectAdjacent('css', CSS_BUILD))
311-
.pipe(inject(bowerJsCssStream({ read: false }), {
316+
.pipe(inject(bowerStream({ read: false }), {
312317
name: 'bower'
313318
}))
314319
.pipe(gulp.dest(HTML_BUILD));
@@ -344,7 +349,7 @@ gulp.task('release:adjacent', function() {
344349

345350
// copy bower main elements to versioned directories in release
346351
gulp.task('release:bower', function() {
347-
return bowerJsCssStream({ manifest: true })
352+
return bowerStream({ manifest: true })
348353
.pipe(wrap([
349354
'/* ' + hr('-', 114),
350355
' * <%= file.relative %>',

lib/build/browserify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,4 +409,4 @@ module.exports = function (bannerWidth) {
409409
* The relative path to the traceur runtime
410410
* @type {string}
411411
*/
412-
module.exports.RUNTIME = es6ify.runtime.replace(process.cwd(), '').slice(1);
412+
module.exports.RUNTIME = es6ify.runtime;

0 commit comments

Comments
 (0)