@module-federation/sdk 0.0.0-next-20240824225724 → 0.0.0-next-20240826081819

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/dist/index.cjs.js CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _extends = require('@swc/helpers/_/_extends');
6
-
7
5
  const FederationModuleManifest = 'federation-manifest.json';
8
6
  const MANIFEST_EXT = '.json';
9
7
  const BROWSER_LOG_KEY = 'FEDERATION_DEBUG';
@@ -63,6 +61,13 @@ const getProcessEnv = function() {
63
61
  return typeof process !== 'undefined' && process.env ? process.env : {};
64
62
  };
65
63
 
64
+ function safeToString(info) {
65
+ try {
66
+ return JSON.stringify(info, null, 2);
67
+ } catch (e) {
68
+ return '';
69
+ }
70
+ }
66
71
  const DEBUG_LOG = '[ FEDERATION DEBUG ]';
67
72
  function safeGetLocalStorageItem() {
68
73
  try {
@@ -242,12 +247,16 @@ const error = (msg)=>{
242
247
  const warn = (msg)=>{
243
248
  console.warn(`${LOG_CATEGORY}: ${msg}`);
244
249
  };
245
- function safeToString(info) {
246
- try {
247
- return JSON.stringify(info, null, 2);
248
- } catch (e) {
249
- return '';
250
- }
250
+
251
+ function _extends() {
252
+ _extends = Object.assign || function assign(target) {
253
+ for(var i = 1; i < arguments.length; i++){
254
+ var source = arguments[i];
255
+ for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
256
+ }
257
+ return target;
258
+ };
259
+ return _extends.apply(this, arguments);
251
260
  }
252
261
 
253
262
  const simpleJoinRemoteEntry = (rPath, rName)=>{
@@ -353,23 +362,23 @@ function generateSnapshotFromManifest(manifest, options = {}) {
353
362
  };
354
363
  if ((_manifest_metaData = manifest.metaData) == null ? void 0 : _manifest_metaData.prefetchInterface) {
355
364
  const prefetchInterface = manifest.metaData.prefetchInterface;
356
- basicRemoteSnapshot = _extends._({}, basicRemoteSnapshot, {
365
+ basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
357
366
  prefetchInterface
358
367
  });
359
368
  }
360
369
  if ((_manifest_metaData1 = manifest.metaData) == null ? void 0 : _manifest_metaData1.prefetchEntry) {
361
370
  const { path, name, type } = manifest.metaData.prefetchEntry;
362
- basicRemoteSnapshot = _extends._({}, basicRemoteSnapshot, {
371
+ basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
363
372
  prefetchEntry: simpleJoinRemoteEntry(path, name),
364
373
  prefetchEntryType: type
365
374
  });
366
375
  }
367
376
  if ('publicPath' in manifest.metaData) {
368
- remoteSnapshot = _extends._({}, basicRemoteSnapshot, {
377
+ remoteSnapshot = _extends({}, basicRemoteSnapshot, {
369
378
  publicPath: getPublicPath()
370
379
  });
371
380
  } else {
372
- remoteSnapshot = _extends._({}, basicRemoteSnapshot, {
381
+ remoteSnapshot = _extends({}, basicRemoteSnapshot, {
373
382
  getPublicPath: getPublicPath()
374
383
  });
375
384
  }
@@ -557,7 +566,7 @@ function loadScript(url, info) {
557
566
  const { script, needAttach } = createScript({
558
567
  url,
559
568
  cb: resolve,
560
- attrs: _extends._({
569
+ attrs: _extends({
561
570
  fetchpriority: 'high'
562
571
  }, attrs),
563
572
  createScriptHook,
@@ -693,7 +702,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
693
702
  return defaultOptions;
694
703
  }
695
704
  if (options && typeof options === 'object') {
696
- return _extends._({}, defaultOptions, options);
705
+ return _extends({}, defaultOptions, options);
697
706
  }
698
707
  throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`);
699
708
  };
@@ -740,7 +749,6 @@ exports.logger = logger;
740
749
  exports.moduleFederationPlugin = ModuleFederationPlugin;
741
750
  exports.normalizeOptions = normalizeOptions;
742
751
  exports.parseEntry = parseEntry;
743
- exports.safeToString = safeToString;
744
752
  exports.safeWrapper = safeWrapper;
745
753
  exports.sharePlugin = SharePlugin;
746
754
  exports.simpleJoinRemoteEntry = simpleJoinRemoteEntry;
package/dist/index.esm.js CHANGED
@@ -1,5 +1,3 @@
1
- import { _ } from '@swc/helpers/_/_extends';
2
-
3
1
  const FederationModuleManifest = 'federation-manifest.json';
4
2
  const MANIFEST_EXT = '.json';
5
3
  const BROWSER_LOG_KEY = 'FEDERATION_DEBUG';
@@ -59,6 +57,13 @@ const getProcessEnv = function() {
59
57
  return typeof process !== 'undefined' && process.env ? process.env : {};
60
58
  };
61
59
 
60
+ function safeToString(info) {
61
+ try {
62
+ return JSON.stringify(info, null, 2);
63
+ } catch (e) {
64
+ return '';
65
+ }
66
+ }
62
67
  const DEBUG_LOG = '[ FEDERATION DEBUG ]';
63
68
  function safeGetLocalStorageItem() {
64
69
  try {
@@ -238,12 +243,16 @@ const error = (msg)=>{
238
243
  const warn = (msg)=>{
239
244
  console.warn(`${LOG_CATEGORY}: ${msg}`);
240
245
  };
241
- function safeToString(info) {
242
- try {
243
- return JSON.stringify(info, null, 2);
244
- } catch (e) {
245
- return '';
246
- }
246
+
247
+ function _extends() {
248
+ _extends = Object.assign || function assign(target) {
249
+ for(var i = 1; i < arguments.length; i++){
250
+ var source = arguments[i];
251
+ for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
252
+ }
253
+ return target;
254
+ };
255
+ return _extends.apply(this, arguments);
247
256
  }
248
257
 
249
258
  const simpleJoinRemoteEntry = (rPath, rName)=>{
@@ -349,23 +358,23 @@ function generateSnapshotFromManifest(manifest, options = {}) {
349
358
  };
350
359
  if ((_manifest_metaData = manifest.metaData) == null ? void 0 : _manifest_metaData.prefetchInterface) {
351
360
  const prefetchInterface = manifest.metaData.prefetchInterface;
352
- basicRemoteSnapshot = _({}, basicRemoteSnapshot, {
361
+ basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
353
362
  prefetchInterface
354
363
  });
355
364
  }
356
365
  if ((_manifest_metaData1 = manifest.metaData) == null ? void 0 : _manifest_metaData1.prefetchEntry) {
357
366
  const { path, name, type } = manifest.metaData.prefetchEntry;
358
- basicRemoteSnapshot = _({}, basicRemoteSnapshot, {
367
+ basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
359
368
  prefetchEntry: simpleJoinRemoteEntry(path, name),
360
369
  prefetchEntryType: type
361
370
  });
362
371
  }
363
372
  if ('publicPath' in manifest.metaData) {
364
- remoteSnapshot = _({}, basicRemoteSnapshot, {
373
+ remoteSnapshot = _extends({}, basicRemoteSnapshot, {
365
374
  publicPath: getPublicPath()
366
375
  });
367
376
  } else {
368
- remoteSnapshot = _({}, basicRemoteSnapshot, {
377
+ remoteSnapshot = _extends({}, basicRemoteSnapshot, {
369
378
  getPublicPath: getPublicPath()
370
379
  });
371
380
  }
@@ -553,7 +562,7 @@ function loadScript(url, info) {
553
562
  const { script, needAttach } = createScript({
554
563
  url,
555
564
  cb: resolve,
556
- attrs: _({
565
+ attrs: _extends({
557
566
  fetchpriority: 'high'
558
567
  }, attrs),
559
568
  createScriptHook,
@@ -689,10 +698,10 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
689
698
  return defaultOptions;
690
699
  }
691
700
  if (options && typeof options === 'object') {
692
- return _({}, defaultOptions, options);
701
+ return _extends({}, defaultOptions, options);
693
702
  }
694
703
  throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`);
695
704
  };
696
705
  }
697
706
 
698
- 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 };
707
+ 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 };
@@ -174,7 +174,6 @@ export interface ModuleFederationPluginOptions {
174
174
  dev?: boolean | PluginDevOptions;
175
175
  dts?: boolean | PluginDtsOptions;
176
176
  async?: boolean | AsyncBoundaryOptions;
177
- embedRuntime?: boolean;
178
177
  }
179
178
  /**
180
179
  * Modules that should be exposed by this container. Property names are used as public paths.
@@ -14,5 +14,4 @@ declare const getResourceUrl: (module: ModuleInfo, sourceUrl: string) => string;
14
14
  declare const assert: (condition: any, msg: string) => asserts condition;
15
15
  declare const error: (msg: string | Error | unknown) => never;
16
16
  declare const warn: (msg: Parameters<typeof console.warn>[0]) => void;
17
- declare function safeToString(info: any): string;
18
- export { parseEntry, logger, decodeName, encodeName, composeKeyWithSeparator, generateExposeFilename, generateShareFilename, getResourceUrl, assert, error, warn, safeToString, };
17
+ export { parseEntry, logger, decodeName, encodeName, composeKeyWithSeparator, generateExposeFilename, generateShareFilename, getResourceUrl, assert, error, warn, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240824225724",
3
+ "version": "0.0.0-next-20240826081819",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [