Skip to content
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

Get rid of ANSI escaping #137

Merged
merged 1 commit into from
Mar 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var io = require("socket.io-client");
var stripAnsi = require('strip-ansi');
var scriptElements = document.getElementsByTagName("script");
io = io.connect(typeof __resourceQuery === "string" && __resourceQuery ?
__resourceQuery.substr(1) :
@@ -38,15 +39,15 @@ io.on("warnings", function(warnings) {
io.on("errors", function(errors) {
console.log("[WDS] Errors while compiling.");
for(var i = 0; i < errors.length; i++)
console.error(errors[i]);
console.error(stripAnsi(errors[i]));
if(initial) return initial = false;
reloadApp();
});

io.on("proxy-error", function(errors) {
console.log("[WDS] Proxy error.");
for(var i = 0; i < errors.length; i++)
console.error(errors[i]);
console.error(stripAnsi(errors[i]));
if(initial) return initial = false;
reloadApp();
});
5 changes: 3 additions & 2 deletions client/live.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var $ = require("jquery");
var io = require("socket.io-client");
var stripAnsi = require('strip-ansi');
require("./style.css");

$(function() {
@@ -50,15 +51,15 @@ $(function() {
io.on("errors", function(errors) {
status.text("App updated with errors. No reload!");
okness.text("Errors while compiling.");
$errors.text("\n" + errors.join("\n\n\n") + "\n\n");
$errors.text("\n" + stripAnsi(errors.join("\n\n\n")) + "\n\n");
header.css({borderColor: "#ebcb8b"});
$errors.show(); iframe.hide();
});

io.on("proxy-error", function(errors) {
status.text("Could not proxy to content base target!");
okness.text("Proxy error.");
$errors.text("\n" + errors.join("\n\n\n") + "\n\n");
$errors.text("\n" + stripAnsi(errors.join("\n\n\n")) + "\n\n");
header.css({borderColor: "#ebcb8b"});
$errors.show(); iframe.hide();
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@
"stream-cache": "~0.0.1",
"http-proxy": "^1.1.4",
"serve-index": "^1.2.0",
"connect-history-api-fallback": "0.0.5"
"connect-history-api-fallback": "0.0.5",
"strip-ansi": "^2.0.1",
},
"devDependencies": {
"css-loader": "~0.7.1",