@module-federation/esbuild 0.0.81 → 0.0.83

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.
Files changed (54) hide show
  1. package/dist/build.d.ts +5 -1
  2. package/dist/build.js +481 -0
  3. package/dist/build.mjs +380 -0
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +36 -0
  6. package/dist/index.mjs +2 -0
  7. package/dist/plugin.js +1247 -0
  8. package/dist/{plugin.esm.js → plugin.mjs} +198 -317
  9. package/dist/resolve/esm-resolver.mjs +22 -15
  10. package/package.json +18 -25
  11. package/dist/build.cjs.js +0 -532
  12. package/dist/build.cjs.js.map +0 -1
  13. package/dist/build.esm.js +0 -494
  14. package/dist/build.esm.js.map +0 -1
  15. package/dist/get-externals.cjs.js +0 -22
  16. package/dist/get-externals.cjs.js.map +0 -1
  17. package/dist/get-externals.esm.js +0 -20
  18. package/dist/get-externals.esm.js.map +0 -1
  19. package/dist/index.cjs.js +0 -6
  20. package/dist/index.cjs.js.map +0 -1
  21. package/dist/index.esm.js +0 -4
  22. package/dist/index.esm.js.map +0 -1
  23. package/dist/plugin.cjs.js +0 -1313
  24. package/dist/plugin.cjs.js.map +0 -1
  25. package/dist/plugin.d.ts +0 -1
  26. package/dist/plugin.esm.js.map +0 -1
  27. package/dist/src/build.d.ts +0 -5
  28. package/dist/src/index.d.ts +0 -2
  29. /package/dist/{src/adapters → adapters}/lib/collect-exports.d.ts +0 -0
  30. /package/dist/{src/adapters → adapters}/lib/commonjs.d.ts +0 -0
  31. /package/dist/{src/adapters → adapters}/lib/containerPlugin.d.ts +0 -0
  32. /package/dist/{src/adapters → adapters}/lib/containerReference.d.ts +0 -0
  33. /package/dist/{src/adapters → adapters}/lib/lexer.d.ts +0 -0
  34. /package/dist/{src/adapters → adapters}/lib/linkRemotesPlugin.d.ts +0 -0
  35. /package/dist/{src/adapters → adapters}/lib/manifest.d.ts +0 -0
  36. /package/dist/{src/adapters → adapters}/lib/plugin.d.ts +0 -0
  37. /package/dist/{src/adapters → adapters}/lib/react-replacements.d.ts +0 -0
  38. /package/dist/{src/adapters → adapters}/lib/transform.d.ts +0 -0
  39. /package/dist/{src/adapters → adapters}/lib/utils.d.ts +0 -0
  40. /package/dist/{src/lib → lib}/config/configuration-context.d.ts +0 -0
  41. /package/dist/{src/lib → lib}/config/federation-config.d.ts +0 -0
  42. /package/dist/{src/lib → lib}/config/share-utils.d.ts +0 -0
  43. /package/dist/{src/lib → lib}/config/with-native-federation.d.ts +0 -0
  44. /package/dist/{src/lib → lib}/core/build-adapter.d.ts +0 -0
  45. /package/dist/{src/lib → lib}/core/createContainerTemplate.d.ts +0 -0
  46. /package/dist/{src/lib → lib}/core/default-skip-list.d.ts +0 -0
  47. /package/dist/{src/lib → lib}/core/federation-options.d.ts +0 -0
  48. /package/dist/{src/lib → lib}/core/get-externals.d.ts +0 -0
  49. /package/dist/{src/lib → lib}/core/load-federation-config.d.ts +0 -0
  50. /package/dist/{src/lib → lib}/core/write-federation-info.d.ts +0 -0
  51. /package/dist/{src/lib → lib}/utils/logger.d.ts +0 -0
  52. /package/dist/{src/lib → lib}/utils/mapped-paths.d.ts +0 -0
  53. /package/dist/{src/lib → lib}/utils/normalize.d.ts +0 -0
  54. /package/dist/{src/lib → lib}/utils/package-info.d.ts +0 -0
package/dist/build.d.ts CHANGED
@@ -1 +1,5 @@
1
- export * from "./src/build";
1
+ export * from './lib/core/get-externals';
2
+ export * from './lib/core/load-federation-config';
3
+ export * from './lib/config/with-native-federation';
4
+ export * from './lib/config/share-utils';
5
+ export * from './lib/utils/logger';
package/dist/build.js ADDED
@@ -0,0 +1,481 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ shareAll: ()=>share_utils_shareAll,
37
+ setLogLevel: ()=>setLogLevel,
38
+ getExternals: ()=>getExternals,
39
+ addSecondaries: ()=>addSecondaries,
40
+ _findSecondaries: ()=>_findSecondaries,
41
+ findSecondaries: ()=>findSecondaries,
42
+ findPackageJson: ()=>findPackageJson,
43
+ getSecondaries: ()=>getSecondaries,
44
+ setInferVersion: ()=>setInferVersion,
45
+ share: ()=>share,
46
+ getDefaultEntry: ()=>getDefaultEntry,
47
+ logger: ()=>logger_logger,
48
+ DEFAULT_SECONARIES_SKIP_LIST: ()=>DEFAULT_SECONARIES_SKIP_LIST,
49
+ findRootTsConfigJson: ()=>share_utils_findRootTsConfigJson,
50
+ lookupVersionInMap: ()=>lookupVersionInMap,
51
+ lookupVersion: ()=>lookupVersion,
52
+ loadFederationConfig: ()=>loadFederationConfig,
53
+ readConfiguredSecondaries: ()=>readConfiguredSecondaries,
54
+ withFederation: ()=>withFederation
55
+ });
56
+ function getExternals(config) {
57
+ const shared = Object.keys(config.shared ?? {});
58
+ const remotes = config.remotes ?? {};
59
+ const remoteKeys = Object.keys(remotes).reduce((acc, key)=>{
60
+ if (!key) return acc;
61
+ acc.push(key);
62
+ acc.push(key + '/*');
63
+ return acc;
64
+ }, []);
65
+ const externals = [
66
+ ...shared,
67
+ ...remoteKeys
68
+ ];
69
+ return externals;
70
+ }
71
+ const external_path_namespaceObject = require("path");
72
+ var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
73
+ const external_fs_namespaceObject = require("fs");
74
+ var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
75
+ async function loadFederationConfig(fedOptions) {
76
+ const fullConfigPath = external_path_namespaceObject.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
77
+ if (!external_fs_namespaceObject.existsSync(fullConfigPath)) throw new Error('Expected ' + fullConfigPath);
78
+ const config = await import(`${fullConfigPath}`);
79
+ return config;
80
+ }
81
+ const DEFAULT_SKIP_LIST = [
82
+ '@module-federation/native-federation-runtime',
83
+ '@module-federation/native-federation',
84
+ '@module-federation/native-federation-core',
85
+ '@module-federation/native-federation-esbuild',
86
+ '@angular-architects/native-federation',
87
+ '@angular-architects/native-federation-runtime',
88
+ 'es-module-shims',
89
+ 'zone.js',
90
+ 'tslib/',
91
+ '@angular/localize',
92
+ '@angular/localize/init',
93
+ '@angular/localize/tools',
94
+ '@angular/platform-server',
95
+ '@angular/platform-server/init',
96
+ '@angular/ssr',
97
+ 'express',
98
+ /\/schematics(\/|$)/,
99
+ /^@nx\/angular/,
100
+ (pkg)=>pkg.startsWith('@angular/') && !!pkg.match(/\/testing(\/|$)/),
101
+ (pkg)=>pkg.startsWith('@types/'),
102
+ (pkg)=>pkg.startsWith('@module-federation/')
103
+ ];
104
+ const PREPARED_DEFAULT_SKIP_LIST = prepareSkipList(DEFAULT_SKIP_LIST);
105
+ function prepareSkipList(skipList) {
106
+ return {
107
+ strings: new Set(skipList.filter((e)=>'string' == typeof e)),
108
+ functions: skipList.filter((e)=>'function' == typeof e),
109
+ regexps: skipList.filter((e)=>e instanceof RegExp)
110
+ };
111
+ }
112
+ function default_skip_list_isInSkipList(entry, skipList) {
113
+ if (skipList.strings.has(entry)) return true;
114
+ if (skipList.functions.some((f)=>f(entry))) return true;
115
+ if (skipList.regexps.some((r)=>r.test(entry))) return true;
116
+ return false;
117
+ }
118
+ const external_process_namespaceObject = require("process");
119
+ var external_process_default = /*#__PURE__*/ __webpack_require__.n(external_process_namespaceObject);
120
+ let _context = {};
121
+ function getConfigContext() {
122
+ return _context;
123
+ }
124
+ const external_npmlog_namespaceObject = require("npmlog");
125
+ var external_npmlog_default = /*#__PURE__*/ __webpack_require__.n(external_npmlog_namespaceObject);
126
+ const levels = external_npmlog_default().levels;
127
+ external_npmlog_default().addLevel('error', levels.error, {
128
+ fg: 'brightWhite',
129
+ bg: 'red'
130
+ }, ' ERR! ');
131
+ external_npmlog_default().addLevel('warn', levels.info, {
132
+ fg: 'brightWhite',
133
+ bg: 'yellow'
134
+ }, ' WARN ');
135
+ external_npmlog_default().addLevel('info', levels.warn, {
136
+ fg: 'brightWhite',
137
+ bg: 'green'
138
+ }, ' INFO ');
139
+ external_npmlog_default().addLevel('notice', levels.notice, {
140
+ fg: 'black',
141
+ bg: 'brightYellow'
142
+ }, ' NOTE ');
143
+ external_npmlog_default().addLevel('verbose', levels.verbose, {
144
+ fg: 'brightWhite',
145
+ bg: 'brightBlue'
146
+ }, ' VRB! ');
147
+ external_npmlog_default().addLevel('silly', levels.silly, {
148
+ fg: 'black',
149
+ bg: 'white'
150
+ }, ' DBG! ');
151
+ const logger_logger = {
152
+ error: (msg)=>external_npmlog_default().error('', msg),
153
+ warn: (msg)=>external_npmlog_default().warn('', msg),
154
+ notice: (msg)=>external_npmlog_default().notice('', msg),
155
+ info: (msg)=>external_npmlog_default().info('', msg),
156
+ verbose: (msg)=>external_npmlog_default().verbose('', msg),
157
+ debug: (msg)=>external_npmlog_default().silly('', msg)
158
+ };
159
+ const setLogLevel = (level)=>{
160
+ external_npmlog_default().level = 'debug' === level ? 'silly' : level;
161
+ };
162
+ setLogLevel('info');
163
+ function normalize_normalize(path, trailingSlash) {
164
+ let cand = path.replace(/\\/g, '/');
165
+ if (void 0 === trailingSlash) return cand;
166
+ while(cand.endsWith('/'))cand = cand.substring(0, cand.length - 1);
167
+ if (trailingSlash) return cand + '/';
168
+ return cand;
169
+ }
170
+ const packageCache = {};
171
+ function findPackageJsonFiles(project, workspace) {
172
+ return expandFolders(project, workspace).map((f)=>external_path_namespaceObject.join(f, 'package.json')).filter((f)=>external_fs_namespaceObject.existsSync(f));
173
+ }
174
+ function expandFolders(child, parent) {
175
+ const result = [];
176
+ parent = normalize_normalize(parent, true);
177
+ child = normalize_normalize(child, true);
178
+ if (!child.startsWith(parent)) throw new Error(`Workspace folder ${parent} needs to be a parent of the project folder ${child}`);
179
+ let current = child;
180
+ while(current !== parent){
181
+ result.push(current);
182
+ const cand = normalize_normalize(external_path_namespaceObject.dirname(current), true);
183
+ if (cand === current) break;
184
+ current = cand;
185
+ }
186
+ result.push(parent);
187
+ return result;
188
+ }
189
+ function getVersionMapCacheKey(project, workspace) {
190
+ return `${project}**${workspace}`;
191
+ }
192
+ function getVersionMaps(project, workspace) {
193
+ return getPackageJsonFiles(project, workspace).map((json)=>({
194
+ ...json.content['dependencies']
195
+ }));
196
+ }
197
+ function getPackageJsonFiles(project, workspace) {
198
+ const cacheKey = getVersionMapCacheKey(project, workspace);
199
+ let maps = packageCache[cacheKey];
200
+ if (maps) return maps;
201
+ maps = findPackageJsonFiles(project, workspace).map((f)=>{
202
+ const content = JSON.parse(external_fs_namespaceObject.readFileSync(f, 'utf-8'));
203
+ const directory = normalize_normalize(external_path_namespaceObject.dirname(f), true);
204
+ const result = {
205
+ content,
206
+ directory
207
+ };
208
+ return result;
209
+ });
210
+ packageCache[cacheKey] = maps;
211
+ return maps;
212
+ }
213
+ function findDepPackageJson(packageName, projectRoot) {
214
+ const mainPkgName = getPkgFolder(packageName);
215
+ let mainPkgPath = external_path_namespaceObject.join(projectRoot, 'node_modules', mainPkgName);
216
+ let mainPkgJsonPath = external_path_namespaceObject.join(mainPkgPath, 'package.json');
217
+ let directory = projectRoot;
218
+ while(external_path_namespaceObject.dirname(directory) !== directory){
219
+ if (external_fs_namespaceObject.existsSync(mainPkgJsonPath)) break;
220
+ directory = normalize_normalize(external_path_namespaceObject.dirname(directory), true);
221
+ mainPkgPath = external_path_namespaceObject.join(directory, 'node_modules', mainPkgName);
222
+ mainPkgJsonPath = external_path_namespaceObject.join(mainPkgPath, 'package.json');
223
+ }
224
+ if (!external_fs_namespaceObject.existsSync(mainPkgJsonPath)) {
225
+ logger_logger.verbose('No package.json found for ' + packageName + ' in ' + mainPkgPath);
226
+ return null;
227
+ }
228
+ return mainPkgJsonPath;
229
+ }
230
+ function getPkgFolder(packageName) {
231
+ const parts = packageName.split('/');
232
+ let folder = parts[0];
233
+ if (folder.startsWith('@')) folder += '/' + parts[1];
234
+ return folder;
235
+ }
236
+ let share_utils_inferVersion = false;
237
+ const DEFAULT_SECONARIES_SKIP_LIST = [
238
+ '@angular/router/upgrade',
239
+ '@angular/common/upgrade'
240
+ ];
241
+ function share_utils_findRootTsConfigJson() {
242
+ const packageJson = findPackageJson(external_process_default().cwd());
243
+ const projectRoot = external_path_default().dirname(packageJson);
244
+ const tsConfigBaseJson = external_path_default().join(projectRoot, 'tsconfig.base.json');
245
+ const tsConfigJson = external_path_default().join(projectRoot, 'tsconfig.json');
246
+ if (external_fs_default().existsSync(tsConfigBaseJson)) return tsConfigBaseJson;
247
+ if (external_fs_default().existsSync(tsConfigJson)) return tsConfigJson;
248
+ throw new Error('Neither a tsconfig.json nor a tsconfig.base.json was found');
249
+ }
250
+ function findPackageJson(folder) {
251
+ while(!external_fs_default().existsSync(external_path_default().join(folder, 'package.json')) && external_path_default().dirname(folder) !== folder)folder = external_path_default().dirname(folder);
252
+ const filePath = external_path_default().join(folder, 'package.json');
253
+ if (external_fs_default().existsSync(filePath)) return filePath;
254
+ throw new Error(`No package.json found. Searched the following folder and all parents: ${folder}`);
255
+ }
256
+ function lookupVersion(key, workspaceRoot) {
257
+ const versionMaps = getVersionMaps(workspaceRoot, workspaceRoot);
258
+ for (const versionMap of versionMaps){
259
+ const version = lookupVersionInMap(key, versionMap);
260
+ if (version) return version;
261
+ }
262
+ throw new Error(`Shared Dependency ${key} has requiredVersion:'auto'. However, this dependency is not found in your package.json`);
263
+ }
264
+ function lookupVersionInMap(key, versions) {
265
+ const parts = key.split('/');
266
+ key = parts.length >= 2 && parts[0].startsWith('@') ? `${parts[0]}/${parts[1]}` : parts[0];
267
+ if ('@angular-architects/module-federation-runtime' === key.toLowerCase()) key = '@angular-architects/module-federation';
268
+ return versions[key] || null;
269
+ }
270
+ function _findSecondaries(libPath, excludes, shareObject, acc) {
271
+ const files = external_fs_default().readdirSync(libPath);
272
+ const dirs = files.map((f)=>external_path_default().join(libPath, f)).filter((f)=>external_fs_default().lstatSync(f).isDirectory() && 'node_modules' !== f);
273
+ const secondaries = dirs.filter((d)=>external_fs_default().existsSync(external_path_default().join(d, 'package.json')));
274
+ for (const s of secondaries){
275
+ const secondaryLibName = s.replace(/\\/g, '/').replace(/^.*node_modules[/]/, '');
276
+ if (!excludes.includes(secondaryLibName)) {
277
+ if (!default_skip_list_isInSkipList(secondaryLibName, PREPARED_DEFAULT_SKIP_LIST)) {
278
+ acc[secondaryLibName] = {
279
+ ...shareObject
280
+ };
281
+ _findSecondaries(s, excludes, shareObject, acc);
282
+ }
283
+ }
284
+ }
285
+ }
286
+ function findSecondaries(libPath, excludes, shareObject) {
287
+ const acc = {};
288
+ _findSecondaries(libPath, excludes, shareObject, acc);
289
+ return acc;
290
+ }
291
+ function getSecondaries(includeSecondaries, libPath, key, shareObject) {
292
+ let exclude = [
293
+ ...DEFAULT_SECONARIES_SKIP_LIST
294
+ ];
295
+ if ('object' == typeof includeSecondaries) {
296
+ if (Array.isArray(includeSecondaries.skip)) exclude = includeSecondaries.skip;
297
+ else if ('string' == typeof includeSecondaries.skip) exclude = [
298
+ includeSecondaries.skip
299
+ ];
300
+ }
301
+ if (!external_fs_default().existsSync(libPath)) return {};
302
+ const configured = readConfiguredSecondaries(key, libPath, exclude, shareObject);
303
+ if (configured) return configured;
304
+ return findSecondaries(libPath, exclude, shareObject);
305
+ }
306
+ function readConfiguredSecondaries(parent, libPath, exclude, shareObject) {
307
+ const libPackageJson = external_path_default().join(libPath, 'package.json');
308
+ if (!external_fs_default().existsSync(libPackageJson)) return null;
309
+ const packageJson = JSON.parse(external_fs_default().readFileSync(libPackageJson, 'utf-8'));
310
+ const exports1 = packageJson['exports'];
311
+ if (!exports1) return null;
312
+ const keys = Object.keys(exports1).filter((key)=>'.' !== key && './package.json' !== key && !key.endsWith('*') && (exports1[key]['default'] || 'string' == typeof exports1[key]));
313
+ const result = {};
314
+ for (const key of keys){
315
+ const secondaryName = external_path_default().join(parent, key).replace(/\\/g, '/');
316
+ if (exclude.includes(secondaryName)) continue;
317
+ if (default_skip_list_isInSkipList(secondaryName, PREPARED_DEFAULT_SKIP_LIST)) continue;
318
+ const entry = getDefaultEntry(exports1, key);
319
+ if ('string' != typeof entry) {
320
+ console.log(`No entry point found for ${secondaryName}`);
321
+ continue;
322
+ }
323
+ if (![
324
+ '.css',
325
+ '.scss',
326
+ '.less'
327
+ ].some((ext)=>entry.endsWith(ext))) result[secondaryName] = {
328
+ ...shareObject
329
+ };
330
+ }
331
+ return result;
332
+ }
333
+ function getDefaultEntry(exports1, key) {
334
+ let entry;
335
+ if ('string' == typeof exports1[key]) entry = exports1[key];
336
+ else {
337
+ var _exports_key;
338
+ entry = null == (_exports_key = exports1[key]) ? void 0 : _exports_key['default'];
339
+ if ('object' == typeof entry) entry = entry['default'];
340
+ }
341
+ return entry;
342
+ }
343
+ function share_utils_shareAll(config, skip = DEFAULT_SKIP_LIST, projectPath = '') {
344
+ projectPath = inferProjectPath(projectPath);
345
+ const versionMaps = getVersionMaps(projectPath, projectPath);
346
+ const shareConfig = {};
347
+ for (const versions of versionMaps){
348
+ const preparedSkipList = prepareSkipList(skip);
349
+ for(const key in versions){
350
+ if (default_skip_list_isInSkipList(key, preparedSkipList)) continue;
351
+ const inferVersion = !config.requiredVersion || 'auto' === config.requiredVersion;
352
+ const requiredVersion = inferVersion ? versions[key] : config.requiredVersion;
353
+ if (!shareConfig[key]) shareConfig[key] = {
354
+ ...config,
355
+ requiredVersion
356
+ };
357
+ }
358
+ }
359
+ return share(share, projectPath);
360
+ }
361
+ function inferProjectPath(projectPath) {
362
+ if (!projectPath) projectPath = external_path_default().dirname(getConfigContext().packageJson || '');
363
+ if (!projectPath && getConfigContext().workspaceRoot) projectPath = getConfigContext().workspaceRoot || '';
364
+ if (!projectPath) projectPath = external_process_default().cwd();
365
+ return projectPath;
366
+ }
367
+ function setInferVersion(infer) {
368
+ share_utils_inferVersion = infer;
369
+ }
370
+ function share(shareObjects, projectPath = '') {
371
+ projectPath = inferProjectPath(projectPath);
372
+ const packagePath = findPackageJson(projectPath);
373
+ const result = {};
374
+ let includeSecondaries;
375
+ for(const key in shareObjects){
376
+ includeSecondaries = false;
377
+ const shareObject = shareObjects[key];
378
+ if ('auto' === shareObject.requiredVersion || share_utils_inferVersion && void 0 === shareObject.requiredVersion) {
379
+ const version = lookupVersion(key, projectPath);
380
+ shareObject.requiredVersion = version;
381
+ shareObject.version = version.replace(/^\D*/, '');
382
+ }
383
+ if (void 0 === shareObject.includeSecondaries) shareObject.includeSecondaries = true;
384
+ if (shareObject.includeSecondaries) {
385
+ includeSecondaries = shareObject.includeSecondaries;
386
+ delete shareObject.includeSecondaries;
387
+ }
388
+ result[key] = shareObject;
389
+ if (includeSecondaries) {
390
+ const libPackageJson = findDepPackageJson(key, external_path_default().dirname(packagePath));
391
+ if (!libPackageJson) {
392
+ logger_logger.error(`Could not find folder containing dep ${key}`);
393
+ continue;
394
+ }
395
+ const libPath = external_path_default().dirname(libPackageJson);
396
+ const secondaries = getSecondaries(includeSecondaries, libPath, key, shareObject);
397
+ if (secondaries) addSecondaries(secondaries, result);
398
+ }
399
+ }
400
+ return result;
401
+ }
402
+ function addSecondaries(secondaries, result) {
403
+ Object.assign(result, secondaries);
404
+ }
405
+ require("json5");
406
+ function withFederation(config) {
407
+ const skip = prepareSkipList(config.skip ?? []);
408
+ return {
409
+ name: config.name ?? '',
410
+ filename: config.filename ?? 'remoteEntry',
411
+ exposes: config.exposes ?? {},
412
+ remotes: config.remotes ?? {},
413
+ shared: normalizeShared(config, skip)
414
+ };
415
+ }
416
+ function normalizeShared(config, skip) {
417
+ let result = {};
418
+ const shared = config.shared;
419
+ result = shared ? Object.keys(shared).reduce((acc, cur)=>({
420
+ ...acc,
421
+ [cur]: {
422
+ requiredVersion: shared[cur].requiredVersion ?? 'auto',
423
+ singleton: shared[cur].singleton ?? false,
424
+ strictVersion: shared[cur].strictVersion ?? false,
425
+ version: shared[cur].version,
426
+ includeSecondaries: shared[cur].includeSecondaries
427
+ }
428
+ }), {}) : share_utils_shareAll({
429
+ singleton: true,
430
+ strictVersion: true,
431
+ requiredVersion: 'auto'
432
+ });
433
+ result = Object.keys(result).filter((key)=>!default_skip_list_isInSkipList(key, skip)).reduce((acc, cur)=>({
434
+ ...acc,
435
+ [cur]: result[cur]
436
+ }), {});
437
+ return result;
438
+ }
439
+ exports.DEFAULT_SECONARIES_SKIP_LIST = __webpack_exports__.DEFAULT_SECONARIES_SKIP_LIST;
440
+ exports._findSecondaries = __webpack_exports__._findSecondaries;
441
+ exports.addSecondaries = __webpack_exports__.addSecondaries;
442
+ exports.findPackageJson = __webpack_exports__.findPackageJson;
443
+ exports.findRootTsConfigJson = __webpack_exports__.findRootTsConfigJson;
444
+ exports.findSecondaries = __webpack_exports__.findSecondaries;
445
+ exports.getDefaultEntry = __webpack_exports__.getDefaultEntry;
446
+ exports.getExternals = __webpack_exports__.getExternals;
447
+ exports.getSecondaries = __webpack_exports__.getSecondaries;
448
+ exports.loadFederationConfig = __webpack_exports__.loadFederationConfig;
449
+ exports.logger = __webpack_exports__.logger;
450
+ exports.lookupVersion = __webpack_exports__.lookupVersion;
451
+ exports.lookupVersionInMap = __webpack_exports__.lookupVersionInMap;
452
+ exports.readConfiguredSecondaries = __webpack_exports__.readConfiguredSecondaries;
453
+ exports.setInferVersion = __webpack_exports__.setInferVersion;
454
+ exports.setLogLevel = __webpack_exports__.setLogLevel;
455
+ exports.share = __webpack_exports__.share;
456
+ exports.shareAll = __webpack_exports__.shareAll;
457
+ exports.withFederation = __webpack_exports__.withFederation;
458
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
459
+ "DEFAULT_SECONARIES_SKIP_LIST",
460
+ "_findSecondaries",
461
+ "addSecondaries",
462
+ "findPackageJson",
463
+ "findRootTsConfigJson",
464
+ "findSecondaries",
465
+ "getDefaultEntry",
466
+ "getExternals",
467
+ "getSecondaries",
468
+ "loadFederationConfig",
469
+ "logger",
470
+ "lookupVersion",
471
+ "lookupVersionInMap",
472
+ "readConfiguredSecondaries",
473
+ "setInferVersion",
474
+ "setLogLevel",
475
+ "share",
476
+ "shareAll",
477
+ "withFederation"
478
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
479
+ Object.defineProperty(exports, '__esModule', {
480
+ value: true
481
+ });