@module-federation/manifest 0.0.0-next-20240605083609 → 0.0.0-next-20240605100049

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
@@ -658,52 +658,53 @@ var ManifestManager = /*#__PURE__*/ function() {
658
658
  {
659
659
  key: "generateManifest",
660
660
  value: function generateManifest(options) {
661
- var extraOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
662
661
  var _this = this;
663
662
  return _async_to_generator$2(function() {
664
- var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, manifestFileName, ret;
663
+ var compilation, publicPath, stats, compiler, bundler, additionalData, manifest, manifestFileName, ret;
665
664
  return _ts_generator$2(this, function(_state) {
666
665
  switch(_state.label){
667
666
  case 0:
668
667
  compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler, bundler = options.bundler, additionalData = options.additionalData;
669
- disableEmit = extraOptions.disableEmit;
670
668
  manifest = _object_spread$2({}, stats);
671
- manifest.exposes = stats.exposes.reduce(function(sum, cur) {
669
+ manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
670
+ var statsExpose = manifest.exposes[cur];
672
671
  var expose = {
673
- id: cur.id,
674
- name: cur.name,
675
- assets: cur.assets,
676
- path: cur.path
672
+ id: statsExpose.id,
673
+ name: statsExpose.name,
674
+ assets: statsExpose.assets,
675
+ path: statsExpose.path
677
676
  };
678
677
  sum.push(expose);
679
678
  return sum;
680
679
  }, []);
681
- manifest.shared = stats.shared.reduce(function(sum, cur) {
680
+ manifest.shared = Object.keys(stats.shared).reduce(function(sum, cur) {
681
+ var statsShared = manifest.shared[cur];
682
682
  var shared = {
683
- id: cur.id,
684
- name: cur.name,
685
- version: cur.version,
686
- singleton: cur.singleton,
687
- requiredVersion: cur.requiredVersion,
688
- hash: cur.hash,
689
- assets: cur.assets
683
+ id: statsShared.id,
684
+ name: statsShared.name,
685
+ version: statsShared.version,
686
+ singleton: statsShared.singleton,
687
+ requiredVersion: statsShared.requiredVersion,
688
+ hash: statsShared.hash,
689
+ assets: statsShared.assets
690
690
  };
691
691
  sum.push(shared);
692
692
  return sum;
693
693
  }, []);
694
- manifest.remotes = stats.remotes.reduce(function(sum, cur) {
694
+ manifest.remotes = Object.keys(stats.remotes).reduce(function(sum, cur) {
695
+ var statsRemote = manifest.remotes[cur];
695
696
  // @ts-ignore version/entry will be added as follow
696
697
  var remote = {
697
- federationContainerName: cur.federationContainerName,
698
- moduleName: cur.moduleName,
699
- alias: cur.alias
698
+ federationContainerName: statsRemote.federationContainerName,
699
+ moduleName: statsRemote.moduleName,
700
+ alias: statsRemote.alias
700
701
  };
701
- if ('entry' in cur) {
702
+ if ('entry' in statsRemote) {
702
703
  // @ts-ignore
703
- remote.entry = cur.entry;
704
- } else if ('version' in cur) {
704
+ remote.entry = statsRemote.entry;
705
+ } else if ('version' in statsRemote) {
705
706
  // @ts-ignore
706
- remote.entry = cur.version;
707
+ remote.entry = statsRemote.version;
707
708
  }
708
709
  sum.push(remote);
709
710
  return sum;
@@ -730,18 +731,12 @@ var ManifestManager = /*#__PURE__*/ function() {
730
731
  _this._manifest = ret || _this._manifest;
731
732
  _state.label = 2;
732
733
  case 2:
733
- if (!disableEmit) {
734
- compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
735
- }
734
+ compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
736
735
  if (isDev()) {
737
736
  console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
738
737
  }
739
738
  return [
740
- 2,
741
- {
742
- manifest: _this._manifest,
743
- filename: manifestFileName
744
- }
739
+ 2
745
740
  ];
746
741
  }
747
742
  });
@@ -903,11 +898,13 @@ var ModuleHandler = /*#__PURE__*/ function() {
903
898
  }
904
899
  var sharedManagerNormalizedOptions = this._sharedManager.normalizedOptions;
905
900
  var initShared = function(pkgName, pkgVersion) {
901
+ var _sharedManagerNormalizedOptions_pkgName;
906
902
  if (sharedMap[pkgName]) {
907
903
  return;
908
904
  }
909
905
  sharedMap[pkgName] = _object_spread_props$1(_object_spread$1({}, sharedManagerNormalizedOptions[pkgName]), {
910
906
  id: "".concat(_this._options.name, ":").concat(pkgName),
907
+ requiredVersion: ((_sharedManagerNormalizedOptions_pkgName = sharedManagerNormalizedOptions[pkgName]) === null || _sharedManagerNormalizedOptions_pkgName === void 0 ? void 0 : _sharedManagerNormalizedOptions_pkgName.requiredVersion) || "^".concat(pkgVersion),
911
908
  name: pkgName,
912
909
  version: pkgVersion,
913
910
  assets: {
@@ -1462,6 +1459,7 @@ var StatsManager = /*#__PURE__*/ function() {
1462
1459
  key: "_getMetaData",
1463
1460
  value: function _getMetaData(compiler, compilation, extraOptions) {
1464
1461
  var _this = this;
1462
+ var _this__options_library, _this__options;
1465
1463
  var context = compiler.options.context;
1466
1464
  var _this1 = this, name = _this1._options.name, buildInfo = _this1.buildInfo;
1467
1465
  var type = this._pkgJsonManager.getExposeGarfishModuleType(context || process.cwd());
@@ -1491,8 +1489,8 @@ var StatsManager = /*#__PURE__*/ function() {
1491
1489
  remoteEntry: {
1492
1490
  name: getRemoteEntryName(),
1493
1491
  path: '',
1494
- // same as the types supported by runtime, currently only global/var/script/cjs:webpack is supported
1495
- type: 'global'
1492
+ // same as the types supported by runtime, currently only global/var/script is supported
1493
+ type: ((_this__options = this._options) === null || _this__options === void 0 ? void 0 : (_this__options_library = _this__options.library) === null || _this__options_library === void 0 ? void 0 : _this__options_library.type) || 'global'
1496
1494
  },
1497
1495
  types: getTypesMetaInfo(this._options, compiler.context),
1498
1496
  globalName: globalName,
@@ -1759,11 +1757,10 @@ var StatsManager = /*#__PURE__*/ function() {
1759
1757
  },
1760
1758
  {
1761
1759
  key: "generateStats",
1762
- value: function generateStats(compiler, compilation) {
1763
- var extraOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1760
+ value: function generateStats(compiler, compilation, extraOptions) {
1764
1761
  var _this = this;
1765
1762
  return _async_to_generator$1(function() {
1766
- var disableEmit, existedStats, _this__options, tmp, manifestOptions, stats, ret, err;
1763
+ var existedStats, _this__options, tmp, manifestOptions, stats, ret, err;
1767
1764
  return _ts_generator$1(this, function(_state) {
1768
1765
  switch(_state.label){
1769
1766
  case 0:
@@ -1773,15 +1770,11 @@ var StatsManager = /*#__PURE__*/ function() {
1773
1770
  ,
1774
1771
  5
1775
1772
  ]);
1776
- disableEmit = extraOptions.disableEmit;
1777
1773
  existedStats = compilation.getAsset(_this.fileName);
1778
- if (existedStats && !isDev()) {
1774
+ if (existedStats) {
1779
1775
  return [
1780
1776
  2,
1781
- {
1782
- stats: JSON.parse(existedStats.source.source().toString()),
1783
- filename: _this.fileName
1784
- }
1777
+ JSON.parse(existedStats.source.source().toString())
1785
1778
  ];
1786
1779
  }
1787
1780
  _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
@@ -1810,15 +1803,10 @@ var StatsManager = /*#__PURE__*/ function() {
1810
1803
  stats = ret || stats;
1811
1804
  _state.label = 3;
1812
1805
  case 3:
1813
- if (!disableEmit) {
1814
- compilation.emitAsset(_this.fileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1815
- }
1806
+ compilation.emitAsset(_this.fileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1816
1807
  return [
1817
1808
  2,
1818
- {
1819
- stats: stats,
1820
- filename: _this.fileName
1821
- }
1809
+ stats
1822
1810
  ];
1823
1811
  case 4:
1824
1812
  err = _state.sent();
@@ -2023,13 +2011,9 @@ var StatsPlugin = /*#__PURE__*/ function() {
2023
2011
  _define_property(this, "_manifestManager", new ManifestManager());
2024
2012
  _define_property(this, "_enable", true);
2025
2013
  _define_property(this, "_bundler", 'webpack');
2026
- _define_property(this, "statsInfo", void 0);
2027
- _define_property(this, "manifestInfo", void 0);
2028
- _define_property(this, "disableEmit", void 0);
2029
2014
  try {
2030
2015
  this._options = options;
2031
2016
  this._bundler = bundler;
2032
- this.disableEmit = Boolean(process.env['MF_DISABLE_EMIT_STATS']);
2033
2017
  this._statsManager.init(this._options, {
2034
2018
  pluginVersion: pluginVersion,
2035
2019
  bundler: bundler
@@ -2062,38 +2046,30 @@ var StatsPlugin = /*#__PURE__*/ function() {
2062
2046
  // @ts-ignore use runtime variable in case peer dep not installed
2063
2047
  stage: compilation.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER
2064
2048
  }, /*#__PURE__*/ _async_to_generator(function() {
2049
+ var stats;
2065
2050
  return _ts_generator(this, function(_state) {
2066
2051
  switch(_state.label){
2067
2052
  case 0:
2068
2053
  if (!(_this1._options.manifest !== false)) return [
2069
2054
  3,
2070
- 3
2055
+ 2
2071
2056
  ];
2072
2057
  return [
2073
2058
  4,
2074
- _this1._statsManager.generateStats(compiler, compilation, {
2075
- disableEmit: _this1.disableEmit
2076
- })
2059
+ _this1._statsManager.generateStats(compiler, compilation)
2077
2060
  ];
2078
2061
  case 1:
2079
- _this1.statsInfo = _state.sent();
2080
- return [
2081
- 4,
2082
- _this1._manifestManager.generateManifest({
2083
- compilation: compilation,
2084
- stats: _this1.statsInfo.stats,
2085
- publicPath: _this1._statsManager.getPublicPath(compiler),
2086
- compiler: compiler,
2087
- bundler: _this1._bundler,
2088
- additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2089
- }, {
2090
- disableEmit: _this1.disableEmit
2091
- })
2092
- ];
2062
+ stats = _state.sent();
2063
+ _this1._manifestManager.generateManifest({
2064
+ compilation: compilation,
2065
+ stats: stats,
2066
+ publicPath: _this1._statsManager.getPublicPath(compiler),
2067
+ compiler: compiler,
2068
+ bundler: _this1._bundler,
2069
+ additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2070
+ });
2071
+ _state.label = 2;
2093
2072
  case 2:
2094
- _this1.manifestInfo = _state.sent();
2095
- _state.label = 3;
2096
- case 3:
2097
2073
  return [
2098
2074
  2
2099
2075
  ];
@@ -2102,15 +2078,6 @@ var StatsPlugin = /*#__PURE__*/ function() {
2102
2078
  }));
2103
2079
  });
2104
2080
  }
2105
- },
2106
- {
2107
- key: "resourceInfo",
2108
- get: function get() {
2109
- return {
2110
- stats: this.statsInfo,
2111
- manifest: this.manifestInfo
2112
- };
2113
- }
2114
2081
  }
2115
2082
  ]);
2116
2083
  return StatsPlugin;
package/dist/index.esm.js CHANGED
@@ -649,52 +649,53 @@ var ManifestManager = /*#__PURE__*/ function() {
649
649
  {
650
650
  key: "generateManifest",
651
651
  value: function generateManifest(options) {
652
- var extraOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
653
652
  var _this = this;
654
653
  return _async_to_generator$2(function() {
655
- var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, manifestFileName, ret;
654
+ var compilation, publicPath, stats, compiler, bundler, additionalData, manifest, manifestFileName, ret;
656
655
  return _ts_generator$2(this, function(_state) {
657
656
  switch(_state.label){
658
657
  case 0:
659
658
  compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler, bundler = options.bundler, additionalData = options.additionalData;
660
- disableEmit = extraOptions.disableEmit;
661
659
  manifest = _object_spread$2({}, stats);
662
- manifest.exposes = stats.exposes.reduce(function(sum, cur) {
660
+ manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
661
+ var statsExpose = manifest.exposes[cur];
663
662
  var expose = {
664
- id: cur.id,
665
- name: cur.name,
666
- assets: cur.assets,
667
- path: cur.path
663
+ id: statsExpose.id,
664
+ name: statsExpose.name,
665
+ assets: statsExpose.assets,
666
+ path: statsExpose.path
668
667
  };
669
668
  sum.push(expose);
670
669
  return sum;
671
670
  }, []);
672
- manifest.shared = stats.shared.reduce(function(sum, cur) {
671
+ manifest.shared = Object.keys(stats.shared).reduce(function(sum, cur) {
672
+ var statsShared = manifest.shared[cur];
673
673
  var shared = {
674
- id: cur.id,
675
- name: cur.name,
676
- version: cur.version,
677
- singleton: cur.singleton,
678
- requiredVersion: cur.requiredVersion,
679
- hash: cur.hash,
680
- assets: cur.assets
674
+ id: statsShared.id,
675
+ name: statsShared.name,
676
+ version: statsShared.version,
677
+ singleton: statsShared.singleton,
678
+ requiredVersion: statsShared.requiredVersion,
679
+ hash: statsShared.hash,
680
+ assets: statsShared.assets
681
681
  };
682
682
  sum.push(shared);
683
683
  return sum;
684
684
  }, []);
685
- manifest.remotes = stats.remotes.reduce(function(sum, cur) {
685
+ manifest.remotes = Object.keys(stats.remotes).reduce(function(sum, cur) {
686
+ var statsRemote = manifest.remotes[cur];
686
687
  // @ts-ignore version/entry will be added as follow
687
688
  var remote = {
688
- federationContainerName: cur.federationContainerName,
689
- moduleName: cur.moduleName,
690
- alias: cur.alias
689
+ federationContainerName: statsRemote.federationContainerName,
690
+ moduleName: statsRemote.moduleName,
691
+ alias: statsRemote.alias
691
692
  };
692
- if ('entry' in cur) {
693
+ if ('entry' in statsRemote) {
693
694
  // @ts-ignore
694
- remote.entry = cur.entry;
695
- } else if ('version' in cur) {
695
+ remote.entry = statsRemote.entry;
696
+ } else if ('version' in statsRemote) {
696
697
  // @ts-ignore
697
- remote.entry = cur.version;
698
+ remote.entry = statsRemote.version;
698
699
  }
699
700
  sum.push(remote);
700
701
  return sum;
@@ -721,18 +722,12 @@ var ManifestManager = /*#__PURE__*/ function() {
721
722
  _this._manifest = ret || _this._manifest;
722
723
  _state.label = 2;
723
724
  case 2:
724
- if (!disableEmit) {
725
- compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
726
- }
725
+ compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
727
726
  if (isDev()) {
728
727
  console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
729
728
  }
730
729
  return [
731
- 2,
732
- {
733
- manifest: _this._manifest,
734
- filename: manifestFileName
735
- }
730
+ 2
736
731
  ];
737
732
  }
738
733
  });
@@ -894,11 +889,13 @@ var ModuleHandler = /*#__PURE__*/ function() {
894
889
  }
895
890
  var sharedManagerNormalizedOptions = this._sharedManager.normalizedOptions;
896
891
  var initShared = function(pkgName, pkgVersion) {
892
+ var _sharedManagerNormalizedOptions_pkgName;
897
893
  if (sharedMap[pkgName]) {
898
894
  return;
899
895
  }
900
896
  sharedMap[pkgName] = _object_spread_props$1(_object_spread$1({}, sharedManagerNormalizedOptions[pkgName]), {
901
897
  id: "".concat(_this._options.name, ":").concat(pkgName),
898
+ requiredVersion: ((_sharedManagerNormalizedOptions_pkgName = sharedManagerNormalizedOptions[pkgName]) === null || _sharedManagerNormalizedOptions_pkgName === void 0 ? void 0 : _sharedManagerNormalizedOptions_pkgName.requiredVersion) || "^".concat(pkgVersion),
902
899
  name: pkgName,
903
900
  version: pkgVersion,
904
901
  assets: {
@@ -1453,6 +1450,7 @@ var StatsManager = /*#__PURE__*/ function() {
1453
1450
  key: "_getMetaData",
1454
1451
  value: function _getMetaData(compiler, compilation, extraOptions) {
1455
1452
  var _this = this;
1453
+ var _this__options_library, _this__options;
1456
1454
  var context = compiler.options.context;
1457
1455
  var _this1 = this, name = _this1._options.name, buildInfo = _this1.buildInfo;
1458
1456
  var type = this._pkgJsonManager.getExposeGarfishModuleType(context || process.cwd());
@@ -1482,8 +1480,8 @@ var StatsManager = /*#__PURE__*/ function() {
1482
1480
  remoteEntry: {
1483
1481
  name: getRemoteEntryName(),
1484
1482
  path: '',
1485
- // same as the types supported by runtime, currently only global/var/script/cjs:webpack is supported
1486
- type: 'global'
1483
+ // same as the types supported by runtime, currently only global/var/script is supported
1484
+ type: ((_this__options = this._options) === null || _this__options === void 0 ? void 0 : (_this__options_library = _this__options.library) === null || _this__options_library === void 0 ? void 0 : _this__options_library.type) || 'global'
1487
1485
  },
1488
1486
  types: getTypesMetaInfo(this._options, compiler.context),
1489
1487
  globalName: globalName,
@@ -1750,11 +1748,10 @@ var StatsManager = /*#__PURE__*/ function() {
1750
1748
  },
1751
1749
  {
1752
1750
  key: "generateStats",
1753
- value: function generateStats(compiler, compilation) {
1754
- var extraOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1751
+ value: function generateStats(compiler, compilation, extraOptions) {
1755
1752
  var _this = this;
1756
1753
  return _async_to_generator$1(function() {
1757
- var disableEmit, existedStats, _this__options, tmp, manifestOptions, stats, ret, err;
1754
+ var existedStats, _this__options, tmp, manifestOptions, stats, ret, err;
1758
1755
  return _ts_generator$1(this, function(_state) {
1759
1756
  switch(_state.label){
1760
1757
  case 0:
@@ -1764,15 +1761,11 @@ var StatsManager = /*#__PURE__*/ function() {
1764
1761
  ,
1765
1762
  5
1766
1763
  ]);
1767
- disableEmit = extraOptions.disableEmit;
1768
1764
  existedStats = compilation.getAsset(_this.fileName);
1769
- if (existedStats && !isDev()) {
1765
+ if (existedStats) {
1770
1766
  return [
1771
1767
  2,
1772
- {
1773
- stats: JSON.parse(existedStats.source.source().toString()),
1774
- filename: _this.fileName
1775
- }
1768
+ JSON.parse(existedStats.source.source().toString())
1776
1769
  ];
1777
1770
  }
1778
1771
  _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
@@ -1801,15 +1794,10 @@ var StatsManager = /*#__PURE__*/ function() {
1801
1794
  stats = ret || stats;
1802
1795
  _state.label = 3;
1803
1796
  case 3:
1804
- if (!disableEmit) {
1805
- compilation.emitAsset(_this.fileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1806
- }
1797
+ compilation.emitAsset(_this.fileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1807
1798
  return [
1808
1799
  2,
1809
- {
1810
- stats: stats,
1811
- filename: _this.fileName
1812
- }
1800
+ stats
1813
1801
  ];
1814
1802
  case 4:
1815
1803
  err = _state.sent();
@@ -2014,13 +2002,9 @@ var StatsPlugin = /*#__PURE__*/ function() {
2014
2002
  _define_property(this, "_manifestManager", new ManifestManager());
2015
2003
  _define_property(this, "_enable", true);
2016
2004
  _define_property(this, "_bundler", 'webpack');
2017
- _define_property(this, "statsInfo", void 0);
2018
- _define_property(this, "manifestInfo", void 0);
2019
- _define_property(this, "disableEmit", void 0);
2020
2005
  try {
2021
2006
  this._options = options;
2022
2007
  this._bundler = bundler;
2023
- this.disableEmit = Boolean(process.env['MF_DISABLE_EMIT_STATS']);
2024
2008
  this._statsManager.init(this._options, {
2025
2009
  pluginVersion: pluginVersion,
2026
2010
  bundler: bundler
@@ -2053,38 +2037,30 @@ var StatsPlugin = /*#__PURE__*/ function() {
2053
2037
  // @ts-ignore use runtime variable in case peer dep not installed
2054
2038
  stage: compilation.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER
2055
2039
  }, /*#__PURE__*/ _async_to_generator(function() {
2040
+ var stats;
2056
2041
  return _ts_generator(this, function(_state) {
2057
2042
  switch(_state.label){
2058
2043
  case 0:
2059
2044
  if (!(_this1._options.manifest !== false)) return [
2060
2045
  3,
2061
- 3
2046
+ 2
2062
2047
  ];
2063
2048
  return [
2064
2049
  4,
2065
- _this1._statsManager.generateStats(compiler, compilation, {
2066
- disableEmit: _this1.disableEmit
2067
- })
2050
+ _this1._statsManager.generateStats(compiler, compilation)
2068
2051
  ];
2069
2052
  case 1:
2070
- _this1.statsInfo = _state.sent();
2071
- return [
2072
- 4,
2073
- _this1._manifestManager.generateManifest({
2074
- compilation: compilation,
2075
- stats: _this1.statsInfo.stats,
2076
- publicPath: _this1._statsManager.getPublicPath(compiler),
2077
- compiler: compiler,
2078
- bundler: _this1._bundler,
2079
- additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2080
- }, {
2081
- disableEmit: _this1.disableEmit
2082
- })
2083
- ];
2053
+ stats = _state.sent();
2054
+ _this1._manifestManager.generateManifest({
2055
+ compilation: compilation,
2056
+ stats: stats,
2057
+ publicPath: _this1._statsManager.getPublicPath(compiler),
2058
+ compiler: compiler,
2059
+ bundler: _this1._bundler,
2060
+ additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2061
+ });
2062
+ _state.label = 2;
2084
2063
  case 2:
2085
- _this1.manifestInfo = _state.sent();
2086
- _state.label = 3;
2087
- case 3:
2088
2064
  return [
2089
2065
  2
2090
2066
  ];
@@ -2093,15 +2069,6 @@ var StatsPlugin = /*#__PURE__*/ function() {
2093
2069
  }));
2094
2070
  });
2095
2071
  }
2096
- },
2097
- {
2098
- key: "resourceInfo",
2099
- get: function get() {
2100
- return {
2101
- stats: this.statsInfo,
2102
- manifest: this.manifestInfo
2103
- };
2104
- }
2105
2072
  }
2106
2073
  ]);
2107
2074
  return StatsPlugin;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.1.15",
3
+ "version": "0.1.18",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -1,6 +1,5 @@
1
1
  import { Stats, Manifest, moduleFederationPlugin } from '@module-federation/sdk';
2
2
  import type { Compilation, Compiler } from 'webpack';
3
- import { ManifestInfo } from './types';
4
3
  interface GenerateManifestOptions {
5
4
  compilation: Compilation;
6
5
  stats: Stats;
@@ -15,8 +14,6 @@ declare class ManifestManager {
15
14
  get manifest(): Manifest | undefined;
16
15
  init(options: moduleFederationPlugin.ModuleFederationPluginOptions): void;
17
16
  get fileName(): string;
18
- generateManifest(options: GenerateManifestOptions, extraOptions?: {
19
- disableEmit?: boolean;
20
- }): Promise<ManifestInfo>;
17
+ generateManifest(options: GenerateManifestOptions): Promise<void>;
21
18
  }
22
19
  export { ManifestManager };
@@ -1,6 +1,5 @@
1
- import { StatsBuildInfo, moduleFederationPlugin } from '@module-federation/sdk';
1
+ import { StatsBuildInfo, Stats, moduleFederationPlugin } from '@module-federation/sdk';
2
2
  import { Compilation, Compiler } from 'webpack';
3
- import { StatsInfo } from './types';
4
3
  declare class StatsManager {
5
4
  private _options;
6
5
  private _publicPath?;
@@ -22,9 +21,7 @@ declare class StatsManager {
22
21
  pluginVersion: string;
23
22
  bundler: 'webpack' | 'rspack';
24
23
  }): void;
25
- generateStats(compiler: Compiler, compilation: Compilation, extraOptions?: {
26
- disableEmit?: boolean;
27
- }): Promise<StatsInfo>;
24
+ generateStats(compiler: Compiler, compilation: Compilation, extraOptions?: {}): Promise<Stats>;
28
25
  validate(compiler: Compiler): boolean;
29
26
  }
30
27
  export { StatsManager };
@@ -1,6 +1,5 @@
1
1
  import { Compiler, WebpackPluginInstance } from 'webpack';
2
2
  import { moduleFederationPlugin } from '@module-federation/sdk';
3
- import { StatsInfo, ManifestInfo, ResourceInfo } from './types';
4
3
  export declare class StatsPlugin implements WebpackPluginInstance {
5
4
  readonly name = "StatsPlugin";
6
5
  private _options;
@@ -8,13 +7,9 @@ export declare class StatsPlugin implements WebpackPluginInstance {
8
7
  private _manifestManager;
9
8
  private _enable;
10
9
  private _bundler;
11
- statsInfo?: StatsInfo;
12
- manifestInfo?: ManifestInfo;
13
- disableEmit?: boolean;
14
10
  constructor(options: moduleFederationPlugin.ModuleFederationPluginOptions, { pluginVersion, bundler, }: {
15
11
  pluginVersion: string;
16
12
  bundler: 'webpack' | 'rspack';
17
13
  });
18
14
  apply(compiler: Compiler): void;
19
- get resourceInfo(): Partial<ResourceInfo>;
20
15
  }
@@ -1,4 +1,3 @@
1
1
  export { StatsPlugin } from './StatsPlugin';
2
2
  export { ManifestManager } from './ManifestManager';
3
3
  export { StatsManager } from './StatsManager';
4
- export * from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.0.0-next-20240605083609",
3
+ "version": "0.0.0-next-20240605100049",
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-20240605083609",
28
- "@module-federation/dts-plugin": "0.0.0-next-20240605083609",
29
- "@module-federation/managers": "0.0.0-next-20240605083609"
27
+ "@module-federation/sdk": "0.0.0-next-20240605100049",
28
+ "@module-federation/dts-plugin": "0.0.0-next-20240605100049",
29
+ "@module-federation/managers": "0.0.0-next-20240605100049"
30
30
  },
31
31
  "exports": {
32
32
  ".": {
@@ -1,13 +0,0 @@
1
- import { Manifest, Stats } from '@module-federation/sdk';
2
- export type StatsInfo = {
3
- stats: Stats;
4
- filename: string;
5
- };
6
- export type ManifestInfo = {
7
- manifest: Manifest;
8
- filename: string;
9
- };
10
- export type ResourceInfo = {
11
- stats: StatsInfo;
12
- manifest: ManifestInfo;
13
- };