Add JS-CATCH-FALLBACK-01 rule and update npm packages
Add PHP-ALIAS-01 rule: prohibit field aliasing in serialization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
39
node_modules/webpack/lib/Module.js
generated
vendored
39
node_modules/webpack/lib/Module.js
generated
vendored
@@ -9,7 +9,11 @@ const util = require("util");
|
||||
const ChunkGraph = require("./ChunkGraph");
|
||||
const DependenciesBlock = require("./DependenciesBlock");
|
||||
const ModuleGraph = require("./ModuleGraph");
|
||||
const { JS_TYPES } = require("./ModuleSourceTypesConstants");
|
||||
const {
|
||||
JAVASCRIPT_TYPE,
|
||||
UNKNOWN_TYPE
|
||||
} = require("./ModuleSourceTypeConstants");
|
||||
const { JAVASCRIPT_TYPES } = require("./ModuleSourceTypeConstants");
|
||||
const RuntimeGlobals = require("./RuntimeGlobals");
|
||||
const { first } = require("./util/SetHelpers");
|
||||
const { compareChunksById } = require("./util/comparators");
|
||||
@@ -24,12 +28,14 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
/** @typedef {import("./CodeGenerationResults")} CodeGenerationResults */
|
||||
/** @typedef {import("./Compilation")} Compilation */
|
||||
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
|
||||
/** @typedef {import("./Compilation").FileSystemDependencies} FileSystemDependencies */
|
||||
/** @typedef {import("./Compilation").UnsafeCacheData} UnsafeCacheData */
|
||||
/** @typedef {import("./ConcatenationScope")} ConcatenationScope */
|
||||
/** @typedef {import("./Dependency")} Dependency */
|
||||
/** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */
|
||||
/** @typedef {import("./DependencyTemplate").CssData} CssData */
|
||||
/** @typedef {import("./DependencyTemplates")} DependencyTemplates */
|
||||
/** @typedef {import("./ModuleSourceTypeConstants").AllTypes} AllTypes */
|
||||
/** @typedef {import("./FileSystemInfo")} FileSystemInfo */
|
||||
/** @typedef {import("./FileSystemInfo").Snapshot} Snapshot */
|
||||
/** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */
|
||||
@@ -70,7 +76,9 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
* @property {string=} type the type of source that should be generated
|
||||
*/
|
||||
|
||||
/** @typedef {ReadonlySet<string>} SourceTypes */
|
||||
/** @typedef {AllTypes} KnownSourceType */
|
||||
/** @typedef {KnownSourceType | string} SourceType */
|
||||
/** @typedef {ReadonlySet<SourceType>} SourceTypes */
|
||||
|
||||
// TODO webpack 6: compilation will be required in CodeGenerationContext
|
||||
/**
|
||||
@@ -80,6 +88,7 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
* @property {ModuleGraph} moduleGraph the module graph
|
||||
* @property {ChunkGraph} chunkGraph the chunk graph
|
||||
* @property {RuntimeSpec} runtime the runtimes code should be generated for
|
||||
* @property {RuntimeSpec[]} runtimes all runtimes code should be generated for
|
||||
* @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules
|
||||
* @property {CodeGenerationResults | undefined} codeGenerationResults code generation results of other modules (need to have a codeGenerationDependency to use that)
|
||||
* @property {Compilation=} compilation the compilation
|
||||
@@ -103,7 +112,7 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
|
||||
/**
|
||||
* @typedef {object} CodeGenerationResult
|
||||
* @property {Map<string, Source>} sources the resulting sources for all source types
|
||||
* @property {Map<SourceType, Source>} sources the resulting sources for all source types
|
||||
* @property {CodeGenerationResultData=} data the resulting data for all source types
|
||||
* @property {ReadOnlyRuntimeRequirements | null} runtimeRequirements the runtime requirements
|
||||
* @property {string=} hash a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
|
||||
@@ -126,12 +135,10 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
* @property {boolean=} sideEffectFree
|
||||
* @property {boolean=} isCSSModule
|
||||
* @property {Record<string, string>=} jsIncompatibleExports
|
||||
* @property {Record<string, string>=} exportsFinalName
|
||||
* @property {string=} factoryExportsBinding
|
||||
* @property {Map<RuntimeSpec, Record<string, string>>=} exportsFinalNameByRuntime
|
||||
* @property {Map<RuntimeSpec, string>=} exportsSourceByRuntime
|
||||
*/
|
||||
|
||||
/** @typedef {LazySet<string>} FileSystemDependencies */
|
||||
|
||||
/**
|
||||
* @typedef {object} KnownBuildInfo
|
||||
* @property {boolean=} cacheable
|
||||
@@ -188,7 +195,8 @@ const EMPTY_RESOLVE_OPTIONS = {};
|
||||
|
||||
let debugId = 1000;
|
||||
|
||||
const DEFAULT_TYPES_UNKNOWN = new Set(["unknown"]);
|
||||
/** @type {SourceTypes} */
|
||||
const DEFAULT_TYPES_UNKNOWN = new Set([UNKNOWN_TYPE]);
|
||||
|
||||
const deprecatedNeedRebuild = util.deprecate(
|
||||
/**
|
||||
@@ -839,8 +847,8 @@ class Module extends DependenciesBlock {
|
||||
|
||||
/**
|
||||
* @deprecated Use needBuild instead
|
||||
* @param {Map<string, number|null>} fileTimestamps timestamps of files
|
||||
* @param {Map<string, number|null>} contextTimestamps timestamps of directories
|
||||
* @param {Map<string, number | null>} fileTimestamps timestamps of files
|
||||
* @param {Map<string, number | null>} contextTimestamps timestamps of directories
|
||||
* @returns {boolean} true, if the module needs a rebuild
|
||||
*/
|
||||
needRebuild(fileTimestamps, contextTimestamps) {
|
||||
@@ -928,7 +936,7 @@ class Module extends DependenciesBlock {
|
||||
if (this.source === Module.prototype.source) {
|
||||
return DEFAULT_TYPES_UNKNOWN;
|
||||
}
|
||||
return JS_TYPES;
|
||||
return JAVASCRIPT_TYPES;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -936,10 +944,10 @@ class Module extends DependenciesBlock {
|
||||
* @deprecated Use codeGeneration() instead
|
||||
* @param {DependencyTemplates} dependencyTemplates the dependency templates
|
||||
* @param {RuntimeTemplate} runtimeTemplate the runtime template
|
||||
* @param {string=} type the type of source that should be generated
|
||||
* @param {SourceType=} type the type of source that should be generated
|
||||
* @returns {Source} generated source
|
||||
*/
|
||||
source(dependencyTemplates, runtimeTemplate, type = "javascript") {
|
||||
source(dependencyTemplates, runtimeTemplate, type = JAVASCRIPT_TYPE) {
|
||||
if (this.codeGeneration === Module.prototype.codeGeneration) {
|
||||
const AbstractMethodError = require("./AbstractMethodError");
|
||||
|
||||
@@ -957,6 +965,7 @@ class Module extends DependenciesBlock {
|
||||
moduleGraph: chunkGraph.moduleGraph,
|
||||
chunkGraph,
|
||||
runtime: undefined,
|
||||
runtimes: [],
|
||||
codeGenerationResults: undefined
|
||||
};
|
||||
const sources = this.codeGeneration(codeGenContext).sources;
|
||||
@@ -964,7 +973,7 @@ class Module extends DependenciesBlock {
|
||||
return /** @type {Source} */ (
|
||||
type
|
||||
? sources.get(type)
|
||||
: sources.get(/** @type {string} */ (first(this.getSourceTypes())))
|
||||
: sources.get(/** @type {SourceType} */ (first(this.getSourceTypes())))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1019,7 +1028,7 @@ class Module extends DependenciesBlock {
|
||||
// Best override this method
|
||||
const sources = new Map();
|
||||
for (const type of this.getSourceTypes()) {
|
||||
if (type !== "unknown") {
|
||||
if (type !== UNKNOWN_TYPE) {
|
||||
sources.set(
|
||||
type,
|
||||
this.source(
|
||||
|
||||
Reference in New Issue
Block a user