@module-federation/manifest 0.6.3 → 0.6.5

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
@@ -2,16 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chalk = require('chalk');
6
5
  var path = require('path');
6
+ var fs = require('fs');
7
+ var chalk = require('chalk');
7
8
  var sdk = require('@module-federation/sdk');
8
9
  var core = require('@module-federation/dts-plugin/core');
9
10
  var managers = require('@module-federation/managers');
10
11
 
11
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
13
 
13
- var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
14
14
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
15
+ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
16
+ var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
15
17
 
16
18
  var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
17
19
  var HOT_UPDATE_SUFFIX = '.hot-update';
@@ -657,7 +659,7 @@ var ManifestManager = /*#__PURE__*/ function() {
657
659
  var extraOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
658
660
  var _this = this;
659
661
  return _async_to_generator$2(function() {
660
- var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, manifestFileName, ret;
662
+ var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, prefetchInterface, prefetchFilePath, existPrefetch, content, manifestFileName, ret;
661
663
  return _ts_generator$2(this, function(_state) {
662
664
  switch(_state.label){
663
665
  case 0:
@@ -704,6 +706,16 @@ var ManifestManager = /*#__PURE__*/ function() {
704
706
  sum.push(remote);
705
707
  return sum;
706
708
  }, []);
709
+ prefetchInterface = false;
710
+ prefetchFilePath = path__default["default"].resolve(compiler.options.context || process.cwd(), "node_modules/.mf/".concat(sdk.encodeName(stats.name), "/").concat(sdk.MFPrefetchCommon.fileName));
711
+ existPrefetch = fs__default["default"].existsSync(prefetchFilePath);
712
+ if (existPrefetch) {
713
+ content = fs__default["default"].readFileSync(prefetchFilePath).toString();
714
+ if (content) {
715
+ prefetchInterface = true;
716
+ }
717
+ }
718
+ stats.metaData.prefetchInterface = prefetchInterface;
707
719
  _this._manifest = manifest;
708
720
  manifestFileName = _this.fileName;
709
721
  if (!additionalData) return [
package/dist/index.esm.js CHANGED
@@ -1,6 +1,7 @@
1
- import chalk from 'chalk';
2
1
  import path from 'path';
3
- import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOptions } from '@module-federation/sdk';
2
+ import fs from 'fs';
3
+ import chalk from 'chalk';
4
+ import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOptions, encodeName, MFPrefetchCommon } from '@module-federation/sdk';
4
5
  import { isTSProject, retrieveTypesAssetsInfo } from '@module-federation/dts-plugin/core';
5
6
  import { RemoteManager, SharedManager, ContainerManager, PKGJsonManager, utils } from '@module-federation/managers';
6
7
 
@@ -648,7 +649,7 @@ var ManifestManager = /*#__PURE__*/ function() {
648
649
  var extraOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
649
650
  var _this = this;
650
651
  return _async_to_generator$2(function() {
651
- var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, manifestFileName, ret;
652
+ var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, prefetchInterface, prefetchFilePath, existPrefetch, content, manifestFileName, ret;
652
653
  return _ts_generator$2(this, function(_state) {
653
654
  switch(_state.label){
654
655
  case 0:
@@ -695,6 +696,16 @@ var ManifestManager = /*#__PURE__*/ function() {
695
696
  sum.push(remote);
696
697
  return sum;
697
698
  }, []);
699
+ prefetchInterface = false;
700
+ prefetchFilePath = path.resolve(compiler.options.context || process.cwd(), "node_modules/.mf/".concat(encodeName(stats.name), "/").concat(MFPrefetchCommon.fileName));
701
+ existPrefetch = fs.existsSync(prefetchFilePath);
702
+ if (existPrefetch) {
703
+ content = fs.readFileSync(prefetchFilePath).toString();
704
+ if (content) {
705
+ prefetchInterface = true;
706
+ }
707
+ }
708
+ stats.metaData.prefetchInterface = prefetchInterface;
698
709
  _this._manifest = manifest;
699
710
  manifestFileName = _this.fileName;
700
711
  if (!additionalData) return [
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
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.3",
28
- "@module-federation/dts-plugin": "0.6.3",
29
- "@module-federation/managers": "0.6.3"
27
+ "@module-federation/sdk": "0.6.5",
28
+ "@module-federation/dts-plugin": "0.6.5",
29
+ "@module-federation/managers": "0.6.5"
30
30
  },
31
31
  "exports": {
32
32
  ".": {