@module-federation/webpack-bundler-runtime 2.1.0 → 2.2.0

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.
@@ -0,0 +1,18 @@
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ const require_attachShareScopeMap = require('./attachShareScopeMap.cjs');
4
+ const require_index = require('./index.cjs');
5
+ let _module_federation_runtime = require("@module-federation/runtime");
6
+
7
+ exports.attachShareScopeMap = require_attachShareScopeMap.attachShareScopeMap;
8
+ exports.bundlerRuntime = require_index.bundlerRuntime;
9
+ exports.bundlerRuntimeOptions = require_index.bundlerRuntimeOptions;
10
+ exports.default = require_index.default;
11
+ exports.initOptions = require_index.initOptions;
12
+ exports.instance = require_index.instance;
13
+ Object.defineProperty(exports, 'runtime', {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _module_federation_runtime;
17
+ }
18
+ });
@@ -0,0 +1,4 @@
1
+ import { attachShareScopeMap } from "./attachShareScopeMap.js";
2
+ import { ConsumesLoadingData, ConsumesOptions, CoreRemotesOptions, Federation, GetSharedFallbackGetterOptions, HandleInitialConsumesOptions, IdToExternalAndNameMapping, IdToRemoteMap, IdToRemoteMapItem, InitContainerEntryOptions, InitializeSharingData, InitializeSharingOptions, InstallInitialConsumesOptions, ModuleId, ModuleIdToRemoteDataMapping, RemoteChunkMapping, RemoteDataItem, RemoteEntryExports, RemoteInfos, RemotesLoadingData, RemotesOptions, ShareScopeMap, WebpackRequire } from "./types.js";
3
+ import federation, { bundlerRuntime, bundlerRuntimeOptions, initOptions, instance, runtime } from "./index.js";
4
+ export { ConsumesLoadingData, ConsumesOptions, CoreRemotesOptions, Federation, GetSharedFallbackGetterOptions, HandleInitialConsumesOptions, IdToExternalAndNameMapping, IdToRemoteMap, IdToRemoteMapItem, InitContainerEntryOptions, InitializeSharingData, InitializeSharingOptions, InstallInitialConsumesOptions, ModuleId, ModuleIdToRemoteDataMapping, RemoteChunkMapping, RemoteDataItem, RemoteEntryExports, RemoteInfos, RemotesLoadingData, RemotesOptions, ShareScopeMap, WebpackRequire, attachShareScopeMap, bundlerRuntime, bundlerRuntimeOptions, federation as default, initOptions, instance, runtime };
@@ -0,0 +1,4 @@
1
+ import { attachShareScopeMap } from "./attachShareScopeMap.js";
2
+ import federation, { bundlerRuntime, bundlerRuntimeOptions, initOptions, instance, runtime } from "./index.js";
3
+
4
+ export { attachShareScopeMap, bundlerRuntime, bundlerRuntimeOptions, federation as default, initOptions, instance, runtime };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { Remote, Shared, SharedGetter, UserOptions } from "./runtime-core/dist/type/config.js";
2
- import "./runtime-core/dist/index.js";
3
- import "./runtime-core/dist/types.js";
4
2
  import { ExternalsType } from "./sdk/dist/types/plugins/ModuleFederationPlugin.js";
5
3
  import { initializeSharing } from "./initializeSharing.js";
6
4
  import { attachShareScopeMap } from "./attachShareScopeMap.js";
@@ -5,12 +5,10 @@ import { AsyncWaterfallHook } from "./utils/hooks/asyncWaterfallHooks.js";
5
5
  import { PluginSystem } from "./utils/hooks/pluginSystem.js";
6
6
  import { CallFrom, InitScope, Options, Remote, RemoteEntryExports, RemoteEntryInitOptions, RemoteInfo, ShareInfos, ShareScopeMap, Shared, UserOptions } from "./type/config.js";
7
7
  import { PreloadRemoteArgs } from "./type/preload.js";
8
- import "./type/index.js";
9
8
  import { RemoteHandler } from "./remote/index.js";
10
9
  import { SharedHandler } from "./shared/index.js";
11
10
  import { SnapshotHandler } from "./plugins/snapshot/SnapshotHandler.js";
12
11
  import { getRemoteEntry } from "./utils/load.js";
13
- import "./utils/index.js";
14
12
  import { Module$1 } from "./module/index.js";
15
13
  import { CreateScriptHookReturn, GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
16
14
 
@@ -1,5 +1,4 @@
1
1
  import { GlobalShareScopeMap, RemoteEntryExports } from "./type/config.js";
2
- import "./type/index.js";
3
2
  import { ModuleFederationRuntimePlugin } from "./type/plugin.js";
4
3
  import { ModuleFederation } from "./core.js";
5
4
  import { GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
@@ -1,4 +1 @@
1
- import "./global.js";
2
- import "./utils/index.js";
3
- import "./utils/preload.js";
4
- import "./utils/share.js";
1
+ export { };
@@ -1,15 +1,6 @@
1
1
  import { UserOptions } from "./type/config.js";
2
- import "./type/index.js";
3
2
  import { ModuleFederationRuntimePlugin } from "./type/plugin.js";
4
3
  import { Federation, getGlobalSnapshot } from "./global.js";
5
4
  import { getRemoteEntry } from "./utils/load.js";
6
- import "./utils/index.js";
7
5
  import { ModuleFederation } from "./core.js";
8
- import { Module$1 } from "./module/index.js";
9
- import "./utils/tool.js";
10
- import "./utils/manifest.js";
11
- import "./utils/logger.js";
12
- import "./utils/preload.js";
13
- import "./utils/share.js";
14
- import "./helpers.js";
15
- import "@module-federation/sdk";
6
+ import { Module$1 } from "./module/index.js";
@@ -1,5 +1,4 @@
1
1
  import { InitScope, RemoteEntryExports, RemoteInfo } from "../type/config.js";
2
- import "../type/index.js";
3
2
  import { ModuleFederation } from "../core.js";
4
3
  import { ModuleInfo } from "@module-federation/sdk";
5
4
 
@@ -2,7 +2,6 @@ import { AsyncHook } from "../../utils/hooks/asyncHook.js";
2
2
  import { AsyncWaterfallHook } from "../../utils/hooks/asyncWaterfallHooks.js";
3
3
  import { PluginSystem } from "../../utils/hooks/pluginSystem.js";
4
4
  import { Options, Remote } from "../../type/config.js";
5
- import "../../type/index.js";
6
5
  import { getGlobalSnapshot } from "../../global.js";
7
6
  import { ModuleFederation } from "../../core.js";
8
7
  import { GlobalModuleInfo, Manifest, ModuleInfo } from "@module-federation/sdk";
@@ -5,7 +5,6 @@ import { AsyncWaterfallHook } from "../utils/hooks/asyncWaterfallHooks.js";
5
5
  import { PluginSystem } from "../utils/hooks/pluginSystem.js";
6
6
  import { CallFrom, Options, Remote, RemoteEntryExports, RemoteInfo, UserOptions } from "../type/config.js";
7
7
  import { PreloadAssets, PreloadOptions, PreloadRemoteArgs } from "../type/preload.js";
8
- import "../type/index.js";
9
8
  import { ModuleFederation } from "../core.js";
10
9
  import { Module$1, ModuleOptions } from "../module/index.js";
11
10
  import { GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
@@ -3,7 +3,6 @@ import { SyncWaterfallHook } from "../utils/hooks/syncWaterfallHook.js";
3
3
  import { AsyncWaterfallHook } from "../utils/hooks/asyncWaterfallHooks.js";
4
4
  import { PluginSystem } from "../utils/hooks/pluginSystem.js";
5
5
  import { CallFrom, InitScope, InitTokens, Options, ShareInfos, ShareScopeMap, ShareStrategy, Shared, UserOptions } from "../type/config.js";
6
- import "../type/index.js";
7
6
  import { LoadRemoteMatch } from "../remote/index.js";
8
7
  import { Federation } from "../global.js";
9
8
  import { ModuleFederation } from "../core.js";
@@ -1,3 +1 @@
1
- import "./config.js";
2
- import "./preload.js";
3
- import "./plugin.js";
1
+ export { };
@@ -1,4 +1,3 @@
1
1
  import { CallFrom, GlobalShareScopeMap, InitScope, InitTokens, Optional, Options, Remote, RemoteEntryExports, RemoteEntryInitOptions, RemoteInfo, RemoteInfoCommon, ShareArgs, ShareInfos, ShareScopeMap, ShareStrategy, Shared, SharedConfig, SharedGetter, TreeShakingArgs, UserOptions } from "./type/config.js";
2
2
  import { EntryAssets, PreloadAssets, PreloadConfig, PreloadOptions, PreloadRemoteArgs, depsPreloadArg } from "./type/preload.js";
3
- import "./type/index.js";
4
3
  import { ModuleFederationRuntimePlugin } from "./type/plugin.js";
@@ -1,5 +1,4 @@
1
1
  import { RemoteEntryExports, RemoteInfo } from "../type/config.js";
2
- import "../type/index.js";
3
2
  import { ModuleFederation } from "../core.js";
4
3
 
5
4
  //#region ../runtime-core/dist/utils/load.d.ts
@@ -1,2 +1 @@
1
- import "../type/config.js";
2
- import "../type/index.js";
1
+ export { };
@@ -1,4 +1 @@
1
- import "../type/config.js";
2
- import "../type/preload.js";
3
- import "../type/index.js";
4
- import "../core.js";
1
+ export { };
@@ -1,3 +1 @@
1
- import "../type/config.js";
2
- import "../type/index.js";
3
- import "../global.js";
1
+ export { };
@@ -1,12 +1,10 @@
1
- import "webpack";
2
-
3
1
  //#region ../sdk/dist/types/plugins/ModuleFederationPlugin.d.ts
4
2
  /**
5
3
  * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
6
4
  */
7
- type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'script' | 'module-import' | 'node-commonjs';
5
+ type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'script' | 'node-commonjs';
8
6
  /**
9
- * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
7
+ * Container location from which modules should be resolved and loaded at runtime.
10
8
  */
11
9
  //#endregion
12
10
  export { ExternalsType };
package/dist/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { initializeSharing } from "./initializeSharing.js";
2
2
  import { attachShareScopeMap } from "./attachShareScopeMap.js";
3
3
  import { initContainerEntry } from "./initContainerEntry.js";
4
- import * as runtime from "@module-federation/runtime";
5
4
  import { moduleFederationPlugin } from "@module-federation/sdk";
5
+ import * as runtime from "@module-federation/runtime";
6
6
  import { Remote, RemoteEntryInitOptions, SharedConfig, SharedGetter, TreeShakingArgs } from "@module-federation/runtime/types";
7
7
 
8
8
  //#region src/types.d.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "@module-federation/webpack-bundler-runtime",
4
- "version": "2.1.0",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Module Federation Runtime for webpack",
@@ -26,8 +26,8 @@
26
26
  "module": "./dist/index.js",
27
27
  "types": "./dist/index.d.ts",
28
28
  "dependencies": {
29
- "@module-federation/runtime": "2.1.0",
30
- "@module-federation/sdk": "2.1.0"
29
+ "@module-federation/runtime": "2.2.0",
30
+ "@module-federation/sdk": "2.2.0"
31
31
  },
32
32
  "exports": {
33
33
  ".": {
@@ -50,6 +50,7 @@
50
50
  "default": "./dist/constant.cjs"
51
51
  }
52
52
  },
53
+ "./bundler": "./dist/bundler.js",
53
54
  "./*": "./*"
54
55
  },
55
56
  "typesVersions": {
@@ -59,7 +60,17 @@
59
60
  ],
60
61
  "constant": [
61
62
  "./dist/constant.d.ts"
63
+ ],
64
+ "bundler": [
65
+ "./dist/bundler.d.ts"
62
66
  ]
63
67
  }
68
+ },
69
+ "scripts": {
70
+ "build": "tsdown --config tsdown.config.ts --filter webpack-bundler-runtime-build",
71
+ "lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.ts\" \"package.json\"",
72
+ "test": "pnpm exec jest --config jest.config.cjs --passWithNoTests",
73
+ "test:ci": "pnpm exec jest --config jest.config.cjs --passWithNoTests --ci --coverage",
74
+ "pre-release": "pnpm run test && pnpm run build"
64
75
  }
65
76
  }
@@ -1 +0,0 @@
1
- import "@module-federation/sdk";
@@ -1,2 +0,0 @@
1
- import "./env.js";
2
- import "./plugin.js";
@@ -1 +0,0 @@
1
- import "@module-federation/sdk";
@@ -1,2 +0,0 @@
1
- import "../type/index.js";
2
- import "../core.js";
@@ -1 +0,0 @@
1
- import "../type/index.js";