Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
60
node_modules/webpack/lib/sharing/ConsumeSharedModule.js
generated
vendored
60
node_modules/webpack/lib/sharing/ConsumeSharedModule.js
generated
vendored
@@ -17,6 +17,9 @@ const makeSerializable = require("../util/makeSerializable");
|
||||
const { rangeToString, stringifyHoley } = require("../util/semver");
|
||||
const ConsumeSharedFallbackDependency = require("./ConsumeSharedFallbackDependency");
|
||||
|
||||
/** @type {WeakMap<ModuleGraph, WeakMap<ConsumeSharedModule, Module | null>>} */
|
||||
const fallbackModuleCache = new WeakMap();
|
||||
|
||||
/** @typedef {import("../config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
|
||||
/** @typedef {import("../Compilation")} Compilation */
|
||||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
|
||||
@@ -27,7 +30,10 @@ const ConsumeSharedFallbackDependency = require("./ConsumeSharedFallbackDependen
|
||||
/** @typedef {import("../Module").LibIdent} LibIdent */
|
||||
/** @typedef {import("../Module").NeedBuildCallback} NeedBuildCallback */
|
||||
/** @typedef {import("../Module").NeedBuildContext} NeedBuildContext */
|
||||
/** @typedef {import("../Module").Sources} Sources */
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
||||
/** @typedef {import("../Module").ExportsType} ExportsType */
|
||||
/** @typedef {import("../RequestShortener")} RequestShortener */
|
||||
/** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
||||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
||||
@@ -153,6 +159,57 @@ class ConsumeSharedModule extends Module {
|
||||
return CONSUME_SHARED_TYPES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @returns {Module | null} fallback module
|
||||
*/
|
||||
_getFallbackModule(moduleGraph) {
|
||||
let moduleCache = fallbackModuleCache.get(moduleGraph);
|
||||
if (!moduleCache) {
|
||||
moduleCache = new WeakMap();
|
||||
fallbackModuleCache.set(moduleGraph, moduleCache);
|
||||
}
|
||||
const cached = moduleCache.get(this);
|
||||
if (cached !== undefined) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
/** @type {undefined | null | Module} */
|
||||
let fallbackModule = null;
|
||||
|
||||
if (this.options.import) {
|
||||
if (this.options.eager) {
|
||||
const dep = this.dependencies[0];
|
||||
if (dep) {
|
||||
fallbackModule = moduleGraph.getModule(dep);
|
||||
}
|
||||
} else {
|
||||
const block = this.blocks[0];
|
||||
if (block && block.dependencies.length > 0) {
|
||||
fallbackModule = moduleGraph.getModule(block.dependencies[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
moduleCache.set(this, fallbackModule);
|
||||
return fallbackModule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @param {boolean | undefined} strict the importing module is strict
|
||||
* @returns {ExportsType} export type
|
||||
* "namespace": Exports is already a namespace object. namespace = exports.
|
||||
* "dynamic": Check at runtime if __esModule is set. When set: namespace = { ...exports, default: exports }. When not set: namespace = { default: exports }.
|
||||
* "default-only": Provide a namespace object with only default export. namespace = { default: exports }
|
||||
* "default-with-named": Provide a namespace object with named and default export. namespace = { ...exports, default: exports }
|
||||
*/
|
||||
getExportsType(moduleGraph, strict) {
|
||||
const fallbackModule = this._getFallbackModule(moduleGraph);
|
||||
if (!fallbackModule) return "dynamic";
|
||||
return fallbackModule.getExportsType(moduleGraph, strict);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string=} type the source type for which the size should be estimated
|
||||
* @returns {number} the estimated size of the module (must be non-zero)
|
||||
@@ -186,6 +243,7 @@ class ConsumeSharedModule extends Module {
|
||||
singleton,
|
||||
eager
|
||||
} = this.options;
|
||||
/** @type {undefined | string} */
|
||||
let fallbackCode;
|
||||
if (request) {
|
||||
if (eager) {
|
||||
@@ -219,6 +277,7 @@ class ConsumeSharedModule extends Module {
|
||||
args.push(fallbackCode);
|
||||
}
|
||||
|
||||
/** @type {string} */
|
||||
let fn;
|
||||
|
||||
if (requiredVersion) {
|
||||
@@ -232,6 +291,7 @@ class ConsumeSharedModule extends Module {
|
||||
}
|
||||
|
||||
const code = runtimeTemplate.returningFunction(`${fn}(${args.join(", ")})`);
|
||||
/** @type {Sources} */
|
||||
const sources = new Map();
|
||||
sources.set("consume-shared", new RawSource(code));
|
||||
return {
|
||||
|
||||
9
node_modules/webpack/lib/sharing/ConsumeSharedPlugin.js
generated
vendored
9
node_modules/webpack/lib/sharing/ConsumeSharedPlugin.js
generated
vendored
@@ -26,6 +26,7 @@ const {
|
||||
/** @typedef {import("enhanced-resolve").ResolveContext} ResolveContext */
|
||||
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */
|
||||
/** @typedef {import("../Compiler")} Compiler */
|
||||
/** @typedef {import("../Compilation").FileSystemDependencies} FileSystemDependencies */
|
||||
/** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */
|
||||
/** @typedef {import("../util/semver").SemVerRange} SemVerRange */
|
||||
/** @typedef {import("./ConsumeSharedModule").ConsumeOptions} ConsumeOptions */
|
||||
@@ -159,7 +160,7 @@ class ConsumeSharedPlugin {
|
||||
};
|
||||
const directFallback =
|
||||
config.import &&
|
||||
/^(\.\.?(\/|$)|\/|[A-Za-z]:|\\\\)/.test(config.import);
|
||||
/^(?:\.\.?(?:\/|$)|\/|[A-Z]:|\\\\)/i.test(config.import);
|
||||
return Promise.all([
|
||||
new Promise(
|
||||
/**
|
||||
@@ -170,7 +171,7 @@ class ConsumeSharedPlugin {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
/** @typedef {ResolveContext} */
|
||||
/** @type {ResolveContext & { fileDependencies: FileSystemDependencies, contextDependencies: FileSystemDependencies, missingDependencies: FileSystemDependencies }} */
|
||||
const resolveContext = {
|
||||
fileDependencies: new LazySet(),
|
||||
contextDependencies: new LazySet(),
|
||||
@@ -215,13 +216,13 @@ class ConsumeSharedPlugin {
|
||||
}
|
||||
let packageName = config.packageName;
|
||||
if (packageName === undefined) {
|
||||
if (/^(\/|[A-Za-z]:|\\\\)/.test(request)) {
|
||||
if (/^(?:\/|[A-Z]:|\\\\)/i.test(request)) {
|
||||
// For relative or absolute requests we don't automatically use a packageName.
|
||||
// If wished one can specify one with the packageName option.
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const match = /^((?:@[^\\/]+[\\/])?[^\\/]+)/.exec(request);
|
||||
const match = /^(?:@[^\\/]+[\\/])?[^\\/]+/.exec(request);
|
||||
if (!match) {
|
||||
requiredVersionWarning(
|
||||
"Unable to extract the package name from request."
|
||||
|
||||
4
node_modules/webpack/lib/sharing/ProvideSharedModule.js
generated
vendored
4
node_modules/webpack/lib/sharing/ProvideSharedModule.js
generated
vendored
@@ -22,7 +22,9 @@ const ProvideForSharedDependency = require("./ProvideForSharedDependency");
|
||||
/** @typedef {import("../Module").LibIdent} LibIdent */
|
||||
/** @typedef {import("../Module").NeedBuildCallback} NeedBuildCallback */
|
||||
/** @typedef {import("../Module").NeedBuildContext} NeedBuildContext */
|
||||
/** @typedef {import("../Module").Sources} Sources */
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../Module").CodeGenerationResultData} CodeGenerationResultData */
|
||||
/** @typedef {import("../RequestShortener")} RequestShortener */
|
||||
/** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
||||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
||||
@@ -147,7 +149,9 @@ class ProvideSharedModule extends Module {
|
||||
runtimeRequirements
|
||||
})
|
||||
}${this._eager ? ", 1" : ""});`;
|
||||
/** @type {Sources} */
|
||||
const sources = new Map();
|
||||
/** @type {CodeGenerationResultData} */
|
||||
const data = new Map();
|
||||
data.set("share-init", [
|
||||
{
|
||||
|
||||
49
node_modules/webpack/lib/sharing/ProvideSharedPlugin.js
generated
vendored
49
node_modules/webpack/lib/sharing/ProvideSharedPlugin.js
generated
vendored
@@ -45,29 +45,28 @@ class ProvideSharedPlugin {
|
||||
constructor(options) {
|
||||
validate(options);
|
||||
|
||||
this._provides = /** @type {[string, ProvideOptions][]} */ (
|
||||
parseOptions(
|
||||
options.provides,
|
||||
(item) => {
|
||||
if (Array.isArray(item)) {
|
||||
throw new Error("Unexpected array of provides");
|
||||
}
|
||||
/** @type {ProvideOptions} */
|
||||
const result = {
|
||||
shareKey: item,
|
||||
version: undefined,
|
||||
shareScope: options.shareScope || "default",
|
||||
eager: false
|
||||
};
|
||||
return result;
|
||||
},
|
||||
(item) => ({
|
||||
shareKey: item.shareKey,
|
||||
version: item.version,
|
||||
shareScope: item.shareScope || options.shareScope || "default",
|
||||
eager: Boolean(item.eager)
|
||||
})
|
||||
)
|
||||
/** @type {[string, ProvideOptions][]} */
|
||||
this._provides = parseOptions(
|
||||
options.provides,
|
||||
(item) => {
|
||||
if (Array.isArray(item)) {
|
||||
throw new Error("Unexpected array of provides");
|
||||
}
|
||||
/** @type {ProvideOptions} */
|
||||
const result = {
|
||||
shareKey: item,
|
||||
version: undefined,
|
||||
shareScope: options.shareScope || "default",
|
||||
eager: false
|
||||
};
|
||||
return result;
|
||||
},
|
||||
(item) => ({
|
||||
shareKey: /** @type {string} */ (item.shareKey),
|
||||
version: item.version,
|
||||
shareScope: item.shareScope || options.shareScope || "default",
|
||||
eager: Boolean(item.eager)
|
||||
})
|
||||
);
|
||||
this._provides.sort(([a], [b]) => {
|
||||
if (a < b) return -1;
|
||||
@@ -95,13 +94,13 @@ class ProvideSharedPlugin {
|
||||
/** @type {Map<string, ProvideOptions>} */
|
||||
const prefixMatchProvides = new Map();
|
||||
for (const [request, config] of this._provides) {
|
||||
if (/^(\/|[A-Za-z]:\\|\\\\|\.\.?(\/|$))/.test(request)) {
|
||||
if (/^(?:\/|[A-Z]:\\|\\\\|\.\.?(?:\/|$))/i.test(request)) {
|
||||
// relative request
|
||||
resolvedProvideMap.set(request, {
|
||||
config,
|
||||
version: config.version
|
||||
});
|
||||
} else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) {
|
||||
} else if (/^(?:\/|[A-Z]:\\|\\\\)/i.test(request)) {
|
||||
// absolute path
|
||||
resolvedProvideMap.set(request, {
|
||||
config,
|
||||
|
||||
4
node_modules/webpack/lib/sharing/resolveMatchedConfigs.js
generated
vendored
4
node_modules/webpack/lib/sharing/resolveMatchedConfigs.js
generated
vendored
@@ -54,7 +54,7 @@ module.exports.resolveMatchedConfigs = (compilation, configs) => {
|
||||
return Promise.all(
|
||||
// eslint-disable-next-line array-callback-return
|
||||
configs.map(([request, config]) => {
|
||||
if (/^\.\.?(\/|$)/.test(request)) {
|
||||
if (/^\.\.?(?:\/|$)/.test(request)) {
|
||||
// relative request
|
||||
return new Promise((resolve) => {
|
||||
resolver.resolve(
|
||||
@@ -77,7 +77,7 @@ module.exports.resolveMatchedConfigs = (compilation, configs) => {
|
||||
}
|
||||
);
|
||||
});
|
||||
} else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) {
|
||||
} else if (/^(?:\/|[a-z]:\\|\\\\)/i.test(request)) {
|
||||
// absolute path
|
||||
resolved.set(request, config);
|
||||
} else if (request.endsWith("/")) {
|
||||
|
||||
14
node_modules/webpack/lib/sharing/utils.js
generated
vendored
14
node_modules/webpack/lib/sharing/utils.js
generated
vendored
@@ -15,30 +15,30 @@ const { dirname, join, readJson } = require("../util/fs");
|
||||
const RE_URL_GITHUB_EXTREME_SHORT = /^[^/@:.\s][^/@:\s]*\/[^@:\s]*[^/@:\s]#\S+/;
|
||||
|
||||
// Short url with specific protocol. eg: github:foo/bar
|
||||
const RE_GIT_URL_SHORT = /^(github|gitlab|bitbucket|gist):\/?[^/.]+\/?/i;
|
||||
const RE_GIT_URL_SHORT = /^(?:github|gitlab|bitbucket|gist):\/?[^/.]+\/?/i;
|
||||
|
||||
// Currently supported protocols
|
||||
const RE_PROTOCOL =
|
||||
/^((git\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i;
|
||||
/^(?:(?:git\+)?(?:ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i;
|
||||
|
||||
// Has custom protocol
|
||||
const RE_CUSTOM_PROTOCOL = /^((git\+)?(ssh|https?|file)|git):\/\//i;
|
||||
const RE_CUSTOM_PROTOCOL = /^(?:(?:git\+)?(?:ssh|https?|file)|git):\/\//i;
|
||||
|
||||
// Valid hash format for npm / yarn ...
|
||||
const RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/;
|
||||
|
||||
// Simple hostname validate
|
||||
const RE_HOSTNAME = /^(?:[^/.]+(\.[^/]+)+|localhost)$/;
|
||||
const RE_HOSTNAME = /^(?:[^/.]+(?:\.[^/]+)+|localhost)$/;
|
||||
|
||||
// For hostname with colon. eg: ssh://user@github.com:foo/bar
|
||||
const RE_HOSTNAME_WITH_COLON =
|
||||
/([^/@#:.]+(?:\.[^/@#:.]+)+|localhost):([^#/0-9]+)/;
|
||||
|
||||
// Reg for url without protocol
|
||||
const RE_NO_PROTOCOL = /^([^/@#:.]+(?:\.[^/@#:.]+)+)/;
|
||||
const RE_NO_PROTOCOL = /^[^/@#:.]+(?:\.[^/@#:.]+)+/;
|
||||
|
||||
// RegExp for version string
|
||||
const VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
|
||||
const VERSION_PATTERN_REGEXP = /^(?:[\d^=v<>~]|[*xX]$)/;
|
||||
|
||||
// Specific protocol for short url without normal hostname
|
||||
const PROTOCOLS_FOR_SHORT = [
|
||||
@@ -248,7 +248,9 @@ function getGitUrlVersion(gitUrl) {
|
||||
|
||||
gitUrl = correctUrl(gitUrl);
|
||||
|
||||
/** @type {undefined | URL} */
|
||||
let parsed;
|
||||
|
||||
try {
|
||||
parsed = new URL(gitUrl);
|
||||
// eslint-disable-next-line no-empty
|
||||
|
||||
Reference in New Issue
Block a user