Update distributables

This commit is contained in:
James M. Greene
2022-09-16 22:41:27 -05:00
parent a07391ec25
commit 4a12ff50fb
2 changed files with 77 additions and 62 deletions

137
dist/index.js vendored
View File

@@ -2836,10 +2836,10 @@ module.exports = {
var defaultOptions = { var defaultOptions = {
// `ecmaVersion` indicates the ECMAScript version to parse. Must be // `ecmaVersion` indicates the ECMAScript version to parse. Must be
// either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
// (2019), 11 (2020), 12 (2021), 13 (2022), or `"latest"` (the // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
// latest version the library supports). This influences support // (the latest version the library supports). This influences
// for strict mode, the set of reserved words, and support for // support for strict mode, the set of reserved words, and support
// new syntax features. // for new syntax features.
ecmaVersion: null, ecmaVersion: null,
// `sourceType` indicates the mode the code should be parsed in. // `sourceType` indicates the mode the code should be parsed in.
// Can be either `"script"` or `"module"`. This influences global // Can be either `"script"` or `"module"`. This influences global
@@ -2873,8 +2873,9 @@ module.exports = {
// When enabled, super identifiers are not constrained to // When enabled, super identifiers are not constrained to
// appearing in methods and do not raise an error when they appear elsewhere. // appearing in methods and do not raise an error when they appear elsewhere.
allowSuperOutsideMethod: null, allowSuperOutsideMethod: null,
// When enabled, hashbang directive in the beginning of file // When enabled, hashbang directive in the beginning of file is
// is allowed and treated as a line comment. // allowed and treated as a line comment. Enabled by default when
// `ecmaVersion` >= 2023.
allowHashBang: false, allowHashBang: false,
// When `locations` is on, `loc` properties holding objects with // When `locations` is on, `loc` properties holding objects with
// `start` and `end` properties in `{line, column}` form (with // `start` and `end` properties in `{line, column}` form (with
@@ -2949,6 +2950,9 @@ module.exports = {
if (options.allowReserved == null) if (options.allowReserved == null)
{ options.allowReserved = options.ecmaVersion < 5; } { options.allowReserved = options.ecmaVersion < 5; }
if (opts.allowHashBang == null)
{ options.allowHashBang = options.ecmaVersion >= 14; }
if (isArray(options.onToken)) { if (isArray(options.onToken)) {
var tokens = options.onToken; var tokens = options.onToken;
options.onToken = function (token) { return tokens.push(token); }; options.onToken = function (token) { return tokens.push(token); };
@@ -3279,7 +3283,7 @@ module.exports = {
if (refDestructuringErrors.trailingComma > -1) if (refDestructuringErrors.trailingComma > -1)
{ this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); }
}; };
pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
@@ -4375,6 +4379,7 @@ module.exports = {
}; };
pp$8.isDirectiveCandidate = function(statement) { pp$8.isDirectiveCandidate = function(statement) {
return ( return (
this.options.ecmaVersion >= 5 &&
statement.type === "ExpressionStatement" && statement.type === "ExpressionStatement" &&
statement.expression.type === "Literal" && statement.expression.type === "Literal" &&
typeof statement.expression.value === "string" && typeof statement.expression.value === "string" &&
@@ -4785,7 +4790,8 @@ module.exports = {
{ this.exprAllowed = type.beforeExpr; } { this.exprAllowed = type.beforeExpr; }
}; };
// Used to handle egde case when token context could not be inferred correctly in tokenize phase // Used to handle egde cases when token context could not be inferred correctly during tokenization phase
pp$6.overrideContext = function(tokenCtx) { pp$6.overrideContext = function(tokenCtx) {
if (this.curContext() !== tokenCtx) { if (this.curContext() !== tokenCtx) {
this.context[this.context.length - 1] = tokenCtx; this.context[this.context.length - 1] = tokenCtx;
@@ -5601,15 +5607,6 @@ module.exports = {
} }
return this.finishNode(prop, "RestElement") return this.finishNode(prop, "RestElement")
} }
// To disallow parenthesized identifier via `this.toAssignable()`.
if (this.type === types$1.parenL && refDestructuringErrors) {
if (refDestructuringErrors.parenthesizedAssign < 0) {
refDestructuringErrors.parenthesizedAssign = this.start;
}
if (refDestructuringErrors.parenthesizedBind < 0) {
refDestructuringErrors.parenthesizedBind = this.start;
}
}
// Parse argument. // Parse argument.
prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
// To disallow trailing comma via `this.toAssignable()`. // To disallow trailing comma via `this.toAssignable()`.
@@ -8039,7 +8036,7 @@ module.exports = {
// Acorn is a tiny, fast JavaScript parser written in JavaScript. // Acorn is a tiny, fast JavaScript parser written in JavaScript.
var version = "8.7.1"; var version = "8.8.0";
Parser.acorn = { Parser.acorn = {
Parser: Parser, Parser: Parser,
@@ -15189,21 +15186,17 @@ async function enablePagesSite({ repositoryNwo, githubToken }) {
} }
async function getPagesSite({ repositoryNwo, githubToken }) { async function getPagesSite({ repositoryNwo, githubToken }) {
try { const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
const response = await axios.get(pagesEndpoint, { const response = await axios.get(pagesEndpoint, {
headers: { headers: {
Accept: 'application/vnd.github.v3+json', Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}` Authorization: `Bearer ${githubToken}`
} }
}) })
const pageObject = response.data const pageObject = response.data
return pageObject return pageObject
} catch (error) {
throw error
}
} }
async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement = true }) { async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement = true }) {
@@ -15443,6 +15436,7 @@ class ConfigParser {
var depth = 0 var depth = 0
const properties = propertyName.split('.') const properties = propertyName.split('.')
var lastNode = configurationObject var lastNode = configurationObject
// eslint-disable-next-line no-constant-condition
while (true) { while (true) {
// Find the node for the current property // Find the node for the current property
var propertyNode = this.findProperty(lastNode, properties[depth]) var propertyNode = this.findProperty(lastNode, properties[depth])
@@ -15680,7 +15674,7 @@ function setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
} catch (error) { } catch (error) {
// Logging // Logging
core.warning( core.warning(
`We were unable to determine how to inject the site metadata into your config. Generated URLs may be incorrect. The base URL for this site should be ${path}. Please ensure your framework is configured to generate relative links appropriately.`, `We were unable to determine how to inject the site metadata into your config. Generated URLs may be incorrect. The base URL for this site should be ${siteUrl}. Please ensure your framework is configured to generate relative links appropriately.`,
error error
) )
} }
@@ -16509,14 +16503,15 @@ TokenTranslator.prototype = {
const SUPPORTED_VERSIONS = [ const SUPPORTED_VERSIONS = [
3, 3,
5, 5,
6, 6, // 2015
7, 7, // 2016
8, 8, // 2017
9, 9, // 2018
10, 10, // 2019
11, 11, // 2020
12, 12, // 2021
13 13, // 2022
14 // 2023
]; ];
/** /**
@@ -16634,12 +16629,23 @@ const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
* @param {int} end The index at which the comment ends. * @param {int} end The index at which the comment ends.
* @param {Location} startLoc The location at which the comment starts. * @param {Location} startLoc The location at which the comment starts.
* @param {Location} endLoc The location at which the comment ends. * @param {Location} endLoc The location at which the comment ends.
* @param {string} code The source code being parsed.
* @returns {Object} The comment object. * @returns {Object} The comment object.
* @private * @private
*/ */
function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) {
let type;
if (block) {
type = "Block";
} else if (code.slice(start, start + 2) === "#!") {
type = "Hashbang";
} else {
type = "Line";
}
const comment = { const comment = {
type: block ? "Block" : "Line", type,
value: text value: text
}; };
@@ -16684,6 +16690,25 @@ var espree = () => Parser => {
? new TokenTranslator(tokTypes, code) ? new TokenTranslator(tokTypes, code)
: null; : null;
/*
* Data that is unique to Espree and is not represented internally
* in Acorn.
*
* For ES2023 hashbangs, Espree will call `onComment()` during the
* constructor, so we must define state before having access to
* `this`.
*/
const state = {
originalSourceType: originalSourceType || options.sourceType,
tokens: tokenTranslator ? [] : null,
comments: options.comment === true ? [] : null,
impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5,
ecmaVersion: options.ecmaVersion,
jsxAttrValueToken: false,
lastToken: null,
templateElements: []
};
// Initialize acorn parser. // Initialize acorn parser.
super({ super({
@@ -16702,38 +16727,28 @@ var espree = () => Parser => {
if (tokenTranslator) { if (tokenTranslator) {
// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
tokenTranslator.onToken(token, this[STATE]); tokenTranslator.onToken(token, state);
} }
if (token.type !== tokTypes.eof) { if (token.type !== tokTypes.eof) {
this[STATE].lastToken = token; state.lastToken = token;
} }
}, },
// Collect comments // Collect comments
onComment: (block, text, start, end, startLoc, endLoc) => { onComment: (block, text, start, end, startLoc, endLoc) => {
if (this[STATE].comments) { if (state.comments) {
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);
this[STATE].comments.push(comment); state.comments.push(comment);
} }
} }
}, code); }, code);
/* /*
* Data that is unique to Espree and is not represented internally in * We put all of this data into a symbol property as a way to avoid
* Acorn. We put all of this data into a symbol property as a way to * potential naming conflicts with future versions of Acorn.
* avoid potential naming conflicts with future versions of Acorn.
*/ */
this[STATE] = { this[STATE] = state;
originalSourceType: originalSourceType || options.sourceType,
tokens: tokenTranslator ? [] : null,
comments: options.comment === true ? [] : null,
impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5,
ecmaVersion: this.options.ecmaVersion,
jsxAttrValueToken: false,
lastToken: null,
templateElements: []
};
} }
tokenize() { tokenize() {
@@ -16946,7 +16961,7 @@ var espree = () => Parser => {
}; };
}; };
const version$1 = "9.3.2"; const version$1 = "9.4.0";
/** /**
* @fileoverview Main Espree file that converts Acorn into Esprima output. * @fileoverview Main Espree file that converts Acorn into Esprima output.

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long