@module-federation/manifest 0.0.0-next-20241015060033 → 0.0.0-next-20241016062654

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
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var path = require('path');
6
4
  var fs = require('fs');
7
5
  var chalk = require('chalk');
@@ -9,12 +7,6 @@ var sdk = require('@module-federation/sdk');
9
7
  var core = require('@module-federation/dts-plugin/core');
10
8
  var managers = require('@module-federation/managers');
11
9
 
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
15
- var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
16
- var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
17
-
18
10
  var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
19
11
  var HOT_UPDATE_SUFFIX = '.hot-update';
20
12
 
@@ -94,11 +86,6 @@ function ownKeys$2(object, enumerableOnly) {
94
86
  var keys = Object.keys(object);
95
87
  if (Object.getOwnPropertySymbols) {
96
88
  var symbols = Object.getOwnPropertySymbols(object);
97
- if (enumerableOnly) {
98
- symbols = symbols.filter(function(sym) {
99
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
100
- });
101
- }
102
89
  keys.push.apply(keys, symbols);
103
90
  }
104
91
  return keys;
@@ -368,7 +355,7 @@ function isDev() {
368
355
  return process.env['NODE_ENV'] === 'development';
369
356
  }
370
357
  function getFileNameWithOutExt(str) {
371
- return str.replace(path__default["default"].extname(str), '');
358
+ return str.replace(path.extname(str), '');
372
359
  }
373
360
  function getFileName(manifestOptions) {
374
361
  if (!manifestOptions) {
@@ -426,11 +413,11 @@ function getTypesMetaInfo(pluginOptions, context) {
426
413
  return {
427
414
  path: '',
428
415
  name: '',
429
- zip: path__default["default"].join(zipPrefix, zipName),
430
- api: path__default["default"].join(zipPrefix, apiFileName)
416
+ zip: path.join(zipPrefix, zipName),
417
+ api: path.join(zipPrefix, apiFileName)
431
418
  };
432
419
  } catch (err) {
433
- console.warn(chalk__default["default"](_templateObject$2(), PLUGIN_IDENTIFIER, err));
420
+ console.warn(chalk(_templateObject$2(), PLUGIN_IDENTIFIER, err));
434
421
  return defaultTypesMetaInfo;
435
422
  }
436
423
  }
@@ -480,7 +467,6 @@ function _defineProperties$3(target, props) {
480
467
  }
481
468
  function _create_class$3(Constructor, protoProps, staticProps) {
482
469
  if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
483
- if (staticProps) _defineProperties$3(Constructor, staticProps);
484
470
  return Constructor;
485
471
  }
486
472
  function _define_property$3(obj, key, value) {
@@ -707,10 +693,10 @@ var ManifestManager = /*#__PURE__*/ function() {
707
693
  return sum;
708
694
  }, []);
709
695
  prefetchInterface = false;
710
- prefetchFilePath = path__default["default"].resolve(compiler.options.context || process.cwd(), "node_modules/.mf/".concat(sdk.encodeName(stats.name), "/").concat(sdk.MFPrefetchCommon.fileName));
711
- existPrefetch = fs__default["default"].existsSync(prefetchFilePath);
696
+ prefetchFilePath = path.resolve(compiler.options.context || process.cwd(), "node_modules/.mf/".concat(sdk.encodeName(stats.name), "/").concat(sdk.MFPrefetchCommon.fileName));
697
+ existPrefetch = fs.existsSync(prefetchFilePath);
712
698
  if (existPrefetch) {
713
- content = fs__default["default"].readFileSync(prefetchFilePath).toString();
699
+ content = fs.readFileSync(prefetchFilePath).toString();
714
700
  if (content) {
715
701
  prefetchInterface = true;
716
702
  }
@@ -742,7 +728,7 @@ var ManifestManager = /*#__PURE__*/ function() {
742
728
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
743
729
  }
744
730
  if (isDev()) {
745
- console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
731
+ console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
746
732
  }
747
733
  return [
748
734
  2,
@@ -784,7 +770,6 @@ function _defineProperties$2(target, props) {
784
770
  }
785
771
  function _create_class$2(Constructor, protoProps, staticProps) {
786
772
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
787
- if (staticProps) _defineProperties$2(Constructor, staticProps);
788
773
  return Constructor;
789
774
  }
790
775
  function _define_property$2(obj, key, value) {
@@ -846,11 +831,6 @@ function ownKeys$1(object, enumerableOnly) {
846
831
  var keys = Object.keys(object);
847
832
  if (Object.getOwnPropertySymbols) {
848
833
  var symbols = Object.getOwnPropertySymbols(object);
849
- if (enumerableOnly) {
850
- symbols = symbols.filter(function(sym) {
851
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
852
- });
853
- }
854
834
  keys.push.apply(keys, symbols);
855
835
  }
856
836
  return keys;
@@ -1103,7 +1083,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
1103
1083
  name: exposeModuleName,
1104
1084
  // @ts-ignore to deduplicate
1105
1085
  requires: new Set(),
1106
- file: path__default["default"].relative(process.cwd(), file.import[0]),
1086
+ file: path.relative(process.cwd(), file.import[0]),
1107
1087
  assets: {
1108
1088
  js: {
1109
1089
  async: [],
@@ -1222,7 +1202,6 @@ function _defineProperties$1(target, props) {
1222
1202
  }
1223
1203
  function _create_class$1(Constructor, protoProps, staticProps) {
1224
1204
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
1225
- if (staticProps) _defineProperties$1(Constructor, staticProps);
1226
1205
  return Constructor;
1227
1206
  }
1228
1207
  function _define_property$1(obj, key, value) {
@@ -1290,11 +1269,6 @@ function ownKeys(object, enumerableOnly) {
1290
1269
  var keys = Object.keys(object);
1291
1270
  if (Object.getOwnPropertySymbols) {
1292
1271
  var symbols = Object.getOwnPropertySymbols(object);
1293
- if (enumerableOnly) {
1294
- symbols = symbols.filter(function(sym) {
1295
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1296
- });
1297
- }
1298
1272
  keys.push.apply(keys, symbols);
1299
1273
  }
1300
1274
  return keys;
@@ -1730,11 +1704,19 @@ var StatsManager = /*#__PURE__*/ function() {
1730
1704
  4,
1731
1705
  Promise.all([
1732
1706
  new Promise(function(resolve) {
1707
+ var remoteMemo = new Set();
1733
1708
  stats.remotes = remotes1.map(function(remote) {
1709
+ remoteMemo.add(remote.federationContainerName);
1734
1710
  return _object_spread_props(_object_spread({}, remote), {
1735
1711
  usedIn: Array.from(remote.usedIn.values())
1736
1712
  });
1737
1713
  });
1714
+ var statsRemoteWithEmptyUsedIn = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1715
+ statsRemoteWithEmptyUsedIn.forEach(function(remoteInfo) {
1716
+ if (!remoteMemo.has(remoteInfo.federationContainerName)) {
1717
+ stats.remotes.push(remoteInfo);
1718
+ }
1719
+ });
1738
1720
  resolve();
1739
1721
  }),
1740
1722
  new Promise(function(resolve) {
@@ -1878,10 +1860,10 @@ var StatsManager = /*#__PURE__*/ function() {
1878
1860
  value: function validate(compiler) {
1879
1861
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1880
1862
  if (typeof publicPath !== 'string') {
1881
- console.warn(chalk__default["default"](_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1863
+ console.warn(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1882
1864
  return false;
1883
1865
  } else if (publicPath === 'auto') {
1884
- console.warn(chalk__default["default"](_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1866
+ console.warn(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1885
1867
  return true;
1886
1868
  }
1887
1869
  return true;
@@ -1936,7 +1918,6 @@ function _defineProperties(target, props) {
1936
1918
  }
1937
1919
  function _create_class(Constructor, protoProps, staticProps) {
1938
1920
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1939
- if (staticProps) _defineProperties(Constructor, staticProps);
1940
1921
  return Constructor;
1941
1922
  }
1942
1923
  function _define_property(obj, key, value) {
@@ -0,0 +1 @@
1
+ export * from "./src/index";
package/dist/index.esm.js CHANGED
@@ -84,11 +84,6 @@ function ownKeys$2(object, enumerableOnly) {
84
84
  var keys = Object.keys(object);
85
85
  if (Object.getOwnPropertySymbols) {
86
86
  var symbols = Object.getOwnPropertySymbols(object);
87
- if (enumerableOnly) {
88
- symbols = symbols.filter(function(sym) {
89
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
90
- });
91
- }
92
87
  keys.push.apply(keys, symbols);
93
88
  }
94
89
  return keys;
@@ -470,7 +465,6 @@ function _defineProperties$3(target, props) {
470
465
  }
471
466
  function _create_class$3(Constructor, protoProps, staticProps) {
472
467
  if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
473
- if (staticProps) _defineProperties$3(Constructor, staticProps);
474
468
  return Constructor;
475
469
  }
476
470
  function _define_property$3(obj, key, value) {
@@ -774,7 +768,6 @@ function _defineProperties$2(target, props) {
774
768
  }
775
769
  function _create_class$2(Constructor, protoProps, staticProps) {
776
770
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
777
- if (staticProps) _defineProperties$2(Constructor, staticProps);
778
771
  return Constructor;
779
772
  }
780
773
  function _define_property$2(obj, key, value) {
@@ -836,11 +829,6 @@ function ownKeys$1(object, enumerableOnly) {
836
829
  var keys = Object.keys(object);
837
830
  if (Object.getOwnPropertySymbols) {
838
831
  var symbols = Object.getOwnPropertySymbols(object);
839
- if (enumerableOnly) {
840
- symbols = symbols.filter(function(sym) {
841
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
842
- });
843
- }
844
832
  keys.push.apply(keys, symbols);
845
833
  }
846
834
  return keys;
@@ -1212,7 +1200,6 @@ function _defineProperties$1(target, props) {
1212
1200
  }
1213
1201
  function _create_class$1(Constructor, protoProps, staticProps) {
1214
1202
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
1215
- if (staticProps) _defineProperties$1(Constructor, staticProps);
1216
1203
  return Constructor;
1217
1204
  }
1218
1205
  function _define_property$1(obj, key, value) {
@@ -1280,11 +1267,6 @@ function ownKeys(object, enumerableOnly) {
1280
1267
  var keys = Object.keys(object);
1281
1268
  if (Object.getOwnPropertySymbols) {
1282
1269
  var symbols = Object.getOwnPropertySymbols(object);
1283
- if (enumerableOnly) {
1284
- symbols = symbols.filter(function(sym) {
1285
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1286
- });
1287
- }
1288
1270
  keys.push.apply(keys, symbols);
1289
1271
  }
1290
1272
  return keys;
@@ -1720,11 +1702,19 @@ var StatsManager = /*#__PURE__*/ function() {
1720
1702
  4,
1721
1703
  Promise.all([
1722
1704
  new Promise(function(resolve) {
1705
+ var remoteMemo = new Set();
1723
1706
  stats.remotes = remotes1.map(function(remote) {
1707
+ remoteMemo.add(remote.federationContainerName);
1724
1708
  return _object_spread_props(_object_spread({}, remote), {
1725
1709
  usedIn: Array.from(remote.usedIn.values())
1726
1710
  });
1727
1711
  });
1712
+ var statsRemoteWithEmptyUsedIn = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1713
+ statsRemoteWithEmptyUsedIn.forEach(function(remoteInfo) {
1714
+ if (!remoteMemo.has(remoteInfo.federationContainerName)) {
1715
+ stats.remotes.push(remoteInfo);
1716
+ }
1717
+ });
1728
1718
  resolve();
1729
1719
  }),
1730
1720
  new Promise(function(resolve) {
@@ -1926,7 +1916,6 @@ function _defineProperties(target, props) {
1926
1916
  }
1927
1917
  function _create_class(Constructor, protoProps, staticProps) {
1928
1918
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1929
- if (staticProps) _defineProperties(Constructor, staticProps);
1930
1919
  return Constructor;
1931
1920
  }
1932
1921
  function _define_property(obj, key, value) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.6.6",
3
+ "version": "0.6.10",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -42,4 +42,4 @@
42
42
  ]
43
43
  }
44
44
  }
45
- }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.0.0-next-20241015060033",
3
+ "version": "0.0.0-next-20241016062654",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -24,9 +24,9 @@
24
24
  "dependencies": {
25
25
  "find-pkg": "2.0.0",
26
26
  "chalk": "3.0.0",
27
- "@module-federation/sdk": "0.0.0-next-20241015060033",
28
- "@module-federation/dts-plugin": "0.0.0-next-20241015060033",
29
- "@module-federation/managers": "0.0.0-next-20241015060033"
27
+ "@module-federation/sdk": "0.0.0-next-20241016062654",
28
+ "@module-federation/dts-plugin": "0.0.0-next-20241016062654",
29
+ "@module-federation/managers": "0.0.0-next-20241016062654"
30
30
  },
31
31
  "exports": {
32
32
  ".": {