@module-federation/manifest 0.14.3 → 0.16.0
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 +52 -5
- package/dist/index.esm.js +53 -6
- package/dist/src/ModuleHandler.d.ts +1 -0
- package/dist/src/utils.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -364,7 +364,7 @@ function getFileName(manifestOptions) {
|
|
|
364
364
|
manifestFileName: sdk.simpleJoinRemoteEntry(filePath, manifestFileName)
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
function getTypesMetaInfo(pluginOptions, context
|
|
367
|
+
function getTypesMetaInfo(pluginOptions, context) {
|
|
368
368
|
var defaultRemoteOptions = {
|
|
369
369
|
generateAPITypes: true,
|
|
370
370
|
compileInChildProcess: true
|
|
@@ -672,7 +672,7 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
672
672
|
if (!disableEmit) {
|
|
673
673
|
compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
|
|
674
674
|
}
|
|
675
|
-
if (isDev()) {
|
|
675
|
+
if (isDev() && (process.env['MF_SSR_PRJ'] ? compiler.options.target !== 'async-node' : true)) {
|
|
676
676
|
logger.info("Manifest Link: ".concat(chalk.cyan("".concat(publicPath === 'auto' ? '{auto}/' : publicPath).concat(manifestFileName)), " "));
|
|
677
677
|
}
|
|
678
678
|
return [
|
|
@@ -802,12 +802,15 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
802
802
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
803
803
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
804
804
|
}
|
|
805
|
+
var getExposeName = function(exposeKey) {
|
|
806
|
+
return exposeKey.replace('./', '');
|
|
807
|
+
};
|
|
805
808
|
function getExposeItem(param) {
|
|
806
809
|
var exposeKey = param.exposeKey, name = param.name, file = param.file;
|
|
807
|
-
var exposeModuleName = exposeKey
|
|
810
|
+
var exposeModuleName = getExposeName(exposeKey);
|
|
808
811
|
return {
|
|
809
812
|
path: exposeKey,
|
|
810
|
-
id:
|
|
813
|
+
id: sdk.composeKeyWithSeparator(name, exposeModuleName),
|
|
811
814
|
name: exposeModuleName,
|
|
812
815
|
// @ts-ignore to deduplicate
|
|
813
816
|
requires: new Set(),
|
|
@@ -1685,7 +1688,51 @@ var StatsManager = /*#__PURE__*/ function() {
|
|
|
1685
1688
|
});
|
|
1686
1689
|
return sum;
|
|
1687
1690
|
}, new Set());
|
|
1688
|
-
|
|
1691
|
+
var fileExposeKeyMap = _this._containerManager.fileExposeKeyMap;
|
|
1692
|
+
stats.exposes = [];
|
|
1693
|
+
Object.entries(fileExposeKeyMap).forEach(function(param) {
|
|
1694
|
+
var _param = _sliced_to_array(param, 2), exposeFileWithoutExt = _param[0], exposeKeySet = _param[1];
|
|
1695
|
+
var expose = exposesMap[exposeFileWithoutExt] || {
|
|
1696
|
+
assets: {
|
|
1697
|
+
js: {
|
|
1698
|
+
sync: [],
|
|
1699
|
+
async: []
|
|
1700
|
+
},
|
|
1701
|
+
css: {
|
|
1702
|
+
sync: [],
|
|
1703
|
+
async: []
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
exposeKeySet.forEach(function(exposeKey) {
|
|
1708
|
+
var _expose_assets = expose.assets, js = _expose_assets.js, css = _expose_assets.css;
|
|
1709
|
+
var exposeModuleName = getExposeName(exposeKey);
|
|
1710
|
+
stats.exposes.push(_object_spread_props(_object_spread({}, expose), {
|
|
1711
|
+
path: exposeKey,
|
|
1712
|
+
id: sdk.composeKeyWithSeparator(_this._options.name, exposeModuleName),
|
|
1713
|
+
name: exposeModuleName,
|
|
1714
|
+
assets: {
|
|
1715
|
+
js: {
|
|
1716
|
+
sync: js.sync.filter(function(asset) {
|
|
1717
|
+
return !sharedAssets.has(asset);
|
|
1718
|
+
}),
|
|
1719
|
+
async: js.async.filter(function(asset) {
|
|
1720
|
+
return !sharedAssets.has(asset);
|
|
1721
|
+
})
|
|
1722
|
+
},
|
|
1723
|
+
css: {
|
|
1724
|
+
sync: css.sync.filter(function(asset) {
|
|
1725
|
+
return !sharedAssets.has(asset);
|
|
1726
|
+
}),
|
|
1727
|
+
async: css.async.filter(function(asset) {
|
|
1728
|
+
return !sharedAssets.has(asset);
|
|
1729
|
+
})
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
}));
|
|
1733
|
+
});
|
|
1734
|
+
});
|
|
1735
|
+
Object.values(exposesMap).map(function(expose) {
|
|
1689
1736
|
var _expose_assets = expose.assets, js = _expose_assets.js, css = _expose_assets.css;
|
|
1690
1737
|
return _object_spread_props(_object_spread({}, expose), {
|
|
1691
1738
|
assets: {
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { createLogger, ManifestFileName, StatsFileName, simpleJoinRemoteEntry, normalizeOptions, encodeName, MFPrefetchCommon } from '@module-federation/sdk';
|
|
3
|
+
import { createLogger, ManifestFileName, StatsFileName, simpleJoinRemoteEntry, normalizeOptions, composeKeyWithSeparator, encodeName, MFPrefetchCommon } from '@module-federation/sdk';
|
|
4
4
|
import { isTSProject, retrieveTypesAssetsInfo } from '@module-federation/dts-plugin/core';
|
|
5
5
|
import fs from 'fs';
|
|
6
6
|
import { RemoteManager, SharedManager, ContainerManager, PKGJsonManager, utils } from '@module-federation/managers';
|
|
@@ -362,7 +362,7 @@ function getFileName(manifestOptions) {
|
|
|
362
362
|
manifestFileName: simpleJoinRemoteEntry(filePath, manifestFileName)
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function getTypesMetaInfo(pluginOptions, context
|
|
365
|
+
function getTypesMetaInfo(pluginOptions, context) {
|
|
366
366
|
var defaultRemoteOptions = {
|
|
367
367
|
generateAPITypes: true,
|
|
368
368
|
compileInChildProcess: true
|
|
@@ -670,7 +670,7 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
670
670
|
if (!disableEmit) {
|
|
671
671
|
compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
|
|
672
672
|
}
|
|
673
|
-
if (isDev()) {
|
|
673
|
+
if (isDev() && (process.env['MF_SSR_PRJ'] ? compiler.options.target !== 'async-node' : true)) {
|
|
674
674
|
logger.info("Manifest Link: ".concat(chalk.cyan("".concat(publicPath === 'auto' ? '{auto}/' : publicPath).concat(manifestFileName)), " "));
|
|
675
675
|
}
|
|
676
676
|
return [
|
|
@@ -800,12 +800,15 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
800
800
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
801
801
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
802
802
|
}
|
|
803
|
+
var getExposeName = function(exposeKey) {
|
|
804
|
+
return exposeKey.replace('./', '');
|
|
805
|
+
};
|
|
803
806
|
function getExposeItem(param) {
|
|
804
807
|
var exposeKey = param.exposeKey, name = param.name, file = param.file;
|
|
805
|
-
var exposeModuleName = exposeKey
|
|
808
|
+
var exposeModuleName = getExposeName(exposeKey);
|
|
806
809
|
return {
|
|
807
810
|
path: exposeKey,
|
|
808
|
-
id:
|
|
811
|
+
id: composeKeyWithSeparator(name, exposeModuleName),
|
|
809
812
|
name: exposeModuleName,
|
|
810
813
|
// @ts-ignore to deduplicate
|
|
811
814
|
requires: new Set(),
|
|
@@ -1683,7 +1686,51 @@ var StatsManager = /*#__PURE__*/ function() {
|
|
|
1683
1686
|
});
|
|
1684
1687
|
return sum;
|
|
1685
1688
|
}, new Set());
|
|
1686
|
-
|
|
1689
|
+
var fileExposeKeyMap = _this._containerManager.fileExposeKeyMap;
|
|
1690
|
+
stats.exposes = [];
|
|
1691
|
+
Object.entries(fileExposeKeyMap).forEach(function(param) {
|
|
1692
|
+
var _param = _sliced_to_array(param, 2), exposeFileWithoutExt = _param[0], exposeKeySet = _param[1];
|
|
1693
|
+
var expose = exposesMap[exposeFileWithoutExt] || {
|
|
1694
|
+
assets: {
|
|
1695
|
+
js: {
|
|
1696
|
+
sync: [],
|
|
1697
|
+
async: []
|
|
1698
|
+
},
|
|
1699
|
+
css: {
|
|
1700
|
+
sync: [],
|
|
1701
|
+
async: []
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
exposeKeySet.forEach(function(exposeKey) {
|
|
1706
|
+
var _expose_assets = expose.assets, js = _expose_assets.js, css = _expose_assets.css;
|
|
1707
|
+
var exposeModuleName = getExposeName(exposeKey);
|
|
1708
|
+
stats.exposes.push(_object_spread_props(_object_spread({}, expose), {
|
|
1709
|
+
path: exposeKey,
|
|
1710
|
+
id: composeKeyWithSeparator(_this._options.name, exposeModuleName),
|
|
1711
|
+
name: exposeModuleName,
|
|
1712
|
+
assets: {
|
|
1713
|
+
js: {
|
|
1714
|
+
sync: js.sync.filter(function(asset) {
|
|
1715
|
+
return !sharedAssets.has(asset);
|
|
1716
|
+
}),
|
|
1717
|
+
async: js.async.filter(function(asset) {
|
|
1718
|
+
return !sharedAssets.has(asset);
|
|
1719
|
+
})
|
|
1720
|
+
},
|
|
1721
|
+
css: {
|
|
1722
|
+
sync: css.sync.filter(function(asset) {
|
|
1723
|
+
return !sharedAssets.has(asset);
|
|
1724
|
+
}),
|
|
1725
|
+
async: css.async.filter(function(asset) {
|
|
1726
|
+
return !sharedAssets.has(asset);
|
|
1727
|
+
})
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}));
|
|
1731
|
+
});
|
|
1732
|
+
});
|
|
1733
|
+
Object.values(exposesMap).map(function(expose) {
|
|
1687
1734
|
var _expose_assets = expose.assets, js = _expose_assets.js, css = _expose_assets.css;
|
|
1688
1735
|
return _object_spread_props(_object_spread({}, expose), {
|
|
1689
1736
|
assets: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StatsExpose, StatsRemote, StatsShared, moduleFederationPlugin } from '@module-federation/sdk';
|
|
2
2
|
import type { StatsModule } from 'webpack';
|
|
3
|
+
export declare const getExposeName: (exposeKey: string) => string;
|
|
3
4
|
export declare function getExposeItem({ exposeKey, name, file, }: {
|
|
4
5
|
exposeKey: string;
|
|
5
6
|
name: string;
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -15,4 +15,4 @@ 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
|
|
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.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Provide manifest/stats for webpack/rspack MF project .",
|
|
6
6
|
"keywords": [
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"find-pkg": "2.0.0",
|
|
31
31
|
"chalk": "3.0.0",
|
|
32
|
-
"@module-federation/sdk": "0.
|
|
33
|
-
"@module-federation/dts-plugin": "0.
|
|
34
|
-
"@module-federation/managers": "0.
|
|
32
|
+
"@module-federation/sdk": "0.16.0",
|
|
33
|
+
"@module-federation/dts-plugin": "0.16.0",
|
|
34
|
+
"@module-federation/managers": "0.16.0"
|
|
35
35
|
},
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|