@module-federation/dts-plugin 0.2.8 → 0.3.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 +14 -0
- package/dist/{DTSManagerOptions-c0728719.d.ts → DTSManagerOptions-7109e8ac.d.ts} +1 -0
- package/dist/{DtsWorker-90454949.d.ts → DtsWorker-17de6ba4.d.ts} +2 -5
- package/dist/core.d.mts +8 -4
- package/dist/core.d.ts +8 -4
- package/dist/core.js +73 -40
- package/dist/dynamic-remote-type-hints-plugin.js +5 -7
- package/dist/esm/{chunk-MQRIERJP.js → chunk-6DND574L.js} +7 -15
- package/dist/esm/chunk-DEW2PNCR.js +283 -0
- package/dist/esm/chunk-HKRTV6ZH.js +900 -0
- package/dist/esm/{chunk-2RCHPGBO.js → chunk-SFEGBRA3.js} +329 -1428
- package/dist/esm/{chunk-G7ONFBMA.js → chunk-XKCIYRDL.js} +1 -1
- package/dist/esm/core.js +11 -11
- package/dist/esm/dynamic-remote-type-hints-plugin.js +2 -2
- package/dist/esm/fork-dev-worker.js +11 -7
- package/dist/esm/fork-generate-dts.js +3 -2
- package/dist/esm/index.js +21 -18
- package/dist/esm/start-broker.js +2 -2
- package/dist/fork-dev-worker.d.mts +1 -1
- package/dist/fork-dev-worker.d.ts +1 -1
- package/dist/fork-dev-worker.js +69 -38
- package/dist/fork-generate-dts.d.mts +2 -2
- package/dist/fork-generate-dts.d.ts +2 -2
- package/dist/fork-generate-dts.js +141 -289
- package/dist/iife/launch-web-client.js +5 -7
- package/dist/index.js +84 -51
- package/dist/package.json +1 -1
- package/dist/start-broker.js +28 -344
- package/package.json +5 -5
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @module-federation/dts-plugin
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fa37cc4: feat: support modern.js ssr [#2348](https://github.com/module-federation/core/issues/2348)
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 7c4d99b: fix(dts-plugin): temp tsconfig path should extends original tsconfig
|
|
12
|
+
- Updated dependencies [fa37cc4]
|
|
13
|
+
- @module-federation/sdk@0.3.0
|
|
14
|
+
- @module-federation/managers@0.3.0
|
|
15
|
+
- @module-federation/third-party-dts-extractor@0.3.0
|
|
16
|
+
|
|
3
17
|
## 0.2.8
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ interface HostOptions extends moduleFederationPlugin.DtsHostOptions {
|
|
|
11
11
|
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions;
|
|
12
12
|
context?: string;
|
|
13
13
|
implementation?: string;
|
|
14
|
+
runtimePkgs?: string[];
|
|
14
15
|
}
|
|
15
16
|
interface RemoteInfo {
|
|
16
17
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildProcess } from 'child_process';
|
|
2
|
-
import { a as RemoteOptions, D as DTSManagerOptions, R as RemoteInfo, H as HostOptions } from './DTSManagerOptions-
|
|
2
|
+
import { a as RemoteOptions, D as DTSManagerOptions, R as RemoteInfo, H as HostOptions } from './DTSManagerOptions-7109e8ac.js';
|
|
3
3
|
import ts from 'typescript';
|
|
4
4
|
|
|
5
5
|
interface TsConfigJson {
|
|
@@ -16,9 +16,6 @@ declare const retrieveRemoteConfig: (options: RemoteOptions) => {
|
|
|
16
16
|
remoteOptions: Required<RemoteOptions>;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
declare const REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
20
|
-
declare const REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
21
|
-
declare const HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
22
19
|
declare const enum UpdateMode {
|
|
23
20
|
POSITIVE = "POSITIVE",
|
|
24
21
|
PASSIVE = "PASSIVE"
|
|
@@ -105,4 +102,4 @@ declare class DtsWorker {
|
|
|
105
102
|
exit(): void;
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
export { DTSManager as D,
|
|
105
|
+
export { DTSManager as D, RpcRemoteMethod as R, TsConfigJson as T, RpcCallMessage as a, RpcGMCallTypes as b, RpcMessage as c, RpcMethod as d, RpcRejectMessage as e, RpcResolveMessage as f, RpcWorker as g, createRpcWorker as h, getRpcWorkerData as i, DtsWorker as j, DtsWorkerOptions as k, retrieveRemoteConfig as r };
|
package/dist/core.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-
|
|
2
|
-
export { j as DtsWorker,
|
|
3
|
-
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-
|
|
1
|
+
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-17de6ba4.js';
|
|
2
|
+
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-17de6ba4.js';
|
|
3
|
+
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-7109e8ac.js';
|
|
4
4
|
import { moduleFederationPlugin } from '@module-federation/sdk';
|
|
5
5
|
import { ChildProcess } from 'child_process';
|
|
6
6
|
import 'typescript';
|
|
@@ -82,4 +82,8 @@ declare namespace index {
|
|
|
82
82
|
|
|
83
83
|
declare function consumeTypes(options: DTSManagerOptions): Promise<void>;
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
declare const REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
86
|
+
declare const REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
87
|
+
declare const HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
88
|
+
|
|
89
|
+
export { DTSManager, DTSManagerOptions, HOST_API_TYPES_FILE_NAME, HostOptions, REMOTE_ALIAS_IDENTIFIER, REMOTE_API_TYPES_FILE_NAME, RemoteOptions, consumeTypes, generateTypes, generateTypesInChildProcess, getDTSManagerConstructor, isTSProject, retrieveHostConfig, retrieveMfTypesPath, retrieveOriginalOutDir, retrieveTypesAssetsInfo, retrieveTypesZipPath, index as rpc, validateOptions };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-
|
|
2
|
-
export { j as DtsWorker,
|
|
3
|
-
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-
|
|
1
|
+
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-17de6ba4.js';
|
|
2
|
+
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-17de6ba4.js';
|
|
3
|
+
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-7109e8ac.js';
|
|
4
4
|
import { moduleFederationPlugin } from '@module-federation/sdk';
|
|
5
5
|
import { ChildProcess } from 'child_process';
|
|
6
6
|
import 'typescript';
|
|
@@ -82,4 +82,8 @@ declare namespace index {
|
|
|
82
82
|
|
|
83
83
|
declare function consumeTypes(options: DTSManagerOptions): Promise<void>;
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
declare const REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
86
|
+
declare const REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
87
|
+
declare const HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
88
|
+
|
|
89
|
+
export { DTSManager, DTSManagerOptions, HOST_API_TYPES_FILE_NAME, HostOptions, REMOTE_ALIAS_IDENTIFIER, REMOTE_API_TYPES_FILE_NAME, RemoteOptions, consumeTypes, generateTypes, generateTypesInChildProcess, getDTSManagerConstructor, isTSProject, retrieveHostConfig, retrieveMfTypesPath, retrieveOriginalOutDir, retrieveTypesAssetsInfo, retrieveTypesZipPath, index as rpc, validateOptions };
|
package/dist/core.js
CHANGED
|
@@ -76,7 +76,6 @@ __export(core_exports, {
|
|
|
76
76
|
HOST_API_TYPES_FILE_NAME: () => HOST_API_TYPES_FILE_NAME,
|
|
77
77
|
REMOTE_ALIAS_IDENTIFIER: () => REMOTE_ALIAS_IDENTIFIER,
|
|
78
78
|
REMOTE_API_TYPES_FILE_NAME: () => REMOTE_API_TYPES_FILE_NAME,
|
|
79
|
-
UpdateMode: () => UpdateMode,
|
|
80
79
|
consumeTypes: () => consumeTypes,
|
|
81
80
|
generateTypes: () => generateTypes,
|
|
82
81
|
generateTypesInChildProcess: () => generateTypesInChildProcess,
|
|
@@ -113,7 +112,6 @@ var import_path3 = __toESM(require("path"));
|
|
|
113
112
|
var import_promises3 = require("fs/promises");
|
|
114
113
|
var import_fs = __toESM(require("fs"));
|
|
115
114
|
var import_sdk5 = require("@module-federation/sdk");
|
|
116
|
-
var import_lodash = __toESM(require("lodash.clonedeepwith"));
|
|
117
115
|
var import_third_party_dts_extractor2 = require("@module-federation/third-party-dts-extractor");
|
|
118
116
|
|
|
119
117
|
// packages/dts-plugin/src/core/lib/archiveHandler.ts
|
|
@@ -123,8 +121,8 @@ var import_promises2 = require("fs/promises");
|
|
|
123
121
|
|
|
124
122
|
// packages/dts-plugin/src/core/lib/typeScriptCompiler.ts
|
|
125
123
|
var import_fs_extra = require("fs-extra");
|
|
124
|
+
var import_crypto = __toESM(require("crypto"));
|
|
126
125
|
var import_promises = require("fs/promises");
|
|
127
|
-
var import_crypto = require("crypto");
|
|
128
126
|
var import_path = require("path");
|
|
129
127
|
var import_third_party_dts_extractor = require("@module-federation/third-party-dts-extractor");
|
|
130
128
|
var import_child_process = require("child_process");
|
|
@@ -135,8 +133,12 @@ var DEFINITION_FILE_EXTENSION = ".d.ts";
|
|
|
135
133
|
var retrieveMfTypesPath = /* @__PURE__ */ __name((tsConfig, remoteOptions) => (0, import_path.normalize)(tsConfig.compilerOptions.outDir.replace(remoteOptions.compiledTypesFolder, "")), "retrieveMfTypesPath");
|
|
136
134
|
var retrieveOriginalOutDir = /* @__PURE__ */ __name((tsConfig, remoteOptions) => (0, import_path.normalize)(tsConfig.compilerOptions.outDir.replace(remoteOptions.compiledTypesFolder, "").replace(remoteOptions.typesFolder, "")), "retrieveOriginalOutDir");
|
|
137
135
|
var retrieveMfAPITypesPath = /* @__PURE__ */ __name((tsConfig, remoteOptions) => (0, import_path.join)(retrieveOriginalOutDir(tsConfig, remoteOptions), `${remoteOptions.typesFolder}.d.ts`), "retrieveMfAPITypesPath");
|
|
138
|
-
function writeTempTsConfig(tsConfig, context) {
|
|
139
|
-
const
|
|
136
|
+
function writeTempTsConfig(tsConfig, context, name) {
|
|
137
|
+
const createHash = /* @__PURE__ */ __name((contents) => {
|
|
138
|
+
return import_crypto.default.createHash("md5").update(contents).digest("hex");
|
|
139
|
+
}, "createHash");
|
|
140
|
+
const hash = createHash(`${JSON.stringify(tsConfig)}${name}`);
|
|
141
|
+
const tempTsConfigJsonPath = (0, import_path.resolve)(context, "node_modules", import_sdk.TEMP_DIR, `tsconfig.${hash}.json`);
|
|
140
142
|
(0, import_fs_extra.ensureDirSync)((0, import_path.dirname)(tempTsConfigJsonPath));
|
|
141
143
|
(0, import_fs_extra.writeFileSync)(tempTsConfigJsonPath, JSON.stringify(tsConfig, null, 2));
|
|
142
144
|
return tempTsConfigJsonPath;
|
|
@@ -189,7 +191,7 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
|
|
|
189
191
|
return;
|
|
190
192
|
}
|
|
191
193
|
const { compilerOptions } = tsConfig;
|
|
192
|
-
const tempTsConfigJsonPath = writeTempTsConfig(tsConfig, remoteOptions.context);
|
|
194
|
+
const tempTsConfigJsonPath = writeTempTsConfig(tsConfig, remoteOptions.context, remoteOptions.moduleFederationConfig.name || "mf");
|
|
193
195
|
try {
|
|
194
196
|
const mfTypePath = retrieveMfTypesPath(tsConfig, remoteOptions);
|
|
195
197
|
const thirdPartyExtractor = new import_third_party_dts_extractor.ThirdPartyExtractor((0, import_path.resolve)(mfTypePath, "node_modules"), remoteOptions.context);
|
|
@@ -351,6 +353,11 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
351
353
|
// packages/dts-plugin/src/server/constant.ts
|
|
352
354
|
var DEFAULT_WEB_SOCKET_PORT = 16322;
|
|
353
355
|
var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82";
|
|
356
|
+
var UpdateMode;
|
|
357
|
+
(function(UpdateMode2) {
|
|
358
|
+
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
359
|
+
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
360
|
+
})(UpdateMode || (UpdateMode = {}));
|
|
354
361
|
|
|
355
362
|
// packages/dts-plugin/src/server/utils/log.ts
|
|
356
363
|
function fileLog(msg, module2, level) {
|
|
@@ -524,16 +531,6 @@ var UpdateKind;
|
|
|
524
531
|
UpdateKind2["RELOAD_PAGE"] = "RELOAD_PAGE";
|
|
525
532
|
})(UpdateKind || (UpdateKind = {}));
|
|
526
533
|
|
|
527
|
-
// packages/dts-plugin/src/core/constant.ts
|
|
528
|
-
var REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
529
|
-
var REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
530
|
-
var HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
531
|
-
var UpdateMode;
|
|
532
|
-
(function(UpdateMode2) {
|
|
533
|
-
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
534
|
-
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
535
|
-
})(UpdateMode || (UpdateMode = {}));
|
|
536
|
-
|
|
537
534
|
// packages/dts-plugin/src/server/broker/Broker.ts
|
|
538
535
|
var _Broker = class _Broker {
|
|
539
536
|
constructor() {
|
|
@@ -1180,7 +1177,8 @@ var defaultOptions = {
|
|
|
1180
1177
|
implementation: "",
|
|
1181
1178
|
context: process.cwd(),
|
|
1182
1179
|
abortOnError: true,
|
|
1183
|
-
consumeAPITypes: false
|
|
1180
|
+
consumeAPITypes: false,
|
|
1181
|
+
runtimePkgs: []
|
|
1184
1182
|
};
|
|
1185
1183
|
var buildZipUrl = /* @__PURE__ */ __name((hostOptions, url) => {
|
|
1186
1184
|
const remoteUrl = new URL(url, "file:");
|
|
@@ -1239,6 +1237,11 @@ var retrieveHostConfig = /* @__PURE__ */ __name((options) => {
|
|
|
1239
1237
|
};
|
|
1240
1238
|
}, "retrieveHostConfig");
|
|
1241
1239
|
|
|
1240
|
+
// packages/dts-plugin/src/core/constant.ts
|
|
1241
|
+
var REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
1242
|
+
var REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
1243
|
+
var HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
1244
|
+
|
|
1242
1245
|
// packages/dts-plugin/src/core/lib/DTSManager.ts
|
|
1243
1246
|
var _a;
|
|
1244
1247
|
var DTSManager = (_a = class {
|
|
@@ -1249,11 +1252,7 @@ var DTSManager = (_a = class {
|
|
|
1249
1252
|
__publicField(this, "loadedRemoteAPIAlias");
|
|
1250
1253
|
__publicField(this, "extraOptions");
|
|
1251
1254
|
__publicField(this, "updatedRemoteInfos");
|
|
1252
|
-
this.options = (
|
|
1253
|
-
if (key === "manifest") {
|
|
1254
|
-
return false;
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1255
|
+
this.options = cloneDeepOptions(options);
|
|
1257
1256
|
this.runtimePkgs = [
|
|
1258
1257
|
"@module-federation/runtime",
|
|
1259
1258
|
"@module-federation/enhanced/runtime",
|
|
@@ -1464,7 +1463,16 @@ var DTSManager = (_a = class {
|
|
|
1464
1463
|
...packageTypes,
|
|
1465
1464
|
"Y"
|
|
1466
1465
|
].join(" :\n")} ;`;
|
|
1467
|
-
const
|
|
1466
|
+
const runtimePkgs = /* @__PURE__ */ new Set();
|
|
1467
|
+
[
|
|
1468
|
+
...this.runtimePkgs,
|
|
1469
|
+
...hostOptions.runtimePkgs
|
|
1470
|
+
].forEach((pkg) => {
|
|
1471
|
+
runtimePkgs.add(pkg);
|
|
1472
|
+
});
|
|
1473
|
+
const pkgsDeclareStr = [
|
|
1474
|
+
...runtimePkgs
|
|
1475
|
+
].map((pkg) => {
|
|
1468
1476
|
return `declare module "${pkg}" {
|
|
1469
1477
|
${remoteKeysStr}
|
|
1470
1478
|
${packageTypesStr}
|
|
@@ -1597,6 +1605,7 @@ var DTSManager = (_a = class {
|
|
|
1597
1605
|
}, __name(_a, "DTSManager"), _a);
|
|
1598
1606
|
|
|
1599
1607
|
// packages/dts-plugin/src/core/lib/utils.ts
|
|
1608
|
+
var import_lodash = __toESM(require("lodash.clonedeepwith"));
|
|
1600
1609
|
function getDTSManagerConstructor(implementation) {
|
|
1601
1610
|
if (implementation) {
|
|
1602
1611
|
const NewConstructor = require(implementation);
|
|
@@ -1668,6 +1677,18 @@ var isTSProject = /* @__PURE__ */ __name((dtsOptions, context = process.cwd()) =
|
|
|
1668
1677
|
return false;
|
|
1669
1678
|
}
|
|
1670
1679
|
}, "isTSProject");
|
|
1680
|
+
function cloneDeepOptions(options) {
|
|
1681
|
+
const excludeKeys = [
|
|
1682
|
+
"manifest",
|
|
1683
|
+
"async"
|
|
1684
|
+
];
|
|
1685
|
+
return (0, import_lodash.default)(options, (_value, key) => {
|
|
1686
|
+
if (typeof key === "string" && excludeKeys.includes(key)) {
|
|
1687
|
+
return false;
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
__name(cloneDeepOptions, "cloneDeepOptions");
|
|
1671
1692
|
function axiosGet(url, config) {
|
|
1672
1693
|
return __async(this, null, function* () {
|
|
1673
1694
|
const httpAgent = new import_http2.default.Agent({
|
|
@@ -1720,6 +1741,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
1720
1741
|
}
|
|
1721
1742
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
1722
1743
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
1744
|
+
var _a3;
|
|
1723
1745
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
1724
1746
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
1725
1747
|
if (readResult.error) {
|
|
@@ -1738,6 +1760,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1738
1760
|
};
|
|
1739
1761
|
rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
|
|
1740
1762
|
rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
|
|
1763
|
+
(_a3 = rawTsConfigJson.compilerOptions) == null ? true : delete _a3.paths;
|
|
1741
1764
|
const filesToCompile = [
|
|
1742
1765
|
...Object.values(mapComponentsToExpose),
|
|
1743
1766
|
...additionalFilesToCompile
|
|
@@ -1746,10 +1769,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1746
1769
|
rawTsConfigJson.files = filesToCompile;
|
|
1747
1770
|
rawTsConfigJson.exclude = [];
|
|
1748
1771
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
1749
|
-
|
|
1750
|
-
if (extendsPath && extendsPath.startsWith(".")) {
|
|
1751
|
-
rawTsConfigJson.extends = (0, import_path5.resolve)(context, extendsPath);
|
|
1752
|
-
}
|
|
1772
|
+
rawTsConfigJson.extends = resolvedTsConfigPath;
|
|
1753
1773
|
return rawTsConfigJson;
|
|
1754
1774
|
}, "readTsConfig");
|
|
1755
1775
|
var TS_EXTENSIONS = [
|
|
@@ -1809,7 +1829,6 @@ __name(generateTypes, "generateTypes");
|
|
|
1809
1829
|
|
|
1810
1830
|
// packages/dts-plugin/src/core/lib/DtsWorker.ts
|
|
1811
1831
|
var import_path6 = __toESM(require("path"));
|
|
1812
|
-
var import_lodash2 = __toESM(require("lodash.clonedeepwith"));
|
|
1813
1832
|
|
|
1814
1833
|
// packages/dts-plugin/src/core/rpc/index.ts
|
|
1815
1834
|
var rpc_exports = {};
|
|
@@ -2019,11 +2038,24 @@ function createRpcWorker(modulePath, data, memoryLimit, once) {
|
|
|
2019
2038
|
return remoteMethod(...args);
|
|
2020
2039
|
},
|
|
2021
2040
|
terminate() {
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2041
|
+
try {
|
|
2042
|
+
if (childProcess.connected) {
|
|
2043
|
+
childProcess.send({
|
|
2044
|
+
type: RpcGMCallTypes.EXIT,
|
|
2045
|
+
id
|
|
2046
|
+
}, (err) => {
|
|
2047
|
+
if (err) {
|
|
2048
|
+
console.error("Error sending message:", err);
|
|
2049
|
+
}
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
} catch (error2) {
|
|
2053
|
+
if (error2.code === "EPIPE") {
|
|
2054
|
+
console.error("Pipe closed before message could be sent:", error2);
|
|
2055
|
+
} else {
|
|
2056
|
+
console.error("Unexpected error:", error2);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2027
2059
|
childProcess = void 0;
|
|
2028
2060
|
remoteMethod = void 0;
|
|
2029
2061
|
},
|
|
@@ -2051,11 +2083,7 @@ var _DtsWorker = class _DtsWorker {
|
|
|
2051
2083
|
__publicField(this, "rpcWorker");
|
|
2052
2084
|
__publicField(this, "_options");
|
|
2053
2085
|
__publicField(this, "_res");
|
|
2054
|
-
this._options = (
|
|
2055
|
-
if (key === "manifest") {
|
|
2056
|
-
return false;
|
|
2057
|
-
}
|
|
2058
|
-
});
|
|
2086
|
+
this._options = cloneDeepOptions(options);
|
|
2059
2087
|
this.removeUnSerializationOptions();
|
|
2060
2088
|
this.rpcWorker = createRpcWorker(import_path6.default.resolve(__dirname, "./fork-generate-dts.js"), {}, void 0, true);
|
|
2061
2089
|
this._res = this.rpcWorker.connect(this._options);
|
|
@@ -2096,7 +2124,13 @@ var _DtsWorker = class _DtsWorker {
|
|
|
2096
2124
|
}
|
|
2097
2125
|
exit() {
|
|
2098
2126
|
var _a3;
|
|
2099
|
-
|
|
2127
|
+
try {
|
|
2128
|
+
(_a3 = this.rpcWorker) == null ? void 0 : _a3.terminate();
|
|
2129
|
+
} catch (err) {
|
|
2130
|
+
if (isDebugMode()) {
|
|
2131
|
+
console.error(err);
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2100
2134
|
}
|
|
2101
2135
|
};
|
|
2102
2136
|
__name(_DtsWorker, "DtsWorker");
|
|
@@ -2128,7 +2162,6 @@ __name(consumeTypes, "consumeTypes");
|
|
|
2128
2162
|
HOST_API_TYPES_FILE_NAME,
|
|
2129
2163
|
REMOTE_ALIAS_IDENTIFIER,
|
|
2130
2164
|
REMOTE_API_TYPES_FILE_NAME,
|
|
2131
|
-
UpdateMode,
|
|
2132
2165
|
consumeTypes,
|
|
2133
2166
|
generateTypes,
|
|
2134
2167
|
generateTypesInChildProcess,
|
|
@@ -45,6 +45,11 @@ var import_isomorphic_ws = __toESM(require("isomorphic-ws"));
|
|
|
45
45
|
// packages/dts-plugin/src/server/constant.ts
|
|
46
46
|
var DEFAULT_WEB_SOCKET_PORT = 16322;
|
|
47
47
|
var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82";
|
|
48
|
+
var UpdateMode;
|
|
49
|
+
(function(UpdateMode2) {
|
|
50
|
+
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
51
|
+
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
52
|
+
})(UpdateMode || (UpdateMode = {}));
|
|
48
53
|
|
|
49
54
|
// packages/dts-plugin/src/server/createWebsocket.ts
|
|
50
55
|
function createWebsocket() {
|
|
@@ -120,13 +125,6 @@ var _AddDynamicRemoteAction = class _AddDynamicRemoteAction extends Action {
|
|
|
120
125
|
__name(_AddDynamicRemoteAction, "AddDynamicRemoteAction");
|
|
121
126
|
var AddDynamicRemoteAction = _AddDynamicRemoteAction;
|
|
122
127
|
|
|
123
|
-
// packages/dts-plugin/src/core/constant.ts
|
|
124
|
-
var UpdateMode;
|
|
125
|
-
(function(UpdateMode2) {
|
|
126
|
-
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
127
|
-
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
128
|
-
})(UpdateMode || (UpdateMode = {}));
|
|
129
|
-
|
|
130
128
|
// packages/dts-plugin/src/dev-worker/utils.ts
|
|
131
129
|
var DEFAULT_LOCAL_IPS = [
|
|
132
130
|
"localhost",
|
|
@@ -60,6 +60,11 @@ var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82";
|
|
|
60
60
|
var MF_SERVER_IDENTIFIER = "Module Federation Dev Server";
|
|
61
61
|
var WEB_CLIENT_OPTIONS_IDENTIFIER = "__WEB_CLIENT_OPTIONS__";
|
|
62
62
|
var DEFAULT_TAR_NAME = "@mf-types.zip";
|
|
63
|
+
var UpdateMode;
|
|
64
|
+
(function(UpdateMode2) {
|
|
65
|
+
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
66
|
+
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
67
|
+
})(UpdateMode || (UpdateMode = {}));
|
|
63
68
|
|
|
64
69
|
// packages/dts-plugin/src/server/message/Action/Update.ts
|
|
65
70
|
var UpdateKind;
|
|
@@ -129,16 +134,6 @@ var _AddDynamicRemoteAction = class _AddDynamicRemoteAction extends Action {
|
|
|
129
134
|
__name(_AddDynamicRemoteAction, "AddDynamicRemoteAction");
|
|
130
135
|
var AddDynamicRemoteAction = _AddDynamicRemoteAction;
|
|
131
136
|
|
|
132
|
-
// packages/dts-plugin/src/core/constant.ts
|
|
133
|
-
var REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
134
|
-
var REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
135
|
-
var HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
136
|
-
var UpdateMode;
|
|
137
|
-
(function(UpdateMode2) {
|
|
138
|
-
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
139
|
-
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
140
|
-
})(UpdateMode || (UpdateMode = {}));
|
|
141
|
-
|
|
142
137
|
// packages/dts-plugin/src/server/message/Action/AddPublisher.ts
|
|
143
138
|
var _AddPublisherAction = class _AddPublisherAction extends Action {
|
|
144
139
|
constructor(payload) {
|
|
@@ -219,6 +214,7 @@ export {
|
|
|
219
214
|
MF_SERVER_IDENTIFIER,
|
|
220
215
|
WEB_CLIENT_OPTIONS_IDENTIFIER,
|
|
221
216
|
DEFAULT_TAR_NAME,
|
|
217
|
+
UpdateMode,
|
|
222
218
|
ActionKind,
|
|
223
219
|
UpdateKind,
|
|
224
220
|
AddPublisherAction,
|
|
@@ -228,9 +224,5 @@ export {
|
|
|
228
224
|
NotifyWebClientAction,
|
|
229
225
|
UpdatePublisherAction,
|
|
230
226
|
FetchTypesAction,
|
|
231
|
-
AddDynamicRemoteAction
|
|
232
|
-
REMOTE_ALIAS_IDENTIFIER,
|
|
233
|
-
REMOTE_API_TYPES_FILE_NAME,
|
|
234
|
-
HOST_API_TYPES_FILE_NAME,
|
|
235
|
-
UpdateMode
|
|
227
|
+
AddDynamicRemoteAction
|
|
236
228
|
};
|