@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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/BasicPluginOptionsManager.d.mts +10 -0
- package/dist/BasicPluginOptionsManager.d.ts +10 -0
- package/dist/BasicPluginOptionsManager.js +73 -0
- package/dist/BasicPluginOptionsManager.mjs +22 -0
- package/dist/ContainerManager.d.mts +20 -0
- package/dist/ContainerManager.d.ts +20 -0
- package/dist/ContainerManager.js +230 -0
- package/dist/ContainerManager.mjs +163 -0
- package/dist/LICENSE +21 -0
- package/dist/PKGJsonManager.d.mts +6 -0
- package/dist/PKGJsonManager.d.ts +6 -0
- package/dist/PKGJsonManager.js +118 -0
- package/dist/PKGJsonManager.mjs +50 -0
- package/dist/RemoteManager.d.mts +18 -0
- package/dist/RemoteManager.d.ts +18 -0
- package/dist/RemoteManager.js +162 -0
- package/dist/RemoteManager.mjs +108 -0
- package/dist/SharedManager.d.mts +18 -0
- package/dist/SharedManager.d.ts +18 -0
- package/dist/SharedManager.js +198 -0
- package/dist/SharedManager.mjs +130 -0
- package/dist/constant.d.mts +2 -0
- package/dist/constant.d.ts +2 -0
- package/dist/constant.js +58 -0
- package/dist/constant.mjs +4 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +95 -0
- package/dist/index.mjs +27 -0
- package/dist/types.d.mts +16 -0
- package/dist/types.d.ts +16 -0
- package/dist/types.js +29 -0
- package/dist/types.mjs +3 -0
- package/dist/utils.d.mts +4 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +121 -0
- package/dist/utils.mjs +63 -0
- package/package.json +60 -0
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
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@module-federation/managers",
|
|
3
|
+
"version": "0.0.0-chore-bump-node-22-20260710161714",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Provide managers for helping handle mf data .",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"Module Federation"
|
|
8
|
+
],
|
|
9
|
+
"type": "commonjs",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"author": "hanric <hanric.zhang@gmail.com>",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/module-federation/core.git",
|
|
21
|
+
"directory": "packages/managers"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"empathic": "2.0.0",
|
|
29
|
+
"@module-federation/sdk": "0.0.0-chore-bump-node-22-20260710161714"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"webpack": "5.104.1"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
|
+
"default": "./dist/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"default": "./dist/index.js"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"typesVersions": {
|
|
47
|
+
"*": {
|
|
48
|
+
".": [
|
|
49
|
+
"./dist/index.d.ts"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "rslib build",
|
|
55
|
+
"lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.ts\" \"package.json\"",
|
|
56
|
+
"test": "pnpm exec jest --config jest.config.js --passWithNoTests",
|
|
57
|
+
"test:ci": "pnpm exec jest --config jest.config.js --passWithNoTests --ci --coverage",
|
|
58
|
+
"pre-release": "pnpm run test && pnpm run build"
|
|
59
|
+
}
|
|
60
|
+
}
|