@softarc/native-federation-orchestrator 4.2.2 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/fesm2022/@softarc/native-federation-orchestrator.mjs +905 -922
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +4 -4
- package/fesm2022/audit.mjs +2 -2
- package/fesm2022/audit.mjs.map +2 -2
- package/fesm2022/node.mjs +444 -456
- package/fesm2022/node.mjs.map +4 -4
- package/fesm2022/options.mjs +17 -15
- package/fesm2022/options.mjs.map +3 -3
- package/fesm2022/registry.mjs +2 -2
- package/fesm2022/registry.mjs.map +3 -3
- package/fesm2022/sdk.mjs +2 -2
- package/fesm2022/sdk.mjs.map +2 -2
- package/init-registry.mjs +1 -1
- package/node-loader/loader.mjs +1 -1
- package/node-loader/loader.mjs.map +1 -1
- package/package.json +2 -5
- package/quickstart.mjs +13 -13
- package/types/lib/audit/externals-audit.d.ts +4 -0
- package/types/lib/{2.app/driver-ports/audit → audit}/for-auditing-externals.port.d.ts +1 -1
- package/types/lib/audit.index.d.ts +2 -2
- package/types/lib/{2.app → core/2.app}/config/mode.contract.d.ts +1 -0
- package/types/lib/{2.app → core/2.app}/driver-ports/init/drivers.contract.d.ts +6 -0
- package/types/lib/core/2.app/driver-ports/init/flow.contract.d.ts +14 -0
- package/types/lib/{2.app/driver-ports/dynamic-init → core/2.app/driver-ports/init}/for-getting-remote-entry.port.d.ts +1 -1
- package/types/lib/{2.app → core/2.app}/driver-ports/init/index.d.ts +3 -0
- package/types/lib/{2.app → core/2.app}/driving-ports/for-remote-info-storage.port.d.ts +1 -1
- package/types/lib/{2.app → core/2.app}/driving-ports/for-scoped-externals-storage.port.d.ts +1 -1
- package/types/lib/{2.app → core/2.app}/driving-ports/for-shared-chunks-storage.port.d.ts +1 -1
- package/types/lib/{2.app → core/2.app}/driving-ports/for-shared-externals-storage.port.d.ts +1 -1
- package/types/lib/core/2.app/flows/init-remote-entry.flow.d.ts +4 -0
- package/types/lib/core/2.app/flows/init.flow.d.ts +4 -0
- package/types/lib/core/2.app/steps/commit-changes.d.ts +4 -0
- package/types/lib/core/2.app/steps/convert-to-import-map.d.ts +4 -0
- package/types/lib/core/2.app/steps/determine-shared-externals.d.ts +5 -0
- package/types/lib/core/2.app/steps/expose-module-loader.d.ts +4 -0
- package/types/lib/core/2.app/steps/generate-import-map.d.ts +5 -0
- package/types/lib/core/2.app/steps/get-remote-entries.d.ts +6 -0
- package/types/lib/core/2.app/steps/get-remote-entry.d.ts +5 -0
- package/types/lib/core/2.app/steps/process-remote-entries.d.ts +5 -0
- package/types/lib/core/2.app/steps/store-remote-entry.d.ts +23 -0
- package/types/lib/core/2.app/steps/update-cache.d.ts +5 -0
- package/types/lib/{3.adapters → core/3.adapters}/browser/sse-handler.d.ts +1 -1
- package/types/lib/{4.config → core/4.config}/import-map/trusted-types.d.ts +5 -1
- package/types/lib/core/5.di/federation-result.factory.d.ts +12 -0
- package/types/lib/core/5.di/init.factory.d.ts +12 -0
- package/types/lib/{init-federation.contract.d.ts → core/init-federation.contract.d.ts} +1 -1
- package/types/lib/index.d.ts +10 -8
- package/types/lib/{3.adapters/node → node/adapters}/fs-manifest-provider.d.ts +1 -1
- package/types/lib/{3.adapters/node → node/adapters}/fs-remote-entry-provider.d.ts +1 -1
- package/types/lib/{3.adapters/node → node/adapters}/node-loader.client.d.ts +1 -1
- package/types/lib/node/adapters/noop-sse.d.ts +3 -0
- package/types/lib/{init-federation.node.d.ts → node/init-federation.node.d.ts} +5 -5
- package/types/lib/{4.config/import-map → node}/resolve-host-instances.d.ts +3 -3
- package/types/lib/{4.config/import-map → node}/use-node.d.ts +2 -2
- package/types/lib/{utils/node → node/utils}/to-url.d.ts +1 -1
- package/types/lib/node.index.d.ts +5 -5
- package/types/lib/options.index.d.ts +5 -5
- package/types/lib/registry/for-managing-events.port.d.ts +2 -0
- package/types/lib/registry/setup-registry.d.ts +3 -0
- package/types/lib/registry.index.d.ts +5 -4
- package/types/lib/sdk.index.d.ts +4 -5
- package/types/lib/testing/handlers/log.handler.d.ts +3 -0
- package/types/lib/utils/clone-entry.d.ts +1 -1
- package/types/{init-registry.d.ts → scripts/init-registry.d.ts} +1 -1
- package/types/lib/1.domain/registry/index.d.ts +0 -2
- package/types/lib/2.app/driver-ports/audit/index.d.ts +0 -1
- package/types/lib/2.app/driver-ports/dynamic-init/drivers.contract.d.ts +0 -13
- package/types/lib/2.app/driver-ports/dynamic-init/flow.contract.d.ts +0 -8
- package/types/lib/2.app/driver-ports/dynamic-init/index.d.ts +0 -5
- package/types/lib/2.app/driver-ports/init/flow.contract.d.ts +0 -6
- package/types/lib/2.app/driver-ports/registry/for-managing-events.port.d.ts +0 -2
- package/types/lib/2.app/flows/audit/externals-audit.d.ts +0 -4
- package/types/lib/2.app/flows/dynamic-init/convert-to-import-map.d.ts +0 -4
- package/types/lib/2.app/flows/dynamic-init/get-remote-entry.d.ts +0 -5
- package/types/lib/2.app/flows/dynamic-init/update-cache.d.ts +0 -5
- package/types/lib/2.app/flows/init/commit-changes.d.ts +0 -4
- package/types/lib/2.app/flows/init/determine-shared-externals.d.ts +0 -5
- package/types/lib/2.app/flows/init/expose-module-loader.d.ts +0 -4
- package/types/lib/2.app/flows/init/generate-import-map.d.ts +0 -5
- package/types/lib/2.app/flows/init/get-remote-entries.d.ts +0 -6
- package/types/lib/2.app/flows/init/process-remote-entries.d.ts +0 -5
- package/types/lib/2.app/flows/registry/setup-registry.d.ts +0 -3
- package/types/lib/3.adapters/node/noop-sse.d.ts +0 -3
- package/types/lib/5.di/flows/dynamic-init.factory.d.ts +0 -14
- package/types/lib/5.di/flows/init.factory.d.ts +0 -14
- package/types/lib/6.mocks/handlers/log.handler.d.ts +0 -2
- /package/types/lib/{1.domain → core/1.domain}/externals/chunks.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/externals/external.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/externals/version.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/import-map/import-map.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/index.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/remote/remote-info.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/remote/remote-module.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/remote-entry/manifest.contract.d.ts +0 -0
- /package/types/lib/{1.domain → core/1.domain}/remote-entry/remote-entry.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/config/config.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/config/host.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/config/import-map.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/config/index.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/config/log.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/config/storage.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/flow-factory.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-committing-changes.port.d.ts +0 -0
- /package/types/lib/{2.app/driver-ports/dynamic-init → core/2.app/driver-ports/init}/for-converting-to-import-map.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-determining-shared-externals.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-exposing-module-loader.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-generating-import-map.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-getting-remote-entries.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-processing-remote-entries.port.d.ts +0 -0
- /package/types/lib/{2.app/driver-ports/dynamic-init → core/2.app/driver-ports/init}/for-updating-cache.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/driving.contract.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/for-browser-tasks.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/for-providing-manifest.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/for-providing-remote-entries.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/for-sse.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/for-version-checking.port.d.ts +0 -0
- /package/types/lib/{2.app → core/2.app}/driving-ports/index.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/browser/browser.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/checks/version.check.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/http/manifest-provider.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/http/remote-entry-provider.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/storage/chunk.repository.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/storage/remote-info.repository.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/storage/scoped-externals.repository.d.ts +0 -0
- /package/types/lib/{3.adapters → core/3.adapters}/storage/shared-externals.repository.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/host/host.config.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/import-map/import-map.config.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/import-map/index.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/import-map/replace-in-dom.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/import-map/use-default.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/import-map/use-import-shim.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/logging/console.logger.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/logging/index.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/logging/log.config.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/logging/log.handler.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/logging/noop.logger.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/mode/caching.profile.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/mode/default.profile.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/mode/index.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/mode/mode.config.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/storage/global-this.storage.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/storage/index.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/storage/local.storage.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/storage/session.storage.d.ts +0 -0
- /package/types/lib/{4.config → core/4.config}/storage/storage.config.d.ts +0 -0
- /package/types/lib/{5.di → core/5.di}/config.factory.d.ts +0 -0
- /package/types/lib/{5.di → core/5.di}/driving.factory.d.ts +0 -0
- /package/types/lib/{init-federation.d.ts → core/init-federation.d.ts} +0 -0
- /package/types/lib/{native-federation.error.d.ts → core/native-federation.error.d.ts} +0 -0
- /package/types/lib/{3.adapters/node → node/adapters}/loader-url.d.ts +0 -0
- /package/types/lib/{utils/node → node/utils}/read-source.d.ts +0 -0
- /package/types/lib/{1.domain/registry → registry}/event-registry.contract.d.ts +0 -0
- /package/types/lib/{1.domain/registry → registry}/event.contract.d.ts +0 -0
- /package/types/lib/{2.app/config → registry}/registry.contract.d.ts +0 -0
- /package/types/{node-loader.d.ts → scripts/node-loader.d.ts} +0 -0
- /package/types/{quickstart.d.ts → scripts/quickstart.d.ts} +0 -0
package/fesm2022/node.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/semver@7.8.
|
|
4
|
-
"sourcesContent": ["'use strict'\n\nconst debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n", "'use strict'\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n", "'use strict'\n\nconst {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n// Non-numeric identifiers include numeric identifiers but can be longer.\n// Therefore non-numeric identifiers must go first.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifier, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n", "'use strict'\n\n// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n", "'use strict'\n\nconst numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a < b ? -1 : 1\n }\n\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n", "'use strict'\n\nconst debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n if (this.major < other.major) {\n return -1\n }\n if (this.major > other.major) {\n return 1\n }\n if (this.minor < other.minor) {\n return -1\n }\n if (this.minor > other.minor) {\n return 1\n }\n if (this.patch < other.patch) {\n return -1\n }\n if (this.patch > other.patch) {\n return 1\n }\n return 0\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n", "'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n", "'use strict'\n\nconst parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n", "'use strict'\n\nclass LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n", "'use strict'\n\nconst SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n", "'use strict'\n\nconst compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n", "'use strict'\n\nconst compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n", "'use strict'\n\nconst compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n", "'use strict'\n\nconst compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n", "'use strict'\n\nconst compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n", "'use strict'\n\nconst compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n", "'use strict'\n\nconst eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n", "'use strict'\n\nconst ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n", "'use strict'\n\nconst SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // strip build metadata so it can't bleed into the version\n range = range.replace(BUILDSTRIPRE, '')\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n src,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\n// unbounded global build-metadata stripper used by parseRange\nconst BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n comp = comp.replace(re[t.BUILD], '')\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n", "'use strict'\n\nconst Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n", "'use strict'\n\nconst SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n", "'use strict'\n\nconst Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n", "import type { ForBrowserTasks } from 'lib/2.app/driving-ports/for-browser-tasks';\nimport type { ImportMapConfig } from 'lib/2.app/config/import-map.contract';\n\nconst createBrowser = (config: ImportMapConfig): ForBrowserTasks => {\n return {\n setImportMapFn: config.setImportMapFn,\n importModule: config.loadModuleFn,\n };\n};\n\nexport { createBrowser };\n", "import type { ForVersionChecking } from 'lib/2.app/driving-ports/for-version-checking.port';\nimport semverValid from 'semver/functions/valid';\nimport semverSatisfies from 'semver/functions/satisfies';\nimport semverCompare from 'semver/functions/compare';\nimport semverMinVersion from 'semver/ranges/min-version';\nimport semverValidRange from 'semver/ranges/valid';\n\nconst createVersionCheck = (): ForVersionChecking => {\n return {\n isValidSemver: function (version: string) {\n return semverValid(version) !== null;\n },\n isCompatible: function (version: string, range: string) {\n return semverSatisfies(version, range);\n },\n compare: function (versionA: string, versionB: string) {\n return semverCompare(versionA, versionB, true);\n },\n smallestVersion: function (versionRange: string) {\n if (!semverValidRange(versionRange)) return '0.0.0';\n const minVersion = semverMinVersion(versionRange);\n return minVersion?.raw ?? '0.0.0';\n },\n };\n};\n\nexport { createVersionCheck };\n", "class NFError extends Error {\n constructor(message: string, cause?: Error) {\n super(message, cause);\n this.name = 'NFError';\n }\n}\n\nexport { NFError };\n", "const SUPPORTED_ALGORITHMS = {\n 'sha256-': 'SHA-256',\n 'sha384-': 'SHA-384',\n 'sha512-': 'SHA-512',\n} as const;\n\ntype Prefix = keyof typeof SUPPORTED_ALGORITHMS;\n\nconst parseIntegrity = (integrity: string): { algorithm: string; expected: string } | null => {\n for (const prefix of Object.keys(SUPPORTED_ALGORITHMS) as Prefix[]) {\n if (integrity.startsWith(prefix)) {\n return { algorithm: SUPPORTED_ALGORITHMS[prefix], expected: integrity };\n }\n }\n return null;\n};\n\nconst toBase64 = (bytes: ArrayBuffer): string => {\n const view = new Uint8Array(bytes);\n let bin = '';\n for (let i = 0; i < view.length; i++) bin += String.fromCharCode(view[i]!);\n return btoa(bin);\n};\n\nexport const verifyIntegrity = async (bytes: ArrayBuffer, integrity: string): Promise<void> => {\n const parsed = parseIntegrity(integrity);\n if (!parsed) {\n throw new TypeError(\n `Unsupported integrity prefix in '${integrity}'. Expected sha256-, sha384-, or sha512-.`\n );\n }\n\n const subtle =\n typeof crypto !== 'undefined' && crypto.subtle ? crypto.subtle : undefined;\n if (!subtle) {\n throw new Error('SubtleCrypto is not available in this environment.');\n }\n\n const digest = await subtle.digest(parsed.algorithm, bytes);\n const actual =\n integrity.substring(0, integrity.indexOf('-') + 1) + toBase64(digest);\n\n if (actual !== parsed.expected) {\n throw new Error(`Integrity mismatch: expected ${parsed.expected}, got ${actual}`);\n }\n};\n", "import * as fs from 'node:fs/promises';\nimport { fileURLToPath } from 'node:url';\nimport { NFError } from 'lib/native-federation.error';\n\nconst isHttpUrl = (input: string): boolean =>\n input.startsWith('http://') || input.startsWith('https://');\n\nconst isFileUrl = (input: string): boolean => input.startsWith('file://');\n\nexport const readSourceBytes = async (input: string): Promise<ArrayBuffer> => {\n if (isHttpUrl(input)) {\n const response = await fetch(input);\n if (!response.ok) {\n throw new NFError(`${response.status} - ${response.statusText}`);\n }\n return response.arrayBuffer();\n }\n\n const path = isFileUrl(input) ? fileURLToPath(input) : input;\n const buffer = await fs.readFile(path);\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);\n};\n", "import type { FederationManifest } from 'lib/1.domain';\nimport type { ForProvidingManifest } from 'lib/2.app/driving-ports/for-providing-manifest.port';\nimport { NFError } from 'lib/native-federation.error';\nimport { verifyIntegrity } from 'lib/utils/integrity';\nimport { readSourceBytes } from 'lib/utils/node/read-source';\n\nconst createFsManifestProvider = (): ForProvidingManifest => {\n const formatError = (manifestUrl: string) => (err: unknown) => {\n if (err instanceof NFError) throw err;\n const msg = err instanceof Error ? err.message : String(err);\n throw new NFError(`Read of '${manifestUrl}' returned ${msg}`);\n };\n\n return {\n provide: async function (\n remotesOrManifestUrl: string | FederationManifest,\n opts: { integrity?: string } = {}\n ) {\n if (typeof remotesOrManifestUrl !== 'string') return remotesOrManifestUrl;\n\n try {\n const bytes = await readSourceBytes(remotesOrManifestUrl);\n if (opts.integrity) await verifyIntegrity(bytes, opts.integrity);\n return JSON.parse(new TextDecoder().decode(bytes)) as FederationManifest;\n } catch (err) {\n return formatError(remotesOrManifestUrl)(err);\n }\n },\n };\n};\n\nexport { createFsManifestProvider };\n", "import type { RemoteEntry } from 'lib/1.domain/remote-entry/remote-entry.contract';\nimport type { ForProvidingRemoteEntries } from 'lib/2.app/driving-ports/for-providing-remote-entries.port';\nimport { NFError } from 'lib/native-federation.error';\nimport { verifyIntegrity } from 'lib/utils/integrity';\nimport { readSourceBytes } from 'lib/utils/node/read-source';\n\nconst createFsRemoteEntryProvider = (): ForProvidingRemoteEntries => {\n const fillEmptyFields = (remoteEntryUrl: string) => (remoteEntry: RemoteEntry) => {\n if (!remoteEntry.exposes) remoteEntry.exposes = [];\n if (!remoteEntry.shared) remoteEntry.shared = [];\n if (!remoteEntry.url) remoteEntry.url = remoteEntryUrl;\n return remoteEntry;\n };\n\n const formatError = (remoteEntryUrl: string) => (err: unknown) => {\n if (err instanceof NFError) throw err;\n const msg = err instanceof Error ? err.message : String(err);\n throw new NFError(`Read of '${remoteEntryUrl}' returned ${msg}`);\n };\n\n return {\n provide: async function (remoteEntryUrl: string, opts: { integrity?: string } = {}) {\n try {\n const bytes = await readSourceBytes(remoteEntryUrl);\n if (opts.integrity) await verifyIntegrity(bytes, opts.integrity);\n const parsed = JSON.parse(new TextDecoder().decode(bytes)) as RemoteEntry;\n return fillEmptyFields(remoteEntryUrl)(parsed);\n } catch (err) {\n return formatError(remoteEntryUrl)(err);\n }\n },\n };\n};\n\nexport { createFsRemoteEntryProvider };\n", "import type { ForSSE } from 'lib/2.app/driving-ports/for-sse.port';\n\nconst createNoopSSE = (): ForSSE => ({\n watchRemoteBuilds: () => {\n /* no-op */\n },\n closeAll: () => {\n /* no-op */\n },\n});\n\nexport { createNoopSSE };\n", "function join(pathA: string, pathB: string): string {\n pathA = pathA.endsWith('/') ? pathA.slice(0, -1) : pathA;\n pathB = pathB.startsWith('/') ? pathB.slice(1) : pathB;\n return `${pathA}/${pathB}`;\n}\n\nfunction getScope(path: string) {\n if (!path) return '';\n\n const parts = path.split('/');\n\n if (parts[parts.length - 1] === '' || parts[parts.length - 1]!.includes('.')) {\n parts.pop();\n }\n if (parts.length < 1) return '';\n\n return `${parts.join('/')}/`;\n}\n\nexport { join, getScope };\n", "export class Optional<T> {\n private constructor(private item?: T) {}\n\n public static of<T>(item?: T): Optional<T> {\n return new Optional(item);\n }\n public static empty<U>(): Optional<U> {\n return Optional.of<U>(undefined);\n }\n\n public isPresent() {\n return typeof this.item !== 'undefined' && this.item !== null;\n }\n public set<U>(other: U) {\n return Optional.of(other);\n }\n\n public ifPresent(callback: (_: T) => void): void {\n if (this.isPresent()) callback(this.item as T);\n }\n\n public map<U>(callback: (_: NonNullable<T>) => U | Optional<U>): Optional<U> {\n if (!this.isPresent()) return Optional.empty();\n\n const result = callback(this.item as NonNullable<T>);\n return result instanceof Optional ? result : Optional.of(result);\n }\n\n public orElse(other: Required<T>): NonNullable<T> {\n return this.isPresent() ? (this.item as NonNullable<T>) : (other as NonNullable<T>);\n }\n\n public orThrow(error: Error | string | (() => Error)): NonNullable<T> {\n if (this.isPresent()) return this.item as NonNullable<T>;\n if (typeof error === 'function') throw error();\n throw typeof error === 'string' ? new Error(error) : error;\n }\n\n public get(): T | undefined {\n return this.item;\n }\n}\n", "import type { RemoteInfo, RemoteName, Remotes } from 'lib/1.domain';\nimport type { StorageConfig, StorageEntry } from 'lib/2.app/config/storage.contract';\nimport type { ForRemoteInfoStorage } from 'lib/2.app/driving-ports/for-remote-info-storage.port';\nimport * as _path from 'lib/utils/path';\nimport { Optional } from 'lib/utils/optional';\n\nconst createRemoteInfoRepository = (config: StorageConfig): ForRemoteInfoStorage => {\n const STORAGE: StorageEntry<Remotes> = config.storage('remotes', {});\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: Remotes = STORAGE.get() ?? {};\n\n return {\n contains: function (remoteName: RemoteName) {\n return !!_cache[remoteName];\n },\n remove: function (remoteName: RemoteName) {\n delete _cache[remoteName];\n return this;\n },\n addOrUpdate: function (remoteName: string, remote: RemoteInfo) {\n _cache[remoteName] = remote;\n return this;\n },\n tryGet: function (remoteName: RemoteName) {\n return Optional.of(_cache[remoteName]);\n },\n tryGetModule: function (remoteName: RemoteName, exposedModule: string) {\n return Optional.of(_cache[remoteName]?.exposes.find(m => m.moduleName === exposedModule)).map(\n m => _path.join(_cache[remoteName]!.scopeUrl, m.file)\n );\n },\n getAll: function () {\n return _cache;\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createRemoteInfoRepository };\n", "import type { ScopedExternals } from 'lib/1.domain/externals/external.contract';\nimport type { StorageConfig, StorageEntry } from 'lib/2.app/config/storage.contract';\nimport type { ForScopedExternalsStorage } from 'lib/2.app/driving-ports/for-scoped-externals-storage.port';\nimport type { RemoteName, ScopedVersion } from 'lib/1.domain';\nimport { Optional } from 'lib/utils/optional';\n\nconst createScopedExternalsRepository = (config: StorageConfig): ForScopedExternalsStorage => {\n const STORAGE: StorageEntry<ScopedExternals> = config.storage('scoped-externals', {});\n\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: ScopedExternals = STORAGE.get() ?? {};\n\n return {\n addExternal: function (remoteName: RemoteName, external: string, version: ScopedVersion) {\n if (!_cache[remoteName]) _cache[remoteName] = {};\n _cache[remoteName][external] = version;\n return this;\n },\n remove: function (remoteName: RemoteName) {\n delete _cache[remoteName];\n return this;\n },\n getAll: function () {\n return _cache;\n },\n tryGet: function (remoteName: string) {\n return Optional.of(_cache[remoteName]);\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createScopedExternalsRepository };\n", "import type { SharedVersion, ScopedVersion } from './version.contract';\n\nexport type ExternalName = string;\n\nexport type ScopedExternals = Record<string, ScopedExternal>;\n\nexport const GLOBAL_SCOPE = '__GLOBAL__';\n\nexport const STRICT_SCOPE = 'strict';\n\nexport type SharedExternal = {\n dirty: boolean;\n versions: SharedVersion[];\n};\n\nexport type shareScope = Record<string, SharedExternal>;\n\nexport type SharedExternals = Record<string, shareScope> & { [GLOBAL_SCOPE]: shareScope };\n\nexport type ScopedExternal = Record<string, ScopedVersion>;\n", "import {\n type SharedExternal,\n type SharedExternals,\n GLOBAL_SCOPE,\n STRICT_SCOPE,\n} from 'lib/1.domain/externals/external.contract';\nimport type { StorageConfig, StorageEntry } from 'lib/2.app/config/storage.contract';\nimport type { ForSharedExternalsStorage } from 'lib/2.app/driving-ports/for-shared-externals-storage.port';\nimport { Optional } from 'lib/utils/optional';\n\nconst createSharedExternalsRepository = (config: StorageConfig): ForSharedExternalsStorage => {\n const STORAGE: StorageEntry<SharedExternals> = config.storage<SharedExternals>(\n 'shared-externals',\n { [GLOBAL_SCOPE]: {} }\n );\n\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: SharedExternals = STORAGE.get()!;\n\n return {\n getFromScope: function (shareScope?: string) {\n return { ..._cache[shareScope ?? GLOBAL_SCOPE] };\n },\n addOrUpdate: function (externalName: string, external: SharedExternal, shareScope?: string) {\n if (!_cache[shareScope ?? GLOBAL_SCOPE]) _cache[shareScope ?? GLOBAL_SCOPE] = {};\n _cache[shareScope ?? GLOBAL_SCOPE]![externalName] = external;\n return this;\n },\n getScopes: function (o = { includeGlobal: true }) {\n if (o.includeGlobal) return Object.keys(_cache);\n return Object.keys(_cache).filter(s => s !== GLOBAL_SCOPE);\n },\n removeFromAllScopes: function (remoteName: string) {\n Object.values(_cache).forEach(scope => {\n const removeExternals: string[] = [];\n\n Object.entries(scope).forEach(([name, external]) => {\n const removeVersionIdx: number[] = [];\n external.versions.forEach((version, i) => {\n const versionRemoteIDX = version.remotes.findIndex(r => r.name === remoteName);\n if (~versionRemoteIDX) {\n version.remotes.splice(versionRemoteIDX, 1);\n }\n\n if (version.remotes.length === 0) removeVersionIdx.push(i);\n });\n\n if (removeVersionIdx.length > 0) {\n for (let i = removeVersionIdx.length - 1; i >= 0; i--) {\n external.versions.splice(removeVersionIdx[i]!, 1);\n }\n external.dirty = true;\n\n if (external.versions.length === 0) removeExternals.push(name);\n }\n });\n removeExternals.forEach(name => delete scope[name]);\n });\n },\n scopeType: function (shareScope?: string) {\n switch (shareScope) {\n case GLOBAL_SCOPE:\n case null:\n case undefined:\n return 'global';\n case STRICT_SCOPE:\n return 'strict';\n default:\n return 'shareScope';\n }\n },\n tryGet: function (external: string, shareScope?: string) {\n return Optional.of(_cache[shareScope ?? GLOBAL_SCOPE]?.[external]);\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createSharedExternalsRepository };\n", "import type { StorageEntryKey } from 'lib/2.app/config/storage.contract';\nimport { NFError } from 'lib/native-federation.error';\n\ntype CloneEntry = <T>(name: StorageEntryKey, raw: T) => T;\n\nconst cloneEntry: CloneEntry = <T>(name: StorageEntryKey, raw: T) => {\n try {\n if (typeof structuredClone === 'function') {\n return structuredClone(raw);\n }\n } catch {\n /* structured clone is unavailable */\n }\n try {\n return JSON.parse(JSON.stringify(raw));\n } catch {\n /* object is not stringifyable */\n }\n throw new NFError(`Could not clone entry '${String(name)}'`);\n};\n\nexport { CloneEntry, cloneEntry };\n", "import type { StorageConfig, StorageEntry } from 'lib/2.app/config/storage.contract';\nimport type { ForSharedChunksStorage } from 'lib/2.app/driving-ports/for-shared-chunks-storage.port';\nimport type { SharedChunks } from 'lib/1.domain/externals/chunks.contract';\nimport { Optional } from 'lib/sdk.index';\n\nconst createChunkRepository = (config: StorageConfig): ForSharedChunksStorage => {\n const STORAGE: StorageEntry<SharedChunks> = config.storage('shared-chunks', {});\n\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: SharedChunks = STORAGE.get() ?? {};\n\n return {\n addOrReplace: function (remoteName: string, bundleName: string, chunks: string[]) {\n if (!_cache[remoteName]) _cache[remoteName] = {};\n _cache[remoteName][bundleName] = chunks;\n return this;\n },\n tryGet: function (remoteName: string, bundleName: string) {\n return Optional.of(_cache[remoteName]?.[bundleName]);\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createChunkRepository };\n", "type TTCreateScript = (input: string) => string;\ntype TTCreateScriptURL = (input: string) => string;\n\ntype TTPolicyRules = {\n createScript?: TTCreateScript;\n createScriptURL?: TTCreateScriptURL;\n};\n\ntype TTPolicy = {\n createScript: TTCreateScript;\n createScriptURL: TTCreateScriptURL;\n};\n\ntype TTFactory = {\n createPolicy: (name: string, rules: TTPolicyRules) => TTPolicy;\n};\n\nexport type NFTrustedTypesPolicy = {\n createScript: (input: string) => string;\n createScriptURL: (input: string) => string;\n};\n\nconst IMPORT_MAP_KEYS = new Set(['imports', 'scopes', 'integrity']);\n\nconst validateImportMapJSON = (input: string): string => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(input);\n } catch {\n throw new TypeError('[nf-orchestrator] trusted-types: import map is not valid JSON');\n }\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw new TypeError('[nf-orchestrator] trusted-types: import map must be a plain object');\n }\n for (const key of Object.keys(parsed as Record<string, unknown>)) {\n if (!IMPORT_MAP_KEYS.has(key)) {\n throw new TypeError(`[nf-orchestrator] trusted-types: unexpected key \"${key}\" in import map`);\n }\n }\n return input;\n};\n\nconst validateScriptURL = (input: string): string => {\n const base = typeof location !== 'undefined' ? location.href : 'http://localhost/';\n let url: URL;\n try {\n url = new URL(input, base);\n } catch {\n throw new TypeError(`[nf-orchestrator] trusted-types: invalid script URL \"${input}\"`);\n }\n if (url.protocol !== 'https:' && url.protocol !== 'http:') {\n throw new TypeError(\n `[nf-orchestrator] trusted-types: disallowed protocol \"${url.protocol}\" for script URL`\n );\n }\n return input;\n};\n\nconst passThroughPolicy: NFTrustedTypesPolicy = {\n createScript: input => input,\n createScriptURL: input => input,\n};\n\nlet cachedPolicy: NFTrustedTypesPolicy | null = null;\n\nexport const getTrustedTypesPolicy = (\n name: string | false = 'nfo'\n): NFTrustedTypesPolicy => {\n if (name === false) return passThroughPolicy;\n if (cachedPolicy) return cachedPolicy;\n\n const factory = (globalThis as { trustedTypes?: TTFactory }).trustedTypes;\n if (!factory) {\n cachedPolicy = passThroughPolicy;\n return cachedPolicy;\n }\n\n const native = factory.createPolicy(name, {\n createScript: validateImportMapJSON,\n createScriptURL: validateScriptURL,\n });\n\n cachedPolicy = {\n createScript: input => native.createScript(input) as unknown as string,\n createScriptURL: input => native.createScriptURL(input) as unknown as string,\n };\n return cachedPolicy;\n};\n\nexport const __resetTrustedTypesPolicyForTests = (): void => {\n cachedPolicy = null;\n};\n", "import type { ImportMap } from 'lib/1.domain';\nimport type { SetImportMap } from 'lib/2.app/config/import-map.contract';\nimport { getTrustedTypesPolicy } from './trusted-types';\n\nexport const replaceInDOM =\n (mapType: string, trustedTypesPolicyName: string | false = 'nfo'): SetImportMap =>\n (importMap: ImportMap, opts = {}) => {\n if (opts?.override) {\n document.head\n .querySelectorAll(`script[type=\"${mapType}\"]`)\n .forEach(importMap => importMap.remove());\n }\n\n const policy = getTrustedTypesPolicy(trustedTypesPolicyName);\n document.head.appendChild(\n Object.assign(document.createElement('script'), {\n type: mapType,\n text: policy.createScript(JSON.stringify(importMap)),\n })\n );\n return Promise.resolve(importMap);\n };\n", "import type { ImportMapConfig } from 'lib/2.app/config/import-map.contract';\nimport { replaceInDOM } from './replace-in-dom';\nimport { getTrustedTypesPolicy } from './trusted-types';\n\nconst useDefaultImportMap = (\n trustedTypesPolicyName: string | false = 'nfo'\n): ImportMapConfig => ({\n loadModuleFn: url => {\n const trusted = getTrustedTypesPolicy(trustedTypesPolicyName).createScriptURL(url);\n return import(/* @vite-ignore */ trusted);\n },\n setImportMapFn: replaceInDOM('importmap', trustedTypesPolicyName),\n reloadBrowserFn: () => {\n window.location.reload();\n },\n});\n\nexport { useDefaultImportMap };\n", "import type { ImportMapConfig, ImportMapOptions } from 'lib/2.app/config/import-map.contract';\nimport { useDefaultImportMap } from './use-default';\n\nexport const createImportMapConfig = (o: Partial<ImportMapOptions>): ImportMapConfig => {\n const fallback = useDefaultImportMap(o.trustedTypesPolicyName);\n return {\n setImportMapFn: o.setImportMapFn ?? fallback.setImportMapFn,\n loadModuleFn: o.loadModuleFn ?? fallback.loadModuleFn,\n reloadBrowserFn: o.reloadBrowserFn ?? fallback.reloadBrowserFn,\n };\n};\n", "import type { HostConfig, HostOptions } from 'lib/2.app/config/host.contract';\n\nexport const createHostConfig = (override: Partial<HostOptions>): HostConfig => {\n const extras = override?.manifestIntegrity\n ? { manifestIntegrity: override.manifestIntegrity }\n : {};\n\n if (!override?.hostRemoteEntry) {\n return { hostRemoteEntry: false, ...extras };\n }\n if (typeof override.hostRemoteEntry === 'string') {\n return {\n hostRemoteEntry: {\n name: '__NF-HOST__',\n url: override.hostRemoteEntry,\n },\n ...extras,\n };\n }\n return {\n hostRemoteEntry: {\n name: '__NF-HOST__',\n ...override.hostRemoteEntry,\n },\n ...extras,\n };\n};\n", "import type { Logger } from 'lib/2.app/config/log.contract';\n\nconst noopLogger: Logger = {\n debug: () => {},\n error: () => {},\n warn: () => {},\n};\n\nexport { noopLogger };\n", "export const LogLevel = {\n debug: 0,\n warn: 1,\n error: 2,\n};\n\nexport type LogType = keyof typeof LogLevel;\n\nexport type Logger = {\n error: (step: number, msg: string, details?: unknown) => void;\n warn: (step: number, msg: string, details?: unknown) => void;\n debug: (step: number, msg: string, details?: unknown) => void;\n};\n\nexport type LogHandler = Logger & {\n level: LogType;\n};\n\nexport type LoggingConfig = {\n log: LogHandler;\n sse: boolean;\n};\n\nexport type LoggingOptions = {\n logger?: Logger;\n logLevel?: LogType;\n sse?: boolean;\n};\n", "import {\n type LogType,\n type LogHandler,\n type Logger,\n LogLevel,\n} from 'lib/2.app/config/log.contract';\n\nconst createLogHandler = (logger: Logger, logLevel: LogType): LogHandler => {\n const logTypes = Object.keys(LogLevel).filter(key => isNaN(Number(key))) as LogType[];\n\n return logTypes.reduce(\n (acc, logMessageType) => {\n return {\n ...acc,\n [logMessageType]: (step: number, message: string, details: unknown) => {\n if (LogLevel[logMessageType] >= LogLevel[logLevel]) {\n logger[logMessageType](step, message, details);\n }\n },\n };\n },\n { level: logLevel } as LogHandler\n );\n};\n\nexport { createLogHandler };\n", "import type { LoggingConfig, LoggingOptions } from 'lib/2.app/config/log.contract';\nimport { noopLogger } from './noop.logger';\nimport { createLogHandler } from './log.handler';\n\nexport const createLogConfig = ({ logger, logLevel, sse }: LoggingOptions): LoggingConfig => ({\n log: createLogHandler(logger ?? noopLogger, logLevel ?? 'error'),\n sse: !!sse,\n});\n", "import { cloneEntry } from '../../utils/clone-entry';\nimport { type StorageEntryCreator, type StorageEntry } from 'lib/2.app/config/storage.contract';\n\nconst globalThisStorageEntry: StorageEntryCreator =\n (namespace: string) =>\n <TValue>(key: string, initialValue: TValue) => {\n if (!(globalThis as unknown as { [namespace]: unknown })[namespace]) {\n (globalThis as unknown as { [namespace]: unknown })[namespace] = {};\n }\n\n const storage = (globalThis as unknown as { [namespace]: { [P in typeof key]: TValue } })[\n namespace\n ]!;\n if (!storage[key]) storage[key] = initialValue;\n\n const entry: StorageEntry<TValue> = {\n get(): TValue {\n return cloneEntry(key, storage[key])!;\n },\n set(value: TValue): StorageEntry<TValue> {\n storage[key] = cloneEntry(key, value);\n return entry;\n },\n clear(): StorageEntry<TValue> {\n storage[key] = cloneEntry(key, initialValue);\n return this;\n },\n };\n\n return entry;\n };\n\nexport { globalThisStorageEntry };\n", "import type { StorageConfig, StorageOptions } from 'lib/2.app/config/storage.contract';\nimport { globalThisStorageEntry } from './global-this.storage';\n\nexport const createStorageConfig = (override: StorageOptions): StorageConfig => ({\n storage: override.storage\n ? override.storage(override.storageNamespace ?? '__NATIVE_FEDERATION__')\n : globalThisStorageEntry(override.storageNamespace ?? '__NATIVE_FEDERATION__'),\n clearStorage: override.clearStorage ?? false,\n});\n", "import type { ModeProfileConfig } from 'lib/2.app/config/mode.contract';\n\nexport const defaultProfile: ModeProfileConfig = {\n latestSharedExternal: false,\n overrideCachedRemotes: 'init-only',\n overrideCachedRemotesIfURLMatches: false,\n};\n", "import type { ModeConfig, ModeOptions } from 'lib/2.app/config/mode.contract';\nimport { defaultProfile } from './default.profile';\n\nexport const createModeConfig = (override: ModeOptions): ModeConfig => {\n const strictnessConfig =\n typeof override.strict === 'boolean'\n ? {\n strictRemoteEntry: override.strict,\n strictExternalCompatibility: override.strict,\n strictExternalSameVersionCompatibility: override.strict,\n strictExternalVersion: override.strict,\n strictImportMap: override.strict,\n }\n : {\n strictRemoteEntry: override.strict?.strictRemoteEntry ?? false,\n strictExternalCompatibility: override.strict?.strictExternalCompatibility ?? false,\n strictExternalSameVersionCompatibility:\n override.strict?.strictExternalSameVersionCompatibility ?? false,\n strictExternalVersion: override.strict?.strictExternalVersion ?? false,\n strictImportMap: override.strict?.strictImportMap ?? false,\n };\n\n return {\n strict: strictnessConfig,\n profile: { ...defaultProfile, ...(override.profile ?? {}) },\n };\n};\n", "import type { ConfigContract, NFOptions } from 'lib/2.app/config/config.contract';\nimport { createImportMapConfig } from 'lib/4.config/import-map/import-map.config';\nimport { createHostConfig } from 'lib/4.config/host/host.config';\nimport { createLogConfig } from 'lib/4.config/logging/log.config';\nimport { createStorageConfig } from 'lib/4.config/storage/storage.config';\nimport { createModeConfig } from 'lib/4.config/mode/mode.config';\n\nexport const createConfigHandlers = (overrides: NFOptions): ConfigContract => ({\n ...createImportMapConfig(overrides),\n ...createHostConfig(overrides),\n ...createLogConfig(overrides),\n ...createStorageConfig(overrides),\n ...createModeConfig(overrides),\n});\n", "import type { RemoteEntry } from 'lib/1.domain/remote-entry/remote-entry.contract';\nimport type {\n FederationManifest,\n RemoteEntryDescriptor,\n RemoteEntryUrl,\n} from 'lib/1.domain/remote-entry/manifest.contract';\nimport type { RemoteName } from 'lib/1.domain/remote/remote-info.contract';\nimport type { ForGettingRemoteEntries } from '../../driver-ports/init/for-getting-remote-entries.port';\nimport type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport { NFError } from 'lib/native-federation.error';\nimport type { ModeConfig } from '../../config/mode.contract';\nimport type { HostConfig } from '../../config/host.contract';\nimport * as _path from 'lib/utils/path';\n\nexport function createGetRemoteEntries(\n config: LoggingConfig & ModeConfig & HostConfig,\n ports: Pick<\n DrivingContract,\n 'remoteEntryProvider' | 'manifestProvider' | 'remoteInfoRepo' | 'sse'\n >\n): ForGettingRemoteEntries {\n /**\n * Step 1: Fetch the remoteEntry JSON objects:\n *\n * A Manifest or URL to a Manifest is used as the input. Based on the defined remotes\n * in the manifest, the library will download the remoteEntry.json files which contain the\n * metadata of the defined remotes (name, exposed modules and required dependencies a.k.a. externals)\n *\n * @param config\n * @param adapters\n * @returns A list of the remoteEntry json objects\n */\n return (remotesOrManifestUrl = {}) => {\n const manifestPromise = config.manifestIntegrity\n ? ports.manifestProvider.provide(remotesOrManifestUrl, {\n integrity: config.manifestIntegrity,\n })\n : ports.manifestProvider.provide(remotesOrManifestUrl);\n\n return manifestPromise\n .catch(e => {\n config.log.error(1, 'Could not fetch manifest.', e);\n return Promise.reject(new NFError('Failed to fetch manifest'));\n })\n .then(addHostRemoteEntry)\n .then(fetchRemoteEntries)\n .then(removeSkippedRemotes)\n .then(checkForSSE);\n };\n\n function addHostRemoteEntry(manifest: FederationManifest): FederationManifest {\n if (!config.hostRemoteEntry) return manifest;\n\n const { name, url, cacheTag, integrity } = config.hostRemoteEntry;\n const urlWithCache = cacheTag ? `${url}?cacheTag=${cacheTag}` : url;\n\n return {\n ...manifest,\n [name]: integrity ? { url: urlWithCache, integrity } : urlWithCache,\n };\n }\n\n function normalizeEntry(descriptor: RemoteEntryDescriptor): {\n url: RemoteEntryUrl;\n integrity?: string;\n } {\n return typeof descriptor === 'string' ? { url: descriptor } : descriptor;\n }\n\n async function fetchRemoteEntries(manifest: FederationManifest): Promise<(RemoteEntry | false)[]> {\n const fetchPromises = Object.entries(manifest).map(([remoteName, descriptor]) =>\n fetchRemoteEntry(remoteName, descriptor)\n );\n return Promise.all(fetchPromises);\n }\n\n async function fetchRemoteEntry(\n remoteName: RemoteName,\n descriptor: RemoteEntryDescriptor\n ): Promise<RemoteEntry | false> {\n const { url: remoteEntryUrl, integrity } = normalizeEntry(descriptor);\n let isOverride = false;\n let skip = false;\n\n ports.remoteInfoRepo.tryGet(remoteName).ifPresent(cachedRemoteInfo => {\n if (\n config.profile.overrideCachedRemotes !== 'never' &&\n (remoteEntryUrl !== _path.join(cachedRemoteInfo.scopeUrl, 'remoteEntry.json') ||\n config.profile.overrideCachedRemotesIfURLMatches)\n ) {\n config.log.debug(1, `Overriding existing remote '${remoteName}' with '${remoteEntryUrl}'.`);\n isOverride = true;\n } else {\n config.log.debug(1, `Found remote '${remoteName}' in storage, omitting fetch.`);\n skip = true;\n }\n });\n\n if (skip) return false;\n\n try {\n const remoteEntry = integrity\n ? await ports.remoteEntryProvider.provide(remoteEntryUrl, { integrity })\n : await ports.remoteEntryProvider.provide(remoteEntryUrl);\n\n config.log.debug(\n 1,\n `Fetched '${remoteEntry.name}' from '${remoteEntry.url}', exposing: ${JSON.stringify(remoteEntry.exposes)}`\n );\n\n return prepareRemoteEntry(remoteEntry, remoteName, isOverride);\n } catch (error) {\n if (config.strict.strictRemoteEntry) {\n config.log.error(1, `Could not fetch remote '${remoteName}'.`, error);\n return Promise.reject(new NFError(`Could not fetch remote '${remoteName}'`));\n }\n config.log.warn(1, `Could not fetch remote '${remoteName}'. skipping init.`, error);\n\n return Promise.resolve(false);\n }\n }\n\n function prepareRemoteEntry(\n remoteEntry: RemoteEntry,\n expectedRemoteName: string,\n isOverride: boolean\n ): RemoteEntry {\n if (isOverride) remoteEntry.override = isOverride;\n\n if (!!config.hostRemoteEntry && expectedRemoteName === config.hostRemoteEntry.name) {\n remoteEntry.host = true;\n remoteEntry.name = config.hostRemoteEntry!.name;\n }\n\n if (remoteEntry.name !== expectedRemoteName) {\n const errorDetails = `Fetched remote '${remoteEntry.name}' does not match requested '${expectedRemoteName}'.`;\n if (config.strict.strictRemoteEntry) {\n throw new NFError(errorDetails);\n }\n config.log.warn(1, `${errorDetails} Omitting expected name.`);\n }\n\n return remoteEntry;\n }\n\n function removeSkippedRemotes(remoteEntries: (RemoteEntry | false)[]): RemoteEntry[] {\n return remoteEntries.filter((entry): entry is RemoteEntry => entry !== false);\n }\n\n function checkForSSE(remoteEntries: RemoteEntry[]): RemoteEntry[] {\n if (config.sse) {\n remoteEntries.forEach(entry => {\n if (entry.buildNotificationsEndpoint) {\n ports.sse.watchRemoteBuilds(\n _path.join(_path.getScope(entry.url), entry.buildNotificationsEndpoint)\n );\n config.log.debug(1, `Registered SSE endpoint of remote '${entry.name}' `);\n return;\n }\n config.log.debug(1, `Remote ${entry.name} has no defined 'buildNotificationsEndpoint'`);\n });\n }\n\n return remoteEntries;\n }\n}\n", "import type { ForProcessingRemoteEntries } from '../../driver-ports/init/for-processing-remote-entries.port';\nimport {\n type RemoteName,\n type RemoteEntry,\n type RemoteInfo,\n type SharedInfo,\n type SharedVersionMeta,\n type ScopedVersion,\n type SharedVersionAction,\n type SharedExternal,\n} from 'lib/1.domain';\nimport type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport * as _path from 'lib/utils/path';\nimport type { ModeConfig } from 'lib/2.app/config/mode.contract';\nimport { NFError } from 'lib/native-federation.error';\n\nexport function createProcessRemoteEntries(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'sharedExternalsRepo'\n | 'scopedExternalsRepo'\n | 'sharedChunksRepo'\n | 'versionCheck'\n >\n): ForProcessingRemoteEntries {\n /**\n * Step 2: Process remoteEntry objects\n *\n * Extracts the externals and remote-info objects from the provided remoteEntry objects.\n * The metadata will be merged into the existing cache/storage but the changes are not persisted (yet).\n *\n * - For remotes and scoped externals that means a full replace.\n * - For shared externals that means merging the versions into the currently cached externals.\n *\n * @param config\n * @param adapters\n * @returns Promise<void>\n */\n return remoteEntries => {\n try {\n remoteEntries.forEach(remoteEntry => {\n if (remoteEntry?.override) removeCachedRemoteEntry(remoteEntry);\n addRemoteInfoToStorage(remoteEntry);\n addExternalsToStorage(remoteEntry);\n addSharedChunksToStorage(remoteEntry);\n });\n return Promise.resolve(remoteEntries);\n } catch (e) {\n return Promise.reject(e);\n }\n };\n\n function removeCachedRemoteEntry(remoteEntry: RemoteEntry): void {\n ports.remoteInfoRepo.remove(remoteEntry.name);\n ports.scopedExternalsRepo.remove(remoteEntry.name);\n ports.sharedExternalsRepo.removeFromAllScopes(remoteEntry.name);\n }\n\n function addRemoteInfoToStorage({ name, url, exposes, integrity }: RemoteEntry): void {\n ports.remoteInfoRepo.addOrUpdate(name, {\n scopeUrl: _path.getScope(url),\n exposes: Object.values(exposes ?? []).map(m => ({\n moduleName: m.key,\n file: m.outFileName,\n })),\n ...(integrity ? { integrity } : {}),\n } as RemoteInfo);\n }\n\n function addExternalsToStorage(remoteEntry: RemoteEntry): void {\n remoteEntry.shared.forEach(external => {\n if (!external.version || !ports.versionCheck.isValidSemver(external.version)) {\n const errorMsg = `[${remoteEntry.name}][${external.packageName}] Version '${external.version}' is not a valid version.`;\n\n if (config.strict.strictExternalVersion) {\n config.log.error(2, errorMsg);\n throw new NFError(`Could not process remote '${remoteEntry.name}'`);\n }\n config.log.warn(2, errorMsg);\n }\n if (external.singleton) {\n addSharedExternal(remoteEntry.name, external, remoteEntry);\n } else {\n addScopedExternal(remoteEntry.name, external);\n }\n });\n }\n\n function addSharedChunksToStorage(remoteEntry: RemoteEntry): void {\n if (!remoteEntry.chunks) return;\n config.log.debug(\n 2,\n `Adding chunks for remote \"${remoteEntry.name}\", bundles: [${Object.keys(remoteEntry.chunks).join(', ')}]`\n );\n Object.entries(remoteEntry.chunks).forEach(([bundleName, chunks]) => {\n ports.sharedChunksRepo.addOrReplace(remoteEntry.name, bundleName, chunks);\n });\n }\n\n function addSharedExternal(\n remoteName: RemoteName,\n sharedInfo: SharedInfo,\n remoteEntry: RemoteEntry\n ): void {\n let action: SharedVersionAction = 'skip';\n\n const tag =\n sharedInfo.version ?? ports.versionCheck.smallestVersion(sharedInfo.requiredVersion);\n const remote: SharedVersionMeta = {\n file: sharedInfo.outFileName,\n name: remoteName,\n bundle: sharedInfo.bundle,\n strictVersion: sharedInfo.strictVersion,\n cached: false,\n requiredVersion: sharedInfo.requiredVersion || tag,\n };\n\n const scopeType = ports.sharedExternalsRepo.scopeType(sharedInfo.shareScope);\n\n if (scopeType === 'strict') {\n action = 'share';\n remote.requiredVersion = tag;\n }\n\n const cached: SharedExternal = ports.sharedExternalsRepo\n .tryGet(sharedInfo.packageName, sharedInfo.shareScope)\n .orElse({ dirty: false, versions: [] });\n\n const matchingVersion = cached.versions.find(version => version.tag === sharedInfo.version);\n let dirty = cached.dirty;\n\n if (!!matchingVersion) {\n if (\n remote.strictVersion &&\n matchingVersion.remotes[0]!.requiredVersion !== remote.requiredVersion\n ) {\n const errorMsg = `[${remoteName}][${sharedInfo.packageName}@${\n sharedInfo.version\n }] Required version-range '${\n remote.requiredVersion\n }' does not match cached version-range '${matchingVersion.remotes[0]!.requiredVersion}'`;\n if (config.strict.strictExternalSameVersionCompatibility) {\n config.log.error(2, errorMsg);\n throw new NFError(`Could not process remote '${remoteEntry.name}'`);\n }\n config.log.warn(2, errorMsg);\n }\n\n if (!matchingVersion.host && !!remoteEntry?.host) {\n matchingVersion.host = true;\n matchingVersion.remotes.unshift(remote);\n } else matchingVersion.remotes.push(remote);\n } else {\n if (scopeType !== 'strict') dirty = true;\n cached.versions.push({ tag, action, host: !!remoteEntry?.host, remotes: [remote] });\n }\n\n ports.sharedExternalsRepo.addOrUpdate(\n sharedInfo.packageName,\n {\n dirty,\n versions: cached.versions.sort((a, b) => ports.versionCheck.compare(b.tag, a.tag)),\n },\n sharedInfo.shareScope\n );\n }\n\n function addScopedExternal(scope: string, sharedInfo: SharedInfo): void {\n ports.scopedExternalsRepo.addExternal(scope, sharedInfo.packageName, {\n tag: sharedInfo.version ?? ports.versionCheck.smallestVersion(sharedInfo.requiredVersion),\n file: sharedInfo.outFileName,\n bundle: sharedInfo.bundle,\n } as ScopedVersion);\n }\n}\n", "import type { ForDeterminingSharedExternals } from '../../driver-ports/init/for-determining-shared-externals.port';\nimport { GLOBAL_SCOPE, type SharedExternal } from 'lib/1.domain';\nimport { NFError } from 'lib/native-federation.error';\nimport type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport type { ModeConfig } from '../../config/mode.contract';\n\nexport function createDetermineSharedExternals(\n config: LoggingConfig & ModeConfig,\n ports: Pick<DrivingContract, 'versionCheck' | 'sharedExternalsRepo'>\n): ForDeterminingSharedExternals {\n /**\n * Step 3: Determine which version is the optimal version to share.\n *\n * The shared external versions that were merged into the cache/storage caused the shared\n * external to be 'dirty', this step cleans all dirty externals in the storage by calculating\n * the most optimal version to share since only 1 version can be shared globally. All other\n * versions that are compatible are skipped and the incompatible ones are defined as scoped external.\n *\n * Check the docs for a full explanation of the dependency resolver.\n *\n * Priority:\n * 1) Latest external defined in 'host' remoteEntry (if available).\n * 2) If defined in config, prioritize latest available version.\n * 3) Find most optimal version, by comparing potential extra downloads per version.\n *\n * @param config\n * @param adapters\n * @returns\n */\n return () => {\n for (const shareScope of ports.sharedExternalsRepo.getScopes()) {\n const sharedExternals = ports.sharedExternalsRepo.getFromScope(shareScope);\n\n try {\n Object.entries(sharedExternals)\n .filter(([_, e]) => e.dirty)\n .forEach(([name, external]) =>\n ports.sharedExternalsRepo.addOrUpdate(\n name,\n setVersionActions(name, external),\n shareScope\n )\n );\n } catch (error) {\n config.log.error(\n 3,\n `[${shareScope ?? GLOBAL_SCOPE}] failed to determine shared externals.`,\n {\n sharedExternals,\n error,\n }\n );\n return Promise.reject(\n new NFError(\n `Could not determine shared externals in scope ${shareScope}.`,\n error as Error\n )\n );\n }\n }\n return Promise.resolve();\n };\n\n function setVersionActions(externalName: string, external: SharedExternal) {\n if (external.versions.length === 1) {\n external.versions[0]!.action = 'share';\n external.dirty = false;\n return external;\n }\n\n let sharedVersion = external.versions.find(v => v.host);\n\n if (!sharedVersion && config.profile.latestSharedExternal) {\n sharedVersion = external.versions[0];\n }\n\n if (!sharedVersion) {\n // find version with least extra downloads, sorted by SEMVER version (O^2 complexity)\n let leastExtraDownloads = Number.MAX_VALUE;\n external.versions.forEach(vA => {\n const extraDownloads = external.versions.filter(\n vB =>\n !vB.remotes[0]!.cached &&\n vB.remotes[0]!.strictVersion &&\n !ports.versionCheck.isCompatible(vA.tag, vB.remotes[0]!.requiredVersion)\n ).length;\n if (extraDownloads < leastExtraDownloads) {\n leastExtraDownloads = extraDownloads;\n sharedVersion = vA;\n }\n });\n }\n\n if (!sharedVersion) {\n throw new NFError(`[${externalName}] Could not determine shared version!`);\n }\n\n // Determine action of other versions based on chosen sharedVersion\n external.versions.forEach(v => {\n if (ports.versionCheck.isCompatible(sharedVersion!.tag, v.remotes[0]!.requiredVersion)) {\n v.action = 'skip';\n return;\n }\n\n if (config.strict.strictExternalCompatibility && v.remotes[0]!.strictVersion) {\n config.log.error(\n 3,\n `[${v.remotes[0]!.name}][${externalName}@${v.tag}] Is not compatible with requiredRange '${sharedVersion!.remotes[0]?.requiredVersion}' from remote '${sharedVersion!.remotes[0]!.name}'.`\n );\n\n throw new NFError(`External ${externalName}@${v.tag} could not be shared.`);\n }\n v.action = v.remotes[0]!.strictVersion ? 'scope' : 'skip';\n });\n\n sharedVersion.action = 'share';\n external.dirty = false;\n return external;\n }\n}\n", "export var BuildNotificationType;\n(function (BuildNotificationType) {\n BuildNotificationType[\"COMPLETED\"] = \"federation-rebuild-complete\";\n BuildNotificationType[\"ERROR\"] = \"federation-rebuild-error\";\n BuildNotificationType[\"CANCELLED\"] = \"federation-rebuild-cancelled\";\n})(BuildNotificationType || (BuildNotificationType = {}));\n", "export const CHUNK_PREFIX = '@nf-internal';\nexport function toChunkImport(fileName) {\n if (fileName.startsWith('./')) {\n fileName = fileName.slice(2);\n }\n const packageName = fileName.replace(/.(m|c)?js$/, '');\n return CHUNK_PREFIX + '/' + packageName;\n}\n", "import type { ForGeneratingImportMap } from '../../driver-ports/init/for-generating-import-map';\nimport type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { ImportMap, Imports } from 'lib/1.domain/import-map/import-map.contract';\nimport {\n GLOBAL_SCOPE,\n type RemoteName,\n type ScopedExternal,\n type RemoteInfo,\n type SharedExternal,\n type SharedVersion,\n} from 'lib/1.domain';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport type { ModeConfig } from '../../config/mode.contract';\nimport * as _path from 'lib/utils/path';\nimport { NFError } from 'lib/native-federation.error';\nimport { toChunkImport } from '@softarc/native-federation/domain';\n\nexport function createGenerateImportMap(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'sharedExternalsRepo'\n >\n): ForGeneratingImportMap {\n /**\n * Step 4: Generate an importMap from the cached remoteEntries\n *\n * The processed externals in the storage/cache (step 2 & 3) are used\n * to generate an importMap. The step returns the generated importMap object.\n */\n return () => {\n const importMap: ImportMap = { imports: {} };\n const chunkBundles: Record<string, Set<string>> = {};\n try {\n addScopedExternals(importMap, chunkBundles);\n addshareScopeExternals(importMap, chunkBundles);\n addGlobalSharedExternals(importMap, chunkBundles);\n addRemoteInfos(importMap, chunkBundles);\n\n addChunkImports(importMap, chunkBundles);\n\n return Promise.resolve(importMap);\n } catch (e) {\n return Promise.reject(e);\n }\n };\n\n /**\n * Step 4.1: Begin with appending smallest scope of shared dependencies\n * @param importMap\n * @returns\n */\n function addScopedExternals(\n importMap: ImportMap,\n chunkBundles: Record<string, Set<string>>\n ): ImportMap {\n const scopedExternals = ports.scopedExternalsRepo.getAll();\n\n for (const [remoteName, externals] of Object.entries(scopedExternals)) {\n const remote = ports.remoteInfoRepo.tryGet(remoteName).orThrow(() => {\n config.log.error(4, `[scoped][${remoteName}] Remote name not found in cache.`);\n return new NFError('Could not create ImportMap.');\n });\n addToScope(importMap, remote.scopeUrl, createScopeModules(externals, remote.scopeUrl));\n\n for (const version of Object.values(externals)) {\n addIntegrity(importMap, _path.join(remote.scopeUrl, version.file), remoteName, version.file);\n }\n\n Object.values(externals)\n .filter(e => !!e.bundle)\n .forEach(e => registerBundleChunks(chunkBundles, remoteName, e.bundle));\n }\n\n return importMap;\n }\n\n function createScopeModules(externals: ScopedExternal, scope: string): Imports {\n const modules: Imports = {};\n\n for (const [external, version] of Object.entries(externals)) {\n modules[external] = _path.join(scope, version.file);\n }\n\n return modules;\n }\n\n /**\n * Step 4.2: Added the shareScope externals, overriding the scoped externals that are shared\n * @param importMap\n * @returns\n */\n function addshareScopeExternals(\n importMap: ImportMap,\n chunkBundles: Record<string, Set<string>>\n ): ImportMap {\n const shareScopes = ports.sharedExternalsRepo.getScopes({ includeGlobal: false });\n\n for (const shareScope of shareScopes) {\n processshareScope(importMap, shareScope, chunkBundles);\n }\n\n return importMap;\n }\n\n function processshareScope(\n importMap: ImportMap,\n shareScope: string,\n chunkBundles: Record<string, Set<string>>\n ): void {\n const sharedExternals = ports.sharedExternalsRepo.getFromScope(shareScope);\n\n for (const [externalName, external] of Object.entries(sharedExternals)) {\n let override: SharedVersion | undefined | 'NOT_AVAILABLE' = undefined;\n let overrideScope: string | undefined = undefined;\n\n for (const version of external.versions) {\n if (version.action === 'scope') {\n for (const remote of version.remotes) {\n const remoteScope = getScope(shareScope, remote.name, externalName);\n const url = _path.join(remoteScope, remote.file);\n addToScope(importMap, remoteScope, {\n [externalName]: url,\n });\n addIntegrity(importMap, url, remote.name, remote.file);\n registerBundleChunks(chunkBundles, remote.name, remote.bundle);\n remote.cached = true;\n }\n continue;\n }\n\n const scope = getScope(shareScope, version.remotes[0]!.name, externalName);\n\n let targetFileUrl: string = _path.join(scope, version.remotes[0]!.file);\n let targetFileSource: { name: RemoteName; file: string } = {\n name: version.remotes[0]!.name,\n file: version.remotes[0]!.file,\n };\n version.remotes[0]!.cached = true;\n\n if (version.action === 'share') {\n registerBundleChunks(chunkBundles, version.remotes[0]!.name, version.remotes[0]!.bundle);\n }\n\n if (version.action === 'skip') {\n if (!override) {\n override = findOverride(external, shareScope, externalName) ?? 'NOT_AVAILABLE';\n }\n if (override !== 'NOT_AVAILABLE') {\n if (!overrideScope)\n overrideScope = getScope(shareScope, override.remotes[0]!.name, externalName);\n targetFileUrl = _path.join(overrideScope, override.remotes[0]!.file);\n targetFileSource = {\n name: override.remotes[0]!.name,\n file: override.remotes[0]!.file,\n };\n override.remotes[0]!.cached = true;\n\n version.remotes[0]!.cached = false;\n }\n }\n version.remotes.forEach(r => {\n const scope = getScope(shareScope, r.name, externalName);\n addToScope(importMap, scope, { [externalName]: targetFileUrl });\n });\n addIntegrity(importMap, targetFileUrl, targetFileSource.name, targetFileSource.file);\n }\n ports.sharedExternalsRepo.addOrUpdate(externalName, external, shareScope);\n }\n }\n\n function findOverride(\n external: SharedExternal,\n shareScope: string,\n externalName: string\n ): SharedVersion | undefined {\n const sharedVersions = external.versions.filter(v => v.action === 'share');\n const scopedExternalName = `${shareScope}.${externalName}`;\n\n if (sharedVersions.length > 1) {\n handleMultipleSharedVersions(scopedExternalName);\n }\n\n if (sharedVersions.length < 1) {\n if (config.strict.strictImportMap) {\n config.log.error(4, `[${shareScope}][${externalName}] shareScope has no override version.`);\n throw new NFError('Could not create ImportMap.');\n }\n config.log.debug(\n 4,\n `[${shareScope}][${externalName}] shareScope has no override version, scoping override versions.`\n );\n }\n\n return sharedVersions[0];\n }\n\n function handleMultipleSharedVersions(scopedExternalName: string): void {\n if (config.strict.strictImportMap) {\n config.log.error(\n 4,\n `[${scopedExternalName}] ShareScope external has multiple shared versions.`\n );\n throw new NFError('Could not create ImportMap.');\n }\n\n config.log.warn(4, `ShareScope external ${scopedExternalName} has multiple shared versions.`);\n }\n\n /**\n * Step 4.3: Added the globally shared externals.\n * @param importMap\n * @returns\n */\n function addGlobalSharedExternals(\n importMap: ImportMap,\n chunkBundles: Record<string, Set<string>>\n ): ImportMap {\n const sharedExternals = ports.sharedExternalsRepo.getFromScope();\n\n for (const [externalName, external] of Object.entries(sharedExternals)) {\n for (const version of external.versions) {\n if (version.action === 'skip') continue;\n if (version.action === 'scope') {\n for (const remote of version.remotes) {\n const remoteScope = getScope(GLOBAL_SCOPE, remote.name, externalName);\n const url = _path.join(remoteScope, remote.file);\n addToScope(importMap, remoteScope, {\n [externalName]: url,\n });\n addIntegrity(importMap, url, remote.name, remote.file);\n remote.cached = true;\n registerBundleChunks(chunkBundles, remote.name, remote.bundle);\n }\n continue;\n }\n\n if (importMap.imports[externalName]) {\n notifyDuplicateGlobalExternal(externalName);\n continue;\n }\n\n const scope = getScope(GLOBAL_SCOPE, version.remotes[0]!.name, externalName);\n const url = _path.join(scope, version.remotes[0]!.file);\n addToGlobal(importMap, { [externalName]: url });\n addIntegrity(importMap, url, version.remotes[0]!.name, version.remotes[0]!.file);\n registerBundleChunks(chunkBundles, version.remotes[0]!.name, version.remotes[0]!.bundle);\n\n version.remotes[0]!.cached = true;\n }\n ports.sharedExternalsRepo.addOrUpdate(externalName, external);\n }\n\n return importMap;\n }\n\n function notifyDuplicateGlobalExternal(externalName: string): void {\n if (config.strict.strictImportMap) {\n config.log.error(4, `[${externalName}] Shared external has multiple shared versions.`);\n throw new NFError('Could not create ImportMap.');\n }\n\n config.log.warn(4, `Singleton external ${externalName} has multiple shared versions.`);\n }\n\n function addToScope(importMap: ImportMap, scope: string, imports: Imports): void {\n if (!importMap.scopes) importMap.scopes = {};\n if (!importMap.scopes[scope]) importMap.scopes[scope] = {};\n importMap.scopes[scope] = Object.assign(importMap.scopes[scope], imports);\n }\n function addToGlobal(importMap: ImportMap, imports: Imports): void {\n importMap.imports = Object.assign(importMap.imports, imports);\n }\n\n /**\n * Step 4.4: Added the remote-modules (into the global scope).\n * @param importMap\n * @returns\n */\n function addRemoteInfos(importMap: ImportMap, chunkBundles: Record<string, Set<string>>): void {\n const remotes = ports.remoteInfoRepo.getAll();\n\n for (const [remoteName, remote] of Object.entries(remotes)) {\n addRemoteExposedModules(importMap, remoteName, remote);\n registerBundleChunks(chunkBundles, remoteName, 'mapping-or-exposed');\n }\n }\n\n function addRemoteExposedModules(\n importMap: ImportMap,\n remoteName: string,\n remote: RemoteInfo\n ): void {\n for (const exposed of remote.exposes) {\n const moduleName = _path.join(remoteName, exposed.moduleName);\n const moduleUrl = _path.join(remote.scopeUrl, exposed.file);\n importMap.imports[moduleName] = moduleUrl;\n addIntegrity(importMap, moduleUrl, remoteName, exposed.file);\n }\n }\n\n function registerBundleChunks(\n chunkBundles: Record<string, Set<string>>,\n remoteName: string,\n bundleName?: string\n ) {\n if (!bundleName) return chunkBundles;\n if (!chunkBundles[remoteName]) chunkBundles[remoteName] = new Set();\n chunkBundles[remoteName].add(bundleName);\n return chunkBundles;\n }\n\n function addChunkImports(importMap: ImportMap, chunkBundles: Record<string, Set<string>>) {\n Object.entries(chunkBundles).forEach(([remoteName, bundles]) => {\n const baseUrl = getScope('CHUNKS', remoteName);\n\n const imports = Array.from(bundles).reduce((_imports, bundleName) => {\n ports.sharedChunksRepo.tryGet(remoteName, bundleName).ifPresent(files => {\n files.forEach(file => {\n const url = _path.join(baseUrl, file);\n _imports[toChunkImport(file)] = url;\n addIntegrity(importMap, url, remoteName, file);\n });\n });\n return _imports;\n }, {} as Imports);\n\n if (Object.keys(imports).length > 0) addToScope(importMap, baseUrl, imports);\n });\n\n return importMap;\n }\n\n function addIntegrity(\n importMap: ImportMap,\n url: string,\n remoteName: RemoteName,\n file: string\n ): void {\n const hash = ports.remoteInfoRepo.tryGet(remoteName).get()?.integrity?.[file];\n if (!hash) return;\n if (!importMap.integrity) importMap.integrity = {};\n importMap.integrity[url] = hash;\n }\n\n function getScope(ctx: string, remoteName: RemoteName, externalName?: string) {\n return ports.remoteInfoRepo\n .tryGet(remoteName)\n .map(remote => remote.scopeUrl)\n .orThrow(() => {\n if (externalName) {\n config.log.error(\n 4,\n `[${ctx}][${externalName}][${remoteName}] Remote name not found in cache.`\n );\n } else {\n config.log.error(4, `[${ctx}][${remoteName}] Remote name not found in cache.`);\n }\n\n return new NFError('Could not create ImportMap.');\n });\n }\n}\n", "import type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { ForCommittingChanges } from '../../driver-ports/init/for-committing-changes.port';\nimport type { ImportMap } from 'lib/1.domain/import-map/import-map.contract';\nimport type { LoggingConfig } from 'lib/2.app/config';\n\nexport function createCommitChanges(\n config: LoggingConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'scopedExternalsRepo'\n | 'sharedExternalsRepo'\n | 'sharedChunksRepo'\n | 'browser'\n >\n): ForCommittingChanges {\n /**\n * Step 5: Commit all changes\n *\n * The changes made to the storage/cache are persisted to storage, and the importmap is\n * inserted into the HTML DOM.\n *\n * This step only runs if all previous steps were succesful to prevent the persistence of\n * erroneous changes into storage which can corrupt other pages/routes of the host.\n *\n * @param adapters\n */\n return (importMap: ImportMap) =>\n Promise.resolve(importMap).then(addToBrowser).then(persistRepositoryChanges);\n\n function addToBrowser(importMap: ImportMap) {\n ports.browser.setImportMapFn(importMap);\n config.log.debug(5, 'Added import map to browser.', importMap);\n return importMap;\n }\n\n function persistRepositoryChanges() {\n ports.remoteInfoRepo.commit();\n ports.scopedExternalsRepo.commit();\n ports.sharedExternalsRepo.commit();\n ports.sharedChunksRepo.commit();\n return;\n }\n}\n", "import type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { ForExposingModuleLoader } from '../../driver-ports/init/for-exposing-module-loader.port';\nimport type { LoadRemoteModule } from 'lib/init-federation.contract';\nimport { NFError } from 'lib/native-federation.error';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport * as _path from 'lib/utils/path';\n\nexport function createExposeModuleLoader(\n config: LoggingConfig,\n ports: Pick<DrivingContract, 'remoteInfoRepo' | 'browser'>\n): ForExposingModuleLoader {\n const loadRemoteModule: LoadRemoteModule = <TModule = unknown>(\n remoteName: string,\n exposedModule: string\n ): Promise<TModule> => {\n try {\n if (!ports.remoteInfoRepo.contains(remoteName)) {\n throw new NFError(`Remote '${remoteName}' is not initialized.`);\n }\n\n const remoteModuleUrl = ports.remoteInfoRepo\n .tryGetModule(remoteName, exposedModule)\n .orThrow(\n new NFError(\n `Exposed module '${exposedModule}' from remote '${remoteName}' not found in storage.`\n )\n );\n\n config.log.debug(6, `Loading initialized module '${remoteModuleUrl}'`);\n\n return ports.browser.importModule(remoteModuleUrl) as Promise<TModule>;\n } catch (error) {\n config.log.error(6, `Failed to load module ${_path.join(remoteName, exposedModule)}: `, {\n error,\n });\n\n return Promise.reject(\n new NFError(`Failed to load module ${_path.join(remoteName, exposedModule)}`)\n );\n }\n };\n\n /**\n * Step 6: expose module loader\n *\n * The module loader can only be used after the importmap was generated and added to\n * the DOM, hence the module loader fn is exposed to the host after the final commit\n * step.\n *\n * The loadRemoteModule is also a callback that is returned as a promise by the initFederation\n * function. This way the loadRemoteModule can be shared througout the host application using\n * CustomEvents or by adding it to the global Window object for easy access.\n *\n * @param adapters\n */\n return () => Promise.resolve(loadRemoteModule);\n}\n", "import type { FLOW_FACTORY } from 'lib/2.app/driver-ports/flow-factory.contract';\nimport type { InitDriversContract } from 'lib/2.app/driver-ports/init/drivers.contract';\nimport type { InitFlow } from 'lib/2.app/driver-ports/init/flow.contract';\nimport { createGetRemoteEntries } from '../../2.app/flows/init/get-remote-entries';\nimport { createProcessRemoteEntries } from '../../2.app/flows/init/process-remote-entries';\nimport { createDetermineSharedExternals } from '../../2.app/flows/init/determine-shared-externals';\nimport { createGenerateImportMap } from '../../2.app/flows/init/generate-import-map';\nimport { createCommitChanges } from '../../2.app/flows/init/commit-changes';\nimport { createExposeModuleLoader } from '../../2.app/flows/init/expose-module-loader';\nimport type { DrivingContract } from '../../2.app/driving-ports/driving.contract';\nimport type { ConfigContract } from '../../2.app/config/config.contract';\n\nexport const createInitDrivers = ({\n config,\n adapters,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n}): InitDriversContract => ({\n getRemoteEntries: createGetRemoteEntries(config, adapters),\n processRemoteEntries: createProcessRemoteEntries(config, adapters),\n determineSharedExternals: createDetermineSharedExternals(config, adapters),\n generateImportMap: createGenerateImportMap(config, adapters),\n commitChanges: createCommitChanges(config, adapters),\n exposeModuleLoader: createExposeModuleLoader(config, adapters),\n});\n\nexport const INIT_FLOW_FACTORY = ({\n config,\n adapters,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n}): FLOW_FACTORY<InitDriversContract> => {\n const flow = createInitDrivers({ config, adapters });\n\n return {\n flow,\n adapters,\n config,\n };\n};\n\nexport const createInitFlow = ({\n flow,\n adapters,\n config,\n}: FLOW_FACTORY<InitDriversContract>): InitFlow => {\n return remotesOrManifestUrl =>\n flow\n .getRemoteEntries(remotesOrManifestUrl)\n .then(flow.processRemoteEntries)\n .then(flow.determineSharedExternals)\n .then(flow.generateImportMap)\n .then(flow.commitChanges)\n .then(flow.exposeModuleLoader)\n .then(loadRemoteModule => ({\n config,\n adapters,\n loadRemoteModule,\n }));\n};\n", "import type { ImportMap } from 'lib/1.domain/import-map/import-map.contract';\nimport type { RemoteEntry, SharedInfoActions } from 'lib/1.domain';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport * as _path from 'lib/utils/path';\nimport type { ForConvertingToImportMap } from 'lib/2.app/driver-ports/dynamic-init/for-converting-to-import-map';\nimport type { DrivingContract } from 'lib/sdk.index';\nimport { toChunkImport } from '@softarc/native-federation/domain';\n\nexport function createConvertToImportMap(\n { log }: LoggingConfig,\n ports: Pick<DrivingContract, 'sharedChunksRepo'>\n): ForConvertingToImportMap {\n return ({ entry, actions }) => {\n const importMap: ImportMap = { imports: {} };\n\n addExternals(entry, actions, importMap);\n addRemoteInfos(entry, importMap);\n log.debug(9, `[${entry.name}] Processed actions:`, actions);\n return Promise.resolve(importMap);\n };\n\n function addExternals(\n remoteEntry: RemoteEntry,\n actions: SharedInfoActions,\n importMap: ImportMap\n ): void {\n if (!remoteEntry.shared) {\n return;\n }\n\n const remoteEntryScope = _path.getScope(remoteEntry.url);\n const integrityMap = remoteEntry.integrity;\n\n const chunkBundles = new Set<string>(['mapping-or-exposed']);\n remoteEntry.shared.forEach(external => {\n // Scoped externals\n if (!external.singleton) {\n const url = _path.join(remoteEntryScope, external.outFileName);\n addToScopes(remoteEntryScope, external.packageName, url, importMap);\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n if (external?.bundle) chunkBundles.add(external?.bundle);\n return;\n }\n\n if (!actions[external.packageName]) {\n log.warn(\n 9,\n `[${remoteEntry.name}] No action defined for shared external '${external.packageName}', skipping.`\n );\n return;\n }\n\n // Skipped shared externals\n if (actions[external.packageName]!.action === 'skip') {\n if (!external.shareScope) return;\n\n if (actions[external.packageName]!.override) {\n addToScopes(\n remoteEntryScope,\n external.packageName,\n actions[external.packageName]!.override!,\n importMap\n );\n return;\n }\n }\n\n // Chunks for shared externals\n if (external?.bundle) chunkBundles.add(external?.bundle);\n\n // Scoped shared externals\n if (actions[external.packageName]!.action === 'scope') {\n const url = _path.join(remoteEntryScope, external.outFileName);\n addToScopes(remoteEntryScope, external.packageName, url, importMap);\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n return;\n }\n\n // Shared externals with shareScope\n if (external.shareScope) {\n const url = _path.join(remoteEntryScope, external.outFileName);\n addToScopes(remoteEntryScope, external.packageName, url, importMap);\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n return;\n }\n\n // Default case: shared globally\n const url = _path.join(remoteEntryScope, external.outFileName);\n importMap.imports[external.packageName] = url;\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n });\n\n addChunkImports(importMap, remoteEntry, remoteEntryScope, chunkBundles);\n }\n\n function addToScopes(\n scope: string,\n packageName: string,\n url: string,\n importMap: ImportMap\n ): void {\n if (!importMap.scopes) importMap.scopes = {};\n if (!importMap.scopes[scope]) importMap.scopes[scope] = {};\n importMap.scopes[scope][packageName] = url;\n }\n\n function addRemoteInfos(remoteEntry: RemoteEntry, importMap: ImportMap): void {\n if (!remoteEntry.exposes) return;\n const scope = _path.getScope(remoteEntry.url);\n\n remoteEntry.exposes.forEach(exposed => {\n const moduleName = _path.join(remoteEntry.name, exposed.key);\n const moduleUrl = _path.join(scope, exposed.outFileName);\n importMap.imports[moduleName] = moduleUrl;\n addIntegrity(importMap, moduleUrl, remoteEntry.integrity, exposed.outFileName);\n });\n }\n\n function addChunkImports(\n importMap: ImportMap,\n remoteEntry: RemoteEntry,\n remoteEntryScope: string,\n chunkBundles: Set<string>\n ) {\n Array.from(chunkBundles).forEach(bundleName => {\n ports.sharedChunksRepo.tryGet(remoteEntry.name, bundleName).ifPresent(files => {\n files.forEach(file => {\n const url = _path.join(remoteEntryScope, file);\n addToScopes(remoteEntryScope, toChunkImport(file), url, importMap);\n addIntegrity(importMap, url, remoteEntry.integrity, file);\n });\n });\n });\n return importMap;\n }\n\n function addIntegrity(\n importMap: ImportMap,\n url: string,\n integrityMap: Record<string, string> | undefined,\n file: string\n ): void {\n const hash = integrityMap?.[file];\n if (!hash) return;\n if (!importMap.integrity) importMap.integrity = {};\n importMap.integrity[url] = hash;\n }\n}\n", "import type { RemoteEntryUrl } from 'lib/1.domain/remote-entry/manifest.contract';\nimport type { RemoteName } from 'lib/1.domain/remote/remote-info.contract';\nimport type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport { NFError } from 'lib/native-federation.error';\nimport type { ModeConfig } from '../../config/mode.contract';\nimport type { ForGettingRemoteEntry } from '../../driver-ports/dynamic-init/for-getting-remote-entry.port';\nimport type { RemoteRef } from '../../driver-ports/dynamic-init/flow.contract';\nimport { Optional } from 'lib/utils/optional';\nimport type { RemoteEntry } from 'lib/1.domain';\nimport * as _path from 'lib/utils/path';\n\nconst normalizeRemoteRef = (\n remote?: RemoteRef\n): { name?: RemoteName; integrity?: string } => {\n if (!remote) return {};\n if (typeof remote === 'string') return { name: remote };\n return remote;\n};\n\nexport function createGetRemoteEntry(\n config: LoggingConfig & ModeConfig,\n ports: Pick<DrivingContract, 'remoteEntryProvider' | 'remoteInfoRepo' | 'sse'>\n): ForGettingRemoteEntry {\n return async (remoteEntryUrl: RemoteEntryUrl, remote?: RemoteRef) => {\n const { name: remoteName, integrity } = normalizeRemoteRef(remote);\n\n if (!!remoteName && shouldSkipCachedRemote(remoteEntryUrl, remoteName)) {\n config.log.debug(7, `Found remote '${remoteName}' in storage, omitting fetch.`);\n return Optional.empty<RemoteEntry>();\n }\n\n try {\n const remoteEntry = integrity\n ? await ports.remoteEntryProvider.provide(remoteEntryUrl, { integrity })\n : await ports.remoteEntryProvider.provide(remoteEntryUrl);\n\n config.log.debug(\n 7,\n `[${remoteEntry.name}] Fetched from '${remoteEntry.url}', exposing: ${JSON.stringify(remoteEntry.exposes)}`\n );\n\n if (!!remoteName && remoteEntry.name !== remoteName) {\n const errorMsg = `Fetched remote '${remoteEntry.name}' does not match requested '${remoteName}'.`;\n if (config.strict.strictRemoteEntry) {\n config.log.error(7, errorMsg);\n throw new NFError('Could not fetch remote entry');\n }\n config.log.warn(7, errorMsg + ' Omitting expected name.');\n }\n\n if (ports.remoteInfoRepo.contains(remoteEntry.name)) {\n remoteEntry.override = true;\n config.log.debug(7, `Overriding existing remote '${remoteName}' with '${remoteEntryUrl}'.`);\n }\n return Optional.of(checkForSSE(remoteEntry));\n } catch (error) {\n config.log.error(\n 7,\n `[${remoteName ?? 'unknown'}] Could not fetch remoteEntry from ${remoteEntryUrl}.`,\n error\n );\n return Promise.reject(\n new NFError(`[${remoteName ?? remoteEntryUrl}] Could not fetch remoteEntry.`)\n );\n }\n };\n\n function shouldSkipCachedRemote(remoteEntryUrl: string, remoteName: RemoteName): boolean {\n return ports.remoteInfoRepo\n .tryGet(remoteName)\n .map(\n cachedRemoteInfo =>\n config.profile.overrideCachedRemotes !== 'always' ||\n (!config.profile.overrideCachedRemotesIfURLMatches &&\n remoteEntryUrl === _path.join(cachedRemoteInfo.scopeUrl, 'remoteEntry.json'))\n )\n .orElse(false);\n }\n\n function checkForSSE(entry: RemoteEntry): RemoteEntry {\n if (config.sse) {\n if (entry.buildNotificationsEndpoint) {\n ports.sse.watchRemoteBuilds(\n _path.join(_path.getScope(entry.url), entry.buildNotificationsEndpoint)\n );\n config.log.debug(7, `Registered SSE endpoint of remote '${entry.name}' `);\n } else {\n config.log.debug(7, `Remote ${entry.name} has no defined 'buildNotificationsEndpoint'`);\n }\n }\n return entry;\n }\n}\n", "import type { ForUpdatingCache } from '../../driver-ports/dynamic-init/for-updating-cache';\nimport {\n type ScopedVersion,\n type RemoteEntry,\n type RemoteInfo,\n type RemoteName,\n type SharedInfo,\n type SharedInfoActions,\n type SharedVersion,\n type SharedVersionAction,\n type SharedVersionMeta,\n type SharedExternal,\n GLOBAL_SCOPE,\n} from 'lib/1.domain';\nimport type { DrivingContract } from '../../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../../config/log.contract';\nimport * as _path from 'lib/utils/path';\nimport { NFError } from 'lib/native-federation.error';\nimport type { ModeConfig } from 'lib/2.app/config/mode.contract';\n\nexport function createUpdateCache(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'sharedExternalsRepo'\n | 'scopedExternalsRepo'\n | 'sharedChunksRepo'\n | 'versionCheck'\n >\n): ForUpdatingCache {\n return remoteEntry => {\n try {\n if (remoteEntry?.override) removeCachedRemoteEntry(remoteEntry);\n addRemoteInfoToStorage(remoteEntry);\n const actions = mergeExternalsIntoStorage(remoteEntry);\n addSharedChunksToStorage(remoteEntry);\n\n return Promise.resolve({ entry: remoteEntry, actions });\n } catch (error) {\n return Promise.reject(error);\n }\n };\n\n function removeCachedRemoteEntry(remoteEntry: RemoteEntry): void {\n ports.remoteInfoRepo.remove(remoteEntry.name);\n ports.scopedExternalsRepo.remove(remoteEntry.name);\n ports.sharedExternalsRepo.removeFromAllScopes(remoteEntry.name);\n }\n\n function addRemoteInfoToStorage({ name, url, exposes }: RemoteEntry) {\n ports.remoteInfoRepo.addOrUpdate(name, {\n scopeUrl: _path.getScope(url),\n exposes: Object.values(exposes ?? []).map(m => ({\n moduleName: m.key,\n file: m.outFileName,\n })),\n } as RemoteInfo);\n }\n\n function mergeExternalsIntoStorage(remoteEntry: RemoteEntry): SharedInfoActions {\n const actions: SharedInfoActions = {};\n remoteEntry.shared.forEach(external => {\n if (!external.version || !ports.versionCheck.isValidSemver(external.version)) {\n const errorMsg = `[${remoteEntry.name}][${external.packageName}] Version '${external.version}' is not a valid version.`;\n\n if (config.strict.strictExternalVersion) {\n config.log.error(8, errorMsg);\n throw new NFError(`Could not process remote '${remoteEntry.name}'`);\n }\n config.log.warn(8, errorMsg);\n }\n\n if (external.singleton) {\n const { action, sharedVersion } = addSharedExternal(remoteEntry.name, external);\n actions[external.packageName] = { action };\n\n if (action === 'skip' && external.shareScope && sharedVersion?.remotes[0]?.file) {\n actions[external.packageName]!.override = ports.remoteInfoRepo\n .tryGet(sharedVersion.remotes[0]!.name)\n .map(remote => _path.join(remote.scopeUrl, sharedVersion.remotes[0]!.file))\n .orThrow(() => {\n config.log.error(\n 8,\n `[${external.shareScope ?? GLOBAL_SCOPE}][${remoteEntry.name}][${\n external.packageName\n }@${external.version}][override] Remote name not found in cache.`\n );\n return new NFError(\n `Could not find override url from remote ${sharedVersion.remotes[0]!.name}`\n );\n });\n }\n } else {\n addScopedExternal(remoteEntry.name, external);\n }\n });\n return actions;\n }\n\n function addSharedChunksToStorage(remoteEntry: RemoteEntry): void {\n if (!remoteEntry.chunks) return;\n config.log.debug(\n 8,\n `Adding chunks for remote \"${remoteEntry.name}\", bundles: [${Object.keys(remoteEntry.chunks).join(', ')}]`\n );\n Object.entries(remoteEntry.chunks).forEach(([bundleName, chunks]) => {\n ports.sharedChunksRepo.addOrReplace(remoteEntry.name, bundleName, chunks);\n });\n }\n\n function addSharedExternal(\n remoteName: RemoteName,\n sharedInfo: SharedInfo\n ): { action: SharedVersionAction; sharedVersion?: SharedVersion } {\n const cached: SharedExternal = ports.sharedExternalsRepo\n .tryGet(sharedInfo.packageName, sharedInfo.shareScope)\n .orElse({ dirty: false, versions: [] });\n\n let action: SharedVersionAction = 'skip';\n\n const tag =\n sharedInfo.version ?? ports.versionCheck.smallestVersion(sharedInfo.requiredVersion);\n const remote: SharedVersionMeta = {\n file: sharedInfo.outFileName,\n strictVersion: sharedInfo.strictVersion,\n requiredVersion: sharedInfo.requiredVersion || tag,\n name: remoteName,\n bundle: sharedInfo.bundle,\n cached: false,\n };\n\n const scopeType = ports.sharedExternalsRepo.scopeType(sharedInfo.shareScope);\n\n if (scopeType === 'strict') {\n remote.requiredVersion = tag;\n action = 'share';\n }\n\n const sharedVersion = cached.versions.find(c => c.action === 'share');\n const isCompatible =\n !sharedVersion || ports.versionCheck.isCompatible(sharedVersion.tag, remote.requiredVersion);\n\n if (action === 'skip' && !isCompatible && remote.strictVersion) {\n action = 'scope';\n const errorMsg = `[${sharedInfo.shareScope ?? GLOBAL_SCOPE}][${remoteName}] ${\n sharedInfo.packageName\n }@${sharedInfo.version} Is not compatible with existing ${sharedInfo.packageName}@${\n sharedVersion!.tag\n } requiredRange '${sharedVersion!.remotes[0]?.requiredVersion}'`;\n\n if (config.strict.strictExternalCompatibility) {\n config.log.error(8, errorMsg);\n throw new NFError(`Could not process remote '${remoteName}'`);\n }\n config.log.warn(8, errorMsg);\n }\n\n const matchingVersion = cached.versions.find(cached => cached.tag === tag);\n\n if (!!matchingVersion) {\n if (\n remote.strictVersion &&\n matchingVersion.remotes[0]!.requiredVersion !== remote.requiredVersion\n ) {\n const errorMsg = `[${remoteName}][${sharedInfo.packageName}@${\n sharedInfo.version\n }] Required version '${remote.requiredVersion}' does not match existing '${\n matchingVersion.remotes[0]!.requiredVersion\n }'`;\n if (config.strict.strictExternalCompatibility) {\n config.log.error(8, errorMsg);\n throw new NFError(`Could not process remote '${remoteName}'`);\n }\n config.log.warn(8, errorMsg);\n }\n matchingVersion.remotes.push(remote);\n } else {\n if (!sharedVersion) action = 'share';\n remote.cached = action !== 'skip';\n cached.versions.push({ tag, action, host: false, remotes: [remote] });\n }\n\n ports.sharedExternalsRepo.addOrUpdate(\n sharedInfo.packageName,\n {\n dirty: cached.dirty,\n versions: cached.versions.sort((a, b) => ports.versionCheck.compare(b.tag, a.tag)),\n },\n sharedInfo.shareScope\n );\n\n return { action, sharedVersion };\n }\n\n function addScopedExternal(remoteName: RemoteName, sharedInfo: SharedInfo): void {\n ports.scopedExternalsRepo.addExternal(remoteName, sharedInfo.packageName, {\n tag: sharedInfo.version ?? ports.versionCheck.smallestVersion(sharedInfo.requiredVersion),\n file: sharedInfo.outFileName,\n bundle: sharedInfo.bundle,\n } as ScopedVersion);\n }\n}\n", "import type { RemoteEntry } from 'lib/1.domain';\nimport type { DynamicInitFlow } from 'lib/2.app/driver-ports/dynamic-init/flow.contract';\nimport type { FLOW_FACTORY } from 'lib/2.app/driver-ports/flow-factory.contract';\nimport { createConvertToImportMap } from 'lib/2.app/flows/dynamic-init/convert-to-import-map';\nimport { createGetRemoteEntry } from 'lib/2.app/flows/dynamic-init/get-remote-entry';\nimport { createUpdateCache } from 'lib/2.app/flows/dynamic-init/update-cache';\nimport { createCommitChanges } from 'lib/2.app/flows/init/commit-changes';\nimport type { DynamicInitDriversContract } from 'lib/audit.index';\nimport type { DrivingContract } from '../../2.app/driving-ports/driving.contract';\nimport type { ConfigContract } from '../../2.app/config/config.contract';\n\nexport const createDynamicInitDrivers = ({\n config,\n adapters,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n}): DynamicInitDriversContract => ({\n getRemoteEntry: createGetRemoteEntry(config, adapters),\n updateCache: createUpdateCache(config, adapters),\n convertToImportMap: createConvertToImportMap(config, adapters),\n commitChanges: createCommitChanges(config, adapters),\n});\n\nexport const DYNAMIC_INIT_FLOW_FACTORY = ({\n config,\n adapters,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n}): FLOW_FACTORY<DynamicInitDriversContract> => {\n const flow = createDynamicInitDrivers({ config, adapters });\n\n return {\n flow,\n adapters,\n config,\n };\n};\n\nexport const createDynamicInitFlow = ({\n flow,\n adapters,\n config,\n}: FLOW_FACTORY<DynamicInitDriversContract>): DynamicInitFlow => {\n const processDynamicRemoteEntry = async (remoteEntry: RemoteEntry) => {\n return flow.updateCache(remoteEntry).then(flow.convertToImportMap).then(flow.commitChanges);\n };\n const initRemoteEntry: DynamicInitFlow = (remoteEntryUrl, remote) =>\n flow\n .getRemoteEntry(remoteEntryUrl, remote)\n .then(entry => entry.map(processDynamicRemoteEntry).orElse(Promise.resolve()))\n .then(() => ({\n config,\n adapters,\n initRemoteEntry,\n }));\n\n return initRemoteEntry;\n};\n", "import { register } from 'node:module';\nimport { MessageChannel } from 'node:worker_threads';\nimport type { ImportMap } from 'lib/1.domain';\nimport { getLoaderUrl } from './loader-url';\n\n/** Per-specifier list of export names to bridge from the host's instances. */\nexport type HostInstanceKeys = Record<string, string[]>;\n\ntype IncomingMessage = { type: 'import-map-applied' } | { type: 'host-instances-applied' };\ntype OutgoingMessage =\n | { type: 'set-import-map'; map: ImportMap }\n | { type: 'set-host-instances'; keys: HostInstanceKeys };\n\nexport type NodeLoaderClient = {\n setMap: (map: ImportMap) => Promise<void>;\n setHostInstances: (keys: HostInstanceKeys) => Promise<void>;\n ready: () => Promise<void>;\n};\n\nexport const NODE_LOADER_CLIENT_ACK_TIMEOUT_MS = 10_000;\n\nlet cached: NodeLoaderClient | null = null;\n\nconst createClient = (): NodeLoaderClient => {\n const { port1, port2 } = new MessageChannel();\n register(getLoaderUrl(), {\n data: { port: port2 },\n transferList: [port2],\n });\n\n // Don't let the client keep the process alive on its own.\n port1.unref();\n\n let pending: Promise<void> = Promise.resolve();\n\n // Specifiers bridged to host instances. The loader resolves these ahead of\n // the import map, so we strip them from the map we post \u2014 no dead entries.\n const bridged = new Set<string>();\n const omitBridged = (map: ImportMap): ImportMap => {\n if (bridged.size === 0) return map;\n const drop = (imports: ImportMap['imports']): ImportMap['imports'] =>\n Object.fromEntries(Object.entries(imports).filter(([specifier]) => !bridged.has(specifier)));\n const scopes = map.scopes\n ? Object.fromEntries(Object.entries(map.scopes).map(([scope, imports]) => [scope, drop(imports)]))\n : map.scopes;\n return { ...map, imports: drop(map.imports), ...(scopes ? { scopes } : {}) };\n };\n\n const postAndAwaitAck = (\n message: OutgoingMessage,\n ackType: IncomingMessage['type']\n ): Promise<void> =>\n new Promise<void>((resolve, reject) => {\n let timer: ReturnType<typeof setTimeout> | null = null;\n const cleanup = (): void => {\n port1.off('message', onMessage);\n if (timer !== null) clearTimeout(timer);\n };\n const onMessage = (msg: IncomingMessage): void => {\n if (msg?.type === ackType) {\n cleanup();\n resolve();\n }\n };\n port1.on('message', onMessage);\n timer = setTimeout(() => {\n cleanup();\n reject(\n new Error(\n `node-loader.client: loader did not acknowledge ${message.type} within ${NODE_LOADER_CLIENT_ACK_TIMEOUT_MS}ms`\n )\n );\n }, NODE_LOADER_CLIENT_ACK_TIMEOUT_MS);\n (timer as { unref?: () => void }).unref?.();\n try {\n port1.postMessage(message);\n } catch (err) {\n cleanup();\n reject(err);\n }\n });\n\n // Serialize every post on a single chain so set-import-map and\n // set-host-instances can never race each other on the loader thread.\n const enqueue = (message: OutgoingMessage, ackType: IncomingMessage['type']): Promise<void> => {\n const next = pending.catch(() => undefined).then(() => postAndAwaitAck(message, ackType));\n pending = next;\n return next;\n };\n\n const setMap = (map: ImportMap): Promise<void> =>\n enqueue({ type: 'set-import-map', map: omitBridged(map) }, 'import-map-applied');\n\n const setHostInstances = (keys: HostInstanceKeys): Promise<void> => {\n Object.keys(keys).forEach(specifier => bridged.add(specifier));\n return enqueue({ type: 'set-host-instances', keys }, 'host-instances-applied');\n };\n\n return {\n setMap,\n setHostInstances,\n ready: () => pending,\n };\n};\n\nexport const getNodeLoaderClient = (): NodeLoaderClient => {\n if (!cached) cached = createClient();\n return cached;\n};\n\n/** Only used by tests. */\nexport const _resetNodeLoaderClient = (): void => {\n cached = null;\n};\n", "import { createRequire } from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport { NFError } from 'lib/native-federation.error';\n\n/**\n * Resolves the bundled Node loader (`dist/node-loader/loader.mjs`) via the\n * package's own `exports` map. Self-resolving by name (rather than a relative\n * URL from `import.meta.url`) keeps this working under bundlers, pnpm, Yarn\n * PnP, and monorepo symlinks where the on-disk layout of the installed package\n * is not predictable.\n */\nexport const getLoaderUrl = () => {\n try {\n const require = createRequire(import.meta.url);\n return pathToFileURL(\n require.resolve('@softarc/native-federation-orchestrator/node-loader/loader.mjs')\n );\n } catch (err) {\n const cause = err instanceof Error ? err : new Error(String(err));\n throw new NFError(\n `Could not locate the bundled node-loader at '@softarc/native-federation-orchestrator/node-loader/loader.mjs'. Ensure it is installed, and that its 'exports' map exposes this subpath: ${cause.message}`,\n cause\n );\n }\n};\n", "import type { ImportMap } from 'lib/1.domain';\nimport type { ImportMapConfig } from 'lib/2.app/config/import-map.contract';\nimport {\n getNodeLoaderClient,\n type NodeLoaderClient,\n type HostInstanceKeys,\n} from 'lib/3.adapters/node/node-loader.client';\n\ntype NodeImportMapConfig = ImportMapConfig & {\n nodeLoader: NodeLoaderClient;\n setHostInstancesFn: (keys: HostInstanceKeys) => Promise<HostInstanceKeys>;\n};\n\nconst useNodeImportMap = (): NodeImportMapConfig => {\n const nodeLoader = getNodeLoaderClient();\n return {\n nodeLoader,\n loadModuleFn: (url: string) => import(/* @vite-ignore */ url),\n setImportMapFn: (importMap: ImportMap) => nodeLoader.setMap(importMap).then(() => importMap),\n setHostInstancesFn: (keys: HostInstanceKeys) => nodeLoader.setHostInstances(keys).then(() => keys),\n reloadBrowserFn: () => {\n /* no-op */\n },\n };\n};\n\nexport { useNodeImportMap };\n", "import type { HostOptions } from 'lib/2.app/config/host.contract';\nimport type { LogHandler } from 'lib/2.app/config/log.contract';\nimport type { ForProvidingRemoteEntries } from 'lib/2.app/driving-ports/for-providing-remote-entries.port';\n\n/** Specifier \u2192 module namespace object to bridge into remotes (the host's own instances). */\nexport type HostInstanceMap = Record<string, object>;\n\n/**\n * Auto-derive the bridged specifiers from the host remoteEntry's shared\n * singletons instead of listing them by hand. Each derived specifier is loaded\n * in the host realm (so the captured instance is the host's) and published.\n */\nexport type HostInstancesAuto = {\n /** Only bridge specifiers matching one of these (exact or prefix, e.g. `'@angular/'`). */\n include?: string[];\n /** Never bridge specifiers matching one of these (exact or prefix). */\n exclude?: string[];\n /**\n * How to load each instance. Default: `(s) => import(s)`.\n *\n * The default resolves wherever this library runs. Under a bundler-driven dev\n * server (e.g. Vite SSR) that may NOT be the realm holding the host's running\n * instance \u2014 pass a `load` defined in your own host entry so the import\n * resolves through the host's module graph and captures the real instance.\n */\n load?: (specifier: string) => Promise<object>;\n};\n\nexport type HostInstancesOption =\n /** Explicit map of specifier \u2192 already-loaded namespace. */\n | HostInstanceMap\n /** Auto-derive every shared singleton from the host remoteEntry. */\n | 'all'\n /** Auto-derive, filtered. */\n | HostInstancesAuto;\n\ntype Deps = {\n remoteEntryProvider: ForProvidingRemoteEntries;\n hostRemoteEntry: HostOptions['hostRemoteEntry'];\n log: LogHandler;\n};\n\n/** A pattern matches a specifier on exact equality or as a prefix. */\nconst matches = (specifier: string, patterns: string[]): boolean =>\n patterns.some(p => specifier === p || specifier.startsWith(p));\n\n/** Distinguish the auto forms (`'all'` / filter object) from an explicit map. */\nconst isAuto = (option: HostInstancesOption): option is 'all' | HostInstancesAuto =>\n option === 'all' ||\n (typeof option === 'object' &&\n option !== null &&\n ('include' in option || 'exclude' in option || 'load' in option));\n\n/**\n * Turn the `hostInstances` option into a concrete `{ specifier: namespace }` map.\n *\n * - Explicit map \u2192 returned as-is.\n * - `'all'` / `{ include, exclude }` \u2192 read the host remoteEntry's shared\n * singletons, apply the filter, and import each in the host realm.\n *\n * A specifier that fails to load is skipped with a warning rather than aborting\n * init \u2014 the remote falls back to import-map resolution for it (which is the\n * pre-bridge behaviour).\n */\nexport const resolveHostInstances = async (\n option: HostInstancesOption | undefined,\n deps: Deps\n): Promise<HostInstanceMap | undefined> => {\n if (!option) return undefined;\n if (!isAuto(option)) return option;\n\n const auto: HostInstancesAuto = option === 'all' ? {} : option;\n\n const { hostRemoteEntry } = deps;\n if (!hostRemoteEntry) {\n deps.log.warn(\n 0,\n '[native-federation] hostInstances auto mode needs a hostRemoteEntry to derive shared singletons from; skipping.'\n );\n return undefined;\n }\n\n const url = typeof hostRemoteEntry === 'string' ? hostRemoteEntry : hostRemoteEntry.url;\n const integrity = typeof hostRemoteEntry === 'string' ? undefined : hostRemoteEntry.integrity;\n const entry = await deps.remoteEntryProvider.provide(url, { integrity });\n\n const load = auto.load ?? ((specifier: string) => import(specifier));\n\n const specifiers = [...new Set((entry.shared ?? []).filter(s => s.singleton).map(s => s.packageName))]\n .filter(s => (auto.include ? matches(s, auto.include) : true))\n .filter(s => (auto.exclude ? !matches(s, auto.exclude) : true));\n\n const map: HostInstanceMap = {};\n for (const specifier of specifiers) {\n try {\n map[specifier] = (await load(specifier)) as object;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n deps.log.warn(\n 0,\n `[native-federation] hostInstances: could not load '${specifier}' from the host realm; skipping (${msg})`\n );\n }\n }\n\n deps.log.debug(0, `[native-federation] hostInstances bridged: ${Object.keys(map).join(', ') || '(none)'}`);\n return map;\n};\n", "import { pathToFileURL } from 'node:url';\nimport type { HostOptions } from 'lib/2.app/config/host.contract';\n\n/**\n * Coerce a Node-side string into a URL string. Anything that already starts\n * with a scheme (`http:`, `https:`, `file:`, `node:`, \u2026) passes through; a bare\n * filesystem path is converted to a `file://` URL via `pathToFileURL`.\n */\nconst URL_SCHEME = /^[a-z][a-z0-9+\\-.]*:/i;\n\nexport const toUrl = (pathOrUrl: string): string =>\n URL_SCHEME.test(pathOrUrl) ? pathOrUrl : pathToFileURL(pathOrUrl).href;\n\nexport const normalizeHostRemoteEntry = (\n hostRemoteEntry: HostOptions['hostRemoteEntry']\n): HostOptions['hostRemoteEntry'] => {\n if (!hostRemoteEntry) return hostRemoteEntry;\n if (typeof hostRemoteEntry === 'string') return toUrl(hostRemoteEntry);\n return { ...hostRemoteEntry, url: toUrl(hostRemoteEntry.url) };\n};\n", "import type { FederationManifest } from './1.domain';\nimport type { NFOptions, ConfigContract } from './2.app/config/config.contract';\nimport type { DrivingContract } from './2.app/driving-ports/driving.contract';\nimport type { RemoteRef } from './2.app/driver-ports/dynamic-init/flow.contract';\nimport type { LoadRemoteModuleOf, NativeFederationResult } from './init-federation.contract';\n\nimport { createBrowser } from './3.adapters/browser/browser';\nimport { createVersionCheck } from './3.adapters/checks/version.check';\nimport { createFsManifestProvider } from './3.adapters/node/fs-manifest-provider';\nimport { createFsRemoteEntryProvider } from './3.adapters/node/fs-remote-entry-provider';\nimport { createNoopSSE } from './3.adapters/node/noop-sse';\nimport { createRemoteInfoRepository } from './3.adapters/storage/remote-info.repository';\nimport { createScopedExternalsRepository } from './3.adapters/storage/scoped-externals.repository';\nimport { createSharedExternalsRepository } from './3.adapters/storage/shared-externals.repository';\nimport { createChunkRepository } from './3.adapters/storage/chunk.repository';\n\nimport { createConfigHandlers } from './5.di/config.factory';\nimport { createInitFlow, INIT_FLOW_FACTORY } from './5.di/flows/init.factory';\nimport {\n createDynamicInitFlow,\n DYNAMIC_INIT_FLOW_FACTORY,\n} from './5.di/flows/dynamic-init.factory';\nimport { useNodeImportMap } from './4.config/import-map/use-node';\nimport {\n resolveHostInstances,\n type HostInstancesOption,\n} from './4.config/import-map/resolve-host-instances';\nimport { normalizeHostRemoteEntry } from './utils/node/to-url';\n\nexport type { HostInstancesOption, HostInstancesAuto } from './4.config/import-map/resolve-host-instances';\n\nexport type InitNodeFederationOptions = NFOptions & {\n /**\n * Bridge specifiers to instances already loaded in the host process (dev).\n *\n * The host's instances are published on `globalThis.__NF_HOST_INSTANCES__`\n * and the node loader synthesizes a re-export module for each specifier\n * instead of resolving it through the import map, so remotes share the host's\n * singletons. Three forms:\n *\n * - **Explicit map** \u2014 `{ '@angular/core': await import('@angular/core') }`.\n * - **`'all'`** \u2014 auto-derive every shared singleton from the host remoteEntry\n * and import each in the host realm. Needs `hostRemoteEntry`.\n * - **`{ include, exclude }`** \u2014 auto-derive, filtered by exact/prefix match,\n * e.g. `{ include: ['@angular/', 'rxjs', 'zone.js'] }`.\n *\n * This is an escape hatch that bypasses the version resolver, the import map,\n * and integrity checks entirely. Exports are value snapshots, not live\n * bindings \u2014 fine for packages whose exports are stable refs (Angular's\n * classes/functions), not for packages that reassign their exports after init.\n *\n * Omit in production: with no `hostInstances`, nothing is published and the\n * loader never routes to the bridge \u2014 resolution is import-map only.\n */\n hostInstances?: HostInstancesOption;\n};\n\n/** Global key the node loader reads at module-eval time on the main thread. */\nconst HOST_INSTANCES_GLOBAL = '__NF_HOST_INSTANCES__';\n\nconst buildNodeAdapters = (config: ConfigContract): DrivingContract => ({\n versionCheck: createVersionCheck(),\n manifestProvider: createFsManifestProvider(),\n remoteEntryProvider: createFsRemoteEntryProvider(),\n remoteInfoRepo: createRemoteInfoRepository(config),\n scopedExternalsRepo: createScopedExternalsRepository(config),\n sharedExternalsRepo: createSharedExternalsRepository(config),\n sharedChunksRepo: createChunkRepository(config),\n browser: createBrowser(config),\n sse: createNoopSSE(),\n});\n\nconst initNodeFederation = (\n remotesOrManifestUrl: string | FederationManifest,\n options: InitNodeFederationOptions = {}\n): Promise<NativeFederationResult> => {\n const nodeConfig = useNodeImportMap();\n\n const hostRemoteEntry = normalizeHostRemoteEntry(options.hostRemoteEntry);\n\n const config = createConfigHandlers({\n ...options,\n hostRemoteEntry,\n loadModuleFn: options.loadModuleFn ?? nodeConfig.loadModuleFn,\n setImportMapFn: options.setImportMapFn ?? nodeConfig.setImportMapFn,\n reloadBrowserFn: options.reloadBrowserFn ?? nodeConfig.reloadBrowserFn,\n sse: false,\n });\n\n const adapters = buildNodeAdapters(config);\n\n // Host-instance bridge (dev): resolve the instance map (explicit, or\n // auto-derived from the host remoteEntry's shared singletons), publish it on\n // the global the loader reads, ship the export-key lists to the loader thread,\n // and wait for its ack before the init flow resolves any remote import. With\n // no hostInstances this is a no-op and resolution stays import-map only.\n const hostInstancesReady = (async () => {\n const instances = await resolveHostInstances(options.hostInstances, {\n remoteEntryProvider: adapters.remoteEntryProvider,\n hostRemoteEntry,\n log: config.log,\n });\n if (!instances || Object.keys(instances).length === 0) return;\n\n const globals = globalThis as Record<string, unknown>;\n globals[HOST_INSTANCES_GLOBAL] = {\n ...((globals[HOST_INSTANCES_GLOBAL] as Record<string, object> | undefined) ?? {}),\n ...instances,\n };\n const keys = Object.fromEntries(\n Object.entries(instances).map(([specifier, ns]) => [specifier, Object.keys(ns)])\n );\n await nodeConfig.setHostInstancesFn(keys);\n })();\n\n const stateDump = (msg: string) =>\n config.log.debug(0, msg, {\n remotes: { ...adapters.remoteInfoRepo.getAll() },\n 'shared-externals': adapters.sharedExternalsRepo\n .getScopes({ includeGlobal: true })\n .reduce(\n (acc, scope) => ({ ...acc, [scope]: adapters.sharedExternalsRepo.getFromScope(scope) }),\n {}\n ),\n 'scoped-externals': adapters.scopedExternalsRepo.getAll(),\n });\n\n const initFlow = createInitFlow(INIT_FLOW_FACTORY({ adapters, config }));\n const dynamicInitFlow = createDynamicInitFlow(DYNAMIC_INIT_FLOW_FACTORY({ config, adapters }));\n\n return hostInstancesReady\n .then(() => initFlow(remotesOrManifestUrl))\n .then(({ loadRemoteModule }) => nodeConfig.nodeLoader.ready().then(() => loadRemoteModule))\n .then(loadRemoteModule => {\n const output = {\n config,\n adapters,\n loadRemoteModule,\n as: <TModule = unknown>() => ({\n loadRemoteModule: loadRemoteModule as LoadRemoteModuleOf<TModule>,\n load: loadRemoteModule as LoadRemoteModuleOf<TModule>,\n }),\n load: loadRemoteModule,\n };\n\n const initRemoteEntry = async (\n remoteEntryUrl: string,\n remote?: RemoteRef\n ): Promise<NativeFederationResult> => {\n const remoteName = typeof remote === 'string' ? remote : remote?.name;\n return dynamicInitFlow(remoteEntryUrl, remote)\n .catch(e => {\n stateDump(`[dynamic-init][${remoteName ?? remoteEntryUrl}] STATE DUMP`);\n if (config.strict.strictRemoteEntry) return Promise.reject(e);\n else console.warn('Failed to initialize remote entry, continuing anyway.');\n return Promise.resolve();\n })\n .then(() => nodeConfig.nodeLoader.ready())\n .then(() => ({\n ...output,\n initRemoteEntry,\n }));\n };\n\n return {\n ...output,\n init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QAAM,kBAAkB,sBAAsB,0BAA0B,EAAE,QAAQ,SAAS,CAAC,CAAC;AAE7F,SAAO,mBACJ,KAAK,MAAM,SAAS,oBAAoB,CAAC,EACzC,KAAK,CAAC,EAAE,iBAAiB,MAAM,WAAW,WAAW,MAAM,EAAE,KAAK,MAAM,gBAAgB,CAAC,EACzF,KAAK,sBAAoB;AACxB,UAAM,SAAS;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,OAA0B;AAAA,QAC5B;AAAA,QACA,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,IACR;AAEA,UAAM,kBAAkB,OACtB,gBACA,WACoC;AACpC,YAAM,aAAa,OAAO,WAAW,WAAW,SAAS,QAAQ;AACjE,aAAO,gBAAgB,gBAAgB,MAAM,EAC1C,MAAM,OAAK;AACV,kBAAU,kBAAkB,cAAc,cAAc,cAAc;AACtE,YAAI,OAAO,OAAO,kBAAmB,QAAO,QAAQ,OAAO,CAAC;AAAA,YACvD,SAAQ,KAAK,uDAAuD;AACzE,eAAO,QAAQ,QAAQ;AAAA,MACzB,CAAC,EACA,KAAK,MAAM,WAAW,WAAW,MAAM,CAAC,EACxC,KAAK,OAAO;AAAA,QACX,GAAG;AAAA,QACH;AAAA,MACF,EAAE;AAAA,IACN;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC,EACA,MAAM,OAAK;AACV,cAAU,mBAAmB;AAC7B,WAAO,QAAQ,OAAO,CAAC;AAAA,EACzB,CAAC;AACL;",
|
|
6
|
-
"names": ["cached", "require_valid", "import_valid", "semverValid", "semverSatisfies", "semverCompare", "semverValidRange", "semverMinVersion", "importMap", "cached", "
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js", "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js", "../../src/lib/core/3.adapters/browser/browser.ts", "../../src/lib/core/3.adapters/checks/version.check.ts", "../../src/lib/core/native-federation.error.ts", "../../src/lib/utils/integrity.ts", "../../src/lib/node/utils/read-source.ts", "../../src/lib/node/adapters/fs-manifest-provider.ts", "../../src/lib/node/adapters/fs-remote-entry-provider.ts", "../../src/lib/node/adapters/noop-sse.ts", "../../src/lib/utils/path.ts", "../../src/lib/utils/optional.ts", "../../src/lib/core/3.adapters/storage/remote-info.repository.ts", "../../src/lib/core/3.adapters/storage/scoped-externals.repository.ts", "../../src/lib/core/1.domain/externals/external.contract.ts", "../../src/lib/core/3.adapters/storage/shared-externals.repository.ts", "../../src/lib/core/3.adapters/storage/chunk.repository.ts", "../../src/lib/core/4.config/import-map/trusted-types.ts", "../../src/lib/core/4.config/import-map/replace-in-dom.ts", "../../src/lib/core/4.config/import-map/use-default.ts", "../../src/lib/core/4.config/import-map/import-map.config.ts", "../../src/lib/core/4.config/host/host.config.ts", "../../src/lib/core/4.config/logging/noop.logger.ts", "../../src/lib/core/2.app/config/log.contract.ts", "../../src/lib/core/4.config/logging/log.handler.ts", "../../src/lib/core/4.config/logging/log.config.ts", "../../src/lib/utils/clone-entry.ts", "../../src/lib/core/4.config/storage/global-this.storage.ts", "../../src/lib/core/4.config/storage/storage.config.ts", "../../src/lib/core/4.config/mode/default.profile.ts", "../../src/lib/core/4.config/mode/mode.config.ts", "../../src/lib/core/5.di/config.factory.ts", "../../src/lib/core/2.app/flows/init.flow.ts", "../../src/lib/core/2.app/flows/init-remote-entry.flow.ts", "../../src/lib/core/2.app/steps/get-remote-entries.ts", "../../src/lib/core/2.app/steps/store-remote-entry.ts", "../../src/lib/core/2.app/steps/process-remote-entries.ts", "../../src/lib/core/2.app/steps/determine-shared-externals.ts", "../../node_modules/.pnpm/@softarc+native-federation@4.2.0_typescript@6.0.3/node_modules/@softarc/native-federation/dist/lib/domain/core/chunk.js", "../../src/lib/core/2.app/steps/generate-import-map.ts", "../../src/lib/core/2.app/steps/commit-changes.ts", "../../src/lib/core/2.app/steps/expose-module-loader.ts", "../../src/lib/core/2.app/steps/get-remote-entry.ts", "../../src/lib/core/2.app/steps/update-cache.ts", "../../src/lib/core/2.app/steps/convert-to-import-map.ts", "../../src/lib/core/5.di/init.factory.ts", "../../src/lib/core/5.di/federation-result.factory.ts", "../../src/lib/node/adapters/node-loader.client.ts", "../../src/lib/node/adapters/loader-url.ts", "../../src/lib/node/use-node.ts", "../../src/lib/node/resolve-host-instances.ts", "../../src/lib/node/utils/to-url.ts", "../../src/lib/node/init-federation.node.ts"],
|
|
4
|
+
"sourcesContent": ["'use strict'\n\nconst debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n", "'use strict'\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n", "'use strict'\n\nconst {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n// Non-numeric identifiers include numeric identifiers but can be longer.\n// Therefore non-numeric identifiers must go first.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifier, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n", "'use strict'\n\n// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n", "'use strict'\n\nconst numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a < b ? -1 : 1\n }\n\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n", "'use strict'\n\nconst debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\n\nconst isPrereleaseIdentifier = (prerelease, identifier) => {\n const identifiers = identifier.split('.')\n if (identifiers.length > prerelease.length) {\n return false\n }\n\n for (let i = 0; i < identifiers.length; i++) {\n if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {\n return false\n }\n }\n\n return true\n}\n\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n if (this.major < other.major) {\n return -1\n }\n if (this.major > other.major) {\n return 1\n }\n if (this.minor < other.minor) {\n return -1\n }\n if (this.minor > other.minor) {\n return 1\n }\n if (this.patch < other.patch) {\n return -1\n }\n if (this.patch > other.patch) {\n return 1\n }\n return 0\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (isPrereleaseIdentifier(this.prerelease, identifier)) {\n const prereleaseBase = this.prerelease[identifier.split('.').length]\n if (isNaN(prereleaseBase)) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n", "'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n", "'use strict'\n\nconst parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n", "'use strict'\n\nclass LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n", "'use strict'\n\nconst SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n", "'use strict'\n\nconst compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n", "'use strict'\n\nconst compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n", "'use strict'\n\nconst compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n", "'use strict'\n\nconst compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n", "'use strict'\n\nconst compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n", "'use strict'\n\nconst compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n", "'use strict'\n\nconst eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n", "'use strict'\n\nconst ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n", "'use strict'\n\nconst SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // strip build metadata so it can't bleed into the version\n range = range.replace(BUILDSTRIPRE, '')\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n src,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\n// unbounded global build-metadata stripper used by parseRange\nconst BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n comp = comp.replace(re[t.BUILD], '')\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\nconst invalidXRangeOrder = (M, m, p) => (\n (isX(M) && !isX(m)) ||\n (isX(m) && p && !isX(p))\n)\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n // if we're including prereleases in the match, then the lower bound is\n // -0, the lowest possible prerelease value, just like x-ranges and carets.\n // this keeps `~1.2` equivalent to the `1.2.x` x-range it's documented as.\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n if (invalidXRangeOrder(M, m, p)) {\n return comp\n }\n\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n", "'use strict'\n\nconst Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n", "'use strict'\n\nconst SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n", "'use strict'\n\nconst Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n", "import type { ForBrowserTasks } from 'lib/core/2.app/driving-ports/for-browser-tasks';\nimport type { ImportMapConfig } from 'lib/core/2.app/config/import-map.contract';\n\nconst createBrowser = (config: ImportMapConfig): ForBrowserTasks => {\n return {\n setImportMapFn: config.setImportMapFn,\n importModule: config.loadModuleFn,\n };\n};\n\nexport { createBrowser };\n", "import type { ForVersionChecking } from 'lib/core/2.app/driving-ports/for-version-checking.port';\nimport semverValid from 'semver/functions/valid';\nimport semverSatisfies from 'semver/functions/satisfies';\nimport semverCompare from 'semver/functions/compare';\nimport semverMinVersion from 'semver/ranges/min-version';\nimport semverValidRange from 'semver/ranges/valid';\n\nconst createVersionCheck = (): ForVersionChecking => {\n return {\n isValidSemver: function (version: string) {\n return semverValid(version) !== null;\n },\n isCompatible: function (version: string, range: string) {\n return semverSatisfies(version, range);\n },\n compare: function (versionA: string, versionB: string) {\n return semverCompare(versionA, versionB, true);\n },\n smallestVersion: function (versionRange: string) {\n if (!semverValidRange(versionRange)) return '0.0.0';\n const minVersion = semverMinVersion(versionRange);\n return minVersion?.raw ?? '0.0.0';\n },\n };\n};\n\nexport { createVersionCheck };\n", "class NFError extends Error {\n constructor(message: string, cause?: Error) {\n super(message, cause);\n this.name = 'NFError';\n }\n}\n\nexport { NFError };\n", "const SUPPORTED_ALGORITHMS = {\n 'sha256-': 'SHA-256',\n 'sha384-': 'SHA-384',\n 'sha512-': 'SHA-512',\n} as const;\n\ntype Prefix = keyof typeof SUPPORTED_ALGORITHMS;\n\nconst parseIntegrity = (integrity: string): { algorithm: string; expected: string } | null => {\n for (const prefix of Object.keys(SUPPORTED_ALGORITHMS) as Prefix[]) {\n if (integrity.startsWith(prefix)) {\n return { algorithm: SUPPORTED_ALGORITHMS[prefix], expected: integrity };\n }\n }\n return null;\n};\n\nconst toBase64 = (bytes: ArrayBuffer): string => {\n const view = new Uint8Array(bytes);\n let bin = '';\n for (let i = 0; i < view.length; i++) bin += String.fromCharCode(view[i]!);\n return btoa(bin);\n};\n\nexport const verifyIntegrity = async (bytes: ArrayBuffer, integrity: string): Promise<void> => {\n const parsed = parseIntegrity(integrity);\n if (!parsed) {\n throw new TypeError(\n `Unsupported integrity prefix in '${integrity}'. Expected sha256-, sha384-, or sha512-.`\n );\n }\n\n const subtle =\n typeof crypto !== 'undefined' && crypto.subtle ? crypto.subtle : undefined;\n if (!subtle) {\n throw new Error('SubtleCrypto is not available in this environment.');\n }\n\n const digest = await subtle.digest(parsed.algorithm, bytes);\n const actual =\n integrity.substring(0, integrity.indexOf('-') + 1) + toBase64(digest);\n\n if (actual !== parsed.expected) {\n throw new Error(`Integrity mismatch: expected ${parsed.expected}, got ${actual}`);\n }\n};\n", "import * as fs from 'node:fs/promises';\nimport { fileURLToPath } from 'node:url';\nimport { NFError } from 'lib/core/native-federation.error';\n\nconst isHttpUrl = (input: string): boolean =>\n input.startsWith('http://') || input.startsWith('https://');\n\nconst isFileUrl = (input: string): boolean => input.startsWith('file://');\n\nexport const readSourceBytes = async (input: string): Promise<ArrayBuffer> => {\n if (isHttpUrl(input)) {\n const response = await fetch(input);\n if (!response.ok) {\n throw new NFError(`${response.status} - ${response.statusText}`);\n }\n return response.arrayBuffer();\n }\n\n const path = isFileUrl(input) ? fileURLToPath(input) : input;\n const buffer = await fs.readFile(path);\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);\n};\n", "import type { FederationManifest } from 'lib/core/1.domain';\nimport type { ForProvidingManifest } from 'lib/core/2.app/driving-ports/for-providing-manifest.port';\nimport { NFError } from 'lib/core/native-federation.error';\nimport { verifyIntegrity } from 'lib/utils/integrity';\nimport { readSourceBytes } from 'lib/node/utils/read-source';\n\nconst createFsManifestProvider = (): ForProvidingManifest => {\n const formatError = (manifestUrl: string) => (err: unknown) => {\n if (err instanceof NFError) throw err;\n const msg = err instanceof Error ? err.message : String(err);\n throw new NFError(`Read of '${manifestUrl}' returned ${msg}`);\n };\n\n return {\n provide: async function (\n remotesOrManifestUrl: string | FederationManifest,\n opts: { integrity?: string } = {}\n ) {\n if (typeof remotesOrManifestUrl !== 'string') return remotesOrManifestUrl;\n\n try {\n const bytes = await readSourceBytes(remotesOrManifestUrl);\n if (opts.integrity) await verifyIntegrity(bytes, opts.integrity);\n return JSON.parse(new TextDecoder().decode(bytes)) as FederationManifest;\n } catch (err) {\n return formatError(remotesOrManifestUrl)(err);\n }\n },\n };\n};\n\nexport { createFsManifestProvider };\n", "import type { RemoteEntry } from 'lib/core/1.domain/remote-entry/remote-entry.contract';\nimport type { ForProvidingRemoteEntries } from 'lib/core/2.app/driving-ports/for-providing-remote-entries.port';\nimport { NFError } from 'lib/core/native-federation.error';\nimport { verifyIntegrity } from 'lib/utils/integrity';\nimport { readSourceBytes } from 'lib/node/utils/read-source';\n\nconst createFsRemoteEntryProvider = (): ForProvidingRemoteEntries => {\n const fillEmptyFields = (remoteEntryUrl: string) => (remoteEntry: RemoteEntry) => {\n if (!remoteEntry.exposes) remoteEntry.exposes = [];\n if (!remoteEntry.shared) remoteEntry.shared = [];\n if (!remoteEntry.url) remoteEntry.url = remoteEntryUrl;\n return remoteEntry;\n };\n\n const formatError = (remoteEntryUrl: string) => (err: unknown) => {\n if (err instanceof NFError) throw err;\n const msg = err instanceof Error ? err.message : String(err);\n throw new NFError(`Read of '${remoteEntryUrl}' returned ${msg}`);\n };\n\n return {\n provide: async function (remoteEntryUrl: string, opts: { integrity?: string } = {}) {\n try {\n const bytes = await readSourceBytes(remoteEntryUrl);\n if (opts.integrity) await verifyIntegrity(bytes, opts.integrity);\n const parsed = JSON.parse(new TextDecoder().decode(bytes)) as RemoteEntry;\n return fillEmptyFields(remoteEntryUrl)(parsed);\n } catch (err) {\n return formatError(remoteEntryUrl)(err);\n }\n },\n };\n};\n\nexport { createFsRemoteEntryProvider };\n", "import type { ForSSE } from 'lib/core/2.app/driving-ports/for-sse.port';\n\nconst createNoopSSE = (): ForSSE => ({\n watchRemoteBuilds: () => {\n /* no-op */\n },\n closeAll: () => {\n /* no-op */\n },\n});\n\nexport { createNoopSSE };\n", "function join(pathA: string, pathB: string): string {\n pathA = pathA.endsWith('/') ? pathA.slice(0, -1) : pathA;\n pathB = pathB.startsWith('/') ? pathB.slice(1) : pathB;\n return `${pathA}/${pathB}`;\n}\n\nfunction getScope(path: string) {\n if (!path) return '';\n\n const parts = path.split('/');\n\n if (parts[parts.length - 1] === '' || parts[parts.length - 1]!.includes('.')) {\n parts.pop();\n }\n if (parts.length < 1) return '';\n\n return `${parts.join('/')}/`;\n}\n\nexport { join, getScope };\n", "export class Optional<T> {\n private constructor(private item?: T) {}\n\n public static of<T>(item?: T): Optional<T> {\n return new Optional(item);\n }\n public static empty<U>(): Optional<U> {\n return Optional.of<U>(undefined);\n }\n\n public isPresent() {\n return typeof this.item !== 'undefined' && this.item !== null;\n }\n public set<U>(other: U) {\n return Optional.of(other);\n }\n\n public ifPresent(callback: (_: T) => void): void {\n if (this.isPresent()) callback(this.item as T);\n }\n\n public map<U>(callback: (_: NonNullable<T>) => U | Optional<U>): Optional<U> {\n if (!this.isPresent()) return Optional.empty();\n\n const result = callback(this.item as NonNullable<T>);\n return result instanceof Optional ? result : Optional.of(result);\n }\n\n public orElse(other: Required<T>): NonNullable<T> {\n return this.isPresent() ? (this.item as NonNullable<T>) : (other as NonNullable<T>);\n }\n\n public orThrow(error: Error | string | (() => Error)): NonNullable<T> {\n if (this.isPresent()) return this.item as NonNullable<T>;\n if (typeof error === 'function') throw error();\n throw typeof error === 'string' ? new Error(error) : error;\n }\n\n public get(): T | undefined {\n return this.item;\n }\n}\n", "import type { RemoteInfo, RemoteName, Remotes } from 'lib/core/1.domain';\nimport type { StorageConfig, StorageEntry } from 'lib/core/2.app/config/storage.contract';\nimport type { ForRemoteInfoStorage } from 'lib/core/2.app/driving-ports/for-remote-info-storage.port';\nimport * as _path from 'lib/utils/path';\nimport { Optional } from 'lib/utils/optional';\n\nconst createRemoteInfoRepository = (config: StorageConfig): ForRemoteInfoStorage => {\n const STORAGE: StorageEntry<Remotes> = config.storage('remotes', {});\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: Remotes = STORAGE.get() ?? {};\n\n return {\n contains: function (remoteName: RemoteName) {\n return !!_cache[remoteName];\n },\n remove: function (remoteName: RemoteName) {\n delete _cache[remoteName];\n return this;\n },\n addOrUpdate: function (remoteName: string, remote: RemoteInfo) {\n _cache[remoteName] = remote;\n return this;\n },\n tryGet: function (remoteName: RemoteName) {\n return Optional.of(_cache[remoteName]);\n },\n tryGetModule: function (remoteName: RemoteName, exposedModule: string) {\n return Optional.of(_cache[remoteName]?.exposes.find(m => m.moduleName === exposedModule)).map(\n m => _path.join(_cache[remoteName]!.scopeUrl, m.file)\n );\n },\n getAll: function () {\n return _cache;\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createRemoteInfoRepository };\n", "import type { ScopedExternals } from 'lib/core/1.domain/externals/external.contract';\nimport type { StorageConfig, StorageEntry } from 'lib/core/2.app/config/storage.contract';\nimport type { ForScopedExternalsStorage } from 'lib/core/2.app/driving-ports/for-scoped-externals-storage.port';\nimport type { RemoteName, ScopedVersion } from 'lib/core/1.domain';\nimport { Optional } from 'lib/utils/optional';\n\nconst createScopedExternalsRepository = (config: StorageConfig): ForScopedExternalsStorage => {\n const STORAGE: StorageEntry<ScopedExternals> = config.storage('scoped-externals', {});\n\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: ScopedExternals = STORAGE.get() ?? {};\n\n return {\n addExternal: function (remoteName: RemoteName, external: string, version: ScopedVersion) {\n if (!_cache[remoteName]) _cache[remoteName] = {};\n _cache[remoteName][external] = version;\n return this;\n },\n remove: function (remoteName: RemoteName) {\n delete _cache[remoteName];\n return this;\n },\n getAll: function () {\n return _cache;\n },\n tryGet: function (remoteName: string) {\n return Optional.of(_cache[remoteName]);\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createScopedExternalsRepository };\n", "import type { SharedVersion, ScopedVersion } from './version.contract';\n\nexport type ExternalName = string;\n\nexport type ScopedExternals = Record<string, ScopedExternal>;\n\nexport const GLOBAL_SCOPE = '__GLOBAL__';\n\nexport const STRICT_SCOPE = 'strict';\n\nexport type SharedExternal = {\n dirty: boolean;\n versions: SharedVersion[];\n};\n\nexport type shareScope = Record<string, SharedExternal>;\n\nexport type SharedExternals = Record<string, shareScope> & { [GLOBAL_SCOPE]: shareScope };\n\nexport type ScopedExternal = Record<string, ScopedVersion>;\n", "import {\n type SharedExternal,\n type SharedExternals,\n GLOBAL_SCOPE,\n STRICT_SCOPE,\n} from 'lib/core/1.domain/externals/external.contract';\nimport type { StorageConfig, StorageEntry } from 'lib/core/2.app/config/storage.contract';\nimport type { ForSharedExternalsStorage } from 'lib/core/2.app/driving-ports/for-shared-externals-storage.port';\nimport { Optional } from 'lib/utils/optional';\n\nconst createSharedExternalsRepository = (config: StorageConfig): ForSharedExternalsStorage => {\n const STORAGE: StorageEntry<SharedExternals> = config.storage<SharedExternals>(\n 'shared-externals',\n { [GLOBAL_SCOPE]: {} }\n );\n\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: SharedExternals = STORAGE.get()!;\n\n return {\n getFromScope: function (shareScope?: string) {\n return { ..._cache[shareScope ?? GLOBAL_SCOPE] };\n },\n addOrUpdate: function (externalName: string, external: SharedExternal, shareScope?: string) {\n if (!_cache[shareScope ?? GLOBAL_SCOPE]) _cache[shareScope ?? GLOBAL_SCOPE] = {};\n _cache[shareScope ?? GLOBAL_SCOPE]![externalName] = external;\n return this;\n },\n getScopes: function (o = { includeGlobal: true }) {\n if (o.includeGlobal) return Object.keys(_cache);\n return Object.keys(_cache).filter(s => s !== GLOBAL_SCOPE);\n },\n removeFromAllScopes: function (remoteName: string) {\n Object.values(_cache).forEach(scope => {\n const removeExternals: string[] = [];\n\n Object.entries(scope).forEach(([name, external]) => {\n const removeVersionIdx: number[] = [];\n external.versions.forEach((version, i) => {\n const versionRemoteIDX = version.remotes.findIndex(r => r.name === remoteName);\n if (~versionRemoteIDX) {\n version.remotes.splice(versionRemoteIDX, 1);\n }\n\n if (version.remotes.length === 0) removeVersionIdx.push(i);\n });\n\n if (removeVersionIdx.length > 0) {\n for (let i = removeVersionIdx.length - 1; i >= 0; i--) {\n external.versions.splice(removeVersionIdx[i]!, 1);\n }\n external.dirty = true;\n\n if (external.versions.length === 0) removeExternals.push(name);\n }\n });\n removeExternals.forEach(name => delete scope[name]);\n });\n },\n scopeType: function (shareScope?: string) {\n switch (shareScope) {\n case GLOBAL_SCOPE:\n case null:\n case undefined:\n return 'global';\n case STRICT_SCOPE:\n return 'strict';\n default:\n return 'shareScope';\n }\n },\n tryGet: function (external: string, shareScope?: string) {\n return Optional.of(_cache[shareScope ?? GLOBAL_SCOPE]?.[external]);\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createSharedExternalsRepository };\n", "import type { StorageConfig, StorageEntry } from 'lib/core/2.app/config/storage.contract';\nimport type { ForSharedChunksStorage } from 'lib/core/2.app/driving-ports/for-shared-chunks-storage.port';\nimport type { SharedChunks } from 'lib/core/1.domain/externals/chunks.contract';\nimport { Optional } from 'lib/utils/optional';\n\nconst createChunkRepository = (config: StorageConfig): ForSharedChunksStorage => {\n const STORAGE: StorageEntry<SharedChunks> = config.storage('shared-chunks', {});\n\n if (config.clearStorage) STORAGE.clear();\n\n const _cache: SharedChunks = STORAGE.get() ?? {};\n\n return {\n addOrReplace: function (remoteName: string, bundleName: string, chunks: string[]) {\n if (!_cache[remoteName]) _cache[remoteName] = {};\n _cache[remoteName][bundleName] = chunks;\n return this;\n },\n tryGet: function (remoteName: string, bundleName: string) {\n return Optional.of(_cache[remoteName]?.[bundleName]);\n },\n commit: function () {\n STORAGE.set(_cache);\n return this;\n },\n };\n};\n\nexport { createChunkRepository };\n", "type TTCreateScript = (input: string) => string;\ntype TTCreateScriptURL = (input: string) => string;\n\ntype TTPolicyRules = {\n createScript?: TTCreateScript;\n createScriptURL?: TTCreateScriptURL;\n};\n\ntype TrustedValue = { toString(): string };\n\ntype TTPolicy = {\n createScript: (input: string) => TrustedValue;\n createScriptURL: (input: string) => TrustedValue;\n};\n\ntype TTFactory = {\n createPolicy: (name: string, rules: TTPolicyRules) => TTPolicy;\n};\n\nexport type NFTrustedTypesPolicy = {\n // `script.text` is a TrustedScript sink, so this must stay the genuine object.\n createScript: (input: string) => TrustedValue;\n createScriptURL: (input: string) => string;\n};\n\nconst IMPORT_MAP_KEYS = new Set(['imports', 'scopes', 'integrity']);\n\nconst validateImportMapJSON = (input: string): string => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(input);\n } catch {\n throw new TypeError('[nf-orchestrator] trusted-types: import map is not valid JSON');\n }\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw new TypeError('[nf-orchestrator] trusted-types: import map must be a plain object');\n }\n for (const key of Object.keys(parsed as Record<string, unknown>)) {\n if (!IMPORT_MAP_KEYS.has(key)) {\n throw new TypeError(`[nf-orchestrator] trusted-types: unexpected key \"${key}\" in import map`);\n }\n }\n return input;\n};\n\nconst validateScriptURL = (input: string): string => {\n const base = typeof location !== 'undefined' ? location.href : 'http://localhost/';\n let url: URL;\n try {\n url = new URL(input, base);\n } catch {\n throw new TypeError(`[nf-orchestrator] trusted-types: invalid script URL \"${input}\"`);\n }\n if (url.protocol !== 'https:' && url.protocol !== 'http:') {\n throw new TypeError(\n `[nf-orchestrator] trusted-types: disallowed protocol \"${url.protocol}\" for script URL`\n );\n }\n return input;\n};\n\nconst passThroughPolicy: NFTrustedTypesPolicy = {\n createScript: input => input,\n createScriptURL: input => input,\n};\n\nlet cachedPolicy: NFTrustedTypesPolicy | null = null;\n\nexport const getTrustedTypesPolicy = (\n name: string | false = 'nfo'\n): NFTrustedTypesPolicy => {\n if (name === false) return passThroughPolicy;\n if (cachedPolicy) return cachedPolicy;\n\n const factory = (globalThis as { trustedTypes?: TTFactory }).trustedTypes;\n if (!factory) {\n cachedPolicy = passThroughPolicy;\n return cachedPolicy;\n }\n\n const native = factory.createPolicy(name, {\n createScript: validateImportMapJSON,\n createScriptURL: validateScriptURL,\n });\n\n cachedPolicy = {\n createScript: input => native.createScript(input),\n createScriptURL: input => String(native.createScriptURL(input)),\n };\n return cachedPolicy;\n};\n\nexport const __resetTrustedTypesPolicyForTests = (): void => {\n cachedPolicy = null;\n};\n", "import type { ImportMap } from 'lib/core/1.domain';\nimport type { SetImportMap } from 'lib/core/2.app/config/import-map.contract';\nimport { getTrustedTypesPolicy } from './trusted-types';\n\nexport const replaceInDOM =\n (mapType: string, trustedTypesPolicyName: string | false = 'nfo'): SetImportMap =>\n (importMap: ImportMap, opts = {}) => {\n if (opts?.override) {\n document.head\n .querySelectorAll(`script[type=\"${mapType}\"]`)\n .forEach(importMap => importMap.remove());\n }\n\n const policy = getTrustedTypesPolicy(trustedTypesPolicyName);\n document.head.appendChild(\n Object.assign(document.createElement('script'), {\n type: mapType,\n text: policy.createScript(JSON.stringify(importMap)),\n })\n );\n return Promise.resolve(importMap);\n };\n", "import type { ImportMapConfig } from 'lib/core/2.app/config/import-map.contract';\nimport { replaceInDOM } from './replace-in-dom';\nimport { getTrustedTypesPolicy } from './trusted-types';\n\nconst useDefaultImportMap = (trustedTypesPolicyName: string | false = 'nfo'): ImportMapConfig => ({\n loadModuleFn: url => {\n const trusted = getTrustedTypesPolicy(trustedTypesPolicyName).createScriptURL(url);\n return import(/* @vite-ignore */ trusted);\n },\n setImportMapFn: replaceInDOM('importmap', trustedTypesPolicyName),\n reloadBrowserFn: () => {\n window.location.reload();\n },\n});\n\nexport { useDefaultImportMap };\n", "import type {\n ImportMapConfig,\n ImportMapOptions,\n} from 'lib/core/2.app/config/import-map.contract';\nimport { useDefaultImportMap } from './use-default';\n\nexport const createImportMapConfig = (o: Partial<ImportMapOptions>): ImportMapConfig => {\n const fallback = useDefaultImportMap(o.trustedTypesPolicyName);\n return {\n setImportMapFn: o.setImportMapFn ?? fallback.setImportMapFn,\n loadModuleFn: o.loadModuleFn ?? fallback.loadModuleFn,\n reloadBrowserFn: o.reloadBrowserFn ?? fallback.reloadBrowserFn,\n };\n};\n", "import type { HostConfig, HostOptions } from 'lib/core/2.app/config/host.contract';\n\nexport const createHostConfig = (override: Partial<HostOptions>): HostConfig => {\n const extras = override?.manifestIntegrity\n ? { manifestIntegrity: override.manifestIntegrity }\n : {};\n\n if (!override?.hostRemoteEntry) {\n return { hostRemoteEntry: false, ...extras };\n }\n if (typeof override.hostRemoteEntry === 'string') {\n return {\n hostRemoteEntry: {\n name: '__NF-HOST__',\n url: override.hostRemoteEntry,\n },\n ...extras,\n };\n }\n return {\n hostRemoteEntry: {\n name: '__NF-HOST__',\n ...override.hostRemoteEntry,\n },\n ...extras,\n };\n};\n", "import type { Logger } from 'lib/core/2.app/config/log.contract';\n\nconst noopLogger: Logger = {\n debug: () => {},\n error: () => {},\n warn: () => {},\n};\n\nexport { noopLogger };\n", "export const LogLevel = {\n debug: 0,\n warn: 1,\n error: 2,\n};\n\nexport type LogType = keyof typeof LogLevel;\n\nexport type Logger = {\n error: (step: number, msg: string, details?: unknown) => void;\n warn: (step: number, msg: string, details?: unknown) => void;\n debug: (step: number, msg: string, details?: unknown) => void;\n};\n\nexport type LogHandler = Logger & {\n level: LogType;\n};\n\nexport type LoggingConfig = {\n log: LogHandler;\n sse: boolean;\n};\n\nexport type LoggingOptions = {\n logger?: Logger;\n logLevel?: LogType;\n sse?: boolean;\n};\n", "import {\n type LogType,\n type LogHandler,\n type Logger,\n LogLevel,\n} from 'lib/core/2.app/config/log.contract';\n\nconst createLogHandler = (logger: Logger, logLevel: LogType): LogHandler => {\n const logTypes = Object.keys(LogLevel).filter(key => isNaN(Number(key))) as LogType[];\n\n return logTypes.reduce(\n (acc, logMessageType) => {\n return {\n ...acc,\n [logMessageType]: (step: number, message: string, details: unknown) => {\n if (LogLevel[logMessageType] >= LogLevel[logLevel]) {\n logger[logMessageType](step, message, details);\n }\n },\n };\n },\n { level: logLevel } as LogHandler\n );\n};\n\nexport { createLogHandler };\n", "import type { LoggingConfig, LoggingOptions } from 'lib/core/2.app/config/log.contract';\nimport { noopLogger } from './noop.logger';\nimport { createLogHandler } from './log.handler';\n\nexport const createLogConfig = ({ logger, logLevel, sse }: LoggingOptions): LoggingConfig => ({\n log: createLogHandler(logger ?? noopLogger, logLevel ?? 'error'),\n sse: !!sse,\n});\n", "import type { StorageEntryKey } from 'lib/core/2.app/config/storage.contract';\nimport { NFError } from 'lib/core/native-federation.error';\n\ntype CloneEntry = <T>(name: StorageEntryKey, raw: T) => T;\n\nconst cloneEntry: CloneEntry = <T>(name: StorageEntryKey, raw: T) => {\n try {\n if (typeof structuredClone === 'function') {\n return structuredClone(raw);\n }\n } catch {\n /* structured clone is unavailable */\n }\n try {\n return JSON.parse(JSON.stringify(raw));\n } catch {\n /* object is not stringifyable */\n }\n throw new NFError(`Could not clone entry '${String(name)}'`);\n};\n\nexport { CloneEntry, cloneEntry };\n", "import { cloneEntry } from 'lib/utils/clone-entry';\nimport {\n type StorageEntryCreator,\n type StorageEntry,\n} from 'lib/core/2.app/config/storage.contract';\n\nconst globalThisStorageEntry: StorageEntryCreator =\n (namespace: string) =>\n <TValue>(key: string, initialValue: TValue) => {\n if (!(globalThis as unknown as { [namespace]: unknown })[namespace]) {\n (globalThis as unknown as { [namespace]: unknown })[namespace] = {};\n }\n\n const storage = (globalThis as unknown as { [namespace]: { [P in typeof key]: TValue } })[\n namespace\n ]!;\n if (!storage[key]) storage[key] = initialValue;\n\n const entry: StorageEntry<TValue> = {\n get(): TValue {\n return cloneEntry(key, storage[key])!;\n },\n set(value: TValue): StorageEntry<TValue> {\n storage[key] = cloneEntry(key, value);\n return entry;\n },\n clear(): StorageEntry<TValue> {\n storage[key] = cloneEntry(key, initialValue);\n return this;\n },\n };\n\n return entry;\n };\n\nexport { globalThisStorageEntry };\n", "import type { StorageConfig, StorageOptions } from 'lib/core/2.app/config/storage.contract';\nimport { globalThisStorageEntry } from './global-this.storage';\n\nexport const createStorageConfig = (override: StorageOptions): StorageConfig => ({\n storage: override.storage\n ? override.storage(override.storageNamespace ?? '__NATIVE_FEDERATION__')\n : globalThisStorageEntry(override.storageNamespace ?? '__NATIVE_FEDERATION__'),\n clearStorage: override.clearStorage ?? false,\n});\n", "import type { ModeProfileConfig } from 'lib/core/2.app/config/mode.contract';\n\nexport const defaultProfile: ModeProfileConfig = {\n latestSharedExternal: false,\n skipInvalidExternalVersions: false,\n overrideCachedRemotes: 'init-only',\n overrideCachedRemotesIfURLMatches: false,\n};\n", "import type { ModeConfig, ModeOptions } from 'lib/core/2.app/config/mode.contract';\nimport { defaultProfile } from './default.profile';\n\nexport const createModeConfig = (override: ModeOptions): ModeConfig => {\n const strictnessConfig =\n typeof override.strict === 'boolean'\n ? {\n strictRemoteEntry: override.strict,\n strictExternalCompatibility: override.strict,\n strictExternalSameVersionCompatibility: override.strict,\n strictExternalVersion: override.strict,\n strictImportMap: override.strict,\n }\n : {\n strictRemoteEntry: override.strict?.strictRemoteEntry ?? false,\n strictExternalCompatibility: override.strict?.strictExternalCompatibility ?? false,\n strictExternalSameVersionCompatibility:\n override.strict?.strictExternalSameVersionCompatibility ?? false,\n strictExternalVersion: override.strict?.strictExternalVersion ?? false,\n strictImportMap: override.strict?.strictImportMap ?? false,\n };\n\n return {\n strict: strictnessConfig,\n profile: { ...defaultProfile, ...(override.profile ?? {}) },\n };\n};\n", "import type { ConfigContract, NFOptions } from 'lib/core/2.app/config/config.contract';\nimport { createImportMapConfig } from 'lib/core/4.config/import-map/import-map.config';\nimport { createHostConfig } from 'lib/core/4.config/host/host.config';\nimport { createLogConfig } from 'lib/core/4.config/logging/log.config';\nimport { createStorageConfig } from 'lib/core/4.config/storage/storage.config';\nimport { createModeConfig } from 'lib/core/4.config/mode/mode.config';\n\nexport const createConfigHandlers = (overrides: NFOptions): ConfigContract => ({\n ...createImportMapConfig(overrides),\n ...createHostConfig(overrides),\n ...createLogConfig(overrides),\n ...createStorageConfig(overrides),\n ...createModeConfig(overrides),\n});\n", "import type { FLOW_FACTORY } from '../driver-ports/flow-factory.contract';\nimport type { InitDriversContract } from '../driver-ports/init/drivers.contract';\nimport type { InitFlow } from '../driver-ports/init/flow.contract';\n\nexport const createInitFlow = ({\n flow,\n adapters,\n config,\n}: FLOW_FACTORY<InitDriversContract>): InitFlow => {\n return remotesOrManifestUrl =>\n flow\n .getRemoteEntries(remotesOrManifestUrl)\n .then(flow.processRemoteEntries)\n .then(flow.determineSharedExternals)\n .then(flow.generateImportMap)\n .then(flow.commitChanges)\n .then(flow.exposeModuleLoader)\n .then(loadRemoteModule => ({\n config,\n adapters,\n loadRemoteModule,\n }));\n};\n", "import type { RemoteEntry } from 'lib/core/1.domain';\nimport type { FLOW_FACTORY } from '../driver-ports/flow-factory.contract';\nimport type { InitDriversContract } from '../driver-ports/init/drivers.contract';\nimport type { InitRemoteEntryFlow } from '../driver-ports/init/flow.contract';\n\nexport const createInitRemoteEntryFlow = ({\n flow,\n}: FLOW_FACTORY<InitDriversContract>): InitRemoteEntryFlow => {\n const processDynamicRemoteEntry = (remoteEntry: RemoteEntry) =>\n flow.updateCache(remoteEntry).then(flow.convertToImportMap).then(flow.commitChanges);\n\n return (remoteEntryUrl, remote) =>\n flow\n .getRemoteEntry(remoteEntryUrl, remote)\n .then(entry => entry.map(processDynamicRemoteEntry).orElse(Promise.resolve()))\n .then(() => undefined);\n};\n", "import type { RemoteEntry } from 'lib/core/1.domain/remote-entry/remote-entry.contract';\nimport type {\n FederationManifest,\n RemoteEntryDescriptor,\n RemoteEntryUrl,\n} from 'lib/core/1.domain/remote-entry/manifest.contract';\nimport type { RemoteName } from 'lib/core/1.domain/remote/remote-info.contract';\nimport type { ForGettingRemoteEntries } from '../driver-ports/init/for-getting-remote-entries.port';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../config/log.contract';\nimport { NFError } from 'lib/core/native-federation.error';\nimport type { ModeConfig } from '../config/mode.contract';\nimport type { HostConfig } from '../config/host.contract';\nimport * as _path from 'lib/utils/path';\n\nexport function createGetRemoteEntries(\n config: LoggingConfig & ModeConfig & HostConfig,\n ports: Pick<\n DrivingContract,\n 'remoteEntryProvider' | 'manifestProvider' | 'remoteInfoRepo' | 'sse'\n >\n): ForGettingRemoteEntries {\n /**\n * Step 1: Fetch the remoteEntry JSON objects:\n *\n * A Manifest or URL to a Manifest is used as the input. Based on the defined remotes\n * in the manifest, the library will download the remoteEntry.json files which contain the\n * metadata of the defined remotes (name, exposed modules and required dependencies a.k.a. externals)\n *\n * @param config\n * @param adapters\n * @returns A list of the remoteEntry json objects\n */\n return (remotesOrManifestUrl = {}) => {\n const manifestPromise = config.manifestIntegrity\n ? ports.manifestProvider.provide(remotesOrManifestUrl, {\n integrity: config.manifestIntegrity,\n })\n : ports.manifestProvider.provide(remotesOrManifestUrl);\n\n return manifestPromise\n .catch(e => {\n config.log.error(1, 'Could not fetch manifest.', e);\n return Promise.reject(new NFError('Failed to fetch manifest'));\n })\n .then(addHostRemoteEntry)\n .then(fetchRemoteEntries)\n .then(removeSkippedRemotes)\n .then(checkForSSE);\n };\n\n function addHostRemoteEntry(manifest: FederationManifest): FederationManifest {\n if (!config.hostRemoteEntry) return manifest;\n\n const { name, url, cacheTag, integrity } = config.hostRemoteEntry;\n const urlWithCache = cacheTag ? `${url}?cacheTag=${cacheTag}` : url;\n\n return {\n ...manifest,\n [name]: integrity ? { url: urlWithCache, integrity } : urlWithCache,\n };\n }\n\n function normalizeEntry(descriptor: RemoteEntryDescriptor): {\n url: RemoteEntryUrl;\n integrity?: string;\n } {\n return typeof descriptor === 'string' ? { url: descriptor } : descriptor;\n }\n\n async function fetchRemoteEntries(\n manifest: FederationManifest\n ): Promise<(RemoteEntry | false)[]> {\n const fetchPromises = Object.entries(manifest).map(([remoteName, descriptor]) =>\n fetchRemoteEntry(remoteName, descriptor)\n );\n return Promise.all(fetchPromises);\n }\n\n async function fetchRemoteEntry(\n remoteName: RemoteName,\n descriptor: RemoteEntryDescriptor\n ): Promise<RemoteEntry | false> {\n const { url: remoteEntryUrl, integrity } = normalizeEntry(descriptor);\n let isOverride = false;\n let skip = false;\n\n ports.remoteInfoRepo.tryGet(remoteName).ifPresent(cachedRemoteInfo => {\n if (\n config.profile.overrideCachedRemotes !== 'never' &&\n (remoteEntryUrl !== _path.join(cachedRemoteInfo.scopeUrl, 'remoteEntry.json') ||\n config.profile.overrideCachedRemotesIfURLMatches)\n ) {\n config.log.debug(1, `Overriding existing remote '${remoteName}' with '${remoteEntryUrl}'.`);\n isOverride = true;\n } else {\n config.log.debug(1, `Found remote '${remoteName}' in storage, omitting fetch.`);\n skip = true;\n }\n });\n\n if (skip) return false;\n\n try {\n const remoteEntry = integrity\n ? await ports.remoteEntryProvider.provide(remoteEntryUrl, { integrity })\n : await ports.remoteEntryProvider.provide(remoteEntryUrl);\n\n config.log.debug(\n 1,\n `Fetched '${remoteEntry.name}' from '${remoteEntry.url}', exposing: ${JSON.stringify(remoteEntry.exposes)}`\n );\n\n return prepareRemoteEntry(remoteEntry, remoteName, isOverride);\n } catch (error) {\n if (config.strict.strictRemoteEntry) {\n config.log.error(1, `Could not fetch remote '${remoteName}'.`, error);\n return Promise.reject(new NFError(`Could not fetch remote '${remoteName}'`));\n }\n config.log.warn(1, `Could not fetch remote '${remoteName}'. skipping init.`, error);\n\n return Promise.resolve(false);\n }\n }\n\n function prepareRemoteEntry(\n remoteEntry: RemoteEntry,\n expectedRemoteName: string,\n isOverride: boolean\n ): RemoteEntry {\n if (isOverride) remoteEntry.override = isOverride;\n\n if (!!config.hostRemoteEntry && expectedRemoteName === config.hostRemoteEntry.name) {\n remoteEntry.host = true;\n remoteEntry.name = config.hostRemoteEntry!.name;\n }\n\n if (remoteEntry.name !== expectedRemoteName) {\n const errorDetails = `Fetched remote '${remoteEntry.name}' does not match requested '${expectedRemoteName}'.`;\n if (config.strict.strictRemoteEntry) {\n throw new NFError(errorDetails);\n }\n config.log.warn(1, `${errorDetails} Omitting expected name.`);\n }\n\n return remoteEntry;\n }\n\n function removeSkippedRemotes(remoteEntries: (RemoteEntry | false)[]): RemoteEntry[] {\n return remoteEntries.filter((entry): entry is RemoteEntry => entry !== false);\n }\n\n function checkForSSE(remoteEntries: RemoteEntry[]): RemoteEntry[] {\n if (config.sse) {\n remoteEntries.forEach(entry => {\n if (entry.buildNotificationsEndpoint) {\n ports.sse.watchRemoteBuilds(\n _path.join(_path.getScope(entry.url), entry.buildNotificationsEndpoint)\n );\n config.log.debug(1, `Registered SSE endpoint of remote '${entry.name}' `);\n return;\n }\n config.log.debug(1, `Remote ${entry.name} has no defined 'buildNotificationsEndpoint'`);\n });\n }\n\n return remoteEntries;\n }\n}\n", "import type {\n RemoteEntry,\n RemoteInfo,\n ScopedVersion,\n SharedExternal,\n SharedInfo,\n SharedVersion,\n SharedVersionMeta,\n} from 'lib/core/1.domain';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../config/log.contract';\nimport type { ModeConfig } from 'lib/core/2.app/config/mode.contract';\nimport { NFError } from 'lib/core/native-federation.error';\nimport * as _path from 'lib/utils/path';\n\nexport type StoreRemoteEntry = (\n remoteEntry: RemoteEntry,\n onSharedExternal: SharedExternalHandler\n) => void;\n\nexport type SharedExternalHandler = (\n remoteEntry: RemoteEntry,\n external: SharedInfo,\n ctx: SharedExternalContext\n) => void;\n\nexport type SharedExternalContext = {\n tag: string;\n remote: SharedVersionMeta;\n cached: SharedExternal;\n scopeType: 'global' | 'strict' | 'shareScope';\n assertSameVersionCompatibility: (matchingVersion: SharedVersion) => void;\n commit: () => void;\n};\n\n/**\n * Not a pipeline step but the template both storage steps specialize: it owns the full\n * storage sequence for a remoteEntry, and only the resolution of a singleton external\n * differs between the init pipeline (process-remote-entries, step 2) and the dynamic\n * pipeline (update-cache, step 8), injected per call. The pipelines must not be merged,\n * see docs/version-resolver.md \"Dynamic Init\". If a change ever needs a flag or\n * parameter here to serve only one caller, inline this back into the steps instead.\n */\nexport function createStoreRemoteEntry(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'scopedExternalsRepo'\n | 'sharedExternalsRepo'\n | 'sharedChunksRepo'\n | 'versionCheck'\n >,\n logStep: number\n): StoreRemoteEntry {\n return (remoteEntry, onSharedExternal) => {\n if (remoteEntry?.override) removeCachedRemoteEntry(remoteEntry);\n addRemoteInfoToStorage(remoteEntry);\n addExternalsToStorage(remoteEntry, onSharedExternal);\n addSharedChunksToStorage(remoteEntry);\n };\n\n function removeCachedRemoteEntry(remoteEntry: RemoteEntry): void {\n ports.remoteInfoRepo.remove(remoteEntry.name);\n ports.scopedExternalsRepo.remove(remoteEntry.name);\n ports.sharedExternalsRepo.removeFromAllScopes(remoteEntry.name);\n }\n\n function addRemoteInfoToStorage({ name, url, exposes, integrity }: RemoteEntry): void {\n ports.remoteInfoRepo.addOrUpdate(name, {\n scopeUrl: _path.getScope(url),\n exposes: Object.values(exposes ?? []).map(m => ({\n moduleName: m.key,\n file: m.outFileName,\n })),\n ...(integrity ? { integrity } : {}),\n } as RemoteInfo);\n }\n\n function addExternalsToStorage(\n remoteEntry: RemoteEntry,\n onSharedExternal: SharedExternalHandler\n ): void {\n remoteEntry.shared.forEach(external => {\n const tag = resolveVersion(remoteEntry, external);\n if (tag === null) return;\n\n if (external.singleton) {\n onSharedExternal(remoteEntry, external, sharedExternalContext(remoteEntry, external, tag));\n } else {\n addScopedExternal(remoteEntry, external, tag);\n }\n });\n }\n\n function addSharedChunksToStorage(remoteEntry: RemoteEntry): void {\n if (!remoteEntry.chunks) return;\n config.log.debug(\n logStep,\n `Adding chunks for remote \"${remoteEntry.name}\", bundles: [${Object.keys(remoteEntry.chunks).join(', ')}]`\n );\n Object.entries(remoteEntry.chunks).forEach(([bundleName, chunks]) => {\n ports.sharedChunksRepo.addOrReplace(remoteEntry.name, bundleName, chunks);\n });\n }\n\n function addScopedExternal(remoteEntry: RemoteEntry, sharedInfo: SharedInfo, tag: string): void {\n ports.scopedExternalsRepo.addExternal(remoteEntry.name, sharedInfo.packageName, {\n tag,\n file: sharedInfo.outFileName,\n bundle: sharedInfo.bundle,\n } as ScopedVersion);\n }\n\n function resolveVersion(remoteEntry: RemoteEntry, external: SharedInfo): string | null {\n if (external.version && ports.versionCheck.isValidSemver(external.version)) {\n return external.version;\n }\n\n const errorMsg = `[${remoteEntry.name}][${external.packageName}] Version '${external.version}' is not a valid version.`;\n if (config.strict.strictExternalVersion) {\n config.log.error(logStep, errorMsg);\n throw new NFError(`Could not process remote '${remoteEntry.name}'`);\n }\n if (config.profile.skipInvalidExternalVersions) {\n config.log.warn(logStep, `${errorMsg} Skipping external.`);\n return null;\n }\n config.log.warn(logStep, errorMsg);\n return ports.versionCheck.smallestVersion(external.requiredVersion);\n }\n\n function sharedExternalContext(\n remoteEntry: RemoteEntry,\n sharedInfo: SharedInfo,\n tag: string\n ): SharedExternalContext {\n const scopeType = ports.sharedExternalsRepo.scopeType(sharedInfo.shareScope);\n\n const remote: SharedVersionMeta = {\n file: sharedInfo.outFileName,\n name: remoteEntry.name,\n bundle: sharedInfo.bundle,\n strictVersion: sharedInfo.strictVersion,\n cached: false,\n requiredVersion: scopeType === 'strict' ? tag : sharedInfo.requiredVersion || tag,\n };\n\n const cached: SharedExternal = ports.sharedExternalsRepo\n .tryGet(sharedInfo.packageName, sharedInfo.shareScope)\n .orElse({ dirty: false, versions: [] });\n\n return {\n tag,\n remote,\n cached,\n scopeType,\n assertSameVersionCompatibility(matchingVersion: SharedVersion): void {\n if (!remote.strictVersion) return;\n if (matchingVersion.remotes[0]!.requiredVersion === remote.requiredVersion) return;\n\n const errorMsg = `[${remoteEntry.name}][${sharedInfo.packageName}@${\n sharedInfo.version\n }] Required version-range '${\n remote.requiredVersion\n }' does not match cached version-range '${matchingVersion.remotes[0]!.requiredVersion}'`;\n\n if (config.strict.strictExternalSameVersionCompatibility) {\n config.log.error(logStep, errorMsg);\n throw new NFError(`Could not process remote '${remoteEntry.name}'`);\n }\n config.log.warn(logStep, errorMsg);\n },\n commit(): void {\n ports.sharedExternalsRepo.addOrUpdate(\n sharedInfo.packageName,\n {\n dirty: cached.dirty,\n versions: cached.versions.sort((a, b) => ports.versionCheck.compare(b.tag, a.tag)),\n },\n sharedInfo.shareScope\n );\n },\n };\n }\n}\n", "import type { ForProcessingRemoteEntries } from '../driver-ports/init/for-processing-remote-entries.port';\nimport type { RemoteEntry, SharedInfo } from 'lib/core/1.domain';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../config/log.contract';\nimport type { ModeConfig } from 'lib/core/2.app/config/mode.contract';\nimport { createStoreRemoteEntry, type SharedExternalContext } from './store-remote-entry';\n\nexport function createProcessRemoteEntries(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'sharedExternalsRepo'\n | 'scopedExternalsRepo'\n | 'sharedChunksRepo'\n | 'versionCheck'\n >\n): ForProcessingRemoteEntries {\n const storeRemoteEntry = createStoreRemoteEntry(config, ports, 2);\n\n /**\n * Step 2: Merge the remote-info, externals and chunks of the provided remoteEntry\n * objects into the cache. Shared externals are only registered here; resolution\n * happens later in determine-shared-externals, per scope, with global knowledge.\n */\n return remoteEntries => {\n try {\n remoteEntries.forEach(remoteEntry => storeRemoteEntry(remoteEntry, addSharedExternal));\n return Promise.resolve(remoteEntries);\n } catch (e) {\n return Promise.reject(e);\n }\n };\n\n function addSharedExternal(\n remoteEntry: RemoteEntry,\n _sharedInfo: SharedInfo,\n {\n tag,\n remote,\n cached,\n scopeType,\n assertSameVersionCompatibility,\n commit,\n }: SharedExternalContext\n ): void {\n const matchingVersion = cached.versions.find(version => version.tag === tag);\n\n if (matchingVersion) {\n assertSameVersionCompatibility(matchingVersion);\n\n if (!matchingVersion.host && !!remoteEntry?.host) {\n matchingVersion.host = true;\n matchingVersion.remotes.unshift(remote);\n } else matchingVersion.remotes.push(remote);\n } else {\n if (scopeType !== 'strict') cached.dirty = true;\n cached.versions.push({\n tag,\n action: scopeType === 'strict' ? 'share' : 'skip',\n host: !!remoteEntry?.host,\n remotes: [remote],\n });\n }\n\n commit();\n }\n}\n", "import type { ForDeterminingSharedExternals } from '../driver-ports/init/for-determining-shared-externals.port';\nimport { GLOBAL_SCOPE, type SharedExternal } from 'lib/core/1.domain';\nimport { NFError } from 'lib/core/native-federation.error';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../config/log.contract';\nimport type { ModeConfig } from '../config/mode.contract';\n\nexport function createDetermineSharedExternals(\n config: LoggingConfig & ModeConfig,\n ports: Pick<DrivingContract, 'versionCheck' | 'sharedExternalsRepo'>\n): ForDeterminingSharedExternals {\n /**\n * Step 3: Determine which version is the optimal version to share.\n *\n * The shared external versions that were merged into the cache/storage caused the shared\n * external to be 'dirty', this step cleans all dirty externals in the storage by calculating\n * the most optimal version to share since only 1 version can be shared globally. All other\n * versions that are compatible are skipped and the incompatible ones are defined as scoped external.\n *\n * Check the docs for a full explanation of the dependency resolver.\n *\n * Priority:\n * 1) Latest external defined in 'host' remoteEntry (if available).\n * 2) If defined in config, prioritize latest available version.\n * 3) Find most optimal version, by comparing potential extra downloads per version.\n *\n * @param config\n * @param adapters\n * @returns\n */\n return () => {\n for (const shareScope of ports.sharedExternalsRepo.getScopes()) {\n const sharedExternals = ports.sharedExternalsRepo.getFromScope(shareScope);\n\n try {\n Object.entries(sharedExternals)\n .filter(([_, e]) => e.dirty)\n .forEach(([name, external]) =>\n ports.sharedExternalsRepo.addOrUpdate(\n name,\n setVersionActions(name, external),\n shareScope\n )\n );\n } catch (error) {\n config.log.error(\n 3,\n `[${shareScope ?? GLOBAL_SCOPE}] failed to determine shared externals.`,\n {\n sharedExternals,\n error,\n }\n );\n return Promise.reject(\n new NFError(\n `Could not determine shared externals in scope ${shareScope}.`,\n error as Error\n )\n );\n }\n }\n return Promise.resolve();\n };\n\n function setVersionActions(externalName: string, external: SharedExternal) {\n if (external.versions.length === 1) {\n external.versions[0]!.action = 'share';\n external.dirty = false;\n return external;\n }\n\n let sharedVersion = external.versions.find(v => v.host);\n\n if (!sharedVersion && config.profile.latestSharedExternal) {\n sharedVersion = external.versions[0];\n }\n\n if (!sharedVersion) {\n // find version with least extra downloads, sorted by SEMVER version (O^2 complexity)\n let leastExtraDownloads = Number.MAX_VALUE;\n external.versions.forEach(vA => {\n const extraDownloads = external.versions.filter(\n vB =>\n !vB.remotes[0]!.cached &&\n vB.remotes[0]!.strictVersion &&\n !ports.versionCheck.isCompatible(vA.tag, vB.remotes[0]!.requiredVersion)\n ).length;\n if (extraDownloads < leastExtraDownloads) {\n leastExtraDownloads = extraDownloads;\n sharedVersion = vA;\n }\n });\n }\n\n if (!sharedVersion) {\n throw new NFError(`[${externalName}] Could not determine shared version!`);\n }\n\n // Determine action of other versions based on chosen sharedVersion\n external.versions.forEach(v => {\n if (ports.versionCheck.isCompatible(sharedVersion!.tag, v.remotes[0]!.requiredVersion)) {\n v.action = 'skip';\n return;\n }\n\n if (config.strict.strictExternalCompatibility && v.remotes[0]!.strictVersion) {\n config.log.error(\n 3,\n `[${v.remotes[0]!.name}][${externalName}@${v.tag}] Is not compatible with requiredRange '${sharedVersion!.remotes[0]?.requiredVersion}' from remote '${sharedVersion!.remotes[0]!.name}'.`\n );\n\n throw new NFError(`External ${externalName}@${v.tag} could not be shared.`);\n }\n v.action = v.remotes[0]!.strictVersion ? 'scope' : 'skip';\n });\n\n sharedVersion.action = 'share';\n external.dirty = false;\n return external;\n }\n}\n", "const CHUNK_PREFIX = \"@nf-internal\";\nfunction toChunkImport(fileName) {\n if (fileName.startsWith(\"./\")) {\n fileName = fileName.slice(2);\n }\n const packageName = fileName.replace(/.(m|c)?js$/, \"\");\n return CHUNK_PREFIX + \"/\" + packageName;\n}\nexport {\n CHUNK_PREFIX,\n toChunkImport\n};\n", "import type { ForGeneratingImportMap } from '../driver-ports/init/for-generating-import-map';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { ImportMap, Imports } from 'lib/core/1.domain/import-map/import-map.contract';\nimport {\n GLOBAL_SCOPE,\n type RemoteName,\n type ScopedExternal,\n type RemoteInfo,\n type SharedExternal,\n type SharedVersion,\n} from 'lib/core/1.domain';\nimport type { LoggingConfig } from '../config/log.contract';\nimport type { ModeConfig } from '../config/mode.contract';\nimport * as _path from 'lib/utils/path';\nimport { NFError } from 'lib/core/native-federation.error';\nimport { toChunkImport } from '@softarc/native-federation/domain';\n\nexport function createGenerateImportMap(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'sharedExternalsRepo'\n >\n): ForGeneratingImportMap {\n /**\n * Step 4: Generate an importMap from the cached remoteEntries\n *\n * The processed externals in the storage/cache (step 2 & 3) are used\n * to generate an importMap. The step returns the generated importMap object.\n */\n return () => {\n const importMap: ImportMap = { imports: {} };\n const chunkBundles: Record<string, Set<string>> = {};\n try {\n addScopedExternals(importMap, chunkBundles);\n addshareScopeExternals(importMap, chunkBundles);\n addGlobalSharedExternals(importMap, chunkBundles);\n addRemoteInfos(importMap, chunkBundles);\n\n addChunkImports(importMap, chunkBundles);\n\n return Promise.resolve(importMap);\n } catch (e) {\n return Promise.reject(e);\n }\n };\n\n /**\n * Step 4.1: Begin with appending smallest scope of shared dependencies\n * @param importMap\n * @returns\n */\n function addScopedExternals(\n importMap: ImportMap,\n chunkBundles: Record<string, Set<string>>\n ): ImportMap {\n const scopedExternals = ports.scopedExternalsRepo.getAll();\n\n for (const [remoteName, externals] of Object.entries(scopedExternals)) {\n const remote = ports.remoteInfoRepo.tryGet(remoteName).orThrow(() => {\n config.log.error(4, `[scoped][${remoteName}] Remote name not found in cache.`);\n return new NFError('Could not create ImportMap.');\n });\n addToScope(importMap, remote.scopeUrl, createScopeModules(externals, remote.scopeUrl));\n\n for (const version of Object.values(externals)) {\n addIntegrity(\n importMap,\n _path.join(remote.scopeUrl, version.file),\n remoteName,\n version.file\n );\n }\n\n Object.values(externals)\n .filter(e => !!e.bundle)\n .forEach(e => registerBundleChunks(chunkBundles, remoteName, e.bundle));\n }\n\n return importMap;\n }\n\n function createScopeModules(externals: ScopedExternal, scope: string): Imports {\n const modules: Imports = {};\n\n for (const [external, version] of Object.entries(externals)) {\n modules[external] = _path.join(scope, version.file);\n }\n\n return modules;\n }\n\n /**\n * Step 4.2: Added the shareScope externals, overriding the scoped externals that are shared\n * @param importMap\n * @returns\n */\n function addshareScopeExternals(\n importMap: ImportMap,\n chunkBundles: Record<string, Set<string>>\n ): ImportMap {\n const shareScopes = ports.sharedExternalsRepo.getScopes({ includeGlobal: false });\n\n for (const shareScope of shareScopes) {\n processshareScope(importMap, shareScope, chunkBundles);\n }\n\n return importMap;\n }\n\n function processshareScope(\n importMap: ImportMap,\n shareScope: string,\n chunkBundles: Record<string, Set<string>>\n ): void {\n const sharedExternals = ports.sharedExternalsRepo.getFromScope(shareScope);\n\n for (const [externalName, external] of Object.entries(sharedExternals)) {\n let override: SharedVersion | undefined | 'NOT_AVAILABLE' = undefined;\n let overrideScope: string | undefined = undefined;\n\n for (const version of external.versions) {\n if (version.action === 'scope') {\n for (const remote of version.remotes) {\n const remoteScope = getScope(shareScope, remote.name, externalName);\n const url = _path.join(remoteScope, remote.file);\n addToScope(importMap, remoteScope, {\n [externalName]: url,\n });\n addIntegrity(importMap, url, remote.name, remote.file);\n registerBundleChunks(chunkBundles, remote.name, remote.bundle);\n remote.cached = true;\n }\n continue;\n }\n\n const scope = getScope(shareScope, version.remotes[0]!.name, externalName);\n\n let targetFileUrl: string = _path.join(scope, version.remotes[0]!.file);\n let targetFileSource: { name: RemoteName; file: string } = {\n name: version.remotes[0]!.name,\n file: version.remotes[0]!.file,\n };\n version.remotes[0]!.cached = true;\n\n if (version.action === 'share') {\n registerBundleChunks(chunkBundles, version.remotes[0]!.name, version.remotes[0]!.bundle);\n }\n\n if (version.action === 'skip') {\n if (!override) {\n override = findOverride(external, shareScope, externalName) ?? 'NOT_AVAILABLE';\n }\n if (override !== 'NOT_AVAILABLE') {\n if (!overrideScope)\n overrideScope = getScope(shareScope, override.remotes[0]!.name, externalName);\n targetFileUrl = _path.join(overrideScope, override.remotes[0]!.file);\n targetFileSource = {\n name: override.remotes[0]!.name,\n file: override.remotes[0]!.file,\n };\n override.remotes[0]!.cached = true;\n\n version.remotes[0]!.cached = false;\n }\n }\n version.remotes.forEach(r => {\n const scope = getScope(shareScope, r.name, externalName);\n addToScope(importMap, scope, { [externalName]: targetFileUrl });\n });\n addIntegrity(importMap, targetFileUrl, targetFileSource.name, targetFileSource.file);\n }\n ports.sharedExternalsRepo.addOrUpdate(externalName, external, shareScope);\n }\n }\n\n function findOverride(\n external: SharedExternal,\n shareScope: string,\n externalName: string\n ): SharedVersion | undefined {\n const sharedVersions = external.versions.filter(v => v.action === 'share');\n const scopedExternalName = `${shareScope}.${externalName}`;\n\n if (sharedVersions.length > 1) {\n handleMultipleSharedVersions(scopedExternalName);\n }\n\n if (sharedVersions.length < 1) {\n if (config.strict.strictImportMap) {\n config.log.error(4, `[${shareScope}][${externalName}] shareScope has no override version.`);\n throw new NFError('Could not create ImportMap.');\n }\n config.log.debug(\n 4,\n `[${shareScope}][${externalName}] shareScope has no override version, scoping override versions.`\n );\n }\n\n return sharedVersions[0];\n }\n\n function handleMultipleSharedVersions(scopedExternalName: string): void {\n if (config.strict.strictImportMap) {\n config.log.error(\n 4,\n `[${scopedExternalName}] ShareScope external has multiple shared versions.`\n );\n throw new NFError('Could not create ImportMap.');\n }\n\n config.log.warn(4, `ShareScope external ${scopedExternalName} has multiple shared versions.`);\n }\n\n /**\n * Step 4.3: Added the globally shared externals.\n * @param importMap\n * @returns\n */\n function addGlobalSharedExternals(\n importMap: ImportMap,\n chunkBundles: Record<string, Set<string>>\n ): ImportMap {\n const sharedExternals = ports.sharedExternalsRepo.getFromScope();\n\n for (const [externalName, external] of Object.entries(sharedExternals)) {\n for (const version of external.versions) {\n if (version.action === 'skip') continue;\n if (version.action === 'scope') {\n for (const remote of version.remotes) {\n const remoteScope = getScope(GLOBAL_SCOPE, remote.name, externalName);\n const url = _path.join(remoteScope, remote.file);\n addToScope(importMap, remoteScope, {\n [externalName]: url,\n });\n addIntegrity(importMap, url, remote.name, remote.file);\n remote.cached = true;\n registerBundleChunks(chunkBundles, remote.name, remote.bundle);\n }\n continue;\n }\n\n if (importMap.imports[externalName]) {\n notifyDuplicateGlobalExternal(externalName);\n continue;\n }\n\n const scope = getScope(GLOBAL_SCOPE, version.remotes[0]!.name, externalName);\n const url = _path.join(scope, version.remotes[0]!.file);\n addToGlobal(importMap, { [externalName]: url });\n addIntegrity(importMap, url, version.remotes[0]!.name, version.remotes[0]!.file);\n registerBundleChunks(chunkBundles, version.remotes[0]!.name, version.remotes[0]!.bundle);\n\n version.remotes[0]!.cached = true;\n }\n ports.sharedExternalsRepo.addOrUpdate(externalName, external);\n }\n\n return importMap;\n }\n\n function notifyDuplicateGlobalExternal(externalName: string): void {\n if (config.strict.strictImportMap) {\n config.log.error(4, `[${externalName}] Shared external has multiple shared versions.`);\n throw new NFError('Could not create ImportMap.');\n }\n\n config.log.warn(4, `Singleton external ${externalName} has multiple shared versions.`);\n }\n\n function addToScope(importMap: ImportMap, scope: string, imports: Imports): void {\n if (!importMap.scopes) importMap.scopes = {};\n if (!importMap.scopes[scope]) importMap.scopes[scope] = {};\n importMap.scopes[scope] = Object.assign(importMap.scopes[scope], imports);\n }\n function addToGlobal(importMap: ImportMap, imports: Imports): void {\n importMap.imports = Object.assign(importMap.imports, imports);\n }\n\n /**\n * Step 4.4: Added the remote-modules (into the global scope).\n * @param importMap\n * @returns\n */\n function addRemoteInfos(importMap: ImportMap, chunkBundles: Record<string, Set<string>>): void {\n const remotes = ports.remoteInfoRepo.getAll();\n\n for (const [remoteName, remote] of Object.entries(remotes)) {\n addRemoteExposedModules(importMap, remoteName, remote);\n registerBundleChunks(chunkBundles, remoteName, 'mapping-or-exposed');\n }\n }\n\n function addRemoteExposedModules(\n importMap: ImportMap,\n remoteName: string,\n remote: RemoteInfo\n ): void {\n for (const exposed of remote.exposes) {\n const moduleName = _path.join(remoteName, exposed.moduleName);\n const moduleUrl = _path.join(remote.scopeUrl, exposed.file);\n importMap.imports[moduleName] = moduleUrl;\n addIntegrity(importMap, moduleUrl, remoteName, exposed.file);\n }\n }\n\n function registerBundleChunks(\n chunkBundles: Record<string, Set<string>>,\n remoteName: string,\n bundleName?: string\n ) {\n if (!bundleName) return chunkBundles;\n if (!chunkBundles[remoteName]) chunkBundles[remoteName] = new Set();\n chunkBundles[remoteName].add(bundleName);\n return chunkBundles;\n }\n\n function addChunkImports(importMap: ImportMap, chunkBundles: Record<string, Set<string>>) {\n Object.entries(chunkBundles).forEach(([remoteName, bundles]) => {\n const baseUrl = getScope('CHUNKS', remoteName);\n\n const imports = Array.from(bundles).reduce((_imports, bundleName) => {\n ports.sharedChunksRepo.tryGet(remoteName, bundleName).ifPresent(files => {\n files.forEach(file => {\n const url = _path.join(baseUrl, file);\n _imports[toChunkImport(file)] = url;\n addIntegrity(importMap, url, remoteName, file);\n });\n });\n return _imports;\n }, {} as Imports);\n\n if (Object.keys(imports).length > 0) addToScope(importMap, baseUrl, imports);\n });\n\n return importMap;\n }\n\n function addIntegrity(\n importMap: ImportMap,\n url: string,\n remoteName: RemoteName,\n file: string\n ): void {\n const hash = ports.remoteInfoRepo.tryGet(remoteName).get()?.integrity?.[file];\n if (!hash) return;\n if (!importMap.integrity) importMap.integrity = {};\n importMap.integrity[url] = hash;\n }\n\n function getScope(ctx: string, remoteName: RemoteName, externalName?: string) {\n return ports.remoteInfoRepo\n .tryGet(remoteName)\n .map(remote => remote.scopeUrl)\n .orThrow(() => {\n if (externalName) {\n config.log.error(\n 4,\n `[${ctx}][${externalName}][${remoteName}] Remote name not found in cache.`\n );\n } else {\n config.log.error(4, `[${ctx}][${remoteName}] Remote name not found in cache.`);\n }\n\n return new NFError('Could not create ImportMap.');\n });\n }\n}\n", "import type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { ForCommittingChanges } from '../driver-ports/init/for-committing-changes.port';\nimport type { ImportMap } from 'lib/core/1.domain/import-map/import-map.contract';\nimport type { LoggingConfig } from 'lib/core/2.app/config';\n\nexport function createCommitChanges(\n config: LoggingConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'scopedExternalsRepo'\n | 'sharedExternalsRepo'\n | 'sharedChunksRepo'\n | 'browser'\n >\n): ForCommittingChanges {\n /**\n * Step 5: Commit all changes\n *\n * The changes made to the storage/cache are persisted to storage, and the importmap is\n * inserted into the HTML DOM.\n *\n * This step only runs if all previous steps were succesful to prevent the persistence of\n * erroneous changes into storage which can corrupt other pages/routes of the host.\n *\n * @param adapters\n */\n return (importMap: ImportMap) =>\n Promise.resolve(importMap).then(addToBrowser).then(persistRepositoryChanges);\n\n function addToBrowser(importMap: ImportMap) {\n ports.browser.setImportMapFn(importMap);\n config.log.debug(5, 'Added import map to browser.', importMap);\n return importMap;\n }\n\n function persistRepositoryChanges() {\n ports.remoteInfoRepo.commit();\n ports.scopedExternalsRepo.commit();\n ports.sharedExternalsRepo.commit();\n ports.sharedChunksRepo.commit();\n return;\n }\n}\n", "import type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { ForExposingModuleLoader } from '../driver-ports/init/for-exposing-module-loader.port';\nimport type { LoadRemoteModule } from 'lib/core/init-federation.contract';\nimport { NFError } from 'lib/core/native-federation.error';\nimport type { LoggingConfig } from '../config/log.contract';\nimport * as _path from 'lib/utils/path';\n\nexport function createExposeModuleLoader(\n config: LoggingConfig,\n ports: Pick<DrivingContract, 'remoteInfoRepo' | 'browser'>\n): ForExposingModuleLoader {\n const loadRemoteModule: LoadRemoteModule = <TModule = unknown>(\n remoteName: string,\n exposedModule: string\n ): Promise<TModule> => {\n try {\n if (!ports.remoteInfoRepo.contains(remoteName)) {\n throw new NFError(`Remote '${remoteName}' is not initialized.`);\n }\n\n const remoteModuleUrl = ports.remoteInfoRepo\n .tryGetModule(remoteName, exposedModule)\n .orThrow(\n new NFError(\n `Exposed module '${exposedModule}' from remote '${remoteName}' not found in storage.`\n )\n );\n\n config.log.debug(6, `Loading initialized module '${remoteModuleUrl}'`);\n\n return ports.browser.importModule(remoteModuleUrl) as Promise<TModule>;\n } catch (error) {\n config.log.error(6, `Failed to load module ${_path.join(remoteName, exposedModule)}: `, {\n error,\n });\n\n return Promise.reject(\n new NFError(`Failed to load module ${_path.join(remoteName, exposedModule)}`)\n );\n }\n };\n\n /**\n * Step 6: expose module loader\n *\n * The module loader can only be used after the importmap was generated and added to\n * the DOM, hence the module loader fn is exposed to the host after the final commit\n * step.\n *\n * The loadRemoteModule is also a callback that is returned as a promise by the initFederation\n * function. This way the loadRemoteModule can be shared througout the host application using\n * CustomEvents or by adding it to the global Window object for easy access.\n *\n * @param adapters\n */\n return () => Promise.resolve(loadRemoteModule);\n}\n", "import type { RemoteEntryUrl } from 'lib/core/1.domain/remote-entry/manifest.contract';\nimport type { RemoteName } from 'lib/core/1.domain/remote/remote-info.contract';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../config/log.contract';\nimport { NFError } from 'lib/core/native-federation.error';\nimport type { ModeConfig } from '../config/mode.contract';\nimport type { ForGettingRemoteEntry } from '../driver-ports/init/for-getting-remote-entry.port';\nimport type { RemoteRef } from '../driver-ports/init/flow.contract';\nimport { Optional } from 'lib/utils/optional';\nimport type { RemoteEntry } from 'lib/core/1.domain';\nimport * as _path from 'lib/utils/path';\n\nconst normalizeRemoteRef = (remote?: RemoteRef): { name?: RemoteName; integrity?: string } => {\n if (!remote) return {};\n if (typeof remote === 'string') return { name: remote };\n return remote;\n};\n\nexport function createGetRemoteEntry(\n config: LoggingConfig & ModeConfig,\n ports: Pick<DrivingContract, 'remoteEntryProvider' | 'remoteInfoRepo' | 'sse'>\n): ForGettingRemoteEntry {\n return async (remoteEntryUrl: RemoteEntryUrl, remote?: RemoteRef) => {\n const { name: remoteName, integrity } = normalizeRemoteRef(remote);\n\n if (!!remoteName && shouldSkipCachedRemote(remoteEntryUrl, remoteName)) {\n config.log.debug(7, `Found remote '${remoteName}' in storage, omitting fetch.`);\n return Optional.empty<RemoteEntry>();\n }\n\n try {\n const remoteEntry = integrity\n ? await ports.remoteEntryProvider.provide(remoteEntryUrl, { integrity })\n : await ports.remoteEntryProvider.provide(remoteEntryUrl);\n\n config.log.debug(\n 7,\n `[${remoteEntry.name}] Fetched from '${remoteEntry.url}', exposing: ${JSON.stringify(remoteEntry.exposes)}`\n );\n\n if (!!remoteName && remoteEntry.name !== remoteName) {\n const errorMsg = `Fetched remote '${remoteEntry.name}' does not match requested '${remoteName}'.`;\n if (config.strict.strictRemoteEntry) {\n config.log.error(7, errorMsg);\n throw new NFError('Could not fetch remote entry');\n }\n config.log.warn(7, errorMsg + ' Omitting expected name.');\n }\n\n if (ports.remoteInfoRepo.contains(remoteEntry.name)) {\n remoteEntry.override = true;\n config.log.debug(7, `Overriding existing remote '${remoteName}' with '${remoteEntryUrl}'.`);\n }\n return Optional.of(checkForSSE(remoteEntry));\n } catch (error) {\n config.log.error(\n 7,\n `[${remoteName ?? 'unknown'}] Could not fetch remoteEntry from ${remoteEntryUrl}.`,\n error\n );\n return Promise.reject(\n new NFError(`[${remoteName ?? remoteEntryUrl}] Could not fetch remoteEntry.`)\n );\n }\n };\n\n function shouldSkipCachedRemote(remoteEntryUrl: string, remoteName: RemoteName): boolean {\n return ports.remoteInfoRepo\n .tryGet(remoteName)\n .map(\n cachedRemoteInfo =>\n config.profile.overrideCachedRemotes !== 'always' ||\n (!config.profile.overrideCachedRemotesIfURLMatches &&\n remoteEntryUrl === _path.join(cachedRemoteInfo.scopeUrl, 'remoteEntry.json'))\n )\n .orElse(false);\n }\n\n function checkForSSE(entry: RemoteEntry): RemoteEntry {\n if (config.sse) {\n if (entry.buildNotificationsEndpoint) {\n ports.sse.watchRemoteBuilds(\n _path.join(_path.getScope(entry.url), entry.buildNotificationsEndpoint)\n );\n config.log.debug(7, `Registered SSE endpoint of remote '${entry.name}' `);\n } else {\n config.log.debug(7, `Remote ${entry.name} has no defined 'buildNotificationsEndpoint'`);\n }\n }\n return entry;\n }\n}\n", "import type { ForUpdatingCache } from '../driver-ports/init/for-updating-cache';\nimport {\n type RemoteEntry,\n type SharedInfo,\n type SharedInfoActions,\n type SharedVersion,\n type SharedVersionAction,\n GLOBAL_SCOPE,\n} from 'lib/core/1.domain';\nimport type { DrivingContract } from '../driving-ports/driving.contract';\nimport type { LoggingConfig } from '../config/log.contract';\nimport * as _path from 'lib/utils/path';\nimport { NFError } from 'lib/core/native-federation.error';\nimport type { ModeConfig } from 'lib/core/2.app/config/mode.contract';\nimport { createStoreRemoteEntry, type SharedExternalContext } from './store-remote-entry';\n\nexport function createUpdateCache(\n config: LoggingConfig & ModeConfig,\n ports: Pick<\n DrivingContract,\n | 'remoteInfoRepo'\n | 'sharedExternalsRepo'\n | 'scopedExternalsRepo'\n | 'sharedChunksRepo'\n | 'versionCheck'\n >\n): ForUpdatingCache {\n const storeRemoteEntry = createStoreRemoteEntry(config, ports, 8);\n\n /**\n * Step 8 (dynamic init): merge a runtime-loaded remoteEntry into the cache. The\n * import map is already committed, so shared externals are resolved immediately\n * and additively \u2014 an already-shared version stays authoritative.\n */\n return remoteEntry => {\n try {\n const actions: SharedInfoActions = {};\n\n storeRemoteEntry(remoteEntry, (entry, external, ctx) => {\n const { action, sharedVersion } = resolveSharedExternal(entry, external, ctx);\n actions[external.packageName] = { action };\n\n if (action === 'skip' && external.shareScope && sharedVersion?.remotes[0]?.file) {\n actions[external.packageName]!.override = resolveOverrideUrl(\n entry,\n external,\n sharedVersion\n );\n }\n });\n\n return Promise.resolve({ entry: remoteEntry, actions });\n } catch (error) {\n return Promise.reject(error);\n }\n };\n\n function resolveSharedExternal(\n remoteEntry: RemoteEntry,\n sharedInfo: SharedInfo,\n {\n tag,\n remote,\n cached,\n scopeType,\n assertSameVersionCompatibility,\n commit,\n }: SharedExternalContext\n ): { action: SharedVersionAction; sharedVersion?: SharedVersion } {\n let action: SharedVersionAction = scopeType === 'strict' ? 'share' : 'skip';\n\n const sharedVersion = cached.versions.find(c => c.action === 'share');\n const isCompatible =\n !sharedVersion || ports.versionCheck.isCompatible(sharedVersion.tag, remote.requiredVersion);\n\n if (action === 'skip' && !isCompatible && remote.strictVersion) {\n action = 'scope';\n const errorMsg = `[${sharedInfo.shareScope ?? GLOBAL_SCOPE}][${remoteEntry.name}] ${\n sharedInfo.packageName\n }@${sharedInfo.version} Is not compatible with existing ${sharedInfo.packageName}@${\n sharedVersion!.tag\n } requiredRange '${sharedVersion!.remotes[0]?.requiredVersion}'`;\n\n if (config.strict.strictExternalCompatibility) {\n config.log.error(8, errorMsg);\n throw new NFError(`Could not process remote '${remoteEntry.name}'`);\n }\n config.log.warn(8, errorMsg);\n }\n\n const matchingVersion = cached.versions.find(cached => cached.tag === tag);\n\n if (matchingVersion) {\n assertSameVersionCompatibility(matchingVersion);\n matchingVersion.remotes.push(remote);\n } else {\n if (!sharedVersion) action = 'share';\n remote.cached = action !== 'skip';\n cached.versions.push({ tag, action, host: false, remotes: [remote] });\n }\n\n commit();\n return { action, sharedVersion };\n }\n\n function resolveOverrideUrl(\n remoteEntry: RemoteEntry,\n external: SharedInfo,\n sharedVersion: SharedVersion\n ): string {\n return ports.remoteInfoRepo\n .tryGet(sharedVersion.remotes[0]!.name)\n .map(remote => _path.join(remote.scopeUrl, sharedVersion.remotes[0]!.file))\n .orThrow(() => {\n config.log.error(\n 8,\n `[${external.shareScope ?? GLOBAL_SCOPE}][${remoteEntry.name}][${\n external.packageName\n }@${external.version}][override] Remote name not found in cache.`\n );\n return new NFError(\n `Could not find override url from remote ${sharedVersion.remotes[0]!.name}`\n );\n });\n }\n}\n", "import type { ImportMap } from 'lib/core/1.domain/import-map/import-map.contract';\nimport type { RemoteEntry, SharedInfoActions } from 'lib/core/1.domain';\nimport type { LoggingConfig } from '../config/log.contract';\nimport * as _path from 'lib/utils/path';\nimport type { ForConvertingToImportMap } from 'lib/core/2.app/driver-ports/init/for-converting-to-import-map';\nimport type { DrivingContract } from 'lib/core/2.app/driving-ports/driving.contract';\nimport { toChunkImport } from '@softarc/native-federation/domain';\n\nexport function createConvertToImportMap(\n { log }: LoggingConfig,\n ports: Pick<DrivingContract, 'sharedChunksRepo'>\n): ForConvertingToImportMap {\n return ({ entry, actions }) => {\n const importMap: ImportMap = { imports: {} };\n\n addExternals(entry, actions, importMap);\n addRemoteInfos(entry, importMap);\n log.debug(9, `[${entry.name}] Processed actions:`, actions);\n return Promise.resolve(importMap);\n };\n\n function addExternals(\n remoteEntry: RemoteEntry,\n actions: SharedInfoActions,\n importMap: ImportMap\n ): void {\n if (!remoteEntry.shared) {\n return;\n }\n\n const remoteEntryScope = _path.getScope(remoteEntry.url);\n const integrityMap = remoteEntry.integrity;\n\n const chunkBundles = new Set<string>(['mapping-or-exposed']);\n remoteEntry.shared.forEach(external => {\n // Scoped externals\n if (!external.singleton) {\n const url = _path.join(remoteEntryScope, external.outFileName);\n addToScopes(remoteEntryScope, external.packageName, url, importMap);\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n if (external?.bundle) chunkBundles.add(external?.bundle);\n return;\n }\n\n if (!actions[external.packageName]) {\n log.warn(\n 9,\n `[${remoteEntry.name}] No action defined for shared external '${external.packageName}', skipping.`\n );\n return;\n }\n\n // Skipped shared externals\n if (actions[external.packageName]!.action === 'skip') {\n if (!external.shareScope) return;\n\n if (actions[external.packageName]!.override) {\n addToScopes(\n remoteEntryScope,\n external.packageName,\n actions[external.packageName]!.override!,\n importMap\n );\n return;\n }\n }\n\n // Chunks for shared externals\n if (external?.bundle) chunkBundles.add(external?.bundle);\n\n // Scoped shared externals\n if (actions[external.packageName]!.action === 'scope') {\n const url = _path.join(remoteEntryScope, external.outFileName);\n addToScopes(remoteEntryScope, external.packageName, url, importMap);\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n return;\n }\n\n // Shared externals with shareScope\n if (external.shareScope) {\n const url = _path.join(remoteEntryScope, external.outFileName);\n addToScopes(remoteEntryScope, external.packageName, url, importMap);\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n return;\n }\n\n // Default case: shared globally\n const url = _path.join(remoteEntryScope, external.outFileName);\n importMap.imports[external.packageName] = url;\n addIntegrity(importMap, url, integrityMap, external.outFileName);\n });\n\n addChunkImports(importMap, remoteEntry, remoteEntryScope, chunkBundles);\n }\n\n function addToScopes(\n scope: string,\n packageName: string,\n url: string,\n importMap: ImportMap\n ): void {\n if (!importMap.scopes) importMap.scopes = {};\n if (!importMap.scopes[scope]) importMap.scopes[scope] = {};\n importMap.scopes[scope][packageName] = url;\n }\n\n function addRemoteInfos(remoteEntry: RemoteEntry, importMap: ImportMap): void {\n if (!remoteEntry.exposes) return;\n const scope = _path.getScope(remoteEntry.url);\n\n remoteEntry.exposes.forEach(exposed => {\n const moduleName = _path.join(remoteEntry.name, exposed.key);\n const moduleUrl = _path.join(scope, exposed.outFileName);\n importMap.imports[moduleName] = moduleUrl;\n addIntegrity(importMap, moduleUrl, remoteEntry.integrity, exposed.outFileName);\n });\n }\n\n function addChunkImports(\n importMap: ImportMap,\n remoteEntry: RemoteEntry,\n remoteEntryScope: string,\n chunkBundles: Set<string>\n ) {\n Array.from(chunkBundles).forEach(bundleName => {\n ports.sharedChunksRepo.tryGet(remoteEntry.name, bundleName).ifPresent(files => {\n files.forEach(file => {\n const url = _path.join(remoteEntryScope, file);\n addToScopes(remoteEntryScope, toChunkImport(file), url, importMap);\n addIntegrity(importMap, url, remoteEntry.integrity, file);\n });\n });\n });\n return importMap;\n }\n\n function addIntegrity(\n importMap: ImportMap,\n url: string,\n integrityMap: Record<string, string> | undefined,\n file: string\n ): void {\n const hash = integrityMap?.[file];\n if (!hash) return;\n if (!importMap.integrity) importMap.integrity = {};\n importMap.integrity[url] = hash;\n }\n}\n", "import type { FLOW_FACTORY } from 'lib/core/2.app/driver-ports/flow-factory.contract';\nimport type { InitDriversContract } from 'lib/core/2.app/driver-ports/init/drivers.contract';\nimport { createGetRemoteEntries } from '../2.app/steps/get-remote-entries';\nimport { createProcessRemoteEntries } from '../2.app/steps/process-remote-entries';\nimport { createDetermineSharedExternals } from '../2.app/steps/determine-shared-externals';\nimport { createGenerateImportMap } from '../2.app/steps/generate-import-map';\nimport { createCommitChanges } from '../2.app/steps/commit-changes';\nimport { createExposeModuleLoader } from '../2.app/steps/expose-module-loader';\nimport { createGetRemoteEntry } from '../2.app/steps/get-remote-entry';\nimport { createUpdateCache } from '../2.app/steps/update-cache';\nimport { createConvertToImportMap } from '../2.app/steps/convert-to-import-map';\nimport type { DrivingContract } from '../2.app/driving-ports/driving.contract';\nimport type { ConfigContract } from '../2.app/config/config.contract';\n\nexport const createInitDrivers = ({\n config,\n adapters,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n}): InitDriversContract => ({\n getRemoteEntries: createGetRemoteEntries(config, adapters),\n processRemoteEntries: createProcessRemoteEntries(config, adapters),\n determineSharedExternals: createDetermineSharedExternals(config, adapters),\n generateImportMap: createGenerateImportMap(config, adapters),\n commitChanges: createCommitChanges(config, adapters),\n exposeModuleLoader: createExposeModuleLoader(config, adapters),\n getRemoteEntry: createGetRemoteEntry(config, adapters),\n updateCache: createUpdateCache(config, adapters),\n convertToImportMap: createConvertToImportMap(config, adapters),\n});\n\nexport const INIT_FLOW_FACTORY = ({\n config,\n adapters,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n}): FLOW_FACTORY<InitDriversContract> => {\n const flow = createInitDrivers({ config, adapters });\n\n return {\n flow,\n adapters,\n config,\n };\n};\n", "import type { ConfigContract } from '../2.app/config/config.contract';\nimport type { DrivingContract } from '../2.app/driving-ports/driving.contract';\nimport type { InitRemoteEntryFlow, RemoteRef } from '../2.app/driver-ports/init/flow.contract';\nimport type {\n LoadRemoteModule,\n LoadRemoteModuleOf,\n NativeFederationResult,\n} from '../init-federation.contract';\n\nexport const createStateDump =\n (config: ConfigContract, adapters: DrivingContract) =>\n (msg: string): void =>\n config.log.debug(0, msg, {\n remotes: { ...adapters.remoteInfoRepo.getAll() },\n 'shared-externals': adapters.sharedExternalsRepo\n .getScopes({ includeGlobal: true })\n .reduce(\n (acc, scope) => ({ ...acc, [scope]: adapters.sharedExternalsRepo.getFromScope(scope) }),\n {}\n ),\n 'scoped-externals': adapters.scopedExternalsRepo.getAll(),\n });\n\nexport const createFederationResult = ({\n config,\n adapters,\n loadRemoteModule,\n initRemoteEntryFlow,\n afterInitRemoteEntry,\n}: {\n config: ConfigContract;\n adapters: DrivingContract;\n loadRemoteModule: LoadRemoteModule;\n initRemoteEntryFlow: InitRemoteEntryFlow;\n afterInitRemoteEntry?: () => Promise<unknown>;\n}): NativeFederationResult => {\n const stateDump = createStateDump(config, adapters);\n\n const initRemoteEntry = async (\n remoteEntryUrl: string,\n remote?: RemoteRef\n ): Promise<NativeFederationResult> => {\n const remoteName = typeof remote === 'string' ? remote : remote?.name;\n return initRemoteEntryFlow(remoteEntryUrl, remote)\n .catch(e => {\n stateDump(`[dynamic-init][${remoteName ?? remoteEntryUrl}] STATE DUMP`);\n if (config.strict.strictRemoteEntry) return Promise.reject(e);\n else console.warn('Failed to initialize remote entry, continuing anyway.');\n return Promise.resolve();\n })\n .then(() => afterInitRemoteEntry?.())\n .then(() => result);\n };\n\n const result: NativeFederationResult = {\n config,\n adapters,\n loadRemoteModule,\n load: loadRemoteModule,\n as: <TModule = unknown>() => ({\n loadRemoteModule: loadRemoteModule as LoadRemoteModuleOf<TModule>,\n load: loadRemoteModule as LoadRemoteModuleOf<TModule>,\n }),\n initRemoteEntry,\n };\n\n return result;\n};\n", "import { register } from 'node:module';\nimport { MessageChannel } from 'node:worker_threads';\nimport type { ImportMap } from 'lib/core/1.domain';\nimport { getLoaderUrl } from './loader-url';\n\n/** Per-specifier list of export names to bridge from the host's instances. */\nexport type HostInstanceKeys = Record<string, string[]>;\n\ntype IncomingMessage = { type: 'import-map-applied' } | { type: 'host-instances-applied' };\ntype OutgoingMessage =\n | { type: 'set-import-map'; map: ImportMap }\n | { type: 'set-host-instances'; keys: HostInstanceKeys };\n\nexport type NodeLoaderClient = {\n setMap: (map: ImportMap) => Promise<void>;\n setHostInstances: (keys: HostInstanceKeys) => Promise<void>;\n ready: () => Promise<void>;\n};\n\nexport const NODE_LOADER_CLIENT_ACK_TIMEOUT_MS = 10_000;\n\nlet cached: NodeLoaderClient | null = null;\n\nconst createClient = (): NodeLoaderClient => {\n const { port1, port2 } = new MessageChannel();\n register(getLoaderUrl(), {\n data: { port: port2 },\n transferList: [port2],\n });\n\n // Don't let the client keep the process alive on its own.\n port1.unref();\n\n let pending: Promise<void> = Promise.resolve();\n\n // Specifiers bridged to host instances. The loader resolves these ahead of\n // the import map, so we strip them from the map we post \u2014 no dead entries.\n const bridged = new Set<string>();\n const omitBridged = (map: ImportMap): ImportMap => {\n if (bridged.size === 0) return map;\n const drop = (imports: ImportMap['imports']): ImportMap['imports'] =>\n Object.fromEntries(Object.entries(imports).filter(([specifier]) => !bridged.has(specifier)));\n const scopes = map.scopes\n ? Object.fromEntries(\n Object.entries(map.scopes).map(([scope, imports]) => [scope, drop(imports)])\n )\n : map.scopes;\n return { ...map, imports: drop(map.imports), ...(scopes ? { scopes } : {}) };\n };\n\n const postAndAwaitAck = (\n message: OutgoingMessage,\n ackType: IncomingMessage['type']\n ): Promise<void> =>\n new Promise<void>((resolve, reject) => {\n let timer: ReturnType<typeof setTimeout> | null = null;\n const cleanup = (): void => {\n port1.off('message', onMessage);\n if (timer !== null) clearTimeout(timer);\n };\n const onMessage = (msg: IncomingMessage): void => {\n if (msg?.type === ackType) {\n cleanup();\n resolve();\n }\n };\n port1.on('message', onMessage);\n timer = setTimeout(() => {\n cleanup();\n reject(\n new Error(\n `node-loader.client: loader did not acknowledge ${message.type} within ${NODE_LOADER_CLIENT_ACK_TIMEOUT_MS}ms`\n )\n );\n }, NODE_LOADER_CLIENT_ACK_TIMEOUT_MS);\n (timer as { unref?: () => void }).unref?.();\n try {\n port1.postMessage(message);\n } catch (err) {\n cleanup();\n reject(err);\n }\n });\n\n // Serialize every post on a single chain so set-import-map and\n // set-host-instances can never race each other on the loader thread.\n const enqueue = (message: OutgoingMessage, ackType: IncomingMessage['type']): Promise<void> => {\n const next = pending.catch(() => undefined).then(() => postAndAwaitAck(message, ackType));\n pending = next;\n return next;\n };\n\n const setMap = (map: ImportMap): Promise<void> =>\n enqueue({ type: 'set-import-map', map: omitBridged(map) }, 'import-map-applied');\n\n const setHostInstances = (keys: HostInstanceKeys): Promise<void> => {\n Object.keys(keys).forEach(specifier => bridged.add(specifier));\n return enqueue({ type: 'set-host-instances', keys }, 'host-instances-applied');\n };\n\n return {\n setMap,\n setHostInstances,\n ready: () => pending,\n };\n};\n\nexport const getNodeLoaderClient = (): NodeLoaderClient => {\n if (!cached) cached = createClient();\n return cached;\n};\n\n/** Only used by tests. */\nexport const _resetNodeLoaderClient = (): void => {\n cached = null;\n};\n", "import { createRequire } from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport { NFError } from 'lib/core/native-federation.error';\n\n/**\n * Resolves the bundled Node loader (`dist/node-loader/loader.mjs`) via the\n * package's own `exports` map. Self-resolving by name (rather than a relative\n * URL from `import.meta.url`) keeps this working under bundlers, pnpm, Yarn\n * PnP, and monorepo symlinks where the on-disk layout of the installed package\n * is not predictable.\n */\nexport const getLoaderUrl = () => {\n try {\n const require = createRequire(import.meta.url);\n return pathToFileURL(\n require.resolve('@softarc/native-federation-orchestrator/node-loader/loader.mjs')\n );\n } catch (err) {\n const cause = err instanceof Error ? err : new Error(String(err));\n throw new NFError(\n `Could not locate the bundled node-loader at '@softarc/native-federation-orchestrator/node-loader/loader.mjs'. Ensure it is installed, and that its 'exports' map exposes this subpath: ${cause.message}`,\n cause\n );\n }\n};\n", "import type { ImportMap } from 'lib/core/1.domain';\nimport type { ImportMapConfig } from 'lib/core/2.app/config/import-map.contract';\nimport {\n getNodeLoaderClient,\n type NodeLoaderClient,\n type HostInstanceKeys,\n} from 'lib/node/adapters/node-loader.client';\n\ntype NodeImportMapConfig = ImportMapConfig & {\n nodeLoader: NodeLoaderClient;\n setHostInstancesFn: (keys: HostInstanceKeys) => Promise<HostInstanceKeys>;\n};\n\nconst useNodeImportMap = (): NodeImportMapConfig => {\n const nodeLoader = getNodeLoaderClient();\n return {\n nodeLoader,\n loadModuleFn: (url: string) => import(/* @vite-ignore */ url),\n setImportMapFn: (importMap: ImportMap) => nodeLoader.setMap(importMap).then(() => importMap),\n setHostInstancesFn: (keys: HostInstanceKeys) =>\n nodeLoader.setHostInstances(keys).then(() => keys),\n reloadBrowserFn: () => {\n /* no-op */\n },\n };\n};\n\nexport { useNodeImportMap };\n", "import type { HostOptions } from 'lib/core/2.app/config/host.contract';\nimport type { LogHandler } from 'lib/core/2.app/config/log.contract';\nimport type { ForProvidingRemoteEntries } from 'lib/core/2.app/driving-ports/for-providing-remote-entries.port';\n\n/** Specifier \u2192 module namespace object to bridge into remotes (the host's own instances). */\nexport type HostInstanceMap = Record<string, object>;\n\n/**\n * Auto-derive the bridged specifiers from the host remoteEntry's shared\n * singletons instead of listing them by hand. Each derived specifier is loaded\n * in the host realm (so the captured instance is the host's) and published.\n */\nexport type HostInstancesAuto = {\n /** Only bridge specifiers matching one of these (exact or prefix, e.g. `'@angular/'`). */\n include?: string[];\n /** Never bridge specifiers matching one of these (exact or prefix). */\n exclude?: string[];\n /**\n * How to load each instance. Default: `(s) => import(s)`.\n *\n * The default resolves wherever this library runs. Under a bundler-driven dev\n * server (e.g. Vite SSR) that may NOT be the realm holding the host's running\n * instance \u2014 pass a `load` defined in your own host entry so the import\n * resolves through the host's module graph and captures the real instance.\n */\n load?: (specifier: string) => Promise<object>;\n};\n\nexport type HostInstancesOption =\n /** Explicit map of specifier \u2192 already-loaded namespace. */\n | HostInstanceMap\n /** Auto-derive every shared singleton from the host remoteEntry. */\n | 'all'\n /** Auto-derive, filtered. */\n | HostInstancesAuto;\n\ntype Deps = {\n remoteEntryProvider: ForProvidingRemoteEntries;\n hostRemoteEntry: HostOptions['hostRemoteEntry'];\n log: LogHandler;\n};\n\n/** A pattern matches a specifier on exact equality or as a prefix. */\nconst matches = (specifier: string, patterns: string[]): boolean =>\n patterns.some(p => specifier === p || specifier.startsWith(p));\n\n/** Distinguish the auto forms (`'all'` / filter object) from an explicit map. */\nconst isAuto = (option: HostInstancesOption): option is 'all' | HostInstancesAuto =>\n option === 'all' ||\n (typeof option === 'object' &&\n option !== null &&\n ('include' in option || 'exclude' in option || 'load' in option));\n\n/**\n * Turn the `hostInstances` option into a concrete `{ specifier: namespace }` map.\n *\n * - Explicit map \u2192 returned as-is.\n * - `'all'` / `{ include, exclude }` \u2192 read the host remoteEntry's shared\n * singletons, apply the filter, and import each in the host realm.\n *\n * A specifier that fails to load is skipped with a warning rather than aborting\n * init \u2014 the remote falls back to import-map resolution for it (which is the\n * pre-bridge behaviour).\n */\nexport const resolveHostInstances = async (\n option: HostInstancesOption | undefined,\n deps: Deps\n): Promise<HostInstanceMap | undefined> => {\n if (!option) return undefined;\n if (!isAuto(option)) return option;\n\n const auto: HostInstancesAuto = option === 'all' ? {} : option;\n\n const { hostRemoteEntry } = deps;\n if (!hostRemoteEntry) {\n deps.log.warn(\n 0,\n '[native-federation] hostInstances auto mode needs a hostRemoteEntry to derive shared singletons from; skipping.'\n );\n return undefined;\n }\n\n const url = typeof hostRemoteEntry === 'string' ? hostRemoteEntry : hostRemoteEntry.url;\n const integrity = typeof hostRemoteEntry === 'string' ? undefined : hostRemoteEntry.integrity;\n const entry = await deps.remoteEntryProvider.provide(url, { integrity });\n\n const load = auto.load ?? ((specifier: string) => import(specifier));\n\n const specifiers = [\n ...new Set((entry.shared ?? []).filter(s => s.singleton).map(s => s.packageName)),\n ]\n .filter(s => (auto.include ? matches(s, auto.include) : true))\n .filter(s => (auto.exclude ? !matches(s, auto.exclude) : true));\n\n const map: HostInstanceMap = {};\n for (const specifier of specifiers) {\n try {\n map[specifier] = (await load(specifier)) as object;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n deps.log.warn(\n 0,\n `[native-federation] hostInstances: could not load '${specifier}' from the host realm; skipping (${msg})`\n );\n }\n }\n\n deps.log.debug(\n 0,\n `[native-federation] hostInstances bridged: ${Object.keys(map).join(', ') || '(none)'}`\n );\n return map;\n};\n", "import { pathToFileURL } from 'node:url';\nimport type { HostOptions } from 'lib/core/2.app/config/host.contract';\n\n/**\n * Coerce a Node-side string into a URL string. Anything that already starts\n * with a scheme (`http:`, `https:`, `file:`, `node:`, \u2026) passes through; a bare\n * filesystem path is converted to a `file://` URL via `pathToFileURL`.\n */\nconst URL_SCHEME = /^[a-z][a-z0-9+\\-.]*:/i;\n\nexport const toUrl = (pathOrUrl: string): string =>\n URL_SCHEME.test(pathOrUrl) ? pathOrUrl : pathToFileURL(pathOrUrl).href;\n\nexport const normalizeHostRemoteEntry = (\n hostRemoteEntry: HostOptions['hostRemoteEntry']\n): HostOptions['hostRemoteEntry'] => {\n if (!hostRemoteEntry) return hostRemoteEntry;\n if (typeof hostRemoteEntry === 'string') return toUrl(hostRemoteEntry);\n return { ...hostRemoteEntry, url: toUrl(hostRemoteEntry.url) };\n};\n", "import type { FederationManifest } from 'lib/core/1.domain';\nimport type { NFOptions, ConfigContract } from 'lib/core/2.app/config/config.contract';\nimport type { DrivingContract } from 'lib/core/2.app/driving-ports/driving.contract';\nimport type { NativeFederationResult } from 'lib/core/init-federation.contract';\n\nimport { createBrowser } from 'lib/core/3.adapters/browser/browser';\nimport { createVersionCheck } from 'lib/core/3.adapters/checks/version.check';\nimport { createFsManifestProvider } from './adapters/fs-manifest-provider';\nimport { createFsRemoteEntryProvider } from './adapters/fs-remote-entry-provider';\nimport { createNoopSSE } from './adapters/noop-sse';\nimport { createRemoteInfoRepository } from 'lib/core/3.adapters/storage/remote-info.repository';\nimport { createScopedExternalsRepository } from 'lib/core/3.adapters/storage/scoped-externals.repository';\nimport { createSharedExternalsRepository } from 'lib/core/3.adapters/storage/shared-externals.repository';\nimport { createChunkRepository } from 'lib/core/3.adapters/storage/chunk.repository';\n\nimport { createConfigHandlers } from 'lib/core/5.di/config.factory';\nimport { createInitFlow } from 'lib/core/2.app/flows/init.flow';\nimport { createInitRemoteEntryFlow } from 'lib/core/2.app/flows/init-remote-entry.flow';\nimport { INIT_FLOW_FACTORY } from 'lib/core/5.di/init.factory';\nimport {\n createFederationResult,\n createStateDump,\n} from 'lib/core/5.di/federation-result.factory';\nimport { useNodeImportMap } from './use-node';\nimport { resolveHostInstances, type HostInstancesOption } from './resolve-host-instances';\nimport { normalizeHostRemoteEntry } from './utils/to-url';\n\nexport type { HostInstancesOption, HostInstancesAuto } from './resolve-host-instances';\n\nexport type InitNodeFederationOptions = NFOptions & {\n /**\n * Bridge specifiers to instances already loaded in the host process (dev).\n *\n * The host's instances are published on `globalThis.__NF_HOST_INSTANCES__`\n * and the node loader synthesizes a re-export module for each specifier\n * instead of resolving it through the import map, so remotes share the host's\n * singletons. Three forms:\n *\n * - **Explicit map** \u2014 `{ '@angular/core': await import('@angular/core') }`.\n * - **`'all'`** \u2014 auto-derive every shared singleton from the host remoteEntry\n * and import each in the host realm. Needs `hostRemoteEntry`.\n * - **`{ include, exclude }`** \u2014 auto-derive, filtered by exact/prefix match,\n * e.g. `{ include: ['@angular/', 'rxjs', 'zone.js'] }`.\n *\n * This is an escape hatch that bypasses the version resolver, the import map,\n * and integrity checks entirely. Exports are value snapshots, not live\n * bindings \u2014 fine for packages whose exports are stable refs (Angular's\n * classes/functions), not for packages that reassign their exports after init.\n *\n * Omit in production: with no `hostInstances`, nothing is published and the\n * loader never routes to the bridge \u2014 resolution is import-map only.\n */\n hostInstances?: HostInstancesOption;\n};\n\n/** Global key the node loader reads at module-eval time on the main thread. */\nconst HOST_INSTANCES_GLOBAL = '__NF_HOST_INSTANCES__';\n\nconst buildNodeAdapters = (config: ConfigContract): DrivingContract => ({\n versionCheck: createVersionCheck(),\n manifestProvider: createFsManifestProvider(),\n remoteEntryProvider: createFsRemoteEntryProvider(),\n remoteInfoRepo: createRemoteInfoRepository(config),\n scopedExternalsRepo: createScopedExternalsRepository(config),\n sharedExternalsRepo: createSharedExternalsRepository(config),\n sharedChunksRepo: createChunkRepository(config),\n browser: createBrowser(config),\n sse: createNoopSSE(),\n});\n\nconst initNodeFederation = (\n remotesOrManifestUrl: string | FederationManifest,\n options: InitNodeFederationOptions = {}\n): Promise<NativeFederationResult> => {\n const nodeConfig = useNodeImportMap();\n\n const hostRemoteEntry = normalizeHostRemoteEntry(options.hostRemoteEntry);\n\n const config = createConfigHandlers({\n ...options,\n hostRemoteEntry,\n loadModuleFn: options.loadModuleFn ?? nodeConfig.loadModuleFn,\n setImportMapFn: options.setImportMapFn ?? nodeConfig.setImportMapFn,\n reloadBrowserFn: options.reloadBrowserFn ?? nodeConfig.reloadBrowserFn,\n sse: false,\n });\n\n const adapters = buildNodeAdapters(config);\n\n // Host-instance bridge (dev): resolve the instance map (explicit, or\n // auto-derived from the host remoteEntry's shared singletons), publish it on\n // the global the loader reads, ship the export-key lists to the loader thread,\n // and wait for its ack before the init flow resolves any remote import. With\n // no hostInstances this is a no-op and resolution stays import-map only.\n const hostInstancesReady = (async () => {\n const instances = await resolveHostInstances(options.hostInstances, {\n remoteEntryProvider: adapters.remoteEntryProvider,\n hostRemoteEntry,\n log: config.log,\n });\n if (!instances || Object.keys(instances).length === 0) return;\n\n const globals = globalThis as Record<string, unknown>;\n globals[HOST_INSTANCES_GLOBAL] = {\n ...((globals[HOST_INSTANCES_GLOBAL] as Record<string, object> | undefined) ?? {}),\n ...instances,\n };\n const keys = Object.fromEntries(\n Object.entries(instances).map(([specifier, ns]) => [specifier, Object.keys(ns)])\n );\n await nodeConfig.setHostInstancesFn(keys);\n })();\n\n const factory = INIT_FLOW_FACTORY({ adapters, config });\n const initFlow = createInitFlow(factory);\n const initRemoteEntryFlow = createInitRemoteEntryFlow(factory);\n\n return hostInstancesReady\n .then(() => initFlow(remotesOrManifestUrl))\n .then(({ loadRemoteModule }) => nodeConfig.nodeLoader.ready().then(() => loadRemoteModule))\n .then(loadRemoteModule =>\n createFederationResult({\n config,\n adapters,\n loadRemoteModule,\n initRemoteEntryFlow,\n afterInitRemoteEntry: () => nodeConfig.nodeLoader.ready(),\n })\n )\n .catch(e => {\n createStateDump(config, adapters)(`[init] STATE DUMP`);\n return Promise.reject(e);\n });\n};\n\nexport { initNodeFederation };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAM,QACJ,OAAO,YAAY,YACnB,QAAQ,OACR,QAAQ,IAAI,cACZ,cAAc,KAAK,QAAQ,IAAI,UAAU,IACvC,IAAI,SAAS,QAAQ,MAAM,UAAU,GAAG,IAAI,IAC5C,MAAM;AAAA,IAAC;AAEX,WAAO,UAAU;AAAA;AAAA;;;ACVjB;AAAA;AAAA;AAIA,QAAM,sBAAsB;AAE5B,QAAM,aAAa;AACnB,QAAM,mBAAmB,OAAO;AAAA,IACL;AAG3B,QAAM,4BAA4B;AAIlC,QAAM,wBAAwB,aAAa;AAE3C,QAAM,gBAAgB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO,UAAU;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,yBAAyB;AAAA,MACzB,YAAY;AA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|
|
6
|
+
"names": ["cached", "require_valid", "import_valid", "semverValid", "semverSatisfies", "semverCompare", "semverValidRange", "semverMinVersion", "importMap", "cached", "cached", "getScope", "scope", "url", "cached", "url", "require", "pathToFileURL"]
|
|
7
7
|
}
|