Merge branch 'main' into joh/voluminous-lobster

This commit is contained in:
Johannes
2022-06-09 16:47:09 +02:00
24 changed files with 445 additions and 120 deletions
+5 -12
View File
@@ -9,7 +9,6 @@ const fs_1 = require("fs");
const path = require("path");
const crypto = require("crypto");
const utils = require("./utils");
const log = require("fancy-log");
const colors = require("ansi-colors");
const ts = require("typescript");
const Vinyl = require("vinyl");
@@ -23,11 +22,7 @@ function normalize(path) {
return path.replace(/\\/g, '/');
}
function createTypeScriptBuilder(config, projectFile, cmd) {
function _log(topic, message) {
if (config.verbose) {
log(colors.cyan(topic), message);
}
}
const _log = config.logFn;
const host = new LanguageServiceHost(cmd, projectFile, _log);
const service = ts.createLanguageService(host, ts.createDocumentRegistry());
const lastBuildVersion = Object.create(null);
@@ -290,12 +285,10 @@ function createTypeScriptBuilder(config, projectFile, cmd) {
});
oldErrors = newErrors;
// print stats
if (config.verbose) {
const headNow = process.memoryUsage().heapUsed;
const MB = 1024 * 1024;
log('[tsb]', 'time:', colors.yellow((Date.now() - t1) + 'ms'), 'mem:', colors.cyan(Math.ceil(headNow / MB) + 'MB'), colors.bgCyan('delta: ' + Math.ceil((headNow - headUsed) / MB)));
headUsed = headNow;
}
const headNow = process.memoryUsage().heapUsed;
const MB = 1024 * 1024;
_log('[tsb]', `time: ${colors.yellow((Date.now() - t1) + 'ms')} + \nmem: ${colors.cyan(Math.ceil(headNow / MB) + 'MB')} ${colors.bgCyan('delta: ' + Math.ceil((headNow - headUsed) / MB))}`);
headUsed = headNow;
});
}
return {