@module-federation/dts-plugin 0.13.0 → 0.14.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 +22 -0
- package/dist/core.js +44 -44
- package/dist/dynamic-remote-type-hints-plugin.js +11 -11
- package/dist/esm/{chunk-3I5UINHZ.js → chunk-647HGGGS.js} +12 -12
- package/dist/esm/{chunk-C52DTW7U.js → chunk-FTPSFGB4.js} +19 -19
- package/dist/esm/{chunk-YPIQPQRG.js → chunk-G65LOFTY.js} +2 -2
- package/dist/esm/{chunk-QDIWQJEJ.js → chunk-N3QR25YA.js} +10 -10
- package/dist/esm/{chunk-Y5Q47C4P.js → chunk-WWV5RWOP.js} +15 -15
- package/dist/esm/core.js +4 -4
- package/dist/esm/dynamic-remote-type-hints-plugin.js +4 -4
- package/dist/esm/fork-dev-worker.js +6 -6
- package/dist/esm/fork-generate-dts.js +4 -4
- package/dist/esm/index.js +30 -17
- package/dist/esm/start-broker.js +3 -3
- package/dist/fork-dev-worker.js +51 -51
- package/dist/fork-generate-dts.js +36 -36
- package/dist/iife/launch-web-client.js +10 -10
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +72 -59
- package/dist/package.json +4 -4
- package/dist/start-broker.js +20 -20
- package/package.json +9 -9
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getIPV4,
|
|
9
9
|
getIdentifier,
|
|
10
10
|
logger
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WWV5RWOP.js";
|
|
12
12
|
import {
|
|
13
13
|
AddPublisherAction,
|
|
14
14
|
AddSubscriberAction,
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
__require,
|
|
28
28
|
__spreadProps,
|
|
29
29
|
__spreadValues
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-647HGGGS.js";
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// src/core/lib/typeScriptCompiler.ts
|
|
33
33
|
import { ensureDirSync, writeFileSync, existsSync } from "fs-extra";
|
|
34
34
|
import crypto from "crypto";
|
|
35
35
|
import { stat, readdir, writeFile, rm, readFile } from "fs/promises";
|
|
@@ -163,10 +163,10 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
|
|
|
163
163
|
}
|
|
164
164
|
}), "compileTs");
|
|
165
165
|
|
|
166
|
-
//
|
|
166
|
+
// src/server/DevServer.ts
|
|
167
167
|
import WebSocket from "isomorphic-ws";
|
|
168
168
|
|
|
169
|
-
//
|
|
169
|
+
// src/server/broker/createBroker.ts
|
|
170
170
|
import { fork } from "child_process";
|
|
171
171
|
import path from "path";
|
|
172
172
|
function createBroker() {
|
|
@@ -182,7 +182,7 @@ function createBroker() {
|
|
|
182
182
|
}
|
|
183
183
|
__name(createBroker, "createBroker");
|
|
184
184
|
|
|
185
|
-
//
|
|
185
|
+
// src/server/DevServer.ts
|
|
186
186
|
var _ModuleFederationDevServer = class _ModuleFederationDevServer {
|
|
187
187
|
constructor(ctx) {
|
|
188
188
|
__publicField(this, "_remotes");
|
|
@@ -549,7 +549,7 @@ var _ModuleFederationDevServer = class _ModuleFederationDevServer {
|
|
|
549
549
|
__name(_ModuleFederationDevServer, "ModuleFederationDevServer");
|
|
550
550
|
var ModuleFederationDevServer = _ModuleFederationDevServer;
|
|
551
551
|
|
|
552
|
-
//
|
|
552
|
+
// src/server/createKoaServer.ts
|
|
553
553
|
import fs from "fs-extra";
|
|
554
554
|
import Koa from "koa";
|
|
555
555
|
function createKoaServer(options) {
|
|
@@ -575,12 +575,12 @@ function createKoaServer(options) {
|
|
|
575
575
|
}
|
|
576
576
|
__name(createKoaServer, "createKoaServer");
|
|
577
577
|
|
|
578
|
-
//
|
|
578
|
+
// src/core/lib/archiveHandler.ts
|
|
579
579
|
import AdmZip from "adm-zip";
|
|
580
580
|
import { resolve as resolve3, join as join3 } from "path";
|
|
581
581
|
import { rm as rm3 } from "fs/promises";
|
|
582
582
|
|
|
583
|
-
//
|
|
583
|
+
// src/core/lib/utils.ts
|
|
584
584
|
import fs3 from "fs";
|
|
585
585
|
import path3 from "path";
|
|
586
586
|
import axios from "axios";
|
|
@@ -589,7 +589,7 @@ import https from "https";
|
|
|
589
589
|
import { getProcessEnv } from "@module-federation/sdk";
|
|
590
590
|
import ansiColors from "ansi-colors";
|
|
591
591
|
|
|
592
|
-
//
|
|
592
|
+
// src/core/configurations/remotePlugin.ts
|
|
593
593
|
import { existsSync as existsSync2 } from "fs";
|
|
594
594
|
import { dirname as dirname2, join as join2, resolve as resolve2, extname as extname2 } from "path";
|
|
595
595
|
import { utils } from "@module-federation/managers";
|
|
@@ -713,7 +713,7 @@ var retrieveRemoteConfig = /* @__PURE__ */ __name((options) => {
|
|
|
713
713
|
};
|
|
714
714
|
}, "retrieveRemoteConfig");
|
|
715
715
|
|
|
716
|
-
//
|
|
716
|
+
// src/core/lib/DTSManager.ts
|
|
717
717
|
import path2 from "path";
|
|
718
718
|
import { rm as rm2 } from "fs/promises";
|
|
719
719
|
import fs2 from "fs";
|
|
@@ -721,7 +721,7 @@ import fse from "fs-extra";
|
|
|
721
721
|
import { MANIFEST_EXT, inferAutoPublicPath } from "@module-federation/sdk";
|
|
722
722
|
import { ThirdPartyExtractor as ThirdPartyExtractor2 } from "@module-federation/third-party-dts-extractor";
|
|
723
723
|
|
|
724
|
-
//
|
|
724
|
+
// src/core/configurations/hostPlugin.ts
|
|
725
725
|
import { parseEntry, ENCODE_NAME_PREFIX, decodeName } from "@module-federation/sdk";
|
|
726
726
|
import { utils as utils2 } from "@module-federation/managers";
|
|
727
727
|
var defaultOptions2 = {
|
|
@@ -831,12 +831,12 @@ var retrieveHostConfig = /* @__PURE__ */ __name((options) => {
|
|
|
831
831
|
};
|
|
832
832
|
}, "retrieveHostConfig");
|
|
833
833
|
|
|
834
|
-
//
|
|
834
|
+
// src/core/constant.ts
|
|
835
835
|
var REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
836
836
|
var REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
837
837
|
var HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
838
838
|
|
|
839
|
-
//
|
|
839
|
+
// src/core/lib/DTSManager.ts
|
|
840
840
|
var _a;
|
|
841
841
|
var DTSManager = (_a = class {
|
|
842
842
|
constructor(options) {
|
|
@@ -1247,7 +1247,7 @@ hostName: ${hostName}`, "updateTypes", "info");
|
|
|
1247
1247
|
}
|
|
1248
1248
|
}, __name(_a, "DTSManager"), _a);
|
|
1249
1249
|
|
|
1250
|
-
//
|
|
1250
|
+
// src/core/lib/utils.ts
|
|
1251
1251
|
import cloneDeepWith from "lodash.clonedeepwith";
|
|
1252
1252
|
function getDTSManagerConstructor(implementation) {
|
|
1253
1253
|
if (implementation) {
|
|
@@ -1376,7 +1376,7 @@ function axiosGet(url, config) {
|
|
|
1376
1376
|
}
|
|
1377
1377
|
__name(axiosGet, "axiosGet");
|
|
1378
1378
|
|
|
1379
|
-
//
|
|
1379
|
+
// src/core/lib/archiveHandler.ts
|
|
1380
1380
|
var retrieveTypesZipPath = /* @__PURE__ */ __name((mfTypesPath, remoteOptions) => join3(mfTypesPath.replace(remoteOptions.typesFolder, ""), `${remoteOptions.typesFolder}.zip`), "retrieveTypesZipPath");
|
|
1381
1381
|
var createTypesArchive = /* @__PURE__ */ __name((tsConfig, remoteOptions) => __async(void 0, null, function* () {
|
|
1382
1382
|
const mfTypesPath = retrieveMfTypesPath(tsConfig, remoteOptions);
|
|
@@ -1438,7 +1438,7 @@ var downloadTypesArchive = /* @__PURE__ */ __name((hostOptions) => {
|
|
|
1438
1438
|
});
|
|
1439
1439
|
}, "downloadTypesArchive");
|
|
1440
1440
|
|
|
1441
|
-
//
|
|
1441
|
+
// src/core/lib/generateTypes.ts
|
|
1442
1442
|
function generateTypes(options) {
|
|
1443
1443
|
return __async(this, null, function* () {
|
|
1444
1444
|
var _a2;
|
|
@@ -1449,7 +1449,7 @@ function generateTypes(options) {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
__name(generateTypes, "generateTypes");
|
|
1451
1451
|
|
|
1452
|
-
//
|
|
1452
|
+
// src/core/rpc/types.ts
|
|
1453
1453
|
var RpcGMCallTypes;
|
|
1454
1454
|
(function(RpcGMCallTypes2) {
|
|
1455
1455
|
RpcGMCallTypes2["CALL"] = "mf_call";
|
|
@@ -1458,7 +1458,7 @@ var RpcGMCallTypes;
|
|
|
1458
1458
|
RpcGMCallTypes2["EXIT"] = "mf_exit";
|
|
1459
1459
|
})(RpcGMCallTypes || (RpcGMCallTypes = {}));
|
|
1460
1460
|
|
|
1461
|
-
//
|
|
1461
|
+
// src/core/rpc/expose-rpc.ts
|
|
1462
1462
|
import process2 from "process";
|
|
1463
1463
|
function exposeRpc(fn) {
|
|
1464
1464
|
const sendMessage = /* @__PURE__ */ __name((message) => new Promise((resolve4, reject) => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
exposeRpc,
|
|
5
5
|
getDTSManagerConstructor,
|
|
6
6
|
isDebugMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FTPSFGB4.js";
|
|
8
8
|
import {
|
|
9
9
|
__async,
|
|
10
10
|
__export,
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
__publicField,
|
|
13
13
|
__spreadProps,
|
|
14
14
|
__spreadValues
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-647HGGGS.js";
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// src/core/lib/DtsWorker.ts
|
|
18
18
|
import path from "path";
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// src/core/rpc/index.ts
|
|
21
21
|
var rpc_exports = {};
|
|
22
22
|
__export(rpc_exports, {
|
|
23
23
|
RpcExitError: () => RpcExitError,
|
|
@@ -28,7 +28,7 @@ __export(rpc_exports, {
|
|
|
28
28
|
wrapRpc: () => wrapRpc
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// src/core/rpc/rpc-error.ts
|
|
32
32
|
var _a;
|
|
33
33
|
var RpcExitError = (_a = class extends Error {
|
|
34
34
|
constructor(message, code, signal) {
|
|
@@ -40,7 +40,7 @@ var RpcExitError = (_a = class extends Error {
|
|
|
40
40
|
}
|
|
41
41
|
}, __name(_a, "RpcExitError"), _a);
|
|
42
42
|
|
|
43
|
-
//
|
|
43
|
+
// src/core/rpc/wrap-rpc.ts
|
|
44
44
|
function createControlledPromise() {
|
|
45
45
|
let resolve = /* @__PURE__ */ __name(() => void 0, "resolve");
|
|
46
46
|
let reject = /* @__PURE__ */ __name(() => void 0, "reject");
|
|
@@ -108,7 +108,7 @@ function wrapRpc(childProcess, options) {
|
|
|
108
108
|
}
|
|
109
109
|
__name(wrapRpc, "wrapRpc");
|
|
110
110
|
|
|
111
|
-
//
|
|
111
|
+
// src/core/rpc/rpc-worker.ts
|
|
112
112
|
import * as child_process from "child_process";
|
|
113
113
|
import * as process2 from "process";
|
|
114
114
|
import { randomUUID } from "crypto";
|
|
@@ -195,7 +195,7 @@ function getRpcWorkerData() {
|
|
|
195
195
|
}
|
|
196
196
|
__name(getRpcWorkerData, "getRpcWorkerData");
|
|
197
197
|
|
|
198
|
-
//
|
|
198
|
+
// src/core/lib/DtsWorker.ts
|
|
199
199
|
var _DtsWorker = class _DtsWorker {
|
|
200
200
|
constructor(options) {
|
|
201
201
|
__publicField(this, "rpcWorker");
|
|
@@ -254,7 +254,7 @@ var _DtsWorker = class _DtsWorker {
|
|
|
254
254
|
__name(_DtsWorker, "DtsWorker");
|
|
255
255
|
var DtsWorker = _DtsWorker;
|
|
256
256
|
|
|
257
|
-
//
|
|
257
|
+
// src/core/lib/generateTypesInChildProcess.ts
|
|
258
258
|
function generateTypesInChildProcess(options) {
|
|
259
259
|
return __async(this, null, function* () {
|
|
260
260
|
const dtsWorker = new DtsWorker(options);
|
|
@@ -263,7 +263,7 @@ function generateTypesInChildProcess(options) {
|
|
|
263
263
|
}
|
|
264
264
|
__name(generateTypesInChildProcess, "generateTypesInChildProcess");
|
|
265
265
|
|
|
266
|
-
//
|
|
266
|
+
// src/core/lib/consumeTypes.ts
|
|
267
267
|
function consumeTypes(options) {
|
|
268
268
|
return __async(this, null, function* () {
|
|
269
269
|
var _a2;
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
__async,
|
|
10
10
|
__name,
|
|
11
11
|
__publicField
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-647HGGGS.js";
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// src/server/utils/log.ts
|
|
15
15
|
import { createLogger } from "@module-federation/sdk";
|
|
16
16
|
import * as log4js from "log4js";
|
|
17
17
|
var logger = createLogger(`[ ${MF_SERVER_IDENTIFIER} ]`);
|
|
@@ -58,7 +58,7 @@ function error(error2, action, from) {
|
|
|
58
58
|
}
|
|
59
59
|
__name(error, "error");
|
|
60
60
|
|
|
61
|
-
//
|
|
61
|
+
// src/server/utils/getIPV4.ts
|
|
62
62
|
import os from "os";
|
|
63
63
|
var localIpv4 = "127.0.0.1";
|
|
64
64
|
var getIpv4Interfaces = /* @__PURE__ */ __name(() => {
|
|
@@ -86,14 +86,14 @@ var getIPV4 = /* @__PURE__ */ __name(() => {
|
|
|
86
86
|
return ipv4Interface.address;
|
|
87
87
|
}, "getIPV4");
|
|
88
88
|
|
|
89
|
-
//
|
|
89
|
+
// src/server/utils/index.ts
|
|
90
90
|
import net from "net";
|
|
91
91
|
import { SEPARATOR } from "@module-federation/sdk";
|
|
92
92
|
|
|
93
|
-
//
|
|
93
|
+
// src/server/utils/logTransform.ts
|
|
94
94
|
import chalk from "chalk";
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// src/server/message/Log/Log.ts
|
|
97
97
|
var LogLevel;
|
|
98
98
|
(function(LogLevel2) {
|
|
99
99
|
LogLevel2["LOG"] = "LOG";
|
|
@@ -117,7 +117,7 @@ var _Log = class _Log extends Message {
|
|
|
117
117
|
__name(_Log, "Log");
|
|
118
118
|
var Log = _Log;
|
|
119
119
|
|
|
120
|
-
//
|
|
120
|
+
// src/server/message/Log/BrokerExitLog.ts
|
|
121
121
|
var _BrokerExitLog = class _BrokerExitLog extends Log {
|
|
122
122
|
constructor() {
|
|
123
123
|
super(LogLevel.LOG, LogKind.BrokerExitLog);
|
|
@@ -126,7 +126,7 @@ var _BrokerExitLog = class _BrokerExitLog extends Log {
|
|
|
126
126
|
__name(_BrokerExitLog, "BrokerExitLog");
|
|
127
127
|
var BrokerExitLog = _BrokerExitLog;
|
|
128
128
|
|
|
129
|
-
//
|
|
129
|
+
// src/server/utils/index.ts
|
|
130
130
|
function getIdentifier(options) {
|
|
131
131
|
const { ip, name } = options;
|
|
132
132
|
return `mf ${SEPARATOR}${name}${ip ? `${SEPARATOR}${ip}` : ""}`;
|
|
@@ -161,13 +161,13 @@ function getFreePort() {
|
|
|
161
161
|
}
|
|
162
162
|
__name(getFreePort, "getFreePort");
|
|
163
163
|
|
|
164
|
-
//
|
|
164
|
+
// src/server/broker/Broker.ts
|
|
165
165
|
import { createServer } from "http";
|
|
166
166
|
import WebSocket from "isomorphic-ws";
|
|
167
167
|
import schedule from "node-schedule";
|
|
168
168
|
import { parse } from "url";
|
|
169
169
|
|
|
170
|
-
//
|
|
170
|
+
// src/server/message/API/API.ts
|
|
171
171
|
var APIKind;
|
|
172
172
|
(function(APIKind2) {
|
|
173
173
|
APIKind2["UPDATE_SUBSCRIBER"] = "UPDATE_SUBSCRIBER";
|
|
@@ -187,7 +187,7 @@ var _API = class _API extends Message {
|
|
|
187
187
|
__name(_API, "API");
|
|
188
188
|
var API = _API;
|
|
189
189
|
|
|
190
|
-
//
|
|
190
|
+
// src/server/message/API/UpdateSubscriber.ts
|
|
191
191
|
var _UpdateSubscriberAPI = class _UpdateSubscriberAPI extends API {
|
|
192
192
|
constructor(payload) {
|
|
193
193
|
super({
|
|
@@ -199,7 +199,7 @@ var _UpdateSubscriberAPI = class _UpdateSubscriberAPI extends API {
|
|
|
199
199
|
__name(_UpdateSubscriberAPI, "UpdateSubscriberAPI");
|
|
200
200
|
var UpdateSubscriberAPI = _UpdateSubscriberAPI;
|
|
201
201
|
|
|
202
|
-
//
|
|
202
|
+
// src/server/message/API/ReloadWebClient.ts
|
|
203
203
|
var _ReloadWebClientAPI = class _ReloadWebClientAPI extends API {
|
|
204
204
|
constructor(payload) {
|
|
205
205
|
super({
|
|
@@ -211,7 +211,7 @@ var _ReloadWebClientAPI = class _ReloadWebClientAPI extends API {
|
|
|
211
211
|
__name(_ReloadWebClientAPI, "ReloadWebClientAPI");
|
|
212
212
|
var ReloadWebClientAPI = _ReloadWebClientAPI;
|
|
213
213
|
|
|
214
|
-
//
|
|
214
|
+
// src/server/message/API/FetchTypes.ts
|
|
215
215
|
var _FetchTypesAPI = class _FetchTypesAPI extends API {
|
|
216
216
|
constructor(payload) {
|
|
217
217
|
super({
|
|
@@ -223,7 +223,7 @@ var _FetchTypesAPI = class _FetchTypesAPI extends API {
|
|
|
223
223
|
__name(_FetchTypesAPI, "FetchTypesAPI");
|
|
224
224
|
var FetchTypesAPI = _FetchTypesAPI;
|
|
225
225
|
|
|
226
|
-
//
|
|
226
|
+
// src/server/Publisher.ts
|
|
227
227
|
var _Publisher = class _Publisher {
|
|
228
228
|
constructor(ctx) {
|
|
229
229
|
__publicField(this, "_ip");
|
|
@@ -313,7 +313,7 @@ var _Publisher = class _Publisher {
|
|
|
313
313
|
__name(_Publisher, "Publisher");
|
|
314
314
|
var Publisher = _Publisher;
|
|
315
315
|
|
|
316
|
-
//
|
|
316
|
+
// src/server/broker/Broker.ts
|
|
317
317
|
var _Broker = class _Broker {
|
|
318
318
|
constructor() {
|
|
319
319
|
__publicField(this, "_publisherMap", /* @__PURE__ */ new Map());
|
package/dist/esm/core.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
consumeTypes,
|
|
4
4
|
generateTypesInChildProcess,
|
|
5
5
|
rpc_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N3QR25YA.js";
|
|
7
7
|
import {
|
|
8
8
|
DTSManager,
|
|
9
9
|
HOST_API_TYPES_FILE_NAME,
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
retrieveTypesAssetsInfo,
|
|
20
20
|
retrieveTypesZipPath,
|
|
21
21
|
validateOptions
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-FTPSFGB4.js";
|
|
23
|
+
import "./chunk-WWV5RWOP.js";
|
|
24
|
+
import "./chunk-647HGGGS.js";
|
|
25
25
|
export {
|
|
26
26
|
DTSManager,
|
|
27
27
|
DtsWorker,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIpFromEntry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G65LOFTY.js";
|
|
4
4
|
import {
|
|
5
5
|
AddDynamicRemoteAction,
|
|
6
6
|
DEFAULT_WEB_SOCKET_PORT,
|
|
7
7
|
FetchTypesAction,
|
|
8
8
|
WEB_SOCKET_CONNECT_MAGIC_ID,
|
|
9
9
|
__name
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-647HGGGS.js";
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// src/server/createWebsocket.ts
|
|
13
13
|
import WebSocket from "isomorphic-ws";
|
|
14
14
|
function createWebsocket() {
|
|
15
15
|
return new WebSocket(`ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}?WEB_SOCKET_CONNECT_MAGIC_ID=${WEB_SOCKET_CONNECT_MAGIC_ID}`);
|
|
16
16
|
}
|
|
17
17
|
__name(createWebsocket, "createWebsocket");
|
|
18
18
|
|
|
19
|
-
//
|
|
19
|
+
// src/runtime-plugins/dynamic-remote-type-hints-plugin.ts
|
|
20
20
|
var PLUGIN_NAME = "dynamic-remote-type-hints-plugin";
|
|
21
21
|
function dynamicRemoteTypeHintsPlugin() {
|
|
22
22
|
let ws = createWebsocket();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rpc_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N3QR25YA.js";
|
|
4
4
|
import {
|
|
5
5
|
ModuleFederationDevServer,
|
|
6
6
|
createKoaServer,
|
|
@@ -9,23 +9,23 @@ import {
|
|
|
9
9
|
retrieveMfTypesPath,
|
|
10
10
|
retrieveRemoteConfig,
|
|
11
11
|
retrieveTypesZipPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FTPSFGB4.js";
|
|
13
13
|
import {
|
|
14
14
|
fileLog,
|
|
15
15
|
getIPV4
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WWV5RWOP.js";
|
|
17
17
|
import {
|
|
18
18
|
getIpFromEntry
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-G65LOFTY.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_TAR_NAME,
|
|
22
22
|
UpdateKind,
|
|
23
23
|
UpdateMode,
|
|
24
24
|
__async,
|
|
25
25
|
__name
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-647HGGGS.js";
|
|
27
27
|
|
|
28
|
-
//
|
|
28
|
+
// src/dev-worker/forkDevWorker.ts
|
|
29
29
|
import { decodeName } from "@module-federation/sdk";
|
|
30
30
|
var typesManager;
|
|
31
31
|
var serverAddress;
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
RpcGMCallTypes,
|
|
3
3
|
exposeRpc,
|
|
4
4
|
generateTypes
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-FTPSFGB4.js";
|
|
6
|
+
import "./chunk-WWV5RWOP.js";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__name
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-647HGGGS.js";
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// src/core/lib/forkGenerateDts.ts
|
|
13
13
|
function forkGenerateDts(options) {
|
|
14
14
|
return __async(this, null, function* () {
|
|
15
15
|
return generateTypes(options);
|
package/dist/esm/index.js
CHANGED
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
consumeTypes,
|
|
3
3
|
generateTypesInChildProcess,
|
|
4
4
|
rpc_exports
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-N3QR25YA.js";
|
|
6
6
|
import {
|
|
7
7
|
cloneDeepOptions,
|
|
8
8
|
generateTypes,
|
|
9
9
|
isTSProject,
|
|
10
10
|
retrieveTypesAssetsInfo,
|
|
11
11
|
validateOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FTPSFGB4.js";
|
|
13
13
|
import {
|
|
14
14
|
getIPV4,
|
|
15
15
|
logger
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WWV5RWOP.js";
|
|
17
17
|
import {
|
|
18
18
|
WEB_CLIENT_OPTIONS_IDENTIFIER,
|
|
19
19
|
__async,
|
|
@@ -21,17 +21,17 @@ import {
|
|
|
21
21
|
__publicField,
|
|
22
22
|
__spreadProps,
|
|
23
23
|
__spreadValues
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-647HGGGS.js";
|
|
25
25
|
|
|
26
|
-
//
|
|
26
|
+
// src/plugins/DevPlugin.ts
|
|
27
27
|
import fs from "fs-extra";
|
|
28
28
|
import path4 from "path";
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// src/dev-worker/createDevWorker.ts
|
|
31
31
|
import * as path2 from "path";
|
|
32
32
|
import * as fse from "fs-extra";
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// src/dev-worker/DevWorker.ts
|
|
35
35
|
import path from "path";
|
|
36
36
|
var _DevWorker = class _DevWorker {
|
|
37
37
|
constructor(options) {
|
|
@@ -71,7 +71,7 @@ var _DevWorker = class _DevWorker {
|
|
|
71
71
|
__name(_DevWorker, "DevWorker");
|
|
72
72
|
var DevWorker = _DevWorker;
|
|
73
73
|
|
|
74
|
-
//
|
|
74
|
+
// src/dev-worker/createDevWorker.ts
|
|
75
75
|
function removeLogFile() {
|
|
76
76
|
return __async(this, null, function* () {
|
|
77
77
|
try {
|
|
@@ -89,10 +89,10 @@ function createDevWorker(options) {
|
|
|
89
89
|
}
|
|
90
90
|
__name(createDevWorker, "createDevWorker");
|
|
91
91
|
|
|
92
|
-
//
|
|
92
|
+
// src/plugins/DevPlugin.ts
|
|
93
93
|
import { normalizeOptions, TEMP_DIR as BasicTempDir } from "@module-federation/sdk";
|
|
94
94
|
|
|
95
|
-
//
|
|
95
|
+
// src/plugins/utils.ts
|
|
96
96
|
import path3 from "path";
|
|
97
97
|
function isDev() {
|
|
98
98
|
return process.env["NODE_ENV"] === "development";
|
|
@@ -111,7 +111,7 @@ function getCompilerOutputDir(compiler) {
|
|
|
111
111
|
}
|
|
112
112
|
__name(getCompilerOutputDir, "getCompilerOutputDir");
|
|
113
113
|
|
|
114
|
-
//
|
|
114
|
+
// src/plugins/DevPlugin.ts
|
|
115
115
|
var PROCESS_EXIT_CODE;
|
|
116
116
|
(function(PROCESS_EXIT_CODE2) {
|
|
117
117
|
PROCESS_EXIT_CODE2[PROCESS_EXIT_CODE2["SUCCESS"] = 0] = "SUCCESS";
|
|
@@ -277,10 +277,10 @@ var _DevPlugin = class _DevPlugin {
|
|
|
277
277
|
__name(_DevPlugin, "DevPlugin");
|
|
278
278
|
var DevPlugin = _DevPlugin;
|
|
279
279
|
|
|
280
|
-
//
|
|
280
|
+
// src/plugins/DtsPlugin.ts
|
|
281
281
|
import { normalizeOptions as normalizeOptions4 } from "@module-federation/sdk";
|
|
282
282
|
|
|
283
|
-
//
|
|
283
|
+
// src/plugins/ConsumeTypesPlugin.ts
|
|
284
284
|
import { logger as logger2 } from "@module-federation/sdk";
|
|
285
285
|
import { normalizeOptions as normalizeOptions2 } from "@module-federation/sdk";
|
|
286
286
|
var DEFAULT_CONSUME_TYPES = {
|
|
@@ -362,7 +362,7 @@ var _ConsumeTypesPlugin = class _ConsumeTypesPlugin {
|
|
|
362
362
|
__name(_ConsumeTypesPlugin, "ConsumeTypesPlugin");
|
|
363
363
|
var ConsumeTypesPlugin = _ConsumeTypesPlugin;
|
|
364
364
|
|
|
365
|
-
//
|
|
365
|
+
// src/plugins/GenerateTypesPlugin.ts
|
|
366
366
|
import fs2 from "fs";
|
|
367
367
|
import path5 from "path";
|
|
368
368
|
import { logger as logger3, normalizeOptions as normalizeOptions3 } from "@module-federation/sdk";
|
|
@@ -563,7 +563,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
563
563
|
__name(_GenerateTypesPlugin, "GenerateTypesPlugin");
|
|
564
564
|
var GenerateTypesPlugin = _GenerateTypesPlugin;
|
|
565
565
|
|
|
566
|
-
//
|
|
566
|
+
// src/plugins/DtsPlugin.ts
|
|
567
567
|
var normalizeDtsOptions = /* @__PURE__ */ __name((options, context, defaultOptions) => {
|
|
568
568
|
return normalizeOptions4(isTSProject(options.dts, context), {
|
|
569
569
|
generateTypes: (defaultOptions == null ? void 0 : defaultOptions.defaultGenerateOptions) || DEFAULT_GENERATE_TYPES,
|
|
@@ -575,11 +575,12 @@ var normalizeDtsOptions = /* @__PURE__ */ __name((options, context, defaultOptio
|
|
|
575
575
|
var _DtsPlugin = class _DtsPlugin {
|
|
576
576
|
constructor(options) {
|
|
577
577
|
__publicField(this, "options");
|
|
578
|
+
__publicField(this, "clonedOptions");
|
|
578
579
|
this.options = options;
|
|
580
|
+
this.clonedOptions = __spreadValues({}, options);
|
|
579
581
|
}
|
|
580
582
|
apply(compiler) {
|
|
581
|
-
const { options } = this;
|
|
582
|
-
const clonedOptions = __spreadValues({}, options);
|
|
583
|
+
const { options, clonedOptions } = this;
|
|
583
584
|
if (options.exposes && typeof options.exposes === "object") {
|
|
584
585
|
const cleanedExposes = {};
|
|
585
586
|
Object.entries(options.exposes).forEach(([key, value]) => {
|
|
@@ -607,6 +608,18 @@ var _DtsPlugin = class _DtsPlugin {
|
|
|
607
608
|
new GenerateTypesPlugin(clonedOptions, normalizedDtsOptions, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
|
|
608
609
|
new ConsumeTypesPlugin(clonedOptions, normalizedDtsOptions, fetchRemoteTypeUrlsResolve).apply(compiler);
|
|
609
610
|
}
|
|
611
|
+
addRuntimePlugins() {
|
|
612
|
+
const { options, clonedOptions } = this;
|
|
613
|
+
if (!clonedOptions.runtimePlugins) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
if (!options.runtimePlugins) {
|
|
617
|
+
options.runtimePlugins = [];
|
|
618
|
+
}
|
|
619
|
+
clonedOptions.runtimePlugins.forEach((plugin) => {
|
|
620
|
+
options.runtimePlugins.includes(plugin) || options.runtimePlugins.push(plugin);
|
|
621
|
+
});
|
|
622
|
+
}
|
|
610
623
|
};
|
|
611
624
|
__name(_DtsPlugin, "DtsPlugin");
|
|
612
625
|
var DtsPlugin = _DtsPlugin;
|
package/dist/esm/start-broker.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Broker,
|
|
3
3
|
fileLog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WWV5RWOP.js";
|
|
5
5
|
import {
|
|
6
6
|
__async,
|
|
7
7
|
__name
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-647HGGGS.js";
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// src/server/broker/startBroker.ts
|
|
11
11
|
var broker;
|
|
12
12
|
function getBroker() {
|
|
13
13
|
return broker;
|