@module-federation/dts-plugin 0.11.1 → 0.11.2

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/index.js CHANGED
@@ -83,7 +83,13 @@ var __async = (__this, __arguments, generator) => {
83
83
  // packages/dts-plugin/src/index.ts
84
84
  var src_exports = {};
85
85
  __export(src_exports, {
86
- DtsPlugin: () => DtsPlugin
86
+ DtsPlugin: () => DtsPlugin,
87
+ consumeTypesAPI: () => consumeTypesAPI,
88
+ generateTypesAPI: () => generateTypesAPI,
89
+ isTSProject: () => isTSProject,
90
+ normalizeConsumeTypesOptions: () => normalizeConsumeTypesOptions,
91
+ normalizeDtsOptions: () => normalizeDtsOptions,
92
+ normalizeGenerateTypesOptions: () => normalizeGenerateTypesOptions
87
93
  });
88
94
  module.exports = __toCommonJS(src_exports);
89
95
 
@@ -366,7 +372,7 @@ var log4js = __toESM(require("log4js"));
366
372
  // packages/dts-plugin/src/server/constant.ts
367
373
  var DEFAULT_WEB_SOCKET_PORT = 16322;
368
374
  var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82";
369
- var MF_SERVER_IDENTIFIER = "Module Federation Dev Server";
375
+ var MF_SERVER_IDENTIFIER = "Module Federation DTS";
370
376
  var WEB_CLIENT_OPTIONS_IDENTIFIER = "__WEB_CLIENT_OPTIONS__";
371
377
  var UpdateMode;
372
378
  (function(UpdateMode2) {
@@ -1206,6 +1212,7 @@ var downloadTypesArchive = /* @__PURE__ */ __name((hostOptions) => {
1206
1212
  } catch (error2) {
1207
1213
  fileLog(`Error during types archive download: ${(error2 == null ? void 0 : error2.message) || "unknown error"}`, "downloadTypesArchive", "error");
1208
1214
  if (retries >= hostOptions.maxRetries) {
1215
+ logger.error(`Failed to download ${fileToDownload}, you can set FEDERATION_DEBUG=true to see detail message.`);
1209
1216
  if (hostOptions.abortOnError !== false) {
1210
1217
  throw error2;
1211
1218
  }
@@ -1275,6 +1282,7 @@ var retrieveRemoteInfo = /* @__PURE__ */ __name((options) => {
1275
1282
  };
1276
1283
  }, "retrieveRemoteInfo");
1277
1284
  var resolveRemotes = /* @__PURE__ */ __name((hostOptions) => {
1285
+ var _a3;
1278
1286
  const parsedOptions = import_managers.utils.parseOptions(hostOptions.moduleFederationConfig.remotes || {}, (item, key) => ({
1279
1287
  remote: Array.isArray(item) ? item[0] : item,
1280
1288
  key
@@ -1282,15 +1290,38 @@ var resolveRemotes = /* @__PURE__ */ __name((hostOptions) => {
1282
1290
  remote: Array.isArray(item.external) ? item.external[0] : item.external,
1283
1291
  key
1284
1292
  }));
1293
+ const remoteTypeUrls = (_a3 = hostOptions.remoteTypeUrls) != null ? _a3 : {};
1294
+ if (typeof remoteTypeUrls !== "object") {
1295
+ throw new Error("remoteTypeUrls must be consumed before resolveRemotes");
1296
+ }
1297
+ const remoteInfos = Object.keys(remoteTypeUrls).reduce((sum, remoteName) => {
1298
+ const { zip, api, alias } = remoteTypeUrls[remoteName];
1299
+ sum[alias] = {
1300
+ name: remoteName,
1301
+ url: "",
1302
+ zipUrl: zip,
1303
+ apiTypeUrl: api,
1304
+ alias: alias || remoteName
1305
+ };
1306
+ return sum;
1307
+ }, {});
1285
1308
  return parsedOptions.reduce((accumulator, item) => {
1286
1309
  const { key, remote } = item[1];
1287
- accumulator[key] = retrieveRemoteInfo({
1310
+ const res = retrieveRemoteInfo({
1288
1311
  hostOptions,
1289
1312
  remoteAlias: key,
1290
1313
  remote
1291
1314
  });
1315
+ if (accumulator[key]) {
1316
+ accumulator[key] = __spreadProps(__spreadValues({}, accumulator[key]), {
1317
+ url: res.url,
1318
+ apiTypeUrl: accumulator[key].apiTypeUrl || res.apiTypeUrl
1319
+ });
1320
+ return accumulator;
1321
+ }
1322
+ accumulator[key] = res;
1292
1323
  return accumulator;
1293
- }, {});
1324
+ }, remoteInfos);
1294
1325
  }, "resolveRemotes");
1295
1326
  var retrieveHostConfig = /* @__PURE__ */ __name((options) => {
1296
1327
  validateOptions(options);
@@ -2549,52 +2580,68 @@ var import_sdk11 = require("@module-federation/sdk");
2549
2580
  // packages/dts-plugin/src/plugins/ConsumeTypesPlugin.ts
2550
2581
  var import_sdk8 = require("@module-federation/sdk");
2551
2582
  var import_sdk9 = require("@module-federation/sdk");
2583
+ var DEFAULT_CONSUME_TYPES = {
2584
+ abortOnError: false,
2585
+ consumeAPITypes: true
2586
+ };
2587
+ var normalizeConsumeTypesOptions = /* @__PURE__ */ __name(({ context, dtsOptions, pluginOptions }) => {
2588
+ const normalizedConsumeTypes = (0, import_sdk9.normalizeOptions)(true, DEFAULT_CONSUME_TYPES, "mfOptions.dts.consumeTypes")(dtsOptions.consumeTypes);
2589
+ if (!normalizedConsumeTypes) {
2590
+ return;
2591
+ }
2592
+ const dtsManagerOptions = {
2593
+ host: __spreadValues({
2594
+ implementation: dtsOptions.implementation,
2595
+ context,
2596
+ moduleFederationConfig: pluginOptions
2597
+ }, normalizedConsumeTypes),
2598
+ extraOptions: dtsOptions.extraOptions || {},
2599
+ displayErrorInTerminal: dtsOptions.displayErrorInTerminal
2600
+ };
2601
+ validateOptions(dtsManagerOptions.host);
2602
+ return dtsManagerOptions;
2603
+ }, "normalizeConsumeTypesOptions");
2604
+ var consumeTypesAPI = /* @__PURE__ */ __name((dtsManagerOptions, cb) => __async(void 0, null, function* () {
2605
+ const fetchRemoteTypeUrlsPromise = typeof dtsManagerOptions.host.remoteTypeUrls === "function" ? dtsManagerOptions.host.remoteTypeUrls() : Promise.resolve(dtsManagerOptions.host.remoteTypeUrls);
2606
+ return fetchRemoteTypeUrlsPromise.then((remoteTypeUrls) => {
2607
+ consumeTypes(__spreadProps(__spreadValues({}, dtsManagerOptions), {
2608
+ host: __spreadProps(__spreadValues({}, dtsManagerOptions.host), {
2609
+ remoteTypeUrls
2610
+ })
2611
+ })).then(() => {
2612
+ typeof cb === "function" && cb(remoteTypeUrls);
2613
+ }).catch(() => {
2614
+ typeof cb === "function" && cb(remoteTypeUrls);
2615
+ });
2616
+ });
2617
+ }), "consumeTypesAPI");
2552
2618
  var _ConsumeTypesPlugin = class _ConsumeTypesPlugin {
2553
- constructor(pluginOptions, dtsOptions, defaultOptions3, fetchRemoteTypeUrlsResolve) {
2619
+ constructor(pluginOptions, dtsOptions, fetchRemoteTypeUrlsResolve) {
2554
2620
  __publicField(this, "pluginOptions");
2555
2621
  __publicField(this, "dtsOptions");
2556
- __publicField(this, "defaultOptions");
2557
2622
  __publicField(this, "callback");
2558
2623
  __publicField(this, "fetchRemoteTypeUrlsResolve");
2559
2624
  this.pluginOptions = pluginOptions;
2560
2625
  this.dtsOptions = dtsOptions;
2561
- this.defaultOptions = defaultOptions3;
2562
2626
  this.fetchRemoteTypeUrlsResolve = fetchRemoteTypeUrlsResolve;
2563
2627
  }
2564
2628
  apply(compiler) {
2565
- const { dtsOptions, defaultOptions: defaultOptions3, pluginOptions, fetchRemoteTypeUrlsResolve } = this;
2629
+ const { dtsOptions, pluginOptions, fetchRemoteTypeUrlsResolve } = this;
2566
2630
  if (isPrd()) {
2567
2631
  fetchRemoteTypeUrlsResolve(void 0);
2568
2632
  return;
2569
2633
  }
2570
- const normalizedConsumeTypes = (0, import_sdk9.normalizeOptions)(true, defaultOptions3, "mfOptions.dts.consumeTypes")(dtsOptions.consumeTypes);
2571
- if (!normalizedConsumeTypes) {
2634
+ const dtsManagerOptions = normalizeConsumeTypesOptions({
2635
+ context: compiler.context,
2636
+ dtsOptions,
2637
+ pluginOptions
2638
+ });
2639
+ if (!dtsManagerOptions) {
2572
2640
  fetchRemoteTypeUrlsResolve(void 0);
2573
2641
  return;
2574
2642
  }
2575
- const finalOptions = {
2576
- host: __spreadValues({
2577
- implementation: dtsOptions.implementation,
2578
- context: compiler.context,
2579
- moduleFederationConfig: pluginOptions
2580
- }, normalizedConsumeTypes),
2581
- extraOptions: dtsOptions.extraOptions || {},
2582
- displayErrorInTerminal: dtsOptions.displayErrorInTerminal
2583
- };
2584
- validateOptions(finalOptions.host);
2585
- const fetchRemoteTypeUrlsPromise = typeof normalizedConsumeTypes.remoteTypeUrls === "function" ? normalizedConsumeTypes.remoteTypeUrls() : Promise.resolve(normalizedConsumeTypes.remoteTypeUrls);
2586
2643
  import_sdk8.logger.debug("start fetching remote types...");
2587
- const promise = fetchRemoteTypeUrlsPromise.then((remoteTypeUrls) => {
2588
- consumeTypes(__spreadProps(__spreadValues({}, finalOptions), {
2589
- host: __spreadProps(__spreadValues({}, finalOptions.host), {
2590
- remoteTypeUrls
2591
- })
2592
- })).then(() => {
2593
- fetchRemoteTypeUrlsResolve(remoteTypeUrls);
2594
- }).catch(() => {
2595
- fetchRemoteTypeUrlsResolve(remoteTypeUrls);
2596
- });
2597
- });
2644
+ const promise = consumeTypesAPI(dtsManagerOptions, fetchRemoteTypeUrlsResolve);
2598
2645
  compiler.hooks.thisCompilation.tap("mf:generateTypes", (compilation) => {
2599
2646
  compilation.hooks.processAssets.tapPromise({
2600
2647
  name: "mf:generateTypes",
@@ -2616,70 +2663,89 @@ var ConsumeTypesPlugin = _ConsumeTypesPlugin;
2616
2663
  var import_fs4 = __toESM(require("fs"));
2617
2664
  var import_path10 = __toESM(require("path"));
2618
2665
  var import_sdk10 = require("@module-federation/sdk");
2666
+ var DEFAULT_GENERATE_TYPES = {
2667
+ generateAPITypes: true,
2668
+ compileInChildProcess: true,
2669
+ abortOnError: false,
2670
+ extractThirdParty: false,
2671
+ extractRemoteTypes: false
2672
+ };
2673
+ var normalizeGenerateTypesOptions = /* @__PURE__ */ __name(({ context, outputDir, dtsOptions, pluginOptions }) => {
2674
+ const normalizedGenerateTypes = (0, import_sdk10.normalizeOptions)(true, DEFAULT_GENERATE_TYPES, "mfOptions.dts.generateTypes")(dtsOptions.generateTypes);
2675
+ if (!normalizedGenerateTypes) {
2676
+ return;
2677
+ }
2678
+ const normalizedConsumeTypes = (0, import_sdk10.normalizeOptions)(true, {}, "mfOptions.dts.consumeTypes")(dtsOptions.consumeTypes);
2679
+ const finalOptions = {
2680
+ remote: __spreadValues({
2681
+ implementation: dtsOptions.implementation,
2682
+ context,
2683
+ outputDir,
2684
+ moduleFederationConfig: pluginOptions
2685
+ }, normalizedGenerateTypes),
2686
+ host: normalizedConsumeTypes === false ? void 0 : __spreadValues({
2687
+ context,
2688
+ moduleFederationConfig: pluginOptions
2689
+ }, normalizedGenerateTypes),
2690
+ extraOptions: dtsOptions.extraOptions || {},
2691
+ displayErrorInTerminal: dtsOptions.displayErrorInTerminal
2692
+ };
2693
+ if (dtsOptions.tsConfigPath && !finalOptions.remote.tsConfigPath) {
2694
+ finalOptions.remote.tsConfigPath = dtsOptions.tsConfigPath;
2695
+ }
2696
+ validateOptions(finalOptions.remote);
2697
+ return finalOptions;
2698
+ }, "normalizeGenerateTypesOptions");
2699
+ var getGenerateTypesFn = /* @__PURE__ */ __name((dtsManagerOptions) => {
2700
+ let fn = generateTypes;
2701
+ if (dtsManagerOptions.remote.compileInChildProcess) {
2702
+ fn = generateTypesInChildProcess;
2703
+ }
2704
+ return fn;
2705
+ }, "getGenerateTypesFn");
2706
+ var generateTypesAPI = /* @__PURE__ */ __name(({ dtsManagerOptions }) => {
2707
+ const fn = getGenerateTypesFn(dtsManagerOptions);
2708
+ return fn(dtsManagerOptions);
2709
+ }, "generateTypesAPI");
2619
2710
  var _GenerateTypesPlugin = class _GenerateTypesPlugin {
2620
- constructor(pluginOptions, dtsOptions, defaultOptions3, fetchRemoteTypeUrlsPromise, callback) {
2711
+ constructor(pluginOptions, dtsOptions, fetchRemoteTypeUrlsPromise, callback) {
2621
2712
  __publicField(this, "pluginOptions");
2622
2713
  __publicField(this, "dtsOptions");
2623
- __publicField(this, "defaultOptions");
2624
2714
  __publicField(this, "fetchRemoteTypeUrlsPromise");
2625
2715
  __publicField(this, "callback");
2626
2716
  this.pluginOptions = pluginOptions;
2627
2717
  this.dtsOptions = dtsOptions;
2628
- this.defaultOptions = defaultOptions3;
2629
2718
  this.fetchRemoteTypeUrlsPromise = fetchRemoteTypeUrlsPromise;
2630
2719
  this.callback = callback;
2631
2720
  }
2632
2721
  apply(compiler) {
2633
- const { dtsOptions, defaultOptions: defaultOptions3, pluginOptions, fetchRemoteTypeUrlsPromise, callback } = this;
2634
- const normalizedGenerateTypes = (0, import_sdk10.normalizeOptions)(true, defaultOptions3, "mfOptions.dts.generateTypes")(dtsOptions.generateTypes);
2635
- if (!normalizedGenerateTypes) {
2722
+ const { dtsOptions, pluginOptions, fetchRemoteTypeUrlsPromise, callback } = this;
2723
+ const outputDir = getCompilerOutputDir(compiler);
2724
+ const context = compiler.context;
2725
+ const dtsManagerOptions = normalizeGenerateTypesOptions({
2726
+ context,
2727
+ outputDir,
2728
+ dtsOptions,
2729
+ pluginOptions
2730
+ });
2731
+ if (!dtsManagerOptions) {
2636
2732
  callback();
2637
2733
  return;
2638
2734
  }
2639
- const normalizedConsumeTypes = (0, import_sdk10.normalizeOptions)(true, defaultOptions3, "mfOptions.dts.consumeTypes")(dtsOptions.consumeTypes);
2640
- const finalOptions = {
2641
- remote: __spreadValues({
2642
- implementation: dtsOptions.implementation,
2643
- context: compiler.context,
2644
- outputDir: getCompilerOutputDir(compiler),
2645
- moduleFederationConfig: pluginOptions
2646
- }, normalizedGenerateTypes),
2647
- host: normalizedConsumeTypes === false ? void 0 : __spreadValues({
2648
- context: compiler.context,
2649
- moduleFederationConfig: pluginOptions
2650
- }, normalizedGenerateTypes),
2651
- extraOptions: dtsOptions.extraOptions || {},
2652
- displayErrorInTerminal: dtsOptions.displayErrorInTerminal
2653
- };
2654
- if (dtsOptions.tsConfigPath && !finalOptions.remote.tsConfigPath) {
2655
- finalOptions.remote.tsConfigPath = dtsOptions.tsConfigPath;
2656
- }
2657
- validateOptions(finalOptions.remote);
2658
2735
  const isProd = !isDev();
2659
- const getGenerateTypesFn = /* @__PURE__ */ __name(() => {
2660
- let fn = generateTypes;
2661
- let res;
2662
- if (finalOptions.remote.compileInChildProcess) {
2663
- fn = generateTypesInChildProcess;
2664
- }
2665
- if (isProd) {
2666
- res = fn(finalOptions);
2667
- return () => res;
2668
- }
2669
- return fn;
2670
- }, "getGenerateTypesFn");
2671
- const generateTypesFn = getGenerateTypesFn();
2672
2736
  const emitTypesFiles = /* @__PURE__ */ __name((compilation) => __async(this, null, function* () {
2673
2737
  try {
2674
- const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote);
2738
+ const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(dtsManagerOptions.remote);
2675
2739
  if (isProd && zipName && compilation.getAsset(zipName)) {
2676
2740
  callback();
2677
2741
  return;
2678
2742
  }
2679
2743
  import_sdk10.logger.debug("start generating types...");
2680
- yield generateTypesFn(finalOptions);
2744
+ yield generateTypesAPI({
2745
+ dtsManagerOptions
2746
+ });
2681
2747
  import_sdk10.logger.debug("generate types success!");
2682
- const config = finalOptions.remote.moduleFederationConfig;
2748
+ const config = dtsManagerOptions.remote.moduleFederationConfig;
2683
2749
  let zipPrefix = "";
2684
2750
  if (typeof config.manifest === "object" && config.manifest.filePath) {
2685
2751
  zipPrefix = config.manifest.filePath;
@@ -2710,13 +2776,18 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
2710
2776
  if (err && !isEEXIST(err)) {
2711
2777
  reject(err);
2712
2778
  } else {
2713
- compiler.outputFileSystem.writeFile(zipOutputPath, zipContent, (writeErr) => {
2714
- if (writeErr && !isEEXIST(writeErr)) {
2715
- reject(writeErr);
2716
- } else {
2717
- resolve5();
2779
+ compiler.outputFileSystem.writeFile(
2780
+ zipOutputPath,
2781
+ // @ts-ignore
2782
+ zipContent,
2783
+ (writeErr) => {
2784
+ if (writeErr && !isEEXIST(writeErr)) {
2785
+ reject(writeErr);
2786
+ } else {
2787
+ resolve5();
2788
+ }
2718
2789
  }
2719
- });
2790
+ );
2720
2791
  }
2721
2792
  });
2722
2793
  });
@@ -2729,13 +2800,18 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
2729
2800
  if (err && !isEEXIST(err)) {
2730
2801
  reject(err);
2731
2802
  } else {
2732
- compiler.outputFileSystem.writeFile(apiOutputPath, apiContent, (writeErr) => {
2733
- if (writeErr && !isEEXIST(writeErr)) {
2734
- reject(writeErr);
2735
- } else {
2736
- resolve5();
2803
+ compiler.outputFileSystem.writeFile(
2804
+ apiOutputPath,
2805
+ // @ts-ignore
2806
+ apiContent,
2807
+ (writeErr) => {
2808
+ if (writeErr && !isEEXIST(writeErr)) {
2809
+ reject(writeErr);
2810
+ } else {
2811
+ resolve5();
2812
+ }
2737
2813
  }
2738
- });
2814
+ );
2739
2815
  }
2740
2816
  });
2741
2817
  });
@@ -2744,7 +2820,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
2744
2820
  }
2745
2821
  } catch (err) {
2746
2822
  callback();
2747
- if (finalOptions.displayErrorInTerminal) {
2823
+ if (dtsManagerOptions.displayErrorInTerminal) {
2748
2824
  console.error("Error in mf:generateTypes processAssets hook:", err);
2749
2825
  }
2750
2826
  import_sdk10.logger.debug("generate types fail!");
@@ -2771,6 +2847,14 @@ __name(_GenerateTypesPlugin, "GenerateTypesPlugin");
2771
2847
  var GenerateTypesPlugin = _GenerateTypesPlugin;
2772
2848
 
2773
2849
  // packages/dts-plugin/src/plugins/DtsPlugin.ts
2850
+ var normalizeDtsOptions = /* @__PURE__ */ __name((options, context, defaultOptions3) => {
2851
+ return (0, import_sdk11.normalizeOptions)(isTSProject(options.dts, context), {
2852
+ generateTypes: (defaultOptions3 == null ? void 0 : defaultOptions3.defaultGenerateOptions) || DEFAULT_GENERATE_TYPES,
2853
+ consumeTypes: (defaultOptions3 == null ? void 0 : defaultOptions3.defaultConsumeOptions) || DEFAULT_CONSUME_TYPES,
2854
+ extraOptions: {},
2855
+ displayErrorInTerminal: true
2856
+ }, "mfOptions.dts")(options.dts);
2857
+ }, "normalizeDtsOptions");
2774
2858
  var _DtsPlugin = class _DtsPlugin {
2775
2859
  constructor(options) {
2776
2860
  __publicField(this, "options");
@@ -2778,23 +2862,7 @@ var _DtsPlugin = class _DtsPlugin {
2778
2862
  }
2779
2863
  apply(compiler) {
2780
2864
  const { options } = this;
2781
- const defaultGenerateTypes = {
2782
- generateAPITypes: true,
2783
- compileInChildProcess: true,
2784
- abortOnError: false,
2785
- extractThirdParty: false,
2786
- extractRemoteTypes: false
2787
- };
2788
- const defaultConsumeTypes = {
2789
- abortOnError: false,
2790
- consumeAPITypes: true
2791
- };
2792
- const normalizedDtsOptions = (0, import_sdk11.normalizeOptions)(isTSProject(options.dts, compiler.context), {
2793
- generateTypes: defaultGenerateTypes,
2794
- consumeTypes: defaultConsumeTypes,
2795
- extraOptions: {},
2796
- displayErrorInTerminal: true
2797
- }, "mfOptions.dts")(options.dts);
2865
+ const normalizedDtsOptions = normalizeDtsOptions(options, compiler.context);
2798
2866
  if (typeof normalizedDtsOptions !== "object") {
2799
2867
  return;
2800
2868
  }
@@ -2807,13 +2875,19 @@ var _DtsPlugin = class _DtsPlugin {
2807
2875
  generateTypesPromiseResolve = resolve5;
2808
2876
  });
2809
2877
  new DevPlugin(options, normalizedDtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise).apply(compiler);
2810
- new GenerateTypesPlugin(options, normalizedDtsOptions, defaultGenerateTypes, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
2811
- new ConsumeTypesPlugin(options, normalizedDtsOptions, defaultConsumeTypes, fetchRemoteTypeUrlsResolve).apply(compiler);
2878
+ new GenerateTypesPlugin(options, normalizedDtsOptions, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
2879
+ new ConsumeTypesPlugin(options, normalizedDtsOptions, fetchRemoteTypeUrlsResolve).apply(compiler);
2812
2880
  }
2813
2881
  };
2814
2882
  __name(_DtsPlugin, "DtsPlugin");
2815
2883
  var DtsPlugin = _DtsPlugin;
2816
2884
  // Annotate the CommonJS export names for ESM import in node:
2817
2885
  0 && (module.exports = {
2818
- DtsPlugin
2886
+ DtsPlugin,
2887
+ consumeTypesAPI,
2888
+ generateTypesAPI,
2889
+ isTSProject,
2890
+ normalizeConsumeTypesOptions,
2891
+ normalizeDtsOptions,
2892
+ normalizeGenerateTypesOptions
2819
2893
  });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -73,7 +73,7 @@
73
73
  "vue": "^3.4.29",
74
74
  "@vue/tsconfig": "^0.5.1",
75
75
  "vue-tsc": "^2.0.26",
76
- "rimraf": "~3.0.2"
76
+ "rimraf": "~6.0.1"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "typescript": "^4.9.0 || ^5.0.0",
@@ -65,7 +65,7 @@ var import_http = require("http");
65
65
  // packages/dts-plugin/src/server/constant.ts
66
66
  var DEFAULT_WEB_SOCKET_PORT = 16322;
67
67
  var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82";
68
- var MF_SERVER_IDENTIFIER = "Module Federation Dev Server";
68
+ var MF_SERVER_IDENTIFIER = "Module Federation DTS";
69
69
  var UpdateMode;
70
70
  (function(UpdateMode2) {
71
71
  UpdateMode2["POSITIVE"] = "POSITIVE";
@@ -0,0 +1,16 @@
1
+ import { moduleFederationPlugin } from '@module-federation/sdk';
2
+ import { H as HostOptions, a as RemoteOptions } from './DTSManagerOptions-c74c59ed.js';
3
+ import { D as DTSManager } from './DTSManager-81645796.js';
4
+
5
+ declare function getDTSManagerConstructor(implementation?: string): typeof DTSManager;
6
+ declare const validateOptions: (options: HostOptions) => void;
7
+ declare function retrieveTypesAssetsInfo(options: RemoteOptions): {
8
+ zipPrefix: string;
9
+ apiTypesPath: string;
10
+ zipTypesPath: string;
11
+ zipName: string;
12
+ apiFileName: string;
13
+ };
14
+ declare const isTSProject: (dtsOptions: moduleFederationPlugin.ModuleFederationPluginOptions["dts"], context?: string) => boolean;
15
+
16
+ export { getDTSManagerConstructor as g, isTSProject as i, retrieveTypesAssetsInfo as r, validateOptions as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -60,10 +60,10 @@
60
60
  "log4js": "6.9.1",
61
61
  "node-schedule": "2.1.1",
62
62
  "ws": "8.18.0",
63
- "@module-federation/sdk": "0.11.1",
64
- "@module-federation/managers": "0.11.1",
65
- "@module-federation/third-party-dts-extractor": "0.11.1",
66
- "@module-federation/error-codes": "0.11.1"
63
+ "@module-federation/sdk": "0.11.2",
64
+ "@module-federation/managers": "0.11.2",
65
+ "@module-federation/third-party-dts-extractor": "0.11.2",
66
+ "@module-federation/error-codes": "0.11.2"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/ws": "8.5.12",
@@ -72,8 +72,8 @@
72
72
  "vue": "^3.4.29",
73
73
  "@vue/tsconfig": "^0.5.1",
74
74
  "vue-tsc": "^2.0.26",
75
- "rimraf": "~3.0.2",
76
- "@module-federation/runtime": "0.11.1"
75
+ "rimraf": "~6.0.1",
76
+ "@module-federation/runtime": "0.11.2"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "typescript": "^4.9.0 || ^5.0.0",