@module-federation/inject-external-runtime-core-plugin 2.1.0 → 2.2.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/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # `@module-federation/inject-external-runtime-core-plugin`
1
+ # `@module-federation/inject-external-runtime-core-plugin`
2
2
 
3
- This runtime plugin will inject `@module-federation/runtime-core` .
3
+ This runtime plugin will inject `@module-federation/runtime-core` .
4
4
 
5
- And the plugin will be automatic applied when set `experiments.externalRuntime: 'provide'` by build plugin.
5
+ And the plugin will be automatic applied when set `experiments.externalRuntime: 'provide'` by build plugin.
6
6
 
7
7
  The provider can use host's runtime when set `experiments.externalRuntime: true`.
package/dist/index.cjs CHANGED
@@ -7,12 +7,12 @@ const runtimeCore = _module_federation_runtime_tools_runtime_core.default ?? _mo
7
7
  function injectExternalRuntimeCorePlugin() {
8
8
  return {
9
9
  name: "inject-external-runtime-core-plugin",
10
- version: "2.1.0",
10
+ version: "2.2.1",
11
11
  beforeInit(args) {
12
12
  const globalRef = runtimeCore.Global;
13
13
  if (!globalRef || typeof globalRef !== "object") return args;
14
14
  const name = args.options.name;
15
- const version = "2.1.0";
15
+ const version = "2.2.1";
16
16
  if (globalRef._FEDERATION_RUNTIME_CORE && globalRef._FEDERATION_RUNTIME_CORE_FROM && (globalRef._FEDERATION_RUNTIME_CORE_FROM.name !== name || globalRef._FEDERATION_RUNTIME_CORE_FROM.version !== version)) {
17
17
  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!`);
18
18
  return args;
package/dist/index.js CHANGED
@@ -6,12 +6,12 @@ const runtimeCore = runtimeCoreDefault ?? runtimeCoreNamespace;
6
6
  function injectExternalRuntimeCorePlugin() {
7
7
  return {
8
8
  name: "inject-external-runtime-core-plugin",
9
- version: "2.1.0",
9
+ version: "2.2.1",
10
10
  beforeInit(args) {
11
11
  const globalRef = runtimeCore.Global;
12
12
  if (!globalRef || typeof globalRef !== "object") return args;
13
13
  const name = args.options.name;
14
- const version = "2.1.0";
14
+ const version = "2.2.1";
15
15
  if (globalRef._FEDERATION_RUNTIME_CORE && globalRef._FEDERATION_RUNTIME_CORE_FROM && (globalRef._FEDERATION_RUNTIME_CORE_FROM.name !== name || globalRef._FEDERATION_RUNTIME_CORE_FROM.version !== version)) {
16
16
  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!`);
17
17
  return args;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/inject-external-runtime-core-plugin",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "A sdk for support module federation",
@@ -45,9 +45,14 @@
45
45
  }
46
46
  },
47
47
  "peerDependencies": {
48
- "@module-federation/runtime-tools": "2.1.0"
48
+ "@module-federation/runtime-tools": "2.2.1"
49
49
  },
50
50
  "devDependencies": {
51
- "@module-federation/runtime-tools": "2.1.0"
51
+ "@module-federation/runtime-tools": "2.2.1"
52
+ },
53
+ "scripts": {
54
+ "build": "tsdown --config tsdown.config.ts --filter inject-external-runtime-core-plugin-build",
55
+ "lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.ts\" \"package.json\"",
56
+ "pre-release": "pnpm run build"
52
57
  }
53
58
  }