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