@module-federation/dts-plugin 0.1.12 → 0.1.14

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,28 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 0.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [103b2b8]
8
+ - @module-federation/sdk@0.1.14
9
+ - @module-federation/managers@0.1.14
10
+ - @module-federation/third-party-dts-extractor@0.1.14
11
+
12
+ ## 0.1.13
13
+
14
+ ### Patch Changes
15
+
16
+ - 2e52e51: Build zip url for json ext as well
17
+ - 677958c: fix: tsup configuration
18
+ - Updated dependencies [2e52e51]
19
+ - Updated dependencies [0113b81]
20
+ - Updated dependencies [677958c]
21
+ - Updated dependencies [2e52e51]
22
+ - @module-federation/managers@0.1.13
23
+ - @module-federation/third-party-dts-extractor@0.1.13
24
+ - @module-federation/sdk@0.1.13
25
+
3
26
  ## 0.1.12
4
27
 
5
28
  ### Patch Changes
package/dist/core.js CHANGED
@@ -999,7 +999,7 @@ var downloadTypesArchive = (hostOptions) => {
999
999
  );
1000
1000
  while (retries++ < hostOptions.maxRetries) {
1001
1001
  try {
1002
- const url = replaceLocalhost(fileToDownload);
1002
+ const url = fileToDownload;
1003
1003
  const response = await import_axios.default.get(url, { responseType: "arraybuffer" }).catch(downloadErrorLogger(destinationFolder, url));
1004
1004
  const zip = new import_adm_zip.default(Buffer.from(response.data));
1005
1005
  zip.extractAllTo(destinationPath, true);
@@ -1036,9 +1036,6 @@ var defaultOptions = {
1036
1036
  };
1037
1037
  var buildZipUrl = (hostOptions, url) => {
1038
1038
  const remoteUrl = new URL(url);
1039
- if (remoteUrl.href.includes(import_sdk3.MANIFEST_EXT)) {
1040
- return void 0;
1041
- }
1042
1039
  const pathnameWithoutEntry = remoteUrl.pathname.split("/").slice(0, -1).join("/");
1043
1040
  remoteUrl.pathname = `${pathnameWithoutEntry}/${hostOptions.remoteTypesFolder}.zip`;
1044
1041
  return remoteUrl.href;
@@ -1218,7 +1215,7 @@ var DTSManager = class {
1218
1215
  if (!remoteInfo.url.includes(import_sdk4.MANIFEST_EXT)) {
1219
1216
  return remoteInfo;
1220
1217
  }
1221
- const url = replaceLocalhost(remoteInfo.url);
1218
+ const url = remoteInfo.url;
1222
1219
  const res = await (0, import_axios2.default)({
1223
1220
  method: "get",
1224
1221
  url
@@ -1233,7 +1230,10 @@ var DTSManager = class {
1233
1230
  }
1234
1231
  return u;
1235
1232
  };
1236
- const publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1233
+ let publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1234
+ if (publicPath === "auto") {
1235
+ publicPath = (0, import_sdk4.inferAutoPublicPath)(remoteInfo.url);
1236
+ }
1237
1237
  remoteInfo.zipUrl = new URL(
1238
1238
  import_path3.default.join(addProtocol(publicPath), manifestJson.metaData.types.zip)
1239
1239
  ).href;
@@ -1268,7 +1268,7 @@ var DTSManager = class {
1268
1268
  return;
1269
1269
  }
1270
1270
  try {
1271
- const url = replaceLocalhost(apiTypeUrl);
1271
+ const url = apiTypeUrl;
1272
1272
  const res = await import_axios2.default.get(url);
1273
1273
  let apiTypeFile = res.data;
1274
1274
  apiTypeFile = apiTypeFile.replaceAll(
@@ -1488,9 +1488,6 @@ function retrieveTypesAssetsInfo(options) {
1488
1488
  };
1489
1489
  }
1490
1490
  }
1491
- function replaceLocalhost(url) {
1492
- return url.replace("localhost", "127.0.0.1");
1493
- }
1494
1491
  var isTSProject = (dtsOptions, context = process.cwd()) => {
1495
1492
  if (dtsOptions === false) {
1496
1493
  return false;
@@ -1564,7 +1564,7 @@ var downloadTypesArchive = (hostOptions) => {
1564
1564
  );
1565
1565
  while (retries++ < hostOptions.maxRetries) {
1566
1566
  try {
1567
- const url = replaceLocalhost(fileToDownload);
1567
+ const url = fileToDownload;
1568
1568
  const response = await import_axios.default.get(url, { responseType: "arraybuffer" }).catch(downloadErrorLogger(destinationFolder, url));
1569
1569
  const zip = new import_adm_zip.default(Buffer.from(response.data));
1570
1570
  zip.extractAllTo(destinationPath, true);
@@ -1601,9 +1601,6 @@ var defaultOptions = {
1601
1601
  };
1602
1602
  var buildZipUrl = (hostOptions, url) => {
1603
1603
  const remoteUrl = new URL(url);
1604
- if (remoteUrl.href.includes(import_sdk3.MANIFEST_EXT)) {
1605
- return void 0;
1606
- }
1607
1604
  const pathnameWithoutEntry = remoteUrl.pathname.split("/").slice(0, -1).join("/");
1608
1605
  remoteUrl.pathname = `${pathnameWithoutEntry}/${hostOptions.remoteTypesFolder}.zip`;
1609
1606
  return remoteUrl.href;
@@ -1778,7 +1775,7 @@ var DTSManager = class {
1778
1775
  if (!remoteInfo.url.includes(import_sdk4.MANIFEST_EXT)) {
1779
1776
  return remoteInfo;
1780
1777
  }
1781
- const url = replaceLocalhost(remoteInfo.url);
1778
+ const url = remoteInfo.url;
1782
1779
  const res = await (0, import_axios2.default)({
1783
1780
  method: "get",
1784
1781
  url
@@ -1793,7 +1790,10 @@ var DTSManager = class {
1793
1790
  }
1794
1791
  return u;
1795
1792
  };
1796
- const publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1793
+ let publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1794
+ if (publicPath === "auto") {
1795
+ publicPath = (0, import_sdk4.inferAutoPublicPath)(remoteInfo.url);
1796
+ }
1797
1797
  remoteInfo.zipUrl = new URL(
1798
1798
  import_path4.default.join(addProtocol(publicPath), manifestJson.metaData.types.zip)
1799
1799
  ).href;
@@ -1828,7 +1828,7 @@ var DTSManager = class {
1828
1828
  return;
1829
1829
  }
1830
1830
  try {
1831
- const url = replaceLocalhost(apiTypeUrl);
1831
+ const url = apiTypeUrl;
1832
1832
  const res = await import_axios2.default.get(url);
1833
1833
  let apiTypeFile = res.data;
1834
1834
  apiTypeFile = apiTypeFile.replaceAll(
@@ -2013,9 +2013,6 @@ var validateOptions = (options) => {
2013
2013
  throw new Error("moduleFederationConfig is required");
2014
2014
  }
2015
2015
  };
2016
- function replaceLocalhost(url) {
2017
- return url.replace("localhost", "127.0.0.1");
2018
- }
2019
2016
 
2020
2017
  // packages/dts-plugin/src/core/configurations/remotePlugin.ts
2021
2018
  var defaultOptions2 = {
@@ -549,9 +549,6 @@ var defaultOptions2 = {
549
549
  };
550
550
  var buildZipUrl = (hostOptions, url) => {
551
551
  const remoteUrl = new URL(url);
552
- if (remoteUrl.href.includes(import_sdk3.MANIFEST_EXT)) {
553
- return void 0;
554
- }
555
552
  const pathnameWithoutEntry = remoteUrl.pathname.split("/").slice(0, -1).join("/");
556
553
  remoteUrl.pathname = `${pathnameWithoutEntry}/${hostOptions.remoteTypesFolder}.zip`;
557
554
  return remoteUrl.href;
@@ -1223,7 +1220,7 @@ var downloadTypesArchive = (hostOptions) => {
1223
1220
  );
1224
1221
  while (retries++ < hostOptions.maxRetries) {
1225
1222
  try {
1226
- const url = replaceLocalhost(fileToDownload);
1223
+ const url = fileToDownload;
1227
1224
  const response = await import_axios.default.get(url, { responseType: "arraybuffer" }).catch(downloadErrorLogger(destinationFolder, url));
1228
1225
  const zip = new import_adm_zip.default(Buffer.from(response.data));
1229
1226
  zip.extractAllTo(destinationPath, true);
@@ -1356,7 +1353,7 @@ var DTSManager = class {
1356
1353
  if (!remoteInfo.url.includes(import_sdk4.MANIFEST_EXT)) {
1357
1354
  return remoteInfo;
1358
1355
  }
1359
- const url = replaceLocalhost(remoteInfo.url);
1356
+ const url = remoteInfo.url;
1360
1357
  const res = await (0, import_axios2.default)({
1361
1358
  method: "get",
1362
1359
  url
@@ -1371,7 +1368,10 @@ var DTSManager = class {
1371
1368
  }
1372
1369
  return u;
1373
1370
  };
1374
- const publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1371
+ let publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1372
+ if (publicPath === "auto") {
1373
+ publicPath = (0, import_sdk4.inferAutoPublicPath)(remoteInfo.url);
1374
+ }
1375
1375
  remoteInfo.zipUrl = new URL(
1376
1376
  import_path4.default.join(addProtocol(publicPath), manifestJson.metaData.types.zip)
1377
1377
  ).href;
@@ -1406,7 +1406,7 @@ var DTSManager = class {
1406
1406
  return;
1407
1407
  }
1408
1408
  try {
1409
- const url = replaceLocalhost(apiTypeUrl);
1409
+ const url = apiTypeUrl;
1410
1410
  const res = await import_axios2.default.get(url);
1411
1411
  let apiTypeFile = res.data;
1412
1412
  apiTypeFile = apiTypeFile.replaceAll(
@@ -1591,9 +1591,6 @@ var validateOptions = (options) => {
1591
1591
  throw new Error("moduleFederationConfig is required");
1592
1592
  }
1593
1593
  };
1594
- function replaceLocalhost(url) {
1595
- return url.replace("localhost", "127.0.0.1");
1596
- }
1597
1594
 
1598
1595
  // packages/dts-plugin/src/core/lib/generateTypes.ts
1599
1596
  async function generateTypes(options) {
package/dist/index.js CHANGED
@@ -994,7 +994,7 @@ var downloadTypesArchive = (hostOptions) => {
994
994
  );
995
995
  while (retries++ < hostOptions.maxRetries) {
996
996
  try {
997
- const url = replaceLocalhost(fileToDownload);
997
+ const url = fileToDownload;
998
998
  const response = await import_axios.default.get(url, { responseType: "arraybuffer" }).catch(downloadErrorLogger(destinationFolder, url));
999
999
  const zip = new import_adm_zip.default(Buffer.from(response.data));
1000
1000
  zip.extractAllTo(destinationPath, true);
@@ -1031,9 +1031,6 @@ var defaultOptions = {
1031
1031
  };
1032
1032
  var buildZipUrl = (hostOptions, url) => {
1033
1033
  const remoteUrl = new URL(url);
1034
- if (remoteUrl.href.includes(import_sdk3.MANIFEST_EXT)) {
1035
- return void 0;
1036
- }
1037
1034
  const pathnameWithoutEntry = remoteUrl.pathname.split("/").slice(0, -1).join("/");
1038
1035
  remoteUrl.pathname = `${pathnameWithoutEntry}/${hostOptions.remoteTypesFolder}.zip`;
1039
1036
  return remoteUrl.href;
@@ -1208,7 +1205,7 @@ var DTSManager = class {
1208
1205
  if (!remoteInfo.url.includes(import_sdk4.MANIFEST_EXT)) {
1209
1206
  return remoteInfo;
1210
1207
  }
1211
- const url = replaceLocalhost(remoteInfo.url);
1208
+ const url = remoteInfo.url;
1212
1209
  const res = await (0, import_axios2.default)({
1213
1210
  method: "get",
1214
1211
  url
@@ -1223,7 +1220,10 @@ var DTSManager = class {
1223
1220
  }
1224
1221
  return u;
1225
1222
  };
1226
- const publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1223
+ let publicPath = "publicPath" in manifestJson.metaData ? manifestJson.metaData.publicPath : new Function(manifestJson.metaData.getPublicPath)();
1224
+ if (publicPath === "auto") {
1225
+ publicPath = (0, import_sdk4.inferAutoPublicPath)(remoteInfo.url);
1226
+ }
1227
1227
  remoteInfo.zipUrl = new URL(
1228
1228
  import_path3.default.join(addProtocol(publicPath), manifestJson.metaData.types.zip)
1229
1229
  ).href;
@@ -1258,7 +1258,7 @@ var DTSManager = class {
1258
1258
  return;
1259
1259
  }
1260
1260
  try {
1261
- const url = replaceLocalhost(apiTypeUrl);
1261
+ const url = apiTypeUrl;
1262
1262
  const res = await import_axios2.default.get(url);
1263
1263
  let apiTypeFile = res.data;
1264
1264
  apiTypeFile = apiTypeFile.replaceAll(
@@ -1478,9 +1478,6 @@ function retrieveTypesAssetsInfo(options) {
1478
1478
  };
1479
1479
  }
1480
1480
  }
1481
- function replaceLocalhost(url) {
1482
- return url.replace("localhost", "127.0.0.1");
1483
- }
1484
1481
  var isTSProject = (dtsOptions, context = process.cwd()) => {
1485
1482
  if (dtsOptions === false) {
1486
1483
  return false;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
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.1.12",
3
+ "version": "0.1.14",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -47,9 +47,9 @@
47
47
  "log4js": "6.9.1",
48
48
  "node-schedule": "2.1.1",
49
49
  "ws": "8.5.0",
50
- "@module-federation/sdk": "0.1.12",
51
- "@module-federation/managers": "0.1.12",
52
- "@module-federation/third-party-dts-extractor": "0.1.12"
50
+ "@module-federation/sdk": "0.1.14",
51
+ "@module-federation/managers": "0.1.14",
52
+ "@module-federation/third-party-dts-extractor": "0.1.14"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/ws": "8.5.3",