diff --git a/package.json b/package.json index bdf23d14548..11d9d8d63ea 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "changegen": "./changeset-gen.js --path ./packages/enhanced --staged && ./changeset-gen.js --path ./packages/node --staged && ./changeset-gen.js --path ./packages/runtime --staged && ./changeset-gen.js --path ./packages/data-prefetch --staged && ./changeset-gen.js --path ./packages/nextjs-mf --staged && ./changeset-gen.js --path ./packages/dts-plugin --staged", "commitgen:staged": "./commit-gen.js --path ./packages --staged", "commitgen:main": "./commit-gen.js --path ./packages", - "changeset:status": "changeset status" + "changeset:status": "changeset status", + "generate:schema": "nx run enhanced:generate:schema && nx format:write" }, "pnpm": { "packageExtensions": { diff --git a/packages/enhanced/package.json b/packages/enhanced/package.json index 441c7f2a3bd..e52040e32d2 100644 --- a/packages/enhanced/package.json +++ b/packages/enhanced/package.json @@ -17,9 +17,9 @@ "access": "public" }, "peerDependencies": { - "webpack": "^5.0.0", "typescript": "^4.9.0 || ^5.0.0", - "vue-tsc": ">=1.0.24" + "vue-tsc": ">=1.0.24", + "webpack": "^5.0.0" }, "peerDependenciesMeta": { "webpack": { @@ -81,20 +81,22 @@ "devDependencies": { "@module-federation/webpack-bundler-runtime": "workspace:*", "@types/btoa": "^1.2.5", - "enhanced-resolve": "^5.0.0" + "ajv": "^8.17.1", + "enhanced-resolve": "^5.0.0", + "terser": "^5.37.0" }, "dependencies": { - "@module-federation/sdk": "workspace:*", - "@module-federation/runtime-tools": "workspace:*", - "@module-federation/manifest": "workspace:*", - "@module-federation/managers": "workspace:*", - "@module-federation/error-codes": "workspace:*", - "@module-federation/dts-plugin": "workspace:*", - "@module-federation/rspack": "workspace:*", "@module-federation/bridge-react-webpack-plugin": "workspace:*", "@module-federation/data-prefetch": "workspace:*", + "@module-federation/dts-plugin": "workspace:*", + "@module-federation/error-codes": "workspace:*", "@module-federation/inject-external-runtime-core-plugin": "workspace:*", - "upath": "2.0.1", - "btoa": "^1.2.1" + "@module-federation/managers": "workspace:*", + "@module-federation/manifest": "workspace:*", + "@module-federation/rspack": "workspace:*", + "@module-federation/runtime-tools": "workspace:*", + "@module-federation/sdk": "workspace:*", + "btoa": "^1.2.1", + "upath": "2.0.1" } } diff --git a/packages/enhanced/project.json b/packages/enhanced/project.json index 32a6e46ca27..57375dba310 100644 --- a/packages/enhanced/project.json +++ b/packages/enhanced/project.json @@ -5,6 +5,13 @@ "projectType": "library", "tags": ["type:pkg"], "targets": { + "generate:schema": { + "executor": "nx:run-commands", + "options": { + "command": "node src/scripts/compile-schema.js", + "cwd": "packages/enhanced" + } + }, "build": { "executor": "@nx/js:tsc", "outputs": ["{workspaceRoot}/packages/enhanced/dist"], diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.check.js b/packages/enhanced/src/schemas/container/ContainerPlugin.check.js new file mode 100644 index 00000000000..6070619ec83 --- /dev/null +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.check.js @@ -0,0 +1,1136 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +'use strict'; +(module.exports = f), (module.exports.default = f); +const t = { + definitions: { + AmdContainer: { type: 'string', minLength: 1 }, + AuxiliaryComment: { + anyOf: [ + { type: 'string' }, + { $ref: '#/definitions/LibraryCustomUmdCommentObject' }, + ], + }, + EntryRuntime: { + anyOf: [{ enum: [!1] }, { type: 'string', minLength: 1 }], + }, + Exposes: { + anyOf: [ + { + type: 'array', + items: { + anyOf: [ + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesObject' }, + ], + }, + }, + { $ref: '#/definitions/ExposesObject' }, + ], + }, + ExposesConfig: { + type: 'object', + additionalProperties: !1, + properties: { + import: { + anyOf: [ + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesItems' }, + ], + }, + name: { type: 'string' }, + }, + required: ['import'], + }, + ExposesItem: { type: 'string', minLength: 1 }, + ExposesItems: { + type: 'array', + items: { $ref: '#/definitions/ExposesItem' }, + }, + ExposesObject: { + type: 'object', + additionalProperties: { + anyOf: [ + { $ref: '#/definitions/ExposesConfig' }, + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesItems' }, + ], + }, + }, + LibraryCustomUmdCommentObject: { + type: 'object', + additionalProperties: !1, + properties: { + amd: { type: 'string' }, + commonjs: { type: 'string' }, + commonjs2: { type: 'string' }, + root: { type: 'string' }, + }, + }, + LibraryCustomUmdObject: { + type: 'object', + additionalProperties: !1, + properties: { + amd: { type: 'string', minLength: 1 }, + commonjs: { type: 'string', minLength: 1 }, + root: { + anyOf: [ + { type: 'array', items: { type: 'string', minLength: 1 } }, + { type: 'string', minLength: 1 }, + ], + }, + }, + }, + LibraryExport: { + anyOf: [ + { type: 'array', items: { type: 'string', minLength: 1 } }, + { type: 'string', minLength: 1 }, + ], + }, + LibraryName: { + anyOf: [ + { + type: 'array', + items: { type: 'string', minLength: 1 }, + minItems: 1, + }, + { type: 'string', minLength: 1 }, + { $ref: '#/definitions/LibraryCustomUmdObject' }, + ], + }, + LibraryOptions: { + type: 'object', + additionalProperties: !1, + properties: { + amdContainer: { $ref: '#/definitions/AmdContainer' }, + auxiliaryComment: { $ref: '#/definitions/AuxiliaryComment' }, + export: { $ref: '#/definitions/LibraryExport' }, + name: { $ref: '#/definitions/LibraryName' }, + type: { $ref: '#/definitions/LibraryType' }, + umdNamedDefine: { $ref: '#/definitions/UmdNamedDefine' }, + }, + required: ['type'], + }, + LibraryType: { + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { type: 'string' }, + ], + }, + UmdNamedDefine: { type: 'boolean' }, + }, + type: 'object', + additionalProperties: !1, + properties: { + experiments: { + type: 'object', + additionalProperties: !1, + properties: { + asyncStartup: { type: 'boolean' }, + externalRuntime: { + anyOf: [{ enum: ['provide'] }, { type: 'boolean' }], + }, + }, + }, + exposes: { $ref: '#/definitions/Exposes' }, + filename: { type: 'string', minLength: 1 }, + library: { $ref: '#/definitions/LibraryOptions' }, + name: { type: 'string', minLength: 1 }, + runtime: { $ref: '#/definitions/EntryRuntime' }, + runtimePlugins: { type: 'array', items: { type: 'string' } }, + shareScope: { type: 'string', minLength: 1 }, + }, + required: ['name', 'exposes'], + }, + r = { anyOf: [{ enum: [!1] }, { type: 'string', minLength: 1 }] }, + e = require('ajv/dist/runtime/ucs2length').default; +function n( + t, + { + instancePath: r = '', + parentData: s, + parentDataProperty: i, + rootData: a = t, + } = {}, +) { + if (!Array.isArray(t)) + return (n.errors = [{ params: { type: 'array' } }]), !1; + { + const r = t.length; + for (let s = 0; s < r; s++) { + let r = t[s]; + const i = 0; + if ('string' != typeof r) + return (n.errors = [{ params: { type: 'string' } }]), !1; + if (e(r) < 1) return (n.errors = [{ params: { limit: 1 } }]), !1; + if (0 !== i) break; + } + } + return (n.errors = null), !0; +} +function s( + t, + { + instancePath: r = '', + parentData: i, + parentDataProperty: a, + rootData: o = t, + } = {}, +) { + let p = null, + l = 0; + if (0 === l) { + if (!t || 'object' != typeof t || Array.isArray(t)) + return (s.errors = [{ params: { type: 'object' } }]), !1; + { + let i; + if (void 0 === t.import && (i = 'import')) + return (s.errors = [{ params: { missingProperty: i } }]), !1; + { + const i = l; + for (const r in t) + if ('import' !== r && 'name' !== r) + return (s.errors = [{ params: { additionalProperty: r } }]), !1; + if (i === l) { + if (void 0 !== t.import) { + let i = t.import; + const a = l, + u = l; + let c = !1; + const y = l; + if (l == l) + if ('string' == typeof i) { + if (e(i) < 1) { + const t = { params: { limit: 1 } }; + null === p ? (p = [t]) : p.push(t), l++; + } + } else { + const t = { params: { type: 'string' } }; + null === p ? (p = [t]) : p.push(t), l++; + } + var m = y === l; + if (((c = c || m), !c)) { + const e = l; + n(i, { + instancePath: r + '/import', + parentData: t, + parentDataProperty: 'import', + rootData: o, + }) || + ((p = null === p ? n.errors : p.concat(n.errors)), + (l = p.length)), + (m = e === l), + (c = c || m); + } + if (!c) { + const t = { params: {} }; + return ( + null === p ? (p = [t]) : p.push(t), l++, (s.errors = p), !1 + ); + } + (l = u), null !== p && (u ? (p.length = u) : (p = null)); + var f = a === l; + } else f = !0; + if (f) + if (void 0 !== t.name) { + const r = l; + if ('string' != typeof t.name) + return (s.errors = [{ params: { type: 'string' } }]), !1; + f = r === l; + } else f = !0; + } + } + } + } + return (s.errors = p), 0 === l; +} +function i( + t, + { + instancePath: r = '', + parentData: a, + parentDataProperty: o, + rootData: p = t, + } = {}, +) { + let l = null, + m = 0; + if (0 === m) { + if (!t || 'object' != typeof t || Array.isArray(t)) + return (i.errors = [{ params: { type: 'object' } }]), !1; + for (const a in t) { + let o = t[a]; + const u = m, + c = m; + let y = !1; + const d = m; + s(o, { + instancePath: r + '/' + a.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: t, + parentDataProperty: a, + rootData: p, + }) || ((l = null === l ? s.errors : l.concat(s.errors)), (m = l.length)); + var f = d === m; + if (((y = y || f), !y)) { + const s = m; + if (m == m) + if ('string' == typeof o) { + if (e(o) < 1) { + const t = { params: { limit: 1 } }; + null === l ? (l = [t]) : l.push(t), m++; + } + } else { + const t = { params: { type: 'string' } }; + null === l ? (l = [t]) : l.push(t), m++; + } + if (((f = s === m), (y = y || f), !y)) { + const e = m; + n(o, { + instancePath: r + '/' + a.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: t, + parentDataProperty: a, + rootData: p, + }) || + ((l = null === l ? n.errors : l.concat(n.errors)), (m = l.length)), + (f = e === m), + (y = y || f); + } + } + if (!y) { + const t = { params: {} }; + return null === l ? (l = [t]) : l.push(t), m++, (i.errors = l), !1; + } + if (((m = c), null !== l && (c ? (l.length = c) : (l = null)), u !== m)) + break; + } + } + return (i.errors = l), 0 === m; +} +function a( + t, + { + instancePath: r = '', + parentData: n, + parentDataProperty: s, + rootData: o = t, + } = {}, +) { + let p = null, + l = 0; + const m = l; + let f = !1; + const u = l; + if (l === u) + if (Array.isArray(t)) { + const n = t.length; + for (let s = 0; s < n; s++) { + let n = t[s]; + const a = l, + m = l; + let f = !1; + const u = l; + if (l == l) + if ('string' == typeof n) { + if (e(n) < 1) { + const t = { params: { limit: 1 } }; + null === p ? (p = [t]) : p.push(t), l++; + } + } else { + const t = { params: { type: 'string' } }; + null === p ? (p = [t]) : p.push(t), l++; + } + var c = u === l; + if (((f = f || c), !f)) { + const e = l; + i(n, { + instancePath: r + '/' + s, + parentData: t, + parentDataProperty: s, + rootData: o, + }) || + ((p = null === p ? i.errors : p.concat(i.errors)), (l = p.length)), + (c = e === l), + (f = f || c); + } + if (f) (l = m), null !== p && (m ? (p.length = m) : (p = null)); + else { + const t = { params: {} }; + null === p ? (p = [t]) : p.push(t), l++; + } + if (a !== l) break; + } + } else { + const t = { params: { type: 'array' } }; + null === p ? (p = [t]) : p.push(t), l++; + } + var y = u === l; + if (((f = f || y), !f)) { + const e = l; + i(t, { + instancePath: r, + parentData: n, + parentDataProperty: s, + rootData: o, + }) || ((p = null === p ? i.errors : p.concat(i.errors)), (l = p.length)), + (y = e === l), + (f = f || y); + } + if (!f) { + const t = { params: {} }; + return null === p ? (p = [t]) : p.push(t), l++, (a.errors = p), !1; + } + return ( + (l = m), + null !== p && (m ? (p.length = m) : (p = null)), + (a.errors = p), + 0 === l + ); +} +const o = { + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { type: 'string' }, + ], +}; +function p( + t, + { + instancePath: r = '', + parentData: e, + parentDataProperty: n, + rootData: s = t, + } = {}, +) { + let i = null, + a = 0; + const o = a; + let l = !1; + const m = a; + if ('string' != typeof t) { + const t = { params: { type: 'string' } }; + null === i ? (i = [t]) : i.push(t), a++; + } + var f = m === a; + if (((l = l || f), !l)) { + const r = a; + if (a == a) + if (t && 'object' == typeof t && !Array.isArray(t)) { + const r = a; + for (const r in t) + if ( + 'amd' !== r && + 'commonjs' !== r && + 'commonjs2' !== r && + 'root' !== r + ) { + const t = { params: { additionalProperty: r } }; + null === i ? (i = [t]) : i.push(t), a++; + break; + } + if (r === a) { + if (void 0 !== t.amd) { + const r = a; + if ('string' != typeof t.amd) { + const t = { params: { type: 'string' } }; + null === i ? (i = [t]) : i.push(t), a++; + } + var u = r === a; + } else u = !0; + if (u) { + if (void 0 !== t.commonjs) { + const r = a; + if ('string' != typeof t.commonjs) { + const t = { params: { type: 'string' } }; + null === i ? (i = [t]) : i.push(t), a++; + } + u = r === a; + } else u = !0; + if (u) { + if (void 0 !== t.commonjs2) { + const r = a; + if ('string' != typeof t.commonjs2) { + const t = { params: { type: 'string' } }; + null === i ? (i = [t]) : i.push(t), a++; + } + u = r === a; + } else u = !0; + if (u) + if (void 0 !== t.root) { + const r = a; + if ('string' != typeof t.root) { + const t = { params: { type: 'string' } }; + null === i ? (i = [t]) : i.push(t), a++; + } + u = r === a; + } else u = !0; + } + } + } + } else { + const t = { params: { type: 'object' } }; + null === i ? (i = [t]) : i.push(t), a++; + } + (f = r === a), (l = l || f); + } + if (!l) { + const t = { params: {} }; + return null === i ? (i = [t]) : i.push(t), a++, (p.errors = i), !1; + } + return ( + (a = o), + null !== i && (o ? (i.length = o) : (i = null)), + (p.errors = i), + 0 === a + ); +} +function l( + t, + { + instancePath: r = '', + parentData: n, + parentDataProperty: s, + rootData: i = t, + } = {}, +) { + let a = null, + o = 0; + const p = o; + let m = !1; + const f = o; + if (o === f) + if (Array.isArray(t)) + if (t.length < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } else { + const r = t.length; + for (let n = 0; n < r; n++) { + let r = t[n]; + const s = o; + if (o === s) + if ('string' == typeof r) { + if (e(r) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + if (s !== o) break; + } + } + else { + const t = { params: { type: 'array' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + var u = f === o; + if (((m = m || u), !m)) { + const r = o; + if (o === r) + if ('string' == typeof t) { + if (e(t) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + if (((u = r === o), (m = m || u), !m)) { + const r = o; + if (o == o) + if (t && 'object' == typeof t && !Array.isArray(t)) { + const r = o; + for (const r in t) + if ('amd' !== r && 'commonjs' !== r && 'root' !== r) { + const t = { params: { additionalProperty: r } }; + null === a ? (a = [t]) : a.push(t), o++; + break; + } + if (r === o) { + if (void 0 !== t.amd) { + let r = t.amd; + const n = o; + if (o === n) + if ('string' == typeof r) { + if (e(r) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + var c = n === o; + } else c = !0; + if (c) { + if (void 0 !== t.commonjs) { + let r = t.commonjs; + const n = o; + if (o === n) + if ('string' == typeof r) { + if (e(r) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + c = n === o; + } else c = !0; + if (c) + if (void 0 !== t.root) { + let r = t.root; + const n = o, + s = o; + let i = !1; + const p = o; + if (o === p) + if (Array.isArray(r)) { + const t = r.length; + for (let n = 0; n < t; n++) { + let t = r[n]; + const s = o; + if (o === s) + if ('string' == typeof t) { + if (e(t) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + if (s !== o) break; + } + } else { + const t = { params: { type: 'array' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + var y = p === o; + if (((i = i || y), !i)) { + const t = o; + if (o === t) + if ('string' == typeof r) { + if (e(r) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), o++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + (y = t === o), (i = i || y); + } + if (i) + (o = s), null !== a && (s ? (a.length = s) : (a = null)); + else { + const t = { params: {} }; + null === a ? (a = [t]) : a.push(t), o++; + } + c = n === o; + } else c = !0; + } + } + } else { + const t = { params: { type: 'object' } }; + null === a ? (a = [t]) : a.push(t), o++; + } + (u = r === o), (m = m || u); + } + } + if (!m) { + const t = { params: {} }; + return null === a ? (a = [t]) : a.push(t), o++, (l.errors = a), !1; + } + return ( + (o = p), + null !== a && (p ? (a.length = p) : (a = null)), + (l.errors = a), + 0 === o + ); +} +function m( + t, + { + instancePath: r = '', + parentData: n, + parentDataProperty: s, + rootData: i = t, + } = {}, +) { + let a = null, + f = 0; + if (0 === f) { + if (!t || 'object' != typeof t || Array.isArray(t)) + return (m.errors = [{ params: { type: 'object' } }]), !1; + { + let n; + if (void 0 === t.type && (n = 'type')) + return (m.errors = [{ params: { missingProperty: n } }]), !1; + { + const n = f; + for (const r in t) + if ( + 'amdContainer' !== r && + 'auxiliaryComment' !== r && + 'export' !== r && + 'name' !== r && + 'type' !== r && + 'umdNamedDefine' !== r + ) + return (m.errors = [{ params: { additionalProperty: r } }]), !1; + if (n === f) { + if (void 0 !== t.amdContainer) { + let r = t.amdContainer; + const n = f; + if (f == f) { + if ('string' != typeof r) + return (m.errors = [{ params: { type: 'string' } }]), !1; + if (e(r) < 1) return (m.errors = [{ params: { limit: 1 } }]), !1; + } + var u = n === f; + } else u = !0; + if (u) { + if (void 0 !== t.auxiliaryComment) { + const e = f; + p(t.auxiliaryComment, { + instancePath: r + '/auxiliaryComment', + parentData: t, + parentDataProperty: 'auxiliaryComment', + rootData: i, + }) || + ((a = null === a ? p.errors : a.concat(p.errors)), + (f = a.length)), + (u = e === f); + } else u = !0; + if (u) { + if (void 0 !== t.export) { + let r = t.export; + const n = f, + s = f; + let i = !1; + const o = f; + if (f === o) + if (Array.isArray(r)) { + const t = r.length; + for (let n = 0; n < t; n++) { + let t = r[n]; + const s = f; + if (f === s) + if ('string' == typeof t) { + if (e(t) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), f++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), f++; + } + if (s !== f) break; + } + } else { + const t = { params: { type: 'array' } }; + null === a ? (a = [t]) : a.push(t), f++; + } + var c = o === f; + if (((i = i || c), !i)) { + const t = f; + if (f === t) + if ('string' == typeof r) { + if (e(r) < 1) { + const t = { params: { limit: 1 } }; + null === a ? (a = [t]) : a.push(t), f++; + } + } else { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), f++; + } + (c = t === f), (i = i || c); + } + if (!i) { + const t = { params: {} }; + return ( + null === a ? (a = [t]) : a.push(t), f++, (m.errors = a), !1 + ); + } + (f = s), + null !== a && (s ? (a.length = s) : (a = null)), + (u = n === f); + } else u = !0; + if (u) { + if (void 0 !== t.name) { + const e = f; + l(t.name, { + instancePath: r + '/name', + parentData: t, + parentDataProperty: 'name', + rootData: i, + }) || + ((a = null === a ? l.errors : a.concat(l.errors)), + (f = a.length)), + (u = e === f); + } else u = !0; + if (u) { + if (void 0 !== t.type) { + let r = t.type; + const e = f, + n = f; + let s = !1; + const i = f; + if ( + 'var' !== r && + 'module' !== r && + 'assign' !== r && + 'assign-properties' !== r && + 'this' !== r && + 'window' !== r && + 'self' !== r && + 'global' !== r && + 'commonjs' !== r && + 'commonjs2' !== r && + 'commonjs-module' !== r && + 'commonjs-static' !== r && + 'amd' !== r && + 'amd-require' !== r && + 'umd' !== r && + 'umd2' !== r && + 'jsonp' !== r && + 'system' !== r + ) { + const t = { params: { allowedValues: o.anyOf[0].enum } }; + null === a ? (a = [t]) : a.push(t), f++; + } + var y = i === f; + if (((s = s || y), !s)) { + const t = f; + if ('string' != typeof r) { + const t = { params: { type: 'string' } }; + null === a ? (a = [t]) : a.push(t), f++; + } + (y = t === f), (s = s || y); + } + if (!s) { + const t = { params: {} }; + return ( + null === a ? (a = [t]) : a.push(t), + f++, + (m.errors = a), + !1 + ); + } + (f = n), + null !== a && (n ? (a.length = n) : (a = null)), + (u = e === f); + } else u = !0; + if (u) + if (void 0 !== t.umdNamedDefine) { + const r = f; + if ('boolean' != typeof t.umdNamedDefine) + return ( + (m.errors = [{ params: { type: 'boolean' } }]), !1 + ); + u = r === f; + } else u = !0; + } + } + } + } + } + } + } + } + return (m.errors = a), 0 === f; +} +function f( + n, + { + instancePath: s = '', + parentData: i, + parentDataProperty: o, + rootData: p = n, + } = {}, +) { + let l = null, + u = 0; + if (0 === u) { + if (!n || 'object' != typeof n || Array.isArray(n)) + return (f.errors = [{ params: { type: 'object' } }]), !1; + { + let i; + if ( + (void 0 === n.name && (i = 'name')) || + (void 0 === n.exposes && (i = 'exposes')) + ) + return (f.errors = [{ params: { missingProperty: i } }]), !1; + { + const i = u; + for (const t in n) + if ( + 'experiments' !== t && + 'exposes' !== t && + 'filename' !== t && + 'library' !== t && + 'name' !== t && + 'runtime' !== t && + 'runtimePlugins' !== t && + 'shareScope' !== t + ) + return (f.errors = [{ params: { additionalProperty: t } }]), !1; + if (i === u) { + if (void 0 !== n.experiments) { + let r = n.experiments; + const e = u; + if (u === e) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (f.errors = [{ params: { type: 'object' } }]), !1; + { + const e = u; + for (const t in r) + if ('asyncStartup' !== t && 'externalRuntime' !== t) + return ( + (f.errors = [{ params: { additionalProperty: t } }]), !1 + ); + if (e === u) { + if (void 0 !== r.asyncStartup) { + const t = u; + if ('boolean' != typeof r.asyncStartup) + return (f.errors = [{ params: { type: 'boolean' } }]), !1; + var c = t === u; + } else c = !0; + if (c) + if (void 0 !== r.externalRuntime) { + let e = r.externalRuntime; + const n = u, + s = u; + let i = !1; + const a = u; + if ('provide' !== e) { + const r = { + params: { + allowedValues: + t.properties.experiments.properties + .externalRuntime.anyOf[0].enum, + }, + }; + null === l ? (l = [r]) : l.push(r), u++; + } + var y = a === u; + if (((i = i || y), !i)) { + const t = u; + if ('boolean' != typeof e) { + const t = { params: { type: 'boolean' } }; + null === l ? (l = [t]) : l.push(t), u++; + } + (y = t === u), (i = i || y); + } + if (!i) { + const t = { params: {} }; + return ( + null === l ? (l = [t]) : l.push(t), + u++, + (f.errors = l), + !1 + ); + } + (u = s), + null !== l && (s ? (l.length = s) : (l = null)), + (c = n === u); + } else c = !0; + } + } + } + var d = e === u; + } else d = !0; + if (d) { + if (void 0 !== n.exposes) { + const t = u; + a(n.exposes, { + instancePath: s + '/exposes', + parentData: n, + parentDataProperty: 'exposes', + rootData: p, + }) || + ((l = null === l ? a.errors : l.concat(a.errors)), + (u = l.length)), + (d = t === u); + } else d = !0; + if (d) { + if (void 0 !== n.filename) { + let t = n.filename; + const r = u; + if (u === r) { + if ('string' != typeof t) + return (f.errors = [{ params: { type: 'string' } }]), !1; + if (e(t) < 1) + return (f.errors = [{ params: { limit: 1 } }]), !1; + } + d = r === u; + } else d = !0; + if (d) { + if (void 0 !== n.library) { + const t = u; + m(n.library, { + instancePath: s + '/library', + parentData: n, + parentDataProperty: 'library', + rootData: p, + }) || + ((l = null === l ? m.errors : l.concat(m.errors)), + (u = l.length)), + (d = t === u); + } else d = !0; + if (d) { + if (void 0 !== n.name) { + let t = n.name; + const r = u; + if (u === r) { + if ('string' != typeof t) + return ( + (f.errors = [{ params: { type: 'string' } }]), !1 + ); + if (e(t) < 1) + return (f.errors = [{ params: { limit: 1 } }]), !1; + } + d = r === u; + } else d = !0; + if (d) { + if (void 0 !== n.runtime) { + let t = n.runtime; + const s = u, + i = u; + let a = !1; + const o = u; + if (!1 !== t) { + const t = { + params: { allowedValues: r.anyOf[0].enum }, + }; + null === l ? (l = [t]) : l.push(t), u++; + } + var g = o === u; + if (((a = a || g), !a)) { + const r = u; + if (u === r) + if ('string' == typeof t) { + if (e(t) < 1) { + const t = { params: { limit: 1 } }; + null === l ? (l = [t]) : l.push(t), u++; + } + } else { + const t = { params: { type: 'string' } }; + null === l ? (l = [t]) : l.push(t), u++; + } + (g = r === u), (a = a || g); + } + if (!a) { + const t = { params: {} }; + return ( + null === l ? (l = [t]) : l.push(t), + u++, + (f.errors = l), + !1 + ); + } + (u = i), + null !== l && (i ? (l.length = i) : (l = null)), + (d = s === u); + } else d = !0; + if (d) { + if (void 0 !== n.runtimePlugins) { + let t = n.runtimePlugins; + const r = u; + if (u === r) { + if (!Array.isArray(t)) + return ( + (f.errors = [{ params: { type: 'array' } }]), !1 + ); + { + const r = t.length; + for (let e = 0; e < r; e++) { + const r = u; + if ('string' != typeof t[e]) + return ( + (f.errors = [{ params: { type: 'string' } }]), + !1 + ); + if (r !== u) break; + } + } + } + d = r === u; + } else d = !0; + if (d) + if (void 0 !== n.shareScope) { + let t = n.shareScope; + const r = u; + if (u === r) { + if ('string' != typeof t) + return ( + (f.errors = [{ params: { type: 'string' } }]), + !1 + ); + if (e(t) < 1) + return ( + (f.errors = [{ params: { limit: 1 } }]), !1 + ); + } + d = r === u; + } else d = !0; + } + } + } + } + } + } + } + } + } + } + return (f.errors = l), 0 === u; +} diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts b/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts index c80302d72da..da07fadf34e 100644 --- a/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.check.ts @@ -1,750 +1,727 @@ +// @ts-nocheck /* eslint-disable */ -//@ts-nocheck /* * This file was automatically generated. * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update */ -const r = /^(?:[A-Za-z]:[\\/]|\\\\|\/)/; - -function t( - r, +const e = /^(?:[A-Za-z]:[\\/]|\\\\|\/)/; +export const validate = m; +export default m; +const t = { + definitions: { + RuntimePlugin: { type: 'array', items: { type: 'string' } }, + AmdContainer: { type: 'string', minLength: 1 }, + AuxiliaryComment: { + anyOf: [ + { type: 'string' }, + { $ref: '#/definitions/LibraryCustomUmdCommentObject' }, + ], + }, + EntryRuntime: { + anyOf: [{ enum: [!1] }, { type: 'string', minLength: 1 }], + }, + Exposes: { + anyOf: [ + { + type: 'array', + items: { + anyOf: [ + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesObject' }, + ], + }, + }, + { $ref: '#/definitions/ExposesObject' }, + ], + }, + ExposesConfig: { + type: 'object', + additionalProperties: !1, + properties: { + import: { + anyOf: [ + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesItems' }, + ], + }, + name: { type: 'string' }, + }, + required: ['import'], + }, + ExposesItem: { type: 'string', minLength: 1 }, + ExposesItems: { + type: 'array', + items: { $ref: '#/definitions/ExposesItem' }, + }, + ExposesObject: { + type: 'object', + additionalProperties: { + anyOf: [ + { $ref: '#/definitions/ExposesConfig' }, + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesItems' }, + ], + }, + }, + LibraryCustomUmdCommentObject: { + type: 'object', + additionalProperties: !1, + properties: { + amd: { type: 'string' }, + commonjs: { type: 'string' }, + commonjs2: { type: 'string' }, + root: { type: 'string' }, + }, + }, + LibraryCustomUmdObject: { + type: 'object', + additionalProperties: !1, + properties: { + amd: { type: 'string', minLength: 1 }, + commonjs: { type: 'string', minLength: 1 }, + root: { + anyOf: [ + { type: 'array', items: { type: 'string', minLength: 1 } }, + { type: 'string', minLength: 1 }, + ], + }, + }, + }, + LibraryExport: { + anyOf: [ + { type: 'array', items: { type: 'string', minLength: 1 } }, + { type: 'string', minLength: 1 }, + ], + }, + LibraryName: { + anyOf: [ + { + type: 'array', + items: { type: 'string', minLength: 1 }, + minItems: 1, + }, + { type: 'string', minLength: 1 }, + { $ref: '#/definitions/LibraryCustomUmdObject' }, + ], + }, + LibraryOptions: { + type: 'object', + additionalProperties: !1, + properties: { + amdContainer: { $ref: '#/definitions/AmdContainer' }, + auxiliaryComment: { $ref: '#/definitions/AuxiliaryComment' }, + export: { $ref: '#/definitions/LibraryExport' }, + name: { $ref: '#/definitions/LibraryName' }, + type: { $ref: '#/definitions/LibraryType' }, + umdNamedDefine: { $ref: '#/definitions/UmdNamedDefine' }, + }, + required: ['type'], + }, + LibraryType: { + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { type: 'string' }, + ], + }, + UmdNamedDefine: { type: 'boolean' }, + }, + type: 'object', + additionalProperties: !1, + properties: { + exposes: { $ref: '#/definitions/Exposes' }, + filename: { type: 'string', absolutePath: !1, minLength: 1 }, + library: { $ref: '#/definitions/LibraryOptions' }, + name: { type: 'string', minLength: 1 }, + runtime: { $ref: '#/definitions/EntryRuntime' }, + runtimePlugins: { $ref: '#/definitions/RuntimePlugin' }, + shareScope: { type: 'string', minLength: 1 }, + experiments: { + type: 'object', + properties: { + federationRuntime: { + anyOf: [{ type: 'boolean' }, { enum: ['hoisted'] }], + }, + externalRuntime: { + anyOf: [{ type: 'boolean' }, { enum: ['provide'] }], + }, + }, + additionalProperties: !1, + }, + }, + required: ['name', 'exposes'], + }, + r = { anyOf: [{ enum: [!1] }, { type: 'string', minLength: 1 }] }; +function n( + e, { - instancePath: e = '', - parentData: n, + instancePath: t = '', + parentData: r, parentDataProperty: s, - rootData: a = r, + rootData: o = e, } = {}, ) { - if (!Array.isArray(r)) - return ( - (t.errors = [ - { - params: { - type: 'array', - }, - }, - ]), - !1 - ); + if (!Array.isArray(e)) + return (n.errors = [{ params: { type: 'array' } }]), !1; { - const e = r.length; - for (let n = 0; n < e; n++) { - let e = r[n]; + const t = e.length; + for (let r = 0; r < t; r++) { + let t = e[r]; const s = 0; - if ('string' != typeof e) - return ( - (t.errors = [ - { - params: { - type: 'string', - }, - }, - ]), - !1 - ); - if (e.length < 1) - return ( - (t.errors = [ - { - params: {}, - }, - ]), - !1 - ); + if ('string' != typeof t) + return (n.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (n.errors = [{ params: {} }]), !1; if (0 !== s) break; } } - return (t.errors = null), !0; + return (n.errors = null), !0; } - -function e( - r, +function s( + e, { - instancePath: n = '', - parentData: s, - parentDataProperty: a, - rootData: o = r, + instancePath: t = '', + parentData: r, + parentDataProperty: o, + rootData: a = e, } = {}, ) { let i = null, l = 0; if (0 === l) { - if (!r || 'object' != typeof r || Array.isArray(r)) - return ( - (e.errors = [ - { - params: { - type: 'object', - }, - }, - ]), - !1 - ); + if (!e || 'object' != typeof e || Array.isArray(e)) + return (s.errors = [{ params: { type: 'object' } }]), !1; { - let s; - if (void 0 === r.import && (s = 'import')) - return ( - (e.errors = [ - { - params: { - missingProperty: s, - }, - }, - ]), - !1 - ); + let r; + if (void 0 === e.import && (r = 'import')) + return (s.errors = [{ params: { missingProperty: r } }]), !1; { - const s = l; - for (const t in r) + const r = l; + for (const t in e) if ('import' !== t && 'name' !== t) - return ( - (e.errors = [ - { - params: { - additionalProperty: t, - }, - }, - ]), - !1 - ); - if (s === l) { - if (void 0 !== r.import) { - let s = r.import; - const a = l, - u = l; - let c = !1; - const m = l; + return (s.errors = [{ params: { additionalProperty: t } }]), !1; + if (r === l) { + if (void 0 !== e.import) { + let r = e.import; + const o = l, + m = l; + let u = !1; + const c = l; if (l == l) - if ('string' == typeof s) { - if (s.length < 1) { - const r = { - params: {}, - }; - null === i ? (i = [r]) : i.push(r), l++; + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === i ? (i = [e]) : i.push(e), l++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === i ? (i = [r]) : i.push(r), l++; + const e = { params: { type: 'string' } }; + null === i ? (i = [e]) : i.push(e), l++; } - var p = m === l; - if (((c = c || p), !c)) { - const e = l; - t(s, { - instancePath: n + '/import', - parentData: r, + var p = c === l; + if (((u = u || p), !u)) { + const s = l; + n(r, { + instancePath: t + '/import', + parentData: e, parentDataProperty: 'import', - rootData: o, + rootData: a, }) || - ((i = null === i ? t.errors : i.concat(t.errors)), + ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), - (p = e === l), - (c = c || p); + (p = s === l), + (u = u || p); } - if (!c) { - const r = { - params: {}, - }; + if (!u) { + const e = { params: {} }; return ( - null === i ? (i = [r]) : i.push(r), l++, (e.errors = i), !1 + null === i ? (i = [e]) : i.push(e), l++, (s.errors = i), !1 ); } - (l = u), null !== i && (u ? (i.length = u) : (i = null)); - var f = a === l; + (l = m), null !== i && (m ? (i.length = m) : (i = null)); + var f = o === l; } else f = !0; if (f) - if (void 0 !== r.name) { + if (void 0 !== e.name) { const t = l; - if ('string' != typeof r.name) - return ( - (e.errors = [ - { - params: { - type: 'string', - }, - }, - ]), - !1 - ); + if ('string' != typeof e.name) + return (s.errors = [{ params: { type: 'string' } }]), !1; f = t === l; } else f = !0; } } } } - return (e.errors = i), 0 === l; + return (s.errors = i), 0 === l; } - -function n( - r, +function o( + e, { - instancePath: s = '', - parentData: a, - parentDataProperty: o, - rootData: i = r, + instancePath: t = '', + parentData: r, + parentDataProperty: a, + rootData: i = e, } = {}, ) { let l = null, p = 0; if (0 === p) { - if (!r || 'object' != typeof r || Array.isArray(r)) - return ( - (n.errors = [ - { - params: { - type: 'object', - }, - }, - ]), - !1 - ); - for (const a in r) { - let o = r[a]; - const u = p, - c = p; - let m = !1; + if (!e || 'object' != typeof e || Array.isArray(e)) + return (o.errors = [{ params: { type: 'object' } }]), !1; + for (const r in e) { + let a = e[r]; + const m = p, + u = p; + let c = !1; const y = p; - e(o, { - instancePath: s + '/' + a.replace(/~/g, '~0').replace(/\//g, '~1'), - parentData: r, - parentDataProperty: a, + s(a, { + instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: e, + parentDataProperty: r, rootData: i, - }) || ((l = null === l ? e.errors : l.concat(e.errors)), (p = l.length)); + }) || ((l = null === l ? s.errors : l.concat(s.errors)), (p = l.length)); var f = y === p; - if (((m = m || f), !m)) { - const e = p; + if (((c = c || f), !c)) { + const s = p; if (p == p) - if ('string' == typeof o) { - if (o.length < 1) { - const r = { - params: {}, - }; - null === l ? (l = [r]) : l.push(r), p++; + if ('string' == typeof a) { + if (a.length < 1) { + const e = { params: {} }; + null === l ? (l = [e]) : l.push(e), p++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: { type: 'string' } }; + null === l ? (l = [e]) : l.push(e), p++; } - if (((f = e === p), (m = m || f), !m)) { - const e = p; - t(o, { - instancePath: s + '/' + a.replace(/~/g, '~0').replace(/\//g, '~1'), - parentData: r, - parentDataProperty: a, + if (((f = s === p), (c = c || f), !c)) { + const s = p; + n(a, { + instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: e, + parentDataProperty: r, rootData: i, }) || - ((l = null === l ? t.errors : l.concat(t.errors)), (p = l.length)), - (f = e === p), - (m = m || f); + ((l = null === l ? n.errors : l.concat(n.errors)), (p = l.length)), + (f = s === p), + (c = c || f); } } - if (!m) { - const r = { - params: {}, - }; - return null === l ? (l = [r]) : l.push(r), p++, (n.errors = l), !1; + if (!c) { + const e = { params: {} }; + return null === l ? (l = [e]) : l.push(e), p++, (o.errors = l), !1; } - if (((p = c), null !== l && (c ? (l.length = c) : (l = null)), u !== p)) + if (((p = u), null !== l && (u ? (l.length = u) : (l = null)), m !== p)) break; } } - return (n.errors = l), 0 === p; + return (o.errors = l), 0 === p; } - -function s( - r, +function a( + e, { instancePath: t = '', - parentData: e, - parentDataProperty: a, - rootData: o = r, + parentData: r, + parentDataProperty: n, + rootData: s = e, } = {}, ) { let i = null, l = 0; const p = l; let f = !1; - const u = l; - if (l === u) - if (Array.isArray(r)) { - const e = r.length; - for (let s = 0; s < e; s++) { - let e = r[s]; + const m = l; + if (l === m) + if (Array.isArray(e)) { + const r = e.length; + for (let n = 0; n < r; n++) { + let r = e[n]; const a = l, p = l; let f = !1; - const u = l; + const m = l; if (l == l) - if ('string' == typeof e) { - if (e.length < 1) { - const r = { - params: {}, - }; - null === i ? (i = [r]) : i.push(r), l++; + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === i ? (i = [e]) : i.push(e), l++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === i ? (i = [r]) : i.push(r), l++; + const e = { params: { type: 'string' } }; + null === i ? (i = [e]) : i.push(e), l++; } - var c = u === l; - if (((f = f || c), !f)) { + var u = m === l; + if (((f = f || u), !f)) { const a = l; - n(e, { - instancePath: t + '/' + s, - parentData: r, - parentDataProperty: s, - rootData: o, + o(r, { + instancePath: t + '/' + n, + parentData: e, + parentDataProperty: n, + rootData: s, }) || - ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), - (c = a === l), - (f = f || c); + ((i = null === i ? o.errors : i.concat(o.errors)), (l = i.length)), + (u = a === l), + (f = f || u); } if (f) (l = p), null !== i && (p ? (i.length = p) : (i = null)); else { - const r = { - params: {}, - }; - null === i ? (i = [r]) : i.push(r), l++; + const e = { params: {} }; + null === i ? (i = [e]) : i.push(e), l++; } if (a !== l) break; } } else { - const r = { - params: { - type: 'array', - }, - }; - null === i ? (i = [r]) : i.push(r), l++; + const e = { params: { type: 'array' } }; + null === i ? (i = [e]) : i.push(e), l++; } - var m = u === l; - if (((f = f || m), !f)) { - const s = l; - n(r, { + var c = m === l; + if (((f = f || c), !f)) { + const a = l; + o(e, { instancePath: t, - parentData: e, - parentDataProperty: a, - rootData: o, - }) || ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), - (m = s === l), - (f = f || m); + parentData: r, + parentDataProperty: n, + rootData: s, + }) || ((i = null === i ? o.errors : i.concat(o.errors)), (l = i.length)), + (c = a === l), + (f = f || c); } if (!f) { - const r = { - params: {}, - }; - return null === i ? (i = [r]) : i.push(r), l++, (s.errors = i), !1; + const e = { params: {} }; + return null === i ? (i = [e]) : i.push(e), l++, (a.errors = i), !1; } return ( (l = p), null !== i && (p ? (i.length = p) : (i = null)), - (s.errors = i), + (a.errors = i), 0 === l ); } - -function a( - r, +const i = { + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { type: 'string' }, + ], +}; +function l( + e, { instancePath: t = '', - parentData: e, + parentData: r, parentDataProperty: n, - rootData: s = r, + rootData: s = e, } = {}, ) { let o = null, - i = 0; - const l = i; + a = 0; + const i = a; let p = !1; - const f = i; - if ('string' != typeof r) { - const r = { - params: { - type: 'string', - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + const f = a; + if ('string' != typeof e) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - var u = f === i; - if (((p = p || u), !p)) { - const t = i; - if (i == i) - if (r && 'object' == typeof r && !Array.isArray(r)) { - const t = i; - for (const t in r) + var m = f === a; + if (((p = p || m), !p)) { + const t = a; + if (a == a) + if (e && 'object' == typeof e && !Array.isArray(e)) { + const t = a; + for (const t in e) if ( 'amd' !== t && 'commonjs' !== t && 'commonjs2' !== t && 'root' !== t ) { - const r = { - params: { - additionalProperty: t, - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + const e = { params: { additionalProperty: t } }; + null === o ? (o = [e]) : o.push(e), a++; break; } - if (t === i) { - if (void 0 !== r.amd) { - const t = i; - if ('string' != typeof r.amd) { - const r = { - params: { - type: 'string', - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + if (t === a) { + if (void 0 !== e.amd) { + const t = a; + if ('string' != typeof e.amd) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - var c = t === i; - } else c = !0; - if (c) { - if (void 0 !== r.commonjs) { - const t = i; - if ('string' != typeof r.commonjs) { - const r = { - params: { - type: 'string', - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + var u = t === a; + } else u = !0; + if (u) { + if (void 0 !== e.commonjs) { + const t = a; + if ('string' != typeof e.commonjs) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - c = t === i; - } else c = !0; - if (c) { - if (void 0 !== r.commonjs2) { - const t = i; - if ('string' != typeof r.commonjs2) { - const r = { - params: { - type: 'string', - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + u = t === a; + } else u = !0; + if (u) { + if (void 0 !== e.commonjs2) { + const t = a; + if ('string' != typeof e.commonjs2) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - c = t === i; - } else c = !0; - if (c) - if (void 0 !== r.root) { - const t = i; - if ('string' != typeof r.root) { - const r = { - params: { - type: 'string', - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + u = t === a; + } else u = !0; + if (u) + if (void 0 !== e.root) { + const t = a; + if ('string' != typeof e.root) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - c = t === i; - } else c = !0; + u = t === a; + } else u = !0; } } } } else { - const r = { - params: { - type: 'object', - }, - }; - null === o ? (o = [r]) : o.push(r), i++; + const e = { params: { type: 'object' } }; + null === o ? (o = [e]) : o.push(e), a++; } - (u = t === i), (p = p || u); + (m = t === a), (p = p || m); } if (!p) { - const r = { - params: {}, - }; - return null === o ? (o = [r]) : o.push(r), i++, (a.errors = o), !1; + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (l.errors = o), !1; } return ( - (i = l), - null !== o && (l ? (o.length = l) : (o = null)), - (a.errors = o), - 0 === i + (a = i), + null !== o && (i ? (o.length = i) : (o = null)), + (l.errors = o), + 0 === a ); } - -function o( - r, +function p( + e, { instancePath: t = '', - parentData: e, + parentData: r, parentDataProperty: n, - rootData: s = r, + rootData: s = e, } = {}, ) { - let a = null, - i = 0; - const l = i; - let p = !1; - const f = i; - if (i === f) - if (Array.isArray(r)) - if (r.length < 1) { - const r = { - params: { - limit: 1, - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + let o = null, + a = 0; + const i = a; + let l = !1; + const f = a; + if (a === f) + if (Array.isArray(e)) + if (e.length < 1) { + const e = { params: { limit: 1 } }; + null === o ? (o = [e]) : o.push(e), a++; } else { - const t = r.length; - for (let e = 0; e < t; e++) { - let t = r[e]; - const n = i; - if (i === n) + const t = e.length; + for (let r = 0; r < t; r++) { + let t = e[r]; + const n = a; + if (a === n) if ('string' == typeof t) { if (t.length < 1) { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - if (n !== i) break; + if (n !== a) break; } } else { - const r = { - params: { - type: 'array', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; } - var u = f === i; - if (((p = p || u), !p)) { - const t = i; - if (i === t) - if ('string' == typeof r) { - if (r.length < 1) { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + var m = f === a; + if (((l = l || m), !l)) { + const t = a; + if (a === t) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - if (((u = t === i), (p = p || u), !p)) { - const t = i; - if (i == i) - if (r && 'object' == typeof r && !Array.isArray(r)) { - const t = i; - for (const t in r) + if (((m = t === a), (l = l || m), !l)) { + const t = a; + if (a == a) + if (e && 'object' == typeof e && !Array.isArray(e)) { + const t = a; + for (const t in e) if ('amd' !== t && 'commonjs' !== t && 'root' !== t) { - const r = { - params: { - additionalProperty: t, - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { additionalProperty: t } }; + null === o ? (o = [e]) : o.push(e), a++; break; } - if (t === i) { - if (void 0 !== r.amd) { - let t = r.amd; - const e = i; - if (i === e) + if (t === a) { + if (void 0 !== e.amd) { + let t = e.amd; + const r = a; + if (a === r) if ('string' == typeof t) { if (t.length < 1) { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - var c = e === i; - } else c = !0; - if (c) { - if (void 0 !== r.commonjs) { - let t = r.commonjs; - const e = i; - if (i === e) + var u = r === a; + } else u = !0; + if (u) { + if (void 0 !== e.commonjs) { + let t = e.commonjs; + const r = a; + if (a === r) if ('string' == typeof t) { if (t.length < 1) { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - c = e === i; - } else c = !0; - if (c) - if (void 0 !== r.root) { - let t = r.root; - const e = i, - n = i; + u = r === a; + } else u = !0; + if (u) + if (void 0 !== e.root) { + let t = e.root; + const r = a, + n = a; let s = !1; - const o = i; - if (i === o) + const i = a; + if (a === i) if (Array.isArray(t)) { - const r = t.length; - for (let e = 0; e < r; e++) { - let r = t[e]; - const n = i; - if (i === n) - if ('string' == typeof r) { - if (r.length < 1) { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = t.length; + for (let r = 0; r < e; r++) { + let e = t[r]; + const n = a; + if (a === n) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - if (n !== i) break; + if (n !== a) break; } } else { - const r = { - params: { - type: 'array', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; } - var m = o === i; - if (((s = s || m), !s)) { - const r = i; - if (i === r) + var c = i === a; + if (((s = s || c), !s)) { + const e = a; + if (a === e) if ('string' == typeof t) { if (t.length < 1) { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - (m = r === i), (s = s || m); + (c = e === a), (s = s || c); } if (s) - (i = n), null !== a && (n ? (a.length = n) : (a = null)); + (a = n), null !== o && (n ? (o.length = n) : (o = null)); else { - const r = { - params: {}, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } - c = e === i; - } else c = !0; + u = r === a; + } else u = !0; } } } else { - const r = { - params: { - type: 'object', - }, - }; - null === a ? (a = [r]) : a.push(r), i++; + const e = { params: { type: 'object' } }; + null === o ? (o = [e]) : o.push(e), a++; } - (u = t === i), (p = p || u); + (m = t === a), (l = l || m); } } - if (!p) { - const r = { - params: {}, - }; - return null === a ? (a = [r]) : a.push(r), i++, (o.errors = a), !1; + if (!l) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (p.errors = o), !1; } return ( - (i = l), - null !== a && (l ? (a.length = l) : (a = null)), - (o.errors = a), - 0 === i + (a = i), + null !== o && (i ? (o.length = i) : (o = null)), + (p.errors = o), + 0 === a ); } - -function i( - r, +function f( + e, { instancePath: t = '', - parentData: e, + parentData: r, parentDataProperty: n, - rootData: s = r, + rootData: s = e, } = {}, ) { - let l = null, - p = 0; - if (0 === p) { - if (!r || 'object' != typeof r || Array.isArray(r)) - return ( - (i.errors = [ - { - params: { - type: 'object', - }, - }, - ]), - !1 - ); + let o = null, + a = 0; + if (0 === a) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (f.errors = [{ params: { type: 'object' } }]), !1; { - let e; - if (void 0 === r.type && (e = 'type')) - return ( - (i.errors = [ - { - params: { - missingProperty: e, - }, - }, - ]), - !1 - ); + let r; + if (void 0 === e.type && (r = 'type')) + return (f.errors = [{ params: { missingProperty: r } }]), !1; { - const e = p; - for (const t in r) + const r = a; + for (const t in e) if ( 'amdContainer' !== t && 'auxiliaryComment' !== t && @@ -753,149 +730,105 @@ function i( 'type' !== t && 'umdNamedDefine' !== t ) - return ( - (i.errors = [ - { - params: { - additionalProperty: t, - }, - }, - ]), - !1 - ); - if (e === p) { - if (void 0 !== r.amdContainer) { - let t = r.amdContainer; - const e = p; - if (p == p) { + return (f.errors = [{ params: { additionalProperty: t } }]), !1; + if (r === a) { + if (void 0 !== e.amdContainer) { + let t = e.amdContainer; + const r = a; + if (a == a) { if ('string' != typeof t) - return ( - (i.errors = [ - { - params: { - type: 'string', - }, - }, - ]), - !1 - ); - if (t.length < 1) - return ( - (i.errors = [ - { - params: {}, - }, - ]), - !1 - ); + return (f.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (f.errors = [{ params: {} }]), !1; } - var f = e === p; - } else f = !0; - if (f) { - if (void 0 !== r.auxiliaryComment) { - const e = p; - a(r.auxiliaryComment, { + var m = r === a; + } else m = !0; + if (m) { + if (void 0 !== e.auxiliaryComment) { + const r = a; + l(e.auxiliaryComment, { instancePath: t + '/auxiliaryComment', - parentData: r, + parentData: e, parentDataProperty: 'auxiliaryComment', rootData: s, }) || - ((l = null === l ? a.errors : l.concat(a.errors)), - (p = l.length)), - (f = e === p); - } else f = !0; - if (f) { - if (void 0 !== r.export) { - let t = r.export; - const e = p, - n = p; + ((o = null === o ? l.errors : o.concat(l.errors)), + (a = o.length)), + (m = r === a); + } else m = !0; + if (m) { + if (void 0 !== e.export) { + let t = e.export; + const r = a, + n = a; let s = !1; - const a = p; - if (p === a) + const i = a; + if (a === i) if (Array.isArray(t)) { - const r = t.length; - for (let e = 0; e < r; e++) { - let r = t[e]; - const n = p; - if (p === n) - if ('string' == typeof r) { - if (r.length < 1) { - const r = { - params: {}, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = t.length; + for (let r = 0; r < e; r++) { + let e = t[r]; + const n = a; + if (a === n) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - if (n !== p) break; + if (n !== a) break; } } else { - const r = { - params: { - type: 'array', - }, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; } - var u = a === p; + var u = i === a; if (((s = s || u), !s)) { - const r = p; - if (p === r) + const e = a; + if (a === e) if ('string' == typeof t) { if (t.length < 1) { - const r = { - params: {}, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; } } else { - const r = { - params: { - type: 'string', - }, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - (u = r === p), (s = s || u); + (u = e === a), (s = s || u); } if (!s) { - const r = { - params: {}, - }; + const e = { params: {} }; return ( - null === l ? (l = [r]) : l.push(r), p++, (i.errors = l), !1 + null === o ? (o = [e]) : o.push(e), a++, (f.errors = o), !1 ); } - (p = n), - null !== l && (n ? (l.length = n) : (l = null)), - (f = e === p); - } else f = !0; - if (f) { - if (void 0 !== r.name) { - const e = p; - o(r.name, { + (a = n), + null !== o && (n ? (o.length = n) : (o = null)), + (m = r === a); + } else m = !0; + if (m) { + if (void 0 !== e.name) { + const r = a; + p(e.name, { instancePath: t + '/name', - parentData: r, + parentData: e, parentDataProperty: 'name', rootData: s, }) || - ((l = null === l ? o.errors : l.concat(o.errors)), - (p = l.length)), - (f = e === p); - } else f = !0; - if (f) { - if (void 0 !== r.type) { - let t = r.type; - const e = p, - n = p; + ((o = null === o ? p.errors : o.concat(p.errors)), + (a = o.length)), + (m = r === a); + } else m = !0; + if (m) { + if (void 0 !== e.type) { + let t = e.type; + const r = a, + n = a; let s = !1; - const a = p; + const l = a; if ( 'var' !== t && 'module' !== t && @@ -916,55 +849,40 @@ function i( 'jsonp' !== t && 'system' !== t ) { - const r = { - params: {}, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: { allowedValues: i.anyOf[0].enum } }; + null === o ? (o = [e]) : o.push(e), a++; } - var c = a === p; + var c = l === a; if (((s = s || c), !s)) { - const r = p; + const e = a; if ('string' != typeof t) { - const r = { - params: { - type: 'string', - }, - }; - null === l ? (l = [r]) : l.push(r), p++; + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; } - (c = r === p), (s = s || c); + (c = e === a), (s = s || c); } if (!s) { - const r = { - params: {}, - }; + const e = { params: {} }; return ( - null === l ? (l = [r]) : l.push(r), - p++, - (i.errors = l), + null === o ? (o = [e]) : o.push(e), + a++, + (f.errors = o), !1 ); } - (p = n), - null !== l && (n ? (l.length = n) : (l = null)), - (f = e === p); - } else f = !0; - if (f) - if (void 0 !== r.umdNamedDefine) { - const t = p; - if ('boolean' != typeof r.umdNamedDefine) + (a = n), + null !== o && (n ? (o.length = n) : (o = null)), + (m = r === a); + } else m = !0; + if (m) + if (void 0 !== e.umdNamedDefine) { + const t = a; + if ('boolean' != typeof e.umdNamedDefine) return ( - (i.errors = [ - { - params: { - type: 'boolean', - }, - }, - ]), - !1 + (f.errors = [{ params: { type: 'boolean' } }]), !1 ); - f = t === p; - } else f = !0; + m = t === a; + } else m = !0; } } } @@ -973,501 +891,279 @@ function i( } } } - return (i.errors = l), 0 === p; + return (f.errors = o), 0 === a; } - -function l( - t, +function m( + n, { - instancePath: e = '', - parentData: n, - parentDataProperty: a, - rootData: o = t, + instancePath: s = '', + parentData: o, + parentDataProperty: i, + rootData: l = n, } = {}, ) { let p = null, - f = 0; - if (0 === f) { - if (!t || 'object' != typeof t || Array.isArray(t)) - return ( - (l.errors = [ - { - params: { - type: 'object', - }, - }, - ]), - !1 - ); + u = 0; + if (0 === u) { + if (!n || 'object' != typeof n || Array.isArray(n)) + return (m.errors = [{ params: { type: 'object' } }]), !1; { - let n; + let o; if ( - (void 0 === t.name && (n = 'name')) || - (void 0 === t.exposes && (n = 'exposes')) + (void 0 === n.name && (o = 'name')) || + (void 0 === n.exposes && (o = 'exposes')) ) - return ( - (l.errors = [ - { - params: { - missingProperty: n, - }, - }, - ]), - !1 - ); + return (m.errors = [{ params: { missingProperty: o } }]), !1; { - const n = f; - for (const r in t) + const o = u; + for (const e in n) if ( - 'experiments' !== r && - 'exposes' !== r && - 'filename' !== r && - 'library' !== r && - 'name' !== r && - 'runtime' !== r && - 'runtimePlugins' !== r && - 'shareScope' !== r + 'exposes' !== e && + 'filename' !== e && + 'library' !== e && + 'name' !== e && + 'runtime' !== e && + 'runtimePlugins' !== e && + 'shareScope' !== e && + 'experiments' !== e ) - return ( - (l.errors = [ - { - params: { - additionalProperty: r, - }, - }, - ]), - !1 - ); - if (n === f) { - if (void 0 !== t.experiments) { - let r = t.experiments; - const e = f; - if (f === e) { - if (!r || 'object' != typeof r || Array.isArray(r)) - return ( - (l.errors = [ - { - params: { - type: 'object', - }, - }, - ]), - !1 - ); - { - const t = f; - for (const t in r) - if ( - 'externalRuntime' !== t && - 'federationRuntime' !== t && - 'provideExternalRuntime' !== t - ) - return ( - (l.errors = [ - { - params: { - additionalProperty: t, - }, - }, - ]), - !1 - ); - if (t === f) { - if (void 0 !== r.externalRuntime) { - const t = f; - if ('boolean' != typeof r.externalRuntime) + return (m.errors = [{ params: { additionalProperty: e } }]), !1; + if (o === u) { + if (void 0 !== n.exposes) { + const e = u; + a(n.exposes, { + instancePath: s + '/exposes', + parentData: n, + parentDataProperty: 'exposes', + rootData: l, + }) || + ((p = null === p ? a.errors : p.concat(a.errors)), + (u = p.length)); + var c = e === u; + } else c = !0; + if (c) { + if (void 0 !== n.filename) { + let t = n.filename; + const r = u; + if (u === r) { + if ('string' != typeof t) + return (m.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (m.errors = [{ params: {} }]), !1; + if (t.includes('!') || !1 !== e.test(t)) + return (m.errors = [{ params: {} }]), !1; + } + c = r === u; + } else c = !0; + if (c) { + if (void 0 !== n.library) { + const e = u; + f(n.library, { + instancePath: s + '/library', + parentData: n, + parentDataProperty: 'library', + rootData: l, + }) || + ((p = null === p ? f.errors : p.concat(f.errors)), + (u = p.length)), + (c = e === u); + } else c = !0; + if (c) { + if (void 0 !== n.name) { + let e = n.name; + const t = u; + if (u === t) { + if ('string' != typeof e) + return (m.errors = [{ params: { type: 'string' } }]), !1; + if (e.length < 1) return (m.errors = [{ params: {} }]), !1; + } + c = t === u; + } else c = !0; + if (c) { + if (void 0 !== n.runtime) { + let e = n.runtime; + const t = u, + s = u; + let o = !1; + const a = u; + if (!1 !== e) { + const e = { params: { allowedValues: r.anyOf[0].enum } }; + null === p ? (p = [e]) : p.push(e), u++; + } + var y = a === u; + if (((o = o || y), !o)) { + const t = u; + if (u === t) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === p ? (p = [e]) : p.push(e), u++; + } + } else { + const e = { params: { type: 'string' } }; + null === p ? (p = [e]) : p.push(e), u++; + } + (y = t === u), (o = o || y); + } + if (!o) { + const e = { params: {} }; return ( - (l.errors = [ - { - params: { - type: 'boolean', - }, - }, - ]), + null === p ? (p = [e]) : p.push(e), + u++, + (m.errors = p), !1 ); - var u = t === f; - } else u = !0; - if (u) { - if (void 0 !== r.federationRuntime) { - let t = r.federationRuntime; - const e = f, - n = f; - let s = !1; - const a = f; - if ('hoisted' !== t) { - const r = { - params: {}, - }; - null === p ? (p = [r]) : p.push(r), f++; - } - var c = a === f; - if (((s = s || c), !s)) { - const r = f; - if ('boolean' != typeof t) { - const r = { - params: { - type: 'boolean', - }, - }; - null === p ? (p = [r]) : p.push(r), f++; - } - (c = r === f), (s = s || c); - } - if (!s) { - const r = { - params: {}, - }; - return ( - null === p ? (p = [r]) : p.push(r), - f++, - (l.errors = p), - !1 - ); - } - (f = n), - null !== p && (n ? (p.length = n) : (p = null)), - (u = e === f); - } else u = !0; - if (u) - if (void 0 !== r.provideExternalRuntime) { - const t = f; - if ('boolean' != typeof r.provideExternalRuntime) + } + (u = s), + null !== p && (s ? (p.length = s) : (p = null)), + (c = t === u); + } else c = !0; + if (c) { + if (void 0 !== n.runtimePlugins) { + let e = n.runtimePlugins; + const t = u; + if (u == u) { + if (!Array.isArray(e)) return ( - (l.errors = [ - { - params: { - type: 'boolean', - }, - }, - ]), - !1 + (m.errors = [{ params: { type: 'array' } }]), !1 ); - u = t === f; - } else u = !0; - } - } - } - } - var m = e === f; - } else m = !0; - if (m) { - if (void 0 !== t.exposes) { - const r = f; - s(t.exposes, { - instancePath: e + '/exposes', - parentData: t, - parentDataProperty: 'exposes', - rootData: o, - }) || - ((p = null === p ? s.errors : p.concat(s.errors)), - (f = p.length)), - (m = r === f); - } else m = !0; - if (m) { - if (void 0 !== t.filename) { - let e = t.filename; - const n = f; - if (f === n) { - if ('string' != typeof e) - return ( - (l.errors = [ { - params: { - type: 'string', - }, - }, - ]), - !1 - ); - if (e.includes('!') || !1 !== r.test(e)) - return ( - (l.errors = [ - { - params: {}, - }, - ]), - !1 - ); - if (e.length < 1) - return ( - (l.errors = [ - { - params: {}, - }, - ]), - !1 - ); - } - m = n === f; - } else m = !0; - if (m) { - if (void 0 !== t.library) { - const r = f; - i(t.library, { - instancePath: e + '/library', - parentData: t, - parentDataProperty: 'library', - rootData: o, - }) || - ((p = null === p ? i.errors : p.concat(i.errors)), - (f = p.length)), - (m = r === f); - } else m = !0; - if (m) { - if (void 0 !== t.name) { - let r = t.name; - const e = f; - if (f === e) { - if ('string' != typeof r) - return ( - (l.errors = [ - { - params: { - type: 'string', - }, - }, - ]), - !1 - ); - if (r.length < 1) - return ( - (l.errors = [ - { - params: {}, - }, - ]), - !1 - ); - } - m = e === f; - } else m = !0; - if (m) { - if (void 0 !== t.runtime) { - let r = t.runtime; - const e = f, - n = f; - let s = !1; - const a = f; - if (!1 !== r) { - const r = { - params: {}, - }; - null === p ? (p = [r]) : p.push(r), f++; - } - var y = a === f; - if (((s = s || y), !s)) { - const t = f; - if (f === t) - if ('string' == typeof r) { - if (r.length < 1) { - const r = { - params: {}, - }; - null === p ? (p = [r]) : p.push(r), f++; - } - } else { - const r = { - params: { - type: 'string', - }, - }; - null === p ? (p = [r]) : p.push(r), f++; + const t = e.length; + for (let r = 0; r < t; r++) { + const t = u; + if ('string' != typeof e[r]) + return ( + (m.errors = [{ params: { type: 'string' } }]), + !1 + ); + if (t !== u) break; } - (y = t === f), (s = s || y); - } - if (!s) { - const r = { - params: {}, - }; - return ( - null === p ? (p = [r]) : p.push(r), - f++, - (l.errors = p), - !1 - ); + } } - (f = n), - null !== p && (n ? (p.length = n) : (p = null)), - (m = e === f); - } else m = !0; - if (m) { - if (void 0 !== t.runtimePlugins) { - let r = t.runtimePlugins; - const e = f; - if (f === e) { - if (!Array.isArray(r)) + c = t === u; + } else c = !0; + if (c) { + if (void 0 !== n.shareScope) { + let e = n.shareScope; + const t = u; + if (u === t) { + if ('string' != typeof e) return ( - (l.errors = [ - { - params: { - type: 'array', - }, - }, - ]), - !1 + (m.errors = [{ params: { type: 'string' } }]), !1 ); - { - const t = r.length; - for (let e = 0; e < t; e++) { - let t = r[e]; - const n = f, - s = f; - let a = !1; - const o = f; - if (f === o) - if ('string' == typeof t) { - if (t.length < 1) { - const r = { - params: {}, - }; - null === p ? (p = [r]) : p.push(r), f++; + if (e.length < 1) + return (m.errors = [{ params: {} }]), !1; + } + c = t === u; + } else c = !0; + if (c) + if (void 0 !== n.experiments) { + let e = n.experiments; + const r = u; + if (u === r) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return ( + (m.errors = [{ params: { type: 'object' } }]), + !1 + ); + { + const r = u; + for (const t in e) + if ( + 'federationRuntime' !== t && + 'externalRuntime' !== t + ) + return ( + (m.errors = [ + { params: { additionalProperty: t } }, + ]), + !1 + ); + if (r === u) { + if (void 0 !== e.federationRuntime) { + let r = e.federationRuntime; + const n = u, + s = u; + let o = !1; + const a = u; + if ('boolean' != typeof r) { + const e = { params: { type: 'boolean' } }; + null === p ? (p = [e]) : p.push(e), u++; } - } else { - const r = { - params: { - type: 'string', - }, - }; - null === p ? (p = [r]) : p.push(r), f++; - } - var h = o === f; - if (((a = a || h), !a)) { - const r = f; - if (f === r) - if ( - t && - 'object' == typeof t && - !Array.isArray(t) - ) { - let r; - if ( - (void 0 === t.import && (r = 'import')) || - (void 0 === t.async && (r = 'async')) - ) { - const t = { + var g = a === u; + if (((o = o || g), !o)) { + const e = u; + if ('hoisted' !== r) { + const e = { params: { - missingProperty: r, + allowedValues: + t.properties.experiments.properties + .federationRuntime.anyOf[1].enum, }, }; - null === p ? (p = [t]) : p.push(t), f++; - } else { - const r = f; - for (const r in t) - if ('async' !== r && 'import' !== r) { - const t = { - params: { - additionalProperty: r, - }, - }; - null === p ? (p = [t]) : p.push(t), - f++; - break; - } - if (r === f) { - if (void 0 !== t.async) { - const r = f; - if ('boolean' != typeof t.async) { - const r = { - params: { - type: 'boolean', - }, - }; - null === p ? (p = [r]) : p.push(r), - f++; - } - var g = r === f; - } else g = !0; - if (g) - if (void 0 !== t.import) { - let r = t.import; - const e = f; - if (f === e) - if ('string' == typeof r) { - if (r.length < 1) { - const r = { - params: {}, - }; - null === p - ? (p = [r]) - : p.push(r), - f++; - } - } else { - const r = { - params: { - type: 'string', - }, - }; - null === p - ? (p = [r]) - : p.push(r), - f++; - } - g = e === f; - } else g = !0; - } + null === p ? (p = [e]) : p.push(e), u++; } - } else { - const r = { - params: { - type: 'object', - }, - }; - null === p ? (p = [r]) : p.push(r), f++; + (g = e === u), (o = o || g); } - (h = r === f), (a = a || h); - } - if (!a) { - const r = { - params: {}, - }; - return ( - null === p ? (p = [r]) : p.push(r), - f++, - (l.errors = p), - !1 - ); + if (!o) { + const e = { params: {} }; + return ( + null === p ? (p = [e]) : p.push(e), + u++, + (m.errors = p), + !1 + ); + } + (u = s), + null !== p && + (s ? (p.length = s) : (p = null)); + var d = n === u; + } else d = !0; + if (d) + if (void 0 !== e.externalRuntime) { + let r = e.externalRuntime; + const n = u, + s = u; + let o = !1; + const a = u; + if ('boolean' != typeof r) { + const e = { params: { type: 'boolean' } }; + null === p ? (p = [e]) : p.push(e), u++; + } + var h = a === u; + if (((o = o || h), !o)) { + const e = u; + if ('provide' !== r) { + const e = { + params: { + allowedValues: + t.properties.experiments + .properties.externalRuntime + .anyOf[1].enum, + }, + }; + null === p ? (p = [e]) : p.push(e), u++; + } + (h = e === u), (o = o || h); + } + if (!o) { + const e = { params: {} }; + return ( + null === p ? (p = [e]) : p.push(e), + u++, + (m.errors = p), + !1 + ); + } + (u = s), + null !== p && + (s ? (p.length = s) : (p = null)), + (d = n === u); + } else d = !0; } - if ( - ((f = s), - null !== p && (s ? (p.length = s) : (p = null)), - n !== f) - ) - break; } } - } - m = e === f; - } else m = !0; - if (m) - if (void 0 !== t.shareScope) { - let r = t.shareScope; - const e = f; - if (f === e) { - if ('string' != typeof r) - return ( - (l.errors = [ - { - params: { - type: 'string', - }, - }, - ]), - !1 - ); - if (r.length < 1) - return ( - (l.errors = [ - { - params: {}, - }, - ]), - !1 - ); - } - m = e === f; - } else m = !0; + c = r === u; + } else c = !0; } } } @@ -1478,6 +1174,5 @@ function l( } } } - return (l.errors = p), 0 === f; + return (m.errors = p), 0 === u; } -export default l; diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.json b/packages/enhanced/src/schemas/container/ContainerPlugin.json new file mode 100644 index 00000000000..671b32a38e4 --- /dev/null +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.json @@ -0,0 +1,316 @@ +{ + "definitions": { + "RuntimePlugin": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Runtime plugin file paths or package name." + }, + "AmdContainer": { + "description": "Add a container for define/require functions in the AMD module.", + "type": "string", + "minLength": 1 + }, + "AuxiliaryComment": { + "description": "Add a comment in the UMD wrapper.", + "anyOf": [ + { + "description": "Append the same comment above each import style.", + "type": "string" + }, + { + "$ref": "#/definitions/LibraryCustomUmdCommentObject" + } + ] + }, + "EntryRuntime": { + "description": "The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.", + "anyOf": [ + { + "enum": [false] + }, + { + "type": "string", + "minLength": 1 + } + ] + }, + "Exposes": { + "description": "Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Modules that should be exposed by this container.", + "anyOf": [ + { + "$ref": "#/definitions/ExposesItem" + }, + { + "$ref": "#/definitions/ExposesObject" + } + ] + } + }, + { + "$ref": "#/definitions/ExposesObject" + } + ] + }, + "ExposesConfig": { + "description": "Advanced configuration for modules that should be exposed by this container.", + "type": "object", + "additionalProperties": false, + "properties": { + "import": { + "description": "Request to a module that should be exposed by this container.", + "anyOf": [ + { + "$ref": "#/definitions/ExposesItem" + }, + { + "$ref": "#/definitions/ExposesItems" + } + ] + }, + "name": { + "description": "Custom chunk name for the exposed module.", + "type": "string" + } + }, + "required": ["import"] + }, + "ExposesItem": { + "description": "Module that should be exposed by this container.", + "type": "string", + "minLength": 1 + }, + "ExposesItems": { + "description": "Modules that should be exposed by this container.", + "type": "array", + "items": { + "$ref": "#/definitions/ExposesItem" + } + }, + "ExposesObject": { + "description": "Modules that should be exposed by this container. Property names are used as public paths.", + "type": "object", + "additionalProperties": { + "description": "Modules that should be exposed by this container.", + "anyOf": [ + { + "$ref": "#/definitions/ExposesConfig" + }, + { + "$ref": "#/definitions/ExposesItem" + }, + { + "$ref": "#/definitions/ExposesItems" + } + ] + } + }, + "LibraryCustomUmdCommentObject": { + "description": "Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.", + "type": "object", + "additionalProperties": false, + "properties": { + "amd": { + "description": "Set comment for `amd` section in UMD.", + "type": "string" + }, + "commonjs": { + "description": "Set comment for `commonjs` (exports) section in UMD.", + "type": "string" + }, + "commonjs2": { + "description": "Set comment for `commonjs2` (module.exports) section in UMD.", + "type": "string" + }, + "root": { + "description": "Set comment for `root` (global variable) section in UMD.", + "type": "string" + } + } + }, + "LibraryCustomUmdObject": { + "description": "Description object for all UMD variants of the library name.", + "type": "object", + "additionalProperties": false, + "properties": { + "amd": { + "description": "Name of the exposed AMD library in the UMD.", + "type": "string", + "minLength": 1 + }, + "commonjs": { + "description": "Name of the exposed commonjs export in the UMD.", + "type": "string", + "minLength": 1 + }, + "root": { + "description": "Name of the property exposed globally by a UMD library.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Part of the name of the property exposed globally by a UMD library.", + "type": "string", + "minLength": 1 + } + }, + { + "type": "string", + "minLength": 1 + } + ] + } + } + }, + "LibraryExport": { + "description": "Specify which export should be exposed as library.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Part of the export that should be exposed as library.", + "type": "string", + "minLength": 1 + } + }, + { + "type": "string", + "minLength": 1 + } + ] + }, + "LibraryName": { + "description": "The name of the library (some types allow unnamed libraries too).", + "anyOf": [ + { + "type": "array", + "items": { + "description": "A part of the library name.", + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/definitions/LibraryCustomUmdObject" + } + ] + }, + "LibraryOptions": { + "description": "Options for library.", + "type": "object", + "additionalProperties": false, + "properties": { + "amdContainer": { + "$ref": "#/definitions/AmdContainer" + }, + "auxiliaryComment": { + "$ref": "#/definitions/AuxiliaryComment" + }, + "export": { + "$ref": "#/definitions/LibraryExport" + }, + "name": { + "$ref": "#/definitions/LibraryName" + }, + "type": { + "$ref": "#/definitions/LibraryType" + }, + "umdNamedDefine": { + "$ref": "#/definitions/UmdNamedDefine" + } + }, + "required": ["type"] + }, + "LibraryType": { + "description": "Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).", + "anyOf": [ + { + "enum": [ + "var", + "module", + "assign", + "assign-properties", + "this", + "window", + "self", + "global", + "commonjs", + "commonjs2", + "commonjs-module", + "commonjs-static", + "amd", + "amd-require", + "umd", + "umd2", + "jsonp", + "system" + ] + }, + { + "type": "string" + } + ] + }, + "UmdNamedDefine": { + "description": "If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.", + "type": "boolean" + } + }, + "title": "ContainerPluginOptions", + "type": "object", + "additionalProperties": false, + "properties": { + "exposes": { + "$ref": "#/definitions/Exposes" + }, + "filename": { + "description": "The filename for this container relative path inside the `output.path` directory.", + "type": "string", + "absolutePath": false, + "minLength": 1 + }, + "library": { + "$ref": "#/definitions/LibraryOptions" + }, + "name": { + "description": "The name for this container.", + "type": "string", + "minLength": 1 + }, + "runtime": { + "$ref": "#/definitions/EntryRuntime" + }, + "runtimePlugins": { + "$ref": "#/definitions/RuntimePlugin" + }, + "shareScope": { + "description": "The name of the share scope which is shared with the host (defaults to 'default').", + "type": "string", + "minLength": 1 + }, + "experiments": { + "type": "object", + "properties": { + "federationRuntime": { + "anyOf": [{ "type": "boolean" }, { "enum": ["hoisted"] }] + }, + "externalRuntime": { + "anyOf": [{ "type": "boolean" }, { "enum": ["provide"] }] + } + }, + "additionalProperties": false + } + }, + "required": ["name", "exposes"] +} diff --git a/packages/enhanced/src/schemas/container/ContainerPlugin.ts b/packages/enhanced/src/schemas/container/ContainerPlugin.ts index 58747f5a66d..3676e30fbf6 100644 --- a/packages/enhanced/src/schemas/container/ContainerPlugin.ts +++ b/packages/enhanced/src/schemas/container/ContainerPlugin.ts @@ -1,34 +1,19 @@ -//@ts-nocheck -const runtimePlugin = { - type: 'array', - items: { - anyOf: [ - { - type: 'string', - minLength: 1, - description: 'Runtime Plugin File Path.', - }, - { - type: 'object', - required: ['import', 'async'], - properties: { - import: { - type: 'string', - minLength: 1, - description: 'Runtime Plugin File Path.', - }, - async: { - type: 'boolean', - }, - }, - additionalProperties: false, - }, - ], - }, -}; +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ export default { definitions: { + RuntimePlugin: { + type: 'array', + items: { + type: 'string', + }, + description: 'Runtime plugin file paths or package name.', + }, AmdContainer: { description: 'Add a container for define/require functions in the AMD module.', @@ -330,7 +315,9 @@ export default { runtime: { $ref: '#/definitions/EntryRuntime', }, - runtimePlugins: runtimePlugin, + runtimePlugins: { + $ref: '#/definitions/RuntimePlugin', + }, shareScope: { description: "The name of the share scope which is shared with the host (defaults to 'default').", @@ -341,14 +328,28 @@ export default { type: 'object', properties: { federationRuntime: { - anyOf: [{ type: 'boolean' }, { enum: ['hoisted'] }], + anyOf: [ + { + type: 'boolean', + }, + { + enum: ['hoisted'], + }, + ], }, externalRuntime: { - anyOf: [{ type: 'boolean' }, { enum: ['provide'] }], + anyOf: [ + { + type: 'boolean', + }, + { + enum: ['provide'], + }, + ], }, }, additionalProperties: false, }, }, required: ['name', 'exposes'], -}; +} as const; diff --git a/packages/enhanced/src/schemas/container/ContainerReferencePlugin.check.ts b/packages/enhanced/src/schemas/container/ContainerReferencePlugin.check.ts index e0fb064b137..184e5fe6129 100644 --- a/packages/enhanced/src/schemas/container/ContainerReferencePlugin.check.ts +++ b/packages/enhanced/src/schemas/container/ContainerReferencePlugin.check.ts @@ -1,127 +1,12 @@ +// @ts-nocheck /* eslint-disable */ -//@ts-nocheck /* * This file was automatically generated. * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update */ - -const schema40 = { - definitions: { - ExternalsType: { - enum: [ - 'var', - 'module', - 'assign', - 'this', - 'window', - 'self', - 'global', - 'commonjs', - 'commonjs2', - 'commonjs-module', - 'commonjs-static', - 'amd', - 'amd-require', - 'umd', - 'umd2', - 'jsonp', - 'system', - 'promise', - 'import', - 'script', - 'node-commonjs', - ], - }, - Remotes: { - anyOf: [ - { - type: 'array', - items: { - anyOf: [ - { - $ref: '#/definitions/RemotesItem', - }, - { - $ref: '#/definitions/RemotesObject', - }, - ], - }, - }, - { - $ref: '#/definitions/RemotesObject', - }, - ], - }, - RemotesConfig: { - type: 'object', - additionalProperties: false, - properties: { - external: { - anyOf: [ - { - $ref: '#/definitions/RemotesItem', - }, - { - $ref: '#/definitions/RemotesItems', - }, - ], - }, - shareScope: { - type: 'string', - minLength: 1, - }, - }, - required: ['external'], - }, - RemotesItem: { - type: 'string', - minLength: 1, - }, - RemotesItems: { - type: 'array', - items: { - $ref: '#/definitions/RemotesItem', - }, - }, - RemotesObject: { - type: 'object', - additionalProperties: { - anyOf: [ - { - $ref: '#/definitions/RemotesConfig', - }, - { - $ref: '#/definitions/RemotesItem', - }, - { - $ref: '#/definitions/RemotesItems', - }, - ], - }, - }, - }, - type: 'object', - additionalProperties: false, - properties: { - remoteType: { - oneOf: [ - { - $ref: '#/definitions/ExternalsType', - }, - ], - }, - remotes: { - $ref: '#/definitions/Remotes', - }, - shareScope: { - type: 'string', - minLength: 1, - }, - }, - required: ['remoteType', 'remotes'], -}; -const schema41 = { +export const validate = o; +export default o; +const r = { enum: [ 'var', 'module', @@ -146,792 +31,349 @@ const schema41 = { 'node-commonjs', ], }; -const schema42 = { - anyOf: [ - { - type: 'array', - items: { - anyOf: [ - { - $ref: '#/definitions/RemotesItem', - }, - { - $ref: '#/definitions/RemotesObject', - }, - ], - }, - }, - { - $ref: '#/definitions/RemotesObject', - }, - ], -}; -const schema43 = { - type: 'string', - minLength: 1, -}; -const schema44 = { - type: 'object', - additionalProperties: { - anyOf: [ - { - $ref: '#/definitions/RemotesConfig', - }, - { - $ref: '#/definitions/RemotesItem', - }, - { - $ref: '#/definitions/RemotesItems', - }, - ], - }, -}; -const schema45 = { - type: 'object', - additionalProperties: false, - properties: { - external: { - anyOf: [ - { - $ref: '#/definitions/RemotesItem', - }, - { - $ref: '#/definitions/RemotesItems', - }, - ], - }, - name: { - type: 'string', - minLength: 1, - }, - shareScope: { - type: 'string', - minLength: 1, - }, - }, - required: ['external'], -}; -const schema47 = { - type: 'array', - items: { - $ref: '#/definitions/RemotesItem', - }, -}; - -function validate40( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +function t( + r, + { + instancePath: e = '', + parentData: a, + parentDataProperty: n, + rootData: o = r, + } = {}, ) { - let vErrors = null; - let errors = 0; - if (errors === 0) { - if (Array.isArray(data)) { - var valid0 = true; - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - let data0 = data[i0]; - const _errs1 = errors; - const _errs2 = errors; - if (errors === _errs2) { - if (typeof data0 === 'string') { - if (data0.length < 1) { - validate40.errors = [ - { - params: {}, - }, - ]; - return false; - } - } else { - validate40.errors = [ - { - params: { - type: 'string', - }, - }, - ]; - return false; - } - } - var valid0 = _errs1 === errors; - if (!valid0) { - break; - } - } - } else { - validate40.errors = [ - { - params: { - type: 'array', - }, - }, - ]; - return false; + if (!Array.isArray(r)) + return (t.errors = [{ params: { type: 'array' } }]), !1; + { + const e = r.length; + for (let a = 0; a < e; a++) { + let e = r[a]; + const n = 0; + if ('string' != typeof e) + return (t.errors = [{ params: { type: 'string' } }]), !1; + if (e.length < 1) return (t.errors = [{ params: {} }]), !1; + if (0 !== n) break; } } - validate40.errors = vErrors; - return errors === 0; + return (t.errors = null), !0; } - -function validate39( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +function e( + r, + { + instancePath: a = '', + parentData: n, + parentDataProperty: o, + rootData: s = r, + } = {}, ) { - let vErrors = null; - let errors = 0; - if (errors === 0) { - if (data && typeof data == 'object' && !Array.isArray(data)) { - let missing0; - if (data.external === undefined && (missing0 = 'external')) { - validate39.errors = [ - { - params: { - missingProperty: missing0, - }, - }, - ]; - return false; - } else { - const _errs1 = errors; - for (const key0 in data) { - if (!(key0 === 'external' || key0 === 'shareScope')) { - validate39.errors = [ - { - params: { - additionalProperty: key0, - }, - }, - ]; - return false; - break; - } - } - if (_errs1 === errors) { - if (data.external !== undefined) { - let data0 = data.external; - const _errs2 = errors; - const _errs3 = errors; - let valid1 = false; - const _errs4 = errors; - const _errs5 = errors; - if (errors === _errs5) { - if (typeof data0 === 'string') { - if (data0.length < 1) { - const err0 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } else { - const err1 = { - params: { - type: 'string', - }, - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); + let l = null, + i = 0; + if (0 === i) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (e.errors = [{ params: { type: 'object' } }]), !1; + { + let n; + if (void 0 === r.external && (n = 'external')) + return (e.errors = [{ params: { missingProperty: n } }]), !1; + { + const n = i; + for (const t in r) + if ('external' !== t && 'shareScope' !== t) + return (e.errors = [{ params: { additionalProperty: t } }]), !1; + if (n === i) { + if (void 0 !== r.external) { + let n = r.external; + const o = i, + u = i; + let m = !1; + const f = i; + if (i == i) + if ('string' == typeof n) { + if (n.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; } - errors++; - } - } - var _valid0 = _errs4 === errors; - valid1 = valid1 || _valid0; - if (!valid1) { - const _errs7 = errors; - if ( - !validate40(data0, { - instancePath: instancePath + '/external', - parentData: data, - parentDataProperty: 'external', - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate40.errors - : vErrors.concat(validate40.errors); - errors = vErrors.length; - } - var _valid0 = _errs7 === errors; - valid1 = valid1 || _valid0; - } - if (!valid1) { - const err2 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err2]; } else { - vErrors.push(err2); - } - errors++; - validate39.errors = vErrors; - return false; - } else { - errors = _errs3; - if (vErrors !== null) { - if (_errs3) { - vErrors.length = _errs3; - } else { - vErrors = null; - } + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; } + var p = f === i; + if (((m = m || p), !m)) { + const e = i; + t(n, { + instancePath: a + '/external', + parentData: r, + parentDataProperty: 'external', + rootData: s, + }) || + ((l = null === l ? t.errors : l.concat(t.errors)), + (i = l.length)), + (p = e === i), + (m = m || p); } - var valid0 = _errs2 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.name !== undefined) { - let data1 = data.name; - const _errs8 = errors; - if (errors === _errs8) { - if (typeof data1 === 'string') { - if (data1.length < 1) { - validate39.errors = [ - { - params: {}, - }, - ]; - return false; - } - } else { - validate39.errors = [ - { - params: { - type: 'string', - }, - }, - ]; - return false; - } - } - var valid0 = _errs8 === errors; - } else { - var valid0 = true; + if (!m) { + const r = { params: {} }; + return ( + null === l ? (l = [r]) : l.push(r), i++, (e.errors = l), !1 + ); } - if (valid0) { - if (data.shareScope !== undefined) { - let data2 = data.shareScope; - const _errs10 = errors; - if (errors === _errs10) { - if (typeof data2 === 'string') { - if (data2.length < 1) { - validate39.errors = [ - { - params: {}, - }, - ]; - return false; - } - } else { - validate39.errors = [ - { - params: { - type: 'string', - }, - }, - ]; - return false; - } - } - var valid0 = _errs10 === errors; - } else { - var valid0 = true; + (i = u), null !== l && (u ? (l.length = u) : (l = null)); + var c = o === i; + } else c = !0; + if (c) + if (void 0 !== r.shareScope) { + let t = r.shareScope; + const a = i; + if (i === a) { + if ('string' != typeof t) + return (e.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (e.errors = [{ params: {} }]), !1; } - } - } + c = a === i; + } else c = !0; } } - } else { - validate39.errors = [ - { - params: { - type: 'object', - }, - }, - ]; - return false; } } - validate39.errors = vErrors; - return errors === 0; + return (e.errors = l), 0 === i; } - -function validate38( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +function a( + r, + { + instancePath: n = '', + parentData: o, + parentDataProperty: s, + rootData: l = r, + } = {}, ) { - let vErrors = null; - let errors = 0; - if (errors === 0) { - if (data && typeof data == 'object' && !Array.isArray(data)) { - for (const key0 in data) { - let data0 = data[key0]; - const _errs2 = errors; - const _errs3 = errors; - let valid1 = false; - const _errs4 = errors; - if ( - !validate39(data0, { - instancePath: - instancePath + - '/' + - key0.replace(/~/g, '~0').replace(/\//g, '~1'), - parentData: data, - parentDataProperty: key0, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate39.errors - : vErrors.concat(validate39.errors); - errors = vErrors.length; - } - var _valid0 = _errs4 === errors; - valid1 = valid1 || _valid0; - if (!valid1) { - const _errs5 = errors; - const _errs6 = errors; - if (errors === _errs6) { - if (typeof data0 === 'string') { - if (data0.length < 1) { - const err0 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } else { - const err1 = { - params: { - type: 'string', - }, - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - var _valid0 = _errs5 === errors; - valid1 = valid1 || _valid0; - if (!valid1) { - const _errs8 = errors; - if ( - !validate40(data0, { - instancePath: - instancePath + - '/' + - key0.replace(/~/g, '~0').replace(/\//g, '~1'), - parentData: data, - parentDataProperty: key0, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate40.errors - : vErrors.concat(validate40.errors); - errors = vErrors.length; + let i = null, + p = 0; + if (0 === p) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (a.errors = [{ params: { type: 'object' } }]), !1; + for (const o in r) { + let s = r[o]; + const u = p, + m = p; + let f = !1; + const y = p; + e(s, { + instancePath: n + '/' + o.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: r, + parentDataProperty: o, + rootData: l, + }) || ((i = null === i ? e.errors : i.concat(e.errors)), (p = i.length)); + var c = y === p; + if (((f = f || c), !f)) { + const e = p; + if (p == p) + if ('string' == typeof s) { + if (s.length < 1) { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), p++; } - var _valid0 = _errs8 === errors; - valid1 = valid1 || _valid0; - } - } - if (!valid1) { - const err2 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err2]; } else { - vErrors.push(err2); - } - errors++; - validate38.errors = vErrors; - return false; - } else { - errors = _errs3; - if (vErrors !== null) { - if (_errs3) { - vErrors.length = _errs3; - } else { - vErrors = null; - } + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), p++; } - } - var valid0 = _errs2 === errors; - if (!valid0) { - break; + if (((c = e === p), (f = f || c), !f)) { + const e = p; + t(s, { + instancePath: n + '/' + o.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: r, + parentDataProperty: o, + rootData: l, + }) || + ((i = null === i ? t.errors : i.concat(t.errors)), (p = i.length)), + (c = e === p), + (f = f || c); } } - } else { - validate38.errors = [ - { - params: { - type: 'object', - }, - }, - ]; - return false; + if (!f) { + const r = { params: {} }; + return null === i ? (i = [r]) : i.push(r), p++, (a.errors = i), !1; + } + if (((p = m), null !== i && (m ? (i.length = m) : (i = null)), u !== p)) + break; } } - validate38.errors = vErrors; - return errors === 0; + return (a.errors = i), 0 === p; } - -function validate37( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +function n( + r, + { + instancePath: t = '', + parentData: e, + parentDataProperty: o, + rootData: s = r, + } = {}, ) { - let vErrors = null; - let errors = 0; - const _errs0 = errors; - let valid0 = false; - const _errs1 = errors; - if (errors === _errs1) { - if (Array.isArray(data)) { - var valid1 = true; - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - let data0 = data[i0]; - const _errs3 = errors; - const _errs4 = errors; - let valid2 = false; - const _errs5 = errors; - const _errs6 = errors; - if (errors === _errs6) { - if (typeof data0 === 'string') { - if (data0.length < 1) { - const err0 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; + let l = null, + i = 0; + const p = i; + let c = !1; + const u = i; + if (i === u) + if (Array.isArray(r)) { + const e = r.length; + for (let n = 0; n < e; n++) { + let e = r[n]; + const o = i, + p = i; + let c = !1; + const u = i; + if (i == i) + if ('string' == typeof e) { + if (e.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; } } else { - const err1 = { - params: { - type: 'string', - }, - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; } + var m = u === i; + if (((c = c || m), !c)) { + const o = i; + a(e, { + instancePath: t + '/' + n, + parentData: r, + parentDataProperty: n, + rootData: s, + }) || + ((l = null === l ? a.errors : l.concat(a.errors)), (i = l.length)), + (m = o === i), + (c = c || m); } - var _valid1 = _errs5 === errors; - valid2 = valid2 || _valid1; - if (!valid2) { - const _errs8 = errors; - if ( - !validate38(data0, { - instancePath: instancePath + '/' + i0, - parentData: data, - parentDataProperty: i0, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate38.errors - : vErrors.concat(validate38.errors); - errors = vErrors.length; - } - var _valid1 = _errs8 === errors; - valid2 = valid2 || _valid1; - } - if (!valid2) { - const err2 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } else { - errors = _errs4; - if (vErrors !== null) { - if (_errs4) { - vErrors.length = _errs4; - } else { - vErrors = null; - } - } - } - var valid1 = _errs3 === errors; - if (!valid1) { - break; + if (c) (i = p), null !== l && (p ? (l.length = p) : (l = null)); + else { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; } + if (o !== i) break; } } else { - const err3 = { - params: { - type: 'array', - }, - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - var _valid0 = _errs1 === errors; - valid0 = valid0 || _valid0; - if (!valid0) { - const _errs9 = errors; - if ( - !validate38(data, { - instancePath, - parentData, - parentDataProperty, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate38.errors - : vErrors.concat(validate38.errors); - errors = vErrors.length; + const r = { params: { type: 'array' } }; + null === l ? (l = [r]) : l.push(r), i++; } - var _valid0 = _errs9 === errors; - valid0 = valid0 || _valid0; + var f = u === i; + if (((c = c || f), !c)) { + const n = i; + a(r, { + instancePath: t, + parentData: e, + parentDataProperty: o, + rootData: s, + }) || ((l = null === l ? a.errors : l.concat(a.errors)), (i = l.length)), + (f = n === i), + (c = c || f); } - if (!valid0) { - const err4 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - validate37.errors = vErrors; - return false; - } else { - errors = _errs0; - if (vErrors !== null) { - if (_errs0) { - vErrors.length = _errs0; - } else { - vErrors = null; - } - } + if (!c) { + const r = { params: {} }; + return null === l ? (l = [r]) : l.push(r), i++, (n.errors = l), !1; } - validate37.errors = vErrors; - return errors === 0; + return ( + (i = p), + null !== l && (p ? (l.length = p) : (l = null)), + (n.errors = l), + 0 === i + ); } - -function validate36( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +function o( + t, + { + instancePath: e = '', + parentData: a, + parentDataProperty: s, + rootData: l = t, + } = {}, ) { - /*# sourceURL="" */ let vErrors = null; - let errors = 0; - if (errors === 0) { - if (data && typeof data == 'object' && !Array.isArray(data)) { - let missing0; + let i = null, + p = 0; + if (0 === p) { + if (!t || 'object' != typeof t || Array.isArray(t)) + return (o.errors = [{ params: { type: 'object' } }]), !1; + { + let a; if ( - (data.remoteType === undefined && (missing0 = 'remoteType')) || - (data.remotes === undefined && (missing0 = 'remotes')) - ) { - validate36.errors = [ - { - params: { - missingProperty: missing0, - }, - }, - ]; - return false; - } else { - const _errs1 = errors; - for (const key0 in data) { - if ( - !( - key0 === 'remoteType' || - key0 === 'remotes' || - key0 === 'shareScope' - ) - ) { - validate36.errors = [ - { - params: { - additionalProperty: key0, - }, - }, - ]; - return false; - break; - } - } - if (_errs1 === errors) { - if (data.remoteType !== undefined) { - let data0 = data.remoteType; - const _errs2 = errors; - const _errs3 = errors; - let valid1 = false; - let passing0 = null; - const _errs4 = errors; + (void 0 === t.remoteType && (a = 'remoteType')) || + (void 0 === t.remotes && (a = 'remotes')) + ) + return (o.errors = [{ params: { missingProperty: a } }]), !1; + { + const a = p; + for (const r in t) + if ('remoteType' !== r && 'remotes' !== r && 'shareScope' !== r) + return (o.errors = [{ params: { additionalProperty: r } }]), !1; + if (a === p) { + if (void 0 !== t.remoteType) { + let e = t.remoteType; + const a = p, + n = p; + let s = !1, + l = null; + const u = p; if ( - data0 !== 'var' && - data0 !== 'module' && - data0 !== 'assign' && - data0 !== 'this' && - data0 !== 'window' && - data0 !== 'self' && - data0 !== 'global' && - data0 !== 'commonjs' && - data0 !== 'commonjs2' && - data0 !== 'commonjs-module' && - data0 !== 'commonjs-static' && - data0 !== 'amd' && - data0 !== 'amd-require' && - data0 !== 'umd' && - data0 !== 'umd2' && - data0 !== 'jsonp' && - data0 !== 'system' && - data0 !== 'promise' && - data0 !== 'import' && - data0 !== 'script' && - data0 !== 'node-commonjs' + 'var' !== e && + 'module' !== e && + 'assign' !== e && + 'this' !== e && + 'window' !== e && + 'self' !== e && + 'global' !== e && + 'commonjs' !== e && + 'commonjs2' !== e && + 'commonjs-module' !== e && + 'commonjs-static' !== e && + 'amd' !== e && + 'amd-require' !== e && + 'umd' !== e && + 'umd2' !== e && + 'jsonp' !== e && + 'system' !== e && + 'promise' !== e && + 'import' !== e && + 'script' !== e && + 'node-commonjs' !== e ) { - const err0 = { - params: {}, - }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; + const t = { params: { allowedValues: r.enum } }; + null === i ? (i = [t]) : i.push(t), p++; } - var _valid0 = _errs4 === errors; - if (_valid0) { - valid1 = true; - passing0 = 0; + if ((u === p && ((s = !0), (l = 0)), !s)) { + const r = { params: { passingSchemas: l } }; + return ( + null === i ? (i = [r]) : i.push(r), p++, (o.errors = i), !1 + ); } - if (!valid1) { - const err1 = { - params: { - passingSchemas: passing0, - }, - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - validate36.errors = vErrors; - return false; - } else { - errors = _errs3; - if (vErrors !== null) { - if (_errs3) { - vErrors.length = _errs3; - } else { - vErrors = null; + (p = n), null !== i && (n ? (i.length = n) : (i = null)); + var c = a === p; + } else c = !0; + if (c) { + if (void 0 !== t.remotes) { + const r = p; + n(t.remotes, { + instancePath: e + '/remotes', + parentData: t, + parentDataProperty: 'remotes', + rootData: l, + }) || + ((i = null === i ? n.errors : i.concat(n.errors)), + (p = i.length)), + (c = r === p); + } else c = !0; + if (c) + if (void 0 !== t.shareScope) { + let r = t.shareScope; + const e = p; + if (p === e) { + if ('string' != typeof r) + return (o.errors = [{ params: { type: 'string' } }]), !1; + if (r.length < 1) return (o.errors = [{ params: {} }]), !1; } - } - } - var valid0 = _errs2 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.remotes !== undefined) { - const _errs6 = errors; - if ( - !validate37(data.remotes, { - instancePath: instancePath + '/remotes', - parentData: data, - parentDataProperty: 'remotes', - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate37.errors - : vErrors.concat(validate37.errors); - errors = vErrors.length; - } - var valid0 = _errs6 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.shareScope !== undefined) { - let data2 = data.shareScope; - const _errs7 = errors; - if (errors === _errs7) { - if (typeof data2 === 'string') { - if (data2.length < 1) { - validate36.errors = [ - { - params: {}, - }, - ]; - return false; - } - } else { - validate36.errors = [ - { - params: { - type: 'string', - }, - }, - ]; - return false; - } - } - var valid0 = _errs7 === errors; - } else { - var valid0 = true; - } - } + c = e === p; + } else c = !0; } } } - } else { - validate36.errors = [ - { - params: { - type: 'object', - }, - }, - ]; - return false; } } - validate36.errors = vErrors; - return errors === 0; + return (o.errors = i), 0 === p; } - -export default validate36; diff --git a/packages/enhanced/src/schemas/container/ContainerReferencePlugin.json b/packages/enhanced/src/schemas/container/ContainerReferencePlugin.json new file mode 100644 index 00000000000..b7270cdbd5d --- /dev/null +++ b/packages/enhanced/src/schemas/container/ContainerReferencePlugin.json @@ -0,0 +1,128 @@ +{ + "definitions": { + "ExternalsType": { + "description": "Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).", + "enum": [ + "var", + "module", + "assign", + "this", + "window", + "self", + "global", + "commonjs", + "commonjs2", + "commonjs-module", + "commonjs-static", + "amd", + "amd-require", + "umd", + "umd2", + "jsonp", + "system", + "promise", + "import", + "script", + "node-commonjs" + ] + }, + "Remotes": { + "description": "Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Container locations and request scopes from which modules should be resolved and loaded at runtime.", + "anyOf": [ + { + "$ref": "#/definitions/RemotesItem" + }, + { + "$ref": "#/definitions/RemotesObject" + } + ] + } + }, + { + "$ref": "#/definitions/RemotesObject" + } + ] + }, + "RemotesConfig": { + "description": "Advanced configuration for container locations from which modules should be resolved and loaded at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + "external": { + "description": "Container locations from which modules should be resolved and loaded at runtime.", + "anyOf": [ + { + "$ref": "#/definitions/RemotesItem" + }, + { + "$ref": "#/definitions/RemotesItems" + } + ] + }, + "shareScope": { + "description": "The name of the share scope shared with this remote.", + "type": "string", + "minLength": 1 + } + }, + "required": ["external"] + }, + "RemotesItem": { + "description": "Container location from which modules should be resolved and loaded at runtime.", + "type": "string", + "minLength": 1 + }, + "RemotesItems": { + "description": "Container locations from which modules should be resolved and loaded at runtime.", + "type": "array", + "items": { + "$ref": "#/definitions/RemotesItem" + } + }, + "RemotesObject": { + "description": "Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.", + "type": "object", + "additionalProperties": { + "description": "Container locations from which modules should be resolved and loaded at runtime.", + "anyOf": [ + { + "$ref": "#/definitions/RemotesConfig" + }, + { + "$ref": "#/definitions/RemotesItem" + }, + { + "$ref": "#/definitions/RemotesItems" + } + ] + } + } + }, + "title": "ContainerReferencePluginOptions", + "type": "object", + "additionalProperties": false, + "properties": { + "remoteType": { + "description": "The external type of the remote containers.", + "oneOf": [ + { + "$ref": "#/definitions/ExternalsType" + } + ] + }, + "remotes": { + "$ref": "#/definitions/Remotes" + }, + "shareScope": { + "description": "The name of the share scope shared with all remotes (defaults to 'default').", + "type": "string", + "minLength": 1 + } + }, + "required": ["remoteType", "remotes"] +} diff --git a/packages/enhanced/src/schemas/container/ContainerReferencePlugin.ts b/packages/enhanced/src/schemas/container/ContainerReferencePlugin.ts index dc0a4bac747..c8a478fde34 100644 --- a/packages/enhanced/src/schemas/container/ContainerReferencePlugin.ts +++ b/packages/enhanced/src/schemas/container/ContainerReferencePlugin.ts @@ -1,4 +1,10 @@ -//@ts-nocheck +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + export default { definitions: { ExternalsType: { @@ -136,4 +142,4 @@ export default { }, }, required: ['remoteType', 'remotes'], -}; +} as const; diff --git a/packages/enhanced/src/schemas/container/ExternalsType.check.ts b/packages/enhanced/src/schemas/container/ExternalsType.check.ts new file mode 100644 index 00000000000..246474df66d --- /dev/null +++ b/packages/enhanced/src/schemas/container/ExternalsType.check.ts @@ -0,0 +1,68 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +export const validate = m; +export default m; +const o = { + enum: [ + 'var', + 'module', + 'assign', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + 'promise', + 'import', + 'script', + 'module-import', + 'node-commonjs', + ], +}; +function m( + s, + { + instancePath: e = '', + parentData: t, + parentDataProperty: n, + rootData: r = s, + } = {}, +) { + return 'var' !== s && + 'module' !== s && + 'assign' !== s && + 'this' !== s && + 'window' !== s && + 'self' !== s && + 'global' !== s && + 'commonjs' !== s && + 'commonjs2' !== s && + 'commonjs-module' !== s && + 'commonjs-static' !== s && + 'amd' !== s && + 'amd-require' !== s && + 'umd' !== s && + 'umd2' !== s && + 'jsonp' !== s && + 'system' !== s && + 'promise' !== s && + 'import' !== s && + 'script' !== s && + 'module-import' !== s && + 'node-commonjs' !== s + ? ((m.errors = [{ params: { allowedValues: o.enum } }]), !1) + : ((m.errors = null), !0); +} diff --git a/packages/enhanced/src/schemas/container/ExternalsType.json b/packages/enhanced/src/schemas/container/ExternalsType.json new file mode 100644 index 00000000000..d5898583c6b --- /dev/null +++ b/packages/enhanced/src/schemas/container/ExternalsType.json @@ -0,0 +1,3 @@ +{ + "$ref": "./ModuleFederationPlugin.json#/definitions/ExternalsType" +} diff --git a/packages/enhanced/src/schemas/container/ExternalsType.ts b/packages/enhanced/src/schemas/container/ExternalsType.ts new file mode 100644 index 00000000000..7b88f8dac45 --- /dev/null +++ b/packages/enhanced/src/schemas/container/ExternalsType.ts @@ -0,0 +1,10 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + +export default { + $ref: './ModuleFederationPlugin.json#/definitions/ExternalsType', +} as const; diff --git a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts new file mode 100644 index 00000000000..431631aaf66 --- /dev/null +++ b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts @@ -0,0 +1,3373 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +const e = /^(?:[A-Za-z]:[\\/]|\\\\|\/)/; +export const validate = j; +export default j; +const t = { + definitions: { + AmdContainer: { type: 'string', minLength: 1 }, + AuxiliaryComment: { + anyOf: [ + { type: 'string' }, + { $ref: '#/definitions/LibraryCustomUmdCommentObject' }, + ], + }, + EntryRuntime: { + anyOf: [{ enum: [!1] }, { type: 'string', minLength: 1 }], + }, + Exposes: { + anyOf: [ + { + type: 'array', + items: { + anyOf: [ + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesObject' }, + ], + }, + }, + { $ref: '#/definitions/ExposesObject' }, + ], + }, + ExposesConfig: { + type: 'object', + additionalProperties: !1, + properties: { + import: { + anyOf: [ + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesItems' }, + ], + }, + name: { type: 'string' }, + }, + required: ['import'], + }, + ExposesItem: { type: 'string', minLength: 1 }, + ExposesItems: { + type: 'array', + items: { $ref: '#/definitions/ExposesItem' }, + }, + ExposesObject: { + type: 'object', + additionalProperties: { + anyOf: [ + { $ref: '#/definitions/ExposesConfig' }, + { $ref: '#/definitions/ExposesItem' }, + { $ref: '#/definitions/ExposesItems' }, + ], + }, + }, + ExternalsType: { + enum: [ + 'var', + 'module', + 'assign', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + 'promise', + 'import', + 'script', + 'module-import', + 'node-commonjs', + ], + }, + LibraryCustomUmdCommentObject: { + type: 'object', + additionalProperties: !1, + properties: { + amd: { type: 'string' }, + commonjs: { type: 'string' }, + commonjs2: { type: 'string' }, + root: { type: 'string' }, + }, + }, + LibraryCustomUmdObject: { + type: 'object', + additionalProperties: !1, + properties: { + amd: { type: 'string', minLength: 1 }, + commonjs: { type: 'string', minLength: 1 }, + root: { + anyOf: [ + { type: 'array', items: { type: 'string', minLength: 1 } }, + { type: 'string', minLength: 1 }, + ], + }, + }, + }, + LibraryExport: { + anyOf: [ + { type: 'array', items: { type: 'string', minLength: 1 } }, + { type: 'string', minLength: 1 }, + ], + }, + LibraryName: { + anyOf: [ + { + type: 'array', + items: { type: 'string', minLength: 1 }, + minItems: 1, + }, + { type: 'string', minLength: 1 }, + { $ref: '#/definitions/LibraryCustomUmdObject' }, + ], + }, + LibraryOptions: { + type: 'object', + additionalProperties: !1, + properties: { + amdContainer: { $ref: '#/definitions/AmdContainer' }, + auxiliaryComment: { $ref: '#/definitions/AuxiliaryComment' }, + export: { $ref: '#/definitions/LibraryExport' }, + name: { $ref: '#/definitions/LibraryName' }, + type: { $ref: '#/definitions/LibraryType' }, + umdNamedDefine: { $ref: '#/definitions/UmdNamedDefine' }, + }, + required: ['type'], + }, + LibraryType: { + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { type: 'string' }, + ], + }, + Remotes: { + anyOf: [ + { + type: 'array', + items: { + anyOf: [ + { $ref: '#/definitions/RemotesItem' }, + { $ref: '#/definitions/RemotesObject' }, + ], + }, + }, + { $ref: '#/definitions/RemotesObject' }, + ], + }, + RemotesConfig: { + type: 'object', + additionalProperties: !1, + properties: { + external: { + anyOf: [ + { $ref: '#/definitions/RemotesItem' }, + { $ref: '#/definitions/RemotesItems' }, + ], + }, + shareScope: { type: 'string', minLength: 1 }, + }, + required: ['external'], + }, + RemotesItem: { type: 'string', minLength: 1 }, + RemotesItems: { + type: 'array', + items: { $ref: '#/definitions/RemotesItem' }, + }, + RemotesObject: { + type: 'object', + additionalProperties: { + anyOf: [ + { $ref: '#/definitions/RemotesConfig' }, + { $ref: '#/definitions/RemotesItem' }, + { $ref: '#/definitions/RemotesItems' }, + ], + }, + }, + Shared: { + anyOf: [ + { + type: 'array', + items: { + anyOf: [ + { $ref: '#/definitions/SharedItem' }, + { $ref: '#/definitions/SharedObject' }, + ], + }, + }, + { $ref: '#/definitions/SharedObject' }, + ], + }, + SharedConfig: { + type: 'object', + additionalProperties: !1, + properties: { + eager: { type: 'boolean' }, + import: { + anyOf: [{ enum: [!1] }, { $ref: '#/definitions/SharedItem' }], + }, + packageName: { type: 'string', minLength: 1 }, + requiredVersion: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + shareKey: { type: 'string', minLength: 1 }, + shareScope: { type: 'string', minLength: 1 }, + shareStrategy: { enum: ['version-first', 'loaded-first'] }, + singleton: { type: 'boolean' }, + strictVersion: { type: 'boolean' }, + version: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + }, + }, + SharedItem: { type: 'string', minLength: 1 }, + SharedObject: { + type: 'object', + additionalProperties: { + anyOf: [ + { $ref: '#/definitions/SharedConfig' }, + { $ref: '#/definitions/SharedItem' }, + ], + }, + }, + UmdNamedDefine: { type: 'boolean' }, + }, + type: 'object', + additionalProperties: !1, + properties: { + dataPrefetch: { type: 'boolean' }, + exposes: { $ref: '#/definitions/Exposes' }, + filename: { type: 'string', absolutePath: !1 }, + getPublicPath: { type: 'string' }, + implementation: { type: 'string' }, + library: { $ref: '#/definitions/LibraryOptions' }, + manifest: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + filePath: { type: 'string' }, + disableAssetsAnalyze: { type: 'boolean' }, + fileName: { type: 'string' }, + additionalData: { type: 'string' }, + }, + }, + ], + }, + name: { type: 'string' }, + remoteType: { oneOf: [{ $ref: '#/definitions/ExternalsType' }] }, + remotes: { $ref: '#/definitions/Remotes' }, + runtime: { $ref: '#/definitions/EntryRuntime' }, + runtimePlugins: { type: 'array', items: { type: 'string' } }, + shareScope: { type: 'string', minLength: 1 }, + shareStrategy: { enum: ['version-first', 'loaded-first'] }, + shared: { $ref: '#/definitions/Shared' }, + virtualRuntimeEntry: { type: 'boolean' }, + dev: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + disableLiveReload: { type: 'boolean' }, + disableHotTypesReload: { type: 'boolean' }, + disableDynamicRemoteTypeHints: { type: 'boolean' }, + }, + }, + ], + }, + dts: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + generateTypes: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + tsConfigPath: { type: 'string' }, + typesFolder: { type: 'string' }, + compiledTypesFolder: { type: 'string' }, + deleteTypesFolder: { type: 'boolean' }, + additionalFilesToCompile: { + type: 'array', + items: { type: 'string' }, + }, + compileInChildProcess: { type: 'boolean' }, + compilerInstance: { enum: ['tsc', 'vue-tsc'] }, + generateAPITypes: { type: 'boolean' }, + extractThirdParty: { type: 'boolean' }, + extractRemoteTypes: { type: 'boolean' }, + abortOnError: { type: 'boolean' }, + }, + }, + ], + }, + consumeTypes: { + anyOf: [ + { type: 'boolean' }, + { + type: 'object', + properties: { + typesFolder: { type: 'string' }, + abortOnError: { type: 'boolean' }, + remoteTypesFolder: { type: 'string' }, + deleteTypesFolder: { type: 'boolean' }, + maxRetries: { type: 'number' }, + consumeAPITypes: { type: 'boolean' }, + runtimePkgs: { type: 'array', items: { type: 'string' } }, + }, + }, + ], + }, + tsConfigPath: { type: 'string' }, + extraOptions: { type: 'object' }, + implementation: { type: 'string' }, + cwd: { type: 'string' }, + displayErrorInTerminal: { type: 'boolean' }, + }, + }, + ], + }, + experiments: { + type: 'object', + properties: { + federationRuntime: { + anyOf: [ + { type: 'boolean', enum: [!1] }, + { type: 'string', enum: ['hoisted'] }, + ], + }, + externalRuntime: { type: 'boolean' }, + provideExternalRuntime: { type: 'boolean' }, + }, + }, + bridge: { + type: 'object', + properties: { disableAlias: { type: 'boolean', default: !1 } }, + }, + }, + }, + r = { + enum: [ + 'var', + 'module', + 'assign', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + 'promise', + 'import', + 'script', + 'module-import', + 'node-commonjs', + ], + }, + n = { anyOf: [{ enum: [!1] }, { type: 'string', minLength: 1 }] }, + s = Object.prototype.hasOwnProperty; +function o( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + if (!Array.isArray(e)) + return (o.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 (o.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (o.errors = [{ params: {} }]), !1; + if (0 !== n) break; + } + } + return (o.errors = null), !0; +} +function a( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let i = null, + l = 0; + if (0 === l) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (a.errors = [{ params: { type: 'object' } }]), !1; + { + let r; + if (void 0 === e.import && (r = 'import')) + return (a.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; + if (r === l) { + if (void 0 !== e.import) { + let r = e.import; + const n = l, + m = l; + let y = !1; + const u = l; + if (l == l) + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === i ? (i = [e]) : i.push(e), l++; + } + } else { + const e = { params: { type: 'string' } }; + null === i ? (i = [e]) : i.push(e), l++; + } + var p = u === l; + if (((y = y || p), !y)) { + const n = l; + o(r, { + instancePath: t + '/import', + parentData: e, + parentDataProperty: 'import', + rootData: s, + }) || + ((i = null === i ? o.errors : i.concat(o.errors)), + (l = i.length)), + (p = n === l), + (y = y || p); + } + if (!y) { + const e = { params: {} }; + return ( + null === i ? (i = [e]) : i.push(e), l++, (a.errors = i), !1 + ); + } + (l = m), null !== i && (m ? (i.length = m) : (i = 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; + f = t === l; + } else f = !0; + } + } + } + } + return (a.errors = i), 0 === l; +} +function i( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let l = null, + p = 0; + if (0 === p) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (i.errors = [{ params: { type: 'object' } }]), !1; + for (const r in e) { + let n = e[r]; + const m = p, + y = p; + let u = !1; + const c = p; + a(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)); + var f = c === p; + if (((u = u || f), !u)) { + const a = p; + if (p == p) + if ('string' == typeof n) { + if (n.length < 1) { + const e = { params: {} }; + null === l ? (l = [e]) : l.push(e), p++; + } + } else { + const e = { params: { type: 'string' } }; + null === l ? (l = [e]) : l.push(e), p++; + } + if (((f = a === p), (u = u || f), !u)) { + const a = p; + o(n, { + instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: e, + parentDataProperty: r, + rootData: s, + }) || + ((l = null === l ? o.errors : l.concat(o.errors)), (p = l.length)), + (f = a === p), + (u = u || f); + } + } + if (!u) { + const e = { params: {} }; + return null === l ? (l = [e]) : l.push(e), p++, (i.errors = l), !1; + } + if (((p = y), null !== l && (y ? (l.length = y) : (l = null)), m !== p)) + break; + } + } + return (i.errors = l), 0 === p; +} +function l( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + const p = a; + let f = !1; + const m = a; + if (a === m) + if (Array.isArray(e)) { + const r = e.length; + for (let n = 0; n < r; n++) { + let r = e[n]; + const l = a, + p = a; + let f = !1; + const m = a; + if (a == a) + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var y = m === a; + if (((f = f || y), !f)) { + const l = a; + i(r, { + instancePath: t + '/' + n, + parentData: e, + parentDataProperty: n, + rootData: s, + }) || + ((o = null === o ? i.errors : o.concat(i.errors)), (a = o.length)), + (y = l === a), + (f = f || y); + } + if (f) (a = p), null !== o && (p ? (o.length = p) : (o = null)); + else { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (l !== a) break; + } + } else { + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var u = m === a; + if (((f = f || u), !f)) { + const l = a; + i(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); + } + if (!f) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (l.errors = o), !1; + } + return ( + (a = p), + null !== o && (p ? (o.length = p) : (o = null)), + (l.errors = o), + 0 === a + ); +} +const p = { + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { type: 'string' }, + ], +}; +function f( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + const i = a; + let l = !1; + const p = a; + if ('string' != typeof e) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var m = p === a; + if (((l = l || m), !l)) { + const t = a; + if (a == a) + if (e && 'object' == typeof e && !Array.isArray(e)) { + const t = a; + for (const t in e) + if ( + 'amd' !== t && + 'commonjs' !== t && + 'commonjs2' !== t && + 'root' !== t + ) { + const e = { params: { additionalProperty: t } }; + null === o ? (o = [e]) : o.push(e), a++; + break; + } + if (t === a) { + if (void 0 !== e.amd) { + const t = a; + if ('string' != typeof e.amd) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var y = t === a; + } else y = !0; + if (y) { + if (void 0 !== e.commonjs) { + const t = a; + if ('string' != typeof e.commonjs) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + y = t === a; + } else y = !0; + if (y) { + if (void 0 !== e.commonjs2) { + const t = a; + if ('string' != typeof e.commonjs2) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + y = t === a; + } else y = !0; + if (y) + if (void 0 !== e.root) { + const t = a; + if ('string' != typeof e.root) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + y = t === a; + } else y = !0; + } + } + } + } else { + const e = { params: { type: 'object' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + (m = t === a), (l = l || m); + } + if (!l) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (f.errors = o), !1; + } + return ( + (a = i), + null !== o && (i ? (o.length = i) : (o = null)), + (f.errors = o), + 0 === a + ); +} +function m( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + const i = a; + let l = !1; + const p = a; + if (a === p) + if (Array.isArray(e)) + if (e.length < 1) { + const e = { params: { limit: 1 } }; + null === o ? (o = [e]) : o.push(e), a++; + } else { + const t = e.length; + for (let r = 0; r < t; r++) { + let t = e[r]; + const n = a; + if (a === n) + if ('string' == typeof t) { + if (t.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (n !== a) break; + } + } + else { + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var f = p === a; + if (((l = l || f), !l)) { + const t = a; + if (a === t) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (((f = t === a), (l = l || f), !l)) { + const t = a; + if (a == a) + if (e && 'object' == typeof e && !Array.isArray(e)) { + const t = a; + 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++; + break; + } + if (t === a) { + if (void 0 !== e.amd) { + let t = e.amd; + const r = a; + if (a === r) + if ('string' == typeof t) { + if (t.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var y = r === a; + } else y = !0; + if (y) { + if (void 0 !== e.commonjs) { + let t = e.commonjs; + const r = a; + if (a === r) + if ('string' == typeof t) { + if (t.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + y = r === a; + } else y = !0; + if (y) + if (void 0 !== e.root) { + let t = e.root; + const r = a, + n = a; + let s = !1; + const i = a; + if (a === i) + 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) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (n !== a) break; + } + } else { + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var u = i === a; + if (((s = s || u), !s)) { + const e = a; + if (a === e) + if ('string' == typeof t) { + if (t.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + (u = e === a), (s = s || u); + } + if (s) + (a = n), null !== o && (n ? (o.length = n) : (o = null)); + else { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + y = r === a; + } else y = !0; + } + } + } else { + const e = { params: { type: 'object' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + (f = t === a), (l = l || f); + } + } + if (!l) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (m.errors = o), !1; + } + return ( + (a = i), + null !== o && (i ? (o.length = i) : (o = null)), + (m.errors = o), + 0 === a + ); +} +function y( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + if (0 === a) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (y.errors = [{ params: { type: 'object' } }]), !1; + { + let r; + if (void 0 === e.type && (r = 'type')) + return (y.errors = [{ params: { missingProperty: r } }]), !1; + { + const r = a; + for (const t in e) + if ( + 'amdContainer' !== t && + 'auxiliaryComment' !== t && + 'export' !== t && + 'name' !== t && + 'type' !== t && + 'umdNamedDefine' !== t + ) + return (y.errors = [{ params: { additionalProperty: t } }]), !1; + if (r === a) { + if (void 0 !== e.amdContainer) { + let t = e.amdContainer; + const r = a; + if (a == a) { + if ('string' != typeof t) + return (y.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (y.errors = [{ params: {} }]), !1; + } + var i = r === a; + } else i = !0; + if (i) { + if (void 0 !== e.auxiliaryComment) { + const r = a; + f(e.auxiliaryComment, { + instancePath: t + '/auxiliaryComment', + parentData: e, + parentDataProperty: 'auxiliaryComment', + rootData: s, + }) || + ((o = null === o ? f.errors : o.concat(f.errors)), + (a = o.length)), + (i = r === a); + } else i = !0; + if (i) { + if (void 0 !== e.export) { + let t = e.export; + const r = a, + n = a; + let s = !1; + const p = a; + if (a === 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) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (n !== a) break; + } + } else { + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var l = p === a; + if (((s = s || l), !s)) { + const e = a; + if (a === e) + if ('string' == typeof t) { + if (t.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + (l = e === a), (s = s || l); + } + if (!s) { + const e = { params: {} }; + return ( + null === o ? (o = [e]) : o.push(e), a++, (y.errors = o), !1 + ); + } + (a = n), + null !== o && (n ? (o.length = n) : (o = null)), + (i = r === a); + } else i = !0; + if (i) { + if (void 0 !== e.name) { + const r = a; + m(e.name, { + instancePath: t + '/name', + parentData: e, + parentDataProperty: 'name', + rootData: s, + }) || + ((o = null === o ? m.errors : o.concat(m.errors)), + (a = o.length)), + (i = r === a); + } else i = !0; + if (i) { + if (void 0 !== e.type) { + let t = e.type; + const r = a, + n = a; + let s = !1; + const l = a; + if ( + 'var' !== t && + 'module' !== t && + 'assign' !== t && + 'assign-properties' !== t && + 'this' !== t && + 'window' !== t && + 'self' !== t && + 'global' !== t && + 'commonjs' !== t && + 'commonjs2' !== t && + 'commonjs-module' !== t && + 'commonjs-static' !== t && + 'amd' !== t && + 'amd-require' !== t && + 'umd' !== t && + 'umd2' !== t && + 'jsonp' !== t && + 'system' !== t + ) { + const e = { params: { allowedValues: p.anyOf[0].enum } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var u = l === a; + if (((s = s || u), !s)) { + const e = a; + if ('string' != typeof t) { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + (u = e === a), (s = s || u); + } + if (!s) { + const e = { params: {} }; + return ( + null === o ? (o = [e]) : o.push(e), + a++, + (y.errors = o), + !1 + ); + } + (a = n), + null !== o && (n ? (o.length = n) : (o = null)), + (i = r === a); + } else i = !0; + if (i) + if (void 0 !== e.umdNamedDefine) { + const t = a; + if ('boolean' != typeof e.umdNamedDefine) + return ( + (y.errors = [{ params: { type: 'boolean' } }]), !1 + ); + i = t === a; + } else i = !0; + } + } + } + } + } + } + } + } + return (y.errors = o), 0 === a; +} +function u( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + if (!Array.isArray(e)) + return (u.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; + if (0 !== n) break; + } + } + return (u.errors = null), !0; +} +function c( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + if (0 === a) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (c.errors = [{ params: { type: 'object' } }]), !1; + { + let r; + if (void 0 === e.external && (r = 'external')) + return (c.errors = [{ params: { missingProperty: r } }]), !1; + { + const r = a; + for (const t in e) + if ('external' !== t && 'shareScope' !== t) + return (c.errors = [{ params: { additionalProperty: t } }]), !1; + if (r === a) { + if (void 0 !== e.external) { + let r = e.external; + const n = a, + p = a; + let f = !1; + const m = a; + if (a == a) + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var i = m === a; + if (((f = f || i), !f)) { + const n = a; + u(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); + } + if (!f) { + const e = { params: {} }; + return ( + null === o ? (o = [e]) : o.push(e), a++, (c.errors = o), !1 + ); + } + (a = p), null !== o && (p ? (o.length = p) : (o = null)); + var l = n === a; + } else l = !0; + if (l) + if (void 0 !== e.shareScope) { + let t = e.shareScope; + const r = a; + if (a === r) { + if ('string' != typeof t) + return (c.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (c.errors = [{ params: {} }]), !1; + } + l = r === a; + } else l = !0; + } + } + } + } + return (c.errors = o), 0 === a; +} +function d( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + if (0 === a) { + 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; + let f = !1; + const m = a; + c(n, { + instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: e, + parentDataProperty: r, + rootData: s, + }) || ((o = null === o ? c.errors : o.concat(c.errors)), (a = o.length)); + var i = m === a; + if (((f = f || i), !f)) { + const l = a; + if (a == a) + if ('string' == typeof n) { + if (n.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (((i = l === a), (f = f || i), !f)) { + const l = a; + u(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); + } + } + if (!f) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (d.errors = o), !1; + } + if (((a = p), null !== o && (p ? (o.length = p) : (o = null)), l !== a)) + break; + } + } + return (d.errors = o), 0 === a; +} +function g( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + const i = a; + let l = !1; + const p = a; + if (a === 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; + let p = !1; + const m = a; + if (a == a) + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var f = m === a; + if (((p = p || f), !p)) { + const i = a; + 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), + (p = p || f); + } + if (p) (a = l), null !== o && (l ? (o.length = l) : (o = null)); + else { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (i !== a) break; + } + } else { + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var m = p === a; + if (((l = l || m), !l)) { + const i = a; + d(e, { + instancePath: t, + parentData: r, + parentDataProperty: n, + rootData: s, + }) || ((o = null === o ? d.errors : o.concat(d.errors)), (a = o.length)), + (m = i === a), + (l = l || m); + } + if (!l) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (g.errors = o), !1; + } + return ( + (a = i), + null !== o && (i ? (o.length = i) : (o = null)), + (g.errors = o), + 0 === a + ); +} +const h = { + type: 'object', + additionalProperties: !1, + properties: { + eager: { type: 'boolean' }, + import: { anyOf: [{ enum: [!1] }, { $ref: '#/definitions/SharedItem' }] }, + packageName: { type: 'string', minLength: 1 }, + requiredVersion: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + shareKey: { type: 'string', minLength: 1 }, + shareScope: { type: 'string', minLength: 1 }, + shareStrategy: { enum: ['version-first', 'loaded-first'] }, + singleton: { type: 'boolean' }, + strictVersion: { type: 'boolean' }, + version: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + }, +}; +function b( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: o = e, + } = {}, +) { + let a = null, + i = 0; + if (0 === i) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (b.errors = [{ params: { type: 'object' } }]), !1; + { + const t = i; + for (const t in e) + if (!s.call(h.properties, t)) + return (b.errors = [{ params: { additionalProperty: t } }]), !1; + if (t === i) { + if (void 0 !== e.eager) { + const t = i; + if ('boolean' != typeof e.eager) + return (b.errors = [{ params: { type: 'boolean' } }]), !1; + var l = t === i; + } else l = !0; + if (l) { + if (void 0 !== e.import) { + let t = e.import; + const r = i, + n = i; + let s = !1; + const o = i; + if (!1 !== t) { + const e = { + params: { allowedValues: h.properties.import.anyOf[0].enum }, + }; + null === a ? (a = [e]) : a.push(e), i++; + } + var p = o === i; + if (((s = s || p), !s)) { + const e = i; + if (i == i) + if ('string' == typeof t) { + if (t.length < 1) { + const e = { params: {} }; + null === a ? (a = [e]) : a.push(e), i++; + } + } else { + const e = { params: { type: 'string' } }; + null === a ? (a = [e]) : a.push(e), i++; + } + (p = e === i), (s = s || p); + } + if (!s) { + const e = { params: {} }; + return ( + null === a ? (a = [e]) : a.push(e), i++, (b.errors = a), !1 + ); + } + (i = n), + null !== a && (n ? (a.length = n) : (a = null)), + (l = r === i); + } else l = !0; + if (l) { + if (void 0 !== e.packageName) { + let t = e.packageName; + const r = i; + if (i === r) { + if ('string' != typeof t) + return (b.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (b.errors = [{ params: {} }]), !1; + } + l = r === i; + } else l = !0; + if (l) { + if (void 0 !== e.requiredVersion) { + let t = e.requiredVersion; + const r = i, + n = i; + let s = !1; + const o = i; + if (!1 !== t) { + const e = { + params: { + allowedValues: h.properties.requiredVersion.anyOf[0].enum, + }, + }; + null === a ? (a = [e]) : a.push(e), i++; + } + var f = o === i; + if (((s = s || f), !s)) { + const e = i; + if ('string' != typeof t) { + const e = { params: { type: 'string' } }; + null === a ? (a = [e]) : a.push(e), i++; + } + (f = e === i), (s = s || f); + } + if (!s) { + const e = { params: {} }; + return ( + null === a ? (a = [e]) : a.push(e), i++, (b.errors = a), !1 + ); + } + (i = n), + null !== a && (n ? (a.length = n) : (a = null)), + (l = r === i); + } else l = !0; + if (l) { + if (void 0 !== e.shareKey) { + let t = e.shareKey; + const r = i; + if (i === r) { + if ('string' != typeof t) + return (b.errors = [{ params: { type: 'string' } }]), !1; + if (t.length < 1) return (b.errors = [{ params: {} }]), !1; + } + l = r === i; + } else l = !0; + if (l) { + if (void 0 !== e.shareScope) { + let t = e.shareScope; + const r = i; + if (i === r) { + if ('string' != typeof t) + return ( + (b.errors = [{ params: { type: 'string' } }]), !1 + ); + if (t.length < 1) + return (b.errors = [{ params: {} }]), !1; + } + l = r === i; + } else l = !0; + if (l) { + if (void 0 !== e.shareStrategy) { + let t = e.shareStrategy; + const r = i; + if ('version-first' !== t && 'loaded-first' !== t) + return ( + (b.errors = [ + { + params: { + allowedValues: h.properties.shareStrategy.enum, + }, + }, + ]), + !1 + ); + l = r === i; + } else l = !0; + if (l) { + if (void 0 !== e.singleton) { + const t = i; + if ('boolean' != typeof e.singleton) + return ( + (b.errors = [{ params: { type: 'boolean' } }]), !1 + ); + l = t === i; + } else l = !0; + if (l) { + if (void 0 !== e.strictVersion) { + const t = i; + if ('boolean' != typeof e.strictVersion) + return ( + (b.errors = [{ params: { type: 'boolean' } }]), !1 + ); + l = t === i; + } 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 m = o === i; + if (((s = s || m), !s)) { + const e = i; + if ('string' != typeof t) { + const e = { params: { type: 'string' } }; + null === a ? (a = [e]) : a.push(e), i++; + } + (m = e === i), (s = s || m); + } + if (!s) { + const e = { params: {} }; + return ( + null === a ? (a = [e]) : a.push(e), + i++, + (b.errors = a), + !1 + ); + } + (i = n), + null !== a && (n ? (a.length = n) : (a = null)), + (l = r === i); + } else l = !0; + } + } + } + } + } + } + } + } + } + } + } + return (b.errors = a), 0 === i; +} +function v( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + if (0 === a) { + if (!e || 'object' != typeof e || Array.isArray(e)) + return (v.errors = [{ params: { type: 'object' } }]), !1; + for (const r in e) { + let n = e[r]; + const l = a, + p = a; + let f = !1; + const m = a; + b(n, { + instancePath: t + '/' + r.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: e, + parentDataProperty: r, + rootData: s, + }) || ((o = null === o ? b.errors : o.concat(b.errors)), (a = o.length)); + var i = m === a; + if (((f = f || i), !f)) { + const e = a; + if (a == a) + if ('string' == typeof n) { + if (n.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + (i = e === a), (f = f || i); + } + if (!f) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (v.errors = o), !1; + } + if (((a = p), null !== o && (p ? (o.length = p) : (o = null)), l !== a)) + break; + } + } + return (v.errors = o), 0 === a; +} +function P( + e, + { + instancePath: t = '', + parentData: r, + parentDataProperty: n, + rootData: s = e, + } = {}, +) { + let o = null, + a = 0; + const i = a; + let l = !1; + const p = a; + if (a === 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; + let p = !1; + const m = a; + if (a == a) + if ('string' == typeof r) { + if (r.length < 1) { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + } else { + const e = { params: { type: 'string' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var f = m === a; + if (((p = p || f), !p)) { + const i = a; + v(r, { + instancePath: t + '/' + n, + parentData: e, + parentDataProperty: n, + rootData: s, + }) || + ((o = null === o ? v.errors : o.concat(v.errors)), (a = o.length)), + (f = i === a), + (p = p || f); + } + if (p) (a = l), null !== o && (l ? (o.length = l) : (o = null)); + else { + const e = { params: {} }; + null === o ? (o = [e]) : o.push(e), a++; + } + if (i !== a) break; + } + } else { + const e = { params: { type: 'array' } }; + null === o ? (o = [e]) : o.push(e), a++; + } + var m = p === a; + if (((l = l || m), !l)) { + const i = a; + v(e, { + instancePath: t, + parentData: r, + parentDataProperty: n, + rootData: s, + }) || ((o = null === o ? v.errors : o.concat(v.errors)), (a = o.length)), + (m = i === a), + (l = l || m); + } + if (!l) { + const e = { params: {} }; + return null === o ? (o = [e]) : o.push(e), a++, (P.errors = o), !1; + } + return ( + (a = i), + null !== o && (i ? (o.length = i) : (o = null)), + (P.errors = o), + 0 === a + ); +} +function j( + o, + { + instancePath: a = '', + parentData: i, + parentDataProperty: p, + rootData: f = o, + } = {}, +) { + let m = null, + u = 0; + if (0 === u) { + if (!o || 'object' != typeof o || Array.isArray(o)) + return (j.errors = [{ params: { type: 'object' } }]), !1; + { + const i = u; + for (const e in o) + if (!s.call(t.properties, e)) + return (j.errors = [{ params: { additionalProperty: e } }]), !1; + if (i === u) { + if (void 0 !== o.dataPrefetch) { + const e = u; + if ('boolean' != typeof o.dataPrefetch) + return (j.errors = [{ params: { type: 'boolean' } }]), !1; + var c = e === u; + } else c = !0; + if (c) { + if (void 0 !== o.exposes) { + const e = u; + l(o.exposes, { + instancePath: a + '/exposes', + parentData: o, + parentDataProperty: 'exposes', + rootData: f, + }) || + ((m = null === m ? l.errors : m.concat(l.errors)), + (u = m.length)), + (c = e === u); + } else c = !0; + if (c) { + if (void 0 !== o.filename) { + let t = o.filename; + const r = u; + if (u === r) { + if ('string' != typeof t) + return (j.errors = [{ params: { type: 'string' } }]), !1; + if (t.includes('!') || !1 !== e.test(t)) + return (j.errors = [{ params: {} }]), !1; + } + c = r === u; + } else c = !0; + if (c) { + if (void 0 !== o.getPublicPath) { + const e = u; + if ('string' != typeof o.getPublicPath) + return (j.errors = [{ params: { type: 'string' } }]), !1; + c = e === u; + } else c = !0; + if (c) { + if (void 0 !== o.implementation) { + const e = u; + if ('string' != typeof o.implementation) + return (j.errors = [{ params: { type: 'string' } }]), !1; + c = e === u; + } else c = !0; + if (c) { + if (void 0 !== o.library) { + const e = u; + y(o.library, { + instancePath: a + '/library', + parentData: o, + parentDataProperty: 'library', + rootData: f, + }) || + ((m = null === m ? y.errors : m.concat(y.errors)), + (u = m.length)), + (c = e === u); + } else c = !0; + if (c) { + if (void 0 !== o.manifest) { + let e = o.manifest; + const t = u, + r = u; + let n = !1; + const s = u; + if ('boolean' != typeof e) { + const e = { params: { type: 'boolean' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + var d = s === u; + if (((n = n || d), !n)) { + const t = u; + if (u === t) + if (e && 'object' == typeof e && !Array.isArray(e)) { + if (void 0 !== e.filePath) { + const t = u; + if ('string' != typeof e.filePath) { + const e = { params: { type: 'string' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + var h = t === u; + } else h = !0; + if (h) { + if (void 0 !== e.disableAssetsAnalyze) { + const t = u; + if ( + 'boolean' != typeof e.disableAssetsAnalyze + ) { + const e = { params: { type: 'boolean' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + h = t === u; + } else h = !0; + if (h) { + if (void 0 !== e.fileName) { + const t = u; + if ('string' != typeof e.fileName) { + const e = { params: { type: 'string' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + h = t === u; + } else h = !0; + if (h) + if (void 0 !== e.additionalData) { + const t = u; + if ('string' != typeof e.additionalData) { + const e = { params: { type: 'string' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + h = t === u; + } else h = !0; + } + } + } else { + const e = { params: { type: 'object' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + (d = t === u), (n = n || d); + } + if (!n) { + const e = { params: {} }; + return ( + null === m ? (m = [e]) : m.push(e), + u++, + (j.errors = m), + !1 + ); + } + (u = r), + null !== m && (r ? (m.length = r) : (m = null)), + (c = t === u); + } else c = !0; + if (c) { + if (void 0 !== o.name) { + const e = u; + if ('string' != typeof o.name) + return ( + (j.errors = [{ params: { type: 'string' } }]), !1 + ); + c = e === u; + } else c = !0; + if (c) { + if (void 0 !== o.remoteType) { + let e = o.remoteType; + const t = u, + n = u; + let s = !1, + a = null; + const i = u; + if ( + 'var' !== e && + 'module' !== e && + 'assign' !== e && + 'this' !== e && + 'window' !== e && + 'self' !== e && + 'global' !== e && + 'commonjs' !== e && + 'commonjs2' !== e && + 'commonjs-module' !== e && + 'commonjs-static' !== e && + 'amd' !== e && + 'amd-require' !== e && + 'umd' !== e && + 'umd2' !== e && + 'jsonp' !== e && + 'system' !== e && + 'promise' !== e && + 'import' !== e && + 'script' !== e && + 'module-import' !== e && + 'node-commonjs' !== e + ) { + const e = { params: { allowedValues: r.enum } }; + null === m ? (m = [e]) : m.push(e), u++; + } + if ((i === u && ((s = !0), (a = 0)), !s)) { + const e = { params: { passingSchemas: a } }; + return ( + null === m ? (m = [e]) : m.push(e), + u++, + (j.errors = m), + !1 + ); + } + (u = n), + null !== m && (n ? (m.length = n) : (m = null)), + (c = t === u); + } else c = !0; + if (c) { + if (void 0 !== o.remotes) { + const e = u; + g(o.remotes, { + instancePath: a + '/remotes', + parentData: o, + parentDataProperty: 'remotes', + rootData: f, + }) || + ((m = null === m ? g.errors : m.concat(g.errors)), + (u = m.length)), + (c = e === u); + } else c = !0; + if (c) { + if (void 0 !== o.runtime) { + let e = o.runtime; + const t = u, + r = u; + let s = !1; + const a = u; + if (!1 !== e) { + const e = { + params: { allowedValues: n.anyOf[0].enum }, + }; + null === m ? (m = [e]) : m.push(e), u++; + } + var b = a === u; + if (((s = s || b), !s)) { + const t = u; + if (u === t) + if ('string' == typeof e) { + if (e.length < 1) { + const e = { params: {} }; + null === m ? (m = [e]) : m.push(e), u++; + } + } else { + const e = { params: { type: 'string' } }; + null === m ? (m = [e]) : m.push(e), u++; + } + (b = t === u), (s = s || b); + } + if (!s) { + const e = { params: {} }; + return ( + null === m ? (m = [e]) : m.push(e), + u++, + (j.errors = m), + !1 + ); + } + (u = r), + null !== m && (r ? (m.length = r) : (m = null)), + (c = t === u); + } else c = !0; + if (c) { + if (void 0 !== o.runtimePlugins) { + let e = o.runtimePlugins; + const t = u; + if (u === t) { + if (!Array.isArray(e)) + return ( + (j.errors = [ + { params: { type: 'array' } }, + ]), + !1 + ); + { + const t = e.length; + for (let r = 0; r < t; r++) { + const t = u; + if ('string' != typeof e[r]) + return ( + (j.errors = [ + { params: { type: 'string' } }, + ]), + !1 + ); + if (t !== u) break; + } + } + } + c = t === u; + } else c = !0; + if (c) { + if (void 0 !== o.shareScope) { + let e = o.shareScope; + const t = u; + if (u === t) { + if ('string' != typeof e) + return ( + (j.errors = [ + { params: { type: 'string' } }, + ]), + !1 + ); + if (e.length < 1) + return (j.errors = [{ params: {} }]), !1; + } + c = t === u; + } else c = !0; + if (c) { + if (void 0 !== o.shareStrategy) { + let e = o.shareStrategy; + const r = u; + if ( + 'version-first' !== e && + 'loaded-first' !== e + ) + return ( + (j.errors = [ + { + params: { + allowedValues: + t.properties.shareStrategy.enum, + }, + }, + ]), + !1 + ); + c = r === u; + } else c = !0; + if (c) { + if (void 0 !== o.shared) { + const e = u; + P(o.shared, { + instancePath: a + '/shared', + parentData: o, + parentDataProperty: 'shared', + rootData: f, + }) || + ((m = + null === m + ? P.errors + : m.concat(P.errors)), + (u = m.length)), + (c = e === u); + } else c = !0; + if (c) { + if (void 0 !== o.virtualRuntimeEntry) { + const e = u; + if ( + 'boolean' != + typeof o.virtualRuntimeEntry + ) + return ( + (j.errors = [ + { params: { type: 'boolean' } }, + ]), + !1 + ); + c = e === u; + } else c = !0; + if (c) { + if (void 0 !== o.dev) { + let e = o.dev; + const t = u, + r = u; + let n = !1; + const s = u; + if ('boolean' != typeof e) { + const e = { + params: { type: 'boolean' }, + }; + null === m ? (m = [e]) : m.push(e), + u++; + } + var v = s === u; + if (((n = n || v), !n)) { + const t = u; + if (u === t) + if ( + e && + 'object' == typeof e && + !Array.isArray(e) + ) { + if ( + void 0 !== e.disableLiveReload + ) { + const t = u; + if ( + 'boolean' != + typeof e.disableLiveReload + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var D = t === u; + } else D = !0; + if (D) { + if ( + void 0 !== + e.disableHotTypesReload + ) { + const t = u; + if ( + 'boolean' != + typeof e.disableHotTypesReload + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + D = t === u; + } else D = !0; + if (D) + if ( + void 0 !== + e.disableDynamicRemoteTypeHints + ) { + const t = u; + if ( + 'boolean' != + typeof e.disableDynamicRemoteTypeHints + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + D = t === u; + } else D = !0; + } + } else { + const e = { + params: { type: 'object' }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + (v = t === u), (n = n || v); + } + if (!n) { + const e = { params: {} }; + return ( + null === m + ? (m = [e]) + : m.push(e), + u++, + (j.errors = m), + !1 + ); + } + (u = r), + null !== m && + (r ? (m.length = r) : (m = null)), + (c = t === u); + } else c = !0; + if (c) { + if (void 0 !== o.dts) { + let e = o.dts; + const r = u, + n = u; + let s = !1; + const a = u; + if ('boolean' != typeof e) { + const e = { + params: { type: 'boolean' }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var A = a === u; + if (((s = s || A), !s)) { + const r = u; + if (u === r) + if ( + e && + 'object' == typeof e && + !Array.isArray(e) + ) { + if ( + void 0 !== e.generateTypes + ) { + let r = e.generateTypes; + const n = u, + s = u; + let o = !1; + const a = u; + if ('boolean' != typeof r) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var x = a === u; + if (((o = o || x), !o)) { + const e = u; + if (u === e) + if ( + r && + 'object' == + typeof r && + !Array.isArray(r) + ) { + if ( + void 0 !== + r.tsConfigPath + ) { + const e = u; + if ( + 'string' != + typeof r.tsConfigPath + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var O = e === u; + } else O = !0; + if (O) { + if ( + void 0 !== + r.typesFolder + ) { + const e = u; + if ( + 'string' != + typeof r.typesFolder + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + O = e === u; + } else O = !0; + if (O) { + if ( + void 0 !== + r.compiledTypesFolder + ) { + const e = u; + if ( + 'string' != + typeof r.compiledTypesFolder + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + O = e === u; + } else O = !0; + if (O) { + if ( + void 0 !== + r.deleteTypesFolder + ) { + const e = u; + if ( + 'boolean' != + typeof r.deleteTypesFolder + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = e === u; + } else O = !0; + if (O) { + if ( + void 0 !== + r.additionalFilesToCompile + ) { + let e = + r.additionalFilesToCompile; + const t = u; + if (u === t) + if ( + Array.isArray( + e, + ) + ) { + const t = + e.length; + for ( + let r = 0; + r < t; + r++ + ) { + const t = + u; + if ( + 'string' != + typeof e[ + r + ] + ) { + const e = + { + params: + { + type: 'string', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + if ( + t !== + u + ) + break; + } + } else { + const e = + { + params: + { + type: 'array', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = t === u; + } else O = !0; + if (O) { + if ( + void 0 !== + r.compileInChildProcess + ) { + const e = + u; + if ( + 'boolean' != + typeof r.compileInChildProcess + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = + e === u; + } else + O = !0; + if (O) { + if ( + void 0 !== + r.compilerInstance + ) { + let e = + r.compilerInstance; + const n = + u; + if ( + 'tsc' !== + e && + 'vue-tsc' !== + e + ) { + const e = + { + params: + { + allowedValues: + t + .properties + .dts + .anyOf[1] + .properties + .generateTypes + .anyOf[1] + .properties + .compilerInstance + .enum, + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = + n === + u; + } else + O = !0; + if (O) { + if ( + void 0 !== + r.generateAPITypes + ) { + const e = + u; + if ( + 'boolean' != + typeof r.generateAPITypes + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = + e === + u; + } else + O = + !0; + if (O) { + if ( + void 0 !== + r.extractThirdParty + ) { + const e = + u; + if ( + 'boolean' != + typeof r.extractThirdParty + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = + e === + u; + } else + O = + !0; + if ( + O + ) { + if ( + void 0 !== + r.extractRemoteTypes + ) { + const e = + u; + if ( + 'boolean' != + typeof r.extractRemoteTypes + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = + e === + u; + } else + O = + !0; + if ( + O + ) + if ( + void 0 !== + r.abortOnError + ) { + const e = + u; + if ( + 'boolean' != + typeof r.abortOnError + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + O = + e === + u; + } else + O = + !0; + } + } + } + } + } + } + } + } + } + } else { + const e = { + params: { + type: 'object', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + (x = e === u), + (o = o || x); + } + if (o) + (u = s), + null !== m && + (s + ? (m.length = s) + : (m = null)); + else { + const e = { params: {} }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var T = n === u; + } else T = !0; + if (T) { + if ( + void 0 !== e.consumeTypes + ) { + let t = e.consumeTypes; + const r = u, + n = u; + let s = !1; + const o = u; + if ( + 'boolean' != typeof t + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var R = o === u; + if (((s = s || R), !s)) { + const e = u; + if (u === e) + if ( + t && + 'object' == + typeof t && + !Array.isArray(t) + ) { + if ( + void 0 !== + t.typesFolder + ) { + const e = u; + if ( + 'string' != + typeof t.typesFolder + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var $ = e === u; + } else $ = !0; + if ($) { + if ( + void 0 !== + t.abortOnError + ) { + const e = u; + if ( + 'boolean' != + typeof t.abortOnError + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + $ = e === u; + } else $ = !0; + if ($) { + if ( + void 0 !== + t.remoteTypesFolder + ) { + const e = u; + if ( + 'string' != + typeof t.remoteTypesFolder + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [ + e, + ]) + : m.push( + e, + ), + u++; + } + $ = e === u; + } else $ = !0; + if ($) { + if ( + void 0 !== + t.deleteTypesFolder + ) { + const e = u; + if ( + 'boolean' != + typeof t.deleteTypesFolder + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === m + ? (m = [ + e, + ]) + : m.push( + e, + ), + u++; + } + $ = e === u; + } else $ = !0; + if ($) { + if ( + void 0 !== + t.maxRetries + ) { + const e = + u; + if ( + 'number' != + typeof t.maxRetries + ) { + const e = + { + params: + { + type: 'number', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + $ = + e === u; + } else + $ = !0; + if ($) { + if ( + void 0 !== + t.consumeAPITypes + ) { + const e = + u; + if ( + 'boolean' != + typeof t.consumeAPITypes + ) { + const e = + { + params: + { + type: 'boolean', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + $ = + e === + u; + } else + $ = !0; + if ($) + if ( + void 0 !== + t.runtimePkgs + ) { + let e = + t.runtimePkgs; + const r = + u; + if ( + u === + r + ) + if ( + Array.isArray( + e, + ) + ) { + const t = + e.length; + for ( + let r = 0; + r < + t; + r++ + ) { + const t = + u; + if ( + 'string' != + typeof e[ + r + ] + ) { + const e = + { + params: + { + type: 'string', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + if ( + t !== + u + ) + break; + } + } else { + const e = + { + params: + { + type: 'array', + }, + }; + null === + m + ? (m = + [ + e, + ]) + : m.push( + e, + ), + u++; + } + $ = + r === + u; + } else + $ = + !0; + } + } + } + } + } + } else { + const e = { + params: { + type: 'object', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + (R = e === u), + (s = s || R); + } + if (s) + (u = n), + null !== m && + (n + ? (m.length = n) + : (m = null)); + else { + const e = { + params: {}, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + T = r === u; + } else T = !0; + if (T) { + if ( + void 0 !== + e.tsConfigPath + ) { + const t = u; + if ( + 'string' != + typeof e.tsConfigPath + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + T = t === u; + } else T = !0; + if (T) { + if ( + void 0 !== + e.extraOptions + ) { + let t = + e.extraOptions; + const r = u; + if ( + !t || + 'object' != + typeof t || + Array.isArray(t) + ) { + const e = { + params: { + type: 'object', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + T = r === u; + } else T = !0; + if (T) { + if ( + void 0 !== + e.implementation + ) { + const t = u; + if ( + 'string' != + typeof e.implementation + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + T = t === u; + } else T = !0; + if (T) { + if ( + void 0 !== e.cwd + ) { + const t = u; + if ( + 'string' != + typeof e.cwd + ) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + T = t === u; + } else T = !0; + if (T) + if ( + void 0 !== + e.displayErrorInTerminal + ) { + const t = u; + if ( + 'boolean' != + typeof e.displayErrorInTerminal + ) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + T = t === u; + } else T = !0; + } + } + } + } + } + } else { + const e = { + params: { type: 'object' }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + (A = r === u), (s = s || A); + } + if (!s) { + const e = { params: {} }; + return ( + null === m + ? (m = [e]) + : m.push(e), + u++, + (j.errors = m), + !1 + ); + } + (u = n), + null !== m && + (n + ? (m.length = n) + : (m = null)), + (c = r === u); + } else c = !0; + if (c) { + if (void 0 !== o.experiments) { + let e = o.experiments; + const r = u; + if (u === r) { + if ( + !e || + 'object' != typeof e || + Array.isArray(e) + ) + return ( + (j.errors = [ + { + params: { + type: 'object', + }, + }, + ]), + !1 + ); + if ( + void 0 !== e.federationRuntime + ) { + let r = e.federationRuntime; + const n = u, + s = u; + let o = !1; + const a = u; + if ('boolean' != typeof r) { + const e = { + params: { + type: 'boolean', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + if (!1 !== r) { + const e = { + params: { + allowedValues: + t.properties + .experiments + .properties + .federationRuntime + .anyOf[0].enum, + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + var C = a === u; + if (((o = o || C), !o)) { + const e = u; + if ('string' != typeof r) { + const e = { + params: { + type: 'string', + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + if ('hoisted' !== r) { + const e = { + params: { + allowedValues: + t.properties + .experiments + .properties + .federationRuntime + .anyOf[1].enum, + }, + }; + null === m + ? (m = [e]) + : m.push(e), + u++; + } + (C = e === u), (o = o || C); + } + if (!o) { + const e = { params: {} }; + return ( + null === m + ? (m = [e]) + : m.push(e), + u++, + (j.errors = m), + !1 + ); + } + (u = s), + null !== m && + (s + ? (m.length = s) + : (m = null)); + var I = n === u; + } else I = !0; + if (I) { + if ( + void 0 !== e.externalRuntime + ) { + const t = u; + if ( + 'boolean' != + typeof e.externalRuntime + ) + return ( + (j.errors = [ + { + params: { + type: 'boolean', + }, + }, + ]), + !1 + ); + I = t === u; + } else I = !0; + if (I) + if ( + void 0 !== + e.provideExternalRuntime + ) { + const t = u; + if ( + 'boolean' != + typeof e.provideExternalRuntime + ) + return ( + (j.errors = [ + { + params: { + type: 'boolean', + }, + }, + ]), + !1 + ); + I = t === u; + } else I = !0; + } + } + c = r === u; + } else c = !0; + if (c) + if (void 0 !== o.bridge) { + let e = o.bridge; + const t = u; + if (u === t) { + if ( + !e || + 'object' != typeof e || + Array.isArray(e) + ) + return ( + (j.errors = [ + { + params: { + type: 'object', + }, + }, + ]), + !1 + ); + if ( + void 0 !== e.disableAlias && + 'boolean' != + typeof e.disableAlias + ) + return ( + (j.errors = [ + { + params: { + type: 'boolean', + }, + }, + ]), + !1 + ); + } + c = t === u; + } else c = !0; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return (j.errors = m), 0 === u; +} diff --git a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json new file mode 100644 index 00000000000..788d70e7eb3 --- /dev/null +++ b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.json @@ -0,0 +1,746 @@ +{ + "definitions": { + "AmdContainer": { + "description": "Add a container for define/require functions in the AMD module.", + "type": "string", + "minLength": 1 + }, + "AuxiliaryComment": { + "description": "Add a comment in the UMD wrapper.", + "anyOf": [ + { + "description": "Append the same comment above each import style.", + "type": "string" + }, + { + "$ref": "#/definitions/LibraryCustomUmdCommentObject" + } + ] + }, + "EntryRuntime": { + "description": "The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.", + "anyOf": [ + { + "enum": [false] + }, + { + "type": "string", + "minLength": 1 + } + ] + }, + "Exposes": { + "description": "Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Modules that should be exposed by this container.", + "anyOf": [ + { + "$ref": "#/definitions/ExposesItem" + }, + { + "$ref": "#/definitions/ExposesObject" + } + ] + } + }, + { + "$ref": "#/definitions/ExposesObject" + } + ] + }, + "ExposesConfig": { + "description": "Advanced configuration for modules that should be exposed by this container.", + "type": "object", + "additionalProperties": false, + "properties": { + "import": { + "description": "Request to a module that should be exposed by this container.", + "anyOf": [ + { + "$ref": "#/definitions/ExposesItem" + }, + { + "$ref": "#/definitions/ExposesItems" + } + ] + }, + "name": { + "description": "Custom chunk name for the exposed module.", + "type": "string" + } + }, + "required": ["import"] + }, + "ExposesItem": { + "description": "Module that should be exposed by this container.", + "type": "string", + "minLength": 1 + }, + "ExposesItems": { + "description": "Modules that should be exposed by this container.", + "type": "array", + "items": { + "$ref": "#/definitions/ExposesItem" + } + }, + "ExposesObject": { + "description": "Modules that should be exposed by this container. Property names are used as public paths.", + "type": "object", + "additionalProperties": { + "description": "Modules that should be exposed by this container.", + "anyOf": [ + { + "$ref": "#/definitions/ExposesConfig" + }, + { + "$ref": "#/definitions/ExposesItem" + }, + { + "$ref": "#/definitions/ExposesItems" + } + ] + } + }, + "ExternalsType": { + "description": "Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).", + "enum": [ + "var", + "module", + "assign", + "this", + "window", + "self", + "global", + "commonjs", + "commonjs2", + "commonjs-module", + "commonjs-static", + "amd", + "amd-require", + "umd", + "umd2", + "jsonp", + "system", + "promise", + "import", + "script", + "module-import", + "node-commonjs" + ] + }, + "LibraryCustomUmdCommentObject": { + "description": "Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.", + "type": "object", + "additionalProperties": false, + "properties": { + "amd": { + "description": "Set comment for `amd` section in UMD.", + "type": "string" + }, + "commonjs": { + "description": "Set comment for `commonjs` (exports) section in UMD.", + "type": "string" + }, + "commonjs2": { + "description": "Set comment for `commonjs2` (module.exports) section in UMD.", + "type": "string" + }, + "root": { + "description": "Set comment for `root` (global variable) section in UMD.", + "type": "string" + } + } + }, + "LibraryCustomUmdObject": { + "description": "Description object for all UMD variants of the library name.", + "type": "object", + "additionalProperties": false, + "properties": { + "amd": { + "description": "Name of the exposed AMD library in the UMD.", + "type": "string", + "minLength": 1 + }, + "commonjs": { + "description": "Name of the exposed commonjs export in the UMD.", + "type": "string", + "minLength": 1 + }, + "root": { + "description": "Name of the property exposed globally by a UMD library.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Part of the name of the property exposed globally by a UMD library.", + "type": "string", + "minLength": 1 + } + }, + { + "type": "string", + "minLength": 1 + } + ] + } + } + }, + "LibraryExport": { + "description": "Specify which export should be exposed as library.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Part of the export that should be exposed as library.", + "type": "string", + "minLength": 1 + } + }, + { + "type": "string", + "minLength": 1 + } + ] + }, + "LibraryName": { + "description": "The name of the library (some types allow unnamed libraries too).", + "anyOf": [ + { + "type": "array", + "items": { + "description": "A part of the library name.", + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + { + "type": "string", + "minLength": 1 + }, + { + "$ref": "#/definitions/LibraryCustomUmdObject" + } + ] + }, + "LibraryOptions": { + "description": "Options for library.", + "type": "object", + "additionalProperties": false, + "properties": { + "amdContainer": { + "$ref": "#/definitions/AmdContainer" + }, + "auxiliaryComment": { + "$ref": "#/definitions/AuxiliaryComment" + }, + "export": { + "$ref": "#/definitions/LibraryExport" + }, + "name": { + "$ref": "#/definitions/LibraryName" + }, + "type": { + "$ref": "#/definitions/LibraryType" + }, + "umdNamedDefine": { + "$ref": "#/definitions/UmdNamedDefine" + } + }, + "required": ["type"] + }, + "LibraryType": { + "description": "Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).", + "anyOf": [ + { + "enum": [ + "var", + "module", + "assign", + "assign-properties", + "this", + "window", + "self", + "global", + "commonjs", + "commonjs2", + "commonjs-module", + "commonjs-static", + "amd", + "amd-require", + "umd", + "umd2", + "jsonp", + "system" + ] + }, + { + "type": "string" + } + ] + }, + "Remotes": { + "description": "Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Container locations and request scopes from which modules should be resolved and loaded at runtime.", + "anyOf": [ + { + "$ref": "#/definitions/RemotesItem" + }, + { + "$ref": "#/definitions/RemotesObject" + } + ] + } + }, + { + "$ref": "#/definitions/RemotesObject" + } + ] + }, + "RemotesConfig": { + "description": "Advanced configuration for container locations from which modules should be resolved and loaded at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + "external": { + "description": "Container locations from which modules should be resolved and loaded at runtime.", + "anyOf": [ + { + "$ref": "#/definitions/RemotesItem" + }, + { + "$ref": "#/definitions/RemotesItems" + } + ] + }, + "shareScope": { + "description": "The name of the share scope shared with this remote.", + "type": "string", + "minLength": 1 + } + }, + "required": ["external"] + }, + "RemotesItem": { + "description": "Container location from which modules should be resolved and loaded at runtime.", + "type": "string", + "minLength": 1 + }, + "RemotesItems": { + "description": "Container locations from which modules should be resolved and loaded at runtime.", + "type": "array", + "items": { + "$ref": "#/definitions/RemotesItem" + } + }, + "RemotesObject": { + "description": "Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.", + "type": "object", + "additionalProperties": { + "description": "Container locations from which modules should be resolved and loaded at runtime.", + "anyOf": [ + { + "$ref": "#/definitions/RemotesConfig" + }, + { + "$ref": "#/definitions/RemotesItem" + }, + { + "$ref": "#/definitions/RemotesItems" + } + ] + } + }, + "Shared": { + "description": "Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Modules that should be shared in the share scope.", + "anyOf": [ + { + "$ref": "#/definitions/SharedItem" + }, + { + "$ref": "#/definitions/SharedObject" + } + ] + } + }, + { + "$ref": "#/definitions/SharedObject" + } + ] + }, + "SharedConfig": { + "description": "Advanced configuration for modules that should be shared in the share scope.", + "type": "object", + "additionalProperties": false, + "properties": { + "eager": { + "description": "Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.", + "type": "boolean" + }, + "import": { + "description": "Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.", + "anyOf": [ + { + "description": "No provided or fallback module.", + "enum": [false] + }, + { + "$ref": "#/definitions/SharedItem" + } + ] + }, + "packageName": { + "description": "Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.", + "type": "string", + "minLength": 1 + }, + "requiredVersion": { + "description": "Version requirement from module in share scope.", + "anyOf": [ + { + "description": "No version requirement check.", + "enum": [false] + }, + { + "description": "Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.", + "type": "string" + } + ] + }, + "shareKey": { + "description": "Module is looked up under this key from the share scope.", + "type": "string", + "minLength": 1 + }, + "shareScope": { + "description": "Share scope name.", + "type": "string", + "minLength": 1 + }, + "shareStrategy": { + "description": "load shared strategy(defaults to 'version-first').", + "enum": ["version-first", "loaded-first"] + }, + "singleton": { + "description": "Allow only a single version of the shared module in share scope (disabled by default).", + "type": "boolean" + }, + "strictVersion": { + "description": "Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).", + "type": "boolean" + }, + "version": { + "description": "Version of the provided module. Will replace lower matching versions, but not higher.", + "anyOf": [ + { + "description": "Don't provide a version.", + "enum": [false] + }, + { + "description": "Version as string. Each part of the version should be separated by a dot '.'.", + "type": "string" + } + ] + } + } + }, + "SharedItem": { + "description": "A module that should be shared in the share scope.", + "type": "string", + "minLength": 1 + }, + "SharedObject": { + "description": "Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.", + "type": "object", + "additionalProperties": { + "description": "Modules that should be shared in the share scope.", + "anyOf": [ + { + "$ref": "#/definitions/SharedConfig" + }, + { + "$ref": "#/definitions/SharedItem" + } + ] + } + }, + "UmdNamedDefine": { + "description": "If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.", + "type": "boolean" + } + }, + "title": "ModuleFederationPluginOptions", + "type": "object", + "additionalProperties": false, + "properties": { + "dataPrefetch": { + "description": "Enable Data Prefetch", + "type": "boolean" + }, + "exposes": { + "$ref": "#/definitions/Exposes" + }, + "filename": { + "description": "The filename of the container as relative path inside the `output.path` directory.", + "type": "string", + "absolutePath": false + }, + "getPublicPath": { + "description": "Custom public path function", + "type": "string" + }, + "implementation": { + "description": "Bundler runtime path", + "type": "string" + }, + "library": { + "$ref": "#/definitions/LibraryOptions" + }, + "manifest": { + "description": "Manifest generation options", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "filePath": { + "type": "string" + }, + "disableAssetsAnalyze": { + "type": "boolean" + }, + "fileName": { + "type": "string" + }, + "additionalData": { + "type": "string", + "description": "Function string to provide additional data to the manifest" + } + } + } + ] + }, + "name": { + "description": "The name of the container.", + "type": "string" + }, + "remoteType": { + "description": "The external type of the remote containers.", + "oneOf": [ + { + "$ref": "#/definitions/ExternalsType" + } + ] + }, + "remotes": { + "$ref": "#/definitions/Remotes" + }, + "runtime": { + "$ref": "#/definitions/EntryRuntime" + }, + "runtimePlugins": { + "description": "Runtime plugin file paths or package name", + "type": "array", + "items": { + "type": "string" + } + }, + "shareScope": { + "description": "Share scope name used for all shared modules (defaults to 'default').", + "type": "string", + "minLength": 1 + }, + "shareStrategy": { + "description": "load shared strategy(defaults to 'version-first').", + "enum": ["version-first", "loaded-first"] + }, + "shared": { + "$ref": "#/definitions/Shared" + }, + "virtualRuntimeEntry": { + "description": "Enable virtual runtime entry", + "type": "boolean" + }, + "dev": { + "description": "Development options", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "disableLiveReload": { + "type": "boolean" + }, + "disableHotTypesReload": { + "type": "boolean" + }, + "disableDynamicRemoteTypeHints": { + "type": "boolean" + } + } + } + ] + }, + "dts": { + "description": "TypeScript declaration file generation options", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "generateTypes": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "tsConfigPath": { + "type": "string" + }, + "typesFolder": { + "type": "string" + }, + "compiledTypesFolder": { + "type": "string" + }, + "deleteTypesFolder": { + "type": "boolean" + }, + "additionalFilesToCompile": { + "type": "array", + "items": { + "type": "string" + } + }, + "compileInChildProcess": { + "type": "boolean" + }, + "compilerInstance": { + "enum": ["tsc", "vue-tsc"] + }, + "generateAPITypes": { + "type": "boolean" + }, + "extractThirdParty": { + "type": "boolean" + }, + "extractRemoteTypes": { + "type": "boolean" + }, + "abortOnError": { + "type": "boolean" + } + } + } + ] + }, + "consumeTypes": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "typesFolder": { + "type": "string" + }, + "abortOnError": { + "type": "boolean" + }, + "remoteTypesFolder": { + "type": "string" + }, + "deleteTypesFolder": { + "type": "boolean" + }, + "maxRetries": { + "type": "number" + }, + "consumeAPITypes": { + "type": "boolean" + }, + "runtimePkgs": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + ] + }, + "tsConfigPath": { + "type": "string" + }, + "extraOptions": { + "type": "object" + }, + "implementation": { + "type": "string" + }, + "cwd": { + "type": "string" + }, + "displayErrorInTerminal": { + "type": "boolean" + } + } + } + ] + }, + "experiments": { + "type": "object", + "properties": { + "federationRuntime": { + "anyOf": [ + { + "type": "boolean", + "enum": [false] + }, + { + "type": "string", + "enum": ["hoisted"] + } + ] + }, + "externalRuntime": { + "type": "boolean" + }, + "provideExternalRuntime": { + "type": "boolean" + } + } + }, + "bridge": { + "type": "object", + "properties": { + "disableAlias": { + "description": "Disables the default alias setting in the bridge. When true, users must manually handle basename through root component props.", + "type": "boolean", + "default": false + } + } + } + } +} diff --git a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts index e69de29bb2d..7244749a134 100644 --- a/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts +++ b/packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts @@ -0,0 +1,794 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + +export default { + definitions: { + AmdContainer: { + description: + 'Add a container for define/require functions in the AMD module.', + type: 'string', + minLength: 1, + }, + AuxiliaryComment: { + description: 'Add a comment in the UMD wrapper.', + anyOf: [ + { + description: 'Append the same comment above each import style.', + type: 'string', + }, + { + $ref: '#/definitions/LibraryCustomUmdCommentObject', + }, + ], + }, + EntryRuntime: { + description: + 'The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.', + anyOf: [ + { + enum: [false], + }, + { + type: 'string', + minLength: 1, + }, + ], + }, + Exposes: { + description: + 'Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.', + anyOf: [ + { + type: 'array', + items: { + description: 'Modules that should be exposed by this container.', + anyOf: [ + { + $ref: '#/definitions/ExposesItem', + }, + { + $ref: '#/definitions/ExposesObject', + }, + ], + }, + }, + { + $ref: '#/definitions/ExposesObject', + }, + ], + }, + ExposesConfig: { + description: + 'Advanced configuration for modules that should be exposed by this container.', + type: 'object', + additionalProperties: false, + properties: { + import: { + description: + 'Request to a module that should be exposed by this container.', + anyOf: [ + { + $ref: '#/definitions/ExposesItem', + }, + { + $ref: '#/definitions/ExposesItems', + }, + ], + }, + name: { + description: 'Custom chunk name for the exposed module.', + type: 'string', + }, + }, + required: ['import'], + }, + ExposesItem: { + description: 'Module that should be exposed by this container.', + type: 'string', + minLength: 1, + }, + ExposesItems: { + description: 'Modules that should be exposed by this container.', + type: 'array', + items: { + $ref: '#/definitions/ExposesItem', + }, + }, + ExposesObject: { + description: + 'Modules that should be exposed by this container. Property names are used as public paths.', + type: 'object', + additionalProperties: { + description: 'Modules that should be exposed by this container.', + anyOf: [ + { + $ref: '#/definitions/ExposesConfig', + }, + { + $ref: '#/definitions/ExposesItem', + }, + { + $ref: '#/definitions/ExposesItems', + }, + ], + }, + }, + ExternalsType: { + description: + "Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).", + enum: [ + 'var', + 'module', + 'assign', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + 'promise', + 'import', + 'script', + 'module-import', + 'node-commonjs', + ], + }, + LibraryCustomUmdCommentObject: { + description: + 'Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.', + type: 'object', + additionalProperties: false, + properties: { + amd: { + description: 'Set comment for `amd` section in UMD.', + type: 'string', + }, + commonjs: { + description: 'Set comment for `commonjs` (exports) section in UMD.', + type: 'string', + }, + commonjs2: { + description: + 'Set comment for `commonjs2` (module.exports) section in UMD.', + type: 'string', + }, + root: { + description: + 'Set comment for `root` (global variable) section in UMD.', + type: 'string', + }, + }, + }, + LibraryCustomUmdObject: { + description: + 'Description object for all UMD variants of the library name.', + type: 'object', + additionalProperties: false, + properties: { + amd: { + description: 'Name of the exposed AMD library in the UMD.', + type: 'string', + minLength: 1, + }, + commonjs: { + description: 'Name of the exposed commonjs export in the UMD.', + type: 'string', + minLength: 1, + }, + root: { + description: + 'Name of the property exposed globally by a UMD library.', + anyOf: [ + { + type: 'array', + items: { + description: + 'Part of the name of the property exposed globally by a UMD library.', + type: 'string', + minLength: 1, + }, + }, + { + type: 'string', + minLength: 1, + }, + ], + }, + }, + }, + LibraryExport: { + description: 'Specify which export should be exposed as library.', + anyOf: [ + { + type: 'array', + items: { + description: + 'Part of the export that should be exposed as library.', + type: 'string', + minLength: 1, + }, + }, + { + type: 'string', + minLength: 1, + }, + ], + }, + LibraryName: { + description: + 'The name of the library (some types allow unnamed libraries too).', + anyOf: [ + { + type: 'array', + items: { + description: 'A part of the library name.', + type: 'string', + minLength: 1, + }, + minItems: 1, + }, + { + type: 'string', + minLength: 1, + }, + { + $ref: '#/definitions/LibraryCustomUmdObject', + }, + ], + }, + LibraryOptions: { + description: 'Options for library.', + type: 'object', + additionalProperties: false, + properties: { + amdContainer: { + $ref: '#/definitions/AmdContainer', + }, + auxiliaryComment: { + $ref: '#/definitions/AuxiliaryComment', + }, + export: { + $ref: '#/definitions/LibraryExport', + }, + name: { + $ref: '#/definitions/LibraryName', + }, + type: { + $ref: '#/definitions/LibraryType', + }, + umdNamedDefine: { + $ref: '#/definitions/UmdNamedDefine', + }, + }, + required: ['type'], + }, + LibraryType: { + description: + "Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).", + anyOf: [ + { + enum: [ + 'var', + 'module', + 'assign', + 'assign-properties', + 'this', + 'window', + 'self', + 'global', + 'commonjs', + 'commonjs2', + 'commonjs-module', + 'commonjs-static', + 'amd', + 'amd-require', + 'umd', + 'umd2', + 'jsonp', + 'system', + ], + }, + { + type: 'string', + }, + ], + }, + Remotes: { + description: + 'Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.', + anyOf: [ + { + type: 'array', + items: { + description: + 'Container locations and request scopes from which modules should be resolved and loaded at runtime.', + anyOf: [ + { + $ref: '#/definitions/RemotesItem', + }, + { + $ref: '#/definitions/RemotesObject', + }, + ], + }, + }, + { + $ref: '#/definitions/RemotesObject', + }, + ], + }, + RemotesConfig: { + description: + 'Advanced configuration for container locations from which modules should be resolved and loaded at runtime.', + type: 'object', + additionalProperties: false, + properties: { + external: { + description: + 'Container locations from which modules should be resolved and loaded at runtime.', + anyOf: [ + { + $ref: '#/definitions/RemotesItem', + }, + { + $ref: '#/definitions/RemotesItems', + }, + ], + }, + shareScope: { + description: 'The name of the share scope shared with this remote.', + type: 'string', + minLength: 1, + }, + }, + required: ['external'], + }, + RemotesItem: { + description: + 'Container location from which modules should be resolved and loaded at runtime.', + type: 'string', + minLength: 1, + }, + RemotesItems: { + description: + 'Container locations from which modules should be resolved and loaded at runtime.', + type: 'array', + items: { + $ref: '#/definitions/RemotesItem', + }, + }, + RemotesObject: { + description: + 'Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.', + type: 'object', + additionalProperties: { + description: + 'Container locations from which modules should be resolved and loaded at runtime.', + anyOf: [ + { + $ref: '#/definitions/RemotesConfig', + }, + { + $ref: '#/definitions/RemotesItem', + }, + { + $ref: '#/definitions/RemotesItems', + }, + ], + }, + }, + Shared: { + description: + 'Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.', + anyOf: [ + { + type: 'array', + items: { + description: 'Modules that should be shared in the share scope.', + anyOf: [ + { + $ref: '#/definitions/SharedItem', + }, + { + $ref: '#/definitions/SharedObject', + }, + ], + }, + }, + { + $ref: '#/definitions/SharedObject', + }, + ], + }, + SharedConfig: { + description: + 'Advanced configuration for modules that should be shared in the share scope.', + type: 'object', + additionalProperties: false, + properties: { + eager: { + description: + 'Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.', + type: 'boolean', + }, + import: { + description: + "Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.", + anyOf: [ + { + description: 'No provided or fallback module.', + enum: [false], + }, + { + $ref: '#/definitions/SharedItem', + }, + ], + }, + packageName: { + description: + "Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.", + type: 'string', + minLength: 1, + }, + requiredVersion: { + description: 'Version requirement from module in share scope.', + anyOf: [ + { + description: 'No version requirement check.', + enum: [false], + }, + { + description: + "Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.", + type: 'string', + }, + ], + }, + shareKey: { + description: + 'Module is looked up under this key from the share scope.', + type: 'string', + minLength: 1, + }, + shareScope: { + description: 'Share scope name.', + type: 'string', + minLength: 1, + }, + shareStrategy: { + description: "load shared strategy(defaults to 'version-first').", + enum: ['version-first', 'loaded-first'], + }, + singleton: { + description: + 'Allow only a single version of the shared module in share scope (disabled by default).', + type: 'boolean', + }, + strictVersion: { + description: + 'Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).', + type: 'boolean', + }, + version: { + description: + 'Version of the provided module. Will replace lower matching versions, but not higher.', + anyOf: [ + { + description: "Don't provide a version.", + enum: [false], + }, + { + description: + "Version as string. Each part of the version should be separated by a dot '.'.", + type: 'string', + }, + ], + }, + }, + }, + SharedItem: { + description: 'A module that should be shared in the share scope.', + type: 'string', + minLength: 1, + }, + SharedObject: { + description: + 'Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.', + type: 'object', + additionalProperties: { + description: 'Modules that should be shared in the share scope.', + anyOf: [ + { + $ref: '#/definitions/SharedConfig', + }, + { + $ref: '#/definitions/SharedItem', + }, + ], + }, + }, + UmdNamedDefine: { + description: + 'If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.', + type: 'boolean', + }, + }, + title: 'ModuleFederationPluginOptions', + type: 'object', + additionalProperties: false, + properties: { + dataPrefetch: { + description: 'Enable Data Prefetch', + type: 'boolean', + }, + exposes: { + $ref: '#/definitions/Exposes', + }, + filename: { + description: + 'The filename of the container as relative path inside the `output.path` directory.', + type: 'string', + absolutePath: false, + }, + getPublicPath: { + description: 'Custom public path function', + type: 'string', + }, + implementation: { + description: 'Bundler runtime path', + type: 'string', + }, + library: { + $ref: '#/definitions/LibraryOptions', + }, + manifest: { + description: 'Manifest generation options', + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + filePath: { + type: 'string', + }, + disableAssetsAnalyze: { + type: 'boolean', + }, + fileName: { + type: 'string', + }, + additionalData: { + type: 'string', + description: + 'Function string to provide additional data to the manifest', + }, + }, + }, + ], + }, + name: { + description: 'The name of the container.', + type: 'string', + }, + remoteType: { + description: 'The external type of the remote containers.', + oneOf: [ + { + $ref: '#/definitions/ExternalsType', + }, + ], + }, + remotes: { + $ref: '#/definitions/Remotes', + }, + runtime: { + $ref: '#/definitions/EntryRuntime', + }, + runtimePlugins: { + description: 'Runtime plugin file paths or package name', + type: 'array', + items: { + type: 'string', + }, + }, + shareScope: { + description: + "Share scope name used for all shared modules (defaults to 'default').", + type: 'string', + minLength: 1, + }, + shareStrategy: { + description: "load shared strategy(defaults to 'version-first').", + enum: ['version-first', 'loaded-first'], + }, + shared: { + $ref: '#/definitions/Shared', + }, + virtualRuntimeEntry: { + description: 'Enable virtual runtime entry', + type: 'boolean', + }, + dev: { + description: 'Development options', + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + disableLiveReload: { + type: 'boolean', + }, + disableHotTypesReload: { + type: 'boolean', + }, + disableDynamicRemoteTypeHints: { + type: 'boolean', + }, + }, + }, + ], + }, + dts: { + description: 'TypeScript declaration file generation options', + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + generateTypes: { + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + tsConfigPath: { + type: 'string', + }, + typesFolder: { + type: 'string', + }, + compiledTypesFolder: { + type: 'string', + }, + deleteTypesFolder: { + type: 'boolean', + }, + additionalFilesToCompile: { + type: 'array', + items: { + type: 'string', + }, + }, + compileInChildProcess: { + type: 'boolean', + }, + compilerInstance: { + enum: ['tsc', 'vue-tsc'], + }, + generateAPITypes: { + type: 'boolean', + }, + extractThirdParty: { + type: 'boolean', + }, + extractRemoteTypes: { + type: 'boolean', + }, + abortOnError: { + type: 'boolean', + }, + }, + }, + ], + }, + consumeTypes: { + anyOf: [ + { + type: 'boolean', + }, + { + type: 'object', + properties: { + typesFolder: { + type: 'string', + }, + abortOnError: { + type: 'boolean', + }, + remoteTypesFolder: { + type: 'string', + }, + deleteTypesFolder: { + type: 'boolean', + }, + maxRetries: { + type: 'number', + }, + consumeAPITypes: { + type: 'boolean', + }, + runtimePkgs: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + tsConfigPath: { + type: 'string', + }, + extraOptions: { + type: 'object', + }, + implementation: { + type: 'string', + }, + cwd: { + type: 'string', + }, + displayErrorInTerminal: { + type: 'boolean', + }, + }, + }, + ], + }, + experiments: { + type: 'object', + properties: { + federationRuntime: { + anyOf: [ + { + type: 'boolean', + enum: [false], + }, + { + type: 'string', + enum: ['hoisted'], + }, + ], + }, + externalRuntime: { + type: 'boolean', + }, + provideExternalRuntime: { + type: 'boolean', + }, + }, + }, + bridge: { + type: 'object', + properties: { + disableAlias: { + description: + 'Disables the default alias setting in the bridge. When true, users must manually handle basename through root component props.', + type: 'boolean', + default: false, + }, + }, + }, + }, +} as const; diff --git a/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.check.ts b/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.check.ts new file mode 100644 index 00000000000..6d438755ed5 --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.check.ts @@ -0,0 +1,378 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +export const validate = s; +export default s; +const r = { + type: 'object', + additionalProperties: !1, + properties: { + eager: { type: 'boolean' }, + import: { anyOf: [{ enum: [!1] }, { $ref: '#/definitions/ConsumesItem' }] }, + packageName: { type: 'string', minLength: 1 }, + requiredVersion: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + shareKey: { type: 'string', minLength: 1 }, + shareScope: { type: 'string', minLength: 1 }, + singleton: { type: 'boolean' }, + strictVersion: { type: 'boolean' }, + }, +}; +function e( + t, + { + instancePath: n = '', + parentData: s, + parentDataProperty: a, + rootData: o = t, + } = {}, +) { + let i = null, + l = 0; + if (0 === l) { + if (!t || 'object' != typeof t || Array.isArray(t)) + return (e.errors = [{ params: { type: 'object' } }]), !1; + { + const n = l; + for (const r in t) + if ( + 'eager' !== r && + 'import' !== r && + 'packageName' !== r && + 'requiredVersion' !== r && + 'shareKey' !== r && + 'shareScope' !== r && + 'singleton' !== r && + 'strictVersion' !== r + ) + return (e.errors = [{ params: { additionalProperty: r } }]), !1; + if (n === l) { + if (void 0 !== t.eager) { + const r = l; + if ('boolean' != typeof t.eager) + return (e.errors = [{ params: { type: 'boolean' } }]), !1; + var p = r === l; + } else p = !0; + if (p) { + if (void 0 !== t.import) { + let n = t.import; + const s = l, + a = l; + let o = !1; + const c = l; + if (!1 !== n) { + const e = { + params: { allowedValues: r.properties.import.anyOf[0].enum }, + }; + null === i ? (i = [e]) : i.push(e), l++; + } + var f = c === l; + if (((o = o || f), !o)) { + const r = l; + if (l == l) + if ('string' == typeof n) { + if (n.length < 1) { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + } else { + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + (f = r === l), (o = o || f); + } + if (!o) { + const r = { params: {} }; + return ( + null === i ? (i = [r]) : i.push(r), l++, (e.errors = i), !1 + ); + } + (l = a), + null !== i && (a ? (i.length = a) : (i = null)), + (p = s === l); + } else p = !0; + if (p) { + if (void 0 !== t.packageName) { + let r = t.packageName; + const n = l; + if (l === n) { + if ('string' != typeof r) + return (e.errors = [{ params: { type: 'string' } }]), !1; + if (r.length < 1) return (e.errors = [{ params: {} }]), !1; + } + p = n === l; + } else p = !0; + if (p) { + if (void 0 !== t.requiredVersion) { + let n = t.requiredVersion; + const s = l, + a = l; + let o = !1; + const f = l; + if (!1 !== n) { + const e = { + params: { + allowedValues: r.properties.requiredVersion.anyOf[0].enum, + }, + }; + null === i ? (i = [e]) : i.push(e), l++; + } + var c = f === l; + if (((o = o || c), !o)) { + const r = l; + if ('string' != typeof n) { + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + (c = r === l), (o = o || c); + } + if (!o) { + const r = { params: {} }; + return ( + null === i ? (i = [r]) : i.push(r), l++, (e.errors = i), !1 + ); + } + (l = a), + null !== i && (a ? (i.length = a) : (i = null)), + (p = s === l); + } else p = !0; + if (p) { + if (void 0 !== t.shareKey) { + let r = t.shareKey; + const n = l; + if (l === n) { + if ('string' != typeof r) + return (e.errors = [{ params: { type: 'string' } }]), !1; + if (r.length < 1) return (e.errors = [{ params: {} }]), !1; + } + p = n === l; + } else p = !0; + if (p) { + if (void 0 !== t.shareScope) { + let r = t.shareScope; + const n = l; + if (l === n) { + if ('string' != typeof r) + return ( + (e.errors = [{ params: { type: 'string' } }]), !1 + ); + if (r.length < 1) + return (e.errors = [{ params: {} }]), !1; + } + p = n === l; + } else p = !0; + if (p) { + if (void 0 !== t.singleton) { + const r = l; + if ('boolean' != typeof t.singleton) + return ( + (e.errors = [{ params: { type: 'boolean' } }]), !1 + ); + p = r === l; + } else p = !0; + if (p) + if (void 0 !== t.strictVersion) { + const r = l; + if ('boolean' != typeof t.strictVersion) + return ( + (e.errors = [{ params: { type: 'boolean' } }]), !1 + ); + p = r === l; + } else p = !0; + } + } + } + } + } + } + } + } + } + return (e.errors = i), 0 === l; +} +function t( + r, + { + instancePath: n = '', + parentData: s, + parentDataProperty: a, + rootData: o = r, + } = {}, +) { + let i = null, + l = 0; + if (0 === l) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (t.errors = [{ params: { type: 'object' } }]), !1; + for (const s in r) { + let a = r[s]; + const f = l, + c = l; + let u = !1; + const y = l; + e(a, { + instancePath: n + '/' + s.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: r, + parentDataProperty: s, + rootData: o, + }) || ((i = null === i ? e.errors : i.concat(e.errors)), (l = i.length)); + var p = y === l; + if (((u = u || p), !u)) { + const r = l; + if (l == l) + if ('string' == typeof a) { + if (a.length < 1) { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + } else { + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + (p = r === l), (u = u || p); + } + if (!u) { + const r = { params: {} }; + return null === i ? (i = [r]) : i.push(r), l++, (t.errors = i), !1; + } + if (((l = c), null !== i && (c ? (i.length = c) : (i = null)), f !== l)) + break; + } + } + return (t.errors = i), 0 === l; +} +function n( + r, + { + instancePath: e = '', + parentData: s, + parentDataProperty: a, + rootData: o = r, + } = {}, +) { + let i = null, + l = 0; + const p = l; + let f = !1; + const c = l; + if (l === c) + if (Array.isArray(r)) { + const n = r.length; + for (let s = 0; s < n; s++) { + let n = r[s]; + const a = l, + p = l; + let f = !1; + const c = l; + if (l == l) + if ('string' == typeof n) { + if (n.length < 1) { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + } else { + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + var u = c === l; + if (((f = f || u), !f)) { + const a = l; + t(n, { + instancePath: e + '/' + s, + parentData: r, + parentDataProperty: s, + rootData: o, + }) || + ((i = null === i ? t.errors : i.concat(t.errors)), (l = i.length)), + (u = a === l), + (f = f || u); + } + if (f) (l = p), null !== i && (p ? (i.length = p) : (i = null)); + else { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + if (a !== l) break; + } + } else { + const r = { params: { type: 'array' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + var y = c === l; + if (((f = f || y), !f)) { + const n = l; + t(r, { + instancePath: e, + parentData: s, + parentDataProperty: a, + rootData: o, + }) || ((i = null === i ? t.errors : i.concat(t.errors)), (l = i.length)), + (y = n === l), + (f = f || y); + } + if (!f) { + const r = { params: {} }; + return null === i ? (i = [r]) : i.push(r), l++, (n.errors = i), !1; + } + return ( + (l = p), + null !== i && (p ? (i.length = p) : (i = null)), + (n.errors = i), + 0 === l + ); +} +function s( + r, + { + instancePath: e = '', + parentData: t, + parentDataProperty: a, + rootData: o = r, + } = {}, +) { + let i = null, + l = 0; + if (0 === l) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (s.errors = [{ params: { type: 'object' } }]), !1; + { + let t; + if (void 0 === r.consumes && (t = 'consumes')) + return (s.errors = [{ params: { missingProperty: t } }]), !1; + { + const t = l; + for (const e in r) + if ('consumes' !== e && 'shareScope' !== e) + return (s.errors = [{ params: { additionalProperty: e } }]), !1; + if (t === l) { + if (void 0 !== r.consumes) { + const t = l; + n(r.consumes, { + instancePath: e + '/consumes', + parentData: r, + parentDataProperty: 'consumes', + rootData: o, + }) || + ((i = null === i ? n.errors : i.concat(n.errors)), + (l = i.length)); + var p = t === l; + } else p = !0; + if (p) + if (void 0 !== r.shareScope) { + let e = r.shareScope; + const t = l; + if (l === t) { + if ('string' != typeof e) + return (s.errors = [{ params: { type: 'string' } }]), !1; + if (e.length < 1) return (s.errors = [{ params: {} }]), !1; + } + p = t === l; + } else p = !0; + } + } + } + } + return (s.errors = i), 0 === l; +} diff --git a/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.json b/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.json new file mode 100644 index 00000000000..8365d5ff54d --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.json @@ -0,0 +1,120 @@ +{ + "definitions": { + "Consumes": { + "description": "Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Modules that should be consumed from share scope.", + "anyOf": [ + { + "$ref": "#/definitions/ConsumesItem" + }, + { + "$ref": "#/definitions/ConsumesObject" + } + ] + } + }, + { + "$ref": "#/definitions/ConsumesObject" + } + ] + }, + "ConsumesConfig": { + "description": "Advanced configuration for modules that should be consumed from share scope.", + "type": "object", + "additionalProperties": false, + "properties": { + "eager": { + "description": "Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.", + "type": "boolean" + }, + "import": { + "description": "Fallback module if no shared module is found in share scope. Defaults to the property name.", + "anyOf": [ + { + "description": "No fallback module.", + "enum": [false] + }, + { + "$ref": "#/definitions/ConsumesItem" + } + ] + }, + "packageName": { + "description": "Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.", + "type": "string", + "minLength": 1 + }, + "requiredVersion": { + "description": "Version requirement from module in share scope.", + "anyOf": [ + { + "description": "No version requirement check.", + "enum": [false] + }, + { + "description": "Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.", + "type": "string" + } + ] + }, + "shareKey": { + "description": "Module is looked up under this key from the share scope.", + "type": "string", + "minLength": 1 + }, + "shareScope": { + "description": "Share scope name.", + "type": "string", + "minLength": 1 + }, + "singleton": { + "description": "Allow only a single version of the shared module in share scope (disabled by default).", + "type": "boolean" + }, + "strictVersion": { + "description": "Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).", + "type": "boolean" + } + } + }, + "ConsumesItem": { + "description": "A module that should be consumed from share scope.", + "type": "string", + "minLength": 1 + }, + "ConsumesObject": { + "description": "Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.", + "type": "object", + "additionalProperties": { + "description": "Modules that should be consumed from share scope.", + "anyOf": [ + { + "$ref": "#/definitions/ConsumesConfig" + }, + { + "$ref": "#/definitions/ConsumesItem" + } + ] + } + } + }, + "title": "ConsumeSharedPluginOptions", + "description": "Options for consuming shared modules.", + "type": "object", + "additionalProperties": false, + "properties": { + "consumes": { + "$ref": "#/definitions/Consumes" + }, + "shareScope": { + "description": "Share scope name used for all consumed modules (defaults to 'default').", + "type": "string", + "minLength": 1 + } + }, + "required": ["consumes"] +} diff --git a/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.ts b/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.ts new file mode 100644 index 00000000000..26670eb044c --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/ConsumeSharedPlugin.ts @@ -0,0 +1,138 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + +export default { + definitions: { + Consumes: { + description: + 'Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.', + anyOf: [ + { + type: 'array', + items: { + description: 'Modules that should be consumed from share scope.', + anyOf: [ + { + $ref: '#/definitions/ConsumesItem', + }, + { + $ref: '#/definitions/ConsumesObject', + }, + ], + }, + }, + { + $ref: '#/definitions/ConsumesObject', + }, + ], + }, + ConsumesConfig: { + description: + 'Advanced configuration for modules that should be consumed from share scope.', + type: 'object', + additionalProperties: false, + properties: { + eager: { + description: + 'Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.', + type: 'boolean', + }, + import: { + description: + 'Fallback module if no shared module is found in share scope. Defaults to the property name.', + anyOf: [ + { + description: 'No fallback module.', + enum: [false], + }, + { + $ref: '#/definitions/ConsumesItem', + }, + ], + }, + packageName: { + description: + "Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.", + type: 'string', + minLength: 1, + }, + requiredVersion: { + description: 'Version requirement from module in share scope.', + anyOf: [ + { + description: 'No version requirement check.', + enum: [false], + }, + { + description: + "Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.", + type: 'string', + }, + ], + }, + shareKey: { + description: + 'Module is looked up under this key from the share scope.', + type: 'string', + minLength: 1, + }, + shareScope: { + description: 'Share scope name.', + type: 'string', + minLength: 1, + }, + singleton: { + description: + 'Allow only a single version of the shared module in share scope (disabled by default).', + type: 'boolean', + }, + strictVersion: { + description: + 'Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).', + type: 'boolean', + }, + }, + }, + ConsumesItem: { + description: 'A module that should be consumed from share scope.', + type: 'string', + minLength: 1, + }, + ConsumesObject: { + description: + 'Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.', + type: 'object', + additionalProperties: { + description: 'Modules that should be consumed from share scope.', + anyOf: [ + { + $ref: '#/definitions/ConsumesConfig', + }, + { + $ref: '#/definitions/ConsumesItem', + }, + ], + }, + }, + }, + title: 'ConsumeSharedPluginOptions', + description: 'Options for consuming shared modules.', + type: 'object', + additionalProperties: false, + properties: { + consumes: { + $ref: '#/definitions/Consumes', + }, + shareScope: { + description: + "Share scope name used for all consumed modules (defaults to 'default').", + type: 'string', + minLength: 1, + }, + }, + required: ['consumes'], +} as const; diff --git a/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts new file mode 100644 index 00000000000..0107b2955cb --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.check.ts @@ -0,0 +1,290 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +export const validate = n; +export default n; +const r = { + type: 'object', + additionalProperties: !1, + properties: { + eager: { type: 'boolean' }, + shareKey: { type: 'string', minLength: 1 }, + shareScope: { type: 'string', minLength: 1 }, + version: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + }, +}; +function e( + t, + { + instancePath: n = '', + parentData: s, + parentDataProperty: a, + rootData: o = t, + } = {}, +) { + let l = null, + i = 0; + if (0 === i) { + if (!t || 'object' != typeof t || Array.isArray(t)) + return (e.errors = [{ params: { type: 'object' } }]), !1; + for (const n in t) { + let s = t[n]; + const a = i, + o = i; + let u = !1; + const h = i; + if (i == i) + if (s && 'object' == typeof s && !Array.isArray(s)) { + const e = i; + for (const r in s) + if ( + 'eager' !== r && + 'shareKey' !== r && + 'shareScope' !== r && + 'version' !== r + ) { + const e = { params: { additionalProperty: r } }; + null === l ? (l = [e]) : l.push(e), i++; + break; + } + if (e === i) { + if (void 0 !== s.eager) { + const r = i; + if ('boolean' != typeof s.eager) { + const r = { params: { type: 'boolean' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + var p = r === i; + } else p = !0; + if (p) { + if (void 0 !== s.shareKey) { + let r = s.shareKey; + const e = i; + if (i === e) + if ('string' == typeof r) { + if (r.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; + } + } else { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + p = e === i; + } else p = !0; + if (p) { + if (void 0 !== s.shareScope) { + let r = s.shareScope; + const e = i; + if (i === e) + if ('string' == typeof r) { + if (r.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; + } + } else { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + p = e === i; + } else p = !0; + if (p) + if (void 0 !== s.version) { + let e = s.version; + const t = i, + n = i; + let a = !1; + const o = i; + if (!1 !== e) { + const e = { + params: { + allowedValues: r.properties.version.anyOf[0].enum, + }, + }; + null === l ? (l = [e]) : l.push(e), i++; + } + var c = o === i; + if (((a = a || c), !a)) { + const r = i; + if ('string' != typeof e) { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + (c = r === i), (a = a || c); + } + if (a) + (i = n), null !== l && (n ? (l.length = n) : (l = null)); + else { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; + } + p = t === i; + } else p = !0; + } + } + } + } else { + const r = { params: { type: 'object' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + var f = h === i; + if (((u = u || f), !u)) { + const r = i; + if (i == i) + if ('string' == typeof s) { + if (s.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; + } + } else { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + (f = r === i), (u = u || f); + } + if (!u) { + const r = { params: {} }; + return null === l ? (l = [r]) : l.push(r), i++, (e.errors = l), !1; + } + if (((i = o), null !== l && (o ? (l.length = o) : (l = null)), a !== i)) + break; + } + } + return (e.errors = l), 0 === i; +} +function t( + r, + { + instancePath: n = '', + parentData: s, + parentDataProperty: a, + rootData: o = r, + } = {}, +) { + let l = null, + i = 0; + const p = i; + let c = !1; + const f = i; + if (i === f) + if (Array.isArray(r)) { + const t = r.length; + for (let s = 0; s < t; s++) { + let t = r[s]; + const a = i, + p = i; + let c = !1; + const f = i; + if (i == i) + if ('string' == typeof t) { + if (t.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; + } + } else { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + var u = f === i; + if (((c = c || u), !c)) { + const a = i; + e(t, { + instancePath: n + '/' + s, + parentData: r, + parentDataProperty: s, + rootData: o, + }) || + ((l = null === l ? e.errors : l.concat(e.errors)), (i = l.length)), + (u = a === i), + (c = c || u); + } + if (c) (i = p), null !== l && (p ? (l.length = p) : (l = null)); + else { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), i++; + } + if (a !== i) break; + } + } else { + const r = { params: { type: 'array' } }; + null === l ? (l = [r]) : l.push(r), i++; + } + var h = f === i; + if (((c = c || h), !c)) { + const t = i; + e(r, { + instancePath: n, + parentData: s, + parentDataProperty: a, + rootData: o, + }) || ((l = null === l ? e.errors : l.concat(e.errors)), (i = l.length)), + (h = t === i), + (c = c || h); + } + if (!c) { + const r = { params: {} }; + return null === l ? (l = [r]) : l.push(r), i++, (t.errors = l), !1; + } + return ( + (i = p), + null !== l && (p ? (l.length = p) : (l = null)), + (t.errors = l), + 0 === i + ); +} +function n( + r, + { + instancePath: e = '', + parentData: s, + parentDataProperty: a, + rootData: o = r, + } = {}, +) { + let l = null, + i = 0; + if (0 === i) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (n.errors = [{ params: { type: 'object' } }]), !1; + { + let s; + if (void 0 === r.provides && (s = 'provides')) + return (n.errors = [{ params: { missingProperty: s } }]), !1; + { + const s = i; + for (const e in r) + if ('provides' !== e && 'shareScope' !== e) + return (n.errors = [{ params: { additionalProperty: e } }]), !1; + if (s === i) { + if (void 0 !== r.provides) { + const n = i; + t(r.provides, { + instancePath: e + '/provides', + parentData: r, + parentDataProperty: 'provides', + rootData: o, + }) || + ((l = null === l ? t.errors : l.concat(t.errors)), + (i = l.length)); + var p = n === i; + } else p = !0; + if (p) + if (void 0 !== r.shareScope) { + let e = r.shareScope; + const t = i; + if (i === t) { + if ('string' != typeof e) + return (n.errors = [{ params: { type: 'string' } }]), !1; + if (e.length < 1) return (n.errors = [{ params: {} }]), !1; + } + p = t === i; + } else p = !0; + } + } + } + } + return (n.errors = l), 0 === i; +} diff --git a/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.json b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.json new file mode 100644 index 00000000000..3dead87f036 --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.json @@ -0,0 +1,94 @@ +{ + "definitions": { + "Provides": { + "description": "Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Modules that should be provided as shared modules to the share scope.", + "anyOf": [ + { + "$ref": "#/definitions/ProvidesItem" + }, + { + "$ref": "#/definitions/ProvidesObject" + } + ] + } + }, + { + "$ref": "#/definitions/ProvidesObject" + } + ] + }, + "ProvidesConfig": { + "description": "Advanced configuration for modules that should be provided as shared modules to the share scope.", + "type": "object", + "additionalProperties": false, + "properties": { + "eager": { + "description": "Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.", + "type": "boolean" + }, + "shareKey": { + "description": "Key in the share scope under which the shared modules should be stored.", + "type": "string", + "minLength": 1 + }, + "shareScope": { + "description": "Share scope name.", + "type": "string", + "minLength": 1 + }, + "version": { + "description": "Version of the provided module. Will replace lower matching versions, but not higher.", + "anyOf": [ + { + "description": "Don't provide a version.", + "enum": [false] + }, + { + "description": "Version as string. Each part of the version should be separated by a dot '.'.", + "type": "string" + } + ] + } + } + }, + "ProvidesItem": { + "description": "Request to a module that should be provided as shared module to the share scope (will be resolved when relative).", + "type": "string", + "minLength": 1 + }, + "ProvidesObject": { + "description": "Modules that should be provided as shared modules to the share scope. Property names are used as share keys.", + "type": "object", + "additionalProperties": { + "description": "Modules that should be provided as shared modules to the share scope.", + "anyOf": [ + { + "$ref": "#/definitions/ProvidesConfig" + }, + { + "$ref": "#/definitions/ProvidesItem" + } + ] + } + } + }, + "title": "ProvideSharedPluginOptions", + "type": "object", + "additionalProperties": false, + "properties": { + "provides": { + "$ref": "#/definitions/Provides" + }, + "shareScope": { + "description": "Share scope name used for all provided modules (defaults to 'default').", + "type": "string", + "minLength": 1 + } + }, + "required": ["provides"] +} diff --git a/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.ts b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.ts new file mode 100644 index 00000000000..aef404bd6dc --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/ProvideSharedPlugin.ts @@ -0,0 +1,112 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + +export default { + definitions: { + Provides: { + description: + 'Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.', + anyOf: [ + { + type: 'array', + items: { + description: + 'Modules that should be provided as shared modules to the share scope.', + anyOf: [ + { + $ref: '#/definitions/ProvidesItem', + }, + { + $ref: '#/definitions/ProvidesObject', + }, + ], + }, + }, + { + $ref: '#/definitions/ProvidesObject', + }, + ], + }, + ProvidesConfig: { + description: + 'Advanced configuration for modules that should be provided as shared modules to the share scope.', + type: 'object', + additionalProperties: false, + properties: { + eager: { + description: + 'Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.', + type: 'boolean', + }, + shareKey: { + description: + 'Key in the share scope under which the shared modules should be stored.', + type: 'string', + minLength: 1, + }, + shareScope: { + description: 'Share scope name.', + type: 'string', + minLength: 1, + }, + version: { + description: + 'Version of the provided module. Will replace lower matching versions, but not higher.', + anyOf: [ + { + description: "Don't provide a version.", + enum: [false], + }, + { + description: + "Version as string. Each part of the version should be separated by a dot '.'.", + type: 'string', + }, + ], + }, + }, + }, + ProvidesItem: { + description: + 'Request to a module that should be provided as shared module to the share scope (will be resolved when relative).', + type: 'string', + minLength: 1, + }, + ProvidesObject: { + description: + 'Modules that should be provided as shared modules to the share scope. Property names are used as share keys.', + type: 'object', + additionalProperties: { + description: + 'Modules that should be provided as shared modules to the share scope.', + anyOf: [ + { + $ref: '#/definitions/ProvidesConfig', + }, + { + $ref: '#/definitions/ProvidesItem', + }, + ], + }, + }, + }, + title: 'ProvideSharedPluginOptions', + type: 'object', + additionalProperties: false, + properties: { + provides: { + $ref: '#/definitions/Provides', + }, + shareScope: { + description: + "Share scope name used for all provided modules (defaults to 'default').", + type: 'string', + minLength: 1, + }, + }, + required: ['provides'], +} as const; diff --git a/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts b/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts new file mode 100644 index 00000000000..0365f4a27cc --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/SharePlugin.check.ts @@ -0,0 +1,410 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +export const validate = s; +export default s; +const r = { + type: 'object', + additionalProperties: !1, + properties: { + eager: { type: 'boolean' }, + import: { anyOf: [{ enum: [!1] }, { $ref: '#/definitions/SharedItem' }] }, + packageName: { type: 'string', minLength: 1 }, + requiredVersion: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + shareKey: { type: 'string', minLength: 1 }, + shareScope: { type: 'string', minLength: 1 }, + singleton: { type: 'boolean' }, + strictVersion: { type: 'boolean' }, + version: { anyOf: [{ enum: [!1] }, { type: 'string' }] }, + }, + }, + e = Object.prototype.hasOwnProperty; +function t( + n, + { + instancePath: a = '', + parentData: s, + parentDataProperty: o, + rootData: i = n, + } = {}, +) { + let l = null, + p = 0; + if (0 === p) { + if (!n || 'object' != typeof n || Array.isArray(n)) + return (t.errors = [{ params: { type: 'object' } }]), !1; + { + const a = p; + for (const a in n) + if (!e.call(r.properties, a)) + return (t.errors = [{ params: { additionalProperty: a } }]), !1; + if (a === p) { + if (void 0 !== n.eager) { + const r = p; + if ('boolean' != typeof n.eager) + return (t.errors = [{ params: { type: 'boolean' } }]), !1; + var f = r === p; + } else f = !0; + if (f) { + if (void 0 !== n.import) { + let e = n.import; + const a = p, + s = p; + let o = !1; + const i = p; + if (!1 !== e) { + const e = { + params: { allowedValues: r.properties.import.anyOf[0].enum }, + }; + null === l ? (l = [e]) : l.push(e), p++; + } + var u = i === p; + if (((o = o || u), !o)) { + const r = p; + if (p == p) + if ('string' == typeof e) { + if (e.length < 1) { + const r = { params: {} }; + null === l ? (l = [r]) : l.push(r), p++; + } + } else { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), p++; + } + (u = r === p), (o = o || u); + } + if (!o) { + const r = { params: {} }; + return ( + null === l ? (l = [r]) : l.push(r), p++, (t.errors = l), !1 + ); + } + (p = s), + null !== l && (s ? (l.length = s) : (l = null)), + (f = a === p); + } else f = !0; + if (f) { + if (void 0 !== n.packageName) { + let r = n.packageName; + const e = p; + if (p === e) { + if ('string' != typeof r) + return (t.errors = [{ params: { type: 'string' } }]), !1; + if (r.length < 1) return (t.errors = [{ params: {} }]), !1; + } + f = e === p; + } else f = !0; + if (f) { + if (void 0 !== n.requiredVersion) { + let e = n.requiredVersion; + const a = p, + s = p; + let o = !1; + const i = p; + if (!1 !== e) { + const e = { + params: { + allowedValues: r.properties.requiredVersion.anyOf[0].enum, + }, + }; + null === l ? (l = [e]) : l.push(e), p++; + } + var c = i === p; + if (((o = o || c), !o)) { + const r = p; + if ('string' != typeof e) { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), p++; + } + (c = r === p), (o = o || c); + } + if (!o) { + const r = { params: {} }; + return ( + null === l ? (l = [r]) : l.push(r), p++, (t.errors = l), !1 + ); + } + (p = s), + null !== l && (s ? (l.length = s) : (l = null)), + (f = a === p); + } else f = !0; + if (f) { + if (void 0 !== n.shareKey) { + let r = n.shareKey; + const e = p; + if (p === e) { + if ('string' != typeof r) + return (t.errors = [{ params: { type: 'string' } }]), !1; + if (r.length < 1) return (t.errors = [{ params: {} }]), !1; + } + f = e === p; + } else f = !0; + if (f) { + if (void 0 !== n.shareScope) { + let r = n.shareScope; + const e = p; + if (p === e) { + if ('string' != typeof r) + return ( + (t.errors = [{ params: { type: 'string' } }]), !1 + ); + if (r.length < 1) + return (t.errors = [{ params: {} }]), !1; + } + f = e === p; + } else f = !0; + if (f) { + if (void 0 !== n.singleton) { + const r = p; + if ('boolean' != typeof n.singleton) + return ( + (t.errors = [{ params: { type: 'boolean' } }]), !1 + ); + f = r === p; + } else f = !0; + if (f) { + if (void 0 !== n.strictVersion) { + const r = p; + if ('boolean' != typeof n.strictVersion) + return ( + (t.errors = [{ params: { type: 'boolean' } }]), !1 + ); + f = r === p; + } else f = !0; + if (f) + if (void 0 !== n.version) { + let e = n.version; + const a = p, + s = p; + let o = !1; + const i = p; + if (!1 !== e) { + const e = { + params: { + allowedValues: + r.properties.version.anyOf[0].enum, + }, + }; + null === l ? (l = [e]) : l.push(e), p++; + } + var y = i === p; + if (((o = o || y), !o)) { + const r = p; + if ('string' != typeof e) { + const r = { params: { type: 'string' } }; + null === l ? (l = [r]) : l.push(r), p++; + } + (y = r === p), (o = o || y); + } + if (!o) { + const r = { params: {} }; + return ( + null === l ? (l = [r]) : l.push(r), + p++, + (t.errors = l), + !1 + ); + } + (p = s), + null !== l && (s ? (l.length = s) : (l = null)), + (f = a === p); + } else f = !0; + } + } + } + } + } + } + } + } + } + } + return (t.errors = l), 0 === p; +} +function n( + r, + { + instancePath: e = '', + parentData: a, + parentDataProperty: s, + rootData: o = r, + } = {}, +) { + let i = null, + l = 0; + if (0 === l) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (n.errors = [{ params: { type: 'object' } }]), !1; + for (const a in r) { + let s = r[a]; + const f = l, + u = l; + let c = !1; + const y = l; + t(s, { + instancePath: e + '/' + a.replace(/~/g, '~0').replace(/\//g, '~1'), + parentData: r, + parentDataProperty: a, + rootData: o, + }) || ((i = null === i ? t.errors : i.concat(t.errors)), (l = i.length)); + var p = y === l; + if (((c = c || p), !c)) { + const r = l; + if (l == l) + if ('string' == typeof s) { + if (s.length < 1) { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + } else { + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + (p = r === l), (c = c || p); + } + if (!c) { + const r = { params: {} }; + return null === i ? (i = [r]) : i.push(r), l++, (n.errors = i), !1; + } + if (((l = u), null !== i && (u ? (i.length = u) : (i = null)), f !== l)) + break; + } + } + return (n.errors = i), 0 === l; +} +function a( + r, + { + instancePath: e = '', + parentData: t, + parentDataProperty: s, + rootData: o = r, + } = {}, +) { + let i = null, + l = 0; + const p = l; + let f = !1; + const u = l; + if (l === u) + if (Array.isArray(r)) { + const t = r.length; + for (let a = 0; a < t; a++) { + let t = r[a]; + const s = l, + p = l; + let f = !1; + const u = l; + if (l == l) + if ('string' == typeof t) { + if (t.length < 1) { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + } else { + const r = { params: { type: 'string' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + var c = u === l; + if (((f = f || c), !f)) { + const s = l; + n(t, { + instancePath: e + '/' + a, + parentData: r, + parentDataProperty: a, + rootData: o, + }) || + ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), + (c = s === l), + (f = f || c); + } + if (f) (l = p), null !== i && (p ? (i.length = p) : (i = null)); + else { + const r = { params: {} }; + null === i ? (i = [r]) : i.push(r), l++; + } + if (s !== l) break; + } + } else { + const r = { params: { type: 'array' } }; + null === i ? (i = [r]) : i.push(r), l++; + } + var y = u === l; + if (((f = f || y), !f)) { + const a = l; + n(r, { + instancePath: e, + parentData: t, + parentDataProperty: s, + rootData: o, + }) || ((i = null === i ? n.errors : i.concat(n.errors)), (l = i.length)), + (y = a === l), + (f = f || y); + } + if (!f) { + const r = { params: {} }; + return null === i ? (i = [r]) : i.push(r), l++, (a.errors = i), !1; + } + return ( + (l = p), + null !== i && (p ? (i.length = p) : (i = null)), + (a.errors = i), + 0 === l + ); +} +function s( + r, + { + instancePath: e = '', + parentData: t, + parentDataProperty: n, + rootData: o = r, + } = {}, +) { + let i = null, + l = 0; + if (0 === l) { + if (!r || 'object' != typeof r || Array.isArray(r)) + return (s.errors = [{ params: { type: 'object' } }]), !1; + { + let t; + if (void 0 === r.shared && (t = 'shared')) + return (s.errors = [{ params: { missingProperty: t } }]), !1; + { + const t = l; + for (const e in r) + if ('shareScope' !== e && 'shared' !== e) + return (s.errors = [{ params: { additionalProperty: e } }]), !1; + if (t === l) { + if (void 0 !== r.shareScope) { + let e = r.shareScope; + const t = l; + if (l === t) { + if ('string' != typeof e) + return (s.errors = [{ params: { type: 'string' } }]), !1; + if (e.length < 1) return (s.errors = [{ params: {} }]), !1; + } + var p = t === l; + } else p = !0; + if (p) + if (void 0 !== r.shared) { + const t = l; + a(r.shared, { + instancePath: e + '/shared', + parentData: r, + parentDataProperty: 'shared', + rootData: o, + }) || + ((i = null === i ? a.errors : i.concat(a.errors)), + (l = i.length)), + (p = t === l); + } else p = !0; + } + } + } + } + return (s.errors = i), 0 === l; +} diff --git a/packages/enhanced/src/schemas/sharing/SharePlugin.json b/packages/enhanced/src/schemas/sharing/SharePlugin.json new file mode 100644 index 00000000000..fd99c276b2c --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/SharePlugin.json @@ -0,0 +1,133 @@ +{ + "definitions": { + "Shared": { + "description": "Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.", + "anyOf": [ + { + "type": "array", + "items": { + "description": "Modules that should be shared in the share scope.", + "anyOf": [ + { + "$ref": "#/definitions/SharedItem" + }, + { + "$ref": "#/definitions/SharedObject" + } + ] + } + }, + { + "$ref": "#/definitions/SharedObject" + } + ] + }, + "SharedConfig": { + "description": "Advanced configuration for modules that should be shared in the share scope.", + "type": "object", + "additionalProperties": false, + "properties": { + "eager": { + "description": "Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.", + "type": "boolean" + }, + "import": { + "description": "Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.", + "anyOf": [ + { + "description": "No provided or fallback module.", + "enum": [false] + }, + { + "$ref": "#/definitions/SharedItem" + } + ] + }, + "packageName": { + "description": "Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.", + "type": "string", + "minLength": 1 + }, + "requiredVersion": { + "description": "Version requirement from module in share scope.", + "anyOf": [ + { + "description": "No version requirement check.", + "enum": [false] + }, + { + "description": "Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.", + "type": "string" + } + ] + }, + "shareKey": { + "description": "Module is looked up under this key from the share scope.", + "type": "string", + "minLength": 1 + }, + "shareScope": { + "description": "Share scope name.", + "type": "string", + "minLength": 1 + }, + "singleton": { + "description": "Allow only a single version of the shared module in share scope (disabled by default).", + "type": "boolean" + }, + "strictVersion": { + "description": "Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).", + "type": "boolean" + }, + "version": { + "description": "Version of the provided module. Will replace lower matching versions, but not higher.", + "anyOf": [ + { + "description": "Don't provide a version.", + "enum": [false] + }, + { + "description": "Version as string. Each part of the version should be separated by a dot '.'.", + "type": "string" + } + ] + } + } + }, + "SharedItem": { + "description": "A module that should be shared in the share scope.", + "type": "string", + "minLength": 1 + }, + "SharedObject": { + "description": "Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.", + "type": "object", + "additionalProperties": { + "description": "Modules that should be shared in the share scope.", + "anyOf": [ + { + "$ref": "#/definitions/SharedConfig" + }, + { + "$ref": "#/definitions/SharedItem" + } + ] + } + } + }, + "title": "SharePluginOptions", + "description": "Options for shared modules.", + "type": "object", + "additionalProperties": false, + "properties": { + "shareScope": { + "description": "Share scope name used for all shared modules (defaults to 'default').", + "type": "string", + "minLength": 1 + }, + "shared": { + "$ref": "#/definitions/Shared" + } + }, + "required": ["shared"] +} diff --git a/packages/enhanced/src/schemas/sharing/SharePlugin.ts b/packages/enhanced/src/schemas/sharing/SharePlugin.ts new file mode 100644 index 00000000000..fd65a33532e --- /dev/null +++ b/packages/enhanced/src/schemas/sharing/SharePlugin.ts @@ -0,0 +1,153 @@ +// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + +export default { + definitions: { + Shared: { + description: + 'Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.', + anyOf: [ + { + type: 'array', + items: { + description: 'Modules that should be shared in the share scope.', + anyOf: [ + { + $ref: '#/definitions/SharedItem', + }, + { + $ref: '#/definitions/SharedObject', + }, + ], + }, + }, + { + $ref: '#/definitions/SharedObject', + }, + ], + }, + SharedConfig: { + description: + 'Advanced configuration for modules that should be shared in the share scope.', + type: 'object', + additionalProperties: false, + properties: { + eager: { + description: + 'Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.', + type: 'boolean', + }, + import: { + description: + "Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.", + anyOf: [ + { + description: 'No provided or fallback module.', + enum: [false], + }, + { + $ref: '#/definitions/SharedItem', + }, + ], + }, + packageName: { + description: + "Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.", + type: 'string', + minLength: 1, + }, + requiredVersion: { + description: 'Version requirement from module in share scope.', + anyOf: [ + { + description: 'No version requirement check.', + enum: [false], + }, + { + description: + "Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.", + type: 'string', + }, + ], + }, + shareKey: { + description: + 'Module is looked up under this key from the share scope.', + type: 'string', + minLength: 1, + }, + shareScope: { + description: 'Share scope name.', + type: 'string', + minLength: 1, + }, + singleton: { + description: + 'Allow only a single version of the shared module in share scope (disabled by default).', + type: 'boolean', + }, + strictVersion: { + description: + 'Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).', + type: 'boolean', + }, + version: { + description: + 'Version of the provided module. Will replace lower matching versions, but not higher.', + anyOf: [ + { + description: "Don't provide a version.", + enum: [false], + }, + { + description: + "Version as string. Each part of the version should be separated by a dot '.'.", + type: 'string', + }, + ], + }, + }, + }, + SharedItem: { + description: 'A module that should be shared in the share scope.', + type: 'string', + minLength: 1, + }, + SharedObject: { + description: + 'Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.', + type: 'object', + additionalProperties: { + description: 'Modules that should be shared in the share scope.', + anyOf: [ + { + $ref: '#/definitions/SharedConfig', + }, + { + $ref: '#/definitions/SharedItem', + }, + ], + }, + }, + }, + title: 'SharePluginOptions', + description: 'Options for shared modules.', + type: 'object', + additionalProperties: false, + properties: { + shareScope: { + description: + "Share scope name used for all shared modules (defaults to 'default').", + type: 'string', + minLength: 1, + }, + shared: { + $ref: '#/definitions/Shared', + }, + }, + required: ['shared'], +} as const; diff --git a/packages/enhanced/src/scripts/compile-schema.js b/packages/enhanced/src/scripts/compile-schema.js new file mode 100755 index 00000000000..c0cecbf335a --- /dev/null +++ b/packages/enhanced/src/scripts/compile-schema.js @@ -0,0 +1,184 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const { pathToFileURL, fileURLToPath } = require('url'); +const Ajv = require('ajv'); +const { _, Name } = require('ajv/dist/compile/codegen'); +const standaloneCode = require('ajv/dist/standalone').default; +const terser = require('terser'); +const glob = require('fast-glob'); + +// Create Ajv instance factory to avoid ID conflicts +const createAjv = () => + new Ajv({ + code: { + source: true, + optimize: true, + lines: true, + esm: true, + formats: false, + }, + uriResolver: undefined, + unicodeRegExp: false, + messages: false, + strictNumbers: false, + logger: false, + loadSchema: async (uri) => { + const loadedSchemaPath = fileURLToPath(uri); + const schema = require(loadedSchemaPath); + const processedSchema = processJson(schema); + processedSchema.$id = uri; + return processedSchema; + }, + }); + +// Add custom keywords factory +const addCustomKeywords = (ajv) => { + // Remove any existing keywords that might use runtime dependencies + ajv.removeKeyword('minLength'); + + ajv.addKeyword({ + keyword: 'minLength', + type: 'string', + schemaType: 'number', + code(ctx) { + const { data, schema } = ctx; + ctx.fail(_`${data}.length < ${schema}`); + }, + }); + + ajv.addKeyword({ + keyword: 'absolutePath', + type: 'string', + schemaType: 'boolean', + code(ctx) { + const { data, schema } = ctx; + ctx.fail( + _`${data}.includes("!") || (absolutePathRegExp.test(${data}) !== ${schema})`, + ); + }, + }); + return ajv; +}; + +const EXCLUDED_PROPERTIES = [ + 'title', + 'description', + 'cli', + 'implements', + 'tsType', +]; + +const processJson = (json) => { + if (json === null || typeof json !== 'object') return json; + if (Array.isArray(json)) return json.map(processJson); + const result = {}; + for (const key of Object.keys(json)) { + if (!EXCLUDED_PROPERTIES.includes(key)) { + result[key] = processJson(json[key]); + } + } + return result; +}; + +const postprocessValidation = async (code) => { + // Add hoisted values + if (/absolutePathRegExp/.test(code)) { + code = `const absolutePathRegExp = /^(?:[A-Za-z]:[\\\\/]|\\\\\\\\|\\/)/;${code}`; + } + + // Remove unnecessary error code + code = code + .replace(/\{instancePath[^{}]+,keyword:[^{}]+,/g, '{') + .replace(/"\$id":".+?"/, ''); + + // Convert to ESM + code = code.replace( + /^(?:module\.)?exports\s*=\s*([^;]+)/m, + 'const a = $1;\nexport const validate = a;\nexport default a;', + ); + + // Minimize + code = ( + await terser.minify(code, { + compress: { passes: 3 }, + mangle: true, + ecma: 2015, + module: true, + }) + ).code; + + return `// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ +${code}`; +}; + +const generateSchemaFile = (schema, outputPath) => { + const schemaContent = `// @ts-nocheck +/* eslint-disable */ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + */ + +export default ${JSON.stringify(schema, null, 2)} as const; +`; + + fs.writeFileSync(outputPath, schemaContent, 'utf-8'); +}; + +async function compileSchema(inputPath) { + try { + const schema = require(inputPath); + const processedSchema = processJson(schema); + processedSchema.$id = pathToFileURL(inputPath).href; + + // Create new Ajv instance for each schema + const ajv = addCustomKeywords(createAjv()); + const validate = await ajv.compileAsync(processedSchema); + const code = await postprocessValidation(standaloneCode(ajv, validate)); + + // Generate both files + const baseDir = path.dirname(inputPath); + const baseName = path.basename(inputPath, '.json'); + + // Generate validation file (.check.ts) + const validationPath = path.join(baseDir, `${baseName}.check.ts`); + fs.writeFileSync(validationPath, code, 'utf-8'); + + // Generate schema file (.ts) + const tsPath = path.join(baseDir, `${baseName}.ts`); + generateSchemaFile(schema, tsPath); + + console.log(`Successfully generated for ${baseName}: +- ${validationPath} (validation) +- ${tsPath} (schema)`); + } catch (err) { + console.error(`Error compiling schema ${inputPath}:`, err); + process.exit(1); + } +} + +async function main() { + const schemasDir = path.resolve(__dirname, '../schemas'); + const jsonFiles = await glob('**/*.json', { + cwd: schemasDir, + absolute: true, + }); + + console.log(`Found ${jsonFiles.length} schema files to process...`); + + for (const jsonFile of jsonFiles) { + await compileSchema(jsonFile); + } +} + +main().catch((err) => { + console.error('Error processing schemas:', err); + process.exit(1); +}); diff --git a/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts b/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts index 70105e26ac5..eb707849579 100644 --- a/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts +++ b/packages/sdk/src/types/plugins/ModuleFederationPlugin.ts @@ -232,7 +232,6 @@ export interface ModuleFederationPluginOptions { manifest?: boolean | PluginManifestOptions; dev?: boolean | PluginDevOptions; dts?: boolean | PluginDtsOptions; - async?: boolean | AsyncBoundaryOptions; dataPrefetch?: DataPrefetch; virtualRuntimeEntry?: boolean; experiments?: { @@ -248,6 +247,10 @@ export interface ModuleFederationPluginOptions { */ disableAlias?: boolean; }; + /** + * Configuration for async boundary plugin + */ + async?: boolean | AsyncBoundaryOptions; } /** * Modules that should be exposed by this container. Property names are used as public paths. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0f967699b64..56a454f182b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2225,9 +2225,15 @@ importers: '@types/btoa': specifier: ^1.2.5 version: 1.2.5 + ajv: + specifier: ^8.17.1 + version: 8.17.1 enhanced-resolve: specifier: ^5.0.0 version: 5.17.1 + terser: + specifier: ^5.37.0 + version: 5.37.0 packages/error-codes: {}