@vc-shell/mf-config 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/shared-deps.d.ts +23 -0
- package/dist/shared-deps.d.ts.map +1 -0
- package/dist/shared-deps.js +33 -0
- package/dist/shared-deps.js.map +1 -0
- package/package.json +23 -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,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,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,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface SharedDepConfig {
|
|
2
|
+
singleton?: boolean;
|
|
3
|
+
requiredVersion?: string;
|
|
4
|
+
eager?: boolean;
|
|
5
|
+
import?: false | string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Canonical list of shared dependency names.
|
|
9
|
+
* This is the SINGLE SOURCE OF TRUTH — loader and build configs import this
|
|
10
|
+
* to build their runtime shared config, ensuring build and runtime stay in sync.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SHARED_DEP_NAMES: ReadonlyArray<"vue" | "vue-router" | "vue-i18n" | "vee-validate" | "lodash-es" | "@vueuse/core" | "@vc-shell/framework">;
|
|
13
|
+
/**
|
|
14
|
+
* Shared deps for HOST app — bundles all deps (provides them to remotes).
|
|
15
|
+
*/
|
|
16
|
+
export declare const DEFAULT_SHARED: Record<string, SharedDepConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* Shared deps for REMOTE modules — `import: false` prevents bundling fallback chunks.
|
|
19
|
+
* The remote relies entirely on the host to provide these deps at runtime.
|
|
20
|
+
* This eliminates multi-MB fallback bundles (vue, framework, lodash, etc).
|
|
21
|
+
*/
|
|
22
|
+
export declare const REMOTE_SHARED: Record<string, SharedDepConfig>;
|
|
23
|
+
//# sourceMappingURL=shared-deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-deps.d.ts","sourceRoot":"","sources":["../src/shared-deps.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACzB;AAgBD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAoC,aAAa,CAC5E,KAAK,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,GAAG,cAAc,GAAG,qBAAqB,CAC1G,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAA2B,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAKzD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base shared dependency definitions for Module Federation.
|
|
3
|
+
* Both host and remote use the same dep list with singleton negotiation.
|
|
4
|
+
*/
|
|
5
|
+
const SHARED_DEPS_BASE = {
|
|
6
|
+
vue: { singleton: true, requiredVersion: "^3.4.0" },
|
|
7
|
+
"vue-router": { singleton: true, requiredVersion: "^4.0.0" },
|
|
8
|
+
"vue-i18n": { singleton: true, requiredVersion: "^9.0.0" },
|
|
9
|
+
"vee-validate": { singleton: true },
|
|
10
|
+
"lodash-es": { singleton: true },
|
|
11
|
+
"@vueuse/core": { singleton: true },
|
|
12
|
+
"@vc-shell/framework": { singleton: true },
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Canonical list of shared dependency names.
|
|
16
|
+
* This is the SINGLE SOURCE OF TRUTH — loader and build configs import this
|
|
17
|
+
* to build their runtime shared config, ensuring build and runtime stay in sync.
|
|
18
|
+
*/
|
|
19
|
+
export const SHARED_DEP_NAMES = Object.keys(SHARED_DEPS_BASE);
|
|
20
|
+
/**
|
|
21
|
+
* Shared deps for HOST app — bundles all deps (provides them to remotes).
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_SHARED = { ...SHARED_DEPS_BASE };
|
|
24
|
+
/**
|
|
25
|
+
* Shared deps for REMOTE modules — `import: false` prevents bundling fallback chunks.
|
|
26
|
+
* The remote relies entirely on the host to provide these deps at runtime.
|
|
27
|
+
* This eliminates multi-MB fallback bundles (vue, framework, lodash, etc).
|
|
28
|
+
*/
|
|
29
|
+
export const REMOTE_SHARED = Object.fromEntries(Object.entries(SHARED_DEPS_BASE).map(([key, config]) => [
|
|
30
|
+
key,
|
|
31
|
+
{ ...config, import: false },
|
|
32
|
+
]));
|
|
33
|
+
//# sourceMappingURL=shared-deps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-deps.js","sourceRoot":"","sources":["../src/shared-deps.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,gBAAgB,GAAoD;IACxE,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE;IACnD,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE;IAC5D,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE;IAC1D,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IACnC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IAChC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IACnC,qBAAqB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAE3D,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAoC,EAAE,GAAG,gBAAgB,EAAE,CAAC;AAEvF;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAoC,MAAM,CAAC,WAAW,CAC9E,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;IACtD,GAAG;IACH,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAc,EAAE;CACtC,CAAC,CACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vc-shell/mf-config",
|
|
3
|
+
"description": "Module Federation shared dependency catalog for VC Shell",
|
|
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
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@vc-shell/ts-config": "2.0.0-alpha.8",
|
|
16
|
+
"tsc-alias": "^1.8.8",
|
|
17
|
+
"typescript": "^5.8.3"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org/"
|
|
22
|
+
}
|
|
23
|
+
}
|