@module-federation/dts-plugin 0.11.2 → 0.11.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,27 @@
1
1
  # @module-federation/dts-plugin
2
2
 
3
+ ## 0.11.4
4
+
5
+ ### Patch Changes
6
+
7
+ - ed8bda3: remove query strings from exposed modules to fix tsc resolves
8
+ - Updated dependencies [64a2bc1]
9
+ - Updated dependencies [c14842f]
10
+ - @module-federation/sdk@0.11.4
11
+ - @module-federation/managers@0.11.4
12
+ - @module-federation/third-party-dts-extractor@0.11.4
13
+ - @module-federation/error-codes@0.11.4
14
+
15
+ ## 0.11.3
16
+
17
+ ### Patch Changes
18
+
19
+ - e2c0a89: fix(dts-plugin): add recursive:true while generate types hit cache
20
+ - @module-federation/sdk@0.11.3
21
+ - @module-federation/managers@0.11.3
22
+ - @module-federation/third-party-dts-extractor@0.11.3
23
+ - @module-federation/error-codes@0.11.3
24
+
3
25
  ## 0.11.2
4
26
 
5
27
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -475,48 +475,62 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
475
475
  const zipContent = fs2.readFileSync(zipTypesPath);
476
476
  const zipOutputPath = path5.join(compiler.outputPath, zipPrefix, zipName);
477
477
  yield new Promise((resolve2, reject) => {
478
- compiler.outputFileSystem.mkdir(path5.dirname(zipOutputPath), (err) => {
479
- if (err && !isEEXIST(err)) {
480
- reject(err);
481
- } else {
482
- compiler.outputFileSystem.writeFile(
483
- zipOutputPath,
484
- // @ts-ignore
485
- zipContent,
486
- (writeErr) => {
487
- if (writeErr && !isEEXIST(writeErr)) {
488
- reject(writeErr);
489
- } else {
490
- resolve2();
478
+ compiler.outputFileSystem.mkdir(
479
+ path5.dirname(zipOutputPath),
480
+ {
481
+ recursive: true
482
+ },
483
+ // @ts-ignore type fixed in https://github.com/webpack/webpack/releases/tag/v5.91.0
484
+ (err) => {
485
+ if (err && !isEEXIST(err)) {
486
+ reject(err);
487
+ } else {
488
+ compiler.outputFileSystem.writeFile(
489
+ zipOutputPath,
490
+ // @ts-ignore
491
+ zipContent,
492
+ (writeErr) => {
493
+ if (writeErr && !isEEXIST(writeErr)) {
494
+ reject(writeErr);
495
+ } else {
496
+ resolve2();
497
+ }
491
498
  }
492
- }
493
- );
499
+ );
500
+ }
494
501
  }
495
- });
502
+ );
496
503
  });
497
504
  }
498
505
  if (apiTypesPath) {
499
506
  const apiContent = fs2.readFileSync(apiTypesPath);
500
507
  const apiOutputPath = path5.join(compiler.outputPath, zipPrefix, apiFileName);
501
508
  yield new Promise((resolve2, reject) => {
502
- compiler.outputFileSystem.mkdir(path5.dirname(apiOutputPath), (err) => {
503
- if (err && !isEEXIST(err)) {
504
- reject(err);
505
- } else {
506
- compiler.outputFileSystem.writeFile(
507
- apiOutputPath,
508
- // @ts-ignore
509
- apiContent,
510
- (writeErr) => {
511
- if (writeErr && !isEEXIST(writeErr)) {
512
- reject(writeErr);
513
- } else {
514
- resolve2();
509
+ compiler.outputFileSystem.mkdir(
510
+ path5.dirname(apiOutputPath),
511
+ {
512
+ recursive: true
513
+ },
514
+ // @ts-ignore type fixed in https://github.com/webpack/webpack/releases/tag/v5.91.0
515
+ (err) => {
516
+ if (err && !isEEXIST(err)) {
517
+ reject(err);
518
+ } else {
519
+ compiler.outputFileSystem.writeFile(
520
+ apiOutputPath,
521
+ // @ts-ignore
522
+ apiContent,
523
+ (writeErr) => {
524
+ if (writeErr && !isEEXIST(writeErr)) {
525
+ reject(writeErr);
526
+ } else {
527
+ resolve2();
528
+ }
515
529
  }
516
- }
517
- );
530
+ );
531
+ }
518
532
  }
519
- });
533
+ );
520
534
  });
521
535
  }
522
536
  callback();
@@ -565,7 +579,19 @@ var _DtsPlugin = class _DtsPlugin {
565
579
  }
566
580
  apply(compiler) {
567
581
  const { options } = this;
568
- const normalizedDtsOptions = normalizeDtsOptions(options, compiler.context);
582
+ const clonedOptions = __spreadValues({}, options);
583
+ if (options.exposes && typeof options.exposes === "object") {
584
+ const cleanedExposes = {};
585
+ Object.entries(options.exposes).forEach(([key, value]) => {
586
+ if (typeof value === "string") {
587
+ cleanedExposes[key] = value.split("?")[0];
588
+ } else {
589
+ cleanedExposes[key] = value;
590
+ }
591
+ });
592
+ clonedOptions.exposes = cleanedExposes;
593
+ }
594
+ const normalizedDtsOptions = normalizeDtsOptions(clonedOptions, compiler.context);
569
595
  if (typeof normalizedDtsOptions !== "object") {
570
596
  return;
571
597
  }
@@ -577,9 +603,9 @@ var _DtsPlugin = class _DtsPlugin {
577
603
  const generateTypesPromise = new Promise((resolve2) => {
578
604
  generateTypesPromiseResolve = resolve2;
579
605
  });
580
- new DevPlugin(options, normalizedDtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise).apply(compiler);
581
- new GenerateTypesPlugin(options, normalizedDtsOptions, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
582
- new ConsumeTypesPlugin(options, normalizedDtsOptions, fetchRemoteTypeUrlsResolve).apply(compiler);
606
+ new DevPlugin(clonedOptions, normalizedDtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise).apply(compiler);
607
+ new GenerateTypesPlugin(clonedOptions, normalizedDtsOptions, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
608
+ new ConsumeTypesPlugin(clonedOptions, normalizedDtsOptions, fetchRemoteTypeUrlsResolve).apply(compiler);
583
609
  }
584
610
  };
585
611
  __name(_DtsPlugin, "DtsPlugin");
package/dist/index.js CHANGED
@@ -2772,48 +2772,62 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
2772
2772
  const zipContent = import_fs4.default.readFileSync(zipTypesPath);
2773
2773
  const zipOutputPath = import_path10.default.join(compiler.outputPath, zipPrefix, zipName);
2774
2774
  yield new Promise((resolve5, reject) => {
2775
- compiler.outputFileSystem.mkdir(import_path10.default.dirname(zipOutputPath), (err) => {
2776
- if (err && !isEEXIST(err)) {
2777
- reject(err);
2778
- } else {
2779
- compiler.outputFileSystem.writeFile(
2780
- zipOutputPath,
2781
- // @ts-ignore
2782
- zipContent,
2783
- (writeErr) => {
2784
- if (writeErr && !isEEXIST(writeErr)) {
2785
- reject(writeErr);
2786
- } else {
2787
- resolve5();
2775
+ compiler.outputFileSystem.mkdir(
2776
+ import_path10.default.dirname(zipOutputPath),
2777
+ {
2778
+ recursive: true
2779
+ },
2780
+ // @ts-ignore type fixed in https://github.com/webpack/webpack/releases/tag/v5.91.0
2781
+ (err) => {
2782
+ if (err && !isEEXIST(err)) {
2783
+ reject(err);
2784
+ } else {
2785
+ compiler.outputFileSystem.writeFile(
2786
+ zipOutputPath,
2787
+ // @ts-ignore
2788
+ zipContent,
2789
+ (writeErr) => {
2790
+ if (writeErr && !isEEXIST(writeErr)) {
2791
+ reject(writeErr);
2792
+ } else {
2793
+ resolve5();
2794
+ }
2788
2795
  }
2789
- }
2790
- );
2796
+ );
2797
+ }
2791
2798
  }
2792
- });
2799
+ );
2793
2800
  });
2794
2801
  }
2795
2802
  if (apiTypesPath) {
2796
2803
  const apiContent = import_fs4.default.readFileSync(apiTypesPath);
2797
2804
  const apiOutputPath = import_path10.default.join(compiler.outputPath, zipPrefix, apiFileName);
2798
2805
  yield new Promise((resolve5, reject) => {
2799
- compiler.outputFileSystem.mkdir(import_path10.default.dirname(apiOutputPath), (err) => {
2800
- if (err && !isEEXIST(err)) {
2801
- reject(err);
2802
- } else {
2803
- compiler.outputFileSystem.writeFile(
2804
- apiOutputPath,
2805
- // @ts-ignore
2806
- apiContent,
2807
- (writeErr) => {
2808
- if (writeErr && !isEEXIST(writeErr)) {
2809
- reject(writeErr);
2810
- } else {
2811
- resolve5();
2806
+ compiler.outputFileSystem.mkdir(
2807
+ import_path10.default.dirname(apiOutputPath),
2808
+ {
2809
+ recursive: true
2810
+ },
2811
+ // @ts-ignore type fixed in https://github.com/webpack/webpack/releases/tag/v5.91.0
2812
+ (err) => {
2813
+ if (err && !isEEXIST(err)) {
2814
+ reject(err);
2815
+ } else {
2816
+ compiler.outputFileSystem.writeFile(
2817
+ apiOutputPath,
2818
+ // @ts-ignore
2819
+ apiContent,
2820
+ (writeErr) => {
2821
+ if (writeErr && !isEEXIST(writeErr)) {
2822
+ reject(writeErr);
2823
+ } else {
2824
+ resolve5();
2825
+ }
2812
2826
  }
2813
- }
2814
- );
2827
+ );
2828
+ }
2815
2829
  }
2816
- });
2830
+ );
2817
2831
  });
2818
2832
  }
2819
2833
  callback();
@@ -2862,7 +2876,19 @@ var _DtsPlugin = class _DtsPlugin {
2862
2876
  }
2863
2877
  apply(compiler) {
2864
2878
  const { options } = this;
2865
- const normalizedDtsOptions = normalizeDtsOptions(options, compiler.context);
2879
+ const clonedOptions = __spreadValues({}, options);
2880
+ if (options.exposes && typeof options.exposes === "object") {
2881
+ const cleanedExposes = {};
2882
+ Object.entries(options.exposes).forEach(([key, value]) => {
2883
+ if (typeof value === "string") {
2884
+ cleanedExposes[key] = value.split("?")[0];
2885
+ } else {
2886
+ cleanedExposes[key] = value;
2887
+ }
2888
+ });
2889
+ clonedOptions.exposes = cleanedExposes;
2890
+ }
2891
+ const normalizedDtsOptions = normalizeDtsOptions(clonedOptions, compiler.context);
2866
2892
  if (typeof normalizedDtsOptions !== "object") {
2867
2893
  return;
2868
2894
  }
@@ -2874,9 +2900,9 @@ var _DtsPlugin = class _DtsPlugin {
2874
2900
  const generateTypesPromise = new Promise((resolve5) => {
2875
2901
  generateTypesPromiseResolve = resolve5;
2876
2902
  });
2877
- new DevPlugin(options, normalizedDtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise).apply(compiler);
2878
- new GenerateTypesPlugin(options, normalizedDtsOptions, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
2879
- new ConsumeTypesPlugin(options, normalizedDtsOptions, fetchRemoteTypeUrlsResolve).apply(compiler);
2903
+ new DevPlugin(clonedOptions, normalizedDtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise).apply(compiler);
2904
+ new GenerateTypesPlugin(clonedOptions, normalizedDtsOptions, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler);
2905
+ new ConsumeTypesPlugin(clonedOptions, normalizedDtsOptions, fetchRemoteTypeUrlsResolve).apply(compiler);
2880
2906
  }
2881
2907
  };
2882
2908
  __name(_DtsPlugin, "DtsPlugin");
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/dts-plugin",
3
- "version": "0.11.2",
3
+ "version": "0.11.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.11.2",
3
+ "version": "0.11.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.11.2",
64
- "@module-federation/managers": "0.11.2",
65
- "@module-federation/third-party-dts-extractor": "0.11.2",
66
- "@module-federation/error-codes": "0.11.2"
63
+ "@module-federation/sdk": "0.11.4",
64
+ "@module-federation/managers": "0.11.4",
65
+ "@module-federation/third-party-dts-extractor": "0.11.4",
66
+ "@module-federation/error-codes": "0.11.4"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/ws": "8.5.12",
@@ -73,7 +73,7 @@
73
73
  "@vue/tsconfig": "^0.5.1",
74
74
  "vue-tsc": "^2.0.26",
75
75
  "rimraf": "~6.0.1",
76
- "@module-federation/runtime": "0.11.2"
76
+ "@module-federation/runtime": "0.11.4"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "typescript": "^4.9.0 || ^5.0.0",