@module-federation/sdk
Advanced tools
Comparing version 0.0.0-next-20240318072254 to 0.0.0-next-20240318082152
@@ -5,3 +5,3 @@ 'use strict'; | ||
function _define_property$3(obj, key, value) { | ||
function _define_property$2(obj, key, value) { | ||
if (key in obj) { | ||
@@ -29,5 +29,5 @@ Object.defineProperty(obj, key, { | ||
var _obj; | ||
var NameTransformMap = (_obj = {}, _define_property$3(_obj, NameTransformSymbol.AT, "scope_"), _define_property$3(_obj, NameTransformSymbol.HYPHEN, "_"), _define_property$3(_obj, NameTransformSymbol.SLASH, "__"), _obj); | ||
var NameTransformMap = (_obj = {}, _define_property$2(_obj, NameTransformSymbol.AT, "scope_"), _define_property$2(_obj, NameTransformSymbol.HYPHEN, "_"), _define_property$2(_obj, NameTransformSymbol.SLASH, "__"), _obj); | ||
var _obj1; | ||
var EncodedNameTransformMap = (_obj1 = {}, _define_property$3(_obj1, NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT), _define_property$3(_obj1, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN), _define_property$3(_obj1, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH), _obj1); | ||
var EncodedNameTransformMap = (_obj1 = {}, _define_property$2(_obj1, NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT), _define_property$2(_obj1, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN), _define_property$2(_obj1, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH), _obj1); | ||
var SEPARATOR = ":"; | ||
@@ -40,3 +40,2 @@ var ManifestFileName = "mf-manifest.json"; | ||
}; | ||
var HEADERS_KEY = "FEDERATION_HEADERS"; | ||
@@ -99,3 +98,3 @@ var ContainerPlugin = /*#__PURE__*/Object.freeze({ | ||
} | ||
function _define_property$2(obj, key, value) { | ||
function _define_property$1(obj, key, value) { | ||
if (key in obj) { | ||
@@ -151,4 +150,4 @@ Object.defineProperty(obj, key, { | ||
_class_call_check(this, Logger); | ||
_define_property$2(this, "enable", false); | ||
_define_property$2(this, "identifier", void 0); | ||
_define_property$1(this, "enable", false); | ||
_define_property$1(this, "identifier", void 0); | ||
this.identifier = identifier || DEBUG_LOG; | ||
@@ -206,15 +205,2 @@ if (isBrowserEnv() && safeGetLocalStorageItem()) { | ||
} | ||
function _define_property$1(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _iterable_to_array(iter) { | ||
@@ -250,17 +236,2 @@ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _object_spread$1(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
var ownKeys = Object.keys(source); | ||
if (typeof Object.getOwnPropertySymbols === "function") { | ||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
})); | ||
} | ||
ownKeys.forEach(function(key) { | ||
_define_property$1(target, key, source[key]); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _sliced_to_array$1(arr, i) { | ||
@@ -411,9 +382,2 @@ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1(); | ||
}; | ||
var getHeaders = function() { | ||
if (typeof window !== "undefined") { | ||
return JSON.parse(localStorage.getItem(HEADERS_KEY) || "{}"); | ||
} | ||
var headersStr = getProcessEnv()[HEADERS_KEY] || "{}"; | ||
return _object_spread$1({}, JSON.parse(headersStr)); | ||
}; | ||
@@ -505,3 +469,3 @@ function _define_property(obj, key, value) { | ||
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | ||
var _manifest_metaData; | ||
var _manifest_metaData, _manifest_metaData1; | ||
var _options_remotes = options.remotes, remotes = _options_remotes === void 0 ? {} : _options_remotes, _options_overrides = options.overrides, overrides = _options_overrides === void 0 ? {} : _options_overrides, version = options.version; | ||
@@ -547,3 +511,3 @@ var remoteSnapshot; | ||
}); | ||
var _manifest_metaData1 = manifest.metaData, _manifest_metaData_remoteEntry = _manifest_metaData1.remoteEntry, remoteEntryPath = _manifest_metaData_remoteEntry.path, remoteEntryName = _manifest_metaData_remoteEntry.name, remoteEntryType = _manifest_metaData_remoteEntry.type, remoteTypes = _manifest_metaData1.types, buildVersion = _manifest_metaData1.buildInfo.buildVersion, globalName = _manifest_metaData1.globalName; | ||
var _manifest_metaData2 = manifest.metaData, _manifest_metaData_remoteEntry = _manifest_metaData2.remoteEntry, remoteEntryPath = _manifest_metaData_remoteEntry.path, remoteEntryName = _manifest_metaData_remoteEntry.name, remoteEntryType = _manifest_metaData_remoteEntry.type, remoteTypes = _manifest_metaData2.types, buildVersion = _manifest_metaData2.buildInfo.buildVersion, globalName = _manifest_metaData2.globalName; | ||
var exposes = manifest.exposes; | ||
@@ -572,3 +536,9 @@ var basicRemoteSnapshot = { | ||
}; | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) { | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) { | ||
var prefetchInterface = manifest.metaData.prefetchInterface; | ||
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), { | ||
prefetchInterface: prefetchInterface | ||
}); | ||
} | ||
if ((_manifest_metaData1 = manifest.metaData) === null || _manifest_metaData1 === void 0 ? void 0 : _manifest_metaData1.prefetchEntry) { | ||
var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type; | ||
@@ -1223,3 +1193,2 @@ basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), { | ||
exports.FederationModuleManifest = FederationModuleManifest; | ||
exports.HEADERS_KEY = HEADERS_KEY; | ||
exports.Logger = Logger; | ||
@@ -1246,3 +1215,2 @@ exports.MANIFEST_EXT = MANIFEST_EXT; | ||
exports.generateSnapshotFromManifest = generateSnapshotFromManifest; | ||
exports.getHeaders = getHeaders; | ||
exports.getProcessEnv = getProcessEnv; | ||
@@ -1249,0 +1217,0 @@ exports.getResourceUrl = getResourceUrl; |
@@ -1,2 +0,2 @@ | ||
function _define_property$3(obj, key, value) { | ||
function _define_property$2(obj, key, value) { | ||
if (key in obj) { | ||
@@ -24,5 +24,5 @@ Object.defineProperty(obj, key, { | ||
var _obj; | ||
var NameTransformMap = (_obj = {}, _define_property$3(_obj, NameTransformSymbol.AT, "scope_"), _define_property$3(_obj, NameTransformSymbol.HYPHEN, "_"), _define_property$3(_obj, NameTransformSymbol.SLASH, "__"), _obj); | ||
var NameTransformMap = (_obj = {}, _define_property$2(_obj, NameTransformSymbol.AT, "scope_"), _define_property$2(_obj, NameTransformSymbol.HYPHEN, "_"), _define_property$2(_obj, NameTransformSymbol.SLASH, "__"), _obj); | ||
var _obj1; | ||
var EncodedNameTransformMap = (_obj1 = {}, _define_property$3(_obj1, NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT), _define_property$3(_obj1, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN), _define_property$3(_obj1, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH), _obj1); | ||
var EncodedNameTransformMap = (_obj1 = {}, _define_property$2(_obj1, NameTransformMap[NameTransformSymbol.AT], NameTransformSymbol.AT), _define_property$2(_obj1, NameTransformMap[NameTransformSymbol.HYPHEN], NameTransformSymbol.HYPHEN), _define_property$2(_obj1, NameTransformMap[NameTransformSymbol.SLASH], NameTransformSymbol.SLASH), _obj1); | ||
var SEPARATOR = ":"; | ||
@@ -35,3 +35,2 @@ var ManifestFileName = "mf-manifest.json"; | ||
}; | ||
var HEADERS_KEY = "FEDERATION_HEADERS"; | ||
@@ -94,3 +93,3 @@ var ContainerPlugin = /*#__PURE__*/Object.freeze({ | ||
} | ||
function _define_property$2(obj, key, value) { | ||
function _define_property$1(obj, key, value) { | ||
if (key in obj) { | ||
@@ -146,4 +145,4 @@ Object.defineProperty(obj, key, { | ||
_class_call_check(this, Logger); | ||
_define_property$2(this, "enable", false); | ||
_define_property$2(this, "identifier", void 0); | ||
_define_property$1(this, "enable", false); | ||
_define_property$1(this, "identifier", void 0); | ||
this.identifier = identifier || DEBUG_LOG; | ||
@@ -201,15 +200,2 @@ if (isBrowserEnv() && safeGetLocalStorageItem()) { | ||
} | ||
function _define_property$1(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _iterable_to_array(iter) { | ||
@@ -245,17 +231,2 @@ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _object_spread$1(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
var ownKeys = Object.keys(source); | ||
if (typeof Object.getOwnPropertySymbols === "function") { | ||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
})); | ||
} | ||
ownKeys.forEach(function(key) { | ||
_define_property$1(target, key, source[key]); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _sliced_to_array$1(arr, i) { | ||
@@ -406,9 +377,2 @@ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1(); | ||
}; | ||
var getHeaders = function() { | ||
if (typeof window !== "undefined") { | ||
return JSON.parse(localStorage.getItem(HEADERS_KEY) || "{}"); | ||
} | ||
var headersStr = getProcessEnv()[HEADERS_KEY] || "{}"; | ||
return _object_spread$1({}, JSON.parse(headersStr)); | ||
}; | ||
@@ -500,3 +464,3 @@ function _define_property(obj, key, value) { | ||
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | ||
var _manifest_metaData; | ||
var _manifest_metaData, _manifest_metaData1; | ||
var _options_remotes = options.remotes, remotes = _options_remotes === void 0 ? {} : _options_remotes, _options_overrides = options.overrides, overrides = _options_overrides === void 0 ? {} : _options_overrides, version = options.version; | ||
@@ -542,3 +506,3 @@ var remoteSnapshot; | ||
}); | ||
var _manifest_metaData1 = manifest.metaData, _manifest_metaData_remoteEntry = _manifest_metaData1.remoteEntry, remoteEntryPath = _manifest_metaData_remoteEntry.path, remoteEntryName = _manifest_metaData_remoteEntry.name, remoteEntryType = _manifest_metaData_remoteEntry.type, remoteTypes = _manifest_metaData1.types, buildVersion = _manifest_metaData1.buildInfo.buildVersion, globalName = _manifest_metaData1.globalName; | ||
var _manifest_metaData2 = manifest.metaData, _manifest_metaData_remoteEntry = _manifest_metaData2.remoteEntry, remoteEntryPath = _manifest_metaData_remoteEntry.path, remoteEntryName = _manifest_metaData_remoteEntry.name, remoteEntryType = _manifest_metaData_remoteEntry.type, remoteTypes = _manifest_metaData2.types, buildVersion = _manifest_metaData2.buildInfo.buildVersion, globalName = _manifest_metaData2.globalName; | ||
var exposes = manifest.exposes; | ||
@@ -567,3 +531,9 @@ var basicRemoteSnapshot = { | ||
}; | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) { | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) { | ||
var prefetchInterface = manifest.metaData.prefetchInterface; | ||
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), { | ||
prefetchInterface: prefetchInterface | ||
}); | ||
} | ||
if ((_manifest_metaData1 = manifest.metaData) === null || _manifest_metaData1 === void 0 ? void 0 : _manifest_metaData1.prefetchEntry) { | ||
var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type; | ||
@@ -1214,2 +1184,2 @@ basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), { | ||
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, HEADERS_KEY, Logger, MANIFEST_EXT, MFModuleType, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getHeaders, getProcessEnv, getResourceUrl, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, parseEntry, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn }; | ||
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, MFModuleType, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, parseEntry, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn }; |
@@ -23,2 +23,1 @@ export declare const FederationModuleManifest = "federation-manifest.json"; | ||
}; | ||
export declare const HEADERS_KEY = "FEDERATION_HEADERS"; |
@@ -30,2 +30,3 @@ import { RemoteEntryType, StatsAssets } from './stats'; | ||
}>; | ||
prefetchInterface?: boolean; | ||
prefetchEntry?: string; | ||
@@ -32,0 +33,0 @@ prefetchEntryType?: RemoteEntryType; |
@@ -17,2 +17,3 @@ import type { RemoteWithEntry, RemoteWithVersion } from './common'; | ||
remoteEntry: ResourceInfo; | ||
prefetchInterface?: boolean; | ||
prefetchEntry?: ResourceInfo; | ||
@@ -19,0 +20,0 @@ types: Omit<ResourceInfo, 'type'>; |
@@ -17,3 +17,2 @@ import { RemoteEntryInfo, ModuleInfo } from './types'; | ||
declare const warn: (msg: Parameters<typeof console.warn>[0]) => void; | ||
declare const getHeaders: () => Record<string, string>; | ||
export { getHeaders, parseEntry, logger, decodeName, encodeName, composeKeyWithSeparator, generateExposeFilename, generateShareFilename, getResourceUrl, assert, error, warn, }; | ||
export { parseEntry, logger, decodeName, encodeName, composeKeyWithSeparator, generateExposeFilename, generateShareFilename, getResourceUrl, assert, error, warn, }; |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.0-next-20240318072254", | ||
"version": "0.0.0-next-20240318082152", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131686
3327