@module-federation/dts-plugin 2.5.0 → 2.6.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.
@@ -1,6 +1,7 @@
1
1
  const require_Action = require('./Action-CzhPMw2i.js');
2
2
  let fs = require("fs");
3
3
  fs = require_Action.__toESM(fs);
4
+ let url = require("url");
4
5
  let path = require("path");
5
6
  path = require_Action.__toESM(path);
6
7
  let _module_federation_sdk = require("@module-federation/sdk");
@@ -13,7 +14,6 @@ isomorphic_ws = require_Action.__toESM(isomorphic_ws);
13
14
  let http = require("http");
14
15
  let node_schedule = require("node-schedule");
15
16
  node_schedule = require_Action.__toESM(node_schedule);
16
- let url = require("url");
17
17
 
18
18
  //#region src/server/message/API/API.ts
19
19
  let APIKind = /* @__PURE__ */ function(APIKind) {
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a7f724: Fix dts-plugin expose resolution for extensionless multi-dot paths like `foo.generated` so they correctly infer supported source files such as `.ts`, `.tsx`, `.vue`, `.js`, and `.jsx`, while preserving explicit extensions and directory `index` fallback behavior.
8
+ - @module-federation/sdk@2.6.0
9
+ - @module-federation/managers@2.6.0
10
+ - @module-federation/third-party-dts-extractor@2.6.0
11
+ - @module-federation/error-codes@2.6.0
12
+
13
+ ## 2.5.1
14
+
15
+ ### Patch Changes
16
+
17
+ - b79ba22: Update the dts plugin websocket dependency to a version that includes the CVE-2026-45736 fix.
18
+ - b553153: Fix `__dirname is not defined` ReferenceError when `@module-federation/dts-plugin` is consumed as ESM. `DevWorker`, `DevPlugin`, and `createBroker` now derive `__dirname` from `import.meta.url` (matching the existing `DtsWorker` shim) so the ESM build no longer emits bare `__dirname`.
19
+ - b9b3b8c: Fix Windows manifest type URL resolution in dts-plugin consumeTypes and allow the default IP family option to auto-select with `0`.
20
+ - Updated dependencies [b9b3b8c]
21
+ - @module-federation/sdk@2.5.1
22
+ - @module-federation/managers@2.5.1
23
+ - @module-federation/third-party-dts-extractor@2.5.1
24
+ - @module-federation/error-codes@2.5.1
25
+
3
26
  ## 2.5.0
4
27
 
5
28
  ### Patch Changes
@@ -1,11 +1,11 @@
1
1
  const require_Action = require('./Action-CzhPMw2i.js');
2
- const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
2
+ const require_expose_rpc = require('./expose-rpc-BNzQqY2X.js');
3
+ let url = require("url");
3
4
  let path = require("path");
4
5
  path = require_Action.__toESM(path);
5
6
  let crypto = require("crypto");
6
7
  let child_process = require("child_process");
7
8
  child_process = require_Action.__toESM(child_process);
8
- let url = require("url");
9
9
  let process$1 = require("process");
10
10
  process$1 = require_Action.__toESM(process$1);
11
11
 
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- require('./Broker-DRFgFvXI.js');
3
- const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
4
- const require_consumeTypes = require('./consumeTypes-CFK17Cck.js');
2
+ require('./Broker-CaenCqdn.js');
3
+ const require_expose_rpc = require('./expose-rpc-BNzQqY2X.js');
4
+ const require_consumeTypes = require('./consumeTypes-DuDkcp8N.js');
5
5
 
6
6
  exports.DTSManager = require_expose_rpc.DTSManager;
7
7
  exports.DtsWorker = require_consumeTypes.DtsWorker;
@@ -1,5 +1,6 @@
1
1
  import { a as MF_SERVER_IDENTIFIER, c as WEB_SOCKET_CONNECT_MAGIC_ID, i as DEFAULT_WEB_SOCKET_PORT, l as Message, n as ActionKind, o as UpdateMode } from "./Action-DNNg2YDh.mjs";
2
2
  import * as fs$1 from "fs";
3
+ import { parse } from "url";
3
4
  import * as path$1 from "path";
4
5
  import { SEPARATOR, createLogger } from "@module-federation/sdk";
5
6
  import net from "net";
@@ -7,7 +8,6 @@ import os from "os";
7
8
  import WebSocket from "isomorphic-ws";
8
9
  import { createServer } from "http";
9
10
  import schedule from "node-schedule";
10
- import { parse } from "url";
11
11
 
12
12
  //#region src/server/message/API/API.ts
13
13
  let APIKind = /* @__PURE__ */ function(APIKind) {
@@ -1,8 +1,8 @@
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";
1
+ import { a as cloneDeepOptions, n as RpcGMCallTypes, o as getDTSManagerConstructor, s as isDebugMode, t as exposeRpc, x as __exportAll } from "./expose-rpc-BiwGpqZ3.mjs";
2
+ import { fileURLToPath } from "url";
2
3
  import path from "path";
3
4
  import { randomUUID } from "crypto";
4
5
  import * as child_process from "child_process";
5
- import { fileURLToPath } from "url";
6
6
  import * as process$2 from "process";
7
7
 
8
8
  //#region src/core/rpc/rpc-error.ts
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-BgxOTFXQ.mjs";
2
- import "./Broker-z82OgzMe.mjs";
3
- import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-DCGF9bG3.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-BiwGpqZ3.mjs";
2
+ import "./Broker-Cmbh_XVO.mjs";
3
+ import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-CUv-A3UY.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 };
@@ -1,7 +1,8 @@
1
1
  import { a as MF_SERVER_IDENTIFIER, n as ActionKind, o as UpdateMode, r as DEFAULT_TAR_NAME, t as Action } from "./Action-DNNg2YDh.mjs";
2
- import { a as getIdentifier, c as logger$1, i as getFreePort, l as LogKind, n as UpdateKind, o as getIPV4, r as fib, s as fileLog, t as Broker, u as APIKind } from "./Broker-z82OgzMe.mjs";
2
+ import { a as getIdentifier, c as logger$1, i as getFreePort, l as LogKind, n as UpdateKind, o as getIPV4, r as fib, s as fileLog, t as Broker, u as APIKind } from "./Broker-Cmbh_XVO.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import fs, { existsSync, mkdirSync, writeFileSync } from "fs";
5
+ import { fileURLToPath } from "url";
5
6
  import path, { dirname, extname, isAbsolute, join, normalize, relative, resolve, sep } from "path";
6
7
  import { cp, mkdir, readFile, readdir, rm, stat, writeFile } from "fs/promises";
7
8
  import { utils } from "@module-federation/managers";
@@ -87,6 +88,8 @@ var UpdatePublisherAction = class extends Action {
87
88
 
88
89
  //#endregion
89
90
  //#region src/server/broker/createBroker.ts
91
+ const __filename = fileURLToPath(import.meta.url);
92
+ const __dirname = path.dirname(__filename);
90
93
  function createBroker() {
91
94
  const sub = fork(path.resolve(__dirname, "./start-broker.js"), [], {
92
95
  detached: true,
@@ -667,7 +670,7 @@ const defaultOptions$1 = {
667
670
  remoteTypeUrls: {},
668
671
  timeout: 6e4,
669
672
  typesOnBuild: false,
670
- family: 4
673
+ family: 0
671
674
  };
672
675
  const buildZipUrl = (hostOptions, url) => {
673
676
  const remoteUrl = new URL(url, "file:");
@@ -881,13 +884,14 @@ var DTSManager = class {
881
884
  else publicPath = getPublicPath();
882
885
  }
883
886
  if (publicPath === "auto") publicPath = inferAutoPublicPath(remoteInfo.url);
884
- remoteInfo.zipUrl = new URL(path.join(addProtocol(publicPath), manifestJson.metaData.types.zip)).href;
887
+ const normalizedPublicPath = addProtocol(publicPath).endsWith("/") ? addProtocol(publicPath) : `${addProtocol(publicPath)}/`;
888
+ remoteInfo.zipUrl = new URL(manifestJson.metaData.types.zip, normalizedPublicPath).href;
885
889
  if (!manifestJson.metaData.types.api) {
886
890
  console.warn(`Can not get ${remoteInfo.name}'s api types url!`);
887
891
  remoteInfo.apiTypeUrl = "";
888
892
  return remoteInfo;
889
893
  }
890
- remoteInfo.apiTypeUrl = new URL(path.join(addProtocol(publicPath), manifestJson.metaData.types.api)).href;
894
+ remoteInfo.apiTypeUrl = new URL(manifestJson.metaData.types.api, normalizedPublicPath).href;
891
895
  return remoteInfo;
892
896
  } catch (_err) {
893
897
  fileLog(`fetch manifest failed, ${_err}, ${remoteInfo.name} will be ignored`, "requestRemoteManifest", "error");
@@ -1231,7 +1235,7 @@ function getEffectiveRootDir(parsedCommandLine) {
1231
1235
  throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
1232
1236
  }
1233
1237
  const getDependentFiles = (rootFiles, configContent, rootDir) => {
1234
- const dependentFiles = typescript.createProgram(rootFiles, configContent.options).getSourceFiles().map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
1238
+ const dependentFiles = typescript.createProgram(rootFiles, configContent.options).getSourceFiles().map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir + "/"));
1235
1239
  return dependentFiles.length ? dependentFiles : rootFiles;
1236
1240
  };
1237
1241
  const readTsConfig = ({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
@@ -1270,15 +1274,18 @@ const readTsConfig = ({ tsConfigPath, typesFolder, compiledTypesFolder, context,
1270
1274
  return rawTsConfigJson;
1271
1275
  };
1272
1276
  const TS_EXTENSIONS = [
1273
- "ts",
1274
- "tsx",
1275
- "vue",
1276
- "svelte"
1277
+ ".ts",
1278
+ ".tsx",
1279
+ ".vue",
1280
+ ".svelte",
1281
+ ".js",
1282
+ ".jsx"
1277
1283
  ];
1278
1284
  const resolveWithExtension = (exposedPath, context) => {
1279
- if (extname(exposedPath)) return resolve(context, exposedPath);
1285
+ const explicitExtension = extname(exposedPath);
1286
+ if (TS_EXTENSIONS.includes(explicitExtension)) return resolve(context, exposedPath);
1280
1287
  for (const extension of TS_EXTENSIONS) {
1281
- const exposedPathWithExtension = resolve(context, `${exposedPath}.${extension}`);
1288
+ const exposedPathWithExtension = resolve(context, `${exposedPath}${extension}`);
1282
1289
  if (existsSync(exposedPathWithExtension)) return exposedPathWithExtension;
1283
1290
  }
1284
1291
  };
@@ -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-BgxOTFXQ.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-BiwGpqZ3.mjs";
2
2
  import { o as UpdateMode, r as DEFAULT_TAR_NAME } from "./Action-DNNg2YDh.mjs";
3
- import { n as UpdateKind, o as getIPV4, s as fileLog } from "./Broker-z82OgzMe.mjs";
4
- import "./consumeTypes-DCGF9bG3.mjs";
3
+ import { n as UpdateKind, o as getIPV4, s as fileLog } from "./Broker-Cmbh_XVO.mjs";
4
+ import "./consumeTypes-CUv-A3UY.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,5 +1,5 @@
1
- import { n as RpcGMCallTypes, r as generateTypes, t as exposeRpc } from "./expose-rpc-BgxOTFXQ.mjs";
2
- import "./Broker-z82OgzMe.mjs";
1
+ import { n as RpcGMCallTypes, r as generateTypes, t as exposeRpc } from "./expose-rpc-BiwGpqZ3.mjs";
2
+ import "./Broker-Cmbh_XVO.mjs";
3
3
 
4
4
  //#region src/core/lib/forkGenerateDts.ts
5
5
  async function forkGenerateDts(options) {
@@ -1,20 +1,23 @@
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";
1
+ import { a as cloneDeepOptions, c as isTSProject, l as retrieveTypesAssetsInfo, n as RpcGMCallTypes, r as generateTypes, u as validateOptions } from "./expose-rpc-BiwGpqZ3.mjs";
2
2
  import { s as WEB_CLIENT_OPTIONS_IDENTIFIER } from "./Action-DNNg2YDh.mjs";
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-DCGF9bG3.mjs";
3
+ import { c as logger$1, o as getIPV4 } from "./Broker-Cmbh_XVO.mjs";
4
+ import { a as createRpcWorker, n as generateTypesInChildProcess, t as consumeTypes } from "./consumeTypes-CUv-A3UY.mjs";
5
5
  import "./core.mjs";
6
6
  import fs from "fs";
7
+ import { fileURLToPath } from "url";
7
8
  import * as path$1 from "path";
8
9
  import path from "path";
9
10
  import { rm } from "fs/promises";
10
11
  import { TEMP_DIR, infrastructureLogger, logger, normalizeOptions } from "@module-federation/sdk";
11
12
 
12
13
  //#region src/dev-worker/DevWorker.ts
14
+ const __filename$1 = fileURLToPath(import.meta.url);
15
+ const __dirname$1 = path.dirname(__filename$1);
13
16
  var DevWorker = class {
14
17
  constructor(options) {
15
18
  this._options = cloneDeepOptions(options);
16
19
  this.removeUnSerializationOptions();
17
- this._rpcWorker = createRpcWorker(path.resolve(__dirname, "./fork-dev-worker.js"), {}, void 0, false);
20
+ this._rpcWorker = createRpcWorker(path.resolve(__dirname$1, "./fork-dev-worker.js"), {}, void 0, false);
18
21
  this._res = this._rpcWorker.connect(this._options);
19
22
  }
20
23
  removeUnSerializationOptions() {
@@ -71,6 +74,8 @@ function getCompilerOutputDir(compiler) {
71
74
 
72
75
  //#endregion
73
76
  //#region src/plugins/DevPlugin.ts
77
+ const __filename = fileURLToPath(import.meta.url);
78
+ const __dirname = path.dirname(__filename);
74
79
  var PROCESS_EXIT_CODE = /* @__PURE__ */ function(PROCESS_EXIT_CODE) {
75
80
  PROCESS_EXIT_CODE[PROCESS_EXIT_CODE["SUCCESS"] = 0] = "SUCCESS";
76
81
  PROCESS_EXIT_CODE[PROCESS_EXIT_CODE["FAILURE"] = 1] = "FAILURE";
@@ -1,4 +1,4 @@
1
- import { s as fileLog, t as Broker } from "./Broker-z82OgzMe.mjs";
1
+ import { s as fileLog, t as Broker } from "./Broker-Cmbh_XVO.mjs";
2
2
 
3
3
  //#region src/server/broker/startBroker.ts
4
4
  let broker;
@@ -1,7 +1,8 @@
1
1
  const require_Action = require('./Action-CzhPMw2i.js');
2
- const require_Broker = require('./Broker-DRFgFvXI.js');
2
+ const require_Broker = require('./Broker-CaenCqdn.js');
3
3
  let fs = require("fs");
4
4
  fs = require_Action.__toESM(fs);
5
+ let url = require("url");
5
6
  let path = require("path");
6
7
  path = require_Action.__toESM(path);
7
8
  let fs_promises = require("fs/promises");
@@ -78,8 +79,10 @@ var UpdatePublisherAction = class extends require_Action.Action {
78
79
 
79
80
  //#endregion
80
81
  //#region src/server/broker/createBroker.ts
82
+ const __filename$1 = (0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
83
+ const __dirname$1 = path.default.dirname(__filename$1);
81
84
  function createBroker() {
82
- const sub = (0, child_process.fork)(path.default.resolve(__dirname, "./start-broker.js"), [], {
85
+ const sub = (0, child_process.fork)(path.default.resolve(__dirname$1, "./start-broker.js"), [], {
83
86
  detached: true,
84
87
  stdio: "ignore",
85
88
  env: process.env
@@ -658,7 +661,7 @@ const defaultOptions$1 = {
658
661
  remoteTypeUrls: {},
659
662
  timeout: 6e4,
660
663
  typesOnBuild: false,
661
- family: 4
664
+ family: 0
662
665
  };
663
666
  const buildZipUrl = (hostOptions, url) => {
664
667
  const remoteUrl = new URL(url, "file:");
@@ -872,13 +875,14 @@ var DTSManager = class {
872
875
  else publicPath = getPublicPath();
873
876
  }
874
877
  if (publicPath === "auto") publicPath = (0, _module_federation_sdk.inferAutoPublicPath)(remoteInfo.url);
875
- remoteInfo.zipUrl = new URL(path.default.join(addProtocol(publicPath), manifestJson.metaData.types.zip)).href;
878
+ const normalizedPublicPath = addProtocol(publicPath).endsWith("/") ? addProtocol(publicPath) : `${addProtocol(publicPath)}/`;
879
+ remoteInfo.zipUrl = new URL(manifestJson.metaData.types.zip, normalizedPublicPath).href;
876
880
  if (!manifestJson.metaData.types.api) {
877
881
  console.warn(`Can not get ${remoteInfo.name}'s api types url!`);
878
882
  remoteInfo.apiTypeUrl = "";
879
883
  return remoteInfo;
880
884
  }
881
- remoteInfo.apiTypeUrl = new URL(path.default.join(addProtocol(publicPath), manifestJson.metaData.types.api)).href;
885
+ remoteInfo.apiTypeUrl = new URL(manifestJson.metaData.types.api, normalizedPublicPath).href;
882
886
  return remoteInfo;
883
887
  } catch (_err) {
884
888
  require_Broker.fileLog(`fetch manifest failed, ${_err}, ${remoteInfo.name} will be ignored`, "requestRemoteManifest", "error");
@@ -1222,7 +1226,7 @@ function getEffectiveRootDir(parsedCommandLine) {
1222
1226
  throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
1223
1227
  }
1224
1228
  const getDependentFiles = (rootFiles, configContent, rootDir) => {
1225
- const dependentFiles = typescript.default.createProgram(rootFiles, configContent.options).getSourceFiles().map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
1229
+ const dependentFiles = typescript.default.createProgram(rootFiles, configContent.options).getSourceFiles().map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir + "/"));
1226
1230
  return dependentFiles.length ? dependentFiles : rootFiles;
1227
1231
  };
1228
1232
  const readTsConfig = ({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
@@ -1261,15 +1265,18 @@ const readTsConfig = ({ tsConfigPath, typesFolder, compiledTypesFolder, context,
1261
1265
  return rawTsConfigJson;
1262
1266
  };
1263
1267
  const TS_EXTENSIONS = [
1264
- "ts",
1265
- "tsx",
1266
- "vue",
1267
- "svelte"
1268
+ ".ts",
1269
+ ".tsx",
1270
+ ".vue",
1271
+ ".svelte",
1272
+ ".js",
1273
+ ".jsx"
1268
1274
  ];
1269
1275
  const resolveWithExtension = (exposedPath, context) => {
1270
- if ((0, path.extname)(exposedPath)) return (0, path.resolve)(context, exposedPath);
1276
+ const explicitExtension = (0, path.extname)(exposedPath);
1277
+ if (TS_EXTENSIONS.includes(explicitExtension)) return (0, path.resolve)(context, exposedPath);
1271
1278
  for (const extension of TS_EXTENSIONS) {
1272
- const exposedPathWithExtension = (0, path.resolve)(context, `${exposedPath}.${extension}`);
1279
+ const exposedPathWithExtension = (0, path.resolve)(context, `${exposedPath}${extension}`);
1273
1280
  if ((0, fs.existsSync)(exposedPathWithExtension)) return exposedPathWithExtension;
1274
1281
  }
1275
1282
  };
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_Action = require('./Action-CzhPMw2i.js');
3
- const require_Broker = require('./Broker-DRFgFvXI.js');
4
- const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
5
- require('./consumeTypes-CFK17Cck.js');
3
+ const require_Broker = require('./Broker-CaenCqdn.js');
4
+ const require_expose_rpc = require('./expose-rpc-BNzQqY2X.js');
5
+ require('./consumeTypes-DuDkcp8N.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
- require('./Broker-DRFgFvXI.js');
3
- const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
2
+ require('./Broker-CaenCqdn.js');
3
+ const require_expose_rpc = require('./expose-rpc-BNzQqY2X.js');
4
4
 
5
5
  //#region src/core/lib/forkGenerateDts.ts
6
6
  async function forkGenerateDts(options) {
@@ -56,7 +56,7 @@
56
56
  }({});
57
57
 
58
58
  //#endregion
59
- //#region ../../node_modules/.pnpm/isomorphic-ws@5.0.0_ws@8.18.0/node_modules/isomorphic-ws/browser.js
59
+ //#region ../../node_modules/.pnpm/isomorphic-ws@5.0.0_ws@8.21.0/node_modules/isomorphic-ws/browser.js
60
60
  var ws = null;
61
61
  if (typeof WebSocket !== "undefined") ws = WebSocket;
62
62
  else if (typeof MozWebSocket !== "undefined") ws = MozWebSocket;
package/dist/index.d.ts CHANGED
@@ -35,7 +35,7 @@ declare const normalizeConsumeTypesOptions: ({
35
35
  runtimePkgs?: string[];
36
36
  remoteTypeUrls?: (() => Promise<moduleFederationPlugin.RemoteTypeUrls>) | moduleFederationPlugin.RemoteTypeUrls;
37
37
  timeout?: number;
38
- family?: 4 | 6;
38
+ family?: 0 | 4 | 6;
39
39
  typesOnBuild?: boolean;
40
40
  implementation: string;
41
41
  context: string;
package/dist/index.js CHANGED
@@ -1,22 +1,25 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_Action = require('./Action-CzhPMw2i.js');
3
- const require_Broker = require('./Broker-DRFgFvXI.js');
4
- const require_expose_rpc = require('./expose-rpc-mEaCWCcd.js');
5
- const require_consumeTypes = require('./consumeTypes-CFK17Cck.js');
3
+ const require_Broker = require('./Broker-CaenCqdn.js');
4
+ const require_expose_rpc = require('./expose-rpc-BNzQqY2X.js');
5
+ const require_consumeTypes = require('./consumeTypes-DuDkcp8N.js');
6
6
  require('./core.js');
7
7
  let fs = require("fs");
8
8
  fs = require_Action.__toESM(fs);
9
+ let url = require("url");
9
10
  let path = require("path");
10
11
  path = require_Action.__toESM(path);
11
12
  let fs_promises = require("fs/promises");
12
13
  let _module_federation_sdk = require("@module-federation/sdk");
13
14
 
14
15
  //#region src/dev-worker/DevWorker.ts
16
+ const __filename$2 = (0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
17
+ const __dirname$2 = path.default.dirname(__filename$2);
15
18
  var DevWorker = class {
16
19
  constructor(options) {
17
20
  this._options = require_expose_rpc.cloneDeepOptions(options);
18
21
  this.removeUnSerializationOptions();
19
- this._rpcWorker = require_consumeTypes.createRpcWorker(path.default.resolve(__dirname, "./fork-dev-worker.js"), {}, void 0, false);
22
+ this._rpcWorker = require_consumeTypes.createRpcWorker(path.default.resolve(__dirname$2, "./fork-dev-worker.js"), {}, void 0, false);
20
23
  this._res = this._rpcWorker.connect(this._options);
21
24
  }
22
25
  removeUnSerializationOptions() {
@@ -73,6 +76,8 @@ function getCompilerOutputDir(compiler) {
73
76
 
74
77
  //#endregion
75
78
  //#region src/plugins/DevPlugin.ts
79
+ const __filename$1 = (0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
80
+ const __dirname$1 = path.default.dirname(__filename$1);
76
81
  var PROCESS_EXIT_CODE = /* @__PURE__ */ function(PROCESS_EXIT_CODE) {
77
82
  PROCESS_EXIT_CODE[PROCESS_EXIT_CODE["SUCCESS"] = 0] = "SUCCESS";
78
83
  PROCESS_EXIT_CODE[PROCESS_EXIT_CODE["FAILURE"] = 1] = "FAILURE";
@@ -94,7 +99,7 @@ var DevPlugin = class DevPlugin {
94
99
  }
95
100
  static ensureLiveReloadEntry(options, filePath) {
96
101
  ensureTempDir(filePath);
97
- const liveReloadEntryWithOptions = fs.default.readFileSync(path.default.join(__dirname, "./iife/launch-web-client.iife.js")).toString("utf-8").replace(require_Action.WEB_CLIENT_OPTIONS_IDENTIFIER, JSON.stringify(options));
102
+ const liveReloadEntryWithOptions = fs.default.readFileSync(path.default.join(__dirname$1, "./iife/launch-web-client.iife.js")).toString("utf-8").replace(require_Action.WEB_CLIENT_OPTIONS_IDENTIFIER, JSON.stringify(options));
98
103
  fs.default.writeFileSync(filePath, liveReloadEntryWithOptions);
99
104
  }
100
105
  _stopWhenSIGTERMOrSIGINT() {
@@ -139,7 +144,7 @@ var DevPlugin = class DevPlugin {
139
144
  if (!name) throw new Error("name is required if you want to enable dev server!");
140
145
  if (!normalizedDev.disableDynamicRemoteTypeHints) {
141
146
  if (!this._options.runtimePlugins) this._options.runtimePlugins = [];
142
- this._options.runtimePlugins.push(path.default.resolve(__dirname, "dynamic-remote-type-hints-plugin.js"));
147
+ this._options.runtimePlugins.push(path.default.resolve(__dirname$1, "dynamic-remote-type-hints-plugin.js"));
143
148
  }
144
149
  if (!normalizedDev.disableLiveReload) {
145
150
  const TEMP_DIR = path.default.join(`${process.cwd()}/node_modules`, _module_federation_sdk.TEMP_DIR);
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_Broker = require('./Broker-DRFgFvXI.js');
2
+ const require_Broker = require('./Broker-CaenCqdn.js');
3
3
 
4
4
  //#region src/server/broker/startBroker.ts
5
5
  let broker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -68,13 +68,13 @@
68
68
  "adm-zip": "0.5.10",
69
69
  "ansi-colors": "4.1.3",
70
70
  "isomorphic-ws": "5.0.0",
71
- "undici": "7.24.7",
71
+ "undici": "7.28.0",
72
72
  "node-schedule": "2.1.1",
73
- "ws": "8.18.0",
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"
73
+ "ws": "8.21.0",
74
+ "@module-federation/error-codes": "2.6.0",
75
+ "@module-federation/sdk": "2.6.0",
76
+ "@module-federation/managers": "2.6.0",
77
+ "@module-federation/third-party-dts-extractor": "2.6.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.5.0"
89
+ "@module-federation/runtime": "2.6.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "typescript": "^4.9.0 || ^5.0.0",