@module-federation/managers 0.0.0-chore-bump-node-22-20260710161714

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,198 @@
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
+ SharedManager: () => (/* binding */ SharedManager)
59
+ });
60
+
61
+ ;// CONCATENATED MODULE: external "empathic/package"
62
+ const package_namespaceObject = require("empathic/package");
63
+ ;// CONCATENATED MODULE: external "path"
64
+ const external_path_namespaceObject = require("path");
65
+ var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_namespaceObject);
66
+ ;// CONCATENATED MODULE: external "fs"
67
+ const external_fs_namespaceObject = require("fs");
68
+ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_namespaceObject);
69
+ ;// CONCATENATED MODULE: external "@module-federation/sdk"
70
+ const sdk_namespaceObject = require("@module-federation/sdk");
71
+ ;// CONCATENATED MODULE: external "./BasicPluginOptionsManager.js"
72
+ const external_BasicPluginOptionsManager_js_namespaceObject = require("./BasicPluginOptionsManager.js");
73
+ ;// CONCATENATED MODULE: external "./utils.js"
74
+ const external_utils_js_namespaceObject = require("./utils.js");
75
+ ;// CONCATENATED MODULE: ./src/SharedManager.ts
76
+
77
+
78
+
79
+
80
+
81
+
82
+ class SharedManager extends external_BasicPluginOptionsManager_js_namespaceObject.BasicPluginOptionsManager {
83
+ get enable() {
84
+ return Boolean(Object.keys(this.sharedPluginOptions.shared).length);
85
+ }
86
+ get sharedPluginOptions() {
87
+ const normalizedShared = this.normalizedOptions;
88
+ const shared = Object.keys(normalizedShared).reduce((sum, cur)=>{
89
+ const { singleton, requiredVersion, version, eager, shareScope, import: sharedImport, treeShaking } = normalizedShared[cur];
90
+ sum[cur] = {
91
+ singleton,
92
+ requiredVersion,
93
+ version,
94
+ eager,
95
+ shareScope,
96
+ import: sharedImport,
97
+ treeShaking
98
+ };
99
+ return sum;
100
+ }, {});
101
+ return {
102
+ shared,
103
+ shareScope: this.options.shareScope || 'default'
104
+ };
105
+ }
106
+ findPkg(name, shareConfig) {
107
+ try {
108
+ let pkgPath = '';
109
+ let depName = name;
110
+ if (shareConfig.import) {
111
+ if (external_path_default().isAbsolute(shareConfig.import)) {
112
+ pkgPath = shareConfig.import;
113
+ } else if (shareConfig.import.startsWith('.')) {
114
+ pkgPath = external_path_default().resolve(this.root, shareConfig.import);
115
+ }
116
+ } else {
117
+ if (shareConfig.packageName) {
118
+ depName = shareConfig.packageName;
119
+ }
120
+ }
121
+ pkgPath = pkgPath || require.resolve(depName, {
122
+ paths: [
123
+ this.root
124
+ ]
125
+ });
126
+ const pkgJsonPath = (0,package_namespaceObject.up)({
127
+ cwd: external_path_default().dirname(pkgPath)
128
+ });
129
+ return {
130
+ pkg: JSON.parse(external_fs_default().readFileSync(pkgJsonPath, 'utf-8')),
131
+ path: '',
132
+ pkgPath: ''
133
+ };
134
+ } catch (err) {
135
+ return {
136
+ pkg: {},
137
+ path: '',
138
+ pkgPath: ''
139
+ };
140
+ }
141
+ }
142
+ get enableTreeShaking() {
143
+ return Object.values(this.normalizedOptions).some((item)=>item.treeShaking);
144
+ }
145
+ transformSharedConfig(sharedConfig) {
146
+ const defaultSharedConfig = {
147
+ singleton: true,
148
+ requiredVersion: undefined,
149
+ shareScope: 'default'
150
+ };
151
+ return {
152
+ ...defaultSharedConfig,
153
+ ...sharedConfig
154
+ };
155
+ }
156
+ normalizeOptions(options) {
157
+ const normalizedShared = {};
158
+ const sharedOptions = (0,external_utils_js_namespaceObject.parseOptions)(options, (item, key)=>{
159
+ if (typeof item !== 'string') throw new Error('Unexpected array in shared');
160
+ const config = item === key || !(0,sdk_namespaceObject.isRequiredVersion)(item) ? {
161
+ import: item
162
+ } : {
163
+ import: key,
164
+ requiredVersion: item
165
+ };
166
+ return config;
167
+ }, (item)=>item);
168
+ sharedOptions.forEach((item)=>{
169
+ const [sharedName, sharedOptions] = item;
170
+ const pkgInfo = this.findPkg(sharedName, sharedOptions);
171
+ const sharedConfig = this.transformSharedConfig(sharedOptions);
172
+ normalizedShared[sharedName] = {
173
+ ...sharedConfig,
174
+ requiredVersion: typeof sharedConfig.requiredVersion !== 'undefined' ? sharedConfig.requiredVersion : `^${pkgInfo.pkg['version']}`,
175
+ name: sharedName,
176
+ version: pkgInfo.pkg['version'],
177
+ eager: Boolean(sharedConfig.eager)
178
+ };
179
+ });
180
+ this.normalizedOptions = normalizedShared;
181
+ }
182
+ init(options) {
183
+ this.setOptions(options);
184
+ this.normalizeOptions(options.shared);
185
+ }
186
+ constructor(...args){
187
+ super(...args), this.normalizedOptions = {};
188
+ }
189
+ }
190
+
191
+
192
+ exports.SharedManager = __webpack_exports__.SharedManager;
193
+ for(var __rspack_i in __webpack_exports__) {
194
+ if(["SharedManager"].indexOf(__rspack_i) === -1) {
195
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
196
+ }
197
+ }
198
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,130 @@
1
+ import { up } from "empathic/package";
2
+ import path from "path";
3
+ import fs from "fs";
4
+ import { isRequiredVersion } from "@module-federation/sdk";
5
+ import { BasicPluginOptionsManager } from "./BasicPluginOptionsManager.mjs";
6
+ import { parseOptions } from "./utils.mjs";
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+ class SharedManager extends BasicPluginOptionsManager {
21
+ get enable() {
22
+ return Boolean(Object.keys(this.sharedPluginOptions.shared).length);
23
+ }
24
+ get sharedPluginOptions() {
25
+ const normalizedShared = this.normalizedOptions;
26
+ const shared = Object.keys(normalizedShared).reduce((sum, cur)=>{
27
+ const { singleton, requiredVersion, version, eager, shareScope, import: sharedImport, treeShaking } = normalizedShared[cur];
28
+ sum[cur] = {
29
+ singleton,
30
+ requiredVersion,
31
+ version,
32
+ eager,
33
+ shareScope,
34
+ import: sharedImport,
35
+ treeShaking
36
+ };
37
+ return sum;
38
+ }, {});
39
+ return {
40
+ shared,
41
+ shareScope: this.options.shareScope || 'default'
42
+ };
43
+ }
44
+ findPkg(name, shareConfig) {
45
+ try {
46
+ let pkgPath = '';
47
+ let depName = name;
48
+ if (shareConfig.import) {
49
+ if (path.isAbsolute(shareConfig.import)) {
50
+ pkgPath = shareConfig.import;
51
+ } else if (shareConfig.import.startsWith('.')) {
52
+ pkgPath = path.resolve(this.root, shareConfig.import);
53
+ }
54
+ } else {
55
+ if (shareConfig.packageName) {
56
+ depName = shareConfig.packageName;
57
+ }
58
+ }
59
+ pkgPath = pkgPath || require.resolve(depName, {
60
+ paths: [
61
+ this.root
62
+ ]
63
+ });
64
+ const pkgJsonPath = up({
65
+ cwd: path.dirname(pkgPath)
66
+ });
67
+ return {
68
+ pkg: JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8')),
69
+ path: '',
70
+ pkgPath: ''
71
+ };
72
+ } catch (err) {
73
+ return {
74
+ pkg: {},
75
+ path: '',
76
+ pkgPath: ''
77
+ };
78
+ }
79
+ }
80
+ get enableTreeShaking() {
81
+ return Object.values(this.normalizedOptions).some((item)=>item.treeShaking);
82
+ }
83
+ transformSharedConfig(sharedConfig) {
84
+ const defaultSharedConfig = {
85
+ singleton: true,
86
+ requiredVersion: undefined,
87
+ shareScope: 'default'
88
+ };
89
+ return {
90
+ ...defaultSharedConfig,
91
+ ...sharedConfig
92
+ };
93
+ }
94
+ normalizeOptions(options) {
95
+ const normalizedShared = {};
96
+ const sharedOptions = parseOptions(options, (item, key)=>{
97
+ if (typeof item !== 'string') throw new Error('Unexpected array in shared');
98
+ const config = item === key || !isRequiredVersion(item) ? {
99
+ import: item
100
+ } : {
101
+ import: key,
102
+ requiredVersion: item
103
+ };
104
+ return config;
105
+ }, (item)=>item);
106
+ sharedOptions.forEach((item)=>{
107
+ const [sharedName, sharedOptions] = item;
108
+ const pkgInfo = this.findPkg(sharedName, sharedOptions);
109
+ const sharedConfig = this.transformSharedConfig(sharedOptions);
110
+ normalizedShared[sharedName] = {
111
+ ...sharedConfig,
112
+ requiredVersion: typeof sharedConfig.requiredVersion !== 'undefined' ? sharedConfig.requiredVersion : `^${pkgInfo.pkg['version']}`,
113
+ name: sharedName,
114
+ version: pkgInfo.pkg['version'],
115
+ eager: Boolean(sharedConfig.eager)
116
+ };
117
+ });
118
+ this.normalizedOptions = normalizedShared;
119
+ }
120
+ init(options) {
121
+ this.setOptions(options);
122
+ this.normalizeOptions(options.shared);
123
+ }
124
+ constructor(...args){
125
+ super(...args), this.normalizedOptions = {};
126
+ }
127
+ }
128
+
129
+
130
+ export { SharedManager };
@@ -0,0 +1,2 @@
1
+ export declare const LOCAL_BUILD_VERSION = "local";
2
+ export declare const UNKNOWN_MODULE_NAME = "UNKNOWN";
@@ -0,0 +1,2 @@
1
+ export declare const LOCAL_BUILD_VERSION = "local";
2
+ export declare const UNKNOWN_MODULE_NAME = "UNKNOWN";
@@ -0,0 +1,58 @@
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/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ __webpack_require__.r(__webpack_exports__);
42
+ const LOCAL_BUILD_VERSION = 'local';
43
+ const UNKNOWN_MODULE_NAME = 'UNKNOWN';
44
+
45
+ __webpack_require__.d(__webpack_exports__, {
46
+ }, {
47
+ LOCAL_BUILD_VERSION: LOCAL_BUILD_VERSION,
48
+ UNKNOWN_MODULE_NAME: UNKNOWN_MODULE_NAME
49
+ });
50
+
51
+ exports.LOCAL_BUILD_VERSION = __webpack_exports__.LOCAL_BUILD_VERSION;
52
+ exports.UNKNOWN_MODULE_NAME = __webpack_exports__.UNKNOWN_MODULE_NAME;
53
+ for(var __rspack_i in __webpack_exports__) {
54
+ if(["LOCAL_BUILD_VERSION","UNKNOWN_MODULE_NAME"].indexOf(__rspack_i) === -1) {
55
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
56
+ }
57
+ }
58
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,4 @@
1
+ const LOCAL_BUILD_VERSION = 'local';
2
+ const UNKNOWN_MODULE_NAME = 'UNKNOWN';
3
+
4
+ export { LOCAL_BUILD_VERSION, UNKNOWN_MODULE_NAME };
@@ -0,0 +1,8 @@
1
+ export { BasicPluginOptionsManager } from './BasicPluginOptionsManager';
2
+ export { ContainerManager } from './ContainerManager';
3
+ export { PKGJsonManager } from './PKGJsonManager';
4
+ export { RemoteManager } from './RemoteManager';
5
+ export { SharedManager } from './SharedManager';
6
+ export { UNKNOWN_MODULE_NAME } from './constant';
7
+ export * as utils from './utils';
8
+ export * as types from './types';
@@ -0,0 +1,8 @@
1
+ export { BasicPluginOptionsManager } from './BasicPluginOptionsManager';
2
+ export { ContainerManager } from './ContainerManager';
3
+ export { PKGJsonManager } from './PKGJsonManager';
4
+ export { RemoteManager } from './RemoteManager';
5
+ export { SharedManager } from './SharedManager';
6
+ export { UNKNOWN_MODULE_NAME } from './constant';
7
+ export * as utils from './utils';
8
+ export * as types from './types';
package/dist/index.js ADDED
@@ -0,0 +1,95 @@
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/define_property_getters
13
+ (() => {
14
+ __webpack_require__.d = (exports, getters, values) => {
15
+ var define = (defs, kind) => {
16
+ for(var key in defs) {
17
+ if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
19
+ }
20
+ }
21
+ };
22
+ define(getters, "get");
23
+ define(values, "value");
24
+ };
25
+ })();
26
+ // webpack/runtime/has_own_property
27
+ (() => {
28
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ })();
30
+ // webpack/runtime/make_namespace_object
31
+ (() => {
32
+ // define __esModule on exports
33
+ __webpack_require__.r = (exports) => {
34
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
35
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36
+ }
37
+ Object.defineProperty(exports, '__esModule', { value: true });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ // ESM COMPAT FLAG
42
+ __webpack_require__.r(__webpack_exports__);
43
+
44
+ // EXPORTS
45
+ __webpack_require__.d(__webpack_exports__, {
46
+ BasicPluginOptionsManager: () => (/* reexport */ external_BasicPluginOptionsManager_js_namespaceObject.BasicPluginOptionsManager),
47
+ ContainerManager: () => (/* reexport */ external_ContainerManager_js_namespaceObject.ContainerManager),
48
+ PKGJsonManager: () => (/* reexport */ external_PKGJsonManager_js_namespaceObject.PKGJsonManager),
49
+ RemoteManager: () => (/* reexport */ external_RemoteManager_js_namespaceObject.RemoteManager),
50
+ SharedManager: () => (/* reexport */ external_SharedManager_js_namespaceObject.SharedManager),
51
+ UNKNOWN_MODULE_NAME: () => (/* reexport */ external_constant_js_namespaceObject.UNKNOWN_MODULE_NAME),
52
+ types: () => (/* reexport */ external_types_js_namespaceObject),
53
+ utils: () => (/* reexport */ external_utils_js_namespaceObject)
54
+ });
55
+
56
+ ;// CONCATENATED MODULE: external "./BasicPluginOptionsManager.js"
57
+ const external_BasicPluginOptionsManager_js_namespaceObject = require("./BasicPluginOptionsManager.js");
58
+ ;// CONCATENATED MODULE: external "./ContainerManager.js"
59
+ const external_ContainerManager_js_namespaceObject = require("./ContainerManager.js");
60
+ ;// CONCATENATED MODULE: external "./PKGJsonManager.js"
61
+ const external_PKGJsonManager_js_namespaceObject = require("./PKGJsonManager.js");
62
+ ;// CONCATENATED MODULE: external "./RemoteManager.js"
63
+ const external_RemoteManager_js_namespaceObject = require("./RemoteManager.js");
64
+ ;// CONCATENATED MODULE: external "./SharedManager.js"
65
+ const external_SharedManager_js_namespaceObject = require("./SharedManager.js");
66
+ ;// CONCATENATED MODULE: external "./constant.js"
67
+ const external_constant_js_namespaceObject = require("./constant.js");
68
+ ;// CONCATENATED MODULE: external "./utils.js"
69
+ const external_utils_js_namespaceObject = require("./utils.js");
70
+ ;// CONCATENATED MODULE: external "./types.js"
71
+ const external_types_js_namespaceObject = require("./types.js");
72
+ ;// CONCATENATED MODULE: ./src/index.ts
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+ exports.BasicPluginOptionsManager = __webpack_exports__.BasicPluginOptionsManager;
83
+ exports.ContainerManager = __webpack_exports__.ContainerManager;
84
+ exports.PKGJsonManager = __webpack_exports__.PKGJsonManager;
85
+ exports.RemoteManager = __webpack_exports__.RemoteManager;
86
+ exports.SharedManager = __webpack_exports__.SharedManager;
87
+ exports.UNKNOWN_MODULE_NAME = __webpack_exports__.UNKNOWN_MODULE_NAME;
88
+ exports.types = __webpack_exports__.types;
89
+ exports.utils = __webpack_exports__.utils;
90
+ for(var __rspack_i in __webpack_exports__) {
91
+ if(["BasicPluginOptionsManager","ContainerManager","PKGJsonManager","RemoteManager","SharedManager","UNKNOWN_MODULE_NAME","types","utils"].indexOf(__rspack_i) === -1) {
92
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
93
+ }
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
package/dist/index.mjs ADDED
@@ -0,0 +1,27 @@
1
+ import * as __rspack_external__types_mjs_4ad50757 from "./types.mjs";
2
+ import * as __rspack_external__utils_mjs_25ece7d1 from "./utils.mjs";
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+ export { __rspack_external__types_mjs_4ad50757 as types, __rspack_external__utils_mjs_25ece7d1 as utils };
22
+ export { BasicPluginOptionsManager } from "./BasicPluginOptionsManager.mjs";
23
+ export { ContainerManager } from "./ContainerManager.mjs";
24
+ export { PKGJsonManager } from "./PKGJsonManager.mjs";
25
+ export { RemoteManager } from "./RemoteManager.mjs";
26
+ export { SharedManager } from "./SharedManager.mjs";
27
+ export { UNKNOWN_MODULE_NAME } from "./constant.mjs";
@@ -0,0 +1,16 @@
1
+ import { WebpackOptionsNormalized } from 'webpack';
2
+ import { moduleFederationPlugin } from '@module-federation/sdk';
3
+ export type EntryStaticNormalized = Awaited<ReturnType<Extract<WebpackOptionsNormalized['entry'], () => any>>>;
4
+ export type EntryDescriptionNormalized = EntryStaticNormalized[keyof EntryStaticNormalized];
5
+ export type ContainerOptionsFormat<T> = (string | Record<string, string | string[] | T>)[] | Record<string, string | string[] | T>;
6
+ export type NormalizeSimple<R> = (value: string | string[], key: string) => R;
7
+ export type NormalizeOptions<T, R> = (value: T, key: string) => R;
8
+ export type ProcessFN<R> = (key: string, normalizedOptions: R) => void;
9
+ export type ParsedContainerOptions<T> = [string, T][];
10
+ export type NormalizedSharedOption = {
11
+ name: string;
12
+ version: string;
13
+ } & moduleFederationPlugin.SharedConfig;
14
+ export interface NormalizedSharedOptions {
15
+ [depName: string]: NormalizedSharedOption;
16
+ }
@@ -0,0 +1,16 @@
1
+ import { WebpackOptionsNormalized } from 'webpack';
2
+ import { moduleFederationPlugin } from '@module-federation/sdk';
3
+ export type EntryStaticNormalized = Awaited<ReturnType<Extract<WebpackOptionsNormalized['entry'], () => any>>>;
4
+ export type EntryDescriptionNormalized = EntryStaticNormalized[keyof EntryStaticNormalized];
5
+ export type ContainerOptionsFormat<T> = (string | Record<string, string | string[] | T>)[] | Record<string, string | string[] | T>;
6
+ export type NormalizeSimple<R> = (value: string | string[], key: string) => R;
7
+ export type NormalizeOptions<T, R> = (value: T, key: string) => R;
8
+ export type ProcessFN<R> = (key: string, normalizedOptions: R) => void;
9
+ export type ParsedContainerOptions<T> = [string, T][];
10
+ export type NormalizedSharedOption = {
11
+ name: string;
12
+ version: string;
13
+ } & moduleFederationPlugin.SharedConfig;
14
+ export interface NormalizedSharedOptions {
15
+ [depName: string]: NormalizedSharedOption;
16
+ }
package/dist/types.js ADDED
@@ -0,0 +1,29 @@
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/make_namespace_object
13
+ (() => {
14
+ // define __esModule on exports
15
+ __webpack_require__.r = (exports) => {
16
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
17
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
18
+ }
19
+ Object.defineProperty(exports, '__esModule', { value: true });
20
+ };
21
+ })();
22
+ var __webpack_exports__ = {};
23
+ __webpack_require__.r(__webpack_exports__);
24
+
25
+
26
+ for(var __rspack_i in __webpack_exports__) {
27
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
28
+ }
29
+ Object.defineProperty(exports, '__esModule', { value: true });
package/dist/types.mjs ADDED
@@ -0,0 +1,3 @@
1
+
2
+
3
+ export {};
@@ -0,0 +1,4 @@
1
+ import { ContainerOptionsFormat, NormalizeSimple, NormalizeOptions, ParsedContainerOptions } from './types';
2
+ export declare function parseOptions<T, R>(options: ContainerOptionsFormat<T>, normalizeSimple: NormalizeSimple<R>, normalizeOptions: NormalizeOptions<T, R>): ParsedContainerOptions<R>;
3
+ export declare function getBuildVersion(root?: string): string;
4
+ export declare function getBuildName(): string | undefined;
@@ -0,0 +1,4 @@
1
+ import { ContainerOptionsFormat, NormalizeSimple, NormalizeOptions, ParsedContainerOptions } from './types';
2
+ export declare function parseOptions<T, R>(options: ContainerOptionsFormat<T>, normalizeSimple: NormalizeSimple<R>, normalizeOptions: NormalizeOptions<T, R>): ParsedContainerOptions<R>;
3
+ export declare function getBuildVersion(root?: string): string;
4
+ export declare function getBuildName(): string | undefined;