diff --git a/cspell.json b/cspell.json index 6f403c0f4..8f3dba2d1 100644 --- a/cspell.json +++ b/cspell.json @@ -3,6 +3,7 @@ "language": "en", "words": [ "absolutify", + "abortable", "acircular", "amdmodule", "analyse", diff --git a/lib/APIPlugin.js b/lib/APIPlugin.js index cc13392b8..3d1384ba6 100644 --- a/lib/APIPlugin.js +++ b/lib/APIPlugin.js @@ -25,6 +25,7 @@ const GetFullHashRuntimeModule = require("./runtime/GetFullHashRuntimeModule"); /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("./Module").BuildInfo} BuildInfo */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ /** @typedef {import("./javascript/JavascriptParser").Range} Range */ @@ -187,7 +188,7 @@ class APIPlugin { hooks.renderModuleContent.tap( PLUGIN_NAME, (source, module, renderContext) => { - if (module.buildInfo.needCreateRequire) { + if (/** @type {BuildInfo} */ (module.buildInfo).needCreateRequire) { const chunkInitFragments = [ new InitFragment( 'import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";\n', @@ -214,7 +215,8 @@ class APIPlugin { const dep = toConstantDependency(parser, info.expr, info.req); if (key === "__non_webpack_require__" && this.options.module) { - parser.state.module.buildInfo.needCreateRequire = true; + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).needCreateRequire = true; } return dep(expression); @@ -267,7 +269,8 @@ class APIPlugin { parser.hooks.expression .for("__webpack_module__.id") .tap(PLUGIN_NAME, expr => { - parser.state.module.buildInfo.moduleConcatenationBailout = + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).moduleConcatenationBailout = "__webpack_module__.id"; const dep = new ConstDependency( parser.state.module.moduleArgument + ".id", @@ -282,7 +285,8 @@ class APIPlugin { parser.hooks.expression .for("__webpack_module__") .tap(PLUGIN_NAME, expr => { - parser.state.module.buildInfo.moduleConcatenationBailout = + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).moduleConcatenationBailout = "__webpack_module__"; const dep = new ConstDependency( parser.state.module.moduleArgument, diff --git a/lib/LibManifestPlugin.js b/lib/LibManifestPlugin.js index e3d5c3ec3..527231aa4 100644 --- a/lib/LibManifestPlugin.js +++ b/lib/LibManifestPlugin.js @@ -12,6 +12,7 @@ const { compareModulesById } = require("./util/comparators"); const { dirname, mkdirp } = require("./util/fs"); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Compiler").IntermediateFileSystem} IntermediateFileSystem */ /** @typedef {import("./Module").BuildMeta} BuildMeta */ /** @@ -113,16 +114,16 @@ class LibManifestPlugin { ? JSON.stringify(manifest, null, 2) : JSON.stringify(manifest); const buffer = Buffer.from(manifestContent, "utf8"); + const intermediateFileSystem = + /** @type {IntermediateFileSystem} */ ( + compiler.intermediateFileSystem + ); mkdirp( - compiler.intermediateFileSystem, - dirname(compiler.intermediateFileSystem, targetPath), + intermediateFileSystem, + dirname(intermediateFileSystem, targetPath), err => { if (err) return callback(err); - compiler.intermediateFileSystem.writeFile( - targetPath, - buffer, - callback - ); + intermediateFileSystem.writeFile(targetPath, buffer, callback); } ); }, diff --git a/lib/RuntimeTemplate.js b/lib/RuntimeTemplate.js index 805db6a6e..81f148448 100644 --- a/lib/RuntimeTemplate.js +++ b/lib/RuntimeTemplate.js @@ -86,7 +86,9 @@ class RuntimeTemplate { this.compilation = compilation; this.outputOptions = outputOptions || {}; this.requestShortener = requestShortener; - this.globalObject = getGlobalObject(outputOptions.globalObject); + this.globalObject = + /** @type {string} */ + (getGlobalObject(outputOptions.globalObject)); this.contentHashReplacement = "X".repeat( /** @type {NonNullable} */ (outputOptions.hashDigestLength) diff --git a/lib/javascript/JavascriptParserHelpers.js b/lib/javascript/JavascriptParserHelpers.js index 4d5298876..be85e9e14 100644 --- a/lib/javascript/JavascriptParserHelpers.js +++ b/lib/javascript/JavascriptParserHelpers.js @@ -18,7 +18,7 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression"); /** * @param {JavascriptParser} parser the parser * @param {string} value the const value - * @param {string[]=} runtimeRequirements runtime requirements + * @param {(string[] | null)=} runtimeRequirements runtime requirements * @returns {function(Expression): true} plugin function */ exports.toConstantDependency = (parser, value, runtimeRequirements) => { diff --git a/lib/logging/Logger.js b/lib/logging/Logger.js index 8258027a4..641bc7ca0 100644 --- a/lib/logging/Logger.js +++ b/lib/logging/Logger.js @@ -95,19 +95,32 @@ class WebpackLogger { this[LOG_SYMBOL](LogType.groupEnd, args); } + /** + * @param {string=} label label + */ profile(label) { this[LOG_SYMBOL](LogType.profile, [label]); } + /** + * @param {string=} label label + */ profileEnd(label) { this[LOG_SYMBOL](LogType.profileEnd, [label]); } + /** + * @param {string} label label + */ time(label) { + /** @type {Map} */ this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map(); this[TIMERS_SYMBOL].set(label, process.hrtime()); } + /** + * @param {string=} label label + */ timeLog(label) { const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); if (!prev) { @@ -117,16 +130,23 @@ class WebpackLogger { this[LOG_SYMBOL](LogType.time, [label, ...time]); } + /** + * @param {string=} label label + */ timeEnd(label) { const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); if (!prev) { throw new Error(`No such label '${label}' for WebpackLogger.timeEnd()`); } const time = process.hrtime(prev); - this[TIMERS_SYMBOL].delete(label); + /** @type {Map} */ + (this[TIMERS_SYMBOL]).delete(label); this[LOG_SYMBOL](LogType.time, [label, ...time]); } + /** + * @param {string=} label label + */ timeAggregate(label) { const prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label); if (!prev) { @@ -135,7 +155,9 @@ class WebpackLogger { ); } const time = process.hrtime(prev); - this[TIMERS_SYMBOL].delete(label); + /** @type {Map} */ + (this[TIMERS_SYMBOL]).delete(label); + /** @type {Map} */ this[TIMERS_AGGREGATES_SYMBOL] = this[TIMERS_AGGREGATES_SYMBOL] || new Map(); const current = this[TIMERS_AGGREGATES_SYMBOL].get(label); @@ -151,6 +173,9 @@ class WebpackLogger { this[TIMERS_AGGREGATES_SYMBOL].set(label, time); } + /** + * @param {string=} label label + */ timeAggregateEnd(label) { if (this[TIMERS_AGGREGATES_SYMBOL] === undefined) return; const time = this[TIMERS_AGGREGATES_SYMBOL].get(label); diff --git a/lib/logging/createConsoleLogger.js b/lib/logging/createConsoleLogger.js index 062991225..4cba9cf12 100644 --- a/lib/logging/createConsoleLogger.js +++ b/lib/logging/createConsoleLogger.js @@ -41,7 +41,7 @@ const { LogType } = require("./Logger"); /** * @param {FilterItemTypes} item an input item - * @returns {FilterFunction} filter function + * @returns {FilterFunction | undefined} filter function */ const filterToFunction = item => { if (typeof item === "string") { @@ -81,11 +81,14 @@ const LogLevel = { */ module.exports = ({ level = "info", debug = false, console }) => { const debugFilters = - typeof debug === "boolean" - ? [() => debug] - : /** @type {FilterItemTypes[]} */ ([]) - .concat(debug) - .map(filterToFunction); + /** @type {FilterFunction[]} */ + ( + typeof debug === "boolean" + ? [() => debug] + : /** @type {FilterItemTypes[]} */ ([]) + .concat(debug) + .map(filterToFunction) + ); /** @type {number} */ const loglevel = LogLevel[`${level}`] || 0; diff --git a/lib/node/NodeEnvironmentPlugin.js b/lib/node/NodeEnvironmentPlugin.js index 7d53eb1d9..0d297bd48 100644 --- a/lib/node/NodeEnvironmentPlugin.js +++ b/lib/node/NodeEnvironmentPlugin.js @@ -5,7 +5,7 @@ "use strict"; -const CachedInputFileSystem = require("enhanced-resolve/lib/CachedInputFileSystem"); +const CachedInputFileSystem = require("enhanced-resolve").CachedInputFileSystem; const fs = require("graceful-fs"); const createConsoleLogger = require("../logging/createConsoleLogger"); const NodeWatchFileSystem = require("./NodeWatchFileSystem"); @@ -13,6 +13,7 @@ const nodeConsole = require("./nodeConsole"); /** @typedef {import("../../declarations/WebpackOptions").InfrastructureLogging} InfrastructureLogging */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ class NodeEnvironmentPlugin { /** @@ -38,18 +39,23 @@ class NodeEnvironmentPlugin { nodeConsole({ colors: infrastructureLogging.colors, appendOnly: infrastructureLogging.appendOnly, - stream: infrastructureLogging.stream + stream: + /** @type {NodeJS.WritableStream} */ + (infrastructureLogging.stream) }) }); compiler.inputFileSystem = new CachedInputFileSystem(fs, 60000); - const inputFileSystem = compiler.inputFileSystem; + const inputFileSystem = + /** @type {InputFileSystem} */ + (compiler.inputFileSystem); compiler.outputFileSystem = fs; compiler.intermediateFileSystem = fs; - compiler.watchFileSystem = new NodeWatchFileSystem( - compiler.inputFileSystem - ); + compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem); compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", compiler => { - if (compiler.inputFileSystem === inputFileSystem) { + if ( + compiler.inputFileSystem === inputFileSystem && + inputFileSystem.purge + ) { compiler.fsStartTime = Date.now(); inputFileSystem.purge(); } diff --git a/lib/node/NodeWatchFileSystem.js b/lib/node/NodeWatchFileSystem.js index 13befb709..9e8b67237 100644 --- a/lib/node/NodeWatchFileSystem.js +++ b/lib/node/NodeWatchFileSystem.js @@ -10,11 +10,15 @@ const Watchpack = require("watchpack"); /** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */ /** @typedef {import("../FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */ +/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ /** @typedef {import("../util/fs").WatchFileSystem} WatchFileSystem */ /** @typedef {import("../util/fs").WatchMethod} WatchMethod */ /** @typedef {import("../util/fs").Watcher} Watcher */ class NodeWatchFileSystem { + /** + * @param {InputFileSystem} inputFileSystem input filesystem + */ constructor(inputFileSystem) { this.inputFileSystem = inputFileSystem; this.watcherOptions = { @@ -29,7 +33,7 @@ class NodeWatchFileSystem { * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {WatchOptions} options options object - * @param {function((Error | null)=, Map, Map, Set, Set): void} callback aggregated callback + * @param {function(Error | null, Map, Map, Set, Set): void} callback aggregated callback * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ @@ -81,28 +85,35 @@ class NodeWatchFileSystem { } return { fileTimeInfoEntries, contextTimeInfoEntries }; }; - this.watcher.once("aggregated", (changes, removals) => { - // pause emitting events (avoids clearing aggregated changes and removals on timeout) - this.watcher.pause(); + this.watcher.once( + "aggregated", + /** + * @param {Set} changes changes + * @param {Set} removals removals + */ + (changes, removals) => { + // pause emitting events (avoids clearing aggregated changes and removals on timeout) + this.watcher.pause(); - if (this.inputFileSystem && this.inputFileSystem.purge) { const fs = this.inputFileSystem; - for (const item of changes) { - fs.purge(item); - } - for (const item of removals) { - fs.purge(item); + if (fs && fs.purge) { + for (const item of changes) { + fs.purge(item); + } + for (const item of removals) { + fs.purge(item); + } } + const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo(); + callback( + null, + fileTimeInfoEntries, + contextTimeInfoEntries, + changes, + removals + ); } - const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo(); - callback( - null, - fileTimeInfoEntries, - contextTimeInfoEntries, - changes, - removals - ); - }); + ); this.watcher.watch({ files, directories, missing, startTime }); @@ -124,8 +135,8 @@ class NodeWatchFileSystem { getAggregatedRemovals: util.deprecate( () => { const items = this.watcher && this.watcher.aggregatedRemovals; - if (items && this.inputFileSystem && this.inputFileSystem.purge) { - const fs = this.inputFileSystem; + const fs = this.inputFileSystem; + if (items && fs && fs.purge) { for (const item of items) { fs.purge(item); } @@ -138,8 +149,8 @@ class NodeWatchFileSystem { getAggregatedChanges: util.deprecate( () => { const items = this.watcher && this.watcher.aggregatedChanges; - if (items && this.inputFileSystem && this.inputFileSystem.purge) { - const fs = this.inputFileSystem; + const fs = this.inputFileSystem; + if (items && fs && fs.purge) { for (const item of items) { fs.purge(item); } @@ -166,8 +177,8 @@ class NodeWatchFileSystem { getInfo: () => { const removals = this.watcher && this.watcher.aggregatedRemovals; const changes = this.watcher && this.watcher.aggregatedChanges; - if (this.inputFileSystem && this.inputFileSystem.purge) { - const fs = this.inputFileSystem; + const fs = this.inputFileSystem; + if (fs && fs.purge) { if (removals) { for (const item of removals) { fs.purge(item); diff --git a/lib/node/nodeConsole.js b/lib/node/nodeConsole.js index 24676d118..cccd02f0a 100644 --- a/lib/node/nodeConsole.js +++ b/lib/node/nodeConsole.js @@ -8,12 +8,29 @@ const util = require("util"); const truncateArgs = require("../logging/truncateArgs"); +/** @typedef {import("../logging/createConsoleLogger").LoggerConsole} LoggerConsole */ + +/** + * @param {Object} options options + * @param {boolean=} options.colors colors + * @param {boolean=} options.appendOnly append only + * @param {NodeJS.WritableStream} options.stream stream + * @returns {LoggerConsole} logger function + */ module.exports = ({ colors, appendOnly, stream }) => { + /** @type {string[] | undefined} */ let currentStatusMessage = undefined; let hasStatusMessage = false; let currentIndent = ""; let currentCollapsed = 0; + /** + * @param {string} str string + * @param {string} prefix prefix + * @param {string} colorPrefix color prefix + * @param {string} colorSuffix color suffix + * @returns {string} indented string + */ const indent = (str, prefix, colorPrefix, colorSuffix) => { if (str === "") return str; prefix = currentIndent + prefix; @@ -38,7 +55,7 @@ module.exports = ({ colors, appendOnly, stream }) => { const writeStatusMessage = () => { if (!currentStatusMessage) return; - const l = stream.columns || 40; + const l = /** @type {TODO} */ (stream).columns || 40; const args = truncateArgs(currentStatusMessage, l - 1); const str = args.join(" "); const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`; @@ -46,6 +63,12 @@ module.exports = ({ colors, appendOnly, stream }) => { hasStatusMessage = true; }; + /** + * @param {string} prefix prefix + * @param {string} colorPrefix color prefix + * @param {string} colorSuffix color suffix + * @returns {(function(...any[]): void)} function to write with colors + */ const writeColored = (prefix, colorPrefix, colorSuffix) => { return (...args) => { if (currentCollapsed > 0) return; diff --git a/lib/rules/ObjectMatcherRulePlugin.js b/lib/rules/ObjectMatcherRulePlugin.js index 613429e8c..f912604a0 100644 --- a/lib/rules/ObjectMatcherRulePlugin.js +++ b/lib/rules/ObjectMatcherRulePlugin.js @@ -9,6 +9,10 @@ /** @typedef {import("./RuleSetCompiler").RuleCondition} RuleCondition */ class ObjectMatcherRulePlugin { + /** + * @param {string} ruleProperty the rule property + * @param {string=} dataProperty the data property + */ constructor(ruleProperty, dataProperty) { this.ruleProperty = ruleProperty; this.dataProperty = dataProperty || ruleProperty; diff --git a/lib/util/fs.js b/lib/util/fs.js index 73167e3d3..4052a6a84 100644 --- a/lib/util/fs.js +++ b/lib/util/fs.js @@ -11,7 +11,8 @@ const path = require("path"); /** @typedef {import("../FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */ /** - * @typedef {Object} IStats + * @template T + * @typedef {Object} IStatsBase * @property {() => boolean} isFile * @property {() => boolean} isDirectory * @property {() => boolean} isBlockDevice @@ -19,20 +20,20 @@ const path = require("path"); * @property {() => boolean} isSymbolicLink * @property {() => boolean} isFIFO * @property {() => boolean} isSocket - * @property {number | bigint} dev - * @property {number | bigint} ino - * @property {number | bigint} mode - * @property {number | bigint} nlink - * @property {number | bigint} uid - * @property {number | bigint} gid - * @property {number | bigint} rdev - * @property {number | bigint} size - * @property {number | bigint} blksize - * @property {number | bigint} blocks - * @property {number | bigint} atimeMs - * @property {number | bigint} mtimeMs - * @property {number | bigint} ctimeMs - * @property {number | bigint} birthtimeMs + * @property {T} dev + * @property {T} ino + * @property {T} mode + * @property {T} nlink + * @property {T} uid + * @property {T} gid + * @property {T} rdev + * @property {T} size + * @property {T} blksize + * @property {T} blocks + * @property {T} atimeMs + * @property {T} mtimeMs + * @property {T} ctimeMs + * @property {T} birthtimeMs * @property {Date} atime * @property {Date} mtime * @property {Date} ctime @@ -40,7 +41,15 @@ const path = require("path"); */ /** - * @typedef {Object} IDirent + * @typedef {IStatsBase} IStats + */ + +/** + * @typedef {IStatsBase & { atimeNs: bigint, mtimeNs: bigint, ctimeNs: bigint, birthtimeNs: bigint }} IBigIntStats + */ + +/** + * @typedef {Object} Dirent * @property {() => boolean} isFile * @property {() => boolean} isDirectory * @property {() => boolean} isBlockDevice @@ -48,18 +57,28 @@ const path = require("path"); * @property {() => boolean} isSymbolicLink * @property {() => boolean} isFIFO * @property {() => boolean} isSocket - * @property {string | Buffer} name + * @property {string} name + * @property {string} path */ -/** @typedef {function((NodeJS.ErrnoException | null)=): void} Callback */ -/** @typedef {function((NodeJS.ErrnoException | null)=, Buffer=): void} BufferCallback */ -/** @typedef {function((NodeJS.ErrnoException | null)=, Buffer|string=): void} BufferOrStringCallback */ -/** @typedef {function((NodeJS.ErrnoException | null)=, (string | Buffer)[] | IDirent[]=): void} DirentArrayCallback */ -/** @typedef {function((NodeJS.ErrnoException | null)=, string=): void} StringCallback */ -/** @typedef {function((NodeJS.ErrnoException | null)=, number=): void} NumberCallback */ -/** @typedef {function((NodeJS.ErrnoException | null)=, IStats=): void} StatsCallback */ -/** @typedef {function((NodeJS.ErrnoException | Error | null)=, any=): void} ReadJsonCallback */ -/** @typedef {function((NodeJS.ErrnoException | Error | null)=, IStats|string=): void} LstatReadlinkAbsoluteCallback */ +/** @typedef {string | number | boolean | null} JsonPrimitive */ +/** @typedef {JsonValue[]} JsonArray */ +/** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ +/** @typedef {{[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined}} JsonObject */ + +/** @typedef {function(NodeJS.ErrnoException | null): void} NoParamCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, string=): void} StringCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, Buffer=): void} BufferCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, (string | Buffer)=): void} StringOrBufferCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, (string[])=): void} ReaddirStringCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, (Buffer[])=): void} ReaddirBufferCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, (string[] | Buffer[])=): void} ReaddirStringOrBufferCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, (Dirent[])=): void} ReaddirDirentCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, IStats=): void} StatsCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, IBigIntStats=): void} BigIntStatsCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, (IStats | IBigIntStats)=): void} StatsOrBigIntStatsCallback */ +/** @typedef {function(NodeJS.ErrnoException | null, number=): void} NumberCallback */ +/** @typedef {function(NodeJS.ErrnoException | Error | null, JsonObject=): void} ReadJsonCallback */ /** * @typedef {Object} WatcherInfo @@ -88,38 +107,244 @@ const path = require("path"); * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {WatchOptions} options options object - * @param {function(Error=, Map, Map, Set, Set): void} callback aggregated callback + * @param {function(Error | null, Map, Map, Set, Set): void} callback aggregated callback * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ -// TODO webpack 6 make optional methods required +// TODO webpack 6 make optional methods required and avoid using non standard methods like `join`, `relative`, `dirname`, move IntermediateFileSystemExtras methods to InputFilesystem or OutputFilesystem /** - * @typedef {Object} OutputFileSystem - * @property {function(string, Buffer|string, Callback): void} writeFile - * @property {function(string, Callback): void} mkdir - * @property {function(string, DirentArrayCallback): void=} readdir - * @property {function(string, Callback): void=} rmdir - * @property {function(string, Callback): void=} unlink - * @property {function(string, StatsCallback): void} stat - * @property {function(string, StatsCallback): void=} lstat - * @property {function(string, BufferOrStringCallback): void} readFile + * @typedef {string | Buffer | URL} PathLike + */ + +/** + * @typedef {PathLike | number} PathOrFileDescriptor + */ + +/** + * @typedef {Object} ObjectEncodingOptions + * @property {BufferEncoding | null | undefined} [encoding] + */ + +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options: ({ encoding?: null | undefined, flag?: string | undefined } & import("events").Abortable) | undefined | null, callback: BufferCallback): void; + * (path: PathOrFileDescriptor, options: ({ encoding: BufferEncoding, flag?: string | undefined } & import("events").Abortable) | BufferEncoding, callback: StringCallback): void; + * (path: PathOrFileDescriptor, options: (ObjectEncodingOptions & { flag?: string | undefined } & import("events").Abortable) | BufferEncoding | undefined | null, callback: StringOrBufferCallback): void; + * (path: PathOrFileDescriptor, callback: BufferCallback): void; + * }} ReadFile + */ + +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options?: { encoding?: null | undefined, flag?: string | undefined } | null): Buffer; + * (path: PathOrFileDescriptor, options: { encoding: BufferEncoding, flag?: string | undefined } | BufferEncoding): string; + * (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { flag?: string | undefined }) | BufferEncoding | null): string | Buffer; + * }} ReadFileSync + */ + +/** + * @typedef {ObjectEncodingOptions | BufferEncoding | undefined | null} EncodingOption + */ + +/** + * @typedef {'buffer'| { encoding: 'buffer' }} BufferEncodingOption + */ + +/** + * @typedef {Object} StatOptions + * @property {(boolean | undefined)=} bigint + */ + +/** + * @typedef {Object} StatSyncOptions + * @property {(boolean | undefined)=} bigint + * @property {(boolean | undefined)=} throwIfNoEntry + */ + +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void; + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void; + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void; + * (path: PathLike, callback: StringCallback): void; + * }} Readlink + */ + +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string; + * (path: PathLike, options: BufferEncodingOption): Buffer; + * (path: PathLike, options?: EncodingOption): string | Buffer; + * }} ReadlinkSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null, callback: ReaddirStringCallback): void; + * (path: PathLike, options: { encoding: 'buffer', withFileTypes?: false | undefined, recursive?: boolean | undefined } | 'buffer', callback: ReaddirBufferCallback): void; + * (path: PathLike, callback: ReaddirStringCallback): void; + * (path: PathLike, options: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | undefined | null, callback: ReaddirStringOrBufferCallback): void; + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }, callback: ReaddirDirentCallback): void; + * }} Readdir + */ + +/** + * @typedef {{ + * (path: PathLike, options?: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | null): string[]; + * (path: PathLike, options: { encoding: 'buffer', withFileTypes?: false | undefined, recursive?: boolean | undefined } | 'buffer'): Buffer[]; + * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[]; + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[]; + * }} ReaddirSync + */ + +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void; + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void; + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void; + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void; + * }} Stat + */ + +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined; + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats; + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats; + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined; + * }} StatSync + */ + +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void; + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void; + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void; + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void; + * }} LStat + */ + +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined; + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined; + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats; + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats; + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined; + * }} LStatSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void; + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void; + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void; + * (path: PathLike, callback: StringCallback): void; + * }} RealPath + */ + +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string; + * (path: PathLike, options: BufferEncodingOption): Buffer; + * (path: PathLike, options?: EncodingOption): string | Buffer; + * }} RealPathSync + */ + +/** + * @typedef {function(PathOrFileDescriptor, ReadJsonCallback): void} ReadJson + */ + +/** + * @typedef {function(PathOrFileDescriptor): JsonObject} ReadJsonSync + */ + +/** + * @typedef {function((string | string[] | Set)=): void} Purge + */ + +/** + * @typedef {Object} InputFileSystem + * @property {ReadFile} readFile + * @property {ReadFileSync=} readFileSync + * @property {Readlink} readlink + * @property {ReadlinkSync=} readlinkSync + * @property {Readdir} readdir + * @property {ReaddirSync=} readdirSync + * @property {Stat} stat + * @property {StatSync=} statSync + * @property {LStat=} lstat + * @property {LStatSync=} lstatSync + * @property {RealPath=} realpath + * @property {RealPathSync=} realpathSync + * @property {ReadJson=} readJson + * @property {ReadJsonSync=} readJsonSync + * @property {Purge=} purge * @property {(function(string, string): string)=} join * @property {(function(string, string): string)=} relative * @property {(function(string): string)=} dirname */ /** - * @typedef {Object} InputFileSystem - * @property {function(string, BufferOrStringCallback): void} readFile - * @property {(function(string, ReadJsonCallback): void)=} readJson - * @property {function(string, BufferOrStringCallback): void} readlink - * @property {function(string, DirentArrayCallback): void} readdir - * @property {function(string, StatsCallback): void} stat - * @property {function(string, StatsCallback): void=} lstat - * @property {(function(string, BufferOrStringCallback): void)=} realpath - * @property {(function(string=): void)=} purge + * @typedef {number | string} Mode + */ + +/** + * @typedef {(ObjectEncodingOptions & import("events").Abortable & { mode?: Mode | undefined, flag?: string | undefined, flush?: boolean | undefined }) | BufferEncoding | null} WriteFileOptions + */ + +/** + * @typedef {{ + * (file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; + * (file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; + * }} WriteFile + */ + +/** + * @typedef {{ recursive?: boolean | undefined, mode?: Mode | undefined }} MakeDirectoryOptions + */ + +/** + * @typedef {{ + * (file: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: StringCallback): void; + * (file: PathLike, options: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null | undefined, callback: NoParamCallback): void; + * (file: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: StringCallback): void; + * (file: PathLike, callback: NoParamCallback): void; + * }} Mkdir + */ + +/** + * @typedef {{ maxRetries?: number | undefined, recursive?: boolean | undefined, retryDelay?: number | undefined }} RmDirOptions + */ + +/** + * @typedef {{ + * (file: PathLike, callback: NoParamCallback): void; + * (file: PathLike, options: RmDirOptions, callback: NoParamCallback): void; + * }} Rmdir + */ + +/** + * @typedef {function(PathLike, NoParamCallback): void} Unlink + */ + +/** + * @typedef {Object} OutputFileSystem + * @property {WriteFile} writeFile + * @property {Mkdir} mkdir + * @property {Readdir=} readdir + * @property {Rmdir=} rmdir + * @property {Unlink=} unlink + * @property {Stat} stat + * @property {LStat=} lstat + * @property {ReadFile} readFile * @property {(function(string, string): string)=} join * @property {(function(string, string): string)=} relative * @property {(function(string): string)=} dirname @@ -130,14 +355,97 @@ const path = require("path"); * @property {WatchMethod} watch */ +/** + * @typedef {{ + * (path: PathLike, options: MakeDirectoryOptions & { recursive: true }): string | undefined; + * (path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined }) | null): void; + * (path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + * }} MkdirSync + */ + +/** + * @typedef {Object} StreamOptions + * @property {(string | undefined)=} flags + * @property {(BufferEncoding | undefined)} encoding + * @property {(number | any | undefined)=} fd + * @property {(number | undefined)=} mode + * @property {(boolean | undefined)=} autoClose + * @property {(boolean | undefined)=} emitClose + * @property {(number | undefined)=} start + * @property {(AbortSignal | null | undefined)=} signal + */ + +/** + * @typedef {Object} FSImplementation + * @property {((...args: any[]) => any)=} open + * @property {((...args: any[]) => any)=} close + */ + +/** + * @typedef {FSImplementation & { write: (...args: any[]) => any; close?: (...args: any[]) => any }} CreateWriteStreamFSImplementation + */ + +/** + * @typedef {StreamOptions & { fs?: CreateWriteStreamFSImplementation | null | undefined }} WriteStreamOptions + */ + +/** + * @typedef {function(PathLike, (BufferEncoding | WriteStreamOptions)=): NodeJS.WritableStream} CreateWriteStream + */ + +/** + * @typedef {number | string} OpenMode + */ + +/** + * @typedef {{ + * (file: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: NumberCallback): void; + * (file: PathLike, flags: OpenMode | undefined, callback: NumberCallback): void; + * (file: PathLike, callback: NumberCallback): void; + * }} Open + */ + +/** + * @typedef {number | bigint} ReadPosition + */ + +/** + * @typedef {Object} ReadSyncOptions + * @property {(number | undefined)=} offset + * @property {(number | undefined)=} length + * @property {(ReadPosition | null | undefined)=} position + */ + +/** + * @template {NodeJS.ArrayBufferView} TBuffer + * @typedef {Object} ReadAsyncOptions + * @property {(number | undefined)=} offset + * @property {(number | undefined)=} length + * @property {(ReadPosition | null | undefined)=} position + * @property {TBuffer=} buffer + */ + +/** + * @template {NodeJS.ArrayBufferView} [TBuffer=Buffer] + * @typedef {{ + * (fd: number, buffer: TBuffer, offset: number, length: number, position: ReadPosition | null, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void; + * (fd: number, options: ReadAsyncOptions, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void; + * (fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; + * }} Read + */ + +/** @typedef {function(number, NoParamCallback): void} Close */ + +/** @typedef {function(PathLike, PathLike, NoParamCallback): void} Rename */ + /** * @typedef {Object} IntermediateFileSystemExtras - * @property {function(string): void} mkdirSync - * @property {function(string): NodeJS.WritableStream} createWriteStream - * @property {function(string, string, NumberCallback): void} open - * @property {function(number, Buffer, number, number, number, NumberCallback): void} read - * @property {function(number, Callback): void} close - * @property {function(string, string, Callback): void} rename + * @property {MkdirSync} mkdirSync + * @property {CreateWriteStream} createWriteStream + * @property {Open} open + * @property {Read} read + * @property {Close} close + * @property {Rename} rename */ /** @typedef {InputFileSystem & OutputFileSystem & IntermediateFileSystemExtras} IntermediateFileSystem */ @@ -260,7 +568,7 @@ const mkdirpSync = (fs, p) => { fs.mkdirSync(p); } catch (err) { if (err) { - if (err.code === "ENOENT") { + if (/** @type {NodeJS.ErrnoException} */ (err).code === "ENOENT") { const dir = dirname(fs, p); if (dir === p) { throw err; @@ -268,7 +576,7 @@ const mkdirpSync = (fs, p) => { mkdirpSync(fs, dir); fs.mkdirSync(p); return; - } else if (err.code === "EEXIST") { + } else if (/** @type {NodeJS.ErrnoException} */ (err).code === "EEXIST") { return; } throw err; @@ -304,7 +612,7 @@ exports.readJson = readJson; /** * @param {InputFileSystem} fs a file system * @param {string} p an absolute path - * @param {ReadJsonCallback} callback callback + * @param {function(NodeJS.ErrnoException | Error | null, (IStats | string)=): void} callback callback * @returns {void} */ const lstatReadlinkAbsolute = (fs, p, callback) => { diff --git a/package.json b/package.json index dfd679d12..c6032f28e 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,12 @@ "acorn-import-assertions": "^1.9.0", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.16.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", @@ -80,7 +80,7 @@ "lint-staged": "^13.2.1", "lodash": "^4.17.19", "lodash-es": "^4.17.15", - "memfs": "^3.5.0", + "memfs": "^3.6.0", "mini-css-extract-plugin": "^1.6.1", "mini-svg-data-uri": "^1.2.3", "nyc": "^15.1.0", diff --git a/test/configCases/types/filesystems/webpack.config.js b/test/configCases/types/filesystems/webpack.config.js index 2180a04e5..36c632723 100644 --- a/test/configCases/types/filesystems/webpack.config.js +++ b/test/configCases/types/filesystems/webpack.config.js @@ -5,8 +5,14 @@ const fs = require("fs"); module.exports = { plugins: [ compiler => { + // eslint-disable-next-line no-warning-comments + // @ts-ignore compiler.outputFileSystem = memfs.fs; + // eslint-disable-next-line no-warning-comments + // @ts-ignore compiler.inputFileSystem = memfs.fs; + // eslint-disable-next-line no-warning-comments + // @ts-ignore compiler.intermediateFileSystem = memfs.fs; compiler.outputFileSystem = fs; diff --git a/types.d.ts b/types.d.ts index 87e96966b..93b84fc09 100644 --- a/types.d.ts +++ b/types.d.ts @@ -83,7 +83,6 @@ import { WithStatement, YieldExpression } from "estree"; -import { Dirent } from "fs"; import { IncomingMessage, ServerOptions as ServerOptionsImport, @@ -106,8 +105,15 @@ import { SyncWaterfallHook } from "tapable"; import { SecureContextOptions, TlsOptions } from "tls"; +import { URL } from "url"; import { Context } from "vm"; +declare interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal; +} declare class AbstractLibraryPlugin { constructor(__0: { /** @@ -237,6 +243,19 @@ declare interface ArgumentConfig { type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset"; values?: any[]; } +type ArrayBufferView = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array + | DataView; declare interface Assertions { [index: string]: any; } @@ -484,7 +503,7 @@ declare interface BaseResolveRequest { context?: object; descriptionFilePath?: string; descriptionFileRoot?: string; - descriptionFileData?: JsonObject; + descriptionFileData?: JsonObjectTypes; relativePath?: string; ignoreSymlinks?: boolean; fullySpecified?: boolean; @@ -817,6 +836,32 @@ declare abstract class BasicEvaluatedExpression { | TemplateElement ): BasicEvaluatedExpression; } +type BufferEncodingBuffer = + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; +type BufferEncodingOption = "buffer" | { encoding: "buffer" }; +type BufferEncodingTypes = + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; type BuildInfo = KnownBuildInfo & Record; type BuildMeta = KnownBuildMeta & Record; declare abstract class ByTypeGenerator extends Generator { @@ -2582,12 +2627,12 @@ declare interface Configuration { /** * Options for the resolver. */ - resolve?: ResolveOptionsWebpackOptions; + resolve?: ResolveOptions; /** * Options for the resolver when resolving loaders. */ - resolveLoader?: ResolveOptionsWebpackOptions; + resolveLoader?: ResolveOptions; /** * Options affecting how file system snapshots are created and validated. @@ -2897,6 +2942,10 @@ declare interface ContextTimestampAndHash { } type CreateStatsOptionsContext = KnownCreateStatsOptionsContext & Record; +type CreateWriteStreamFSImplementation = FSImplementation & { + write: (...args: any[]) => any; + close?: (...args: any[]) => any; +}; /** * Generator options for css/auto modules. @@ -3310,6 +3359,17 @@ declare interface DeterministicModuleIdsPluginOptions { */ failOnConflict?: boolean; } +declare interface Dirent { + isFile: () => boolean; + isDirectory: () => boolean; + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isSymbolicLink: () => boolean; + isFIFO: () => boolean; + isSocket: () => boolean; + name: string; + path: string; +} declare class DllPlugin { constructor(options: DllPluginOptions); options: { @@ -3589,6 +3649,37 @@ declare class EnableWasmLoadingPlugin { static setEnabled(compiler: Compiler, type: string): void; static checkEnabled(compiler: Compiler, type: string): void; } +type EncodingOptionFs = + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | ObjectEncodingOptionsFs; +type EncodingOptionTypes = + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | ObjectEncodingOptionsTypes; type Entry = | string | (() => string | EntryObject | string[] | Promise) @@ -4363,7 +4454,7 @@ declare interface ExternalItemFunctionData { * Get a resolve function with the current resolver options. */ getResolve?: ( - options?: ResolveOptionsWebpackOptions + options?: ResolveOptions ) => | (( context: string, @@ -4505,6 +4596,10 @@ type ExternalsType = | "promise" | "script" | "node-commonjs"; +declare interface FSImplementation { + open?: (...args: any[]) => any; + close?: (...args: any[]) => any; +} declare interface FactorizeModuleOptions { currentProfile: ModuleProfile; factory: ModuleFactory; @@ -4659,71 +4754,19 @@ declare interface FileCacheOptions { version?: string; } declare interface FileSystem { - readFile: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - readdir: ( - arg0: string, - arg1?: - | null - | "ascii" - | "utf8" - | "utf16le" - | "ucs2" - | "latin1" - | "binary" - | (( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | Dirent[] - ) => void) - | ReaddirOptions - | "utf-8" - | "ucs-2" - | "base64" - | "base64url" - | "hex" - | "buffer", - arg2?: ( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | Dirent[] + readFile: ReadFileTypes; + readdir: ReaddirTypes; + readJson?: ( + arg0: PathOrFileDescriptorTypes, + arg1: ( + arg0: null | Error | NodeJS.ErrnoException, + arg1?: JsonObjectTypes ) => void ) => void; - readJson?: { - (arg0: string, arg1: FileSystemCallback): void; - (arg0: string, arg1: object, arg2: FileSystemCallback): void; - }; - readlink: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - lstat?: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; - stat: { - (arg0: string, arg1: FileSystemCallback): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback - ): void; - }; -} -declare interface FileSystemCallback { - (err?: null | (PossibleFileSystemError & Error), result?: T): any; + readlink: ReadlinkTypes; + lstat?: LStatTypes; + stat: StatTypes; + realpath?: RealPathTypes; } declare abstract class FileSystemInfo { fs: InputFileSystem; @@ -4818,10 +4861,6 @@ declare interface FileSystemInfoEntry { safeTime: number; timestamp?: number; } -declare interface FileSystemStats { - isDirectory: () => boolean; - isFile: () => boolean; -} type FilterItemTypes = string | RegExp | ((value: string) => boolean); declare interface GenerateContext { /** @@ -5178,16 +5217,12 @@ declare class HttpUriPlugin { */ apply(compiler: Compiler): void; } -declare interface IDirent { - isFile: () => boolean; - isDirectory: () => boolean; - isBlockDevice: () => boolean; - isCharacterDevice: () => boolean; - isSymbolicLink: () => boolean; - isFIFO: () => boolean; - isSocket: () => boolean; - name: string | Buffer; -} +type IBigIntStats = IStatsBase & { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; +}; declare interface IStats { isFile: () => boolean; isDirectory: () => boolean; @@ -5196,20 +5231,47 @@ declare interface IStats { isSymbolicLink: () => boolean; isFIFO: () => boolean; isSocket: () => boolean; - dev: number | bigint; - ino: number | bigint; - mode: number | bigint; - nlink: number | bigint; - uid: number | bigint; - gid: number | bigint; - rdev: number | bigint; - size: number | bigint; - blksize: number | bigint; - blocks: number | bigint; - atimeMs: number | bigint; - mtimeMs: number | bigint; - ctimeMs: number | bigint; - birthtimeMs: number | bigint; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; +} +declare interface IStatsBase { + isFile: () => boolean; + isDirectory: () => boolean; + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isSymbolicLink: () => boolean; + isFIFO: () => boolean; + isSocket: () => boolean; + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; atime: Date; mtime: Date; ctime: Date; @@ -5323,38 +5385,27 @@ declare abstract class InitFragment { merge: any; } declare interface InputFileSystem { - readFile: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void - ) => void; + readFile: ReadFileFs; + readFileSync?: ReadFileSync; + readlink: ReadlinkFs; + readlinkSync?: ReadlinkSync; + readdir: ReaddirFs; + readdirSync?: ReaddirSync; + stat: StatFs; + statSync?: StatSync; + lstat?: LStatFs; + lstatSync?: LStatSync; + realpath?: RealPathFs; + realpathSync?: RealPathSync; readJson?: ( - arg0: string, - arg1: (arg0?: null | Error | NodeJS.ErrnoException, arg1?: any) => void - ) => void; - readlink: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void - ) => void; - readdir: ( - arg0: string, + arg0: PathOrFileDescriptorFs, arg1: ( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | IDirent[] + arg0: null | Error | NodeJS.ErrnoException, + arg1?: JsonObjectFs ) => void ) => void; - stat: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void - ) => void; - lstat?: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void - ) => void; - realpath?: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void - ) => void; - purge?: (arg0?: string) => void; + readJsonSync?: (arg0: PathOrFileDescriptorFs) => JsonObjectFs; + purge?: (arg0?: string | string[] | Set) => void; join?: (arg0: string, arg1: string) => string; relative?: (arg0: string, arg1: string) => string; dirname?: (arg0: string) => string; @@ -5363,29 +5414,33 @@ type IntermediateFileSystem = InputFileSystem & OutputFileSystem & IntermediateFileSystemExtras; declare interface IntermediateFileSystemExtras { - mkdirSync: (arg0: string) => void; - createWriteStream: (arg0: string) => NodeJS.WritableStream; - open: ( - arg0: string, - arg1: string, - arg2: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void - ) => void; - read: ( - arg0: number, - arg1: Buffer, - arg2: number, - arg3: number, - arg4: number, - arg5: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void - ) => void; + mkdirSync: MkdirSync; + createWriteStream: ( + arg0: PathLikeFs, + arg1?: + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | WriteStreamOptions + ) => NodeJS.WritableStream; + open: Open; + read: Read; close: ( arg0: number, - arg1: (arg0?: null | NodeJS.ErrnoException) => void + arg1: (arg0: null | NodeJS.ErrnoException) => void ) => void; rename: ( - arg0: string, - arg1: string, - arg2: (arg0?: null | NodeJS.ErrnoException) => void + arg0: PathLikeFs, + arg1: PathLikeFs, + arg2: (arg0: null | NodeJS.ErrnoException) => void ) => void; } type InternalCell = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER; @@ -6547,17 +6602,40 @@ declare interface JavascriptParserOptions { */ wrappedContextRegExp?: RegExp; } -type JsonObject = { [index: string]: JsonValue } & { +type JsonObjectFs = { [index: string]: JsonValueFs } & { [index: string]: | undefined | null | string | number | boolean - | JsonObject - | JsonValue[]; + | JsonObjectFs + | JsonValueFs[]; }; -type JsonValue = null | string | number | boolean | JsonObject | JsonValue[]; +type JsonObjectTypes = { [index: string]: JsonValueTypes } & { + [index: string]: + | undefined + | null + | string + | number + | boolean + | JsonObjectTypes + | JsonValueTypes[]; +}; +type JsonValueFs = + | null + | string + | number + | boolean + | JsonObjectFs + | JsonValueFs[]; +type JsonValueTypes = + | null + | string + | number + | boolean + | JsonObjectTypes + | JsonValueTypes[]; declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule { constructor(runtimeRequirements: Set); static getCompilationHooks( @@ -6984,6 +7062,75 @@ declare interface KnownStatsProfile { factory: number; dependencies: number; } +declare interface LStatFs { + ( + path: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeFs, + options: undefined | (StatOptions & { bigint?: false }), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeFs, + options: StatOptions & { bigint: true }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void + ): void; + ( + path: PathLikeFs, + options: undefined | StatOptions, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: IStats | IBigIntStats + ) => void + ): void; +} +declare interface LStatSync { + (path: PathLikeFs, options?: undefined): IStats; + ( + path: PathLikeFs, + options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false } + ): undefined | IStats; + ( + path: PathLikeFs, + options: StatSyncOptions & { bigint: true; throwIfNoEntry: false } + ): undefined | IBigIntStats; + (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats; + (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats; + ( + path: PathLikeFs, + options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false } + ): IStats | IBigIntStats; + ( + path: PathLikeFs, + options?: StatSyncOptions + ): undefined | IStats | IBigIntStats; +} +declare interface LStatTypes { + ( + path: PathLikeTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeTypes, + options: undefined | (StatOptions & { bigint?: false }), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeTypes, + options: StatOptions & { bigint: true }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void + ): void; + ( + path: PathLikeTypes, + options: undefined | StatOptions, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: IStats | IBigIntStats + ) => void + ): void; +} /** * Options for the default backend. @@ -7635,6 +7782,10 @@ declare abstract class MainTemplate { get requireFn(): "__webpack_require__"; get outputOptions(): Output; } +declare interface MakeDirectoryOptions { + recursive?: boolean; + mode?: string | number; +} declare interface MapOptions { columns?: boolean; module?: boolean; @@ -7698,6 +7849,50 @@ declare interface MinChunkSizePluginOptions { */ minChunkSize: number; } +declare interface Mkdir { + ( + file: PathLikeFs, + options: MakeDirectoryOptions & { recursive: true }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + file: PathLikeFs, + options: + | undefined + | null + | string + | number + | (MakeDirectoryOptions & { recursive?: false }), + callback: (arg0: null | NodeJS.ErrnoException) => void + ): void; + ( + file: PathLikeFs, + options: undefined | null | string | number | MakeDirectoryOptions, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + file: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException) => void + ): void; +} +declare interface MkdirSync { + ( + path: PathLikeFs, + options: MakeDirectoryOptions & { recursive: true } + ): undefined | string; + ( + path: PathLikeFs, + options?: + | null + | string + | number + | (MakeDirectoryOptions & { recursive?: false }) + ): void; + ( + path: PathLikeFs, + options?: null | string | number | MakeDirectoryOptions + ): undefined | string; +} declare class Module extends DependenciesBlock { constructor(type: string, context?: null | string, layer?: null | string); type: string; @@ -7705,7 +7900,7 @@ declare class Module extends DependenciesBlock { layer: null | string; needId: boolean; debugId: number; - resolveOptions?: ResolveOptionsWebpackOptions; + resolveOptions?: ResolveOptions; factoryMeta?: FactoryMeta; useSourceMap: boolean; useSimpleSourceMap: boolean; @@ -7864,7 +8059,7 @@ declare abstract class ModuleFactory { } declare interface ModuleFactoryCreateData { contextInfo: ModuleFactoryCreateDataContextInfo; - resolveOptions?: ResolveOptionsWebpackOptions; + resolveOptions?: ResolveOptions; context: string; dependencies: Dependency[]; } @@ -8334,7 +8529,7 @@ declare interface ModuleSettings { /** * Options for the resolver. */ - resolve?: ResolveOptionsWebpackOptions; + resolve?: ResolveOptions; /** * Options for parsing. @@ -8679,7 +8874,7 @@ declare interface NormalModuleCreateData { /** * options used for resolving requests from this module */ - resolveOptions?: ResolveOptionsWebpackOptions; + resolveOptions?: ResolveOptions; } declare abstract class NormalModuleFactory extends ModuleFactory { hooks: Readonly<{ @@ -8882,6 +9077,37 @@ declare interface ObjectDeserializerContext { read: () => any; setCircularReference: (arg0?: any) => void; } +declare interface ObjectEncodingOptionsFs { + encoding?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; +} +declare interface ObjectEncodingOptionsTypes { + encoding?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; +} declare interface ObjectSerializer { serialize: (arg0: any, arg1: ObjectSerializerContext) => void; deserialize: (arg0: ObjectDeserializerContext) => any; @@ -8920,6 +9146,23 @@ declare interface OccurrenceModuleIdsPluginOptions { */ prioritiseInitial?: boolean; } +declare interface Open { + ( + file: PathLikeFs, + flags: undefined | string | number, + mode: undefined | null | string | number, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void + ): void; + ( + file: PathLikeFs, + flags: undefined | string | number, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void + ): void; + ( + file: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void + ): void; +} /** * Enables/Disables integrated optimizations. @@ -9621,42 +9864,17 @@ declare interface Output { workerWasmLoading?: string | false; } declare interface OutputFileSystem { - writeFile: ( - arg0: string, - arg1: string | Buffer, - arg2: (arg0?: null | NodeJS.ErrnoException) => void - ) => void; - mkdir: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException) => void - ) => void; - readdir?: ( - arg0: string, - arg1: ( - arg0?: null | NodeJS.ErrnoException, - arg1?: (string | Buffer)[] | IDirent[] - ) => void - ) => void; - rmdir?: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException) => void - ) => void; + writeFile: WriteFile; + mkdir: Mkdir; + readdir?: ReaddirFs; + rmdir?: Rmdir; unlink?: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException) => void - ) => void; - stat: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void - ) => void; - lstat?: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void - ) => void; - readFile: ( - arg0: string, - arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void + arg0: PathLikeFs, + arg1: (arg0: null | NodeJS.ErrnoException) => void ) => void; + stat: StatFs; + lstat?: LStatFs; + readFile: ReadFileFs; join?: (arg0: string, arg1: string) => string; relative?: (arg0: string, arg1: string) => string; dirname?: (arg0: string) => string; @@ -10049,6 +10267,10 @@ declare interface PathData { noChunkHash?: boolean; url?: string; } +type PathLikeFs = string | Buffer | URL; +type PathLikeTypes = string | Buffer | URL_url; +type PathOrFileDescriptorFs = string | number | Buffer | URL; +type PathOrFileDescriptorTypes = string | number | Buffer | URL_url; type Pattern = | Identifier | MemberExpression @@ -10104,14 +10326,12 @@ type Plugin = | 0 | { apply: (arg0: Resolver) => void } | ((this: Resolver, arg1: Resolver) => void); -declare interface PnpApiImpl { - resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string; -} -declare interface PossibleFileSystemError { - code?: string; - errno?: number; - path?: string; - syscall?: string; +declare interface PnpApi { + resolveToUnqualified: ( + arg0: string, + arg1: string, + arg2: object + ) => null | string; } declare class PrefetchPlugin { constructor(context: string, request?: string); @@ -10361,6 +10581,43 @@ declare interface RawSourceMap { mappings: string; file: string; } +declare interface Read { + ( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: null | number | bigint, + callback: ( + err: null | NodeJS.ErrnoException, + bytesRead: number, + buffer: TBuffer + ) => void + ): void; + ( + fd: number, + options: ReadAsyncOptions, + callback: ( + err: null | NodeJS.ErrnoException, + bytesRead: number, + buffer: TBuffer + ) => void + ): void; + ( + fd: number, + callback: ( + err: null | NodeJS.ErrnoException, + bytesRead: number, + buffer: ArrayBufferView + ) => void + ): void; +} +declare interface ReadAsyncOptions { + offset?: number; + length?: number; + position?: null | number | bigint; + buffer?: TBuffer; +} declare class ReadFileCompileWasmPlugin { constructor(options?: ReadFileCompileWasmPluginOptions); options: ReadFileCompileWasmPluginOptions; @@ -10376,22 +10633,438 @@ declare interface ReadFileCompileWasmPluginOptions { */ mangleImports?: boolean; } -declare interface ReaddirOptions { - encoding?: - | null - | "ascii" - | "utf8" - | "utf16le" - | "ucs2" - | "latin1" - | "binary" - | "utf-8" - | "ucs-2" - | "base64" - | "base64url" - | "hex" - | "buffer"; - withFileTypes?: boolean; +declare interface ReadFileFs { + ( + path: PathOrFileDescriptorFs, + options: + | undefined + | null + | ({ encoding?: null; flag?: string } & Abortable), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; + ( + path: PathOrFileDescriptorFs, + options: + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | ({ encoding: BufferEncodingBuffer; flag?: string } & Abortable), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + path: PathOrFileDescriptorFs, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsFs & { flag?: string } & Abortable), + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string | Buffer + ) => void + ): void; + ( + path: PathOrFileDescriptorFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; +} +declare interface ReadFileSync { + ( + path: PathOrFileDescriptorFs, + options?: null | { encoding?: null; flag?: string } + ): Buffer; + ( + path: PathOrFileDescriptorFs, + options: + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | { encoding: BufferEncodingBuffer; flag?: string } + ): string; + ( + path: PathOrFileDescriptorFs, + options?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsFs & { flag?: string }) + ): string | Buffer; +} +declare interface ReadFileTypes { + ( + path: PathOrFileDescriptorTypes, + options: + | undefined + | null + | ({ encoding?: null; flag?: string } & Abortable), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; + ( + path: PathOrFileDescriptorTypes, + options: + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | ({ encoding: BufferEncodingTypes; flag?: string } & Abortable) + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex", + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + path: PathOrFileDescriptorTypes, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsTypes & { flag?: string } & Abortable), + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string | Buffer + ) => void + ): void; + ( + path: PathOrFileDescriptorTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; +} +declare interface ReaddirFs { + ( + path: PathLikeFs, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | { + encoding: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; + withFileTypes?: false; + recursive?: boolean; + }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void + ): void; + ( + path: PathLikeFs, + options: + | "buffer" + | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void + ): void; + ( + path: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void + ): void; + ( + path: PathLikeFs, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsFs & { + withFileTypes?: false; + recursive?: boolean; + }), + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string[] | Buffer[] + ) => void + ): void; + ( + path: PathLikeFs, + options: ObjectEncodingOptionsFs & { + withFileTypes: true; + recursive?: boolean; + }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void + ): void; +} +declare interface ReaddirSync { + ( + path: PathLikeFs, + options?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | { + encoding: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; + withFileTypes?: false; + recursive?: boolean; + } + ): string[]; + ( + path: PathLikeFs, + options: + | "buffer" + | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean } + ): Buffer[]; + ( + path: PathLikeFs, + options?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsFs & { + withFileTypes?: false; + recursive?: boolean; + }) + ): string[] | Buffer[]; + ( + path: PathLikeFs, + options: ObjectEncodingOptionsFs & { + withFileTypes: true; + recursive?: boolean; + } + ): Dirent[]; +} +declare interface ReaddirTypes { + ( + path: PathLikeTypes, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | { + encoding: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; + withFileTypes?: false; + recursive?: boolean; + }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void + ): void; + ( + path: PathLikeTypes, + options: + | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean } + | "buffer", + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void + ): void; + ( + path: PathLikeTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void + ): void; + ( + path: PathLikeTypes, + options: + | undefined + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "utf-16le" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsTypes & { + withFileTypes?: false; + recursive?: boolean; + }), + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string[] | Buffer[] + ) => void + ): void; + ( + path: PathLikeTypes, + options: ObjectEncodingOptionsTypes & { + withFileTypes: true; + recursive?: boolean; + }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void + ): void; +} +declare interface ReadlinkFs { + ( + path: PathLikeFs, + options: EncodingOptionFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + path: PathLikeFs, + options: BufferEncodingOption, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; + ( + path: PathLikeFs, + options: EncodingOptionFs, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string | Buffer + ) => void + ): void; + ( + path: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; +} +declare interface ReadlinkSync { + (path: PathLikeFs, options?: EncodingOptionFs): string; + (path: PathLikeFs, options: BufferEncodingOption): Buffer; + (path: PathLikeFs, options?: EncodingOptionFs): string | Buffer; +} +declare interface ReadlinkTypes { + ( + path: PathLikeTypes, + options: EncodingOptionTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + path: PathLikeTypes, + options: BufferEncodingOption, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; + ( + path: PathLikeTypes, + options: EncodingOptionTypes, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string | Buffer + ) => void + ): void; + ( + path: PathLikeTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; } declare class RealContentHashPlugin { constructor(__0: { @@ -10418,6 +11091,59 @@ declare interface RealDependencyLocation { end?: SourcePosition; index?: number; } +declare interface RealPathFs { + ( + path: PathLikeFs, + options: EncodingOptionFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + path: PathLikeFs, + options: BufferEncodingOption, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; + ( + path: PathLikeFs, + options: EncodingOptionFs, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string | Buffer + ) => void + ): void; + ( + path: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; +} +declare interface RealPathSync { + (path: PathLikeFs, options?: EncodingOptionFs): string; + (path: PathLikeFs, options: BufferEncodingOption): Buffer; + (path: PathLikeFs, options?: EncodingOptionFs): string | Buffer; +} +declare interface RealPathTypes { + ( + path: PathLikeTypes, + options: EncodingOptionTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; + ( + path: PathLikeTypes, + options: BufferEncodingOption, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void + ): void; + ( + path: PathLikeTypes, + options: EncodingOptionTypes, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: string | Buffer + ) => void + ): void; + ( + path: PathLikeTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void + ): void; +} type RecursiveArrayOrRecord = | { [index: string]: RecursiveArrayOrRecord } | RecursiveArrayOrRecord[] @@ -10615,10 +11341,6 @@ declare interface ResolveBuildDependenciesResult { missing: Set; }; } - -/** - * Resolve context - */ declare interface ResolveContext { contextDependencies?: WriteOnlySet; @@ -10649,7 +11371,7 @@ declare interface ResolveContext { } declare interface ResolveData { contextInfo: ModuleFactoryCreateDataContextInfo; - resolveOptions?: ResolveOptionsWebpackOptions; + resolveOptions?: ResolveOptions; context: string; request: string; assertions?: Record; @@ -10665,44 +11387,11 @@ declare interface ResolveData { */ cacheable: boolean; } -declare interface ResolveOptionsTypes { - alias: AliasOption[]; - fallback: AliasOption[]; - aliasFields: Set; - extensionAlias: ExtensionAliasOption[]; - cachePredicate: (arg0: ResolveRequest) => boolean; - cacheWithContext: boolean; - - /** - * A list of exports field condition names. - */ - conditionNames: Set; - descriptionFiles: string[]; - enforceExtension: boolean; - exportsFields: Set; - importsFields: Set; - extensions: Set; - fileSystem: FileSystem; - unsafeCache: false | object; - symlinks: boolean; - resolver?: Resolver; - modules: (string | string[])[]; - mainFields: { name: string[]; forceRelative: boolean }[]; - mainFiles: Set; - plugins: Plugin[]; - pnpApi: null | PnpApiImpl; - roots: Set; - fullySpecified: boolean; - resolveToContext: boolean; - restrictions: Set; - preferRelative: boolean; - preferAbsolute: boolean; -} /** * Options object for resolving requests. */ -declare interface ResolveOptionsWebpackOptions { +declare interface ResolveOptions { /** * Redirect module requests. */ @@ -10731,7 +11420,7 @@ declare interface ResolveOptionsWebpackOptions { /** * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm". */ - byDependency?: { [index: string]: ResolveOptionsWebpackOptions }; + byDependency?: { [index: string]: ResolveOptions }; /** * Enable caching of successfully resolved requests (cache entries are revalidated). @@ -10888,7 +11577,185 @@ declare interface ResolveOptionsWebpackOptions { */ useSyncFileSystemCalls?: boolean; } -type ResolveOptionsWithDependencyType = ResolveOptionsWebpackOptions & { +declare interface ResolveOptionsResolverFactoryObject1 { + alias: AliasOption[]; + fallback: AliasOption[]; + aliasFields: Set; + extensionAlias: ExtensionAliasOption[]; + cachePredicate: (arg0: ResolveRequest) => boolean; + cacheWithContext: boolean; + + /** + * A list of exports field condition names. + */ + conditionNames: Set; + descriptionFiles: string[]; + enforceExtension: boolean; + exportsFields: Set; + importsFields: Set; + extensions: Set; + fileSystem: FileSystem; + unsafeCache: false | object; + symlinks: boolean; + resolver?: Resolver; + modules: (string | string[])[]; + mainFields: { name: string[]; forceRelative: boolean }[]; + mainFiles: Set; + plugins: Plugin[]; + pnpApi: null | PnpApi; + roots: Set; + fullySpecified: boolean; + resolveToContext: boolean; + restrictions: Set; + preferRelative: boolean; + preferAbsolute: boolean; +} +declare interface ResolveOptionsResolverFactoryObject2 { + /** + * A list of module alias configurations or an object which maps key to value + */ + alias?: AliasOption[] | AliasOptions; + + /** + * A list of module alias configurations or an object which maps key to value, applied only after modules option + */ + fallback?: AliasOption[] | AliasOptions; + + /** + * An object which maps extension to extension aliases + */ + extensionAlias?: ExtensionAliasOptions; + + /** + * A list of alias fields in description files + */ + aliasFields?: (string | string[])[]; + + /** + * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. + */ + cachePredicate?: (arg0: ResolveRequest) => boolean; + + /** + * Whether or not the unsafeCache should include request context as part of the cache key. + */ + cacheWithContext?: boolean; + + /** + * A list of description files to read from + */ + descriptionFiles?: string[]; + + /** + * A list of exports field condition names. + */ + conditionNames?: string[]; + + /** + * Enforce that a extension from extensions must be used + */ + enforceExtension?: boolean; + + /** + * A list of exports fields in description files + */ + exportsFields?: (string | string[])[]; + + /** + * A list of imports fields in description files + */ + importsFields?: (string | string[])[]; + + /** + * A list of extensions which should be tried for files + */ + extensions?: string[]; + + /** + * The file system which should be used + */ + fileSystem: FileSystem; + + /** + * Use this cache object to unsafely cache the successful requests + */ + unsafeCache?: boolean | object; + + /** + * Resolve symlinks to their symlinked location + */ + symlinks?: boolean; + + /** + * A prepared Resolver to which the plugins are attached + */ + resolver?: Resolver; + + /** + * A list of directories to resolve modules from, can be absolute path or folder name + */ + modules?: string | string[]; + + /** + * A list of main fields in description files + */ + mainFields?: ( + | string + | string[] + | { name: string | string[]; forceRelative: boolean } + )[]; + + /** + * A list of main files in directories + */ + mainFiles?: string[]; + + /** + * A list of additional resolve plugins which should be applied + */ + plugins?: Plugin[]; + + /** + * A PnP API that should be used - null is "never", undefined is "auto" + */ + pnpApi?: null | PnpApi; + + /** + * A list of root paths + */ + roots?: string[]; + + /** + * The request is already fully specified and no extensions or directories are resolved for it + */ + fullySpecified?: boolean; + + /** + * Resolve to a context instead of a file + */ + resolveToContext?: boolean; + + /** + * A list of resolve restrictions + */ + restrictions?: (string | RegExp)[]; + + /** + * Use only the sync constraints of the file system calls + */ + useSyncFileSystemCalls?: boolean; + + /** + * Prefer to resolve module requests as relative requests before falling back to modules + */ + preferRelative?: boolean; + + /** + * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots + */ + preferAbsolute?: boolean; +} +type ResolveOptionsWithDependencyType = ResolveOptions & { dependencyType?: string; resolveToContext?: boolean; }; @@ -10913,7 +11780,7 @@ declare interface ResolvedContextTimestampAndHash { } declare abstract class Resolver { fileSystem: FileSystem; - options: ResolveOptionsTypes; + options: ResolveOptionsResolverFactoryObject1; hooks: KnownHooks; ensureHook( name: @@ -10976,7 +11843,13 @@ declare abstract class ResolverFactory { SyncWaterfallHook<[ResolveOptionsWithDependencyType]> >; resolver: HookMap< - SyncHook<[Resolver, UserResolveOptions, ResolveOptionsWithDependencyType]> + SyncHook< + [ + Resolver, + ResolveOptionsResolverFactoryObject2, + ResolveOptionsWithDependencyType + ] + > >; }>; cache: Map; @@ -10995,6 +11868,22 @@ declare interface ResourceDataWithData { context?: string; data: Record; } +declare interface RmDirOptions { + maxRetries?: number; + recursive?: boolean; + retryDelay?: number; +} +declare interface Rmdir { + ( + file: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException) => void + ): void; + ( + file: PathLikeFs, + options: RmDirOptions, + callback: (arg0: null | NodeJS.ErrnoException) => void + ): void; +} type Rule = string | RegExp; declare interface RuleSet { /** @@ -11208,7 +12097,7 @@ declare interface RuleSetRule { /** * Options for the resolver. */ - resolve?: ResolveOptionsWebpackOptions; + resolve?: ResolveOptions; /** * Match the resource path of the module. @@ -11508,7 +12397,7 @@ declare abstract class RuntimeTemplate { compilation: Compilation; outputOptions: OutputNormalized; requestShortener: RequestShortener; - globalObject?: string; + globalObject: string; contentHashReplacement: string; isIIFE(): undefined | boolean; isModule(): undefined | boolean; @@ -12415,6 +13304,82 @@ declare abstract class StackedMap { createChild(): StackedMap; } type StartupRenderContext = RenderContext & { inlined: boolean }; +declare interface StatFs { + ( + path: PathLikeFs, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeFs, + options: undefined | (StatOptions & { bigint?: false }), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeFs, + options: StatOptions & { bigint: true }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void + ): void; + ( + path: PathLikeFs, + options: undefined | StatOptions, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: IStats | IBigIntStats + ) => void + ): void; +} +declare interface StatOptions { + bigint?: boolean; +} +declare interface StatSync { + (path: PathLikeFs, options?: undefined): IStats; + ( + path: PathLikeFs, + options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false } + ): undefined | IStats; + ( + path: PathLikeFs, + options: StatSyncOptions & { bigint: true; throwIfNoEntry: false } + ): undefined | IBigIntStats; + (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats; + (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats; + ( + path: PathLikeFs, + options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false } + ): IStats | IBigIntStats; + ( + path: PathLikeFs, + options?: StatSyncOptions + ): undefined | IStats | IBigIntStats; +} +declare interface StatSyncOptions { + bigint?: boolean; + throwIfNoEntry?: boolean; +} +declare interface StatTypes { + ( + path: PathLikeTypes, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeTypes, + options: undefined | (StatOptions & { bigint?: false }), + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void + ): void; + ( + path: PathLikeTypes, + options: StatOptions & { bigint: true }, + callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void + ): void; + ( + path: PathLikeTypes, + options: undefined | StatOptions, + callback: ( + arg0: null | NodeJS.ErrnoException, + arg1?: IStats | IBigIntStats + ) => void + ): void; +} type Statement = | FunctionDeclaration | VariableDeclaration @@ -13131,9 +14096,15 @@ declare interface TrustedTypes { policyName?: string; } declare const UNDEFINED_MARKER: unique symbol; + +/** + * `URL` class is a global reference for `require('url').URL` + * https://nodejs.org/api/url.html#the-whatwg-url-api + */ +declare interface URL_url extends URL {} declare interface UnsafeCacheData { factoryMeta?: FactoryMeta; - resolveOptions?: ResolveOptionsWebpackOptions; + resolveOptions?: ResolveOptions; } declare interface UpdateHashContextDependency { chunkGraph: ChunkGraph; @@ -13150,151 +14121,6 @@ declare interface UpdateHashContextGenerator { runtimeTemplate?: RuntimeTemplate; } type UsageStateType = 0 | 1 | 2 | 3 | 4; -declare interface UserResolveOptions { - /** - * A list of module alias configurations or an object which maps key to value - */ - alias?: AliasOption[] | AliasOptions; - - /** - * A list of module alias configurations or an object which maps key to value, applied only after modules option - */ - fallback?: AliasOption[] | AliasOptions; - - /** - * An object which maps extension to extension aliases - */ - extensionAlias?: ExtensionAliasOptions; - - /** - * A list of alias fields in description files - */ - aliasFields?: (string | string[])[]; - - /** - * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. - */ - cachePredicate?: (arg0: ResolveRequest) => boolean; - - /** - * Whether or not the unsafeCache should include request context as part of the cache key. - */ - cacheWithContext?: boolean; - - /** - * A list of description files to read from - */ - descriptionFiles?: string[]; - - /** - * A list of exports field condition names. - */ - conditionNames?: string[]; - - /** - * Enforce that a extension from extensions must be used - */ - enforceExtension?: boolean; - - /** - * A list of exports fields in description files - */ - exportsFields?: (string | string[])[]; - - /** - * A list of imports fields in description files - */ - importsFields?: (string | string[])[]; - - /** - * A list of extensions which should be tried for files - */ - extensions?: string[]; - - /** - * The file system which should be used - */ - fileSystem: FileSystem; - - /** - * Use this cache object to unsafely cache the successful requests - */ - unsafeCache?: boolean | object; - - /** - * Resolve symlinks to their symlinked location - */ - symlinks?: boolean; - - /** - * A prepared Resolver to which the plugins are attached - */ - resolver?: Resolver; - - /** - * A list of directories to resolve modules from, can be absolute path or folder name - */ - modules?: string | string[]; - - /** - * A list of main fields in description files - */ - mainFields?: ( - | string - | string[] - | { name: string | string[]; forceRelative: boolean } - )[]; - - /** - * A list of main files in directories - */ - mainFiles?: string[]; - - /** - * A list of additional resolve plugins which should be applied - */ - plugins?: Plugin[]; - - /** - * A PnP API that should be used - null is "never", undefined is "auto" - */ - pnpApi?: null | PnpApiImpl; - - /** - * A list of root paths - */ - roots?: string[]; - - /** - * The request is already fully specified and no extensions or directories are resolved for it - */ - fullySpecified?: boolean; - - /** - * Resolve to a context instead of a file - */ - resolveToContext?: boolean; - - /** - * A list of resolve restrictions - */ - restrictions?: (string | RegExp)[]; - - /** - * Use only the sync constraints of the file system calls - */ - useSyncFileSystemCalls?: boolean; - - /** - * Prefer to resolve module requests as relative requests before falling back to modules - */ - preferRelative?: boolean; - - /** - * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots - */ - preferAbsolute?: boolean; -} declare abstract class VariableInfo { declaredScope: ScopeInfo; freeName?: string | true; @@ -13317,7 +14143,7 @@ declare interface WatchFileSystem { startTime: number, options: WatchOptions, callback: ( - arg0: undefined | Error, + arg0: null | Error, arg1: Map, arg2: Map, arg3: Set, @@ -13565,13 +14391,13 @@ declare abstract class WebpackLogger { group(...args: any[]): void; groupCollapsed(...args: any[]): void; groupEnd(...args: any[]): void; - profile(label?: any): void; - profileEnd(label?: any): void; - time(label?: any): void; - timeLog(label?: any): void; - timeEnd(label?: any): void; - timeAggregate(label?: any): void; - timeAggregateEnd(label?: any): void; + profile(label?: string): void; + profileEnd(label?: string): void; + time(label: string): void; + timeLog(label?: string): void; + timeEnd(label?: string): void; + timeAggregate(label?: string): void; + timeAggregateEnd(label?: string): void; } declare class WebpackOptionsApply extends OptionsApply { constructor(); @@ -13755,12 +14581,12 @@ declare interface WebpackOptionsNormalized { /** * Options for the resolver. */ - resolve: ResolveOptionsWebpackOptions; + resolve: ResolveOptions; /** * Options for the resolver when resolving loaders. */ - resolveLoader: ResolveOptionsWebpackOptions; + resolveLoader: ResolveOptions; /** * Options affecting how file system snapshots are created and validated. @@ -13810,9 +14636,86 @@ declare interface WithOptions { arg0: Partial ) => ResolverWithOptions; } +declare interface WriteFile { + ( + file: PathOrFileDescriptorFs, + data: + | string + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array + | DataView, + options: WriteFileOptions, + callback: (arg0: null | NodeJS.ErrnoException) => void + ): void; + ( + file: PathOrFileDescriptorFs, + data: + | string + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array + | DataView, + callback: (arg0: null | NodeJS.ErrnoException) => void + ): void; +} +type WriteFileOptions = + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex" + | (ObjectEncodingOptionsFs & + Abortable & { mode?: string | number; flag?: string; flush?: boolean }); declare interface WriteOnlySet { add: (item: T) => void; } + +declare interface WriteStreamOptions { + flags?: string; + encoding?: + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "base64url" + | "hex"; + fd?: any; + mode?: number; + autoClose?: boolean; + emitClose?: boolean; + start?: number; + signal?: null | AbortSignal; + fs?: null | CreateWriteStreamFSImplementation; +} type __TypeWebpackOptions = (data: object) => | string | { @@ -14430,7 +15333,7 @@ declare namespace exports { LibraryOptions, MemoryCacheOptions, ModuleOptions, - ResolveOptionsWebpackOptions as ResolveOptions, + ResolveOptions, RuleSetCondition, RuleSetConditionAbsolute, RuleSetRule, diff --git a/yarn.lock b/yarn.lock index 21b232f20..5aaca79c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2535,10 +2535,10 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -enhanced-resolve@^5.0.0, enhanced-resolve@^5.15.0: - version "5.15.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" - integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz#65ec88778083056cb32487faa9aef82ed0864787" + integrity sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -3258,7 +3258,7 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -4533,10 +4533,10 @@ map-obj@^4.3.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -memfs@^3.4.1, memfs@^3.5.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.5.3.tgz#d9b40fe4f8d5788c5f895bda804cd0d9eeee9f3b" - integrity sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw== +memfs@^3.4.1, memfs@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.6.0.tgz#d7a2110f86f79dd950a8b6df6d57bc984aa185f6" + integrity sha512-EGowvkkgbMcIChjMTMkESFDbZeSh8xZ7kNSF0hAiAN4Jh6jgHCRS0Ga/+C8y6Au+oqpezRHCfPsmJ2+DwAgiwQ== dependencies: fs-monkey "^1.0.4"