@module-federation/native-federation-tests 0.4.1 → 0.5.0

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,4 +1,20 @@
1
- # [1.0.0-canary.1](https://github.com/module-federation/universe/compare/native-federation-tests-0.2.1...native-federation-tests-1.0.0-canary.1) (2023-11-06)
1
+ # [1.0.0-canary.1](https://github.com/module-federation/core/compare/native-federation-tests-0.2.1...native-federation-tests-1.0.0-canary.1) (2023-11-06)
2
+
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3d61613: perf(native-federation): extract archive only if needed
8
+
9
+ ### Patch Changes
10
+
11
+ - 677958c: fix: tsup configuration
12
+
13
+ ## 0.4.2
14
+
15
+ ### Patch Changes
16
+
17
+ - 671f64b: download retrieves count per file
2
18
 
3
19
  ## 0.4.1
4
20
 
@@ -26,50 +42,50 @@
26
42
 
27
43
  ### Bug Fixes
28
44
 
29
- - **deps:** update dependency antd to v4.24.11 ([#1029](https://github.com/module-federation/universe/issues/1029)) ([f9e64c0](https://github.com/module-federation/universe/commit/f9e64c04aa1e5802fdc0cdc8f07f2ee728c3ff1c))
30
- - **deps:** update dependency antd to v4.24.12 ([#1074](https://github.com/module-federation/universe/issues/1074)) ([46c25e0](https://github.com/module-federation/universe/commit/46c25e0a873ada88d2888a4e995bfa7133c01953))
31
- - **deps:** update dependency antd to v4.24.14 ([#1309](https://github.com/module-federation/universe/issues/1309)) ([d0a2314](https://github.com/module-federation/universe/commit/d0a231470e37dbad85a11df1f12695657ba3b984))
32
- - **deps:** update dependency axios to v1.5.0 ([#1275](https://github.com/module-federation/universe/issues/1275)) ([f163df1](https://github.com/module-federation/universe/commit/f163df1073740bf4218bb35ba57cea5dc409fe43))
33
- - **deps:** update dependency axios to v1.5.1 ([ae9a06a](https://github.com/module-federation/universe/commit/ae9a06a0cc35fad27a0b493a25370b92617c39fb))
34
- - **deps:** update dependency core-js to v3.31.0 ([#1048](https://github.com/module-federation/universe/issues/1048)) ([96a99f2](https://github.com/module-federation/universe/commit/96a99f2f531b165f14aa36c73eef0691abe3f12c))
35
- - **deps:** update dependency core-js to v3.32.2 ([18d2746](https://github.com/module-federation/universe/commit/18d2746763f38fe295a14df3f1bcd4218fade5b8))
36
- - **deps:** update dependency core-js to v3.33.0 ([30894ca](https://github.com/module-federation/universe/commit/30894cafbe5dea4350dc7c633548038d7ec5f8a8))
37
- - **deps:** update dependency fast-glob to v3.3.0 ([#1078](https://github.com/module-federation/universe/issues/1078)) ([14bb0b5](https://github.com/module-federation/universe/commit/14bb0b5e7ca6a72190fa9d9df817b57586221b66))
38
- - **deps:** update dependency fast-glob to v3.3.1 ([#1197](https://github.com/module-federation/universe/issues/1197)) ([5743543](https://github.com/module-federation/universe/commit/57435430bd0912e3bf370ce08b46f610b12d00e3))
39
- - **deps:** update dependency react-router-dom to v6.14.0 ([#1049](https://github.com/module-federation/universe/issues/1049)) ([ada4160](https://github.com/module-federation/universe/commit/ada416019bbbf589a5a39094b5f608db39a456b2))
40
- - **deps:** update dependency react-router-dom to v6.14.1 ([#1081](https://github.com/module-federation/universe/issues/1081)) ([8515c31](https://github.com/module-federation/universe/commit/8515c314ae2d6159c25fc0fcdc992b24c1fa1a93))
41
- - **deps:** update dependency react-router-dom to v6.15.0 ([#1276](https://github.com/module-federation/universe/issues/1276)) ([850e2fa](https://github.com/module-federation/universe/commit/850e2fac60f49b456aef3b5df9827fc3ac5a6006))
42
- - **deps:** update dependency react-router-dom to v6.16.0 ([0618339](https://github.com/module-federation/universe/commit/061833912f7e5748011cd60ed679a68c1b659f77))
43
- - **deps:** update dependency tsup to v7 ([#1042](https://github.com/module-federation/universe/issues/1042)) ([f319c8a](https://github.com/module-federation/universe/commit/f319c8a8d876e547eeadd59e5bde30dcc367edaf))
44
- - **deps:** update dependency typedoc to ^0.25.0 ([#1277](https://github.com/module-federation/universe/issues/1277)) ([8d6a72e](https://github.com/module-federation/universe/commit/8d6a72e18a57b69b2f63802621e8b4b479554fed))
45
- - **deps:** update dependency typedoc to v0.25.1 ([#1304](https://github.com/module-federation/universe/issues/1304)) ([abf84fe](https://github.com/module-federation/universe/commit/abf84fefd5c20b5de7c9a74d1c49235f44d36dc6))
46
- - **deps:** update dependency typedoc to v0.25.2 ([46c6524](https://github.com/module-federation/universe/commit/46c65247e187cee9e15625402c1570ac351bb1fe))
47
- - **deps:** update dependency undici to v5.24.0 ([573e644](https://github.com/module-federation/universe/commit/573e644333da6d24cb4286ce08221a1aa82415e4))
48
- - **deps:** update dependency undici to v5.25.2 ([da3e539](https://github.com/module-federation/universe/commit/da3e539a41ed23ccb5086b1dd428fbee0f8d652c))
49
- - **deps:** update dependency undici to v5.25.4 ([1d4f91e](https://github.com/module-federation/universe/commit/1d4f91ec93da4326c8a42eef28f150d5d09738bb))
50
- - **deps:** update dependency undici to v5.26.2 [security] ([410a8b8](https://github.com/module-federation/universe/commit/410a8b8bd1558dfb5119ae10941d2b3816a0d0e0))
51
- - **deps:** update dependency unplugin to v1.5.0 ([936b3f8](https://github.com/module-federation/universe/commit/936b3f8d8061fd9d481d1788fb35b88588928d14))
52
- - Fix call undefined delegate ([#1149](https://github.com/module-federation/universe/issues/1149)) ([87a5896](https://github.com/module-federation/universe/commit/87a5896221a726578c3433071755fba3465824f4)), closes [#1151](https://github.com/module-federation/universe/issues/1151)
53
- - override semantic-release-plugin-decorators ([18675de](https://github.com/module-federation/universe/commit/18675defef65570d2b3bb6a9caa3fd039badee29))
54
- - switch to @goestav/nx-semantic-release ([63a3350](https://github.com/module-federation/universe/commit/63a3350a6a1a12235e3c9f1e7c724d54f0476356))
45
+ - **deps:** update dependency antd to v4.24.11 ([#1029](https://github.com/module-federation/core/issues/1029)) ([f9e64c0](https://github.com/module-federation/core/commit/f9e64c04aa1e5802fdc0cdc8f07f2ee728c3ff1c))
46
+ - **deps:** update dependency antd to v4.24.12 ([#1074](https://github.com/module-federation/core/issues/1074)) ([46c25e0](https://github.com/module-federation/core/commit/46c25e0a873ada88d2888a4e995bfa7133c01953))
47
+ - **deps:** update dependency antd to v4.24.14 ([#1309](https://github.com/module-federation/core/issues/1309)) ([d0a2314](https://github.com/module-federation/core/commit/d0a231470e37dbad85a11df1f12695657ba3b984))
48
+ - **deps:** update dependency axios to v1.5.0 ([#1275](https://github.com/module-federation/core/issues/1275)) ([f163df1](https://github.com/module-federation/core/commit/f163df1073740bf4218bb35ba57cea5dc409fe43))
49
+ - **deps:** update dependency axios to v1.5.1 ([ae9a06a](https://github.com/module-federation/core/commit/ae9a06a0cc35fad27a0b493a25370b92617c39fb))
50
+ - **deps:** update dependency core-js to v3.31.0 ([#1048](https://github.com/module-federation/core/issues/1048)) ([96a99f2](https://github.com/module-federation/core/commit/96a99f2f531b165f14aa36c73eef0691abe3f12c))
51
+ - **deps:** update dependency core-js to v3.32.2 ([18d2746](https://github.com/module-federation/core/commit/18d2746763f38fe295a14df3f1bcd4218fade5b8))
52
+ - **deps:** update dependency core-js to v3.33.0 ([30894ca](https://github.com/module-federation/core/commit/30894cafbe5dea4350dc7c633548038d7ec5f8a8))
53
+ - **deps:** update dependency fast-glob to v3.3.0 ([#1078](https://github.com/module-federation/core/issues/1078)) ([14bb0b5](https://github.com/module-federation/core/commit/14bb0b5e7ca6a72190fa9d9df817b57586221b66))
54
+ - **deps:** update dependency fast-glob to v3.3.1 ([#1197](https://github.com/module-federation/core/issues/1197)) ([5743543](https://github.com/module-federation/core/commit/57435430bd0912e3bf370ce08b46f610b12d00e3))
55
+ - **deps:** update dependency react-router-dom to v6.14.0 ([#1049](https://github.com/module-federation/core/issues/1049)) ([ada4160](https://github.com/module-federation/core/commit/ada416019bbbf589a5a39094b5f608db39a456b2))
56
+ - **deps:** update dependency react-router-dom to v6.14.1 ([#1081](https://github.com/module-federation/core/issues/1081)) ([8515c31](https://github.com/module-federation/core/commit/8515c314ae2d6159c25fc0fcdc992b24c1fa1a93))
57
+ - **deps:** update dependency react-router-dom to v6.15.0 ([#1276](https://github.com/module-federation/core/issues/1276)) ([850e2fa](https://github.com/module-federation/core/commit/850e2fac60f49b456aef3b5df9827fc3ac5a6006))
58
+ - **deps:** update dependency react-router-dom to v6.16.0 ([0618339](https://github.com/module-federation/core/commit/061833912f7e5748011cd60ed679a68c1b659f77))
59
+ - **deps:** update dependency tsup to v7 ([#1042](https://github.com/module-federation/core/issues/1042)) ([f319c8a](https://github.com/module-federation/core/commit/f319c8a8d876e547eeadd59e5bde30dcc367edaf))
60
+ - **deps:** update dependency typedoc to ^0.25.0 ([#1277](https://github.com/module-federation/core/issues/1277)) ([8d6a72e](https://github.com/module-federation/core/commit/8d6a72e18a57b69b2f63802621e8b4b479554fed))
61
+ - **deps:** update dependency typedoc to v0.25.1 ([#1304](https://github.com/module-federation/core/issues/1304)) ([abf84fe](https://github.com/module-federation/core/commit/abf84fefd5c20b5de7c9a74d1c49235f44d36dc6))
62
+ - **deps:** update dependency typedoc to v0.25.2 ([46c6524](https://github.com/module-federation/core/commit/46c65247e187cee9e15625402c1570ac351bb1fe))
63
+ - **deps:** update dependency undici to v5.24.0 ([573e644](https://github.com/module-federation/core/commit/573e644333da6d24cb4286ce08221a1aa82415e4))
64
+ - **deps:** update dependency undici to v5.25.2 ([da3e539](https://github.com/module-federation/core/commit/da3e539a41ed23ccb5086b1dd428fbee0f8d652c))
65
+ - **deps:** update dependency undici to v5.25.4 ([1d4f91e](https://github.com/module-federation/core/commit/1d4f91ec93da4326c8a42eef28f150d5d09738bb))
66
+ - **deps:** update dependency undici to v5.26.2 [security] ([410a8b8](https://github.com/module-federation/core/commit/410a8b8bd1558dfb5119ae10941d2b3816a0d0e0))
67
+ - **deps:** update dependency unplugin to v1.5.0 ([936b3f8](https://github.com/module-federation/core/commit/936b3f8d8061fd9d481d1788fb35b88588928d14))
68
+ - Fix call undefined delegate ([#1149](https://github.com/module-federation/core/issues/1149)) ([87a5896](https://github.com/module-federation/core/commit/87a5896221a726578c3433071755fba3465824f4)), closes [#1151](https://github.com/module-federation/core/issues/1151)
69
+ - override semantic-release-plugin-decorators ([18675de](https://github.com/module-federation/core/commit/18675defef65570d2b3bb6a9caa3fd039badee29))
70
+ - switch to @goestav/nx-semantic-release ([63a3350](https://github.com/module-federation/core/commit/63a3350a6a1a12235e3c9f1e7c724d54f0476356))
55
71
 
56
72
  ### Features
57
73
 
58
- - core package for module federation ([#1093](https://github.com/module-federation/universe/issues/1093)) ([d460400](https://github.com/module-federation/universe/commit/d46040053e9b627321b5fe8e05556c5bb727c238)), closes [#851](https://github.com/module-federation/universe/issues/851) [#864](https://github.com/module-federation/universe/issues/864) [#835](https://github.com/module-federation/universe/issues/835) [#851](https://github.com/module-federation/universe/issues/851) [#864](https://github.com/module-federation/universe/issues/864) [#871](https://github.com/module-federation/universe/issues/871) [#851](https://github.com/module-federation/universe/issues/851) [#864](https://github.com/module-federation/universe/issues/864) [#872](https://github.com/module-federation/universe/issues/872) [#875](https://github.com/module-federation/universe/issues/875) [#884](https://github.com/module-federation/universe/issues/884) [#887](https://github.com/module-federation/universe/issues/887) [#893](https://github.com/module-federation/universe/issues/893) [#885](https://github.com/module-federation/universe/issues/885) [#899](https://github.com/module-federation/universe/issues/899) [#904](https://github.com/module-federation/universe/issues/904) [#932](https://github.com/module-federation/universe/issues/932) [#936](https://github.com/module-federation/universe/issues/936) [#959](https://github.com/module-federation/universe/issues/959) [#960](https://github.com/module-federation/universe/issues/960) [#969](https://github.com/module-federation/universe/issues/969) [#971](https://github.com/module-federation/universe/issues/971) [#1234](https://github.com/module-federation/universe/issues/1234) [#1235](https://github.com/module-federation/universe/issues/1235)
59
- - Dynamic Filesystem ([#1274](https://github.com/module-federation/universe/issues/1274)) ([2bec98a](https://github.com/module-federation/universe/commit/2bec98a2472b44898a7f14ec6868a2368cfb6d82))
60
- - fork module federation ([0ad7430](https://github.com/module-federation/universe/commit/0ad7430f6170458a47144be392133b7b2fa1ade0))
61
- - improved async init ([ae3a450](https://github.com/module-federation/universe/commit/ae3a4503ff9de86492b13029d6334b281ddd9493))
62
- - native self forming node federation ([#1291](https://github.com/module-federation/universe/issues/1291)) ([1dd5ed1](https://github.com/module-federation/universe/commit/1dd5ed17c981e036336925e807203e94b58c36d6))
63
- - new actions, remove gpt integration ([370229e](https://github.com/module-federation/universe/commit/370229e02cc352fcfaeaa0f3cf1f9f2d4966d1bb))
64
- - Next Federation 7 ([#726](https://github.com/module-federation/universe/issues/726)) ([d50ca1e](https://github.com/module-federation/universe/commit/d50ca1e4636c4e0a402190f6e9c3f69ed9ec8eac)), closes [#851](https://github.com/module-federation/universe/issues/851) [#864](https://github.com/module-federation/universe/issues/864) [#835](https://github.com/module-federation/universe/issues/835) [#851](https://github.com/module-federation/universe/issues/851) [#864](https://github.com/module-federation/universe/issues/864) [#871](https://github.com/module-federation/universe/issues/871) [#851](https://github.com/module-federation/universe/issues/851) [#864](https://github.com/module-federation/universe/issues/864) [#872](https://github.com/module-federation/universe/issues/872) [#875](https://github.com/module-federation/universe/issues/875) [#884](https://github.com/module-federation/universe/issues/884) [#887](https://github.com/module-federation/universe/issues/887) [#893](https://github.com/module-federation/universe/issues/893) [#885](https://github.com/module-federation/universe/issues/885) [#899](https://github.com/module-federation/universe/issues/899) [#904](https://github.com/module-federation/universe/issues/904) [#932](https://github.com/module-federation/universe/issues/932) [#936](https://github.com/module-federation/universe/issues/936) [#959](https://github.com/module-federation/universe/issues/959) [#960](https://github.com/module-federation/universe/issues/960) [#969](https://github.com/module-federation/universe/issues/969) [#971](https://github.com/module-federation/universe/issues/971) [#974](https://github.com/module-federation/universe/issues/974) [#984](https://github.com/module-federation/universe/issues/984) [#986](https://github.com/module-federation/universe/issues/986) [#1015](https://github.com/module-federation/universe/issues/1015) [#1086](https://github.com/module-federation/universe/issues/1086) [#1084](https://github.com/module-federation/universe/issues/1084)
65
- - **node:** node federation demo/testing apps added ([27d545d](https://github.com/module-federation/universe/commit/27d545d99095da7134c392dbcd9fb135a170f6ef))
66
- - **typedoc-parsetr:** merged main ([cf6e65a](https://github.com/module-federation/universe/commit/cf6e65a4aa895d7c2dba8fdbd8ec22ec7bd8f514))
67
- - **typedoc-parsetr:** merged main ([2ff0d5a](https://github.com/module-federation/universe/commit/2ff0d5a075df3f241742cc7e516cd0378e8e1b3e))
68
- - **typedoc-parsetr:** python script implementation ([0a533cb](https://github.com/module-federation/universe/commit/0a533cb60e0c3ca269ab45df740c1367be175e80))
74
+ - core package for module federation ([#1093](https://github.com/module-federation/core/issues/1093)) ([d460400](https://github.com/module-federation/core/commit/d46040053e9b627321b5fe8e05556c5bb727c238)), closes [#851](https://github.com/module-federation/core/issues/851) [#864](https://github.com/module-federation/core/issues/864) [#835](https://github.com/module-federation/core/issues/835) [#851](https://github.com/module-federation/core/issues/851) [#864](https://github.com/module-federation/core/issues/864) [#871](https://github.com/module-federation/core/issues/871) [#851](https://github.com/module-federation/core/issues/851) [#864](https://github.com/module-federation/core/issues/864) [#872](https://github.com/module-federation/core/issues/872) [#875](https://github.com/module-federation/core/issues/875) [#884](https://github.com/module-federation/core/issues/884) [#887](https://github.com/module-federation/core/issues/887) [#893](https://github.com/module-federation/core/issues/893) [#885](https://github.com/module-federation/core/issues/885) [#899](https://github.com/module-federation/core/issues/899) [#904](https://github.com/module-federation/core/issues/904) [#932](https://github.com/module-federation/core/issues/932) [#936](https://github.com/module-federation/core/issues/936) [#959](https://github.com/module-federation/core/issues/959) [#960](https://github.com/module-federation/core/issues/960) [#969](https://github.com/module-federation/core/issues/969) [#971](https://github.com/module-federation/core/issues/971) [#1234](https://github.com/module-federation/core/issues/1234) [#1235](https://github.com/module-federation/core/issues/1235)
75
+ - Dynamic Filesystem ([#1274](https://github.com/module-federation/core/issues/1274)) ([2bec98a](https://github.com/module-federation/core/commit/2bec98a2472b44898a7f14ec6868a2368cfb6d82))
76
+ - fork module federation ([0ad7430](https://github.com/module-federation/core/commit/0ad7430f6170458a47144be392133b7b2fa1ade0))
77
+ - improved async init ([ae3a450](https://github.com/module-federation/core/commit/ae3a4503ff9de86492b13029d6334b281ddd9493))
78
+ - native self forming node federation ([#1291](https://github.com/module-federation/core/issues/1291)) ([1dd5ed1](https://github.com/module-federation/core/commit/1dd5ed17c981e036336925e807203e94b58c36d6))
79
+ - new actions, remove gpt integration ([370229e](https://github.com/module-federation/core/commit/370229e02cc352fcfaeaa0f3cf1f9f2d4966d1bb))
80
+ - Next Federation 7 ([#726](https://github.com/module-federation/core/issues/726)) ([d50ca1e](https://github.com/module-federation/core/commit/d50ca1e4636c4e0a402190f6e9c3f69ed9ec8eac)), closes [#851](https://github.com/module-federation/core/issues/851) [#864](https://github.com/module-federation/core/issues/864) [#835](https://github.com/module-federation/core/issues/835) [#851](https://github.com/module-federation/core/issues/851) [#864](https://github.com/module-federation/core/issues/864) [#871](https://github.com/module-federation/core/issues/871) [#851](https://github.com/module-federation/core/issues/851) [#864](https://github.com/module-federation/core/issues/864) [#872](https://github.com/module-federation/core/issues/872) [#875](https://github.com/module-federation/core/issues/875) [#884](https://github.com/module-federation/core/issues/884) [#887](https://github.com/module-federation/core/issues/887) [#893](https://github.com/module-federation/core/issues/893) [#885](https://github.com/module-federation/core/issues/885) [#899](https://github.com/module-federation/core/issues/899) [#904](https://github.com/module-federation/core/issues/904) [#932](https://github.com/module-federation/core/issues/932) [#936](https://github.com/module-federation/core/issues/936) [#959](https://github.com/module-federation/core/issues/959) [#960](https://github.com/module-federation/core/issues/960) [#969](https://github.com/module-federation/core/issues/969) [#971](https://github.com/module-federation/core/issues/971) [#974](https://github.com/module-federation/core/issues/974) [#984](https://github.com/module-federation/core/issues/984) [#986](https://github.com/module-federation/core/issues/986) [#1015](https://github.com/module-federation/core/issues/1015) [#1086](https://github.com/module-federation/core/issues/1086) [#1084](https://github.com/module-federation/core/issues/1084)
81
+ - **node:** node federation demo/testing apps added ([27d545d](https://github.com/module-federation/core/commit/27d545d99095da7134c392dbcd9fb135a170f6ef))
82
+ - **typedoc-parsetr:** merged main ([cf6e65a](https://github.com/module-federation/core/commit/cf6e65a4aa895d7c2dba8fdbd8ec22ec7bd8f514))
83
+ - **typedoc-parsetr:** merged main ([2ff0d5a](https://github.com/module-federation/core/commit/2ff0d5a075df3f241742cc7e516cd0378e8e1b3e))
84
+ - **typedoc-parsetr:** python script implementation ([0a533cb](https://github.com/module-federation/core/commit/0a533cb60e0c3ca269ab45df740c1367be175e80))
69
85
 
70
86
  ### Reverts
71
87
 
72
- - Revert "chore: upgrade nx" (#1064) ([3eadaf6](https://github.com/module-federation/universe/commit/3eadaf6f2d8ecc64b45c8e10dbc93f18293f45d5)), closes [#1064](https://github.com/module-federation/universe/issues/1064)
88
+ - Revert "chore: upgrade nx" (#1064) ([3eadaf6](https://github.com/module-federation/core/commit/3eadaf6f2d8ecc64b45c8e10dbc93f18293f45d5)), closes [#1064](https://github.com/module-federation/core/issues/1064)
73
89
 
74
90
  ### BREAKING CHANGES
75
91
 
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _ansicolors = require('ansi-colors'); var _ansicolors2 = _interopRequireDefault(_ansicolors);var _path = require('path');var _rambda = require('rambda');var _tsup = require('tsup');var _unplugin = require('unplugin');var y={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0,maxRetries:3},C=t=>{let e=t.split("@");return e[e.length-1]},b=(t,e)=>{let r=C(e),o=new URL(r),s=o.pathname.split("/").slice(0,-1).join("/");return o.pathname=`${s}/${t.testsFolder}.zip`,o.href},E=t=>Object.entries(t.moduleFederationConfig.remotes).reduce((e,[r,o])=>(e[r]=b(t,o),e),{}),l=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...y,...t},r=E(e);return{hostOptions:e,mapRemotesToDownload:r}};var _fs = require('fs');var k={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},U=["ts","tsx","js","jsx","mjs"],u=t=>{let e=process.cwd();for(let r of U){let o=_path.join.call(void 0, e,`${t}.${r}`);if(_fs.existsSync.call(void 0, o))return o}},T=t=>Object.entries(t.moduleFederationConfig.exposes).reduce((e,[r,o])=>(e[r]=u(o)||u(_path.join.call(void 0, o,"index"))||o,e),{}),f=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...k,...t},r=T(e),o=Object.keys(t.moduleFederationConfig.shared||{}).concat(Object.keys(t.moduleFederationConfig.remotes||{})),s=_path.join.call(void 0, e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:o,compiledFilesFolder:s,mapComponentsToExpose:r}};var _admzip = require('adm-zip'); var _admzip2 = _interopRequireDefault(_admzip);var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var _crypto = require('crypto');var _promises = require('fs/promises');var q=t=>_path.join.call(void 0, t.distFolder,`${t.testsFolder}.zip`),O=async(t,e)=>{let r=new _admzip2.default;return r.addLocalFolder(e),r.writeZipPromise(q(t))},B=(t,e)=>r=>{throw{...r,message:`Network error: Unable to download federated mocks for '${t}' from '${e}' because '${r.message}'`}},a=async(t,e)=>{t.deleteTestsFolder&&await _promises.rm.call(void 0, e,{recursive:!0,force:!0}).catch(r=>console.error(_ansicolors2.default.red(`Unable to remove tests folder, ${r}`)))},w=t=>{let e={},r={};return async([o,s])=>{e[s]=0;let n=_path.join.call(void 0, t.mocksFolder,o);for(;e[s]++<t.maxRetries;)try{let i=await _axios2.default.get(s,{responseType:"arraybuffer"}).catch(B(o,s)),c=Buffer.from(i.data),p=_crypto.createHash.call(void 0, "sha256").update(c).digest("hex");r[s]!==p&&(await a(t,n),new (0, _admzip2.default)(c).extractAllTo(n,!0),r[s]=p);break}catch(i){if(console.error(_ansicolors2.default.red(`Error during types archive download: ${(i==null?void 0:i.message)||"unknown error"}`)),e[s]>=t.maxRetries)throw i}}};var ne=_unplugin.createUnplugin.call(void 0, t=>{let{remoteOptions:e,compiledFilesFolder:r,externalDeps:o,mapComponentsToExpose:s}=f(t);return{name:"native-federation-tests/remote",async writeBundle(){let n=_rambda.mergeRight.call(void 0, e.additionalBundlerConfig,{external:o.map(i=>new RegExp(`^${i}`)),entry:s,outDir:r,silent:!0});try{await _tsup.build.call(void 0, n),await O(e,r),await a(e,r),console.log(_ansicolors2.default.green("Federated mocks created correctly"))}catch(i){console.error(_ansicolors2.default.red(`Unable to build federated mocks: ${i}`))}},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}},webpack(n){n.options.devServer=_rambda.mergeDeepRight.call(void 0, n.options.devServer||{},{static:{directory:_path.resolve.call(void 0, e.distFolder)}})},rspack(n){n.options.devServer=_rambda.mergeDeepRight.call(void 0, n.options.devServer||{},{static:{directory:_path.resolve.call(void 0, e.distFolder)}})}}}),ie= exports.b =_unplugin.createUnplugin.call(void 0, t=>{let{hostOptions:e,mapRemotesToDownload:r}=l(t),o=w(e);return{name:"native-federation-tests/host",async writeBundle(){let s=Object.entries(r).map(o);await Promise.allSettled(s),console.log(_ansicolors2.default.green("Federated mocks extraction completed"))},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}}}});exports.a = ne; exports.b = ie;
@@ -0,0 +1 @@
1
+ import m from"ansi-colors";import{resolve as F}from"path";import{mergeDeepRight as v,mergeRight as N}from"rambda";import{build as P}from"tsup";import{createUnplugin as x}from"unplugin";var y={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0,maxRetries:3},C=t=>{let e=t.split("@");return e[e.length-1]},b=(t,e)=>{let r=C(e),o=new URL(r),s=o.pathname.split("/").slice(0,-1).join("/");return o.pathname=`${s}/${t.testsFolder}.zip`,o.href},E=t=>Object.entries(t.moduleFederationConfig.remotes).reduce((e,[r,o])=>(e[r]=b(t,o),e),{}),l=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...y,...t},r=E(e);return{hostOptions:e,mapRemotesToDownload:r}};import{existsSync as H}from"fs";import{join as d}from"path";var k={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},U=["ts","tsx","js","jsx","mjs"],u=t=>{let e=process.cwd();for(let r of U){let o=d(e,`${t}.${r}`);if(H(o))return o}},T=t=>Object.entries(t.moduleFederationConfig.exposes).reduce((e,[r,o])=>(e[r]=u(o)||u(d(o,"index"))||o,e),{}),f=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...k,...t},r=T(e),o=Object.keys(t.moduleFederationConfig.shared||{}).concat(Object.keys(t.moduleFederationConfig.remotes||{})),s=d(e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:o,compiledFilesFolder:s,mapComponentsToExpose:r}};import g from"adm-zip";import R from"ansi-colors";import S from"axios";import{createHash as $}from"node:crypto";import{rm as j}from"node:fs/promises";import{join as h}from"node:path";var q=t=>h(t.distFolder,`${t.testsFolder}.zip`),O=async(t,e)=>{let r=new g;return r.addLocalFolder(e),r.writeZipPromise(q(t))},B=(t,e)=>r=>{throw{...r,message:`Network error: Unable to download federated mocks for '${t}' from '${e}' because '${r.message}'`}},a=async(t,e)=>{t.deleteTestsFolder&&await j(e,{recursive:!0,force:!0}).catch(r=>console.error(R.red(`Unable to remove tests folder, ${r}`)))},w=t=>{let e={},r={};return async([o,s])=>{e[s]=0;let n=h(t.mocksFolder,o);for(;e[s]++<t.maxRetries;)try{let i=await S.get(s,{responseType:"arraybuffer"}).catch(B(o,s)),c=Buffer.from(i.data),p=$("sha256").update(c).digest("hex");r[s]!==p&&(await a(t,n),new g(c).extractAllTo(n,!0),r[s]=p);break}catch(i){if(console.error(R.red(`Error during types archive download: ${(i==null?void 0:i.message)||"unknown error"}`)),e[s]>=t.maxRetries)throw i}}};var ne=x(t=>{let{remoteOptions:e,compiledFilesFolder:r,externalDeps:o,mapComponentsToExpose:s}=f(t);return{name:"native-federation-tests/remote",async writeBundle(){let n=N(e.additionalBundlerConfig,{external:o.map(i=>new RegExp(`^${i}`)),entry:s,outDir:r,silent:!0});try{await P(n),await O(e,r),await a(e,r),console.log(m.green("Federated mocks created correctly"))}catch(i){console.error(m.red(`Unable to build federated mocks: ${i}`))}},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}},webpack(n){n.options.devServer=v(n.options.devServer||{},{static:{directory:F(e.distFolder)}})},rspack(n){n.options.devServer=v(n.options.devServer||{},{static:{directory:F(e.distFolder)}})}}}),ie=x(t=>{let{hostOptions:e,mapRemotesToDownload:r}=l(t),o=w(e);return{name:"native-federation-tests/host",async writeBundle(){let s=Object.entries(r).map(o);await Promise.allSettled(s),console.log(m.green("Federated mocks extraction completed"))},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}}}});export{ne as a,ie as b};
package/dist/esbuild.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');var o=_chunkYEO6PJMKjs.a.esbuild,a= exports.NativeFederationTestsHost =_chunkYEO6PJMKjs.b.esbuild;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');var o=_chunkSYHYDCCQjs.a.esbuild,a= exports.NativeFederationTestsHost =_chunkSYHYDCCQjs.b.esbuild;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = o;
package/dist/esbuild.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t}from"./chunk-VIRFTP5T.mjs";var o=e.esbuild,a=t.esbuild;export{a as NativeFederationTestsHost,o as NativeFederationTestsRemote};
1
+ import{a as e,b as t}from"./chunk-TF5YWS3M.mjs";var o=e.esbuild,a=t.esbuild;export{a as NativeFederationTestsHost,o as NativeFederationTestsRemote};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');exports.NativeFederationTestsHost = _chunkYEO6PJMKjs.b; exports.NativeFederationTestsRemote = _chunkYEO6PJMKjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');exports.NativeFederationTestsHost = _chunkSYHYDCCQjs.b; exports.NativeFederationTestsRemote = _chunkSYHYDCCQjs.a;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-VIRFTP5T.mjs";export{b as NativeFederationTestsHost,a as NativeFederationTestsRemote};
1
+ import{a,b}from"./chunk-TF5YWS3M.mjs";export{b as NativeFederationTestsHost,a as NativeFederationTestsRemote};
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/native-federation-tests",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Bundler agnostic unplugin to share federated tests",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/dist/rolldown.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');var s=_chunkYEO6PJMKjs.a.rolldown,a= exports.NativeFederationTestsHost =_chunkYEO6PJMKjs.b.rolldown;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');var s=_chunkSYHYDCCQjs.a.rolldown,a= exports.NativeFederationTestsHost =_chunkSYHYDCCQjs.b.rolldown;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
package/dist/rolldown.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t}from"./chunk-VIRFTP5T.mjs";var s=e.rolldown,a=t.rolldown;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
1
+ import{a as e,b as t}from"./chunk-TF5YWS3M.mjs";var s=e.rolldown,a=t.rolldown;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
package/dist/rollup.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');var s=_chunkYEO6PJMKjs.a.rollup,a= exports.NativeFederationTestsHost =_chunkYEO6PJMKjs.b.rollup;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');var s=_chunkSYHYDCCQjs.a.rollup,a= exports.NativeFederationTestsHost =_chunkSYHYDCCQjs.b.rollup;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
package/dist/rollup.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t}from"./chunk-VIRFTP5T.mjs";var s=e.rollup,a=t.rollup;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
1
+ import{a as e,b as t}from"./chunk-TF5YWS3M.mjs";var s=e.rollup,a=t.rollup;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
package/dist/rspack.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');var o=_chunkYEO6PJMKjs.a.rspack,a= exports.NativeFederationTestsHost =_chunkYEO6PJMKjs.b.rspack;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');var o=_chunkSYHYDCCQjs.a.rspack,a= exports.NativeFederationTestsHost =_chunkSYHYDCCQjs.b.rspack;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = o;
package/dist/rspack.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t}from"./chunk-VIRFTP5T.mjs";var o=e.rspack,a=t.rspack;export{a as NativeFederationTestsHost,o as NativeFederationTestsRemote};
1
+ import{a as e,b as t}from"./chunk-TF5YWS3M.mjs";var o=e.rspack,a=t.rspack;export{a as NativeFederationTestsHost,o as NativeFederationTestsRemote};
package/dist/vite.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');var s=_chunkYEO6PJMKjs.a.vite,i= exports.NativeFederationTestsHost =_chunkYEO6PJMKjs.b.vite;exports.NativeFederationTestsHost = i; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');var s=_chunkSYHYDCCQjs.a.vite,i= exports.NativeFederationTestsHost =_chunkSYHYDCCQjs.b.vite;exports.NativeFederationTestsHost = i; exports.NativeFederationTestsRemote = s;
package/dist/vite.mjs CHANGED
@@ -1 +1 @@
1
- import{a as t,b as e}from"./chunk-VIRFTP5T.mjs";var s=t.vite,i=e.vite;export{i as NativeFederationTestsHost,s as NativeFederationTestsRemote};
1
+ import{a as t,b as e}from"./chunk-TF5YWS3M.mjs";var s=t.vite,i=e.vite;export{i as NativeFederationTestsHost,s as NativeFederationTestsRemote};
package/dist/webpack.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYEO6PJMKjs = require('./chunk-YEO6PJMK.js');var s=_chunkYEO6PJMKjs.a.webpack,n= exports.NativeFederationTestsHost =_chunkYEO6PJMKjs.b.webpack;exports.NativeFederationTestsHost = n; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSYHYDCCQjs = require('./chunk-SYHYDCCQ.js');var s=_chunkSYHYDCCQjs.a.webpack,n= exports.NativeFederationTestsHost =_chunkSYHYDCCQjs.b.webpack;exports.NativeFederationTestsHost = n; exports.NativeFederationTestsRemote = s;
package/dist/webpack.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t}from"./chunk-VIRFTP5T.mjs";var s=e.webpack,n=t.webpack;export{n as NativeFederationTestsHost,s as NativeFederationTestsRemote};
1
+ import{a as e,b as t}from"./chunk-TF5YWS3M.mjs";var s=e.webpack,n=t.webpack;export{n as NativeFederationTestsHost,s as NativeFederationTestsRemote};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/native-federation-tests",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Bundler agnostic unplugin to share federated tests",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1 +0,0 @@
1
- import a from"ansi-colors";import{rm as q}from"fs/promises";import{resolve as O}from"path";import{mergeDeepRight as R,mergeRight as B}from"rambda";import{build as D}from"tsup";import{createUnplugin as F}from"unplugin";var h={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0,maxRetries:3},v=t=>{let e=t.split("@");return e[e.length-1]},x=(t,e)=>{let o=v(e),r=new URL(o),n=r.pathname.split("/").slice(0,-1).join("/");return r.pathname=`${n}/${t.testsFolder}.zip`,r.href},y=t=>Object.entries(t.moduleFederationConfig.remotes).reduce((e,[o,r])=>(e[o]=x(t,r),e),{}),m=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...h,...t},o=y(e);return{hostOptions:e,mapRemotesToDownload:o}};import{existsSync as C}from"fs";import{join as d}from"path";var b={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},k=["ts","tsx","js","jsx","mjs"],c=t=>{let e=process.cwd();for(let o of k){let r=d(e,`${t}.${o}`);if(C(r))return r}},E=t=>Object.entries(t.moduleFederationConfig.exposes).reduce((e,[o,r])=>(e[o]=c(r)||c(d(r,"index"))||r,e),{}),p=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...b,...t},o=E(e),r=Object.keys(t.moduleFederationConfig.shared||{}).concat(Object.keys(t.moduleFederationConfig.remotes||{})),n=d(e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:r,compiledFilesFolder:n,mapComponentsToExpose:o}};import l from"adm-zip";import T from"ansi-colors";import H from"axios";import{join as u}from"path";var j=t=>u(t.distFolder,`${t.testsFolder}.zip`),f=async(t,e)=>{let o=new l;return o.addLocalFolder(e),o.writeZipPromise(j(t))},S=(t,e)=>o=>{throw{...o,message:`Network error: Unable to download federated mocks for '${t}' from '${e}' because '${o.message}'`}},g=t=>{let e=0;return async([o,r])=>{let n=u(t.mocksFolder,o);for(;e++<t.maxRetries;)try{let s=await H.get(r,{responseType:"arraybuffer"}).catch(S(o,r));new l(Buffer.from(s.data)).extractAllTo(n,!0);break}catch(s){if(console.error(T.red(`Error during types archive download: ${(s==null?void 0:s.message)||"unknown error"}`)),e>=t.maxRetries)throw s}}};import{rm as U}from"fs/promises";import{join as $}from"path";var w=async(t,e)=>{let o=e.map(r=>{let n=$(t.mocksFolder,r);return U(n,{recursive:!0,force:!0})});return Promise.allSettled(o)};var ie=F(t=>{let{remoteOptions:e,compiledFilesFolder:o,externalDeps:r,mapComponentsToExpose:n}=p(t);return{name:"native-federation-tests/remote",async writeBundle(){let s=B(e.additionalBundlerConfig,{external:r.map(i=>new RegExp(`^${i}`)),entry:n,outDir:o,silent:!0});try{await D(s),await f(e,o),e.deleteTestsFolder&&await q(o,{recursive:!0,force:!0}),console.log(a.green("Federated mocks created correctly"))}catch(i){console.error(a.red(`Unable to build federated mocks: ${i}`))}},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}},webpack:s=>{s.options.devServer=R(s.options.devServer||{},{static:{directory:O(e.distFolder)}})},rspack:s=>{s.options.devServer=R(s.options.devServer||{},{static:{directory:O(e.distFolder)}})}}}),de=F(t=>{let{hostOptions:e,mapRemotesToDownload:o}=m(t);return{name:"native-federation-tests/host",async writeBundle(){e.deleteTestsFolder&&await w(e,Object.keys(o));let r=g(e),n=Object.entries(o).map(r);await Promise.allSettled(n),console.log(a.green("Federated mocks extraction completed"))},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}}}});export{ie as a,de as b};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _ansicolors = require('ansi-colors'); var _ansicolors2 = _interopRequireDefault(_ansicolors);var _promises = require('fs/promises');var _path = require('path');var _rambda = require('rambda');var _tsup = require('tsup');var _unplugin = require('unplugin');var h={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0,maxRetries:3},v=t=>{let e=t.split("@");return e[e.length-1]},x=(t,e)=>{let o=v(e),r=new URL(o),n=r.pathname.split("/").slice(0,-1).join("/");return r.pathname=`${n}/${t.testsFolder}.zip`,r.href},y=t=>Object.entries(t.moduleFederationConfig.remotes).reduce((e,[o,r])=>(e[o]=x(t,r),e),{}),m=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...h,...t},o=y(e);return{hostOptions:e,mapRemotesToDownload:o}};var _fs = require('fs');var b={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},k=["ts","tsx","js","jsx","mjs"],c=t=>{let e=process.cwd();for(let o of k){let r=_path.join.call(void 0, e,`${t}.${o}`);if(_fs.existsSync.call(void 0, r))return r}},E=t=>Object.entries(t.moduleFederationConfig.exposes).reduce((e,[o,r])=>(e[o]=c(r)||c(_path.join.call(void 0, r,"index"))||r,e),{}),p=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...b,...t},o=E(e),r=Object.keys(t.moduleFederationConfig.shared||{}).concat(Object.keys(t.moduleFederationConfig.remotes||{})),n=_path.join.call(void 0, e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:r,compiledFilesFolder:n,mapComponentsToExpose:o}};var _admzip = require('adm-zip'); var _admzip2 = _interopRequireDefault(_admzip);var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var j=t=>_path.join.call(void 0, t.distFolder,`${t.testsFolder}.zip`),f=async(t,e)=>{let o=new _admzip2.default;return o.addLocalFolder(e),o.writeZipPromise(j(t))},S=(t,e)=>o=>{throw{...o,message:`Network error: Unable to download federated mocks for '${t}' from '${e}' because '${o.message}'`}},g=t=>{let e=0;return async([o,r])=>{let n=_path.join.call(void 0, t.mocksFolder,o);for(;e++<t.maxRetries;)try{let s=await _axios2.default.get(r,{responseType:"arraybuffer"}).catch(S(o,r));new (0, _admzip2.default)(Buffer.from(s.data)).extractAllTo(n,!0);break}catch(s){if(console.error(_ansicolors2.default.red(`Error during types archive download: ${(s==null?void 0:s.message)||"unknown error"}`)),e>=t.maxRetries)throw s}}};var w=async(t,e)=>{let o=e.map(r=>{let n=_path.join.call(void 0, t.mocksFolder,r);return _promises.rm.call(void 0, n,{recursive:!0,force:!0})});return Promise.allSettled(o)};var ie=_unplugin.createUnplugin.call(void 0, t=>{let{remoteOptions:e,compiledFilesFolder:o,externalDeps:r,mapComponentsToExpose:n}=p(t);return{name:"native-federation-tests/remote",async writeBundle(){let s=_rambda.mergeRight.call(void 0, e.additionalBundlerConfig,{external:r.map(i=>new RegExp(`^${i}`)),entry:n,outDir:o,silent:!0});try{await _tsup.build.call(void 0, s),await f(e,o),e.deleteTestsFolder&&await _promises.rm.call(void 0, o,{recursive:!0,force:!0}),console.log(_ansicolors2.default.green("Federated mocks created correctly"))}catch(i){console.error(_ansicolors2.default.red(`Unable to build federated mocks: ${i}`))}},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}},webpack:s=>{s.options.devServer=_rambda.mergeDeepRight.call(void 0, s.options.devServer||{},{static:{directory:_path.resolve.call(void 0, e.distFolder)}})},rspack:s=>{s.options.devServer=_rambda.mergeDeepRight.call(void 0, s.options.devServer||{},{static:{directory:_path.resolve.call(void 0, e.distFolder)}})}}}),de= exports.b =_unplugin.createUnplugin.call(void 0, t=>{let{hostOptions:e,mapRemotesToDownload:o}=m(t);return{name:"native-federation-tests/host",async writeBundle(){e.deleteTestsFolder&&await w(e,Object.keys(o));let r=g(e),n=Object.entries(o).map(r);await Promise.allSettled(n),console.log(_ansicolors2.default.green("Federated mocks extraction completed"))},get vite(){return process.env.NODE_ENV==="production"?void 0:{buildStart:this.writeBundle,watchChange:this.writeBundle}}}});exports.a = ie; exports.b = de;