diff --git a/.changeset/giant-falcons-tie.md b/.changeset/giant-falcons-tie.md new file mode 100644 index 00000000000..2c276613fac --- /dev/null +++ b/.changeset/giant-falcons-tie.md @@ -0,0 +1,5 @@ +--- +'@module-federation/enhanced': patch +--- + +feat(enhanced): runtimePlugins support pass params diff --git a/apps/website-new/docs/en/configure/_meta.json b/apps/website-new/docs/en/configure/_meta.json index 57517c05e40..7f8aac3dfc7 100644 --- a/apps/website-new/docs/en/configure/_meta.json +++ b/apps/website-new/docs/en/configure/_meta.json @@ -32,7 +32,7 @@ { "type": "file", "name": "runtimeplugins", - "label": "Runtime Plugins" + "label": "runtimePlugins" }, { "type": "file", diff --git a/apps/website-new/docs/en/configure/runtimeplugins.mdx b/apps/website-new/docs/en/configure/runtimeplugins.mdx index a005ed1e7f3..3d0c4e68944 100644 --- a/apps/website-new/docs/en/configure/runtimeplugins.mdx +++ b/apps/website-new/docs/en/configure/runtimeplugins.mdx @@ -1,15 +1,20 @@ # runtimePlugins -- Type: `string[]` +- Type: `string[] | Array<[string, object]>` - Required: No - Default: `undefined` -The `runtimePlugins` configuration is used to add additional plugins needed at runtime. The value should be the path to the specific plugin, which can be an absolute/relative path or a package name. You can learn more about how to develop `runtimePlugin` details by visiting the [Plugin System](../plugin/dev/index). +The `runtimePlugins` configuration is used to add additional plugins needed at runtime. The value can be: +- A string representing the path to the specific plugin (absolute/relative path or package name) +- An array where each element can be either a string or a tuple with [string path, object options] + +You can learn more about how to develop `runtimePlugin` details by visiting the [Plugin System](../plugin/dev/index). Once set, runtime plugins will be automatically injected and used during the build process. - Examples +**Basic usage:** To create a runtime plugin file, you can name it `custom-runtime-plugin.ts`: ```ts title="custom-runtime-plugin.ts" @@ -47,3 +52,52 @@ module.exports = { ], }; ``` + +**With options:** +You can also provide options to runtime plugins by using a tuple format: + +```ts title="rspack.config.ts" +const path = require('path'); +module.exports = { + plugins: [ + new ModuleFederationPlugin({ + name: 'host', + remotes: { + 'manifest-provider': + 'manifest_provider@http://localhost:3011/mf-manifest.json', + }, + runtimePlugins: [ + path.resolve(__dirname, './custom-runtime-plugin.ts'), + [ + path.resolve(__dirname, './another-plugin.ts'), + { + debug: true, + timeout: 5000, + customConfig: 'value' + } + ] + ], + }), + ], +}; +``` + +The plugin can then access these options: + +```ts title="another-plugin.ts" +import { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime'; + +export default function (options: any): ModuleFederationRuntimePlugin { + console.log('Plugin options:', options); + + return { + name: 'another-plugin', + beforeInit(args) { + if (options.debug) { + console.log('[debug] beforeInit: ', args); + } + return args; + }, + }; +} +``` diff --git a/apps/website-new/docs/zh/configure/runtimeplugins.mdx b/apps/website-new/docs/zh/configure/runtimeplugins.mdx index fc6fddcc807..d2086f68812 100644 --- a/apps/website-new/docs/zh/configure/runtimeplugins.mdx +++ b/apps/website-new/docs/zh/configure/runtimeplugins.mdx @@ -1,15 +1,20 @@ # runtimePlugins -- 类型:`string[]` +- 类型:`string[] | Array<[string, object]>` - 是否必填:否 - 默认值:`undefined` -用于添加运行时需要的额外插件,值为具体插件的路径,支持绝对/相对路径、包名,通过「[插件系统](../plugin/dev/index)」了解更多关于如何开发 runtimePlugin 细节。 +用于添加运行时需要的额外插件。值可以是: +- 表示具体插件路径的字符串(支持绝对/相对路径、包名) +- 一个数组,其中每个元素可以是字符串或元组 [字符串路径, 对象配置] + +通过「[插件系统](../plugin/dev/index)」了解更多关于如何开发 runtimePlugin 细节。 设置后,运行时插件会自动在构建时注入并使用。 -- examples +- 示例 +**基础用法:** 创建运行时插件文件: `custom-runtime-plugin.ts` ```ts title="custom-runtime-plugin.ts" @@ -48,3 +53,53 @@ module.exports = { ], }; ``` + +**带参数用法:** +你还可以通过使用元组格式为运行时插件提供配置选项: + +```ts title="rspack.config.ts" +const path = require('path'); +module.exports = { + plugins: [ + new ModuleFederationPlugin({ + name: 'host', + remotes: { + 'manifest-provider': + 'manifest_provider@http://localhost:3011/mf-manifest.json', + }, + runtimePlugins: [ + path.resolve(__dirname, './custom-runtime-plugin.ts'), + [ + path.resolve(__dirname, './another-plugin.ts'), + { + debug: true, + timeout: 5000, + customConfig: 'value' + } + ] + ], + }), + ], +}; + +``` + +插件可以访问这些配置选项: + +```ts title="another-plugin.ts" +import { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime'; + +export default function (options: any): ModuleFederationRuntimePlugin { + console.log('插件配置:', options); + + return { + name: 'another-plugin', + beforeInit(args) { + if (options.debug) { + console.log('[调试] beforeInit: ', args); + } + return args; + }, + }; +} +``` diff --git a/packages/enhanced/src/lib/container/runtime/FederationRuntimePlugin.ts b/packages/enhanced/src/lib/container/runtime/FederationRuntimePlugin.ts index 861bb636fee..81b82c64623 100644 --- a/packages/enhanced/src/lib/container/runtime/FederationRuntimePlugin.ts +++ b/packages/enhanced/src/lib/container/runtime/FederationRuntimePlugin.ts @@ -82,19 +82,30 @@ class FederationRuntimePlugin { ); let runtimePluginTemplates = ''; - const runtimePluginNames: string[] = []; + const runtimePluginCalls: string[] = []; if (Array.isArray(runtimePlugins)) { runtimePlugins.forEach((runtimePlugin, index) => { + if (!runtimePlugin) { + return; + } const runtimePluginName = `plugin_${index}`; + const runtimePluginEntry = Array.isArray(runtimePlugin) + ? runtimePlugin[0] + : runtimePlugin; const runtimePluginPath = normalizeToPosixPath( - path.isAbsolute(runtimePlugin) - ? runtimePlugin - : path.join(process.cwd(), runtimePlugin), + path.isAbsolute(runtimePluginEntry) + ? runtimePluginEntry + : path.join(process.cwd(), runtimePluginEntry), ); - + const paramsStr = + Array.isArray(runtimePlugin) && runtimePlugin.length > 1 + ? JSON.stringify(runtimePlugin[1]) + : 'undefined'; runtimePluginTemplates += `import ${runtimePluginName} from '${runtimePluginPath}';\n`; - runtimePluginNames.push(runtimePluginName); + runtimePluginCalls.push( + `${runtimePluginName} ? (${runtimePluginName}.default || ${runtimePluginName})(${paramsStr}) : false`, + ); }); } const embedRuntimeLines = Template.asString([ @@ -118,13 +129,11 @@ class FederationRuntimePlugin { embedRuntimeLines, `if(!${federationGlobal}.instance){`, Template.indent([ - runtimePluginNames.length + runtimePluginCalls.length ? Template.asString([ `var pluginsToAdd = [`, Template.indent( - runtimePluginNames.map( - (item) => `${item} ? (${item}.default || ${item})() : false,`, - ), + Template.indent(runtimePluginCalls.map((call) => `${call},`)), ), `].filter(Boolean);`, `${federationGlobal}.initOptions.plugins = ${federationGlobal}.initOptions.plugins ? `, diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts b/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts index 4c223e3a498..f41e37b89f0 100644 --- a/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts @@ -169,7 +169,20 @@ const e = { }, }, dataPrefetch: { type: 'boolean' }, - runtimePlugins: { type: 'array', items: { type: 'string' } }, + runtimePlugins: { + type: 'array', + items: { + anyOf: [ + { type: 'string' }, + { + type: 'array', + items: [{ type: 'string' }, { type: 'object' }], + minItems: 2, + maxItems: 2, + }, + ], + }, + }, }, required: ['name', 'exposes'], }, @@ -209,8 +222,8 @@ function a( } = {}, ) { let i = null, - p = 0; - if (0 === p) { + l = 0; + if (0 === l) { if (!t || 'object' != typeof t || Array.isArray(t)) return (a.errors = [{ params: { type: 'object' } }]), !1; { @@ -218,30 +231,30 @@ function a( if (void 0 === t.import && (r = 'import')) return (a.errors = [{ params: { missingProperty: r } }]), !1; { - const r = p; + const r = l; for (const e in t) if ('import' !== e && 'name' !== e) return (a.errors = [{ params: { additionalProperty: e } }]), !1; - if (r === p) { + if (r === l) { if (void 0 !== t.import) { let r = t.import; - const n = p, - m = p; + const n = l, + m = l; let u = !1; - const c = p; - if (p == p) + const c = l; + if (l == l) if ('string' == typeof r) { if (r.length < 1) { const t = { params: {} }; - null === i ? (i = [t]) : i.push(t), p++; + null === i ? (i = [t]) : i.push(t), l++; } } else { const t = { params: { type: 'string' } }; - null === i ? (i = [t]) : i.push(t), p++; + null === i ? (i = [t]) : i.push(t), l++; } - var l = c === p; - if (((u = u || l), !u)) { - const n = p; + var p = c === l; + if (((u = u || p), !u)) { + const n = l; s(r, { instancePath: e + '/import', parentData: t, @@ -249,31 +262,31 @@ function a( rootData: o, }) || ((i = null === i ? s.errors : i.concat(s.errors)), - (p = i.length)), - (l = n === p), - (u = u || l); + (l = i.length)), + (p = n === l), + (u = u || p); } if (!u) { const t = { params: {} }; return ( - null === i ? (i = [t]) : i.push(t), p++, (a.errors = i), !1 + null === i ? (i = [t]) : i.push(t), l++, (a.errors = i), !1 ); } - (p = m), null !== i && (m ? (i.length = m) : (i = null)); - var f = n === p; + (l = m), null !== i && (m ? (i.length = m) : (i = null)); + var f = n === l; } else f = !0; if (f) if (void 0 !== t.name) { - const e = p; + const e = l; if ('string' != typeof t.name) return (a.errors = [{ params: { type: 'string' } }]), !1; - f = e === p; + f = e === l; } else f = !0; } } } } - return (a.errors = i), 0 === p; + return (a.errors = i), 0 === l; } function o( t, @@ -284,58 +297,58 @@ function o( rootData: i = t, } = {}, ) { - let p = null, - l = 0; - if (0 === l) { + let l = null, + p = 0; + if (0 === p) { if (!t || 'object' != typeof t || Array.isArray(t)) return (o.errors = [{ params: { type: 'object' } }]), !1; for (const r in t) { let n = t[r]; - const m = l, - u = l; + const m = p, + u = p; let c = !1; - const y = l; + const y = p; a(n, { instancePath: e + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: t, parentDataProperty: r, rootData: i, - }) || ((p = null === p ? a.errors : p.concat(a.errors)), (l = p.length)); - var f = y === l; + }) || ((l = null === l ? a.errors : l.concat(a.errors)), (p = l.length)); + var f = y === p; if (((c = c || f), !c)) { - const a = l; - if (l == l) + const a = p; + if (p == p) if ('string' == typeof n) { if (n.length < 1) { const t = { params: {} }; - null === p ? (p = [t]) : p.push(t), l++; + null === l ? (l = [t]) : l.push(t), p++; } } else { const t = { params: { type: 'string' } }; - null === p ? (p = [t]) : p.push(t), l++; + null === l ? (l = [t]) : l.push(t), p++; } - if (((f = a === l), (c = c || f), !c)) { - const a = l; + if (((f = a === p), (c = c || f), !c)) { + const a = p; s(n, { instancePath: e + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: t, parentDataProperty: r, rootData: i, }) || - ((p = null === p ? s.errors : p.concat(s.errors)), (l = p.length)), - (f = a === l), + ((l = null === l ? s.errors : l.concat(s.errors)), (p = l.length)), + (f = a === p), (c = c || f); } } if (!c) { const t = { params: {} }; - return null === p ? (p = [t]) : p.push(t), l++, (o.errors = p), !1; + return null === l ? (l = [t]) : l.push(t), p++, (o.errors = l), !1; } - if (((l = u), null !== p && (u ? (p.length = u) : (p = null)), m !== l)) + if (((p = u), null !== l && (u ? (l.length = u) : (l = null)), m !== p)) break; } } - return (o.errors = p), 0 === l; + return (o.errors = l), 0 === p; } function i( t, @@ -347,77 +360,77 @@ function i( } = {}, ) { let a = null, - p = 0; - const l = p; + l = 0; + const p = l; let f = !1; - const m = p; - if (p === m) + const m = l; + if (l === m) if (Array.isArray(t)) { const r = t.length; for (let n = 0; n < r; n++) { let r = t[n]; - const i = p, - l = p; + const i = l, + p = l; let f = !1; - const m = p; - if (p == p) + const m = l; + if (l == l) if ('string' == typeof r) { if (r.length < 1) { const t = { params: {} }; - null === a ? (a = [t]) : a.push(t), p++; + null === a ? (a = [t]) : a.push(t), l++; } } else { const t = { params: { type: 'string' } }; - null === a ? (a = [t]) : a.push(t), p++; + null === a ? (a = [t]) : a.push(t), l++; } - var u = m === p; + var u = m === l; if (((f = f || u), !f)) { - const i = p; + const i = l; o(r, { instancePath: e + '/' + n, parentData: t, parentDataProperty: n, rootData: s, }) || - ((a = null === a ? o.errors : a.concat(o.errors)), (p = a.length)), - (u = i === p), + ((a = null === a ? o.errors : a.concat(o.errors)), (l = a.length)), + (u = i === l), (f = f || u); } - if (f) (p = l), null !== a && (l ? (a.length = l) : (a = null)); + if (f) (l = p), null !== a && (p ? (a.length = p) : (a = null)); else { const t = { params: {} }; - null === a ? (a = [t]) : a.push(t), p++; + null === a ? (a = [t]) : a.push(t), l++; } - if (i !== p) break; + if (i !== l) break; } } else { const t = { params: { type: 'array' } }; - null === a ? (a = [t]) : a.push(t), p++; + null === a ? (a = [t]) : a.push(t), l++; } - var c = m === p; + var c = m === l; if (((f = f || c), !f)) { - const i = p; + const i = l; o(t, { instancePath: e, parentData: r, parentDataProperty: n, rootData: s, - }) || ((a = null === a ? o.errors : a.concat(o.errors)), (p = a.length)), - (c = i === p), + }) || ((a = null === a ? o.errors : a.concat(o.errors)), (l = a.length)), + (c = i === l), (f = f || c); } if (!f) { const t = { params: {} }; - return null === a ? (a = [t]) : a.push(t), p++, (i.errors = a), !1; + return null === a ? (a = [t]) : a.push(t), l++, (i.errors = a), !1; } return ( - (p = l), - null !== a && (l ? (a.length = l) : (a = null)), + (l = p), + null !== a && (p ? (a.length = p) : (a = null)), (i.errors = a), - 0 === p + 0 === l ); } -const p = { +const l = { anyOf: [ { enum: [ @@ -444,7 +457,7 @@ const p = { { type: 'string' }, ], }; -function l( +function p( t, { instancePath: e = '', @@ -456,14 +469,14 @@ function l( let a = null, o = 0; const i = o; - let p = !1; + let l = !1; const f = o; if ('string' != typeof t) { const t = { params: { type: 'string' } }; null === a ? (a = [t]) : a.push(t), o++; } var m = f === o; - if (((p = p || m), !p)) { + if (((l = l || m), !l)) { const e = o; if (o == o) if (t && 'object' == typeof t && !Array.isArray(t)) { @@ -522,16 +535,16 @@ function l( const t = { params: { type: 'object' } }; null === a ? (a = [t]) : a.push(t), o++; } - (m = e === o), (p = p || m); + (m = e === o), (l = l || m); } - if (!p) { + if (!l) { const t = { params: {} }; - return null === a ? (a = [t]) : a.push(t), o++, (l.errors = a), !1; + return null === a ? (a = [t]) : a.push(t), o++, (p.errors = a), !1; } return ( (o = i), null !== a && (i ? (a.length = i) : (a = null)), - (l.errors = a), + (p.errors = a), 0 === o ); } @@ -547,9 +560,9 @@ function f( let a = null, o = 0; const i = o; - let p = !1; - const l = o; - if (o === l) + let l = !1; + const p = o; + if (o === p) if (Array.isArray(t)) if (t.length < 1) { const t = { params: { limit: 1 } }; @@ -576,8 +589,8 @@ function f( const t = { params: { type: 'array' } }; null === a ? (a = [t]) : a.push(t), o++; } - var m = l === o; - if (((p = p || m), !p)) { + var m = p === o; + if (((l = l || m), !l)) { const e = o; if (o === e) if ('string' == typeof t) { @@ -589,7 +602,7 @@ function f( const t = { params: { type: 'string' } }; null === a ? (a = [t]) : a.push(t), o++; } - if (((m = e === o), (p = p || m), !p)) { + if (((m = e === o), (l = l || m), !l)) { const e = o; if (o == o) if (t && 'object' == typeof t && !Array.isArray(t)) { @@ -690,10 +703,10 @@ function f( const t = { params: { type: 'object' } }; null === a ? (a = [t]) : a.push(t), o++; } - (m = e === o), (p = p || m); + (m = e === o), (l = l || m); } } - if (!p) { + if (!l) { const t = { params: {} }; return null === a ? (a = [t]) : a.push(t), o++, (f.errors = a), !1; } @@ -748,13 +761,13 @@ function m( if (i) { if (void 0 !== t.auxiliaryComment) { const r = o; - l(t.auxiliaryComment, { + p(t.auxiliaryComment, { instancePath: e + '/auxiliaryComment', parentData: t, parentDataProperty: 'auxiliaryComment', rootData: s, }) || - ((a = null === a ? l.errors : a.concat(l.errors)), + ((a = null === a ? p.errors : a.concat(p.errors)), (o = a.length)), (i = r === o); } else i = !0; @@ -764,8 +777,8 @@ function m( const r = o, n = o; let s = !1; - const p = o; - if (o === p) + const l = o; + if (o === l) if (Array.isArray(e)) { const t = e.length; for (let r = 0; r < t; r++) { @@ -787,7 +800,7 @@ function m( const t = { params: { type: 'array' } }; null === a ? (a = [t]) : a.push(t), o++; } - var u = p === o; + var u = l === o; if (((s = s || u), !s)) { const t = o; if (o === t) @@ -831,7 +844,7 @@ function m( const r = o, n = o; let s = !1; - const l = o; + const p = o; if ( 'var' !== e && 'module' !== e && @@ -852,10 +865,10 @@ function m( 'jsonp' !== e && 'system' !== e ) { - const t = { params: { allowedValues: p.anyOf[0].enum } }; + const t = { params: { allowedValues: l.anyOf[0].enum } }; null === a ? (a = [t]) : a.push(t), o++; } - var c = l === o; + var c = p === o; if (((s = s || c), !s)) { const t = o; if ('string' != typeof e) { @@ -901,8 +914,8 @@ function u( { instancePath: a = '', parentData: o, - parentDataProperty: p, - rootData: l = s, + parentDataProperty: l, + rootData: p = s, } = {}, ) { let f = null, @@ -929,7 +942,7 @@ function u( instancePath: a + '/exposes', parentData: s, parentDataProperty: 'exposes', - rootData: l, + rootData: p, }) || ((f = null === f ? i.errors : f.concat(i.errors)), (c = f.length)); @@ -955,7 +968,7 @@ function u( instancePath: a + '/library', parentData: s, parentDataProperty: 'library', - rootData: l, + rootData: p, }) || ((f = null === f ? m.errors : f.concat(m.errors)), (c = f.length)), @@ -1158,15 +1171,84 @@ function u( { const e = t.length; for (let r = 0; r < e; r++) { - const e = c; - if ('string' != typeof t[r]) + let e = t[r]; + const n = c, + s = c; + let a = !1; + const o = c; + if ('string' != typeof e) { + const t = { params: { type: 'string' } }; + null === f ? (f = [t]) : f.push(t), c++; + } + var b = o === c; + if (((a = a || b), !a)) { + const t = c; + if (c === t) + if (Array.isArray(e)) + if (e.length > 2) { + const t = { params: { limit: 2 } }; + null === f ? (f = [t]) : f.push(t), + c++; + } else if (e.length < 2) { + const t = { params: { limit: 2 } }; + null === f ? (f = [t]) : f.push(t), + c++; + } else { + const t = e.length; + if (t > 0) { + const t = c; + if ('string' != typeof e[0]) { + const t = { + params: { type: 'string' }, + }; + null === f + ? (f = [t]) + : f.push(t), + c++; + } + var j = t === c; + } + if (j && t > 1) { + let t = e[1]; + const r = c; + if ( + !t || + 'object' != typeof t || + Array.isArray(t) + ) { + const t = { + params: { type: 'object' }, + }; + null === f + ? (f = [t]) + : f.push(t), + c++; + } + j = r === c; + } + } + else { + const t = { params: { type: 'array' } }; + null === f ? (f = [t]) : f.push(t), c++; + } + (b = t === c), (a = a || b); + } + if (!a) { + const t = { params: {} }; return ( - (u.errors = [ - { params: { type: 'string' } }, - ]), + null === f ? (f = [t]) : f.push(t), + c++, + (u.errors = f), !1 ); - if (e !== c) break; + } + if ( + ((c = s), + null !== f && + (s ? (f.length = s) : (f = null)), + n !== c) + ) + break; } } } diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.json b/packages/enhanced/src/schemas/container/ContainerPlugin.json index 9e7c1744349..a5bf16d0d7b 100644 --- a/packages/enhanced/src/schemas/container/ContainerPlugin.json +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.json @@ -329,7 +329,15 @@ "description": "Array of runtime plugins to be applied", "type": "array", "items": { - "type": "string" + "anyOf": [ + { "type": "string" }, + { + "type": "array", + "items": [{ "type": "string" }, { "type": "object" }], + "minItems": 2, + "maxItems": 2 + } + ] } } }, diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.ts b/packages/enhanced/src/schemas/container/ContainerPlugin.ts index 5d97175cd92..6f86e60d6e2 100644 --- a/packages/enhanced/src/schemas/container/ContainerPlugin.ts +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.ts @@ -355,7 +355,24 @@ export default { description: 'Array of runtime plugins to be applied', type: 'array', items: { - type: 'string', + anyOf: [ + { + type: 'string', + }, + { + type: 'array', + items: [ + { + type: 'string', + }, + { + type: 'object', + }, + ], + minItems: 2, + maxItems: 2, + }, + ], }, }, }, diff --git a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts index 666cb30205d..8d57f33fba6 100644 --- a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts +++ b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts @@ -5,8 +5,8 @@ * DO NOT MODIFY BY HAND. */ const e = /^(?:[A-Za-z]:[\\/]|\\\\|\/)/; -export const validate = D; -export default D; +export const validate = A; +export default A; const t = { definitions: { AmdContainer: { type: 'string', minLength: 1 }, @@ -253,6 +253,10 @@ const t = { { type: 'array', items: { type: 'string', minLength: 1 } }, ], }, + shareStrategy: { + enum: ['version-first', 'loaded-first'], + type: 'string', + }, singleton: { type: 'boolean' }, strictVersion: { type: 'boolean' }, version: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, @@ -297,7 +301,21 @@ const t = { type: 'object', additionalProperties: !1, properties: { - async: { type: 'boolean' }, + async: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + eager: { + anyOf: [{ instanceof: 'RegExp' }, { instanceof: 'Function' }], + }, + excludeChunk: { instanceof: 'Function' }, + }, + additionalProperties: !1, + }, + ], + }, exposes: { $ref: '#/definitions/Exposes' }, filename: { type: 'string', absolutePath: !1, minLength: 1 }, library: { $ref: '#/definitions/LibraryOptions' }, @@ -339,7 +357,26 @@ const t = { compileInChildProcess: { type: 'boolean' }, compilerInstance: { type: 'string' }, generateAPITypes: { type: 'boolean' }, - extractThirdParty: { type: 'boolean' }, + extractThirdParty: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + exclude: { + type: 'array', + items: { + anyOf: [ + { type: 'string' }, + { instanceof: 'RegExp' }, + ], + }, + }, + }, + additionalProperties: !1, + }, + ], + }, extractRemoteTypes: { type: 'boolean' }, abortOnError: { type: 'boolean' }, }, @@ -359,6 +396,27 @@ const t = { maxRetries: { type: 'number' }, consumeAPITypes: { type: 'boolean' }, runtimePkgs: { type: 'array', items: { type: 'string' } }, + remoteTypeUrls: { + anyOf: [ + { instanceof: 'Function' }, + { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + alias: { type: 'string' }, + api: { type: 'string' }, + zip: { type: 'string' }, + }, + required: ['api', 'zip'], + additionalProperties: !1, + }, + }, + ], + }, + timeout: { type: 'number' }, + family: { enum: [4, 6] }, + typesOnBuild: { type: 'boolean' }, }, }, ], @@ -378,6 +436,14 @@ const t = { asyncStartup: { type: 'boolean' }, externalRuntime: { type: 'boolean' }, provideExternalRuntime: { type: 'boolean' }, + optimization: { + type: 'object', + properties: { + disableSnapshot: { type: 'boolean' }, + target: { enum: ['web', 'node'] }, + }, + additionalProperties: !1, + }, }, }, bridge: { @@ -415,7 +481,20 @@ const t = { }, ], }, - runtimePlugins: { type: 'array', items: { type: 'string' } }, + runtimePlugins: { + type: 'array', + items: { + anyOf: [ + { type: 'string' }, + { + type: 'array', + items: [{ type: 'string' }, { type: 'object' }], + minItems: 2, + maxItems: 2, + }, + ], + }, + }, getPublicPath: { type: 'string' }, dataPrefetch: { type: 'boolean' }, implementation: { type: 'string' }, @@ -473,7 +552,7 @@ function o( } return (o.errors = null), !0; } -function a( +function i( e, { instancePath: t = '', @@ -482,38 +561,38 @@ function a( rootData: s = e, } = {}, ) { - let i = null, + let a = null, l = 0; if (0 === l) { if (!e || 'object' != typeof e || Array.isArray(e)) - return (a.errors = [{ params: { type: 'object' } }]), !1; + return (i.errors = [{ params: { type: 'object' } }]), !1; { let r; if (void 0 === e.import && (r = 'import')) - return (a.errors = [{ params: { missingProperty: r } }]), !1; + return (i.errors = [{ params: { missingProperty: r } }]), !1; { const r = l; for (const t in e) if ('import' !== t && 'name' !== t) - return (a.errors = [{ params: { additionalProperty: t } }]), !1; + return (i.errors = [{ params: { additionalProperty: t } }]), !1; if (r === l) { if (void 0 !== e.import) { let r = e.import; const n = l, - y = l; + u = l; let c = !1; - const u = l; + const y = l; if (l == l) if ('string' == typeof r) { if (r.length < 1) { const e = { params: {} }; - null === i ? (i = [e]) : i.push(e), l++; + null === a ? (a = [e]) : a.push(e), l++; } } else { const e = { params: { type: 'string' } }; - null === i ? (i = [e]) : i.push(e), l++; + null === a ? (a = [e]) : a.push(e), l++; } - var p = u === l; + var p = y === l; if (((c = c || p), !c)) { const n = l; o(r, { @@ -522,34 +601,34 @@ function a( parentDataProperty: 'import', rootData: s, }) || - ((i = null === i ? o.errors : i.concat(o.errors)), - (l = i.length)), + ((a = null === a ? o.errors : a.concat(o.errors)), + (l = a.length)), (p = n === l), (c = c || p); } if (!c) { const e = { params: {} }; return ( - null === i ? (i = [e]) : i.push(e), l++, (a.errors = i), !1 + null === a ? (a = [e]) : a.push(e), l++, (i.errors = a), !1 ); } - (l = y), null !== i && (y ? (i.length = y) : (i = null)); + (l = u), null !== a && (u ? (a.length = u) : (a = null)); var f = n === l; } else f = !0; if (f) if (void 0 !== e.name) { const t = l; if ('string' != typeof e.name) - return (a.errors = [{ params: { type: 'string' } }]), !1; + return (i.errors = [{ params: { type: 'string' } }]), !1; f = t === l; } else f = !0; } } } } - return (a.errors = i), 0 === l; + return (i.errors = a), 0 === l; } -function i( +function a( e, { instancePath: t = '', @@ -562,22 +641,22 @@ function i( p = 0; if (0 === p) { if (!e || 'object' != typeof e || Array.isArray(e)) - return (i.errors = [{ params: { type: 'object' } }]), !1; + return (a.errors = [{ params: { type: 'object' } }]), !1; for (const r in e) { let n = e[r]; - const y = p, + const u = p, c = p; - let u = !1; + let y = !1; const m = p; - a(n, { + i(n, { instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: e, parentDataProperty: r, rootData: s, - }) || ((l = null === l ? a.errors : l.concat(a.errors)), (p = l.length)); + }) || ((l = null === l ? i.errors : l.concat(i.errors)), (p = l.length)); var f = m === p; - if (((u = u || f), !u)) { - const a = p; + if (((y = y || f), !y)) { + const i = p; if (p == p) if ('string' == typeof n) { if (n.length < 1) { @@ -588,8 +667,8 @@ function i( const e = { params: { type: 'string' } }; null === l ? (l = [e]) : l.push(e), p++; } - if (((f = a === p), (u = u || f), !u)) { - const a = p; + if (((f = i === p), (y = y || f), !y)) { + const i = p; o(n, { instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: e, @@ -597,19 +676,19 @@ function i( rootData: s, }) || ((l = null === l ? o.errors : l.concat(o.errors)), (p = l.length)), - (f = a === p), - (u = u || f); + (f = i === p), + (y = y || f); } } - if (!u) { + if (!y) { const e = { params: {} }; - return null === l ? (l = [e]) : l.push(e), p++, (i.errors = l), !1; + return null === l ? (l = [e]) : l.push(e), p++, (a.errors = l), !1; } - if (((p = c), null !== l && (c ? (l.length = c) : (l = null)), y !== p)) + if (((p = c), null !== l && (c ? (l.length = c) : (l = null)), u !== p)) break; } } - return (i.errors = l), 0 === p; + return (a.errors = l), 0 === p; } function l( e, @@ -621,74 +700,74 @@ function l( } = {}, ) { let o = null, - a = 0; - const p = a; + i = 0; + const p = i; let f = !1; - const y = a; - if (a === y) + const u = i; + if (i === u) if (Array.isArray(e)) { const r = e.length; for (let n = 0; n < r; n++) { let r = e[n]; - const l = a, - p = a; + const l = i, + p = i; let f = !1; - const y = a; - if (a == a) + const u = i; + if (i == i) if ('string' == typeof r) { if (r.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var c = y === a; + var c = u === i; if (((f = f || c), !f)) { - const l = a; - i(r, { + const l = i; + a(r, { instancePath: t + '/' + n, parentData: e, parentDataProperty: n, rootData: s, }) || - ((o = null === o ? i.errors : o.concat(i.errors)), (a = o.length)), - (c = l === a), + ((o = null === o ? a.errors : o.concat(a.errors)), (i = o.length)), + (c = l === i), (f = f || c); } - if (f) (a = p), null !== o && (p ? (o.length = p) : (o = null)); + if (f) (i = p), null !== o && (p ? (o.length = p) : (o = null)); else { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (l !== a) break; + if (l !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var u = y === a; - if (((f = f || u), !f)) { - const l = a; - i(e, { + var y = u === i; + if (((f = f || y), !f)) { + const l = i; + a(e, { instancePath: t, parentData: r, parentDataProperty: n, rootData: s, - }) || ((o = null === o ? i.errors : o.concat(i.errors)), (a = o.length)), - (u = l === a), - (f = f || u); + }) || ((o = null === o ? a.errors : o.concat(a.errors)), (i = o.length)), + (y = l === i), + (f = f || y); } if (!f) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (l.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (l.errors = o), !1; } return ( - (a = p), + (i = p), null !== o && (p ? (o.length = p) : (o = null)), (l.errors = o), - 0 === a + 0 === i ); } const p = { @@ -728,20 +807,20 @@ function f( } = {}, ) { let o = null, - a = 0; - const i = a; + i = 0; + const a = i; let l = !1; - const p = a; + const p = i; if ('string' != typeof e) { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var y = p === a; - if (((l = l || y), !l)) { - const t = a; - if (a == a) + var u = p === i; + if (((l = l || u), !l)) { + const t = i; + if (i == i) if (e && 'object' == typeof e && !Array.isArray(e)) { - const t = a; + const t = i; for (const t in e) if ( 'amd' !== t && @@ -750,66 +829,66 @@ function f( 'root' !== t ) { const e = { params: { additionalProperty: t } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; break; } - if (t === a) { + if (t === i) { if (void 0 !== e.amd) { - const t = a; + const t = i; if ('string' != typeof e.amd) { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var c = t === a; + var c = t === i; } else c = !0; if (c) { if (void 0 !== e.commonjs) { - const t = a; + const t = i; if ('string' != typeof e.commonjs) { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - c = t === a; + c = t === i; } else c = !0; if (c) { if (void 0 !== e.commonjs2) { - const t = a; + const t = i; if ('string' != typeof e.commonjs2) { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - c = t === a; + c = t === i; } else c = !0; if (c) if (void 0 !== e.root) { - const t = a; + const t = i; if ('string' != typeof e.root) { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - c = t === a; + c = t === i; } else c = !0; } } } } else { const e = { params: { type: 'object' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (y = t === a), (l = l || y); + (u = t === i), (l = l || u); } if (!l) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (f.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (f.errors = o), !1; } return ( - (a = i), - null !== o && (i ? (o.length = i) : (o = null)), + (i = a), + null !== o && (a ? (o.length = a) : (o = null)), (f.errors = o), - 0 === a + 0 === i ); } -function y( +function u( e, { instancePath: t = '', @@ -819,163 +898,163 @@ function y( } = {}, ) { let o = null, - a = 0; - const i = a; + i = 0; + const a = i; let l = !1; - const p = a; - if (a === p) + const p = i; + if (i === p) if (Array.isArray(e)) if (e.length < 1) { const e = { params: { limit: 1 } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } else { const t = e.length; for (let r = 0; r < t; r++) { let t = e[r]; - const n = a; - if (a === n) + const n = i; + if (i === n) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (n !== a) break; + if (n !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var f = p === a; + var f = p === i; if (((l = l || f), !l)) { - const t = a; - if (a === t) + const t = i; + if (i === t) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (((f = t === a), (l = l || f), !l)) { - const t = a; - if (a == a) + if (((f = t === i), (l = l || f), !l)) { + const t = i; + if (i == i) if (e && 'object' == typeof e && !Array.isArray(e)) { - const t = a; + const t = i; for (const t in e) if ('amd' !== t && 'commonjs' !== t && 'root' !== t) { const e = { params: { additionalProperty: t } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; break; } - if (t === a) { + if (t === i) { if (void 0 !== e.amd) { let t = e.amd; - const r = a; - if (a === r) + const r = i; + if (i === r) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var c = r === a; + var c = r === i; } else c = !0; if (c) { if (void 0 !== e.commonjs) { let t = e.commonjs; - const r = a; - if (a === r) + const r = i; + if (i === r) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - c = r === a; + c = r === i; } else c = !0; if (c) if (void 0 !== e.root) { let t = e.root; - const r = a, - n = a; + const r = i, + n = i; let s = !1; - const i = a; - if (a === i) + const a = i; + if (i === a) if (Array.isArray(t)) { const e = t.length; for (let r = 0; r < e; r++) { let e = t[r]; - const n = a; - if (a === n) + const n = i; + if (i === n) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (n !== a) break; + if (n !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var u = i === a; - if (((s = s || u), !s)) { - const e = a; - if (a === e) + var y = a === i; + if (((s = s || y), !s)) { + const e = i; + if (i === e) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (u = e === a), (s = s || u); + (y = e === i), (s = s || y); } if (s) - (a = n), null !== o && (n ? (o.length = n) : (o = null)); + (i = n), null !== o && (n ? (o.length = n) : (o = null)); else { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - c = r === a; + c = r === i; } else c = !0; } } } else { const e = { params: { type: 'object' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (f = t === a), (l = l || f); + (f = t === i), (l = l || f); } } if (!l) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (y.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (u.errors = o), !1; } return ( - (a = i), - null !== o && (i ? (o.length = i) : (o = null)), - (y.errors = o), - 0 === a + (i = a), + null !== o && (a ? (o.length = a) : (o = null)), + (u.errors = o), + 0 === i ); } function c( @@ -988,8 +1067,8 @@ function c( } = {}, ) { let o = null, - a = 0; - if (0 === a) { + i = 0; + if (0 === i) { if (!e || 'object' != typeof e || Array.isArray(e)) return (c.errors = [{ params: { type: 'object' } }]), !1; { @@ -997,7 +1076,7 @@ function c( if (void 0 === e.type && (r = 'type')) return (c.errors = [{ params: { missingProperty: r } }]), !1; { - const r = a; + const r = i; for (const t in e) if ( 'amdContainer' !== t && @@ -1008,20 +1087,20 @@ function c( 'umdNamedDefine' !== t ) return (c.errors = [{ params: { additionalProperty: t } }]), !1; - if (r === a) { + if (r === i) { if (void 0 !== e.amdContainer) { let t = e.amdContainer; - const r = a; - if (a == a) { + const r = i; + if (i == i) { if ('string' != typeof t) return (c.errors = [{ params: { type: 'string' } }]), !1; if (t.length < 1) return (c.errors = [{ params: {} }]), !1; } - var i = r === a; - } else i = !0; - if (i) { + var a = r === i; + } else a = !0; + if (a) { if (void 0 !== e.auxiliaryComment) { - const r = a; + const r = i; f(e.auxiliaryComment, { instancePath: t + '/auxiliaryComment', parentData: e, @@ -1029,83 +1108,83 @@ function c( rootData: s, }) || ((o = null === o ? f.errors : o.concat(f.errors)), - (a = o.length)), - (i = r === a); - } else i = !0; - if (i) { + (i = o.length)), + (a = r === i); + } else a = !0; + if (a) { if (void 0 !== e.export) { let t = e.export; - const r = a, - n = a; + const r = i, + n = i; let s = !1; - const p = a; - if (a === p) + const p = i; + if (i === p) if (Array.isArray(t)) { const e = t.length; for (let r = 0; r < e; r++) { let e = t[r]; - const n = a; - if (a === n) + const n = i; + if (i === n) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (n !== a) break; + if (n !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var l = p === a; + var l = p === i; if (((s = s || l), !s)) { - const e = a; - if (a === e) + const e = i; + if (i === e) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (l = e === a), (s = s || l); + (l = e === i), (s = s || l); } if (!s) { const e = { params: {} }; return ( - null === o ? (o = [e]) : o.push(e), a++, (c.errors = o), !1 + null === o ? (o = [e]) : o.push(e), i++, (c.errors = o), !1 ); } - (a = n), + (i = n), null !== o && (n ? (o.length = n) : (o = null)), - (i = r === a); - } else i = !0; - if (i) { + (a = r === i); + } else a = !0; + if (a) { if (void 0 !== e.name) { - const r = a; - y(e.name, { + const r = i; + u(e.name, { instancePath: t + '/name', parentData: e, parentDataProperty: 'name', rootData: s, }) || - ((o = null === o ? y.errors : o.concat(y.errors)), - (a = o.length)), - (i = r === a); - } else i = !0; - if (i) { + ((o = null === o ? u.errors : o.concat(u.errors)), + (i = o.length)), + (a = r === i); + } else a = !0; + if (a) { if (void 0 !== e.type) { let t = e.type; - const r = a, - n = a; + const r = i, + n = i; let s = !1; - const l = a; + const l = i; if ( 'var' !== t && 'module' !== t && @@ -1127,39 +1206,39 @@ function c( 'system' !== t ) { const e = { params: { allowedValues: p.anyOf[0].enum } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var u = l === a; - if (((s = s || u), !s)) { - const e = a; + var y = l === i; + if (((s = s || y), !s)) { + const e = i; if ('string' != typeof t) { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (u = e === a), (s = s || u); + (y = e === i), (s = s || y); } if (!s) { const e = { params: {} }; return ( null === o ? (o = [e]) : o.push(e), - a++, + i++, (c.errors = o), !1 ); } - (a = n), + (i = n), null !== o && (n ? (o.length = n) : (o = null)), - (i = r === a); - } else i = !0; - if (i) + (a = r === i); + } else a = !0; + if (a) if (void 0 !== e.umdNamedDefine) { - const t = a; + const t = i; if ('boolean' != typeof e.umdNamedDefine) return ( (c.errors = [{ params: { type: 'boolean' } }]), !1 ); - i = t === a; - } else i = !0; + a = t === i; + } else a = !0; } } } @@ -1168,9 +1247,9 @@ function c( } } } - return (c.errors = o), 0 === a; + return (c.errors = o), 0 === i; } -function u( +function y( e, { instancePath: t = '', @@ -1180,19 +1259,19 @@ function u( } = {}, ) { if (!Array.isArray(e)) - return (u.errors = [{ params: { type: 'array' } }]), !1; + return (y.errors = [{ params: { type: 'array' } }]), !1; { const t = e.length; for (let r = 0; r < t; r++) { let t = e[r]; const n = 0; if ('string' != typeof t) - return (u.errors = [{ params: { type: 'string' } }]), !1; - if (t.length < 1) return (u.errors = [{ params: {} }]), !1; + return (y.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (y.errors = [{ params: {} }]), !1; if (0 !== n) break; } } - return (u.errors = null), !0; + return (y.errors = null), !0; } function m( e, @@ -1204,8 +1283,8 @@ function m( } = {}, ) { let o = null, - a = 0; - if (0 === a) { + i = 0; + if (0 === i) { if (!e || 'object' != typeof e || Array.isArray(e)) return (m.errors = [{ params: { type: 'object' } }]), !1; { @@ -1213,109 +1292,109 @@ function m( if (void 0 === e.external && (r = 'external')) return (m.errors = [{ params: { missingProperty: r } }]), !1; { - const r = a; + const r = i; for (const t in e) if ('external' !== t && 'shareScope' !== t) return (m.errors = [{ params: { additionalProperty: t } }]), !1; - if (r === a) { + if (r === i) { if (void 0 !== e.external) { let r = e.external; - const n = a, - p = a; + const n = i, + p = i; let f = !1; - const y = a; - if (a == a) + const u = i; + if (i == i) if ('string' == typeof r) { if (r.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var i = y === a; - if (((f = f || i), !f)) { - const n = a; - u(r, { + var a = u === i; + if (((f = f || a), !f)) { + const n = i; + y(r, { instancePath: t + '/external', parentData: e, parentDataProperty: 'external', rootData: s, }) || - ((o = null === o ? u.errors : o.concat(u.errors)), - (a = o.length)), - (i = n === a), - (f = f || i); + ((o = null === o ? y.errors : o.concat(y.errors)), + (i = o.length)), + (a = n === i), + (f = f || a); } if (!f) { const e = { params: {} }; return ( - null === o ? (o = [e]) : o.push(e), a++, (m.errors = o), !1 + null === o ? (o = [e]) : o.push(e), i++, (m.errors = o), !1 ); } - (a = p), null !== o && (p ? (o.length = p) : (o = null)); - var l = n === a; + (i = p), null !== o && (p ? (o.length = p) : (o = null)); + var l = n === i; } else l = !0; if (l) if (void 0 !== e.shareScope) { let t = e.shareScope; - const r = a, - n = a; + const r = i, + n = i; let s = !1; - const i = a; - if (a === i) + const a = i; + if (i === a) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var p = i === a; + var p = a === i; if (((s = s || p), !s)) { - const e = a; - if (a === e) + const e = i; + if (i === e) if (Array.isArray(t)) { const e = t.length; for (let r = 0; r < e; r++) { let e = t[r]; - const n = a; - if (a === n) + const n = i; + if (i === n) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (n !== a) break; + if (n !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (p = e === a), (s = s || p); + (p = e === i), (s = s || p); } if (!s) { const e = { params: {} }; return ( - null === o ? (o = [e]) : o.push(e), a++, (m.errors = o), !1 + null === o ? (o = [e]) : o.push(e), i++, (m.errors = o), !1 ); } - (a = n), + (i = n), null !== o && (n ? (o.length = n) : (o = null)), - (l = r === a); + (l = r === i); } else l = !0; } } } } - return (m.errors = o), 0 === a; + return (m.errors = o), 0 === i; } function d( e, @@ -1327,57 +1406,57 @@ function d( } = {}, ) { let o = null, - a = 0; - if (0 === a) { + i = 0; + if (0 === i) { if (!e || 'object' != typeof e || Array.isArray(e)) return (d.errors = [{ params: { type: 'object' } }]), !1; for (const r in e) { let n = e[r]; - const l = a, - p = a; + const l = i, + p = i; let f = !1; - const y = a; + const u = i; m(n, { instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: e, parentDataProperty: r, rootData: s, - }) || ((o = null === o ? m.errors : o.concat(m.errors)), (a = o.length)); - var i = y === a; - if (((f = f || i), !f)) { - const l = a; - if (a == a) + }) || ((o = null === o ? m.errors : o.concat(m.errors)), (i = o.length)); + var a = u === i; + if (((f = f || a), !f)) { + const l = i; + if (i == i) if ('string' == typeof n) { if (n.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (((i = l === a), (f = f || i), !f)) { - const l = a; - u(n, { + if (((a = l === i), (f = f || a), !f)) { + const l = i; + y(n, { instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: e, parentDataProperty: r, rootData: s, }) || - ((o = null === o ? u.errors : o.concat(u.errors)), (a = o.length)), - (i = l === a), - (f = f || i); + ((o = null === o ? y.errors : o.concat(y.errors)), (i = o.length)), + (a = l === i), + (f = f || a); } } if (!f) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (d.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (d.errors = o), !1; } - if (((a = p), null !== o && (p ? (o.length = p) : (o = null)), l !== a)) + if (((i = p), null !== o && (p ? (o.length = p) : (o = null)), l !== i)) break; } } - return (d.errors = o), 0 === a; + return (d.errors = o), 0 === i; } function g( e, @@ -1389,74 +1468,74 @@ function g( } = {}, ) { let o = null, - a = 0; - const i = a; + i = 0; + const a = i; let l = !1; - const p = a; - if (a === p) + const p = i; + if (i === p) if (Array.isArray(e)) { const r = e.length; for (let n = 0; n < r; n++) { let r = e[n]; - const i = a, - l = a; + const a = i, + l = i; let p = !1; - const y = a; - if (a == a) + const u = i; + if (i == i) if ('string' == typeof r) { if (r.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var f = y === a; + var f = u === i; if (((p = p || f), !p)) { - const i = a; + const a = i; d(r, { instancePath: t + '/' + n, parentData: e, parentDataProperty: n, rootData: s, }) || - ((o = null === o ? d.errors : o.concat(d.errors)), (a = o.length)), - (f = i === a), + ((o = null === o ? d.errors : o.concat(d.errors)), (i = o.length)), + (f = a === i), (p = p || f); } - if (p) (a = l), null !== o && (l ? (o.length = l) : (o = null)); + if (p) (i = l), null !== o && (l ? (o.length = l) : (o = null)); else { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (i !== a) break; + if (a !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var y = p === a; - if (((l = l || y), !l)) { - const i = a; + var u = p === i; + if (((l = l || u), !l)) { + const a = i; d(e, { instancePath: t, parentData: r, parentDataProperty: n, rootData: s, - }) || ((o = null === o ? d.errors : o.concat(d.errors)), (a = o.length)), - (y = i === a), - (l = l || y); + }) || ((o = null === o ? d.errors : o.concat(d.errors)), (i = o.length)), + (u = a === i), + (l = l || u); } if (!l) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (g.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (g.errors = o), !1; } return ( - (a = i), - null !== o && (i ? (o.length = i) : (o = null)), + (i = a), + null !== o && (a ? (o.length = a) : (o = null)), (g.errors = o), - 0 === a + 0 === i ); } const h = { @@ -1479,6 +1558,10 @@ const h = { { type: 'array', items: { type: 'string', minLength: 1 } }, ], }, + shareStrategy: { + enum: ['version-first', 'loaded-first'], + type: 'string', + }, singleton: { type: 'boolean' }, strictVersion: { type: 'boolean' }, version: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, @@ -1508,75 +1591,75 @@ function v( rootData: o = e, } = {}, ) { - let a = null, - i = 0; - if (0 === i) { + let i = null, + a = 0; + if (0 === a) { if (!e || 'object' != typeof e || Array.isArray(e)) return (v.errors = [{ params: { type: 'object' } }]), !1; { - const t = i; + const t = a; for (const t in e) if (!s.call(h.properties, t)) return (v.errors = [{ params: { additionalProperty: t } }]), !1; - if (t === i) { + if (t === a) { if (void 0 !== e.eager) { - const t = i; + const t = a; if ('boolean' != typeof e.eager) return (v.errors = [{ params: { type: 'boolean' } }]), !1; - var l = t === i; + var l = t === a; } else l = !0; if (l) { if (void 0 !== e.exclude) { let t = e.exclude; - const r = i, - n = i, - s = i; + const r = a, + n = a, + s = a; let o = !1; - const y = i; + const u = a; if (t && 'object' == typeof t && !Array.isArray(t)) { let e; if (void 0 === t.request && (e = 'request')) { const t = { params: { missingProperty: e } }; - null === a ? (a = [t]) : a.push(t), i++; + null === i ? (i = [t]) : i.push(t), a++; } } - var p = y === i; + var p = u === a; if (((o = o || p), !o)) { - const e = i; + const e = a; if (t && 'object' == typeof t && !Array.isArray(t)) { let e; if (void 0 === t.version && (e = 'version')) { const t = { params: { missingProperty: e } }; - null === a ? (a = [t]) : a.push(t), i++; + null === i ? (i = [t]) : i.push(t), a++; } } - if (((p = e === i), (o = o || p), !o)) { - const e = i; + if (((p = e === a), (o = o || p), !o)) { + const e = a; if (t && 'object' == typeof t && !Array.isArray(t)) { let e; if (void 0 === t.fallbackVersion && (e = 'fallbackVersion')) { const t = { params: { missingProperty: e } }; - null === a ? (a = [t]) : a.push(t), i++; + null === i ? (i = [t]) : i.push(t), a++; } } - (p = e === i), (o = o || p); + (p = e === a), (o = o || p); } } if (!o) { const e = { params: {} }; return ( - null === a ? (a = [e]) : a.push(e), i++, (v.errors = a), !1 + null === i ? (i = [e]) : i.push(e), a++, (v.errors = i), !1 ); } if ( - ((i = s), - null !== a && (s ? (a.length = s) : (a = null)), - i === n) + ((a = s), + null !== i && (s ? (i.length = s) : (i = null)), + a === n) ) { if (!t || 'object' != typeof t || Array.isArray(t)) return (v.errors = [{ params: { type: 'object' } }]), !1; { - const e = i; + const e = a; for (const e in t) if ( 'request' !== e && @@ -1586,10 +1669,10 @@ function v( return ( (v.errors = [{ params: { additionalProperty: e } }]), !1 ); - if (e === i) { + if (e === a) { if (void 0 !== t.request) { let e = t.request; - const r = i; + const r = a; if ( 'string' != typeof e && (!e || 'object' != typeof e || Array.isArray(e)) @@ -1600,59 +1683,59 @@ function v( ]), !1 ); - var f = r === i; + var f = r === a; } else f = !0; if (f) { if (void 0 !== t.version) { - const e = i; + const e = a; if ('string' != typeof t.version) return ( (v.errors = [{ params: { type: 'string' } }]), !1 ); - f = e === i; + f = e === a; } else f = !0; if (f) if (void 0 !== t.fallbackVersion) { - const e = i; + const e = a; if ('string' != typeof t.fallbackVersion) return ( (v.errors = [{ params: { type: 'string' } }]), !1 ); - f = e === i; + f = e === a; } else f = !0; } } } } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.include) { let t = e.include; - const r = i, - n = i, - s = i; + const r = a, + n = a, + s = a; let o = !1; - const p = i; + const p = a; if (t && 'object' == typeof t && !Array.isArray(t)) { let e; if (void 0 === t.request && (e = 'request')) { const t = { params: { missingProperty: e } }; - null === a ? (a = [t]) : a.push(t), i++; + null === i ? (i = [t]) : i.push(t), a++; } } - var y = p === i; - if (((o = o || y), !o)) { - const e = i; + var u = p === a; + if (((o = o || u), !o)) { + const e = a; if (t && 'object' == typeof t && !Array.isArray(t)) { let e; if (void 0 === t.version && (e = 'version')) { const t = { params: { missingProperty: e } }; - null === a ? (a = [t]) : a.push(t), i++; + null === i ? (i = [t]) : i.push(t), a++; } } - if (((y = e === i), (o = o || y), !o)) { - const e = i; + if (((u = e === a), (o = o || u), !o)) { + const e = a; if (t && 'object' == typeof t && !Array.isArray(t)) { let e; if ( @@ -1660,27 +1743,27 @@ function v( (e = 'fallbackVersion') ) { const t = { params: { missingProperty: e } }; - null === a ? (a = [t]) : a.push(t), i++; + null === i ? (i = [t]) : i.push(t), a++; } } - (y = e === i), (o = o || y); + (u = e === a), (o = o || u); } } if (!o) { const e = { params: {} }; return ( - null === a ? (a = [e]) : a.push(e), i++, (v.errors = a), !1 + null === i ? (i = [e]) : i.push(e), a++, (v.errors = i), !1 ); } if ( - ((i = s), - null !== a && (s ? (a.length = s) : (a = null)), - i === n) + ((a = s), + null !== i && (s ? (i.length = s) : (i = null)), + a === n) ) { if (!t || 'object' != typeof t || Array.isArray(t)) return (v.errors = [{ params: { type: 'object' } }]), !1; { - const e = i; + const e = a; for (const e in t) if ( 'request' !== e && @@ -1690,10 +1773,10 @@ function v( return ( (v.errors = [{ params: { additionalProperty: e } }]), !1 ); - if (e === i) { + if (e === a) { if (void 0 !== t.request) { let e = t.request; - const r = i; + const r = a; if ( 'string' != typeof e && (!e || 'object' != typeof e || Array.isArray(e)) @@ -1704,88 +1787,88 @@ function v( ]), !1 ); - var c = r === i; + var c = r === a; } else c = !0; if (c) { if (void 0 !== t.version) { - const e = i; + const e = a; if ('string' != typeof t.version) return ( (v.errors = [{ params: { type: 'string' } }]), !1 ); - c = e === i; + c = e === a; } else c = !0; if (c) if (void 0 !== t.fallbackVersion) { - const e = i; + const e = a; if ('string' != typeof t.fallbackVersion) return ( (v.errors = [{ params: { type: 'string' } }]), !1 ); - c = e === i; + c = e === a; } else c = !0; } } } } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.import) { let t = e.import; - const r = i, - n = i; + const r = a, + n = a; let s = !1; - const o = i; + const o = a; if (!1 !== t) { const e = { params: { allowedValues: h.properties.import.anyOf[0].enum, }, }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } - var u = o === i; - if (((s = s || u), !s)) { - const e = i; - if (i == i) + var y = o === a; + if (((s = s || y), !s)) { + const e = a; + if (a == a) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } } else { const e = { params: { type: 'string' } }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } - (u = e === i), (s = s || u); + (y = e === a), (s = s || y); } if (!s) { const e = { params: {} }; return ( - null === a ? (a = [e]) : a.push(e), i++, (v.errors = a), !1 + null === i ? (i = [e]) : i.push(e), a++, (v.errors = i), !1 ); } - (i = n), - null !== a && (n ? (a.length = n) : (a = null)), - (l = r === i); + (a = n), + null !== i && (n ? (i.length = n) : (i = null)), + (l = r === a); } else l = !0; if (l) { if (void 0 !== e.request) { let t = e.request; - const r = i; - if (i === r) { + const r = a; + if (a === r) { if ('string' != typeof t) return (v.errors = [{ params: { type: 'string' } }]), !1; if (t.length < 1) return (v.errors = [{ params: {} }]), !1; } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.layer) { let t = e.layer; - const r = i; - if (i === r) { + const r = a; + if (a === r) { if ('string' != typeof t) return ( (v.errors = [{ params: { type: 'string' } }]), !1 @@ -1793,13 +1876,13 @@ function v( if (t.length < 1) return (v.errors = [{ params: {} }]), !1; } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.issuerLayer) { let t = e.issuerLayer; - const r = i; - if (i === r) { + const r = a; + if (a === r) { if ('string' != typeof t) return ( (v.errors = [{ params: { type: 'string' } }]), !1 @@ -1807,13 +1890,13 @@ function v( if (t.length < 1) return (v.errors = [{ params: {} }]), !1; } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.packageName) { let t = e.packageName; - const r = i; - if (i === r) { + const r = a; + if (a === r) { if ('string' != typeof t) return ( (v.errors = [{ params: { type: 'string' } }]), !1 @@ -1821,15 +1904,15 @@ function v( if (t.length < 1) return (v.errors = [{ params: {} }]), !1; } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.requiredVersion) { let t = e.requiredVersion; - const r = i, - n = i; + const r = a, + n = a; let s = !1; - const o = i; + const o = a; if (!1 !== t) { const e = { params: { @@ -1837,35 +1920,35 @@ function v( h.properties.requiredVersion.anyOf[0].enum, }, }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } - var m = o === i; + var m = o === a; if (((s = s || m), !s)) { - const e = i; + const e = a; if ('string' != typeof t) { const e = { params: { type: 'string' } }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } - (m = e === i), (s = s || m); + (m = e === a), (s = s || m); } if (!s) { const e = { params: {} }; return ( - null === a ? (a = [e]) : a.push(e), - i++, - (v.errors = a), + null === i ? (i = [e]) : i.push(e), + a++, + (v.errors = i), !1 ); } - (i = n), - null !== a && (n ? (a.length = n) : (a = null)), - (l = r === i); + (a = n), + null !== i && (n ? (i.length = n) : (i = null)), + (l = r === a); } else l = !0; if (l) { if (void 0 !== e.shareKey) { let t = e.shareKey; - const r = i; - if (i === r) { + const r = a; + if (a === r) { if ('string' != typeof t) return ( (v.errors = [{ params: { type: 'string' } }]), @@ -1874,151 +1957,182 @@ function v( if (t.length < 1) return (v.errors = [{ params: {} }]), !1; } - l = r === i; + l = r === a; } else l = !0; if (l) { if (void 0 !== e.shareScope) { let t = e.shareScope; - const r = i, - n = i; + const r = a, + n = a; let s = !1; - const o = i; - if (i === o) + const o = a; + if (a === o) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } } else { const e = { params: { type: 'string' } }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } - var d = o === i; + var d = o === a; if (((s = s || d), !s)) { - const e = i; - if (i === e) + const e = a; + if (a === e) if (Array.isArray(t)) { const e = t.length; for (let r = 0; r < e; r++) { let e = t[r]; - const n = i; - if (i === n) + const n = a; + if (a === n) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === a ? (a = [e]) : a.push(e), - i++; + null === i ? (i = [e]) : i.push(e), + a++; } } else { const e = { params: { type: 'string' }, }; - null === a ? (a = [e]) : a.push(e), - i++; + null === i ? (i = [e]) : i.push(e), + a++; } - if (n !== i) break; + if (n !== a) break; } } else { const e = { params: { type: 'array' } }; - null === a ? (a = [e]) : a.push(e), i++; + null === i ? (i = [e]) : i.push(e), a++; } - (d = e === i), (s = s || d); + (d = e === a), (s = s || d); } if (!s) { const e = { params: {} }; return ( - null === a ? (a = [e]) : a.push(e), - i++, - (v.errors = a), + null === i ? (i = [e]) : i.push(e), + a++, + (v.errors = i), !1 ); } - (i = n), - null !== a && (n ? (a.length = n) : (a = null)), - (l = r === i); + (a = n), + null !== i && (n ? (i.length = n) : (i = null)), + (l = r === a); } else l = !0; if (l) { - if (void 0 !== e.singleton) { - const t = i; - if ('boolean' != typeof e.singleton) + if (void 0 !== e.shareStrategy) { + let t = e.shareStrategy; + const r = a; + if ('string' != typeof t) return ( (v.errors = [ - { params: { type: 'boolean' } }, + { params: { type: 'string' } }, ]), !1 ); - l = t === i; + if ( + 'version-first' !== t && + 'loaded-first' !== t + ) + return ( + (v.errors = [ + { + params: { + allowedValues: + h.properties.shareStrategy.enum, + }, + }, + ]), + !1 + ); + l = r === a; } else l = !0; if (l) { - if (void 0 !== e.strictVersion) { - const t = i; - if ('boolean' != typeof e.strictVersion) + if (void 0 !== e.singleton) { + const t = a; + if ('boolean' != typeof e.singleton) return ( (v.errors = [ { params: { type: 'boolean' } }, ]), !1 ); - l = t === i; + l = t === a; } else l = !0; if (l) { - if (void 0 !== e.version) { - let t = e.version; - const r = i, - n = i; - let s = !1; - const o = i; - if (!1 !== t) { - const e = { - params: { - allowedValues: - h.properties.version.anyOf[0].enum, - }, - }; - null === a ? (a = [e]) : a.push(e), i++; - } - var g = o === i; - if (((s = s || g), !s)) { - const e = i; - if ('string' != typeof t) { - const e = { - params: { type: 'string' }, - }; - null === a ? (a = [e]) : a.push(e), i++; - } - (g = e === i), (s = s || g); - } - if (!s) { - const e = { params: {} }; + if (void 0 !== e.strictVersion) { + const t = a; + if ('boolean' != typeof e.strictVersion) return ( - null === a ? (a = [e]) : a.push(e), - i++, - (v.errors = a), + (v.errors = [ + { params: { type: 'boolean' } }, + ]), !1 ); - } - (i = n), - null !== a && - (n ? (a.length = n) : (a = null)), - (l = r === i); + l = t === a; } else l = !0; - if (l) - if ( - void 0 !== e.allowNodeModulesSuffixMatch - ) { - const t = i; - if ( - 'boolean' != - typeof e.allowNodeModulesSuffixMatch - ) + if (l) { + if (void 0 !== e.version) { + let t = e.version; + const r = a, + n = a; + let s = !1; + const o = a; + if (!1 !== t) { + const e = { + params: { + allowedValues: + h.properties.version.anyOf[0] + .enum, + }, + }; + null === i ? (i = [e]) : i.push(e), a++; + } + var g = o === a; + if (((s = s || g), !s)) { + const e = a; + if ('string' != typeof t) { + const e = { + params: { type: 'string' }, + }; + null === i ? (i = [e]) : i.push(e), + a++; + } + (g = e === a), (s = s || g); + } + if (!s) { + const e = { params: {} }; return ( - (v.errors = [ - { params: { type: 'boolean' } }, - ]), + null === i ? (i = [e]) : i.push(e), + a++, + (v.errors = i), !1 ); - l = t === i; + } + (a = n), + null !== i && + (n ? (i.length = n) : (i = null)), + (l = r === a); } else l = !0; + if (l) + if ( + void 0 !== e.allowNodeModulesSuffixMatch + ) { + const t = a; + if ( + 'boolean' != + typeof e.allowNodeModulesSuffixMatch + ) + return ( + (v.errors = [ + { params: { type: 'boolean' } }, + ]), + !1 + ); + l = t === a; + } else l = !0; + } } } } @@ -2035,7 +2149,7 @@ function v( } } } - return (v.errors = a), 0 === i; + return (v.errors = i), 0 === a; } function P( e, @@ -2047,46 +2161,46 @@ function P( } = {}, ) { let o = null, - a = 0; - if (0 === a) { + i = 0; + if (0 === i) { if (!e || 'object' != typeof e || Array.isArray(e)) return (P.errors = [{ params: { type: 'object' } }]), !1; for (const r in e) { let n = e[r]; - const l = a, - p = a; + const l = i, + p = i; let f = !1; - const y = a; + const u = i; v(n, { instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: e, parentDataProperty: r, rootData: s, - }) || ((o = null === o ? v.errors : o.concat(v.errors)), (a = o.length)); - var i = y === a; - if (((f = f || i), !f)) { - const e = a; - if (a == a) + }) || ((o = null === o ? v.errors : o.concat(v.errors)), (i = o.length)); + var a = u === i; + if (((f = f || a), !f)) { + const e = i; + if (i == i) if ('string' == typeof n) { if (n.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - (i = e === a), (f = f || i); + (a = e === i), (f = f || a); } if (!f) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (P.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (P.errors = o), !1; } - if (((a = p), null !== o && (p ? (o.length = p) : (o = null)), l !== a)) + if (((i = p), null !== o && (p ? (o.length = p) : (o = null)), l !== i)) break; } } - return (P.errors = o), 0 === a; + return (P.errors = o), 0 === i; } function j( e, @@ -2098,160 +2212,227 @@ function j( } = {}, ) { let o = null, - a = 0; - const i = a; + i = 0; + const a = i; let l = !1; - const p = a; - if (a === p) + const p = i; + if (i === p) if (Array.isArray(e)) { const r = e.length; for (let n = 0; n < r; n++) { let r = e[n]; - const i = a, - l = a; + const a = i, + l = i; let p = !1; - const y = a; - if (a == a) + const u = i; + if (i == i) if ('string' == typeof r) { if (r.length < 1) { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } } else { const e = { params: { type: 'string' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var f = y === a; + var f = u === i; if (((p = p || f), !p)) { - const i = a; + const a = i; P(r, { instancePath: t + '/' + n, parentData: e, parentDataProperty: n, rootData: s, }) || - ((o = null === o ? P.errors : o.concat(P.errors)), (a = o.length)), - (f = i === a), + ((o = null === o ? P.errors : o.concat(P.errors)), (i = o.length)), + (f = a === i), (p = p || f); } - if (p) (a = l), null !== o && (l ? (o.length = l) : (o = null)); + if (p) (i = l), null !== o && (l ? (o.length = l) : (o = null)); else { const e = { params: {} }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - if (i !== a) break; + if (a !== i) break; } } else { const e = { params: { type: 'array' } }; - null === o ? (o = [e]) : o.push(e), a++; + null === o ? (o = [e]) : o.push(e), i++; } - var y = p === a; - if (((l = l || y), !l)) { - const i = a; + var u = p === i; + if (((l = l || u), !l)) { + const a = i; P(e, { instancePath: t, parentData: r, parentDataProperty: n, rootData: s, - }) || ((o = null === o ? P.errors : o.concat(P.errors)), (a = o.length)), - (y = i === a), - (l = l || y); + }) || ((o = null === o ? P.errors : o.concat(P.errors)), (i = o.length)), + (u = a === i), + (l = l || u); } if (!l) { const e = { params: {} }; - return null === o ? (o = [e]) : o.push(e), a++, (j.errors = o), !1; + return null === o ? (o = [e]) : o.push(e), i++, (j.errors = o), !1; } return ( - (a = i), - null !== o && (i ? (o.length = i) : (o = null)), + (i = a), + null !== o && (a ? (o.length = a) : (o = null)), (j.errors = o), - 0 === a + 0 === i ); } -function D( +function A( o, { - instancePath: a = '', - parentData: i, + instancePath: i = '', + parentData: a, parentDataProperty: p, rootData: f = o, } = {}, ) { - let y = null, - u = 0; - if (0 === u) { + let u = null, + y = 0; + if (0 === y) { if (!o || 'object' != typeof o || Array.isArray(o)) - return (D.errors = [{ params: { type: 'object' } }]), !1; + return (A.errors = [{ params: { type: 'object' } }]), !1; { - const i = u; + const a = y; for (const e in o) if (!s.call(t.properties, e)) - return (D.errors = [{ params: { additionalProperty: e } }]), !1; - if (i === u) { + return (A.errors = [{ params: { additionalProperty: e } }]), !1; + if (a === y) { if (void 0 !== o.async) { - const e = u; - if ('boolean' != typeof o.async) - return (D.errors = [{ params: { type: 'boolean' } }]), !1; - var m = e === u; - } else m = !0; - if (m) { + let e = o.async; + const t = y, + r = y; + let n = !1; + const s = y; + if ('boolean' != typeof e) { + const e = { params: { type: 'boolean' } }; + null === u ? (u = [e]) : u.push(e), y++; + } + var m = s === y; + if (((n = n || m), !n)) { + const t = y; + if (y === t) + if (e && 'object' == typeof e && !Array.isArray(e)) { + const t = y; + for (const t in e) + if ('eager' !== t && 'excludeChunk' !== t) { + const e = { params: { additionalProperty: t } }; + null === u ? (u = [e]) : u.push(e), y++; + break; + } + if (t === y) { + if (void 0 !== e.eager) { + let t = e.eager; + const r = y, + n = y; + let s = !1; + const o = y; + if (!(t instanceof RegExp)) { + const e = { params: {} }; + null === u ? (u = [e]) : u.push(e), y++; + } + var d = o === y; + if (((s = s || d), !s)) { + const e = y; + if (!(t instanceof Function)) { + const e = { params: {} }; + null === u ? (u = [e]) : u.push(e), y++; + } + (d = e === y), (s = s || d); + } + if (s) + (y = n), null !== u && (n ? (u.length = n) : (u = null)); + else { + const e = { params: {} }; + null === u ? (u = [e]) : u.push(e), y++; + } + var h = r === y; + } else h = !0; + if (h) + if (void 0 !== e.excludeChunk) { + const t = y; + if (!(e.excludeChunk instanceof Function)) { + const e = { params: {} }; + null === u ? (u = [e]) : u.push(e), y++; + } + h = t === y; + } else h = !0; + } + } else { + const e = { params: { type: 'object' } }; + null === u ? (u = [e]) : u.push(e), y++; + } + (m = t === y), (n = n || m); + } + if (!n) { + const e = { params: {} }; + return null === u ? (u = [e]) : u.push(e), y++, (A.errors = u), !1; + } + (y = r), null !== u && (r ? (u.length = r) : (u = null)); + var b = t === y; + } else b = !0; + if (b) { if (void 0 !== o.exposes) { - const e = u; + const e = y; l(o.exposes, { - instancePath: a + '/exposes', + instancePath: i + '/exposes', parentData: o, parentDataProperty: 'exposes', rootData: f, }) || - ((y = null === y ? l.errors : y.concat(l.errors)), - (u = y.length)), - (m = e === u); - } else m = !0; - if (m) { + ((u = null === u ? l.errors : u.concat(l.errors)), + (y = u.length)), + (b = e === y); + } else b = !0; + if (b) { if (void 0 !== o.filename) { let t = o.filename; - const r = u; - if (u === r) { + const r = y; + if (y === r) { if ('string' != typeof t) - return (D.errors = [{ params: { type: 'string' } }]), !1; - if (t.length < 1) return (D.errors = [{ params: {} }]), !1; + return (A.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (A.errors = [{ params: {} }]), !1; if (t.includes('!') || !1 !== e.test(t)) - return (D.errors = [{ params: {} }]), !1; + return (A.errors = [{ params: {} }]), !1; } - m = r === u; - } else m = !0; - if (m) { + b = r === y; + } else b = !0; + if (b) { if (void 0 !== o.library) { - const e = u; + const e = y; c(o.library, { - instancePath: a + '/library', + instancePath: i + '/library', parentData: o, parentDataProperty: 'library', rootData: f, }) || - ((y = null === y ? c.errors : y.concat(c.errors)), - (u = y.length)), - (m = e === u); - } else m = !0; - if (m) { + ((u = null === u ? c.errors : u.concat(c.errors)), + (y = u.length)), + (b = e === y); + } else b = !0; + if (b) { if (void 0 !== o.name) { let e = o.name; - const t = u; - if (u === t) { + const t = y; + if (y === t) { if ('string' != typeof e) - return (D.errors = [{ params: { type: 'string' } }]), !1; - if (e.length < 1) return (D.errors = [{ params: {} }]), !1; + return (A.errors = [{ params: { type: 'string' } }]), !1; + if (e.length < 1) return (A.errors = [{ params: {} }]), !1; } - m = t === u; - } else m = !0; - if (m) { + b = t === y; + } else b = !0; + if (b) { if (void 0 !== o.remoteType) { let e = o.remoteType; - const t = u, - n = u; + const t = y, + n = y; let s = !1, - a = null; - const i = u; + i = null; + const a = y; if ( 'var' !== e && 'module' !== e && @@ -2277,144 +2458,144 @@ function D( 'node-commonjs' !== e ) { const e = { params: { allowedValues: r.enum } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - if ((i === u && ((s = !0), (a = 0)), !s)) { - const e = { params: { passingSchemas: a } }; + if ((a === y && ((s = !0), (i = 0)), !s)) { + const e = { params: { passingSchemas: i } }; return ( - null === y ? (y = [e]) : y.push(e), - u++, - (D.errors = y), + null === u ? (u = [e]) : u.push(e), + y++, + (A.errors = u), !1 ); } - (u = n), - null !== y && (n ? (y.length = n) : (y = null)), - (m = t === u); - } else m = !0; - if (m) { + (y = n), + null !== u && (n ? (u.length = n) : (u = null)), + (b = t === y); + } else b = !0; + if (b) { if (void 0 !== o.remotes) { - const e = u; + const e = y; g(o.remotes, { - instancePath: a + '/remotes', + instancePath: i + '/remotes', parentData: o, parentDataProperty: 'remotes', rootData: f, }) || - ((y = null === y ? g.errors : y.concat(g.errors)), - (u = y.length)), - (m = e === u); - } else m = !0; - if (m) { + ((u = null === u ? g.errors : u.concat(g.errors)), + (y = u.length)), + (b = e === y); + } else b = !0; + if (b) { if (void 0 !== o.runtime) { let e = o.runtime; - const t = u, - r = u; + const t = y, + r = y; let s = !1; - const a = u; + const i = y; if (!1 !== e) { const e = { params: { allowedValues: n.anyOf[0].enum }, }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - var d = a === u; - if (((s = s || d), !s)) { - const t = u; - if (u === t) + var v = i === y; + if (((s = s || v), !s)) { + const t = y; + if (y === t) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } } else { const e = { params: { type: 'string' } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - (d = t === u), (s = s || d); + (v = t === y), (s = s || v); } if (!s) { const e = { params: {} }; return ( - null === y ? (y = [e]) : y.push(e), - u++, - (D.errors = y), + null === u ? (u = [e]) : u.push(e), + y++, + (A.errors = u), !1 ); } - (u = r), - null !== y && (r ? (y.length = r) : (y = null)), - (m = t === u); - } else m = !0; - if (m) { + (y = r), + null !== u && (r ? (u.length = r) : (u = null)), + (b = t === y); + } else b = !0; + if (b) { if (void 0 !== o.shareScope) { let e = o.shareScope; - const t = u, - r = u; + const t = y, + r = y; let n = !1; - const s = u; - if (u === s) + const s = y; + if (y === s) if ('string' == typeof e) { if (e.length < 1) { const e = { params: {} }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } } else { const e = { params: { type: 'string' } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - var h = s === u; - if (((n = n || h), !n)) { - const t = u; - if (u === t) + var P = s === y; + if (((n = n || P), !n)) { + const t = y; + if (y === t) if (Array.isArray(e)) { const t = e.length; for (let r = 0; r < t; r++) { let t = e[r]; - const n = u; - if (u === n) + const n = y; + if (y === n) if ('string' == typeof t) { if (t.length < 1) { const e = { params: {} }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } } else { const e = { params: { type: 'string' } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - if (n !== u) break; + if (n !== y) break; } } else { const e = { params: { type: 'array' } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - (h = t === u), (n = n || h); + (P = t === y), (n = n || P); } if (!n) { const e = { params: {} }; return ( - null === y ? (y = [e]) : y.push(e), - u++, - (D.errors = y), + null === u ? (u = [e]) : u.push(e), + y++, + (A.errors = u), !1 ); } - (u = r), - null !== y && (r ? (y.length = r) : (y = null)), - (m = t === u); - } else m = !0; - if (m) { + (y = r), + null !== u && (r ? (u.length = r) : (u = null)), + (b = t === y); + } else b = !0; + if (b) { if (void 0 !== o.shareStrategy) { let e = o.shareStrategy; - const r = u; + const r = y; if ('string' != typeof e) return ( - (D.errors = [{ params: { type: 'string' } }]), + (A.errors = [{ params: { type: 'string' } }]), !1 ); if ('version-first' !== e && 'loaded-first' !== e) return ( - (D.errors = [ + (A.errors = [ { params: { allowedValues: @@ -2424,37 +2605,37 @@ function D( ]), !1 ); - m = r === u; - } else m = !0; - if (m) { + b = r === y; + } else b = !0; + if (b) { if (void 0 !== o.shared) { - const e = u; + const e = y; j(o.shared, { - instancePath: a + '/shared', + instancePath: i + '/shared', parentData: o, parentDataProperty: 'shared', rootData: f, }) || - ((y = - null === y ? j.errors : y.concat(j.errors)), - (u = y.length)), - (m = e === u); - } else m = !0; - if (m) { + ((u = + null === u ? j.errors : u.concat(j.errors)), + (y = u.length)), + (b = e === y); + } else b = !0; + if (b) { if (void 0 !== o.dts) { let e = o.dts; - const t = u, - r = u; - let n = !1; - const s = u; + const r = y, + n = y; + let s = !1; + const i = y; if ('boolean' != typeof e) { const e = { params: { type: 'boolean' } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - var b = s === u; - if (((n = n || b), !n)) { - const t = u; - if (u === t) + var D = i === y; + if (((s = s || D), !s)) { + const r = y; + if (y === r) if ( e && 'object' == typeof e && @@ -2462,28 +2643,28 @@ function D( ) { if (void 0 !== e.generateTypes) { let t = e.generateTypes; - const r = u, - n = u; + const r = y, + n = y; let s = !1; - const o = u; + const o = y; if ('boolean' != typeof t) { const e = { params: { type: 'boolean' }, }; - null === y ? (y = [e]) : y.push(e), - u++; + null === u ? (u = [e]) : u.push(e), + y++; } - var v = o === u; - if (((s = s || v), !s)) { - const e = u; - if (u === e) + var x = o === y; + if (((s = s || x), !s)) { + const e = y; + if (y === e) if ( t && 'object' == typeof t && !Array.isArray(t) ) { if (void 0 !== t.tsConfigPath) { - const e = u; + const e = y; if ( 'string' != typeof t.tsConfigPath @@ -2491,16 +2672,16 @@ function D( const e = { params: { type: 'string' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - var P = e === u; - } else P = !0; - if (P) { + var O = e === y; + } else O = !0; + if (O) { if (void 0 !== t.typesFolder) { - const e = u; + const e = y; if ( 'string' != typeof t.typesFolder @@ -2510,19 +2691,19 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + O = e === y; + } else O = !0; + if (O) { if ( void 0 !== t.compiledTypesFolder ) { - const e = u; + const e = y; if ( 'string' != typeof t.compiledTypesFolder @@ -2532,19 +2713,19 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + O = e === y; + } else O = !0; + if (O) { if ( void 0 !== t.deleteTypesFolder ) { - const e = u; + const e = y; if ( 'boolean' != typeof t.deleteTypesFolder @@ -2554,22 +2735,22 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + O = e === y; + } else O = !0; + if (O) { if ( void 0 !== t.additionalFilesToCompile ) { let e = t.additionalFilesToCompile; - const r = u; - if (u === r) + const r = y; + if (y === r) if ( Array.isArray(e) ) { @@ -2579,7 +2760,7 @@ function D( r < t; r++ ) { - const t = u; + const t = y; if ( 'string' != typeof e[r] @@ -2589,12 +2770,12 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - if (t !== u) + if (t !== y) break; } } else { @@ -2603,19 +2784,19 @@ function D( type: 'array', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = r === u; - } else P = !0; - if (P) { + O = r === y; + } else O = !0; + if (O) { if ( void 0 !== t.compileInChildProcess ) { - const e = u; + const e = y; if ( 'boolean' != typeof t.compileInChildProcess @@ -2625,19 +2806,19 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + O = e === y; + } else O = !0; + if (O) { if ( void 0 !== t.compilerInstance ) { - const e = u; + const e = y; if ( 'string' != typeof t.compilerInstance @@ -2647,19 +2828,19 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + O = e === y; + } else O = !0; + if (O) { if ( void 0 !== t.generateAPITypes ) { - const e = u; + const e = y; if ( 'boolean' != typeof t.generateAPITypes @@ -2669,41 +2850,280 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + O = e === y; + } else O = !0; + if (O) { if ( void 0 !== t.extractThirdParty ) { - const e = u; + let e = + t.extractThirdParty; + const r = y, + n = y; + let s = !1; + const o = y; if ( 'boolean' != - typeof t.extractThirdParty + typeof e ) { const e = { params: { type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - P = e === u; - } else P = !0; - if (P) { + var T = o === y; + if ( + ((s = s || T), + !s) + ) { + const t = y; + if (y === t) + if ( + e && + 'object' == + typeof e && + !Array.isArray( + e, + ) + ) { + const t = + y; + for (const t in e) + if ( + 'exclude' !== + t + ) { + const e = + { + params: + { + additionalProperty: + t, + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + break; + } + if ( + t === + y && + void 0 !== + e.exclude + ) { + let t = + e.exclude; + if ( + y == y + ) + if ( + Array.isArray( + t, + ) + ) { + const e = + t.length; + for ( + let r = 0; + r < + e; + r++ + ) { + let e = + t[ + r + ]; + const n = + y, + s = + y; + let o = + !1; + const i = + y; + if ( + 'string' != + typeof e + ) { + const e = + { + params: + { + type: 'string', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + var L = + i === + y; + if ( + ((o = + o || + L), + !o) + ) { + const t = + y; + if ( + !( + e instanceof + RegExp + ) + ) { + const e = + { + params: + {}, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + (L = + t === + y), + (o = + o || + L); + } + if ( + o + ) + (y = + s), + null !== + u && + (s + ? (u.length = + s) + : (u = + null)); + else { + const e = + { + params: + {}, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + if ( + n !== + y + ) + break; + } + } else { + const e = + { + params: + { + type: 'array', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + } + } else { + const e = + { + params: + { + type: 'object', + }, + }; + null === u + ? (u = [ + e, + ]) + : u.push( + e, + ), + y++; + } + (T = t === y), + (s = + s || T); + } + if (s) + (y = n), + null !== + u && + (n + ? (u.length = + n) + : (u = + null)); + else { + const e = { + params: {}, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + O = r === y; + } else O = !0; + if (O) { if ( void 0 !== t.extractRemoteTypes ) { - const e = u; + const e = y; if ( 'boolean' != typeof t.extractRemoteTypes @@ -2713,23 +3133,23 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [ + null === u + ? (u = [ e, ]) - : y.push( + : u.push( e, ), - u++; + y++; } - P = e === u; - } else P = !0; - if (P) + O = e === y; + } else O = !0; + if (O) if ( void 0 !== t.abortOnError ) { - const e = u; + const e = y; if ( 'boolean' != typeof t.abortOnError @@ -2741,17 +3161,17 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [ + null === u + ? (u = [ e, ]) - : y.push( + : u.push( e, ), - u++; + y++; } - P = e === u; - } else P = !0; + O = e === y; + } else O = !0; } } } @@ -2765,183 +3185,183 @@ function D( const e = { params: { type: 'object' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - (v = e === u), (s = s || v); + (x = e === y), (s = s || x); } if (s) - (u = n), - null !== y && - (n ? (y.length = n) : (y = null)); + (y = n), + null !== u && + (n ? (u.length = n) : (u = null)); else { const e = { params: {} }; - null === y ? (y = [e]) : y.push(e), - u++; + null === u ? (u = [e]) : u.push(e), + y++; } - var A = r === u; - } else A = !0; - if (A) { + var k = r === y; + } else k = !0; + if (k) { if (void 0 !== e.consumeTypes) { - let t = e.consumeTypes; - const r = u, - n = u; - let s = !1; - const o = u; - if ('boolean' != typeof t) { + let r = e.consumeTypes; + const n = y, + s = y; + let o = !1; + const i = y; + if ('boolean' != typeof r) { const e = { params: { type: 'boolean' }, }; - null === y ? (y = [e]) : y.push(e), - u++; + null === u ? (u = [e]) : u.push(e), + y++; } - var x = o === u; - if (((s = s || x), !s)) { - const e = u; - if (u === e) + var R = i === y; + if (((o = o || R), !o)) { + const e = y; + if (y === e) if ( - t && - 'object' == typeof t && - !Array.isArray(t) + r && + 'object' == typeof r && + !Array.isArray(r) ) { - if (void 0 !== t.typesFolder) { - const e = u; + if (void 0 !== r.typesFolder) { + const e = y; if ( 'string' != - typeof t.typesFolder + typeof r.typesFolder ) { const e = { params: { type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - var O = e === u; - } else O = !0; - if (O) { + var E = e === y; + } else E = !0; + if (E) { if ( - void 0 !== t.abortOnError + void 0 !== r.abortOnError ) { - const e = u; + const e = y; if ( 'boolean' != - typeof t.abortOnError + typeof r.abortOnError ) { const e = { params: { type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - O = e === u; - } else O = !0; - if (O) { + E = e === y; + } else E = !0; + if (E) { if ( void 0 !== - t.remoteTypesFolder + r.remoteTypesFolder ) { - const e = u; + const e = y; if ( 'string' != - typeof t.remoteTypesFolder + typeof r.remoteTypesFolder ) { const e = { params: { type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - O = e === u; - } else O = !0; - if (O) { + E = e === y; + } else E = !0; + if (E) { if ( void 0 !== - t.deleteTypesFolder + r.deleteTypesFolder ) { - const e = u; + const e = y; if ( 'boolean' != - typeof t.deleteTypesFolder + typeof r.deleteTypesFolder ) { const e = { params: { type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - O = e === u; - } else O = !0; - if (O) { + E = e === y; + } else E = !0; + if (E) { if ( void 0 !== - t.maxRetries + r.maxRetries ) { - const e = u; + const e = y; if ( 'number' != - typeof t.maxRetries + typeof r.maxRetries ) { const e = { params: { type: 'number', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - O = e === u; - } else O = !0; - if (O) { + E = e === y; + } else E = !0; + if (E) { if ( void 0 !== - t.consumeAPITypes + r.consumeAPITypes ) { - const e = u; + const e = y; if ( 'boolean' != - typeof t.consumeAPITypes + typeof r.consumeAPITypes ) { const e = { params: { type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - O = e === u; - } else O = !0; - if (O) + E = e === y; + } else E = !0; + if (E) { if ( void 0 !== - t.runtimePkgs + r.runtimePkgs ) { let e = - t.runtimePkgs; - const r = u; - if (u === r) + r.runtimePkgs; + const t = y; + if (y === t) if ( Array.isArray( e, @@ -2954,7 +3374,7 @@ function D( r < t; r++ ) { - const t = u; + const t = y; if ( 'string' != typeof e[ @@ -2968,16 +3388,16 @@ function D( type: 'string', }, }; - null === y - ? (y = [ + null === u + ? (u = [ e, ]) - : y.push( + : u.push( e, ), - u++; + y++; } - if (t !== u) + if (t !== y) break; } } else { @@ -2986,13 +3406,415 @@ function D( type: 'array', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - O = r === u; - } else O = !0; + E = t === y; + } else E = !0; + if (E) { + if ( + void 0 !== + r.remoteTypeUrls + ) { + let e = + r.remoteTypeUrls; + const t = y, + n = y; + let s = !1; + const o = y; + if ( + !( + e instanceof + Function + ) + ) { + const e = { + params: {}, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + var I = o === y; + if ( + ((s = s || I), + !s) + ) { + const t = y; + if (y === t) + if ( + e && + 'object' == + typeof e && + !Array.isArray( + e, + ) + ) + for (const t in e) { + let r = + e[t]; + const n = + y; + if ( + y === + n + ) + if ( + r && + 'object' == + typeof r && + !Array.isArray( + r, + ) + ) { + let e; + if ( + (void 0 === + r.api && + (e = + 'api')) || + (void 0 === + r.zip && + (e = + 'zip')) + ) { + const t = + { + params: + { + missingProperty: + e, + }, + }; + null === + u + ? (u = + [ + t, + ]) + : u.push( + t, + ), + y++; + } else { + const e = + y; + for (const e in r) + if ( + 'alias' !== + e && + 'api' !== + e && + 'zip' !== + e + ) { + const t = + { + params: + { + additionalProperty: + e, + }, + }; + null === + u + ? (u = + [ + t, + ]) + : u.push( + t, + ), + y++; + break; + } + if ( + e === + y + ) { + if ( + void 0 !== + r.alias + ) { + const e = + y; + if ( + 'string' != + typeof r.alias + ) { + const e = + { + params: + { + type: 'string', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + var S = + e === + y; + } else + S = + !0; + if ( + S + ) { + if ( + void 0 !== + r.api + ) { + const e = + y; + if ( + 'string' != + typeof r.api + ) { + const e = + { + params: + { + type: 'string', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + S = + e === + y; + } else + S = + !0; + if ( + S + ) + if ( + void 0 !== + r.zip + ) { + const e = + y; + if ( + 'string' != + typeof r.zip + ) { + const e = + { + params: + { + type: 'string', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + S = + e === + y; + } else + S = + !0; + } + } + } + } else { + const e = + { + params: + { + type: 'object', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + if ( + n !== + y + ) + break; + } + else { + const e = + { + params: + { + type: 'object', + }, + }; + null === u + ? (u = [ + e, + ]) + : u.push( + e, + ), + y++; + } + (I = t === y), + (s = + s || I); + } + if (s) + (y = n), + null !== + u && + (n + ? (u.length = + n) + : (u = + null)); + else { + const e = { + params: {}, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + E = t === y; + } else E = !0; + if (E) { + if ( + void 0 !== + r.timeout + ) { + const e = y; + if ( + 'number' != + typeof r.timeout + ) { + const e = { + params: { + type: 'number', + }, + }; + null === u + ? (u = [ + e, + ]) + : u.push( + e, + ), + y++; + } + E = e === y; + } else E = !0; + if (E) { + if ( + void 0 !== + r.family + ) { + let e = + r.family; + const n = y; + if ( + 4 !== e && + 6 !== e + ) { + const e = + { + params: + { + allowedValues: + t + .properties + .dts + .anyOf[1] + .properties + .consumeTypes + .anyOf[1] + .properties + .family + .enum, + }, + }; + null === u + ? (u = [ + e, + ]) + : u.push( + e, + ), + y++; + } + E = n === y; + } else E = !0; + if (E) + if ( + void 0 !== + r.typesOnBuild + ) { + const e = + y; + if ( + 'boolean' != + typeof r.typesOnBuild + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + u + ? (u = + [ + e, + ]) + : u.push( + e, + ), + y++; + } + E = + e === y; + } else + E = !0; + } + } + } + } } } } @@ -3002,46 +3824,46 @@ function D( const e = { params: { type: 'object' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - (x = e === u), (s = s || x); + (R = e === y), (o = o || R); } - if (s) - (u = n), - null !== y && - (n - ? (y.length = n) - : (y = null)); + if (o) + (y = s), + null !== u && + (s + ? (u.length = s) + : (u = null)); else { const e = { params: {} }; - null === y ? (y = [e]) : y.push(e), - u++; + null === u ? (u = [e]) : u.push(e), + y++; } - A = r === u; - } else A = !0; - if (A) { + k = n === y; + } else k = !0; + if (k) { if (void 0 !== e.tsConfigPath) { - const t = u; + const t = y; if ( 'string' != typeof e.tsConfigPath ) { const e = { params: { type: 'string' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - A = t === u; - } else A = !0; - if (A) { + k = t === y; + } else k = !0; + if (k) { if (void 0 !== e.extraOptions) { let t = e.extraOptions; - const r = u; + const r = y; if ( !t || 'object' != typeof t || @@ -3050,16 +3872,16 @@ function D( const e = { params: { type: 'object' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - A = r === u; - } else A = !0; - if (A) { + k = r === y; + } else k = !0; + if (k) { if (void 0 !== e.implementation) { - const t = u; + const t = y; if ( 'string' != typeof e.implementation @@ -3067,16 +3889,16 @@ function D( const e = { params: { type: 'string' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - A = t === u; - } else A = !0; - if (A) { + k = t === y; + } else k = !0; + if (k) { if (void 0 !== e.cwd) { - const t = u; + const t = y; if ( 'string' != typeof e.cwd ) { @@ -3085,19 +3907,19 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - A = t === u; - } else A = !0; - if (A) + k = t === y; + } else k = !0; + if (k) if ( void 0 !== e.displayErrorInTerminal ) { - const t = u; + const t = y; if ( 'boolean' != typeof e.displayErrorInTerminal @@ -3107,13 +3929,13 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - A = t === u; - } else A = !0; + k = t === y; + } else k = !0; } } } @@ -3121,108 +3943,200 @@ function D( } } else { const e = { params: { type: 'object' } }; - null === y ? (y = [e]) : y.push(e), u++; + null === u ? (u = [e]) : u.push(e), y++; } - (b = t === u), (n = n || b); + (D = r === y), (s = s || D); } - if (!n) { + if (!s) { const e = { params: {} }; return ( - null === y ? (y = [e]) : y.push(e), - u++, - (D.errors = y), + null === u ? (u = [e]) : u.push(e), + y++, + (A.errors = u), !1 ); } - (u = r), - null !== y && - (r ? (y.length = r) : (y = null)), - (m = t === u); - } else m = !0; - if (m) { + (y = n), + null !== u && + (n ? (u.length = n) : (u = null)), + (b = r === y); + } else b = !0; + if (b) { if (void 0 !== o.experiments) { let e = o.experiments; - const t = u; - if (u === t) { + const r = y; + if (y === r) { if ( !e || 'object' != typeof e || Array.isArray(e) ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'object' } }, ]), !1 ); if (void 0 !== e.asyncStartup) { - const t = u; + const t = y; if ('boolean' != typeof e.asyncStartup) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'boolean' } }, ]), !1 ); - var L = t === u; - } else L = !0; - if (L) { + var $ = t === y; + } else $ = !0; + if ($) { if (void 0 !== e.externalRuntime) { - const t = u; + const t = y; if ( 'boolean' != typeof e.externalRuntime ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'boolean' } }, ]), !1 ); - L = t === u; - } else L = !0; - if (L) + $ = t === y; + } else $ = !0; + if ($) { if ( void 0 !== e.provideExternalRuntime ) { - const t = u; + const t = y; if ( 'boolean' != typeof e.provideExternalRuntime ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'boolean' } }, ]), !1 ); - L = t === u; - } else L = !0; + $ = t === y; + } else $ = !0; + if ($) + if (void 0 !== e.optimization) { + let r = e.optimization; + const n = y; + if (y === n) { + if ( + !r || + 'object' != typeof r || + Array.isArray(r) + ) + return ( + (A.errors = [ + { + params: { + type: 'object', + }, + }, + ]), + !1 + ); + { + const e = y; + for (const e in r) + if ( + 'disableSnapshot' !== e && + 'target' !== e + ) + return ( + (A.errors = [ + { + params: { + additionalProperty: + e, + }, + }, + ]), + !1 + ); + if (e === y) { + if ( + void 0 !== r.disableSnapshot + ) { + const e = y; + if ( + 'boolean' != + typeof r.disableSnapshot + ) + return ( + (A.errors = [ + { + params: { + type: 'boolean', + }, + }, + ]), + !1 + ); + var q = e === y; + } else q = !0; + if (q) + if (void 0 !== r.target) { + let e = r.target; + const n = y; + if ( + 'web' !== e && + 'node' !== e + ) + return ( + (A.errors = [ + { + params: { + allowedValues: + t.properties + .experiments + .properties + .optimization + .properties + .target + .enum, + }, + }, + ]), + !1 + ); + q = n === y; + } else q = !0; + } + } + } + $ = n === y; + } else $ = !0; + } } } - m = t === u; - } else m = !0; - if (m) { + b = r === y; + } else b = !0; + if (b) { if (void 0 !== o.bridge) { let e = o.bridge; - const t = u; - if (u === t) { + const t = y; + if (y === t) { if ( !e || 'object' != typeof e || Array.isArray(e) ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'object' } }, ]), !1 ); { - const t = u; + const t = y; for (const t in e) if ('disableAlias' !== t) return ( - (D.errors = [ + (A.errors = [ { params: { additionalProperty: t, @@ -3232,59 +4146,59 @@ function D( !1 ); if ( - t === u && + t === y && void 0 !== e.disableAlias && 'boolean' != typeof e.disableAlias ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'boolean' } }, ]), !1 ); } } - m = t === u; - } else m = !0; - if (m) { + b = t === y; + } else b = !0; + if (b) { if (void 0 !== o.virtualRuntimeEntry) { - const e = u; + const e = y; if ( 'boolean' != typeof o.virtualRuntimeEntry ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'boolean' } }, ]), !1 ); - m = e === u; - } else m = !0; - if (m) { + b = e === y; + } else b = !0; + if (b) { if (void 0 !== o.dev) { let e = o.dev; - const t = u, - r = u; + const t = y, + r = y; let n = !1; - const s = u; + const s = y; if ('boolean' != typeof e) { const e = { params: { type: 'boolean' }, }; - null === y ? (y = [e]) : y.push(e), - u++; + null === u ? (u = [e]) : u.push(e), + y++; } - var T = s === u; - if (((n = n || T), !n)) { - const t = u; - if (u === t) + var C = s === y; + if (((n = n || C), !n)) { + const t = y; + if (y === t) if ( e && 'object' == typeof e && !Array.isArray(e) ) { - const t = u; + const t = y; for (const t in e) if ( 'disableLiveReload' !== t && @@ -3298,17 +4212,17 @@ function D( additionalProperty: t, }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; break; } - if (t === u) { + if (t === y) { if ( void 0 !== e.disableLiveReload ) { - const t = u; + const t = y; if ( 'boolean' != typeof e.disableLiveReload @@ -3318,19 +4232,19 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - var R = t === u; - } else R = !0; - if (R) { + var V = t === y; + } else V = !0; + if (V) { if ( void 0 !== e.disableHotTypesReload ) { - const t = u; + const t = y; if ( 'boolean' != typeof e.disableHotTypesReload @@ -3340,19 +4254,19 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - R = t === u; - } else R = !0; - if (R) + V = t === y; + } else V = !0; + if (V) if ( void 0 !== e.disableDynamicRemoteTypeHints ) { - const t = u; + const t = y; if ( 'boolean' != typeof e.disableDynamicRemoteTypeHints @@ -3362,64 +4276,64 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - R = t === u; - } else R = !0; + V = t === y; + } else V = !0; } } } else { const e = { params: { type: 'object' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - (T = t === u), (n = n || T); + (C = t === y), (n = n || C); } if (!n) { const e = { params: {} }; return ( - null === y ? (y = [e]) : y.push(e), - u++, - (D.errors = y), + null === u ? (u = [e]) : u.push(e), + y++, + (A.errors = u), !1 ); } - (u = r), - null !== y && - (r ? (y.length = r) : (y = null)), - (m = t === u); - } else m = !0; - if (m) { + (y = r), + null !== u && + (r ? (u.length = r) : (u = null)), + (b = t === y); + } else b = !0; + if (b) { if (void 0 !== o.manifest) { let e = o.manifest; - const t = u, - r = u; + const t = y, + r = y; let n = !1; - const s = u; + const s = y; if ('boolean' != typeof e) { const e = { params: { type: 'boolean' }, }; - null === y ? (y = [e]) : y.push(e), - u++; + null === u ? (u = [e]) : u.push(e), + y++; } - var k = s === u; - if (((n = n || k), !n)) { - const t = u; - if (u === t) + var w = s === y; + if (((n = n || w), !n)) { + const t = y; + if (y === t) if ( e && 'object' == typeof e && !Array.isArray(e) ) { - const t = u; + const t = y; for (const t in e) if ( 'filePath' !== t && @@ -3433,15 +4347,15 @@ function D( additionalProperty: t, }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; break; } - if (t === u) { + if (t === y) { if (void 0 !== e.filePath) { - const t = u; + const t = y; if ( 'string' != typeof e.filePath @@ -3451,19 +4365,19 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - var E = t === u; - } else E = !0; - if (E) { + var F = t === y; + } else F = !0; + if (F) { if ( void 0 !== e.disableAssetsAnalyze ) { - const t = u; + const t = y; if ( 'boolean' != typeof e.disableAssetsAnalyze @@ -3473,18 +4387,18 @@ function D( type: 'boolean', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - E = t === u; - } else E = !0; - if (E) { + F = t === y; + } else F = !0; + if (F) { if ( void 0 !== e.fileName ) { - const t = u; + const t = y; if ( 'string' != typeof e.fileName @@ -3494,19 +4408,19 @@ function D( type: 'string', }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - E = t === u; - } else E = !0; - if (E) + F = t === y; + } else F = !0; + if (F) if ( void 0 !== e.additionalData ) { - const t = u; + const t = y; if ( !( e.additionalData instanceof @@ -3516,13 +4430,13 @@ function D( const e = { params: {}, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - E = t === u; - } else E = !0; + F = t === y; + } else F = !0; } } } @@ -3530,37 +4444,37 @@ function D( const e = { params: { type: 'object' }, }; - null === y - ? (y = [e]) - : y.push(e), - u++; + null === u + ? (u = [e]) + : u.push(e), + y++; } - (k = t === u), (n = n || k); + (w = t === y), (n = n || w); } if (!n) { const e = { params: {} }; return ( - null === y - ? (y = [e]) - : y.push(e), - u++, - (D.errors = y), + null === u + ? (u = [e]) + : u.push(e), + y++, + (A.errors = u), !1 ); } - (u = r), - null !== y && - (r ? (y.length = r) : (y = null)), - (m = t === u); - } else m = !0; - if (m) { + (y = r), + null !== u && + (r ? (u.length = r) : (u = null)), + (b = t === y); + } else b = !0; + if (b) { if (void 0 !== o.runtimePlugins) { let e = o.runtimePlugins; - const t = u; - if (u === t) { + const t = y; + if (y === t) { if (!Array.isArray(e)) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'array' }, }, @@ -3570,33 +4484,138 @@ function D( { const t = e.length; for (let r = 0; r < t; r++) { - const t = u; - if ('string' != typeof e[r]) - return ( - (D.errors = [ - { + let t = e[r]; + const n = y, + s = y; + let o = !1; + const i = y; + if ('string' != typeof t) { + const e = { + params: { + type: 'string', + }, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + var N = i === y; + if (((o = o || N), !o)) { + const e = y; + if (y === e) + if (Array.isArray(t)) + if (t.length > 2) { + const e = { + params: { + limit: 2, + }, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } else if ( + t.length < 2 + ) { + const e = { + params: { + limit: 2, + }, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } else { + const e = t.length; + if (e > 0) { + const e = y; + if ( + 'string' != + typeof t[0] + ) { + const e = { + params: { + type: 'string', + }, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + var z = e === y; + } + if (z && e > 1) { + let e = t[1]; + const r = y; + if ( + !e || + 'object' != + typeof e || + Array.isArray(e) + ) { + const e = { + params: { + type: 'object', + }, + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + z = r === y; + } + } + else { + const e = { params: { - type: 'string', + type: 'array', }, - }, - ]), + }; + null === u + ? (u = [e]) + : u.push(e), + y++; + } + (N = e === y), (o = o || N); + } + if (!o) { + const e = { params: {} }; + return ( + null === u + ? (u = [e]) + : u.push(e), + y++, + (A.errors = u), !1 ); - if (t !== u) break; + } + if ( + ((y = s), + null !== u && + (s + ? (u.length = s) + : (u = null)), + n !== y) + ) + break; } } } - m = t === u; - } else m = !0; - if (m) { + b = t === y; + } else b = !0; + if (b) { if (void 0 !== o.getPublicPath) { - const e = u; + const e = y; if ( 'string' != typeof o.getPublicPath ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'string', @@ -3605,17 +4624,17 @@ function D( ]), !1 ); - m = e === u; - } else m = !0; - if (m) { + b = e === y; + } else b = !0; + if (b) { if (void 0 !== o.dataPrefetch) { - const e = u; + const e = y; if ( 'boolean' != typeof o.dataPrefetch ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'boolean', @@ -3624,19 +4643,19 @@ function D( ]), !1 ); - m = e === u; - } else m = !0; - if (m) + b = e === y; + } else b = !0; + if (b) if ( void 0 !== o.implementation ) { - const e = u; + const e = y; if ( 'string' != typeof o.implementation ) return ( - (D.errors = [ + (A.errors = [ { params: { type: 'string', @@ -3645,8 +4664,8 @@ function D( ]), !1 ); - m = e === u; - } else m = !0; + b = e === y; + } else b = !0; } } } @@ -3669,5 +4688,5 @@ function D( } } } - return (D.errors = y), 0 === u; + return (A.errors = u), 0 === y; } diff --git a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json index 7cec0462f36..36b50952fea 100644 --- a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json +++ b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json @@ -912,7 +912,15 @@ "description": "Runtime plugin file paths or package names to be included in federation runtime", "type": "array", "items": { - "type": "string" + "anyOf": [ + { "type": "string" }, + { + "type": "array", + "items": [{ "type": "string" }, { "type": "object" }], + "minItems": 2, + "maxItems": 2 + } + ] } }, "getPublicPath": { diff --git a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts index 4d162dd7a3e..b397c34d281 100644 --- a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts +++ b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts @@ -514,6 +514,12 @@ export default { }, ], }, + shareStrategy: { + description: + "[Deprecated]: load shared strategy(defaults to 'version-first').", + enum: ['version-first', 'loaded-first'], + type: 'string', + }, singleton: { description: 'Allow only a single version of the shared module in share scope (disabled by default).', @@ -632,8 +638,34 @@ export default { properties: { async: { description: - 'Enable/disable asynchronous loading of runtime modules. When enabled, entry points will be wrapped in asynchronous chunks.', - type: 'boolean', + 'Enable/disable asynchronous loading of runtime modules or provide async boundary options.', + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + eager: { + description: + 'Eagerly load a module, matched via RegExp or predicate function', + anyOf: [ + { + instanceof: 'RegExp', + }, + { + instanceof: 'Function', + }, + ], + }, + excludeChunk: { + description: 'Predicate to exclude chunk from async boundary', + instanceof: 'Function', + }, + }, + additionalProperties: false, + }, + ], }, exposes: { $ref: '#/definitions/Exposes', @@ -737,7 +769,30 @@ export default { type: 'boolean', }, extractThirdParty: { - type: 'boolean', + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + exclude: { + type: 'array', + items: { + anyOf: [ + { + type: 'string', + }, + { + instanceof: 'RegExp', + }, + ], + }, + }, + }, + additionalProperties: false, + }, + ], }, extractRemoteTypes: { type: 'boolean', @@ -781,6 +836,42 @@ export default { type: 'string', }, }, + remoteTypeUrls: { + description: 'Remote type URLs provider or map', + anyOf: [ + { + instanceof: 'Function', + }, + { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + alias: { + type: 'string', + }, + api: { + type: 'string', + }, + zip: { + type: 'string', + }, + }, + required: ['api', 'zip'], + additionalProperties: false, + }, + }, + ], + }, + timeout: { + type: 'number', + }, + family: { + enum: [4, 6], + }, + typesOnBuild: { + type: 'boolean', + }, }, }, ], @@ -817,6 +908,21 @@ export default { provideExternalRuntime: { type: 'boolean', }, + optimization: { + description: 'Options related to build optimizations.', + type: 'object', + properties: { + disableSnapshot: { + description: 'Enable optimization to skip snapshot plugin', + type: 'boolean', + }, + target: { + description: 'Target environment for the build', + enum: ['web', 'node'], + }, + }, + additionalProperties: false, + }, }, }, bridge: { @@ -901,7 +1007,24 @@ export default { 'Runtime plugin file paths or package names to be included in federation runtime', type: 'array', items: { - type: 'string', + anyOf: [ + { + type: 'string', + }, + { + type: 'array', + items: [ + { + type: 'string', + }, + { + type: 'object', + }, + ], + minItems: 2, + maxItems: 2, + }, + ], }, }, getPublicPath: { diff --git a/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts index c6a4a194c1a..b271919200f 100644 --- a/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts +++ b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts @@ -36,8 +36,8 @@ function t( { instancePath: n = '', parentData: o, - parentDataProperty: i, - rootData: a = s, + parentDataProperty: a, + rootData: i = s, } = {}, ) { let l = null, @@ -85,8 +85,8 @@ function t( const e = p, n = p; let o = !1; - const i = p; - if (p === i) + const a = p; + if (p === a) if ('string' == typeof r) { if (r.length < 1) { const r = { params: {} }; @@ -96,7 +96,7 @@ function t( const r = { params: { type: 'string' } }; null === l ? (l = [r]) : l.push(r), p++; } - var u = i === p; + var u = a === p; if (((o = o || u), !o)) { const e = p; if (p === e) @@ -138,8 +138,8 @@ function t( let e = s.requiredVersion; const n = p, o = p; - let i = !1; - const a = p; + let a = !1; + const i = p; if (!1 !== e) { const e = { params: { @@ -149,16 +149,16 @@ function t( }; null === l ? (l = [e]) : l.push(e), p++; } - var c = a === p; - if (((i = i || c), !i)) { + var c = i === p; + if (((a = a || c), !a)) { const r = p; if ('string' != typeof e) { const r = { params: { type: 'string' } }; null === l ? (l = [r]) : l.push(r), p++; } - (c = r === p), (i = i || c); + (c = r === p), (a = a || c); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === l ? (l = [r]) : l.push(r), @@ -221,8 +221,8 @@ function t( let e = s.version; const n = p, o = p; - let i = !1; - const a = p; + let a = !1; + const i = p; if (!1 !== e) { const e = { params: { @@ -232,16 +232,16 @@ function t( }; null === l ? (l = [e]) : l.push(e), p++; } - var y = a === p; - if (((i = i || y), !i)) { + var y = i === p; + if (((a = a || y), !a)) { const r = p; if ('string' != typeof e) { const r = { params: { type: 'string' } }; null === l ? (l = [r]) : l.push(r), p++; } - (y = r === p), (i = i || y); + (y = r === p), (a = a || y); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === l ? (l = [r]) : l.push(r), @@ -260,8 +260,8 @@ function t( const e = p, n = p, o = p; - let i = !1; - const a = p; + let a = !1; + const i = p; if ( r && 'object' == typeof r && @@ -273,8 +273,8 @@ function t( null === l ? (l = [r]) : l.push(r), p++; } } - var g = a === p; - if (((i = i || g), !i)) { + var h = i === p; + if (((a = a || h), !a)) { const e = p; if ( r && @@ -289,9 +289,9 @@ function t( null === l ? (l = [r]) : l.push(r), p++; } } - (g = e === p), (i = i || g); + (h = e === p), (a = a || h); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === l ? (l = [r]) : l.push(r), @@ -336,22 +336,22 @@ function t( const s = p, n = p; let o = !1; - const i = p; + const a = p; if ('string' != typeof e) { const r = { params: { type: 'string' }, }; null === l ? (l = [r]) : l.push(r), p++; } - var h = i === p; - if (((o = o || h), !o)) { + var g = a === p; + if (((o = o || g), !o)) { const r = p; if (!(e instanceof RegExp)) { const r = { params: {} }; null === l ? (l = [r]) : l.push(r), p++; } - (h = r === p), (o = o || h); + (g = r === p), (o = o || g); } if (!o) { const r = { params: {} }; @@ -405,8 +405,8 @@ function t( const e = p, n = p, o = p; - let i = !1; - const a = p; + let a = !1; + const i = p; if ( r && 'object' == typeof r && @@ -420,8 +420,8 @@ function t( null === l ? (l = [r]) : l.push(r), p++; } } - var d = a === p; - if (((i = i || d), !i)) { + var d = i === p; + if (((a = a || d), !a)) { const e = p; if ( r && @@ -439,9 +439,9 @@ function t( null === l ? (l = [r]) : l.push(r), p++; } } - (d = e === p), (i = i || d); + (d = e === p), (a = a || d); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === l ? (l = [r]) : l.push(r), @@ -489,7 +489,7 @@ function t( const s = p, n = p; let o = !1; - const i = p; + const a = p; if ('string' != typeof e) { const r = { params: { type: 'string' }, @@ -497,7 +497,7 @@ function t( null === l ? (l = [r]) : l.push(r), p++; } - var v = i === p; + var v = a === p; if (((o = o || v), !o)) { const r = p; if (!(e instanceof RegExp)) { @@ -593,10 +593,10 @@ function s( instancePath: e = '', parentData: n, parentDataProperty: o, - rootData: i = r, + rootData: a = r, } = {}, ) { - let a = null, + let i = null, l = 0; if (0 === l) { if (!r || 'object' != typeof r || Array.isArray(r)) @@ -611,8 +611,8 @@ function s( instancePath: e + '/' + n.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: r, parentDataProperty: n, - rootData: i, - }) || ((a = null === a ? t.errors : a.concat(t.errors)), (l = a.length)); + rootData: a, + }) || ((i = null === i ? t.errors : i.concat(t.errors)), (l = i.length)); var p = y === l; if (((c = c || p), !c)) { const r = l; @@ -620,23 +620,23 @@ function s( if ('string' == typeof o) { if (o.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } (p = r === l), (c = c || p); } if (!c) { const r = { params: {} }; - return null === a ? (a = [r]) : a.push(r), l++, (s.errors = a), !1; + return null === i ? (i = [r]) : i.push(r), l++, (s.errors = i), !1; } - if (((l = u), null !== a && (u ? (a.length = u) : (a = null)), f !== l)) + if (((l = u), null !== i && (u ? (i.length = u) : (i = null)), f !== l)) break; } } - return (s.errors = a), 0 === l; + return (s.errors = i), 0 === l; } function n( r, @@ -644,10 +644,10 @@ function n( instancePath: e = '', parentData: t, parentDataProperty: o, - rootData: i = r, + rootData: a = r, } = {}, ) { - let a = null, + let i = null, l = 0; const p = l; let f = !1; @@ -665,11 +665,11 @@ function n( if ('string' == typeof t) { if (t.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } var c = u === l; if (((f = f || c), !f)) { @@ -678,22 +678,22 @@ function n( instancePath: e + '/' + n, parentData: r, parentDataProperty: n, - rootData: i, + rootData: a, }) || - ((a = null === a ? s.errors : a.concat(s.errors)), (l = a.length)), + ((i = null === i ? s.errors : i.concat(s.errors)), (l = i.length)), (c = o === l), (f = f || c); } - if (f) (l = p), null !== a && (p ? (a.length = p) : (a = null)); + if (f) (l = p), null !== i && (p ? (i.length = p) : (i = null)); else { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } if (o !== l) break; } } else { const r = { params: { type: 'array' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } var y = u === l; if (((f = f || y), !f)) { @@ -702,19 +702,19 @@ function n( instancePath: e, parentData: t, parentDataProperty: o, - rootData: i, - }) || ((a = null === a ? s.errors : a.concat(s.errors)), (l = a.length)), + rootData: a, + }) || ((i = null === i ? s.errors : i.concat(s.errors)), (l = i.length)), (y = n === l), (f = f || y); } if (!f) { const r = { params: {} }; - return null === a ? (a = [r]) : a.push(r), l++, (n.errors = a), !1; + return null === i ? (i = [r]) : i.push(r), l++, (n.errors = i), !1; } return ( (l = p), - null !== a && (p ? (a.length = p) : (a = null)), - (n.errors = a), + null !== i && (p ? (i.length = p) : (i = null)), + (n.errors = i), 0 === l ); } @@ -724,10 +724,10 @@ function o( instancePath: e = '', parentData: t, parentDataProperty: s, - rootData: i = r, + rootData: a = r, } = {}, ) { - let a = null, + let i = null, l = 0; if (0 === l) { if (!r || 'object' != typeof r || Array.isArray(r)) @@ -748,10 +748,10 @@ function o( instancePath: e + '/provides', parentData: r, parentDataProperty: 'provides', - rootData: i, + rootData: a, }) || - ((a = null === a ? n.errors : a.concat(n.errors)), - (l = a.length)); + ((i = null === i ? n.errors : i.concat(n.errors)), + (l = i.length)); var p = t === l; } else p = !0; if (p) { @@ -760,18 +760,18 @@ function o( const t = l, s = l; let n = !1; - const i = l; - if (l === i) + const a = l; + if (l === a) if ('string' == typeof e) { if (e.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } - var f = i === l; + var f = a === l; if (((n = n || f), !n)) { const r = l; if (l === r) @@ -784,28 +784,28 @@ function o( if ('string' == typeof r) { if (r.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } if (s !== l) break; } } else { const r = { params: { type: 'array' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } (f = r === l), (n = n || f); } if (!n) { const r = { params: {} }; return ( - null === a ? (a = [r]) : a.push(r), l++, (o.errors = a), !1 + null === i ? (i = [r]) : i.push(r), l++, (o.errors = i), !1 ); } (l = s), - null !== a && (s ? (a.length = s) : (a = null)), + null !== i && (s ? (i.length = s) : (i = null)), (p = t === l); } else p = !0; if (p) @@ -838,5 +838,5 @@ function o( } } } - return (o.errors = a), 0 === l; + return (o.errors = i), 0 === l; } diff --git a/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts b/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts index 1bdc610e00d..11c9a20a6c8 100644 --- a/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts +++ b/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts @@ -4,8 +4,8 @@ * This file was automatically generated. * DO NOT MODIFY BY HAND. */ -export const validate = i; -export default i; +export const validate = a; +export default a; const r = { type: 'object', additionalProperties: !1, @@ -51,8 +51,8 @@ function s( n, { instancePath: o = '', - parentData: i, - parentDataProperty: a, + parentData: a, + parentDataProperty: i, rootData: l = n, } = {}, ) { @@ -78,8 +78,8 @@ function s( let r = n.exclude; const t = f, o = f, - i = f; - let a = !1; + a = f; + let i = !1; const l = f; if (r && 'object' == typeof r && !Array.isArray(r)) { let e; @@ -89,7 +89,7 @@ function s( } } var c = l === f; - if (((a = a || c), !a)) { + if (((i = i || c), !i)) { const e = f; if (r && 'object' == typeof r && !Array.isArray(r)) { let e; @@ -98,7 +98,7 @@ function s( null === p ? (p = [r]) : p.push(r), f++; } } - if (((c = e === f), (a = a || c), !a)) { + if (((c = e === f), (i = i || c), !i)) { const e = f; if (r && 'object' == typeof r && !Array.isArray(r)) { let e; @@ -107,18 +107,18 @@ function s( null === p ? (p = [r]) : p.push(r), f++; } } - (c = e === f), (a = a || c); + (c = e === f), (i = i || c); } } - if (!a) { + if (!i) { const r = { params: {} }; return ( null === p ? (p = [r]) : p.push(r), f++, (s.errors = p), !1 ); } if ( - ((f = i), - null !== p && (i ? (p.length = i) : (p = null)), + ((f = a), + null !== p && (a ? (p.length = a) : (p = null)), f === o) ) { if (!r || 'object' != typeof r || Array.isArray(r)) @@ -179,8 +179,8 @@ function s( let r = n.include; const t = f, o = f, - i = f; - let a = !1; + a = f; + let i = !1; const l = f; if (r && 'object' == typeof r && !Array.isArray(r)) { let e; @@ -189,8 +189,8 @@ function s( null === p ? (p = [r]) : p.push(r), f++; } } - var g = l === f; - if (((a = a || g), !a)) { + var h = l === f; + if (((i = i || h), !i)) { const e = f; if (r && 'object' == typeof r && !Array.isArray(r)) { let e; @@ -199,7 +199,7 @@ function s( null === p ? (p = [r]) : p.push(r), f++; } } - if (((g = e === f), (a = a || g), !a)) { + if (((h = e === f), (i = i || h), !i)) { const e = f; if (r && 'object' == typeof r && !Array.isArray(r)) { let e; @@ -211,18 +211,18 @@ function s( null === p ? (p = [r]) : p.push(r), f++; } } - (g = e === f), (a = a || g); + (h = e === f), (i = i || h); } } - if (!a) { + if (!i) { const r = { params: {} }; return ( null === p ? (p = [r]) : p.push(r), f++, (s.errors = p), !1 ); } if ( - ((f = i), - null !== p && (i ? (p.length = i) : (p = null)), + ((f = a), + null !== p && (a ? (p.length = a) : (p = null)), f === o) ) { if (!r || 'object' != typeof r || Array.isArray(r)) @@ -252,26 +252,26 @@ function s( ]), !1 ); - var m = n === f; - } else m = !0; - if (m) { + var g = n === f; + } else g = !0; + if (g) { if (void 0 !== r.version) { const e = f; if ('string' != typeof r.version) return ( (s.errors = [{ params: { type: 'string' } }]), !1 ); - m = e === f; - } else m = !0; - if (m) + g = e === f; + } else g = !0; + if (g) if (void 0 !== r.fallbackVersion) { const e = f; if ('string' != typeof r.fallbackVersion) return ( (s.errors = [{ params: { type: 'string' } }]), !1 ); - m = e === f; - } else m = !0; + g = e === f; + } else g = !0; } } } @@ -283,8 +283,8 @@ function s( let e = n.import; const t = f, o = f; - let i = !1; - const a = f; + let a = !1; + const i = f; if (!1 !== e) { const e = { params: { @@ -293,8 +293,8 @@ function s( }; null === p ? (p = [e]) : p.push(e), f++; } - var h = a === f; - if (((i = i || h), !i)) { + var m = i === f; + if (((a = a || m), !a)) { const r = f; if (f == f) if ('string' == typeof e) { @@ -306,9 +306,9 @@ function s( const r = { params: { type: 'string' } }; null === p ? (p = [r]) : p.push(r), f++; } - (h = r === f), (i = i || h); + (m = r === f), (a = a || m); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === p ? (p = [r]) : p.push(r), f++, (s.errors = p), !1 @@ -334,8 +334,8 @@ function s( let e = n.requiredVersion; const t = f, o = f; - let i = !1; - const a = f; + let a = !1; + const i = f; if (!1 !== e) { const e = { params: { @@ -345,16 +345,16 @@ function s( }; null === p ? (p = [e]) : p.push(e), f++; } - var d = a === f; - if (((i = i || d), !i)) { + var d = i === f; + if (((a = a || d), !a)) { const r = f; if ('string' != typeof e) { const r = { params: { type: 'string' } }; null === p ? (p = [r]) : p.push(r), f++; } - (d = r === f), (i = i || d); + (d = r === f), (a = a || d); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === p ? (p = [r]) : p.push(r), @@ -387,8 +387,8 @@ function s( const e = f, t = f; let o = !1; - const i = f; - if (f === i) + const a = f; + if (f === a) if ('string' == typeof r) { if (r.length < 1) { const r = { params: {} }; @@ -398,7 +398,7 @@ function s( const r = { params: { type: 'string' } }; null === p ? (p = [r]) : p.push(r), f++; } - var v = i === f; + var v = a === f; if (((o = o || v), !o)) { const e = f; if (f === e) @@ -462,8 +462,8 @@ function s( let e = n.version; const t = f, o = f; - let i = !1; - const a = f; + let a = !1; + const i = f; if (!1 !== e) { const e = { params: { @@ -473,16 +473,16 @@ function s( }; null === p ? (p = [e]) : p.push(e), f++; } - var b = a === f; - if (((i = i || b), !i)) { + var b = i === f; + if (((a = a || b), !a)) { const r = f; if ('string' != typeof e) { const r = { params: { type: 'string' } }; null === p ? (p = [r]) : p.push(r), f++; } - (b = r === f), (i = i || b); + (b = r === f), (a = a || b); } - if (!i) { + if (!a) { const r = { params: {} }; return ( null === p ? (p = [r]) : p.push(r), @@ -589,10 +589,10 @@ function n( instancePath: e = '', parentData: t, parentDataProperty: o, - rootData: i = r, + rootData: a = r, } = {}, ) { - let a = null, + let i = null, l = 0; if (0 === l) { if (!r || 'object' != typeof r || Array.isArray(r)) @@ -607,8 +607,8 @@ function n( instancePath: e + '/' + t.replace(/~/g, '~0').replace(/\//g, '~1'), parentData: r, parentDataProperty: t, - rootData: i, - }) || ((a = null === a ? s.errors : a.concat(s.errors)), (l = a.length)); + rootData: a, + }) || ((i = null === i ? s.errors : i.concat(s.errors)), (l = i.length)); var p = y === l; if (((c = c || p), !c)) { const r = l; @@ -616,23 +616,23 @@ function n( if ('string' == typeof o) { if (o.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } (p = r === l), (c = c || p); } if (!c) { const r = { params: {} }; - return null === a ? (a = [r]) : a.push(r), l++, (n.errors = a), !1; + return null === i ? (i = [r]) : i.push(r), l++, (n.errors = i), !1; } - if (((l = u), null !== a && (u ? (a.length = u) : (a = null)), f !== l)) + if (((l = u), null !== i && (u ? (i.length = u) : (i = null)), f !== l)) break; } } - return (n.errors = a), 0 === l; + return (n.errors = i), 0 === l; } function o( r, @@ -640,10 +640,10 @@ function o( instancePath: e = '', parentData: t, parentDataProperty: s, - rootData: i = r, + rootData: a = r, } = {}, ) { - let a = null, + let i = null, l = 0; const p = l; let f = !1; @@ -661,11 +661,11 @@ function o( if ('string' == typeof t) { if (t.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } var c = u === l; if (((f = f || c), !f)) { @@ -674,22 +674,22 @@ function o( instancePath: e + '/' + s, parentData: r, parentDataProperty: s, - rootData: i, + rootData: a, }) || - ((a = null === a ? n.errors : a.concat(n.errors)), (l = a.length)), + ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), (c = o === l), (f = f || c); } - if (f) (l = p), null !== a && (p ? (a.length = p) : (a = null)); + if (f) (l = p), null !== i && (p ? (i.length = p) : (i = null)); else { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } if (o !== l) break; } } else { const r = { params: { type: 'array' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } var y = u === l; if (((f = f || y), !f)) { @@ -698,23 +698,23 @@ function o( instancePath: e, parentData: t, parentDataProperty: s, - rootData: i, - }) || ((a = null === a ? n.errors : a.concat(n.errors)), (l = a.length)), + rootData: a, + }) || ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), (y = o === l), (f = f || y); } if (!f) { const r = { params: {} }; - return null === a ? (a = [r]) : a.push(r), l++, (o.errors = a), !1; + return null === i ? (i = [r]) : i.push(r), l++, (o.errors = i), !1; } return ( (l = p), - null !== a && (p ? (a.length = p) : (a = null)), - (o.errors = a), + null !== i && (p ? (i.length = p) : (i = null)), + (o.errors = i), 0 === l ); } -function i( +function a( r, { instancePath: e = '', @@ -723,15 +723,15 @@ function i( rootData: n = r, } = {}, ) { - let a = null, + let i = null, l = 0; if (0 === l) { if (!r || 'object' != typeof r || Array.isArray(r)) - return (i.errors = [{ params: { type: 'object' } }]), !1; + return (a.errors = [{ params: { type: 'object' } }]), !1; { let t; if (void 0 === r.shared && (t = 'shared')) - return (i.errors = [{ params: { missingProperty: t } }]), !1; + return (a.errors = [{ params: { missingProperty: t } }]), !1; { const t = l; for (const e in r) @@ -741,12 +741,12 @@ function i( 'shared' !== e && 'experiments' !== e ) - return (i.errors = [{ params: { additionalProperty: e } }]), !1; + return (a.errors = [{ params: { additionalProperty: e } }]), !1; if (t === l) { if (void 0 !== r.async) { const e = l; if ('boolean' != typeof r.async) - return (i.errors = [{ params: { type: 'boolean' } }]), !1; + return (a.errors = [{ params: { type: 'boolean' } }]), !1; var p = e === l; } else p = !0; if (p) { @@ -760,11 +760,11 @@ function i( if ('string' == typeof e) { if (e.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } var f = o === l; if (((n = n || f), !n)) { @@ -779,28 +779,28 @@ function i( if ('string' == typeof r) { if (r.length < 1) { const r = { params: {} }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } } else { const r = { params: { type: 'string' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } if (s !== l) break; } } else { const r = { params: { type: 'array' } }; - null === a ? (a = [r]) : a.push(r), l++; + null === i ? (i = [r]) : i.push(r), l++; } (f = r === l), (n = n || f); } if (!n) { const r = { params: {} }; return ( - null === a ? (a = [r]) : a.push(r), l++, (i.errors = a), !1 + null === i ? (i = [r]) : i.push(r), l++, (a.errors = i), !1 ); } (l = s), - null !== a && (s ? (a.length = s) : (a = null)), + null !== i && (s ? (i.length = s) : (i = null)), (p = t === l); } else p = !0; if (p) { @@ -812,8 +812,8 @@ function i( parentDataProperty: 'shared', rootData: n, }) || - ((a = null === a ? o.errors : a.concat(o.errors)), - (l = a.length)), + ((i = null === i ? o.errors : i.concat(o.errors)), + (l = i.length)), (p = t === l); } else p = !0; if (p) @@ -822,13 +822,13 @@ function i( const t = l; if (l === t) { if (!e || 'object' != typeof e || Array.isArray(e)) - return (i.errors = [{ params: { type: 'object' } }]), !1; + return (a.errors = [{ params: { type: 'object' } }]), !1; { const r = l; for (const r in e) if ('allowNodeModulesSuffixMatch' !== r) return ( - (i.errors = [ + (a.errors = [ { params: { additionalProperty: r } }, ]), !1 @@ -839,7 +839,7 @@ function i( 'boolean' != typeof e.allowNodeModulesSuffixMatch ) return ( - (i.errors = [{ params: { type: 'boolean' } }]), !1 + (a.errors = [{ params: { type: 'boolean' } }]), !1 ); } } @@ -851,5 +851,5 @@ function i( } } } - return (i.errors = a), 0 === l; + return (a.errors = i), 0 === l; } diff --git a/packages/enhanced/test/unit/container/FederationRuntimePlugin.test.ts b/packages/enhanced/test/unit/container/FederationRuntimePlugin.test.ts new file mode 100644 index 00000000000..dc2d193106b --- /dev/null +++ b/packages/enhanced/test/unit/container/FederationRuntimePlugin.test.ts @@ -0,0 +1,185 @@ +import FederationRuntimePlugin from '../../../src/lib/container/runtime/FederationRuntimePlugin'; +import type { Compiler } from 'webpack'; + +jest.mock('@module-federation/sdk/normalize-webpack-path', () => ({ + normalizeWebpackPath: (path: string) => path, + getWebpackPath: jest.fn(() => 'webpack'), +})); + +describe('FederationRuntimePlugin runtimePluginCalls', () => { + let compiler: any; + let mockOptions: any; + + beforeEach(() => { + compiler = { + options: { + context: '/test/path', + }, + hooks: { + thisCompilation: { + tap: jest.fn(), + }, + make: { + tapAsync: jest.fn(), + }, + }, + }; + + mockOptions = { + name: 'test-container', + virtualRuntimeEntry: true, + }; + + // Mock process.cwd + Object.defineProperty(process, 'cwd', { + value: () => '/current/working/dir', + }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + describe('runtimePluginCalls array', () => { + it('should create runtimePluginCalls when runtimePlugins is provided', () => { + const optionsWithPlugins = { + ...mockOptions, + runtimePlugins: ['plugin1.js', 'plugin2.js'], + }; + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithPlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中包含插件调用 + expect(template).toContain('plugin_0'); + expect(template).toContain('plugin_1'); + expect(template).toContain('pluginsToAdd = ['); + }); + + it('should handle runtimePlugins with parameters', () => { + const optionsWithPlugins = { + ...mockOptions, + runtimePlugins: [ + 'plugin1.js', + ['plugin2.js', { param1: 'value1', param2: 'value2' }], + ], + }; + + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithPlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中包含带参数的插件调用 + expect(template).toContain('plugin_0'); + expect(template).toContain('plugin_1'); + expect(template).toContain('{"param1":"value1","param2":"value2"}'); + }); + + it('should not include runtimePluginCalls when no runtimePlugins provided', () => { + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + mockOptions, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中不包含插件调用相关代码 + expect(template).not.toContain('pluginsToAdd = ['); + expect(template).not.toContain('plugin_0'); + }); + + it('should create empty runtimePluginCalls array when runtimePlugins is empty', () => { + const optionsWithEmptyPlugins = { + ...mockOptions, + runtimePlugins: [], + }; + + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithEmptyPlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中不包含插件调用相关代码 + expect(template).not.toContain('pluginsToAdd = ['); + expect(template).not.toContain('plugin_0'); + }); + + it('should handle absolute paths in runtimePlugins', () => { + const optionsWithAbsolutePlugins = { + ...mockOptions, + runtimePlugins: ['/absolute/path/plugin1.js'], + }; + + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithAbsolutePlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中包含正确路径的插件 + expect(template).toContain("from '/absolute/path/plugin1.js'"); + }); + + it('should handle relative paths in runtimePlugins', () => { + const optionsWithRelativePlugins = { + ...mockOptions, + runtimePlugins: ['relative/path/plugin1.js'], + }; + + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithRelativePlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中包含正确路径的插件 + expect(template).toContain( + "from '/current/working/dir/relative/path/plugin1.js'", + ); + }); + + it('should filter out false plugins in runtimePluginCalls', () => { + const optionsWithFalsyPlugins = { + ...mockOptions, + runtimePlugins: ['plugin1.js', null as any, 'plugin2.js'], + }; + + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithFalsyPlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中包含filter(Boolean)调用 + expect(template).toContain('].filter(Boolean)'); + }); + + it('should handle runtimePluginCalls with default export syntax', () => { + const optionsWithPlugins = { + ...mockOptions, + runtimePlugins: ['plugin1.js'], + }; + + const template = FederationRuntimePlugin.getTemplate( + compiler as Compiler, + optionsWithPlugins, + 'bundler-runtime.js', + {}, + ); + + // 验证生成的模板中包含正确的插件调用语法 + expect(template).toContain('plugin_0 ? (plugin_0.default || plugin_0)'); + }); + }); +}); diff --git a/packages/modernjs/src/cli/configPlugin.ts b/packages/modernjs/src/cli/configPlugin.ts index 64bd548c670..647de6261cd 100644 --- a/packages/modernjs/src/cli/configPlugin.ts +++ b/packages/modernjs/src/cli/configPlugin.ts @@ -31,6 +31,10 @@ export type ConfigType = T extends 'webpack' ? Rspack.Configuration : never; +type RuntimePluginEntry = NonNullable< + moduleFederationPlugin.ModuleFederationPluginOptions['runtimePlugins'] +>[number]; + export function setEnv(enableSSR: boolean) { if (enableSSR) { process.env['MF_DISABLE_EMIT_STATS'] = 'true'; @@ -55,10 +59,21 @@ export const getMFConfig = async ( }; const injectRuntimePlugins = ( - runtimePlugin: string, - runtimePlugins: string[], + runtimePlugin: RuntimePluginEntry, + runtimePlugins: RuntimePluginEntry[], ): void => { - if (!runtimePlugins.includes(runtimePlugin)) { + const pluginName = + typeof runtimePlugin === 'string' ? runtimePlugin : runtimePlugin[0]; + + const hasPlugin = runtimePlugins.some((existingPlugin) => { + if (typeof existingPlugin === 'string') { + return existingPlugin === pluginName; + } + + return existingPlugin[0] === pluginName; + }); + + if (!hasPlugin) { runtimePlugins.push(runtimePlugin); } }; @@ -161,7 +176,9 @@ export const patchMFConfig = ( throw new Error(`${PLUGIN_IDENTIFIER} mfConfig.name can not be empty!`); } - const runtimePlugins = [...(mfConfig.runtimePlugins || [])]; + const runtimePlugins = [ + ...(mfConfig.runtimePlugins || []), + ] as RuntimePluginEntry[]; try { const nodeModulesPath = path.resolve(process.cwd(), 'node_modules'); diff --git a/packages/sdk/src/types/plugins/ContainerPlugin.ts b/packages/sdk/src/types/plugins/ContainerPlugin.ts index 67ba796b65e..e598d16acff 100644 --- a/packages/sdk/src/types/plugins/ContainerPlugin.ts +++ b/packages/sdk/src/types/plugins/ContainerPlugin.ts @@ -95,9 +95,9 @@ export interface ContainerPluginOptions { */ shareScope?: string | string[]; /** - * Runtime plugin file paths or package name. + * Runtime plugin file paths or package name. Supports tuple [path, params]. */ - runtimePlugins?: string[]; + runtimePlugins?: (string | [string, Record])[]; dataPrefetch?: DataPrefetch; } diff --git a/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts b/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts index de865cfcb63..041c098be95 100644 --- a/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts +++ b/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts @@ -236,9 +236,9 @@ export interface ModuleFederationPluginOptions { */ shared?: Shared; /** - * Runtime plugin file paths or package name. + * Runtime plugin file paths or package name. Supports tuple [path, params]. */ - runtimePlugins?: string[]; + runtimePlugins?: (string | [string, Record])[]; /** * Custom public path function */