v1.0 with SW PWA enabled

This commit is contained in:
Blomios
2026-01-01 17:40:53 +01:00
parent 1c0e22aac1
commit 3c8bebb2ad
29775 changed files with 2197201 additions and 119080 deletions

View File

@ -196,7 +196,7 @@ class Buffer {
position.column = 0;
last = i + 1;
if (last < len && line !== undefined) {
this._mark(++line, 0, null, null, filename);
this._mark(++line, 0, undefined, undefined, filename);
}
i = str.indexOf("\n", last);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -517,9 +517,7 @@ function ObjectTypeAnnotation(node) {
if (props.length) {
this.newline();
this.space();
this.printJoin(props, true, true, undefined, undefined, function addNewlines(leading) {
if (leading && !props[0]) return 1;
}, () => {
this.printJoin(props, true, true, undefined, undefined, () => {
if (props.length !== 1 || node.inexact) {
this.tokenChar(44);
this.space();

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ function _parameters(parameters, endToken) {
for (let i = 0; i < paramLength; i++) {
this._param(parameters[i]);
if (trailingComma || i < paramLength - 1) {
this.token(",", null, i);
this.token(",", undefined, i);
this.space();
}
}
@ -77,7 +77,7 @@ function _methodHead(node) {
if (node.optional) {
this.tokenChar(63);
}
this._params(node, node.computed && node.key.type !== "StringLiteral" ? undefined : node.key, undefined);
this._params(node, node.computed && node.key.type !== "StringLiteral" ? undefined : node.key);
}
function _predicate(node, noLineTerminatorAfter) {
if (node.predicate) {

File diff suppressed because one or more lines are too long

View File

@ -93,11 +93,11 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
return;
}
const occurrenceCount = hasPreviousBrace ? 1 : 0;
this.token("{", null, occurrenceCount);
this.token("{", undefined, occurrenceCount);
this.space();
this.printList(attributes || assertions, this.shouldPrintTrailingComma("}"));
this.space();
this.token("}", null, occurrenceCount);
this.token("}", undefined, occurrenceCount);
}
function ExportAllDeclaration(node) {
var _node$attributes, _node$assertions;

File diff suppressed because one or more lines are too long

View File

@ -203,9 +203,7 @@ function SwitchStatement(node) {
this.tokenChar(41);
this.space();
this.tokenChar(123);
this.printSequence(node.cases, true, undefined, function addNewlines(leading, cas) {
if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
});
this.printSequence(node.cases, true);
this.rightBrace(node);
}
function SwitchCase(node) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -354,7 +354,7 @@ function tsPrintUnionOrIntersectionType(printer, node, sep) {
}
printer.printJoin(node.types, undefined, undefined, function (i) {
this.space();
this.token(sep, null, i + hasLeadingToken);
this.token(sep, undefined, i + hasLeadingToken);
this.space();
});
}
@ -714,6 +714,7 @@ function printModifiersList(printer, node, modifiers) {
modifiersSet.delete(tok.value);
return modifiersSet.size === 0;
}
return false;
});
for (const modifier of modifiersSet) {
printer.word(modifier);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -90,7 +90,7 @@ function needsParens(node, parent, tokenContext, getRawIdentifier) {
if (isDecorator(parent)) {
return !isDecoratorMemberExpression(node) && !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) && !isParenthesizedExpression(node);
}
return (_expandedParens$get = expandedParens.get(node.type)) == null ? void 0 : _expandedParens$get(node, parent, tokenContext, getRawIdentifier);
return ((_expandedParens$get = expandedParens.get(node.type)) == null ? void 0 : _expandedParens$get(node, parent, tokenContext, getRawIdentifier)) || false;
}
function isDecoratorMemberExpression(node) {
switch (node.type) {

File diff suppressed because one or more lines are too long

View File

@ -102,7 +102,6 @@ function Binary(node, parent) {
return true;
}
}
return undefined;
}
function UnionTypeAnnotation(node, parent) {
const parentType = parent.type;

File diff suppressed because one or more lines are too long

View File

@ -69,6 +69,7 @@ const nodes = exports.nodes = {
if (state.hasCall && state.hasHelper || state.hasFunction) {
return state.hasFunction ? 1 | 2 : 2;
}
return 0;
},
SwitchCase(node, parent) {
return (!!node.consequent.length || parent.cases[0] === node ? 1 : 0) | (!node.consequent.length && parent.cases[parent.cases.length - 1] === node ? 2 : 0);
@ -77,21 +78,25 @@ const nodes = exports.nodes = {
if (isFunction(node.left) || isFunction(node.right)) {
return 2;
}
return 0;
},
Literal(node) {
if (isStringLiteral(node) && node.value === "use strict") {
return 2;
}
return 0;
},
CallExpression(node) {
if (isFunction(node.callee) || isHelper(node)) {
return 1 | 2;
}
return 0;
},
OptionalCallExpression(node) {
if (isFunction(node.callee)) {
return 1 | 2;
}
return 0;
},
VariableDeclaration(node) {
for (let i = 0; i < node.declarations.length; i++) {
@ -105,35 +110,41 @@ const nodes = exports.nodes = {
return 1 | 2;
}
}
return 0;
},
IfStatement(node) {
if (isBlockStatement(node.consequent)) {
return 1 | 2;
}
return 0;
}
};
nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
if (parent.properties[0] === node) {
return 1;
}
return 0;
};
nodes.ObjectTypeCallProperty = function (node, parent) {
var _parent$properties;
if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) {
return 1;
}
return 0;
};
nodes.ObjectTypeIndexer = function (node, parent) {
var _parent$properties2, _parent$callPropertie;
if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) {
return 1;
}
return 0;
};
nodes.ObjectTypeInternalSlot = function (node, parent) {
var _parent$properties3, _parent$callPropertie2, _parent$indexers;
if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) {
return 1;
}
return 0;
};
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
[type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ const {
needsParens
} = n;
class Printer {
constructor(format, map, tokens, originalCode) {
constructor(format, map, tokens = null, originalCode = null) {
this.tokenContext = _index.TokenContext.normal;
this._tokens = null;
this._originalCode = null;
@ -56,7 +56,7 @@ class Printer {
this._tokens = tokens;
this._originalCode = originalCode;
this._indentRepeat = format.indent.style.length;
this._inputMap = map == null ? void 0 : map._inputMap;
this._inputMap = (map == null ? void 0 : map._inputMap) || null;
this._buf = new _buffer.default(map, format.indent.style[0]);
}
enterForStatementInit() {
@ -351,7 +351,7 @@ class Printer {
this._noLineTerminator = true;
this.print(node);
}
print(node, noLineTerminatorAfter, trailingCommentsLineOffset) {
print(node, noLineTerminatorAfter = false, trailingCommentsLineOffset) {
var _node$extra, _node$leadingComments, _node$leadingComments2;
if (!node) return;
this._endsWithInnerRaw = false;
@ -399,7 +399,7 @@ class Printer {
let oldNoLineTerminatorAfterNode;
let oldTokenContext;
if (!shouldPrintParens) {
noLineTerminatorAfter || (noLineTerminatorAfter = parent && this._noLineTerminatorAfterNode === parent && n.isLastChild(parent, node));
noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && n.isLastChild(parent, node));
if (noLineTerminatorAfter) {
var _node$trailingComment;
if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) {
@ -480,7 +480,7 @@ class Printer {
return extra.raw;
}
}
printJoin(nodes, statement, indent, separator, printTrailingSeparator, addNewlines, iterator, trailingCommentsLineOffset) {
printJoin(nodes, statement, indent, separator, printTrailingSeparator, iterator, trailingCommentsLineOffset) {
if (!(nodes != null && nodes.length)) return;
if (indent == null && this.format.retainLines) {
var _nodes$0$loc;
@ -491,7 +491,6 @@ class Printer {
}
if (indent) this.indent();
const newlineOpts = {
addNewlines: addNewlines,
nextNodeStartLine: 0
};
const boundSeparator = separator == null ? void 0 : separator.bind(this);
@ -577,11 +576,11 @@ class Printer {
noIndentInnerCommentsHere() {
this._indentInnerComments = false;
}
printSequence(nodes, indent, trailingCommentsLineOffset, addNewlines) {
this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, addNewlines, undefined, trailingCommentsLineOffset);
printSequence(nodes, indent, trailingCommentsLineOffset) {
this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, undefined, trailingCommentsLineOffset);
}
printList(items, printTrailingSeparator, statement, indent, separator, iterator) {
this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, undefined, iterator);
this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, iterator);
}
shouldPrintTrailingComma(listEnd) {
if (!this.tokenMap) return null;

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,7 @@ class SourceMap {
this._lastGenLine = 0;
this._lastSourceLine = 0;
this._lastSourceColumn = 0;
this._inputMap = void 0;
this._inputMap = null;
const map = this._map = new _genMapping.GenMapping({
sourceRoot: opts.sourceRoot
});
@ -56,7 +56,7 @@ class SourceMap {
if (this._inputMap) {
originalMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, {
line,
column
column: column
});
if (!originalMapping.name && identifierNamePos) {
const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
@ -66,6 +66,7 @@ class SourceMap {
}
} else {
originalMapping = {
name: null,
source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
line: line,
column: column

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,7 @@ class TokenMap {
const indexes = this._getTokensIndexesOfNode(node);
if (indexes.length > 0) this._nodesToTokenIndexes.set(node, indexes);
});
this._tokensCache = null;
this._tokensCache.clear();
}
has(node) {
return this._nodesToTokenIndexes.has(node);

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "@babel/generator",
"version": "7.28.3",
"version": "7.28.5",
"description": "Turns an AST into code.",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
@ -19,16 +19,16 @@
"lib"
],
"dependencies": {
"@babel/parser": "^7.28.3",
"@babel/types": "^7.28.2",
"@babel/parser": "^7.28.5",
"@babel/types": "^7.28.5",
"@jridgewell/gen-mapping": "^0.3.12",
"@jridgewell/trace-mapping": "^0.3.28",
"jsesc": "^3.0.2"
},
"devDependencies": {
"@babel/core": "^7.28.3",
"@babel/core": "^7.28.5",
"@babel/helper-fixtures": "^7.28.0",
"@babel/plugin-transform-typescript": "^7.28.0",
"@babel/plugin-transform-typescript": "^7.28.5",
"@jridgewell/sourcemap-codec": "^1.5.3",
"charcodes": "^0.2.0"
},