@module-federation/dts-plugin 0.19.0 → 0.20.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,27 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 0.20.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e96509: fix(dts-plugin): correct generateTypes host params
8
+ - Updated dependencies [37346d4]
9
+ - Updated dependencies [639a83b]
10
+ - @module-federation/sdk@0.20.0
11
+ - @module-federation/error-codes@0.20.0
12
+ - @module-federation/managers@0.20.0
13
+ - @module-federation/third-party-dts-extractor@0.20.0
14
+
15
+ ## 0.19.1
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+ - @module-federation/sdk@0.19.1
21
+ - @module-federation/managers@0.19.1
22
+ - @module-federation/third-party-dts-extractor@0.19.1
23
+ - @module-federation/error-codes@0.19.1
24
+
3
25
  ## 0.19.0
4
26
 
5
27
  ### Patch Changes
package/dist/core.js CHANGED
@@ -219,7 +219,7 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
219
219
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
220
220
  });
221
221
  const execPromise = import_util.default.promisify(import_child_process.exec);
222
- const cmd = `npx ${remoteOptions.compilerInstance} --project ${tempTsConfigJsonPath}`;
222
+ const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
223
223
  try {
224
224
  yield execPromise(cmd, {
225
225
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -4,7 +4,7 @@ import {
4
4
  exposeRpc,
5
5
  getDTSManagerConstructor,
6
6
  isDebugMode
7
- } from "./chunk-QAYDHZEF.js";
7
+ } from "./chunk-ETMHGGQH.js";
8
8
  import {
9
9
  __async,
10
10
  __export,
@@ -116,7 +116,7 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
116
116
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
117
117
  });
118
118
  const execPromise = util.promisify(exec);
119
- const cmd = `npx ${remoteOptions.compilerInstance} --project ${tempTsConfigJsonPath}`;
119
+ const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
120
120
  try {
121
121
  yield execPromise(cmd, {
122
122
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -417,7 +417,7 @@ var _ModuleFederationDevServer = class _ModuleFederationDevServer {
417
417
  });
418
418
  }
419
419
  _tryCreateBackgroundBroker(err) {
420
- if (!((err == null ? void 0 : err.code) === "ECONNREFUSED" && err.port === Broker.DEFAULT_WEB_SOCKET_PORT)) {
420
+ if (!(((err == null ? void 0 : err.code) === "ECONNREFUSED" || (err == null ? void 0 : err.code) === "ETIMEDOUT") && err.port === Broker.DEFAULT_WEB_SOCKET_PORT)) {
421
421
  fileLog(`websocket error: ${err.stack}`, MF_SERVER_IDENTIFIER, "fatal");
422
422
  return;
423
423
  }
package/dist/esm/core.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  consumeTypes,
4
4
  generateTypesInChildProcess,
5
5
  rpc_exports
6
- } from "./chunk-ES2OUXYD.js";
6
+ } from "./chunk-2GDMDG2O.js";
7
7
  import {
8
8
  DTSManager,
9
9
  HOST_API_TYPES_FILE_NAME,
@@ -19,7 +19,7 @@ import {
19
19
  retrieveTypesAssetsInfo,
20
20
  retrieveTypesZipPath,
21
21
  validateOptions
22
- } from "./chunk-QAYDHZEF.js";
22
+ } from "./chunk-ETMHGGQH.js";
23
23
  import "./chunk-WWV5RWOP.js";
24
24
  import "./chunk-647HGGGS.js";
25
25
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rpc_exports
3
- } from "./chunk-ES2OUXYD.js";
3
+ } from "./chunk-2GDMDG2O.js";
4
4
  import {
5
5
  ModuleFederationDevServer,
6
6
  createKoaServer,
@@ -9,7 +9,7 @@ import {
9
9
  retrieveMfTypesPath,
10
10
  retrieveRemoteConfig,
11
11
  retrieveTypesZipPath
12
- } from "./chunk-QAYDHZEF.js";
12
+ } from "./chunk-ETMHGGQH.js";
13
13
  import {
14
14
  fileLog,
15
15
  getIPV4
@@ -2,7 +2,7 @@ import {
2
2
  RpcGMCallTypes,
3
3
  exposeRpc,
4
4
  generateTypes
5
- } from "./chunk-QAYDHZEF.js";
5
+ } from "./chunk-ETMHGGQH.js";
6
6
  import "./chunk-WWV5RWOP.js";
7
7
  import {
8
8
  __async,
package/dist/esm/index.js CHANGED
@@ -2,14 +2,14 @@ import {
2
2
  consumeTypes,
3
3
  generateTypesInChildProcess,
4
4
  rpc_exports
5
- } from "./chunk-ES2OUXYD.js";
5
+ } from "./chunk-2GDMDG2O.js";
6
6
  import {
7
7
  cloneDeepOptions,
8
8
  generateTypes,
9
9
  isTSProject,
10
10
  retrieveTypesAssetsInfo,
11
11
  validateOptions
12
- } from "./chunk-QAYDHZEF.js";
12
+ } from "./chunk-ETMHGGQH.js";
13
13
  import {
14
14
  getIPV4,
15
15
  logger
@@ -281,7 +281,7 @@ var DevPlugin = _DevPlugin;
281
281
  import { normalizeOptions as normalizeOptions4 } from "@module-federation/sdk";
282
282
 
283
283
  // src/plugins/ConsumeTypesPlugin.ts
284
- import { logger as logger2 } from "@module-federation/sdk";
284
+ import { infrastructureLogger as logger2 } from "@module-federation/sdk";
285
285
  import { normalizeOptions as normalizeOptions2 } from "@module-federation/sdk";
286
286
  var DEFAULT_CONSUME_TYPES = {
287
287
  abortOnError: false,
@@ -387,10 +387,13 @@ var normalizeGenerateTypesOptions = /* @__PURE__ */ __name(({ context, outputDir
387
387
  outputDir,
388
388
  moduleFederationConfig: pluginOptions
389
389
  }, normalizedGenerateTypes),
390
- host: normalizedConsumeTypes === false ? void 0 : __spreadValues({
390
+ host: normalizedConsumeTypes === false ? void 0 : __spreadProps(__spreadValues({
391
391
  context,
392
392
  moduleFederationConfig: pluginOptions
393
- }, normalizedGenerateTypes),
393
+ }, normalizedConsumeTypes), {
394
+ // generateTypes only use host basic config, eg: typeFolders
395
+ remoteTypeUrls: typeof (normalizedConsumeTypes == null ? void 0 : normalizedConsumeTypes.remoteTypeUrls) === "object" ? normalizedConsumeTypes == null ? void 0 : normalizedConsumeTypes.remoteTypeUrls : void 0
396
+ }),
394
397
  extraOptions: dtsOptions.extraOptions || {},
395
398
  displayErrorInTerminal: dtsOptions.displayErrorInTerminal
396
399
  };
@@ -200,7 +200,7 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
200
200
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
201
201
  });
202
202
  const execPromise = import_util.default.promisify(import_child_process.exec);
203
- const cmd = `npx ${remoteOptions.compilerInstance} --project ${tempTsConfigJsonPath}`;
203
+ const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
204
204
  try {
205
205
  yield execPromise(cmd, {
206
206
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -1504,7 +1504,7 @@ var _ModuleFederationDevServer = class _ModuleFederationDevServer {
1504
1504
  });
1505
1505
  }
1506
1506
  _tryCreateBackgroundBroker(err) {
1507
- if (!((err == null ? void 0 : err.code) === "ECONNREFUSED" && err.port === Broker.DEFAULT_WEB_SOCKET_PORT)) {
1507
+ if (!(((err == null ? void 0 : err.code) === "ECONNREFUSED" || (err == null ? void 0 : err.code) === "ETIMEDOUT") && err.port === Broker.DEFAULT_WEB_SOCKET_PORT)) {
1508
1508
  fileLog(`websocket error: ${err.stack}`, MF_SERVER_IDENTIFIER, "fatal");
1509
1509
  return;
1510
1510
  }
@@ -401,7 +401,7 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
401
401
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
402
402
  });
403
403
  const execPromise = import_util.default.promisify(import_child_process.exec);
404
- const cmd = `npx ${remoteOptions.compilerInstance} --project ${tempTsConfigJsonPath}`;
404
+ const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
405
405
  try {
406
406
  yield execPromise(cmd, {
407
407
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
package/dist/index.js CHANGED
@@ -219,7 +219,7 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
219
219
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
220
220
  });
221
221
  const execPromise = import_util.default.promisify(import_child_process.exec);
222
- const cmd = `npx ${remoteOptions.compilerInstance} --project ${tempTsConfigJsonPath}`;
222
+ const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
223
223
  try {
224
224
  yield execPromise(cmd, {
225
225
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -2684,7 +2684,7 @@ var _ConsumeTypesPlugin = class _ConsumeTypesPlugin {
2684
2684
  fetchRemoteTypeUrlsResolve(void 0);
2685
2685
  return;
2686
2686
  }
2687
- import_sdk8.logger.debug("start fetching remote types...");
2687
+ import_sdk8.infrastructureLogger.debug("start fetching remote types...");
2688
2688
  const promise = consumeTypesAPI(dtsManagerOptions, fetchRemoteTypeUrlsResolve);
2689
2689
  compiler.hooks.thisCompilation.tap("mf:generateTypes", (compilation) => {
2690
2690
  compilation.hooks.processAssets.tapPromise({
@@ -2695,7 +2695,7 @@ var _ConsumeTypesPlugin = class _ConsumeTypesPlugin {
2695
2695
  )
2696
2696
  }, () => __async(this, null, function* () {
2697
2697
  yield promise;
2698
- import_sdk8.logger.debug("fetch remote types success!");
2698
+ import_sdk8.infrastructureLogger.debug("fetch remote types success!");
2699
2699
  }));
2700
2700
  });
2701
2701
  }
@@ -2727,10 +2727,13 @@ var normalizeGenerateTypesOptions = /* @__PURE__ */ __name(({ context, outputDir
2727
2727
  outputDir,
2728
2728
  moduleFederationConfig: pluginOptions
2729
2729
  }, normalizedGenerateTypes),
2730
- host: normalizedConsumeTypes === false ? void 0 : __spreadValues({
2730
+ host: normalizedConsumeTypes === false ? void 0 : __spreadProps(__spreadValues({
2731
2731
  context,
2732
2732
  moduleFederationConfig: pluginOptions
2733
- }, normalizedGenerateTypes),
2733
+ }, normalizedConsumeTypes), {
2734
+ // generateTypes only use host basic config, eg: typeFolders
2735
+ remoteTypeUrls: typeof (normalizedConsumeTypes == null ? void 0 : normalizedConsumeTypes.remoteTypeUrls) === "object" ? normalizedConsumeTypes == null ? void 0 : normalizedConsumeTypes.remoteTypeUrls : void 0
2736
+ }),
2734
2737
  extraOptions: dtsOptions.extraOptions || {},
2735
2738
  displayErrorInTerminal: dtsOptions.displayErrorInTerminal
2736
2739
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "adm-zip": "^0.5.10",
52
52
  "ansi-colors": "^4.1.3",
53
- "axios": "^1.11.0",
53
+ "axios": "^1.12.0",
54
54
  "rambda": "^9.1.0",
55
55
  "@module-federation/sdk": "workspace:*",
56
56
  "@module-federation/managers": "workspace:*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "adm-zip": "^0.5.10",
52
52
  "ansi-colors": "^4.1.3",
53
- "axios": "^1.11.0",
53
+ "axios": "^1.12.0",
54
54
  "rambda": "^9.1.0",
55
55
  "lodash.clonedeepwith": "4.5.0",
56
56
  "chalk": "3.0.0",
@@ -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.19.0",
64
- "@module-federation/managers": "0.19.0",
65
- "@module-federation/third-party-dts-extractor": "0.19.0",
66
- "@module-federation/error-codes": "0.19.0"
63
+ "@module-federation/sdk": "0.20.0",
64
+ "@module-federation/managers": "0.20.0",
65
+ "@module-federation/error-codes": "0.20.0",
66
+ "@module-federation/third-party-dts-extractor": "0.20.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/ws": "8.5.12",
@@ -73,7 +73,7 @@
73
73
  "@vue/tsconfig": "^0.7.0",
74
74
  "vue-tsc": "^2.2.10",
75
75
  "rimraf": "~6.0.1",
76
- "@module-federation/runtime": "0.19.0"
76
+ "@module-federation/runtime": "0.20.0"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "typescript": "^4.9.0 || ^5.0.0",