Framework updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-03-04 23:20:19 +00:00
parent a89daf3d43
commit 3ed8517b2a
891 changed files with 11126 additions and 9600 deletions

View File

@@ -14,7 +14,7 @@
*/
/**
* @typedef {Array<string>} ExtractedComments
* @typedef {string[]} ExtractedComments
*/
const notSettled = Symbol("not-settled");
@@ -86,7 +86,7 @@ async function terserMinify(input, sourceMap, minimizerOptions, extractComments)
};
/**
* @param {import("terser").MinifyOptions & { sourceMap: import("terser").SourceMapOptions | undefined } & ({ output: import("terser").FormatOptions & { beautify: boolean } } | { format: import("terser").FormatOptions & { beautify: boolean } })} terserOptions terser options
* @param {import("terser").MinifyOptions & { sourceMap: import("terser").SourceMapOptions | undefined } & ({ output: import("terser").FormatOptions & { beautify: boolean } } | { format: import("terser").FormatOptions & { beautify: boolean } })} terserOptions terser options
* @param {ExtractedComments} extractedComments extracted comments
* @returns {ExtractCommentsFunction} function to extract comments
*/
@@ -143,7 +143,7 @@ async function terserMinify(input, sourceMap, minimizerOptions, extractComments)
}
regexStr = /** @type {string} */condition[key];
condition[key] = /** @type {ExtractCommentsFunction} */
(astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value);
(astNode, comment) => new RegExp(/** @type {string} */regexStr).test(comment.value);
break;
default:
regex = /** @type {RegExp} */condition[key];
@@ -155,7 +155,7 @@ async function terserMinify(input, sourceMap, minimizerOptions, extractComments)
// Redefine the comments function to extract and preserve
// comments according to the two conditions
return (astNode, comment) => {
if ( /** @type {{ extract: ExtractCommentsFunction }} */
if (/** @type {{ extract: ExtractCommentsFunction }} */
condition.extract(astNode, comment)) {
const commentText = comment.type === "comment2" ? `/*${comment.value}*/` : `//${comment.value}`;
@@ -217,7 +217,7 @@ async function terserMinify(input, sourceMap, minimizerOptions, extractComments)
} = require("terser"));
} catch (err) {
return {
errors: [( /** @type {Error} */err)]
errors: [(/** @type {Error} */err)]
};
}
@@ -254,8 +254,8 @@ async function terserMinify(input, sourceMap, minimizerOptions, extractComments)
[filename]: code
}, terserOptions);
return {
code: ( /** @type {string} * */result.code),
map: result.map ? ( /** @type {RawSourceMap} * */result.map) : undefined,
code: (/** @type {string} * */result.code),
map: result.map ? (/** @type {RawSourceMap} * */result.map) : undefined,
extractedComments
};
}
@@ -300,7 +300,7 @@ async function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComment
};
/**
* @param {import("uglify-js").MinifyOptions & { sourceMap: boolean | import("uglify-js").SourceMapOptions | undefined } & { output: import("uglify-js").OutputOptions & { beautify: boolean }}} uglifyJsOptions uglify-js options
* @param {import("uglify-js").MinifyOptions & { sourceMap: boolean | import("uglify-js").SourceMapOptions | undefined } & { output: import("uglify-js").OutputOptions & { beautify: boolean } }} uglifyJsOptions uglify-js options
* @param {ExtractedComments} extractedComments extracted comments
* @returns {ExtractCommentsFunction} extract comments function
*/
@@ -350,7 +350,7 @@ async function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComment
}
regexStr = /** @type {string} */condition[key];
condition[key] = /** @type {ExtractCommentsFunction} */
(astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value);
(astNode, comment) => new RegExp(/** @type {string} */regexStr).test(comment.value);
break;
default:
regex = /** @type {RegExp} */condition[key];
@@ -362,7 +362,7 @@ async function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComment
// Redefine the comments function to extract and preserve
// comments according to the two conditions
return (astNode, comment) => {
if ( /** @type {{ extract: ExtractCommentsFunction }} */
if (/** @type {{ extract: ExtractCommentsFunction }} */
condition.extract(astNode, comment)) {
const commentText = comment.type === "comment2" ? `/*${comment.value}*/` : `//${comment.value}`;
@@ -377,7 +377,7 @@ async function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComment
/**
* @param {PredefinedOptions<import("uglify-js").MinifyOptions> & import("uglify-js").MinifyOptions=} uglifyJsOptions uglify-js options
* @returns {import("uglify-js").MinifyOptions & { sourceMap: boolean | import("uglify-js").SourceMapOptions | undefined } & { output: import("uglify-js").OutputOptions & { beautify: boolean }}} uglify-js options
* @returns {import("uglify-js").MinifyOptions & { sourceMap: boolean | import("uglify-js").SourceMapOptions | undefined } & { output: import("uglify-js").OutputOptions & { beautify: boolean } }} uglify-js options
*/
const buildUglifyJsOptions = (uglifyJsOptions = {}) => {
if (typeof uglifyJsOptions.ecma !== "undefined") {
@@ -422,7 +422,7 @@ async function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComment
} = require("uglify-js"));
} catch (err) {
return {
errors: [( /** @type {Error} */err)]
errors: [(/** @type {Error} */err)]
};
}
@@ -508,7 +508,7 @@ async function swcMinify(input, sourceMap, minimizerOptions) {
swc = require("@swc/core");
} catch (err) {
return {
errors: [( /** @type {Error} */err)]
errors: [(/** @type {Error} */err)]
};
}
@@ -596,7 +596,7 @@ async function esbuildMinify(input, sourceMap, minimizerOptions) {
esbuild = require("esbuild");
} catch (err) {
return {
errors: [( /** @type {Error} */err)]
errors: [(/** @type {Error} */err)]
};
}