@module-federation/dts-plugin 2.3.3 → 2.5.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.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 13dce52: fix(dts-plugin): read manifest metadata when consuming DTS files from manifest remotes.
8
+ - Updated dependencies [5d4095d]
9
+ - Updated dependencies [0716c11]
10
+ - Updated dependencies [41281f4]
11
+ - @module-federation/sdk@2.5.0
12
+ - @module-federation/error-codes@2.5.0
13
+ - @module-federation/managers@2.5.0
14
+ - @module-federation/third-party-dts-extractor@2.5.0
15
+
16
+ ## 2.4.0
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [5eba770]
21
+ - Updated dependencies [13b1e84]
22
+ - @module-federation/sdk@2.4.0
23
+ - @module-federation/managers@2.4.0
24
+ - @module-federation/third-party-dts-extractor@2.4.0
25
+ - @module-federation/error-codes@2.4.0
26
+
3
27
  ## 2.3.3
4
28
 
5
29
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  const require_Action = require('./Action-CzhPMw2i.js');
2
- const require_expose_rpc = require('./expose-rpc-CQq6zYK-.js');
2
+ const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
3
3
  let path = require("path");
4
4
  path = require_Action.__toESM(path);
5
5
  let crypto = require("crypto");
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  require('./Broker-DRFgFvXI.js');
3
- const require_expose_rpc = require('./expose-rpc-CQq6zYK-.js');
4
- const require_consumeTypes = require('./consumeTypes-DxGMNavh.js');
3
+ const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
4
+ const require_consumeTypes = require('./consumeTypes-CFK17Cck.js');
5
5
 
6
6
  exports.DTSManager = require_expose_rpc.DTSManager;
7
7
  exports.DtsWorker = require_consumeTypes.DtsWorker;
@@ -1,4 +1,4 @@
1
- import { CreateScriptHookReturn, GlobalModuleInfo, Manifest, Module, ModuleInfo, RemoteEntryType, RemoteWithEntry, RemoteWithVersion, TreeShakingStatus } from "@module-federation/sdk";
1
+ import { CreateLinkHookReturnDom, CreateScriptHookReturn, GlobalModuleInfo, Manifest, Module, ModuleInfo, RemoteEntryType, RemoteWithEntry, RemoteWithVersion, TreeShakingStatus } from "@module-federation/sdk";
2
2
 
3
3
  //#region ../runtime-core/dist/utils/hooks/syncHook.d.ts
4
4
  //#region src/utils/hooks/syncHook.d.ts
@@ -24,7 +24,7 @@ declare class AsyncHook<T, ExternalEmitReturnType = CallbackReturnType$1> extend
24
24
  //#endregion
25
25
  //#region ../runtime-core/dist/utils/hooks/syncWaterfallHook.d.ts
26
26
  //#region src/utils/hooks/syncWaterfallHook.d.ts
27
- declare class SyncWaterfallHook<T extends Record<string, any>> extends SyncHook<[T], T> {
27
+ declare class SyncWaterfallHook<T extends Record<string, any>> extends SyncHook<[T], T | void> {
28
28
  onerror: (errMsg: string | Error | unknown) => void;
29
29
  constructor(type: string);
30
30
  emit(data: T): T;
@@ -32,8 +32,8 @@ declare class SyncWaterfallHook<T extends Record<string, any>> extends SyncHook<
32
32
  //#endregion
33
33
  //#region ../runtime-core/dist/utils/hooks/asyncWaterfallHooks.d.ts
34
34
  //#region src/utils/hooks/asyncWaterfallHooks.d.ts
35
- type CallbackReturnType<T> = T | Promise<T>;
36
- declare class AsyncWaterfallHook<T extends Record<string, any>> extends SyncHook<[T], CallbackReturnType<T>> {
35
+ type CallbackReturnType<T> = T | void | Promise<T | void>;
36
+ declare class AsyncWaterfallHook<T extends object> extends SyncHook<[T], CallbackReturnType<T>> {
37
37
  onerror: (errMsg: string | Error | unknown) => void;
38
38
  constructor(type: string);
39
39
  emit(data: T): Promise<T>;
@@ -177,13 +177,36 @@ interface PreloadRemoteArgs {
177
177
  share?: boolean;
178
178
  depsRemote?: boolean | Array<depsPreloadArg>;
179
179
  filter?: (assetUrl: string) => boolean;
180
- prefetchInterface?: boolean;
181
180
  }
182
181
  type PreloadConfig = PreloadRemoteArgs;
183
182
  type PreloadOptions = Array<{
184
183
  remote: Remote;
185
184
  preloadConfig: PreloadConfig;
186
185
  }>;
186
+ type ResourceLoadInitiator = 'loadRemote' | 'preloadRemote';
187
+ type ResourceLoadType = 'manifest' | 'remoteEntry' | 'js' | 'css';
188
+ interface ResourceLoadContext {
189
+ initiator: ResourceLoadInitiator;
190
+ id: string;
191
+ resourceType: ResourceLoadType;
192
+ url?: string;
193
+ }
194
+ type PreloadAssetStatus = 'success' | 'error' | 'timeout' | 'cached';
195
+ interface PreloadAssetResult {
196
+ url: string;
197
+ status: PreloadAssetStatus;
198
+ resourceType: ResourceLoadType;
199
+ initiator: ResourceLoadInitiator;
200
+ id: string;
201
+ error?: unknown;
202
+ }
203
+ interface PreloadRemoteResult {
204
+ remote: Remote;
205
+ remoteInfo: RemoteInfo;
206
+ preloadConfig: PreloadConfig;
207
+ id: string;
208
+ results: PreloadAssetResult[];
209
+ }
187
210
  type EntryAssets = {
188
211
  name: string;
189
212
  url: string;
@@ -227,6 +250,15 @@ declare class RemoteHandler {
227
250
  options: Options;
228
251
  origin: ModuleFederation;
229
252
  }>;
253
+ afterMatchRemote: AsyncHook<[{
254
+ id: string;
255
+ options: Options;
256
+ remote?: Remote;
257
+ expose?: string;
258
+ remoteInfo?: RemoteInfo;
259
+ error?: unknown;
260
+ origin: ModuleFederation;
261
+ }], void>;
230
262
  onLoad: AsyncHook<[{
231
263
  id: string;
232
264
  expose: string;
@@ -237,6 +269,18 @@ declare class RemoteHandler {
237
269
  exposeModule: any;
238
270
  exposeModuleFactory: any;
239
271
  moduleInstance: Module$1;
272
+ }], unknown>;
273
+ afterLoadRemote: AsyncHook<[{
274
+ id: string;
275
+ expose?: string;
276
+ remote?: RemoteInfo;
277
+ options?: {
278
+ loadFactory?: boolean;
279
+ from?: CallFrom;
280
+ };
281
+ error?: unknown;
282
+ recovered?: boolean;
283
+ origin: ModuleFederation;
240
284
  }], void>;
241
285
  handlePreloadModule: SyncHook<[{
242
286
  id: string;
@@ -252,6 +296,8 @@ declare class RemoteHandler {
252
296
  options?: any;
253
297
  from: CallFrom;
254
298
  lifecycle: "beforeRequest" | "beforeLoadShare" | "afterResolve" | "onLoad";
299
+ remote?: RemoteInfo;
300
+ expose?: string;
255
301
  origin: ModuleFederation;
256
302
  }], unknown>;
257
303
  beforePreloadRemote: AsyncHook<[{
@@ -267,16 +313,19 @@ declare class RemoteHandler {
267
313
  remoteSnapshot: ModuleInfo;
268
314
  globalSnapshot: GlobalModuleInfo;
269
315
  }], Promise<PreloadAssets>>;
270
- afterPreloadRemote: AsyncHook<{
316
+ afterPreloadRemote: AsyncHook<[{
271
317
  preloadOps: Array<PreloadRemoteArgs>;
272
318
  options: Options;
273
319
  origin: ModuleFederation;
274
- }, false | void | Promise<false | void>>;
320
+ results: PreloadRemoteResult[];
321
+ error?: unknown;
322
+ }], false | void | Promise<false | void>>;
275
323
  loadEntry: AsyncHook<[{
324
+ origin: ModuleFederation;
276
325
  loaderHook: ModuleFederation["loaderHook"];
277
326
  remoteInfo: RemoteInfo;
278
327
  remoteEntryExports?: RemoteEntryExports;
279
- }], Promise<RemoteEntryExports>>;
328
+ }], void | RemoteEntryExports | Promise<void | RemoteEntryExports>>;
280
329
  }>;
281
330
  constructor(host: ModuleFederation);
282
331
  formatAndRegisterRemote(globalOptions: Options, userOptions: UserOptions): Remote[];
@@ -321,6 +370,25 @@ declare class SharedHandler {
321
370
  origin: ModuleFederation;
322
371
  }>;
323
372
  loadShare: AsyncHook<[ModuleFederation, string, ShareInfos], false | void | Promise<false | void>>;
373
+ afterLoadShare: SyncHook<[{
374
+ pkgName: string;
375
+ shareInfo?: Partial<Shared>;
376
+ selectedShared?: Partial<Shared>;
377
+ shared: Options["shared"];
378
+ shareScopeMap: ShareScopeMap;
379
+ lifecycle: "loadShare" | "loadShareSync";
380
+ origin: ModuleFederation;
381
+ }], void>;
382
+ errorLoadShare: SyncHook<[{
383
+ pkgName: string;
384
+ shareInfo?: Partial<Shared>;
385
+ shared: Options["shared"];
386
+ shareScopeMap: ShareScopeMap;
387
+ lifecycle: "loadShare" | "loadShareSync";
388
+ origin: ModuleFederation;
389
+ error?: unknown;
390
+ recovered?: boolean;
391
+ }], void>;
324
392
  resolveShare: SyncWaterfallHook<{
325
393
  shareScopeMap: ShareScopeMap;
326
394
  scope: string;
@@ -343,6 +411,8 @@ declare class SharedHandler {
343
411
  }>;
344
412
  initTokens: InitTokens;
345
413
  constructor(host: ModuleFederation);
414
+ private emitAfterLoadShare;
415
+ private emitErrorLoadShare;
346
416
  registerShared(globalOptions: Options, userOptions: UserOptions): {
347
417
  newShareInfos: ShareInfos;
348
418
  allShareInfos: {
@@ -422,6 +492,7 @@ declare class SnapshotHandler {
422
492
  beforeLoadRemoteSnapshot: AsyncHook<[{
423
493
  options: Options;
424
494
  moduleInfo: Remote;
495
+ origin: ModuleFederation;
425
496
  }], void>;
426
497
  loadSnapshot: AsyncWaterfallHook<{
427
498
  options: Options;
@@ -452,11 +523,11 @@ declare class SnapshotHandler {
452
523
  loadRemoteSnapshotInfo({
453
524
  moduleInfo,
454
525
  id,
455
- expose
526
+ initiator
456
527
  }: {
457
528
  moduleInfo: Remote;
458
529
  id?: string;
459
- expose?: string;
530
+ initiator?: ResourceLoadInitiator;
460
531
  }): Promise<{
461
532
  remoteSnapshot: ModuleInfo;
462
533
  globalSnapshot: GlobalModuleInfo;
@@ -467,6 +538,7 @@ declare class SnapshotHandler {
467
538
  remoteSnapshot: GlobalModuleInfo[string] | undefined;
468
539
  };
469
540
  private getManifestJson;
541
+ private loadManifestSnapshot;
470
542
  } //#endregion
471
543
  //#endregion
472
544
  //#region ../runtime-core/dist/utils/load.d.ts
@@ -477,6 +549,7 @@ declare function getRemoteEntry(params: {
477
549
  remoteEntryExports?: RemoteEntryExports | undefined;
478
550
  getEntryUrl?: (url: string) => string;
479
551
  _inErrorHandling?: boolean;
552
+ resourceContext?: ResourceLoadContext;
480
553
  }): Promise<RemoteEntryExports | false | void>;
481
554
  //#endregion
482
555
  //#region ../runtime-core/dist/core.d.ts
@@ -539,6 +612,7 @@ declare class ModuleFederation {
539
612
  * (e.g. preloadRemote / loading remoteEntry).
540
613
  */
541
614
  remoteInfo?: RemoteInfo;
615
+ resourceContext?: ResourceLoadContext;
542
616
  }], CreateScriptHookReturn>;
543
617
  createLink: SyncHook<[{
544
618
  url: string;
@@ -549,8 +623,9 @@ declare class ModuleFederation {
549
623
  * (e.g. preloadRemote / loading remoteEntry).
550
624
  */
551
625
  remoteInfo?: RemoteInfo;
552
- }], void | HTMLLinkElement>;
553
- fetch: AsyncHook<[string, RequestInit, (RemoteInfo | undefined)?], false | void | Promise<Response>>;
626
+ resourceContext?: ResourceLoadContext;
627
+ }], CreateLinkHookReturnDom>;
628
+ fetch: AsyncHook<[string, RequestInit, (RemoteInfo | undefined)?, (ResourceLoadContext | undefined)?], false | void | Promise<Response>>;
554
629
  loadEntryError: AsyncHook<[{
555
630
  getRemoteEntry: typeof getRemoteEntry;
556
631
  origin: ModuleFederation;
@@ -559,11 +634,65 @@ declare class ModuleFederation {
559
634
  globalLoading: Record<string, Promise<void | RemoteEntryExports> | undefined>;
560
635
  uniqueKey: string;
561
636
  }], Promise<Promise<RemoteEntryExports | undefined> | undefined>>;
637
+ afterLoadEntry: AsyncHook<[{
638
+ origin: ModuleFederation;
639
+ remoteInfo: RemoteInfo;
640
+ remoteEntryExports?: false | void | RemoteEntryExports | undefined;
641
+ error?: unknown;
642
+ recovered?: boolean;
643
+ }], void>;
644
+ beforeInitRemote: AsyncHook<[{
645
+ id?: string;
646
+ remoteInfo: RemoteInfo;
647
+ remoteSnapshot?: ModuleInfo;
648
+ origin: ModuleFederation;
649
+ }], void>;
650
+ afterInitRemote: AsyncHook<[{
651
+ id?: string;
652
+ remoteInfo: RemoteInfo;
653
+ remoteSnapshot?: ModuleInfo;
654
+ remoteEntryExports?: RemoteEntryExports;
655
+ error?: unknown;
656
+ cached?: boolean;
657
+ origin: ModuleFederation;
658
+ }], void>;
659
+ beforeGetExpose: AsyncHook<[{
660
+ id: string;
661
+ expose: string;
662
+ moduleInfo: RemoteInfo;
663
+ remoteEntryExports: RemoteEntryExports;
664
+ origin: ModuleFederation;
665
+ }], void>;
666
+ afterGetExpose: AsyncHook<[{
667
+ id: string;
668
+ expose: string;
669
+ moduleInfo: RemoteInfo;
670
+ remoteEntryExports: RemoteEntryExports;
671
+ moduleFactory?: RemoteModuleFactory;
672
+ error?: unknown;
673
+ origin: ModuleFederation;
674
+ }], void>;
675
+ beforeExecuteFactory: AsyncHook<[{
676
+ id: string;
677
+ expose: string;
678
+ moduleInfo: RemoteInfo;
679
+ loadFactory: boolean;
680
+ origin: ModuleFederation;
681
+ }], void>;
682
+ afterExecuteFactory: AsyncHook<[{
683
+ id: string;
684
+ expose: string;
685
+ moduleInfo: RemoteInfo;
686
+ loadFactory: boolean;
687
+ exposeModule?: unknown;
688
+ error?: unknown;
689
+ origin: ModuleFederation;
690
+ }], void>;
562
691
  getModuleFactory: AsyncHook<[{
563
692
  remoteEntryExports: RemoteEntryExports;
564
693
  expose: string;
565
694
  moduleInfo: RemoteInfo;
566
- }], Promise<(() => Promise<Module$1>) | undefined>>;
695
+ }], RemoteModuleFactory | Promise<RemoteModuleFactory | undefined> | undefined>;
567
696
  }>;
568
697
  bridgeHook: PluginSystem<{
569
698
  beforeBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>;
@@ -608,6 +737,7 @@ declare class ModuleFederation {
608
737
  //#region ../runtime-core/dist/module/index.d.ts
609
738
  //#region src/module/index.d.ts
610
739
  type ModuleOptions = ConstructorParameters<typeof Module$1>[0];
740
+ type RemoteModuleFactory = () => unknown | Promise<unknown>;
611
741
  declare class Module$1 {
612
742
  remoteInfo: RemoteInfo;
613
743
  inited: boolean;
@@ -623,11 +753,11 @@ declare class Module$1 {
623
753
  remoteInfo: RemoteInfo;
624
754
  host: ModuleFederation;
625
755
  });
626
- getEntry(): Promise<RemoteEntryExports>;
627
- init(id?: string, remoteSnapshot?: ModuleInfo, rawInitScope?: InitScope): Promise<RemoteEntryExports>;
756
+ getEntry(expose?: string): Promise<RemoteEntryExports>;
757
+ init(id?: string, remoteSnapshot?: ModuleInfo, rawInitScope?: InitScope, expose?: string): Promise<RemoteEntryExports>;
628
758
  get(id: string, expose: string, options?: {
629
759
  loadFactory?: boolean;
630
- }, remoteSnapshot?: ModuleInfo): Promise<any>;
760
+ }, remoteSnapshot?: ModuleInfo): Promise<unknown>;
631
761
  private wraperFactory;
632
762
  } //#endregion
633
763
  //#endregion
@@ -1,4 +1,4 @@
1
- import { a as cloneDeepOptions, n as RpcGMCallTypes, o as getDTSManagerConstructor, s as isDebugMode, t as exposeRpc, x as __exportAll } from "./expose-rpc-B-zm7DmJ.mjs";
1
+ import { a as cloneDeepOptions, n as RpcGMCallTypes, o as getDTSManagerConstructor, s as isDebugMode, t as exposeRpc, x as __exportAll } from "./expose-rpc-BgxOTFXQ.mjs";
2
2
  import path from "path";
3
3
  import { randomUUID } from "crypto";
4
4
  import * as child_process from "child_process";
package/dist/esm/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as retrieveMfTypesPath, c as isTSProject, d as DTSManager, f as HOST_API_TYPES_FILE_NAME, g as retrieveTypesZipPath, h as retrieveHostConfig, i as retrieveRemoteConfig, l as retrieveTypesAssetsInfo, m as REMOTE_API_TYPES_FILE_NAME, o as getDTSManagerConstructor, p as REMOTE_ALIAS_IDENTIFIER, r as generateTypes, u as validateOptions, v as retrieveOriginalOutDir } from "./expose-rpc-B-zm7DmJ.mjs";
1
+ import { _ as retrieveMfTypesPath, c as isTSProject, d as DTSManager, f as HOST_API_TYPES_FILE_NAME, g as retrieveTypesZipPath, h as retrieveHostConfig, i as retrieveRemoteConfig, l as retrieveTypesAssetsInfo, m as REMOTE_API_TYPES_FILE_NAME, o as getDTSManagerConstructor, p as REMOTE_ALIAS_IDENTIFIER, r as generateTypes, u as validateOptions, v as retrieveOriginalOutDir } from "./expose-rpc-BgxOTFXQ.mjs";
2
2
  import "./Broker-z82OgzMe.mjs";
3
- import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-DYgYpZMQ.mjs";
3
+ import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-DCGF9bG3.mjs";
4
4
 
5
5
  export { DTSManager, DtsWorker, HOST_API_TYPES_FILE_NAME, REMOTE_ALIAS_IDENTIFIER, REMOTE_API_TYPES_FILE_NAME, consumeTypes, generateTypes, generateTypesInChildProcess, getDTSManagerConstructor, isTSProject, retrieveHostConfig, retrieveMfTypesPath, retrieveOriginalOutDir, retrieveRemoteConfig, retrieveTypesAssetsInfo, retrieveTypesZipPath, rpc_exports as rpc, validateOptions };
@@ -688,12 +688,14 @@ const retrieveRemoteInfo = (options) => {
688
688
  let zipUrl = "";
689
689
  let apiTypeUrl = "";
690
690
  const name = parsedInfo.name || remoteAlias;
691
- if (typeof remoteTypeUrls === "object" && remoteTypeUrls[name]) {
692
- zipUrl = remoteTypeUrls[name].zip;
693
- apiTypeUrl = remoteTypeUrls[name].api;
691
+ const remoteTypeUrl = typeof remoteTypeUrls === "object" && remoteTypeUrls[name];
692
+ if (remoteTypeUrl) {
693
+ zipUrl = remoteTypeUrl.zip;
694
+ apiTypeUrl = remoteTypeUrl.api;
694
695
  }
695
- if (!zipUrl && url) zipUrl = buildZipUrl(hostOptions, url);
696
- if (!apiTypeUrl && zipUrl) apiTypeUrl = buildApiTypeUrl(zipUrl);
696
+ const shouldResolveTypeUrlsByConvention = Boolean(url && !url.includes(MANIFEST_EXT));
697
+ if (!zipUrl && shouldResolveTypeUrlsByConvention) zipUrl = buildZipUrl(hostOptions, url);
698
+ if (!apiTypeUrl && zipUrl && (remoteTypeUrl || shouldResolveTypeUrlsByConvention)) apiTypeUrl = buildApiTypeUrl(zipUrl);
697
699
  return {
698
700
  name,
699
701
  url,
@@ -1,7 +1,7 @@
1
- import { _ as retrieveMfTypesPath, b as ModuleFederationDevServer, g as retrieveTypesZipPath, h as retrieveHostConfig, i as retrieveRemoteConfig, n as RpcGMCallTypes, o as getDTSManagerConstructor, t as exposeRpc, y as createHttpServer } from "./expose-rpc-B-zm7DmJ.mjs";
1
+ import { _ as retrieveMfTypesPath, b as ModuleFederationDevServer, g as retrieveTypesZipPath, h as retrieveHostConfig, i as retrieveRemoteConfig, n as RpcGMCallTypes, o as getDTSManagerConstructor, t as exposeRpc, y as createHttpServer } from "./expose-rpc-BgxOTFXQ.mjs";
2
2
  import { o as UpdateMode, r as DEFAULT_TAR_NAME } from "./Action-DNNg2YDh.mjs";
3
3
  import { n as UpdateKind, o as getIPV4, s as fileLog } from "./Broker-z82OgzMe.mjs";
4
- import "./consumeTypes-DYgYpZMQ.mjs";
4
+ import "./consumeTypes-DCGF9bG3.mjs";
5
5
  import "./core.mjs";
6
6
  import { t as getIpFromEntry } from "./utils-CkPvDGOy.mjs";
7
7
  import { decodeName } from "@module-federation/sdk";
@@ -1,4 +1,4 @@
1
- import { n as RpcGMCallTypes, r as generateTypes, t as exposeRpc } from "./expose-rpc-B-zm7DmJ.mjs";
1
+ import { n as RpcGMCallTypes, r as generateTypes, t as exposeRpc } from "./expose-rpc-BgxOTFXQ.mjs";
2
2
  import "./Broker-z82OgzMe.mjs";
3
3
 
4
4
  //#region src/core/lib/forkGenerateDts.ts
@@ -1,7 +1,7 @@
1
- import { a as cloneDeepOptions, c as isTSProject, l as retrieveTypesAssetsInfo, n as RpcGMCallTypes, r as generateTypes, u as validateOptions } from "./expose-rpc-B-zm7DmJ.mjs";
1
+ import { a as cloneDeepOptions, c as isTSProject, l as retrieveTypesAssetsInfo, n as RpcGMCallTypes, r as generateTypes, u as validateOptions } from "./expose-rpc-BgxOTFXQ.mjs";
2
2
  import { s as WEB_CLIENT_OPTIONS_IDENTIFIER } from "./Action-DNNg2YDh.mjs";
3
3
  import { c as logger$1, o as getIPV4 } from "./Broker-z82OgzMe.mjs";
4
- import { a as createRpcWorker, n as generateTypesInChildProcess, t as consumeTypes } from "./consumeTypes-DYgYpZMQ.mjs";
4
+ import { a as createRpcWorker, n as generateTypesInChildProcess, t as consumeTypes } from "./consumeTypes-DCGF9bG3.mjs";
5
5
  import "./core.mjs";
6
6
  import fs from "fs";
7
7
  import * as path$1 from "path";
@@ -679,12 +679,14 @@ const retrieveRemoteInfo = (options) => {
679
679
  let zipUrl = "";
680
680
  let apiTypeUrl = "";
681
681
  const name = parsedInfo.name || remoteAlias;
682
- if (typeof remoteTypeUrls === "object" && remoteTypeUrls[name]) {
683
- zipUrl = remoteTypeUrls[name].zip;
684
- apiTypeUrl = remoteTypeUrls[name].api;
682
+ const remoteTypeUrl = typeof remoteTypeUrls === "object" && remoteTypeUrls[name];
683
+ if (remoteTypeUrl) {
684
+ zipUrl = remoteTypeUrl.zip;
685
+ apiTypeUrl = remoteTypeUrl.api;
685
686
  }
686
- if (!zipUrl && url) zipUrl = buildZipUrl(hostOptions, url);
687
- if (!apiTypeUrl && zipUrl) apiTypeUrl = buildApiTypeUrl(zipUrl);
687
+ const shouldResolveTypeUrlsByConvention = Boolean(url && !url.includes(_module_federation_sdk.MANIFEST_EXT));
688
+ if (!zipUrl && shouldResolveTypeUrlsByConvention) zipUrl = buildZipUrl(hostOptions, url);
689
+ if (!apiTypeUrl && zipUrl && (remoteTypeUrl || shouldResolveTypeUrlsByConvention)) apiTypeUrl = buildApiTypeUrl(zipUrl);
688
690
  return {
689
691
  name,
690
692
  url,
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_Action = require('./Action-CzhPMw2i.js');
3
3
  const require_Broker = require('./Broker-DRFgFvXI.js');
4
- const require_expose_rpc = require('./expose-rpc-CQq6zYK-.js');
5
- require('./consumeTypes-DxGMNavh.js');
4
+ const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
5
+ require('./consumeTypes-CFK17Cck.js');
6
6
  require('./core.js');
7
7
  const require_utils = require('./utils-7KqCZHbb.js');
8
8
  let _module_federation_sdk = require("@module-federation/sdk");
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  require('./Broker-DRFgFvXI.js');
3
- const require_expose_rpc = require('./expose-rpc-CQq6zYK-.js');
3
+ const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
4
4
 
5
5
  //#region src/core/lib/forkGenerateDts.ts
6
6
  async function forkGenerateDts(options) {
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_Action = require('./Action-CzhPMw2i.js');
3
3
  const require_Broker = require('./Broker-DRFgFvXI.js');
4
- const require_expose_rpc = require('./expose-rpc-CQq6zYK-.js');
5
- const require_consumeTypes = require('./consumeTypes-DxGMNavh.js');
4
+ const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
5
+ const require_consumeTypes = require('./consumeTypes-CFK17Cck.js');
6
6
  require('./core.js');
7
7
  let fs = require("fs");
8
8
  fs = require_Action.__toESM(fs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "2.3.3",
3
+ "version": "2.5.0",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -71,10 +71,10 @@
71
71
  "undici": "7.24.7",
72
72
  "node-schedule": "2.1.1",
73
73
  "ws": "8.18.0",
74
- "@module-federation/error-codes": "2.3.3",
75
- "@module-federation/sdk": "2.3.3",
76
- "@module-federation/third-party-dts-extractor": "2.3.3",
77
- "@module-federation/managers": "2.3.3"
74
+ "@module-federation/managers": "2.5.0",
75
+ "@module-federation/third-party-dts-extractor": "2.5.0",
76
+ "@module-federation/sdk": "2.5.0",
77
+ "@module-federation/error-codes": "2.5.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/node-schedule": "2.1.7",
@@ -86,7 +86,7 @@
86
86
  "directory-tree": "3.5.2",
87
87
  "vitest": "1.6.0",
88
88
  "webpack": "^5.104.1",
89
- "@module-federation/runtime": "2.3.3"
89
+ "@module-federation/runtime": "2.5.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "typescript": "^4.9.0 || ^5.0.0",