@module-federation/enhanced 0.0.8 → 0.0.9
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/package.json +2 -1
- package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
- package/dist/src/declarations/plugins/container/ContainerPlugin.d.ts +187 -0
- package/dist/src/declarations/plugins/container/ContainerReferencePlugin.d.ts +80 -0
- package/dist/src/declarations/plugins/container/Dependency.d.ts +285 -0
- package/dist/src/declarations/plugins/container/Module.d.ts +138 -0
- package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +33 -0
- package/dist/src/declarations/plugins/container/ModuleFederationPlugin.d.ts +320 -0
- package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +4 -0
- package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
- package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
- package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
- package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
- package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
- package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
- package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
- package/dist/src/lib/container/ContainerEntryDependency.d.ts +22 -20
- package/dist/src/lib/container/ContainerEntryModule.d.ts +70 -81
- package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +14 -10
- package/dist/src/lib/container/ContainerExposedDependency.d.ts +18 -25
- package/dist/src/lib/container/ContainerPlugin.d.ts +31 -10
- package/dist/src/lib/container/ContainerReferencePlugin.d.ts +27 -12
- package/dist/src/lib/container/FallbackDependency.d.ts +14 -20
- package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -10
- package/dist/src/lib/container/FallbackModule.d.ts +52 -70
- package/dist/src/lib/container/FallbackModuleFactory.d.ts +10 -10
- package/dist/src/lib/container/ModuleFederationPlugin.d.ts +22 -15
- package/dist/src/lib/container/ModuleFederationPlugin.js +2 -2
- package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
- package/dist/src/lib/container/ModuleFederationPluginTypes.d.ts +271 -0
- package/dist/src/lib/container/ModuleFederationPluginTypes.js +8 -0
- package/dist/src/lib/container/ModuleFederationPluginTypes.js.map +1 -0
- package/dist/src/lib/container/RemoteModule.d.ts +88 -73
- package/dist/src/lib/container/RemoteRuntimeModule.d.ts +10 -7
- package/dist/src/lib/container/RemoteToExternalDependency.d.ts +3 -9
- package/dist/src/lib/container/options.d.ts +12 -4
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +11 -2
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -10
- package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +97 -104
- package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +28 -6
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js +1 -1
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +29 -11
- package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -11
- package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +35 -37
- package/dist/src/lib/sharing/ProvideSharedModule.d.ts +65 -83
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +17 -10
- package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +37 -19
- package/dist/src/lib/sharing/SharePlugin.d.ts +39 -13
- package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
- package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -8
- package/dist/src/lib/sharing/utils.d.ts +21 -29
- package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -7
- package/package.json +5 -4
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ProvideSharedPluginOptions, ProvidesConfig } from '../../declarations/plugins/sharing/ProvideSharedPlugin';
|
|
3
|
-
export type ProvideOptions = ProvidesConfig;
|
|
4
|
-
export type ResolvedProvideMap = Map<string, {
|
|
5
|
-
config: ProvideOptions;
|
|
6
|
-
version: string | undefined | false;
|
|
7
|
-
}>;
|
|
1
|
+
export = ProvideSharedPlugin;
|
|
8
2
|
/**
|
|
9
3
|
* @typedef {Object} ProvideOptions
|
|
10
4
|
* @property {string} shareKey
|
|
@@ -14,16 +8,40 @@ export type ResolvedProvideMap = Map<string, {
|
|
|
14
8
|
*/
|
|
15
9
|
/** @typedef {Map<string, { config: ProvideOptions, version: string | undefined | false }>} ResolvedProvideMap */
|
|
16
10
|
declare class ProvideSharedPlugin {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @param {ProvideSharedPluginOptions} options options
|
|
13
|
+
*/
|
|
14
|
+
constructor(options: any);
|
|
15
|
+
_provides: [string, ProvideOptions][];
|
|
16
|
+
/**
|
|
17
|
+
* Apply the plugin
|
|
18
|
+
* @param {Compiler} compiler the compiler instance
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
apply(compiler: Compiler): void;
|
|
22
|
+
}
|
|
23
|
+
declare namespace ProvideSharedPlugin {
|
|
24
|
+
export {
|
|
25
|
+
ProvideSharedPluginOptions,
|
|
26
|
+
Compilation,
|
|
27
|
+
Compiler,
|
|
28
|
+
ProvideOptions,
|
|
29
|
+
ResolvedProvideMap,
|
|
30
|
+
};
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
type ProvideOptions = {
|
|
33
|
+
shareKey: string;
|
|
34
|
+
shareScope: string;
|
|
35
|
+
version: string | undefined | false;
|
|
36
|
+
eager: boolean;
|
|
37
|
+
};
|
|
38
|
+
type Compiler = import('webpack/lib/Compiler');
|
|
39
|
+
type ProvideSharedPluginOptions = any;
|
|
40
|
+
type Compilation = import('webpack/lib/Compilation');
|
|
41
|
+
type ResolvedProvideMap = Map<
|
|
42
|
+
string,
|
|
43
|
+
{
|
|
44
|
+
config: ProvideOptions;
|
|
45
|
+
version: string | undefined | false;
|
|
46
|
+
}
|
|
47
|
+
>;
|
|
@@ -1,15 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export = SharePlugin;
|
|
2
|
+
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */
|
|
3
|
+
/** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */
|
|
4
|
+
/** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions} ProvideSharedPluginOptions */
|
|
5
|
+
/** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvidesConfig} ProvidesConfig */
|
|
6
|
+
/** @typedef {import("../../declarations/plugins/sharing/SharePlugin").SharePluginOptions} SharePluginOptions */
|
|
7
|
+
/** @typedef {import("../../declarations/plugins/sharing/SharePlugin").SharedConfig} SharedConfig */
|
|
8
|
+
/** @typedef {import("webpack/lib/Compiler")} Compiler */
|
|
3
9
|
declare class SharePlugin {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @param {SharePluginOptions} options options
|
|
12
|
+
*/
|
|
13
|
+
constructor(options: any);
|
|
14
|
+
_shareScope: any;
|
|
15
|
+
_consumes: Record<string, any>[];
|
|
16
|
+
_provides: Record<string, any>[];
|
|
17
|
+
/**
|
|
18
|
+
* Apply the plugin
|
|
19
|
+
* @param {Compiler} compiler the compiler instance
|
|
20
|
+
* @returns {void}
|
|
21
|
+
*/
|
|
22
|
+
apply(compiler: Compiler): void;
|
|
14
23
|
}
|
|
15
|
-
|
|
24
|
+
declare namespace SharePlugin {
|
|
25
|
+
export {
|
|
26
|
+
ConsumeSharedPluginOptions,
|
|
27
|
+
ConsumesConfig,
|
|
28
|
+
ProvideSharedPluginOptions,
|
|
29
|
+
ProvidesConfig,
|
|
30
|
+
SharePluginOptions,
|
|
31
|
+
SharedConfig,
|
|
32
|
+
Compiler,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
type Compiler = import('webpack/lib/Compiler');
|
|
36
|
+
type ConsumeSharedPluginOptions = any;
|
|
37
|
+
type ConsumesConfig = any;
|
|
38
|
+
type ProvideSharedPluginOptions = any;
|
|
39
|
+
type ProvidesConfig = any;
|
|
40
|
+
type SharePluginOptions = any;
|
|
41
|
+
type SharedConfig = any;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
export = ShareRuntimeModule;
|
|
2
|
+
/** @typedef {import("webpack/lib/Chunk")} Chunk */
|
|
3
|
+
/** @typedef {import("webpack/lib/ChunkGraph")} ChunkGraph */
|
|
4
|
+
/** @typedef {import("webpack/lib/Compilation")} Compilation */
|
|
2
5
|
declare class ShareRuntimeModule extends RuntimeModule {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @returns {string | null} runtime code
|
|
6
|
-
*/
|
|
7
|
-
generate(): string | null;
|
|
6
|
+
constructor();
|
|
8
7
|
}
|
|
9
|
-
|
|
8
|
+
declare namespace ShareRuntimeModule {
|
|
9
|
+
export { Chunk, ChunkGraph, Compilation };
|
|
10
|
+
}
|
|
11
|
+
import RuntimeModule = require('webpack/lib/RuntimeModule');
|
|
12
|
+
type Chunk = import('webpack/lib/Chunk');
|
|
13
|
+
type ChunkGraph = import('webpack/lib/ChunkGraph');
|
|
14
|
+
type Compilation = import('webpack/lib/Compilation');
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
1
|
+
export function resolveMatchedConfigs<T>(
|
|
2
|
+
compilation: Compilation,
|
|
3
|
+
configs: [string, T][],
|
|
4
|
+
): Promise<MatchedConfigs<T>>;
|
|
5
|
+
export type Compilation = import('webpack/lib/Compilation');
|
|
6
|
+
export type ResolveOptionsWithDependencyType =
|
|
7
|
+
import('webpack/lib/ResolverFactory').ResolveOptionsWithDependencyType;
|
|
8
|
+
export type MatchedConfigs<T> = {
|
|
9
|
+
resolved: Map<string, T>;
|
|
10
|
+
unresolved: Map<string, T>;
|
|
11
|
+
prefixed: Map<string, T>;
|
|
12
|
+
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export function getRequiredVersionFromDescriptionFile(
|
|
2
|
+
data: any,
|
|
3
|
+
packageName: any,
|
|
4
|
+
): string;
|
|
5
|
+
export type InputFileSystem = import('webpack/lib/util/fs').InputFileSystem;
|
|
3
6
|
/**
|
|
4
7
|
* @param {string} str maybe required version
|
|
5
8
|
* @returns {boolean} true, if it looks like a version
|
|
6
9
|
*/
|
|
7
|
-
|
|
8
|
-
export { isRequiredVersion };
|
|
10
|
+
export function isRequiredVersion(str: string): boolean;
|
|
9
11
|
/**
|
|
10
12
|
* @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies
|
|
11
13
|
* @param {string} versionDesc version to be normalized
|
|
12
14
|
* @returns {string} normalized version
|
|
13
15
|
*/
|
|
14
|
-
|
|
15
|
-
export { normalizeVersion };
|
|
16
|
+
export function normalizeVersion(versionDesc: string): string;
|
|
16
17
|
/**
|
|
17
18
|
*
|
|
18
19
|
* @param {InputFileSystem} fs file system
|
|
@@ -20,26 +21,17 @@ export { normalizeVersion };
|
|
|
20
21
|
* @param {string[]} descriptionFiles possible description filenames
|
|
21
22
|
* @param {function((Error | null)=, {data: object, path: string}=): void} callback callback
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fixedDependencies: boolean;
|
|
38
|
-
requiredVersion: false | import("../../../../../webpack/lib/util/semver").SemVerRange;
|
|
39
|
-
strictVersion: boolean;
|
|
40
|
-
singleton: boolean;
|
|
41
|
-
eager: boolean;
|
|
42
|
-
};
|
|
43
|
-
shareScope: string;
|
|
44
|
-
shareKey: string;
|
|
45
|
-
};
|
|
24
|
+
export function getDescriptionFile(
|
|
25
|
+
fs: InputFileSystem,
|
|
26
|
+
directory: string,
|
|
27
|
+
descriptionFiles: string[],
|
|
28
|
+
callback: (
|
|
29
|
+
arg0: (Error | null) | undefined,
|
|
30
|
+
arg1:
|
|
31
|
+
| {
|
|
32
|
+
data: object;
|
|
33
|
+
path: string;
|
|
34
|
+
}
|
|
35
|
+
| undefined,
|
|
36
|
+
) => void,
|
|
37
|
+
): void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/*
|
|
2
|
+
* This file was automatically generated.
|
|
3
|
+
* DO NOT MODIFY BY HAND.
|
|
4
|
+
* Run `yarn special-lint-fix` to update
|
|
5
|
+
*/
|
|
6
|
+
declare const check: (
|
|
7
|
+
options: import('../../../declarations/plugins/container/ModuleFederationPlugin').ModuleFederationPluginOptions,
|
|
8
|
+
) => boolean;
|
|
9
|
+
export = check;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/enhanced",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"main": "./dist/src/index.js",
|
|
5
5
|
"types": "./dist/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"require": "./dist/src/index.js",
|
|
19
|
+
"import": "./dist/src/index.js",
|
|
19
20
|
"types": "./dist/index.d.ts"
|
|
20
21
|
}
|
|
21
22
|
},
|
|
@@ -27,10 +28,10 @@
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@module-federation/webpack-bundler-runtime": "0.0.
|
|
31
|
+
"@module-federation/webpack-bundler-runtime": "0.0.9"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@module-federation/sdk": "0.0.
|
|
34
|
-
"@module-federation/runtime-tools": "0.0.
|
|
34
|
+
"@module-federation/sdk": "0.0.9",
|
|
35
|
+
"@module-federation/runtime-tools": "0.0.9"
|
|
35
36
|
}
|
|
36
37
|
}
|