@module-federation/managers 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.
Files changed (45) hide show
  1. package/dist/BasicPluginOptionsManager.d.ts +10 -0
  2. package/dist/BasicPluginOptionsManager.js +73 -0
  3. package/dist/BasicPluginOptionsManager.mjs +22 -0
  4. package/dist/ContainerManager.d.ts +20 -0
  5. package/dist/ContainerManager.js +230 -0
  6. package/dist/ContainerManager.mjs +163 -0
  7. package/dist/PKGJsonManager.d.ts +6 -0
  8. package/dist/PKGJsonManager.js +116 -0
  9. package/dist/PKGJsonManager.mjs +48 -0
  10. package/dist/RemoteManager.d.ts +18 -0
  11. package/dist/RemoteManager.js +162 -0
  12. package/dist/RemoteManager.mjs +108 -0
  13. package/dist/SharedManager.d.mts +18 -0
  14. package/dist/{src/SharedManager.d.ts → SharedManager.d.ts} +4 -4
  15. package/dist/SharedManager.js +199 -0
  16. package/dist/SharedManager.mjs +131 -0
  17. package/dist/constant.d.ts +2 -0
  18. package/dist/constant.js +58 -0
  19. package/dist/constant.mjs +4 -0
  20. package/dist/findPackageJson.d.mts +1 -0
  21. package/dist/findPackageJson.d.ts +1 -0
  22. package/dist/findPackageJson.js +91 -0
  23. package/dist/findPackageJson.mjs +23 -0
  24. package/dist/index.d.ts +8 -1
  25. package/dist/index.js +95 -0
  26. package/dist/index.mjs +27 -0
  27. package/dist/types.d.mts +16 -0
  28. package/dist/{src/types.d.ts → types.d.ts} +2 -2
  29. package/dist/types.js +29 -0
  30. package/dist/types.mjs +3 -0
  31. package/dist/utils.d.ts +4 -0
  32. package/dist/utils.js +121 -0
  33. package/dist/utils.mjs +63 -0
  34. package/package.json +21 -10
  35. package/dist/index.cjs.js +0 -495
  36. package/dist/index.cjs.js.map +0 -1
  37. package/dist/index.esm.js +0 -486
  38. package/dist/index.esm.js.map +0 -1
  39. /package/dist/{src/BasicPluginOptionsManager.d.ts → BasicPluginOptionsManager.d.mts} +0 -0
  40. /package/dist/{src/ContainerManager.d.ts → ContainerManager.d.mts} +0 -0
  41. /package/dist/{src/PKGJsonManager.d.ts → PKGJsonManager.d.mts} +0 -0
  42. /package/dist/{src/RemoteManager.d.ts → RemoteManager.d.mts} +0 -0
  43. /package/dist/{src/constant.d.ts → constant.d.mts} +0 -0
  44. /package/dist/{src/index.d.ts → index.d.mts} +0 -0
  45. /package/dist/{src/utils.d.ts → utils.d.mts} +0 -0
@@ -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 @@
1
+ export declare function findPackageJson(startPath: string): string | undefined;
@@ -0,0 +1 @@
1
+ export declare function findPackageJson(startPath: string): string | undefined;
@@ -0,0 +1,91 @@
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
+ findPackageJson: () => (/* binding */ findPackageJson)
59
+ });
60
+
61
+ ;// CONCATENATED MODULE: external "node:fs"
62
+ const external_node_fs_namespaceObject = require("node:fs");
63
+ var external_node_fs_default = /*#__PURE__*/__webpack_require__.n(external_node_fs_namespaceObject);
64
+ ;// CONCATENATED MODULE: external "node:path"
65
+ const external_node_path_namespaceObject = require("node:path");
66
+ var external_node_path_default = /*#__PURE__*/__webpack_require__.n(external_node_path_namespaceObject);
67
+ ;// CONCATENATED MODULE: ./src/findPackageJson.ts
68
+
69
+
70
+ function findPackageJson(startPath) {
71
+ let currentPath = external_node_path_default().resolve(startPath);
72
+ while(true){
73
+ const packageJsonPath = external_node_path_default().join(currentPath, 'package.json');
74
+ if (external_node_fs_default().existsSync(packageJsonPath)) {
75
+ return packageJsonPath;
76
+ }
77
+ const parentPath = external_node_path_default().dirname(currentPath);
78
+ if (parentPath === currentPath) {
79
+ return undefined;
80
+ }
81
+ currentPath = parentPath;
82
+ }
83
+ }
84
+
85
+ exports.findPackageJson = __webpack_exports__.findPackageJson;
86
+ for(var __rspack_i in __webpack_exports__) {
87
+ if(["findPackageJson"].indexOf(__rspack_i) === -1) {
88
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
89
+ }
90
+ }
91
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,23 @@
1
+ import node_fs from "node:fs";
2
+ import node_path from "node:path";
3
+
4
+
5
+
6
+
7
+
8
+ function findPackageJson(startPath) {
9
+ let currentPath = node_path.resolve(startPath);
10
+ while(true){
11
+ const packageJsonPath = node_path.join(currentPath, 'package.json');
12
+ if (node_fs.existsSync(packageJsonPath)) {
13
+ return packageJsonPath;
14
+ }
15
+ const parentPath = node_path.dirname(currentPath);
16
+ if (parentPath === currentPath) {
17
+ return undefined;
18
+ }
19
+ currentPath = parentPath;
20
+ }
21
+ }
22
+
23
+ export { findPackageJson };
package/dist/index.d.ts CHANGED
@@ -1 +1,8 @@
1
- export * from "./src/index";
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
+ }
@@ -1,5 +1,5 @@
1
1
  import { WebpackOptionsNormalized } from 'webpack';
2
- import { sharePlugin } from '@module-federation/sdk';
2
+ import { moduleFederationPlugin } from '@module-federation/sdk';
3
3
  export type EntryStaticNormalized = Awaited<ReturnType<Extract<WebpackOptionsNormalized['entry'], () => any>>>;
4
4
  export type EntryDescriptionNormalized = EntryStaticNormalized[keyof EntryStaticNormalized];
5
5
  export type ContainerOptionsFormat<T> = (string | Record<string, string | string[] | T>)[] | Record<string, string | string[] | T>;
@@ -10,7 +10,7 @@ export type ParsedContainerOptions<T> = [string, T][];
10
10
  export type NormalizedSharedOption = {
11
11
  name: string;
12
12
  version: string;
13
- } & sharePlugin.SharedConfig;
13
+ } & moduleFederationPlugin.SharedConfig;
14
14
  export interface NormalizedSharedOptions {
15
15
  [depName: string]: NormalizedSharedOption;
16
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;
package/dist/utils.js ADDED
@@ -0,0 +1,121 @@
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
+ getBuildName: () => (/* binding */ getBuildName),
47
+ getBuildVersion: () => (/* binding */ getBuildVersion),
48
+ parseOptions: () => (/* binding */ parseOptions)
49
+ });
50
+
51
+ ;// CONCATENATED MODULE: external "./PKGJsonManager.js"
52
+ const external_PKGJsonManager_js_namespaceObject = require("./PKGJsonManager.js");
53
+ ;// CONCATENATED MODULE: external "./constant.js"
54
+ const external_constant_js_namespaceObject = require("./constant.js");
55
+ ;// CONCATENATED MODULE: ./src/utils.ts
56
+
57
+
58
+ function processFn(options, normalizeSimple, normalizeOptions, fn) {
59
+ const object = (obj)=>{
60
+ for (const [key, value] of Object.entries(obj)){
61
+ if (typeof value === 'string') {
62
+ fn(key, normalizeSimple(value, key));
63
+ } else {
64
+ fn(key, normalizeOptions(value, key));
65
+ }
66
+ }
67
+ };
68
+ const array = (items)=>{
69
+ for (const item of items){
70
+ if (typeof item === 'string') {
71
+ fn(item, normalizeSimple(item, item));
72
+ } else if (item && typeof item === 'object') {
73
+ object(item);
74
+ } else {
75
+ throw new Error('Unexpected options format');
76
+ }
77
+ }
78
+ };
79
+ if (!options) {
80
+ return;
81
+ } else if (Array.isArray(options)) {
82
+ array(options);
83
+ } else if (typeof options === 'object') {
84
+ object(options);
85
+ } else {
86
+ throw new Error('Unexpected options format');
87
+ }
88
+ }
89
+ function parseOptions(options, normalizeSimple, normalizeOptions) {
90
+ const items = [];
91
+ processFn(options, normalizeSimple, normalizeOptions, (key, value)=>{
92
+ items.push([
93
+ key,
94
+ value
95
+ ]);
96
+ });
97
+ return items;
98
+ }
99
+ function getBuildVersion(root) {
100
+ if (process.env['MF_BUILD_VERSION']) {
101
+ return process.env['MF_BUILD_VERSION'];
102
+ }
103
+ const pkg = new external_PKGJsonManager_js_namespaceObject.PKGJsonManager().readPKGJson(root);
104
+ if (pkg?.['version'] && typeof pkg['version'] === 'string') {
105
+ return pkg['version'];
106
+ }
107
+ return external_constant_js_namespaceObject.LOCAL_BUILD_VERSION;
108
+ }
109
+ function getBuildName() {
110
+ return process.env['MF_BUILD_NAME'];
111
+ }
112
+
113
+ exports.getBuildName = __webpack_exports__.getBuildName;
114
+ exports.getBuildVersion = __webpack_exports__.getBuildVersion;
115
+ exports.parseOptions = __webpack_exports__.parseOptions;
116
+ for(var __rspack_i in __webpack_exports__) {
117
+ if(["getBuildName","getBuildVersion","parseOptions"].indexOf(__rspack_i) === -1) {
118
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
119
+ }
120
+ }
121
+ Object.defineProperty(exports, '__esModule', { value: true });
package/dist/utils.mjs ADDED
@@ -0,0 +1,63 @@
1
+ import { PKGJsonManager } from "./PKGJsonManager.mjs";
2
+ import { LOCAL_BUILD_VERSION } from "./constant.mjs";
3
+
4
+
5
+
6
+
7
+
8
+ function processFn(options, normalizeSimple, normalizeOptions, fn) {
9
+ const object = (obj)=>{
10
+ for (const [key, value] of Object.entries(obj)){
11
+ if (typeof value === 'string') {
12
+ fn(key, normalizeSimple(value, key));
13
+ } else {
14
+ fn(key, normalizeOptions(value, key));
15
+ }
16
+ }
17
+ };
18
+ const array = (items)=>{
19
+ for (const item of items){
20
+ if (typeof item === 'string') {
21
+ fn(item, normalizeSimple(item, item));
22
+ } else if (item && typeof item === 'object') {
23
+ object(item);
24
+ } else {
25
+ throw new Error('Unexpected options format');
26
+ }
27
+ }
28
+ };
29
+ if (!options) {
30
+ return;
31
+ } else if (Array.isArray(options)) {
32
+ array(options);
33
+ } else if (typeof options === 'object') {
34
+ object(options);
35
+ } else {
36
+ throw new Error('Unexpected options format');
37
+ }
38
+ }
39
+ function parseOptions(options, normalizeSimple, normalizeOptions) {
40
+ const items = [];
41
+ processFn(options, normalizeSimple, normalizeOptions, (key, value)=>{
42
+ items.push([
43
+ key,
44
+ value
45
+ ]);
46
+ });
47
+ return items;
48
+ }
49
+ function getBuildVersion(root) {
50
+ if (process.env['MF_BUILD_VERSION']) {
51
+ return process.env['MF_BUILD_VERSION'];
52
+ }
53
+ const pkg = new PKGJsonManager().readPKGJson(root);
54
+ if (pkg?.['version'] && typeof pkg['version'] === 'string') {
55
+ return pkg['version'];
56
+ }
57
+ return LOCAL_BUILD_VERSION;
58
+ }
59
+ function getBuildName() {
60
+ return process.env['MF_BUILD_NAME'];
61
+ }
62
+
63
+ export { getBuildName, getBuildVersion, parseOptions };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@module-federation/managers",
3
- "version": "0.0.0-perf-devtools-20260108034446",
3
+ "version": "0.0.0-perf-website-code-usage-20260914033703",
4
4
  "license": "MIT",
5
5
  "description": "Provide managers for helping handle mf data .",
6
6
  "keywords": [
7
7
  "Module Federation"
8
8
  ],
9
+ "type": "commonjs",
9
10
  "files": [
10
11
  "dist/",
11
12
  "README.md"
@@ -20,22 +21,25 @@
20
21
  "directory": "packages/managers"
21
22
  },
22
23
  "sideEffects": false,
23
- "main": "./dist/index.cjs.js",
24
- "module": "./dist/index.esm.js",
24
+ "main": "./dist/index.js",
25
+ "module": "./dist/index.mjs",
25
26
  "types": "./dist/index.d.ts",
26
27
  "dependencies": {
27
- "find-pkg": "2.0.0",
28
- "fs-extra": "9.1.0",
29
- "@module-federation/sdk": "0.0.0-perf-devtools-20260108034446"
28
+ "@module-federation/sdk": "0.0.0-perf-website-code-usage-20260914033703"
30
29
  },
31
30
  "devDependencies": {
32
- "webpack": "5.94.0"
31
+ "webpack": "5.104.1"
33
32
  },
34
33
  "exports": {
35
34
  ".": {
36
- "types": "./dist/index.d.ts",
37
- "import": "./dist/index.esm.js",
38
- "require": "./dist/index.cjs.js"
35
+ "import": {
36
+ "types": "./dist/index.d.mts",
37
+ "default": "./dist/index.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/index.d.ts",
41
+ "default": "./dist/index.js"
42
+ }
39
43
  }
40
44
  },
41
45
  "typesVersions": {
@@ -44,5 +48,12 @@
44
48
  "./dist/index.d.ts"
45
49
  ]
46
50
  }
51
+ },
52
+ "scripts": {
53
+ "build": "rslib build",
54
+ "lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.ts\" \"package.json\"",
55
+ "test": "pnpm exec jest --config jest.config.js --passWithNoTests",
56
+ "test:ci": "pnpm exec jest --config jest.config.js --passWithNoTests --ci --coverage",
57
+ "pre-release": "pnpm run test && pnpm run build"
47
58
  }
48
59
  }