@module-federation/sdk
Advanced tools
Comparing version 0.0.0-next-20240824225724 to 0.0.0-next-20240826075118
@@ -5,4 +5,2 @@ 'use strict'; | ||
var _extends = require('@swc/helpers/_/_extends'); | ||
const FederationModuleManifest = 'federation-manifest.json'; | ||
@@ -67,2 +65,9 @@ const MANIFEST_EXT = '.json'; | ||
function safeToString(info) { | ||
try { | ||
return JSON.stringify(info, null, 2); | ||
} catch (e) { | ||
return ''; | ||
} | ||
} | ||
const DEBUG_LOG = '[ FEDERATION DEBUG ]'; | ||
@@ -247,8 +252,12 @@ function safeGetLocalStorageItem() { | ||
}; | ||
function safeToString(info) { | ||
try { | ||
return JSON.stringify(info, null, 2); | ||
} catch (e) { | ||
return ''; | ||
} | ||
function _extends() { | ||
_extends = Object.assign || function assign(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
@@ -359,3 +368,3 @@ | ||
const prefetchInterface = manifest.metaData.prefetchInterface; | ||
basicRemoteSnapshot = _extends._({}, basicRemoteSnapshot, { | ||
basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
prefetchInterface | ||
@@ -366,3 +375,3 @@ }); | ||
const { path, name, type } = manifest.metaData.prefetchEntry; | ||
basicRemoteSnapshot = _extends._({}, basicRemoteSnapshot, { | ||
basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
prefetchEntry: simpleJoinRemoteEntry(path, name), | ||
@@ -373,7 +382,7 @@ prefetchEntryType: type | ||
if ('publicPath' in manifest.metaData) { | ||
remoteSnapshot = _extends._({}, basicRemoteSnapshot, { | ||
remoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
publicPath: getPublicPath() | ||
}); | ||
} else { | ||
remoteSnapshot = _extends._({}, basicRemoteSnapshot, { | ||
remoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
getPublicPath: getPublicPath() | ||
@@ -566,3 +575,3 @@ }); | ||
cb: resolve, | ||
attrs: _extends._({ | ||
attrs: _extends({ | ||
fetchpriority: 'high' | ||
@@ -703,3 +712,3 @@ }, attrs), | ||
if (options && typeof options === 'object') { | ||
return _extends._({}, defaultOptions, options); | ||
return _extends({}, defaultOptions, options); | ||
} | ||
@@ -751,3 +760,2 @@ throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`); | ||
exports.parseEntry = parseEntry; | ||
exports.safeToString = safeToString; | ||
exports.safeWrapper = safeWrapper; | ||
@@ -754,0 +762,0 @@ exports.sharePlugin = SharePlugin; |
@@ -1,3 +0,1 @@ | ||
import { _ } from '@swc/helpers/_/_extends'; | ||
const FederationModuleManifest = 'federation-manifest.json'; | ||
@@ -62,2 +60,9 @@ const MANIFEST_EXT = '.json'; | ||
function safeToString(info) { | ||
try { | ||
return JSON.stringify(info, null, 2); | ||
} catch (e) { | ||
return ''; | ||
} | ||
} | ||
const DEBUG_LOG = '[ FEDERATION DEBUG ]'; | ||
@@ -242,8 +247,12 @@ function safeGetLocalStorageItem() { | ||
}; | ||
function safeToString(info) { | ||
try { | ||
return JSON.stringify(info, null, 2); | ||
} catch (e) { | ||
return ''; | ||
} | ||
function _extends() { | ||
_extends = Object.assign || function assign(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
@@ -354,3 +363,3 @@ | ||
const prefetchInterface = manifest.metaData.prefetchInterface; | ||
basicRemoteSnapshot = _({}, basicRemoteSnapshot, { | ||
basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
prefetchInterface | ||
@@ -361,3 +370,3 @@ }); | ||
const { path, name, type } = manifest.metaData.prefetchEntry; | ||
basicRemoteSnapshot = _({}, basicRemoteSnapshot, { | ||
basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
prefetchEntry: simpleJoinRemoteEntry(path, name), | ||
@@ -368,7 +377,7 @@ prefetchEntryType: type | ||
if ('publicPath' in manifest.metaData) { | ||
remoteSnapshot = _({}, basicRemoteSnapshot, { | ||
remoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
publicPath: getPublicPath() | ||
}); | ||
} else { | ||
remoteSnapshot = _({}, basicRemoteSnapshot, { | ||
remoteSnapshot = _extends({}, basicRemoteSnapshot, { | ||
getPublicPath: getPublicPath() | ||
@@ -561,3 +570,3 @@ }); | ||
cb: resolve, | ||
attrs: _({ | ||
attrs: _extends({ | ||
fetchpriority: 'high' | ||
@@ -698,3 +707,3 @@ }, attrs), | ||
if (options && typeof options === 'object') { | ||
return _({}, defaultOptions, options); | ||
return _extends({}, defaultOptions, options); | ||
} | ||
@@ -705,2 +714,2 @@ throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`); | ||
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, MFModuleType, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, TEMP_DIR, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, inferAutoPublicPath, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, normalizeOptions, parseEntry, safeToString, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn }; | ||
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, MFModuleType, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, TEMP_DIR, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, inferAutoPublicPath, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, normalizeOptions, parseEntry, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn }; |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
@@ -177,3 +177,2 @@ import type webpack from 'webpack'; | ||
async?: boolean | AsyncBoundaryOptions; | ||
embedRuntime?: boolean; | ||
} | ||
@@ -180,0 +179,0 @@ /** |
@@ -17,3 +17,2 @@ import { RemoteEntryInfo, ModuleInfo } from './types'; | ||
declare const warn: (msg: Parameters<typeof console.warn>[0]) => void; | ||
declare function safeToString(info: any): string; | ||
export { parseEntry, logger, decodeName, encodeName, composeKeyWithSeparator, generateExposeFilename, generateShareFilename, getResourceUrl, assert, error, warn, safeToString, }; | ||
export { parseEntry, logger, decodeName, encodeName, composeKeyWithSeparator, generateExposeFilename, generateShareFilename, getResourceUrl, assert, error, warn, }; |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.0-next-20240824225724", | ||
"version": "0.0.0-next-20240826075118", | ||
"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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
100080
2484
7
8