@module-federation/manifest 0.0.0-next-20240930063850 → 0.0.0-next-20240930091801

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,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var path = require('path');
4
6
  var fs = require('fs');
5
7
  var chalk = require('chalk');
@@ -7,6 +9,12 @@ var sdk = require('@module-federation/sdk');
7
9
  var core = require('@module-federation/dts-plugin/core');
8
10
  var managers = require('@module-federation/managers');
9
11
 
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
+
10
18
  var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
11
19
  var HOT_UPDATE_SUFFIX = '.hot-update';
12
20
 
@@ -86,6 +94,11 @@ function ownKeys$2(object, enumerableOnly) {
86
94
  var keys = Object.keys(object);
87
95
  if (Object.getOwnPropertySymbols) {
88
96
  var symbols = Object.getOwnPropertySymbols(object);
97
+ if (enumerableOnly) {
98
+ symbols = symbols.filter(function(sym) {
99
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
100
+ });
101
+ }
89
102
  keys.push.apply(keys, symbols);
90
103
  }
91
104
  return keys;
@@ -355,7 +368,7 @@ function isDev() {
355
368
  return process.env['NODE_ENV'] === 'development';
356
369
  }
357
370
  function getFileNameWithOutExt(str) {
358
- return str.replace(path.extname(str), '');
371
+ return str.replace(path__default["default"].extname(str), '');
359
372
  }
360
373
  function getFileName(manifestOptions) {
361
374
  if (!manifestOptions) {
@@ -413,11 +426,11 @@ function getTypesMetaInfo(pluginOptions, context) {
413
426
  return {
414
427
  path: '',
415
428
  name: '',
416
- zip: path.join(zipPrefix, zipName),
417
- api: path.join(zipPrefix, apiFileName)
429
+ zip: path__default["default"].join(zipPrefix, zipName),
430
+ api: path__default["default"].join(zipPrefix, apiFileName)
418
431
  };
419
432
  } catch (err) {
420
- console.warn(chalk(_templateObject$2(), PLUGIN_IDENTIFIER, err));
433
+ console.warn(chalk__default["default"](_templateObject$2(), PLUGIN_IDENTIFIER, err));
421
434
  return defaultTypesMetaInfo;
422
435
  }
423
436
  }
@@ -467,6 +480,7 @@ function _defineProperties$3(target, props) {
467
480
  }
468
481
  function _create_class$3(Constructor, protoProps, staticProps) {
469
482
  if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
483
+ if (staticProps) _defineProperties$3(Constructor, staticProps);
470
484
  return Constructor;
471
485
  }
472
486
  function _define_property$3(obj, key, value) {
@@ -693,10 +707,10 @@ var ManifestManager = /*#__PURE__*/ function() {
693
707
  return sum;
694
708
  }, []);
695
709
  prefetchInterface = false;
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);
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);
698
712
  if (existPrefetch) {
699
- content = fs.readFileSync(prefetchFilePath).toString();
713
+ content = fs__default["default"].readFileSync(prefetchFilePath).toString();
700
714
  if (content) {
701
715
  prefetchInterface = true;
702
716
  }
@@ -728,7 +742,7 @@ var ManifestManager = /*#__PURE__*/ function() {
728
742
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
729
743
  }
730
744
  if (isDev()) {
731
- console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
745
+ console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
732
746
  }
733
747
  return [
734
748
  2,
@@ -770,6 +784,7 @@ function _defineProperties$2(target, props) {
770
784
  }
771
785
  function _create_class$2(Constructor, protoProps, staticProps) {
772
786
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
787
+ if (staticProps) _defineProperties$2(Constructor, staticProps);
773
788
  return Constructor;
774
789
  }
775
790
  function _define_property$2(obj, key, value) {
@@ -831,6 +846,11 @@ function ownKeys$1(object, enumerableOnly) {
831
846
  var keys = Object.keys(object);
832
847
  if (Object.getOwnPropertySymbols) {
833
848
  var symbols = Object.getOwnPropertySymbols(object);
849
+ if (enumerableOnly) {
850
+ symbols = symbols.filter(function(sym) {
851
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
852
+ });
853
+ }
834
854
  keys.push.apply(keys, symbols);
835
855
  }
836
856
  return keys;
@@ -1083,7 +1103,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
1083
1103
  name: exposeModuleName,
1084
1104
  // @ts-ignore to deduplicate
1085
1105
  requires: new Set(),
1086
- file: path.relative(process.cwd(), file.import[0]),
1106
+ file: path__default["default"].relative(process.cwd(), file.import[0]),
1087
1107
  assets: {
1088
1108
  js: {
1089
1109
  async: [],
@@ -1202,6 +1222,7 @@ function _defineProperties$1(target, props) {
1202
1222
  }
1203
1223
  function _create_class$1(Constructor, protoProps, staticProps) {
1204
1224
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
1225
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
1205
1226
  return Constructor;
1206
1227
  }
1207
1228
  function _define_property$1(obj, key, value) {
@@ -1269,6 +1290,11 @@ function ownKeys(object, enumerableOnly) {
1269
1290
  var keys = Object.keys(object);
1270
1291
  if (Object.getOwnPropertySymbols) {
1271
1292
  var symbols = Object.getOwnPropertySymbols(object);
1293
+ if (enumerableOnly) {
1294
+ symbols = symbols.filter(function(sym) {
1295
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1296
+ });
1297
+ }
1272
1298
  keys.push.apply(keys, symbols);
1273
1299
  }
1274
1300
  return keys;
@@ -1300,6 +1326,10 @@ function _tagged_template_literal(strings, raw) {
1300
1326
  function _to_consumable_array(arr) {
1301
1327
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1302
1328
  }
1329
+ function _type_of$1(obj) {
1330
+ "@swc/helpers - typeof";
1331
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1332
+ }
1303
1333
  function _unsupported_iterable_to_array(o, minLen) {
1304
1334
  if (!o) return;
1305
1335
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -1637,7 +1667,7 @@ var StatsManager = /*#__PURE__*/ function() {
1637
1667
  remotes: [],
1638
1668
  exposes: []
1639
1669
  };
1640
- if (typeof manifestOptions === 'object' && manifestOptions.disableAssetsAnalyze) {
1670
+ if ((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.disableAssetsAnalyze) {
1641
1671
  remotes = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1642
1672
  stats.remotes = remotes;
1643
1673
  return [
@@ -1802,7 +1832,7 @@ var StatsManager = /*#__PURE__*/ function() {
1802
1832
  ];
1803
1833
  case 1:
1804
1834
  stats = _state.sent();
1805
- if (!(typeof manifestOptions === 'object' && manifestOptions.additionalData)) return [
1835
+ if (!((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.additionalData)) return [
1806
1836
  3,
1807
1837
  3
1808
1838
  ];
@@ -1848,10 +1878,10 @@ var StatsManager = /*#__PURE__*/ function() {
1848
1878
  value: function validate(compiler) {
1849
1879
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1850
1880
  if (typeof publicPath !== 'string') {
1851
- console.warn(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1881
+ console.warn(chalk__default["default"](_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1852
1882
  return false;
1853
1883
  } else if (publicPath === 'auto') {
1854
- console.warn(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1884
+ console.warn(chalk__default["default"](_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1855
1885
  return true;
1856
1886
  }
1857
1887
  return true;
@@ -1906,6 +1936,7 @@ function _defineProperties(target, props) {
1906
1936
  }
1907
1937
  function _create_class(Constructor, protoProps, staticProps) {
1908
1938
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1939
+ if (staticProps) _defineProperties(Constructor, staticProps);
1909
1940
  return Constructor;
1910
1941
  }
1911
1942
  function _define_property(obj, key, value) {
@@ -1928,6 +1959,10 @@ function _instanceof(left, right) {
1928
1959
  return left instanceof right;
1929
1960
  }
1930
1961
  }
1962
+ function _type_of(obj) {
1963
+ "@swc/helpers - typeof";
1964
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1965
+ }
1931
1966
  function _ts_generator(thisArg, body) {
1932
1967
  var f, y, t, g, _ = {
1933
1968
  label: 0,
@@ -2095,7 +2130,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2095
2130
  publicPath: _this1._statsManager.getPublicPath(compiler),
2096
2131
  compiler: compiler,
2097
2132
  bundler: _this1._bundler,
2098
- additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2133
+ additionalData: _type_of(_this1._options.manifest) === 'object' ? _this1._options.manifest.additionalData : undefined
2099
2134
  }, {
2100
2135
  disableEmit: _this1.disableEmit
2101
2136
  })
package/dist/index.esm.js CHANGED
@@ -84,6 +84,11 @@ 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
+ }
87
92
  keys.push.apply(keys, symbols);
88
93
  }
89
94
  return keys;
@@ -465,6 +470,7 @@ function _defineProperties$3(target, props) {
465
470
  }
466
471
  function _create_class$3(Constructor, protoProps, staticProps) {
467
472
  if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
473
+ if (staticProps) _defineProperties$3(Constructor, staticProps);
468
474
  return Constructor;
469
475
  }
470
476
  function _define_property$3(obj, key, value) {
@@ -768,6 +774,7 @@ function _defineProperties$2(target, props) {
768
774
  }
769
775
  function _create_class$2(Constructor, protoProps, staticProps) {
770
776
  if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
777
+ if (staticProps) _defineProperties$2(Constructor, staticProps);
771
778
  return Constructor;
772
779
  }
773
780
  function _define_property$2(obj, key, value) {
@@ -829,6 +836,11 @@ function ownKeys$1(object, enumerableOnly) {
829
836
  var keys = Object.keys(object);
830
837
  if (Object.getOwnPropertySymbols) {
831
838
  var symbols = Object.getOwnPropertySymbols(object);
839
+ if (enumerableOnly) {
840
+ symbols = symbols.filter(function(sym) {
841
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
842
+ });
843
+ }
832
844
  keys.push.apply(keys, symbols);
833
845
  }
834
846
  return keys;
@@ -1200,6 +1212,7 @@ function _defineProperties$1(target, props) {
1200
1212
  }
1201
1213
  function _create_class$1(Constructor, protoProps, staticProps) {
1202
1214
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
1215
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
1203
1216
  return Constructor;
1204
1217
  }
1205
1218
  function _define_property$1(obj, key, value) {
@@ -1267,6 +1280,11 @@ function ownKeys(object, enumerableOnly) {
1267
1280
  var keys = Object.keys(object);
1268
1281
  if (Object.getOwnPropertySymbols) {
1269
1282
  var symbols = Object.getOwnPropertySymbols(object);
1283
+ if (enumerableOnly) {
1284
+ symbols = symbols.filter(function(sym) {
1285
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1286
+ });
1287
+ }
1270
1288
  keys.push.apply(keys, symbols);
1271
1289
  }
1272
1290
  return keys;
@@ -1298,6 +1316,10 @@ function _tagged_template_literal(strings, raw) {
1298
1316
  function _to_consumable_array(arr) {
1299
1317
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1300
1318
  }
1319
+ function _type_of$1(obj) {
1320
+ "@swc/helpers - typeof";
1321
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1322
+ }
1301
1323
  function _unsupported_iterable_to_array(o, minLen) {
1302
1324
  if (!o) return;
1303
1325
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -1635,7 +1657,7 @@ var StatsManager = /*#__PURE__*/ function() {
1635
1657
  remotes: [],
1636
1658
  exposes: []
1637
1659
  };
1638
- if (typeof manifestOptions === 'object' && manifestOptions.disableAssetsAnalyze) {
1660
+ if ((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.disableAssetsAnalyze) {
1639
1661
  remotes = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1640
1662
  stats.remotes = remotes;
1641
1663
  return [
@@ -1800,7 +1822,7 @@ var StatsManager = /*#__PURE__*/ function() {
1800
1822
  ];
1801
1823
  case 1:
1802
1824
  stats = _state.sent();
1803
- if (!(typeof manifestOptions === 'object' && manifestOptions.additionalData)) return [
1825
+ if (!((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.additionalData)) return [
1804
1826
  3,
1805
1827
  3
1806
1828
  ];
@@ -1904,6 +1926,7 @@ function _defineProperties(target, props) {
1904
1926
  }
1905
1927
  function _create_class(Constructor, protoProps, staticProps) {
1906
1928
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1929
+ if (staticProps) _defineProperties(Constructor, staticProps);
1907
1930
  return Constructor;
1908
1931
  }
1909
1932
  function _define_property(obj, key, value) {
@@ -1926,6 +1949,10 @@ function _instanceof(left, right) {
1926
1949
  return left instanceof right;
1927
1950
  }
1928
1951
  }
1952
+ function _type_of(obj) {
1953
+ "@swc/helpers - typeof";
1954
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1955
+ }
1929
1956
  function _ts_generator(thisArg, body) {
1930
1957
  var f, y, t, g, _ = {
1931
1958
  label: 0,
@@ -2093,7 +2120,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2093
2120
  publicPath: _this1._statsManager.getPublicPath(compiler),
2094
2121
  compiler: compiler,
2095
2122
  bundler: _this1._bundler,
2096
- additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2123
+ additionalData: _type_of(_this1._options.manifest) === 'object' ? _this1._options.manifest.additionalData : undefined
2097
2124
  }, {
2098
2125
  disableEmit: _this1.disableEmit
2099
2126
  })
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.6.7",
3
+ "version": "0.6.6",
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-20240930063850",
3
+ "version": "0.0.0-next-20240930091801",
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-20240930063850",
28
- "@module-federation/dts-plugin": "0.0.0-next-20240930063850",
29
- "@module-federation/managers": "0.0.0-next-20240930063850"
27
+ "@module-federation/sdk": "0.0.0-next-20240930091801",
28
+ "@module-federation/dts-plugin": "0.0.0-next-20240930091801",
29
+ "@module-federation/managers": "0.0.0-next-20240930091801"
30
30
  },
31
31
  "exports": {
32
32
  ".": {
@@ -1 +0,0 @@
1
- export * from "./src/index";