mirror of https://github.com/webpack/webpack.git
Compare commits
9 Commits
2be6c6e0fa
...
3da32d7100
Author | SHA1 | Date |
---|---|---|
|
3da32d7100 | |
|
fc945e88f7 | |
|
81a41850e0 | |
|
a570a65384 | |
|
d93b3eb1f1 | |
|
d45073a2b3 | |
|
568bb1d789 | |
|
11144e4eec | |
|
b6c781a0f1 |
|
@ -284,6 +284,7 @@
|
|||
"url's",
|
||||
"valign",
|
||||
"valtype",
|
||||
"walltime",
|
||||
"wasi",
|
||||
"wasm",
|
||||
"watchings",
|
||||
|
@ -304,7 +305,6 @@
|
|||
"commithash",
|
||||
"formaters",
|
||||
"akait",
|
||||
"Akait",
|
||||
"evenstensberg",
|
||||
"Stensberg",
|
||||
"ovflowd",
|
||||
|
@ -314,7 +314,8 @@
|
|||
"Kumar",
|
||||
"spacek",
|
||||
"thelarkinn",
|
||||
"behaviour"
|
||||
"behaviour",
|
||||
"WHATWG"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
"/Author.+/",
|
||||
|
|
|
@ -114,6 +114,7 @@ const {
|
|||
/** @typedef {import("./ModuleTypeConstants").ASSET_MODULE_TYPE_INLINE} ASSET_MODULE_TYPE_INLINE */
|
||||
/** @typedef {import("./ModuleTypeConstants").ASSET_MODULE_TYPE_RESOURCE} ASSET_MODULE_TYPE_RESOURCE */
|
||||
/** @typedef {import("./ModuleTypeConstants").ASSET_MODULE_TYPE_SOURCE} ASSET_MODULE_TYPE_SOURCE */
|
||||
/** @typedef {import("./ModuleTypeConstants").ASSET_MODULE_TYPE_BYTES} ASSET_MODULE_TYPE_BYTES */
|
||||
/** @typedef {import("./ModuleTypeConstants").WEBASSEMBLY_MODULE_TYPE_ASYNC} WEBASSEMBLY_MODULE_TYPE_ASYNC */
|
||||
/** @typedef {import("./ModuleTypeConstants").WEBASSEMBLY_MODULE_TYPE_SYNC} WEBASSEMBLY_MODULE_TYPE_SYNC */
|
||||
/** @typedef {import("./ModuleTypeConstants").CSS_MODULE_TYPE} CSS_MODULE_TYPE */
|
||||
|
@ -268,6 +269,76 @@ const ruleSetCompiler = new RuleSetCompiler([
|
|||
new UseEffectRulePlugin()
|
||||
]);
|
||||
|
||||
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
|
||||
/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
|
||||
/** @typedef {import("./javascript/JavascriptGenerator")} JavascriptGenerator */
|
||||
/** @typedef {import("../declarations/WebpackOptions").EmptyGeneratorOptions} EmptyGeneratorOptions */
|
||||
|
||||
/** @typedef {import("./json/JsonParser")} JsonParser */
|
||||
/** @typedef {import("../declarations/WebpackOptions").JsonParserOptions} JsonParserOptions */
|
||||
/** @typedef {import("./json/JsonGenerator")} JsonGenerator */
|
||||
/** @typedef {import("../declarations/WebpackOptions").JsonGeneratorOptions} JsonGeneratorOptions */
|
||||
|
||||
/** @typedef {import("./asset/AssetParser")} AssetParser */
|
||||
/** @typedef {import("./asset/AssetSourceParser")} AssetSourceParser */
|
||||
/** @typedef {import("./asset/AssetBytesParser")} AssetBytesParser */
|
||||
/** @typedef {import("../declarations/WebpackOptions").AssetParserOptions} AssetParserOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").EmptyParserOptions} EmptyParserOptions */
|
||||
/** @typedef {import("./asset/AssetGenerator")} AssetGenerator */
|
||||
/** @typedef {import("../declarations/WebpackOptions").AssetGeneratorOptions} AssetGeneratorOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").AssetInlineGeneratorOptions} AssetInlineGeneratorOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").AssetResourceGeneratorOptions} AssetResourceGeneratorOptions */
|
||||
/** @typedef {import("./asset/AssetSourceGenerator")} AssetSourceGenerator */
|
||||
/** @typedef {import("./asset/AssetBytesGenerator")} AssetBytesGenerator */
|
||||
|
||||
/** @typedef {import("./wasm-async/AsyncWebAssemblyParser")} AsyncWebAssemblyParser */
|
||||
/** @typedef {import("./wasm-sync/WebAssemblyParser")} WebAssemblyParser */
|
||||
|
||||
/** @typedef {import("./css/CssParser")} CssParser */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssParserOptions} CssParserOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssAutoParserOptions} CssAutoParserOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssGlobalParserOptions} CssGlobalParserOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssModuleParserOptions} CssModuleParserOptions */
|
||||
/** @typedef {import("./css/CssGenerator")} CssGenerator */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssGeneratorOptions} CssGeneratorOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssGlobalGeneratorOptions} CssGlobalGeneratorOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssModuleGeneratorOptions} CssModuleGeneratorOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssAutoGeneratorOptions} CssAutoGeneratorOptions */
|
||||
|
||||
/**
|
||||
* @typedef {[
|
||||
* [JAVASCRIPT_MODULE_TYPE_AUTO, JavascriptParser, JavascriptParserOptions, JavascriptGenerator, EmptyGeneratorOptions],
|
||||
* [JAVASCRIPT_MODULE_TYPE_DYNAMIC, JavascriptParser, JavascriptParserOptions, JavascriptGenerator, EmptyGeneratorOptions],
|
||||
* [JAVASCRIPT_MODULE_TYPE_ESM, JavascriptParser, JavascriptParserOptions, JavascriptGenerator, EmptyGeneratorOptions],
|
||||
* [JSON_MODULE_TYPE, JsonParser, JsonParserOptions, JsonGenerator, JsonGeneratorOptions],
|
||||
* [ASSET_MODULE_TYPE, AssetParser, AssetParserOptions, AssetGenerator, AssetGeneratorOptions],
|
||||
* [ASSET_MODULE_TYPE_INLINE, AssetParser, EmptyParserOptions, AssetGenerator, AssetGeneratorOptions],
|
||||
* [ASSET_MODULE_TYPE_RESOURCE, AssetParser, EmptyParserOptions, AssetGenerator, AssetGeneratorOptions],
|
||||
* [ASSET_MODULE_TYPE_SOURCE, AssetSourceParser, EmptyParserOptions, AssetSourceGenerator, EmptyGeneratorOptions],
|
||||
* [ASSET_MODULE_TYPE_BYTES, AssetBytesParser, EmptyParserOptions, AssetBytesGenerator, EmptyGeneratorOptions],
|
||||
* [WEBASSEMBLY_MODULE_TYPE_ASYNC, AsyncWebAssemblyParser, EmptyParserOptions, Generator, EmptyParserOptions],
|
||||
* [WEBASSEMBLY_MODULE_TYPE_SYNC, WebAssemblyParser, EmptyParserOptions, Generator, EmptyParserOptions],
|
||||
* [CSS_MODULE_TYPE, CssParser, CssParserOptions, CssGenerator, CssGeneratorOptions],
|
||||
* [CSS_MODULE_TYPE_AUTO, CssParser, CssAutoParserOptions, CssGenerator, CssAutoGeneratorOptions],
|
||||
* [CSS_MODULE_TYPE_MODULE, CssParser, CssModuleParserOptions, CssGenerator, CssModuleGeneratorOptions],
|
||||
* [CSS_MODULE_TYPE_GLOBAL, CssParser, CssGlobalParserOptions, CssGenerator, CssGlobalGeneratorOptions],
|
||||
* [string, Parser, ParserOptions, Generator, GeneratorOptions],
|
||||
* ]} ParsersAndGeneratorsByTypes
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {unknown[]} T
|
||||
* @template {number[]} I
|
||||
* @typedef {{ [K in keyof I]: K extends keyof I ? I[K] extends keyof T ? T[I[K]] : never : never }} ExtractTupleElements
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template {unknown[]} T
|
||||
* @template {number[]} A
|
||||
* @template [R=void]
|
||||
* @typedef {T extends [infer Head extends [string, ...unknown[]], ...infer Tail extends [string, ...unknown[]][]] ? Record<Head[0], SyncBailHook<ExtractTupleElements<Head, A>, R extends number ? Head[R] : R>> & RecordFactoryFromTuple<Tail, A, R> : unknown } RecordFactoryFromTuple
|
||||
*/
|
||||
|
||||
class NormalModuleFactory extends ModuleFactory {
|
||||
/**
|
||||
* @param {object} param params
|
||||
|
@ -306,15 +377,15 @@ class NormalModuleFactory extends ModuleFactory {
|
|||
createModule: new AsyncSeriesBailHook(["createData", "resolveData"]),
|
||||
/** @type {SyncWaterfallHook<[Module, CreateData, ResolveData]>} */
|
||||
module: new SyncWaterfallHook(["module", "createData", "resolveData"]),
|
||||
/** @type {HookMap<SyncBailHook<[ParserOptions], Parser | void>>} */
|
||||
/** @type {import("tapable").TypedHookMap<RecordFactoryFromTuple<ParsersAndGeneratorsByTypes, [2], 1>>} */
|
||||
createParser: new HookMap(() => new SyncBailHook(["parserOptions"])),
|
||||
/** @type {HookMap<SyncBailHook<[EXPECTED_ANY, ParserOptions], void>>} */
|
||||
/** @type {import("tapable").TypedHookMap<RecordFactoryFromTuple<ParsersAndGeneratorsByTypes, [1, 2]>>} */
|
||||
parser: new HookMap(() => new SyncHook(["parser", "parserOptions"])),
|
||||
/** @type {HookMap<SyncBailHook<[GeneratorOptions], Generator | void>>} */
|
||||
/** @type {import("tapable").TypedHookMap<RecordFactoryFromTuple<ParsersAndGeneratorsByTypes, [4], 3>>} */
|
||||
createGenerator: new HookMap(
|
||||
() => new SyncBailHook(["generatorOptions"])
|
||||
),
|
||||
/** @type {HookMap<SyncBailHook<[EXPECTED_ANY, GeneratorOptions], void>>} */
|
||||
/** @type {import("tapable").TypedHookMap<RecordFactoryFromTuple<ParsersAndGeneratorsByTypes, [3, 4]>>} */
|
||||
generator: new HookMap(
|
||||
() => new SyncHook(["generator", "generatorOptions"])
|
||||
),
|
||||
|
|
|
@ -15,59 +15,46 @@ const browserslist = require("browserslist");
|
|||
// [[C:]/path/to/config][:env]
|
||||
const inputRx = /^(?:((?:[A-Z]:)?[/\\].*?))?(?::(.+?))?$/i;
|
||||
|
||||
/**
|
||||
* @typedef {object} BrowserslistHandlerConfig
|
||||
* @property {string=} configPath
|
||||
* @property {string=} env
|
||||
* @property {string=} query
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string | null | undefined} input input string
|
||||
* @param {string} context the context directory
|
||||
* @returns {BrowserslistHandlerConfig} config
|
||||
*/
|
||||
const parse = (input, context) => {
|
||||
if (!input) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (path.isAbsolute(input)) {
|
||||
const [, configPath, env] = inputRx.exec(input) || [];
|
||||
return { configPath, env };
|
||||
}
|
||||
|
||||
const config = browserslist.findConfig(context);
|
||||
|
||||
if (config && Object.keys(config).includes(input)) {
|
||||
return { env: input };
|
||||
}
|
||||
|
||||
return { query: input };
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string | null | undefined} input input string
|
||||
* @param {string} context the context directory
|
||||
* @returns {string[] | undefined} selected browsers
|
||||
*/
|
||||
const load = (input, context) => {
|
||||
const { configPath, env, query } = parse(input, context);
|
||||
// browserslist:path-to-config
|
||||
// browserslist:path-to-config:env
|
||||
if (input && path.isAbsolute(input)) {
|
||||
const [, configPath, env] = inputRx.exec(input) || [];
|
||||
|
||||
// if a query is specified, then use it, else
|
||||
// if a path to a config is specified then load it, else
|
||||
// find a nearest config
|
||||
const config =
|
||||
query ||
|
||||
(configPath
|
||||
? browserslist.loadConfig({
|
||||
config: configPath,
|
||||
env
|
||||
})
|
||||
: browserslist.loadConfig({ path: context, env }));
|
||||
const config = browserslist.loadConfig({
|
||||
config: configPath,
|
||||
env
|
||||
});
|
||||
|
||||
if (!config) return;
|
||||
return browserslist(config);
|
||||
return browserslist(config, { env });
|
||||
}
|
||||
|
||||
const env = input || undefined;
|
||||
|
||||
const config = browserslist.loadConfig({
|
||||
path: context,
|
||||
env
|
||||
});
|
||||
|
||||
// browserslist
|
||||
// browserslist:env
|
||||
if (config) {
|
||||
try {
|
||||
return browserslist(config, { env, throwOnMissing: true });
|
||||
} catch (_err) {
|
||||
// Nothing, no `env` was found in browserslist, maybe input is `queries`
|
||||
}
|
||||
}
|
||||
|
||||
// browserslist:query
|
||||
if (env) {
|
||||
return browserslist(env);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -104,28 +91,6 @@ const resolve = (browsers) => {
|
|||
const anyBrowser = browsers.some((b) => /^(?!node)/.test(b));
|
||||
const browserProperty = !anyBrowser ? false : anyNode ? null : true;
|
||||
const nodeProperty = !anyNode ? false : anyBrowser ? null : true;
|
||||
// Internet Explorer Mobile, Blackberry browser and Opera Mini are very old browsers, they do not support new features
|
||||
const es6DynamicImport = rawChecker({
|
||||
/* eslint-disable camelcase */
|
||||
chrome: 63,
|
||||
and_chr: 63,
|
||||
edge: 79,
|
||||
firefox: 67,
|
||||
and_ff: 67,
|
||||
// ie: Not supported
|
||||
opera: 50,
|
||||
op_mob: 46,
|
||||
safari: [11, 1],
|
||||
ios_saf: [11, 3],
|
||||
samsung: [8, 2],
|
||||
android: 63,
|
||||
and_qq: [10, 4],
|
||||
baidu: [13, 18],
|
||||
and_uc: [15, 5],
|
||||
kaios: [3, 0],
|
||||
node: [12, 17]
|
||||
/* eslint-enable camelcase */
|
||||
});
|
||||
|
||||
return {
|
||||
/* eslint-disable camelcase */
|
||||
|
@ -188,9 +153,9 @@ const resolve = (browsers) => {
|
|||
ios_saf: 7,
|
||||
samsung: [3, 0],
|
||||
android: 38,
|
||||
// and_qq: Unknown support
|
||||
and_qq: [10, 4],
|
||||
// baidu: Unknown support
|
||||
// and_uc: Unknown support
|
||||
and_uc: [12, 12],
|
||||
kaios: [3, 0],
|
||||
node: [0, 12]
|
||||
}),
|
||||
|
@ -207,9 +172,9 @@ const resolve = (browsers) => {
|
|||
ios_saf: 8,
|
||||
samsung: [5, 0],
|
||||
android: 49,
|
||||
// and_qq: Unknown support
|
||||
and_qq: [10, 4],
|
||||
// baidu: Unknown support
|
||||
// and_uc: Unknown support
|
||||
and_uc: [12, 12],
|
||||
kaios: [2, 5],
|
||||
node: [6, 0]
|
||||
}),
|
||||
|
@ -253,8 +218,44 @@ const resolve = (browsers) => {
|
|||
kaios: [3, 0],
|
||||
node: [12, 17]
|
||||
}),
|
||||
dynamicImport: es6DynamicImport,
|
||||
dynamicImportInWorker: es6DynamicImport && !anyNode,
|
||||
dynamicImport: rawChecker({
|
||||
chrome: 63,
|
||||
and_chr: 63,
|
||||
edge: 79,
|
||||
firefox: 67,
|
||||
and_ff: 67,
|
||||
// ie: Not supported
|
||||
opera: 50,
|
||||
op_mob: 46,
|
||||
safari: [11, 1],
|
||||
ios_saf: [11, 3],
|
||||
samsung: [8, 2],
|
||||
android: 63,
|
||||
and_qq: [10, 4],
|
||||
baidu: [13, 18],
|
||||
and_uc: [15, 5],
|
||||
kaios: [3, 0],
|
||||
node: [12, 17]
|
||||
}),
|
||||
dynamicImportInWorker: rawChecker({
|
||||
chrome: 80,
|
||||
and_chr: 80,
|
||||
edge: 80,
|
||||
firefox: 114,
|
||||
and_ff: 114,
|
||||
// ie: Not supported
|
||||
opera: 67,
|
||||
op_mob: 57,
|
||||
safari: [15, 0],
|
||||
ios_saf: [15, 0],
|
||||
samsung: [13, 0],
|
||||
android: 80,
|
||||
and_qq: [10, 4],
|
||||
baidu: [13, 18],
|
||||
and_uc: [15, 5],
|
||||
kaios: [3, 0],
|
||||
node: [12, 17]
|
||||
}),
|
||||
// browserslist does not have info about globalThis
|
||||
// so this is based on mdn-browser-compat-data
|
||||
globalThis: rawChecker({
|
||||
|
@ -270,9 +271,9 @@ const resolve = (browsers) => {
|
|||
ios_saf: [12, 2],
|
||||
samsung: [10, 1],
|
||||
android: 71,
|
||||
// and_qq: Unknown support
|
||||
and_qq: [13, 1],
|
||||
// baidu: Unknown support
|
||||
// and_uc: Unknown support
|
||||
and_uc: [15, 5],
|
||||
kaios: [3, 0],
|
||||
node: 12
|
||||
}),
|
||||
|
@ -289,9 +290,9 @@ const resolve = (browsers) => {
|
|||
ios_saf: [13, 4],
|
||||
samsung: 13,
|
||||
android: 80,
|
||||
// and_qq: Not supported
|
||||
and_qq: [13, 1],
|
||||
// baidu: Not supported
|
||||
// and_uc: Not supported
|
||||
and_uc: [15, 5],
|
||||
kaios: [3, 0],
|
||||
node: 14
|
||||
}),
|
||||
|
@ -327,9 +328,9 @@ const resolve = (browsers) => {
|
|||
ios_saf: 11,
|
||||
samsung: [6, 2],
|
||||
android: 55,
|
||||
and_qq: [13, 1],
|
||||
and_qq: [10, 4],
|
||||
baidu: [13, 18],
|
||||
and_uc: [15, 5],
|
||||
and_uc: [12, 12],
|
||||
kaios: 3,
|
||||
node: [7, 6]
|
||||
}),
|
||||
|
@ -345,7 +346,7 @@ const resolve = (browsers) => {
|
|||
fetchWasm: browserProperty,
|
||||
global: nodeProperty,
|
||||
importScripts: false,
|
||||
importScriptsInWorker: true,
|
||||
importScriptsInWorker: Boolean(browserProperty),
|
||||
nodeBuiltins: nodeProperty,
|
||||
nodePrefixForCoreModules:
|
||||
nodeProperty &&
|
||||
|
|
|
@ -1326,8 +1326,13 @@ const applyOutputDefaults = (
|
|||
if (tp.importScripts) return "array-push";
|
||||
throw new Error(
|
||||
"For the selected environment is no default script chunk format available:\n" +
|
||||
"JSONP Array push can be chosen when 'document' or 'importScripts' is available.\n" +
|
||||
`CommonJs exports can be chosen when 'require' or node builtins are available.\n${
|
||||
`${
|
||||
tp.module
|
||||
? "Module ('module') can be chosen when ES modules are available (please set 'experiments.outputModule' and 'output.module' to `true`)"
|
||||
: ""
|
||||
}\n` +
|
||||
"JSONP Array push ('array-push') can be chosen when 'document' or 'importScripts' is available.\n" +
|
||||
`CommonJs exports ('commonjs') can be chosen when 'require' or node builtins are available.\n${
|
||||
helpMessage
|
||||
}`
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ const getBrowserslistTargetHandler = memoize(() =>
|
|||
* @returns {string} default target
|
||||
*/
|
||||
const getDefaultTarget = (context) => {
|
||||
const browsers = getBrowserslistTargetHandler().load(null, context);
|
||||
const browsers = getBrowserslistTargetHandler().load(undefined, context);
|
||||
return browsers ? "browserslist" : "web";
|
||||
};
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
|||
/** @typedef {Set<DestructuringAssignmentProperty>} DestructuringAssignmentProperties */
|
||||
|
||||
// TODO remove cast when @types/estree has been updated to import assertions
|
||||
/** @typedef {import("estree").ImportExpression & { options?: Expression | null, phase?: "defer" }} ImportExpression */
|
||||
/** @typedef {import("estree").ImportExpression & { phase?: "defer" }} ImportExpression */
|
||||
|
||||
/** @type {string[]} */
|
||||
const EMPTY_ARRAY = [];
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
const memoize = require("./memoize");
|
||||
|
||||
/** @typedef {import("schema-utils").Schema} Schema */
|
||||
/** @typedef {import("schema-utils/declarations/validate").ValidationErrorConfiguration} ValidationErrorConfiguration */
|
||||
/** @typedef {import("schema-utils").ValidationErrorConfiguration} ValidationErrorConfiguration */
|
||||
|
||||
const getValidate = memoize(() => require("schema-utils").validate);
|
||||
|
||||
|
|
|
@ -26,15 +26,6 @@ const decoderOpts = {
|
|||
};
|
||||
|
||||
class WebAssemblyParser extends Parser {
|
||||
/**
|
||||
* @param {{}=} options parser options
|
||||
*/
|
||||
constructor(options) {
|
||||
super();
|
||||
this.hooks = Object.freeze({});
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | Buffer | PreparsedAst} source the source to parse
|
||||
* @param {ParserState} state the parser state
|
||||
|
|
|
@ -63,15 +63,6 @@ const decoderOpts = {
|
|||
};
|
||||
|
||||
class WebAssemblyParser extends Parser {
|
||||
/**
|
||||
* @param {{}=} options parser options
|
||||
*/
|
||||
constructor(options) {
|
||||
super();
|
||||
this.hooks = Object.freeze({});
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | Buffer | PreparsedAst} source the source to parse
|
||||
* @param {ParserState} state the parser state
|
||||
|
|
|
@ -69,7 +69,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
|||
if (options && options.baseUri) {
|
||||
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
|
||||
}
|
||||
return `${RuntimeGlobals.baseURI} = (document && document.baseURI) || self.location.href;`;
|
||||
return `${RuntimeGlobals.baseURI} = (typeof document !== 'undefined' && document.baseURI) || self.location.href;`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
10
package.json
10
package.json
|
@ -89,7 +89,7 @@
|
|||
"@webassemblyjs/wasm-parser": "^1.14.1",
|
||||
"acorn": "^8.15.0",
|
||||
"acorn-import-phases": "^1.0.3",
|
||||
"browserslist": "^4.24.5",
|
||||
"browserslist": "^4.26.3",
|
||||
"chrome-trace-event": "^1.0.2",
|
||||
"enhanced-resolve": "^5.17.3",
|
||||
"es-module-lexer": "^1.2.1",
|
||||
|
@ -101,8 +101,8 @@
|
|||
"loader-runner": "^4.2.0",
|
||||
"mime-types": "^2.1.27",
|
||||
"neo-async": "^2.6.2",
|
||||
"schema-utils": "^4.3.2",
|
||||
"tapable": "^2.2.3",
|
||||
"schema-utils": "^4.3.3",
|
||||
"tapable": "^2.3.0",
|
||||
"terser-webpack-plugin": "^5.3.11",
|
||||
"watchpack": "^2.4.4",
|
||||
"webpack-sources": "^3.3.3"
|
||||
|
@ -110,7 +110,7 @@
|
|||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/preset-react": "^7.27.1",
|
||||
"@codspeed/core": "^4.0.1",
|
||||
"@codspeed/core": "^5.0.1",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@eslint/markdown": "^7.3.0",
|
||||
"@stylistic/eslint-plugin": "^5.4.0",
|
||||
|
@ -184,7 +184,7 @@
|
|||
"toml": "^3.0.0",
|
||||
"tooling": "webpack/tooling#v1.24.3",
|
||||
"ts-loader": "^9.5.1",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"url-loader": "^4.1.0",
|
||||
"wast-loader": "^1.12.1",
|
||||
"webassembly-feature": "1.3.0",
|
||||
|
|
|
@ -3,6 +3,15 @@ import fs from "fs/promises";
|
|||
import { Session } from "inspector";
|
||||
import path from "path";
|
||||
import { fileURLToPath, pathToFileURL } from "url";
|
||||
import {
|
||||
InstrumentHooks,
|
||||
getCodspeedRunnerMode,
|
||||
getGitDir,
|
||||
getV8Flags,
|
||||
mongoMeasurement,
|
||||
setupCore,
|
||||
teardownCore
|
||||
} from "@codspeed/core";
|
||||
import { simpleGit } from "simple-git";
|
||||
import { Bench, hrtimeNow } from "tinybench";
|
||||
|
||||
|
@ -12,32 +21,6 @@ const git = simpleGit(rootPath);
|
|||
|
||||
const REV_LIST_REGEXP = /^([a-f0-9]+)\s*([a-f0-9]+)\s*([a-f0-9]+)?\s*$/;
|
||||
|
||||
const getV8Flags = () => {
|
||||
const nodeVersionMajor = Number.parseInt(
|
||||
process.version.slice(1).split(".")[0],
|
||||
10
|
||||
);
|
||||
const flags = [
|
||||
"--hash-seed=1",
|
||||
"--random-seed=1",
|
||||
"--no-opt",
|
||||
"--predictable",
|
||||
"--predictable-gc-schedule",
|
||||
"--interpreted-frames-native-stack",
|
||||
"--allow-natives-syntax",
|
||||
"--expose-gc",
|
||||
"--no-concurrent-sweeping",
|
||||
"--max-old-space-size=4096"
|
||||
];
|
||||
if (nodeVersionMajor < 18) {
|
||||
flags.push("--no-randomize-hashes");
|
||||
}
|
||||
if (nodeVersionMajor < 20) {
|
||||
flags.push("--no-scavenge-task");
|
||||
}
|
||||
return flags;
|
||||
};
|
||||
|
||||
const checkV8Flags = () => {
|
||||
const requiredFlags = getV8Flags();
|
||||
const actualFlags = process.execArgv;
|
||||
|
@ -248,6 +231,8 @@ for (const baselineInfo of baselineRevisions) {
|
|||
}
|
||||
}
|
||||
|
||||
const baseOutputPath = path.join(__dirname, "js", "benchmark");
|
||||
|
||||
function buildConfiguration(
|
||||
test,
|
||||
baseline,
|
||||
|
@ -385,105 +370,239 @@ const scenarios = [
|
|||
}
|
||||
];
|
||||
|
||||
const baseOutputPath = path.join(__dirname, "js", "benchmark");
|
||||
function getStackTrace(belowFn) {
|
||||
const oldLimit = Error.stackTraceLimit;
|
||||
Error.stackTraceLimit = Infinity;
|
||||
const dummyObject = {};
|
||||
const v8Handler = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = (dummyObject, v8StackTrace) => v8StackTrace;
|
||||
Error.captureStackTrace(dummyObject, belowFn || getStackTrace);
|
||||
const v8StackTrace = dummyObject.stack;
|
||||
Error.prepareStackTrace = v8Handler;
|
||||
Error.stackTraceLimit = oldLimit;
|
||||
return v8StackTrace;
|
||||
}
|
||||
|
||||
function getCallingFile() {
|
||||
const stack = getStackTrace();
|
||||
let callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]
|
||||
const gitDir = getGitDir(callingFile);
|
||||
if (gitDir === undefined) {
|
||||
throw new Error("Could not find a git repository");
|
||||
}
|
||||
if (callingFile.startsWith("file://")) {
|
||||
callingFile = fileURLToPath(callingFile);
|
||||
}
|
||||
return path.relative(gitDir, callingFile);
|
||||
}
|
||||
|
||||
const taskUriMap = new WeakMap();
|
||||
|
||||
function getOrCreateUriMap(bench) {
|
||||
let uriMap = taskUriMap.get(bench);
|
||||
if (!uriMap) {
|
||||
uriMap = new Map();
|
||||
taskUriMap.set(bench, uriMap);
|
||||
}
|
||||
return uriMap;
|
||||
}
|
||||
|
||||
function getTaskUri(bench, taskName, rootCallingFile) {
|
||||
const uriMap = taskUriMap.get(bench);
|
||||
return uriMap?.get(taskName) || `${rootCallingFile}::${taskName}`;
|
||||
}
|
||||
|
||||
const withCodSpeed = async (/** @type {import("tinybench").Bench} */ bench) => {
|
||||
const { Measurement, getGitDir, mongoMeasurement, setupCore, teardownCore } =
|
||||
await import("@codspeed/core");
|
||||
const codspeedRunnerMode = getCodspeedRunnerMode();
|
||||
|
||||
if (!Measurement.isInstrumented()) {
|
||||
const rawRun = bench.run;
|
||||
bench.run = async () => {
|
||||
console.warn(
|
||||
`[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`
|
||||
);
|
||||
return await rawRun.bind(bench)();
|
||||
};
|
||||
if (codspeedRunnerMode === "disabled") {
|
||||
return bench;
|
||||
}
|
||||
|
||||
const getStackTrace = (belowFn) => {
|
||||
const oldLimit = Error.stackTraceLimit;
|
||||
Error.stackTraceLimit = Infinity;
|
||||
const dummyObject = {};
|
||||
const v8Handler = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = (dummyObject, v8StackTrace) => v8StackTrace;
|
||||
Error.captureStackTrace(dummyObject, belowFn || getStackTrace);
|
||||
const v8StackTrace = dummyObject.stack;
|
||||
Error.prepareStackTrace = v8Handler;
|
||||
Error.stackTraceLimit = oldLimit;
|
||||
return v8StackTrace;
|
||||
};
|
||||
|
||||
const getCallingFile = () => {
|
||||
const stack = getStackTrace();
|
||||
let callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]
|
||||
const gitDir = getGitDir(callingFile);
|
||||
if (gitDir === undefined) {
|
||||
throw new Error("Could not find a git repository");
|
||||
}
|
||||
if (callingFile.startsWith("file://")) {
|
||||
callingFile = fileURLToPath(callingFile);
|
||||
}
|
||||
return path.relative(gitDir, callingFile);
|
||||
};
|
||||
|
||||
const rawAdd = bench.add;
|
||||
const uriMap = getOrCreateUriMap(bench);
|
||||
bench.add = (name, fn, opts) => {
|
||||
const callingFile = getCallingFile();
|
||||
const uri = `${callingFile}::${name}`;
|
||||
const options = { ...opts, uri };
|
||||
return rawAdd.bind(bench)(name, fn, options);
|
||||
let uri = callingFile;
|
||||
if (bench.name !== undefined) {
|
||||
uri += `::${bench.name}`;
|
||||
}
|
||||
uri += `::${name}`;
|
||||
uriMap.set(name, uri);
|
||||
return rawAdd.bind(bench)(name, fn, opts);
|
||||
};
|
||||
const rootCallingFile = getCallingFile();
|
||||
bench.run = async function run() {
|
||||
const iterations = bench.opts.iterations - 1;
|
||||
console.log("[CodSpeed] running");
|
||||
setupCore();
|
||||
for (const task of bench.tasks) {
|
||||
await bench.opts.setup?.(task, "run");
|
||||
await task.fnOpts.beforeAll?.call(task);
|
||||
const samples = [];
|
||||
async function iteration() {
|
||||
try {
|
||||
await task.fnOpts.beforeEach?.call(task, "run");
|
||||
const start = bench.opts.now();
|
||||
await task.fn();
|
||||
samples.push(bench.opts.now() - start || 0);
|
||||
await task.fnOpts.afterEach?.call(this, "run");
|
||||
} catch (err) {
|
||||
if (bench.opts.throws) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
if (codspeedRunnerMode === "instrumented") {
|
||||
const setupBenchRun = () => {
|
||||
setupCore();
|
||||
console.log(
|
||||
"[CodSpeed] running with @codspeed/tinybench (instrumented mode)"
|
||||
);
|
||||
};
|
||||
const finalizeBenchRun = () => {
|
||||
teardownCore();
|
||||
console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);
|
||||
return bench.tasks;
|
||||
};
|
||||
|
||||
const wrapFunctionWithFrame = (fn, isAsync) => {
|
||||
if (isAsync) {
|
||||
return async function __codspeed_root_frame__() {
|
||||
await fn();
|
||||
};
|
||||
}
|
||||
|
||||
return function __codspeed_root_frame__() {
|
||||
fn();
|
||||
};
|
||||
};
|
||||
|
||||
const logTaskCompletion = (uri, status) => {
|
||||
console.log(`[CodSpeed] ${status} ${uri}`);
|
||||
};
|
||||
|
||||
const taskCompletionMessage = () =>
|
||||
InstrumentHooks.isInstrumented() ? "Measured" : "Checked";
|
||||
|
||||
const iterationAsync = async (task) => {
|
||||
try {
|
||||
await task.fnOpts.beforeEach?.call(task, "run");
|
||||
const start = bench.opts.now();
|
||||
await task.fn();
|
||||
const end = bench.opts.now() - start || 0;
|
||||
await task.fnOpts.afterEach?.call(this, "run");
|
||||
return [start, end];
|
||||
} catch (err) {
|
||||
if (bench.opts.throws) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
while (samples.length < iterations) {
|
||||
await iteration();
|
||||
}
|
||||
// Codspeed Measure
|
||||
const uri =
|
||||
task.opts && "uri" in task.options
|
||||
? task.opts.uri
|
||||
: `${rootCallingFile}::${task.name}`;
|
||||
await task.fnOpts.beforeEach?.call(task);
|
||||
await mongoMeasurement.start(uri);
|
||||
await (async function __codspeed_root_frame__() {
|
||||
Measurement.startInstrumentation();
|
||||
await task.fn();
|
||||
Measurement.stopInstrumentation(uri);
|
||||
})();
|
||||
await mongoMeasurement.stop(uri);
|
||||
await task.fnOpts.afterEach?.call(task);
|
||||
console.log(`[Codspeed] ✔ Measured ${uri}`);
|
||||
await task.fnOpts.afterAll?.call(task);
|
||||
};
|
||||
|
||||
const wrapWithInstrumentHooksAsync = async (fn, uri) => {
|
||||
InstrumentHooks.startBenchmark();
|
||||
const result = await fn();
|
||||
InstrumentHooks.stopBenchmark();
|
||||
InstrumentHooks.setExecutedBenchmark(process.pid, uri);
|
||||
return result;
|
||||
};
|
||||
|
||||
const runTaskAsync = async (task, uri) => {
|
||||
const { fnOpts, fn } = task;
|
||||
|
||||
// Custom setup
|
||||
await bench.opts.setup?.(task, "run");
|
||||
|
||||
await fnOpts?.beforeAll?.call(task, "run");
|
||||
|
||||
// Custom warmup
|
||||
// We don't run `optimizeFunction` because our function is never optimized, instead we just warmup webpack
|
||||
const samples = [];
|
||||
|
||||
while (samples.length < bench.opts.iterations - 1) {
|
||||
samples.push(await iterationAsync(task));
|
||||
}
|
||||
|
||||
await fnOpts?.beforeEach?.call(task, "run");
|
||||
await mongoMeasurement.start(uri);
|
||||
global.gc?.();
|
||||
await wrapWithInstrumentHooksAsync(wrapFunctionWithFrame(fn, true), uri);
|
||||
await mongoMeasurement.stop(uri);
|
||||
await fnOpts?.afterEach?.call(task, "run");
|
||||
console.log(`[Codspeed] ✔ Measured ${uri}`);
|
||||
await fnOpts?.afterAll?.call(task, "run");
|
||||
|
||||
// Custom teardown
|
||||
await bench.opts.teardown?.(task, "run");
|
||||
task.processRunResult({ latencySamples: samples });
|
||||
}
|
||||
teardownCore();
|
||||
console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);
|
||||
return bench.tasks;
|
||||
};
|
||||
|
||||
logTaskCompletion(uri, taskCompletionMessage());
|
||||
};
|
||||
|
||||
const iteration = (task) => {
|
||||
try {
|
||||
task.fnOpts.beforeEach?.call(task, "run");
|
||||
const start = bench.opts.now();
|
||||
task.fn();
|
||||
const end = bench.opts.now() - start || 0;
|
||||
task.fnOpts.afterEach?.call(this, "run");
|
||||
return [start, end];
|
||||
} catch (err) {
|
||||
if (bench.opts.throws) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const wrapWithInstrumentHooks = (fn, uri) => {
|
||||
InstrumentHooks.startBenchmark();
|
||||
const result = fn();
|
||||
InstrumentHooks.stopBenchmark();
|
||||
InstrumentHooks.setExecutedBenchmark(process.pid, uri);
|
||||
return result;
|
||||
};
|
||||
|
||||
const runTaskSync = (task, uri) => {
|
||||
const { fnOpts, fn } = task;
|
||||
|
||||
// Custom setup
|
||||
bench.opts.setup?.(task, "run");
|
||||
|
||||
fnOpts?.beforeAll?.call(task, "run");
|
||||
|
||||
// Custom warmup
|
||||
const samples = [];
|
||||
|
||||
while (samples.length < bench.opts.iterations - 1) {
|
||||
samples.push(iteration(task));
|
||||
}
|
||||
|
||||
fnOpts?.beforeEach?.call(task, "run");
|
||||
|
||||
wrapWithInstrumentHooks(wrapFunctionWithFrame(fn, false), uri);
|
||||
|
||||
fnOpts?.afterEach?.call(task, "run");
|
||||
console.log(`[Codspeed] ✔ Measured ${uri}`);
|
||||
fnOpts?.afterAll?.call(task, "run");
|
||||
|
||||
// Custom teardown
|
||||
bench.opts.teardown?.(task, "run");
|
||||
|
||||
logTaskCompletion(uri, taskCompletionMessage());
|
||||
};
|
||||
|
||||
const finalizeAsyncRun = () => {
|
||||
finalizeBenchRun();
|
||||
};
|
||||
const finalizeSyncRun = () => {
|
||||
finalizeBenchRun();
|
||||
};
|
||||
|
||||
bench.run = async () => {
|
||||
setupBenchRun();
|
||||
|
||||
for (const task of bench.tasks) {
|
||||
const uri = getTaskUri(task.bench, task.name, rootCallingFile);
|
||||
await runTaskAsync(task, uri);
|
||||
}
|
||||
|
||||
return finalizeAsyncRun();
|
||||
};
|
||||
|
||||
bench.runSync = () => {
|
||||
setupBenchRun();
|
||||
|
||||
for (const task of bench.tasks) {
|
||||
const uri = getTaskUri(task.bench, task.name, rootCallingFile);
|
||||
runTaskSync(task, uri);
|
||||
}
|
||||
|
||||
return finalizeSyncRun();
|
||||
};
|
||||
} else if (codspeedRunnerMode === "walltime") {
|
||||
// We don't need it
|
||||
}
|
||||
|
||||
return bench;
|
||||
};
|
||||
|
||||
|
@ -495,7 +614,6 @@ const bench = await withCodSpeed(
|
|||
warmupIterations: 2,
|
||||
iterations: 8,
|
||||
setup(task, mode) {
|
||||
global.gc();
|
||||
console.log(`Setup (${mode} mode): ${task.name}`);
|
||||
},
|
||||
teardown(task, mode) {
|
||||
|
|
|
@ -2909,12 +2909,6 @@ describe("Targets", () => {
|
|||
- Expected
|
||||
+ Received
|
||||
|
||||
@@ ... @@
|
||||
- "dynamicImportInWorker": true,
|
||||
+ "dynamicImportInWorker": false,
|
||||
@@ ... @@
|
||||
- "dynamicImportInWorker": true,
|
||||
+ "dynamicImportInWorker": false,
|
||||
@@ ... @@
|
||||
- "target": "node12.17",
|
||||
+ "target": "browserslist: node 12.17",
|
||||
|
|
|
@ -31,6 +31,37 @@ Object {
|
|||
}
|
||||
`;
|
||||
|
||||
exports[`browserslist target ["and_chr 140","and_ff 142","and_qq 14.9","and_uc 15.5","android 140","chrome 140","chrome 139","chrome 138","chrome 137","chrome 112","chrome 109","chrome 105","edge 140","edge 139","edge 138","firefox 143","firefox 142","firefox 141","firefox 140","ios_saf 26.0","ios_saf 18.5-18.6","kaios 3.0-3.1","node 24.8.0","node 22.19.0","node 20.19.0","op_mob 80","opera 122","opera 121","opera 120","safari 26.0","safari 18.5-18.6","samsung 28","samsung 27"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
"asyncFunction": true,
|
||||
"bigIntLiteral": true,
|
||||
"browser": null,
|
||||
"const": true,
|
||||
"destructuring": true,
|
||||
"document": null,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"electron": false,
|
||||
"fetchWasm": null,
|
||||
"forOf": true,
|
||||
"global": null,
|
||||
"globalThis": true,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": false,
|
||||
"module": true,
|
||||
"node": null,
|
||||
"nodeBuiltins": null,
|
||||
"nodePrefixForCoreModules": null,
|
||||
"nwjs": false,
|
||||
"optionalChaining": true,
|
||||
"require": null,
|
||||
"templateLiteral": true,
|
||||
"web": null,
|
||||
"webworker": false,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`browserslist target ["and_ff 68"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
|
@ -41,7 +72,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -65,17 +96,17 @@ Object {
|
|||
exports[`browserslist target ["and_qq 10.4"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
"asyncFunction": false,
|
||||
"asyncFunction": true,
|
||||
"bigIntLiteral": false,
|
||||
"browser": true,
|
||||
"const": true,
|
||||
"destructuring": false,
|
||||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": false,
|
||||
"forOf": true,
|
||||
"global": false,
|
||||
"globalThis": false,
|
||||
"importScripts": false,
|
||||
|
@ -93,37 +124,6 @@ Object {
|
|||
}
|
||||
`;
|
||||
|
||||
exports[`browserslist target ["and_uc 12.12"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
"asyncFunction": false,
|
||||
"bigIntLiteral": false,
|
||||
"browser": true,
|
||||
"const": true,
|
||||
"destructuring": false,
|
||||
"document": true,
|
||||
"dynamicImport": false,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": false,
|
||||
"global": false,
|
||||
"globalThis": false,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"module": false,
|
||||
"node": false,
|
||||
"nodeBuiltins": false,
|
||||
"nodePrefixForCoreModules": false,
|
||||
"nwjs": false,
|
||||
"optionalChaining": false,
|
||||
"require": false,
|
||||
"templateLiteral": true,
|
||||
"web": true,
|
||||
"webworker": false,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`browserslist target ["android 4"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": false,
|
||||
|
@ -320,14 +320,45 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": null,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"dynamicImportInWorker": true,
|
||||
"electron": false,
|
||||
"fetchWasm": null,
|
||||
"forOf": true,
|
||||
"global": null,
|
||||
"globalThis": true,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"importScriptsInWorker": false,
|
||||
"module": true,
|
||||
"node": null,
|
||||
"nodeBuiltins": null,
|
||||
"nodePrefixForCoreModules": null,
|
||||
"nwjs": false,
|
||||
"optionalChaining": false,
|
||||
"require": null,
|
||||
"templateLiteral": true,
|
||||
"web": null,
|
||||
"webworker": false,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`browserslist target ["chrome 80","node 13.12.0"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
"asyncFunction": true,
|
||||
"bigIntLiteral": true,
|
||||
"browser": null,
|
||||
"const": true,
|
||||
"destructuring": true,
|
||||
"document": null,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"electron": false,
|
||||
"fetchWasm": null,
|
||||
"forOf": true,
|
||||
"global": null,
|
||||
"globalThis": true,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": false,
|
||||
"module": true,
|
||||
"node": null,
|
||||
"nodeBuiltins": null,
|
||||
|
@ -382,7 +413,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -413,7 +444,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -444,7 +475,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -537,7 +568,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -606,7 +637,7 @@ Object {
|
|||
"global": true,
|
||||
"globalThis": false,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"importScriptsInWorker": false,
|
||||
"module": false,
|
||||
"node": true,
|
||||
"nodeBuiltins": true,
|
||||
|
@ -637,7 +668,7 @@ Object {
|
|||
"global": true,
|
||||
"globalThis": false,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"importScriptsInWorker": false,
|
||||
"module": false,
|
||||
"node": true,
|
||||
"nodeBuiltins": true,
|
||||
|
@ -668,7 +699,7 @@ Object {
|
|||
"global": true,
|
||||
"globalThis": false,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"importScriptsInWorker": false,
|
||||
"module": false,
|
||||
"node": true,
|
||||
"nodeBuiltins": true,
|
||||
|
@ -699,7 +730,7 @@ Object {
|
|||
"global": true,
|
||||
"globalThis": false,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"importScriptsInWorker": false,
|
||||
"module": false,
|
||||
"node": true,
|
||||
"nodeBuiltins": true,
|
||||
|
@ -723,14 +754,45 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": false,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"dynamicImportInWorker": true,
|
||||
"electron": false,
|
||||
"fetchWasm": false,
|
||||
"forOf": true,
|
||||
"global": true,
|
||||
"globalThis": true,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": true,
|
||||
"importScriptsInWorker": false,
|
||||
"module": true,
|
||||
"node": true,
|
||||
"nodeBuiltins": true,
|
||||
"nodePrefixForCoreModules": false,
|
||||
"nwjs": false,
|
||||
"optionalChaining": false,
|
||||
"require": true,
|
||||
"templateLiteral": true,
|
||||
"web": false,
|
||||
"webworker": false,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`browserslist target ["node 13.12.0"] 1`] = `
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
"asyncFunction": true,
|
||||
"bigIntLiteral": true,
|
||||
"browser": false,
|
||||
"const": true,
|
||||
"destructuring": true,
|
||||
"document": false,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"electron": false,
|
||||
"fetchWasm": false,
|
||||
"forOf": true,
|
||||
"global": true,
|
||||
"globalThis": true,
|
||||
"importScripts": false,
|
||||
"importScriptsInWorker": false,
|
||||
"module": true,
|
||||
"node": true,
|
||||
"nodeBuiltins": true,
|
||||
|
@ -785,7 +847,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -816,7 +878,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -909,7 +971,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -940,7 +1002,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -971,7 +1033,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -1064,7 +1126,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
@ -1095,7 +1157,7 @@ Object {
|
|||
"destructuring": true,
|
||||
"document": true,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"electron": false,
|
||||
"fetchWasm": true,
|
||||
"forOf": true,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
extends browserslist-config-mycompany
|
|
@ -0,0 +1 @@
|
|||
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,37 @@
|
|||
"use strict";
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const rootPath = path.resolve(__dirname, "../../../../");
|
||||
const rootNodeModules = path.resolve(rootPath, "./node_modules");
|
||||
const browserslistPackage = path.resolve(
|
||||
rootNodeModules,
|
||||
"browserslist-config-mycompany"
|
||||
);
|
||||
const content = `
|
||||
module.exports = {
|
||||
development: [
|
||||
'last 1 version'
|
||||
],
|
||||
production: [
|
||||
'ie 9',
|
||||
]
|
||||
}
|
||||
`;
|
||||
const browserslistFile = path.resolve(browserslistPackage, "./index.js");
|
||||
|
||||
try {
|
||||
fs.mkdirSync(browserslistPackage);
|
||||
} catch (_err) {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
fs.writeFileSync(browserslistFile, content);
|
||||
|
||||
module.exports = {
|
||||
afterExecute() {
|
||||
fs.unlinkSync(browserslistFile);
|
||||
fs.rmdirSync(browserslistPackage);
|
||||
}
|
||||
};
|
|
@ -0,0 +1,43 @@
|
|||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
target: `browserslist:${path.join(__dirname, ".browserslistrc")}:production`,
|
||||
plugins: [
|
||||
(compiler) => {
|
||||
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"arrowFunction": false,
|
||||
"asyncFunction": false,
|
||||
"bigIntLiteral": false,
|
||||
"const": false,
|
||||
"destructuring": false,
|
||||
"document": true,
|
||||
"dynamicImport": false,
|
||||
"dynamicImportInWorker": false,
|
||||
"forOf": false,
|
||||
"globalThis": false,
|
||||
"module": false,
|
||||
"nodePrefixForCoreModules": false,
|
||||
"optionalChaining": false,
|
||||
"templateLiteral": false,
|
||||
}
|
||||
`);
|
||||
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"electron": false,
|
||||
"electronMain": false,
|
||||
"electronPreload": false,
|
||||
"electronRenderer": false,
|
||||
"node": false,
|
||||
"nwjs": false,
|
||||
"web": true,
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
]
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
extends browserslist-config-mycompany1
|
|
@ -0,0 +1 @@
|
|||
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,38 @@
|
|||
"use strict";
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const rootPath = path.resolve(__dirname, "../../../../");
|
||||
const rootNodeModules = path.resolve(rootPath, "./node_modules");
|
||||
const browserslistPackage = path.resolve(
|
||||
rootNodeModules,
|
||||
"browserslist-config-mycompany1"
|
||||
);
|
||||
const content = `
|
||||
module.exports = {
|
||||
development: [
|
||||
'last 1 version'
|
||||
],
|
||||
// We are in tests, so 'process.env.NODE_ENV' has the 'test' value (browserslist respects the 'process.env.NODE_ENV' value)
|
||||
test: [
|
||||
'ie 9',
|
||||
]
|
||||
}
|
||||
`;
|
||||
const browserslistFile = path.resolve(browserslistPackage, "./index.js");
|
||||
|
||||
try {
|
||||
fs.mkdirSync(browserslistPackage);
|
||||
} catch (_err) {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
fs.writeFileSync(browserslistFile, content);
|
||||
|
||||
module.exports = {
|
||||
afterExecute() {
|
||||
fs.unlinkSync(browserslistFile);
|
||||
fs.rmdirSync(browserslistPackage);
|
||||
}
|
||||
};
|
|
@ -0,0 +1,43 @@
|
|||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
target: `browserslist:${path.join(__dirname, ".browserslistrc")}`,
|
||||
plugins: [
|
||||
(compiler) => {
|
||||
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"arrowFunction": false,
|
||||
"asyncFunction": false,
|
||||
"bigIntLiteral": false,
|
||||
"const": false,
|
||||
"destructuring": false,
|
||||
"document": true,
|
||||
"dynamicImport": false,
|
||||
"dynamicImportInWorker": false,
|
||||
"forOf": false,
|
||||
"globalThis": false,
|
||||
"module": false,
|
||||
"nodePrefixForCoreModules": false,
|
||||
"optionalChaining": false,
|
||||
"templateLiteral": false,
|
||||
}
|
||||
`);
|
||||
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"electron": false,
|
||||
"electronMain": false,
|
||||
"electronPreload": false,
|
||||
"electronRenderer": false,
|
||||
"node": false,
|
||||
"nwjs": false,
|
||||
"web": true,
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
]
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"browserslist": {
|
||||
"development": [
|
||||
"last 1 version"
|
||||
],
|
||||
"production": [
|
||||
"ie 9"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
target: "browserslist:production",
|
||||
plugins: [
|
||||
(compiler) => {
|
||||
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"arrowFunction": false,
|
||||
"asyncFunction": false,
|
||||
"bigIntLiteral": false,
|
||||
"const": false,
|
||||
"destructuring": false,
|
||||
"document": true,
|
||||
"dynamicImport": false,
|
||||
"dynamicImportInWorker": false,
|
||||
"forOf": false,
|
||||
"globalThis": false,
|
||||
"module": false,
|
||||
"nodePrefixForCoreModules": false,
|
||||
"optionalChaining": false,
|
||||
"templateLiteral": false,
|
||||
}
|
||||
`);
|
||||
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"electron": false,
|
||||
"electronMain": false,
|
||||
"electronPreload": false,
|
||||
"electronRenderer": false,
|
||||
"node": false,
|
||||
"nwjs": false,
|
||||
"web": true,
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
]
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"browserslist": [
|
||||
"extends browserslist-config-mycompany2"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
"use strict";
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const rootPath = path.resolve(__dirname, "../../../../");
|
||||
const rootNodeModules = path.resolve(rootPath, "./node_modules");
|
||||
const browserslistPackage = path.resolve(
|
||||
rootNodeModules,
|
||||
"browserslist-config-mycompany2"
|
||||
);
|
||||
const content = `
|
||||
module.exports = {
|
||||
development: [
|
||||
'last 1 version'
|
||||
],
|
||||
// We are in tests, so 'process.env.NODE_ENV' has the 'test' value (browserslist respects the 'process.env.NODE_ENV' value)
|
||||
test: [
|
||||
'ie 9',
|
||||
]
|
||||
}
|
||||
`;
|
||||
const browserslistFile = path.resolve(browserslistPackage, "./index.js");
|
||||
|
||||
try {
|
||||
fs.mkdirSync(browserslistPackage);
|
||||
} catch (_err) {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
fs.writeFileSync(browserslistFile, content);
|
||||
|
||||
module.exports = {
|
||||
afterExecute() {
|
||||
fs.unlinkSync(browserslistFile);
|
||||
fs.rmdirSync(browserslistPackage);
|
||||
}
|
||||
};
|
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
target: "browserslist",
|
||||
plugins: [
|
||||
(compiler) => {
|
||||
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"arrowFunction": false,
|
||||
"asyncFunction": false,
|
||||
"bigIntLiteral": false,
|
||||
"const": false,
|
||||
"destructuring": false,
|
||||
"document": true,
|
||||
"dynamicImport": false,
|
||||
"dynamicImportInWorker": false,
|
||||
"forOf": false,
|
||||
"globalThis": false,
|
||||
"module": false,
|
||||
"nodePrefixForCoreModules": false,
|
||||
"optionalChaining": false,
|
||||
"templateLiteral": false,
|
||||
}
|
||||
`);
|
||||
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"electron": false,
|
||||
"electronMain": false,
|
||||
"electronPreload": false,
|
||||
"electronRenderer": false,
|
||||
"node": false,
|
||||
"nwjs": false,
|
||||
"web": true,
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
]
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"browserslist": {
|
||||
"development": [
|
||||
"last 1 version"
|
||||
],
|
||||
"production": [
|
||||
"ie 9"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
target: "browserslist:maintained node versions",
|
||||
plugins: [
|
||||
(compiler) => {
|
||||
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"arrowFunction": true,
|
||||
"asyncFunction": true,
|
||||
"bigIntLiteral": true,
|
||||
"const": true,
|
||||
"destructuring": true,
|
||||
"document": false,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": true,
|
||||
"forOf": true,
|
||||
"globalThis": true,
|
||||
"module": true,
|
||||
"nodePrefixForCoreModules": true,
|
||||
"optionalChaining": true,
|
||||
"templateLiteral": true,
|
||||
}
|
||||
`);
|
||||
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"electron": false,
|
||||
"electronMain": false,
|
||||
"electronPreload": false,
|
||||
"electronRenderer": false,
|
||||
"node": true,
|
||||
"nwjs": false,
|
||||
"web": false,
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
]
|
||||
};
|
|
@ -15,7 +15,7 @@ module.exports = {
|
|||
"destructuring": true,
|
||||
"document": false,
|
||||
"dynamicImport": true,
|
||||
"dynamicImportInWorker": false,
|
||||
"dynamicImportInWorker": true,
|
||||
"forOf": true,
|
||||
"globalThis": true,
|
||||
"module": true,
|
||||
|
|
|
@ -57,9 +57,7 @@ describe("browserslist target", () => {
|
|||
["node 10.0.0"],
|
||||
["node 10.17.0"],
|
||||
["node 12.19.0"],
|
||||
|
||||
// UC browsers for Android
|
||||
["and_uc 12.12"],
|
||||
["node 13.12.0"],
|
||||
|
||||
// QQ browser
|
||||
["and_qq 10.4"],
|
||||
|
@ -73,6 +71,45 @@ describe("browserslist target", () => {
|
|||
// Multiple
|
||||
["firefox 80", "chrome 80"],
|
||||
["chrome 80", "node 12.19.0"],
|
||||
["chrome 80", "node 13.12.0"],
|
||||
|
||||
// defaults and fully supports es6-module
|
||||
// maintained node versions
|
||||
[
|
||||
"and_chr 140",
|
||||
"and_ff 142",
|
||||
"and_qq 14.9",
|
||||
"and_uc 15.5",
|
||||
"android 140",
|
||||
"chrome 140",
|
||||
"chrome 139",
|
||||
"chrome 138",
|
||||
"chrome 137",
|
||||
"chrome 112",
|
||||
"chrome 109",
|
||||
"chrome 105",
|
||||
"edge 140",
|
||||
"edge 139",
|
||||
"edge 138",
|
||||
"firefox 143",
|
||||
"firefox 142",
|
||||
"firefox 141",
|
||||
"firefox 140",
|
||||
"ios_saf 26.0",
|
||||
"ios_saf 18.5-18.6",
|
||||
"kaios 3.0-3.1",
|
||||
"node 24.8.0",
|
||||
"node 22.19.0",
|
||||
"node 20.19.0",
|
||||
"op_mob 80",
|
||||
"opera 122",
|
||||
"opera 121",
|
||||
"opera 120",
|
||||
"safari 26.0",
|
||||
"safari 18.5-18.6",
|
||||
"samsung 28",
|
||||
"samsung 27"
|
||||
],
|
||||
|
||||
// Unknown
|
||||
["unknown 50"]
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
ClassBody,
|
||||
ClassDeclaration,
|
||||
ClassExpression,
|
||||
Comment,
|
||||
Comment as CommentImport,
|
||||
ConditionalExpression,
|
||||
ContinueStatement,
|
||||
DebuggerStatement,
|
||||
|
@ -99,9 +99,11 @@ import {
|
|||
} from "inspector";
|
||||
import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
|
||||
import { ListenOptions } from "net";
|
||||
import { validate as validateFunction } from "schema-utils";
|
||||
import {
|
||||
ValidationErrorConfiguration,
|
||||
validate as validateFunction
|
||||
} from "schema-utils";
|
||||
import { default as ValidationError } from "schema-utils/declarations/ValidationError";
|
||||
import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
|
||||
import {
|
||||
AsArray,
|
||||
AsyncParallelHook,
|
||||
|
@ -114,7 +116,8 @@ import {
|
|||
SyncBailHook,
|
||||
SyncHook,
|
||||
SyncWaterfallHook,
|
||||
TapOptions
|
||||
TapOptions,
|
||||
TypedHookMap
|
||||
} from "tapable";
|
||||
import { SecureContextOptions, TlsOptions } from "tls";
|
||||
import { URL } from "url";
|
||||
|
@ -297,6 +300,14 @@ declare interface Asset {
|
|||
*/
|
||||
info: AssetInfo;
|
||||
}
|
||||
declare abstract class AssetBytesGenerator extends Generator {
|
||||
generateError(
|
||||
error: Error,
|
||||
module: NormalModule,
|
||||
generateContext: GenerateContext
|
||||
): null | Source;
|
||||
}
|
||||
declare abstract class AssetBytesParser extends ParserClass {}
|
||||
declare interface AssetDependencyMeta {
|
||||
sourceType: "css-url";
|
||||
}
|
||||
|
@ -311,6 +322,25 @@ type AssetFilterItemTypes =
|
|||
| string
|
||||
| RegExp
|
||||
| ((name: string, asset: StatsAsset) => boolean);
|
||||
declare abstract class AssetGenerator extends Generator {
|
||||
dataUrlOptions?:
|
||||
| AssetGeneratorDataUrlOptions
|
||||
| ((
|
||||
source: string | Buffer,
|
||||
context: { filename: string; module: Module }
|
||||
) => string);
|
||||
filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
||||
publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
||||
outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
||||
emit?: boolean;
|
||||
getMimeType(module: NormalModule): string;
|
||||
generateDataUri(module: NormalModule): string;
|
||||
generateError(
|
||||
error: Error,
|
||||
module: NormalModule,
|
||||
generateContext: GenerateContext
|
||||
): null | Source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options object for data url generation.
|
||||
|
@ -349,6 +379,15 @@ declare interface AssetInlineGeneratorOptions {
|
|||
context: { filename: string; module: Module }
|
||||
) => string);
|
||||
}
|
||||
declare abstract class AssetParser extends ParserClass {
|
||||
dataUrlCondition?:
|
||||
| boolean
|
||||
| AssetParserDataUrlOptions
|
||||
| ((
|
||||
source: string | Buffer,
|
||||
context: { filename: string; module: Module }
|
||||
) => boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Options object for DataUrl condition.
|
||||
|
@ -404,6 +443,14 @@ declare interface AssetResourceGeneratorOptions {
|
|||
*/
|
||||
publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
||||
}
|
||||
declare abstract class AssetSourceGenerator extends Generator {
|
||||
generateError(
|
||||
error: Error,
|
||||
module: NormalModule,
|
||||
generateContext: GenerateContext
|
||||
): null | Source;
|
||||
}
|
||||
declare abstract class AssetSourceParser extends ParserClass {}
|
||||
declare class AsyncDependenciesBlock extends DependenciesBlock {
|
||||
constructor(
|
||||
groupOptions:
|
||||
|
@ -473,6 +520,7 @@ declare interface AsyncWebAssemblyModulesPluginOptions {
|
|||
*/
|
||||
mangleImports?: boolean;
|
||||
}
|
||||
declare abstract class AsyncWebAssemblyParser extends ParserClass {}
|
||||
declare class AutomaticPrefetchPlugin {
|
||||
constructor();
|
||||
|
||||
|
@ -2044,6 +2092,11 @@ declare interface ColorsOptions {
|
|||
*/
|
||||
useColor?: boolean;
|
||||
}
|
||||
declare interface CommentCssParser {
|
||||
value: string;
|
||||
range: [number, number];
|
||||
loc: { start: Position; end: Position };
|
||||
}
|
||||
declare interface CommonJsImportSettings {
|
||||
name?: string;
|
||||
context: string;
|
||||
|
@ -3558,6 +3611,23 @@ declare interface CssData {
|
|||
*/
|
||||
exports: Map<string, string>;
|
||||
}
|
||||
declare abstract class CssGenerator extends Generator {
|
||||
convention?:
|
||||
| "as-is"
|
||||
| "camel-case"
|
||||
| "camel-case-only"
|
||||
| "dashes"
|
||||
| "dashes-only"
|
||||
| ((name: string) => string);
|
||||
localIdentName?: string;
|
||||
exportsOnly?: boolean;
|
||||
esModule?: boolean;
|
||||
generateError(
|
||||
error: Error,
|
||||
module: NormalModule,
|
||||
generateContext: GenerateContext
|
||||
): null | Source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generator options for css modules.
|
||||
|
@ -3753,6 +3823,19 @@ declare class CssModulesPlugin {
|
|||
): TemplatePath;
|
||||
static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
|
||||
}
|
||||
declare abstract class CssParser extends ParserClass {
|
||||
defaultMode: "global" | "auto" | "pure" | "local";
|
||||
import: boolean;
|
||||
url: boolean;
|
||||
namedExports: boolean;
|
||||
comments?: CommentCssParser[];
|
||||
magicCommentContext: Context;
|
||||
getComments(range: [number, number]): CommentCssParser[];
|
||||
parseCommentOptions(range: [number, number]): {
|
||||
options: null | Record<string, any>;
|
||||
errors: null | (Error & { comment: CommentCssParser })[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Parser options for css modules.
|
||||
|
@ -6380,35 +6463,6 @@ declare interface ImportDependencyMeta {
|
|||
externalType?: "import" | "module";
|
||||
}
|
||||
type ImportExpressionJavascriptParser = ImportExpressionImport & {
|
||||
options?:
|
||||
| null
|
||||
| ImportExpressionImport
|
||||
| UnaryExpression
|
||||
| ArrayExpression
|
||||
| ArrowFunctionExpression
|
||||
| AssignmentExpression
|
||||
| AwaitExpression
|
||||
| BinaryExpression
|
||||
| SimpleCallExpression
|
||||
| NewExpression
|
||||
| ChainExpression
|
||||
| ClassExpression
|
||||
| ConditionalExpression
|
||||
| FunctionExpression
|
||||
| Identifier
|
||||
| SimpleLiteral
|
||||
| RegExpLiteral
|
||||
| BigIntLiteral
|
||||
| LogicalExpression
|
||||
| MemberExpression
|
||||
| MetaProperty
|
||||
| ObjectExpression
|
||||
| SequenceExpression
|
||||
| TaggedTemplateExpression
|
||||
| TemplateLiteral
|
||||
| ThisExpression
|
||||
| UpdateExpression
|
||||
| YieldExpression;
|
||||
phase?: "defer";
|
||||
};
|
||||
declare interface ImportModuleOptions {
|
||||
|
@ -6623,6 +6677,33 @@ declare interface IteratorObject<T, TReturn = unknown, TNext = unknown>
|
|||
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
|
||||
[Symbol.dispose](): void;
|
||||
}
|
||||
declare abstract class JavascriptGenerator extends Generator {
|
||||
generateError(
|
||||
error: Error,
|
||||
module: NormalModule,
|
||||
generateContext: GenerateContext
|
||||
): null | Source;
|
||||
sourceModule(
|
||||
module: Module,
|
||||
initFragments: InitFragment<GenerateContext>[],
|
||||
source: ReplaceSource,
|
||||
generateContext: GenerateContext
|
||||
): void;
|
||||
sourceBlock(
|
||||
module: Module,
|
||||
block: DependenciesBlock,
|
||||
initFragments: InitFragment<GenerateContext>[],
|
||||
source: ReplaceSource,
|
||||
generateContext: GenerateContext
|
||||
): void;
|
||||
sourceDependency(
|
||||
module: Module,
|
||||
dependency: Dependency,
|
||||
initFragments: InitFragment<GenerateContext>[],
|
||||
source: ReplaceSource,
|
||||
generateContext: GenerateContext
|
||||
): void;
|
||||
}
|
||||
declare class JavascriptModulesPlugin {
|
||||
constructor(options?: object);
|
||||
options: object;
|
||||
|
@ -7107,15 +7188,15 @@ declare class JavascriptParser extends ParserClass {
|
|||
[LogicalExpression],
|
||||
boolean | void
|
||||
>;
|
||||
program: SyncBailHook<[Program, Comment[]], boolean | void>;
|
||||
program: SyncBailHook<[Program, CommentImport[]], boolean | void>;
|
||||
terminate: SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>;
|
||||
finish: SyncBailHook<[Program, Comment[]], boolean | void>;
|
||||
finish: SyncBailHook<[Program, CommentImport[]], boolean | void>;
|
||||
unusedStatement: SyncBailHook<[Statement], boolean | void>;
|
||||
}>;
|
||||
sourceType: "module" | "auto" | "script";
|
||||
scope: ScopeInfo;
|
||||
state: ParserState;
|
||||
comments?: Comment[];
|
||||
comments?: CommentImport[];
|
||||
semicolons?: Set<number>;
|
||||
statementPath?: StatementPathItem[];
|
||||
prevStatement?:
|
||||
|
@ -7939,7 +8020,7 @@ declare class JavascriptParser extends ParserClass {
|
|||
| MaybeNamedClassDeclaration,
|
||||
commentsStartPos: number
|
||||
): boolean;
|
||||
getComments(range: [number, number]): Comment[];
|
||||
getComments(range: [number, number]): CommentImport[];
|
||||
isAsiPosition(pos: number): boolean;
|
||||
setAsiPosition(pos: number): void;
|
||||
unsetAsiPosition(pos: number): void;
|
||||
|
@ -7975,7 +8056,7 @@ declare class JavascriptParser extends ParserClass {
|
|||
evaluatedVariable(tagInfo: TagInfo): VariableInfo;
|
||||
parseCommentOptions(range: [number, number]): {
|
||||
options: null | Record<string, any>;
|
||||
errors: null | (Error & { comment: Comment })[];
|
||||
errors: null | (Error & { comment: CommentImport })[];
|
||||
};
|
||||
extractMemberExpressionChain(
|
||||
expression:
|
||||
|
@ -8327,6 +8408,14 @@ declare abstract class JsonData {
|
|||
| JsonValueFs[];
|
||||
updateHash(hash: Hash): void;
|
||||
}
|
||||
declare abstract class JsonGenerator extends Generator {
|
||||
options: JsonGeneratorOptions;
|
||||
generateError(
|
||||
error: Error,
|
||||
module: NormalModule,
|
||||
generateContext: GenerateContext
|
||||
): null | Source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generator options for json modules.
|
||||
|
@ -8337,6 +8426,17 @@ declare interface JsonGeneratorOptions {
|
|||
*/
|
||||
JSONParse?: boolean;
|
||||
}
|
||||
declare interface JsonModulesPluginParserOptions {
|
||||
/**
|
||||
* The depth of json dependency flagged as `exportInfo`.
|
||||
*/
|
||||
exportsDepth?: number;
|
||||
|
||||
/**
|
||||
* Function that executes for a module source string and should return json-compatible data.
|
||||
*/
|
||||
parse?: (input: string) => any;
|
||||
}
|
||||
declare interface JsonObjectFs {
|
||||
[index: string]:
|
||||
| undefined
|
||||
|
@ -8357,6 +8457,9 @@ declare interface JsonObjectTypes {
|
|||
| JsonObjectTypes
|
||||
| JsonValueTypes[];
|
||||
}
|
||||
declare abstract class JsonParser extends ParserClass {
|
||||
options: JsonModulesPluginParserOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parser options for JSON modules.
|
||||
|
@ -11288,12 +11391,225 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
|||
],
|
||||
Module
|
||||
>;
|
||||
createParser: HookMap<SyncBailHook<[ParserOptions], void | ParserClass>>;
|
||||
parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
|
||||
createGenerator: HookMap<
|
||||
SyncBailHook<[GeneratorOptions], void | Generator>
|
||||
createParser: TypedHookMap<
|
||||
Record<
|
||||
"javascript/auto",
|
||||
SyncBailHook<[JavascriptParserOptions], JavascriptParser>
|
||||
> &
|
||||
Record<
|
||||
"javascript/dynamic",
|
||||
SyncBailHook<[JavascriptParserOptions], JavascriptParser>
|
||||
> &
|
||||
Record<
|
||||
"javascript/esm",
|
||||
SyncBailHook<[JavascriptParserOptions], JavascriptParser>
|
||||
> &
|
||||
Record<"json", SyncBailHook<[JsonParserOptions], JsonParser>> &
|
||||
Record<"asset", SyncBailHook<[AssetParserOptions], AssetParser>> &
|
||||
Record<
|
||||
"asset/inline",
|
||||
SyncBailHook<[EmptyParserOptions], AssetParser>
|
||||
> &
|
||||
Record<
|
||||
"asset/resource",
|
||||
SyncBailHook<[EmptyParserOptions], AssetParser>
|
||||
> &
|
||||
Record<
|
||||
"asset/source",
|
||||
SyncBailHook<[EmptyParserOptions], AssetSourceParser>
|
||||
> &
|
||||
Record<
|
||||
"asset/bytes",
|
||||
SyncBailHook<[EmptyParserOptions], AssetBytesParser>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/async",
|
||||
SyncBailHook<[EmptyParserOptions], AsyncWebAssemblyParser>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/sync",
|
||||
SyncBailHook<[EmptyParserOptions], WebAssemblyParser>
|
||||
> &
|
||||
Record<"css", SyncBailHook<[CssParserOptions], CssParser>> &
|
||||
Record<"css/auto", SyncBailHook<[CssAutoParserOptions], CssParser>> &
|
||||
Record<
|
||||
"css/module",
|
||||
SyncBailHook<[CssModuleParserOptions], CssParser>
|
||||
> &
|
||||
Record<
|
||||
"css/global",
|
||||
SyncBailHook<[CssGlobalParserOptions], CssParser>
|
||||
> &
|
||||
Record<string, SyncBailHook<[ParserOptions], ParserClass>>
|
||||
>;
|
||||
parser: TypedHookMap<
|
||||
Record<
|
||||
"javascript/auto",
|
||||
SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"javascript/dynamic",
|
||||
SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"javascript/esm",
|
||||
SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
|
||||
> &
|
||||
Record<"json", SyncBailHook<[JsonParser, JsonParserOptions], void>> &
|
||||
Record<"asset", SyncBailHook<[AssetParser, AssetParserOptions], void>> &
|
||||
Record<
|
||||
"asset/inline",
|
||||
SyncBailHook<[AssetParser, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/resource",
|
||||
SyncBailHook<[AssetParser, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/source",
|
||||
SyncBailHook<[AssetSourceParser, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/bytes",
|
||||
SyncBailHook<[AssetBytesParser, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/async",
|
||||
SyncBailHook<[AsyncWebAssemblyParser, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/sync",
|
||||
SyncBailHook<[WebAssemblyParser, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<"css", SyncBailHook<[CssParser, CssParserOptions], void>> &
|
||||
Record<
|
||||
"css/auto",
|
||||
SyncBailHook<[CssParser, CssAutoParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"css/module",
|
||||
SyncBailHook<[CssParser, CssModuleParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"css/global",
|
||||
SyncBailHook<[CssParser, CssGlobalParserOptions], void>
|
||||
> &
|
||||
Record<string, SyncBailHook<[ParserClass, ParserOptions], void>>
|
||||
>;
|
||||
createGenerator: TypedHookMap<
|
||||
Record<
|
||||
"javascript/auto",
|
||||
SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
|
||||
> &
|
||||
Record<
|
||||
"javascript/dynamic",
|
||||
SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
|
||||
> &
|
||||
Record<
|
||||
"javascript/esm",
|
||||
SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
|
||||
> &
|
||||
Record<"json", SyncBailHook<[JsonGeneratorOptions], JsonGenerator>> &
|
||||
Record<"asset", SyncBailHook<[AssetGeneratorOptions], AssetGenerator>> &
|
||||
Record<
|
||||
"asset/inline",
|
||||
SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
|
||||
> &
|
||||
Record<
|
||||
"asset/resource",
|
||||
SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
|
||||
> &
|
||||
Record<
|
||||
"asset/source",
|
||||
SyncBailHook<[EmptyGeneratorOptions], AssetSourceGenerator>
|
||||
> &
|
||||
Record<
|
||||
"asset/bytes",
|
||||
SyncBailHook<[EmptyGeneratorOptions], AssetBytesGenerator>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/async",
|
||||
SyncBailHook<[EmptyParserOptions], Generator>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/sync",
|
||||
SyncBailHook<[EmptyParserOptions], Generator>
|
||||
> &
|
||||
Record<"css", SyncBailHook<[CssGeneratorOptions], CssGenerator>> &
|
||||
Record<
|
||||
"css/auto",
|
||||
SyncBailHook<[CssAutoGeneratorOptions], CssGenerator>
|
||||
> &
|
||||
Record<
|
||||
"css/module",
|
||||
SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
|
||||
> &
|
||||
Record<
|
||||
"css/global",
|
||||
SyncBailHook<[CssGlobalGeneratorOptions], CssGenerator>
|
||||
> &
|
||||
Record<string, SyncBailHook<[GeneratorOptions], Generator>>
|
||||
>;
|
||||
generator: TypedHookMap<
|
||||
Record<
|
||||
"javascript/auto",
|
||||
SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"javascript/dynamic",
|
||||
SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"javascript/esm",
|
||||
SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"json",
|
||||
SyncBailHook<[JsonGenerator, JsonGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset",
|
||||
SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/inline",
|
||||
SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/resource",
|
||||
SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/source",
|
||||
SyncBailHook<[AssetSourceGenerator, EmptyGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"asset/bytes",
|
||||
SyncBailHook<[AssetBytesGenerator, EmptyGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/async",
|
||||
SyncBailHook<[Generator, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"webassembly/sync",
|
||||
SyncBailHook<[Generator, EmptyParserOptions], void>
|
||||
> &
|
||||
Record<"css", SyncBailHook<[CssGenerator, CssGeneratorOptions], void>> &
|
||||
Record<
|
||||
"css/auto",
|
||||
SyncBailHook<[CssGenerator, CssAutoGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"css/module",
|
||||
SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
|
||||
> &
|
||||
Record<
|
||||
"css/global",
|
||||
SyncBailHook<[CssGenerator, CssGlobalGeneratorOptions], void>
|
||||
> &
|
||||
Record<string, SyncBailHook<[Generator, GeneratorOptions], void>>
|
||||
>;
|
||||
generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
|
||||
createModuleClass: HookMap<
|
||||
SyncBailHook<
|
||||
[
|
||||
|
@ -13166,6 +13482,10 @@ declare interface PnpApi {
|
|||
options: { considerBuiltins: boolean }
|
||||
) => null | string;
|
||||
}
|
||||
declare interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
declare class PrefetchPlugin {
|
||||
constructor(context: string, request?: string);
|
||||
context: null | string;
|
||||
|
@ -17815,6 +18135,7 @@ declare abstract class WeakTupleMap<K extends any[], V> {
|
|||
delete(...args: K): void;
|
||||
clear(): void;
|
||||
}
|
||||
declare abstract class WebAssemblyParser extends ParserClass {}
|
||||
declare interface WebAssemblyRenderContext {
|
||||
/**
|
||||
* the chunk
|
||||
|
|
170
yarn.lock
170
yarn.lock
|
@ -332,14 +332,14 @@
|
|||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@codspeed/core@^4.0.1":
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@codspeed/core/-/core-4.0.1.tgz#91049cce17b8c1d1b4b6cbc481f5ddc1145d6e1e"
|
||||
integrity sha512-fJ53arfgtzCDZa8DuGJhpTZ3Ll9A1uW5nQ2jSJnfO4Hl5MRD2cP8P4vPvIUAGbdbjwCxR1jat6cW8OloMJkJXw==
|
||||
"@codspeed/core@^5.0.1":
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@codspeed/core/-/core-5.0.1.tgz#6145c898a86a6d56a169611c3e9657a8b97c7642"
|
||||
integrity sha512-4g5ZyFAin8QywK4+0FK1uXG3GLRPu0oc3xbP+7OUhhFxbwpzFuaJtKmnTofMqLy9/pHH6Bl/7H0/DTVH3cpFkA==
|
||||
dependencies:
|
||||
axios "^1.4.0"
|
||||
find-up "^6.3.0"
|
||||
form-data "^4.0.0"
|
||||
form-data "^4.0.4"
|
||||
node-gyp-build "^4.6.0"
|
||||
|
||||
"@cspell/cspell-bundled-dicts@9.1.3":
|
||||
|
@ -995,13 +995,6 @@
|
|||
"@types/node" "*"
|
||||
jest-mock "30.2.0"
|
||||
|
||||
"@jest/expect-utils@30.1.2":
|
||||
version "30.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-30.1.2.tgz#88ea18040f707c9fadb6fd9e77568cae5266cee8"
|
||||
integrity sha512-HXy1qT/bfdjCv7iC336ExbqqYtZvljrV8odNdso7dWK9bSeHtLlvwWWC3YSybSPL03Gg5rug6WLCZAZFH72m0A==
|
||||
dependencies:
|
||||
"@jest/get-type" "30.1.0"
|
||||
|
||||
"@jest/expect-utils@30.2.0":
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-30.2.0.tgz#4f95413d4748454fdb17404bf1141827d15e6011"
|
||||
|
@ -1148,19 +1141,6 @@
|
|||
slash "^3.0.0"
|
||||
write-file-atomic "^5.0.1"
|
||||
|
||||
"@jest/types@30.0.5":
|
||||
version "30.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-30.0.5.tgz#29a33a4c036e3904f1cfd94f6fe77f89d2e1cc05"
|
||||
integrity sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==
|
||||
dependencies:
|
||||
"@jest/pattern" "30.0.1"
|
||||
"@jest/schemas" "30.0.5"
|
||||
"@types/istanbul-lib-coverage" "^2.0.6"
|
||||
"@types/istanbul-reports" "^3.0.4"
|
||||
"@types/node" "*"
|
||||
"@types/yargs" "^17.0.33"
|
||||
chalk "^4.1.2"
|
||||
|
||||
"@jest/types@30.2.0":
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-30.2.0.tgz#1c678a7924b8f59eafd4c77d56b6d0ba976d62b8"
|
||||
|
@ -2252,6 +2232,11 @@ base64-js@^1.3.1:
|
|||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
|
||||
|
||||
baseline-browser-mapping@^2.8.9:
|
||||
version "2.8.10"
|
||||
resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.10.tgz#32eb5e253d633fa3fa3ffb1685fabf41680d9e8a"
|
||||
integrity sha512-uLfgBi+7IBNay8ECBO2mVMGZAc1VgZWEChxm4lv+TobGdG82LnXMjuNGo/BSSZZL4UmkWhxEHP2f5ziLNwGWMA==
|
||||
|
||||
big.js@^5.2.2:
|
||||
version "5.2.2"
|
||||
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
|
||||
|
@ -2284,14 +2269,15 @@ braces@^3.0.3:
|
|||
dependencies:
|
||||
fill-range "^7.1.1"
|
||||
|
||||
browserslist@^4.24.0, browserslist@^4.24.5, browserslist@^4.25.1:
|
||||
version "4.25.4"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.4.tgz#ebdd0e1d1cf3911834bab3a6cd7b917d9babf5af"
|
||||
integrity sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==
|
||||
browserslist@^4.24.0, browserslist@^4.25.1, browserslist@^4.26.3:
|
||||
version "4.26.3"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.26.3.tgz#40fbfe2d1cd420281ce5b1caa8840049c79afb56"
|
||||
integrity sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==
|
||||
dependencies:
|
||||
caniuse-lite "^1.0.30001737"
|
||||
electron-to-chromium "^1.5.211"
|
||||
node-releases "^2.0.19"
|
||||
baseline-browser-mapping "^2.8.9"
|
||||
caniuse-lite "^1.0.30001746"
|
||||
electron-to-chromium "^1.5.227"
|
||||
node-releases "^2.0.21"
|
||||
update-browserslist-db "^1.1.3"
|
||||
|
||||
bser@2.1.1:
|
||||
|
@ -2407,10 +2393,10 @@ camelcase@^6.3.0:
|
|||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
||||
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
||||
|
||||
caniuse-lite@^1.0.30001737:
|
||||
version "1.0.30001739"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001739.tgz#b34ce2d56bfc22f4352b2af0144102d623a124f4"
|
||||
integrity sha512-y+j60d6ulelrNSwpPyrHdl+9mJnQzHBr08xm48Qno0nSk4h3Qojh+ziv2qE6rXf4k3tadF4o1J/1tAbVm1NtnA==
|
||||
caniuse-lite@^1.0.30001746:
|
||||
version "1.0.30001746"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001746.tgz#199d20f04f5369825e00ff7067d45d5dfa03aee7"
|
||||
integrity sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA==
|
||||
|
||||
ccount@^2.0.0:
|
||||
version "2.0.1"
|
||||
|
@ -3048,10 +3034,10 @@ eastasianwidth@^0.2.0:
|
|||
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
|
||||
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
|
||||
|
||||
electron-to-chromium@^1.5.211:
|
||||
version "1.5.211"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.211.tgz#749317bf9cf894c06f67980940cf8074e5eb08ca"
|
||||
integrity sha512-IGBvimJkotaLzFnwIVgW9/UD/AOJ2tByUmeOrtqBfACSbAw5b1G0XpvdaieKyc7ULmbwXVx+4e4Be8pOPBrYkw==
|
||||
electron-to-chromium@^1.5.227:
|
||||
version "1.5.228"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.228.tgz#38b849bc8714bd21fb64f5ad56bf8cfd8638e1e9"
|
||||
integrity sha512-nxkiyuqAn4MJ1QbobwqJILiDtu/jk14hEAWaMiJmNPh1Z+jqoFlBFZjdXwLWGeVSeu9hGLg6+2G9yJaW8rBIFA==
|
||||
|
||||
emittery@^0.13.1:
|
||||
version "0.13.1"
|
||||
|
@ -3892,7 +3878,7 @@ fork-ts-checker-webpack-plugin@^9.0.2:
|
|||
semver "^7.3.5"
|
||||
tapable "^2.2.1"
|
||||
|
||||
form-data@^4.0.0, form-data@^4.0.4:
|
||||
form-data@^4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4"
|
||||
integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==
|
||||
|
@ -4862,16 +4848,6 @@ jest-config@30.2.0:
|
|||
slash "^3.0.0"
|
||||
strip-json-comments "^3.1.1"
|
||||
|
||||
jest-diff@30.1.2:
|
||||
version "30.1.2"
|
||||
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.1.2.tgz#8ff4217e5b63fef49a5b37462999d8f5299a4eb4"
|
||||
integrity sha512-4+prq+9J61mOVXCa4Qp8ZjavdxzrWQXrI80GNxP8f4tkI2syPuPrJgdRPZRrfUTRvIoUwcmNLbqEJy9W800+NQ==
|
||||
dependencies:
|
||||
"@jest/diff-sequences" "30.0.1"
|
||||
"@jest/get-type" "30.1.0"
|
||||
chalk "^4.1.2"
|
||||
pretty-format "30.0.5"
|
||||
|
||||
jest-diff@30.2.0, jest-diff@^30.2.0:
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.2.0.tgz#e3ec3a6ea5c5747f605c9e874f83d756cba36825"
|
||||
|
@ -4949,16 +4925,6 @@ jest-leak-detector@30.2.0:
|
|||
"@jest/get-type" "30.1.0"
|
||||
pretty-format "30.2.0"
|
||||
|
||||
jest-matcher-utils@30.1.2:
|
||||
version "30.1.2"
|
||||
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.1.2.tgz#3f1b63949f740025aff740c6c6a1b653ae370fbb"
|
||||
integrity sha512-7ai16hy4rSbDjvPTuUhuV8nyPBd6EX34HkBsBcBX2lENCuAQ0qKCPb/+lt8OSWUa9WWmGYLy41PrEzkwRwoGZQ==
|
||||
dependencies:
|
||||
"@jest/get-type" "30.1.0"
|
||||
chalk "^4.1.2"
|
||||
jest-diff "30.1.2"
|
||||
pretty-format "30.0.5"
|
||||
|
||||
jest-matcher-utils@30.2.0:
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.2.0.tgz#69a0d4c271066559ec8b0d8174829adc3f23a783"
|
||||
|
@ -4969,21 +4935,6 @@ jest-matcher-utils@30.2.0:
|
|||
jest-diff "30.2.0"
|
||||
pretty-format "30.2.0"
|
||||
|
||||
jest-message-util@30.1.0:
|
||||
version "30.1.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.1.0.tgz#653a9bb1a33306eddf13455ce0666ba621b767c4"
|
||||
integrity sha512-HizKDGG98cYkWmaLUHChq4iN+oCENohQLb7Z5guBPumYs+/etonmNFlg1Ps6yN9LTPyZn+M+b/9BbnHx3WTMDg==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.27.1"
|
||||
"@jest/types" "30.0.5"
|
||||
"@types/stack-utils" "^2.0.3"
|
||||
chalk "^4.1.2"
|
||||
graceful-fs "^4.2.11"
|
||||
micromatch "^4.0.8"
|
||||
pretty-format "30.0.5"
|
||||
slash "^3.0.0"
|
||||
stack-utils "^2.0.6"
|
||||
|
||||
jest-message-util@30.2.0:
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.2.0.tgz#fc97bf90d11f118b31e6131e2b67fc4f39f92152"
|
||||
|
@ -4999,15 +4950,6 @@ jest-message-util@30.2.0:
|
|||
slash "^3.0.0"
|
||||
stack-utils "^2.0.6"
|
||||
|
||||
jest-mock@30.0.5:
|
||||
version "30.0.5"
|
||||
resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.0.5.tgz#ef437e89212560dd395198115550085038570bdd"
|
||||
integrity sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==
|
||||
dependencies:
|
||||
"@jest/types" "30.0.5"
|
||||
"@types/node" "*"
|
||||
jest-util "30.0.5"
|
||||
|
||||
jest-mock@30.2.0:
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.2.0.tgz#69f991614eeb4060189459d3584f710845bff45e"
|
||||
|
@ -5132,18 +5074,6 @@ jest-snapshot@30.2.0:
|
|||
semver "^7.7.2"
|
||||
synckit "^0.11.8"
|
||||
|
||||
jest-util@30.0.5:
|
||||
version "30.0.5"
|
||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.0.5.tgz#035d380c660ad5f1748dff71c4105338e05f8669"
|
||||
integrity sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==
|
||||
dependencies:
|
||||
"@jest/types" "30.0.5"
|
||||
"@types/node" "*"
|
||||
chalk "^4.1.2"
|
||||
ci-info "^4.2.0"
|
||||
graceful-fs "^4.2.11"
|
||||
picomatch "^4.0.2"
|
||||
|
||||
jest-util@30.2.0:
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.2.0.tgz#5142adbcad6f4e53c2776c067a4db3c14f913705"
|
||||
|
@ -6317,10 +6247,10 @@ node-preload@^0.2.1:
|
|||
dependencies:
|
||||
process-on-spawn "^1.0.0"
|
||||
|
||||
node-releases@^2.0.19:
|
||||
version "2.0.19"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314"
|
||||
integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==
|
||||
node-releases@^2.0.21:
|
||||
version "2.0.21"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.21.tgz#f59b018bc0048044be2d4c4c04e4c8b18160894c"
|
||||
integrity sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw==
|
||||
|
||||
nopt@3.x:
|
||||
version "3.0.6"
|
||||
|
@ -6799,15 +6729,6 @@ prettier@^3.6.0:
|
|||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393"
|
||||
integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==
|
||||
|
||||
pretty-format@30.0.5:
|
||||
version "30.0.5"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.0.5.tgz#e001649d472800396c1209684483e18a4d250360"
|
||||
integrity sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==
|
||||
dependencies:
|
||||
"@jest/schemas" "30.0.5"
|
||||
ansi-styles "^5.2.0"
|
||||
react-is "^18.3.1"
|
||||
|
||||
pretty-format@30.2.0, pretty-format@^30.0.0, pretty-format@^30.0.5:
|
||||
version "30.2.0"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.2.0.tgz#2d44fe6134529aed18506f6d11509d8a62775ebe"
|
||||
|
@ -7258,10 +7179,10 @@ schema-utils@^3.0.0, schema-utils@^3.1.1:
|
|||
ajv "^6.12.5"
|
||||
ajv-keywords "^3.5.2"
|
||||
|
||||
schema-utils@^4.0.0, schema-utils@^4.3.0, schema-utils@^4.3.2:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.2.tgz#0c10878bf4a73fd2b1dfd14b9462b26788c806ae"
|
||||
integrity sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==
|
||||
schema-utils@^4.0.0, schema-utils@^4.3.0, schema-utils@^4.3.3:
|
||||
version "4.3.3"
|
||||
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.3.tgz#5b1850912fa31df90716963d45d9121fdfc09f46"
|
||||
integrity sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.9"
|
||||
ajv "^8.9.0"
|
||||
|
@ -7764,10 +7685,10 @@ synckit@^0.11.7, synckit@^0.11.8:
|
|||
dependencies:
|
||||
"@pkgr/core" "^0.2.4"
|
||||
|
||||
tapable@^2.2.0, tapable@^2.2.1, tapable@^2.2.3:
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.3.tgz#4b67b635b2d97578a06a2713d2f04800c237e99b"
|
||||
integrity sha512-ZL6DDuAlRlLGghwcfmSn9sK3Hr6ArtyudlSAiCqQ6IfE+b+HHbydbYDIG15IfS5do+7XQQBdBiubF/cV2dnDzg==
|
||||
tapable@^2.2.0, tapable@^2.2.1, tapable@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.0.tgz#7e3ea6d5ca31ba8e078b560f0d83ce9a14aa8be6"
|
||||
integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==
|
||||
|
||||
tar@^7.4.3:
|
||||
version "7.4.3"
|
||||
|
@ -8052,10 +7973,10 @@ typedarray-to-buffer@^3.1.5:
|
|||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@^5.9.2:
|
||||
version "5.9.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6"
|
||||
integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==
|
||||
typescript@^5.9.3:
|
||||
version "5.9.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f"
|
||||
integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==
|
||||
|
||||
uglify-js@^3.1.4:
|
||||
version "3.19.3"
|
||||
|
@ -8072,11 +7993,6 @@ unbox-primitive@^1.1.0:
|
|||
has-symbols "^1.1.0"
|
||||
which-boxed-primitive "^1.1.1"
|
||||
|
||||
undici-types@~7.10.0:
|
||||
version "7.10.0"
|
||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350"
|
||||
integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==
|
||||
|
||||
undici-types@~7.13.0:
|
||||
version "7.13.0"
|
||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.13.0.tgz#a20ba7c0a2be0c97bd55c308069d29d167466bff"
|
||||
|
|
Loading…
Reference in New Issue