@module-federation/dts-plugin 2.5.0 → 2.5.1
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/{Broker-DRFgFvXI.js → Broker-CaenCqdn.js} +1 -1
- package/dist/CHANGELOG.md +13 -0
- package/dist/{consumeTypes-CFK17Cck.js → consumeTypes-FbF0o6AJ.js} +2 -2
- package/dist/core.js +3 -3
- package/dist/esm/{Broker-z82OgzMe.mjs → Broker-Cmbh_XVO.mjs} +1 -1
- package/dist/esm/{consumeTypes-DCGF9bG3.mjs → consumeTypes-COIltElB.mjs} +2 -2
- package/dist/esm/core.mjs +3 -3
- package/dist/esm/{expose-rpc-BgxOTFXQ.mjs → expose-rpc-ZWQxpg0y.mjs} +8 -4
- package/dist/esm/fork-dev-worker.mjs +3 -3
- package/dist/esm/fork-generate-dts.mjs +2 -2
- package/dist/esm/index.mjs +9 -4
- package/dist/esm/start-broker.mjs +1 -1
- package/dist/{expose-rpc-mEaCWCcd.js → expose-rpc-XLxmAXIW.js} +9 -5
- package/dist/fork-dev-worker.js +3 -3
- package/dist/fork-generate-dts.js +2 -2
- package/dist/iife/launch-web-client.iife.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -6
- package/dist/start-broker.js +1 -1
- package/package.json +7 -7
|
@@ -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,18 @@
|
|
|
1
1
|
# @module-federation/dts-plugin
|
|
2
2
|
|
|
3
|
+
## 2.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b79ba22: Update the dts plugin websocket dependency to a version that includes the CVE-2026-45736 fix.
|
|
8
|
+
- 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`.
|
|
9
|
+
- b9b3b8c: Fix Windows manifest type URL resolution in dts-plugin consumeTypes and allow the default IP family option to auto-select with `0`.
|
|
10
|
+
- Updated dependencies [b9b3b8c]
|
|
11
|
+
- @module-federation/sdk@2.5.1
|
|
12
|
+
- @module-federation/managers@2.5.1
|
|
13
|
+
- @module-federation/third-party-dts-extractor@2.5.1
|
|
14
|
+
- @module-federation/error-codes@2.5.1
|
|
15
|
+
|
|
3
16
|
## 2.5.0
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_Action = require('./Action-CzhPMw2i.js');
|
|
2
|
-
const require_expose_rpc = require('./expose-rpc-
|
|
2
|
+
const require_expose_rpc = require('./expose-rpc-XLxmAXIW.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-
|
|
3
|
-
const require_expose_rpc = require('./expose-rpc-
|
|
4
|
-
const require_consumeTypes = require('./consumeTypes-
|
|
2
|
+
require('./Broker-CaenCqdn.js');
|
|
3
|
+
const require_expose_rpc = require('./expose-rpc-XLxmAXIW.js');
|
|
4
|
+
const require_consumeTypes = require('./consumeTypes-FbF0o6AJ.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-
|
|
1
|
+
import { a as cloneDeepOptions, n as RpcGMCallTypes, o as getDTSManagerConstructor, s as isDebugMode, t as exposeRpc, x as __exportAll } from "./expose-rpc-ZWQxpg0y.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-
|
|
2
|
-
import "./Broker-
|
|
3
|
-
import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-
|
|
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-ZWQxpg0y.mjs";
|
|
2
|
+
import "./Broker-Cmbh_XVO.mjs";
|
|
3
|
+
import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-COIltElB.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-
|
|
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:
|
|
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
|
-
|
|
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(
|
|
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");
|
|
@@ -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-
|
|
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-ZWQxpg0y.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-
|
|
4
|
-
import "./consumeTypes-
|
|
3
|
+
import { n as UpdateKind, o as getIPV4, s as fileLog } from "./Broker-Cmbh_XVO.mjs";
|
|
4
|
+
import "./consumeTypes-COIltElB.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-
|
|
2
|
-
import "./Broker-
|
|
1
|
+
import { n as RpcGMCallTypes, r as generateTypes, t as exposeRpc } from "./expose-rpc-ZWQxpg0y.mjs";
|
|
2
|
+
import "./Broker-Cmbh_XVO.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/core/lib/forkGenerateDts.ts
|
|
5
5
|
async function forkGenerateDts(options) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -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-
|
|
1
|
+
import { a as cloneDeepOptions, c as isTSProject, l as retrieveTypesAssetsInfo, n as RpcGMCallTypes, r as generateTypes, u as validateOptions } from "./expose-rpc-ZWQxpg0y.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-
|
|
4
|
-
import { a as createRpcWorker, n as generateTypesInChildProcess, t as consumeTypes } from "./consumeTypes-
|
|
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-COIltElB.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,7 +1,8 @@
|
|
|
1
1
|
const require_Action = require('./Action-CzhPMw2i.js');
|
|
2
|
-
const require_Broker = require('./Broker-
|
|
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:
|
|
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
|
-
|
|
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(
|
|
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");
|
package/dist/fork-dev-worker.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
|
-
const require_Broker = require('./Broker-
|
|
4
|
-
const require_expose_rpc = require('./expose-rpc-
|
|
5
|
-
require('./consumeTypes-
|
|
3
|
+
const require_Broker = require('./Broker-CaenCqdn.js');
|
|
4
|
+
const require_expose_rpc = require('./expose-rpc-XLxmAXIW.js');
|
|
5
|
+
require('./consumeTypes-FbF0o6AJ.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-
|
|
3
|
-
const require_expose_rpc = require('./expose-rpc-
|
|
2
|
+
require('./Broker-CaenCqdn.js');
|
|
3
|
+
const require_expose_rpc = require('./expose-rpc-XLxmAXIW.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.
|
|
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-
|
|
4
|
-
const require_expose_rpc = require('./expose-rpc-
|
|
5
|
-
const require_consumeTypes = require('./consumeTypes-
|
|
3
|
+
const require_Broker = require('./Broker-CaenCqdn.js');
|
|
4
|
+
const require_expose_rpc = require('./expose-rpc-XLxmAXIW.js');
|
|
5
|
+
const require_consumeTypes = require('./consumeTypes-FbF0o6AJ.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);
|
package/dist/start-broker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/dts-plugin",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"author": "hanric <hanric.zhang@gmail.com>",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"isomorphic-ws": "5.0.0",
|
|
71
71
|
"undici": "7.24.7",
|
|
72
72
|
"node-schedule": "2.1.1",
|
|
73
|
-
"ws": "8.
|
|
74
|
-
"@module-federation/
|
|
75
|
-
"@module-federation/
|
|
76
|
-
"@module-federation/sdk": "2.5.
|
|
77
|
-
"@module-federation/
|
|
73
|
+
"ws": "8.21.0",
|
|
74
|
+
"@module-federation/error-codes": "2.5.1",
|
|
75
|
+
"@module-federation/managers": "2.5.1",
|
|
76
|
+
"@module-federation/sdk": "2.5.1",
|
|
77
|
+
"@module-federation/third-party-dts-extractor": "2.5.1"
|
|
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.
|
|
89
|
+
"@module-federation/runtime": "2.5.1"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"typescript": "^4.9.0 || ^5.0.0",
|