@module-federation/inject-external-runtime-core-plugin 0.24.1 → 2.0.1
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/dist/index.cjs.cjs +17 -11
- package/dist/index.cjs.cjs.map +1 -1
- package/dist/index.esm.js +17 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/package.json +3 -3
package/dist/index.cjs.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var runtimeCoreDefault = require('@module-federation/runtime-tools/runtime-core');
|
|
4
4
|
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
var n = Object.create(null);
|
|
@@ -13,24 +13,30 @@ function _interopNamespaceDefault(e) {
|
|
|
13
13
|
return Object.freeze(n);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var runtimeCoreDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(runtimeCoreDefault);
|
|
17
17
|
|
|
18
|
+
const runtimeCore = runtimeCoreDefault ??
|
|
19
|
+
runtimeCoreDefault__namespace;
|
|
18
20
|
function injectExternalRuntimeCorePlugin() {
|
|
19
21
|
return {
|
|
20
22
|
name: 'inject-external-runtime-core-plugin',
|
|
21
|
-
version: "0.
|
|
23
|
+
version: "2.0.1",
|
|
22
24
|
beforeInit(args) {
|
|
25
|
+
const globalRef = runtimeCore.Global;
|
|
26
|
+
if (!globalRef || typeof globalRef !== 'object') {
|
|
27
|
+
return args;
|
|
28
|
+
}
|
|
23
29
|
const name = args.options.name;
|
|
24
|
-
const version = "0.
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
console.warn(`Detect multiple module federation runtime! Injected runtime from ${
|
|
30
|
+
const version = "2.0.1";
|
|
31
|
+
if (globalRef._FEDERATION_RUNTIME_CORE &&
|
|
32
|
+
globalRef._FEDERATION_RUNTIME_CORE_FROM &&
|
|
33
|
+
(globalRef._FEDERATION_RUNTIME_CORE_FROM.name !== name ||
|
|
34
|
+
globalRef._FEDERATION_RUNTIME_CORE_FROM.version !== version)) {
|
|
35
|
+
console.warn(`Detect multiple module federation runtime! Injected runtime from ${globalRef._FEDERATION_RUNTIME_CORE_FROM.name}@${globalRef._FEDERATION_RUNTIME_CORE_FROM.version} and current is ${name}@${version}, pleasure ensure there is only one consumer to provider runtime!`);
|
|
30
36
|
return args;
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
globalRef._FEDERATION_RUNTIME_CORE = runtimeCore;
|
|
39
|
+
globalRef._FEDERATION_RUNTIME_CORE_FROM = {
|
|
34
40
|
version,
|
|
35
41
|
name,
|
|
36
42
|
};
|
package/dist/index.cjs.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.cjs","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.cjs.cjs","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["runtimeCoreNamespace"],"mappings":";;;;;;;;;;;;;;;;;AAGA,MAAM,WAAW,GACd,kBAA8D;AAC/D,IAAAA,6BAAoB;AAUtB,SAAS,+BAA+B,GAAA;IACtC,OAAO;AACL,QAAA,IAAI,EAAE,qCAAqC;AAC3C,QAAA,OAAO,EAAE,OAAW;AACpB,QAAA,UAAU,CAAC,IAAI,EAAA;AACb,YAAA,MAAM,SAAS,GACb,WAGD,CAAC,MAAM;YACR,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;AAC/C,gBAAA,OAAO,IAAI;YACb;AACA,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI;YAC9B,MAAM,OAAO,GAAG,OAAW;YAC3B,IACE,SAAS,CAAC,wBAAwB;AAClC,gBAAA,SAAS,CAAC,6BAA6B;AACvC,iBAAC,SAAS,CAAC,6BAA6B,CAAC,IAAI,KAAK,IAAI;oBACpD,SAAS,CAAC,6BAA6B,CAAC,OAAO,KAAK,OAAO,CAAC,EAC9D;gBACA,OAAO,CAAC,IAAI,CACV,CAAA,iEAAA,EAAoE,SAAS,CAAC,6BAA6B,CAAC,IAAI,CAAA,CAAA,EAAI,SAAS,CAAC,6BAA6B,CAAC,OAAO,CAAA,gBAAA,EAAmB,IAAI,CAAA,CAAA,EAAI,OAAO,CAAA,iEAAA,CAAmE,CACzQ;AACD,gBAAA,OAAO,IAAI;YACb;AACA,YAAA,SAAS,CAAC,wBAAwB,GAAG,WAAW;YAChD,SAAS,CAAC,6BAA6B,GAAG;gBACxC,OAAO;gBACP,IAAI;aACL;AACD,YAAA,OAAO,IAAI;QACb,CAAC;KACF;AACH;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as runtimeCoreDefault from '@module-federation/runtime-tools/runtime-core';
|
|
2
|
+
import runtimeCoreDefault__default from '@module-federation/runtime-tools/runtime-core';
|
|
2
3
|
|
|
4
|
+
const runtimeCore = runtimeCoreDefault__default ??
|
|
5
|
+
runtimeCoreDefault;
|
|
3
6
|
function injectExternalRuntimeCorePlugin() {
|
|
4
7
|
return {
|
|
5
8
|
name: 'inject-external-runtime-core-plugin',
|
|
6
|
-
version: "0.
|
|
9
|
+
version: "2.0.1",
|
|
7
10
|
beforeInit(args) {
|
|
11
|
+
const globalRef = runtimeCore.Global;
|
|
12
|
+
if (!globalRef || typeof globalRef !== 'object') {
|
|
13
|
+
return args;
|
|
14
|
+
}
|
|
8
15
|
const name = args.options.name;
|
|
9
|
-
const version = "0.
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
(
|
|
13
|
-
|
|
14
|
-
console.warn(`Detect multiple module federation runtime! Injected runtime from ${
|
|
16
|
+
const version = "2.0.1";
|
|
17
|
+
if (globalRef._FEDERATION_RUNTIME_CORE &&
|
|
18
|
+
globalRef._FEDERATION_RUNTIME_CORE_FROM &&
|
|
19
|
+
(globalRef._FEDERATION_RUNTIME_CORE_FROM.name !== name ||
|
|
20
|
+
globalRef._FEDERATION_RUNTIME_CORE_FROM.version !== version)) {
|
|
21
|
+
console.warn(`Detect multiple module federation runtime! Injected runtime from ${globalRef._FEDERATION_RUNTIME_CORE_FROM.name}@${globalRef._FEDERATION_RUNTIME_CORE_FROM.version} and current is ${name}@${version}, pleasure ensure there is only one consumer to provider runtime!`);
|
|
15
22
|
return args;
|
|
16
23
|
}
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
globalRef._FEDERATION_RUNTIME_CORE = runtimeCore;
|
|
25
|
+
globalRef._FEDERATION_RUNTIME_CORE_FROM = {
|
|
19
26
|
version,
|
|
20
27
|
name,
|
|
21
28
|
};
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["runtimeCoreDefault","runtimeCoreNamespace"],"mappings":";;;AAGA,MAAM,WAAW,GACdA,2BAA8D;AAC/D,IAAAC,kBAAoB;AAUtB,SAAS,+BAA+B,GAAA;IACtC,OAAO;AACL,QAAA,IAAI,EAAE,qCAAqC;AAC3C,QAAA,OAAO,EAAE,OAAW;AACpB,QAAA,UAAU,CAAC,IAAI,EAAA;AACb,YAAA,MAAM,SAAS,GACb,WAGD,CAAC,MAAM;YACR,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;AAC/C,gBAAA,OAAO,IAAI;YACb;AACA,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI;YAC9B,MAAM,OAAO,GAAG,OAAW;YAC3B,IACE,SAAS,CAAC,wBAAwB;AAClC,gBAAA,SAAS,CAAC,6BAA6B;AACvC,iBAAC,SAAS,CAAC,6BAA6B,CAAC,IAAI,KAAK,IAAI;oBACpD,SAAS,CAAC,6BAA6B,CAAC,OAAO,KAAK,OAAO,CAAC,EAC9D;gBACA,OAAO,CAAC,IAAI,CACV,CAAA,iEAAA,EAAoE,SAAS,CAAC,6BAA6B,CAAC,IAAI,CAAA,CAAA,EAAI,SAAS,CAAC,6BAA6B,CAAC,OAAO,CAAA,gBAAA,EAAmB,IAAI,CAAA,CAAA,EAAI,OAAO,CAAA,iEAAA,CAAmE,CACzQ;AACD,gBAAA,OAAO,IAAI;YACb;AACA,YAAA,SAAS,CAAC,wBAAwB,GAAG,WAAW;YAChD,SAAS,CAAC,6BAA6B,GAAG;gBACxC,OAAO;gBACP,IAAI;aACL;AACD,YAAA,OAAO,IAAI;QACb,CAAC;KACF;AACH;;;;"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import runtimeCoreDefault from '@module-federation/runtime-tools/runtime-core';
|
|
2
2
|
import type { ModuleFederationRuntimePlugin } from '@module-federation/runtime-tools/runtime-core';
|
|
3
|
+
declare const runtimeCore: typeof runtimeCoreDefault;
|
|
3
4
|
declare global {
|
|
4
5
|
var __VERSION__: string;
|
|
5
6
|
var _FEDERATION_RUNTIME_CORE: typeof runtimeCore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/inject-external-runtime-core-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A sdk for support module federation",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@module-federation/runtime-tools": "0.
|
|
43
|
+
"@module-federation/runtime-tools": "2.0.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@module-federation/runtime-tools": "0.
|
|
46
|
+
"@module-federation/runtime-tools": "2.0.1"
|
|
47
47
|
}
|
|
48
48
|
}
|