@vc-shell/mf-host 2.0.0-alpha.8
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/CHANGELOG.md +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/register-remote-modules.d.ts +30 -0
- package/dist/register-remote-modules.d.ts.map +1 -0
- package/dist/register-remote-modules.js +196 -0
- package/dist/register-remote-modules.js.map +1 -0
- package/package.json +47 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [2.0.0-alpha.8](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2026-03-12)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **mf:** extract Module Federation loader into @vc-shell/mf-config and @vc-shell/mf-host ([9b079c2](https://github.com/VirtoCommerce/vc-shell/commit/9b079c27b))
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type App } from "vue";
|
|
2
|
+
import type { Router } from "vue-router";
|
|
3
|
+
export interface ModuleRegistryEntry {
|
|
4
|
+
id: string;
|
|
5
|
+
entry: string;
|
|
6
|
+
version: string;
|
|
7
|
+
compatibleWith?: {
|
|
8
|
+
dependencies?: Record<string, string>;
|
|
9
|
+
requires?: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface RegisterRemoteModulesOptions {
|
|
13
|
+
router: Router;
|
|
14
|
+
appName: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Discover and load remote MF modules from the server registry.
|
|
18
|
+
*
|
|
19
|
+
* Call this in your app's main.ts BEFORE app.mount():
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { registerRemoteModules } from "@vc-shell/mf-host";
|
|
22
|
+
* registerRemoteModules(app, { router, appName: "my-app" });
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* The function is fire-and-forget (async internally).
|
|
26
|
+
* It provides `ModulesReadyKey` and `ModulesLoadErrorKey` refs via app.provide()
|
|
27
|
+
* so components can react to loading state.
|
|
28
|
+
*/
|
|
29
|
+
export declare function registerRemoteModules(app: App, options: RegisterRemoteModulesOptions): void;
|
|
30
|
+
//# sourceMappingURL=register-remote-modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-remote-modules.d.ts","sourceRoot":"","sources":["../src/register-remote-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAe,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAsCzC,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE;QACf,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;CACH;AAMD,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAuCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,4BAA4B,GAAG,IAAI,CA0H3F"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
import * as semver from "semver";
|
|
3
|
+
import { init, loadRemote } from "@module-federation/enhanced/runtime";
|
|
4
|
+
// Shared deps — statically imported. No circular dependency because
|
|
5
|
+
// this package is separate from @vc-shell/framework.
|
|
6
|
+
import * as Vue from "vue";
|
|
7
|
+
import * as VueRouter from "vue-router";
|
|
8
|
+
import * as VueI18n from "vue-i18n";
|
|
9
|
+
import * as VeeValidate from "vee-validate";
|
|
10
|
+
import * as LodashEs from "lodash-es";
|
|
11
|
+
import * as VueuseCore from "@vueuse/core";
|
|
12
|
+
import * as Framework from "@vc-shell/framework";
|
|
13
|
+
// Read versions from package.json to avoid rollup warnings about missing named exports
|
|
14
|
+
import vuePkg from "vue/package.json";
|
|
15
|
+
import vueRouterPkg from "vue-router/package.json";
|
|
16
|
+
import vueI18nPkg from "vue-i18n/package.json";
|
|
17
|
+
import lodashEsPkg from "lodash-es/package.json";
|
|
18
|
+
import vueusePkg from "@vueuse/core/package.json";
|
|
19
|
+
import frameworkPkg from "@vc-shell/framework/package.json";
|
|
20
|
+
const REGISTRY_URL = "/api/frontend-modules";
|
|
21
|
+
// IMPORTANT: Keep this list in sync with @vc-shell/mf-config/src/shared-deps.ts (SHARED_DEPS_BASE).
|
|
22
|
+
// Both files define the same 7 shared deps — mf-config for build-time, this for runtime.
|
|
23
|
+
const SHARED_LIBS = {
|
|
24
|
+
vue: { lib: () => Vue, version: vuePkg.version, requiredVersion: "^3.4.0" },
|
|
25
|
+
"vue-router": { lib: () => VueRouter, version: vueRouterPkg.version, requiredVersion: "^4.0.0" },
|
|
26
|
+
"vue-i18n": { lib: () => VueI18n, version: vueI18nPkg.version, requiredVersion: "^9.0.0" },
|
|
27
|
+
"vee-validate": { lib: () => VeeValidate, version: VeeValidate.version ?? "4.0.0", requiredVersion: "^4.0.0" },
|
|
28
|
+
"lodash-es": { lib: () => LodashEs, version: lodashEsPkg.version, requiredVersion: "^4.0.0" },
|
|
29
|
+
"@vueuse/core": { lib: () => VueuseCore, version: vueusePkg.version, requiredVersion: "^10.0.0" },
|
|
30
|
+
"@vc-shell/framework": { lib: () => Framework, version: frameworkPkg.version, requiredVersion: `^${frameworkPkg.version}` },
|
|
31
|
+
};
|
|
32
|
+
// --- Helper functions ---
|
|
33
|
+
/** Resolve Vue plugin(s) from MF module exports. */
|
|
34
|
+
function resolvePlugins(exports) {
|
|
35
|
+
const mod = exports;
|
|
36
|
+
if (!mod)
|
|
37
|
+
return [];
|
|
38
|
+
if (mod.default?.install)
|
|
39
|
+
return [mod.default];
|
|
40
|
+
if (mod.install)
|
|
41
|
+
return [mod];
|
|
42
|
+
const target = mod.default ?? mod;
|
|
43
|
+
const plugins = [];
|
|
44
|
+
for (const value of Object.values(target)) {
|
|
45
|
+
const v = value;
|
|
46
|
+
if (!v || typeof v !== "object")
|
|
47
|
+
continue;
|
|
48
|
+
if ("install" in v) {
|
|
49
|
+
plugins.push(v);
|
|
50
|
+
}
|
|
51
|
+
else if (v.default?.install) {
|
|
52
|
+
plugins.push(v.default);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return plugins;
|
|
56
|
+
}
|
|
57
|
+
/** Convert NuGet-style version range notation to semver. */
|
|
58
|
+
function humanizeRange(range) {
|
|
59
|
+
const exact = range.match(/^\[\s*([^\],]+?)\s*\]$/);
|
|
60
|
+
if (exact)
|
|
61
|
+
return exact[1];
|
|
62
|
+
const m = range.match(/^([[\(])\s*([^,]*?)\s*,\s*([^)\]]*?)\s*([)\]])$/);
|
|
63
|
+
if (!m)
|
|
64
|
+
return range;
|
|
65
|
+
const [, openBracket, lower, upper, closeBracket] = m;
|
|
66
|
+
const parts = [];
|
|
67
|
+
if (lower)
|
|
68
|
+
parts.push(`${openBracket === "[" ? ">=" : ">"}${lower}`);
|
|
69
|
+
if (upper)
|
|
70
|
+
parts.push(`${closeBracket === "]" ? "<=" : "<"}${upper}`);
|
|
71
|
+
return parts.join(" ") || range;
|
|
72
|
+
}
|
|
73
|
+
// --- Main function ---
|
|
74
|
+
/**
|
|
75
|
+
* Discover and load remote MF modules from the server registry.
|
|
76
|
+
*
|
|
77
|
+
* Call this in your app's main.ts BEFORE app.mount():
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { registerRemoteModules } from "@vc-shell/mf-host";
|
|
80
|
+
* registerRemoteModules(app, { router, appName: "my-app" });
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* The function is fire-and-forget (async internally).
|
|
84
|
+
* It provides `ModulesReadyKey` and `ModulesLoadErrorKey` refs via app.provide()
|
|
85
|
+
* so components can react to loading state.
|
|
86
|
+
*/
|
|
87
|
+
export function registerRemoteModules(app, options) {
|
|
88
|
+
const { ModulesReadyKey, ModulesLoadErrorKey } = Framework;
|
|
89
|
+
const modulesReady = ref(false);
|
|
90
|
+
const modulesLoadError = ref(false);
|
|
91
|
+
app.provide(ModulesReadyKey, modulesReady);
|
|
92
|
+
app.provide(ModulesLoadErrorKey, modulesLoadError);
|
|
93
|
+
// Fire-and-forget async loading
|
|
94
|
+
(async () => {
|
|
95
|
+
try {
|
|
96
|
+
performance.mark("vc:modules-start");
|
|
97
|
+
const frameworkVersion = frameworkPkg.version;
|
|
98
|
+
// 1. Build provides dict
|
|
99
|
+
const provides = {};
|
|
100
|
+
for (const [name, entry] of Object.entries(SHARED_LIBS)) {
|
|
101
|
+
provides[name] = entry.version;
|
|
102
|
+
}
|
|
103
|
+
// 2. Fetch registry
|
|
104
|
+
const response = await fetch(REGISTRY_URL, {
|
|
105
|
+
method: "POST",
|
|
106
|
+
credentials: "same-origin",
|
|
107
|
+
headers: { "Content-Type": "application/json" },
|
|
108
|
+
body: JSON.stringify({ appName: options.appName, provides }),
|
|
109
|
+
});
|
|
110
|
+
if (response.status === 401 || response.status === 403) {
|
|
111
|
+
modulesReady.value = true;
|
|
112
|
+
performance.mark("vc:modules-done");
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
throw new Error(`Registry fetch failed: ${response.status} ${response.statusText}`);
|
|
117
|
+
}
|
|
118
|
+
const registry = await response.json();
|
|
119
|
+
const modules = Array.isArray(registry.modules)
|
|
120
|
+
? registry.modules.filter((m) => typeof m?.id === "string" && typeof m?.entry === "string" && typeof m?.version === "string")
|
|
121
|
+
: [];
|
|
122
|
+
// 3. Compatibility filter
|
|
123
|
+
const compatible = modules.filter((mod) => {
|
|
124
|
+
const fwRange = mod.compatibleWith?.dependencies?.["@vc-shell/framework"];
|
|
125
|
+
if (!fwRange)
|
|
126
|
+
return true;
|
|
127
|
+
const range = humanizeRange(fwRange);
|
|
128
|
+
const coerced = semver.coerce(frameworkVersion)?.version ?? frameworkVersion;
|
|
129
|
+
const ok = semver.satisfies(coerced, range);
|
|
130
|
+
if (!ok)
|
|
131
|
+
console.warn(`[mf-host] Module "${mod.id}" v${mod.version} requires framework ${range}, current ${frameworkVersion}. Skipping.`);
|
|
132
|
+
return ok;
|
|
133
|
+
});
|
|
134
|
+
if (compatible.length === 0) {
|
|
135
|
+
modulesReady.value = true;
|
|
136
|
+
performance.mark("vc:modules-done");
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// 4. Init MF runtime
|
|
140
|
+
const shared = {};
|
|
141
|
+
for (const [name, entry] of Object.entries(SHARED_LIBS)) {
|
|
142
|
+
shared[name] = {
|
|
143
|
+
version: entry.version,
|
|
144
|
+
lib: entry.lib,
|
|
145
|
+
shareConfig: { singleton: true, requiredVersion: entry.requiredVersion },
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
init({
|
|
149
|
+
name: "host",
|
|
150
|
+
remotes: compatible.map((mod) => ({ name: mod.id, entry: mod.entry, type: "module" })),
|
|
151
|
+
shared,
|
|
152
|
+
});
|
|
153
|
+
// 5. Load all in parallel
|
|
154
|
+
const results = await Promise.allSettled(compatible.map(async (mod) => ({ mod, exports: await loadRemote(`${mod.id}/module`) })));
|
|
155
|
+
performance.mark("vc:modules-loaded");
|
|
156
|
+
const loaded = [];
|
|
157
|
+
const failed = [];
|
|
158
|
+
for (let i = 0; i < results.length; i++) {
|
|
159
|
+
const r = results[i];
|
|
160
|
+
if (r.status === "fulfilled")
|
|
161
|
+
loaded.push(r.value);
|
|
162
|
+
else
|
|
163
|
+
failed.push({ mod: compatible[i], error: r.reason });
|
|
164
|
+
}
|
|
165
|
+
for (const { mod, error } of failed)
|
|
166
|
+
console.error(`[mf-host] Failed to load "${mod.id}":`, error);
|
|
167
|
+
// 6. Install plugins
|
|
168
|
+
for (const { mod, exports } of loaded) {
|
|
169
|
+
const plugins = resolvePlugins(exports);
|
|
170
|
+
if (plugins.length > 0) {
|
|
171
|
+
for (const plugin of plugins)
|
|
172
|
+
app.use(plugin, { router: options.router });
|
|
173
|
+
console.info(`[mf-host] "${mod.id}" v${mod.version} installed (${plugins.length} sub-module(s)).`);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
console.error(`[mf-host] "${mod.id}" has no install function. Skipping.`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (failed.length > 0) {
|
|
180
|
+
console.warn(`[mf-host] ${loaded.length}/${compatible.length} modules loaded. Failed: [${failed.map((f) => f.mod.id).join(", ")}]`);
|
|
181
|
+
}
|
|
182
|
+
performance.mark("vc:modules-installed");
|
|
183
|
+
modulesReady.value = true;
|
|
184
|
+
const resolvedPath = options.router.currentRoute.value.fullPath;
|
|
185
|
+
if (resolvedPath !== "/")
|
|
186
|
+
options.router.replace(resolvedPath);
|
|
187
|
+
performance.mark("vc:modules-done");
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
console.error("[mf-host] Module loading failed:", error);
|
|
191
|
+
modulesLoadError.value = true;
|
|
192
|
+
performance.mark("vc:modules-done");
|
|
193
|
+
}
|
|
194
|
+
})();
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=register-remote-modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-remote-modules.js","sourceRoot":"","sources":["../src/register-remote-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAyB,MAAM,KAAK,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEvE,oEAAoE;AACpE,qDAAqD;AACrD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAC;AAEjD,uFAAuF;AACvF,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAE5D,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAE7C,oGAAoG;AACpG,yFAAyF;AACzF,MAAM,WAAW,GAAqF;IACpG,GAAG,EAAqB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAU,OAAO,EAAE,MAAM,CAAC,OAAO,EAAoC,eAA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AAE,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,6BAA6B,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACtI,CAAC;YAED,WAAW,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACzC,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;YAE1B,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC;YAChE,IAAI,YAAY,KAAK,GAAG;gBAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAE/D,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YACzD,gBAAgB,CAAC,KAAK,GAAG,IAAI,CAAC;YAC9B,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vc-shell/mf-host",
|
|
3
|
+
"description": "Module Federation host runtime for VC Shell — discovers and loads remote modules",
|
|
4
|
+
"version": "2.0.0-alpha.8",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc && tsc-alias",
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"test:watch": "vitest"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@module-federation/enhanced": "^2.1.0",
|
|
18
|
+
"semver": "^7.6.2"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@vc-shell/framework": "^2.0.0-alpha.7",
|
|
22
|
+
"@vueuse/core": "^10.0.0",
|
|
23
|
+
"lodash-es": "^4.0.0",
|
|
24
|
+
"vee-validate": "^4.0.0",
|
|
25
|
+
"vue": "^3.4.0",
|
|
26
|
+
"vue-i18n": "^9.0.0",
|
|
27
|
+
"vue-router": "^4.0.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/semver": "^7.5.0",
|
|
31
|
+
"@vc-shell/framework": "2.0.0-alpha.8",
|
|
32
|
+
"@vc-shell/ts-config": "2.0.0-alpha.8",
|
|
33
|
+
"@vueuse/core": "^10.7.1",
|
|
34
|
+
"lodash-es": "^4.17.21",
|
|
35
|
+
"tsc-alias": "^1.8.8",
|
|
36
|
+
"typescript": "^5.8.3",
|
|
37
|
+
"vee-validate": "^4.12.4",
|
|
38
|
+
"vitest": "^3.2.4",
|
|
39
|
+
"vue": "^3.5.13",
|
|
40
|
+
"vue-i18n": "^11.3.0",
|
|
41
|
+
"vue-router": "^4.5.0"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"registry": "https://registry.npmjs.org/"
|
|
46
|
+
}
|
|
47
|
+
}
|