@depup/module-federation__manifest 2.2.2-depup.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present hanric(2heal1)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @depup/module-federation__manifest
2
+
3
+ > Dependency-bumped version of [@module-federation/manifest](https://www.npmjs.com/package/@module-federation/manifest)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/module-federation__manifest
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [@module-federation/manifest](https://www.npmjs.com/package/@module-federation/manifest) @ 2.2.2 |
17
+ | Processed | 2026-03-17 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 1 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | chalk | 3.0.0 | ^5.6.2 |
26
+
27
+ ---
28
+
29
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@module-federation/manifest
30
+
31
+ License inherited from the original package.
package/changes.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "bumped": {
3
+ "chalk": {
4
+ "from": "3.0.0",
5
+ "to": "^5.6.2"
6
+ }
7
+ },
8
+ "timestamp": "2026-03-17T16:32:07.133Z",
9
+ "totalUpdated": 1
10
+ }
package/dist/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present hanric(2heal1)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,18 @@
1
+ import { Stats, Manifest, moduleFederationPlugin } from '@module-federation/sdk';
2
+ import type { Compilation, Compiler } from 'webpack';
3
+ interface GenerateManifestOptions {
4
+ compilation: Compilation;
5
+ stats: Stats;
6
+ publicPath: string;
7
+ compiler: Compiler;
8
+ bundler: 'webpack' | 'rspack';
9
+ additionalData?: moduleFederationPlugin.PluginManifestOptions['additionalData'];
10
+ }
11
+ declare class ManifestManager {
12
+ private _options;
13
+ init(options: moduleFederationPlugin.ModuleFederationPluginOptions): void;
14
+ get fileName(): string;
15
+ updateManifest(options: GenerateManifestOptions): Manifest;
16
+ generateManifest(options: GenerateManifestOptions): Manifest;
17
+ }
18
+ export { ManifestManager };
@@ -0,0 +1,161 @@
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
+ /************************************************************************/
13
+ // webpack/runtime/compat_get_default_export
14
+ (() => {
15
+ // getDefaultExport function for compatibility with non-ESM modules
16
+ __webpack_require__.n = (module) => {
17
+ var getter = module && module.__esModule ?
18
+ () => (module['default']) :
19
+ () => (module);
20
+ __webpack_require__.d(getter, { a: getter });
21
+ return getter;
22
+ };
23
+
24
+ })();
25
+ // webpack/runtime/define_property_getters
26
+ (() => {
27
+ __webpack_require__.d = (exports, definition) => {
28
+ for(var key in definition) {
29
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
30
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
31
+ }
32
+ }
33
+ };
34
+ })();
35
+ // webpack/runtime/has_own_property
36
+ (() => {
37
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
38
+ })();
39
+ // webpack/runtime/make_namespace_object
40
+ (() => {
41
+ // define __esModule on exports
42
+ __webpack_require__.r = (exports) => {
43
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
44
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
45
+ }
46
+ Object.defineProperty(exports, '__esModule', { value: true });
47
+ };
48
+ })();
49
+ /************************************************************************/
50
+ var __webpack_exports__ = {};
51
+ // ESM COMPAT FLAG
52
+ __webpack_require__.r(__webpack_exports__);
53
+
54
+ // EXPORTS
55
+ __webpack_require__.d(__webpack_exports__, {
56
+ ManifestManager: () => (/* binding */ ManifestManager)
57
+ });
58
+
59
+ ;// CONCATENATED MODULE: external "chalk"
60
+ const external_chalk_namespaceObject = require("chalk");
61
+ var external_chalk_default = /*#__PURE__*/__webpack_require__.n(external_chalk_namespaceObject);
62
+ ;// CONCATENATED MODULE: external "@module-federation/sdk"
63
+ const sdk_namespaceObject = require("@module-federation/sdk");
64
+ ;// CONCATENATED MODULE: external "./utils.js"
65
+ const external_utils_js_namespaceObject = require("./utils.js");
66
+ ;// CONCATENATED MODULE: external "./logger.js"
67
+ const external_logger_js_namespaceObject = require("./logger.js");
68
+ var external_logger_js_default = /*#__PURE__*/__webpack_require__.n(external_logger_js_namespaceObject);
69
+ ;// CONCATENATED MODULE: ./src/ManifestManager.ts
70
+
71
+
72
+
73
+
74
+ class ManifestManager {
75
+ init(options) {
76
+ this._options = options;
77
+ }
78
+ get fileName() {
79
+ return (0,sdk_namespaceObject.getManifestFileName)(this._options.manifest).manifestFileName;
80
+ }
81
+ updateManifest(options) {
82
+ const manifest = this.generateManifest(options);
83
+ return manifest;
84
+ }
85
+ generateManifest(options) {
86
+ const { publicPath, stats, compiler } = options;
87
+ // Initialize manifest with required properties from stats
88
+ const { id, name, metaData } = stats;
89
+ if (metaData.buildInfo) {
90
+ 'target' in metaData.buildInfo && delete metaData.buildInfo.target;
91
+ 'plugins' in metaData.buildInfo && delete metaData.buildInfo.plugins;
92
+ }
93
+ const manifest = {
94
+ id,
95
+ name,
96
+ metaData,
97
+ shared: [],
98
+ remotes: [],
99
+ exposes: []
100
+ };
101
+ manifest.exposes = stats.exposes.reduce((sum, cur)=>{
102
+ const expose = {
103
+ id: cur.id,
104
+ name: cur.name,
105
+ assets: cur.assets,
106
+ path: cur.path
107
+ };
108
+ sum.push(expose);
109
+ return sum;
110
+ }, []);
111
+ manifest.shared = stats.shared.reduce((sum, cur)=>{
112
+ const shared = {
113
+ id: cur.id,
114
+ name: cur.name,
115
+ version: cur.version,
116
+ singleton: cur.singleton,
117
+ requiredVersion: cur.requiredVersion,
118
+ hash: cur.hash,
119
+ assets: cur.assets,
120
+ fallback: cur.fallback,
121
+ fallbackName: cur.fallbackName,
122
+ fallbackType: cur.fallbackType
123
+ };
124
+ sum.push(shared);
125
+ return sum;
126
+ }, []);
127
+ manifest.remotes = stats.remotes.reduce((sum, cur)=>{
128
+ // @ts-ignore version/entry will be added as follow
129
+ const remote = {
130
+ federationContainerName: cur.federationContainerName,
131
+ moduleName: cur.moduleName,
132
+ alias: cur.alias
133
+ };
134
+ if ('entry' in cur) {
135
+ // @ts-ignore
136
+ remote.entry = cur.entry;
137
+ } else if ('version' in cur) {
138
+ // @ts-ignore
139
+ remote.entry = cur.version;
140
+ }
141
+ sum.push(remote);
142
+ return sum;
143
+ }, []);
144
+ if ((0,external_utils_js_namespaceObject.isDev)() && (process.env['MF_SSR_PRJ'] ? compiler.options.target !== 'async-node' : true)) {
145
+ external_logger_js_default().info(`Manifest Link: ${external_chalk_default().cyan(`${publicPath === 'auto' ? '{auto}/' : publicPath}${this.fileName}`)} `);
146
+ }
147
+ return manifest;
148
+ }
149
+ constructor(){
150
+ this._options = {};
151
+ }
152
+ }
153
+
154
+
155
+ exports.ManifestManager = __webpack_exports__.ManifestManager;
156
+ for(var __webpack_i__ in __webpack_exports__) {
157
+ if(["ManifestManager"].indexOf(__webpack_i__) === -1) {
158
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
159
+ }
160
+ }
161
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,100 @@
1
+ import chalk from "chalk";
2
+ import { getManifestFileName } from "@module-federation/sdk";
3
+ import { isDev } from "./utils.mjs";
4
+ import logger from "./logger.mjs";
5
+
6
+ ;// CONCATENATED MODULE: external "chalk"
7
+
8
+ ;// CONCATENATED MODULE: external "@module-federation/sdk"
9
+
10
+ ;// CONCATENATED MODULE: external "./utils.mjs"
11
+
12
+ ;// CONCATENATED MODULE: external "./logger.mjs"
13
+
14
+ ;// CONCATENATED MODULE: ./src/ManifestManager.ts
15
+
16
+
17
+
18
+
19
+ class ManifestManager {
20
+ init(options) {
21
+ this._options = options;
22
+ }
23
+ get fileName() {
24
+ return getManifestFileName(this._options.manifest).manifestFileName;
25
+ }
26
+ updateManifest(options) {
27
+ const manifest = this.generateManifest(options);
28
+ return manifest;
29
+ }
30
+ generateManifest(options) {
31
+ const { publicPath, stats, compiler } = options;
32
+ // Initialize manifest with required properties from stats
33
+ const { id, name, metaData } = stats;
34
+ if (metaData.buildInfo) {
35
+ 'target' in metaData.buildInfo && delete metaData.buildInfo.target;
36
+ 'plugins' in metaData.buildInfo && delete metaData.buildInfo.plugins;
37
+ }
38
+ const manifest = {
39
+ id,
40
+ name,
41
+ metaData,
42
+ shared: [],
43
+ remotes: [],
44
+ exposes: []
45
+ };
46
+ manifest.exposes = stats.exposes.reduce((sum, cur)=>{
47
+ const expose = {
48
+ id: cur.id,
49
+ name: cur.name,
50
+ assets: cur.assets,
51
+ path: cur.path
52
+ };
53
+ sum.push(expose);
54
+ return sum;
55
+ }, []);
56
+ manifest.shared = stats.shared.reduce((sum, cur)=>{
57
+ const shared = {
58
+ id: cur.id,
59
+ name: cur.name,
60
+ version: cur.version,
61
+ singleton: cur.singleton,
62
+ requiredVersion: cur.requiredVersion,
63
+ hash: cur.hash,
64
+ assets: cur.assets,
65
+ fallback: cur.fallback,
66
+ fallbackName: cur.fallbackName,
67
+ fallbackType: cur.fallbackType
68
+ };
69
+ sum.push(shared);
70
+ return sum;
71
+ }, []);
72
+ manifest.remotes = stats.remotes.reduce((sum, cur)=>{
73
+ // @ts-ignore version/entry will be added as follow
74
+ const remote = {
75
+ federationContainerName: cur.federationContainerName,
76
+ moduleName: cur.moduleName,
77
+ alias: cur.alias
78
+ };
79
+ if ('entry' in cur) {
80
+ // @ts-ignore
81
+ remote.entry = cur.entry;
82
+ } else if ('version' in cur) {
83
+ // @ts-ignore
84
+ remote.entry = cur.version;
85
+ }
86
+ sum.push(remote);
87
+ return sum;
88
+ }, []);
89
+ if (isDev() && (process.env['MF_SSR_PRJ'] ? compiler.options.target !== 'async-node' : true)) {
90
+ logger.info(`Manifest Link: ${chalk.cyan(`${publicPath === 'auto' ? '{auto}/' : publicPath}${this.fileName}`)} `);
91
+ }
92
+ return manifest;
93
+ }
94
+ constructor(){
95
+ this._options = {};
96
+ }
97
+ }
98
+
99
+
100
+ export { ManifestManager };
@@ -0,0 +1,44 @@
1
+ import { StatsExpose, StatsRemote, StatsShared, moduleFederationPlugin } from '@module-federation/sdk';
2
+ import type { StatsModule } from '../../../webpack/lib/stats/DefaultStatsFactoryPlugin.d';
3
+ import type managerTypes from '@module-federation/managers';
4
+ export declare const getExposeName: (exposeKey: string) => string;
5
+ export declare function getExposeItem({ exposeKey, name, file, }: {
6
+ exposeKey: string;
7
+ name: string;
8
+ file: {
9
+ import: string[];
10
+ };
11
+ }): StatsExpose;
12
+ export declare const getShareItem: ({ pkgName, normalizedShareOptions, pkgVersion, hostName, }: {
13
+ pkgName: string;
14
+ hostName?: string;
15
+ normalizedShareOptions: managerTypes.types.NormalizedSharedOptions[string];
16
+ pkgVersion: string;
17
+ }) => StatsShared;
18
+ declare class ModuleHandler {
19
+ private _options;
20
+ private _bundler;
21
+ private _modules;
22
+ private _containerManager;
23
+ private _remoteManager;
24
+ private _sharedManager;
25
+ constructor(options: moduleFederationPlugin.ModuleFederationPluginOptions, modules: StatsModule[], { bundler }: {
26
+ bundler: 'webpack' | 'rspack';
27
+ });
28
+ get isRspack(): boolean;
29
+ private _handleSharedModule;
30
+ private _handleRemoteModule;
31
+ private _handleContainerModule;
32
+ private _getContainerExposeEntriesFromOptions;
33
+ private _initializeExposesFromOptions;
34
+ collect(): {
35
+ remotes: StatsRemote[];
36
+ exposesMap: {
37
+ [exposeImportValue: string]: StatsExpose;
38
+ };
39
+ sharedMap: {
40
+ [sharedKey: string]: StatsShared;
41
+ };
42
+ };
43
+ }
44
+ export { ModuleHandler };