@module-federation/dts-plugin 0.6.5 → 0.6.7

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,24 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 0.6.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 0216364: fix(dts-plugin): ignore .vue ext
8
+ - Updated dependencies [9e32644]
9
+ - @module-federation/sdk@0.6.7
10
+ - @module-federation/managers@0.6.7
11
+ - @module-federation/third-party-dts-extractor@0.6.7
12
+
13
+ ## 0.6.6
14
+
15
+ ### Patch Changes
16
+
17
+ - 35aead4: fix(dts-plugin): zipName should add prefix if remoteEntry has it
18
+ - @module-federation/sdk@0.6.6
19
+ - @module-federation/managers@0.6.6
20
+ - @module-federation/third-party-dts-extractor@0.6.6
21
+
3
22
  ## 0.6.5
4
23
 
5
24
  ### Patch Changes
package/dist/core.d.mts CHANGED
@@ -13,6 +13,7 @@ declare const retrieveHostConfig: (options: HostOptions) => {
13
13
  declare function getDTSManagerConstructor(implementation?: string): typeof DTSManager;
14
14
  declare const validateOptions: (options: HostOptions) => void;
15
15
  declare function retrieveTypesAssetsInfo(options: RemoteOptions): {
16
+ zipPrefix: string;
16
17
  apiTypesPath: string;
17
18
  zipTypesPath: string;
18
19
  zipName: string;
package/dist/core.d.ts CHANGED
@@ -13,6 +13,7 @@ declare const retrieveHostConfig: (options: HostOptions) => {
13
13
  declare function getDTSManagerConstructor(implementation?: string): typeof DTSManager;
14
14
  declare const validateOptions: (options: HostOptions) => void;
15
15
  declare function retrieveTypesAssetsInfo(options: RemoteOptions): {
16
+ zipPrefix: string;
16
17
  apiTypesPath: string;
17
18
  zipTypesPath: string;
18
19
  zipName: string;
package/dist/core.js CHANGED
@@ -157,13 +157,17 @@ function writeTempTsConfig(tsConfig, context, name) {
157
157
  }
158
158
  __name(writeTempTsConfig, "writeTempTsConfig");
159
159
  var removeExt = /* @__PURE__ */ __name((f) => {
160
+ const vueExt = ".vue";
160
161
  const ext = (0, import_path.extname)(f);
162
+ if (ext === vueExt) {
163
+ return f;
164
+ }
161
165
  const regexPattern = new RegExp(`\\${ext}$`);
162
166
  return f.replace(regexPattern, "");
163
167
  }, "removeExt");
164
168
  function getExposeKey(options) {
165
169
  const { filePath, rootDir, outDir, mapExposeToEntry } = options;
166
- const relativeFilePath = removeExt((0, import_path.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), "")));
170
+ const relativeFilePath = (0, import_path.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), ""));
167
171
  return mapExposeToEntry[relativeFilePath];
168
172
  }
169
173
  __name(getExposeKey, "getExposeKey");
@@ -1629,12 +1633,15 @@ var validateOptions = /* @__PURE__ */ __name((options) => {
1629
1633
  }
1630
1634
  }, "validateOptions");
1631
1635
  function retrieveTypesAssetsInfo(options) {
1636
+ const { moduleFederationConfig } = options;
1632
1637
  let apiTypesPath = "";
1633
1638
  let zipTypesPath = "";
1639
+ let zipPrefix = "";
1634
1640
  try {
1635
1641
  const { tsConfig, remoteOptions, mapComponentsToExpose } = retrieveRemoteConfig(options);
1636
1642
  if (!Object.keys(mapComponentsToExpose).length) {
1637
1643
  return {
1644
+ zipPrefix,
1638
1645
  apiTypesPath,
1639
1646
  zipTypesPath,
1640
1647
  zipName: "",
@@ -1646,7 +1653,15 @@ function retrieveTypesAssetsInfo(options) {
1646
1653
  if (remoteOptions.generateAPITypes) {
1647
1654
  apiTypesPath = retrieveMfAPITypesPath(tsConfig, remoteOptions);
1648
1655
  }
1656
+ if (typeof moduleFederationConfig.manifest === "object" && moduleFederationConfig.manifest.filePath) {
1657
+ zipPrefix = moduleFederationConfig.manifest.filePath;
1658
+ } else if (typeof moduleFederationConfig.manifest === "object" && moduleFederationConfig.manifest.fileName) {
1659
+ zipPrefix = import_path4.default.dirname(moduleFederationConfig.manifest.fileName);
1660
+ } else if (moduleFederationConfig.filename) {
1661
+ zipPrefix = import_path4.default.dirname(moduleFederationConfig.filename);
1662
+ }
1649
1663
  return {
1664
+ zipPrefix,
1650
1665
  apiTypesPath,
1651
1666
  zipTypesPath,
1652
1667
  zipName: import_path4.default.basename(zipTypesPath),
@@ -1655,6 +1670,7 @@ function retrieveTypesAssetsInfo(options) {
1655
1670
  } catch (err) {
1656
1671
  console.error(import_ansi_colors2.default.red(`Unable to compile federated types, ${err}`));
1657
1672
  return {
1673
+ zipPrefix,
1658
1674
  apiTypesPath: "",
1659
1675
  zipTypesPath: "",
1660
1676
  zipName: "",
@@ -54,13 +54,17 @@ function writeTempTsConfig(tsConfig, context, name) {
54
54
  }
55
55
  __name(writeTempTsConfig, "writeTempTsConfig");
56
56
  var removeExt = /* @__PURE__ */ __name((f) => {
57
+ const vueExt = ".vue";
57
58
  const ext = extname(f);
59
+ if (ext === vueExt) {
60
+ return f;
61
+ }
58
62
  const regexPattern = new RegExp(`\\${ext}$`);
59
63
  return f.replace(regexPattern, "");
60
64
  }, "removeExt");
61
65
  function getExposeKey(options) {
62
66
  const { filePath, rootDir, outDir, mapExposeToEntry } = options;
63
- const relativeFilePath = removeExt(relative(outDir, filePath.replace(new RegExp(`\\.d.ts$`), "")));
67
+ const relativeFilePath = relative(outDir, filePath.replace(new RegExp(`\\.d.ts$`), ""));
64
68
  return mapExposeToEntry[relativeFilePath];
65
69
  }
66
70
  __name(getExposeKey, "getExposeKey");
@@ -1134,12 +1138,15 @@ var validateOptions = /* @__PURE__ */ __name((options) => {
1134
1138
  }
1135
1139
  }, "validateOptions");
1136
1140
  function retrieveTypesAssetsInfo(options) {
1141
+ const { moduleFederationConfig } = options;
1137
1142
  let apiTypesPath = "";
1138
1143
  let zipTypesPath = "";
1144
+ let zipPrefix = "";
1139
1145
  try {
1140
1146
  const { tsConfig, remoteOptions, mapComponentsToExpose } = retrieveRemoteConfig(options);
1141
1147
  if (!Object.keys(mapComponentsToExpose).length) {
1142
1148
  return {
1149
+ zipPrefix,
1143
1150
  apiTypesPath,
1144
1151
  zipTypesPath,
1145
1152
  zipName: "",
@@ -1151,7 +1158,15 @@ function retrieveTypesAssetsInfo(options) {
1151
1158
  if (remoteOptions.generateAPITypes) {
1152
1159
  apiTypesPath = retrieveMfAPITypesPath(tsConfig, remoteOptions);
1153
1160
  }
1161
+ if (typeof moduleFederationConfig.manifest === "object" && moduleFederationConfig.manifest.filePath) {
1162
+ zipPrefix = moduleFederationConfig.manifest.filePath;
1163
+ } else if (typeof moduleFederationConfig.manifest === "object" && moduleFederationConfig.manifest.fileName) {
1164
+ zipPrefix = path3.dirname(moduleFederationConfig.manifest.fileName);
1165
+ } else if (moduleFederationConfig.filename) {
1166
+ zipPrefix = path3.dirname(moduleFederationConfig.filename);
1167
+ }
1154
1168
  return {
1169
+ zipPrefix,
1155
1170
  apiTypesPath,
1156
1171
  zipTypesPath,
1157
1172
  zipName: path3.basename(zipTypesPath),
@@ -1160,6 +1175,7 @@ function retrieveTypesAssetsInfo(options) {
1160
1175
  } catch (err) {
1161
1176
  console.error(ansiColors2.red(`Unable to compile federated types, ${err}`));
1162
1177
  return {
1178
+ zipPrefix,
1163
1179
  apiTypesPath: "",
1164
1180
  zipTypesPath: "",
1165
1181
  zipName: "",
@@ -4,7 +4,7 @@ import {
4
4
  exposeRpc,
5
5
  getDTSManagerConstructor,
6
6
  isDebugMode
7
- } from "./chunk-I4MF3J7G.js";
7
+ } from "./chunk-FRBMF2X6.js";
8
8
  import {
9
9
  __async,
10
10
  __export,
package/dist/esm/core.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  consumeTypes,
4
4
  generateTypesInChildProcess,
5
5
  rpc_exports
6
- } from "./chunk-IW3CXUPB.js";
6
+ } from "./chunk-QTWE2VJ4.js";
7
7
  import {
8
8
  DTSManager,
9
9
  HOST_API_TYPES_FILE_NAME,
@@ -19,7 +19,7 @@ import {
19
19
  retrieveTypesAssetsInfo,
20
20
  retrieveTypesZipPath,
21
21
  validateOptions
22
- } from "./chunk-I4MF3J7G.js";
22
+ } from "./chunk-FRBMF2X6.js";
23
23
  import "./chunk-MY3H5SQO.js";
24
24
  import "./chunk-4CSLH7II.js";
25
25
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rpc_exports
3
- } from "./chunk-IW3CXUPB.js";
3
+ } from "./chunk-QTWE2VJ4.js";
4
4
  import {
5
5
  ModuleFederationDevServer,
6
6
  createKoaServer,
@@ -9,7 +9,7 @@ import {
9
9
  retrieveMfTypesPath,
10
10
  retrieveRemoteConfig,
11
11
  retrieveTypesZipPath
12
- } from "./chunk-I4MF3J7G.js";
12
+ } from "./chunk-FRBMF2X6.js";
13
13
  import {
14
14
  fileLog,
15
15
  getIPV4
@@ -2,7 +2,7 @@ import {
2
2
  RpcGMCallTypes,
3
3
  exposeRpc,
4
4
  generateTypes
5
- } from "./chunk-I4MF3J7G.js";
5
+ } from "./chunk-FRBMF2X6.js";
6
6
  import "./chunk-MY3H5SQO.js";
7
7
  import {
8
8
  __async,
package/dist/esm/index.js CHANGED
@@ -2,14 +2,14 @@ import {
2
2
  consumeTypes,
3
3
  generateTypesInChildProcess,
4
4
  rpc_exports
5
- } from "./chunk-IW3CXUPB.js";
5
+ } from "./chunk-QTWE2VJ4.js";
6
6
  import {
7
7
  cloneDeepOptions,
8
8
  generateTypes,
9
9
  isTSProject,
10
10
  retrieveTypesAssetsInfo,
11
11
  validateOptions
12
- } from "./chunk-I4MF3J7G.js";
12
+ } from "./chunk-FRBMF2X6.js";
13
13
  import {
14
14
  getIPV4
15
15
  } from "./chunk-MY3H5SQO.js";
@@ -138,13 +138,17 @@ function writeTempTsConfig(tsConfig, context, name) {
138
138
  }
139
139
  __name(writeTempTsConfig, "writeTempTsConfig");
140
140
  var removeExt = /* @__PURE__ */ __name((f) => {
141
+ const vueExt = ".vue";
141
142
  const ext = (0, import_path.extname)(f);
143
+ if (ext === vueExt) {
144
+ return f;
145
+ }
142
146
  const regexPattern = new RegExp(`\\${ext}$`);
143
147
  return f.replace(regexPattern, "");
144
148
  }, "removeExt");
145
149
  function getExposeKey(options) {
146
150
  const { filePath, rootDir, outDir, mapExposeToEntry } = options;
147
- const relativeFilePath = removeExt((0, import_path.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), "")));
151
+ const relativeFilePath = (0, import_path.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), ""));
148
152
  return mapExposeToEntry[relativeFilePath];
149
153
  }
150
154
  __name(getExposeKey, "getExposeKey");
@@ -316,13 +316,17 @@ function writeTempTsConfig(tsConfig, context, name) {
316
316
  }
317
317
  __name(writeTempTsConfig, "writeTempTsConfig");
318
318
  var removeExt = /* @__PURE__ */ __name((f) => {
319
+ const vueExt = ".vue";
319
320
  const ext = (0, import_path2.extname)(f);
321
+ if (ext === vueExt) {
322
+ return f;
323
+ }
320
324
  const regexPattern = new RegExp(`\\${ext}$`);
321
325
  return f.replace(regexPattern, "");
322
326
  }, "removeExt");
323
327
  function getExposeKey(options) {
324
328
  const { filePath, rootDir, outDir, mapExposeToEntry } = options;
325
- const relativeFilePath = removeExt((0, import_path2.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), "")));
329
+ const relativeFilePath = (0, import_path2.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), ""));
326
330
  return mapExposeToEntry[relativeFilePath];
327
331
  }
328
332
  __name(getExposeKey, "getExposeKey");
package/dist/index.js CHANGED
@@ -151,13 +151,17 @@ function writeTempTsConfig(tsConfig, context, name) {
151
151
  }
152
152
  __name(writeTempTsConfig, "writeTempTsConfig");
153
153
  var removeExt = /* @__PURE__ */ __name((f) => {
154
+ const vueExt = ".vue";
154
155
  const ext = (0, import_path.extname)(f);
156
+ if (ext === vueExt) {
157
+ return f;
158
+ }
155
159
  const regexPattern = new RegExp(`\\${ext}$`);
156
160
  return f.replace(regexPattern, "");
157
161
  }, "removeExt");
158
162
  function getExposeKey(options) {
159
163
  const { filePath, rootDir, outDir, mapExposeToEntry } = options;
160
- const relativeFilePath = removeExt((0, import_path.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), "")));
164
+ const relativeFilePath = (0, import_path.relative)(outDir, filePath.replace(new RegExp(`\\.d.ts$`), ""));
161
165
  return mapExposeToEntry[relativeFilePath];
162
166
  }
163
167
  __name(getExposeKey, "getExposeKey");
@@ -1652,12 +1656,15 @@ var validateOptions = /* @__PURE__ */ __name((options) => {
1652
1656
  }
1653
1657
  }, "validateOptions");
1654
1658
  function retrieveTypesAssetsInfo(options) {
1659
+ const { moduleFederationConfig } = options;
1655
1660
  let apiTypesPath = "";
1656
1661
  let zipTypesPath = "";
1662
+ let zipPrefix = "";
1657
1663
  try {
1658
1664
  const { tsConfig, remoteOptions, mapComponentsToExpose } = retrieveRemoteConfig(options);
1659
1665
  if (!Object.keys(mapComponentsToExpose).length) {
1660
1666
  return {
1667
+ zipPrefix,
1661
1668
  apiTypesPath,
1662
1669
  zipTypesPath,
1663
1670
  zipName: "",
@@ -1669,7 +1676,15 @@ function retrieveTypesAssetsInfo(options) {
1669
1676
  if (remoteOptions.generateAPITypes) {
1670
1677
  apiTypesPath = retrieveMfAPITypesPath(tsConfig, remoteOptions);
1671
1678
  }
1679
+ if (typeof moduleFederationConfig.manifest === "object" && moduleFederationConfig.manifest.filePath) {
1680
+ zipPrefix = moduleFederationConfig.manifest.filePath;
1681
+ } else if (typeof moduleFederationConfig.manifest === "object" && moduleFederationConfig.manifest.fileName) {
1682
+ zipPrefix = import_path4.default.dirname(moduleFederationConfig.manifest.fileName);
1683
+ } else if (moduleFederationConfig.filename) {
1684
+ zipPrefix = import_path4.default.dirname(moduleFederationConfig.filename);
1685
+ }
1672
1686
  return {
1687
+ zipPrefix,
1673
1688
  apiTypesPath,
1674
1689
  zipTypesPath,
1675
1690
  zipName: import_path4.default.basename(zipTypesPath),
@@ -1678,6 +1693,7 @@ function retrieveTypesAssetsInfo(options) {
1678
1693
  } catch (err) {
1679
1694
  console.error(import_ansi_colors2.default.red(`Unable to compile federated types, ${err}`));
1680
1695
  return {
1696
+ zipPrefix,
1681
1697
  apiTypesPath: "",
1682
1698
  zipTypesPath: "",
1683
1699
  zipName: "",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
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.6.5",
3
+ "version": "0.6.7",
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.6.5",
59
- "@module-federation/managers": "0.6.5",
60
- "@module-federation/third-party-dts-extractor": "0.6.5"
58
+ "@module-federation/sdk": "0.6.7",
59
+ "@module-federation/managers": "0.6.7",
60
+ "@module-federation/third-party-dts-extractor": "0.6.7"
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.6.5"
69
+ "@module-federation/runtime": "0.6.7"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "typescript": "^4.9.0 || ^5.0.0",