rename to babel

This commit is contained in:
Sebastian McKenzie
2015-02-15 18:09:05 +11:00
parent e05aed0394
commit 1d34d03ac8
253 changed files with 1279 additions and 1248 deletions

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env node
var runtime = require("../lib/6to5/build-runtime");
console.log(runtime());

View File

@@ -2,14 +2,14 @@
var commander = require("commander");
var Module = require("module");
var babel = require("../lib/babel/api/node");
var path = require("path");
var repl = require("repl");
var to5 = require("../lib/6to5/api/node");
var util = require("../lib/6to5/util");
var util = require("../lib/babel/util");
var vm = require("vm");
var _ = require("lodash");
var program = new commander.Command("6to5-node");
var program = new commander.Command("babel-node");
program.option("-e, --eval [script]", "Evaluate script");
program.option("-p, --print [code]", "Evaluate script and print result");
@@ -28,7 +28,7 @@ program.parse(process.argv);
//
to5.register({
babel.register({
experimental: program.experimental,
extensions: program.extensions,
playground: program.playground,
@@ -41,7 +41,7 @@ to5.register({
//
var _eval = function (code, filename) {
code = to5.transform(code, {
code = babel.transform(code, {
filename: filename,
blacklist: ["useStrict"].concat(program.blacklist || []),
whitelist: program.whitelist,
@@ -60,7 +60,7 @@ if (program.eval || program.print) {
if (program.print) console.log(result);
} else {
if (program.args.length) {
// slice all arguments up to the first filename since they're 6to5 args that we handle
// slice all arguments up to the first filename since they're babel args that we handle
var args = process.argv.slice(2);
var i = 0;

4
bin/babel-external-helpers Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
var runtime = require("../lib/babel/build-external-helpers");
console.log(runtime());

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env node
var opts = require("./6to5").opts;
var opts = require("./babel").opts;
opts.optional = (opts.optional || []).concat("minification");
opts.format = {
compact: true

View File

@@ -2,10 +2,10 @@
/**
* This tiny wrapper file checks for known node flags and appends them
* when found, before invoking the "real" _6to5-node(1) executable.
* when found, before invoking the "real" _babel-node(1) executable.
*/
var args = [__dirname + "/_6to5-node"];
var args = [__dirname + "/_babel-node"];
process.argv.slice(2).forEach(function(arg){
var flag = arg.split("=")[0];

View File

@@ -1,6 +1,6 @@
var sourceMap = require("source-map");
var chokidar = require("chokidar");
var util2 = require("../../lib/6to5/util");
var util2 = require("../../lib/babel/util");
var path = require("path");
var util = require("./util");
var fs = require("fs");

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env node
var commander = require("commander");
var transform = require("../../lib/6to5/transformation");
var util = require("../../lib/6to5/util");
var transform = require("../../lib/babel/transformation");
var util = require("../../lib/babel/util");
var fs = require("fs");
var each = require("lodash/collection/each");
var keys = require("lodash/object/keys");
@@ -11,7 +11,7 @@ commander.option("-t, --source-maps-inline", "Append sourceMappingURL comment to
commander.option("-s, --source-maps", "Save source map alongside the compiled code");
commander.option("-f, --filename [filename]", "Filename to use when reading from stdin - this will be used in source-maps, errors etc [stdin]", "stdin");
commander.option("-w, --watch", "Recompile files on changes");
commander.option("-r, --runtime", "Replace 6to5 declarations with references to a runtime");
commander.option("-r, --runtime", "Replace babel helpers with references to a runtime");
commander.option("-e, --experimental", "Enable experimental support for proposed ES7 features");
commander.option("-p, --playground", "Enable playground support");
@@ -117,7 +117,7 @@ exports.opts = {
};
setTimeout(function () {
// this is just a hack to give `6to5-minify` and other files including this
// this is just a hack to give `babel-minify` and other files including this
// time to modify `exports.opts`
var fn;

View File

@@ -1,8 +1,8 @@
var readdir = require("fs-readdir-recursive");
var index = require("./index");
var util = require("../../lib/6to5/util");
var babel = require("../../lib/babel/api/node");
var util = require("../../lib/babel/util");
var path = require("path");
var to5 = require("../../lib/6to5/api/node");
var fs = require("fs");
var _ = require("lodash");
@@ -26,7 +26,7 @@ exports.transform = function (filename, code, opts) {
var result;
try {
result = to5.transform(code, opts);
result = babel.transform(code, opts);
} catch (e) {
if (e instanceof SyntaxError) {
console.error("SyntaxError:", e.message);

3
bin/deprecated/6to5 Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
console.error("`6to5` has been renamed to `babel`");
require("../babel");

3
bin/deprecated/6to5-minify Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
console.error("`6to5-minify` has been renamed to `babel-minify`");
require("../babel-minify");

3
bin/deprecated/6to5-node Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
console.error("`6to5-node` has been renamed to `babel-node`");
require("../_babel-node");

3
bin/deprecated/6to5-runtime Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
console.error("`6to5-runtime` has been renamed to `babel-external-helpers`");
require("../babel-external-helpers");