@module-federation/dts-plugin 0.2.8 → 0.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/CHANGELOG.md +23 -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 -43
- 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-2RCHPGBO.js → chunk-7AXI7WOP.js} +286 -1390
- package/dist/esm/chunk-HKRTV6ZH.js +900 -0
- package/dist/esm/chunk-VFGWGY54.js +283 -0
- 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 -41
- 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 -292
- package/dist/iife/launch-web-client.js +5 -7
- package/dist/index.js +84 -54
- 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,28 @@
|
|
|
1
1
|
# @module-federation/dts-plugin
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0a9adaf: chore: remove useless log
|
|
8
|
+
- @module-federation/sdk@0.3.1
|
|
9
|
+
- @module-federation/managers@0.3.1
|
|
10
|
+
- @module-federation/third-party-dts-extractor@0.3.1
|
|
11
|
+
|
|
12
|
+
## 0.3.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- fa37cc4: feat: support modern.js ssr [#2348](https://github.com/module-federation/core/issues/2348)
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 7c4d99b: fix(dts-plugin): temp tsconfig path should extends original tsconfig
|
|
21
|
+
- Updated dependencies [fa37cc4]
|
|
22
|
+
- @module-federation/sdk@0.3.0
|
|
23
|
+
- @module-federation/managers@0.3.0
|
|
24
|
+
- @module-federation/third-party-dts-extractor@0.3.0
|
|
25
|
+
|
|
3
26
|
## 0.2.8
|
|
4
27
|
|
|
5
28
|
### 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);
|
|
@@ -227,9 +229,6 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
|
|
|
227
229
|
}
|
|
228
230
|
yield (0, import_promises.rm)(tempTsConfigJsonPath);
|
|
229
231
|
} catch (err) {
|
|
230
|
-
if (isDebugMode()) {
|
|
231
|
-
console.log("tsconfig: ", JSON.stringify(tsConfig, null, 2));
|
|
232
|
-
}
|
|
233
232
|
throw err;
|
|
234
233
|
}
|
|
235
234
|
}), "compileTs");
|
|
@@ -351,6 +350,11 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
351
350
|
// packages/dts-plugin/src/server/constant.ts
|
|
352
351
|
var DEFAULT_WEB_SOCKET_PORT = 16322;
|
|
353
352
|
var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82";
|
|
353
|
+
var UpdateMode;
|
|
354
|
+
(function(UpdateMode2) {
|
|
355
|
+
UpdateMode2["POSITIVE"] = "POSITIVE";
|
|
356
|
+
UpdateMode2["PASSIVE"] = "PASSIVE";
|
|
357
|
+
})(UpdateMode || (UpdateMode = {}));
|
|
354
358
|
|
|
355
359
|
// packages/dts-plugin/src/server/utils/log.ts
|
|
356
360
|
function fileLog(msg, module2, level) {
|
|
@@ -524,16 +528,6 @@ var UpdateKind;
|
|
|
524
528
|
UpdateKind2["RELOAD_PAGE"] = "RELOAD_PAGE";
|
|
525
529
|
})(UpdateKind || (UpdateKind = {}));
|
|
526
530
|
|
|
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
531
|
// packages/dts-plugin/src/server/broker/Broker.ts
|
|
538
532
|
var _Broker = class _Broker {
|
|
539
533
|
constructor() {
|
|
@@ -1180,7 +1174,8 @@ var defaultOptions = {
|
|
|
1180
1174
|
implementation: "",
|
|
1181
1175
|
context: process.cwd(),
|
|
1182
1176
|
abortOnError: true,
|
|
1183
|
-
consumeAPITypes: false
|
|
1177
|
+
consumeAPITypes: false,
|
|
1178
|
+
runtimePkgs: []
|
|
1184
1179
|
};
|
|
1185
1180
|
var buildZipUrl = /* @__PURE__ */ __name((hostOptions, url) => {
|
|
1186
1181
|
const remoteUrl = new URL(url, "file:");
|
|
@@ -1239,6 +1234,11 @@ var retrieveHostConfig = /* @__PURE__ */ __name((options) => {
|
|
|
1239
1234
|
};
|
|
1240
1235
|
}, "retrieveHostConfig");
|
|
1241
1236
|
|
|
1237
|
+
// packages/dts-plugin/src/core/constant.ts
|
|
1238
|
+
var REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER";
|
|
1239
|
+
var REMOTE_API_TYPES_FILE_NAME = "apis.d.ts";
|
|
1240
|
+
var HOST_API_TYPES_FILE_NAME = "index.d.ts";
|
|
1241
|
+
|
|
1242
1242
|
// packages/dts-plugin/src/core/lib/DTSManager.ts
|
|
1243
1243
|
var _a;
|
|
1244
1244
|
var DTSManager = (_a = class {
|
|
@@ -1249,11 +1249,7 @@ var DTSManager = (_a = class {
|
|
|
1249
1249
|
__publicField(this, "loadedRemoteAPIAlias");
|
|
1250
1250
|
__publicField(this, "extraOptions");
|
|
1251
1251
|
__publicField(this, "updatedRemoteInfos");
|
|
1252
|
-
this.options = (
|
|
1253
|
-
if (key === "manifest") {
|
|
1254
|
-
return false;
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1252
|
+
this.options = cloneDeepOptions(options);
|
|
1257
1253
|
this.runtimePkgs = [
|
|
1258
1254
|
"@module-federation/runtime",
|
|
1259
1255
|
"@module-federation/enhanced/runtime",
|
|
@@ -1464,7 +1460,16 @@ var DTSManager = (_a = class {
|
|
|
1464
1460
|
...packageTypes,
|
|
1465
1461
|
"Y"
|
|
1466
1462
|
].join(" :\n")} ;`;
|
|
1467
|
-
const
|
|
1463
|
+
const runtimePkgs = /* @__PURE__ */ new Set();
|
|
1464
|
+
[
|
|
1465
|
+
...this.runtimePkgs,
|
|
1466
|
+
...hostOptions.runtimePkgs
|
|
1467
|
+
].forEach((pkg) => {
|
|
1468
|
+
runtimePkgs.add(pkg);
|
|
1469
|
+
});
|
|
1470
|
+
const pkgsDeclareStr = [
|
|
1471
|
+
...runtimePkgs
|
|
1472
|
+
].map((pkg) => {
|
|
1468
1473
|
return `declare module "${pkg}" {
|
|
1469
1474
|
${remoteKeysStr}
|
|
1470
1475
|
${packageTypesStr}
|
|
@@ -1597,6 +1602,7 @@ var DTSManager = (_a = class {
|
|
|
1597
1602
|
}, __name(_a, "DTSManager"), _a);
|
|
1598
1603
|
|
|
1599
1604
|
// packages/dts-plugin/src/core/lib/utils.ts
|
|
1605
|
+
var import_lodash = __toESM(require("lodash.clonedeepwith"));
|
|
1600
1606
|
function getDTSManagerConstructor(implementation) {
|
|
1601
1607
|
if (implementation) {
|
|
1602
1608
|
const NewConstructor = require(implementation);
|
|
@@ -1668,6 +1674,18 @@ var isTSProject = /* @__PURE__ */ __name((dtsOptions, context = process.cwd()) =
|
|
|
1668
1674
|
return false;
|
|
1669
1675
|
}
|
|
1670
1676
|
}, "isTSProject");
|
|
1677
|
+
function cloneDeepOptions(options) {
|
|
1678
|
+
const excludeKeys = [
|
|
1679
|
+
"manifest",
|
|
1680
|
+
"async"
|
|
1681
|
+
];
|
|
1682
|
+
return (0, import_lodash.default)(options, (_value, key) => {
|
|
1683
|
+
if (typeof key === "string" && excludeKeys.includes(key)) {
|
|
1684
|
+
return false;
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
__name(cloneDeepOptions, "cloneDeepOptions");
|
|
1671
1689
|
function axiosGet(url, config) {
|
|
1672
1690
|
return __async(this, null, function* () {
|
|
1673
1691
|
const httpAgent = new import_http2.default.Agent({
|
|
@@ -1720,6 +1738,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
1720
1738
|
}
|
|
1721
1739
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
1722
1740
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
1741
|
+
var _a3;
|
|
1723
1742
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
1724
1743
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
1725
1744
|
if (readResult.error) {
|
|
@@ -1738,6 +1757,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1738
1757
|
};
|
|
1739
1758
|
rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
|
|
1740
1759
|
rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
|
|
1760
|
+
(_a3 = rawTsConfigJson.compilerOptions) == null ? true : delete _a3.paths;
|
|
1741
1761
|
const filesToCompile = [
|
|
1742
1762
|
...Object.values(mapComponentsToExpose),
|
|
1743
1763
|
...additionalFilesToCompile
|
|
@@ -1746,10 +1766,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1746
1766
|
rawTsConfigJson.files = filesToCompile;
|
|
1747
1767
|
rawTsConfigJson.exclude = [];
|
|
1748
1768
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
1749
|
-
|
|
1750
|
-
if (extendsPath && extendsPath.startsWith(".")) {
|
|
1751
|
-
rawTsConfigJson.extends = (0, import_path5.resolve)(context, extendsPath);
|
|
1752
|
-
}
|
|
1769
|
+
rawTsConfigJson.extends = resolvedTsConfigPath;
|
|
1753
1770
|
return rawTsConfigJson;
|
|
1754
1771
|
}, "readTsConfig");
|
|
1755
1772
|
var TS_EXTENSIONS = [
|
|
@@ -1809,7 +1826,6 @@ __name(generateTypes, "generateTypes");
|
|
|
1809
1826
|
|
|
1810
1827
|
// packages/dts-plugin/src/core/lib/DtsWorker.ts
|
|
1811
1828
|
var import_path6 = __toESM(require("path"));
|
|
1812
|
-
var import_lodash2 = __toESM(require("lodash.clonedeepwith"));
|
|
1813
1829
|
|
|
1814
1830
|
// packages/dts-plugin/src/core/rpc/index.ts
|
|
1815
1831
|
var rpc_exports = {};
|
|
@@ -2019,11 +2035,24 @@ function createRpcWorker(modulePath, data, memoryLimit, once) {
|
|
|
2019
2035
|
return remoteMethod(...args);
|
|
2020
2036
|
},
|
|
2021
2037
|
terminate() {
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2038
|
+
try {
|
|
2039
|
+
if (childProcess.connected) {
|
|
2040
|
+
childProcess.send({
|
|
2041
|
+
type: RpcGMCallTypes.EXIT,
|
|
2042
|
+
id
|
|
2043
|
+
}, (err) => {
|
|
2044
|
+
if (err) {
|
|
2045
|
+
console.error("Error sending message:", err);
|
|
2046
|
+
}
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
} catch (error2) {
|
|
2050
|
+
if (error2.code === "EPIPE") {
|
|
2051
|
+
console.error("Pipe closed before message could be sent:", error2);
|
|
2052
|
+
} else {
|
|
2053
|
+
console.error("Unexpected error:", error2);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2027
2056
|
childProcess = void 0;
|
|
2028
2057
|
remoteMethod = void 0;
|
|
2029
2058
|
},
|
|
@@ -2051,11 +2080,7 @@ var _DtsWorker = class _DtsWorker {
|
|
|
2051
2080
|
__publicField(this, "rpcWorker");
|
|
2052
2081
|
__publicField(this, "_options");
|
|
2053
2082
|
__publicField(this, "_res");
|
|
2054
|
-
this._options = (
|
|
2055
|
-
if (key === "manifest") {
|
|
2056
|
-
return false;
|
|
2057
|
-
}
|
|
2058
|
-
});
|
|
2083
|
+
this._options = cloneDeepOptions(options);
|
|
2059
2084
|
this.removeUnSerializationOptions();
|
|
2060
2085
|
this.rpcWorker = createRpcWorker(import_path6.default.resolve(__dirname, "./fork-generate-dts.js"), {}, void 0, true);
|
|
2061
2086
|
this._res = this.rpcWorker.connect(this._options);
|
|
@@ -2096,7 +2121,13 @@ var _DtsWorker = class _DtsWorker {
|
|
|
2096
2121
|
}
|
|
2097
2122
|
exit() {
|
|
2098
2123
|
var _a3;
|
|
2099
|
-
|
|
2124
|
+
try {
|
|
2125
|
+
(_a3 = this.rpcWorker) == null ? void 0 : _a3.terminate();
|
|
2126
|
+
} catch (err) {
|
|
2127
|
+
if (isDebugMode()) {
|
|
2128
|
+
console.error(err);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2100
2131
|
}
|
|
2101
2132
|
};
|
|
2102
2133
|
__name(_DtsWorker, "DtsWorker");
|
|
@@ -2128,7 +2159,6 @@ __name(consumeTypes, "consumeTypes");
|
|
|
2128
2159
|
HOST_API_TYPES_FILE_NAME,
|
|
2129
2160
|
REMOTE_ALIAS_IDENTIFIER,
|
|
2130
2161
|
REMOTE_API_TYPES_FILE_NAME,
|
|
2131
|
-
UpdateMode,
|
|
2132
2162
|
consumeTypes,
|
|
2133
2163
|
generateTypes,
|
|
2134
2164
|
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
|
};
|