Skip to content

Commit 8633da6

Browse files
fix(enhanced): fix types of container reference (#2897)
Co-authored-by: ScriptedAlchemy <[email protected]>
1 parent 424029c commit 8633da6

File tree

5 files changed

+26
-756
lines changed

5 files changed

+26
-756
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@
9393
"@nx/cypress": "17.2.8",
9494
"@nx/devkit": "17.2.8",
9595
"@nx/esbuild": "17.2.8",
96-
"@nx/eslint-plugin": "19.4.1",
96+
"@nx/eslint-plugin": "17.2.8",
9797
"@nx/express": "17.2.8",
9898
"@nx/jest": "17.2.8",
9999
"@nx/js": "17.2.8",
100-
"@nx/linter": "19.2.3",
100+
"@nx/linter": "17.2.8",
101101
"@nx/next": "17.2.8",
102102
"@nx/node": "17.2.8",
103103
"@nx/react": "17.2.8",

packages/enhanced/src/lib/container/ContainerReferencePlugin.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { containerReferencePlugin } from '@module-federation/sdk';
2020
import FederationRuntimePlugin from './runtime/FederationRuntimePlugin';
2121
import schema from '../../schemas/container/ContainerReferencePlugin';
2222
import checkOptions from '../../schemas/container/ContainerReferencePlugin.check';
23-
import HoistContainerReferencesPlugin from './HoistContainerReferencesPlugin';
2423

2524
const { ExternalsPlugin } = require(
2625
normalizeWebpackPath('webpack'),
@@ -108,7 +107,6 @@ class ContainerReferencePlugin {
108107

109108
compilation.dependencyFactories.set(
110109
FallbackDependency,
111-
// @ts-ignore
112110
new FallbackModuleFactory(),
113111
);
114112

packages/enhanced/src/lib/container/RemoteModule.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class RemoteModule extends Module {
9191
* @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
9292
* @returns {void}
9393
*/
94-
// @ts-ignore
9594
override needBuild(
9695
context: NeedBuildContext,
9796
callback: (err: WebpackError | null, needsRebuild?: boolean) => void,

packages/enhanced/src/lib/container/options.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@ const process = <T, N>(
6464
* @param {function(T, string) : R} normalizeOptions normalize a complex item
6565
* @returns {[string, R][]} parsed options
6666
*/
67-
const parseOptions = <T, R>(
67+
export function parseOptions<T, R>(
6868
options: ContainerOptionsFormat<T>,
6969
normalizeSimple: (item: string | string[], name: string) => R,
7070
normalizeOptions: (item: T, name: string) => R,
71-
): [string, R][] => {
71+
): [string, R][] {
7272
const items: [string, R][] = [];
7373
process(options, normalizeSimple, normalizeOptions, (key, value) => {
7474
items.push([key, value]);
7575
});
7676
return items;
77-
};
77+
}
7878

7979
/**
8080
* @template T
8181
* @param {string} scope scope name
8282
* @param {ContainerOptionsFormat<T>} options options passed by the user
8383
* @returns {Record<string, string | string[] | T>} options to spread or pass
8484
*/
85-
const scope = <T>(
85+
export function scope<T>(
8686
scope: string,
8787
options: ContainerOptionsFormat<T>,
88-
): Record<string, string | string[] | T> => {
88+
): Record<string, string | string[] | T> {
8989
const obj: Record<string, string | string[] | T> = {};
9090
process(
9191
options,
@@ -98,6 +98,4 @@ const scope = <T>(
9898
},
9999
);
100100
return obj;
101-
};
102-
103-
export { parseOptions, scope };
101+
}

0 commit comments

Comments
 (0)