diff --git a/.eslintignore b/.eslintignore index af2e497fb8..93f43288ef 100644 --- a/.eslintignore +++ b/.eslintignore @@ -18,6 +18,7 @@ coverage/ # 忽略第三方包 /vendor/loader.js +override/ # 忽略文件 **/*-min.js diff --git a/package.json b/package.json index 6a581f353b..63a439e836 100644 --- a/package.json +++ b/package.json @@ -68,5 +68,10 @@ "lint-staged": { "*.{js,jsx,ts,tsx}": "eslint --cache --fix" }, - "packageManager": "pnpm@8.9.2" + "packageManager": "pnpm@8.9.2", + "pnpm": { + "patchedDependencies": { + "unplugin@1.5.1": "patches/unplugin@1.5.1.patch" + } + } } diff --git a/packages/bundles/CHANGELOG.md b/packages/bundles/CHANGELOG.md index 2f9160c023..52154d331e 100644 --- a/packages/bundles/CHANGELOG.md +++ b/packages/bundles/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.2.0 + +### Minor Changes + +- a68ff48d: feat: support @ice/pack-binding + ## 0.1.17 ### Patch Changes diff --git a/packages/bundles/override/rspack/adapter.js b/packages/bundles/override/rspack/adapter.js new file mode 100644 index 0000000000..5e378ec28f --- /dev/null +++ b/packages/bundles/override/rspack/adapter.js @@ -0,0 +1,669 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRawChunkLoading = exports.getRawEntryRuntime = exports.toRawSplitChunksOptions = exports.getRawLibrary = exports.getRawOptions = void 0; +const assert_1 = __importDefault(require("assert")); +const Stats_1 = require("../Stats"); +const util_1 = require("../util"); +const identifier_1 = require("../util/identifier"); +const adapterRuleUse_1 = require("./adapterRuleUse"); +const Module_1 = require("../Module"); +const getRawOptions = (options, compiler, processResource) => { + var _a, _b; + (0, assert_1.default)(!(0, util_1.isNil)(options.context) && !(0, util_1.isNil)(options.devtool) && !(0, util_1.isNil)(options.cache), "context, devtool, cache should not be nil after defaults"); + const devtool = options.devtool === false ? "" : options.devtool; + const mode = options.mode; + const experiments = getRawExperiments(options.experiments); + return { + // CUSTOM: add options of features. + features: options.features, + mode, + target: getRawTarget(options.target), + context: options.context, + output: getRawOutput(options.output), + resolve: getRawResolve(options.resolve), + resolveLoader: getRawResolve(options.resolveLoader), + module: getRawModule(options.module, { + compiler, + devtool, + mode, + context: options.context, + experiments + }), + devtool, + optimization: getRawOptimization(options.optimization), + stats: getRawStats(options.stats), + devServer: { + hot: (_b = (_a = options.devServer) === null || _a === void 0 ? void 0 : _a.hot) !== null && _b !== void 0 ? _b : false + }, + snapshot: getRawSnapshotOptions(options.snapshot), + cache: { + type: options.cache ? "memory" : "disable", + // TODO: implement below cache options + maxGenerations: 0, + maxAge: 0, + profile: false, + buildDependencies: [], + cacheDirectory: "", + cacheLocation: "", + name: "", + version: "" + }, + experiments, + node: getRawNode(options.node), + profile: options.profile, + // TODO: remove this + builtins: options.builtins + }; +}; +exports.getRawOptions = getRawOptions; +function getRawTarget(target) { + if (!target) { + return []; + } + if (typeof target === "string") { + return [target]; + } + return target; +} +function getRawAlias(alias = {}) { + const entires = Object.entries(alias).map(([key, value]) => { + if (Array.isArray(value)) { + return [key, value]; + } + else { + return [key, [value]]; + } + }); + return Object.fromEntries(entires); +} +function getRawResolveByDependency(byDependency) { + if (byDependency === undefined) + return byDependency; + return Object.fromEntries(Object.entries(byDependency).map(([k, v]) => [k, getRawResolve(v)])); +} +function getRawResolve(resolve) { + var _a, _b, _c; + let references = (_a = resolve.tsConfig) === null || _a === void 0 ? void 0 : _a.references; + let tsconfigConfigFile = (_b = resolve.tsConfigPath) !== null && _b !== void 0 ? _b : (_c = resolve.tsConfig) === null || _c === void 0 ? void 0 : _c.configFile; + return { + ...resolve, + alias: getRawAlias(resolve.alias), + fallback: getRawAlias(resolve.fallback), + extensionAlias: getRawAlias(resolve.extensionAlias), + tsconfig: tsconfigConfigFile + ? { + configFile: tsconfigConfigFile, + referencesType: references == "auto" ? "auto" : references ? "manual" : "disabled", + references: references == "auto" ? undefined : references + } + : undefined, + byDependency: getRawResolveByDependency(resolve.byDependency) + }; +} +function getRawCrossOriginLoading(crossOriginLoading) { + if (typeof crossOriginLoading === "boolean") { + return { type: "bool", boolPayload: crossOriginLoading }; + } + return { type: "string", stringPayload: crossOriginLoading }; +} +function getRawOutput(output) { + const chunkLoading = output.chunkLoading; + const wasmLoading = output.wasmLoading; + const workerChunkLoading = output.workerChunkLoading; + const workerWasmLoading = output.workerWasmLoading; + return { + path: output.path, + publicPath: output.publicPath, + clean: output.clean, + assetModuleFilename: output.assetModuleFilename, + filename: output.filename, + chunkFilename: output.chunkFilename, + chunkLoading: getRawChunkLoading(chunkLoading), + crossOriginLoading: getRawCrossOriginLoading(output.crossOriginLoading), + cssFilename: output.cssFilename, + cssChunkFilename: output.cssChunkFilename, + hotUpdateChunkFilename: output.hotUpdateChunkFilename, + hotUpdateMainFilename: output.hotUpdateMainFilename, + hotUpdateGlobal: output.hotUpdateGlobal, + uniqueName: output.uniqueName, + chunkLoadingGlobal: output.chunkLoadingGlobal, + enabledLibraryTypes: output.enabledLibraryTypes, + library: output.library && getRawLibrary(output.library), + strictModuleErrorHandling: output.strictModuleErrorHandling, + globalObject: output.globalObject, + importFunctionName: output.importFunctionName, + iife: output.iife, + module: output.module, + wasmLoading: wasmLoading === false ? "false" : wasmLoading, + enabledWasmLoadingTypes: output.enabledWasmLoadingTypes, + enabledChunkLoadingTypes: output.enabledChunkLoadingTypes, + webassemblyModuleFilename: output.webassemblyModuleFilename, + trustedTypes: output.trustedTypes, + sourceMapFilename: output.sourceMapFilename, + hashFunction: output.hashFunction, + hashDigest: output.hashDigest, + hashDigestLength: output.hashDigestLength, + hashSalt: output.hashSalt, + asyncChunks: output.asyncChunks, + workerChunkLoading: workerChunkLoading === false ? "false" : workerChunkLoading, + workerWasmLoading: workerWasmLoading === false ? "false" : workerWasmLoading, + workerPublicPath: output.workerPublicPath, + scriptType: output.scriptType === false ? "false" : output.scriptType + }; +} +function getRawLibrary(library) { + const { type, name, export: libraryExport, umdNamedDefine, auxiliaryComment, amdContainer } = library; + return { + amdContainer, + auxiliaryComment: typeof auxiliaryComment === "string" + ? { + commonjs: auxiliaryComment, + commonjs2: auxiliaryComment, + amd: auxiliaryComment, + root: auxiliaryComment + } + : auxiliaryComment, + libraryType: type, + name: (0, util_1.isNil)(name) ? name : getRawLibraryName(name), + export: Array.isArray(libraryExport) || libraryExport == null + ? libraryExport + : [libraryExport], + umdNamedDefine + }; +} +exports.getRawLibrary = getRawLibrary; +function getRawLibraryName(name) { + if (typeof name === "string") { + return { + type: "string", + stringPayload: name + }; + } + if (Array.isArray(name)) { + return { + type: "array", + arrayPayload: name + }; + } + if (typeof name === "object" && !Array.isArray(name)) { + return { + type: "umdObject", + umdObjectPayload: { + commonjs: name.commonjs, + root: Array.isArray(name.root) || (0, util_1.isNil)(name.root) + ? name.root + : [name.root], + amd: name.amd + } + }; + } + throw new Error("unreachable"); +} +function getRawModule(module, options) { + (0, assert_1.default)(!(0, util_1.isNil)(module.defaultRules), "module.defaultRules should not be nil after defaults"); + // "..." in defaultRules will be flatten in `applyModuleDefaults`, and "..." in rules is empty, so it's safe to use `as RuleSetRule[]` at here + const ruleSet = [ + { rules: module.defaultRules }, + { rules: module.rules } + ]; + const rules = ruleSet.map((rule, index) => getRawModuleRule(rule, `ruleSet[${index}]`, options)); + return { + rules, + parser: getRawParserOptionsByModuleType(module.parser), + generator: getRawGeneratorOptionsByModuleType(module.generator) + }; +} +function tryMatch(payload, condition) { + if (typeof condition === "string") { + return payload.startsWith(condition); + } + if (condition instanceof RegExp) { + return condition.test(payload); + } + if (typeof condition === "function") { + return condition(payload); + } + if (Array.isArray(condition)) { + return condition.some(c => tryMatch(payload, c)); + } + if (condition && typeof condition === "object") { + if (condition.and) { + return condition.and.every(c => tryMatch(payload, c)); + } + if (condition.or) { + return condition.or.some(c => tryMatch(payload, c)); + } + if (condition.not) { + return condition.not.every(c => !tryMatch(payload, c)); + } + } + return false; +} +const deprecatedRuleType = (type) => { + type !== null && type !== void 0 ? type : (type = "javascript/auto"); + if (/ts|typescript|tsx|typescriptx|jsx|javascriptx/.test(type)) { + (0, util_1.deprecatedWarn)(`'Rule.type: ${type}' has been deprecated, please migrate to builtin:swc-loader with type 'javascript/auto'`); + } +}; +const getRawModuleRule = (rule, path, options) => { + var _a, _b, _c; + // Rule.loader is a shortcut to Rule.use: [ { loader } ]. + // See: https://webpack.js.org/configuration/module/#ruleloader + if (rule.loader) { + rule.use = [ + { + loader: rule.loader, + options: rule.options + } + ]; + } + let funcUse; + if (typeof rule.use === "function") { + funcUse = (rawContext) => { + const context = { + ...rawContext, + compiler: options.compiler + }; + const uses = rule.use(context); + return (0, adapterRuleUse_1.createRawModuleRuleUses)(uses !== null && uses !== void 0 ? uses : [], `${path}.use`, options); + }; + } + let rawModuleRule = { + test: rule.test ? getRawRuleSetCondition(rule.test) : undefined, + include: rule.include ? getRawRuleSetCondition(rule.include) : undefined, + exclude: rule.exclude ? getRawRuleSetCondition(rule.exclude) : undefined, + issuer: rule.issuer ? getRawRuleSetCondition(rule.issuer) : undefined, + dependency: rule.dependency + ? getRawRuleSetCondition(rule.dependency) + : undefined, + descriptionData: rule.descriptionData + ? Object.fromEntries(Object.entries(rule.descriptionData).map(([k, v]) => [ + k, + getRawRuleSetCondition(v) + ])) + : undefined, + resource: rule.resource ? getRawRuleSetCondition(rule.resource) : undefined, + resourceQuery: rule.resourceQuery + ? getRawRuleSetCondition(rule.resourceQuery) + : undefined, + resourceFragment: rule.resourceFragment + ? getRawRuleSetCondition(rule.resourceFragment) + : undefined, + scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : undefined, + mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : undefined, + sideEffects: rule.sideEffects, + use: typeof rule.use === "function" + ? { type: "function", funcUse } + : { + type: "array", + arrayUse: (0, adapterRuleUse_1.createRawModuleRuleUses)((_a = rule.use) !== null && _a !== void 0 ? _a : [], `${path}.use`, options) + }, + type: rule.type, + parser: rule.parser + ? getRawParserOptions(rule.parser, (_b = rule.type) !== null && _b !== void 0 ? _b : "javascript/auto") + : undefined, + generator: rule.generator + ? getRawGeneratorOptions(rule.generator, (_c = rule.type) !== null && _c !== void 0 ? _c : "javascript/auto") + : undefined, + resolve: rule.resolve ? getRawResolve(rule.resolve) : undefined, + oneOf: rule.oneOf + ? rule.oneOf.map((rule, index) => getRawModuleRule(rule, `${path}.oneOf[${index}]`, options)) + : undefined, + rules: rule.rules + ? rule.rules.map((rule, index) => getRawModuleRule(rule, `${path}.rules[${index}]`, options)) + : undefined, + enforce: rule.enforce + }; + // Function calls may contain side-effects when interoperating with single-threaded environment. + // In order to mitigate the issue, Rspack tries to merge these calls together. + // See: https://github.com/web-infra-dev/rspack/issues/4003#issuecomment-1689662380 + if (typeof rule.test === "function" || + typeof rule.resource === "function" || + typeof rule.resourceQuery === "function" || + typeof rule.resourceFragment === "function") { + delete rawModuleRule.test; + delete rawModuleRule.resource; + delete rawModuleRule.resourceQuery; + delete rawModuleRule.resourceFragment; + rawModuleRule.rspackResource = getRawRuleSetCondition(function (resourceQueryFragment) { + const { path, query, fragment } = (0, identifier_1.parseResource)(resourceQueryFragment); + if (rule.test && !tryMatch(path, rule.test)) { + return false; + } + else if (rule.resource && !tryMatch(path, rule.resource)) { + return false; + } + if (rule.resourceQuery && !tryMatch(query, rule.resourceQuery)) { + return false; + } + if (rule.resourceFragment && !tryMatch(fragment, rule.resourceFragment)) { + return false; + } + return true; + }); + } + if (options.experiments.rspackFuture.disableTransformByDefault) { + deprecatedRuleType(rule.type); + } + return rawModuleRule; +}; +function getRawRuleSetCondition(condition) { + if (typeof condition === "string") { + return { + type: "string", + stringMatcher: condition + }; + } + if (condition instanceof RegExp) { + return { + type: "regexp", + regexpMatcher: { + source: condition.source, + flags: condition.flags + } + }; + } + if (typeof condition === "function") { + return { + type: "function", + funcMatcher: condition + }; + } + if (Array.isArray(condition)) { + return { + type: "array", + arrayMatcher: condition.map(i => getRawRuleSetCondition(i)) + }; + } + if (typeof condition === "object" && condition !== null) { + return { + type: "logical", + logicalMatcher: [getRawRuleSetLogicalConditions(condition)] + }; + } + throw new Error("unreachable: condition should be one of string, RegExp, Array, Object"); +} +function getRawRuleSetLogicalConditions(logical) { + return { + and: logical.and + ? logical.and.map(i => getRawRuleSetCondition(i)) + : undefined, + or: logical.or ? logical.or.map(i => getRawRuleSetCondition(i)) : undefined, + not: logical.not ? getRawRuleSetCondition(logical.not) : undefined + }; +} +function getRawParserOptionsByModuleType(parser) { + return Object.fromEntries(Object.entries(parser).map(([k, v]) => [k, getRawParserOptions(v, k)])); +} +function getRawGeneratorOptionsByModuleType(parser) { + return Object.fromEntries(Object.entries(parser).map(([k, v]) => [k, getRawGeneratorOptions(v, k)])); +} +function getRawParserOptions(parser, type) { + if (type === "asset") { + return { + type: "asset", + asset: getRawAssetParserOptions(parser) + }; + } + else if (type === "javascript") { + return { + type: "javascript", + javascript: getRawJavascriptParserOptions(parser) + }; + } + return { + type: "unknown" + }; +} +function getRawJavascriptParserOptions(parser) { + var _a; + return { + dynamicImportMode: (_a = parser.dynamicImportMode) !== null && _a !== void 0 ? _a : "lazy" + }; +} +function getRawAssetParserOptions(parser) { + return { + dataUrlCondition: parser.dataUrlCondition + ? getRawAssetParserDataUrl(parser.dataUrlCondition) + : undefined + }; +} +function getRawAssetParserDataUrl(dataUrlCondition) { + if (typeof dataUrlCondition === "object" && dataUrlCondition !== null) { + return { + type: "options", + options: { + maxSize: dataUrlCondition.maxSize + } + }; + } + throw new Error(`unreachable: AssetParserDataUrl type should be one of "options", but got ${dataUrlCondition}`); +} +function getRawGeneratorOptions(generator, type) { + if (type === "asset") { + return { + type: "asset", + asset: generator ? getRawAssetGeneratorOptions(generator) : undefined + }; + } + if (type === "asset/inline") { + return { + type: "asset/inline", + assetInline: generator + ? getRawAssetInlineGeneratorOptions(generator) + : undefined + }; + } + if (type === "asset/resource") { + return { + type: "asset/resource", + assetResource: generator + ? getRawAssetResourceGeneratorOptions(generator) + : undefined + }; + } + return { + type: "unknown" + }; +} +function getRawAssetGeneratorOptions(options) { + return { + ...getRawAssetInlineGeneratorOptions(options), + ...getRawAssetResourceGeneratorOptions(options) + }; +} +function getRawAssetInlineGeneratorOptions(options) { + return { + dataUrl: options.dataUrl + ? getRawAssetGeneratorDaraUrl(options.dataUrl) + : undefined + }; +} +function getRawAssetResourceGeneratorOptions(options) { + return { + filename: options.filename, + publicPath: options.publicPath + }; +} +function getRawAssetGeneratorDaraUrl(dataUrl) { + if (typeof dataUrl === "object" && dataUrl !== null) { + return { + type: "options", + options: { + encoding: dataUrl.encoding === false ? "false" : dataUrl.encoding, + mimetype: dataUrl.mimetype + } + }; + } + throw new Error(`unreachable: AssetGeneratorDataUrl type should be one of "options", but got ${dataUrl}`); +} +function getRawOptimization(optimization) { + (0, assert_1.default)(!(0, util_1.isNil)(optimization.moduleIds) && + !(0, util_1.isNil)(optimization.chunkIds) && + !(0, util_1.isNil)(optimization.removeAvailableModules) && + !(0, util_1.isNil)(optimization.removeEmptyChunks) && + !(0, util_1.isNil)(optimization.sideEffects) && + !(0, util_1.isNil)(optimization.realContentHash) && + !(0, util_1.isNil)(optimization.providedExports) && + !(0, util_1.isNil)(optimization.usedExports) && + !(0, util_1.isNil)(optimization.innerGraph), "optimization.moduleIds, optimization.removeAvailableModules, optimization.removeEmptyChunks, optimization.sideEffects, optimization.realContentHash, optimization.providedExports, optimization.usedExports, optimization.innerGraph should not be nil after defaults"); + return { + chunkIds: optimization.chunkIds, + splitChunks: toRawSplitChunksOptions(optimization.splitChunks), + moduleIds: optimization.moduleIds, + removeAvailableModules: optimization.removeAvailableModules, + removeEmptyChunks: optimization.removeEmptyChunks, + sideEffects: String(optimization.sideEffects), + realContentHash: optimization.realContentHash, + usedExports: String(optimization.usedExports), + providedExports: optimization.providedExports, + innerGraph: optimization.innerGraph, + mangleExports: String(optimization.mangleExports) + }; +} +function toRawSplitChunksOptions(sc) { + if (!sc) { + return; + } + function getName(name) { + if (typeof name === "function") { + return (ctx) => { + if (typeof ctx.module === "undefined") { + return name(undefined); + } + else { + return name(Module_1.Module.__from_binding(ctx.module)); + } + }; + } + else { + return name; + } + } + function getTest(test) { + if (typeof test === "function") { + return (ctx) => { + if (typeof ctx.module === "undefined") { + return test(undefined); + } + else { + return test(Module_1.Module.__from_binding(ctx.module)); + } + }; + } + else { + return test; + } + } + const { name, cacheGroups = {}, ...passThrough } = sc; + return { + name: getName(name), + cacheGroups: Object.entries(cacheGroups) + .filter(([_key, group]) => group !== false) + .map(([key, group]) => { + group = group; + const { test, name, ...passThrough } = group; + const rawGroup = { + key, + test: getTest(test), + name: getName(name), + ...passThrough + }; + return rawGroup; + }), + ...passThrough + }; +} +exports.toRawSplitChunksOptions = toRawSplitChunksOptions; +function getRawSnapshotOptions(snapshot) { + const { resolve, module } = snapshot; + (0, assert_1.default)(!(0, util_1.isNil)(resolve) && !(0, util_1.isNil)(module)); + const { timestamp: resolveTimestamp, hash: resolveHash } = resolve; + const { timestamp: moduleTimestamp, hash: moduleHash } = module; + (0, assert_1.default)(!(0, util_1.isNil)(resolveTimestamp) && + !(0, util_1.isNil)(resolveHash) && + !(0, util_1.isNil)(moduleTimestamp) && + !(0, util_1.isNil)(moduleHash)); + return { + resolve: { + timestamp: resolveTimestamp, + hash: resolveHash + }, + module: { + timestamp: moduleTimestamp, + hash: moduleHash + } + }; +} +function getRawExperiments(experiments) { + const { lazyCompilation, incrementalRebuild, asyncWebAssembly, newSplitChunks, topLevelAwait, css, rspackFuture } = experiments; + (0, assert_1.default)(!(0, util_1.isNil)(lazyCompilation) && + !(0, util_1.isNil)(incrementalRebuild) && + !(0, util_1.isNil)(asyncWebAssembly) && + !(0, util_1.isNil)(newSplitChunks) && + !(0, util_1.isNil)(topLevelAwait) && + !(0, util_1.isNil)(css) && + !(0, util_1.isNil)(rspackFuture)); + return { + lazyCompilation, + incrementalRebuild: getRawIncrementalRebuild(incrementalRebuild), + asyncWebAssembly, + newSplitChunks, + topLevelAwait, + css, + rspackFuture: getRawRspackFutureOptions(rspackFuture) + }; +} +function getRawRspackFutureOptions(future) { + (0, assert_1.default)(!(0, util_1.isNil)(future.newResolver)); + (0, assert_1.default)(!(0, util_1.isNil)(future.newTreeshaking)); + (0, assert_1.default)(!(0, util_1.isNil)(future.disableTransformByDefault)); + return { + newResolver: future.newResolver, + newTreeshaking: future.newTreeshaking, + disableTransformByDefault: future.disableTransformByDefault + }; +} +function getRawIncrementalRebuild(inc) { + if (inc === false) { + return { + make: false, + emitAsset: false + }; + } + const { make, emitAsset } = inc; + (0, assert_1.default)(!(0, util_1.isNil)(make) && !(0, util_1.isNil)(emitAsset)); + return { + make, + emitAsset + }; +} +function getRawNode(node) { + if (node === false) { + return undefined; + } + (0, assert_1.default)(!(0, util_1.isNil)(node.__dirname) && !(0, util_1.isNil)(node.global) && !(0, util_1.isNil)(node.__filename)); + return { + dirname: String(node.__dirname), + filename: String(node.__filename), + global: String(node.global) + }; +} +function getRawStats(stats) { + var _a; + const statsOptions = (0, Stats_1.normalizeStatsPreset)(stats); + return { + colors: (_a = statsOptions.colors) !== null && _a !== void 0 ? _a : false + }; +} +function getRawEntryRuntime(runtime) { + return runtime === false ? undefined : runtime; +} +exports.getRawEntryRuntime = getRawEntryRuntime; +function getRawChunkLoading(chunkLoading) { + return chunkLoading === false ? "false" : chunkLoading; +} +exports.getRawChunkLoading = getRawChunkLoading; diff --git a/packages/bundles/override/rspack/bindingVersionCheck.js b/packages/bundles/override/rspack/bindingVersionCheck.js new file mode 100644 index 0000000000..447f1ca336 --- /dev/null +++ b/packages/bundles/override/rspack/bindingVersionCheck.js @@ -0,0 +1,6 @@ +"use strict"; +const checkVersion = function() { + // Skip binding version check, framework will lock the binding version. + return null; +} +exports.checkVersion = checkVersion; diff --git a/packages/bundles/override/rspack/defaults.js b/packages/bundles/override/rspack/defaults.js new file mode 100644 index 0000000000..68db4c167b --- /dev/null +++ b/packages/bundles/override/rspack/defaults.js @@ -0,0 +1,763 @@ +"use strict"; +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/defaults.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyRspackOptionsBaseDefaults = exports.applyRspackOptionsDefaults = void 0; +const assert_1 = __importDefault(require("assert")); +const fs_1 = __importDefault(require("fs")); +const path_1 = __importDefault(require("path")); +const util_1 = require("../util"); +const cleverMerge_1 = require("../util/cleverMerge"); +const target_1 = require("./target"); +const Template_1 = __importDefault(require("../Template")); +const assertNotNil_1 = require("../util/assertNotNil"); +const ModuleTypeConstants_1 = require("../ModuleTypeConstants"); +const applyRspackOptionsDefaults = (options) => { + var _a; + F(options, "context", () => process.cwd()); + F(options, "target", () => { + return (0, target_1.getDefaultTarget)(options.context); + }); + const { mode, target } = options; + (0, assert_1.default)(!(0, util_1.isNil)(target)); + let targetProperties = target === false + ? false + : typeof target === "string" + ? (0, target_1.getTargetProperties)(target, options.context) + : (0, target_1.getTargetsProperties)(target, options.context); + const development = mode === "development"; + const production = mode === "production" || !mode; + if (typeof options.entry !== "function") { + for (const key of Object.keys(options.entry)) { + F(options.entry[key], "import", () => ["./src"]); + } + } + F(options, "devtool", () => false); + D(options, "watch", false); + D(options, "profile", false); + const futureDefaults = (_a = options.experiments.futureDefaults) !== null && _a !== void 0 ? _a : false; + F(options, "cache", () => development); + applyExperimentsDefaults(options.experiments, { + cache: options.cache + }); + // CUSTOM: add default rules for features options. + if (options.features) { + applyFeaturesDefaults(options.features); + } else { + D(options, 'features', {}); + } + applySnapshotDefaults(options.snapshot, { production }); + applyModuleDefaults(options.module, { + // syncWebAssembly: options.experiments.syncWebAssembly, + asyncWebAssembly: options.experiments.asyncWebAssembly, + disableTransformByDefault: options.experiments.rspackFuture.disableTransformByDefault, + css: options.experiments.css + }); + applyOutputDefaults(options.output, { + context: options.context, + targetProperties, + isAffectedByBrowserslist: target === undefined || + (typeof target === "string" && target.startsWith("browserslist")) || + (Array.isArray(target) && + target.some(target => target.startsWith("browserslist"))), + outputModule: options.experiments.outputModule, + entry: options.entry, + futureDefaults + }); + applyExternalsPresetsDefaults(options.externalsPresets, { + targetProperties + }); + // @ts-expect-error + F(options, "externalsType", () => { + return options.output.library + ? options.output.library.type + : options.output.module + ? "module" + : "var"; + }); + applyNodeDefaults(options.node, { targetProperties }); + applyOptimizationDefaults(options.optimization, { production, development }); + options.resolve = (0, cleverMerge_1.cleverMerge)(getResolveDefaults({ + targetProperties, + mode: options.mode + }), options.resolve); + options.resolveLoader = (0, cleverMerge_1.cleverMerge)(getResolveLoaderDefaults(), options.resolveLoader); +}; +exports.applyRspackOptionsDefaults = applyRspackOptionsDefaults; +const applyRspackOptionsBaseDefaults = (options) => { + F(options, "context", () => process.cwd()); + applyInfrastructureLoggingDefaults(options.infrastructureLogging); +}; +exports.applyRspackOptionsBaseDefaults = applyRspackOptionsBaseDefaults; +const applyInfrastructureLoggingDefaults = (infrastructureLogging) => { + F(infrastructureLogging, "stream", () => process.stderr); + const tty = infrastructureLogging.stream.isTTY && process.env.TERM !== "dumb"; + D(infrastructureLogging, "level", "info"); + D(infrastructureLogging, "debug", false); + D(infrastructureLogging, "colors", tty); + D(infrastructureLogging, "appendOnly", !tty); +}; +const applyExperimentsDefaults = (experiments, { cache }) => { + D(experiments, "lazyCompilation", false); + D(experiments, "asyncWebAssembly", false); + D(experiments, "newSplitChunks", true); + D(experiments, "css", true); // we not align with webpack about the default value for better DX + D(experiments, "topLevelAwait", true); + D(experiments, "incrementalRebuild", {}); + if (typeof experiments.incrementalRebuild === "object") { + D(experiments.incrementalRebuild, "make", true); + D(experiments.incrementalRebuild, "emitAsset", true); + } + if (cache === false && + experiments.incrementalRebuild && + experiments.incrementalRebuild.make) { + experiments.incrementalRebuild.make = false; + // TODO: use logger to warn user enable cache for incrementalRebuild.make + } + D(experiments, "rspackFuture", {}); + if (typeof experiments.rspackFuture === "object") { + D(experiments.rspackFuture, "newResolver", true); + D(experiments.rspackFuture, "newTreeshaking", false); + D(experiments.rspackFuture, "disableTransformByDefault", true); + } +}; +const applyFeaturesDefaults = (features) => { + D(features, 'split_chunks_strategy', {}); + if (typeof features.split_chunks_strategy === 'object') { + D(features.split_chunks_strategy, 'name', ''); + D(features.split_chunks_strategy, 'topLevelFrameworks', []); + } +}; +const applySnapshotDefaults = (snapshot, { production }) => { + F(snapshot, "module", () => production + ? { timestamp: true, hash: true } + : { timestamp: true, hash: false }); + F(snapshot, "resolve", () => production + ? { timestamp: true, hash: true } + : { timestamp: true, hash: false }); +}; +const applyJavascriptParserOptionsDefaults = (parserOptions) => { + D(parserOptions, "dynamicImportMode", "lazy"); +}; +const applyModuleDefaults = (module, { asyncWebAssembly, css, disableTransformByDefault }) => { + (0, assertNotNil_1.assertNotNill)(module.parser); + F(module.parser, ModuleTypeConstants_1.ASSET_MODULE_TYPE, () => ({})); + (0, assertNotNil_1.assertNotNill)(module.parser.asset); + F(module.parser.asset, "dataUrlCondition", () => ({})); + if (typeof module.parser.asset.dataUrlCondition === "object") { + D(module.parser.asset.dataUrlCondition, "maxSize", 8096); + } + F(module.parser, "javascript", () => ({})); + (0, assertNotNil_1.assertNotNill)(module.parser.javascript); + applyJavascriptParserOptionsDefaults(module.parser.javascript); + A(module, "defaultRules", () => { + const esm = { + type: "javascript/esm", + resolve: { + byDependency: { + esm: { + fullySpecified: true + } + } + } + }; + const commonjs = { + type: "javascript/dynamic" + }; + const rules = [ + { + mimetype: "application/node", + type: "javascript/auto" + }, + { + test: /\.json$/i, + type: "json" + }, + { + mimetype: "application/json", + type: "json" + }, + { + test: /\.mjs$/i, + ...esm + }, + { + test: /\.js$/i, + descriptionData: { + type: "module" + }, + ...esm + }, + { + test: /\.cjs$/i, + ...commonjs + }, + { + test: /\.js$/i, + descriptionData: { + type: "commonjs" + }, + ...commonjs + }, + { + mimetype: { + or: ["text/javascript", "application/javascript"] + }, + ...esm + } + ]; + // TODO: remove in 0.5.0 + if (!disableTransformByDefault) { + rules.push({ + test: /\.jsx$/i, + type: "jsx" + }, { + test: /\.ts$/i, + type: "ts" + }, { + test: /\.tsx$/i, + type: "tsx" + }); + } + if (asyncWebAssembly) { + const wasm = { + type: "webassembly/async", + rules: [ + { + descriptionData: { + type: "module" + }, + resolve: { + fullySpecified: true + } + } + ] + }; + rules.push({ + test: /\.wasm$/i, + ...wasm + }); + rules.push({ + mimetype: "application/wasm", + ...wasm + }); + } + if (css) { + const cssRule = { + type: "css", + resolve: { + fullySpecified: true, + preferRelative: true + } + }; + const cssModulesRule = { + type: "css/module", + resolve: { + fullySpecified: true + } + }; + rules.push({ + test: /\.css$/i, + oneOf: [ + { + test: /\.module\.css$/i, + ...cssModulesRule + }, + { + ...cssRule + } + ] + }); + rules.push({ + mimetype: "text/css+module", + ...cssModulesRule + }); + rules.push({ + mimetype: "text/css", + ...cssRule + }); + } + rules.push({ + dependency: "url", + oneOf: [ + { + scheme: /^data$/, + type: "asset/inline" + }, + { + type: "asset/resource" + } + ] + }); + return rules; + }); +}; +const applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist, entry, futureDefaults }) => { + const getLibraryName = (library) => { + const libraryName = typeof library === "object" && + library && + !Array.isArray(library) && + "type" in library + ? library.name + : library; + if (Array.isArray(libraryName)) { + return libraryName.join("."); + } + else if (typeof libraryName === "object") { + return getLibraryName(libraryName.root); + } + else if (typeof libraryName === "string") { + return libraryName; + } + return ""; + }; + F(output, "uniqueName", () => { + const libraryName = getLibraryName(output.library).replace(/^\[(\\*[\w:]+\\*)\](\.)|(\.)\[(\\*[\w:]+\\*)\](?=\.|$)|\[(\\*[\w:]+\\*)\]/g, (m, a, d1, d2, b, c) => { + const content = a || b || c; + return content.startsWith("\\") && content.endsWith("\\") + ? `${d2 || ""}[${content.slice(1, -1)}]${d1 || ""}` + : ""; + }); + if (libraryName) + return libraryName; + const pkgPath = path_1.default.resolve(context, "package.json"); + try { + const packageInfo = JSON.parse(fs_1.default.readFileSync(pkgPath, "utf-8")); + return packageInfo.name || ""; + } + catch (e) { + if (e.code !== "ENOENT") { + e.message += `\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`; + throw e; + } + return ""; + } + }); + F(output, "chunkLoadingGlobal", () => Template_1.default.toIdentifier("webpackChunk" + Template_1.default.toIdentifier(output.uniqueName))); + F(output, "module", () => !!outputModule); + D(output, "filename", output.module ? "[name].mjs" : "[name].js"); + F(output, "iife", () => !output.module); + F(output, "chunkFilename", () => { + const filename = output.filename; + if (typeof filename !== "function") { + const hasName = filename.includes("[name]"); + const hasId = filename.includes("[id]"); + const hasChunkHash = filename.includes("[chunkhash]"); + const hasContentHash = filename.includes("[contenthash]"); + // Anything changing depending on chunk is fine + if (hasChunkHash || hasContentHash || hasName || hasId) + return filename; + // Otherwise prefix "[id]." in front of the basename to make it changing + return filename.replace(/(^|\/)([^/]*(?:\?|$))/, "$1[id].$2"); + } + return "[id].js"; + }); + F(output, "cssFilename", () => { + const filename = output.filename; + if (typeof filename !== "function") { + return filename.replace(/\.[mc]?js(\?|$)/, ".css$1"); + } + return "[id].css"; + }); + F(output, "cssChunkFilename", () => { + const chunkFilename = output.chunkFilename; + if (typeof chunkFilename !== "function") { + return chunkFilename.replace(/\.[mc]?js(\?|$)/, ".css$1"); + } + return "[id].css"; + }); + D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`); + D(output, "hotUpdateMainFilename", "[runtime].[fullhash].hot-update.json"); + F(output, "hotUpdateGlobal", () => Template_1.default.toIdentifier("webpackHotUpdate" + Template_1.default.toIdentifier(output.uniqueName))); + D(output, "assetModuleFilename", "[hash][ext][query]"); + D(output, "webassemblyModuleFilename", "[hash].module.wasm"); + F(output, "path", () => path_1.default.join(process.cwd(), "dist")); + D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : ""); + D(output, "hashFunction", futureDefaults ? "xxhash64" : "md4"); + D(output, "hashDigest", "hex"); + D(output, "hashDigestLength", futureDefaults ? 16 : 20); + D(output, "strictModuleErrorHandling", false); + if (output.library) { + F(output.library, "type", () => (output.module ? "module" : "var")); + } + F(output, "chunkFormat", () => { + if (tp) { + const helpMessage = isAffectedByBrowserslist + ? "Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively specify the 'output.chunkFormat' directly." + : "Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly."; + if (output.module) { + if (tp.dynamicImport) + return "module"; + if (tp.document) + return "array-push"; + throw new Error("For the selected environment is no default ESM chunk format available:\n" + + "ESM exports can be chosen when 'import()' is available.\n" + + "JSONP Array push can be chosen when 'document' is available.\n" + + helpMessage); + } + else { + if (tp.document) + return "array-push"; + if (tp.require) + return "commonjs"; + if (tp.nodeBuiltins) + return "commonjs"; + if (tp.importScripts) + return "array-push"; + throw new Error("For the selected environment is no default script chunk format available:\n" + + "JSONP Array push can be chosen when 'document' or 'importScripts' is available.\n" + + "CommonJs exports can be chosen when 'require' or node builtins are available.\n" + + helpMessage); + } + } + throw new Error("Chunk format can't be selected by default when no target is specified"); + }); + D(output, "asyncChunks", true); + F(output, "chunkLoading", () => { + if (tp) { + switch (output.chunkFormat) { + case "array-push": + if (tp.document) + return "jsonp"; + if (tp.importScripts) + return "import-scripts"; + break; + case "commonjs": + if (tp.require) + return "require"; + if (tp.nodeBuiltins) + return "async-node"; + break; + case "module": + if (tp.dynamicImport) + return "import"; + break; + } + if (tp.require === null || + tp.nodeBuiltins === null || + tp.document === null || + tp.importScripts === null) { + return "universal"; + } + } + return false; + }); + F(output, "workerChunkLoading", () => { + if (tp) { + switch (output.chunkFormat) { + case "array-push": + if (tp.importScriptsInWorker) + return "import-scripts"; + break; + case "commonjs": + if (tp.require) + return "require"; + if (tp.nodeBuiltins) + return "async-node"; + break; + case "module": + if (tp.dynamicImportInWorker) + return "import"; + break; + } + if (tp.require === null || + tp.nodeBuiltins === null || + tp.importScriptsInWorker === null) { + return "universal"; + } + } + return false; + }); + F(output, "wasmLoading", () => { + if (tp) { + if (tp.fetchWasm) + return "fetch"; + if (tp.nodeBuiltins) + return output.module ? "async-node-module" : "async-node"; + if (tp.nodeBuiltins === null || tp.fetchWasm === null) { + return "universal"; + } + } + return false; + }); + F(output, "workerWasmLoading", () => output.wasmLoading); + F(output, "globalObject", () => { + if (tp) { + if (tp.global) + return "global"; + if (tp.globalThis) + return "globalThis"; + } + return "self"; + }); + D(output, "importFunctionName", "import"); + F(output, "clean", () => !!output.clean); + D(output, "crossOriginLoading", false); + D(output, "workerPublicPath", ""); + F(output, "sourceMapFilename", () => { + return "[file].map"; + }); + F(output, "scriptType", () => (output.module ? "module" : false)); + const { trustedTypes } = output; + if (trustedTypes) { + F(trustedTypes, "policyName", () => output.uniqueName.replace(/[^a-zA-Z0-9\-#=_/@.%]+/g, "_") || "webpack"); + } + const forEachEntry = (fn) => { + for (const name of Object.keys(entry)) { + fn(entry[name]); + } + }; + A(output, "enabledLibraryTypes", () => { + const enabledLibraryTypes = []; + if (output.library) { + enabledLibraryTypes.push(output.library.type); + } + forEachEntry(desc => { + if (desc.library) { + enabledLibraryTypes.push(desc.library.type); + } + }); + return enabledLibraryTypes; + }); + A(output, "enabledChunkLoadingTypes", () => { + const enabledChunkLoadingTypes = new Set(); + if (output.chunkLoading) { + enabledChunkLoadingTypes.add(output.chunkLoading); + } + if (output.workerChunkLoading) { + enabledChunkLoadingTypes.add(output.workerChunkLoading); + } + forEachEntry(desc => { + if (desc.chunkLoading) { + enabledChunkLoadingTypes.add(desc.chunkLoading); + } + }); + return Array.from(enabledChunkLoadingTypes); + }); + A(output, "enabledWasmLoadingTypes", () => { + const enabledWasmLoadingTypes = new Set(); + if (output.wasmLoading) { + enabledWasmLoadingTypes.add(output.wasmLoading); + } + if (output.workerWasmLoading) { + enabledWasmLoadingTypes.add(output.workerWasmLoading); + } + // forEachEntry(desc => { + // if (desc.wasmLoading) { + // enabledWasmLoadingTypes.add(desc.wasmLoading); + // } + // }); + return Array.from(enabledWasmLoadingTypes); + }); +}; +const applyExternalsPresetsDefaults = (externalsPresets, { targetProperties }) => { + D(externalsPresets, "web", targetProperties && targetProperties.web); + D(externalsPresets, "node", targetProperties && targetProperties.node); + D(externalsPresets, "electron", targetProperties && targetProperties.electron); + D(externalsPresets, "electronMain", targetProperties && + targetProperties.electron && + targetProperties.electronMain); + D(externalsPresets, "electronPreload", targetProperties && + targetProperties.electron && + targetProperties.electronPreload); + D(externalsPresets, "electronRenderer", targetProperties && + targetProperties.electron && + targetProperties.electronRenderer); +}; +const applyNodeDefaults = (node, { targetProperties }) => { + if (node === false) + return; + F(node, "global", () => { + if (targetProperties && targetProperties.global) + return false; + return "warn"; + }); + F(node, "__dirname", () => { + if (targetProperties && targetProperties.node) + return "eval-only"; + return "warn-mock"; + }); + F(node, "__filename", () => { + if (targetProperties && targetProperties.node) + return "eval-only"; + return "warn-mock"; + }); +}; +const applyOptimizationDefaults = (optimization, { production, development }) => { + D(optimization, "removeAvailableModules", true); + D(optimization, "removeEmptyChunks", true); + D(optimization, "mergeDuplicateChunks", true); + F(optimization, "moduleIds", () => { + if (production) + return "deterministic"; + return "named"; + }); + F(optimization, "chunkIds", () => "named"); + F(optimization, "sideEffects", () => (production ? true : "flag")); + D(optimization, "mangleExports", production); + D(optimization, "providedExports", true); + D(optimization, "usedExports", production); + D(optimization, "innerGraph", production); + D(optimization, "runtimeChunk", false); + D(optimization, "realContentHash", production); + D(optimization, "minimize", production); + A(optimization, "minimizer", () => [ + // TODO: enable this when drop support for builtins options + // new SwcJsMinimizerPlugin(), + // new SwcCssMinimizerPlugin() + ]); + F(optimization, "nodeEnv", () => { + if (production) + return "production"; + if (development) + return "development"; + return false; + }); + const { splitChunks } = optimization; + if (splitChunks) { + // A(splitChunks, "defaultSizeTypes", () => + // css ? ["javascript", "css", "unknown"] : ["javascript", "unknown"] + // ); + D(splitChunks, "hidePathInfo", production); + D(splitChunks, "chunks", "async"); + // D(splitChunks, "usedExports", optimization.usedExports === true); + D(splitChunks, "minChunks", 1); + F(splitChunks, "minSize", () => (production ? 20000 : 10000)); + // F(splitChunks, "minRemainingSize", () => (development ? 0 : undefined)); + // F(splitChunks, "enforceSizeThreshold", () => (production ? 50000 : 30000)); + F(splitChunks, "maxAsyncRequests", () => (production ? 30 : Infinity)); + F(splitChunks, "maxInitialRequests", () => (production ? 30 : Infinity)); + D(splitChunks, "automaticNameDelimiter", "-"); + const { cacheGroups } = splitChunks; + if (cacheGroups) { + F(cacheGroups, "default", () => ({ + idHint: "", + reuseExistingChunk: true, + minChunks: 2, + priority: -20 + })); + F(cacheGroups, "defaultVendors", () => ({ + idHint: "vendors", + reuseExistingChunk: true, + test: /[\\/]node_modules[\\/]/i, + priority: -10 + })); + } + } +}; +const getResolveLoaderDefaults = () => { + const resolveOptions = { + conditionNames: ["loader", "require", "node"], + exportsFields: ["exports"], + mainFields: ["loader", "main"], + extensions: [".js"], + mainFiles: ["index"] + }; + return resolveOptions; +}; +const getResolveDefaults = ({ targetProperties, mode }) => { + const conditions = ["webpack"]; + conditions.push(mode === "development" ? "development" : "production"); + if (targetProperties) { + if (targetProperties.webworker) + conditions.push("worker"); + if (targetProperties.node) + conditions.push("node"); + if (targetProperties.web) + conditions.push("browser"); + if (targetProperties.electron) + conditions.push("electron"); + if (targetProperties.nwjs) + conditions.push("nwjs"); + } + const jsExtensions = [".js", ".json", ".wasm", ".tsx", ".ts", ".jsx"]; + const tp = targetProperties; + const browserField = tp && tp.web && (!tp.node || (tp.electron && tp.electronRenderer)); + const cjsDeps = () => ({ + browserField, + mainFields: browserField ? ["browser", "module", "..."] : ["module", "..."], + conditionNames: ["require", "module", "..."], + extensions: [...jsExtensions] + }); + const esmDeps = () => ({ + browserField, + mainFields: browserField ? ["browser", "module", "..."] : ["module", "..."], + conditionNames: ["import", "module", "..."], + extensions: [...jsExtensions] + }); + const resolveOptions = { + modules: ["node_modules"], + conditionNames: conditions, + mainFiles: ["index"], + extensions: [], + browserField, + mainFields: ["main"].filter(Boolean), + exportsFields: ["exports"], + byDependency: { + wasm: esmDeps(), + esm: esmDeps(), + url: { + preferRelative: true + }, + worker: { + ...esmDeps(), + preferRelative: true + }, + commonjs: cjsDeps(), + // amd: cjsDeps(), + // for backward-compat: loadModule + // loader: cjsDeps(), + // for backward-compat: Custom Dependency and getResolve without dependencyType + unknown: cjsDeps() + } + }; + return resolveOptions; +}; +const D = (obj, prop, value) => { + if (obj[prop] === undefined) { + obj[prop] = value; + } +}; +const F = (obj, prop, factory) => { + if (obj[prop] === undefined) { + obj[prop] = factory(); + } +}; +const A = (obj, prop, factory) => { + const value = obj[prop]; + if (value === undefined) { + obj[prop] = factory(); + } + else if (Array.isArray(value)) { + let newArray = undefined; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item === "...") { + if (newArray === undefined) { + newArray = value.slice(0, i); + // @ts-expect-error + obj[prop] = newArray; + } + const items = factory(); + if (items !== undefined) { + for (const item of items) { + newArray.push(item); + } + } + } + else if (newArray !== undefined) { + newArray.push(item); + } + } + } +}; diff --git a/packages/bundles/override/rspack/normalization.js b/packages/bundles/override/rspack/normalization.js new file mode 100644 index 0000000000..942bfc8684 --- /dev/null +++ b/packages/bundles/override/rspack/normalization.js @@ -0,0 +1,299 @@ +"use strict"; +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/normalization.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getNormalizedRspackOptions = void 0; +const util_1 = require("../util"); +const getNormalizedRspackOptions = (config) => { + return { + features: config.features, + ignoreWarnings: config.ignoreWarnings !== undefined + ? config.ignoreWarnings.map(ignore => { + if (typeof ignore === "function") { + return ignore; + } + else { + return (warning) => { + return ignore.test(warning.message); + }; + } + }) + : undefined, + name: config.name, + dependencies: config.dependencies, + context: config.context, + mode: config.mode, + entry: config.entry === undefined + ? { main: {} } + : getNormalizedEntryStatic(config.entry), + output: nestedConfig(config.output, output => { + var _a; + const { library } = output; + const libraryAsName = library; + const libraryBase = typeof library === "object" && + library && + !Array.isArray(library) && + "type" in library + ? library + : libraryAsName || output.libraryTarget + ? { + name: libraryAsName + } + : undefined; + // DEPRECATE: remove this in after version + { + const ext = "[ext]"; + const filenames = [ + "filename", + "chunkFilename", + "cssFilename", + "cssChunkFilename" + ]; + const checkFilename = (prop) => { + const oldFilename = output[prop]; + if (typeof oldFilename === "string" && oldFilename.endsWith(ext)) { + const newFilename = oldFilename.slice(0, -ext.length) + + (prop.includes("css") ? ".css" : ".js"); + (0, util_1.deprecatedWarn)(`Deprecated: output.${prop} ends with [ext] is now deprecated, please use ${newFilename} instead.`); + output[prop] = newFilename; + } + }; + filenames.forEach(checkFilename); + } + return { + path: output.path, + publicPath: output.publicPath, + filename: output.filename, + clean: output.clean, + chunkFormat: output.chunkFormat, + chunkLoading: output.chunkLoading, + chunkFilename: output.chunkFilename, + crossOriginLoading: output.crossOriginLoading, + cssFilename: output.cssFilename, + cssChunkFilename: output.cssChunkFilename, + hotUpdateMainFilename: output.hotUpdateMainFilename, + hotUpdateChunkFilename: output.hotUpdateChunkFilename, + hotUpdateGlobal: output.hotUpdateGlobal, + assetModuleFilename: output.assetModuleFilename, + wasmLoading: output.wasmLoading, + enabledChunkLoadingTypes: output.enabledChunkLoadingTypes + ? [...output.enabledChunkLoadingTypes] + : ["..."], + enabledWasmLoadingTypes: output.enabledWasmLoadingTypes + ? [...output.enabledWasmLoadingTypes] + : ["..."], + webassemblyModuleFilename: output.webassemblyModuleFilename, + uniqueName: output.uniqueName, + chunkLoadingGlobal: output.chunkLoadingGlobal, + enabledLibraryTypes: output.enabledLibraryTypes + ? [...output.enabledLibraryTypes] + : ["..."], + globalObject: output.globalObject, + importFunctionName: output.importFunctionName, + iife: output.iife, + module: output.module, + sourceMapFilename: output.sourceMapFilename, + library: libraryBase && { + type: output.libraryTarget !== undefined + ? output.libraryTarget + : libraryBase.type, + auxiliaryComment: output.auxiliaryComment !== undefined + ? output.auxiliaryComment + : libraryBase.auxiliaryComment, + amdContainer: output.amdContainer !== undefined + ? output.amdContainer + : libraryBase.amdContainer, + export: output.libraryExport !== undefined + ? output.libraryExport + : libraryBase.export, + name: libraryBase.name, + umdNamedDefine: output.umdNamedDefine !== undefined + ? output.umdNamedDefine + : libraryBase.umdNamedDefine + }, + strictModuleErrorHandling: (_a = output.strictModuleErrorHandling) !== null && _a !== void 0 ? _a : output.strictModuleExceptionHandling, + trustedTypes: optionalNestedConfig(output.trustedTypes, trustedTypes => { + if (trustedTypes === true) + return {}; + if (typeof trustedTypes === "string") + return { policyName: trustedTypes }; + return { ...trustedTypes }; + }), + hashDigest: output.hashDigest, + hashDigestLength: output.hashDigestLength, + hashFunction: output.hashFunction, + hashSalt: output.hashSalt, + asyncChunks: output.asyncChunks, + workerChunkLoading: output.workerChunkLoading, + workerWasmLoading: output.workerWasmLoading, + workerPublicPath: output.workerPublicPath, + scriptType: output.scriptType + }; + }), + resolve: nestedConfig(config.resolve, resolve => ({ + ...resolve + })), + resolveLoader: nestedConfig(config.resolveLoader, resolve => ({ + ...resolve + })), + module: nestedConfig(config.module, module => ({ + parser: keyedNestedConfig(module.parser, cloneObject, {}), + generator: keyedNestedConfig(module.generator, cloneObject, {}), + defaultRules: optionalNestedArray(module.defaultRules, r => [...r]), + rules: nestedArray(module.rules, r => [...r]) + })), + target: config.target, + externals: config.externals, + externalsType: config.externalsType, + externalsPresets: cloneObject(config.externalsPresets), + infrastructureLogging: cloneObject(config.infrastructureLogging), + devtool: config.devtool, + node: nestedConfig(config.node, node => node && { + ...node + }), + snapshot: nestedConfig(config.snapshot, snapshot => ({ + resolve: optionalNestedConfig(snapshot.resolve, resolve => ({ + timestamp: resolve.timestamp, + hash: resolve.hash + })), + module: optionalNestedConfig(snapshot.module, module => ({ + timestamp: module.timestamp, + hash: module.hash + })) + })), + cache: optionalNestedConfig(config.cache, cache => cache), + stats: nestedConfig(config.stats, stats => { + if (stats === false) { + return { + preset: "none" + }; + } + if (stats === true) { + return { + preset: "normal" + }; + } + if (typeof stats === "string") { + return { + preset: stats + }; + } + return { + ...stats + }; + }), + optimization: nestedConfig(config.optimization, optimization => { + return { + ...optimization, + runtimeChunk: getNormalizedOptimizationRuntimeChunk(optimization.runtimeChunk), + splitChunks: nestedConfig(optimization.splitChunks, splitChunks => splitChunks && { + ...splitChunks, + cacheGroups: cloneObject(splitChunks.cacheGroups) + }) + }; + }), + plugins: nestedArray(config.plugins, p => [...p]), + experiments: nestedConfig(config.experiments, experiments => ({ + ...experiments, + incrementalRebuild: optionalNestedConfig(experiments.incrementalRebuild, options => (options === true ? {} : options)) + })), + watch: config.watch, + watchOptions: cloneObject(config.watchOptions), + devServer: config.devServer, + profile: config.profile, + builtins: nestedConfig(config.builtins, builtins => ({ + ...builtins + })) + }; +}; +exports.getNormalizedRspackOptions = getNormalizedRspackOptions; +const getNormalizedEntryStatic = (entry) => { + if (typeof entry === "string") { + return { + main: { + import: [entry] + } + }; + } + if (Array.isArray(entry)) { + return { + main: { + import: entry + } + }; + } + const result = {}; + for (const key of Object.keys(entry)) { + const value = entry[key]; + if (typeof value === "string") { + result[key] = { + import: [value] + }; + } + else if (Array.isArray(value)) { + result[key] = { + import: value + }; + } + else { + result[key] = { + import: Array.isArray(value.import) ? value.import : [value.import], + runtime: value.runtime, + publicPath: value.publicPath, + baseUri: value.baseUri, + chunkLoading: value.chunkLoading, + asyncChunks: value.asyncChunks, + filename: value.filename, + library: value.library + }; + } + } + return result; +}; +const getNormalizedOptimizationRuntimeChunk = (runtimeChunk) => { + if (runtimeChunk === undefined) + return undefined; + if (runtimeChunk === false) + return false; + if (runtimeChunk === "single") { + return { + name: () => "runtime" + }; + } + if (runtimeChunk === true || runtimeChunk === "multiple") { + return { + name: (entrypoint) => `runtime~${entrypoint.name}` + }; + } + const { name } = runtimeChunk; + const opts = { + name: typeof name === "function" ? name : () => name + }; + return opts; +}; +const nestedConfig = (value, fn) => value === undefined ? fn({}) : fn(value); +const optionalNestedConfig = (value, fn) => (value === undefined ? undefined : fn(value)); +const nestedArray = (value, fn) => Array.isArray(value) ? fn(value) : fn([]); +const optionalNestedArray = (value, fn) => (Array.isArray(value) ? fn(value) : undefined); +const cloneObject = (value) => ({ ...value }); +const keyedNestedConfig = (value, fn, customKeys) => { + const result = value === undefined + ? {} + : Object.keys(value).reduce((obj, key) => ((obj[key] = (customKeys && key in customKeys ? customKeys[key] : fn)(value[key])), + obj), {}); + if (customKeys) { + for (const key of Object.keys(customKeys)) { + if (!(key in result)) { + result[key] = customKeys[key]({}); + } + } + } + return result; +}; diff --git a/packages/bundles/override/rspack/zod.js b/packages/bundles/override/rspack/zod.js new file mode 100644 index 0000000000..0364b4c919 --- /dev/null +++ b/packages/bundles/override/rspack/zod.js @@ -0,0 +1,738 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rspackOptions = exports.externalsType = void 0; +const zod_1 = require("zod"); +const util_1 = require("../util"); +const Module_1 = require("../Module"); +//#region Name +const name = zod_1.z.string(); +//#endregion +//#region Dependencies +const dependencies = zod_1.z.array(name); +//#endregion +//#region Context +const context = zod_1.z.string(); +//#endregion +//#region Mode +const mode = zod_1.z.enum(["development", "production", "none"]); +//#endregion +//#region Entry +const rawPublicPath = zod_1.z.string(); +const publicPath = zod_1.z.literal("auto").or(rawPublicPath); +const baseUri = zod_1.z.string(); +const chunkLoadingType = zod_1.z + .enum(["jsonp", "import-scripts", "require", "async-node", "import"]) + .or(zod_1.z.string()); +const chunkLoading = zod_1.z.literal(false).or(chunkLoadingType); +const asyncChunks = zod_1.z.boolean(); +const wasmLoadingType = zod_1.z + .enum(["fetch-streaming", "fetch", "async-node"]) + .or(zod_1.z.string()); +const wasmLoading = zod_1.z.literal(false).or(wasmLoadingType); +const scriptType = zod_1.z.enum(["text/javascript", "module"]).or(zod_1.z.literal(false)); +const libraryCustomUmdObject = zod_1.z.strictObject({ + amd: zod_1.z.string().optional(), + commonjs: zod_1.z.string().optional(), + root: zod_1.z.string().or(zod_1.z.array(zod_1.z.string())).optional() +}); +const libraryName = zod_1.z + .string() + .or(zod_1.z.array(zod_1.z.string())) + .or(libraryCustomUmdObject); +const libraryCustomUmdCommentObject = zod_1.z.strictObject({ + amd: zod_1.z.string().optional(), + commonjs: zod_1.z.string().optional(), + commonjs2: zod_1.z.string().optional(), + root: zod_1.z.string().optional() +}); +const amdContainer = zod_1.z.string(); +const auxiliaryComment = zod_1.z.string().or(libraryCustomUmdCommentObject); +const libraryExport = zod_1.z.string().or(zod_1.z.array(zod_1.z.string())); +const libraryType = zod_1.z + .enum([ + "var", + "module", + "assign", + "assign-properties", + "this", + "window", + "self", + "global", + "commonjs", + "commonjs2", + "commonjs-module", + "commonjs-static", + "amd", + "amd-require", + "umd", + "umd2", + "jsonp", + "system" +]) + .or(zod_1.z.string()); +const umdNamedDefine = zod_1.z.boolean(); +const libraryOptions = zod_1.z.strictObject({ + amdContainer: amdContainer.optional(), + auxiliaryComment: auxiliaryComment.optional(), + export: libraryExport.optional(), + name: libraryName.optional(), + type: libraryType, + umdNamedDefine: umdNamedDefine.optional() +}); +const library = libraryName.or(libraryOptions).optional(); +const filenameTemplate = zod_1.z.string(); +const filename = filenameTemplate; +const entryFilename = filenameTemplate; +const entryRuntime = zod_1.z.literal(false).or(zod_1.z.string()); +const entryItem = zod_1.z.string().or(zod_1.z.array(zod_1.z.string())); +const entryDescription = zod_1.z.strictObject({ + import: entryItem, + runtime: entryRuntime.optional(), + publicPath: publicPath.optional(), + baseUri: baseUri.optional(), + chunkLoading: chunkLoading.optional(), + asyncChunks: asyncChunks.optional(), + wasmLoading: wasmLoading.optional(), + filename: entryFilename.optional(), + library: libraryOptions.optional() +}); +const entryUnnamed = entryItem; +const entryObject = zod_1.z.record(entryItem.or(entryDescription)); +const entryStatic = entryObject.or(entryUnnamed); +const entry = entryStatic; +//#endregion +//#region Output +const path = zod_1.z.string(); +const assetModuleFilename = zod_1.z.string(); +const webassemblyModuleFilename = zod_1.z.string(); +const chunkFilename = filenameTemplate; +const crossOriginLoading = zod_1.z + .literal(false) + .or(zod_1.z.enum(["anonymous", "use-credentials"])); +const cssFilename = filenameTemplate; +const cssChunkFilename = filenameTemplate; +const hotUpdateChunkFilename = filenameTemplate; +const hotUpdateMainFilename = filenameTemplate; +const hotUpdateGlobal = zod_1.z.string(); +const uniqueName = zod_1.z.string(); +const chunkLoadingGlobal = zod_1.z.string(); +const enabledLibraryTypes = zod_1.z.array(libraryType); +const clean = zod_1.z.boolean(); +const outputModule = zod_1.z.boolean(); +const strictModuleExceptionHandling = zod_1.z.boolean(); +const strictModuleErrorHandling = zod_1.z.boolean(); +const globalObject = zod_1.z.string(); +const enabledWasmLoadingTypes = zod_1.z.array(wasmLoadingType); +const importFunctionName = zod_1.z.string(); +const iife = zod_1.z.boolean(); +const enabledChunkLoadingTypes = zod_1.z.array(chunkLoadingType); +const chunkFormat = zod_1.z.literal(false).or(zod_1.z.string()); +const workerPublicPath = zod_1.z.string(); +const trustedTypes = zod_1.z.strictObject({ + policyName: zod_1.z.string().optional() +}); +const hashDigest = zod_1.z.string(); +const hashDigestLength = zod_1.z.number(); +const hashFunction = zod_1.z.string(); +const hashSalt = zod_1.z.string(); +const sourceMapFilename = zod_1.z.string(); +const output = zod_1.z.strictObject({ + path: path.optional(), + clean: clean.optional(), + publicPath: publicPath.optional(), + filename: filename.optional(), + chunkFilename: chunkFilename.optional(), + crossOriginLoading: crossOriginLoading.optional(), + cssFilename: cssFilename.optional(), + cssChunkFilename: cssChunkFilename.optional(), + hotUpdateMainFilename: hotUpdateMainFilename.optional(), + hotUpdateChunkFilename: hotUpdateChunkFilename.optional(), + hotUpdateGlobal: hotUpdateGlobal.optional(), + assetModuleFilename: assetModuleFilename.optional(), + uniqueName: uniqueName.optional(), + chunkLoadingGlobal: chunkLoadingGlobal.optional(), + enabledLibraryTypes: enabledLibraryTypes.optional(), + library: library.optional(), + libraryExport: libraryExport.optional(), + libraryTarget: libraryType.optional(), + umdNamedDefine: umdNamedDefine.optional(), + amdContainer: amdContainer.optional(), + auxiliaryComment: auxiliaryComment.optional(), + module: outputModule.optional(), + strictModuleExceptionHandling: strictModuleExceptionHandling.optional(), + strictModuleErrorHandling: strictModuleErrorHandling.optional(), + globalObject: globalObject.optional(), + importFunctionName: importFunctionName.optional(), + iife: iife.optional(), + wasmLoading: wasmLoading.optional(), + enabledWasmLoadingTypes: enabledWasmLoadingTypes.optional(), + webassemblyModuleFilename: webassemblyModuleFilename.optional(), + chunkFormat: chunkFormat.optional(), + chunkLoading: chunkLoading.optional(), + enabledChunkLoadingTypes: enabledChunkLoadingTypes.optional(), + trustedTypes: zod_1.z.literal(true).or(zod_1.z.string()).or(trustedTypes).optional(), + sourceMapFilename: sourceMapFilename.optional(), + hashDigest: hashDigest.optional(), + hashDigestLength: hashDigestLength.optional(), + hashFunction: hashFunction.optional(), + hashSalt: hashSalt.optional(), + asyncChunks: asyncChunks.optional(), + workerChunkLoading: chunkLoading.optional(), + workerWasmLoading: wasmLoading.optional(), + workerPublicPath: workerPublicPath.optional(), + scriptType: scriptType.optional() +}); +//#endregion +//#region Resolve +const resolveAlias = zod_1.z.record(zod_1.z + .literal(false) + .or(zod_1.z.string()) + .or(zod_1.z.array(zod_1.z.string().or(zod_1.z.literal(false))))); +const resolveTsconfig = zod_1.z.strictObject({ + configFile: zod_1.z.string(), + references: zod_1.z.array(zod_1.z.string()).or(zod_1.z.literal("auto")).optional() +}); +const baseResolveOptions = zod_1.z.strictObject({ + alias: resolveAlias.optional(), + /** + * This is `aliasField: ["browser"]` in webpack, because no one + * uses aliasField other than "browser". ---@bvanjoi + */ + browserField: zod_1.z.boolean().optional(), + conditionNames: zod_1.z.array(zod_1.z.string()).optional(), + extensions: zod_1.z.array(zod_1.z.string()).optional(), + fallback: resolveAlias.optional(), + mainFields: zod_1.z.array(zod_1.z.string()).optional(), + mainFiles: zod_1.z.array(zod_1.z.string()).optional(), + modules: zod_1.z.array(zod_1.z.string()).optional(), + preferRelative: zod_1.z.boolean().optional(), + tsConfigPath: zod_1.z.string().optional(), + tsConfig: resolveTsconfig.optional(), + fullySpecified: zod_1.z.boolean().optional(), + exportsFields: zod_1.z.array(zod_1.z.string()).optional(), + extensionAlias: zod_1.z.record(zod_1.z.string().or(zod_1.z.array(zod_1.z.string()))).optional() +}); +const resolveOptions = baseResolveOptions.extend({ + byDependency: zod_1.z.lazy(() => zod_1.z.record(resolveOptions)).optional() +}); +const resolve = resolveOptions; +//#endregion +//#region Module +const baseRuleSetCondition = zod_1.z + .instanceof(RegExp) + .or(zod_1.z.string()) + .or(zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.boolean())); +const ruleSetCondition = baseRuleSetCondition + .or(zod_1.z.lazy(() => ruleSetConditions)) + .or(zod_1.z.lazy(() => ruleSetLogicalConditions)); +const ruleSetConditions = zod_1.z.lazy(() => zod_1.z.array(ruleSetCondition)); +const ruleSetLogicalConditions = zod_1.z.strictObject({ + and: ruleSetConditions.optional(), + or: ruleSetConditions.optional(), + not: ruleSetConditions.optional() +}); +const ruleSetLoader = zod_1.z.string(); +const ruleSetLoaderOptions = zod_1.z.string().or(zod_1.z.record(zod_1.z.any())); +const ruleSetLoaderWithOptions = zod_1.z.strictObject({ + ident: zod_1.z.string().optional(), + loader: ruleSetLoader, + options: ruleSetLoaderOptions.optional() +}); +const ruleSetUseItem = ruleSetLoader.or(ruleSetLoaderWithOptions); +const ruleSetUse = ruleSetUseItem + .or(ruleSetUseItem.array()) + .or(zod_1.z.function().args(zod_1.z.custom()).returns(ruleSetUseItem.array())); +const baseRuleSetRule = zod_1.z.strictObject({ + test: ruleSetCondition.optional(), + exclude: ruleSetCondition.optional(), + include: ruleSetCondition.optional(), + issuer: ruleSetCondition.optional(), + dependency: ruleSetCondition.optional(), + resource: ruleSetCondition.optional(), + resourceFragment: ruleSetCondition.optional(), + resourceQuery: ruleSetCondition.optional(), + scheme: ruleSetCondition.optional(), + mimetype: ruleSetCondition.optional(), + descriptionData: zod_1.z.record(ruleSetCondition).optional(), + type: zod_1.z.string().optional(), + loader: ruleSetLoader.optional(), + options: ruleSetLoaderOptions.optional(), + use: ruleSetUse.optional(), + parser: zod_1.z.record(zod_1.z.any()).optional(), + generator: zod_1.z.record(zod_1.z.any()).optional(), + resolve: resolveOptions.optional(), + sideEffects: zod_1.z.boolean().optional(), + enforce: zod_1.z.literal("pre").or(zod_1.z.literal("post")).optional() +}); +const ruleSetRule = baseRuleSetRule.extend({ + oneOf: zod_1.z.lazy(() => ruleSetRule.array()).optional(), + rules: zod_1.z.lazy(() => ruleSetRule.array()).optional() +}); +const ruleSetRules = zod_1.z.array(zod_1.z.literal("...").or(ruleSetRule)); +const assetParserDataUrlOptions = zod_1.z.strictObject({ + maxSize: zod_1.z.number().optional() +}); +const assetParserDataUrl = assetParserDataUrlOptions; +const assetParserOptions = zod_1.z.strictObject({ + dataUrlCondition: assetParserDataUrl.optional() +}); +//TODO: "weak", "lazy-once" +const dynamicImportMode = zod_1.z.enum(["eager", "lazy"]); +const javascriptParserOptions = zod_1.z.strictObject({ + dynamicImportMode: dynamicImportMode.optional() +}); +const parserOptionsByModuleTypeKnown = zod_1.z.strictObject({ + asset: assetParserOptions.optional(), + javascript: javascriptParserOptions.optional() +}); +const parserOptionsByModuleTypeUnknown = zod_1.z.record(zod_1.z.record(zod_1.z.any())); +const parserOptionsByModuleType = parserOptionsByModuleTypeKnown.or(parserOptionsByModuleTypeUnknown); +const assetGeneratorDataUrlOptions = zod_1.z.strictObject({ + encoding: zod_1.z.literal(false).or(zod_1.z.literal("base64")).optional(), + mimetype: zod_1.z.string().optional() +}); +const assetGeneratorDataUrl = assetGeneratorDataUrlOptions; +const assetInlineGeneratorOptions = zod_1.z.strictObject({ + dataUrl: assetGeneratorDataUrl.optional() +}); +const assetResourceGeneratorOptions = zod_1.z.strictObject({ + filename: filenameTemplate.optional(), + publicPath: publicPath.optional() +}); +const assetGeneratorOptions = assetInlineGeneratorOptions.merge(assetResourceGeneratorOptions); +const generatorOptionsByModuleTypeKnown = zod_1.z.strictObject({ + asset: assetGeneratorOptions.optional(), + "asset/inline": assetInlineGeneratorOptions.optional(), + "asset/resource": assetResourceGeneratorOptions.optional() +}); +const generatorOptionsByModuleTypeUnknown = zod_1.z.record(zod_1.z.record(zod_1.z.any())); +const generatorOptionsByModuleType = generatorOptionsByModuleTypeKnown.or(generatorOptionsByModuleTypeUnknown); +const moduleOptions = zod_1.z.strictObject({ + defaultRules: ruleSetRules.optional(), + rules: ruleSetRules.optional(), + parser: parserOptionsByModuleType.optional(), + generator: generatorOptionsByModuleType.optional() +}); +//#endregion +//#region Target +const allowTarget = zod_1.z + .enum([ + "web", + "webworker", + "es3", + "es5", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020", + "es2021", + "es2022", + "browserslist" +]) + .or(zod_1.z.literal("node")) + .or(zod_1.z.literal("async-node")) + .or(zod_1.z.custom(value => typeof value === "string" && /^node\d+$/.test(value))) + .or(zod_1.z.custom(value => typeof value === "string" && /^async-node\d+$/.test(value))) + .or(zod_1.z.custom(value => typeof value === "string" && /^node\d+\.\d+$/.test(value))) + .or(zod_1.z.custom(value => typeof value === "string" && /^async-node\d+\.\d+$/.test(value))) + .or(zod_1.z.literal("electron-main")) + .or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+-main$/.test(value))) + .or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+\.\d+-main$/.test(value))) + .or(zod_1.z.literal("electron-renderer")) + .or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+-renderer$/.test(value))) + .or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+\.\d+-renderer$/.test(value))) + .or(zod_1.z.literal("electron-preload")) + .or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+-preload$/.test(value))) + .or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+\.\d+-preload$/.test(value))); +const target = zod_1.z.literal(false).or(allowTarget).or(allowTarget.array()); +//#endregion +//#region ExternalsType +exports.externalsType = zod_1.z.enum([ + "var", + "module", + "assign", + "this", + "window", + "self", + "global", + "commonjs", + "commonjs2", + "commonjs-module", + "commonjs-static", + "amd", + "amd-require", + "umd", + "umd2", + "jsonp", + "system", + "promise", + "import", + "script", + "node-commonjs" +]); +//#endregion +//#region Externals +const externalItemValue = zod_1.z + .string() + .or(zod_1.z.boolean()) + .or(zod_1.z.string().array().min(1)) + .or(zod_1.z.record(zod_1.z.string().or(zod_1.z.string().array()))); +const externalItemObjectUnknown = zod_1.z.record(externalItemValue); +const externalItemFunctionData = zod_1.z.strictObject({ + context: zod_1.z.string().optional(), + dependencyType: zod_1.z.string().optional(), + request: zod_1.z.string().optional() +}); +const externalItem = zod_1.z + .string() + .or(zod_1.z.instanceof(RegExp)) + .or(externalItemObjectUnknown) + .or(zod_1.z + .function() + .args(externalItemFunctionData, zod_1.z + .function() + .args(zod_1.z.instanceof(Error).optional(), externalItemValue.optional(), exports.externalsType.optional()) + .returns(zod_1.z.void()))) + .or(zod_1.z + .function() + .args(externalItemFunctionData) + .returns(zod_1.z.promise(externalItemValue))); +const externals = externalItem.array().or(externalItem); +//#endregion +//#region ExternalsPresets +const externalsPresets = zod_1.z.strictObject({ + node: zod_1.z.boolean().optional(), + web: zod_1.z.boolean().optional(), + webAsync: zod_1.z.boolean().optional(), + electron: zod_1.z.boolean().optional(), + electronMain: zod_1.z.boolean().optional(), + electronPreload: zod_1.z.boolean().optional(), + electronRenderer: zod_1.z.boolean().optional() +}); +//#endregion +//#region InfrastructureLogging +const filterItemTypes = zod_1.z + .instanceof(RegExp) + .or(zod_1.z.string()) + .or(zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.boolean())); +const filterTypes = filterItemTypes.array().or(filterItemTypes); +const infrastructureLogging = zod_1.z.strictObject({ + appendOnly: zod_1.z.boolean().optional(), + colors: zod_1.z.boolean().optional(), + console: zod_1.z.custom().optional(), + debug: zod_1.z.boolean().or(filterTypes).optional(), + level: zod_1.z.enum(["none", "error", "warn", "info", "log", "verbose"]).optional(), + stream: zod_1.z.custom().optional() +}); +//#endregion +//#region DevTool +const devTool = zod_1.z + .literal(false) + .or(zod_1.z.enum([ + "cheap-source-map", + "cheap-module-source-map", + "source-map", + "inline-cheap-source-map", + "inline-cheap-module-source-map", + "inline-source-map", + "inline-nosources-cheap-module-source-map", + "inline-nosources-source-map", + "nosources-cheap-source-map", + "nosources-cheap-module-source-map", + "nosources-source-map", + "hidden-nosources-cheap-source-map", + "hidden-nosources-cheap-module-source-map", + "hidden-nosources-source-map", + "hidden-cheap-source-map", + "hidden-cheap-module-source-map", + "hidden-source-map", + "eval-cheap-source-map", + "eval-cheap-module-source-map", + "eval-source-map", + "eval-nosources-cheap-source-map", + "eval-nosources-cheap-module-source-map", + "eval-nosources-source-map" +])); +//#endregion +//#region Node +const nodeOptions = zod_1.z.strictObject({ + __dirname: zod_1.z + .boolean() + .or(zod_1.z.enum(["warn-mock", "mock", "eval-only"])) + .optional(), + __filename: zod_1.z + .boolean() + .or(zod_1.z.enum(["warn-mock", "mock", "eval-only"])) + .optional(), + global: zod_1.z.boolean().or(zod_1.z.literal("warn")).optional() +}); +const node = zod_1.z.literal(false).or(nodeOptions); +//#endregion +//#region Snapshot +const snapshotOptions = zod_1.z.strictObject({ + module: zod_1.z + .strictObject({ + hash: zod_1.z.boolean().optional(), + timestamp: zod_1.z.boolean().optional() + }) + .optional(), + resolve: zod_1.z + .strictObject({ + hash: zod_1.z.boolean().optional(), + timestamp: zod_1.z.boolean().optional() + }) + .optional() +}); +//#endregion +//#region Cache +const cacheOptions = zod_1.z.boolean(); +//#endregion +//#region Stats +const statsOptions = zod_1.z.strictObject({ + all: zod_1.z.boolean().optional(), + preset: zod_1.z + .enum(["normal", "none", "verbose", "errors-only", "errors-warnings"]) + .optional(), + assets: zod_1.z.boolean().optional(), + chunks: zod_1.z.boolean().optional(), + modules: zod_1.z.boolean().optional(), + entrypoints: zod_1.z.boolean().optional(), + chunkGroups: zod_1.z.boolean().optional(), + warnings: zod_1.z.boolean().optional(), + warningsCount: zod_1.z.boolean().optional(), + errors: zod_1.z.boolean().optional(), + errorsCount: zod_1.z.boolean().optional(), + colors: zod_1.z.boolean().optional(), + hash: zod_1.z.boolean().optional(), + version: zod_1.z.boolean().optional(), + reasons: zod_1.z.boolean().optional(), + publicPath: zod_1.z.boolean().optional(), + outputPath: zod_1.z.boolean().optional(), + chunkModules: zod_1.z.boolean().optional(), + chunkRelations: zod_1.z.boolean().optional(), + ids: zod_1.z.boolean().optional(), + timings: zod_1.z.boolean().optional(), + builtAt: zod_1.z.boolean().optional(), + moduleAssets: zod_1.z.boolean().optional(), + modulesSpace: zod_1.z.number().optional(), + nestedModules: zod_1.z.boolean().optional(), + source: zod_1.z.boolean().optional(), + logging: zod_1.z + .enum(["none", "error", "warn", "info", "log", "verbose"]) + .or(zod_1.z.boolean()) + .optional(), + loggingDebug: zod_1.z.boolean().or(filterTypes).optional(), + loggingTrace: zod_1.z.boolean().optional(), + runtimeModules: zod_1.z.boolean().optional() +}); +const statsValue = zod_1.z + .enum(["none", "errors-only", "errors-warnings", "normal", "verbose"]) + .or(zod_1.z.boolean()) + .or(statsOptions); +const plugin = zod_1.z.union([ + zod_1.z.custom(), + zod_1.z.custom() +]); +const plugins = plugin.array(); +//#endregion +//#region Optimization +const optimizationRuntimeChunk = zod_1.z + .enum(["single", "multiple"]) + .or(zod_1.z.boolean()) + .or(zod_1.z.strictObject({ + name: zod_1.z + .string() + .or(zod_1.z.function().returns(zod_1.z.string().or(zod_1.z.undefined()))) + .optional() +})); +const optimizationSplitChunksNameFunction = zod_1.z.function().args(zod_1.z.instanceof(Module_1.Module).optional() +// FIXME: z.array(z.instanceof(Chunk)).optional(), z.string() +// FIXME: Chunk[], cacheChunkKey +); +const optimizationSplitChunksName = zod_1.z + .string() + .or(zod_1.z.literal(false)) + .or(optimizationSplitChunksNameFunction); +const optimizationSplitChunksChunks = zod_1.z + .enum(["initial", "async", "all"]) + .or(zod_1.z.instanceof(RegExp)); +const optimizationSplitChunksSizes = zod_1.z.number(); +const sharedOptimizationSplitChunksCacheGroup = { + chunks: optimizationSplitChunksChunks.optional(), + minChunks: zod_1.z.number().optional(), + name: optimizationSplitChunksName.optional(), + minSize: optimizationSplitChunksSizes.optional(), + maxSize: optimizationSplitChunksSizes.optional(), + maxAsyncSize: optimizationSplitChunksSizes.optional(), + maxInitialSize: optimizationSplitChunksSizes.optional(), + automaticNameDelimiter: zod_1.z.string().optional() +}; +const optimizationSplitChunksCacheGroup = zod_1.z.strictObject({ + test: zod_1.z + .string() + .or(zod_1.z.instanceof(RegExp)) + .or(zod_1.z + .function() + .args(zod_1.z.instanceof(Module_1.Module) /** FIXME: lack of CacheGroupContext */)) + .optional(), + priority: zod_1.z.number().optional(), + enforce: zod_1.z.boolean().optional(), + filename: zod_1.z.string().optional(), + reuseExistingChunk: zod_1.z.boolean().optional(), + type: zod_1.z.string().or(zod_1.z.instanceof(RegExp)).optional(), + idHint: zod_1.z.string().optional(), + ...sharedOptimizationSplitChunksCacheGroup +}); +const optimizationSplitChunksOptions = zod_1.z.strictObject({ + cacheGroups: zod_1.z + .record(zod_1.z.literal(false).or(optimizationSplitChunksCacheGroup)) + .optional(), + maxAsyncRequests: zod_1.z.number().optional(), + maxInitialRequests: zod_1.z.number().optional(), + fallbackCacheGroup: zod_1.z + .strictObject({ + chunks: optimizationSplitChunksChunks.optional(), + minSize: zod_1.z.number().optional(), + maxSize: zod_1.z.number().optional(), + maxAsyncSize: zod_1.z.number().optional(), + maxInitialSize: zod_1.z.number().optional(), + automaticNameDelimiter: zod_1.z.string().optional() + }) + .optional(), + hidePathInfo: zod_1.z.boolean().optional(), + ...sharedOptimizationSplitChunksCacheGroup +}); +const optimization = zod_1.z.strictObject({ + moduleIds: zod_1.z.enum(["named", "deterministic"]).optional(), + chunkIds: zod_1.z.enum(["named", "deterministic"]).optional(), + minimize: zod_1.z.boolean().optional(), + minimizer: zod_1.z.literal("...").or(plugin).array().optional(), + mergeDuplicateChunks: zod_1.z.boolean().optional(), + splitChunks: zod_1.z.literal(false).or(optimizationSplitChunksOptions).optional(), + runtimeChunk: optimizationRuntimeChunk.optional(), + removeAvailableModules: zod_1.z.boolean().optional(), + removeEmptyChunks: zod_1.z.boolean().optional(), + realContentHash: zod_1.z.boolean().optional(), + sideEffects: zod_1.z.enum(["flag"]).or(zod_1.z.boolean()).optional(), + providedExports: zod_1.z.boolean().optional(), + innerGraph: zod_1.z.boolean().optional(), + usedExports: zod_1.z.enum(["global"]).or(zod_1.z.boolean()).optional(), + mangleExports: zod_1.z.enum(["size", "deterministic"]).or(zod_1.z.boolean()).optional(), + nodeEnv: zod_1.z.union([zod_1.z.string(), zod_1.z.literal(false)]).optional() +}); +//#endregion +//#region Experiments +const incrementalRebuildOptions = zod_1.z.strictObject({ + make: zod_1.z.boolean().optional(), + emitAsset: zod_1.z.boolean().optional() +}); +const rspackFutureOptions = zod_1.z.strictObject({ + newResolver: zod_1.z + .boolean() + .optional() + .refine(val => { + if (val === false) { + (0, util_1.deprecatedWarn)(`'experiments.rspackFuture.newResolver = ${JSON.stringify(val)}' has been deprecated, and will be drop support in 0.5.0, please switch 'experiments.rspackFuture.newResolver = true' to use new resolver, See the discussion ${(0, util_1.termlink)("here", "https://github.com/web-infra-dev/rspack/issues/4825")}`); + } + return true; + }), + newTreeshaking: zod_1.z.boolean().optional(), + disableTransformByDefault: zod_1.z.boolean().optional() +}); +const experiments = zod_1.z.strictObject({ + lazyCompilation: zod_1.z.boolean().optional(), + incrementalRebuild: zod_1.z + .boolean() + .or(incrementalRebuildOptions) + .optional() + .refine(val => { + if (val !== undefined) { + (0, util_1.deprecatedWarn)(`'experiments.incrementalRebuild' has been deprecated, and will be drop support in 0.5.0. See the discussion ${(0, util_1.termlink)("here", "https://github.com/web-infra-dev/rspack/issues/4708")}`); + } + return true; + }), + asyncWebAssembly: zod_1.z.boolean().optional(), + outputModule: zod_1.z.boolean().optional(), + topLevelAwait: zod_1.z.boolean().optional(), + newSplitChunks: zod_1.z + .boolean() + .optional() + .refine(val => { + if (val === false) { + (0, util_1.deprecatedWarn)(`'experiments.newSplitChunks = ${JSON.stringify(val)}' has been deprecated, please switch to 'experiments.newSplitChunks = true' to use webpack's behavior. + See the discussion ${(0, util_1.termlink)("here", "https://github.com/web-infra-dev/rspack/discussions/4168")}`); + } + return true; + }), + css: zod_1.z.boolean().optional(), + futureDefaults: zod_1.z.boolean().optional(), + rspackFuture: rspackFutureOptions.optional() +}); +//#endregion +//#region Watch +const watch = zod_1.z.boolean(); +//#endregion +//#region WatchOptions +const watchOptions = zod_1.z.strictObject({ + aggregateTimeout: zod_1.z.number().optional(), + followSymlinks: zod_1.z.boolean().optional(), + ignored: zod_1.z + .string() + .array() + .or(zod_1.z.instanceof(RegExp)) + .or(zod_1.z.string()) + .optional(), + poll: zod_1.z.number().or(zod_1.z.boolean()).optional(), + stdin: zod_1.z.boolean().optional() +}); +const devServer = zod_1.z.custom(); +//#endregion +//#region IgnoreWarnings +const ignoreWarnings = zod_1.z + .instanceof(RegExp) + .or(zod_1.z + .function() + .args(zod_1.z.instanceof(Error), zod_1.z.custom()) + .returns(zod_1.z.boolean())) + .array(); +//#endregion +//#region Profile +const profile = zod_1.z.boolean(); +//#endregion +//#region Builtins (deprecated) +const builtins = zod_1.z.custom(); +const features = zod_1.z.custom(); +// #endregion +exports.rspackOptions = zod_1.z.strictObject({ + name: name.optional(), + dependencies: dependencies.optional(), + entry: entry.optional(), + output: output.optional(), + target: target.optional(), + mode: mode.optional(), + experiments: experiments.optional(), + externals: externals.optional(), + externalsType: exports.externalsType.optional(), + externalsPresets: externalsPresets.optional(), + infrastructureLogging: infrastructureLogging.optional(), + cache: cacheOptions.optional(), + context: context.optional(), + devtool: devTool.optional(), + node: node.optional(), + ignoreWarnings: ignoreWarnings.optional(), + watchOptions: watchOptions.optional(), + watch: watch.optional(), + stats: statsValue.optional(), + snapshot: snapshotOptions.optional(), + optimization: optimization.optional(), + resolve: resolve.optional(), + resolveLoader: resolve.optional(), + plugins: plugins.optional(), + devServer: devServer.optional(), + builtins: builtins.optional(), + module: moduleOptions.optional(), + profile: profile.optional(), + features: features.optional(), +}); diff --git a/packages/bundles/package.json b/packages/bundles/package.json index 7f4197a3cc..61d4c6c3f8 100644 --- a/packages/bundles/package.json +++ b/packages/bundles/package.json @@ -1,6 +1,6 @@ { "name": "@ice/bundles", - "version": "0.1.17", + "version": "0.2.0", "license": "MIT", "author": "ICE", "description": "Basic dependencies for ice.", @@ -33,11 +33,25 @@ "react-refresh": "0.14.0", "core-js-pure": "^3.8.1", "error-stack-parser": "^2.0.6", - "@rspack/core": "0.3.0", - "@rspack/dev-server": "0.3.0", - "@ice/css-modules-hash": "0.0.6" + "@ice/css-modules-hash": "0.0.6", + "browserslist": "^4.21.3", + "compare-versions": "6.0.0-rc.1", + "enhanced-resolve": "5.12.0", + "fast-querystring": "1.1.2", + "json-parse-even-better-errors": "^3.0.0", + "neo-async": "2.6.2", + "watchpack": "^2.4.0", + "webpack-sources": "3.2.3", + "zod": "^3.21.4", + "zod-validation-error": "1.2.0", + "terminal-link": "^2.1.1", + "@ice/pack-binding": "0.0.4", + "mime-types": "2.1.35" }, "devDependencies": { + "@rspack/plugin-react-refresh": "0.4.3", + "@rspack/dev-server": "0.4.3", + "@rspack/core": "0.4.3", "@types/less": "^3.0.3", "@types/lodash": "^4.14.181", "@types/webpack-bundle-analyzer": "^4.4.1", @@ -71,14 +85,14 @@ "webpack": "5.88.2", "webpack-bundle-analyzer": "4.5.0", "webpack-dev-server": "4.15.0", - "unplugin": "1.5.0", + "unplugin": "1.5.1", "bonjour-service": "^1.0.13", "colorette": "^2.0.10", "compression": "^1.7.4", - "connect-history-api-fallback": "^1.6.0", + "connect-history-api-fallback": "2.0.0", "default-gateway": "^6.0.3", "express": "^4.17.3", - "graceful-fs": "^4.2.6", + "graceful-fs": "4.2.10", "http-proxy-middleware": "^2.0.3", "ipaddr.js": "^2.0.1", "open": "^8.0.9", diff --git a/packages/bundles/scripts/tasks.ts b/packages/bundles/scripts/tasks.ts index d7ca951587..5555d665db 100644 --- a/packages/bundles/scripts/tasks.ts +++ b/packages/bundles/scripts/tasks.ts @@ -220,6 +220,96 @@ const tasks = [ fs.copySync(path.join(__dirname, '../webpack/packages'), targetPath); }, }, + { + pkgName: '@rspack/core', + skipCompile: true, + declaration: false, + patch: () => { + const pkgPath = path.join(__dirname, '../node_modules/@rspack/core'); + const targetPath = path.join(__dirname, '../compiled/@rspack/core'); + // Copy the entire directory. + // filter out js files and replace with compiled files. + const filePaths = globbySync(['**/*'], { cwd: pkgPath, ignore: ['node_modules'] }); + const filesAddOverwrite = [ + 'dist/config/adapter.js', + 'dist/config/defaults.js', + 'dist/config/zod.js', + 'dist/config/normalization.js', + 'dist/util/bindingVersionCheck.js', + ]; + filePaths.forEach((filePath) => { + const sourcePath = path.join(pkgPath, filePath); + const targetFilePath = path.join(targetPath, filePath); + fs.ensureDirSync(path.dirname(targetFilePath)); + if (path.extname(filePath) === '.js') { + const matched = filesAddOverwrite.some(filePath => { + const matched = sourcePath.split(path.sep).join('/').includes(filePath); + if (matched) { + fs.copyFileSync(path.join(__dirname, `../override/rspack/${path.basename(filePath)}`), targetFilePath); + } + return matched; + }); + if (!matched) { + const fileContent = fs.readFileSync(sourcePath, 'utf8'); + fs.writeFileSync( + targetFilePath, + replaceDeps(fileContent, ['tapable', 'schema-utils', 'graceful-fs']) + .replace(new RegExp('require\\(["\']@rspack/binding["\']\\)', 'g'), 'require("@ice/pack-binding")'), + ); + } + } else { + fs.copyFileSync(sourcePath, targetFilePath); + } + }); + }, + }, + { + pkgName: '@rspack/dev-server', + skipCompile: true, + patch: () => { + // Copy webpack-dev-server while all dependencies has been packed. + const pkgPath = path.join(__dirname, '../node_modules/@rspack/dev-server'); + const filePaths = globbySync(['**/*'], { cwd: pkgPath, ignore: ['node_modules', 'types', 'bin'] }); + filePaths.forEach((filePath) => { + fs.ensureDirSync(path.join(__dirname, `../compiled/@rspack/dev-server/${path.dirname(filePath)}`)); + const sourcePath = path.join(pkgPath, filePath); + const targetPath = path.join(__dirname, `../compiled/@rspack/dev-server/${filePath}`); + if (path.extname(filePath) === '.js') { + const fileContent = fs.readFileSync(sourcePath, 'utf8'); + fs.writeFileSync(targetPath, + replaceDeps(fileContent, webpackDevServerDeps.concat([...commonDeps, '@rspack/core', 'webpack-dev-server'])) + .replace(/webpack-dev-server\/client\/clients/g, '@ice/bundles/compiled/webpack-dev-server/client/clients'), + ); + } else { + fs.copyFileSync(sourcePath, targetPath); + } + }); + }, + }, + { + pkgName: '@rspack/plugin-react-refresh', + skipCompile: true, + patch: () => { + const pkgPath = path.join(__dirname, '../node_modules/@rspack/plugin-react-refresh'); + const filePaths = globbySync(['**/*'], { cwd: pkgPath, ignore: ['node_modules'] }); + filePaths.forEach((filePath) => { + fs.ensureDirSync(path.join(__dirname, `../compiled/@rspack/plugin-react-refresh/${path.dirname(filePath)}`)); + const sourcePath = path.join(pkgPath, filePath); + const targetPath = path.join(__dirname, `../compiled/@rspack/plugin-react-refresh/${filePath}`); + if (path.extname(filePath) === '.js') { + const fileContent = fs.readFileSync(sourcePath, 'utf8'); + fs.writeFileSync(targetPath, + replaceDeps(fileContent, webpackDevServerDeps.concat([ + ...commonDeps, + '@rspack/core', + ])).replace(/@pmmmwh\/react-refresh-webpack-plugin\/lib\/runtime\/RefreshUtils/g, '@ice/bundles/compiled/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils'), + ); + } else { + fs.copyFileSync(sourcePath, targetPath); + } + }); + }, + }, ]; export default tasks; diff --git a/packages/bundles/src/dev-server.ts b/packages/bundles/src/dev-server.ts index 794a2cc45a..2c3d8a34b5 100644 --- a/packages/bundles/src/dev-server.ts +++ b/packages/bundles/src/dev-server.ts @@ -1 +1 @@ -export * from '@rspack/dev-server'; +export * from '../compiled/@rspack/dev-server/dist/index.js'; diff --git a/packages/bundles/src/plugin-refresh.ts b/packages/bundles/src/plugin-refresh.ts new file mode 100644 index 0000000000..c15ae4fd8f --- /dev/null +++ b/packages/bundles/src/plugin-refresh.ts @@ -0,0 +1,3 @@ +import RefreshPlugin from '../compiled/@rspack/plugin-react-refresh/dist/index.js'; + +export default RefreshPlugin; diff --git a/packages/bundles/src/rspack.ts b/packages/bundles/src/rspack.ts index afd429cbbc..0e5acc254f 100644 --- a/packages/bundles/src/rspack.ts +++ b/packages/bundles/src/rspack.ts @@ -1 +1 @@ -export * from '@rspack/core'; +export * from '../compiled/@rspack/core/dist/index.js'; diff --git a/packages/ice/CHANGELOG.md b/packages/ice/CHANGELOG.md index 15faf5b702..749e2a2ba2 100644 --- a/packages/ice/CHANGELOG.md +++ b/packages/ice/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 3.4.0 + +### Minor Changes + +- a68ff48d: feat: support @ice/pack-binding + +### Patch Changes + +- 7d193fe9: fix: css module hash and HMR +- Updated dependencies [7d193fe9] +- Updated dependencies [7d193fe9] +- Updated dependencies [a68ff48d] + - @ice/rspack-config@1.1.0 + - @ice/webpack-config@1.1.7 + - @ice/shared-config@1.2.0 + - @ice/bundles@0.2.0 + ## 3.3.9 ### Patch Changes diff --git a/packages/ice/package.json b/packages/ice/package.json index 81f928c4de..f4cc6c3bb6 100644 --- a/packages/ice/package.json +++ b/packages/ice/package.json @@ -1,6 +1,6 @@ { "name": "@ice/app", - "version": "3.3.9", + "version": "3.4.0", "description": "provide scripts and configuration used by web framework ice", "type": "module", "main": "./esm/index.js", @@ -47,12 +47,12 @@ "bugs": "https://github.com/alibaba/ice/issues", "homepage": "https://v3.ice.work", "dependencies": { - "@ice/bundles": "0.1.17", + "@ice/bundles": "0.2.0", "@ice/route-manifest": "1.2.2", "@ice/runtime": "^1.3.3", - "@ice/shared-config": "1.1.2", - "@ice/webpack-config": "1.1.6", - "@ice/rspack-config": "1.0.7", + "@ice/shared-config": "1.2.0", + "@ice/webpack-config": "1.1.7", + "@ice/rspack-config": "1.1.0", "@swc/helpers": "0.5.1", "@types/express": "^4.17.14", "address": "^1.1.2", @@ -95,11 +95,11 @@ "react": "^18.2.0", "react-router": "6.14.2", "sass": "^1.50.0", - "unplugin": "^1.5.0", + "unplugin": "^1.5.1", "webpack": "^5.88.0", - "webpack-dev-server": "^4.7.4", - "@rspack/core": "0.3.0", - "@rspack/dev-server": "0.3.0" + "webpack-dev-server": "4.15.0", + "@rspack/core": "0.4.3", + "@rspack/dev-server": "0.4.3" }, "peerDependencies": { "react": ">=18.0.0", diff --git a/packages/ice/src/bundler/rspack/build.ts b/packages/ice/src/bundler/rspack/build.ts index 212dae65c4..6de7c92584 100644 --- a/packages/ice/src/bundler/rspack/build.ts +++ b/packages/ice/src/bundler/rspack/build.ts @@ -15,7 +15,11 @@ async function build(options: BuildOptions) { }); const { stats, isSuccessful, messages } = await new Promise((resolve, reject) => { let messages: { errors: string[]; warnings: string[] }; - compiler.run(async (_, stats: MultiStats) => { + compiler.run(async (err: any, stats: MultiStats) => { + if (err) { + reject(err); + return; + } const obj = stats.toJson({ all: false, timings: true, diff --git a/packages/ice/src/bundler/rspack/getConfig.ts b/packages/ice/src/bundler/rspack/getConfig.ts index d57900d88c..81eecadbd3 100644 --- a/packages/ice/src/bundler/rspack/getConfig.ts +++ b/packages/ice/src/bundler/rspack/getConfig.ts @@ -1,6 +1,5 @@ import getRspackConfig from '@ice/rspack-config'; -import type { Configuration } from '@rspack/core'; -import type { rspack as Rspack } from '@ice/bundles/esm/rspack.js'; +import type { Configuration, rspack as Rspack } from '@rspack/core'; import type { Config } from '@ice/shared-config/types'; import { getRouteExportConfig } from '../../service/config.js'; import { @@ -42,7 +41,7 @@ const getConfig: GetConfig = async (context, options, rspack) => { }, } = context; const { reCompile, ensureRoutesConfig } = getRouteExportConfig(rootDir); - const getPlugins = (taskConfig: Config): Configuration['plugins'] => { + const getPlugins = (taskConfig: Config): Config['plugins'] => { const { target, outputDir, useDataLoader, server } = taskConfig; return [ // Add spinner for webpack task. @@ -69,11 +68,11 @@ const getConfig: GetConfig = async (context, options, rspack) => { getAllPlugin, frameworkExports: generator.getExportList('framework', target), }), - ].filter(Boolean); + ].filter(Boolean) as Config['plugins']; }; - return taskConfigs.map(({ config }) => { + return await Promise.all(taskConfigs.map(async ({ config }) => { const plugins = getPlugins(config); - return getRspackConfig({ + return await getRspackConfig({ rootDir, rspack, runtimeTmpDir: RUNTIME_TMP_DIR, @@ -83,13 +82,13 @@ const getConfig: GetConfig = async (context, options, rspack) => { }, getRoutesFile, getExpandedEnvs, - localIdentName: config.mode === 'development' ? CSS_MODULES_LOCAL_IDENT_NAME_DEV : CSS_MODULES_LOCAL_IDENT_NAME, + localIdentName: config.cssModules?.localIdentName || (config.mode === 'development' ? CSS_MODULES_LOCAL_IDENT_NAME_DEV : CSS_MODULES_LOCAL_IDENT_NAME), taskConfig: { ...config, plugins: (config.plugins || []).concat(plugins), }, }); - }); + })); }; diff --git a/packages/ice/src/bundler/rspack/index.ts b/packages/ice/src/bundler/rspack/index.ts index 6615040469..aec155cb97 100644 --- a/packages/ice/src/bundler/rspack/index.ts +++ b/packages/ice/src/bundler/rspack/index.ts @@ -1,4 +1,4 @@ -import type { MultiCompiler } from '@rspack/core'; +import type { MultiCompiler, rspack as Rspack } from '@rspack/core'; import type { RspackDevServer } from '@rspack/dev-server'; import { logger } from '../../utils/logger.js'; import type { BundlerOptions, Context } from '../types.js'; @@ -20,8 +20,10 @@ async function bundler( let compiler: MultiCompiler; let devServer: RspackDevServer; const { rspack } = await import('@ice/bundles/esm/rspack.js'); - const rspackConfigs = await getConfig(context, options, rspack); + // Override the type of rspack, because of rspack is imported from pre-compiled bundle. + const rspackConfigs = await getConfig(context, options, rspack as unknown as typeof Rspack); try { + // @ts-ignore compiler = rspack(rspackConfigs); } catch (error) { logger.error('Webpack compile error.'); @@ -37,6 +39,7 @@ async function bundler( rspackConfigs, }; if (command === 'start') { + // @ts-expect-error dev-server has been pre-packed, so it will have different type. devServer = await start(buildOptions); } else if (command === 'build') { await build(buildOptions); diff --git a/packages/ice/src/bundler/webpack/start.ts b/packages/ice/src/bundler/webpack/start.ts index 290f484040..ce19580660 100644 --- a/packages/ice/src/bundler/webpack/start.ts +++ b/packages/ice/src/bundler/webpack/start.ts @@ -32,8 +32,10 @@ export async function startDevServer( // Sort by length, shortest path first. a.split('/').filter(Boolean).length - b.split('/').filter(Boolean).length); const webTaskConfig = taskConfigs.find(({ name }) => name === WEB); - const customMiddlewares = webpackConfigs[0].devServer?.setupMiddlewares; - const defaultDevServerConfig = await getDefaultServerConfig(webpackConfigs[0].devServer, commandArgs); + // @ts-expect-error webpack-dev-server types in Configuration is missing. + const originalDevServer: DevServerConfiguration = webpackConfigs[0].devServer; + const customMiddlewares = originalDevServer?.setupMiddlewares; + const defaultDevServerConfig = await getDefaultServerConfig(originalDevServer, commandArgs); let devServerConfig: DevServerConfiguration = { ...defaultDevServerConfig, setupMiddlewares: (middlewares, devServer) => { @@ -50,7 +52,7 @@ export async function startDevServer( }, }; // merge devServerConfig with webpackConfig.devServer - devServerConfig = merge(webpackConfigs[0].devServer, devServerConfig); + devServerConfig = merge(originalDevServer, devServerConfig); const urls = getUrls({ taskConfig: webTaskConfig, devServerConfig, diff --git a/packages/ice/src/esbuild/assets.ts b/packages/ice/src/esbuild/assets.ts index 1290eb8f21..ea594ffd4e 100644 --- a/packages/ice/src/esbuild/assets.ts +++ b/packages/ice/src/esbuild/assets.ts @@ -72,14 +72,16 @@ const createAssetsPlugin = (compilationInfo: CompilationInfo | (() => Compilatio let url = ''; // Suffix `?url` will generate content hash in assets manifest, // keep the same file rule with client side. - const contentHash = manifest?.assetsManifest!.assets[`${relativePath}${args.suffix}`]; + const contentHash = manifest?.assetsManifest?.assets?.[`${relativePath}${args.suffix}`]; if (contentHash) { const basename = path.basename(args.path); const extname = path.extname(basename); const ext = extname.substring(1); const name = basename.slice(0, -extname.length); + // In case of rspack bundler it will return full hash even it is set to [hash:8]. + const hash = contentHash.length > 8 ? contentHash.slice(0, 8) : contentHash; // assets/[name].[hash:8][ext] - url = `${manifest?.assetsManifest.publicPath}assets/${name}.${contentHash}.${ext}`; + url = `${manifest?.assetsManifest.publicPath}assets/${name}.${hash}.${ext}`; } else { url = `data:${mrmime.lookup(args.path)};base64,${content.toString('base64')}`; } diff --git a/packages/ice/src/webpack/ServerCompilerPlugin.ts b/packages/ice/src/webpack/ServerCompilerPlugin.ts index 42711e4118..a4b62f7ce9 100644 --- a/packages/ice/src/webpack/ServerCompilerPlugin.ts +++ b/packages/ice/src/webpack/ServerCompilerPlugin.ts @@ -40,7 +40,7 @@ export default class ServerCompilerPlugin { if (compilation) { // Option of compilationInfo need to be object, while it may changed during multi-time compilation. this.compilerOptions.compilationInfo.assetsManifest = - JSON.parse(compilation.assets['assets-manifest.json'].source().toString()); + JSON.parse(compilation.getAsset('assets-manifest.json').source.source().toString()); } // For first time, we create a new task. // The next time, we use incremental build so do not create task again. diff --git a/packages/miniapp-loader/CHANGELOG.md b/packages/miniapp-loader/CHANGELOG.md index e6bfe89bcb..efbc062311 100644 --- a/packages/miniapp-loader/CHANGELOG.md +++ b/packages/miniapp-loader/CHANGELOG.md @@ -1,5 +1,12 @@ # @ice/miniapp-loader +## 1.1.2 + +### Patch Changes + +- Updated dependencies [a68ff48d] + - @ice/bundles@0.2.0 + ## 1.1.1 ### Patch Changes diff --git a/packages/miniapp-loader/package.json b/packages/miniapp-loader/package.json index d253245ad0..c156b0d888 100644 --- a/packages/miniapp-loader/package.json +++ b/packages/miniapp-loader/package.json @@ -1,6 +1,6 @@ { "name": "@ice/miniapp-loader", - "version": "1.1.1", + "version": "1.1.2", "description": "webpack loader for miniapps.", "main": "./lib/page.js", "files": [ @@ -18,7 +18,7 @@ }, "sideEffects": false, "dependencies": { - "@ice/bundles": "^0.1.16" + "@ice/bundles": "^0.2.0" }, "devDependencies": { "webpack": "^5.88.0" diff --git a/packages/plugin-i18n/CHANGELOG.md b/packages/plugin-i18n/CHANGELOG.md index 544ee16953..5cfbd1d276 100644 --- a/packages/plugin-i18n/CHANGELOG.md +++ b/packages/plugin-i18n/CHANGELOG.md @@ -1,5 +1,13 @@ # @ice/plugin-i18n +## 4.0.0 + +### Patch Changes + +- Updated dependencies [7d193fe9] +- Updated dependencies [a68ff48d] + - @ice/app@3.4.0 + ## 3.0.0 ### Patch Changes diff --git a/packages/plugin-i18n/package.json b/packages/plugin-i18n/package.json index 5b42ed81b6..b2b2b4c53b 100644 --- a/packages/plugin-i18n/package.json +++ b/packages/plugin-i18n/package.json @@ -1,6 +1,6 @@ { "name": "@ice/plugin-i18n", - "version": "3.0.0", + "version": "4.0.0", "description": "I18n plugin for ice.js 3.", "files": [ "es2017", @@ -53,10 +53,10 @@ "@types/accept-language-parser": "^1.5.3", "@types/react": "^18.0.33", "cross-env": "^7.0.3", - "webpack-dev-server": "^4.13.2" + "webpack-dev-server": "4.15.0" }, "peerDependencies": { - "@ice/app": "^3.3.9", + "@ice/app": "^3.4.0", "@ice/runtime": "^1.3.3" }, "publishConfig": { diff --git a/packages/plugin-miniapp/CHANGELOG.md b/packages/plugin-miniapp/CHANGELOG.md index a3f4354f69..289e359e51 100644 --- a/packages/plugin-miniapp/CHANGELOG.md +++ b/packages/plugin-miniapp/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.1.3 + +### Patch Changes + +- Updated dependencies [a68ff48d] + - @ice/bundles@0.2.0 + - @ice/miniapp-loader@1.1.2 + ## 1.1.2 ### Patch Changes diff --git a/packages/plugin-miniapp/package.json b/packages/plugin-miniapp/package.json index 3cc57b7ea6..7cf04be161 100644 --- a/packages/plugin-miniapp/package.json +++ b/packages/plugin-miniapp/package.json @@ -1,6 +1,6 @@ { "name": "@ice/plugin-miniapp", - "version": "1.1.2", + "version": "1.1.3", "description": "ice.js plugin for miniapp.", "license": "MIT", "type": "module", @@ -33,8 +33,8 @@ "build": "tsc" }, "dependencies": { - "@ice/bundles": "^0.1.16", - "@ice/miniapp-loader": "^1.1.1", + "@ice/bundles": "^0.2.0", + "@ice/miniapp-loader": "^1.1.2", "@ice/miniapp-react-dom": "^1.0.2", "@ice/miniapp-runtime": "^1.1.2", "@ice/shared": "^1.0.2", @@ -47,7 +47,7 @@ "sax": "^1.2.4" }, "devDependencies": { - "@ice/app": "^3.3.2", + "@ice/app": "^3.4.0", "@ice/runtime": "^1.2.9", "webpack": "^5.88.0" }, diff --git a/packages/plugin-pha/package.json b/packages/plugin-pha/package.json index fadb2cb39b..eb17b537f0 100644 --- a/packages/plugin-pha/package.json +++ b/packages/plugin-pha/package.json @@ -29,7 +29,7 @@ "build-scripts": "^2.1.2-0", "esbuild": "^0.17.16", "webpack": "^5.88.0", - "webpack-dev-server": "^4.9.2" + "webpack-dev-server": "4.15.0" }, "repository": { "type": "http", diff --git a/packages/plugin-rax-compat/CHANGELOG.md b/packages/plugin-rax-compat/CHANGELOG.md index 6068894273..94d8fafa63 100644 --- a/packages/plugin-rax-compat/CHANGELOG.md +++ b/packages/plugin-rax-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.2.10 + +### Patch Changes + +- Updated dependencies [a68ff48d] + - @ice/bundles@0.2.0 + ## 0.2.9 ### Patch Changes diff --git a/packages/plugin-rax-compat/package.json b/packages/plugin-rax-compat/package.json index a7149707d7..a64239b54d 100644 --- a/packages/plugin-rax-compat/package.json +++ b/packages/plugin-rax-compat/package.json @@ -1,6 +1,6 @@ { "name": "@ice/plugin-rax-compat", - "version": "0.2.9", + "version": "0.2.10", "description": "Provide rax compat support for ice.js", "license": "MIT", "type": "module", @@ -20,7 +20,7 @@ "dependencies": { "@babel/core": "^7.0.0", "@babel/plugin-proposal-export-default-from": "^7.18.9", - "@ice/bundles": "^0.1.16", + "@ice/bundles": "^0.2.0", "babel-plugin-transform-jsx-stylesheet": "1.0.6", "consola": "^2.15.3", "css": "^2.2.1", @@ -30,7 +30,7 @@ "stylesheet-loader": "^0.9.1" }, "devDependencies": { - "@ice/app": "^3.3.5", + "@ice/app": "^3.4.0", "@types/lodash-es": "^4.17.7", "webpack": "^5.88.0" }, diff --git a/packages/rspack-config/CHANGELOG.md b/packages/rspack-config/CHANGELOG.md index 64f46c94c4..ec9b29d085 100644 --- a/packages/rspack-config/CHANGELOG.md +++ b/packages/rspack-config/CHANGELOG.md @@ -1,5 +1,19 @@ # @ice/rspack-config +## 1.1.0 + +### Minor Changes + +- a68ff48d: feat: support @ice/pack-binding + +### Patch Changes + +- 7d193fe9: fix: css module hash and HMR +- Updated dependencies [7d193fe9] +- Updated dependencies [a68ff48d] + - @ice/shared-config@1.2.0 + - @ice/bundles@0.2.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/rspack-config/package.json b/packages/rspack-config/package.json index 3a443f2d1c..2854fa8057 100644 --- a/packages/rspack-config/package.json +++ b/packages/rspack-config/package.json @@ -1,6 +1,6 @@ { "name": "@ice/rspack-config", - "version": "1.0.7", + "version": "1.1.0", "repository": "alibaba/ice", "bugs": "https://github.com/alibaba/ice/issues", "homepage": "https://v3.ice.work", @@ -15,11 +15,11 @@ "*.d.ts" ], "dependencies": { - "@ice/shared-config": "1.1.2", - "@ice/bundles": "0.1.17" + "@ice/bundles": "0.2.0", + "@ice/shared-config": "1.2.0" }, "devDependencies": { - "@rspack/core": "^0.3.0" + "@rspack/core": "0.4.3" }, "scripts": { "watch": "tsc -w --sourceMap", diff --git a/packages/rspack-config/src/index.ts b/packages/rspack-config/src/index.ts index eb1529f466..451c918166 100644 --- a/packages/rspack-config/src/index.ts +++ b/packages/rspack-config/src/index.ts @@ -1,11 +1,12 @@ import * as path from 'path'; import { createRequire } from 'module'; -import { compilationPlugin, compileExcludes, getDefineVars, getCompilerPlugins } from '@ice/shared-config'; +import { compilationPlugin, compileExcludes, getDefineVars, getCompilerPlugins, getJsxTransformOptions, getAliasWithRoot } from '@ice/shared-config'; import type { Config, ModifyWebpackConfig } from '@ice/shared-config/types'; -import type { Configuration } from '@rspack/core'; -import type { rspack as Rspack } from '@ice/bundles/esm/rspack.js'; -import AssetManifest from './plugins/AssetManifest.js'; -import getSplitChunks from './splitChunks.js'; +import type { Configuration, rspack as Rspack } from '@rspack/core'; +import lodash from '@ice/bundles/compiled/lodash/index.js'; +import { coreJsPath } from '@ice/bundles'; +import RefreshPlugin from '@ice/bundles/esm/plugin-refresh.js'; +import getSplitChunks, { getFrameworkBundles } from './splitChunks.js'; import getAssetsRule from './assetsRule.js'; import getCssRules from './cssRules.js'; @@ -22,11 +23,20 @@ interface GetRspackConfigOptions { type GetConfig = ( options: GetRspackConfigOptions, -) => Configuration; +) => Promise; + +interface BuiltinFeatures { + splitChunksStrategy?: { + name: string; + topLevelFrameworks: string[]; + }; +} const require = createRequire(import.meta.url); -const getConfig: GetConfig = (options) => { +const { merge } = lodash; + +const getConfig: GetConfig = async (options) => { const { rootDir, taskConfig, @@ -40,6 +50,7 @@ const getConfig: GetConfig = (options) => { const { mode, + minify, publicPath = '/', cacheDir, outputDir = 'build', @@ -59,7 +70,9 @@ const getConfig: GetConfig = (options) => { plugins = [], middlewares, configureWebpack = [], + minimizerOptions = {}, } = taskConfig || {}; + const isDev = mode === 'development'; const absoluteOutputDir = path.isAbsolute(outputDir) ? outputDir : path.join(rootDir, outputDir); const hashKey = hash === true ? 'hash:8' : (hash || ''); const compilation = compilationPlugin({ @@ -75,9 +88,46 @@ const getConfig: GetConfig = (options) => { enableEnv: true, getRoutesFile, }); + + const { rspack: { DefinePlugin, ProvidePlugin, SwcJsMinimizerRspackPlugin } } = await import('@ice/bundles/esm/rspack.js'); const cssFilename = `css/${hashKey ? `[name]-[${hashKey}].css` : '[name].css'}`; // get compile plugins const compilerWebpackPlugins = getCompilerPlugins(rootDir, taskConfig || {}, 'rspack', { isServer: false }); + const jsMinimizerPluginOptions: any = merge({ + compress: { + ecma: 5, + unused: true, + dead_code: true, + // The following two options are known to break valid JavaScript code + // https://github.com/vercel/next.js/issues/7178#issuecomment-493048965 + comparisons: false, + inline: 2, + passes: 4, + }, + mangle: { + safari10: true, + }, + format: { + safari10: true, + comments: false, + // Fixes usage of Emoji and certain Regex + asciiOnly: true, + }, + module: true, + }, minimizerOptions); + const builtinFeatures: BuiltinFeatures = {}; + let splitChunksStrategy = null; + // Use builtin splitChunks strategy by default. + if (splitChunks === true || splitChunks === 'chunks') { + builtinFeatures.splitChunksStrategy = { + name: 'chunks', + topLevelFrameworks: getFrameworkBundles(rootDir), + }; + } else { + splitChunksStrategy = typeof splitChunks == 'object' + ? splitChunks + : getSplitChunks(rootDir, splitChunks); + } const config: Configuration = { entry: { main: [path.join(rootDir, runtimeTmpDir, 'entry.client.tsx')], @@ -97,15 +147,19 @@ const getConfig: GetConfig = (options) => { context: rootDir, module: { rules: [ - // Compliation rules for js / ts. { + // TODO: use regexp to improve performance. test: compilation.transformInclude, - use: [{ - loader: require.resolve('@ice/shared-config/compilation-loader'), + use: { + loader: 'builtin:compilation-loader', options: { - transform: compilation.transform, + swcOptions: getJsxTransformOptions({ suffix: 'jsx', rootDir, mode, fastRefresh: isDev, polyfill, enableEnv: true }), + transformFeatures: { + removeExport: swcOptions.removeExportExprs, + keepExport: swcOptions.keepExports, + }, }, - }], + }, }, ...getAssetsRule(), ...getCssRules({ @@ -116,38 +170,42 @@ const getConfig: GetConfig = (options) => { ], }, resolve: { - alias, + alias: { + // Always lock the corejs version, it is decided by shared-config. + 'core-js': coreJsPath, + ...getAliasWithRoot(rootDir, alias), + }, }, watchOptions: { ignored: /node_modules/, aggregateTimeout: 100, }, optimization: { - splitChunks: typeof splitChunks == 'object' - ? splitChunks - : getSplitChunks(rootDir, splitChunks), + minimize: !!minify, + ...(splitChunksStrategy ? { splitChunks: splitChunksStrategy } : {}), }, // @ts-expect-error plugin instance defined by default in not compatible with rspack. plugins: [ ...plugins, // Unplugin should be compatible with rspack. ...compilerWebpackPlugins, - new AssetManifest({ - fileName: 'assets-manifest.json', - outputDir: path.join(rootDir, runtimeTmpDir), + isDev && new RefreshPlugin(), + new DefinePlugin(getDefineVars(define, runtimeDefineVars, getExpandedEnvs)), + new ProvidePlugin({ + process: [require.resolve('process/browser')], }), + !!minify && new SwcJsMinimizerRspackPlugin(jsMinimizerPluginOptions), ].filter(Boolean), builtins: { - define: getDefineVars(define, runtimeDefineVars, getExpandedEnvs), - provide: { - process: [require.resolve('process/browser')], - $ReactRefreshRuntime$: [require.resolve('./client/reactRefresh.cjs')], - }, - devFriendlySplitChunks: true, css: { modules: { localIdentName }, }, }, + experiments: { + rspackFuture: { + disableTransformByDefault: true, + }, + }, stats: 'none', infrastructureLogging: { level: 'warn', @@ -172,6 +230,7 @@ const getConfig: GetConfig = (options) => { ...devServer, setupMiddlewares: middlewares, }, + features: builtinFeatures, }; // Compatible with API configureWebpack. const ctx = { diff --git a/packages/rspack-config/src/plugins/AssetManifest.ts b/packages/rspack-config/src/plugins/AssetManifest.ts deleted file mode 100644 index e51f67e67f..0000000000 --- a/packages/rspack-config/src/plugins/AssetManifest.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { existsSync } from 'fs'; -import { resolve } from 'path'; -import type { Compiler, Compilation, RspackPluginInstance } from '@rspack/core'; - -export default class AssetManifest implements RspackPluginInstance { - private fileName: string; - private outputDir: string; - - constructor(options) { - this.fileName = options?.fileName || 'assets-manifest.json'; - this.outputDir = options?.outputDir || './'; - } - - apply(compiler: Compiler) { - compiler.hooks.thisCompilation.tap(this.constructor.name, (compilation) => { - compilation.hooks.processAssets.tapAsync( - { - name: this.constructor.name, - stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE, - }, - (_: Compilation['assets'], callback) => { - const entries = {}; - const pages = {}; - // TODO: get assets info by compilation.assetsInfo (not supported yet). - const assets = {}; - const entryNames = Array.from(compilation.entrypoints.keys()); - entryNames.forEach((entryName: string) => { - const entryUnfilteredPointFiles = compilation.entrypoints.get(entryName)?.getFiles(); - const entryPointFiles = entryUnfilteredPointFiles?.filter((chunkFile) => { - const asset = compilation.getAsset(chunkFile); - if (!asset) { - return true; - } - const assetMetaInfo = asset.info; - return !( - assetMetaInfo.hotModuleReplacement || - assetMetaInfo.development - ); - }); - entries[entryName] = entryPointFiles; - }); - const stats = compilation.getStats().toJson({ - all: false, - chunks: true, - }); - stats.chunks.filter(({ entry, initial }) => !entry && !initial).forEach((chunk) => { - const chunkName = chunk.id; - - if (chunkName) { - pages[chunkName.replace(/^p_/, '')] = chunk.files.filter((file: string) => { - return file.endsWith('.js') || file.endsWith('.css'); - }); - } - }); - const manifest = { - publicPath: compilation.outputOptions?.publicPath, - entries, - pages, - assets, - }; - - const dataLoader = resolve(this.outputDir, './data-loader.ts'); - if (existsSync(dataLoader)) { - manifest['dataLoader'] = 'js/data-loader.js'; - } - - const output = JSON.stringify(manifest, null, 2); - // Emit asset manifest for server compile. - compilation.emitAsset(this.fileName, new compiler.webpack.sources.RawSource(output)); - callback(); - }, - ); - }); - } -} diff --git a/packages/rspack-config/src/splitChunks.ts b/packages/rspack-config/src/splitChunks.ts index 6e825be7cf..5224596212 100644 --- a/packages/rspack-config/src/splitChunks.ts +++ b/packages/rspack-config/src/splitChunks.ts @@ -13,7 +13,7 @@ function transformPathForRegex(str: string) { ? str.replace(/\\$/, '').replace(/\\/g, '\\') : str; } -const getChunksStrategy = (rootDir: string) => { +export const getFrameworkBundles = (rootDir: string) => { const frameworkPaths: string[] = []; const visitedFramework = new Set(); function addPackagePath(packageName: string, dir: string) { @@ -40,7 +40,11 @@ const getChunksStrategy = (rootDir: string) => { FRAMEWORK_BUNDLES.forEach((packageName) => { addPackagePath(packageName, rootDir); }); + return frameworkPaths; +}; +export const getChunksStrategy = (rootDir: string) => { + const frameworkPaths = getFrameworkBundles(rootDir); // Create test rule for framework. const frameworkTest = new RegExp(frameworkPaths.join('|')); return { @@ -81,14 +85,14 @@ export const getVendorStrategy = (options: Configuration['splitChunks']) => { }; }; -const getSplitChunks = (rootDir: string, strategy: string | boolean) => { +const getSplitChunks = (_: string, strategy: string | boolean) => { if (strategy === false) { return { minChunks: Infinity, cacheGroups: { default: false } }; } else if (typeof strategy === 'string' && ['page-vendors', 'vendors'].includes(strategy)) { const splitChunksOptions = strategy === 'page-vendors' ? { chunks: 'all' } : {}; return getVendorStrategy(splitChunksOptions); } - return getChunksStrategy(rootDir); + return {}; }; export default getSplitChunks; diff --git a/packages/shared-config/CHANGELOG.md b/packages/shared-config/CHANGELOG.md index 15abd1d6b8..2a916f5b98 100644 --- a/packages/shared-config/CHANGELOG.md +++ b/packages/shared-config/CHANGELOG.md @@ -1,5 +1,17 @@ # @ice/shared-config +## 1.2.0 + +### Minor Changes + +- a68ff48d: feat: support @ice/pack-binding + +### Patch Changes + +- 7d193fe9: fix: optimize utils +- Updated dependencies [a68ff48d] + - @ice/bundles@0.2.0 + ## 1.1.2 ### Patch Changes diff --git a/packages/shared-config/package.json b/packages/shared-config/package.json index 6acda3f3de..88949bbc5b 100644 --- a/packages/shared-config/package.json +++ b/packages/shared-config/package.json @@ -1,6 +1,6 @@ { "name": "@ice/shared-config", - "version": "1.1.2", + "version": "1.2.0", "repository": "alibaba/ice", "bugs": "https://github.com/alibaba/ice/issues", "homepage": "https://v3.ice.work", @@ -17,7 +17,7 @@ "*.d.ts" ], "dependencies": { - "@ice/bundles": "0.1.17", + "@ice/bundles": "0.2.0", "@rollup/pluginutils": "^4.2.0", "browserslist": "^4.22.1", "consola": "^2.15.3", @@ -28,7 +28,7 @@ "esbuild": "^0.17.16", "postcss": "^8.4.31", "webpack": "^5.86.0", - "webpack-dev-server": "^4.7.4" + "webpack-dev-server": "4.15.0" }, "scripts": { "watch": "tsc -w --sourceMap", diff --git a/packages/shared-config/src/compileExcludes.ts b/packages/shared-config/src/compileExcludes.ts index 37aff4d0da..4916c70187 100644 --- a/packages/shared-config/src/compileExcludes.ts +++ b/packages/shared-config/src/compileExcludes.ts @@ -1,4 +1,4 @@ -const SKIP_COMPILE = [ +export const SKIP_COMPILE = [ // polyfill and helpers 'core-js', 'core-js-pure', '@swc/helpers', '@babel/runtime', 'tslib', // Deprecate version of @babel/runtime. diff --git a/packages/shared-config/src/getAlias.ts b/packages/shared-config/src/getAlias.ts new file mode 100644 index 0000000000..942b50083d --- /dev/null +++ b/packages/shared-config/src/getAlias.ts @@ -0,0 +1,12 @@ +import * as path from 'path'; + +function getAliasWithRoot(rootDir: string, alias?: Record) { + const aliasWithRoot = {}; + Object.keys(alias).forEach((key) => { + const aliasValue = alias[key]; + aliasWithRoot[key] = (aliasValue && typeof aliasValue === 'string' && aliasValue.startsWith('.')) ? path.join(rootDir, aliasValue) : aliasValue; + }); + return aliasWithRoot; +} + +export default getAliasWithRoot; diff --git a/packages/shared-config/src/index.ts b/packages/shared-config/src/index.ts index bd5e13d781..a0789a3022 100644 --- a/packages/shared-config/src/index.ts +++ b/packages/shared-config/src/index.ts @@ -1,16 +1,20 @@ -import compilationPlugin, { isSupportedFeature } from './unPlugins/compilation.js'; -import compileExcludes from './compileExcludes.js'; +import compilationPlugin, { isSupportedFeature, getJsxTransformOptions } from './unPlugins/compilation.js'; +import compileExcludes, { SKIP_COMPILE as skipCompilePackages } from './compileExcludes.js'; import getCompilerPlugins from './getCompilerPlugins.js'; import getDefineVars from './getDefineVars.js'; import getPostcssOpts from './getPostcssOpts.js'; import getCSSModuleLocalIdent from './getCSSModuleLocalIdent.js'; +import getAliasWithRoot from './getAlias.js'; export { getCSSModuleLocalIdent, compilationPlugin, isSupportedFeature, compileExcludes, + skipCompilePackages, + getJsxTransformOptions, getCompilerPlugins, getDefineVars, getPostcssOpts, + getAliasWithRoot, }; diff --git a/packages/shared-config/src/types.ts b/packages/shared-config/src/types.ts index 49f3772e42..0d0b90e8e2 100644 --- a/packages/shared-config/src/types.ts +++ b/packages/shared-config/src/types.ts @@ -75,6 +75,9 @@ interface TransformPlugin { export type ModifyWebpackConfig = (config: T, ctx: ConfigurationCtx) => T; export type { webpack }; + +type PluginFunction = (this: Compiler, compiler: Compiler) => void; + export interface Config { target?: string; @@ -103,7 +106,7 @@ export interface Config { loaders?: (undefined | null | false | '' | 0 | RuleSetRule | '...')[]; plugins?: ( - | ((this: Compiler, compiler: Compiler) => void) + | PluginFunction | WebpackPluginInstance )[]; diff --git a/packages/shared-config/src/unPlugins/compilation.ts b/packages/shared-config/src/unPlugins/compilation.ts index 50496ad70f..f45b2f4f0a 100644 --- a/packages/shared-config/src/unPlugins/compilation.ts +++ b/packages/shared-config/src/unPlugins/compilation.ts @@ -71,14 +71,12 @@ const compilationPlugin = (options: Options): UnpluginOptions => { transformInclude(id) { // Resolved id is not formatted when used in webpack loader test. const formatedId = formatId(id); - return extensionRegex.test(formatedId) && !compileExcludes.some((regex) => regex.test(formatedId)); + const needCompile = extensionRegex.test(formatedId) && !compileExcludes.some((regex) => regex.test(formatedId)); + const skipCompile = /node_modules/.test(id) && !compileRegex.some((regex) => regex.test(id)); + return needCompile && !skipCompile; }, async transform(source: string, fileId: string) { const id = formatId(fileId); - if ((/node_modules/.test(id) && !compileRegex.some((regex) => regex.test(id)))) { - return; - } - const suffix = (['jsx', 'tsx'] as JSXSuffix[]).find(suffix => new RegExp(`\\.${suffix}?$`).test(id)); const programmaticOptions: SwcConfig = { @@ -184,13 +182,13 @@ const compilationPlugin = (options: Options): UnpluginOptions => { interface GetJsxTransformOptions { rootDir: string; mode: Options['mode']; - suffix: JSXSuffix; + suffix?: JSXSuffix; fastRefresh: boolean; polyfill: Config['polyfill']; enableEnv: boolean; } -function getJsxTransformOptions({ +export function getJsxTransformOptions({ suffix, fastRefresh, polyfill, @@ -250,6 +248,7 @@ function getJsxTransformOptions({ parser: { jsx: true, ...syntaxFeatures, + syntax: 'ecmascript', }, }, }, commonOptions); diff --git a/packages/webpack-config/CHANGELOG.md b/packages/webpack-config/CHANGELOG.md index 1d53bd9de0..2525e98d2c 100644 --- a/packages/webpack-config/CHANGELOG.md +++ b/packages/webpack-config/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 1.1.7 + +### Patch Changes + +- 7d193fe9: fix: optimize utils +- Updated dependencies [7d193fe9] +- Updated dependencies [a68ff48d] + - @ice/shared-config@1.2.0 + - @ice/bundles@0.2.0 + ## 1.1.6 ### Patch Changes diff --git a/packages/webpack-config/package.json b/packages/webpack-config/package.json index de3c901bdd..4e0d0a8abf 100644 --- a/packages/webpack-config/package.json +++ b/packages/webpack-config/package.json @@ -1,6 +1,6 @@ { "name": "@ice/webpack-config", - "version": "1.1.6", + "version": "1.1.7", "repository": "alibaba/ice", "bugs": "https://github.com/alibaba/ice/issues", "homepage": "https://v3.ice.work", @@ -15,8 +15,8 @@ "*.d.ts" ], "dependencies": { - "@ice/shared-config": "1.1.2", - "@ice/bundles": "0.1.17", + "@ice/shared-config": "1.2.0", + "@ice/bundles": "0.2.0", "fast-glob": "^3.2.11", "process": "^0.11.10" }, diff --git a/packages/webpack-config/src/index.ts b/packages/webpack-config/src/index.ts index b1dfcb3c9e..b6ee1e705d 100644 --- a/packages/webpack-config/src/index.ts +++ b/packages/webpack-config/src/index.ts @@ -11,7 +11,7 @@ import ESlintPlugin from '@ice/bundles/compiled/eslint-webpack-plugin/index.js'; import CopyPlugin from '@ice/bundles/compiled/copy-webpack-plugin/index.js'; import type { NormalModule, Compiler, Configuration } from 'webpack'; import type webpack from 'webpack'; -import { compilationPlugin, compileExcludes, getCompilerPlugins, getDefineVars } from '@ice/shared-config'; +import { compilationPlugin, compileExcludes, getCompilerPlugins, getDefineVars, getAliasWithRoot } from '@ice/shared-config'; import type { Config, ModifyWebpackConfig } from '@ice/shared-config/types.js'; import configAssets from './config/assets.js'; import configCss from './config/css.js'; @@ -59,16 +59,6 @@ function getEntry(rootDir: string, runtimeTmpDir: string) { }; } -// format alias -export function getAliasWithRoot(rootDir: string, alias?: Record) { - const aliasWithRoot = {}; - Object.keys(alias).forEach((key) => { - const aliasValue = alias[key]; - aliasWithRoot[key] = (aliasValue && typeof aliasValue === 'string' && aliasValue.startsWith('.')) ? path.join(rootDir, aliasValue) : aliasValue; - }); - return aliasWithRoot; -} - export function getWebpackConfig(options: GetWebpackConfigOptions): Configuration { const { rootDir, diff --git a/patches/unplugin@1.5.1.patch b/patches/unplugin@1.5.1.patch new file mode 100644 index 0000000000..48ed345100 --- /dev/null +++ b/patches/unplugin@1.5.1.patch @@ -0,0 +1,457 @@ +diff --git a/dist/index.d.mts b/dist/index.d.mts +index 524216f7a6d07c6fb1000cbfaf864087c18c07d6..5f0c400b14c4d53032071963cf1844a2c77b8a1b 100644 +--- a/dist/index.d.mts ++++ b/dist/index.d.mts +@@ -116,6 +116,11 @@ declare module 'webpack' { + $unpluginContext: Record; + } + } ++declare module '@rspack/core' { ++ interface Compiler { ++ $unpluginContext: Record; ++ } ++} + + declare function createUnplugin(factory: UnpluginFactory): UnpluginInstance; + declare function createEsbuildPlugin(factory: UnpluginFactory): UnpluginFactoryOutput; +diff --git a/dist/index.d.ts b/dist/index.d.ts +index 524216f7a6d07c6fb1000cbfaf864087c18c07d6..5f0c400b14c4d53032071963cf1844a2c77b8a1b 100644 +--- a/dist/index.d.ts ++++ b/dist/index.d.ts +@@ -116,6 +116,11 @@ declare module 'webpack' { + $unpluginContext: Record; + } + } ++declare module '@rspack/core' { ++ interface Compiler { ++ $unpluginContext: Record; ++ } ++} + + declare function createUnplugin(factory: UnpluginFactory): UnpluginInstance; + declare function createEsbuildPlugin(factory: UnpluginFactory): UnpluginFactoryOutput; +diff --git a/dist/index.js b/dist/index.js +index e2ae29096208ae06c2e36fd123ee42585c798da1..2166e91885b7ae53e22028142c188489485f5fea 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -1135,6 +1135,24 @@ function toArray(array) { + return array; + return [array]; + } ++function shouldLoad(id, plugin, externalModules) { ++ if (id.startsWith(plugin.__virtualModulePrefix)) ++ id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); ++ if (plugin.loadInclude && !plugin.loadInclude(id)) ++ return false; ++ return !externalModules.has(id); ++} ++function transformUse(data, plugin, transformLoader) { ++ if (data.resource == null) ++ return []; ++ const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || "")); ++ if (!plugin.transformInclude || plugin.transformInclude(id)) { ++ return [{ ++ loader: `${transformLoader}?unpluginName=${encodeURIComponent(plugin.name)}` ++ }]; ++ } ++ return []; ++} + + // src/esbuild/utils.ts + var ExtToLoader = { +@@ -1430,16 +1448,19 @@ function createRspackContext(compilation) { + // src/rspack/index.ts + var TRANSFORM_LOADER = (0, import_path4.resolve)( + __dirname, +- false ? "../../dist/rspack/loaders/transform" : "rspack/loaders/transform" ++ false ? "../../dist/rspack/loaders/transform.js" : "rspack/loaders/transform" + ); + var LOAD_LOADER = (0, import_path4.resolve)( + __dirname, + false ? "../../dist/rspack/loaders/load" : "rspack/loaders/load" + ); ++var VIRTUAL_MODULE_PREFIX = (0, import_path4.resolve)(process.cwd(), "_virtual_"); + function getRspackPlugin(factory) { + return (userOptions) => { + return { + apply(compiler) { ++ const injected = compiler.$unpluginContext || {}; ++ compiler.$unpluginContext = injected; + const meta = { + framework: "rspack", + rspack: { +@@ -1447,27 +1468,43 @@ function getRspackPlugin(factory) { + } + }; + const rawPlugins = toArray(factory(userOptions, meta)); +- for (const plugin of rawPlugins) { ++ for (const rawPlugin of rawPlugins) { ++ const plugin = Object.assign( ++ rawPlugin, ++ { ++ __unpluginMeta: meta, ++ __virtualModulePrefix: VIRTUAL_MODULE_PREFIX ++ } ++ ); ++ injected[plugin.name] = plugin; ++ compiler.hooks.thisCompilation.tap(plugin.name, (compilation) => { ++ if (typeof compilation.hooks.childCompiler === "undefined") ++ throw new Error("`compilation.hooks.childCompiler` only support by @rspack/core>=0.4.1"); ++ compilation.hooks.childCompiler.tap(plugin.name, (childCompiler) => { ++ childCompiler.$unpluginContext = injected; ++ }); ++ }); ++ const externalModules = /* @__PURE__ */ new Set(); + if (plugin.load) { +- const use = { +- loader: LOAD_LOADER, +- options: { plugin } +- }; + compiler.options.module.rules.unshift({ + enforce: plugin.enforce, +- include: /.*/, +- use ++ include(id) { ++ return shouldLoad(id, plugin, externalModules); ++ }, ++ use: [{ ++ loader: LOAD_LOADER, ++ options: { ++ unpluginName: plugin.name ++ } ++ }] + }); + } + if (plugin.transform) { +- const use = { +- loader: TRANSFORM_LOADER, +- options: { plugin } +- }; + compiler.options.module.rules.unshift({ + enforce: plugin.enforce, +- include: /.*/, +- use ++ use(data) { ++ return transformUse(data, plugin, TRANSFORM_LOADER); ++ } + }); + } + if (plugin.rspack) +@@ -1570,7 +1607,7 @@ var LOAD_LOADER2 = (0, import_path6.resolve)( + __dirname, + false ? "../../dist/webpack/loaders/load" : "webpack/loaders/load" + ); +-var VIRTUAL_MODULE_PREFIX = (0, import_path6.resolve)(import_process2.default.cwd(), "_virtual_"); ++var VIRTUAL_MODULE_PREFIX2 = (0, import_path6.resolve)(import_process2.default.cwd(), "_virtual_"); + function getWebpackPlugin(factory) { + return (userOptions) => { + return { +@@ -1589,7 +1626,7 @@ function getWebpackPlugin(factory) { + rawPlugin, + { + __unpluginMeta: meta, +- __virtualModulePrefix: VIRTUAL_MODULE_PREFIX ++ __virtualModulePrefix: VIRTUAL_MODULE_PREFIX2 + } + ); + injected[plugin.name] = plugin; +@@ -1650,11 +1687,7 @@ function getWebpackPlugin(factory) { + if (plugin.load) { + compiler.options.module.rules.unshift({ + include(id) { +- if (id.startsWith(plugin.__virtualModulePrefix)) +- id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); +- if (plugin.loadInclude && !plugin.loadInclude(id)) +- return false; +- return !externalModules.has(id); ++ return shouldLoad(id, plugin, externalModules); + }, + enforce: plugin.enforce, + use: [{ +@@ -1666,19 +1699,10 @@ function getWebpackPlugin(factory) { + }); + } + if (plugin.transform) { +- const useLoader = [{ +- loader: `${TRANSFORM_LOADER2}?unpluginName=${encodeURIComponent(plugin.name)}` +- }]; +- const useNone = []; + compiler.options.module.rules.unshift({ + enforce: plugin.enforce, +- use: (data) => { +- if (data.resource == null) +- return useNone; +- const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || "")); +- if (!plugin.transformInclude || plugin.transformInclude(id)) +- return useLoader; +- return useNone; ++ use(data) { ++ return transformUse(data, plugin, TRANSFORM_LOADER2); + } + }); + } +diff --git a/dist/index.mjs b/dist/index.mjs +index f815c05c279126543cdd40ec879b0c95b92a8d03..c1caae0c0bb82515ff419c244b20a67fc375efb6 100644 +--- a/dist/index.mjs ++++ b/dist/index.mjs +@@ -1101,6 +1101,24 @@ function toArray(array) { + return array; + return [array]; + } ++function shouldLoad(id, plugin, externalModules) { ++ if (id.startsWith(plugin.__virtualModulePrefix)) ++ id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); ++ if (plugin.loadInclude && !plugin.loadInclude(id)) ++ return false; ++ return !externalModules.has(id); ++} ++function transformUse(data, plugin, transformLoader) { ++ if (data.resource == null) ++ return []; ++ const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || "")); ++ if (!plugin.transformInclude || plugin.transformInclude(id)) { ++ return [{ ++ loader: `${transformLoader}?unpluginName=${encodeURIComponent(plugin.name)}` ++ }]; ++ } ++ return []; ++} + + // src/esbuild/utils.ts + var ExtToLoader = { +@@ -1396,16 +1414,19 @@ function createRspackContext(compilation) { + // src/rspack/index.ts + var TRANSFORM_LOADER = resolve3( + __dirname, +- false ? "../../dist/rspack/loaders/transform" : "rspack/loaders/transform" ++ false ? "../../dist/rspack/loaders/transform.js" : "rspack/loaders/transform" + ); + var LOAD_LOADER = resolve3( + __dirname, + false ? "../../dist/rspack/loaders/load" : "rspack/loaders/load" + ); ++var VIRTUAL_MODULE_PREFIX = resolve3(process.cwd(), "_virtual_"); + function getRspackPlugin(factory) { + return (userOptions) => { + return { + apply(compiler) { ++ const injected = compiler.$unpluginContext || {}; ++ compiler.$unpluginContext = injected; + const meta = { + framework: "rspack", + rspack: { +@@ -1413,27 +1434,43 @@ function getRspackPlugin(factory) { + } + }; + const rawPlugins = toArray(factory(userOptions, meta)); +- for (const plugin of rawPlugins) { ++ for (const rawPlugin of rawPlugins) { ++ const plugin = Object.assign( ++ rawPlugin, ++ { ++ __unpluginMeta: meta, ++ __virtualModulePrefix: VIRTUAL_MODULE_PREFIX ++ } ++ ); ++ injected[plugin.name] = plugin; ++ compiler.hooks.thisCompilation.tap(plugin.name, (compilation) => { ++ if (typeof compilation.hooks.childCompiler === "undefined") ++ throw new Error("`compilation.hooks.childCompiler` only support by @rspack/core>=0.4.1"); ++ compilation.hooks.childCompiler.tap(plugin.name, (childCompiler) => { ++ childCompiler.$unpluginContext = injected; ++ }); ++ }); ++ const externalModules = /* @__PURE__ */ new Set(); + if (plugin.load) { +- const use = { +- loader: LOAD_LOADER, +- options: { plugin } +- }; + compiler.options.module.rules.unshift({ + enforce: plugin.enforce, +- include: /.*/, +- use ++ include(id) { ++ return shouldLoad(id, plugin, externalModules); ++ }, ++ use: [{ ++ loader: LOAD_LOADER, ++ options: { ++ unpluginName: plugin.name ++ } ++ }] + }); + } + if (plugin.transform) { +- const use = { +- loader: TRANSFORM_LOADER, +- options: { plugin } +- }; + compiler.options.module.rules.unshift({ + enforce: plugin.enforce, +- include: /.*/, +- use ++ use(data) { ++ return transformUse(data, plugin, TRANSFORM_LOADER); ++ } + }); + } + if (plugin.rspack) +@@ -1480,13 +1517,13 @@ function getVitePlugin(factory) { + // src/webpack/index.ts + import fs3 from "fs"; + import { resolve as resolve5 } from "path"; +-import process2 from "process"; ++import process3 from "process"; + import VirtualModulesPlugin from "webpack-virtual-modules"; + + // src/webpack/context.ts + import { resolve as resolve4 } from "path"; + import { Buffer as Buffer4 } from "buffer"; +-import process from "process"; ++import process2 from "process"; + import sources2 from "webpack-sources"; + import { Parser as Parser3 } from "acorn"; + function createContext(compilation) { +@@ -1501,7 +1538,7 @@ function createContext(compilation) { + }, + addWatchFile(id) { + (compilation.fileDependencies ?? compilation.compilationDependencies).add( +- resolve4(process.cwd(), id) ++ resolve4(process2.cwd(), id) + ); + }, + emitFile(emittedFile) { +@@ -1536,7 +1573,7 @@ var LOAD_LOADER2 = resolve5( + __dirname, + false ? "../../dist/webpack/loaders/load" : "webpack/loaders/load" + ); +-var VIRTUAL_MODULE_PREFIX = resolve5(process2.cwd(), "_virtual_"); ++var VIRTUAL_MODULE_PREFIX2 = resolve5(process3.cwd(), "_virtual_"); + function getWebpackPlugin(factory) { + return (userOptions) => { + return { +@@ -1555,7 +1592,7 @@ function getWebpackPlugin(factory) { + rawPlugin, + { + __unpluginMeta: meta, +- __virtualModulePrefix: VIRTUAL_MODULE_PREFIX ++ __virtualModulePrefix: VIRTUAL_MODULE_PREFIX2 + } + ); + injected[plugin.name] = plugin; +@@ -1616,11 +1653,7 @@ function getWebpackPlugin(factory) { + if (plugin.load) { + compiler.options.module.rules.unshift({ + include(id) { +- if (id.startsWith(plugin.__virtualModulePrefix)) +- id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); +- if (plugin.loadInclude && !plugin.loadInclude(id)) +- return false; +- return !externalModules.has(id); ++ return shouldLoad(id, plugin, externalModules); + }, + enforce: plugin.enforce, + use: [{ +@@ -1632,19 +1665,10 @@ function getWebpackPlugin(factory) { + }); + } + if (plugin.transform) { +- const useLoader = [{ +- loader: `${TRANSFORM_LOADER2}?unpluginName=${encodeURIComponent(plugin.name)}` +- }]; +- const useNone = []; + compiler.options.module.rules.unshift({ + enforce: plugin.enforce, +- use: (data) => { +- if (data.resource == null) +- return useNone; +- const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || "")); +- if (!plugin.transformInclude || plugin.transformInclude(id)) +- return useLoader; +- return useNone; ++ use(data) { ++ return transformUse(data, plugin, TRANSFORM_LOADER2); + } + }); + } +diff --git a/dist/rspack/loaders/load.js b/dist/rspack/loaders/load.js +index 0587e3d6a1b44e10a022a04b3397b2f6e9ec2fb9..4ad1c2fdf35b9970ff8669c093e078d9f62ae2a4 100644 +--- a/dist/rspack/loaders/load.js ++++ b/dist/rspack/loaders/load.js +@@ -80,8 +80,9 @@ function normalizeAbsolutePath(path) { + // src/rspack/loaders/load.ts + async function load(source, map) { + const callback = this.async(); ++ const { unpluginName } = this.query; ++ const plugin = this._compiler?.$unpluginContext[unpluginName]; + const id = this.resource; +- const { plugin } = this.getOptions(); + if (!plugin?.load || !id) + return callback(null, source, map); + if (plugin.loadInclude && !plugin.loadInclude(id)) +diff --git a/dist/rspack/loaders/load.mjs b/dist/rspack/loaders/load.mjs +index 4a3f6d10edc8bcd4b1c3a37a0f3af8dcee893f1f..f3f6e57129c9c17fc15d4a80815e53106ce8023a 100644 +--- a/dist/rspack/loaders/load.mjs ++++ b/dist/rspack/loaders/load.mjs +@@ -44,8 +44,9 @@ function normalizeAbsolutePath(path) { + // src/rspack/loaders/load.ts + async function load(source, map) { + const callback = this.async(); ++ const { unpluginName } = this.query; ++ const plugin = this._compiler?.$unpluginContext[unpluginName]; + const id = this.resource; +- const { plugin } = this.getOptions(); + if (!plugin?.load || !id) + return callback(null, source, map); + if (plugin.loadInclude && !plugin.loadInclude(id)) +diff --git a/dist/rspack/loaders/transform.js b/dist/rspack/loaders/transform.js +index 21ffe0b8056ac063a80beca1c41eb54285b10551..0a24cb09de77b3ab534da7e9827995544f8d182b 100644 +--- a/dist/rspack/loaders/transform.js ++++ b/dist/rspack/loaders/transform.js +@@ -71,12 +71,17 @@ function createRspackContext(compilation) { + // src/rspack/loaders/transform.ts + async function transform(source, map) { + const callback = this.async(); ++ let unpluginName; ++ if (typeof this.query === "string") { ++ const query = new URLSearchParams(this.query); ++ unpluginName = query.get("unpluginName"); ++ } else { ++ unpluginName = this.query.unpluginName; ++ } + const id = this.resource; +- const { plugin } = this.getOptions(); ++ const plugin = this._compiler?.$unpluginContext[unpluginName]; + if (!plugin?.transform) + return callback(null, source, map); +- if (plugin.transformInclude && !plugin.transformInclude(id)) +- return callback(null, source, map); + const context = { + error: (error) => this.emitError(typeof error === "string" ? new Error(error) : error), + warn: (error) => this.emitWarning(typeof error === "string" ? new Error(error) : error) +diff --git a/dist/rspack/loaders/transform.mjs b/dist/rspack/loaders/transform.mjs +index c5c1957cb516acf989fa15d4eebfcabebcfa9541..d023ff719d1ddf5d5ade369614cfbcb5870d843b 100644 +--- a/dist/rspack/loaders/transform.mjs ++++ b/dist/rspack/loaders/transform.mjs +@@ -35,12 +35,17 @@ function createRspackContext(compilation) { + // src/rspack/loaders/transform.ts + async function transform(source, map) { + const callback = this.async(); ++ let unpluginName; ++ if (typeof this.query === "string") { ++ const query = new URLSearchParams(this.query); ++ unpluginName = query.get("unpluginName"); ++ } else { ++ unpluginName = this.query.unpluginName; ++ } + const id = this.resource; +- const { plugin } = this.getOptions(); ++ const plugin = this._compiler?.$unpluginContext[unpluginName]; + if (!plugin?.transform) + return callback(null, source, map); +- if (plugin.transformInclude && !plugin.transformInclude(id)) +- return callback(null, source, map); + const context = { + error: (error) => this.emitError(typeof error === "string" ? new Error(error) : error), + warn: (error) => this.emitWarning(typeof error === "string" ? new Error(error) : error) \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5df409a7f..2aee8336ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + unplugin@1.5.1: + hash: eanypstkeladyqkfllfbryx6lu + path: patches/unplugin@1.5.1.patch + importers: .: @@ -838,7 +843,7 @@ importers: dependencies: '@alifd/next': specifier: ^1.25.49 - version: 1.26.2(@alifd/meet-react@2.9.6)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0) + version: 1.26.2(@alifd/meet-react@2.9.7)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0) '@ice/runtime': specifier: workspace:* version: link:../../packages/runtime @@ -1267,6 +1272,9 @@ importers: '@ice/css-modules-hash': specifier: 0.0.6 version: 0.0.6 + '@ice/pack-binding': + specifier: 0.0.4 + version: 0.0.4 '@ice/swc-plugin-keep-export': specifier: 0.2.0 version: 0.2.0 @@ -1276,30 +1284,33 @@ importers: '@ice/swc-plugin-remove-export': specifier: 0.2.0 version: 0.2.0 - '@rspack/core': - specifier: 0.3.0 - version: 0.3.0(webpack-dev-server@4.15.0)(webpack@5.88.2) - '@rspack/dev-server': - specifier: 0.3.0 - version: 0.3.0(@rspack/core@0.3.0)(@swc/core@1.3.80)(esbuild@0.17.16)(react-refresh@0.14.0) '@swc/core': specifier: 1.3.80 version: 1.3.80 ansi-html-community: specifier: ^0.0.8 version: 0.0.8 + browserslist: + specifier: ^4.21.3 + version: 4.21.5 caniuse-lite: specifier: ^1.0.30001561 version: 1.0.30001564 chokidar: specifier: 3.5.3 version: 3.5.3 + compare-versions: + specifier: 6.0.0-rc.1 + version: 6.0.0-rc.1 core-js: specifier: 3.32.0 version: 3.32.0 core-js-pure: specifier: ^3.8.1 version: 3.29.0 + enhanced-resolve: + specifier: 5.12.0 + version: 5.12.0 error-stack-parser: specifier: ^2.0.6 version: 2.1.4 @@ -1309,15 +1320,27 @@ importers: events: specifier: 3.3.0 version: 3.3.0 + fast-querystring: + specifier: 1.1.2 + version: 1.1.2 html-entities: specifier: ^2.3.2 version: 2.3.3 jest-worker: specifier: 27.5.1 version: 27.5.1 + json-parse-even-better-errors: + specifier: ^3.0.0 + version: 3.0.0 less: specifier: 4.1.2 version: 4.1.2 + mime-types: + specifier: 2.1.35 + version: 2.1.35 + neo-async: + specifier: 2.6.2 + version: 2.6.2 postcss: specifier: 8.4.31 version: 8.4.31 @@ -1327,10 +1350,34 @@ importers: sass: specifier: 1.50.0 version: 1.50.0 + terminal-link: + specifier: ^2.1.1 + version: 2.1.1 + watchpack: + specifier: ^2.4.0 + version: 2.4.0 + webpack-sources: + specifier: 3.2.3 + version: 3.2.3 + zod: + specifier: ^3.21.4 + version: 3.21.4 + zod-validation-error: + specifier: 1.2.0 + version: 1.2.0(zod@3.21.4) devDependencies: '@pmmmwh/react-refresh-webpack-plugin': specifier: 0.5.10 version: 0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.15.0)(webpack@5.88.2) + '@rspack/core': + specifier: 0.4.3 + version: 0.4.3 + '@rspack/dev-server': + specifier: 0.4.3 + version: 0.4.3(@rspack/core@0.4.3)(@swc/core@1.3.80)(esbuild@0.17.16)(react-refresh@0.14.0) + '@rspack/plugin-react-refresh': + specifier: 0.4.3 + version: 0.4.3(react-refresh@0.14.0) '@types/less': specifier: ^3.0.3 version: 3.0.3 @@ -1356,8 +1403,8 @@ importers: specifier: ^1.7.4 version: 1.7.4 connect-history-api-fallback: - specifier: ^1.6.0 - version: 1.6.0 + specifier: 2.0.0 + version: 2.0.0 copy-webpack-plugin: specifier: 10.2.4 version: 10.2.4(webpack@5.88.2) @@ -1401,7 +1448,7 @@ importers: specifier: 13.1.2 version: 13.1.2 graceful-fs: - specifier: ^4.2.6 + specifier: 4.2.10 version: 4.2.10 http-proxy-middleware: specifier: ^2.0.3 @@ -1491,8 +1538,8 @@ importers: specifier: ^4.6.4 version: 4.9.5 unplugin: - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.1 + version: 1.5.1(patch_hash=eanypstkeladyqkfllfbryx6lu) webpack: specifier: 5.88.2 version: 5.88.2(@swc/core@1.3.80)(esbuild@0.17.16) @@ -1550,22 +1597,22 @@ importers: packages/ice: dependencies: '@ice/bundles': - specifier: 0.1.17 + specifier: 0.2.0 version: link:../bundles '@ice/route-manifest': specifier: 1.2.2 version: link:../route-manifest '@ice/rspack-config': - specifier: 1.0.7 + specifier: 1.1.0 version: link:../rspack-config '@ice/runtime': specifier: ^1.3.3 version: link:../runtime '@ice/shared-config': - specifier: 1.1.2 + specifier: 1.2.0 version: link:../shared-config '@ice/webpack-config': - specifier: 1.1.6 + specifier: 1.1.7 version: link:../webpack-config '@swc/helpers': specifier: 0.5.1 @@ -1650,11 +1697,11 @@ importers: version: 21.1.1 devDependencies: '@rspack/core': - specifier: 0.3.0 - version: 0.3.0(webpack-dev-server@4.11.1)(webpack@5.88.2) + specifier: 0.4.3 + version: 0.4.3 '@rspack/dev-server': - specifier: 0.3.0 - version: 0.3.0(@rspack/core@0.3.0)(@types/express@4.17.17)(esbuild@0.17.16)(react-refresh@0.14.0) + specifier: 0.4.3 + version: 0.4.3(@rspack/core@0.4.3)(@types/express@4.17.17)(esbuild@0.17.16) '@types/babel__generator': specifier: ^7.6.4 version: 7.6.4 @@ -1698,14 +1745,14 @@ importers: specifier: ^1.50.0 version: 1.50.0 unplugin: - specifier: ^1.5.0 - version: 1.5.0 + specifier: ^1.5.1 + version: 1.5.1(patch_hash=eanypstkeladyqkfllfbryx6lu) webpack: specifier: ^5.88.0 version: 5.88.2(esbuild@0.17.16) webpack-dev-server: - specifier: ^4.7.4 - version: 4.11.1(webpack@5.88.2) + specifier: 4.15.0 + version: 4.15.0(webpack@5.88.2) packages/jsx-runtime: dependencies: @@ -1737,7 +1784,7 @@ importers: packages/miniapp-loader: dependencies: '@ice/bundles': - specifier: ^0.1.16 + specifier: ^0.2.0 version: link:../bundles devDependencies: webpack: @@ -1902,8 +1949,8 @@ importers: specifier: ^7.0.3 version: 7.0.3 webpack-dev-server: - specifier: ^4.13.2 - version: 4.13.2(webpack@5.88.2) + specifier: 4.15.0 + version: 4.15.0(webpack@5.88.2) packages/plugin-icestark: dependencies: @@ -1967,10 +2014,10 @@ importers: packages/plugin-miniapp: dependencies: '@ice/bundles': - specifier: ^0.1.16 + specifier: ^0.2.0 version: link:../bundles '@ice/miniapp-loader': - specifier: ^1.1.1 + specifier: ^1.1.2 version: link:../miniapp-loader '@ice/miniapp-react-dom': specifier: ^1.0.2 @@ -2004,7 +2051,7 @@ importers: version: 1.2.4 devDependencies: '@ice/app': - specifier: ^3.3.2 + specifier: ^3.4.0 version: link:../ice '@ice/runtime': specifier: ^1.2.9 @@ -2053,8 +2100,8 @@ importers: specifier: ^5.88.0 version: 5.88.2(esbuild@0.17.16) webpack-dev-server: - specifier: ^4.9.2 - version: 4.11.1(webpack@5.88.2) + specifier: 4.15.0 + version: 4.15.0(webpack@5.88.2) packages/plugin-rax-compat: dependencies: @@ -2065,7 +2112,7 @@ importers: specifier: ^7.18.9 version: 7.18.10(@babel/core@7.21.0) '@ice/bundles': - specifier: ^0.1.16 + specifier: ^0.2.0 version: link:../bundles babel-plugin-transform-jsx-stylesheet: specifier: 1.0.6 @@ -2090,7 +2137,7 @@ importers: version: 0.9.1 devDependencies: '@ice/app': - specifier: ^3.3.5 + specifier: ^3.4.0 version: link:../ice '@types/lodash-es': specifier: ^4.17.7 @@ -2189,7 +2236,7 @@ importers: version: 0.57.6(webpack@5.88.2) unocss: specifier: ^0.57.6 - version: 0.57.6(@unocss/webpack@0.57.6)(postcss@8.4.31)(vite@2.9.16) + version: 0.57.6(@unocss/webpack@0.57.6)(postcss@8.4.31)(vite@3.2.5) devDependencies: '@ice/app': specifier: workspace:^ @@ -2244,15 +2291,15 @@ importers: packages/rspack-config: dependencies: '@ice/bundles': - specifier: 0.1.17 + specifier: 0.2.0 version: link:../bundles '@ice/shared-config': - specifier: 1.1.2 + specifier: 1.2.0 version: link:../shared-config devDependencies: '@rspack/core': - specifier: ^0.3.0 - version: 0.3.0(webpack@5.88.2) + specifier: 0.4.3 + version: 0.4.3 packages/runtime: dependencies: @@ -2318,7 +2365,7 @@ importers: packages/shared-config: dependencies: '@ice/bundles': - specifier: 0.1.17 + specifier: 0.2.0 version: link:../bundles '@rollup/pluginutils': specifier: ^4.2.0 @@ -2346,7 +2393,7 @@ importers: specifier: ^5.86.0 version: 5.86.0(esbuild@0.17.16) webpack-dev-server: - specifier: ^4.7.4 + specifier: 4.15.0 version: 4.15.0(webpack@5.86.0) packages/style-import: @@ -2361,10 +2408,10 @@ importers: packages/webpack-config: dependencies: '@ice/bundles': - specifier: 0.1.17 + specifier: 0.2.0 version: link:../bundles '@ice/shared-config': - specifier: 1.1.2 + specifier: 1.2.0 version: link:../shared-config fast-glob: specifier: ^3.2.11 @@ -2609,8 +2656,8 @@ packages: universal-transition: 1.1.1 dev: false - /@alifd/meet-react@2.9.6(rax@1.2.3)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-c1ODwaGKwXoxT633M8Tz+HEGVYCEGZx4sItg3yOcKjQ7vAbZYbTbjvz6mD/BcC6b/jNTm4uFqAsXiJVSVjPxCA==} + /@alifd/meet-react@2.9.7(rax@1.2.3)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-OiIvw7XFwKNEUU2nOuwB/yoddrk118Dpagii7Hn9+vHxucrUuwfY00uY6pW/Z7MbwPwjQBJYiuCdFWHX/9ZFbQ==} peerDependencies: react: '>=16.0.0' react-dom: '>=16.0.0' @@ -2638,7 +2685,7 @@ packages: - rax dev: false - /@alifd/next@1.26.2(@alifd/meet-react@2.9.6)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0): + /@alifd/next@1.26.2(@alifd/meet-react@2.9.7)(moment@2.29.4)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Qz7mJ50lMg3h4yWhV0uIJKzYV4O0zJGN/dZa6xU9+26Yu2VUKMECCcoxBRyiCXVdSNb3XPsLKE8/37R0fw8CGg==} peerDependencies: '@alifd/meet-react': ^2.0.0 @@ -2647,7 +2694,7 @@ packages: react-dom: '>=16.0.0' dependencies: '@alifd/field': 1.5.8 - '@alifd/meet-react': 2.9.6(rax@1.2.3)(react-dom@18.2.0)(react@18.2.0) + '@alifd/meet-react': 2.9.7(rax@1.2.3)(react-dom@18.2.0)(react@18.2.0) '@alifd/overlay': 0.2.12 '@alifd/validate': 1.2.3 babel-runtime: 6.26.0 @@ -2920,7 +2967,7 @@ packages: '@babel/parser': 7.18.10 '@babel/template': 7.20.7 '@babel/traverse': 7.18.10 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -2994,7 +3041,7 @@ packages: resolution: {integrity: sha512-0+sW7e3HjQbiHbj1NeU/vN8ornohYlacAfZIaXhdoGweQqgcNy69COVciYYqEXJ/v+9OBA7Frxm4CVAuNqKeNA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 '@jridgewell/gen-mapping': 0.3.2 jsesc: 2.5.2 @@ -3034,7 +3081,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-explode-assignable-expression': 7.18.6 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 /@babel/helper-compilation-targets@7.20.7(@babel/core@7.21.0): resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} @@ -3132,7 +3179,7 @@ packages: resolution: {integrity: sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 /@babel/helper-function-name@7.21.0: resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} @@ -3164,7 +3211,7 @@ packages: resolution: {integrity: sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 /@babel/helper-member-expression-to-functions@7.23.0: resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} @@ -3217,7 +3264,7 @@ packages: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 /@babel/helper-optimise-call-expression@7.22.5: resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} @@ -3248,7 +3295,7 @@ packages: '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-wrap-function': 7.20.5 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 transitivePeerDependencies: - supports-color @@ -3261,7 +3308,7 @@ packages: '@babel/helper-optimise-call-expression': 7.18.6 '@babel/template': 7.20.7 '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 transitivePeerDependencies: - supports-color @@ -3293,7 +3340,7 @@ packages: resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 /@babel/helper-skip-transparent-expression-wrappers@7.22.5: resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} @@ -3345,7 +3392,7 @@ packages: '@babel/helper-function-name': 7.21.0 '@babel/template': 7.20.7 '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 transitivePeerDependencies: - supports-color @@ -6024,6 +6071,14 @@ packages: requiresBuild: true optional: true + /@esbuild/android-arm@0.15.18: + resolution: {integrity: sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + optional: true + /@esbuild/android-arm@0.16.17: resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==} engines: {node: '>=12'} @@ -6183,6 +6238,15 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.15.18: + resolution: {integrity: sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-loong64@0.16.17: @@ -6591,6 +6655,81 @@ packages: '@ice/css-modules-hash-win32-x64-msvc': 0.0.6 dev: false + /@ice/pack-binding-darwin-arm64@0.0.4: + resolution: {integrity: sha512-OtzGietfQqrE24l+fq4Zt3azY/ZN9GYMfqtFIPmD4OhHdZdBsMj15ycQAu8U35kVI3nRiirYaXkRpysE5Gq98Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding-darwin-universal@0.0.4: + resolution: {integrity: sha512-M6Hf6YyEIEQ6h6ZyX7XsKafnmnch+o4yb4pgRjZFFvdwqToeNj8jHnPSQdnlWXE9vbdGmhAZopJvNPnljDNRmg==} + engines: {node: '>= 10'} + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding-darwin-x64@0.0.4: + resolution: {integrity: sha512-CrnjirRVTng69R5/xgLLETxkH3Vp5wbTWY5BRxQZf3Cd5lIOfsQao4R1Z7tYn5eJ5Huqp20C7ZB/r4By1EgcSg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding-linux-x64-gnu@0.0.4: + resolution: {integrity: sha512-WghzIXix7a1k+z3gPqbIf3S/I9PZXMgFiIvQ409IB8VFwI3pzY3OLqlRISkXZMWIB4u0J1qU+h4Ka/V11HLmzA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding-linux-x64-musl@0.0.4: + resolution: {integrity: sha512-8hkrcS1uicN3JLKS15ODmFxiveSLnHGt2bWjoXTEUmQDxjPZXyevS9oys/WvO8a2Cew5UadI/lgzFGmYZbm9mQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding-win32-arm64-msvc@0.0.4: + resolution: {integrity: sha512-lIl+h3jUHp8DXxPy0U+abM6+uWeIshUNNebBpRUpUqO3TtUcbgfwFU4HkAeQv/ef/xAUY/XzRvotJgtt4SZjPQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding-win32-x64-msvc@0.0.4: + resolution: {integrity: sha512-4N9dMY1bD4k7uTABHKgb0ylZeo6grJU3QHXxBxJMwHyXtGsC6mKzsVWyuTr8rOPm+nEGyy699Zv53YWNLdv8dw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@ice/pack-binding@0.0.4: + resolution: {integrity: sha512-JKt4IcsqdIF2TuWFHh99fdQWoC55z+WgID9Psa+8fYexVAsArpQhXkxAGweiw6ilFTOFqUcRBwQG91oJxGZ3eQ==} + engines: {node: '>= 10'} + optionalDependencies: + '@ice/pack-binding-darwin-arm64': 0.0.4 + '@ice/pack-binding-darwin-universal': 0.0.4 + '@ice/pack-binding-darwin-x64': 0.0.4 + '@ice/pack-binding-linux-x64-gnu': 0.0.4 + '@ice/pack-binding-linux-x64-musl': 0.0.4 + '@ice/pack-binding-win32-arm64-msvc': 0.0.4 + '@ice/pack-binding-win32-x64-msvc': 0.0.4 + dev: false + /@ice/pkg@1.5.5: resolution: {integrity: sha512-0BIfv6Uzs2wpHv7RmFwz+kWfoJLfx0yJrQyh3yqy+F6TZWxTwrqQmX+5yRmgqK5f7lGGhYfMMVNWjRSCw5MHPQ==} engines: {node: '>=16.14.0'} @@ -7453,85 +7592,6 @@ packages: resolution: {integrity: sha512-5gc02Pu1HycOVUWJ8aYsWeeXcSTPe8iX8+KIrhyEtEoOSkY0eMBuo0ssljB8wALuEmepv31DlYe5gpiRwkjESA==} dev: true - /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.11.1)(webpack@5.88.2): - resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} - engines: {node: '>= 10.13'} - peerDependencies: - '@types/webpack': 4.x || 5.x - react-refresh: '>=0.10.0 <1.0.0' - sockjs-client: ^1.4.0 - type-fest: '>=0.17.0 <4.0.0' - webpack: '>=4.43.0 <6.0.0' - webpack-dev-server: 3.x || 4.x - webpack-hot-middleware: 2.x - webpack-plugin-serve: 0.x || 1.x - peerDependenciesMeta: - '@types/webpack': - optional: true - sockjs-client: - optional: true - type-fest: - optional: true - webpack-dev-server: - optional: true - webpack-hot-middleware: - optional: true - webpack-plugin-serve: - optional: true - dependencies: - ansi-html-community: 0.0.8 - common-path-prefix: 3.0.0 - core-js-pure: 3.29.0 - error-stack-parser: 2.1.4 - find-up: 5.0.0 - html-entities: 2.3.3 - loader-utils: 2.0.4 - react-refresh: 0.14.0 - schema-utils: 3.1.1 - source-map: 0.7.4 - webpack: 5.88.2(esbuild@0.17.16) - webpack-dev-server: 4.11.1(webpack@5.88.2) - dev: true - - /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0): - resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} - engines: {node: '>= 10.13'} - peerDependencies: - '@types/webpack': 4.x || 5.x - react-refresh: '>=0.10.0 <1.0.0' - sockjs-client: ^1.4.0 - type-fest: '>=0.17.0 <4.0.0' - webpack: '>=4.43.0 <6.0.0' - webpack-dev-server: 3.x || 4.x - webpack-hot-middleware: 2.x - webpack-plugin-serve: 0.x || 1.x - peerDependenciesMeta: - '@types/webpack': - optional: true - sockjs-client: - optional: true - type-fest: - optional: true - webpack-dev-server: - optional: true - webpack-hot-middleware: - optional: true - webpack-plugin-serve: - optional: true - dependencies: - ansi-html-community: 0.0.8 - common-path-prefix: 3.0.0 - core-js-pure: 3.29.0 - error-stack-parser: 2.1.4 - find-up: 5.0.0 - html-entities: 2.3.3 - loader-utils: 2.0.4 - react-refresh: 0.14.0 - schema-utils: 3.1.1 - source-map: 0.7.4 - webpack: 5.76.0(@swc/core@1.3.80)(esbuild@0.17.16) - webpack-dev-server: 4.13.1(webpack@5.76.0) - /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.15.0)(webpack@5.88.2): resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} engines: {node: '>= 10.13'} @@ -7570,44 +7630,6 @@ packages: source-map: 0.7.4 webpack: 5.88.2(@swc/core@1.3.80)(esbuild@0.17.16) webpack-dev-server: 4.15.0(webpack@5.88.2) - - /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack@5.88.2): - resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} - engines: {node: '>= 10.13'} - peerDependencies: - '@types/webpack': 4.x || 5.x - react-refresh: '>=0.10.0 <1.0.0' - sockjs-client: ^1.4.0 - type-fest: '>=0.17.0 <4.0.0' - webpack: '>=4.43.0 <6.0.0' - webpack-dev-server: 3.x || 4.x - webpack-hot-middleware: 2.x - webpack-plugin-serve: 0.x || 1.x - peerDependenciesMeta: - '@types/webpack': - optional: true - sockjs-client: - optional: true - type-fest: - optional: true - webpack-dev-server: - optional: true - webpack-hot-middleware: - optional: true - webpack-plugin-serve: - optional: true - dependencies: - ansi-html-community: 0.0.8 - common-path-prefix: 3.0.0 - core-js-pure: 3.29.0 - error-stack-parser: 2.1.4 - find-up: 5.0.0 - html-entities: 2.3.3 - loader-utils: 2.0.4 - react-refresh: 0.14.0 - schema-utils: 3.1.1 - source-map: 0.7.4 - webpack: 5.88.2 dev: true /@polka/url@1.0.0-next.21: @@ -7890,8 +7912,8 @@ packages: rollup: 2.79.1 dev: true - /@rollup/pluginutils@5.0.5: - resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} + /@rollup/pluginutils@5.1.0: + resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -7903,255 +7925,121 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 - /@rspack/binding-darwin-arm64@0.3.0: - resolution: {integrity: sha512-VJ/UR4SlW6P7N3z/EdmQMedbH6qS6rtS/SvEOeugUMx5xUL3UC4TSmA37HWYcDGVXdalqhIFskud3LaGlTEYyg==} + /@rspack/binding-darwin-arm64@0.4.3: + resolution: {integrity: sha512-H/MW5oWawFY45OM+ePRELBueDlAusAMTaztn54AB1CRXyhLteyeX9luQv6+Fe1TDHeDfv27NL+eNTfO0+YJeZg==} cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true - /@rspack/binding-darwin-x64@0.3.0: - resolution: {integrity: sha512-rxxam1EHXQ6Ex2XMJW5Zyxy0irB6KOZ+34fzkpFiop8rDvxxr2x16TAPxQzolgJNsq/6NLKkspzmrbQpkP6BLQ==} + /@rspack/binding-darwin-x64@0.4.3: + resolution: {integrity: sha512-m/XiTWbsrJ45sFTD+I3P9V7OT9sNx4+RW6PbS28n9yvPflrx5TX6r9WjFnFD6RJcPnt81hvO6oOE3LDO5LPvAw==} cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-arm64-gnu@0.3.0: - resolution: {integrity: sha512-JIq1ehp2oDOURoSiad+EyHWUD+CPReWxnvTgAUUHjNAH6mnGmJCMl3031/2lq1c9ZsH0yve36MzfTZa42K8gKw==} + /@rspack/binding-linux-arm64-gnu@0.4.3: + resolution: {integrity: sha512-t7wbd5NbZ5H3LeiUGZey0CKJdJWluu/iqdecnoPDEbXRdF7caev9OAJuQ9fKEsK4uQHQLvQ0/pjFDyDbJbPG5w==} cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-arm64-musl@0.3.0: - resolution: {integrity: sha512-GhyAj3laN69Kxu6qoane7nteCemVvqn6oKAB7edqfav4/Xq0DGRtlumAFR2ooShw4KpRI9I0keAZ5LDefAFc2Q==} + /@rspack/binding-linux-arm64-musl@0.4.3: + resolution: {integrity: sha512-VlqXmsgft9LeYxWm8bZB16f/SZE7xLaHgDwFR6KCFLhubPRnF7gvxLf/y8FAtZzV+9XDi7mhfLWHMyJJDqwFBQ==} cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-x64-gnu@0.3.0: - resolution: {integrity: sha512-tQdVXLnulhnhFYtN+r5ZZTNQyS8ErbEvC1efN7P7DSNOU3XRcL5WFzvlcY2KVtZyjmg3Z0xSoDbpYwQ7GAMHKQ==} + /@rspack/binding-linux-x64-gnu@0.4.3: + resolution: {integrity: sha512-7eGymsvYsHz/P1mvUo1O+UJqrFzlMXY41599UWRiX4M3tX/pvDtLvxxjZ3JHVvNzEaBCiQ5xyRzqhhRDzcj4ww==} cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-linux-x64-musl@0.3.0: - resolution: {integrity: sha512-/XvTDvslEjPoCb8BICbKjXKAKO/dNOlIdTzZL7cXYfOrJSxIFpsWen4txNxnky9ArVTw9TuDBQNfFAwi3Sq0kQ==} + /@rspack/binding-linux-x64-musl@0.4.3: + resolution: {integrity: sha512-16PptmbtvpGHtEfbLoQjWjhBXOykdQRHXxn3RUTpkEXFbmhLnvnXbfmfSRoBuVNR+j0BqCrGiwweO43VBceJPg==} cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true - /@rspack/binding-win32-arm64-msvc@0.3.0: - resolution: {integrity: sha512-IVjFLfHFMnCbHf6m/ARIi0AdHpaf5Y94NfkPMwODkhx1DOUZCG5L4oC6+4rBdWP9DlhREN+csq5kzgcpTWxuMg==} + /@rspack/binding-win32-arm64-msvc@0.4.3: + resolution: {integrity: sha512-q9Vsn9Glj6m24UQfXpxcirk5S8r1RmAShXxjF+yRrKqpOtq1IodLWWRZ85kQfJyfk9deAfVkpiqHdsoK54uqQQ==} cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true - /@rspack/binding-win32-ia32-msvc@0.3.0: - resolution: {integrity: sha512-83e1/M+x/LIq60C3tp84X3NoSylntOC608NVr7iuvZ6B+T2OhI3BO9x5MiIMiO8PAt5yu1+fGmXIB/8u8bWY+g==} + /@rspack/binding-win32-ia32-msvc@0.4.3: + resolution: {integrity: sha512-jY6RiFwKQQjX3QR28K7boydBIhWKgAcGlDR+p4KnDSciF0H19ImT9QAf31Wcj2+XjN0wRev58cHRI2tgRw2+cw==} cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true - /@rspack/binding-win32-x64-msvc@0.3.0: - resolution: {integrity: sha512-2ZoYG3+wjoySq0QCQpgt5UWUH6ouJYR6g/ZHgcLOUGRPsEfu9obfIKisH2et/Ozh4ttAiKHfvkpiyGwZmDvZ7Q==} + /@rspack/binding-win32-x64-msvc@0.4.3: + resolution: {integrity: sha512-tZySo3ZZptxjuR0DDYQWQATUf5ApdDH7lQBezum/q5kzKVFFHN963JnInPHEO1wUtNXaTWXcx31habZTBrse/A==} cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true - /@rspack/binding@0.3.0: - resolution: {integrity: sha512-DfnWZT2qPt4YV5tcWzdzbPDnNj1qAXYVmd+oW2Sl1EzoWPNV/ibMEjDFKVEmq1UIA/XvRlz3ZgVXw1AgTi1mhw==} + /@rspack/binding@0.4.3: + resolution: {integrity: sha512-cw7Sca7YL9FeSTWdYahxr6HgWXnboOgPiM5SJai2Nfj6c/PWJV+ntBZbIW0LRY1fFDL7dYz3GUCXj4Dv3QYc8A==} optionalDependencies: - '@rspack/binding-darwin-arm64': 0.3.0 - '@rspack/binding-darwin-x64': 0.3.0 - '@rspack/binding-linux-arm64-gnu': 0.3.0 - '@rspack/binding-linux-arm64-musl': 0.3.0 - '@rspack/binding-linux-x64-gnu': 0.3.0 - '@rspack/binding-linux-x64-musl': 0.3.0 - '@rspack/binding-win32-arm64-msvc': 0.3.0 - '@rspack/binding-win32-ia32-msvc': 0.3.0 - '@rspack/binding-win32-x64-msvc': 0.3.0 - - /@rspack/core@0.3.0(webpack-dev-server@4.11.1)(webpack@5.88.2): - resolution: {integrity: sha512-YltE0AQimUMOSTIFuDP+BW2GoJsabrig/GmgCR1eDWlVeKlmGJ6wd2GdYjmW5TWdH6FBQPQ3YfU8GOB4XWsvgQ==} - dependencies: - '@rspack/binding': 0.3.0 - '@rspack/dev-client': 0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.11.1)(webpack@5.88.2) + '@rspack/binding-darwin-arm64': 0.4.3 + '@rspack/binding-darwin-x64': 0.4.3 + '@rspack/binding-linux-arm64-gnu': 0.4.3 + '@rspack/binding-linux-arm64-musl': 0.4.3 + '@rspack/binding-linux-x64-gnu': 0.4.3 + '@rspack/binding-linux-x64-musl': 0.4.3 + '@rspack/binding-win32-arm64-msvc': 0.4.3 + '@rspack/binding-win32-ia32-msvc': 0.4.3 + '@rspack/binding-win32-x64-msvc': 0.4.3 + dev: true + + /@rspack/core@0.4.3: + resolution: {integrity: sha512-YKzOOt6v6vZZH15+HdwWbd7DdXdXIJLlYQdQ6jgrAK7/X+5qg99MUgsfra3k+MXXX0vWROOy8mM6/dBaaDb7tg==} + engines: {node: '>=16.0.0'} + dependencies: + '@rspack/binding': 0.4.3 '@swc/helpers': 0.5.1 - browserslist: 4.21.5 - compare-versions: 6.0.0-rc.1 - enhanced-resolve: 5.12.0 - graceful-fs: 4.2.10 - neo-async: 2.6.2 - react-refresh: 0.14.0 - schema-utils: 4.0.0 - tapable: 2.2.1 - util: 0.12.5 - watchpack: 2.4.0 - webpack-sources: 3.2.3 - zod: 3.21.4 - zod-validation-error: 1.2.0(zod@3.21.4) - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - - /@rspack/core@0.3.0(webpack-dev-server@4.15.0)(webpack@5.88.2): - resolution: {integrity: sha512-YltE0AQimUMOSTIFuDP+BW2GoJsabrig/GmgCR1eDWlVeKlmGJ6wd2GdYjmW5TWdH6FBQPQ3YfU8GOB4XWsvgQ==} - dependencies: - '@rspack/binding': 0.3.0 - '@rspack/dev-client': 0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.15.0)(webpack@5.88.2) - '@swc/helpers': 0.5.1 - browserslist: 4.21.5 - compare-versions: 6.0.0-rc.1 - enhanced-resolve: 5.12.0 - graceful-fs: 4.2.10 - neo-async: 2.6.2 - react-refresh: 0.14.0 - schema-utils: 4.0.0 - tapable: 2.2.1 - util: 0.12.5 - watchpack: 2.4.0 - webpack-sources: 3.2.3 - zod: 3.21.4 - zod-validation-error: 1.2.0(zod@3.21.4) - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: false - - /@rspack/core@0.3.0(webpack@5.88.2): - resolution: {integrity: sha512-YltE0AQimUMOSTIFuDP+BW2GoJsabrig/GmgCR1eDWlVeKlmGJ6wd2GdYjmW5TWdH6FBQPQ3YfU8GOB4XWsvgQ==} - dependencies: - '@rspack/binding': 0.3.0 - '@rspack/dev-client': 0.3.0(react-refresh@0.14.0)(webpack@5.88.2) - '@swc/helpers': 0.5.1 - browserslist: 4.21.5 + browserslist: 4.22.1 compare-versions: 6.0.0-rc.1 enhanced-resolve: 5.12.0 + fast-querystring: 1.1.2 graceful-fs: 4.2.10 + json-parse-even-better-errors: 3.0.0 neo-async: 2.6.2 react-refresh: 0.14.0 - schema-utils: 4.0.0 tapable: 2.2.1 - util: 0.12.5 + terminal-link: 2.1.1 watchpack: 2.4.0 webpack-sources: 3.2.3 zod: 3.21.4 - zod-validation-error: 1.2.0(zod@3.21.4) - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - - /@rspack/dev-client@0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.11.1)(webpack@5.88.2): - resolution: {integrity: sha512-nttTUBVctbh9auvPq91ThmjNDcBLj3kfLDjM/O1jBYA3xTz9MNsTN3rInLOb4S2fWEsSBLz7CVsNLP7LWtUecA==} - peerDependencies: - react-refresh: '>=0.10.0 <1.0.0' - peerDependenciesMeta: - react-refresh: - optional: true - dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.11.1)(webpack@5.88.2) - react-refresh: 0.14.0 - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve + zod-validation-error: 1.3.1(zod@3.21.4) dev: true - /@rspack/dev-client@0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0): - resolution: {integrity: sha512-nttTUBVctbh9auvPq91ThmjNDcBLj3kfLDjM/O1jBYA3xTz9MNsTN3rInLOb4S2fWEsSBLz7CVsNLP7LWtUecA==} - peerDependencies: - react-refresh: '>=0.10.0 <1.0.0' - peerDependenciesMeta: - react-refresh: - optional: true - dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0) - react-refresh: 0.14.0 - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - - /@rspack/dev-client@0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.15.0)(webpack@5.88.2): - resolution: {integrity: sha512-nttTUBVctbh9auvPq91ThmjNDcBLj3kfLDjM/O1jBYA3xTz9MNsTN3rInLOb4S2fWEsSBLz7CVsNLP7LWtUecA==} - peerDependencies: - react-refresh: '>=0.10.0 <1.0.0' - peerDependenciesMeta: - react-refresh: - optional: true - dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.15.0)(webpack@5.88.2) - react-refresh: 0.14.0 - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: false - - /@rspack/dev-client@0.3.0(react-refresh@0.14.0)(webpack@5.88.2): - resolution: {integrity: sha512-nttTUBVctbh9auvPq91ThmjNDcBLj3kfLDjM/O1jBYA3xTz9MNsTN3rInLOb4S2fWEsSBLz7CVsNLP7LWtUecA==} - peerDependencies: - react-refresh: '>=0.10.0 <1.0.0' - peerDependenciesMeta: - react-refresh: - optional: true - dependencies: - '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack@5.88.2) - react-refresh: 0.14.0 - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - type-fest - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - - /@rspack/dev-server@0.3.0(@rspack/core@0.3.0)(@swc/core@1.3.80)(esbuild@0.17.16)(react-refresh@0.14.0): - resolution: {integrity: sha512-aKY1mUP1PdOWXDvxpUA14mEE7p+IFYnU67i7cAUh361z2/v5KbCTngt521ly8H1LqJv3SJIoEXqSqNc8c62Dsg==} + /@rspack/dev-server@0.4.3(@rspack/core@0.4.3)(@swc/core@1.3.80)(esbuild@0.17.16)(react-refresh@0.14.0): + resolution: {integrity: sha512-qbggWEySoWdCrbWxqV+HX7nXgyT6qE3DqGtdYKzX9RLPp+RilXtnPlXtwY1AXNh8e0gYe1dMpvTcHYxeSglZSg==} peerDependencies: '@rspack/core': '*' dependencies: - '@rspack/core': 0.3.0(webpack-dev-server@4.15.0)(webpack@5.88.2) - '@rspack/dev-client': 0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0) + '@rspack/core': 0.4.3 + '@rspack/plugin-react-refresh': 0.4.3(react-refresh@0.14.0) chokidar: 3.5.3 connect-history-api-fallback: 2.0.0 express: 4.18.1 @@ -8164,28 +8052,23 @@ packages: transitivePeerDependencies: - '@swc/core' - '@types/express' - - '@types/webpack' - bufferutil - debug - esbuild - react-refresh - - sockjs-client - supports-color - - type-fest - uglify-js - utf-8-validate - webpack-cli - - webpack-hot-middleware - - webpack-plugin-serve - dev: false + dev: true - /@rspack/dev-server@0.3.0(@rspack/core@0.3.0)(@types/express@4.17.17)(esbuild@0.17.16)(react-refresh@0.14.0): - resolution: {integrity: sha512-aKY1mUP1PdOWXDvxpUA14mEE7p+IFYnU67i7cAUh361z2/v5KbCTngt521ly8H1LqJv3SJIoEXqSqNc8c62Dsg==} + /@rspack/dev-server@0.4.3(@rspack/core@0.4.3)(@types/express@4.17.17)(esbuild@0.17.16): + resolution: {integrity: sha512-qbggWEySoWdCrbWxqV+HX7nXgyT6qE3DqGtdYKzX9RLPp+RilXtnPlXtwY1AXNh8e0gYe1dMpvTcHYxeSglZSg==} peerDependencies: '@rspack/core': '*' dependencies: - '@rspack/core': 0.3.0(webpack-dev-server@4.11.1)(webpack@5.88.2) - '@rspack/dev-client': 0.3.0(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0) + '@rspack/core': 0.4.3 + '@rspack/plugin-react-refresh': 0.4.3(react-refresh@0.14.0) chokidar: 3.5.3 connect-history-api-fallback: 2.0.0 express: 4.18.1 @@ -8198,19 +8081,25 @@ packages: transitivePeerDependencies: - '@swc/core' - '@types/express' - - '@types/webpack' - bufferutil - debug - esbuild - react-refresh - - sockjs-client - supports-color - - type-fest - uglify-js - utf-8-validate - webpack-cli - - webpack-hot-middleware - - webpack-plugin-serve + dev: true + + /@rspack/plugin-react-refresh@0.4.3(react-refresh@0.14.0): + resolution: {integrity: sha512-JWzlqFZKta87AuaDWpG1XAeF5sG2yTWjm86yevHE0yIHsj/Xy+EFwGwoKHPWg884vzKzzlyLbB8yikgdv8YvJA==} + peerDependencies: + react-refresh: '>=0.10.0 <1.0.0' + peerDependenciesMeta: + react-refresh: + optional: true + dependencies: + react-refresh: 0.14.0 dev: true /@sideway/address@4.1.4: @@ -8435,7 +8324,7 @@ packages: resolution: {integrity: sha512-1hnUxxjd83EAxbL4a0JDJoD3Dao3hmjvyvyEV8PzWmLK3B9m9NPlW7GKjFyoWE8nM7HnXzPcmmSyOW8yOddSXw==} engines: {node: '>=10'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 entities: 4.4.0 /@svgr/plugin-jsx@5.5.0: @@ -8819,7 +8708,7 @@ packages: resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} dependencies: '@babel/parser': 7.21.2 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.18.3 @@ -8835,7 +8724,7 @@ packages: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: '@babel/parser': 7.21.2 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 dev: true /@types/babel__traverse@7.18.3: @@ -8932,6 +8821,7 @@ packages: /@types/estree@0.0.51: resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} + dev: true /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} @@ -9306,7 +9196,7 @@ packages: /@types/ws@8.5.4: resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} dependencies: - '@types/node': 18.14.6 + '@types/node': 17.0.45 /@types/yargs-parser@21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} @@ -9510,7 +9400,7 @@ packages: '@uni/action-sheet': 1.0.8 dev: false - /@unocss/astro@0.57.6(vite@2.9.16): + /@unocss/astro@0.57.6(vite@3.2.5): resolution: {integrity: sha512-7NIGMg9ZHlWWeZoOFzruKQh6sz+wKtRN8ioiAOxIYVtULCoazfjhfzhiWcmyiHWVgrZ0TyUep/nz5cRumNBrQw==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 @@ -9520,8 +9410,8 @@ packages: dependencies: '@unocss/core': 0.57.6 '@unocss/reset': 0.57.6 - '@unocss/vite': 0.57.6(vite@2.9.16) - vite: 2.9.16 + '@unocss/vite': 0.57.6(vite@3.2.5) + vite: 3.2.5(@types/node@17.0.45) transitivePeerDependencies: - rollup dev: false @@ -9532,7 +9422,7 @@ packages: hasBin: true dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.0.5 + '@rollup/pluginutils': 5.1.0 '@unocss/config': 0.57.6 '@unocss/core': 0.57.6 '@unocss/preset-uno': 0.57.6 @@ -9704,13 +9594,13 @@ packages: '@unocss/core': 0.57.6 dev: false - /@unocss/vite@0.57.6(vite@2.9.16): + /@unocss/vite@0.57.6(vite@3.2.5): resolution: {integrity: sha512-sVVKhFCYDFCR+In8HXJ5ddnD+OnFw/3BcLoV3aRvIloojkDCG8rUywxS67TNu40LBZ8E+emFMcreDCFpwqphDA==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.0.5 + '@rollup/pluginutils': 5.1.0 '@unocss/config': 0.57.6 '@unocss/core': 0.57.6 '@unocss/inspector': 0.57.6 @@ -9719,7 +9609,7 @@ packages: chokidar: 3.5.3 fast-glob: 3.3.2 magic-string: 0.30.5 - vite: 2.9.16 + vite: 3.2.5(@types/node@17.0.45) transitivePeerDependencies: - rollup dev: false @@ -9730,13 +9620,13 @@ packages: webpack: ^4 || ^5 dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.0.5 + '@rollup/pluginutils': 5.1.0 '@unocss/config': 0.57.6 '@unocss/core': 0.57.6 chokidar: 3.5.3 fast-glob: 3.3.2 magic-string: 0.30.5 - unplugin: 1.5.1 + unplugin: 1.5.1(patch_hash=eanypstkeladyqkfllfbryx6lu) webpack: 5.88.2 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -9791,7 +9681,9 @@ packages: - less - sass - stylus + - sugarss - supports-color + - terser dev: true /@web3-storage/multipart-parser@1.0.0: @@ -9803,6 +9695,7 @@ packages: dependencies: '@webassemblyjs/helper-numbers': 1.11.1 '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + dev: true /@webassemblyjs/ast@1.11.5: resolution: {integrity: sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ==} @@ -9812,18 +9705,21 @@ packages: /@webassemblyjs/floating-point-hex-parser@1.11.1: resolution: {integrity: sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==} + dev: true /@webassemblyjs/floating-point-hex-parser@1.11.5: resolution: {integrity: sha512-1j1zTIC5EZOtCplMBG/IEwLtUojtwFVwdyVMbL/hwWqbzlQoJsWCOavrdnLkemwNoC/EOwtUFch3fuo+cbcXYQ==} /@webassemblyjs/helper-api-error@1.11.1: resolution: {integrity: sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==} + dev: true /@webassemblyjs/helper-api-error@1.11.5: resolution: {integrity: sha512-L65bDPmfpY0+yFrsgz8b6LhXmbbs38OnwDCf6NpnMUYqa+ENfE5Dq9E42ny0qz/PdR0LJyq/T5YijPnU8AXEpA==} /@webassemblyjs/helper-buffer@1.11.1: resolution: {integrity: sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==} + dev: true /@webassemblyjs/helper-buffer@1.11.5: resolution: {integrity: sha512-fDKo1gstwFFSfacIeH5KfwzjykIE6ldh1iH9Y/8YkAZrhmu4TctqYjSh7t0K2VyDSXOZJ1MLhht/k9IvYGcIxg==} @@ -9834,6 +9730,7 @@ packages: '@webassemblyjs/floating-point-hex-parser': 1.11.1 '@webassemblyjs/helper-api-error': 1.11.1 '@xtuc/long': 4.2.2 + dev: true /@webassemblyjs/helper-numbers@1.11.5: resolution: {integrity: sha512-DhykHXM0ZABqfIGYNv93A5KKDw/+ywBFnuWybZZWcuzWHfbp21wUfRkbtz7dMGwGgT4iXjWuhRMA2Mzod6W4WA==} @@ -9844,6 +9741,7 @@ packages: /@webassemblyjs/helper-wasm-bytecode@1.11.1: resolution: {integrity: sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==} + dev: true /@webassemblyjs/helper-wasm-bytecode@1.11.5: resolution: {integrity: sha512-oC4Qa0bNcqnjAowFn7MPCETQgDYytpsfvz4ujZz63Zu/a/v71HeCAAmZsgZ3YVKec3zSPYytG3/PrRCqbtcAvA==} @@ -9855,6 +9753,7 @@ packages: '@webassemblyjs/helper-buffer': 1.11.1 '@webassemblyjs/helper-wasm-bytecode': 1.11.1 '@webassemblyjs/wasm-gen': 1.11.1 + dev: true /@webassemblyjs/helper-wasm-section@1.11.5: resolution: {integrity: sha512-uEoThA1LN2NA+K3B9wDo3yKlBfVtC6rh0i4/6hvbz071E8gTNZD/pT0MsBf7MeD6KbApMSkaAK0XeKyOZC7CIA==} @@ -9868,6 +9767,7 @@ packages: resolution: {integrity: sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==} dependencies: '@xtuc/ieee754': 1.2.0 + dev: true /@webassemblyjs/ieee754@1.11.5: resolution: {integrity: sha512-37aGq6qVL8A8oPbPrSGMBcp38YZFXcHfiROflJn9jxSdSMMM5dS5P/9e2/TpaJuhE+wFrbukN2WI6Hw9MH5acg==} @@ -9878,6 +9778,7 @@ packages: resolution: {integrity: sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==} dependencies: '@xtuc/long': 4.2.2 + dev: true /@webassemblyjs/leb128@1.11.5: resolution: {integrity: sha512-ajqrRSXaTJoPW+xmkfYN6l8VIeNnR4vBOTQO9HzR7IygoCcKWkICbKFbVTNMjMgMREqXEr0+2M6zukzM47ZUfQ==} @@ -9886,6 +9787,7 @@ packages: /@webassemblyjs/utf8@1.11.1: resolution: {integrity: sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==} + dev: true /@webassemblyjs/utf8@1.11.5: resolution: {integrity: sha512-WiOhulHKTZU5UPlRl53gHR8OxdGsSOxqfpqWeA2FmcwBMaoEdz6b2x2si3IwC9/fSPLfe8pBMRTHVMk5nlwnFQ==} @@ -9901,6 +9803,7 @@ packages: '@webassemblyjs/wasm-opt': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 '@webassemblyjs/wast-printer': 1.11.1 + dev: true /@webassemblyjs/wasm-edit@1.11.5: resolution: {integrity: sha512-C0p9D2fAu3Twwqvygvf42iGCQ4av8MFBLiTb+08SZ4cEdwzWx9QeAHDo1E2k+9s/0w1DM40oflJOpkZ8jW4HCQ==} @@ -9922,6 +9825,7 @@ packages: '@webassemblyjs/ieee754': 1.11.1 '@webassemblyjs/leb128': 1.11.1 '@webassemblyjs/utf8': 1.11.1 + dev: true /@webassemblyjs/wasm-gen@1.11.5: resolution: {integrity: sha512-14vteRlRjxLK9eSyYFvw1K8Vv+iPdZU0Aebk3j6oB8TQiQYuO6hj9s4d7qf6f2HJr2khzvNldAFG13CgdkAIfA==} @@ -9939,6 +9843,7 @@ packages: '@webassemblyjs/helper-buffer': 1.11.1 '@webassemblyjs/wasm-gen': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 + dev: true /@webassemblyjs/wasm-opt@1.11.5: resolution: {integrity: sha512-tcKwlIXstBQgbKy1MlbDMlXaxpucn42eb17H29rawYLxm5+MsEmgPzeCP8B1Cl69hCice8LeKgZpRUAPtqYPgw==} @@ -9957,6 +9862,7 @@ packages: '@webassemblyjs/ieee754': 1.11.1 '@webassemblyjs/leb128': 1.11.1 '@webassemblyjs/utf8': 1.11.1 + dev: true /@webassemblyjs/wasm-parser@1.11.5: resolution: {integrity: sha512-SVXUIwsLQlc8srSD7jejsfTU83g7pIGr2YYNb9oHdtldSxaOhvA5xwvIiWIfcX8PlSakgqMXsLpLfbbJ4cBYew==} @@ -9973,6 +9879,7 @@ packages: dependencies: '@webassemblyjs/ast': 1.11.1 '@xtuc/long': 4.2.2 + dev: true /@webassemblyjs/wast-printer@1.11.5: resolution: {integrity: sha512-f7Pq3wvg3GSPUPzR0F6bmI89Hdb+u9WXrSKc4v+N0aV0q6r42WoF92Jp2jEorBEBRoRNXgjp53nBniDXcqZYPA==} @@ -10029,7 +9936,7 @@ packages: /acorn-globals@7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: - acorn: 8.11.2 + acorn: 8.8.2 acorn-walk: 8.2.0 dev: true @@ -10046,13 +9953,14 @@ packages: acorn: ^8 dependencies: acorn: 8.8.2 + dev: true - /acorn-jsx@5.3.2(acorn@8.11.2): + /acorn-jsx@5.3.2(acorn@8.8.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.11.2 + acorn: 8.8.2 /acorn-node@1.8.2: resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==} @@ -10218,7 +10126,6 @@ packages: engines: {node: '>=8'} dependencies: type-fest: 0.21.3 - dev: true /ansi-escapes@6.0.0: resolution: {integrity: sha512-IG23inYII3dWlU2EyiAiGj6Bwal5GzsgPMwjYGvc1HPE2dgbj4ZB5ToWBKSquKw74nB3TIuOwaI6/jSULzfgrw==} @@ -10740,7 +10647,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@babel/template': 7.20.7 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 '@types/babel__core': 7.20.0 '@types/babel__traverse': 7.18.3 dev: true @@ -10750,7 +10657,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/template': 7.20.7 - '@babel/types': 7.21.2 + '@babel/types': 7.23.4 '@types/babel__core': 7.20.0 '@types/babel__traverse': 7.18.3 dev: true @@ -10961,6 +10868,7 @@ packages: unpipe: 1.0.0 transitivePeerDependencies: - supports-color + dev: true /body-parser@1.20.1: resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} @@ -11615,7 +11523,6 @@ packages: /colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - dev: false /combine-promises@1.1.0: resolution: {integrity: sha512-ZI9jvcLDxqwaXEixOhArm3r7ReIivsXkpbyEWyeOhzz1QS0iSgBPnWvEqvIQtYyamGCYA88gFhmUrs9hrrQ0pg==} @@ -11655,6 +11562,7 @@ packages: /common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} + dev: true /commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -11711,11 +11619,6 @@ packages: write-file-atomic: 3.0.3 xdg-basedir: 4.0.0 - /connect-history-api-fallback@1.6.0: - resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==} - engines: {node: '>=0.8'} - dev: true - /connect-history-api-fallback@2.0.0: resolution: {integrity: sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==} engines: {node: '>=0.8'} @@ -12902,14 +12805,6 @@ packages: graceful-fs: 4.2.10 tapable: 2.2.1 - /enhanced-resolve@5.14.1: - resolution: {integrity: sha512-Vklwq2vDKtl0y/vtwjSesgJ5MYS7Etuk5txS8VdKL4AOS1aUlD96zqIfsOSLQsdv3xgMRbtkWM8eG9XDfKUPow==} - engines: {node: '>=10.13.0'} - dependencies: - graceful-fs: 4.2.10 - tapable: 2.2.1 - dev: true - /enhanced-resolve@5.15.0: resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} engines: {node: '>=10.13.0'} @@ -13011,6 +12906,7 @@ packages: /es-module-lexer@0.9.3: resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==} + dev: true /es-module-lexer@1.2.0: resolution: {integrity: sha512-2BMfqBDeVCcOlLaL1ZAfp+D868SczNpKArrTM3dhpd7dK/OVlogzY15qpUngt+LMTq5UC/csb9vVQAgupucSbA==} @@ -13047,6 +12943,15 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true + optional: true + + /esbuild-android-64@0.15.18: + resolution: {integrity: sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true optional: true /esbuild-android-arm64@0.14.54: @@ -13055,6 +12960,15 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64@0.15.18: + resolution: {integrity: sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true optional: true /esbuild-darwin-64@0.14.54: @@ -13063,6 +12977,15 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64@0.15.18: + resolution: {integrity: sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true optional: true /esbuild-darwin-arm64@0.14.54: @@ -13071,6 +12994,15 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64@0.15.18: + resolution: {integrity: sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true optional: true /esbuild-freebsd-64@0.14.54: @@ -13079,6 +13011,15 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64@0.15.18: + resolution: {integrity: sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true optional: true /esbuild-freebsd-arm64@0.14.54: @@ -13087,6 +13028,15 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64@0.15.18: + resolution: {integrity: sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true optional: true /esbuild-linux-32@0.14.54: @@ -13095,6 +13045,15 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32@0.15.18: + resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true optional: true /esbuild-linux-64@0.14.54: @@ -13103,6 +13062,15 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64@0.15.18: + resolution: {integrity: sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true optional: true /esbuild-linux-arm64@0.14.54: @@ -13111,18 +13079,45 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64@0.15.18: + resolution: {integrity: sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true optional: true /esbuild-linux-arm@0.14.54: resolution: {integrity: sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==} engines: {node: '>=12'} - cpu: [arm] + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm@0.15.18: + resolution: {integrity: sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + optional: true + + /esbuild-linux-mips64le@0.14.54: + resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==} + engines: {node: '>=12'} + cpu: [mips64el] os: [linux] requiresBuild: true + dev: true optional: true - /esbuild-linux-mips64le@0.14.54: - resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==} + /esbuild-linux-mips64le@0.15.18: + resolution: {integrity: sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -13135,6 +13130,15 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le@0.15.18: + resolution: {integrity: sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true optional: true /esbuild-linux-riscv64@0.14.54: @@ -13143,6 +13147,15 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64@0.15.18: + resolution: {integrity: sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true optional: true /esbuild-linux-s390x@0.14.54: @@ -13151,6 +13164,15 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x@0.15.18: + resolution: {integrity: sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true optional: true /esbuild-netbsd-64@0.14.54: @@ -13159,6 +13181,15 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64@0.15.18: + resolution: {integrity: sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true optional: true /esbuild-openbsd-64@0.14.54: @@ -13167,6 +13198,15 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64@0.15.18: + resolution: {integrity: sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true optional: true /esbuild-register@3.4.1(esbuild@0.17.16): @@ -13186,6 +13226,15 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64@0.15.18: + resolution: {integrity: sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true optional: true /esbuild-windows-32@0.14.54: @@ -13194,6 +13243,15 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32@0.15.18: + resolution: {integrity: sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true optional: true /esbuild-windows-64@0.14.54: @@ -13202,6 +13260,15 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64@0.15.18: + resolution: {integrity: sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true optional: true /esbuild-windows-arm64@0.14.54: @@ -13210,6 +13277,15 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64@0.15.18: + resolution: {integrity: sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true optional: true /esbuild@0.14.54: @@ -13239,6 +13315,36 @@ packages: esbuild-windows-32: 0.14.54 esbuild-windows-64: 0.14.54 esbuild-windows-arm64: 0.14.54 + dev: true + + /esbuild@0.15.18: + resolution: {integrity: sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.15.18 + '@esbuild/linux-loong64': 0.15.18 + esbuild-android-64: 0.15.18 + esbuild-android-arm64: 0.15.18 + esbuild-darwin-64: 0.15.18 + esbuild-darwin-arm64: 0.15.18 + esbuild-freebsd-64: 0.15.18 + esbuild-freebsd-arm64: 0.15.18 + esbuild-linux-32: 0.15.18 + esbuild-linux-64: 0.15.18 + esbuild-linux-arm: 0.15.18 + esbuild-linux-arm64: 0.15.18 + esbuild-linux-mips64le: 0.15.18 + esbuild-linux-ppc64le: 0.15.18 + esbuild-linux-riscv64: 0.15.18 + esbuild-linux-s390x: 0.15.18 + esbuild-netbsd-64: 0.15.18 + esbuild-openbsd-64: 0.15.18 + esbuild-sunos-64: 0.15.18 + esbuild-windows-32: 0.15.18 + esbuild-windows-64: 0.15.18 + esbuild-windows-arm64: 0.15.18 /esbuild@0.16.17: resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} @@ -13609,8 +13715,8 @@ packages: resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) + acorn: 8.8.2 + acorn-jsx: 5.3.2(acorn@8.8.2) eslint-visitor-keys: 3.3.0 /esprima@4.0.1: @@ -13769,6 +13875,7 @@ packages: vary: 1.1.2 transitivePeerDependencies: - supports-color + dev: true /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} @@ -13859,6 +13966,9 @@ packages: engines: {'0': node >=0.6.0} dev: false + /fast-decode-uri-component@1.0.1: + resolution: {integrity: sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==} + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -13898,6 +14008,11 @@ packages: /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + /fast-querystring@1.1.2: + resolution: {integrity: sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==} + dependencies: + fast-decode-uri-component: 1.0.1 + /fast-url-parser@1.1.3: resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} dependencies: @@ -14809,7 +14924,7 @@ packages: he: 1.2.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.16.5 + terser: 5.14.2 /html-minifier@4.0.0: resolution: {integrity: sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==} @@ -15227,6 +15342,7 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 + dev: true /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} @@ -15336,6 +15452,7 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 + dev: true /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} @@ -16607,6 +16724,10 @@ packages: /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + /json-parse-even-better-errors@3.0.0: + resolution: {integrity: sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -19257,6 +19378,7 @@ packages: engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 + dev: true /qs@6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} @@ -21095,6 +21217,7 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 + dev: true /rollup@2.79.1: resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} @@ -21102,7 +21225,6 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 - dev: true /rtl-detect@1.0.4: resolution: {integrity: sha512-EBR4I2VDSSYr7PkBmFy04uhycIpDKp+21p/jARYXlCSjQksTBQcJ0HFUPOO79EPPH5JS6VAhiIQbycf0O3JAxQ==} @@ -22117,7 +22239,6 @@ packages: dependencies: has-flag: 4.0.0 supports-color: 7.2.0 - dev: true /supports-hyperlinks@3.0.0: resolution: {integrity: sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==} @@ -22288,7 +22409,6 @@ packages: dependencies: ansi-escapes: 4.3.2 supports-hyperlinks: 2.3.0 - dev: true /terser-webpack-plugin@5.3.5(@swc/core@1.3.80)(esbuild@0.17.16)(webpack@5.76.0): resolution: {integrity: sha512-AOEDLDxD2zylUGf/wxHxklEkOe2/r+seuyOWujejFrIxHf11brA1/dWQNIgXa1c6/Wkxgu7zvv0JhOWfc2ELEA==} @@ -22314,6 +22434,7 @@ packages: serialize-javascript: 6.0.1 terser: 5.14.2 webpack: 5.76.0(@swc/core@1.3.80)(esbuild@0.17.16) + dev: true /terser-webpack-plugin@5.3.5(@swc/core@1.3.80)(esbuild@0.17.16)(webpack@5.88.2): resolution: {integrity: sha512-AOEDLDxD2zylUGf/wxHxklEkOe2/r+seuyOWujejFrIxHf11brA1/dWQNIgXa1c6/Wkxgu7zvv0JhOWfc2ELEA==} @@ -22386,7 +22507,7 @@ packages: jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.1 - terser: 5.16.5 + terser: 5.14.2 webpack: 5.88.2 /terser-webpack-plugin@5.3.7(@swc/core@1.3.80)(esbuild@0.17.16)(webpack@5.88.2): @@ -22858,7 +22979,6 @@ packages: /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - dev: true /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} @@ -23004,7 +23124,7 @@ packages: /unimport@3.5.0: resolution: {integrity: sha512-0Ei1iTeSYxs7oxxUf79/KaBc2dPjZxe7qdVpw7yIz5YcdTZjmBYO6ToLDW+fX9QOHiueZ3xtwb5Z/wqaSfXx6A==} dependencies: - '@rollup/pluginutils': 5.0.5 + '@rollup/pluginutils': 5.1.0 escape-string-regexp: 5.0.0 fast-glob: 3.3.2 local-pkg: 0.5.0 @@ -23014,7 +23134,7 @@ packages: pkg-types: 1.0.3 scule: 1.1.0 strip-literal: 1.3.0 - unplugin: 1.5.0 + unplugin: 1.5.1(patch_hash=eanypstkeladyqkfllfbryx6lu) transitivePeerDependencies: - rollup dev: true @@ -23173,7 +23293,7 @@ packages: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} - /unocss@0.57.6(@unocss/webpack@0.57.6)(postcss@8.4.31)(vite@2.9.16): + /unocss@0.57.6(@unocss/webpack@0.57.6)(postcss@8.4.31)(vite@3.2.5): resolution: {integrity: sha512-z3a4Z8lGRVawr2A/1U0FuP1M9tuT6bs2RcIJ6kLBz5FC/XlLTGtUek6sadrKA0IMq7RWkgDRhdt8xQV0lh6TaA==} engines: {node: '>=14'} peerDependencies: @@ -23185,7 +23305,7 @@ packages: vite: optional: true dependencies: - '@unocss/astro': 0.57.6(vite@2.9.16) + '@unocss/astro': 0.57.6(vite@3.2.5) '@unocss/cli': 0.57.6 '@unocss/core': 0.57.6 '@unocss/extractor-arbitrary-variants': 0.57.6 @@ -23204,9 +23324,9 @@ packages: '@unocss/transformer-compile-class': 0.57.6 '@unocss/transformer-directives': 0.57.6 '@unocss/transformer-variant-group': 0.57.6 - '@unocss/vite': 0.57.6(vite@2.9.16) + '@unocss/vite': 0.57.6(vite@3.2.5) '@unocss/webpack': 0.57.6(webpack@5.88.2) - vite: 2.9.16 + vite: 3.2.5(@types/node@17.0.45) transitivePeerDependencies: - postcss - rollup @@ -23217,23 +23337,14 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - /unplugin@1.5.0: - resolution: {integrity: sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==} - dependencies: - acorn: 8.11.2 - chokidar: 3.5.3 - webpack-sources: 3.2.3 - webpack-virtual-modules: 0.5.0 - dev: true - - /unplugin@1.5.1: + /unplugin@1.5.1(patch_hash=eanypstkeladyqkfllfbryx6lu): resolution: {integrity: sha512-0QkvG13z6RD+1L1FoibQqnvTwVBXvS4XSPwAyinVgoOCl2jAgwzdUKmEj05o4Lt8xwQI85Hb6mSyYkcAGwZPew==} dependencies: acorn: 8.11.2 chokidar: 3.5.3 webpack-sources: 3.2.3 webpack-virtual-modules: 0.6.0 - dev: false + patched: true /unquote@1.1.1: resolution: {integrity: sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==} @@ -23413,6 +23524,7 @@ packages: is-generator-function: 1.0.10 is-typed-array: 1.1.10 which-typed-array: 1.1.9 + dev: true /utila@0.4.0: resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==} @@ -23488,8 +23600,8 @@ packages: unist-util-stringify-position: 2.0.3 vfile-message: 2.0.4 - /vite@2.9.16: - resolution: {integrity: sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==} + /vite@2.9.15: + resolution: {integrity: sha512-fzMt2jK4vQ3yK56te3Kqpkaeq9DkcZfBbzHwYpobasvgYmP2SoAr6Aic05CsB4CzCZbsDv4sujX3pkEGhLabVQ==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -23510,6 +23622,40 @@ packages: rollup: 2.77.3 optionalDependencies: fsevents: 2.3.2 + dev: true + + /vite@3.2.5(@types/node@17.0.45): + resolution: {integrity: sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 17.0.45 + esbuild: 0.15.18 + postcss: 8.4.31 + resolve: 1.22.1 + rollup: 2.79.1 + optionalDependencies: + fsevents: 2.3.2 /vitest@0.15.2(c8@7.13.0)(jsdom@20.0.3): resolution: {integrity: sha512-cMabuUqu+nNHafkdN7H8Z20+UZTrrUfqjGwAoLwUwrqFGWBz3gXwxndjbLf6mgSFs9lF/JWjKeNM1CXKwtk26w==} @@ -23540,7 +23686,7 @@ packages: local-pkg: 0.4.3 tinypool: 0.1.3 tinyspy: 0.3.3 - vite: 2.9.16 + vite: 2.9.15 transitivePeerDependencies: - less - sass @@ -23581,12 +23727,14 @@ packages: tinybench: 2.4.0 tinypool: 0.3.1 tinyspy: 1.1.1 - vite: 2.9.16 + vite: 3.2.5(@types/node@17.0.45) transitivePeerDependencies: - less - sass - stylus + - sugarss - supports-color + - terser dev: true /vue-eslint-parser@8.3.0(eslint@8.35.0): @@ -23728,6 +23876,7 @@ packages: range-parser: 1.2.1 schema-utils: 4.0.0 webpack: 5.76.0(@swc/core@1.3.80)(esbuild@0.17.16) + dev: true /webpack-dev-middleware@5.3.3(webpack@5.86.0): resolution: {integrity: sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==} @@ -23765,59 +23914,12 @@ packages: webpack: optional: true dependencies: - colorette: 2.0.19 + colorette: 2.0.20 memfs: 3.4.13 mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.0.0 webpack: 5.76.0(@swc/core@1.3.80)(esbuild@0.17.16) - - /webpack-dev-server@4.11.1(webpack@5.88.2): - resolution: {integrity: sha512-lILVz9tAUy1zGFwieuaQtYiadImb5M3d+H+L1zDYalYoDl0cksAB1UNyuE5MMWJrG6zR1tXkCP2fitl7yoUJiw==} - engines: {node: '>= 12.13.0'} - hasBin: true - peerDependencies: - webpack: ^4.37.0 || ^5.0.0 - webpack-cli: '*' - peerDependenciesMeta: - webpack-cli: - optional: true - dependencies: - '@types/bonjour': 3.5.10 - '@types/connect-history-api-fallback': 1.3.5 - '@types/express': 4.17.17 - '@types/serve-index': 1.9.1 - '@types/serve-static': 1.15.1 - '@types/sockjs': 0.3.33 - '@types/ws': 8.5.4 - ansi-html-community: 0.0.8 - bonjour-service: 1.1.0 - chokidar: 3.5.3 - colorette: 2.0.19 - compression: 1.7.4 - connect-history-api-fallback: 2.0.0 - default-gateway: 6.0.3 - express: 4.18.2 - graceful-fs: 4.2.10 - html-entities: 2.3.3 - http-proxy-middleware: 2.0.6(@types/express@4.17.17) - ipaddr.js: 2.0.1 - open: 8.4.2 - p-retry: 4.6.2 - rimraf: 3.0.2 - schema-utils: 4.0.0 - selfsigned: 2.1.1 - serve-index: 1.9.1 - sockjs: 0.3.24 - spdy: 4.0.2 - webpack: 5.88.2(esbuild@0.17.16) - webpack-dev-middleware: 5.3.3(webpack@5.88.2) - ws: 8.12.1 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate dev: true /webpack-dev-server@4.13.1(webpack@5.76.0): @@ -23843,7 +23945,7 @@ packages: ansi-html-community: 0.0.8 bonjour-service: 1.1.0 chokidar: 3.5.3 - colorette: 2.0.19 + colorette: 2.0.20 compression: 1.7.4 connect-history-api-fallback: 2.0.0 default-gateway: 6.0.3 @@ -23869,56 +23971,6 @@ packages: - debug - supports-color - utf-8-validate - - /webpack-dev-server@4.13.2(webpack@5.88.2): - resolution: {integrity: sha512-5i6TrGBRxG4vnfDpB6qSQGfnB6skGBXNL5/542w2uRGLimX6qeE5BQMLrzIC3JYV/xlGOv+s+hTleI9AZKUQNw==} - engines: {node: '>= 12.13.0'} - hasBin: true - peerDependencies: - webpack: ^4.37.0 || ^5.0.0 - webpack-cli: '*' - peerDependenciesMeta: - webpack: - optional: true - webpack-cli: - optional: true - dependencies: - '@types/bonjour': 3.5.10 - '@types/connect-history-api-fallback': 1.3.5 - '@types/express': 4.17.17 - '@types/serve-index': 1.9.1 - '@types/serve-static': 1.15.1 - '@types/sockjs': 0.3.33 - '@types/ws': 8.5.4 - ansi-html-community: 0.0.8 - bonjour-service: 1.1.0 - chokidar: 3.5.3 - colorette: 2.0.19 - compression: 1.7.4 - connect-history-api-fallback: 2.0.0 - default-gateway: 6.0.3 - express: 4.18.2 - graceful-fs: 4.2.10 - html-entities: 2.3.3 - http-proxy-middleware: 2.0.6(@types/express@4.17.17) - ipaddr.js: 2.0.1 - launch-editor: 2.6.0 - open: 8.4.2 - p-retry: 4.6.2 - rimraf: 3.0.2 - schema-utils: 4.0.0 - selfsigned: 2.1.1 - serve-index: 1.9.1 - sockjs: 0.3.24 - spdy: 4.0.2 - webpack: 5.88.2 - webpack-dev-middleware: 5.3.3(webpack@5.88.2) - ws: 8.13.0 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate dev: true /webpack-dev-server@4.15.0(debug@4.3.4)(webpack@5.88.2): @@ -24092,13 +24144,8 @@ packages: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} - /webpack-virtual-modules@0.5.0: - resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} - dev: true - /webpack-virtual-modules@0.6.0: resolution: {integrity: sha512-KnaMTE6EItz/f2q4Gwg5/rmeKVi79OR58NoYnwDJqCk9ywMtTGbBnBcfoBtN4QbYu0lWXvyMoH2Owxuhe4qI6Q==} - dev: false /webpack@5.76.0(@swc/core@1.3.80)(esbuild@0.17.16): resolution: {integrity: sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==} @@ -24119,7 +24166,7 @@ packages: acorn-import-assertions: 1.9.0(acorn@8.11.2) browserslist: 4.22.1 chrome-trace-event: 1.0.3 - enhanced-resolve: 5.15.0 + enhanced-resolve: 5.12.0 es-module-lexer: 0.9.3 eslint-scope: 5.1.1 events: 3.3.0 @@ -24138,6 +24185,7 @@ packages: - '@swc/core' - esbuild - uglify-js + dev: true /webpack@5.76.0(esbuild@0.17.16): resolution: {integrity: sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==} @@ -24158,7 +24206,7 @@ packages: acorn-import-assertions: 1.9.0(acorn@8.11.2) browserslist: 4.22.1 chrome-trace-event: 1.0.3 - enhanced-resolve: 5.15.0 + enhanced-resolve: 5.12.0 es-module-lexer: 0.9.3 eslint-scope: 5.1.1 events: 3.3.0 @@ -24198,7 +24246,7 @@ packages: acorn-import-assertions: 1.9.0(acorn@8.8.2) browserslist: 4.22.1 chrome-trace-event: 1.0.3 - enhanced-resolve: 5.14.1 + enhanced-resolve: 5.15.0 es-module-lexer: 1.2.1 eslint-scope: 5.1.1 events: 3.3.0 @@ -24234,8 +24282,8 @@ packages: '@webassemblyjs/ast': 1.11.5 '@webassemblyjs/wasm-edit': 1.11.5 '@webassemblyjs/wasm-parser': 1.11.5 - acorn: 8.8.2 - acorn-import-assertions: 1.9.0(acorn@8.8.2) + acorn: 8.11.2 + acorn-import-assertions: 1.9.0(acorn@8.11.2) browserslist: 4.21.5 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 @@ -24273,8 +24321,8 @@ packages: '@webassemblyjs/ast': 1.11.5 '@webassemblyjs/wasm-edit': 1.11.5 '@webassemblyjs/wasm-parser': 1.11.5 - acorn: 8.8.2 - acorn-import-assertions: 1.9.0(acorn@8.8.2) + acorn: 8.11.2 + acorn-import-assertions: 1.9.0(acorn@8.11.2) browserslist: 4.21.5 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 @@ -24312,8 +24360,8 @@ packages: '@webassemblyjs/ast': 1.11.5 '@webassemblyjs/wasm-edit': 1.11.5 '@webassemblyjs/wasm-parser': 1.11.5 - acorn: 8.8.2 - acorn-import-assertions: 1.9.0(acorn@8.8.2) + acorn: 8.11.2 + acorn-import-assertions: 1.9.0(acorn@8.11.2) browserslist: 4.21.5 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 @@ -24583,6 +24631,7 @@ packages: optional: true utf-8-validate: optional: true + dev: true /xdg-basedir@4.0.0: resolution: {integrity: sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==} @@ -24730,6 +24779,16 @@ packages: zod: ^3.18.0 dependencies: zod: 3.21.4 + dev: false + + /zod-validation-error@1.3.1(zod@3.21.4): + resolution: {integrity: sha512-cNEXpla+tREtNdAnNKY4xKY1SGOn2yzyuZMu4O0RQylX9apRpUjNcPkEc3uHIAr5Ct7LenjZt6RzjEH6+JsqVQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + zod: ^3.18.0 + dependencies: + zod: 3.21.4 + dev: true /zod@3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==}