Skip to content

Commit f926b6c

Browse files
zhoushawilteoood2heal1
authored
chore: native typescript remove all eslint annotation and rollback version (#2285)
Co-authored-by: Matteo Pietro Dazzi <[email protected]> Co-authored-by: 2heal1 <[email protected]>
1 parent 6b3b210 commit f926b6c

File tree

99 files changed

+3446
-1927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3446
-1927
lines changed

.changeset/config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"@module-federation/runtime-tools",
1313
"@module-federation/managers",
1414
"@module-federation/manifest",
15-
"@module-federation/dts-plugin",
16-
"@module-federation/native-federation-typescript"
15+
"@module-federation/dts-plugin"
1716
]
1817
],
1918
"ignorePatterns": ["^alpha|^beta"],

.changeset/khaki-bears-act.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@module-federation/dts-plugin': patch
3+
'@module-federation/manifest': patch
4+
---
5+
6+
chore: split types plugins implementation

.changeset/yellow-pants-brush.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@module-federation/native-federation-typescript': patch
3+
'@module-federation/native-federation-tests': patch
4+
---
5+
6+
chore: revert prev implementation
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type {
2+
PackageType as PackageType_0,
3+
RemoteKeys as RemoteKeys_0,
4+
} from './remote1/apis.d.ts';
5+
declare module '@module-federation/runtime' {
6+
type RemoteKeys = RemoteKeys_0;
7+
type PackageType<T, Y = any> = T extends RemoteKeys_0 ? PackageType_0<T> : Y;
8+
export function loadRemote<T extends RemoteKeys, Y>(
9+
packageName: T,
10+
): Promise<PackageType<T, Y>>;
11+
export function loadRemote<T extends string, Y>(
12+
packageName: T,
13+
): Promise<PackageType<T, Y>>;
14+
}
15+
declare module '@module-federation/runtime-tools' {
16+
type RemoteKeys = RemoteKeys_0;
17+
type PackageType<T, Y = any> = T extends RemoteKeys_0 ? PackageType_0<T> : Y;
18+
export function loadRemote<T extends RemoteKeys, Y>(
19+
packageName: T,
20+
): Promise<PackageType<T, Y>>;
21+
export function loadRemote<T extends string, Y>(
22+
packageName: T,
23+
): Promise<PackageType<T, Y>>;
24+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './compiled-types/apps/runtime-demo/3006-runtime-remote/src/components/WebpackPng';
2+
export { default } from './compiled-types/apps/runtime-demo/3006-runtime-remote/src/components/WebpackPng';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './compiled-types/apps/runtime-demo/3006-runtime-remote/src/components/WebpackSvg';
2+
export { default } from './compiled-types/apps/runtime-demo/3006-runtime-remote/src/components/WebpackSvg';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export type RemoteKeys =
2+
| 'remote1/useCustomRemoteHook'
3+
| 'remote1/WebpackSvg'
4+
| 'remote1/WebpackPng';
5+
type PackageType<T> = T extends 'remote1/WebpackPng'
6+
? typeof import('remote1/WebpackPng')
7+
: T extends 'remote1/WebpackSvg'
8+
? typeof import('remote1/WebpackSvg')
9+
: T extends 'remote1/useCustomRemoteHook'
10+
? typeof import('remote1/useCustomRemoteHook')
11+
: any;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function WebpackPng(): import('react/jsx-runtime').JSX.Element;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function WebpackSvg(): import('react/jsx-runtime').JSX.Element;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare function useCustomRemoteHook(): string;
2+
export default useCustomRemoteHook;

0 commit comments

Comments
 (0)