@module-federation/dts-plugin 0.3.1 → 0.3.2

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0de1c83: fix: do not collect node internal utils
8
+ - 85ae159: feat: support rspack ssr
9
+ - Updated dependencies [0de1c83]
10
+ - @module-federation/third-party-dts-extractor@0.3.2
11
+ - @module-federation/sdk@0.3.2
12
+ - @module-federation/managers@0.3.2
13
+
3
14
  ## 0.3.1
4
15
 
5
16
  ### Patch Changes
package/dist/core.js CHANGED
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
24
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
25
37
  var __export = (target, all) => {
26
38
  for (var name in all)
27
39
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -1738,7 +1750,6 @@ function getEffectiveRootDir(parsedCommandLine) {
1738
1750
  }
1739
1751
  __name(getEffectiveRootDir, "getEffectiveRootDir");
1740
1752
  var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
1741
- var _a3;
1742
1753
  const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
1743
1754
  const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
1744
1755
  if (readResult.error) {
@@ -1757,9 +1768,11 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
1757
1768
  };
1758
1769
  rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
1759
1770
  rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
1760
- (_a3 = rawTsConfigJson.compilerOptions) == null ? true : delete _a3.paths;
1771
+ const _a3 = rawTsConfigJson.compilerOptions || {}, { paths, baseUrl } = _a3, restCompilerOptions = __objRest(_a3, ["paths", "baseUrl"]);
1772
+ rawTsConfigJson.compilerOptions = restCompilerOptions;
1761
1773
  const filesToCompile = [
1762
1774
  ...Object.values(mapComponentsToExpose),
1775
+ ...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts")),
1763
1776
  ...additionalFilesToCompile
1764
1777
  ];
1765
1778
  rawTsConfigJson.include = [];
@@ -25,6 +25,18 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
25
25
  return require.apply(this, arguments);
26
26
  throw Error('Dynamic require of "' + x + '" is not supported');
27
27
  });
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
28
40
  var __export = (target, all) => {
29
41
  for (var name in all)
30
42
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -205,6 +217,7 @@ export {
205
217
  __spreadProps,
206
218
  __name,
207
219
  __require,
220
+ __objRest,
208
221
  __export,
209
222
  __publicField,
210
223
  __async,
@@ -7,7 +7,7 @@ import {
7
7
  getFreePort,
8
8
  getIPV4,
9
9
  getIdentifier
10
- } from "./chunk-HKRTV6ZH.js";
10
+ } from "./chunk-MY3H5SQO.js";
11
11
  import {
12
12
  AddPublisherAction,
13
13
  AddSubscriberAction,
@@ -21,11 +21,12 @@ import {
21
21
  UpdatePublisherAction,
22
22
  __async,
23
23
  __name,
24
+ __objRest,
24
25
  __publicField,
25
26
  __require,
26
27
  __spreadProps,
27
28
  __spreadValues
28
- } from "./chunk-6DND574L.js";
29
+ } from "./chunk-4CSLH7II.js";
29
30
 
30
31
  // packages/dts-plugin/src/core/lib/typeScriptCompiler.ts
31
32
  import { ensureDirSync, writeFileSync, existsSync } from "fs-extra";
@@ -595,7 +596,6 @@ function getEffectiveRootDir(parsedCommandLine) {
595
596
  }
596
597
  __name(getEffectiveRootDir, "getEffectiveRootDir");
597
598
  var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
598
- var _a2;
599
599
  const resolvedTsConfigPath = resolve2(context, tsConfigPath);
600
600
  const readResult = typescript.readConfigFile(resolvedTsConfigPath, typescript.sys.readFile);
601
601
  if (readResult.error) {
@@ -614,9 +614,11 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
614
614
  };
615
615
  rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
616
616
  rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
617
- (_a2 = rawTsConfigJson.compilerOptions) == null ? true : delete _a2.paths;
617
+ const _a2 = rawTsConfigJson.compilerOptions || {}, { paths, baseUrl } = _a2, restCompilerOptions = __objRest(_a2, ["paths", "baseUrl"]);
618
+ rawTsConfigJson.compilerOptions = restCompilerOptions;
618
619
  const filesToCompile = [
619
620
  ...Object.values(mapComponentsToExpose),
621
+ ...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts")),
620
622
  ...additionalFilesToCompile
621
623
  ];
622
624
  rawTsConfigJson.include = [];
@@ -4,7 +4,7 @@ import {
4
4
  exposeRpc,
5
5
  getDTSManagerConstructor,
6
6
  isDebugMode
7
- } from "./chunk-7AXI7WOP.js";
7
+ } from "./chunk-I4MF3J7G.js";
8
8
  import {
9
9
  __async,
10
10
  __export,
@@ -12,7 +12,7 @@ import {
12
12
  __publicField,
13
13
  __spreadProps,
14
14
  __spreadValues
15
- } from "./chunk-6DND574L.js";
15
+ } from "./chunk-4CSLH7II.js";
16
16
 
17
17
  // packages/dts-plugin/src/core/lib/DtsWorker.ts
18
18
  import path from "path";
@@ -8,7 +8,7 @@ import {
8
8
  __async,
9
9
  __name,
10
10
  __publicField
11
- } from "./chunk-6DND574L.js";
11
+ } from "./chunk-4CSLH7II.js";
12
12
 
13
13
  // packages/dts-plugin/src/server/utils/log.ts
14
14
  import { logger } from "@module-federation/sdk";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __name
3
- } from "./chunk-6DND574L.js";
3
+ } from "./chunk-4CSLH7II.js";
4
4
 
5
5
  // packages/dts-plugin/src/dev-worker/utils.ts
6
6
  var DEFAULT_LOCAL_IPS = [
package/dist/esm/core.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  consumeTypes,
4
4
  generateTypesInChildProcess,
5
5
  rpc_exports
6
- } from "./chunk-VFGWGY54.js";
6
+ } from "./chunk-IW3CXUPB.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-7AXI7WOP.js";
23
- import "./chunk-HKRTV6ZH.js";
24
- import "./chunk-6DND574L.js";
22
+ } from "./chunk-I4MF3J7G.js";
23
+ import "./chunk-MY3H5SQO.js";
24
+ import "./chunk-4CSLH7II.js";
25
25
  export {
26
26
  DTSManager,
27
27
  DtsWorker,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getIpFromEntry
3
- } from "./chunk-XKCIYRDL.js";
3
+ } from "./chunk-QAUALHAU.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-6DND574L.js";
10
+ } from "./chunk-4CSLH7II.js";
11
11
 
12
12
  // packages/dts-plugin/src/server/createWebsocket.ts
13
13
  import WebSocket from "isomorphic-ws";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rpc_exports
3
- } from "./chunk-VFGWGY54.js";
3
+ } from "./chunk-IW3CXUPB.js";
4
4
  import {
5
5
  ModuleFederationDevServer,
6
6
  createKoaServer,
@@ -9,21 +9,21 @@ import {
9
9
  retrieveMfTypesPath,
10
10
  retrieveRemoteConfig,
11
11
  retrieveTypesZipPath
12
- } from "./chunk-7AXI7WOP.js";
12
+ } from "./chunk-I4MF3J7G.js";
13
13
  import {
14
14
  fileLog,
15
15
  getIPV4
16
- } from "./chunk-HKRTV6ZH.js";
16
+ } from "./chunk-MY3H5SQO.js";
17
17
  import {
18
18
  getIpFromEntry
19
- } from "./chunk-XKCIYRDL.js";
19
+ } from "./chunk-QAUALHAU.js";
20
20
  import {
21
21
  DEFAULT_TAR_NAME,
22
22
  UpdateKind,
23
23
  UpdateMode,
24
24
  __async,
25
25
  __name
26
- } from "./chunk-6DND574L.js";
26
+ } from "./chunk-4CSLH7II.js";
27
27
 
28
28
  // packages/dts-plugin/src/dev-worker/forkDevWorker.ts
29
29
  import { decodeName } from "@module-federation/sdk";
@@ -2,12 +2,12 @@ import {
2
2
  RpcGMCallTypes,
3
3
  exposeRpc,
4
4
  generateTypes
5
- } from "./chunk-7AXI7WOP.js";
6
- import "./chunk-HKRTV6ZH.js";
5
+ } from "./chunk-I4MF3J7G.js";
6
+ import "./chunk-MY3H5SQO.js";
7
7
  import {
8
8
  __async,
9
9
  __name
10
- } from "./chunk-6DND574L.js";
10
+ } from "./chunk-4CSLH7II.js";
11
11
 
12
12
  // packages/dts-plugin/src/core/lib/forkGenerateDts.ts
13
13
  function forkGenerateDts(options) {
package/dist/esm/index.js CHANGED
@@ -2,17 +2,17 @@ import {
2
2
  consumeTypes,
3
3
  generateTypesInChildProcess,
4
4
  rpc_exports
5
- } from "./chunk-VFGWGY54.js";
5
+ } from "./chunk-IW3CXUPB.js";
6
6
  import {
7
7
  cloneDeepOptions,
8
8
  generateTypes,
9
9
  isTSProject,
10
10
  retrieveTypesAssetsInfo,
11
11
  validateOptions
12
- } from "./chunk-7AXI7WOP.js";
12
+ } from "./chunk-I4MF3J7G.js";
13
13
  import {
14
14
  getIPV4
15
- } from "./chunk-HKRTV6ZH.js";
15
+ } from "./chunk-MY3H5SQO.js";
16
16
  import {
17
17
  WEB_CLIENT_OPTIONS_IDENTIFIER,
18
18
  __async,
@@ -20,7 +20,7 @@ import {
20
20
  __publicField,
21
21
  __spreadProps,
22
22
  __spreadValues
23
- } from "./chunk-6DND574L.js";
23
+ } from "./chunk-4CSLH7II.js";
24
24
 
25
25
  // packages/dts-plugin/src/plugins/DevPlugin.ts
26
26
  import fs from "fs-extra";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  Broker,
3
3
  fileLog
4
- } from "./chunk-HKRTV6ZH.js";
4
+ } from "./chunk-MY3H5SQO.js";
5
5
  import {
6
6
  __async,
7
7
  __name
8
- } from "./chunk-6DND574L.js";
8
+ } from "./chunk-4CSLH7II.js";
9
9
 
10
10
  // packages/dts-plugin/src/server/broker/startBroker.ts
11
11
  var broker;
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
24
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
25
37
  var __export = (target, all) => {
26
38
  for (var name in all)
27
39
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -2194,7 +2206,6 @@ function getEffectiveRootDir(parsedCommandLine) {
2194
2206
  }
2195
2207
  __name(getEffectiveRootDir, "getEffectiveRootDir");
2196
2208
  var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
2197
- var _a3;
2198
2209
  const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
2199
2210
  const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
2200
2211
  if (readResult.error) {
@@ -2213,9 +2224,11 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
2213
2224
  };
2214
2225
  rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
2215
2226
  rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
2216
- (_a3 = rawTsConfigJson.compilerOptions) == null ? true : delete _a3.paths;
2227
+ const _a3 = rawTsConfigJson.compilerOptions || {}, { paths, baseUrl } = _a3, restCompilerOptions = __objRest(_a3, ["paths", "baseUrl"]);
2228
+ rawTsConfigJson.compilerOptions = restCompilerOptions;
2217
2229
  const filesToCompile = [
2218
2230
  ...Object.values(mapComponentsToExpose),
2231
+ ...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts")),
2219
2232
  ...additionalFilesToCompile
2220
2233
  ];
2221
2234
  rawTsConfigJson.include = [];
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
24
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
25
37
  var __export = (target, all) => {
26
38
  for (var name in all)
27
39
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -189,7 +201,6 @@ function getEffectiveRootDir(parsedCommandLine) {
189
201
  }
190
202
  __name(getEffectiveRootDir, "getEffectiveRootDir");
191
203
  var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
192
- var _a2;
193
204
  const resolvedTsConfigPath = (0, import_path.resolve)(context, tsConfigPath);
194
205
  const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
195
206
  if (readResult.error) {
@@ -208,9 +219,11 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
208
219
  };
209
220
  rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
210
221
  rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
211
- (_a2 = rawTsConfigJson.compilerOptions) == null ? true : delete _a2.paths;
222
+ const _a2 = rawTsConfigJson.compilerOptions || {}, { paths, baseUrl } = _a2, restCompilerOptions = __objRest(_a2, ["paths", "baseUrl"]);
223
+ rawTsConfigJson.compilerOptions = restCompilerOptions;
212
224
  const filesToCompile = [
213
225
  ...Object.values(mapComponentsToExpose),
226
+ ...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts")),
214
227
  ...additionalFilesToCompile
215
228
  ];
216
229
  rawTsConfigJson.include = [];
package/dist/index.js CHANGED
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
24
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
25
37
  var __export = (target, all) => {
26
38
  for (var name in all)
27
39
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -1761,7 +1773,6 @@ function getEffectiveRootDir(parsedCommandLine) {
1761
1773
  }
1762
1774
  __name(getEffectiveRootDir, "getEffectiveRootDir");
1763
1775
  var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
1764
- var _a4;
1765
1776
  const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
1766
1777
  const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
1767
1778
  if (readResult.error) {
@@ -1780,9 +1791,11 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
1780
1791
  };
1781
1792
  rawTsConfigJson.compilerOptions = rawTsConfigJson.compilerOptions || {};
1782
1793
  rawTsConfigJson.compilerOptions = __spreadValues(__spreadValues({}, rawTsConfigJson.compilerOptions), defaultCompilerOptions);
1783
- (_a4 = rawTsConfigJson.compilerOptions) == null ? true : delete _a4.paths;
1794
+ const _a4 = rawTsConfigJson.compilerOptions || {}, { paths, baseUrl } = _a4, restCompilerOptions = __objRest(_a4, ["paths", "baseUrl"]);
1795
+ rawTsConfigJson.compilerOptions = restCompilerOptions;
1784
1796
  const filesToCompile = [
1785
1797
  ...Object.values(mapComponentsToExpose),
1798
+ ...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts")),
1786
1799
  ...additionalFilesToCompile
1787
1800
  ];
1788
1801
  rawTsConfigJson.include = [];
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -55,9 +55,9 @@
55
55
  "log4js": "6.9.1",
56
56
  "node-schedule": "2.1.1",
57
57
  "ws": "8.17.1",
58
- "@module-federation/sdk": "0.3.1",
59
- "@module-federation/managers": "0.3.1",
60
- "@module-federation/third-party-dts-extractor": "0.3.1"
58
+ "@module-federation/sdk": "0.3.2",
59
+ "@module-federation/managers": "0.3.2",
60
+ "@module-federation/third-party-dts-extractor": "0.3.2"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/ws": "8.5.10",
@@ -66,7 +66,7 @@
66
66
  "vue": "^3.4.29",
67
67
  "@vue/tsconfig": "^0.5.1",
68
68
  "vue-tsc": "^2.0.26",
69
- "@module-federation/runtime": "0.3.1"
69
+ "@module-federation/runtime": "0.3.2"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "typescript": "^4.9.0 || ^5.0.0",