Socket
Socket
Sign inDemoInstall

traceur

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

traceur - npm Package Compare versions

Comparing version 0.0.78 to 0.0.79

8

package.json
{
"name": "traceur",
"version": "0.0.78",
"version": "0.0.79",
"description": "ES6 to ES5 compiler",

@@ -43,4 +43,3 @@ "keywords": [

"commander": "2.x",
"glob": "4.x",
"regexpu": "0.3.0",
"glob": "4.3",
"rsvp": "^3.0.13",

@@ -57,5 +56,6 @@ "semver": "2.x",

"node-uuid": "1.x",
"regexpu": "0.3.0",
"requirejs": "2.x",
"semver": "2.x",
"traceur": "0.0.76",
"traceur": "0.0.78",
"promises-aplus-tests": "2.x"

@@ -62,0 +62,0 @@ },

@@ -18,2 +18,3 @@ // Copyright 2013 Traceur Authors.

var path = require('path');
var glob = require('glob');
var commandLine;

@@ -132,19 +133,66 @@ var cmdName = path.basename(process.argv[1]);

var dir = commandLine.dir;
function compileAll(out, sources, options) {
var isSingleFileCompile = /\.js$/.test(out);
if (!isSingleFileCompile) {
traceurAPI.forEachRecursiveModuleCompile(out, sources, options);
} else {
traceurAPI.recursiveModuleCompileToSingleFile(out, sources, options).then(function() {
process.exit(0);
}).catch(function(err) {
var errors = err.errors || [err];
errors.forEach(function(err) {
console.error(err.stack || err);
});
process.exit(1);
});
}
}
function globSources(sourcesToGlob, cb) {
var processedCount = 0;
var globbedSources = [];
sourcesToGlob.forEach(function(item) {
glob(item.name, {}, function(err, matches) {
if (err)
throw new Error('While scanning ' + item.name + ': ' + err);
for (var i = matches.length - 1; i >= 0; i--) {
var globbedSource = {
name: matches[i],
type: item.type,
format: item.format
};
globbedSources.push(globbedSource);
}
processedCount++;
if (processedCount === sourcesToGlob.length) {
cb(null, globbedSources);
}
});
});
}
if (!shouldExit) {
if (out) {
var isSingleFileCompile = /\.js$/.test(out);
if (isSingleFileCompile) {
traceurAPI.recursiveModuleCompileToSingleFile(out, rootSources,
commandOptions).then(function() {
var sourcesToGlob = [];
var processedSources = [];
for (var i = 0; i < rootSources.length; i++) {
if (glob.hasMagic(rootSources[i].name)) {
sourcesToGlob.push(rootSources[i]);
} else {
processedSources.push(rootSources[i]);
}
}
if (!sourcesToGlob.length) {
compileAll(out, processedSources, commandOptions);
} else {
globSources(sourcesToGlob, function(err, globbedSources) {
processedSources.push.apply(processedSources, globbedSources);
if (processedSources.length) {
compileAll(out, processedSources, commandOptions);
} else {
process.exit(0);
}).catch(function(err) {
var errors = err.errors || [err];
errors.forEach(function(err) {
console.error(err.stack || err);
});
process.exit(1);
});
} else {
traceurAPI.forEachRecursiveModuleCompile(out, rootSources,
commandOptions);
}
});
}

@@ -151,0 +199,0 @@ } else if (dir) {

@@ -28,5 +28,9 @@ // Copyright 2012 Traceur Authors.

function revertCwd() {
process.chdir(cwd);
}
function recursiveModuleCompileToSingleFile(outputFile, includes, options) {
return new Promise(function (resolve, reject) {
return new Promise(function(resolve, reject) {
var resolvedOutputFile = path.resolve(outputFile);

@@ -54,5 +58,8 @@ var outputDir = path.dirname(resolvedOutputFile);

compiler.writeTreeToFile(tree, resolvedOutputFile);
process.chdir(cwd);
revertCwd();
resolve();
}, reject);
}, function() {
revertCwd();
reject.apply(null, arguments);
});
});

@@ -59,0 +66,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc