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,41 +10,19 @@ exports._replaceWith = _replaceWith;
exports.replaceExpressionWithStatements = replaceExpressionWithStatements;
exports.replaceInline = replaceInline;
function _codeFrame() {
const data = require("@babel/code-frame");
_codeFrame = function () {
return data;
};
return data;
}
var _codeFrame = require("@babel/code-frame");
var _index = _interopRequireDefault(require("../index"));
var _index2 = _interopRequireDefault(require("./index"));
function _parser() {
const data = require("@babel/parser");
var _parser = require("@babel/parser");
_parser = function () {
return data;
};
var t = _interopRequireWildcard(require("@babel/types"));
return data;
}
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -67,7 +45,7 @@ const hoistVariablesVisitor = {
for (const declar of path.node.declarations) {
if (declar.init) {
exprs.push(t().expressionStatement(t().assignmentExpression("=", declar.id, declar.init)));
exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init)));
}
}
@@ -79,8 +57,8 @@ const hoistVariablesVisitor = {
function replaceWithMultiple(nodes) {
this.resync();
nodes = this._verifyNodeList(nodes);
t().inheritLeadingComments(nodes[0], this.node);
t().inheritTrailingComments(nodes[nodes.length - 1], this.node);
t.inheritLeadingComments(nodes[0], this.node);
t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
this.node = this.container[this.key] = null;
const paths = this.insertAfter(nodes);
@@ -98,12 +76,12 @@ function replaceWithSourceString(replacement) {
try {
replacement = `(${replacement})`;
replacement = (0, _parser().parse)(replacement);
replacement = (0, _parser.parse)(replacement);
} catch (err) {
const loc = err.loc;
if (loc) {
err.message += " - make sure this is an expression.\n" + (0, _codeFrame().codeFrameColumns)(replacement, {
err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, {
start: {
line: loc.line,
column: loc.column + 1
@@ -141,7 +119,7 @@ function replaceWith(replacement) {
return [this];
}
if (this.isProgram() && !t().isProgram(replacement)) {
if (this.isProgram() && !t.isProgram(replacement)) {
throw new Error("You can only replace a Program root node with another Program node");
}
@@ -155,14 +133,14 @@ function replaceWith(replacement) {
let nodePath = "";
if (this.isNodeType("Statement") && t().isExpression(replacement)) {
if (this.isNodeType("Statement") && t.isExpression(replacement)) {
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
replacement = t().expressionStatement(replacement);
replacement = t.expressionStatement(replacement);
nodePath = "expression";
}
}
if (this.isNodeType("Expression") && t().isStatement(replacement)) {
if (this.isNodeType("Expression") && t.isStatement(replacement)) {
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
return this.replaceExpressionWithStatements([replacement]);
}
@@ -171,8 +149,8 @@ function replaceWith(replacement) {
const oldNode = this.node;
if (oldNode) {
t().inheritsComments(replacement, oldNode);
t().removeComments(oldNode);
t.inheritsComments(replacement, oldNode);
t.removeComments(oldNode);
}
this._replaceWith(replacement);
@@ -189,9 +167,9 @@ function _replaceWith(node) {
}
if (this.inList) {
t().validate(this.parent, this.key, [node]);
t.validate(this.parent, this.key, [node]);
} else {
t().validate(this.parent, this.key, node);
t.validate(this.parent, this.key, node);
}
this.debug(`Replace with ${node && node.type}`);
@@ -200,7 +178,7 @@ function _replaceWith(node) {
function replaceExpressionWithStatements(nodes) {
this.resync();
const toSequenceExpression = t().toSequenceExpression(nodes, this.scope);
const toSequenceExpression = t.toSequenceExpression(nodes, this.scope);
if (toSequenceExpression) {
return this.replaceWith(toSequenceExpression)[0].get("expressions");
@@ -208,8 +186,8 @@ function replaceExpressionWithStatements(nodes) {
const functionParent = this.getFunctionParent();
const isParentAsync = functionParent && functionParent.is("async");
const container = t().arrowFunctionExpression([], t().blockStatement(nodes));
this.replaceWith(t().callExpression(container, []));
const container = t.arrowFunctionExpression([], t.blockStatement(nodes));
this.replaceWith(t.callExpression(container, []));
this.traverse(hoistVariablesVisitor);
const completionRecords = this.get("callee").getCompletionRecords();
@@ -223,24 +201,24 @@ function replaceExpressionWithStatements(nodes) {
if (!uid) {
const callee = this.get("callee");
uid = callee.scope.generateDeclaredUidIdentifier("ret");
callee.get("body").pushContainer("body", t().returnStatement(t().cloneNode(uid)));
callee.get("body").pushContainer("body", t.returnStatement(t.cloneNode(uid)));
loop.setData("expressionReplacementReturnUid", uid);
} else {
uid = t().identifier(uid.name);
uid = t.identifier(uid.name);
}
path.get("expression").replaceWith(t().assignmentExpression("=", t().cloneNode(uid), path.node.expression));
path.get("expression").replaceWith(t.assignmentExpression("=", t.cloneNode(uid), path.node.expression));
} else {
path.replaceWith(t().returnStatement(path.node.expression));
path.replaceWith(t.returnStatement(path.node.expression));
}
}
const callee = this.get("callee");
callee.arrowFunctionToExpression();
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) {
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t.FUNCTION_TYPES)) {
callee.set("async", true);
this.replaceWith(t().awaitExpression(this.node));
this.replaceWith(t.awaitExpression(this.node));
}
return callee.get("body.body");