@module-federation/dts-plugin 2.2.3 → 2.3.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-DRlzScTT.js → Broker-eLXU1Wnf.js} +11 -28
- package/dist/CHANGELOG.md +45 -0
- package/dist/{consumeTypes-DHKw9PGQ.js → consumeTypes-K9bTh9DW.js} +1 -1
- package/dist/core.js +3 -3
- package/dist/esm/{Broker-BU4gToNr.mjs → Broker-CAfV_Mk2.mjs} +9 -27
- package/dist/esm/{consumeTypes-CirXBJjN.mjs → consumeTypes-mqBQo-ww.mjs} +1 -1
- package/dist/esm/core.mjs +3 -3
- package/dist/esm/{expose-rpc-CyOKS7gM.mjs → expose-rpc-DJAoDLdo.mjs} +24 -10
- package/dist/esm/fork-dev-worker.mjs +3 -3
- package/dist/esm/fork-generate-dts.mjs +2 -2
- package/dist/esm/index.mjs +22 -4
- package/dist/esm/start-broker.mjs +1 -1
- package/dist/{expose-rpc-BAS_80E1.js → expose-rpc-C93yOgOB.js} +24 -11
- package/dist/fork-dev-worker.js +3 -3
- package/dist/fork-generate-dts.js +2 -2
- package/dist/index.js +22 -4
- package/dist/package.json +2 -6
- package/dist/start-broker.js +1 -1
- package/package.json +7 -11
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
const require_Action = require('./Action-CzhPMw2i.js');
|
|
2
|
+
let path = require("path");
|
|
3
|
+
path = require_Action.__toESM(path);
|
|
4
|
+
let fs = require("fs");
|
|
5
|
+
fs = require_Action.__toESM(fs);
|
|
2
6
|
let http = require("http");
|
|
3
7
|
let _module_federation_sdk = require("@module-federation/sdk");
|
|
4
8
|
let net = require("net");
|
|
5
9
|
net = require_Action.__toESM(net);
|
|
6
|
-
require("chalk");
|
|
7
|
-
let log4js = require("log4js");
|
|
8
|
-
log4js = require_Action.__toESM(log4js);
|
|
9
10
|
let os = require("os");
|
|
10
11
|
os = require_Action.__toESM(os);
|
|
11
12
|
let isomorphic_ws = require("isomorphic-ws");
|
|
@@ -98,31 +99,13 @@ var BrokerExitLog = class extends Log {
|
|
|
98
99
|
const logger = (0, _module_federation_sdk.createLogger)(`[ ${require_Action.MF_SERVER_IDENTIFIER} ]`);
|
|
99
100
|
function fileLog(msg, module, level) {
|
|
100
101
|
if (!process?.env?.["FEDERATION_DEBUG"]) return;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
type: "file",
|
|
109
|
-
filename: ".mf/typesGenerate.log"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
categories: {
|
|
113
|
-
[module]: {
|
|
114
|
-
appenders: [module],
|
|
115
|
-
level: "error"
|
|
116
|
-
},
|
|
117
|
-
default: {
|
|
118
|
-
appenders: ["default"],
|
|
119
|
-
level: "trace"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
const logger4 = log4js.getLogger(module);
|
|
124
|
-
logger4.level = "debug";
|
|
125
|
-
logger4[level]?.(msg);
|
|
102
|
+
try {
|
|
103
|
+
const logDir = ".mf";
|
|
104
|
+
const logFile = path.join(logDir, "typesGenerate.log");
|
|
105
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
106
|
+
if (!fs.existsSync(logDir)) fs.mkdirSync(logDir, { recursive: true });
|
|
107
|
+
fs.appendFileSync(logFile, `[${timestamp}] [${level.toUpperCase()}] ${module} - ${msg}\n`);
|
|
108
|
+
} catch {}
|
|
126
109
|
}
|
|
127
110
|
function error(error, action, from) {
|
|
128
111
|
const err = error instanceof Error ? error : /* @__PURE__ */ new Error(`${action} error`);
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @module-federation/dts-plugin
|
|
2
2
|
|
|
3
|
+
## 2.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @module-federation/sdk@2.3.1
|
|
8
|
+
- @module-federation/managers@2.3.1
|
|
9
|
+
- @module-federation/third-party-dts-extractor@2.3.1
|
|
10
|
+
- @module-federation/error-codes@2.3.1
|
|
11
|
+
|
|
12
|
+
## 2.3.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- eb26065: feat(dts-plugin): add `dts.generateTypes.afterGenerate` callback
|
|
17
|
+
|
|
18
|
+
Allows users to hook into the type generation lifecycle from
|
|
19
|
+
`dts.generateTypes`. The callback runs after each successful type generation in
|
|
20
|
+
both dev and prod modes, making it possible to do follow-up work with the
|
|
21
|
+
generated files.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
new ModuleFederationPlugin({
|
|
25
|
+
dts: {
|
|
26
|
+
generateTypes: {
|
|
27
|
+
afterGenerate: async ({ zipTypesPath, apiTypesPath }) => {
|
|
28
|
+
await analyzeTypesAndGenerateJson({
|
|
29
|
+
zipTypesPath,
|
|
30
|
+
apiTypesPath,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [eb26065]
|
|
41
|
+
- Updated dependencies [f1d79b2]
|
|
42
|
+
- Updated dependencies [8f2ec9b]
|
|
43
|
+
- @module-federation/sdk@2.3.0
|
|
44
|
+
- @module-federation/error-codes@2.3.0
|
|
45
|
+
- @module-federation/managers@2.3.0
|
|
46
|
+
- @module-federation/third-party-dts-extractor@2.3.0
|
|
47
|
+
|
|
3
48
|
## 2.2.3
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
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-C93yOgOB.js');
|
|
3
3
|
let path = require("path");
|
|
4
4
|
path = require_Action.__toESM(path);
|
|
5
5
|
let crypto = require("crypto");
|
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-eLXU1Wnf.js');
|
|
3
|
+
const require_expose_rpc = require('./expose-rpc-C93yOgOB.js');
|
|
4
|
+
const require_consumeTypes = require('./consumeTypes-K9bTh9DW.js');
|
|
5
5
|
|
|
6
6
|
exports.DTSManager = require_expose_rpc.DTSManager;
|
|
7
7
|
exports.DtsWorker = require_consumeTypes.DtsWorker;
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
+
import * as path$1 from "path";
|
|
3
|
+
import * as fs$1 from "fs";
|
|
2
4
|
import { createServer } from "http";
|
|
3
5
|
import { SEPARATOR, createLogger } from "@module-federation/sdk";
|
|
4
6
|
import net from "net";
|
|
5
|
-
import "chalk";
|
|
6
|
-
import * as log4js from "log4js";
|
|
7
7
|
import os from "os";
|
|
8
8
|
import WebSocket from "isomorphic-ws";
|
|
9
9
|
import schedule from "node-schedule";
|
|
@@ -93,31 +93,13 @@ var BrokerExitLog = class extends Log {
|
|
|
93
93
|
const logger$1 = createLogger(`[ ${MF_SERVER_IDENTIFIER} ]`);
|
|
94
94
|
function fileLog(msg, module, level) {
|
|
95
95
|
if (!process?.env?.["FEDERATION_DEBUG"]) return;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
type: "file",
|
|
104
|
-
filename: ".mf/typesGenerate.log"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
categories: {
|
|
108
|
-
[module]: {
|
|
109
|
-
appenders: [module],
|
|
110
|
-
level: "error"
|
|
111
|
-
},
|
|
112
|
-
default: {
|
|
113
|
-
appenders: ["default"],
|
|
114
|
-
level: "trace"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
const logger4 = log4js.getLogger(module);
|
|
119
|
-
logger4.level = "debug";
|
|
120
|
-
logger4[level]?.(msg);
|
|
96
|
+
try {
|
|
97
|
+
const logDir = ".mf";
|
|
98
|
+
const logFile = path$1.join(logDir, "typesGenerate.log");
|
|
99
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
100
|
+
if (!fs$1.existsSync(logDir)) fs$1.mkdirSync(logDir, { recursive: true });
|
|
101
|
+
fs$1.appendFileSync(logFile, `[${timestamp}] [${level.toUpperCase()}] ${module} - ${msg}\n`);
|
|
102
|
+
} catch {}
|
|
121
103
|
}
|
|
122
104
|
function error(error, action, from) {
|
|
123
105
|
const err = error instanceof Error ? error : /* @__PURE__ */ new Error(`${action} error`);
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DJAoDLdo.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { randomUUID } from "crypto";
|
|
4
4
|
import * as child_process from "child_process";
|
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-DJAoDLdo.mjs";
|
|
2
|
+
import "./Broker-CAfV_Mk2.mjs";
|
|
3
|
+
import { i as rpc_exports, n as generateTypesInChildProcess, r as DtsWorker, t as consumeTypes } from "./consumeTypes-mqBQo-ww.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,5 +1,5 @@
|
|
|
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-CAfV_Mk2.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import fse from "fs-extra";
|
|
5
5
|
import path, { dirname, extname, isAbsolute, join, normalize, relative, resolve, sep } from "path";
|
|
@@ -20,7 +20,6 @@ import { logAndReport } from "@module-federation/error-codes/node";
|
|
|
20
20
|
import { execFile, fork } from "child_process";
|
|
21
21
|
import util from "util";
|
|
22
22
|
import WebSocket from "isomorphic-ws";
|
|
23
|
-
import cloneDeepWith from "lodash.clonedeepwith";
|
|
24
23
|
import process$1 from "process";
|
|
25
24
|
|
|
26
25
|
//#region \0rolldown/runtime.js
|
|
@@ -1108,14 +1107,29 @@ const isTSProject = (dtsOptions, context = process.cwd()) => {
|
|
|
1108
1107
|
}
|
|
1109
1108
|
};
|
|
1110
1109
|
function cloneDeepOptions(options) {
|
|
1111
|
-
const excludeKeys = ["manifest", "async"];
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
if (typeof
|
|
1115
|
-
if (key === "extractThirdParty" && Array.isArray(
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1110
|
+
const excludeKeys = new Set(["manifest", "async"]);
|
|
1111
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
1112
|
+
function sanitize(val, key) {
|
|
1113
|
+
if (key !== void 0 && excludeKeys.has(key) || typeof val === "function") return false;
|
|
1114
|
+
if (key === "extractThirdParty" && Array.isArray(val)) return val.map(String);
|
|
1115
|
+
if (Array.isArray(val)) {
|
|
1116
|
+
if (cache.has(val)) return cache.get(val);
|
|
1117
|
+
const out = [];
|
|
1118
|
+
cache.set(val, out);
|
|
1119
|
+
val.forEach((v, i) => out.push(sanitize(v, String(i))));
|
|
1120
|
+
return out;
|
|
1121
|
+
}
|
|
1122
|
+
if (val !== null && typeof val === "object" && Object.getPrototypeOf(val) === Object.prototype) {
|
|
1123
|
+
const obj = val;
|
|
1124
|
+
if (cache.has(obj)) return cache.get(obj);
|
|
1125
|
+
const out = {};
|
|
1126
|
+
cache.set(obj, out);
|
|
1127
|
+
for (const [k, v] of Object.entries(obj)) out[k] = sanitize(v, k);
|
|
1128
|
+
return out;
|
|
1129
|
+
}
|
|
1130
|
+
return val;
|
|
1131
|
+
}
|
|
1132
|
+
return structuredClone(sanitize(options));
|
|
1119
1133
|
}
|
|
1120
1134
|
const getEnvHeaders = () => {
|
|
1121
1135
|
const headersStr = getProcessEnv()["MF_ENV_HEADERS"] || "{}";
|
|
@@ -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-DJAoDLdo.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-CAfV_Mk2.mjs";
|
|
4
|
+
import "./consumeTypes-mqBQo-ww.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-DJAoDLdo.mjs";
|
|
2
|
+
import "./Broker-CAfV_Mk2.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/core/lib/forkGenerateDts.ts
|
|
5
5
|
async function forkGenerateDts(options) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-DJAoDLdo.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-CAfV_Mk2.mjs";
|
|
4
|
+
import { a as createRpcWorker, n as generateTypesInChildProcess, t as consumeTypes } from "./consumeTypes-mqBQo-ww.mjs";
|
|
5
5
|
import "./core.mjs";
|
|
6
6
|
import * as fse$1 from "fs-extra";
|
|
7
7
|
import fse from "fs-extra";
|
|
@@ -312,7 +312,25 @@ const getGenerateTypesFn = (dtsManagerOptions) => {
|
|
|
312
312
|
return fn;
|
|
313
313
|
};
|
|
314
314
|
const generateTypesAPI = ({ dtsManagerOptions }) => {
|
|
315
|
-
return getGenerateTypesFn(dtsManagerOptions)(dtsManagerOptions)
|
|
315
|
+
return getGenerateTypesFn(dtsManagerOptions)(dtsManagerOptions).then(async () => {
|
|
316
|
+
await callAfterGenerateHook({
|
|
317
|
+
dtsManagerOptions,
|
|
318
|
+
generatedTypes: retrieveTypesAssetsInfo(dtsManagerOptions.remote)
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
const callAfterGenerateHook = async ({ dtsManagerOptions, generatedTypes }) => {
|
|
323
|
+
const afterGenerate = dtsManagerOptions.remote.afterGenerate;
|
|
324
|
+
if (!afterGenerate) return;
|
|
325
|
+
try {
|
|
326
|
+
await afterGenerate(generatedTypes);
|
|
327
|
+
} catch (error) {
|
|
328
|
+
if (dtsManagerOptions.remote.abortOnError === false) {
|
|
329
|
+
if (dtsManagerOptions.displayErrorInTerminal) logger.error(error);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
throw error;
|
|
333
|
+
}
|
|
316
334
|
};
|
|
317
335
|
const WINDOWS_ABSOLUTE_PATH_REGEXP = /^[a-zA-Z]:[\\/]/;
|
|
318
336
|
const isSafeRelativePath = (relativePath) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_Action = require('./Action-CzhPMw2i.js');
|
|
2
|
-
const require_Broker = require('./Broker-
|
|
2
|
+
const require_Broker = require('./Broker-eLXU1Wnf.js');
|
|
3
3
|
let fs_extra = require("fs-extra");
|
|
4
4
|
fs_extra = require_Action.__toESM(fs_extra);
|
|
5
5
|
let path = require("path");
|
|
@@ -31,8 +31,6 @@ let util = require("util");
|
|
|
31
31
|
util = require_Action.__toESM(util);
|
|
32
32
|
let isomorphic_ws = require("isomorphic-ws");
|
|
33
33
|
isomorphic_ws = require_Action.__toESM(isomorphic_ws);
|
|
34
|
-
let lodash_clonedeepwith = require("lodash.clonedeepwith");
|
|
35
|
-
lodash_clonedeepwith = require_Action.__toESM(lodash_clonedeepwith);
|
|
36
34
|
let process$1 = require("process");
|
|
37
35
|
process$1 = require_Action.__toESM(process$1);
|
|
38
36
|
|
|
@@ -1103,14 +1101,29 @@ const isTSProject = (dtsOptions, context = process.cwd()) => {
|
|
|
1103
1101
|
}
|
|
1104
1102
|
};
|
|
1105
1103
|
function cloneDeepOptions(options) {
|
|
1106
|
-
const excludeKeys = ["manifest", "async"];
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
if (typeof
|
|
1110
|
-
if (key === "extractThirdParty" && Array.isArray(
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1104
|
+
const excludeKeys = new Set(["manifest", "async"]);
|
|
1105
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
1106
|
+
function sanitize(val, key) {
|
|
1107
|
+
if (key !== void 0 && excludeKeys.has(key) || typeof val === "function") return false;
|
|
1108
|
+
if (key === "extractThirdParty" && Array.isArray(val)) return val.map(String);
|
|
1109
|
+
if (Array.isArray(val)) {
|
|
1110
|
+
if (cache.has(val)) return cache.get(val);
|
|
1111
|
+
const out = [];
|
|
1112
|
+
cache.set(val, out);
|
|
1113
|
+
val.forEach((v, i) => out.push(sanitize(v, String(i))));
|
|
1114
|
+
return out;
|
|
1115
|
+
}
|
|
1116
|
+
if (val !== null && typeof val === "object" && Object.getPrototypeOf(val) === Object.prototype) {
|
|
1117
|
+
const obj = val;
|
|
1118
|
+
if (cache.has(obj)) return cache.get(obj);
|
|
1119
|
+
const out = {};
|
|
1120
|
+
cache.set(obj, out);
|
|
1121
|
+
for (const [k, v] of Object.entries(obj)) out[k] = sanitize(v, k);
|
|
1122
|
+
return out;
|
|
1123
|
+
}
|
|
1124
|
+
return val;
|
|
1125
|
+
}
|
|
1126
|
+
return structuredClone(sanitize(options));
|
|
1114
1127
|
}
|
|
1115
1128
|
const getEnvHeaders = () => {
|
|
1116
1129
|
const headersStr = (0, _module_federation_sdk.getProcessEnv)()["MF_ENV_HEADERS"] || "{}";
|
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-eLXU1Wnf.js');
|
|
4
|
+
const require_expose_rpc = require('./expose-rpc-C93yOgOB.js');
|
|
5
|
+
require('./consumeTypes-K9bTh9DW.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-eLXU1Wnf.js');
|
|
3
|
+
const require_expose_rpc = require('./expose-rpc-C93yOgOB.js');
|
|
4
4
|
|
|
5
5
|
//#region src/core/lib/forkGenerateDts.ts
|
|
6
6
|
async function forkGenerateDts(options) {
|
package/dist/index.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
|
-
const require_consumeTypes = require('./consumeTypes-
|
|
3
|
+
const require_Broker = require('./Broker-eLXU1Wnf.js');
|
|
4
|
+
const require_expose_rpc = require('./expose-rpc-C93yOgOB.js');
|
|
5
|
+
const require_consumeTypes = require('./consumeTypes-K9bTh9DW.js');
|
|
6
6
|
require('./core.js');
|
|
7
7
|
let fs_extra = require("fs-extra");
|
|
8
8
|
fs_extra = require_Action.__toESM(fs_extra);
|
|
@@ -314,7 +314,25 @@ const getGenerateTypesFn = (dtsManagerOptions) => {
|
|
|
314
314
|
return fn;
|
|
315
315
|
};
|
|
316
316
|
const generateTypesAPI = ({ dtsManagerOptions }) => {
|
|
317
|
-
return getGenerateTypesFn(dtsManagerOptions)(dtsManagerOptions)
|
|
317
|
+
return getGenerateTypesFn(dtsManagerOptions)(dtsManagerOptions).then(async () => {
|
|
318
|
+
await callAfterGenerateHook({
|
|
319
|
+
dtsManagerOptions,
|
|
320
|
+
generatedTypes: require_expose_rpc.retrieveTypesAssetsInfo(dtsManagerOptions.remote)
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
const callAfterGenerateHook = async ({ dtsManagerOptions, generatedTypes }) => {
|
|
325
|
+
const afterGenerate = dtsManagerOptions.remote.afterGenerate;
|
|
326
|
+
if (!afterGenerate) return;
|
|
327
|
+
try {
|
|
328
|
+
await afterGenerate(generatedTypes);
|
|
329
|
+
} catch (error) {
|
|
330
|
+
if (dtsManagerOptions.remote.abortOnError === false) {
|
|
331
|
+
if (dtsManagerOptions.displayErrorInTerminal) _module_federation_sdk.logger.error(error);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
throw error;
|
|
335
|
+
}
|
|
318
336
|
};
|
|
319
337
|
const WINDOWS_ABSOLUTE_PATH_REGEXP = /^[a-zA-Z]:[\\/]/;
|
|
320
338
|
const isSafeRelativePath = (relativePath) => {
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/dts-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"author": "hanric <hanric.zhang@gmail.com>",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -71,14 +71,10 @@
|
|
|
71
71
|
"@module-federation/third-party-dts-extractor": "workspace:*",
|
|
72
72
|
"adm-zip": "^0.5.10",
|
|
73
73
|
"ansi-colors": "^4.1.3",
|
|
74
|
-
"axios": "
|
|
75
|
-
"chalk": "3.0.0",
|
|
74
|
+
"axios": "1.13.5",
|
|
76
75
|
"fs-extra": "9.1.0",
|
|
77
76
|
"isomorphic-ws": "5.0.0",
|
|
78
|
-
"lodash.clonedeepwith": "4.5.0",
|
|
79
|
-
"log4js": "6.9.1",
|
|
80
77
|
"node-schedule": "2.1.1",
|
|
81
|
-
"rambda": "^9.1.0",
|
|
82
78
|
"ws": "8.18.0"
|
|
83
79
|
},
|
|
84
80
|
"devDependencies": {
|
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.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"author": "hanric <hanric.zhang@gmail.com>",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -67,19 +67,15 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"adm-zip": "^0.5.10",
|
|
69
69
|
"ansi-colors": "^4.1.3",
|
|
70
|
-
"axios": "
|
|
71
|
-
"chalk": "3.0.0",
|
|
70
|
+
"axios": "1.13.5",
|
|
72
71
|
"fs-extra": "9.1.0",
|
|
73
72
|
"isomorphic-ws": "5.0.0",
|
|
74
|
-
"lodash.clonedeepwith": "4.5.0",
|
|
75
|
-
"log4js": "6.9.1",
|
|
76
73
|
"node-schedule": "2.1.1",
|
|
77
|
-
"rambda": "^9.1.0",
|
|
78
74
|
"ws": "8.18.0",
|
|
79
|
-
"@module-federation/
|
|
80
|
-
"@module-federation/
|
|
81
|
-
"@module-federation/
|
|
82
|
-
"@module-federation/
|
|
75
|
+
"@module-federation/managers": "2.3.1",
|
|
76
|
+
"@module-federation/error-codes": "2.3.1",
|
|
77
|
+
"@module-federation/sdk": "2.3.1",
|
|
78
|
+
"@module-federation/third-party-dts-extractor": "2.3.1"
|
|
83
79
|
},
|
|
84
80
|
"devDependencies": {
|
|
85
81
|
"@types/node-schedule": "2.1.7",
|
|
@@ -91,7 +87,7 @@
|
|
|
91
87
|
"directory-tree": "3.5.2",
|
|
92
88
|
"vitest": "1.6.0",
|
|
93
89
|
"webpack": "^5.104.1",
|
|
94
|
-
"@module-federation/runtime": "2.
|
|
90
|
+
"@module-federation/runtime": "2.3.1"
|
|
95
91
|
},
|
|
96
92
|
"peerDependencies": {
|
|
97
93
|
"typescript": "^4.9.0 || ^5.0.0",
|