@module-federation/dts-plugin 0.21.2 → 0.21.4

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,25 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 0.21.4
4
+
5
+ ### Patch Changes
6
+
7
+ - d729167: Support type generation for yarn pnp enviornments
8
+ - Updated dependencies [a50e068]
9
+ - @module-federation/sdk@0.21.4
10
+ - @module-federation/managers@0.21.4
11
+ - @module-federation/third-party-dts-extractor@0.21.4
12
+ - @module-federation/error-codes@0.21.4
13
+
14
+ ## 0.21.3
15
+
16
+ ### Patch Changes
17
+
18
+ - @module-federation/sdk@0.21.3
19
+ - @module-federation/managers@0.21.3
20
+ - @module-federation/third-party-dts-extractor@0.21.3
21
+ - @module-federation/error-codes@0.21.3
22
+
3
23
  ## 0.21.2
4
24
 
5
25
  ### Patch Changes
package/dist/core.js CHANGED
@@ -204,6 +204,25 @@ export { default } from './${relativePathToOutput}';`);
204
204
  cb(content);
205
205
  }
206
206
  }), "processTypesFile");
207
+ var getPMFromUserAgent = /* @__PURE__ */ __name(() => {
208
+ const userAgent = process.env["npm_config_user_agent"];
209
+ if (userAgent == null) {
210
+ return "null";
211
+ }
212
+ const name = userAgent.split("/")[0];
213
+ return name;
214
+ }, "getPMFromUserAgent");
215
+ var resolvePackageManagerExecutable = /* @__PURE__ */ __name(() => {
216
+ const pm = getPMFromUserAgent();
217
+ switch (pm) {
218
+ case "yarn":
219
+ return "yarn";
220
+ case "npm":
221
+ case "pnpm":
222
+ default:
223
+ return "npx";
224
+ }
225
+ }, "resolvePackageManagerExecutable");
207
226
  var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteOptions) => __async(void 0, null, function* () {
208
227
  var _a3, _b, _c, _d;
209
228
  if (!Object.keys(mapComponentsToExpose).length) {
@@ -219,7 +238,8 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
219
238
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
220
239
  });
221
240
  const execPromise = import_util.default.promisify(import_child_process.exec);
222
- const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
241
+ const pmExecutable = resolvePackageManagerExecutable();
242
+ const cmd = `${pmExecutable} ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
223
243
  try {
224
244
  yield execPromise(cmd, {
225
245
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -101,6 +101,25 @@ export { default } from './${relativePathToOutput}';`);
101
101
  cb(content);
102
102
  }
103
103
  }), "processTypesFile");
104
+ var getPMFromUserAgent = /* @__PURE__ */ __name(() => {
105
+ const userAgent = process.env["npm_config_user_agent"];
106
+ if (userAgent == null) {
107
+ return "null";
108
+ }
109
+ const name = userAgent.split("/")[0];
110
+ return name;
111
+ }, "getPMFromUserAgent");
112
+ var resolvePackageManagerExecutable = /* @__PURE__ */ __name(() => {
113
+ const pm = getPMFromUserAgent();
114
+ switch (pm) {
115
+ case "yarn":
116
+ return "yarn";
117
+ case "npm":
118
+ case "pnpm":
119
+ default:
120
+ return "npx";
121
+ }
122
+ }, "resolvePackageManagerExecutable");
104
123
  var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteOptions) => __async(void 0, null, function* () {
105
124
  var _a2, _b, _c, _d;
106
125
  if (!Object.keys(mapComponentsToExpose).length) {
@@ -116,7 +135,8 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
116
135
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
117
136
  });
118
137
  const execPromise = util.promisify(exec);
119
- const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
138
+ const pmExecutable = resolvePackageManagerExecutable();
139
+ const cmd = `${pmExecutable} ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
120
140
  try {
121
141
  yield execPromise(cmd, {
122
142
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -4,7 +4,7 @@ import {
4
4
  exposeRpc,
5
5
  getDTSManagerConstructor,
6
6
  isDebugMode
7
- } from "./chunk-ETMHGGQH.js";
7
+ } from "./chunk-JGZ276AJ.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-2GDMDG2O.js";
6
+ } from "./chunk-OEN3DGLA.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-ETMHGGQH.js";
22
+ } from "./chunk-JGZ276AJ.js";
23
23
  import "./chunk-WWV5RWOP.js";
24
24
  import "./chunk-647HGGGS.js";
25
25
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rpc_exports
3
- } from "./chunk-2GDMDG2O.js";
3
+ } from "./chunk-OEN3DGLA.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-ETMHGGQH.js";
12
+ } from "./chunk-JGZ276AJ.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-ETMHGGQH.js";
5
+ } from "./chunk-JGZ276AJ.js";
6
6
  import "./chunk-WWV5RWOP.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-2GDMDG2O.js";
5
+ } from "./chunk-OEN3DGLA.js";
6
6
  import {
7
7
  cloneDeepOptions,
8
8
  generateTypes,
9
9
  isTSProject,
10
10
  retrieveTypesAssetsInfo,
11
11
  validateOptions
12
- } from "./chunk-ETMHGGQH.js";
12
+ } from "./chunk-JGZ276AJ.js";
13
13
  import {
14
14
  getIPV4,
15
15
  logger
@@ -185,6 +185,25 @@ export { default } from './${relativePathToOutput}';`);
185
185
  cb(content);
186
186
  }
187
187
  }), "processTypesFile");
188
+ var getPMFromUserAgent = /* @__PURE__ */ __name(() => {
189
+ const userAgent = process.env["npm_config_user_agent"];
190
+ if (userAgent == null) {
191
+ return "null";
192
+ }
193
+ const name = userAgent.split("/")[0];
194
+ return name;
195
+ }, "getPMFromUserAgent");
196
+ var resolvePackageManagerExecutable = /* @__PURE__ */ __name(() => {
197
+ const pm = getPMFromUserAgent();
198
+ switch (pm) {
199
+ case "yarn":
200
+ return "yarn";
201
+ case "npm":
202
+ case "pnpm":
203
+ default:
204
+ return "npx";
205
+ }
206
+ }, "resolvePackageManagerExecutable");
188
207
  var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteOptions) => __async(void 0, null, function* () {
189
208
  var _a3, _b, _c, _d;
190
209
  if (!Object.keys(mapComponentsToExpose).length) {
@@ -200,7 +219,8 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
200
219
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
201
220
  });
202
221
  const execPromise = import_util.default.promisify(import_child_process.exec);
203
- const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
222
+ const pmExecutable = resolvePackageManagerExecutable();
223
+ const cmd = `${pmExecutable} ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
204
224
  try {
205
225
  yield execPromise(cmd, {
206
226
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
@@ -386,6 +386,25 @@ export { default } from './${relativePathToOutput}';`);
386
386
  cb(content);
387
387
  }
388
388
  }), "processTypesFile");
389
+ var getPMFromUserAgent = /* @__PURE__ */ __name(() => {
390
+ const userAgent = process.env["npm_config_user_agent"];
391
+ if (userAgent == null) {
392
+ return "null";
393
+ }
394
+ const name = userAgent.split("/")[0];
395
+ return name;
396
+ }, "getPMFromUserAgent");
397
+ var resolvePackageManagerExecutable = /* @__PURE__ */ __name(() => {
398
+ const pm = getPMFromUserAgent();
399
+ switch (pm) {
400
+ case "yarn":
401
+ return "yarn";
402
+ case "npm":
403
+ case "pnpm":
404
+ default:
405
+ return "npx";
406
+ }
407
+ }, "resolvePackageManagerExecutable");
389
408
  var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteOptions) => __async(void 0, null, function* () {
390
409
  var _a2, _b, _c, _d;
391
410
  if (!Object.keys(mapComponentsToExpose).length) {
@@ -401,7 +420,8 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
401
420
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
402
421
  });
403
422
  const execPromise = import_util.default.promisify(import_child_process.exec);
404
- const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
423
+ const pmExecutable = resolvePackageManagerExecutable();
424
+ const cmd = `${pmExecutable} ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
405
425
  try {
406
426
  yield execPromise(cmd, {
407
427
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
package/dist/index.js CHANGED
@@ -204,6 +204,25 @@ export { default } from './${relativePathToOutput}';`);
204
204
  cb(content);
205
205
  }
206
206
  }), "processTypesFile");
207
+ var getPMFromUserAgent = /* @__PURE__ */ __name(() => {
208
+ const userAgent = process.env["npm_config_user_agent"];
209
+ if (userAgent == null) {
210
+ return "null";
211
+ }
212
+ const name = userAgent.split("/")[0];
213
+ return name;
214
+ }, "getPMFromUserAgent");
215
+ var resolvePackageManagerExecutable = /* @__PURE__ */ __name(() => {
216
+ const pm = getPMFromUserAgent();
217
+ switch (pm) {
218
+ case "yarn":
219
+ return "yarn";
220
+ case "npm":
221
+ case "pnpm":
222
+ default:
223
+ return "npx";
224
+ }
225
+ }, "resolvePackageManagerExecutable");
207
226
  var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteOptions) => __async(void 0, null, function* () {
208
227
  var _a3, _b, _c, _d;
209
228
  if (!Object.keys(mapComponentsToExpose).length) {
@@ -219,7 +238,8 @@ var compileTs = /* @__PURE__ */ __name((mapComponentsToExpose, tsConfig, remoteO
219
238
  exclude: typeof remoteOptions.extractThirdParty === "object" ? remoteOptions.extractThirdParty.exclude : void 0
220
239
  });
221
240
  const execPromise = import_util.default.promisify(import_child_process.exec);
222
- const cmd = `npx ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
241
+ const pmExecutable = resolvePackageManagerExecutable();
242
+ const cmd = `${pmExecutable} ${remoteOptions.compilerInstance} --project '${tempTsConfigJsonPath}'`;
223
243
  try {
224
244
  yield execPromise(cmd, {
225
245
  cwd: typeof remoteOptions.moduleFederationConfig.dts !== "boolean" ? (_d = (_c = remoteOptions.moduleFederationConfig.dts) == null ? void 0 : _c.cwd) != null ? _d : void 0 : void 0
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.21.2",
3
+ "version": "0.21.4",
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.21.2",
3
+ "version": "0.21.4",
4
4
  "author": "hanric <hanric.zhang@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -60,10 +60,10 @@
60
60
  "log4js": "6.9.1",
61
61
  "node-schedule": "2.1.1",
62
62
  "ws": "8.18.0",
63
- "@module-federation/sdk": "0.21.2",
64
- "@module-federation/third-party-dts-extractor": "0.21.2",
65
- "@module-federation/managers": "0.21.2",
66
- "@module-federation/error-codes": "0.21.2"
63
+ "@module-federation/sdk": "0.21.4",
64
+ "@module-federation/third-party-dts-extractor": "0.21.4",
65
+ "@module-federation/error-codes": "0.21.4",
66
+ "@module-federation/managers": "0.21.4"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/ws": "8.5.12",
@@ -73,7 +73,7 @@
73
73
  "@vue/tsconfig": "^0.7.0",
74
74
  "vue-tsc": "^2.2.10",
75
75
  "rimraf": "~6.0.1",
76
- "@module-federation/runtime": "0.21.2"
76
+ "@module-federation/runtime": "0.21.4"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "typescript": "^4.9.0 || ^5.0.0",