Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

21
node_modules/@module-federation/runtime/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023-present zhouxiao(zhoushaw)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

13
node_modules/@module-federation/runtime/README.md generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# @module-federation/runtime
- Can be combined with the build plug-in to share basic dependencies according to policies to reduce the number of module downloads and improve the loading speed of modules.
- Only consume part of the export of the remote module and will not fully download the remote module
- The runtime calling process can be extended through the module-runtime plug-in mechanism
## Documentation
See [https://module-federation.io/guide/runtime/index.html](https://module-federation.io/guide/runtime/index.html) for details.
## License
`@module-federation/runtime` is [MIT licensed](https://github.com/module-federation/core/blob/main/packages/runtime/LICENSE).

21
node_modules/@module-federation/runtime/dist/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023-present zhouxiao(zhoushaw)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,29 @@
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) {
__defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
}
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
exports.__toESM = __toESM;

View File

@@ -0,0 +1,52 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
const require_index = require('./index.cjs');
let _module_federation_runtime_core = require("@module-federation/runtime-core");
Object.defineProperty(exports, 'Module', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.Module;
}
});
exports.ModuleFederation = _module_federation_runtime_core.ModuleFederation;
exports.createInstance = require_index.createInstance;
exports.getInstance = require_index.getInstance;
Object.defineProperty(exports, 'getRemoteEntry', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.getRemoteEntry;
}
});
Object.defineProperty(exports, 'getRemoteInfo', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.getRemoteInfo;
}
});
exports.init = require_index.init;
exports.loadRemote = require_index.loadRemote;
Object.defineProperty(exports, 'loadScript', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.loadScript;
}
});
Object.defineProperty(exports, 'loadScriptNode', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.loadScriptNode;
}
});
exports.loadShare = require_index.loadShare;
exports.loadShareSync = require_index.loadShareSync;
exports.preloadRemote = require_index.preloadRemote;
Object.defineProperty(exports, 'registerGlobalPlugins', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.registerGlobalPlugins;
}
});
exports.registerPlugins = require_index.registerPlugins;
exports.registerRemotes = require_index.registerRemotes;
exports.registerShared = require_index.registerShared;

View File

@@ -0,0 +1,2 @@
import { Federation, Module, ModuleFederation, ModuleFederationRuntimePlugin, createInstance, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadScript, loadScriptNode, loadShare, loadShareSync, preloadRemote, registerGlobalPlugins, registerPlugins, registerRemotes, registerShared } from "./index.js";
export { Federation, Module, ModuleFederation, ModuleFederationRuntimePlugin, createInstance, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadScript, loadScriptNode, loadShare, loadShareSync, preloadRemote, registerGlobalPlugins, registerPlugins, registerRemotes, registerShared };

View File

@@ -0,0 +1,3 @@
import { Module, ModuleFederation, createInstance, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadScript, loadScriptNode, loadShare, loadShareSync, preloadRemote, registerGlobalPlugins, registerPlugins, registerRemotes, registerShared } from "./index.js";
export { Module, ModuleFederation, createInstance, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadScript, loadScriptNode, loadShare, loadShareSync, preloadRemote, registerGlobalPlugins, registerPlugins, registerRemotes, registerShared };

18
node_modules/@module-federation/runtime/dist/core.cjs generated vendored Normal file
View File

@@ -0,0 +1,18 @@
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
let _module_federation_runtime_core = require("@module-federation/runtime-core");
_module_federation_runtime_core = require_runtime.__toESM(_module_federation_runtime_core);
//#region src/core.ts
var core_default = _module_federation_runtime_core;
//#endregion
exports.default = core_default;
Object.keys(_module_federation_runtime_core).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function () { return _module_federation_runtime_core[k]; }
});
});
//# sourceMappingURL=core.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"core.cjs","names":["runtimeCore"],"sources":["../src/core.ts"],"sourcesContent":["import * as runtimeCore from '@module-federation/runtime-core';\n\nexport * from '@module-federation/runtime-core';\n\nexport default runtimeCore;\n"],"mappings":";;;;;;AAIA,mBAAeA"}

View File

@@ -0,0 +1,3 @@
import * as runtimeCore from "@module-federation/runtime-core";
export * from "@module-federation/runtime-core";
export { runtimeCore as default };

10
node_modules/@module-federation/runtime/dist/core.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import * as runtimeCore from "@module-federation/runtime-core";
export * from "@module-federation/runtime-core"
//#region src/core.ts
var core_default = runtimeCore;
//#endregion
export { core_default as default };
//# sourceMappingURL=core.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"core.js","names":[],"sources":["../src/core.ts"],"sourcesContent":["import * as runtimeCore from '@module-federation/runtime-core';\n\nexport * from '@module-federation/runtime-core';\n\nexport default runtimeCore;\n"],"mappings":";;;;;AAIA,mBAAe"}

View File

@@ -0,0 +1,24 @@
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
const require_utils = require('./utils.cjs');
let _module_federation_runtime_core = require("@module-federation/runtime-core");
//#region src/helpers.ts
const global = {
..._module_federation_runtime_core.helpers.global,
getGlobalFederationInstance: require_utils.getGlobalFederationInstance
};
const share = _module_federation_runtime_core.helpers.share;
const utils = _module_federation_runtime_core.helpers.utils;
const runtimeHelpers = {
global,
share,
utils
};
//#endregion
exports.default = runtimeHelpers;
exports.global = global;
exports.share = share;
exports.utils = utils;
//# sourceMappingURL=helpers.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"helpers.cjs","names":["helpers"],"sources":["../src/helpers.ts"],"sourcesContent":["import {\n helpers,\n type IGlobalUtils,\n type IShareUtils,\n} from '@module-federation/runtime-core';\nimport { getGlobalFederationInstance } from './utils';\n\nexport type {\n IGlobalUtils,\n IShareUtils,\n} from '@module-federation/runtime-core';\n\ntype RuntimeGlobalUtils = IGlobalUtils & {\n getGlobalFederationInstance: typeof getGlobalFederationInstance;\n};\n\nexport const global: RuntimeGlobalUtils = {\n ...helpers.global,\n getGlobalFederationInstance,\n};\n\nexport const share: IShareUtils = helpers.share;\n\nexport interface IRuntimeUtils {\n matchRemoteWithNameAndExpose: typeof import('@module-federation/runtime-core').matchRemoteWithNameAndExpose;\n preloadAssets: (...args: any[]) => void;\n getRemoteInfo: typeof import('@module-federation/runtime-core').getRemoteInfo;\n}\n\nexport const utils: IRuntimeUtils = helpers.utils;\n\nconst runtimeHelpers: {\n global: RuntimeGlobalUtils;\n share: IShareUtils;\n utils: IRuntimeUtils;\n} = {\n global,\n share,\n utils,\n};\n\nexport default runtimeHelpers;\n"],"mappings":";;;;;;AAgBA,MAAa,SAA6B;CACxC,GAAGA,wCAAQ;CACX;CACD;AAED,MAAa,QAAqBA,wCAAQ;AAQ1C,MAAa,QAAuBA,wCAAQ;AAE5C,MAAM,iBAIF;CACF;CACA;CACA;CACD"}

View File

@@ -0,0 +1,24 @@
import { getGlobalFederationInstance } from "./utils.js";
import * as _module_federation_runtime_core0 from "@module-federation/runtime-core";
import { IGlobalUtils, IGlobalUtils as IGlobalUtils$1, IShareUtils, IShareUtils as IShareUtils$1 } from "@module-federation/runtime-core";
//#region src/helpers.d.ts
type RuntimeGlobalUtils = IGlobalUtils$1 & {
getGlobalFederationInstance: typeof getGlobalFederationInstance;
};
declare const global: RuntimeGlobalUtils;
declare const share: IShareUtils$1;
interface IRuntimeUtils {
matchRemoteWithNameAndExpose: typeof _module_federation_runtime_core0.matchRemoteWithNameAndExpose;
preloadAssets: (...args: any[]) => void;
getRemoteInfo: typeof _module_federation_runtime_core0.getRemoteInfo;
}
declare const utils: IRuntimeUtils;
declare const runtimeHelpers: {
global: RuntimeGlobalUtils;
share: IShareUtils$1;
utils: IRuntimeUtils;
};
//#endregion
export { type IGlobalUtils, IRuntimeUtils, type IShareUtils, runtimeHelpers as default, global, share, utils };
//# sourceMappingURL=helpers.d.ts.map

View File

@@ -0,0 +1,19 @@
import { getGlobalFederationInstance } from "./utils.js";
import { helpers } from "@module-federation/runtime-core";
//#region src/helpers.ts
const global = {
...helpers.global,
getGlobalFederationInstance
};
const share = helpers.share;
const utils = helpers.utils;
const runtimeHelpers = {
global,
share,
utils
};
//#endregion
export { runtimeHelpers as default, global, share, utils };
//# sourceMappingURL=helpers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"helpers.js","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["import {\n helpers,\n type IGlobalUtils,\n type IShareUtils,\n} from '@module-federation/runtime-core';\nimport { getGlobalFederationInstance } from './utils';\n\nexport type {\n IGlobalUtils,\n IShareUtils,\n} from '@module-federation/runtime-core';\n\ntype RuntimeGlobalUtils = IGlobalUtils & {\n getGlobalFederationInstance: typeof getGlobalFederationInstance;\n};\n\nexport const global: RuntimeGlobalUtils = {\n ...helpers.global,\n getGlobalFederationInstance,\n};\n\nexport const share: IShareUtils = helpers.share;\n\nexport interface IRuntimeUtils {\n matchRemoteWithNameAndExpose: typeof import('@module-federation/runtime-core').matchRemoteWithNameAndExpose;\n preloadAssets: (...args: any[]) => void;\n getRemoteInfo: typeof import('@module-federation/runtime-core').getRemoteInfo;\n}\n\nexport const utils: IRuntimeUtils = helpers.utils;\n\nconst runtimeHelpers: {\n global: RuntimeGlobalUtils;\n share: IShareUtils;\n utils: IRuntimeUtils;\n} = {\n global,\n share,\n utils,\n};\n\nexport default runtimeHelpers;\n"],"mappings":";;;;AAgBA,MAAa,SAA6B;CACxC,GAAG,QAAQ;CACX;CACD;AAED,MAAa,QAAqB,QAAQ;AAQ1C,MAAa,QAAuB,QAAQ;AAE5C,MAAM,iBAIF;CACF;CACA;CACA;CACD"}

114
node_modules/@module-federation/runtime/dist/index.cjs generated vendored Normal file
View File

@@ -0,0 +1,114 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
const require_utils = require('./utils.cjs');
let _module_federation_runtime_core = require("@module-federation/runtime-core");
let _module_federation_error_codes = require("@module-federation/error-codes");
//#region src/index.ts
function createInstance(options) {
const instance = new (((0, _module_federation_runtime_core.getGlobalFederationConstructor)()) || _module_federation_runtime_core.ModuleFederation)({
id: `${options.name}@${options.version || Date.now()}`,
...options
});
(0, _module_federation_runtime_core.setGlobalFederationInstance)(instance);
return instance;
}
let FederationInstance = null;
function init(options) {
const instance = require_utils.getGlobalFederationInstance(options.name, options.version);
const normalizedOptions = {
...options,
id: options.id || ""
};
if (!instance) {
FederationInstance = createInstance(normalizedOptions);
return FederationInstance;
} else {
instance.initOptions(normalizedOptions);
if (!FederationInstance) FederationInstance = instance;
return instance;
}
}
function loadRemote(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.loadRemote.apply(FederationInstance, args);
}
function loadShare(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.loadShare.apply(FederationInstance, args);
}
function loadShareSync(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.loadShareSync.apply(FederationInstance, args);
}
function preloadRemote(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.preloadRemote.apply(FederationInstance, args);
}
function registerRemotes(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.registerRemotes.apply(FederationInstance, args);
}
function registerPlugins(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.registerPlugins.apply(FederationInstance, args);
}
function getInstance(finder) {
if (!finder) return FederationInstance;
return _module_federation_runtime_core.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(finder) || null;
}
function registerShared(...args) {
(0, _module_federation_runtime_core.assert)(FederationInstance, _module_federation_error_codes.RUNTIME_009, _module_federation_error_codes.runtimeDescMap);
return FederationInstance.registerShared.apply(FederationInstance, args);
}
(0, _module_federation_runtime_core.setGlobalFederationConstructor)(_module_federation_runtime_core.ModuleFederation);
//#endregion
Object.defineProperty(exports, 'Module', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.Module;
}
});
exports.ModuleFederation = _module_federation_runtime_core.ModuleFederation;
exports.createInstance = createInstance;
exports.getInstance = getInstance;
Object.defineProperty(exports, 'getRemoteEntry', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.getRemoteEntry;
}
});
Object.defineProperty(exports, 'getRemoteInfo', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.getRemoteInfo;
}
});
exports.init = init;
exports.loadRemote = loadRemote;
Object.defineProperty(exports, 'loadScript', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.loadScript;
}
});
Object.defineProperty(exports, 'loadScriptNode', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.loadScriptNode;
}
});
exports.loadShare = loadShare;
exports.loadShareSync = loadShareSync;
exports.preloadRemote = preloadRemote;
Object.defineProperty(exports, 'registerGlobalPlugins', {
enumerable: true,
get: function () {
return _module_federation_runtime_core.registerGlobalPlugins;
}
});
exports.registerPlugins = registerPlugins;
exports.registerRemotes = registerRemotes;
exports.registerShared = registerShared;
//# sourceMappingURL=index.cjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
import { Federation, Module, ModuleFederation, ModuleFederationRuntimePlugin, UserOptions, getRemoteEntry, getRemoteInfo, loadScript, loadScriptNode, registerGlobalPlugins } from "@module-federation/runtime-core";
//#region src/index.d.ts
declare function createInstance(options: UserOptions): ModuleFederation;
declare function init(options: UserOptions): ModuleFederation;
declare function loadRemote<T>(...args: Parameters<ModuleFederation['loadRemote']>): Promise<T | null>;
declare function loadShare<T>(...args: Parameters<ModuleFederation['loadShare']>): Promise<false | (() => T | undefined)>;
declare function loadShareSync<T>(...args: Parameters<ModuleFederation['loadShareSync']>): () => T | never;
declare function preloadRemote(...args: Parameters<ModuleFederation['preloadRemote']>): ReturnType<ModuleFederation['preloadRemote']>;
declare function registerRemotes(...args: Parameters<ModuleFederation['registerRemotes']>): ReturnType<ModuleFederation['registerRemotes']>;
declare function registerPlugins(...args: Parameters<ModuleFederation['registerPlugins']>): ReturnType<ModuleFederation['registerRemotes']>;
declare function getInstance(): ModuleFederation | null;
declare function getInstance(finder: (instance: ModuleFederation) => boolean): ModuleFederation | null;
declare function registerShared(...args: Parameters<ModuleFederation['registerShared']>): ReturnType<ModuleFederation['registerShared']>;
//#endregion
export { type Federation, Module, ModuleFederation, type ModuleFederationRuntimePlugin, createInstance, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadScript, loadScriptNode, loadShare, loadShareSync, preloadRemote, registerGlobalPlugins, registerPlugins, registerRemotes, registerShared };
//# sourceMappingURL=index.d.ts.map

66
node_modules/@module-federation/runtime/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,66 @@
import { getGlobalFederationInstance } from "./utils.js";
import { CurrentGlobal, Module, ModuleFederation, assert, getGlobalFederationConstructor, getRemoteEntry, getRemoteInfo, loadScript, loadScriptNode, registerGlobalPlugins, setGlobalFederationConstructor, setGlobalFederationInstance } from "@module-federation/runtime-core";
import { RUNTIME_009, runtimeDescMap } from "@module-federation/error-codes";
//#region src/index.ts
function createInstance(options) {
const instance = new ((getGlobalFederationConstructor()) || ModuleFederation)({
id: `${options.name}@${options.version || Date.now()}`,
...options
});
setGlobalFederationInstance(instance);
return instance;
}
let FederationInstance = null;
function init(options) {
const instance = getGlobalFederationInstance(options.name, options.version);
const normalizedOptions = {
...options,
id: options.id || ""
};
if (!instance) {
FederationInstance = createInstance(normalizedOptions);
return FederationInstance;
} else {
instance.initOptions(normalizedOptions);
if (!FederationInstance) FederationInstance = instance;
return instance;
}
}
function loadRemote(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.loadRemote.apply(FederationInstance, args);
}
function loadShare(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.loadShare.apply(FederationInstance, args);
}
function loadShareSync(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.loadShareSync.apply(FederationInstance, args);
}
function preloadRemote(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.preloadRemote.apply(FederationInstance, args);
}
function registerRemotes(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.registerRemotes.apply(FederationInstance, args);
}
function registerPlugins(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.registerPlugins.apply(FederationInstance, args);
}
function getInstance(finder) {
if (!finder) return FederationInstance;
return CurrentGlobal.__FEDERATION__.__INSTANCES__.find(finder) || null;
}
function registerShared(...args) {
assert(FederationInstance, RUNTIME_009, runtimeDescMap);
return FederationInstance.registerShared.apply(FederationInstance, args);
}
setGlobalFederationConstructor(ModuleFederation);
//#endregion
export { Module, ModuleFederation, createInstance, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadScript, loadScriptNode, loadShare, loadShareSync, preloadRemote, registerGlobalPlugins, registerPlugins, registerRemotes, registerShared };
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

10
node_modules/@module-federation/runtime/dist/types.cjs generated vendored Normal file
View File

@@ -0,0 +1,10 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
var _module_federation_runtime_core_types = require("@module-federation/runtime-core/types");
Object.keys(_module_federation_runtime_core_types).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function () { return _module_federation_runtime_core_types[k]; }
});
});

View File

@@ -0,0 +1 @@
export * from "@module-federation/runtime-core/types";

View File

@@ -0,0 +1,3 @@
export * from "@module-federation/runtime-core/types"
export { };

20
node_modules/@module-federation/runtime/dist/utils.cjs generated vendored Normal file
View File

@@ -0,0 +1,20 @@
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
let _module_federation_runtime_core = require("@module-federation/runtime-core");
//#region src/utils.ts
function getBuilderId() {
return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
}
function getGlobalFederationInstance(name, version) {
const buildId = getBuilderId();
return _module_federation_runtime_core.CurrentGlobal.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
if (buildId && GMInstance.options.id === buildId) return true;
if (GMInstance.options.name === name && !GMInstance.options.version && !version) return true;
if (GMInstance.options.name === name && version && GMInstance.options.version === version) return true;
return false;
});
}
//#endregion
exports.getGlobalFederationInstance = getGlobalFederationInstance;
//# sourceMappingURL=utils.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.cjs","names":["CurrentGlobal"],"sources":["../src/utils.ts"],"sourcesContent":["import type { ModuleFederation } from '@module-federation/runtime-core';\nimport { CurrentGlobal } from '@module-federation/runtime-core';\n\n// injected by bundler, so it can not use runtime-core stuff\nexport function getBuilderId(): string {\n //@ts-ignore\n return typeof FEDERATION_BUILD_IDENTIFIER !== 'undefined'\n ? //@ts-ignore\n FEDERATION_BUILD_IDENTIFIER\n : '';\n}\n\nexport function getGlobalFederationInstance(\n name: string,\n version: string | undefined,\n): ModuleFederation | undefined {\n const buildId = getBuilderId();\n return CurrentGlobal.__FEDERATION__.__INSTANCES__.find(\n (GMInstance: ModuleFederation) => {\n if (buildId && GMInstance.options.id === buildId) {\n return true;\n }\n\n if (\n GMInstance.options.name === name &&\n !GMInstance.options.version &&\n !version\n ) {\n return true;\n }\n\n if (\n GMInstance.options.name === name &&\n version &&\n GMInstance.options.version === version\n ) {\n return true;\n }\n return false;\n },\n );\n}\n"],"mappings":";;;;AAIA,SAAgB,eAAuB;AAErC,QAAO,OAAO,gCAAgC,cAE1C,8BACA;;AAGN,SAAgB,4BACd,MACA,SAC8B;CAC9B,MAAM,UAAU,cAAc;AAC9B,QAAOA,8CAAc,eAAe,cAAc,MAC/C,eAAiC;AAChC,MAAI,WAAW,WAAW,QAAQ,OAAO,QACvC,QAAO;AAGT,MACE,WAAW,QAAQ,SAAS,QAC5B,CAAC,WAAW,QAAQ,WACpB,CAAC,QAED,QAAO;AAGT,MACE,WAAW,QAAQ,SAAS,QAC5B,WACA,WAAW,QAAQ,YAAY,QAE/B,QAAO;AAET,SAAO;GAEV"}

View File

@@ -0,0 +1,7 @@
import { ModuleFederation } from "@module-federation/runtime-core";
//#region src/utils.d.ts
declare function getGlobalFederationInstance(name: string, version: string | undefined): ModuleFederation | undefined;
//#endregion
export { getGlobalFederationInstance };
//# sourceMappingURL=utils.d.ts.map

19
node_modules/@module-federation/runtime/dist/utils.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { CurrentGlobal } from "@module-federation/runtime-core";
//#region src/utils.ts
function getBuilderId() {
return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
}
function getGlobalFederationInstance(name, version) {
const buildId = getBuilderId();
return CurrentGlobal.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
if (buildId && GMInstance.options.id === buildId) return true;
if (GMInstance.options.name === name && !GMInstance.options.version && !version) return true;
if (GMInstance.options.name === name && version && GMInstance.options.version === version) return true;
return false;
});
}
//#endregion
export { getGlobalFederationInstance };
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import type { ModuleFederation } from '@module-federation/runtime-core';\nimport { CurrentGlobal } from '@module-federation/runtime-core';\n\n// injected by bundler, so it can not use runtime-core stuff\nexport function getBuilderId(): string {\n //@ts-ignore\n return typeof FEDERATION_BUILD_IDENTIFIER !== 'undefined'\n ? //@ts-ignore\n FEDERATION_BUILD_IDENTIFIER\n : '';\n}\n\nexport function getGlobalFederationInstance(\n name: string,\n version: string | undefined,\n): ModuleFederation | undefined {\n const buildId = getBuilderId();\n return CurrentGlobal.__FEDERATION__.__INSTANCES__.find(\n (GMInstance: ModuleFederation) => {\n if (buildId && GMInstance.options.id === buildId) {\n return true;\n }\n\n if (\n GMInstance.options.name === name &&\n !GMInstance.options.version &&\n !version\n ) {\n return true;\n }\n\n if (\n GMInstance.options.name === name &&\n version &&\n GMInstance.options.version === version\n ) {\n return true;\n }\n return false;\n },\n );\n}\n"],"mappings":";;;AAIA,SAAgB,eAAuB;AAErC,QAAO,OAAO,gCAAgC,cAE1C,8BACA;;AAGN,SAAgB,4BACd,MACA,SAC8B;CAC9B,MAAM,UAAU,cAAc;AAC9B,QAAO,cAAc,eAAe,cAAc,MAC/C,eAAiC;AAChC,MAAI,WAAW,WAAW,QAAQ,OAAO,QACvC,QAAO;AAGT,MACE,WAAW,QAAQ,SAAS,QAC5B,CAAC,WAAW,QAAQ,WACpB,CAAC,QAED,QAAO;AAGT,MACE,WAAW,QAAQ,SAAS,QAC5B,WACA,WAAW,QAAQ,YAAY,QAE/B,QAAO;AAET,SAAO;GAEV"}

100
node_modules/@module-federation/runtime/package.json generated vendored Normal file
View File

@@ -0,0 +1,100 @@
{
"name": "@module-federation/runtime",
"version": "2.5.0",
"type": "module",
"author": "zhouxiao <codingzx@gmail.com>",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"browser": {
"url": false
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/module-federation/core.git",
"directory": "packages/runtime"
},
"files": [
"dist/",
"README.md"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
},
"./helpers": {
"import": {
"types": "./dist/helpers.d.ts",
"default": "./dist/helpers.js"
},
"require": {
"types": "./dist/helpers.d.ts",
"default": "./dist/helpers.cjs"
}
},
"./types": {
"import": {
"types": "./dist/types.d.ts",
"default": "./dist/types.js"
},
"require": {
"types": "./dist/types.d.ts",
"default": "./dist/types.cjs"
}
},
"./core": {
"import": {
"types": "./dist/core.d.ts",
"default": "./dist/core.js"
},
"require": {
"types": "./dist/core.d.ts",
"default": "./dist/core.cjs"
}
},
"./bundler": "./dist/bundler.js",
"./*": "./*"
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
],
"helpers": [
"./dist/helpers.d.ts"
],
"types": [
"./dist/types.d.ts"
],
"core": [
"./dist/core.d.ts"
],
"bundler": [
"./dist/bundler.d.ts"
]
}
},
"dependencies": {
"@module-federation/sdk": "2.5.0",
"@module-federation/error-codes": "2.5.0",
"@module-federation/runtime-core": "2.5.0"
},
"scripts": {
"build": "tsdown --config tsdown.config.ts",
"lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.ts\" \"package.json\"",
"build-debug": "RUNTIME_TSDOWN_MODE=debug tsdown --config tsdown.config.ts",
"pre-release": "pnpm run test && pnpm run build",
"test": "vitest run -u -c vitest.config.ts"
}
}