@module-federation/sdk
Advanced tools
Comparing version 0.0.0-next-20240309014600 to 0.0.0-next-20240310052320
@@ -32,25 +32,3 @@ 'use strict'; | ||
var SEPARATOR = ":"; | ||
var ManifestFileName = "mf-manifest.json"; | ||
var StatsFileName = "mf-stats.json"; | ||
var MFModuleType = { | ||
NPM: "npm", | ||
APP: "app" | ||
}; | ||
var ContainerPlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var ContainerReferencePlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var ModuleFederationPlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var SharePlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
function isBrowserEnv() { | ||
@@ -249,4 +227,3 @@ return typeof window !== "undefined"; | ||
var parseEntry = function(str, devVerOrUrl) { | ||
var separator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : SEPARATOR; | ||
var strSplit = str.split(separator); | ||
var strSplit = str.split(SEPARATOR); | ||
var devVersionOrUrl = getProcessEnv()["NODE_ENV"] === "development" && devVerOrUrl; | ||
@@ -260,3 +237,3 @@ var defaultVersion = "*"; | ||
var _strSplit = _to_array(strSplit), name = _strSplit[0], versionOrEntryArr = _strSplit.slice(1); | ||
var versionOrEntry = devVersionOrUrl || versionOrEntryArr.join(separator); | ||
var versionOrEntry = devVersionOrUrl || versionOrEntryArr.join(SEPARATOR); | ||
if (isEntry(versionOrEntry)) { | ||
@@ -529,6 +506,7 @@ return { | ||
}; | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) { | ||
var prefetchInterface = manifest.metaData.prefetchInterface; | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) { | ||
var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type; | ||
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), { | ||
prefetchInterface: prefetchInterface | ||
prefetchEntry: simpleJoinRemoteEntry(path, name), | ||
prefetchEntryType: type | ||
}); | ||
@@ -1128,3 +1106,5 @@ } | ||
try { | ||
script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), filename); | ||
script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), { | ||
filename: filename | ||
}); | ||
script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename); | ||
@@ -1180,12 +1160,7 @@ exportedInterface = scriptContext.module.exports || scriptContext.exports; | ||
exports.MANIFEST_EXT = MANIFEST_EXT; | ||
exports.MFModuleType = MFModuleType; | ||
exports.ManifestFileName = ManifestFileName; | ||
exports.NameTransformMap = NameTransformMap; | ||
exports.NameTransformSymbol = NameTransformSymbol; | ||
exports.SEPARATOR = SEPARATOR; | ||
exports.StatsFileName = StatsFileName; | ||
exports.assert = assert; | ||
exports.composeKeyWithSeparator = composeKeyWithSeparator; | ||
exports.containerPlugin = ContainerPlugin; | ||
exports.containerReferencePlugin = ContainerReferencePlugin; | ||
exports.createLink = createLink; | ||
@@ -1209,7 +1184,5 @@ exports.createScript = createScript; | ||
exports.logger = logger; | ||
exports.moduleFederationPlugin = ModuleFederationPlugin; | ||
exports.parseEntry = parseEntry; | ||
exports.safeWrapper = safeWrapper; | ||
exports.sharePlugin = SharePlugin; | ||
exports.simpleJoinRemoteEntry = simpleJoinRemoteEntry; | ||
exports.warn = warn; |
@@ -28,25 +28,3 @@ function _define_property$2(obj, key, value) { | ||
var SEPARATOR = ":"; | ||
var ManifestFileName = "mf-manifest.json"; | ||
var StatsFileName = "mf-stats.json"; | ||
var MFModuleType = { | ||
NPM: "npm", | ||
APP: "app" | ||
}; | ||
var ContainerPlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var ContainerReferencePlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var ModuleFederationPlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var SharePlugin = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
function isBrowserEnv() { | ||
@@ -245,4 +223,3 @@ return typeof window !== "undefined"; | ||
var parseEntry = function(str, devVerOrUrl) { | ||
var separator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : SEPARATOR; | ||
var strSplit = str.split(separator); | ||
var strSplit = str.split(SEPARATOR); | ||
var devVersionOrUrl = getProcessEnv()["NODE_ENV"] === "development" && devVerOrUrl; | ||
@@ -256,3 +233,3 @@ var defaultVersion = "*"; | ||
var _strSplit = _to_array(strSplit), name = _strSplit[0], versionOrEntryArr = _strSplit.slice(1); | ||
var versionOrEntry = devVersionOrUrl || versionOrEntryArr.join(separator); | ||
var versionOrEntry = devVersionOrUrl || versionOrEntryArr.join(SEPARATOR); | ||
if (isEntry(versionOrEntry)) { | ||
@@ -525,6 +502,7 @@ return { | ||
}; | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) { | ||
var prefetchInterface = manifest.metaData.prefetchInterface; | ||
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) { | ||
var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type; | ||
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), { | ||
prefetchInterface: prefetchInterface | ||
prefetchEntry: simpleJoinRemoteEntry(path, name), | ||
prefetchEntryType: type | ||
}); | ||
@@ -1124,3 +1102,5 @@ } | ||
try { | ||
script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), filename); | ||
script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), { | ||
filename: filename | ||
}); | ||
script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename); | ||
@@ -1170,2 +1150,2 @@ exportedInterface = scriptContext.module.exports || scriptContext.exports; | ||
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 }; | ||
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, NameTransformMap, NameTransformSymbol, SEPARATOR, assert, composeKeyWithSeparator, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, parseEntry, safeWrapper, simpleJoinRemoteEntry, warn }; |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.15", | ||
"version": "0.0.14", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
@@ -17,7 +17,1 @@ export declare const FederationModuleManifest = "federation-manifest.json"; | ||
export declare const SEPARATOR = ":"; | ||
export declare const ManifestFileName = "mf-manifest.json"; | ||
export declare const StatsFileName = "mf-stats.json"; | ||
export declare const MFModuleType: { | ||
NPM: string; | ||
APP: string; | ||
}; |
@@ -5,2 +5,1 @@ export * from './common'; | ||
export * from './snapshot'; | ||
export * from './plugins'; |
@@ -30,3 +30,4 @@ import { RemoteEntryType, StatsAssets } from './stats'; | ||
}>; | ||
prefetchInterface?: boolean; | ||
prefetchEntry?: string; | ||
prefetchEntryType?: RemoteEntryType; | ||
} | ||
@@ -33,0 +34,0 @@ interface BasicProviderModuleInfoWithPublicPath extends BasicProviderModuleInfo { |
@@ -17,7 +17,4 @@ import type { RemoteWithEntry, RemoteWithVersion } from './common'; | ||
remoteEntry: ResourceInfo; | ||
prefetchEntry?: ResourceInfo; | ||
prefetchInterface?: boolean; | ||
prefetchEntry: ResourceInfo; | ||
types: Omit<ResourceInfo, 'type'>; | ||
type: string; | ||
pluginVersion: string; | ||
} | ||
@@ -62,3 +59,3 @@ type StatsMetaDataWithGetPublicPath<T = BasicStatsMetaData> = T & { | ||
name: string; | ||
file: string[]; | ||
file: string; | ||
} | ||
@@ -65,0 +62,0 @@ export interface ManifestModuleInfos { |
import { RemoteEntryInfo, ModuleInfo } from './types'; | ||
import { Logger } from './logger'; | ||
declare const parseEntry: (str: string, devVerOrUrl?: string, separator?: string) => RemoteEntryInfo; | ||
declare const parseEntry: (str: string, devVerOrUrl?: string) => RemoteEntryInfo; | ||
declare global { | ||
@@ -5,0 +5,0 @@ var FEDERATION_DEBUG: string | undefined; |
{ | ||
"name": "@module-federation/sdk", | ||
"version": "0.0.0-next-20240309014600", | ||
"version": "0.0.0-next-20240310052320", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A sdk for support module federation", |
107649
25
2679