@module-federation/native-federation-tests 0.1.2 → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Matteo Pietro Dazzi and NearForm Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -13,9 +13,11 @@ npm i -D @module-federation/native-federation-tests
13
13
  This module provides two plugins:
14
14
 
15
15
  ### NativeFederationTestsRemote
16
+
16
17
  This plugin is used to concat the components that will be used in tests.
17
18
 
18
19
  #### Configuration
20
+
19
21
  ```typescript
20
22
  {
21
23
  moduleFederationConfig: any; // the same configuration provided to the module federation plugin, it is MANDATORY
@@ -27,10 +29,12 @@ This plugin is used to concat the components that will be used in tests.
27
29
  ```
28
30
 
29
31
  #### Additional configuration
32
+
30
33
  Note that, for Webpack, the plugin automatically inject the `devServer.static.directory` configuration.
31
34
  For the other bundlers, you should configure it by yourself.
32
35
 
33
36
  ### NativeFederationTestsHost
37
+
34
38
  This plugin is used to download the concatenated components mock that will be used for tests.
35
39
 
36
40
  ### Configuration
@@ -51,30 +55,35 @@ This plugin is used to download the concatenated components mock that will be us
51
55
 
52
56
  ```ts
53
57
  // vite.config.ts
54
- import {NativeFederationTestsHost, NativeFederationTestsRemote} from '@module-federation/native-federation-tests/vite'
58
+ import { NativeFederationTestsHost, NativeFederationTestsRemote } from '@module-federation/native-federation-tests/vite';
55
59
 
56
60
  export default defineConfig({
57
61
  plugins: [
58
- NativeFederationTestsRemote({ /* options */ }),
59
- NativeFederationTestsHost({ /* options */ }),
62
+ NativeFederationTestsRemote({
63
+ /* options */
64
+ }),
65
+ NativeFederationTestsHost({
66
+ /* options */
67
+ }),
60
68
  ],
61
69
  /* ... */
62
- server: { // This is needed to emulate the devServer.static.directory of WebPack and correctly serve the zip file
70
+ server: {
71
+ // This is needed to emulate the devServer.static.directory of WebPack and correctly serve the zip file
63
72
  /* ... */
64
73
  proxy: {
65
74
  '/@mf-types.zip': {
66
- target: 'http://localhost:3000',
67
- changeOrigin: true,
68
- rewrite: () => `/@fs/${process.cwd()}/dist/@mf-types.zip`
69
- }
75
+ target: 'http://localhost:3000',
76
+ changeOrigin: true,
77
+ rewrite: () => `/@fs/${process.cwd()}/dist/@mf-types.zip`,
78
+ },
70
79
  },
71
80
  fs: {
72
81
  /* ... */
73
- allow: ['./dist']
82
+ allow: ['./dist'],
74
83
  /* ... */
75
- }
76
- }
77
- })
84
+ },
85
+ },
86
+ });
78
87
  ```
79
88
 
80
89
  <br>
@@ -84,14 +93,18 @@ export default defineConfig({
84
93
 
85
94
  ```ts
86
95
  // rollup.config.js
87
- import {NativeFederationTestsHost, NativeFederationTestsRemote} from '@module-federation/native-federation-tests/rollup'
96
+ import { NativeFederationTestsHost, NativeFederationTestsRemote } from '@module-federation/native-federation-tests/rollup';
88
97
 
89
98
  export default {
90
99
  plugins: [
91
- NativeFederationTestsRemote({ /* options */ }),
92
- NativeFederationTestsHost({ /* options */ }),
100
+ NativeFederationTestsRemote({
101
+ /* options */
102
+ }),
103
+ NativeFederationTestsHost({
104
+ /* options */
105
+ }),
93
106
  ],
94
- }
107
+ };
95
108
  ```
96
109
 
97
110
  <br>
@@ -101,14 +114,18 @@ export default {
101
114
 
102
115
  ```ts
103
116
  // webpack.config.js
104
- const {NativeFederationTestsHost, NativeFederationTestsRemote} = require('@module-federation/native-federation-tests/webpack')
117
+ const { NativeFederationTestsHost, NativeFederationTestsRemote } = require('@module-federation/native-federation-tests/webpack');
105
118
  module.exports = {
106
119
  /* ... */
107
120
  plugins: [
108
- NativeFederationTestsRemote({ /* options */ }),
109
- NativeFederationTestsHost({ /* options */ })
110
- ]
111
- }
121
+ NativeFederationTestsRemote({
122
+ /* options */
123
+ }),
124
+ NativeFederationTestsHost({
125
+ /* options */
126
+ }),
127
+ ],
128
+ };
112
129
  ```
113
130
 
114
131
  <br>
@@ -118,15 +135,19 @@ module.exports = {
118
135
 
119
136
  ```ts
120
137
  // esbuild.config.js
121
- import { build } from 'esbuild'
122
- import {NativeFederationTestsHost, NativeFederationTestsRemote} from '@module-federation/native-federation-tests/esbuild'
138
+ import { build } from 'esbuild';
139
+ import { NativeFederationTestsHost, NativeFederationTestsRemote } from '@module-federation/native-federation-tests/esbuild';
123
140
 
124
141
  build({
125
142
  plugins: [
126
- NativeFederationTestsRemote({ /* options */ }),
127
- NativeFederationTestsHost({ /* options */ })
143
+ NativeFederationTestsRemote({
144
+ /* options */
145
+ }),
146
+ NativeFederationTestsHost({
147
+ /* options */
148
+ }),
128
149
  ],
129
- })
150
+ });
130
151
  ```
131
152
 
132
153
  <br>
@@ -137,15 +158,19 @@ build({
137
158
 
138
159
  ```ts
139
160
  // rspack.config.js
140
- const {NativeFederationTestsHost, NativeFederationTestsRemote} = require('@module-federation/native-federation-tests/rspack')
161
+ const { NativeFederationTestsHost, NativeFederationTestsRemote } = require('@module-federation/native-federation-tests/rspack');
141
162
 
142
163
  module.exports = {
143
164
  /* ... */
144
165
  plugins: [
145
- NativeFederationTestsRemote({ /* options */ }),
146
- NativeFederationTestsHost({ /* options */ })
147
- ]
148
- }
166
+ NativeFederationTestsRemote({
167
+ /* options */
168
+ }),
169
+ NativeFederationTestsHost({
170
+ /* options */
171
+ }),
172
+ ],
173
+ };
149
174
  ```
150
175
 
151
176
  <br>
@@ -0,0 +1,491 @@
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)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **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))
6
+ - **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))
7
+ - **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))
8
+ - **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))
9
+ - **deps:** update dependency axios to v1.5.1 ([ae9a06a](https://github.com/module-federation/universe/commit/ae9a06a0cc35fad27a0b493a25370b92617c39fb))
10
+ - **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))
11
+ - **deps:** update dependency core-js to v3.32.2 ([18d2746](https://github.com/module-federation/universe/commit/18d2746763f38fe295a14df3f1bcd4218fade5b8))
12
+ - **deps:** update dependency core-js to v3.33.0 ([30894ca](https://github.com/module-federation/universe/commit/30894cafbe5dea4350dc7c633548038d7ec5f8a8))
13
+ - **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))
14
+ - **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))
15
+ - **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))
16
+ - **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))
17
+ - **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))
18
+ - **deps:** update dependency react-router-dom to v6.16.0 ([0618339](https://github.com/module-federation/universe/commit/061833912f7e5748011cd60ed679a68c1b659f77))
19
+ - **deps:** update dependency tsup to v7 ([#1042](https://github.com/module-federation/universe/issues/1042)) ([f319c8a](https://github.com/module-federation/universe/commit/f319c8a8d876e547eeadd59e5bde30dcc367edaf))
20
+ - **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))
21
+ - **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))
22
+ - **deps:** update dependency typedoc to v0.25.2 ([46c6524](https://github.com/module-federation/universe/commit/46c65247e187cee9e15625402c1570ac351bb1fe))
23
+ - **deps:** update dependency undici to v5.24.0 ([573e644](https://github.com/module-federation/universe/commit/573e644333da6d24cb4286ce08221a1aa82415e4))
24
+ - **deps:** update dependency undici to v5.25.2 ([da3e539](https://github.com/module-federation/universe/commit/da3e539a41ed23ccb5086b1dd428fbee0f8d652c))
25
+ - **deps:** update dependency undici to v5.25.4 ([1d4f91e](https://github.com/module-federation/universe/commit/1d4f91ec93da4326c8a42eef28f150d5d09738bb))
26
+ - **deps:** update dependency undici to v5.26.2 [security] ([410a8b8](https://github.com/module-federation/universe/commit/410a8b8bd1558dfb5119ae10941d2b3816a0d0e0))
27
+ - **deps:** update dependency unplugin to v1.5.0 ([936b3f8](https://github.com/module-federation/universe/commit/936b3f8d8061fd9d481d1788fb35b88588928d14))
28
+ - 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)
29
+ - override semantic-release-plugin-decorators ([18675de](https://github.com/module-federation/universe/commit/18675defef65570d2b3bb6a9caa3fd039badee29))
30
+ - switch to @goestav/nx-semantic-release ([63a3350](https://github.com/module-federation/universe/commit/63a3350a6a1a12235e3c9f1e7c724d54f0476356))
31
+
32
+ ### Features
33
+
34
+ - 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)
35
+ - Dynamic Filesystem ([#1274](https://github.com/module-federation/universe/issues/1274)) ([2bec98a](https://github.com/module-federation/universe/commit/2bec98a2472b44898a7f14ec6868a2368cfb6d82))
36
+ - fork module federation ([0ad7430](https://github.com/module-federation/universe/commit/0ad7430f6170458a47144be392133b7b2fa1ade0))
37
+ - improved async init ([ae3a450](https://github.com/module-federation/universe/commit/ae3a4503ff9de86492b13029d6334b281ddd9493))
38
+ - native self forming node federation ([#1291](https://github.com/module-federation/universe/issues/1291)) ([1dd5ed1](https://github.com/module-federation/universe/commit/1dd5ed17c981e036336925e807203e94b58c36d6))
39
+ - new actions, remove gpt integration ([370229e](https://github.com/module-federation/universe/commit/370229e02cc352fcfaeaa0f3cf1f9f2d4966d1bb))
40
+ - 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)
41
+ - **node:** node federation demo/testing apps added ([27d545d](https://github.com/module-federation/universe/commit/27d545d99095da7134c392dbcd9fb135a170f6ef))
42
+ - **typedoc-parsetr:** merged main ([cf6e65a](https://github.com/module-federation/universe/commit/cf6e65a4aa895d7c2dba8fdbd8ec22ec7bd8f514))
43
+ - **typedoc-parsetr:** merged main ([2ff0d5a](https://github.com/module-federation/universe/commit/2ff0d5a075df3f241742cc7e516cd0378e8e1b3e))
44
+ - **typedoc-parsetr:** python script implementation ([0a533cb](https://github.com/module-federation/universe/commit/0a533cb60e0c3ca269ab45df740c1367be175e80))
45
+
46
+ ### Reverts
47
+
48
+ - Revert "chore: upgrade nx" (#1064) ([3eadaf6](https://github.com/module-federation/universe/commit/3eadaf6f2d8ecc64b45c8e10dbc93f18293f45d5)), closes [#1064](https://github.com/module-federation/universe/issues/1064)
49
+
50
+ ### BREAKING CHANGES
51
+
52
+ - automaticAsyncBoundary option has been removed
53
+
54
+ - fix: exclude specific pages from page map automatically
55
+
56
+ - refactor: conslidate codebase
57
+
58
+ - fix: improve hot reload share recovery
59
+
60
+ - refactor: remove server jsonp template
61
+
62
+ - chore: remove dead code from runtime modules
63
+
64
+ - fix: clean up jsonp getCustomJsonpCode
65
+
66
+ getting chunk loading global from compiler output options
67
+
68
+ - feat: adding cleanInitArrays runtime helper
69
+
70
+ - chore: remove share scope hoist and module hoisting system
71
+
72
+ - chore: cleanup code
73
+
74
+ - chore: remove dead code from add module runtime plugin
75
+
76
+ likely can remove whole plugin in future
77
+
78
+ - chore: remove logs from delegate modules
79
+
80
+ - chore: remove old utils
81
+
82
+ - fix: add warning on auto page stitch
83
+
84
+ - fix: remove commented out code from InvertedContainerPlugin.ts
85
+
86
+ - chore: improve logging to see if its local load or remote load
87
+
88
+ - chore: clean up old custom promises factories
89
+
90
+ - fix: remove container proxy code
91
+
92
+ - fix: remove container proxy code
93
+ - automaticAsyncBoundary option has been removed
94
+
95
+ - fix: exclude specific pages from page map automatically
96
+
97
+ - refactor: conslidate codebase
98
+
99
+ - fix: improve hot reload share recovery
100
+
101
+ - refactor: remove server jsonp template
102
+
103
+ - chore: remove dead code from runtime modules
104
+
105
+ - fix: clean up jsonp getCustomJsonpCode
106
+
107
+ getting chunk loading global from compiler output options
108
+
109
+ - feat: adding cleanInitArrays runtime helper
110
+
111
+ - chore: remove share scope hoist and module hoisting system
112
+
113
+ - chore: cleanup code
114
+
115
+ - chore: remove dead code from add module runtime plugin
116
+
117
+ likely can remove whole plugin in future
118
+
119
+ - chore: remove logs from delegate modules
120
+
121
+ - chore: remove old utils
122
+
123
+ - fix: add warning on auto page stitch
124
+
125
+ - fix: remove commented out code from InvertedContainerPlugin.ts
126
+
127
+ - chore: improve logging to see if its local load or remote load
128
+
129
+ - chore: clean up old custom promises factories
130
+
131
+ - fix: remove container proxy code
132
+
133
+ - fix: remove container proxy code
134
+
135
+ - chore: fix project.json
136
+
137
+ - debugging
138
+
139
+ - fix: resolve backmerge issues with build
140
+
141
+ - Merge branch 'kill_child_compilers' into fix_backmerge_issues
142
+
143
+ # Conflicts:
144
+
145
+ # package-lock.json
146
+
147
+ # package.json
148
+
149
+ # packages/nextjs-mf/src/plugins/NextFederationPlugin/index.ts
150
+
151
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerPlugin.ts
152
+
153
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerRuntimeModule.ts
154
+
155
+ - feat: enable eager sharing
156
+
157
+ - refactor: improve module hooks for eager loading and search
158
+
159
+ - refactor: cleanup custom jsonp and make es5
160
+
161
+ - refactor: cleanup inverted container code
162
+
163
+ - refactor: cleanup inverted container code
164
+ - automaticAsyncBoundary option has been removed
165
+
166
+ - fix: exclude specific pages from page map automatically
167
+
168
+ - refactor: conslidate codebase
169
+
170
+ - fix: improve hot reload share recovery
171
+
172
+ - refactor: remove server jsonp template
173
+
174
+ - chore: remove dead code from runtime modules
175
+
176
+ - fix: clean up jsonp getCustomJsonpCode
177
+
178
+ getting chunk loading global from compiler output options
179
+
180
+ - feat: adding cleanInitArrays runtime helper
181
+
182
+ - chore: remove share scope hoist and module hoisting system
183
+
184
+ - chore: cleanup code
185
+
186
+ - chore: remove dead code from add module runtime plugin
187
+
188
+ likely can remove whole plugin in future
189
+
190
+ - chore: remove logs from delegate modules
191
+
192
+ - chore: remove old utils
193
+
194
+ - fix: add warning on auto page stitch
195
+
196
+ - fix: remove commented out code from InvertedContainerPlugin.ts
197
+
198
+ - chore: improve logging to see if its local load or remote load
199
+
200
+ - chore: clean up old custom promises factories
201
+
202
+ - fix: remove container proxy code
203
+
204
+ - fix: remove container proxy code
205
+
206
+ - fix: resolve backmerge issues with build
207
+
208
+ - Merge branch 'kill_child_compilers' into fix_backmerge_issues
209
+
210
+ # Conflicts:
211
+
212
+ # package-lock.json
213
+
214
+ # package.json
215
+
216
+ # packages/nextjs-mf/src/plugins/NextFederationPlugin/index.ts
217
+
218
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerPlugin.ts
219
+
220
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerRuntimeModule.ts
221
+
222
+ - feat: enable eager sharing
223
+
224
+ - refactor: improve module hooks for eager loading and search
225
+
226
+ - refactor: cleanup custom jsonp and make es5
227
+
228
+ - refactor: cleanup inverted container code
229
+
230
+ - refactor: cleanup inverted container code
231
+
232
+ - ci: fix install step with npm and NX
233
+
234
+ - test: remove tests for now
235
+
236
+ - chore(utils): release version 1.7.3-beta.0
237
+
238
+ - chore(utils): release version 1.7.3
239
+
240
+ - chore(node): release version 0.14.4-beta.0
241
+
242
+ - chore(node): release version 0.14.4
243
+
244
+ - chore(nextjs-mf): release version 6.4.1-beta.4
245
+
246
+ - fix: remove debugging runtime variable
247
+
248
+ - chore(nextjs-mf): release version 6.4.1-beta.5
249
+ - automaticAsyncBoundary option has been removed
250
+
251
+ - fix: exclude specific pages from page map automatically
252
+
253
+ - refactor: conslidate codebase
254
+
255
+ - fix: improve hot reload share recovery
256
+
257
+ - refactor: remove server jsonp template
258
+
259
+ - chore: remove dead code from runtime modules
260
+
261
+ - fix: clean up jsonp getCustomJsonpCode
262
+
263
+ getting chunk loading global from compiler output options
264
+
265
+ - feat: adding cleanInitArrays runtime helper
266
+
267
+ - chore: remove share scope hoist and module hoisting system
268
+
269
+ - chore: cleanup code
270
+
271
+ - chore: remove dead code from add module runtime plugin
272
+
273
+ likely can remove whole plugin in future
274
+
275
+ - chore: remove logs from delegate modules
276
+
277
+ - chore: remove old utils
278
+
279
+ - fix: add warning on auto page stitch
280
+
281
+ - fix: remove commented out code from InvertedContainerPlugin.ts
282
+
283
+ - chore: improve logging to see if its local load or remote load
284
+
285
+ - chore: clean up old custom promises factories
286
+
287
+ - fix: remove container proxy code
288
+
289
+ - fix: remove container proxy code
290
+ - automaticAsyncBoundary option has been removed
291
+
292
+ - fix: exclude specific pages from page map automatically
293
+
294
+ - refactor: conslidate codebase
295
+
296
+ - fix: improve hot reload share recovery
297
+
298
+ - refactor: remove server jsonp template
299
+
300
+ - chore: remove dead code from runtime modules
301
+
302
+ - fix: clean up jsonp getCustomJsonpCode
303
+
304
+ getting chunk loading global from compiler output options
305
+
306
+ - feat: adding cleanInitArrays runtime helper
307
+
308
+ - chore: remove share scope hoist and module hoisting system
309
+
310
+ - chore: cleanup code
311
+
312
+ - chore: remove dead code from add module runtime plugin
313
+
314
+ likely can remove whole plugin in future
315
+
316
+ - chore: remove logs from delegate modules
317
+
318
+ - chore: remove old utils
319
+
320
+ - fix: add warning on auto page stitch
321
+
322
+ - fix: remove commented out code from InvertedContainerPlugin.ts
323
+
324
+ - chore: improve logging to see if its local load or remote load
325
+
326
+ - chore: clean up old custom promises factories
327
+
328
+ - fix: remove container proxy code
329
+
330
+ - fix: remove container proxy code
331
+
332
+ - chore: fix project.json
333
+
334
+ - debugging
335
+
336
+ - fix: resolve backmerge issues with build
337
+
338
+ - Merge branch 'kill_child_compilers' into fix_backmerge_issues
339
+
340
+ # Conflicts:
341
+
342
+ # package-lock.json
343
+
344
+ # package.json
345
+
346
+ # packages/nextjs-mf/src/plugins/NextFederationPlugin/index.ts
347
+
348
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerPlugin.ts
349
+
350
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerRuntimeModule.ts
351
+
352
+ - feat: enable eager sharing
353
+
354
+ - refactor: improve module hooks for eager loading and search
355
+
356
+ - refactor: cleanup custom jsonp and make es5
357
+
358
+ - refactor: cleanup inverted container code
359
+
360
+ - refactor: cleanup inverted container code
361
+ - automaticAsyncBoundary option has been removed
362
+
363
+ - fix: exclude specific pages from page map automatically
364
+
365
+ - refactor: conslidate codebase
366
+
367
+ - fix: improve hot reload share recovery
368
+
369
+ - refactor: remove server jsonp template
370
+
371
+ - chore: remove dead code from runtime modules
372
+
373
+ - fix: clean up jsonp getCustomJsonpCode
374
+
375
+ getting chunk loading global from compiler output options
376
+
377
+ - feat: adding cleanInitArrays runtime helper
378
+
379
+ - chore: remove share scope hoist and module hoisting system
380
+
381
+ - chore: cleanup code
382
+
383
+ - chore: remove dead code from add module runtime plugin
384
+
385
+ likely can remove whole plugin in future
386
+
387
+ - chore: remove logs from delegate modules
388
+
389
+ - chore: remove old utils
390
+
391
+ - fix: add warning on auto page stitch
392
+
393
+ - fix: remove commented out code from InvertedContainerPlugin.ts
394
+
395
+ - chore: improve logging to see if its local load or remote load
396
+
397
+ - chore: clean up old custom promises factories
398
+
399
+ - fix: remove container proxy code
400
+
401
+ - fix: remove container proxy code
402
+
403
+ - fix: resolve backmerge issues with build
404
+
405
+ - Merge branch 'kill_child_compilers' into fix_backmerge_issues
406
+
407
+ # Conflicts:
408
+
409
+ # package-lock.json
410
+
411
+ # package.json
412
+
413
+ # packages/nextjs-mf/src/plugins/NextFederationPlugin/index.ts
414
+
415
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerPlugin.ts
416
+
417
+ # packages/nextjs-mf/src/plugins/container/InvertedContainerRuntimeModule.ts
418
+
419
+ - feat: enable eager sharing
420
+
421
+ - refactor: improve module hooks for eager loading and search
422
+
423
+ - refactor: cleanup custom jsonp and make es5
424
+
425
+ - refactor: cleanup inverted container code
426
+
427
+ - refactor: cleanup inverted container code
428
+
429
+ - ci: fix install step with npm and NX
430
+
431
+ - test: remove tests for now
432
+
433
+ - chore(utils): release version 1.7.3-beta.0
434
+
435
+ - chore(utils): release version 1.7.3
436
+
437
+ - chore(node): release version 0.14.4-beta.0
438
+
439
+ - chore(node): release version 0.14.4
440
+
441
+ - chore(nextjs-mf): release version 6.4.1-beta.4
442
+
443
+ - fix: remove debugging runtime variable
444
+
445
+ - chore(nextjs-mf): release version 6.4.1-beta.5
446
+
447
+ # Changelog
448
+
449
+ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
450
+
451
+ ## [0.2.1](https://github.com/module-federation/nextjs-mf/compare/native-federation-tests-0.2.0...native-federation-tests-0.2.1) (2023-06-28)
452
+
453
+ ### Bug Fixes
454
+
455
+ - .at(-1) ([8dd0520](https://github.com/module-federation/nextjs-mf/commit/8dd0520b5464c49e89c63307c5388450e4bebbf8))
456
+
457
+ # [0.2.0](https://github.com/module-federation/nextjs-mf/compare/native-federation-tests-0.1.2...native-federation-tests-0.2.0) (2023-04-29)
458
+
459
+ ### Bug Fixes
460
+
461
+ - removed any from error logger type ([fb9fcc3](https://github.com/module-federation/nextjs-mf/commit/fb9fcc3a54a13be36335830f076a86557b75bb4a))
462
+ - subpath ([1548501](https://github.com/module-federation/nextjs-mf/commit/1548501bb4679c0c534c02609cb6bc5459f224a4))
463
+
464
+ ### Features
465
+
466
+ - release to npm with next tag to not ruine latest one ([#763](https://github.com/module-federation/nextjs-mf/issues/763)) ([f2d199b](https://github.com/module-federation/nextjs-mf/commit/f2d199b3b3fbbd428514b1ce1f139efc82f7fff0))
467
+
468
+ ## [0.1.2](https://github.com/module-federation/nextjs-mf/compare/native-federation-tests-0.1.1...native-federation-tests-0.1.2) (2023-04-14)
469
+
470
+ ### Bug Fixes
471
+
472
+ - tests regex, external deps should be removed using the startsWith strategy ([5d1c0f5](https://github.com/module-federation/nextjs-mf/commit/5d1c0f5b947ec7690fbe69ec8cc23701f975bae9))
473
+
474
+ ## [0.1.1](https://github.com/module-federation/nextjs-mf/compare/native-federation-tests-0.1.0...native-federation-tests-0.1.1) (2023-04-12)
475
+
476
+ # 0.1.0 (2023-04-11)
477
+
478
+ ### Bug Fixes
479
+
480
+ - build ([d0b2f72](https://github.com/module-federation/nextjs-mf/commit/d0b2f72f4fc3647825412be1574311c3152cf167))
481
+ - build step ([a217170](https://github.com/module-federation/nextjs-mf/commit/a21717096cbc09bff20d3aeebfea2f3533afb0d7))
482
+ - deps ([a378441](https://github.com/module-federation/nextjs-mf/commit/a37844194a3f189cc5863bbdd4776259bce69fa4))
483
+ - native build chunks ([d6c9f8a](https://github.com/module-federation/nextjs-mf/commit/d6c9f8a957ed00a8d92332ccc38ed9780f01d54e))
484
+ - package name ([dcb8480](https://github.com/module-federation/nextjs-mf/commit/dcb848025bbe56a7fc5bd3643462a64d22699cc7))
485
+ - readme ([eaca0b3](https://github.com/module-federation/nextjs-mf/commit/eaca0b311d3b8d9e73309cb92d9a9488f9fc23c0))
486
+ - readme ([74fc6fa](https://github.com/module-federation/nextjs-mf/commit/74fc6fa21ac10ce3cd9dd942a5b392ef50c51f56))
487
+ - README.md ([9159171](https://github.com/module-federation/nextjs-mf/commit/91591712e9a103fff351f0a168c149470c0d69ad))
488
+
489
+ ### Features
490
+
491
+ - federated tests plugin ([063ab33](https://github.com/module-federation/nextjs-mf/commit/063ab336c4830aff4f5bd3b9894df60b4651a9be))
package/dist/README.md ADDED
@@ -0,0 +1,182 @@
1
+ # native-federation-tests
2
+
3
+ Bundler agnostic plugins to share federated components for testing purposes.
4
+
5
+ It aims to work for both [`vitest`](https://vitest.dev/) and [`jest`](https://jestjs.io/).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i -D @module-federation/native-federation-tests
11
+ ```
12
+
13
+ This module provides two plugins:
14
+
15
+ ### NativeFederationTestsRemote
16
+
17
+ This plugin is used to concat the components that will be used in tests.
18
+
19
+ #### Configuration
20
+
21
+ ```typescript
22
+ {
23
+ moduleFederationConfig: any; // the same configuration provided to the module federation plugin, it is MANDATORY
24
+ additionalBundlerConfig?: TsupOptions; // additional `tsup` build options that will be merged with the one generated by the plugin, default is {}
25
+ distFolder?: string; // folder used to store the dist, default is './dist'
26
+ testsFolder?: string; // folder where all the files will be stored, default is '@mf-tests'
27
+ deleteTestsFolder?: boolean; // indicate if the concatenated components folder will be deleted when the job completes, default is 'true'
28
+ }
29
+ ```
30
+
31
+ #### Additional configuration
32
+
33
+ Note that, for Webpack, the plugin automatically inject the `devServer.static.directory` configuration.
34
+ For the other bundlers, you should configure it by yourself.
35
+
36
+ ### NativeFederationTestsHost
37
+
38
+ This plugin is used to download the concatenated components mock that will be used for tests.
39
+
40
+ ### Configuration
41
+
42
+ ```typescript
43
+ {
44
+ moduleFederationConfig: any; // the configuration same configuration provided to the module federation plugin, it is MANDATORY
45
+ testsFolder?: string; // folder where all the files have been stored, default is '@mf-tests',
46
+ mocksFolder?: string; // folder where the concatenated files will be stored, default is './__mocks__',
47
+ deleteTestsFolder?: boolean; // indicate if the tests mock folder will be deleted before the job starts, default is 'true'
48
+ }
49
+ ```
50
+
51
+ ## Bundler configuration
52
+
53
+ <details>
54
+ <summary>Vite</summary><br>
55
+
56
+ ```ts
57
+ // vite.config.ts
58
+ import { NativeFederationTestsHost, NativeFederationTestsRemote } from '@module-federation/native-federation-tests/vite';
59
+
60
+ export default defineConfig({
61
+ plugins: [
62
+ NativeFederationTestsRemote({
63
+ /* options */
64
+ }),
65
+ NativeFederationTestsHost({
66
+ /* options */
67
+ }),
68
+ ],
69
+ /* ... */
70
+ server: {
71
+ // This is needed to emulate the devServer.static.directory of WebPack and correctly serve the zip file
72
+ /* ... */
73
+ proxy: {
74
+ '/@mf-types.zip': {
75
+ target: 'http://localhost:3000',
76
+ changeOrigin: true,
77
+ rewrite: () => `/@fs/${process.cwd()}/dist/@mf-types.zip`,
78
+ },
79
+ },
80
+ fs: {
81
+ /* ... */
82
+ allow: ['./dist'],
83
+ /* ... */
84
+ },
85
+ },
86
+ });
87
+ ```
88
+
89
+ <br>
90
+ </details>
91
+ <details>
92
+ <summary>Rollup</summary><br>
93
+
94
+ ```ts
95
+ // rollup.config.js
96
+ import { NativeFederationTestsHost, NativeFederationTestsRemote } from '@module-federation/native-federation-tests/rollup';
97
+
98
+ export default {
99
+ plugins: [
100
+ NativeFederationTestsRemote({
101
+ /* options */
102
+ }),
103
+ NativeFederationTestsHost({
104
+ /* options */
105
+ }),
106
+ ],
107
+ };
108
+ ```
109
+
110
+ <br>
111
+ </details>
112
+ <details>
113
+ <summary>Webpack</summary><br>
114
+
115
+ ```ts
116
+ // webpack.config.js
117
+ const { NativeFederationTestsHost, NativeFederationTestsRemote } = require('@module-federation/native-federation-tests/webpack');
118
+ module.exports = {
119
+ /* ... */
120
+ plugins: [
121
+ NativeFederationTestsRemote({
122
+ /* options */
123
+ }),
124
+ NativeFederationTestsHost({
125
+ /* options */
126
+ }),
127
+ ],
128
+ };
129
+ ```
130
+
131
+ <br>
132
+ </details>
133
+ <details>
134
+ <summary>esbuild</summary><br>
135
+
136
+ ```ts
137
+ // esbuild.config.js
138
+ import { build } from 'esbuild';
139
+ import { NativeFederationTestsHost, NativeFederationTestsRemote } from '@module-federation/native-federation-tests/esbuild';
140
+
141
+ build({
142
+ plugins: [
143
+ NativeFederationTestsRemote({
144
+ /* options */
145
+ }),
146
+ NativeFederationTestsHost({
147
+ /* options */
148
+ }),
149
+ ],
150
+ });
151
+ ```
152
+
153
+ <br>
154
+ </details>
155
+
156
+ <details>
157
+ <summary>Rspack</summary><br>
158
+
159
+ ```ts
160
+ // rspack.config.js
161
+ const { NativeFederationTestsHost, NativeFederationTestsRemote } = require('@module-federation/native-federation-tests/rspack');
162
+
163
+ module.exports = {
164
+ /* ... */
165
+ plugins: [
166
+ NativeFederationTestsRemote({
167
+ /* options */
168
+ }),
169
+ NativeFederationTestsHost({
170
+ /* options */
171
+ }),
172
+ ],
173
+ };
174
+ ```
175
+
176
+ <br>
177
+ </details>
178
+
179
+ ## Examples
180
+
181
+ To use it in a `host` module, refer to [this example](https://github.com/module-federation/module-federation-examples/tree/master/native-federation-tests-typescript-plugins/host).
182
+ To use it in a `remote` module, refer to [this example](https://github.com/module-federation/module-federation-examples/tree/master/native-federation-tests-typescript-plugins/remote).
@@ -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 _promises = require('fs/promises');var _path = require('path');var _rambda = require('rambda');var _tsup = require('tsup');var _unplugin = require('unplugin');var O={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0},w=t=>{let e=t.split("@");return e[e.length-1]},v=(t,e)=>{let o=w(e),r=new URL(o),s=r.pathname.split("/").slice(0,-1).join("/");return r.pathname=`${s}/${t.testsFolder}.zip`,r.href},x=t=>Object.entries(t.moduleFederationConfig.remotes).reduce((e,[o,r])=>(e[o]=v(t,r),e),{}),c=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...O,...t},o=x(e);return{hostOptions:e,mapRemotesToDownload:o}};var _fs = require('fs');var y={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},C=["ts","tsx","js","jsx","mjs"],p=t=>{let e=process.cwd();for(let o of C){let r=_path.join.call(void 0, e,`${t}.${o}`);if(_fs.existsSync.call(void 0, r))return r}},T=t=>Object.entries(t.moduleFederationConfig.exposes).reduce((e,[o,r])=>(e[o]=p(r)||p(_path.join.call(void 0, r,"index"))||r,e),{}),a=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...y,...t},o=T(e),r=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:r,compiledFilesFolder:s,mapComponentsToExpose:o}};var _admzip = require('adm-zip'); var _admzip2 = _interopRequireDefault(_admzip);var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var E=t=>_path.join.call(void 0, t.distFolder,`${t.testsFolder}.zip`),u=async(t,e)=>{let o=new _admzip2.default;return o.addLocalFolder(e),o.writeZipPromise(E(t))},H=(t,e)=>o=>{throw o.message=_ansicolors2.default.red(`Network error: Unable to download federated mocks for '${t}' from '${e}' because '${o.message}', skipping...`),o},g=t=>async([e,o])=>{try{let r=await _axios2.default.get(o,{responseType:"arraybuffer"}),s=_path.join.call(void 0, t.mocksFolder,e);new (0, _admzip2.default)(Buffer.from(r.data)).extractAllTo(s,!0)}catch(r){H(e,o)(r)}};var F=async(t,e)=>{let o=e.map(r=>{let s=_path.join.call(void 0, t.mocksFolder,r);return _promises.rm.call(void 0, s,{recursive:!0,force:!0})});return Promise.allSettled(o)};var ne=_unplugin.createUnplugin.call(void 0, t=>{let{remoteOptions:e,compiledFilesFolder:o,externalDeps:r,mapComponentsToExpose:s}=a(t);return{name:"native-federation-tests/remote",async writeBundle(){let n=_rambda.mergeRight.call(void 0, e.additionalBundlerConfig,{external:r.map(i=>new RegExp(`^${i}`)),entry:s,outDir:o,silent:!0});try{await _tsup.build.call(void 0, n),await u(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}`))}},webpack: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:o}=c(t);return{name:"native-federation-tests/host",async writeBundle(){e.deleteTestsFolder&&await F(e,Object.keys(o));let r=g(e),s=Object.entries(o).map(r);await Promise.allSettled(s),console.log(_ansicolors2.default.green("Federated mocks extraction completed"))}}});exports.a = ne; exports.b = ie;
@@ -0,0 +1 @@
1
+ import m from"ansi-colors";import{rm as $}from"fs/promises";import{resolve as S}from"path";import{mergeDeepRight as U,mergeRight as D}from"rambda";import{build as A}from"tsup";import{createUnplugin as R}from"unplugin";var O={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0},w=t=>{let e=t.split("@");return e[e.length-1]},v=(t,e)=>{let o=w(e),r=new URL(o),s=r.pathname.split("/").slice(0,-1).join("/");return r.pathname=`${s}/${t.testsFolder}.zip`,r.href},x=t=>Object.entries(t.moduleFederationConfig.remotes).reduce((e,[o,r])=>(e[o]=v(t,r),e),{}),c=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...O,...t},o=x(e);return{hostOptions:e,mapRemotesToDownload:o}};import{existsSync as h}from"fs";import{join as d}from"path";var y={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},C=["ts","tsx","js","jsx","mjs"],p=t=>{let e=process.cwd();for(let o of C){let r=d(e,`${t}.${o}`);if(h(r))return r}},T=t=>Object.entries(t.moduleFederationConfig.exposes).reduce((e,[o,r])=>(e[o]=p(r)||p(d(r,"index"))||r,e),{}),a=t=>{if(!t.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...y,...t},o=T(e),r=Object.keys(t.moduleFederationConfig.shared||{}).concat(Object.keys(t.moduleFederationConfig.remotes||{})),s=d(e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:r,compiledFilesFolder:s,mapComponentsToExpose:o}};import l from"adm-zip";import k from"ansi-colors";import b from"axios";import{join as f}from"path";var E=t=>f(t.distFolder,`${t.testsFolder}.zip`),u=async(t,e)=>{let o=new l;return o.addLocalFolder(e),o.writeZipPromise(E(t))},H=(t,e)=>o=>{throw o.message=k.red(`Network error: Unable to download federated mocks for '${t}' from '${e}' because '${o.message}', skipping...`),o},g=t=>async([e,o])=>{try{let r=await b.get(o,{responseType:"arraybuffer"}),s=f(t.mocksFolder,e);new l(Buffer.from(r.data)).extractAllTo(s,!0)}catch(r){H(e,o)(r)}};import{rm as j}from"fs/promises";import{join as q}from"path";var F=async(t,e)=>{let o=e.map(r=>{let s=q(t.mocksFolder,r);return j(s,{recursive:!0,force:!0})});return Promise.allSettled(o)};var ne=R(t=>{let{remoteOptions:e,compiledFilesFolder:o,externalDeps:r,mapComponentsToExpose:s}=a(t);return{name:"native-federation-tests/remote",async writeBundle(){let n=D(e.additionalBundlerConfig,{external:r.map(i=>new RegExp(`^${i}`)),entry:s,outDir:o,silent:!0});try{await A(n),await u(e,o),e.deleteTestsFolder&&await $(o,{recursive:!0,force:!0}),console.log(m.green("Federated mocks created correctly"))}catch(i){console.error(m.red(`Unable to build federated mocks: ${i}`))}},webpack:n=>{n.options.devServer=U(n.options.devServer||{},{static:{directory:S(e.distFolder)}})}}}),ie=R(t=>{let{hostOptions:e,mapRemotesToDownload:o}=c(t);return{name:"native-federation-tests/host",async writeBundle(){e.deleteTestsFolder&&await F(e,Object.keys(o));let r=g(e),s=Object.entries(o).map(r);await Promise.allSettled(s),console.log(m.green("Federated mocks extraction completed"))}}});export{ne as a,ie as b};
@@ -0,0 +1,7 @@
1
+ import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
2
+ import 'tsup';
3
+
4
+ declare const NativeFederationTestsRemote: (options: RemoteOptions) => undefined;
5
+ declare const NativeFederationTestsHost: (options: HostOptions) => undefined;
6
+
7
+ export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/esbuild.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE5DDWTSLjs = require('./chunk-E5DDWTSL.js');var o=_chunkE5DDWTSLjs.a.esbuild,a= exports.NativeFederationTestsHost =_chunkE5DDWTSLjs.b.esbuild;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL52VPVYNjs = require('./chunk-L52VPVYN.js');var o=_chunkL52VPVYNjs.a.esbuild,a= exports.NativeFederationTestsHost =_chunkL52VPVYNjs.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-BUQMKDKE.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-PJZ7FSU4.mjs";var o=e.esbuild,a=t.esbuild;export{a as NativeFederationTestsHost,o as NativeFederationTestsRemote};
@@ -0,0 +1,8 @@
1
+ import * as unplugin from 'unplugin';
2
+ import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
3
+ import 'tsup';
4
+
5
+ declare const NativeFederationTestsRemote: unplugin.UnpluginInstance<RemoteOptions, boolean>;
6
+ declare const NativeFederationTestsHost: unplugin.UnpluginInstance<HostOptions, boolean>;
7
+
8
+ export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE5DDWTSLjs = require('./chunk-E5DDWTSL.js');exports.NativeFederationTestsHost = _chunkE5DDWTSLjs.b; exports.NativeFederationTestsRemote = _chunkE5DDWTSLjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL52VPVYNjs = require('./chunk-L52VPVYN.js');exports.NativeFederationTestsHost = _chunkL52VPVYNjs.b; exports.NativeFederationTestsRemote = _chunkL52VPVYNjs.a;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-BUQMKDKE.mjs";export{b as NativeFederationTestsHost,a as NativeFederationTestsRemote};
1
+ import{a,b}from"./chunk-PJZ7FSU4.mjs";export{b as NativeFederationTestsHost,a as NativeFederationTestsRemote};
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@module-federation/native-federation-tests",
3
+ "version": "0.2.1",
4
+ "description": "Bundler agnostic unplugin to share federated tests",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "files": [
9
+ "dist/",
10
+ "README.md"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "./rollup": {
19
+ "types": "./dist/rollup.d.ts",
20
+ "require": "./dist/rollup.js",
21
+ "import": "./dist/rollup.mjs"
22
+ },
23
+ "./vite": {
24
+ "types": "./dist/vite.d.ts",
25
+ "require": "./dist/vite.js",
26
+ "import": "./dist/vite.mjs"
27
+ },
28
+ "./webpack": {
29
+ "types": "./dist/webpack.d.ts",
30
+ "require": "./dist/webpack.js",
31
+ "import": "./dist/webpack.mjs"
32
+ },
33
+ "./esbuild": {
34
+ "types": "./dist/esbuild.d.ts",
35
+ "require": "./dist/esbuild.js",
36
+ "import": "./dist/esbuild.mjs"
37
+ },
38
+ "./rspack": {
39
+ "types": "./dist/rspack.d.ts",
40
+ "require": "./dist/rspack.js",
41
+ "import": "./dist/rspack.mjs"
42
+ }
43
+ },
44
+ "main": "./dist/index.js",
45
+ "types": "./dist/index.d.ts",
46
+ "keywords": [
47
+ "module federation",
48
+ "tests",
49
+ "remote tests",
50
+ "federated tests"
51
+ ],
52
+ "author": "Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com> (https://github.com/ilteoood)",
53
+ "license": "MIT",
54
+ "dependencies": {
55
+ "adm-zip": "^0.5.10",
56
+ "ansi-colors": "^4.1.3",
57
+ "axios": "^1.3.4",
58
+ "rambda": "^7.5.0",
59
+ "tsup": "^7.0.0",
60
+ "unplugin": "^1.3.1"
61
+ }
62
+ }
@@ -0,0 +1,8 @@
1
+ import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
2
+ import * as unplugin from 'unplugin';
3
+ import 'tsup';
4
+
5
+ declare const NativeFederationTestsRemote: (options: RemoteOptions) => unplugin.RollupPlugin | unplugin.RollupPlugin[];
6
+ declare const NativeFederationTestsHost: (options: HostOptions) => unplugin.RollupPlugin | unplugin.RollupPlugin[];
7
+
8
+ export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/rollup.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
2
+ import * as unplugin from 'unplugin';
2
3
  import 'tsup';
3
4
 
4
- declare const NativeFederationTestsRemote: (options: RemoteOptions) => undefined | undefined[];
5
- declare const NativeFederationTestsHost: (options: HostOptions) => undefined | undefined[];
5
+ declare const NativeFederationTestsRemote: (options: RemoteOptions) => unplugin.RollupPlugin | unplugin.RollupPlugin[];
6
+ declare const NativeFederationTestsHost: (options: HostOptions) => unplugin.RollupPlugin | unplugin.RollupPlugin[];
6
7
 
7
8
  export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/rollup.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE5DDWTSLjs = require('./chunk-E5DDWTSL.js');var s=_chunkE5DDWTSLjs.a.rollup,a= exports.NativeFederationTestsHost =_chunkE5DDWTSLjs.b.rollup;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL52VPVYNjs = require('./chunk-L52VPVYN.js');var s=_chunkL52VPVYNjs.a.rollup,a= exports.NativeFederationTestsHost =_chunkL52VPVYNjs.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-BUQMKDKE.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-PJZ7FSU4.mjs";var s=e.rollup,a=t.rollup;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
@@ -0,0 +1,7 @@
1
+ import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
2
+ import 'tsup';
3
+
4
+ declare const NativeFederationTestsRemote: (options: RemoteOptions) => RspackPluginInstance;
5
+ declare const NativeFederationTestsHost: (options: HostOptions) => RspackPluginInstance;
6
+
7
+ export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/rspack.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE5DDWTSLjs = require('./chunk-E5DDWTSL.js');var o=_chunkE5DDWTSLjs.a.rspack,a= exports.NativeFederationTestsHost =_chunkE5DDWTSLjs.b.rspack;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL52VPVYNjs = require('./chunk-L52VPVYN.js');var o=_chunkL52VPVYNjs.a.rspack,a= exports.NativeFederationTestsHost =_chunkL52VPVYNjs.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-BUQMKDKE.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-PJZ7FSU4.mjs";var o=e.rspack,a=t.rspack;export{a as NativeFederationTestsHost,o as NativeFederationTestsRemote};
@@ -0,0 +1,7 @@
1
+ import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
2
+ import 'tsup';
3
+
4
+ declare const NativeFederationTestsRemote: (options: RemoteOptions) => any;
5
+ declare const NativeFederationTestsHost: (options: HostOptions) => any;
6
+
7
+ export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/vite.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE5DDWTSLjs = require('./chunk-E5DDWTSL.js');var s=_chunkE5DDWTSLjs.a.vite,i= exports.NativeFederationTestsHost =_chunkE5DDWTSLjs.b.vite;exports.NativeFederationTestsHost = i; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL52VPVYNjs = require('./chunk-L52VPVYN.js');var s=_chunkL52VPVYNjs.a.vite,i= exports.NativeFederationTestsHost =_chunkL52VPVYNjs.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-BUQMKDKE.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-PJZ7FSU4.mjs";var s=t.vite,i=e.vite;export{i as NativeFederationTestsHost,s as NativeFederationTestsRemote};
@@ -0,0 +1,7 @@
1
+ import { R as RemoteOptions, H as HostOptions } from './RemoteOptions-ae724cfa.js';
2
+ import 'tsup';
3
+
4
+ declare const NativeFederationTestsRemote: (options: RemoteOptions) => undefined;
5
+ declare const NativeFederationTestsHost: (options: HostOptions) => undefined;
6
+
7
+ export { NativeFederationTestsHost, NativeFederationTestsRemote };
package/dist/webpack.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE5DDWTSLjs = require('./chunk-E5DDWTSL.js');var s=_chunkE5DDWTSLjs.a.webpack,a= exports.NativeFederationTestsHost =_chunkE5DDWTSLjs.b.webpack;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL52VPVYNjs = require('./chunk-L52VPVYN.js');var s=_chunkL52VPVYNjs.a.webpack,a= exports.NativeFederationTestsHost =_chunkL52VPVYNjs.b.webpack;exports.NativeFederationTestsHost = a; exports.NativeFederationTestsRemote = s;
package/dist/webpack.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t}from"./chunk-BUQMKDKE.mjs";var s=e.webpack,a=t.webpack;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
1
+ import{a as e,b as t}from"./chunk-PJZ7FSU4.mjs";var s=e.webpack,a=t.webpack;export{a as NativeFederationTestsHost,s as NativeFederationTestsRemote};
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@module-federation/native-federation-tests",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Bundler agnostic unplugin to share federated tests",
5
5
  "publishConfig": {
6
- "registry": "https://registry.npmjs.org/"
6
+ "access": "public"
7
7
  },
8
+ "files": [
9
+ "dist/",
10
+ "README.md"
11
+ ],
8
12
  "exports": {
9
13
  ".": {
10
14
  "import": "./dist/index.mjs",
@@ -52,7 +56,7 @@
52
56
  "ansi-colors": "^4.1.3",
53
57
  "axios": "^1.3.4",
54
58
  "rambda": "^7.5.0",
55
- "tsup": "^6.7.0",
59
+ "tsup": "^7.0.0",
56
60
  "unplugin": "^1.3.1"
57
61
  }
58
- }
62
+ }
package/CHANGELOG.md DELETED
@@ -1,35 +0,0 @@
1
- # Changelog
2
-
3
- This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
-
5
- ## [0.1.2](https://github.com/module-federation/nextjs-mf/compare/native-federation-tests-0.1.1...native-federation-tests-0.1.2) (2023-04-14)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * tests regex, external deps should be removed using the startsWith strategy ([5d1c0f5](https://github.com/module-federation/nextjs-mf/commit/5d1c0f5b947ec7690fbe69ec8cc23701f975bae9))
11
-
12
-
13
-
14
- ## [0.1.1](https://github.com/module-federation/nextjs-mf/compare/native-federation-tests-0.1.0...native-federation-tests-0.1.1) (2023-04-12)
15
-
16
-
17
-
18
- # 0.1.0 (2023-04-11)
19
-
20
-
21
- ### Bug Fixes
22
-
23
- * build ([d0b2f72](https://github.com/module-federation/nextjs-mf/commit/d0b2f72f4fc3647825412be1574311c3152cf167))
24
- * build step ([a217170](https://github.com/module-federation/nextjs-mf/commit/a21717096cbc09bff20d3aeebfea2f3533afb0d7))
25
- * deps ([a378441](https://github.com/module-federation/nextjs-mf/commit/a37844194a3f189cc5863bbdd4776259bce69fa4))
26
- * native build chunks ([d6c9f8a](https://github.com/module-federation/nextjs-mf/commit/d6c9f8a957ed00a8d92332ccc38ed9780f01d54e))
27
- * package name ([dcb8480](https://github.com/module-federation/nextjs-mf/commit/dcb848025bbe56a7fc5bd3643462a64d22699cc7))
28
- * readme ([eaca0b3](https://github.com/module-federation/nextjs-mf/commit/eaca0b311d3b8d9e73309cb92d9a9488f9fc23c0))
29
- * readme ([74fc6fa](https://github.com/module-federation/nextjs-mf/commit/74fc6fa21ac10ce3cd9dd942a5b392ef50c51f56))
30
- * README.md ([9159171](https://github.com/module-federation/nextjs-mf/commit/91591712e9a103fff351f0a168c149470c0d69ad))
31
-
32
-
33
- ### Features
34
-
35
- * federated tests plugin ([063ab33](https://github.com/module-federation/nextjs-mf/commit/063ab336c4830aff4f5bd3b9894df60b4651a9be))
@@ -1 +0,0 @@
1
- import m from"ansi-colors";import{rm as q}from"fs/promises";import{resolve as $}from"path";import{mergeDeepRight as S,mergeRight as D}from"rambda";import{build as U}from"tsup";import{createUnplugin as O}from"unplugin";var R={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0},w=(o,e)=>{let t=e.split("@").at(-1),r=new URL(t);return r.pathname=`${o.testsFolder}.zip`,r.href},x=o=>Object.entries(o.moduleFederationConfig.remotes).reduce((e,[t,r])=>(e[t]=w(o,r),e),{}),c=o=>{if(!o.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...R,...o},t=x(e);return{hostOptions:e,mapRemotesToDownload:t}};import{existsSync as v}from"fs";import{join as d}from"path";var y={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},h=["ts","tsx","js","jsx","mjs"],p=o=>{let e=process.cwd();for(let t of h){let r=d(e,`${o}.${t}`);if(v(r))return r}},C=o=>Object.entries(o.moduleFederationConfig.exposes).reduce((e,[t,r])=>(e[t]=p(r)||p(d(r,"index"))||r,e),{}),a=o=>{if(!o.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...y,...o},t=C(e),r=Object.keys(o.moduleFederationConfig.shared||{}).concat(Object.keys(o.moduleFederationConfig.remotes||{})),s=d(e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:r,compiledFilesFolder:s,mapComponentsToExpose:t}};import l from"adm-zip";import T from"ansi-colors";import b from"axios";import{join as f}from"path";var k=o=>f(o.distFolder,`${o.testsFolder}.zip`),u=async(o,e)=>{let t=new l;return t.addLocalFolder(e),t.writeZipPromise(k(o))},H=(o,e)=>t=>{throw console.error(T.red(`Unable to download federated mocks for '${o}' from '${e}' because '${t.message}', skipping...`)),t},g=o=>async([e,t])=>{let r=await b.get(t,{responseType:"arraybuffer"}).catch(H(e,t)),s=f(o.mocksFolder,e);new l(Buffer.from(r.data)).extractAllTo(s,!0)};import{rm as j}from"fs/promises";import{join as E}from"path";var F=async(o,e)=>{let t=e.map(r=>{let s=E(o.mocksFolder,r);return j(s,{recursive:!0,force:!0})});return Promise.allSettled(t)};var se=O(o=>{let{remoteOptions:e,compiledFilesFolder:t,externalDeps:r,mapComponentsToExpose:s}=a(o);return{name:"native-federation-tests/remote",async writeBundle(){let n=D(e.additionalBundlerConfig,{external:r.map(i=>new RegExp(`^${i}`)),entry:s,outDir:t,silent:!0});try{await U(n),await u(e,t),e.deleteTestsFolder&&await q(t,{recursive:!0,force:!0}),console.log(m.green("Federated mocks created correctly"))}catch(i){console.error(m.red(`Unable to build federated mocks: ${i}`))}},webpack:n=>{n.options.devServer=S(n.options.devServer||{},{static:{directory:$(e.distFolder)}})}}}),ne=O(o=>{let{hostOptions:e,mapRemotesToDownload:t}=c(o);return{name:"native-federation-tests/host",async writeBundle(){e.deleteTestsFolder&&await F(e,Object.keys(t));let r=g(e),s=Object.entries(t).map(r);await Promise.allSettled(s),console.log(m.green("Federated mocks extraction completed"))}}});export{se as a,ne 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 R={testsFolder:"@mf-tests",mocksFolder:"./__mocks__",deleteTestsFolder:!0},w=(o,e)=>{let t=e.split("@").at(-1),r=new URL(t);return r.pathname=`${o.testsFolder}.zip`,r.href},x=o=>Object.entries(o.moduleFederationConfig.remotes).reduce((e,[t,r])=>(e[t]=w(o,r),e),{}),c=o=>{if(!o.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...R,...o},t=x(e);return{hostOptions:e,mapRemotesToDownload:t}};var _fs = require('fs');var y={testsFolder:"@mf-tests",distFolder:"./dist",deleteTestsFolder:!0,additionalBundlerConfig:{}},h=["ts","tsx","js","jsx","mjs"],p=o=>{let e=process.cwd();for(let t of h){let r=_path.join.call(void 0, e,`${o}.${t}`);if(_fs.existsSync.call(void 0, r))return r}},C=o=>Object.entries(o.moduleFederationConfig.exposes).reduce((e,[t,r])=>(e[t]=p(r)||p(_path.join.call(void 0, r,"index"))||r,e),{}),a=o=>{if(!o.moduleFederationConfig)throw new Error("moduleFederationConfig is required");let e={...y,...o},t=C(e),r=Object.keys(o.moduleFederationConfig.shared||{}).concat(Object.keys(o.moduleFederationConfig.remotes||{})),s=_path.join.call(void 0, e.distFolder,e.testsFolder);return{remoteOptions:e,externalDeps:r,compiledFilesFolder:s,mapComponentsToExpose:t}};var _admzip = require('adm-zip'); var _admzip2 = _interopRequireDefault(_admzip);var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var k=o=>_path.join.call(void 0, o.distFolder,`${o.testsFolder}.zip`),u=async(o,e)=>{let t=new _admzip2.default;return t.addLocalFolder(e),t.writeZipPromise(k(o))},H=(o,e)=>t=>{throw console.error(_ansicolors2.default.red(`Unable to download federated mocks for '${o}' from '${e}' because '${t.message}', skipping...`)),t},g=o=>async([e,t])=>{let r=await _axios2.default.get(t,{responseType:"arraybuffer"}).catch(H(e,t)),s=_path.join.call(void 0, o.mocksFolder,e);new (0, _admzip2.default)(Buffer.from(r.data)).extractAllTo(s,!0)};var F=async(o,e)=>{let t=e.map(r=>{let s=_path.join.call(void 0, o.mocksFolder,r);return _promises.rm.call(void 0, s,{recursive:!0,force:!0})});return Promise.allSettled(t)};var se=_unplugin.createUnplugin.call(void 0, o=>{let{remoteOptions:e,compiledFilesFolder:t,externalDeps:r,mapComponentsToExpose:s}=a(o);return{name:"native-federation-tests/remote",async writeBundle(){let n=_rambda.mergeRight.call(void 0, e.additionalBundlerConfig,{external:r.map(i=>new RegExp(`^${i}`)),entry:s,outDir:t,silent:!0});try{await _tsup.build.call(void 0, n),await u(e,t),e.deleteTestsFolder&&await _promises.rm.call(void 0, t,{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}`))}},webpack:n=>{n.options.devServer=_rambda.mergeDeepRight.call(void 0, n.options.devServer||{},{static:{directory:_path.resolve.call(void 0, e.distFolder)}})}}}),ne= exports.b =_unplugin.createUnplugin.call(void 0, o=>{let{hostOptions:e,mapRemotesToDownload:t}=c(o);return{name:"native-federation-tests/host",async writeBundle(){e.deleteTestsFolder&&await F(e,Object.keys(t));let r=g(e),s=Object.entries(t).map(r);await Promise.allSettled(s),console.log(_ansicolors2.default.green("Federated mocks extraction completed"))}}});exports.a = se; exports.b = ne;