@module-federation/manifest 0.0.0-next-20240225063605 → 0.0.0-next-20240225075926

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
@@ -386,11 +386,18 @@ var ManifestManager = /*#__PURE__*/ function() {
386
386
  this._options = options;
387
387
  }
388
388
  },
389
+ {
390
+ key: "fileName",
391
+ get: function get() {
392
+ var _this__options = this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
393
+ var manifestFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
394
+ return sdk.simpleJoinRemoteEntry(manifestFilePath, sdk.ManifestFileName);
395
+ }
396
+ },
389
397
  {
390
398
  key: "generateManifest",
391
399
  value: function generateManifest(options) {
392
400
  var compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler;
393
- var _this__options = this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
394
401
  var manifest = _object_spread$2({}, stats);
395
402
  manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
396
403
  var statsExpose = manifest.exposes[cur];
@@ -436,8 +443,7 @@ var ManifestManager = /*#__PURE__*/ function() {
436
443
  return sum;
437
444
  }, []);
438
445
  this._manifest = manifest;
439
- var manifestFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
440
- var manifestFileName = sdk.simpleJoinRemoteEntry(manifestFilePath, sdk.ManifestFileName);
446
+ var manifestFileName = this.fileName;
441
447
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(manifest, null, 2)));
442
448
  if (isDev()) {
443
449
  console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
@@ -1141,7 +1147,6 @@ var StatsManager = /*#__PURE__*/ function() {
1141
1147
  {
1142
1148
  key: "buildInfo",
1143
1149
  get: function get() {
1144
- this._pkgJsonManager.getExposeGarfishModuleType();
1145
1150
  var pkg = this._pkgJsonManager.readPKGJson(process.cwd());
1146
1151
  return {
1147
1152
  buildVersion: managers.utils.getBuildVersion(),
@@ -1149,6 +1154,14 @@ var StatsManager = /*#__PURE__*/ function() {
1149
1154
  };
1150
1155
  }
1151
1156
  },
1157
+ {
1158
+ key: "fileName",
1159
+ get: function get() {
1160
+ var _this__options = this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
1161
+ var statsFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
1162
+ return sdk.simpleJoinRemoteEntry(statsFilePath, sdk.StatsFileName);
1163
+ }
1164
+ },
1152
1165
  {
1153
1166
  key: "_getMetaData",
1154
1167
  value: function _getMetaData(compiler, compilation, extraOptions) {
@@ -1165,7 +1178,6 @@ var StatsManager = /*#__PURE__*/ function() {
1165
1178
  assert(remoteEntryPoint, "Can not get remoteEntry entryPoint!");
1166
1179
  var remoteEntryNameChunk = compilation.namedChunks.get(name);
1167
1180
  assert(remoteEntryNameChunk, "Can not get remoteEntry chunk!");
1168
- debugger;
1169
1181
  assert(Array.from(remoteEntryNameChunk.files).length === 1, "remoteEntry chunk should not have multiple files!");
1170
1182
  var remoteEntryName = _to_consumable_array(remoteEntryNameChunk.files)[0];
1171
1183
  return remoteEntryName;
@@ -1447,7 +1459,7 @@ var StatsManager = /*#__PURE__*/ function() {
1447
1459
  value: function generateStats(compiler, compilation, extraOptions) {
1448
1460
  var _this = this;
1449
1461
  return _async_to_generator$1(function() {
1450
- var stats, _this__options, tmp, manifestOptions, statsFilePath, statsFileName, err;
1462
+ var stats, err;
1451
1463
  return _ts_generator$1(this, function(_state) {
1452
1464
  switch(_state.label){
1453
1465
  case 0:
@@ -1463,10 +1475,7 @@ var StatsManager = /*#__PURE__*/ function() {
1463
1475
  ];
1464
1476
  case 1:
1465
1477
  stats = _state.sent();
1466
- _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
1467
- statsFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
1468
- statsFileName = sdk.simpleJoinRemoteEntry(statsFilePath, sdk.StatsFileName);
1469
- compilation.emitAsset(statsFileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1478
+ compilation.emitAsset(_this.fileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1470
1479
  return [
1471
1480
  2,
1472
1481
  stats
package/dist/index.esm.js CHANGED
@@ -377,11 +377,18 @@ var ManifestManager = /*#__PURE__*/ function() {
377
377
  this._options = options;
378
378
  }
379
379
  },
380
+ {
381
+ key: "fileName",
382
+ get: function get() {
383
+ var _this__options = this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
384
+ var manifestFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
385
+ return simpleJoinRemoteEntry(manifestFilePath, ManifestFileName);
386
+ }
387
+ },
380
388
  {
381
389
  key: "generateManifest",
382
390
  value: function generateManifest(options) {
383
391
  var compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler;
384
- var _this__options = this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
385
392
  var manifest = _object_spread$2({}, stats);
386
393
  manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
387
394
  var statsExpose = manifest.exposes[cur];
@@ -427,8 +434,7 @@ var ManifestManager = /*#__PURE__*/ function() {
427
434
  return sum;
428
435
  }, []);
429
436
  this._manifest = manifest;
430
- var manifestFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
431
- var manifestFileName = simpleJoinRemoteEntry(manifestFilePath, ManifestFileName);
437
+ var manifestFileName = this.fileName;
432
438
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(manifest, null, 2)));
433
439
  if (isDev()) {
434
440
  console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
@@ -1132,7 +1138,6 @@ var StatsManager = /*#__PURE__*/ function() {
1132
1138
  {
1133
1139
  key: "buildInfo",
1134
1140
  get: function get() {
1135
- this._pkgJsonManager.getExposeGarfishModuleType();
1136
1141
  var pkg = this._pkgJsonManager.readPKGJson(process.cwd());
1137
1142
  return {
1138
1143
  buildVersion: utils.getBuildVersion(),
@@ -1140,6 +1145,14 @@ var StatsManager = /*#__PURE__*/ function() {
1140
1145
  };
1141
1146
  }
1142
1147
  },
1148
+ {
1149
+ key: "fileName",
1150
+ get: function get() {
1151
+ var _this__options = this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
1152
+ var statsFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
1153
+ return simpleJoinRemoteEntry(statsFilePath, StatsFileName);
1154
+ }
1155
+ },
1143
1156
  {
1144
1157
  key: "_getMetaData",
1145
1158
  value: function _getMetaData(compiler, compilation, extraOptions) {
@@ -1156,7 +1169,6 @@ var StatsManager = /*#__PURE__*/ function() {
1156
1169
  assert(remoteEntryPoint, "Can not get remoteEntry entryPoint!");
1157
1170
  var remoteEntryNameChunk = compilation.namedChunks.get(name);
1158
1171
  assert(remoteEntryNameChunk, "Can not get remoteEntry chunk!");
1159
- debugger;
1160
1172
  assert(Array.from(remoteEntryNameChunk.files).length === 1, "remoteEntry chunk should not have multiple files!");
1161
1173
  var remoteEntryName = _to_consumable_array(remoteEntryNameChunk.files)[0];
1162
1174
  return remoteEntryName;
@@ -1438,7 +1450,7 @@ var StatsManager = /*#__PURE__*/ function() {
1438
1450
  value: function generateStats(compiler, compilation, extraOptions) {
1439
1451
  var _this = this;
1440
1452
  return _async_to_generator$1(function() {
1441
- var stats, _this__options, tmp, manifestOptions, statsFilePath, statsFileName, err;
1453
+ var stats, err;
1442
1454
  return _ts_generator$1(this, function(_state) {
1443
1455
  switch(_state.label){
1444
1456
  case 0:
@@ -1454,10 +1466,7 @@ var StatsManager = /*#__PURE__*/ function() {
1454
1466
  ];
1455
1467
  case 1:
1456
1468
  stats = _state.sent();
1457
- _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
1458
- statsFilePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
1459
- statsFileName = simpleJoinRemoteEntry(statsFilePath, StatsFileName);
1460
- compilation.emitAsset(statsFileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1469
+ compilation.emitAsset(_this.fileName, new compiler.webpack.sources.RawSource(JSON.stringify(stats, null, 2)));
1461
1470
  return [
1462
1471
  2,
1463
1472
  stats
@@ -11,6 +11,7 @@ declare class ManifestManager {
11
11
  private _manifest?;
12
12
  get manifest(): Manifest | undefined;
13
13
  init(options: moduleFederationPlugin.ModuleFederationPluginOptions): void;
14
+ get fileName(): string;
14
15
  generateManifest(options: GenerateManifestOptions): void;
15
16
  }
16
17
  export { ManifestManager };
@@ -10,6 +10,7 @@ declare class StatsManager {
10
10
  private _sharedManager;
11
11
  private _pkgJsonManager;
12
12
  get buildInfo(): StatsBuildInfo;
13
+ get fileName(): string;
13
14
  private _getMetaData;
14
15
  private _getFilteredModules;
15
16
  private _getModuleAssets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.0.0-next-20240225063605",
3
+ "version": "0.0.0-next-20240225075926",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "find-pkg": "2.0.0",
26
26
  "chalk": "3.0.0",
27
- "@module-federation/sdk": "0.0.0-next-20240225063605",
28
- "@module-federation/managers": "0.0.0-next-20240225063605"
27
+ "@module-federation/sdk": "0.0.0-next-20240225075926",
28
+ "@module-federation/managers": "0.0.0-next-20240225075926"
29
29
  },
30
30
  "exports": {
31
31
  ".": {