@module-federation/manifest 0.6.13 → 0.6.14

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
@@ -10,6 +10,8 @@ var managers = require('@module-federation/managers');
10
10
  var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
11
11
  var HOT_UPDATE_SUFFIX = '.hot-update';
12
12
 
13
+ var logger = sdk.createLogger("[ ".concat(PLUGIN_IDENTIFIER, " ]"));
14
+
13
15
  function _array_like_to_array$2(arr, len) {
14
16
  if (len == null || len > arr.length) len = arr.length;
15
17
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -104,16 +106,6 @@ function _object_spread_props$2(target, source) {
104
106
  function _sliced_to_array$2(arr, i) {
105
107
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
106
108
  }
107
- function _tagged_template_literal$2(strings, raw) {
108
- if (!raw) {
109
- raw = strings.slice(0);
110
- }
111
- return Object.freeze(Object.defineProperties(strings, {
112
- raw: {
113
- value: Object.freeze(raw)
114
- }
115
- }));
116
- }
117
109
  function _to_consumable_array$1(arr) {
118
110
  return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$1();
119
111
  }
@@ -125,17 +117,6 @@ function _unsupported_iterable_to_array$2(o, minLen) {
125
117
  if (n === "Map" || n === "Set") return Array.from(n);
126
118
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
127
119
  }
128
- function _templateObject$2() {
129
- var data = _tagged_template_literal$2([
130
- "{bold {yellow [ ",
131
- " ]: getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ",
132
- " }}"
133
- ]);
134
- _templateObject$2 = function _templateObject() {
135
- return data;
136
- };
137
- return data;
138
- }
139
120
  function isHotFile(file) {
140
121
  return file.includes(HOT_UPDATE_SUFFIX);
141
122
  }
@@ -417,7 +398,7 @@ function getTypesMetaInfo(pluginOptions, context) {
417
398
  api: path.join(zipPrefix, apiFileName)
418
399
  };
419
400
  } catch (err) {
420
- console.warn(chalk(_templateObject$2(), PLUGIN_IDENTIFIER, err));
401
+ logger.warn("getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ".concat(err));
421
402
  return defaultTypesMetaInfo;
422
403
  }
423
404
  }
@@ -497,16 +478,6 @@ function _object_spread$2(target) {
497
478
  }
498
479
  return target;
499
480
  }
500
- function _tagged_template_literal$1(strings, raw) {
501
- if (!raw) {
502
- raw = strings.slice(0);
503
- }
504
- return Object.freeze(Object.defineProperties(strings, {
505
- raw: {
506
- value: Object.freeze(raw)
507
- }
508
- }));
509
- }
510
481
  function _ts_generator$2(thisArg, body) {
511
482
  var f, y, t, g, _ = {
512
483
  label: 0,
@@ -602,18 +573,6 @@ function _ts_generator$2(thisArg, body) {
602
573
  };
603
574
  }
604
575
  }
605
- function _templateObject$1() {
606
- var data = _tagged_template_literal$1([
607
- "{bold {greenBright [ ",
608
- " ]} {greenBright Manifest Link:} {cyan ",
609
- "",
610
- "}}"
611
- ]);
612
- _templateObject$1 = function _templateObject() {
613
- return data;
614
- };
615
- return data;
616
- }
617
576
  var ManifestManager = /*#__PURE__*/ function() {
618
577
  function ManifestManager() {
619
578
  _class_call_check$3(this, ManifestManager);
@@ -728,7 +687,7 @@ var ManifestManager = /*#__PURE__*/ function() {
728
687
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
729
688
  }
730
689
  if (isDev()) {
731
- console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
690
+ logger.info("Manifest Link: ".concat(chalk.cyan("".concat(publicPath === 'auto' ? '{auto}/' : publicPath).concat(manifestFileName)), " "));
732
691
  }
733
692
  return [
734
693
  2,
@@ -1287,16 +1246,6 @@ function _object_spread_props(target, source) {
1287
1246
  function _sliced_to_array(arr, i) {
1288
1247
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
1289
1248
  }
1290
- function _tagged_template_literal(strings, raw) {
1291
- if (!raw) {
1292
- raw = strings.slice(0);
1293
- }
1294
- return Object.freeze(Object.defineProperties(strings, {
1295
- raw: {
1296
- value: Object.freeze(raw)
1297
- }
1298
- }));
1299
- }
1300
1249
  function _to_consumable_array(arr) {
1301
1250
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1302
1251
  }
@@ -1407,28 +1356,6 @@ function _ts_generator$1(thisArg, body) {
1407
1356
  };
1408
1357
  }
1409
1358
  }
1410
- function _templateObject() {
1411
- var data = _tagged_template_literal([
1412
- "{bold {yellow [ ",
1413
- " ]: Manifest will not generate, because publicPath can only be string, but got '",
1414
- "' }}"
1415
- ]);
1416
- _templateObject = function _templateObject() {
1417
- return data;
1418
- };
1419
- return data;
1420
- }
1421
- function _templateObject1() {
1422
- var data = _tagged_template_literal([
1423
- "{bold {blue [ ",
1424
- " ]: Manifest will use absolute path resolution via its host at runtime, reason: publicPath='",
1425
- "'}}"
1426
- ]);
1427
- _templateObject1 = function _templateObject() {
1428
- return data;
1429
- };
1430
- return data;
1431
- }
1432
1359
  var StatsManager = /*#__PURE__*/ function() {
1433
1360
  function StatsManager() {
1434
1361
  _class_call_check$1(this, StatsManager);
@@ -1860,10 +1787,10 @@ var StatsManager = /*#__PURE__*/ function() {
1860
1787
  value: function validate(compiler) {
1861
1788
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1862
1789
  if (typeof publicPath !== 'string') {
1863
- console.warn(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1790
+ logger.warn("Manifest will not generate, because publicPath can only be string, but got '".concat(publicPath, "'"));
1864
1791
  return false;
1865
1792
  } else if (publicPath === 'auto') {
1866
- console.warn(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1793
+ logger.warn("Manifest will use absolute path resolution via its host at runtime, reason: publicPath='".concat(publicPath, "'"));
1867
1794
  return true;
1868
1795
  }
1869
1796
  return true;
@@ -2065,7 +1992,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2065
1992
  if (_instanceof(err, Error)) {
2066
1993
  err.message = "[ ".concat(PLUGIN_IDENTIFIER, " ]: Manifest will not generate, because: ").concat(err.message);
2067
1994
  }
2068
- console.error(err);
1995
+ logger.error(err);
2069
1996
  this._enable = false;
2070
1997
  }
2071
1998
  }
package/dist/index.esm.js CHANGED
@@ -1,13 +1,15 @@
1
1
  import path from 'path';
2
2
  import fs from 'fs';
3
3
  import chalk from 'chalk';
4
- import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOptions, encodeName, MFPrefetchCommon } from '@module-federation/sdk';
4
+ import { createLogger, StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOptions, encodeName, MFPrefetchCommon } from '@module-federation/sdk';
5
5
  import { isTSProject, retrieveTypesAssetsInfo } from '@module-federation/dts-plugin/core';
6
6
  import { RemoteManager, SharedManager, ContainerManager, PKGJsonManager, utils } from '@module-federation/managers';
7
7
 
8
8
  var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
9
9
  var HOT_UPDATE_SUFFIX = '.hot-update';
10
10
 
11
+ var logger = createLogger("[ ".concat(PLUGIN_IDENTIFIER, " ]"));
12
+
11
13
  function _array_like_to_array$2(arr, len) {
12
14
  if (len == null || len > arr.length) len = arr.length;
13
15
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -102,16 +104,6 @@ function _object_spread_props$2(target, source) {
102
104
  function _sliced_to_array$2(arr, i) {
103
105
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
104
106
  }
105
- function _tagged_template_literal$2(strings, raw) {
106
- if (!raw) {
107
- raw = strings.slice(0);
108
- }
109
- return Object.freeze(Object.defineProperties(strings, {
110
- raw: {
111
- value: Object.freeze(raw)
112
- }
113
- }));
114
- }
115
107
  function _to_consumable_array$1(arr) {
116
108
  return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$1();
117
109
  }
@@ -123,17 +115,6 @@ function _unsupported_iterable_to_array$2(o, minLen) {
123
115
  if (n === "Map" || n === "Set") return Array.from(n);
124
116
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
125
117
  }
126
- function _templateObject$2() {
127
- var data = _tagged_template_literal$2([
128
- "{bold {yellow [ ",
129
- " ]: getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ",
130
- " }}"
131
- ]);
132
- _templateObject$2 = function _templateObject() {
133
- return data;
134
- };
135
- return data;
136
- }
137
118
  function isHotFile(file) {
138
119
  return file.includes(HOT_UPDATE_SUFFIX);
139
120
  }
@@ -415,7 +396,7 @@ function getTypesMetaInfo(pluginOptions, context) {
415
396
  api: path.join(zipPrefix, apiFileName)
416
397
  };
417
398
  } catch (err) {
418
- console.warn(chalk(_templateObject$2(), PLUGIN_IDENTIFIER, err));
399
+ logger.warn("getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ".concat(err));
419
400
  return defaultTypesMetaInfo;
420
401
  }
421
402
  }
@@ -495,16 +476,6 @@ function _object_spread$2(target) {
495
476
  }
496
477
  return target;
497
478
  }
498
- function _tagged_template_literal$1(strings, raw) {
499
- if (!raw) {
500
- raw = strings.slice(0);
501
- }
502
- return Object.freeze(Object.defineProperties(strings, {
503
- raw: {
504
- value: Object.freeze(raw)
505
- }
506
- }));
507
- }
508
479
  function _ts_generator$2(thisArg, body) {
509
480
  var f, y, t, g, _ = {
510
481
  label: 0,
@@ -600,18 +571,6 @@ function _ts_generator$2(thisArg, body) {
600
571
  };
601
572
  }
602
573
  }
603
- function _templateObject$1() {
604
- var data = _tagged_template_literal$1([
605
- "{bold {greenBright [ ",
606
- " ]} {greenBright Manifest Link:} {cyan ",
607
- "",
608
- "}}"
609
- ]);
610
- _templateObject$1 = function _templateObject() {
611
- return data;
612
- };
613
- return data;
614
- }
615
574
  var ManifestManager = /*#__PURE__*/ function() {
616
575
  function ManifestManager() {
617
576
  _class_call_check$3(this, ManifestManager);
@@ -726,7 +685,7 @@ var ManifestManager = /*#__PURE__*/ function() {
726
685
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
727
686
  }
728
687
  if (isDev()) {
729
- console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
688
+ logger.info("Manifest Link: ".concat(chalk.cyan("".concat(publicPath === 'auto' ? '{auto}/' : publicPath).concat(manifestFileName)), " "));
730
689
  }
731
690
  return [
732
691
  2,
@@ -1285,16 +1244,6 @@ function _object_spread_props(target, source) {
1285
1244
  function _sliced_to_array(arr, i) {
1286
1245
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
1287
1246
  }
1288
- function _tagged_template_literal(strings, raw) {
1289
- if (!raw) {
1290
- raw = strings.slice(0);
1291
- }
1292
- return Object.freeze(Object.defineProperties(strings, {
1293
- raw: {
1294
- value: Object.freeze(raw)
1295
- }
1296
- }));
1297
- }
1298
1247
  function _to_consumable_array(arr) {
1299
1248
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1300
1249
  }
@@ -1405,28 +1354,6 @@ function _ts_generator$1(thisArg, body) {
1405
1354
  };
1406
1355
  }
1407
1356
  }
1408
- function _templateObject() {
1409
- var data = _tagged_template_literal([
1410
- "{bold {yellow [ ",
1411
- " ]: Manifest will not generate, because publicPath can only be string, but got '",
1412
- "' }}"
1413
- ]);
1414
- _templateObject = function _templateObject() {
1415
- return data;
1416
- };
1417
- return data;
1418
- }
1419
- function _templateObject1() {
1420
- var data = _tagged_template_literal([
1421
- "{bold {blue [ ",
1422
- " ]: Manifest will use absolute path resolution via its host at runtime, reason: publicPath='",
1423
- "'}}"
1424
- ]);
1425
- _templateObject1 = function _templateObject() {
1426
- return data;
1427
- };
1428
- return data;
1429
- }
1430
1357
  var StatsManager = /*#__PURE__*/ function() {
1431
1358
  function StatsManager() {
1432
1359
  _class_call_check$1(this, StatsManager);
@@ -1858,10 +1785,10 @@ var StatsManager = /*#__PURE__*/ function() {
1858
1785
  value: function validate(compiler) {
1859
1786
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1860
1787
  if (typeof publicPath !== 'string') {
1861
- console.warn(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1788
+ logger.warn("Manifest will not generate, because publicPath can only be string, but got '".concat(publicPath, "'"));
1862
1789
  return false;
1863
1790
  } else if (publicPath === 'auto') {
1864
- console.warn(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1791
+ logger.warn("Manifest will use absolute path resolution via its host at runtime, reason: publicPath='".concat(publicPath, "'"));
1865
1792
  return true;
1866
1793
  }
1867
1794
  return true;
@@ -2063,7 +1990,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2063
1990
  if (_instanceof(err, Error)) {
2064
1991
  err.message = "[ ".concat(PLUGIN_IDENTIFIER, " ]: Manifest will not generate, because: ").concat(err.message);
2065
1992
  }
2066
- console.error(err);
1993
+ logger.error(err);
2067
1994
  this._enable = false;
2068
1995
  }
2069
1996
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -0,0 +1,2 @@
1
+ declare const logger: import("@module-federation/sdk").Logger;
2
+ export default logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
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.6.13",
28
- "@module-federation/dts-plugin": "0.6.13",
29
- "@module-federation/managers": "0.6.13"
27
+ "@module-federation/sdk": "0.6.14",
28
+ "@module-federation/dts-plugin": "0.6.14",
29
+ "@module-federation/managers": "0.6.14"
30
30
  },
31
31
  "exports": {
32
32
  ".": {