@module-federation/sdk
Advanced tools
Comparing version 0.0.0-next-20240830062908 to 0.0.0-next-20240830065016
@@ -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.6.0", | ||
"version": "0.5.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
/** | ||
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). | ||
*/ | ||
export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'script' | 'node-commonjs'; | ||
export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'script' | 'node-commonjs'; | ||
/** | ||
@@ -6,0 +6,0 @@ * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location. |
@@ -177,4 +177,2 @@ import type webpack from 'webpack'; | ||
async?: boolean | AsyncBoundaryOptions; | ||
virtualRuntimeEntry?: boolean; | ||
embedRuntime?: boolean; | ||
} | ||
@@ -181,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-20240830062908", | ||
"version": "0.0.0-next-20240830065016", | ||
"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