Fixed #1 - Fixed the whatsnew-** script for loading release notes into builds

Added test to ensure that release notes are parsed properly
Updated to latest dependencies to fix security vulnerability
Updated GH Actions Workflow to run test before updating tag
Updated README.md to reflect proper whatsnew documentation.
This commit is contained in:
Drew Heavner
2020-01-30 11:14:51 -05:00
parent b6496ac4e3
commit bdde081050
2660 changed files with 251487 additions and 213182 deletions

View File

@@ -10,15 +10,16 @@ var __assign = (this && this.__assign) || function () {
};
return __assign.apply(this, arguments);
};
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
return {
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
@@ -36,14 +37,12 @@ var __read = (this && this.__read) || function (o, n) {
}
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var buffer_from_1 = __importDefault(require("buffer-from"));
var bufferFrom = require("buffer-from");
var stableStringify = require("fast-json-stable-stringify");
var fs_1 = require("fs");
var memoize = require("lodash.memoize");
var mkdirp = require("mkdirp");
var path_1 = require("path");
var messages_1 = require("./util/messages");
@@ -112,30 +111,33 @@ function createCompiler(configs) {
_b.namespace = 'ts:serviceHost',
_b.call = null,
_b);
var serviceHostTraceCtx = __assign({}, serviceHostDebugCtx, (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
var serviceHostTraceCtx = __assign(__assign({}, serviceHostDebugCtx), (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
var serviceHost = {
getScriptFileNames: function () { return Object.keys(memoryCache.versions); },
getScriptVersion: function (fileName) {
var version = memoryCache.versions[fileName];
var normalizedFileName = path_1.normalize(fileName);
var version = memoryCache.versions[normalizedFileName];
return version === undefined ? undefined : String(version);
},
getScriptSnapshot: function (fileName) {
var hit = hasOwn.call(memoryCache.contents, fileName);
logger.trace({ fileName: fileName, cacheHit: hit }, "getScriptSnapshot():", 'cache', hit ? 'hit' : 'miss');
var normalizedFileName = path_1.normalize(fileName);
var hit = hasOwn.call(memoryCache.contents, normalizedFileName);
logger.trace({ normalizedFileName: normalizedFileName, cacheHit: hit }, "getScriptSnapshot():", 'cache', hit ? 'hit' : 'miss');
if (!hit) {
memoryCache.contents[fileName] = ts.sys.readFile(fileName);
memoryCache.contents[normalizedFileName] = ts.sys.readFile(normalizedFileName);
}
var contents = memoryCache.contents[fileName];
var contents = memoryCache.contents[normalizedFileName];
if (contents === undefined) {
return;
}
return ts.ScriptSnapshot.fromString(contents);
},
fileExists: ts.sys.fileExists,
readFile: logger.wrap(serviceHostTraceCtx, 'readFile', ts.sys.readFile),
readDirectory: ts.sys.readDirectory,
getDirectories: ts.sys.getDirectories,
directoryExists: ts.sys.directoryExists,
fileExists: memoize(ts.sys.fileExists),
readFile: logger.wrap(serviceHostTraceCtx, 'readFile', memoize(ts.sys.readFile)),
readDirectory: memoize(ts.sys.readDirectory),
getDirectories: memoize(ts.sys.getDirectories),
directoryExists: memoize(ts.sys.directoryExists),
realpath: memoize(ts.sys.realpath),
getNewLine: function () { return '\n'; },
getCurrentDirectory: function () { return cwd; },
getCompilationSettings: function () { return compilerOptions; },
@@ -213,7 +215,7 @@ function readThrough(cachedir, memoryCache, compile, getExtension, cwd, logger)
}
function updateOutput(outputText, fileName, sourceMap, getExtension, sourceRoot) {
var base = path_1.basename(fileName);
var base64Map = buffer_from_1.default(updateSourceMap(sourceMap, fileName, sourceRoot), 'utf8').toString('base64');
var base64Map = bufferFrom(updateSourceMap(sourceMap, fileName, sourceRoot), 'utf8').toString('base64');
var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
var sourceMapLength = (base + ".map").length + (getExtension(fileName).length - path_1.extname(fileName).length);
return outputText.slice(0, -sourceMapLength) + sourceMapContent;
@@ -226,7 +228,7 @@ function updateSourceMap(sourceMapText, fileName, _sourceRoot) {
return stableStringify(sourceMap);
}
function getCacheName(sourceCode, fileName) {
return sha1_1.sha1(path_1.extname(fileName), '\x00', sourceCode);
return sha1_1.sha1(fileName, '\x00', sourceCode);
}
function isValidCacheContent(contents) {
return /(?:9|0=|Q==)$/.test(contents.slice(-3));