Skip to content

Commit

Permalink
Add version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
richgilbank committed Mar 7, 2015
1 parent 9f73130 commit 339380d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion panel/scripts/transformers/babel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Babel() {
Transformer.call(this);

this.name = 'Babel';
this.name = 'Babel (' + this.getVersion() + ')';
this.handle = 'babel';
this.runtimePath = 'node_modules/babel/browser-polyfill.js';
this.opts = {
Expand All @@ -17,4 +17,8 @@ Babel.prototype.transform = function(input) {
return babel.transform(input, this.opts).code;
}

Babel.prototype.getVersion = function() {
return babel.version;
}

var babelTransformer = new Babel();
6 changes: 5 additions & 1 deletion panel/scripts/transformers/coffee.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Coffee() {
Transformer.call(this);

this.name = 'CoffeeScript';
this.name = 'CoffeeScript (' + this.getVersion() + ')';
this.handle = 'coffee-script';
this.opts = {
bare: true
Expand All @@ -16,4 +16,8 @@ Coffee.prototype.transform = function(input) {
return CoffeeScript.compile(input, this.opts);
}

Coffee.prototype.getVersion = function() {
return CoffeeScript.VERSION;
}

var coffeeTransformer = new Coffee();
7 changes: 6 additions & 1 deletion panel/scripts/transformers/traceur.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Traceur() {
Transformer.call(this);

this.name = 'Traceur';
this.name = 'Traceur (' + this.getVersion() + ')';
this.handle = 'traceur';
this.runtimePath = 'node_modules/traceur/bin/traceur-runtime.js';
}
Expand All @@ -18,4 +18,9 @@ Traceur.prototype.transform = function(input) {
return traceur.Compiler.script(input);
}

Traceur.prototype.getVersion = function() {
var loader = new traceur.runtime.TraceurLoader();
return loader.version.split('@')[1];
}

var traceurTransformer = new Traceur();

0 comments on commit 339380d

Please sign in to comment.