@module-federation/manifest 0.0.0-perf-devtools-20260108034446 → 0.0.0-perf-website-code-usage-20260914033703

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.
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ // The require scope
10
+ var __webpack_require__ = {};
11
+
12
+ // webpack/runtime/compat_get_default_export
13
+ (() => {
14
+ // getDefaultExport function for compatibility with non-ESM modules
15
+ __webpack_require__.n = (module) => {
16
+ var getter = module && module.__esModule ?
17
+ () => (module['default']) :
18
+ () => (module);
19
+ __webpack_require__.d(getter, { a: getter });
20
+ return getter;
21
+ };
22
+
23
+ })();
24
+ // webpack/runtime/define_property_getters
25
+ (() => {
26
+ __webpack_require__.d = (exports, getters, values) => {
27
+ var define = (defs, kind) => {
28
+ for(var key in defs) {
29
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
30
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
31
+ }
32
+ }
33
+ };
34
+ define(getters, "get");
35
+ define(values, "value");
36
+ };
37
+ })();
38
+ // webpack/runtime/has_own_property
39
+ (() => {
40
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
41
+ })();
42
+ // webpack/runtime/make_namespace_object
43
+ (() => {
44
+ // define __esModule on exports
45
+ __webpack_require__.r = (exports) => {
46
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ }
49
+ Object.defineProperty(exports, '__esModule', { value: true });
50
+ };
51
+ })();
52
+ var __webpack_exports__ = {};
53
+ // ESM COMPAT FLAG
54
+ __webpack_require__.r(__webpack_exports__);
55
+
56
+ // EXPORTS
57
+ __webpack_require__.d(__webpack_exports__, {
58
+ ManifestManager: () => (/* binding */ ManifestManager)
59
+ });
60
+
61
+ ;// CONCATENATED MODULE: external "node:util"
62
+ const external_node_util_namespaceObject = require("node:util");
63
+ ;// CONCATENATED MODULE: external "@module-federation/sdk"
64
+ const sdk_namespaceObject = require("@module-federation/sdk");
65
+ ;// CONCATENATED MODULE: external "./utils.js"
66
+ const external_utils_js_namespaceObject = require("./utils.js");
67
+ ;// CONCATENATED MODULE: external "./logger.js"
68
+ const external_logger_js_namespaceObject = require("./logger.js");
69
+ var external_logger_js_default = /*#__PURE__*/__webpack_require__.n(external_logger_js_namespaceObject);
70
+ ;// CONCATENATED MODULE: ./src/ManifestManager.ts
71
+
72
+
73
+
74
+
75
+ class ManifestManager {
76
+ init(options) {
77
+ this._options = options;
78
+ }
79
+ get fileName() {
80
+ return (0,sdk_namespaceObject.getManifestFileName)(this._options.manifest).manifestFileName;
81
+ }
82
+ updateManifest(options) {
83
+ const manifest = this.generateManifest(options);
84
+ return manifest;
85
+ }
86
+ generateManifest(options) {
87
+ const { publicPath, stats, compiler } = options;
88
+ // Initialize manifest with required properties from stats
89
+ const { id, name, metaData } = stats;
90
+ if (metaData.buildInfo) {
91
+ 'target' in metaData.buildInfo && delete metaData.buildInfo.target;
92
+ 'plugins' in metaData.buildInfo && delete metaData.buildInfo.plugins;
93
+ }
94
+ const manifest = {
95
+ id,
96
+ name,
97
+ metaData,
98
+ shared: [],
99
+ remotes: [],
100
+ exposes: []
101
+ };
102
+ manifest.exposes = stats.exposes.reduce((sum, cur)=>{
103
+ const expose = {
104
+ id: cur.id,
105
+ name: cur.name,
106
+ assets: cur.assets,
107
+ path: cur.path
108
+ };
109
+ sum.push(expose);
110
+ return sum;
111
+ }, []);
112
+ manifest.shared = stats.shared.reduce((sum, cur)=>{
113
+ const shared = {
114
+ id: cur.id,
115
+ name: cur.name,
116
+ version: cur.version,
117
+ singleton: cur.singleton,
118
+ requiredVersion: cur.requiredVersion,
119
+ hash: cur.hash,
120
+ assets: cur.assets,
121
+ fallback: cur.fallback,
122
+ fallbackName: cur.fallbackName,
123
+ fallbackType: cur.fallbackType
124
+ };
125
+ sum.push(shared);
126
+ return sum;
127
+ }, []);
128
+ manifest.remotes = stats.remotes.reduce((sum, cur)=>{
129
+ // @ts-ignore version/entry will be added as follow
130
+ const remote = {
131
+ federationContainerName: cur.federationContainerName,
132
+ moduleName: cur.moduleName,
133
+ alias: cur.alias
134
+ };
135
+ if ('entry' in cur) {
136
+ // @ts-ignore
137
+ remote.entry = cur.entry;
138
+ } else if ('version' in cur) {
139
+ // @ts-ignore
140
+ remote.entry = cur.version;
141
+ }
142
+ sum.push(remote);
143
+ return sum;
144
+ }, []);
145
+ if ((0,external_utils_js_namespaceObject.isDev)() && (process.env['MF_SSR_PRJ'] ? compiler.options.target !== 'async-node' : true)) {
146
+ external_logger_js_default().info(`Manifest Link: ${(0,external_node_util_namespaceObject.styleText)('cyan', `${publicPath === 'auto' ? '{auto}/' : publicPath}${this.fileName}`)} `);
147
+ }
148
+ return manifest;
149
+ }
150
+ constructor(){
151
+ this._options = {};
152
+ }
153
+ }
154
+
155
+
156
+ exports.ManifestManager = __webpack_exports__.ManifestManager;
157
+ for(var __rspack_i in __webpack_exports__) {
158
+ if(["ManifestManager"].indexOf(__rspack_i) === -1) {
159
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
160
+ }
161
+ }
162
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,95 @@
1
+ import { styleText } from "node:util";
2
+ import { getManifestFileName } from "@module-federation/sdk";
3
+ import { isDev } from "./utils.mjs";
4
+ import logger from "./logger.mjs";
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+ class ManifestManager {
15
+ init(options) {
16
+ this._options = options;
17
+ }
18
+ get fileName() {
19
+ return getManifestFileName(this._options.manifest).manifestFileName;
20
+ }
21
+ updateManifest(options) {
22
+ const manifest = this.generateManifest(options);
23
+ return manifest;
24
+ }
25
+ generateManifest(options) {
26
+ const { publicPath, stats, compiler } = options;
27
+ // Initialize manifest with required properties from stats
28
+ const { id, name, metaData } = stats;
29
+ if (metaData.buildInfo) {
30
+ 'target' in metaData.buildInfo && delete metaData.buildInfo.target;
31
+ 'plugins' in metaData.buildInfo && delete metaData.buildInfo.plugins;
32
+ }
33
+ const manifest = {
34
+ id,
35
+ name,
36
+ metaData,
37
+ shared: [],
38
+ remotes: [],
39
+ exposes: []
40
+ };
41
+ manifest.exposes = stats.exposes.reduce((sum, cur)=>{
42
+ const expose = {
43
+ id: cur.id,
44
+ name: cur.name,
45
+ assets: cur.assets,
46
+ path: cur.path
47
+ };
48
+ sum.push(expose);
49
+ return sum;
50
+ }, []);
51
+ manifest.shared = stats.shared.reduce((sum, cur)=>{
52
+ const shared = {
53
+ id: cur.id,
54
+ name: cur.name,
55
+ version: cur.version,
56
+ singleton: cur.singleton,
57
+ requiredVersion: cur.requiredVersion,
58
+ hash: cur.hash,
59
+ assets: cur.assets,
60
+ fallback: cur.fallback,
61
+ fallbackName: cur.fallbackName,
62
+ fallbackType: cur.fallbackType
63
+ };
64
+ sum.push(shared);
65
+ return sum;
66
+ }, []);
67
+ manifest.remotes = stats.remotes.reduce((sum, cur)=>{
68
+ // @ts-ignore version/entry will be added as follow
69
+ const remote = {
70
+ federationContainerName: cur.federationContainerName,
71
+ moduleName: cur.moduleName,
72
+ alias: cur.alias
73
+ };
74
+ if ('entry' in cur) {
75
+ // @ts-ignore
76
+ remote.entry = cur.entry;
77
+ } else if ('version' in cur) {
78
+ // @ts-ignore
79
+ remote.entry = cur.version;
80
+ }
81
+ sum.push(remote);
82
+ return sum;
83
+ }, []);
84
+ if (isDev() && (process.env['MF_SSR_PRJ'] ? compiler.options.target !== 'async-node' : true)) {
85
+ logger.info(`Manifest Link: ${styleText('cyan', `${publicPath === 'auto' ? '{auto}/' : publicPath}${this.fileName}`)} `);
86
+ }
87
+ return manifest;
88
+ }
89
+ constructor(){
90
+ this._options = {};
91
+ }
92
+ }
93
+
94
+
95
+ export { ManifestManager };
@@ -1,5 +1,5 @@
1
1
  import { StatsExpose, StatsRemote, StatsShared, moduleFederationPlugin } from '@module-federation/sdk';
2
- import type { StatsModule } from 'webpack';
2
+ import type { StatsModule } from 'webpack/lib/stats/DefaultStatsFactoryPlugin';
3
3
  import type managerTypes from '@module-federation/managers';
4
4
  export declare const getExposeName: (exposeKey: string) => string;
5
5
  export declare function getExposeItem({ exposeKey, name, file, }: {