@module-federation/manifest 0.0.0-next-20240401084119 → 0.0.0-next-20240402000503

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
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var chalk = require('chalk');
6
6
  var path = require('path');
7
7
  var sdk = require('@module-federation/sdk');
8
- var dtsKit = require('@module-federation/dts-kit');
9
8
  var managers = require('@module-federation/managers');
10
9
 
11
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -27,19 +26,6 @@ function _array_with_holes$2(arr) {
27
26
  function _array_without_holes(arr) {
28
27
  if (Array.isArray(arr)) return _array_like_to_array$2(arr);
29
28
  }
30
- function _define_property$4(obj, key, value) {
31
- if (key in obj) {
32
- Object.defineProperty(obj, key, {
33
- value: value,
34
- enumerable: true,
35
- configurable: true,
36
- writable: true
37
- });
38
- } else {
39
- obj[key] = value;
40
- }
41
- return obj;
42
- }
43
29
  function _iterable_to_array(iter) {
44
30
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
45
31
  }
@@ -73,58 +59,9 @@ function _non_iterable_rest$2() {
73
59
  function _non_iterable_spread() {
74
60
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
61
  }
76
- function _object_spread$3(target) {
77
- for(var i = 1; i < arguments.length; i++){
78
- var source = arguments[i] != null ? arguments[i] : {};
79
- var ownKeys = Object.keys(source);
80
- if (typeof Object.getOwnPropertySymbols === "function") {
81
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
82
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
83
- }));
84
- }
85
- ownKeys.forEach(function(key) {
86
- _define_property$4(target, key, source[key]);
87
- });
88
- }
89
- return target;
90
- }
91
- function ownKeys$2(object, enumerableOnly) {
92
- var keys = Object.keys(object);
93
- if (Object.getOwnPropertySymbols) {
94
- var symbols = Object.getOwnPropertySymbols(object);
95
- if (enumerableOnly) {
96
- symbols = symbols.filter(function(sym) {
97
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
98
- });
99
- }
100
- keys.push.apply(keys, symbols);
101
- }
102
- return keys;
103
- }
104
- function _object_spread_props$2(target, source) {
105
- source = source != null ? source : {};
106
- if (Object.getOwnPropertyDescriptors) {
107
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
108
- } else {
109
- ownKeys$2(Object(source)).forEach(function(key) {
110
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
111
- });
112
- }
113
- return target;
114
- }
115
62
  function _sliced_to_array$2(arr, i) {
116
63
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
117
64
  }
118
- function _tagged_template_literal$2(strings, raw) {
119
- if (!raw) {
120
- raw = strings.slice(0);
121
- }
122
- return Object.freeze(Object.defineProperties(strings, {
123
- raw: {
124
- value: Object.freeze(raw)
125
- }
126
- }));
127
- }
128
65
  function _to_consumable_array(arr) {
129
66
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread();
130
67
  }
@@ -136,17 +73,6 @@ function _unsupported_iterable_to_array$2(o, minLen) {
136
73
  if (n === "Map" || n === "Set") return Array.from(n);
137
74
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
138
75
  }
139
- function _templateObject$2() {
140
- var data = _tagged_template_literal$2([
141
- "{bold {yellow [ ",
142
- " ]: getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ",
143
- " }}"
144
- ]);
145
- _templateObject$2 = function _templateObject() {
146
- return data;
147
- };
148
- return data;
149
- }
150
76
  function getSharedModuleName(name) {
151
77
  var _name_split = _sliced_to_array$2(name.split(" "), 5); _name_split[0]; _name_split[1]; _name_split[2]; _name_split[3]; var sharedInfo = _name_split[4];
152
78
  return sharedInfo.split("@").slice(0, -1).join("@");
@@ -398,45 +324,6 @@ function getFileName(manifestOptions) {
398
324
  manifestFileName: sdk.simpleJoinRemoteEntry(filePath, manifestFileName)
399
325
  };
400
326
  }
401
- function getTypesMetaInfo(pluginOptions, context) {
402
- var defaultRemoteOptions = {
403
- generateAPITypes: true,
404
- compileInChildProcess: true
405
- };
406
- var defaultTypesMetaInfo = {
407
- path: "",
408
- name: "",
409
- zip: "",
410
- api: ""
411
- };
412
- try {
413
- var normalizedDtsOptions = sdk.normalizeOptions(true, {
414
- disableGenerateTypes: false,
415
- remote: defaultRemoteOptions,
416
- host: {}
417
- }, "mfOptions.dts")(pluginOptions.dts);
418
- if (normalizedDtsOptions === false) {
419
- return defaultTypesMetaInfo;
420
- }
421
- var normalizedRemote = sdk.normalizeOptions(true, defaultRemoteOptions, "mfOptions.dts.remote")(normalizedDtsOptions.remote);
422
- if (normalizedRemote === false) {
423
- return defaultTypesMetaInfo;
424
- }
425
- var _retrieveTypesAssetsInfo = dtsKit.retrieveTypesAssetsInfo(_object_spread_props$2(_object_spread$3({}, normalizedRemote), {
426
- context: context,
427
- moduleFederationConfig: pluginOptions
428
- })), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName;
429
- return {
430
- path: "",
431
- name: "",
432
- zip: zipName,
433
- api: apiFileName
434
- };
435
- } catch (err) {
436
- console.warn(chalk__default["default"](_templateObject$2(), PLUGIN_IDENTIFIER, err));
437
- return defaultTypesMetaInfo;
438
- }
439
- }
440
327
 
441
328
  function _class_call_check$3(instance, Constructor) {
442
329
  if (!(instance instanceof Constructor)) {
@@ -1249,7 +1136,7 @@ function _ts_generator$1(thisArg, body) {
1249
1136
  }
1250
1137
  function _templateObject() {
1251
1138
  var data = _tagged_template_literal([
1252
- "{bold {yellow [ ",
1139
+ "{bold {red [ ",
1253
1140
  " ]: Manifest will not generate, because publicPath can only be string, but got '",
1254
1141
  "' }}"
1255
1142
  ]);
@@ -1260,7 +1147,7 @@ function _templateObject() {
1260
1147
  }
1261
1148
  function _templateObject1() {
1262
1149
  var data = _tagged_template_literal([
1263
- "{bold {yellow [ ",
1150
+ "{bold {red [ ",
1264
1151
  " ]: Manifest will not generate, because publicPath can only be absolute path, but got '",
1265
1152
  "'}}"
1266
1153
  ]);
@@ -1334,7 +1221,10 @@ var StatsManager = /*#__PURE__*/ function() {
1334
1221
  // same as the types supported by runtime, currently only global/var/script is supported
1335
1222
  type: "global"
1336
1223
  },
1337
- types: getTypesMetaInfo(this._options, compiler.context),
1224
+ types: {
1225
+ name: "",
1226
+ path: ""
1227
+ },
1338
1228
  globalName: globalName,
1339
1229
  pluginVersion: this._pluginVersion
1340
1230
  };
@@ -1602,7 +1492,7 @@ var StatsManager = /*#__PURE__*/ function() {
1602
1492
  value: function generateStats(compiler, compilation, extraOptions) {
1603
1493
  var _this = this;
1604
1494
  return _async_to_generator$1(function() {
1605
- var existedStats, _this__options, tmp, manifestOptions, stats, ret, err;
1495
+ var _this__options, tmp, manifestOptions, stats, ret, err;
1606
1496
  return _ts_generator$1(this, function(_state) {
1607
1497
  switch(_state.label){
1608
1498
  case 0:
@@ -1612,13 +1502,6 @@ var StatsManager = /*#__PURE__*/ function() {
1612
1502
  ,
1613
1503
  5
1614
1504
  ]);
1615
- existedStats = compilation.getAsset(_this.fileName);
1616
- if (existedStats) {
1617
- return [
1618
- 2,
1619
- JSON.parse(existedStats.source.source().toString())
1620
- ];
1621
- }
1622
1505
  _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
1623
1506
  return [
1624
1507
  4,
@@ -1667,10 +1550,10 @@ var StatsManager = /*#__PURE__*/ function() {
1667
1550
  value: function validate(compiler) {
1668
1551
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1669
1552
  if (typeof publicPath !== "string") {
1670
- console.warn(chalk__default["default"](_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1553
+ console.error(chalk__default["default"](_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1671
1554
  return false;
1672
1555
  } else if (publicPath === "auto") {
1673
- console.warn(chalk__default["default"](_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1556
+ console.error(chalk__default["default"](_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1674
1557
  return false;
1675
1558
  }
1676
1559
  return true;
package/dist/index.esm.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import path from 'path';
3
- import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOptions } from '@module-federation/sdk';
4
- import { retrieveTypesAssetsInfo } from '@module-federation/dts-kit';
3
+ import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry } from '@module-federation/sdk';
5
4
  import { RemoteManager, SharedManager, ContainerManager, PKGJsonManager, utils } from '@module-federation/managers';
6
5
 
7
6
  var PLUGIN_IDENTIFIER = "Module Federation Manifest Plugin";
@@ -18,19 +17,6 @@ function _array_with_holes$2(arr) {
18
17
  function _array_without_holes(arr) {
19
18
  if (Array.isArray(arr)) return _array_like_to_array$2(arr);
20
19
  }
21
- function _define_property$4(obj, key, value) {
22
- if (key in obj) {
23
- Object.defineProperty(obj, key, {
24
- value: value,
25
- enumerable: true,
26
- configurable: true,
27
- writable: true
28
- });
29
- } else {
30
- obj[key] = value;
31
- }
32
- return obj;
33
- }
34
20
  function _iterable_to_array(iter) {
35
21
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
36
22
  }
@@ -64,58 +50,9 @@ function _non_iterable_rest$2() {
64
50
  function _non_iterable_spread() {
65
51
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
66
52
  }
67
- function _object_spread$3(target) {
68
- for(var i = 1; i < arguments.length; i++){
69
- var source = arguments[i] != null ? arguments[i] : {};
70
- var ownKeys = Object.keys(source);
71
- if (typeof Object.getOwnPropertySymbols === "function") {
72
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
73
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
74
- }));
75
- }
76
- ownKeys.forEach(function(key) {
77
- _define_property$4(target, key, source[key]);
78
- });
79
- }
80
- return target;
81
- }
82
- function ownKeys$2(object, enumerableOnly) {
83
- var keys = Object.keys(object);
84
- if (Object.getOwnPropertySymbols) {
85
- var symbols = Object.getOwnPropertySymbols(object);
86
- if (enumerableOnly) {
87
- symbols = symbols.filter(function(sym) {
88
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
89
- });
90
- }
91
- keys.push.apply(keys, symbols);
92
- }
93
- return keys;
94
- }
95
- function _object_spread_props$2(target, source) {
96
- source = source != null ? source : {};
97
- if (Object.getOwnPropertyDescriptors) {
98
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
99
- } else {
100
- ownKeys$2(Object(source)).forEach(function(key) {
101
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
102
- });
103
- }
104
- return target;
105
- }
106
53
  function _sliced_to_array$2(arr, i) {
107
54
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
108
55
  }
109
- function _tagged_template_literal$2(strings, raw) {
110
- if (!raw) {
111
- raw = strings.slice(0);
112
- }
113
- return Object.freeze(Object.defineProperties(strings, {
114
- raw: {
115
- value: Object.freeze(raw)
116
- }
117
- }));
118
- }
119
56
  function _to_consumable_array(arr) {
120
57
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread();
121
58
  }
@@ -127,17 +64,6 @@ function _unsupported_iterable_to_array$2(o, minLen) {
127
64
  if (n === "Map" || n === "Set") return Array.from(n);
128
65
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
129
66
  }
130
- function _templateObject$2() {
131
- var data = _tagged_template_literal$2([
132
- "{bold {yellow [ ",
133
- " ]: getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ",
134
- " }}"
135
- ]);
136
- _templateObject$2 = function _templateObject() {
137
- return data;
138
- };
139
- return data;
140
- }
141
67
  function getSharedModuleName(name) {
142
68
  var _name_split = _sliced_to_array$2(name.split(" "), 5); _name_split[0]; _name_split[1]; _name_split[2]; _name_split[3]; var sharedInfo = _name_split[4];
143
69
  return sharedInfo.split("@").slice(0, -1).join("@");
@@ -389,45 +315,6 @@ function getFileName(manifestOptions) {
389
315
  manifestFileName: simpleJoinRemoteEntry(filePath, manifestFileName)
390
316
  };
391
317
  }
392
- function getTypesMetaInfo(pluginOptions, context) {
393
- var defaultRemoteOptions = {
394
- generateAPITypes: true,
395
- compileInChildProcess: true
396
- };
397
- var defaultTypesMetaInfo = {
398
- path: "",
399
- name: "",
400
- zip: "",
401
- api: ""
402
- };
403
- try {
404
- var normalizedDtsOptions = normalizeOptions(true, {
405
- disableGenerateTypes: false,
406
- remote: defaultRemoteOptions,
407
- host: {}
408
- }, "mfOptions.dts")(pluginOptions.dts);
409
- if (normalizedDtsOptions === false) {
410
- return defaultTypesMetaInfo;
411
- }
412
- var normalizedRemote = normalizeOptions(true, defaultRemoteOptions, "mfOptions.dts.remote")(normalizedDtsOptions.remote);
413
- if (normalizedRemote === false) {
414
- return defaultTypesMetaInfo;
415
- }
416
- var _retrieveTypesAssetsInfo = retrieveTypesAssetsInfo(_object_spread_props$2(_object_spread$3({}, normalizedRemote), {
417
- context: context,
418
- moduleFederationConfig: pluginOptions
419
- })), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName;
420
- return {
421
- path: "",
422
- name: "",
423
- zip: zipName,
424
- api: apiFileName
425
- };
426
- } catch (err) {
427
- console.warn(chalk(_templateObject$2(), PLUGIN_IDENTIFIER, err));
428
- return defaultTypesMetaInfo;
429
- }
430
- }
431
318
 
432
319
  function _class_call_check$3(instance, Constructor) {
433
320
  if (!(instance instanceof Constructor)) {
@@ -1240,7 +1127,7 @@ function _ts_generator$1(thisArg, body) {
1240
1127
  }
1241
1128
  function _templateObject() {
1242
1129
  var data = _tagged_template_literal([
1243
- "{bold {yellow [ ",
1130
+ "{bold {red [ ",
1244
1131
  " ]: Manifest will not generate, because publicPath can only be string, but got '",
1245
1132
  "' }}"
1246
1133
  ]);
@@ -1251,7 +1138,7 @@ function _templateObject() {
1251
1138
  }
1252
1139
  function _templateObject1() {
1253
1140
  var data = _tagged_template_literal([
1254
- "{bold {yellow [ ",
1141
+ "{bold {red [ ",
1255
1142
  " ]: Manifest will not generate, because publicPath can only be absolute path, but got '",
1256
1143
  "'}}"
1257
1144
  ]);
@@ -1325,7 +1212,10 @@ var StatsManager = /*#__PURE__*/ function() {
1325
1212
  // same as the types supported by runtime, currently only global/var/script is supported
1326
1213
  type: "global"
1327
1214
  },
1328
- types: getTypesMetaInfo(this._options, compiler.context),
1215
+ types: {
1216
+ name: "",
1217
+ path: ""
1218
+ },
1329
1219
  globalName: globalName,
1330
1220
  pluginVersion: this._pluginVersion
1331
1221
  };
@@ -1593,7 +1483,7 @@ var StatsManager = /*#__PURE__*/ function() {
1593
1483
  value: function generateStats(compiler, compilation, extraOptions) {
1594
1484
  var _this = this;
1595
1485
  return _async_to_generator$1(function() {
1596
- var existedStats, _this__options, tmp, manifestOptions, stats, ret, err;
1486
+ var _this__options, tmp, manifestOptions, stats, ret, err;
1597
1487
  return _ts_generator$1(this, function(_state) {
1598
1488
  switch(_state.label){
1599
1489
  case 0:
@@ -1603,13 +1493,6 @@ var StatsManager = /*#__PURE__*/ function() {
1603
1493
  ,
1604
1494
  5
1605
1495
  ]);
1606
- existedStats = compilation.getAsset(_this.fileName);
1607
- if (existedStats) {
1608
- return [
1609
- 2,
1610
- JSON.parse(existedStats.source.source().toString())
1611
- ];
1612
- }
1613
1496
  _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
1614
1497
  return [
1615
1498
  4,
@@ -1658,10 +1541,10 @@ var StatsManager = /*#__PURE__*/ function() {
1658
1541
  value: function validate(compiler) {
1659
1542
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1660
1543
  if (typeof publicPath !== "string") {
1661
- console.warn(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1544
+ console.error(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1662
1545
  return false;
1663
1546
  } else if (publicPath === "auto") {
1664
- console.warn(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1547
+ console.error(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1665
1548
  return false;
1666
1549
  }
1667
1550
  return true;
package/dist/package.json CHANGED
@@ -23,7 +23,6 @@
23
23
  "types": "./dist/index.cjs.d.ts",
24
24
  "dependencies": {
25
25
  "@module-federation/sdk": "workspace:*",
26
- "@module-federation/dts-kit": "workspace:*",
27
26
  "@module-federation/managers": "workspace:*",
28
27
  "find-pkg": "2.0.0",
29
28
  "chalk": "3.0.0"
@@ -1,5 +1,5 @@
1
1
  import { Chunk, Compilation, StatsCompilation, StatsModule } from 'webpack';
2
- import { StatsAssets, moduleFederationPlugin, MetaDataTypes } from '@module-federation/sdk';
2
+ import { StatsAssets, moduleFederationPlugin } from '@module-federation/sdk';
3
3
  export declare function getAssetsByChunkIDs(compilation: Compilation, chunkIDMap: Record<string, Set<string | number>>): Record<string, {
4
4
  js: string[];
5
5
  css: string[];
@@ -15,4 +15,3 @@ export declare function getFileName(manifestOptions?: moduleFederationPlugin.Mod
15
15
  statsFileName: string;
16
16
  manifestFileName: string;
17
17
  };
18
- export declare function getTypesMetaInfo(pluginOptions: moduleFederationPlugin.ModuleFederationPluginOptions, context: string): MetaDataTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.0.0-next-20240401084119",
3
+ "version": "0.0.0-next-20240402000503",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -24,9 +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-20240401084119",
28
- "@module-federation/dts-kit": "0.0.0-next-20240401084119",
29
- "@module-federation/managers": "0.0.0-next-20240401084119"
27
+ "@module-federation/sdk": "0.0.0-next-20240402000503",
28
+ "@module-federation/managers": "0.0.0-next-20240402000503"
30
29
  },
31
30
  "exports": {
32
31
  ".": {