@softarc/native-federation-orchestrator 4.8.0 → 4.10.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/README.md +2 -2
- package/fesm2022/@softarc/native-federation-orchestrator.mjs +874 -343
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +4 -4
- package/fesm2022/module-federation.mjs +78 -21
- package/fesm2022/module-federation.mjs.map +3 -3
- package/fesm2022/node.mjs +949 -347
- package/fesm2022/node.mjs.map +4 -4
- package/fesm2022/options.mjs +27 -2
- package/fesm2022/options.mjs.map +3 -3
- package/package.json +3 -3
- package/quickstart.mjs +16 -14
- package/types/lib/core/1.domain/externals/basis.d.ts +2 -2
- package/types/lib/core/1.domain/externals/claims.d.ts +1 -2
- package/types/lib/core/1.domain/externals/serving.d.ts +2 -2
- package/types/lib/core/1.domain/externals/specifier.d.ts +11 -6
- package/types/lib/core/1.domain/externals/version.contract.d.ts +4 -0
- package/types/lib/core/1.domain/import-map/eager-preloads.d.ts +10 -0
- package/types/lib/core/1.domain/pooling/builds.d.ts +9 -3
- package/types/lib/core/1.domain/pooling/election.d.ts +2 -1
- package/types/lib/core/1.domain/pooling/gate.d.ts +4 -2
- package/types/lib/core/1.domain/pooling/membership.d.ts +4 -2
- package/types/lib/core/1.domain/pooling/plan.d.ts +2 -0
- package/types/lib/core/1.domain/remote/remote-module.contract.d.ts +1 -0
- package/types/lib/core/1.domain/remote-entry/mark-dense.d.ts +2 -0
- package/types/lib/core/1.domain/remote-entry/remote-entry.contract.d.ts +6 -3
- package/types/lib/core/2.app/config/import-map.contract.d.ts +4 -7
- package/types/lib/core/2.app/config/index.d.ts +2 -2
- package/types/lib/core/2.app/config/mode.contract.d.ts +2 -0
- package/types/lib/core/2.app/driver-ports/init/flow.contract.d.ts +2 -4
- package/types/lib/core/2.app/driver-ports/init/for-exposing-module-loader.port.d.ts +6 -2
- package/types/lib/core/2.app/driving-ports/for-browser-tasks.d.ts +1 -0
- package/types/lib/core/2.app/driving-ports/for-remote-info-storage.port.d.ts +1 -0
- package/types/lib/core/2.app/steps/collect-eager-preloads.d.ts +4 -0
- package/types/lib/core/2.app/steps/get-remote-entries.d.ts +1 -1
- package/types/lib/core/2.app/steps/preload-hint.d.ts +4 -0
- package/types/lib/core/2.app/steps/store-remote-entry.d.ts +0 -14
- package/types/lib/core/3.adapters/remote-entry/normalize-remote-entry.d.ts +4 -0
- package/types/lib/core/4.config/import-map/index.d.ts +2 -0
- package/types/lib/core/4.config/import-map/no-preload.d.ts +2 -0
- package/types/lib/core/4.config/import-map/preload-in-dom.d.ts +2 -0
- package/types/lib/core/4.config/storage/storage.config.d.ts +2 -1
- package/types/lib/core/5.di/federation-result.factory.d.ts +3 -2
- package/types/lib/core/init-federation.contract.d.ts +2 -0
- package/types/lib/index.d.ts +1 -1
- package/types/lib/node/adapters/fs-remote-entry-provider.d.ts +2 -1
- package/types/lib/node/init-federation.node.d.ts +2 -7
- package/types/lib/node.index.d.ts +1 -1
- package/types/lib/utils/union-find.d.ts +4 -0
package/fesm2022/node.mjs
CHANGED
|
@@ -28,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// node_modules/.pnpm/semver@7.8.
|
|
31
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/debug.js
|
|
32
32
|
var require_debug = __commonJS({
|
|
33
|
-
"node_modules/.pnpm/semver@7.8.
|
|
33
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/debug.js"(exports, module) {
|
|
34
34
|
"use strict";
|
|
35
35
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
36
36
|
};
|
|
@@ -38,9 +38,9 @@ var require_debug = __commonJS({
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// node_modules/.pnpm/semver@7.8.
|
|
41
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/constants.js
|
|
42
42
|
var require_constants = __commonJS({
|
|
43
|
-
"node_modules/.pnpm/semver@7.8.
|
|
43
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/constants.js"(exports, module) {
|
|
44
44
|
"use strict";
|
|
45
45
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
46
46
|
var MAX_LENGTH = 256;
|
|
@@ -48,6 +48,33 @@ var require_constants = __commonJS({
|
|
|
48
48
|
9007199254740991;
|
|
49
49
|
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
50
50
|
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
51
|
+
var WHITESPACE_CHARACTERS = [
|
|
52
|
+
" ",
|
|
53
|
+
"\n",
|
|
54
|
+
"\v",
|
|
55
|
+
"\f",
|
|
56
|
+
"\r",
|
|
57
|
+
" ",
|
|
58
|
+
"\xA0",
|
|
59
|
+
"\u1680",
|
|
60
|
+
"\u2000",
|
|
61
|
+
"\u2001",
|
|
62
|
+
"\u2002",
|
|
63
|
+
"\u2003",
|
|
64
|
+
"\u2004",
|
|
65
|
+
"\u2005",
|
|
66
|
+
"\u2006",
|
|
67
|
+
"\u2007",
|
|
68
|
+
"\u2008",
|
|
69
|
+
"\u2009",
|
|
70
|
+
"\u200A",
|
|
71
|
+
"\u2028",
|
|
72
|
+
"\u2029",
|
|
73
|
+
"\u202F",
|
|
74
|
+
"\u205F",
|
|
75
|
+
"\u3000",
|
|
76
|
+
"\uFEFF"
|
|
77
|
+
];
|
|
51
78
|
var RELEASE_TYPES = [
|
|
52
79
|
"major",
|
|
53
80
|
"premajor",
|
|
@@ -62,6 +89,7 @@ var require_constants = __commonJS({
|
|
|
62
89
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
63
90
|
MAX_SAFE_BUILD_LENGTH,
|
|
64
91
|
MAX_SAFE_INTEGER,
|
|
92
|
+
WHITESPACE_CHARACTERS,
|
|
65
93
|
RELEASE_TYPES,
|
|
66
94
|
SEMVER_SPEC_VERSION,
|
|
67
95
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
@@ -70,9 +98,9 @@ var require_constants = __commonJS({
|
|
|
70
98
|
}
|
|
71
99
|
});
|
|
72
100
|
|
|
73
|
-
// node_modules/.pnpm/semver@7.8.
|
|
101
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/re.js
|
|
74
102
|
var require_re = __commonJS({
|
|
75
|
-
"node_modules/.pnpm/semver@7.8.
|
|
103
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/re.js"(exports, module) {
|
|
76
104
|
"use strict";
|
|
77
105
|
var {
|
|
78
106
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
@@ -158,9 +186,9 @@ var require_re = __commonJS({
|
|
|
158
186
|
}
|
|
159
187
|
});
|
|
160
188
|
|
|
161
|
-
// node_modules/.pnpm/semver@7.8.
|
|
189
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/parse-options.js
|
|
162
190
|
var require_parse_options = __commonJS({
|
|
163
|
-
"node_modules/.pnpm/semver@7.8.
|
|
191
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
164
192
|
"use strict";
|
|
165
193
|
var looseOption = Object.freeze({ loose: true });
|
|
166
194
|
var emptyOpts = Object.freeze({});
|
|
@@ -177,9 +205,9 @@ var require_parse_options = __commonJS({
|
|
|
177
205
|
}
|
|
178
206
|
});
|
|
179
207
|
|
|
180
|
-
// node_modules/.pnpm/semver@7.8.
|
|
208
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/identifiers.js
|
|
181
209
|
var require_identifiers = __commonJS({
|
|
182
|
-
"node_modules/.pnpm/semver@7.8.
|
|
210
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
183
211
|
"use strict";
|
|
184
212
|
var numeric = /^[0-9]+$/;
|
|
185
213
|
var compareIdentifiers = (a, b) => {
|
|
@@ -202,9 +230,9 @@ var require_identifiers = __commonJS({
|
|
|
202
230
|
}
|
|
203
231
|
});
|
|
204
232
|
|
|
205
|
-
// node_modules/.pnpm/semver@7.8.
|
|
233
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/semver.js
|
|
206
234
|
var require_semver = __commonJS({
|
|
207
|
-
"node_modules/.pnpm/semver@7.8.
|
|
235
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/semver.js"(exports, module) {
|
|
208
236
|
"use strict";
|
|
209
237
|
var debug = require_debug();
|
|
210
238
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
@@ -494,9 +522,9 @@ var require_semver = __commonJS({
|
|
|
494
522
|
}
|
|
495
523
|
});
|
|
496
524
|
|
|
497
|
-
// node_modules/.pnpm/semver@7.8.
|
|
525
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/parse.js
|
|
498
526
|
var require_parse = __commonJS({
|
|
499
|
-
"node_modules/.pnpm/semver@7.8.
|
|
527
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/parse.js"(exports, module) {
|
|
500
528
|
"use strict";
|
|
501
529
|
var SemVer2 = require_semver();
|
|
502
530
|
var parse = (version, options, throwErrors = false) => {
|
|
@@ -516,9 +544,9 @@ var require_parse = __commonJS({
|
|
|
516
544
|
}
|
|
517
545
|
});
|
|
518
546
|
|
|
519
|
-
// node_modules/.pnpm/semver@7.8.
|
|
547
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/valid.js
|
|
520
548
|
var require_valid = __commonJS({
|
|
521
|
-
"node_modules/.pnpm/semver@7.8.
|
|
549
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/valid.js"(exports, module) {
|
|
522
550
|
"use strict";
|
|
523
551
|
var parse = require_parse();
|
|
524
552
|
var valid = (version, options) => {
|
|
@@ -529,9 +557,9 @@ var require_valid = __commonJS({
|
|
|
529
557
|
}
|
|
530
558
|
});
|
|
531
559
|
|
|
532
|
-
// node_modules/.pnpm/semver@7.8.
|
|
560
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/lrucache.js
|
|
533
561
|
var require_lrucache = __commonJS({
|
|
534
|
-
"node_modules/.pnpm/semver@7.8.
|
|
562
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
535
563
|
"use strict";
|
|
536
564
|
var LRUCache = class {
|
|
537
565
|
constructor() {
|
|
@@ -567,9 +595,9 @@ var require_lrucache = __commonJS({
|
|
|
567
595
|
}
|
|
568
596
|
});
|
|
569
597
|
|
|
570
|
-
// node_modules/.pnpm/semver@7.8.
|
|
598
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare.js
|
|
571
599
|
var require_compare = __commonJS({
|
|
572
|
-
"node_modules/.pnpm/semver@7.8.
|
|
600
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/compare.js"(exports, module) {
|
|
573
601
|
"use strict";
|
|
574
602
|
var SemVer2 = require_semver();
|
|
575
603
|
var compare = (a, b, loose) => new SemVer2(a, loose).compare(new SemVer2(b, loose));
|
|
@@ -577,9 +605,9 @@ var require_compare = __commonJS({
|
|
|
577
605
|
}
|
|
578
606
|
});
|
|
579
607
|
|
|
580
|
-
// node_modules/.pnpm/semver@7.8.
|
|
608
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/eq.js
|
|
581
609
|
var require_eq = __commonJS({
|
|
582
|
-
"node_modules/.pnpm/semver@7.8.
|
|
610
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/eq.js"(exports, module) {
|
|
583
611
|
"use strict";
|
|
584
612
|
var compare = require_compare();
|
|
585
613
|
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
@@ -587,9 +615,9 @@ var require_eq = __commonJS({
|
|
|
587
615
|
}
|
|
588
616
|
});
|
|
589
617
|
|
|
590
|
-
// node_modules/.pnpm/semver@7.8.
|
|
618
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/neq.js
|
|
591
619
|
var require_neq = __commonJS({
|
|
592
|
-
"node_modules/.pnpm/semver@7.8.
|
|
620
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/neq.js"(exports, module) {
|
|
593
621
|
"use strict";
|
|
594
622
|
var compare = require_compare();
|
|
595
623
|
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
@@ -597,9 +625,9 @@ var require_neq = __commonJS({
|
|
|
597
625
|
}
|
|
598
626
|
});
|
|
599
627
|
|
|
600
|
-
// node_modules/.pnpm/semver@7.8.
|
|
628
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gt.js
|
|
601
629
|
var require_gt = __commonJS({
|
|
602
|
-
"node_modules/.pnpm/semver@7.8.
|
|
630
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gt.js"(exports, module) {
|
|
603
631
|
"use strict";
|
|
604
632
|
var compare = require_compare();
|
|
605
633
|
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
@@ -607,9 +635,9 @@ var require_gt = __commonJS({
|
|
|
607
635
|
}
|
|
608
636
|
});
|
|
609
637
|
|
|
610
|
-
// node_modules/.pnpm/semver@7.8.
|
|
638
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gte.js
|
|
611
639
|
var require_gte = __commonJS({
|
|
612
|
-
"node_modules/.pnpm/semver@7.8.
|
|
640
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/gte.js"(exports, module) {
|
|
613
641
|
"use strict";
|
|
614
642
|
var compare = require_compare();
|
|
615
643
|
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
@@ -617,9 +645,9 @@ var require_gte = __commonJS({
|
|
|
617
645
|
}
|
|
618
646
|
});
|
|
619
647
|
|
|
620
|
-
// node_modules/.pnpm/semver@7.8.
|
|
648
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lt.js
|
|
621
649
|
var require_lt = __commonJS({
|
|
622
|
-
"node_modules/.pnpm/semver@7.8.
|
|
650
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lt.js"(exports, module) {
|
|
623
651
|
"use strict";
|
|
624
652
|
var compare = require_compare();
|
|
625
653
|
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
@@ -627,9 +655,9 @@ var require_lt = __commonJS({
|
|
|
627
655
|
}
|
|
628
656
|
});
|
|
629
657
|
|
|
630
|
-
// node_modules/.pnpm/semver@7.8.
|
|
658
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lte.js
|
|
631
659
|
var require_lte = __commonJS({
|
|
632
|
-
"node_modules/.pnpm/semver@7.8.
|
|
660
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/lte.js"(exports, module) {
|
|
633
661
|
"use strict";
|
|
634
662
|
var compare = require_compare();
|
|
635
663
|
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
@@ -637,9 +665,9 @@ var require_lte = __commonJS({
|
|
|
637
665
|
}
|
|
638
666
|
});
|
|
639
667
|
|
|
640
|
-
// node_modules/.pnpm/semver@7.8.
|
|
668
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/cmp.js
|
|
641
669
|
var require_cmp = __commonJS({
|
|
642
|
-
"node_modules/.pnpm/semver@7.8.
|
|
670
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
643
671
|
"use strict";
|
|
644
672
|
var eq = require_eq();
|
|
645
673
|
var neq = require_neq();
|
|
@@ -687,9 +715,9 @@ var require_cmp = __commonJS({
|
|
|
687
715
|
}
|
|
688
716
|
});
|
|
689
717
|
|
|
690
|
-
// node_modules/.pnpm/semver@7.8.
|
|
718
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/comparator.js
|
|
691
719
|
var require_comparator = __commonJS({
|
|
692
|
-
"node_modules/.pnpm/semver@7.8.
|
|
720
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
693
721
|
"use strict";
|
|
694
722
|
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
695
723
|
var Comparator = class _Comparator {
|
|
@@ -800,9 +828,200 @@ var require_comparator = __commonJS({
|
|
|
800
828
|
}
|
|
801
829
|
});
|
|
802
830
|
|
|
803
|
-
// node_modules/.pnpm/semver@7.8.
|
|
831
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/trim-comparator-whitespace.js
|
|
832
|
+
var require_trim_comparator_whitespace = __commonJS({
|
|
833
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/internal/trim-comparator-whitespace.js"(exports, module) {
|
|
834
|
+
"use strict";
|
|
835
|
+
var {
|
|
836
|
+
MAX_LENGTH,
|
|
837
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
838
|
+
WHITESPACE_CHARACTERS
|
|
839
|
+
} = require_constants();
|
|
840
|
+
var whitespace = new Uint8Array(65536);
|
|
841
|
+
for (const char of WHITESPACE_CHARACTERS) {
|
|
842
|
+
whitespace[char.charCodeAt(0)] = 1;
|
|
843
|
+
}
|
|
844
|
+
var isWhitespace = (char) => char !== void 0 && whitespace[char.charCodeAt(0)] === 1;
|
|
845
|
+
var isVersionPrefix = (char) => char === "v" || char === "=" || isWhitespace(char);
|
|
846
|
+
var isDigit = (char) => char !== void 0 && char >= "0" && char <= "9";
|
|
847
|
+
var isLetter = (char) => char !== void 0 && (char >= "a" && char <= "z" || char >= "A" && char <= "Z");
|
|
848
|
+
var isIdentifierCharacter = (char) => isDigit(char) || isLetter(char) || char === "-";
|
|
849
|
+
var isVersionStart = (char) => isDigit(char) || char === "x" || char === "X" || char === "*";
|
|
850
|
+
var findDigitsEndIndex = (range, start, limit, digitRuns) => {
|
|
851
|
+
if (!isDigit(range[start])) {
|
|
852
|
+
return start;
|
|
853
|
+
}
|
|
854
|
+
if (start >= digitRuns.start && start < digitRuns.end) {
|
|
855
|
+
return Math.min(start + limit, digitRuns.end);
|
|
856
|
+
}
|
|
857
|
+
if (start >= digitRuns.previousStart && start < digitRuns.previousEnd) {
|
|
858
|
+
return Math.min(start + limit, digitRuns.previousEnd);
|
|
859
|
+
}
|
|
860
|
+
let end = start + 1;
|
|
861
|
+
while (isDigit(range[end])) {
|
|
862
|
+
end++;
|
|
863
|
+
}
|
|
864
|
+
digitRuns.previousStart = digitRuns.start;
|
|
865
|
+
digitRuns.previousEnd = digitRuns.end;
|
|
866
|
+
digitRuns.start = start;
|
|
867
|
+
digitRuns.end = end;
|
|
868
|
+
return Math.min(start + limit, end);
|
|
869
|
+
};
|
|
870
|
+
var findVersionNumberEndIndex = (range, start, loose, digitRuns) => {
|
|
871
|
+
if (!loose && range[start] === "0") {
|
|
872
|
+
return start + 1;
|
|
873
|
+
}
|
|
874
|
+
return findDigitsEndIndex(range, start, loose ? MAX_LENGTH : MAX_LENGTH + 1, digitRuns);
|
|
875
|
+
};
|
|
876
|
+
var findPrereleaseIdentifierEndIndex = (range, start, loose, digitRuns) => {
|
|
877
|
+
const digitsEnd = findDigitsEndIndex(range, start, MAX_LENGTH, digitRuns);
|
|
878
|
+
if (isLetter(range[digitsEnd]) || range[digitsEnd] === "-") {
|
|
879
|
+
let end = digitsEnd + 1;
|
|
880
|
+
const limit = end + MAX_SAFE_BUILD_LENGTH;
|
|
881
|
+
while (end < limit && isIdentifierCharacter(range[end])) {
|
|
882
|
+
end++;
|
|
883
|
+
}
|
|
884
|
+
return end;
|
|
885
|
+
}
|
|
886
|
+
return findVersionNumberEndIndex(range, start, loose, digitRuns);
|
|
887
|
+
};
|
|
888
|
+
var findPrereleaseEndIndex = (range, start, loose, digitRuns) => {
|
|
889
|
+
const hyphen = range[start] === "-";
|
|
890
|
+
if (!loose && !hyphen) {
|
|
891
|
+
return start;
|
|
892
|
+
}
|
|
893
|
+
const identifierStart = start + (hyphen ? 1 : 0);
|
|
894
|
+
let end = findPrereleaseIdentifierEndIndex(range, identifierStart, loose, digitRuns);
|
|
895
|
+
if (end === identifierStart) {
|
|
896
|
+
if (!loose || !hyphen) {
|
|
897
|
+
return start;
|
|
898
|
+
}
|
|
899
|
+
end = findPrereleaseIdentifierEndIndex(range, start, loose, digitRuns);
|
|
900
|
+
}
|
|
901
|
+
while (range[end] === ".") {
|
|
902
|
+
const next = findPrereleaseIdentifierEndIndex(range, end + 1, loose, digitRuns);
|
|
903
|
+
if (next === end + 1) {
|
|
904
|
+
break;
|
|
905
|
+
}
|
|
906
|
+
end = next;
|
|
907
|
+
}
|
|
908
|
+
return end;
|
|
909
|
+
};
|
|
910
|
+
var findBuildIdentifierEndIndex = (range, start) => {
|
|
911
|
+
let end = start;
|
|
912
|
+
while (end - start < MAX_SAFE_BUILD_LENGTH && isIdentifierCharacter(range[end])) {
|
|
913
|
+
end++;
|
|
914
|
+
}
|
|
915
|
+
return end;
|
|
916
|
+
};
|
|
917
|
+
var findBuildEndIndex = (range, start) => {
|
|
918
|
+
if (range[start] !== "+") {
|
|
919
|
+
return start;
|
|
920
|
+
}
|
|
921
|
+
let end = findBuildIdentifierEndIndex(range, start + 1);
|
|
922
|
+
if (end === start + 1) {
|
|
923
|
+
return start;
|
|
924
|
+
}
|
|
925
|
+
while (range[end] === ".") {
|
|
926
|
+
const next = findBuildIdentifierEndIndex(range, end + 1);
|
|
927
|
+
if (next === end + 1) {
|
|
928
|
+
break;
|
|
929
|
+
}
|
|
930
|
+
end = next;
|
|
931
|
+
}
|
|
932
|
+
return end;
|
|
933
|
+
};
|
|
934
|
+
var findLooseFullVersionEndIndex = (range, start, digitRuns) => {
|
|
935
|
+
let end = start;
|
|
936
|
+
for (let component = 0; component < 3; component++) {
|
|
937
|
+
const next = findVersionNumberEndIndex(range, end, true, digitRuns);
|
|
938
|
+
if (next === end) {
|
|
939
|
+
return start;
|
|
940
|
+
}
|
|
941
|
+
end = next;
|
|
942
|
+
if (component < 2) {
|
|
943
|
+
if (range[end] !== ".") {
|
|
944
|
+
return start;
|
|
945
|
+
}
|
|
946
|
+
end++;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
const prereleaseEnd = findPrereleaseEndIndex(range, end, true, digitRuns);
|
|
950
|
+
return findBuildEndIndex(range, prereleaseEnd);
|
|
951
|
+
};
|
|
952
|
+
var findPartialVersionComponentEndIndex = (range, start, digitRuns) => {
|
|
953
|
+
if (isDigit(range[start])) {
|
|
954
|
+
return findVersionNumberEndIndex(range, start, false, digitRuns);
|
|
955
|
+
}
|
|
956
|
+
return isVersionStart(range[start]) ? start + 1 : start;
|
|
957
|
+
};
|
|
958
|
+
var findPartialVersionEndIndex = (range, start, digitRuns) => {
|
|
959
|
+
let end = findPartialVersionComponentEndIndex(range, start, digitRuns);
|
|
960
|
+
for (let component = 0; component < 2; component++) {
|
|
961
|
+
if (range[end] !== ".") {
|
|
962
|
+
return end;
|
|
963
|
+
}
|
|
964
|
+
const next = findPartialVersionComponentEndIndex(range, end + 1, digitRuns);
|
|
965
|
+
if (next === end + 1) {
|
|
966
|
+
return end;
|
|
967
|
+
}
|
|
968
|
+
end = next;
|
|
969
|
+
}
|
|
970
|
+
const prereleaseEnd = findPrereleaseEndIndex(range, end, false, digitRuns);
|
|
971
|
+
return findBuildEndIndex(range, prereleaseEnd);
|
|
972
|
+
};
|
|
973
|
+
var findVersionEndIndex = (range, start, digitRuns) => {
|
|
974
|
+
const fullVersionEnd = findLooseFullVersionEndIndex(range, start, digitRuns);
|
|
975
|
+
return fullVersionEnd !== start ? fullVersionEnd : findPartialVersionEndIndex(range, start, digitRuns);
|
|
976
|
+
};
|
|
977
|
+
var findRemovableWhitespaceIndex = (range, matchStart) => {
|
|
978
|
+
let position = matchStart;
|
|
979
|
+
if (isWhitespace(range[position])) {
|
|
980
|
+
position++;
|
|
981
|
+
}
|
|
982
|
+
if (range[position] === "<" || range[position] === ">") {
|
|
983
|
+
position++;
|
|
984
|
+
}
|
|
985
|
+
if (range[position] === "=") {
|
|
986
|
+
position++;
|
|
987
|
+
}
|
|
988
|
+
return isWhitespace(range[position]) ? position : -1;
|
|
989
|
+
};
|
|
990
|
+
var trimComparatorWhitespace = (range) => {
|
|
991
|
+
let result = "";
|
|
992
|
+
let copyFrom = 0;
|
|
993
|
+
let cursor = 0;
|
|
994
|
+
const digitRuns = { start: -1, end: -1, previousStart: -1, previousEnd: -1 };
|
|
995
|
+
while (cursor < range.length) {
|
|
996
|
+
const matchStart = cursor;
|
|
997
|
+
if (range[cursor] === "<" || range[cursor] === ">") {
|
|
998
|
+
cursor++;
|
|
999
|
+
} else if (!isVersionPrefix(range[cursor]) && !isVersionStart(range[cursor])) {
|
|
1000
|
+
cursor++;
|
|
1001
|
+
continue;
|
|
1002
|
+
}
|
|
1003
|
+
while (cursor < range.length && isVersionPrefix(range[cursor])) {
|
|
1004
|
+
cursor++;
|
|
1005
|
+
}
|
|
1006
|
+
if (!isVersionStart(range[cursor])) {
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
const whitespacePosition = findRemovableWhitespaceIndex(range, matchStart);
|
|
1010
|
+
if (whitespacePosition !== -1) {
|
|
1011
|
+
result += range.slice(copyFrom, whitespacePosition);
|
|
1012
|
+
copyFrom = whitespacePosition + 1;
|
|
1013
|
+
}
|
|
1014
|
+
cursor = findVersionEndIndex(range, cursor, digitRuns);
|
|
1015
|
+
}
|
|
1016
|
+
return result + range.slice(copyFrom);
|
|
1017
|
+
};
|
|
1018
|
+
module.exports = trimComparatorWhitespace;
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
|
|
1022
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/range.js
|
|
804
1023
|
var require_range = __commonJS({
|
|
805
|
-
"node_modules/.pnpm/semver@7.8.
|
|
1024
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/classes/range.js"(exports, module) {
|
|
806
1025
|
"use strict";
|
|
807
1026
|
var SPACE_CHARACTERS = /\s+/g;
|
|
808
1027
|
var Range = class _Range {
|
|
@@ -881,7 +1100,7 @@ var require_range = __commonJS({
|
|
|
881
1100
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
882
1101
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
883
1102
|
debug("hyphen replace", range);
|
|
884
|
-
range = range
|
|
1103
|
+
range = trimComparatorWhitespace(range);
|
|
885
1104
|
debug("comparator trim", range);
|
|
886
1105
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
887
1106
|
debug("tilde trim", range);
|
|
@@ -951,11 +1170,11 @@ var require_range = __commonJS({
|
|
|
951
1170
|
var Comparator = require_comparator();
|
|
952
1171
|
var debug = require_debug();
|
|
953
1172
|
var SemVer2 = require_semver();
|
|
1173
|
+
var trimComparatorWhitespace = require_trim_comparator_whitespace();
|
|
954
1174
|
var {
|
|
955
1175
|
safeRe: re,
|
|
956
1176
|
src,
|
|
957
1177
|
t,
|
|
958
|
-
comparatorTrimReplace,
|
|
959
1178
|
tildeTrimReplace,
|
|
960
1179
|
caretTrimReplace
|
|
961
1180
|
} = require_re();
|
|
@@ -1185,9 +1404,9 @@ var require_range = __commonJS({
|
|
|
1185
1404
|
}
|
|
1186
1405
|
});
|
|
1187
1406
|
|
|
1188
|
-
// node_modules/.pnpm/semver@7.8.
|
|
1407
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/satisfies.js
|
|
1189
1408
|
var require_satisfies = __commonJS({
|
|
1190
|
-
"node_modules/.pnpm/semver@7.8.
|
|
1409
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1191
1410
|
"use strict";
|
|
1192
1411
|
var Range = require_range();
|
|
1193
1412
|
var satisfies = (version, range, options) => {
|
|
@@ -1202,9 +1421,9 @@ var require_satisfies = __commonJS({
|
|
|
1202
1421
|
}
|
|
1203
1422
|
});
|
|
1204
1423
|
|
|
1205
|
-
// node_modules/.pnpm/semver@7.8.
|
|
1424
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/min-version.js
|
|
1206
1425
|
var require_min_version = __commonJS({
|
|
1207
|
-
"node_modules/.pnpm/semver@7.8.
|
|
1426
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1208
1427
|
"use strict";
|
|
1209
1428
|
var SemVer2 = require_semver();
|
|
1210
1429
|
var Range = require_range();
|
|
@@ -1261,9 +1480,9 @@ var require_min_version = __commonJS({
|
|
|
1261
1480
|
}
|
|
1262
1481
|
});
|
|
1263
1482
|
|
|
1264
|
-
// node_modules/.pnpm/semver@7.8.
|
|
1483
|
+
// node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/valid.js
|
|
1265
1484
|
var require_valid2 = __commonJS({
|
|
1266
|
-
"node_modules/.pnpm/semver@7.8.
|
|
1485
|
+
"node_modules/.pnpm/semver@7.8.6/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1267
1486
|
"use strict";
|
|
1268
1487
|
var Range = require_range();
|
|
1269
1488
|
var validRange = (range, options) => {
|
|
@@ -1281,7 +1500,8 @@ var require_valid2 = __commonJS({
|
|
|
1281
1500
|
var createBrowser = (config) => {
|
|
1282
1501
|
return {
|
|
1283
1502
|
setImportMapFn: config.setImportMapFn,
|
|
1284
|
-
importModule: config.loadModuleFn
|
|
1503
|
+
importModule: config.loadModuleFn,
|
|
1504
|
+
preloadModules: config.preloadModulesFn
|
|
1285
1505
|
};
|
|
1286
1506
|
};
|
|
1287
1507
|
|
|
@@ -1406,14 +1626,94 @@ var createFsManifestProvider = () => {
|
|
|
1406
1626
|
};
|
|
1407
1627
|
};
|
|
1408
1628
|
|
|
1629
|
+
// src/lib/core/1.domain/remote-entry/mark-dense.ts
|
|
1630
|
+
function markDense(shared) {
|
|
1631
|
+
return shared.map((entry) => "entries" in entry ? { ...entry, dense: true } : entry);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// node_modules/.pnpm/@softarc+native-federation@4.10.0/node_modules/@softarc/native-federation/dist/lib/domain/core/chunk.js
|
|
1635
|
+
var CHUNK_PREFIX = "@nf-internal";
|
|
1636
|
+
var SCRIPT_EXTENSION = /\.(m|c)?js$/;
|
|
1637
|
+
function toChunkImport(fileName) {
|
|
1638
|
+
if (fileName.startsWith("./")) {
|
|
1639
|
+
fileName = fileName.slice(2);
|
|
1640
|
+
}
|
|
1641
|
+
const packageName = fileName.replace(SCRIPT_EXTENSION, "");
|
|
1642
|
+
return CHUNK_PREFIX + "/" + packageName;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
// node_modules/.pnpm/@softarc+native-federation@4.10.0/node_modules/@softarc/native-federation/dist/lib/utils/normalize.js
|
|
1646
|
+
function inferPackageFromSecondary(secondary) {
|
|
1647
|
+
const parts = secondary.split("/");
|
|
1648
|
+
if (secondary.startsWith("@") && parts.length >= 2) {
|
|
1649
|
+
return parts[0] + "/" + parts[1];
|
|
1650
|
+
}
|
|
1651
|
+
return parts[0];
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
// node_modules/.pnpm/@softarc+native-federation@4.10.0/node_modules/@softarc/native-federation/dist/lib/core/output/densify-externals.js
|
|
1655
|
+
function isDense(entry) {
|
|
1656
|
+
return "entries" in entry;
|
|
1657
|
+
}
|
|
1658
|
+
function isFlatChunk(entry) {
|
|
1659
|
+
return entry.packageName.startsWith(CHUNK_PREFIX);
|
|
1660
|
+
}
|
|
1661
|
+
function densifyExternals(shared, declaredPackages) {
|
|
1662
|
+
const result = [];
|
|
1663
|
+
const groupIndex = /* @__PURE__ */ new Map();
|
|
1664
|
+
for (const entry of shared) {
|
|
1665
|
+
if (isDense(entry)) {
|
|
1666
|
+
result.push(entry);
|
|
1667
|
+
continue;
|
|
1668
|
+
}
|
|
1669
|
+
if (isFlatChunk(entry)) {
|
|
1670
|
+
const { outFileName: outFileName2, ...rest } = entry;
|
|
1671
|
+
result.push({ ...rest, entries: { [entry.packageName]: outFileName2 } });
|
|
1672
|
+
continue;
|
|
1673
|
+
}
|
|
1674
|
+
const { outFileName, packageName, dev, ...meta } = entry;
|
|
1675
|
+
const parent = declaredPackages.get(packageName) ?? inferPackageFromSecondary(packageName);
|
|
1676
|
+
const sig = JSON.stringify(meta, Object.keys(meta).sort());
|
|
1677
|
+
const key = parent + " " + sig;
|
|
1678
|
+
const existing = groupIndex.get(key);
|
|
1679
|
+
if (existing === void 0) {
|
|
1680
|
+
const dense = {
|
|
1681
|
+
...meta,
|
|
1682
|
+
packageName: parent,
|
|
1683
|
+
entries: { [packageName]: outFileName }
|
|
1684
|
+
};
|
|
1685
|
+
if (dev !== void 0) dense.dev = dev;
|
|
1686
|
+
groupIndex.set(key, result.length);
|
|
1687
|
+
result.push(dense);
|
|
1688
|
+
} else {
|
|
1689
|
+
result[existing].entries[packageName] = outFileName;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
return result;
|
|
1693
|
+
}
|
|
1694
|
+
function toDenseSharedInfoFormat(shared) {
|
|
1695
|
+
return shared.map((external) => {
|
|
1696
|
+
if ("entries" in external) return external;
|
|
1697
|
+
const { outFileName, ...baseSharedInfoProps } = external;
|
|
1698
|
+
return {
|
|
1699
|
+
...baseSharedInfoProps,
|
|
1700
|
+
entries: { [external.packageName]: outFileName }
|
|
1701
|
+
};
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
// src/lib/core/3.adapters/remote-entry/normalize-remote-entry.ts
|
|
1706
|
+
var normalizeRemoteEntry = (raw, remoteEntryUrl, config) => {
|
|
1707
|
+
const marked = markDense(raw.shared ?? []);
|
|
1708
|
+
const shared = config.feature.convertFlatSharedInfo ? densifyExternals(marked, /* @__PURE__ */ new Map()) : toDenseSharedInfoFormat(marked);
|
|
1709
|
+
const remoteEntry = { ...raw, shared };
|
|
1710
|
+
if (!remoteEntry.exposes) remoteEntry.exposes = [];
|
|
1711
|
+
if (!remoteEntry.url) remoteEntry.url = remoteEntryUrl;
|
|
1712
|
+
return remoteEntry;
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1409
1715
|
// src/lib/node/adapters/fs-remote-entry-provider.ts
|
|
1410
|
-
var createFsRemoteEntryProvider = () => {
|
|
1411
|
-
const fillEmptyFields = (remoteEntryUrl) => (remoteEntry) => {
|
|
1412
|
-
if (!remoteEntry.exposes) remoteEntry.exposes = [];
|
|
1413
|
-
if (!remoteEntry.shared) remoteEntry.shared = [];
|
|
1414
|
-
if (!remoteEntry.url) remoteEntry.url = remoteEntryUrl;
|
|
1415
|
-
return remoteEntry;
|
|
1416
|
-
};
|
|
1716
|
+
var createFsRemoteEntryProvider = (config) => {
|
|
1417
1717
|
const formatError = (remoteEntryUrl) => (err) => {
|
|
1418
1718
|
if (err instanceof NFError) throw err;
|
|
1419
1719
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -1424,8 +1724,8 @@ var createFsRemoteEntryProvider = () => {
|
|
|
1424
1724
|
try {
|
|
1425
1725
|
const bytes = await readSourceBytes(remoteEntryUrl);
|
|
1426
1726
|
if (opts.integrity) await verifyIntegrity(bytes, opts.integrity);
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1727
|
+
const raw = JSON.parse(new TextDecoder().decode(bytes));
|
|
1728
|
+
return normalizeRemoteEntry(raw, remoteEntryUrl, config);
|
|
1429
1729
|
} catch (err) {
|
|
1430
1730
|
return formatError(remoteEntryUrl)(err);
|
|
1431
1731
|
}
|
|
@@ -1535,6 +1835,11 @@ var createRemoteInfoRepository = (config) => {
|
|
|
1535
1835
|
(m) => join(_cache[remoteName].scopeUrl, m.file)
|
|
1536
1836
|
);
|
|
1537
1837
|
},
|
|
1838
|
+
getModuleChunkUrls: function(remoteName, exposedModule) {
|
|
1839
|
+
const remote = _cache[remoteName];
|
|
1840
|
+
const chunks = remote?.exposes.find((m) => m.moduleName === exposedModule)?.chunks ?? [];
|
|
1841
|
+
return chunks.map((file) => join(remote.scopeUrl, file));
|
|
1842
|
+
},
|
|
1538
1843
|
getAll: function() {
|
|
1539
1844
|
return _cache;
|
|
1540
1845
|
},
|
|
@@ -1850,6 +2155,18 @@ var replaceInDOM = (mapType, trustedTypesPolicyName = "nfo") => (importMap, opts
|
|
|
1850
2155
|
return Promise.resolve(importMap);
|
|
1851
2156
|
};
|
|
1852
2157
|
|
|
2158
|
+
// src/lib/core/4.config/import-map/preload-in-dom.ts
|
|
2159
|
+
var preloadInDOM = (rel) => {
|
|
2160
|
+
const preloaded = /* @__PURE__ */ new Set();
|
|
2161
|
+
return (urls) => {
|
|
2162
|
+
for (const href of urls) {
|
|
2163
|
+
if (preloaded.has(href)) continue;
|
|
2164
|
+
preloaded.add(href);
|
|
2165
|
+
document.head.appendChild(Object.assign(document.createElement("link"), { rel, href }));
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
};
|
|
2169
|
+
|
|
1853
2170
|
// src/lib/core/4.config/import-map/use-default.ts
|
|
1854
2171
|
var useDefaultImportMap = (trustedTypesPolicyName = "nfo") => ({
|
|
1855
2172
|
loadModuleFn: (url) => {
|
|
@@ -1860,20 +2177,27 @@ var useDefaultImportMap = (trustedTypesPolicyName = "nfo") => ({
|
|
|
1860
2177
|
);
|
|
1861
2178
|
},
|
|
1862
2179
|
setImportMapFn: replaceInDOM("importmap", trustedTypesPolicyName),
|
|
2180
|
+
preloadModulesFn: preloadInDOM("modulepreload"),
|
|
1863
2181
|
reloadBrowserFn: () => {
|
|
1864
2182
|
window.location.reload();
|
|
1865
2183
|
}
|
|
1866
2184
|
});
|
|
1867
2185
|
|
|
2186
|
+
// src/lib/core/4.config/import-map/no-preload.ts
|
|
2187
|
+
var noPreload = () => {
|
|
2188
|
+
};
|
|
2189
|
+
|
|
1868
2190
|
// src/lib/core/4.config/import-map/import-map.config.ts
|
|
1869
2191
|
var createImportMapConfig = (o) => {
|
|
1870
2192
|
const fallback = useDefaultImportMap(o.trustedTypesPolicyName);
|
|
1871
2193
|
return {
|
|
1872
2194
|
setImportMapFn: o.setImportMapFn ?? fallback.setImportMapFn,
|
|
1873
2195
|
loadModuleFn: o.loadModuleFn ?? fallback.loadModuleFn,
|
|
1874
|
-
reloadBrowserFn: o.reloadBrowserFn ?? fallback.reloadBrowserFn
|
|
2196
|
+
reloadBrowserFn: o.reloadBrowserFn ?? fallback.reloadBrowserFn,
|
|
2197
|
+
preloadModulesFn: o.preloadModulesFn ?? defaultPreload(o, fallback)
|
|
1875
2198
|
};
|
|
1876
2199
|
};
|
|
2200
|
+
var defaultPreload = (o, fallback) => o.loadModuleFn ? noPreload : fallback.preloadModulesFn;
|
|
1877
2201
|
|
|
1878
2202
|
// src/lib/core/4.config/host/host.config.ts
|
|
1879
2203
|
var createHostConfig = (override) => {
|
|
@@ -1980,7 +2304,7 @@ globalThisStorageEntry.type = "globalThis";
|
|
|
1980
2304
|
Object.freeze(globalThisStorageEntry);
|
|
1981
2305
|
|
|
1982
2306
|
// src/lib/core/4.config/orchestrator-version.ts
|
|
1983
|
-
var ORCHESTRATOR_VERSION = true ? "4.
|
|
2307
|
+
var ORCHESTRATOR_VERSION = true ? "4.10.0" : "dev";
|
|
1984
2308
|
|
|
1985
2309
|
// src/lib/core/4.config/storage/publish-storage-info.ts
|
|
1986
2310
|
var KEYS = Object.freeze(Object.values(STORAGE_KEYS));
|
|
@@ -2023,10 +2347,49 @@ var isOutdatedCache = (storage) => {
|
|
|
2023
2347
|
cacheState.update({ version: ORCHESTRATOR_VERSION, undecidedScopes: [] });
|
|
2024
2348
|
return Object.values(STORAGE_KEYS).filter((key) => key !== STORAGE_KEYS.cacheState).some((key) => storage(key, null).get() !== null);
|
|
2025
2349
|
};
|
|
2026
|
-
var
|
|
2350
|
+
var guardWrites = (storage, log) => {
|
|
2351
|
+
let failed = false;
|
|
2352
|
+
const memory = /* @__PURE__ */ new Map();
|
|
2353
|
+
const write = (key, value, persist) => {
|
|
2354
|
+
if (!failed) {
|
|
2355
|
+
try {
|
|
2356
|
+
persist();
|
|
2357
|
+
return;
|
|
2358
|
+
} catch (error) {
|
|
2359
|
+
failed = true;
|
|
2360
|
+
try {
|
|
2361
|
+
storage(STORAGE_KEYS.cacheState, null).set(null);
|
|
2362
|
+
} catch {
|
|
2363
|
+
}
|
|
2364
|
+
log.warn(
|
|
2365
|
+
5,
|
|
2366
|
+
`Could not save '${key}' to storage; this page runs from memory and the next page starts without a cache.`,
|
|
2367
|
+
error
|
|
2368
|
+
);
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
memory.set(key, cloneEntry(key, value));
|
|
2372
|
+
};
|
|
2373
|
+
return (key, initialValue) => {
|
|
2374
|
+
const inner = storage(key, initialValue);
|
|
2375
|
+
const entry = {
|
|
2376
|
+
get: () => memory.has(key) ? cloneEntry(key, memory.get(key)) : inner.get(),
|
|
2377
|
+
set: (value) => {
|
|
2378
|
+
write(key, value, () => void inner.set(value));
|
|
2379
|
+
return entry;
|
|
2380
|
+
},
|
|
2381
|
+
clear: () => {
|
|
2382
|
+
write(key, initialValue, () => void inner.clear());
|
|
2383
|
+
return entry;
|
|
2384
|
+
}
|
|
2385
|
+
};
|
|
2386
|
+
return entry;
|
|
2387
|
+
};
|
|
2388
|
+
};
|
|
2389
|
+
var createStorageConfig = (override, log) => {
|
|
2027
2390
|
const creator = override.storage ?? globalThisStorageEntry;
|
|
2028
2391
|
const namespace = override.storageNamespace ?? "__NATIVE_FEDERATION__";
|
|
2029
|
-
const storage = creator(namespace);
|
|
2392
|
+
const storage = guardWrites(creator(namespace), log);
|
|
2030
2393
|
publishStorageInfo({
|
|
2031
2394
|
type: creator.type ?? "custom",
|
|
2032
2395
|
namespace,
|
|
@@ -2045,7 +2408,9 @@ var defaultProfile = {
|
|
|
2045
2408
|
latestSharedExternal: false,
|
|
2046
2409
|
skipInvalidExternalVersions: false,
|
|
2047
2410
|
overrideCachedRemotes: "init-only",
|
|
2048
|
-
overrideCachedRemotesIfURLMatches: false
|
|
2411
|
+
overrideCachedRemotesIfURLMatches: false,
|
|
2412
|
+
mergeManifests: true,
|
|
2413
|
+
enableDebugging: false
|
|
2049
2414
|
};
|
|
2050
2415
|
|
|
2051
2416
|
// src/lib/core/4.config/mode/mode.config.ts
|
|
@@ -2073,13 +2438,16 @@ var createModeConfig = (override) => {
|
|
|
2073
2438
|
};
|
|
2074
2439
|
|
|
2075
2440
|
// src/lib/core/5.di/config.factory.ts
|
|
2076
|
-
var createConfigHandlers = (overrides) =>
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2441
|
+
var createConfigHandlers = (overrides) => {
|
|
2442
|
+
const logConfig = createLogConfig(overrides);
|
|
2443
|
+
return {
|
|
2444
|
+
...createImportMapConfig(overrides),
|
|
2445
|
+
...createHostConfig(overrides),
|
|
2446
|
+
...logConfig,
|
|
2447
|
+
...createStorageConfig(overrides, logConfig.log),
|
|
2448
|
+
...createModeConfig(overrides)
|
|
2449
|
+
};
|
|
2450
|
+
};
|
|
2083
2451
|
|
|
2084
2452
|
// src/lib/core/2.app/flows/init.flow.ts
|
|
2085
2453
|
var createInitFlow = ({
|
|
@@ -2087,10 +2455,10 @@ var createInitFlow = ({
|
|
|
2087
2455
|
adapters,
|
|
2088
2456
|
config
|
|
2089
2457
|
}) => {
|
|
2090
|
-
return (remotesOrManifestUrl) => flow.getRemoteEntries(remotesOrManifestUrl).then(flow.processRemoteEntries).then(flow.poolSharedExternals).then(flow.determineSharedExternals).then(flow.decideServingBuilds).then(flow.generateImportMap).then((importMap) => flow.commitChanges(importMap, { override: true })).then(flow.exposeModuleLoader).then((
|
|
2458
|
+
return (remotesOrManifestUrl) => flow.getRemoteEntries(remotesOrManifestUrl).then(flow.processRemoteEntries).then(flow.poolSharedExternals).then(flow.determineSharedExternals).then(flow.decideServingBuilds).then(flow.generateImportMap).then((importMap) => flow.commitChanges(importMap, { override: true })).then(flow.exposeModuleLoader).then((access) => ({
|
|
2091
2459
|
config,
|
|
2092
2460
|
adapters,
|
|
2093
|
-
|
|
2461
|
+
...access
|
|
2094
2462
|
}));
|
|
2095
2463
|
};
|
|
2096
2464
|
|
|
@@ -2105,8 +2473,140 @@ var createInitRemoteEntryFlow = ({
|
|
|
2105
2473
|
});
|
|
2106
2474
|
};
|
|
2107
2475
|
|
|
2476
|
+
// src/lib/core/2.app/steps/store-remote-entry.ts
|
|
2477
|
+
function createRemoveCachedRemoteEntries(ports) {
|
|
2478
|
+
return (remoteNames) => {
|
|
2479
|
+
if (remoteNames.size === 0) return;
|
|
2480
|
+
for (const remoteName of remoteNames) {
|
|
2481
|
+
ports.remoteInfoRepo.remove(remoteName);
|
|
2482
|
+
ports.scopedExternalsRepo.remove(remoteName);
|
|
2483
|
+
ports.sharedChunksRepo.remove(remoteName);
|
|
2484
|
+
}
|
|
2485
|
+
ports.sharedExternalsRepo.removeFromAllScopes(remoteNames);
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
function createStoreRemoteEntry(config, ports, logStep) {
|
|
2489
|
+
return (remoteEntry, onSharedExternal) => {
|
|
2490
|
+
addRemoteInfoToStorage(remoteEntry);
|
|
2491
|
+
addExternalsToStorage(remoteEntry, onSharedExternal);
|
|
2492
|
+
addSharedChunksToStorage(remoteEntry);
|
|
2493
|
+
};
|
|
2494
|
+
function addRemoteInfoToStorage({ name, url, exposes, integrity }) {
|
|
2495
|
+
ports.remoteInfoRepo.addOrUpdate(name, {
|
|
2496
|
+
scopeUrl: getScope(url),
|
|
2497
|
+
exposes: Object.values(exposes ?? []).map((m) => {
|
|
2498
|
+
const chunks = Object.values(m.chunks ?? {}).filter((c) => c.initial).map((c) => c.file);
|
|
2499
|
+
return {
|
|
2500
|
+
moduleName: m.key,
|
|
2501
|
+
file: m.outFileName,
|
|
2502
|
+
...chunks.length ? { chunks } : {}
|
|
2503
|
+
};
|
|
2504
|
+
}),
|
|
2505
|
+
...integrity ? { integrity } : {}
|
|
2506
|
+
});
|
|
2507
|
+
}
|
|
2508
|
+
function addExternalsToStorage(remoteEntry, onSharedExternal) {
|
|
2509
|
+
remoteEntry.shared.forEach((external) => {
|
|
2510
|
+
const tag = resolveVersion(remoteEntry, external);
|
|
2511
|
+
if (tag === null) return;
|
|
2512
|
+
if (external.singleton) {
|
|
2513
|
+
if (external.requiredVersion && !ports.versionCheck.isCompatible(tag, external.requiredVersion))
|
|
2514
|
+
config.log.warn(
|
|
2515
|
+
logStep,
|
|
2516
|
+
`[${remoteEntry.name}][${external.packageName}] requiredVersion '${external.requiredVersion}' excludes its own version '${tag}'; '${tag}' is still accepted for it.`
|
|
2517
|
+
);
|
|
2518
|
+
onSharedExternal(remoteEntry, external, sharedExternalContext(remoteEntry, external, tag));
|
|
2519
|
+
} else {
|
|
2520
|
+
addScopedExternal(remoteEntry, external, tag);
|
|
2521
|
+
}
|
|
2522
|
+
});
|
|
2523
|
+
}
|
|
2524
|
+
function addSharedChunksToStorage(remoteEntry) {
|
|
2525
|
+
if (!remoteEntry.chunks) return;
|
|
2526
|
+
config.log.debug(
|
|
2527
|
+
logStep,
|
|
2528
|
+
`Adding chunks for remote "${remoteEntry.name}", bundles: [${Object.keys(remoteEntry.chunks).join(", ")}]`
|
|
2529
|
+
);
|
|
2530
|
+
Object.entries(remoteEntry.chunks).forEach(([bundleName, chunks]) => {
|
|
2531
|
+
ports.sharedChunksRepo.addOrReplace(remoteEntry.name, bundleName, chunks);
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
function addScopedExternal(remoteEntry, sharedInfo, tag) {
|
|
2535
|
+
const { packageName, entries } = sharedInfo;
|
|
2536
|
+
const key = packageName in entries ? packageName : Object.keys(entries)[0] ?? packageName;
|
|
2537
|
+
ports.scopedExternalsRepo.addExternal(remoteEntry.name, key, {
|
|
2538
|
+
tag,
|
|
2539
|
+
bundle: sharedInfo.bundle,
|
|
2540
|
+
entries,
|
|
2541
|
+
...sharedInfo.preload ? { preload: true } : {}
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
function resolveVersion(remoteEntry, external) {
|
|
2545
|
+
if (external.version && ports.versionCheck.isValidSemver(external.version)) {
|
|
2546
|
+
return external.version;
|
|
2547
|
+
}
|
|
2548
|
+
const errorMsg = `[${remoteEntry.name}][${external.packageName}] Version '${external.version}' is not a valid version.`;
|
|
2549
|
+
if (config.strict.strictExternalVersion) {
|
|
2550
|
+
config.log.error(logStep, errorMsg);
|
|
2551
|
+
throw new NFError(`Could not process remote '${remoteEntry.name}'`);
|
|
2552
|
+
}
|
|
2553
|
+
if (config.profile.skipInvalidExternalVersions) {
|
|
2554
|
+
config.log.warn(logStep, `${errorMsg} Skipping external.`);
|
|
2555
|
+
return null;
|
|
2556
|
+
}
|
|
2557
|
+
config.log.warn(logStep, errorMsg);
|
|
2558
|
+
return ports.versionCheck.smallestVersion(external.requiredVersion);
|
|
2559
|
+
}
|
|
2560
|
+
function sharedExternalContext(remoteEntry, sharedInfo, tag) {
|
|
2561
|
+
const scopeType = ports.sharedExternalsRepo.scopeType(sharedInfo.shareScope);
|
|
2562
|
+
const remote = {
|
|
2563
|
+
name: remoteEntry.name,
|
|
2564
|
+
bundle: sharedInfo.bundle,
|
|
2565
|
+
strictVersion: sharedInfo.strictVersion,
|
|
2566
|
+
cached: false,
|
|
2567
|
+
requiredVersion: scopeType === "strict" ? tag : sharedInfo.requiredVersion || tag,
|
|
2568
|
+
...sharedInfo.pool?.trim() ? { pool: sharedInfo.pool } : {},
|
|
2569
|
+
...sharedInfo.dense ? { dense: true } : {},
|
|
2570
|
+
entries: sharedInfo.entries,
|
|
2571
|
+
...sharedInfo.preload ? { preload: true } : {},
|
|
2572
|
+
...sharedInfo.dev ? { dev: true } : {}
|
|
2573
|
+
};
|
|
2574
|
+
let stored;
|
|
2575
|
+
const readRecord = () => stored ??= ports.sharedExternalsRepo.tryGet(sharedInfo.packageName, sharedInfo.shareScope).get() ?? { dirty: false, versions: [] };
|
|
2576
|
+
return {
|
|
2577
|
+
tag,
|
|
2578
|
+
remote,
|
|
2579
|
+
readRecord,
|
|
2580
|
+
scopeType,
|
|
2581
|
+
assertSameVersionCompatibility(matchingVersion) {
|
|
2582
|
+
if (!remote.strictVersion) return;
|
|
2583
|
+
if (matchingVersion.remotes[0].requiredVersion === remote.requiredVersion) return;
|
|
2584
|
+
const errorMsg = `[${remoteEntry.name}][${sharedInfo.packageName}@${sharedInfo.version}] Required version-range '${remote.requiredVersion}' does not match cached version-range '${matchingVersion.remotes[0].requiredVersion}'`;
|
|
2585
|
+
if (config.strict.strictExternalSameVersionCompatibility) {
|
|
2586
|
+
config.log.error(logStep, errorMsg);
|
|
2587
|
+
throw new NFError(`Could not process remote '${remoteEntry.name}'`);
|
|
2588
|
+
}
|
|
2589
|
+
config.log.warn(logStep, errorMsg);
|
|
2590
|
+
},
|
|
2591
|
+
write() {
|
|
2592
|
+
ports.sharedExternalsRepo.addOrUpdate(
|
|
2593
|
+
sharedInfo.packageName,
|
|
2594
|
+
{
|
|
2595
|
+
...readRecord(),
|
|
2596
|
+
versions: readRecord().versions.sort(
|
|
2597
|
+
(a, b) => ports.versionCheck.compare(b.tag, a.tag)
|
|
2598
|
+
)
|
|
2599
|
+
},
|
|
2600
|
+
sharedInfo.shareScope
|
|
2601
|
+
);
|
|
2602
|
+
}
|
|
2603
|
+
};
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2108
2607
|
// src/lib/core/2.app/steps/get-remote-entries.ts
|
|
2109
2608
|
function createGetRemoteEntries(config, ports) {
|
|
2609
|
+
const removeCachedRemoteEntries = createRemoveCachedRemoteEntries(ports);
|
|
2110
2610
|
return (remotesOrManifestUrl = {}) => {
|
|
2111
2611
|
const manifestPromise = config.manifestIntegrity ? ports.manifestProvider.provide(remotesOrManifestUrl, {
|
|
2112
2612
|
integrity: config.manifestIntegrity
|
|
@@ -2114,7 +2614,7 @@ function createGetRemoteEntries(config, ports) {
|
|
|
2114
2614
|
return manifestPromise.catch((e) => {
|
|
2115
2615
|
config.log.error(1, "Could not fetch manifest.", e);
|
|
2116
2616
|
return Promise.reject(new NFError("Failed to fetch manifest"));
|
|
2117
|
-
}).then(addHostRemoteEntry).then(fetchRemoteEntries).then(removeSkippedRemotes).then(checkForSSE);
|
|
2617
|
+
}).then(addHostRemoteEntry).then(dropUnlistedRemotes).then(fetchRemoteEntries).then(removeSkippedRemotes).then(checkForSSE);
|
|
2118
2618
|
};
|
|
2119
2619
|
function addHostRemoteEntry(manifest) {
|
|
2120
2620
|
if (!config.hostRemoteEntry) return manifest;
|
|
@@ -2124,6 +2624,26 @@ function createGetRemoteEntries(config, ports) {
|
|
|
2124
2624
|
[name]: integrity ? { url, integrity } : url
|
|
2125
2625
|
};
|
|
2126
2626
|
}
|
|
2627
|
+
function dropUnlistedRemotes(manifest) {
|
|
2628
|
+
if (config.profile.mergeManifests !== false) return manifest;
|
|
2629
|
+
const listedUrls = new Set(
|
|
2630
|
+
Object.values(manifest).map((descriptor) => normalizeEntry(descriptor).url)
|
|
2631
|
+
);
|
|
2632
|
+
const isListed = (remoteName, info) => Object.hasOwn(manifest, remoteName) || listedUrls.has(storedEntryUrl(info));
|
|
2633
|
+
const unlisted = new Set(
|
|
2634
|
+
Object.entries(ports.remoteInfoRepo.getAll()).filter(([remoteName, info]) => !isListed(remoteName, info)).map(([remoteName]) => remoteName)
|
|
2635
|
+
);
|
|
2636
|
+
if (unlisted.size > 0)
|
|
2637
|
+
config.log.debug(
|
|
2638
|
+
1,
|
|
2639
|
+
`Removing stored remotes the manifest doesn't list: ${[...unlisted].join(", ")}.`
|
|
2640
|
+
);
|
|
2641
|
+
removeCachedRemoteEntries(unlisted);
|
|
2642
|
+
return manifest;
|
|
2643
|
+
}
|
|
2644
|
+
function storedEntryUrl(info) {
|
|
2645
|
+
return join(info.scopeUrl, "remoteEntry.json");
|
|
2646
|
+
}
|
|
2127
2647
|
function normalizeEntry(descriptor) {
|
|
2128
2648
|
return typeof descriptor === "string" ? { url: descriptor } : descriptor;
|
|
2129
2649
|
}
|
|
@@ -2148,7 +2668,7 @@ function createGetRemoteEntries(config, ports) {
|
|
|
2148
2668
|
let isOverride = false;
|
|
2149
2669
|
let skip = false;
|
|
2150
2670
|
ports.remoteInfoRepo.tryGet(remoteName).ifPresent((cachedRemoteInfo) => {
|
|
2151
|
-
if (config.profile.overrideCachedRemotes !== "never" && (remoteEntryUrl !==
|
|
2671
|
+
if (config.profile.overrideCachedRemotes !== "never" && (remoteEntryUrl !== storedEntryUrl(cachedRemoteInfo) || config.profile.overrideCachedRemotesIfURLMatches)) {
|
|
2152
2672
|
config.log.debug(1, `Overriding existing remote '${remoteName}' with '${remoteEntryUrl}'.`);
|
|
2153
2673
|
isOverride = true;
|
|
2154
2674
|
} else {
|
|
@@ -2216,19 +2736,20 @@ function compareStrings(a, b) {
|
|
|
2216
2736
|
|
|
2217
2737
|
// src/lib/core/1.domain/externals/basis.ts
|
|
2218
2738
|
var coverage = (remote) => Object.keys(remote.entries).length;
|
|
2219
|
-
function isBetterBasis(candidate, basis) {
|
|
2739
|
+
function isBetterBasis(candidate, basis, preferDev = false) {
|
|
2740
|
+
if (preferDev && Boolean(basis.dev) !== Boolean(candidate.dev)) return Boolean(candidate.dev);
|
|
2220
2741
|
if (basis.cached !== candidate.cached) return candidate.cached;
|
|
2221
2742
|
const byCoverage = coverage(candidate) - coverage(basis);
|
|
2222
2743
|
return byCoverage === 0 ? compareStrings(candidate.name, basis.name) < 0 : byCoverage > 0;
|
|
2223
2744
|
}
|
|
2224
|
-
function addRemoteToVersion(version, remote, isHost = false) {
|
|
2745
|
+
function addRemoteToVersion(version, remote, isHost = false, preferDev = false) {
|
|
2225
2746
|
if (isHost) {
|
|
2226
2747
|
version.host = true;
|
|
2227
2748
|
version.remotes.unshift(remote);
|
|
2228
2749
|
return;
|
|
2229
2750
|
}
|
|
2230
2751
|
const basis = version.remotes[0];
|
|
2231
|
-
if (basis && !version.host && isBetterBasis(remote, basis)) {
|
|
2752
|
+
if (basis && !version.host && isBetterBasis(remote, basis, preferDev)) {
|
|
2232
2753
|
version.remotes.unshift(remote);
|
|
2233
2754
|
return;
|
|
2234
2755
|
}
|
|
@@ -2341,125 +2862,6 @@ function scopeRemotes(versions, remotes) {
|
|
|
2341
2862
|
return rows.filter((v) => v.remotes.length > 0);
|
|
2342
2863
|
}
|
|
2343
2864
|
|
|
2344
|
-
// src/lib/core/2.app/steps/store-remote-entry.ts
|
|
2345
|
-
function createRemoveCachedRemoteEntries(ports) {
|
|
2346
|
-
return (remoteNames) => {
|
|
2347
|
-
if (remoteNames.size === 0) return;
|
|
2348
|
-
for (const remoteName of remoteNames) {
|
|
2349
|
-
ports.remoteInfoRepo.remove(remoteName);
|
|
2350
|
-
ports.scopedExternalsRepo.remove(remoteName);
|
|
2351
|
-
ports.sharedChunksRepo.remove(remoteName);
|
|
2352
|
-
}
|
|
2353
|
-
ports.sharedExternalsRepo.removeFromAllScopes(remoteNames);
|
|
2354
|
-
};
|
|
2355
|
-
}
|
|
2356
|
-
function createStoreRemoteEntry(config, ports, logStep) {
|
|
2357
|
-
return (remoteEntry, onSharedExternal) => {
|
|
2358
|
-
addRemoteInfoToStorage(remoteEntry);
|
|
2359
|
-
addExternalsToStorage(remoteEntry, onSharedExternal);
|
|
2360
|
-
addSharedChunksToStorage(remoteEntry);
|
|
2361
|
-
};
|
|
2362
|
-
function addRemoteInfoToStorage({ name, url, exposes, integrity }) {
|
|
2363
|
-
ports.remoteInfoRepo.addOrUpdate(name, {
|
|
2364
|
-
scopeUrl: getScope(url),
|
|
2365
|
-
exposes: Object.values(exposes ?? []).map((m) => ({
|
|
2366
|
-
moduleName: m.key,
|
|
2367
|
-
file: m.outFileName
|
|
2368
|
-
})),
|
|
2369
|
-
...integrity ? { integrity } : {}
|
|
2370
|
-
});
|
|
2371
|
-
}
|
|
2372
|
-
function addExternalsToStorage(remoteEntry, onSharedExternal) {
|
|
2373
|
-
remoteEntry.shared.forEach((external) => {
|
|
2374
|
-
const tag = resolveVersion(remoteEntry, external);
|
|
2375
|
-
if (tag === null) return;
|
|
2376
|
-
if (external.singleton) {
|
|
2377
|
-
if (external.requiredVersion && !ports.versionCheck.isCompatible(tag, external.requiredVersion))
|
|
2378
|
-
config.log.warn(
|
|
2379
|
-
logStep,
|
|
2380
|
-
`[${remoteEntry.name}][${external.packageName}] requiredVersion '${external.requiredVersion}' excludes its own version '${tag}'; '${tag}' is still accepted for it.`
|
|
2381
|
-
);
|
|
2382
|
-
onSharedExternal(remoteEntry, external, sharedExternalContext(remoteEntry, external, tag));
|
|
2383
|
-
} else {
|
|
2384
|
-
addScopedExternal(remoteEntry, external, tag);
|
|
2385
|
-
}
|
|
2386
|
-
});
|
|
2387
|
-
}
|
|
2388
|
-
function addSharedChunksToStorage(remoteEntry) {
|
|
2389
|
-
if (!remoteEntry.chunks) return;
|
|
2390
|
-
config.log.debug(
|
|
2391
|
-
logStep,
|
|
2392
|
-
`Adding chunks for remote "${remoteEntry.name}", bundles: [${Object.keys(remoteEntry.chunks).join(", ")}]`
|
|
2393
|
-
);
|
|
2394
|
-
Object.entries(remoteEntry.chunks).forEach(([bundleName, chunks]) => {
|
|
2395
|
-
ports.sharedChunksRepo.addOrReplace(remoteEntry.name, bundleName, chunks);
|
|
2396
|
-
});
|
|
2397
|
-
}
|
|
2398
|
-
function addScopedExternal(remoteEntry, sharedInfo, tag) {
|
|
2399
|
-
ports.scopedExternalsRepo.addExternal(remoteEntry.name, sharedInfo.packageName, {
|
|
2400
|
-
tag,
|
|
2401
|
-
bundle: sharedInfo.bundle,
|
|
2402
|
-
entries: sharedInfo.entries
|
|
2403
|
-
});
|
|
2404
|
-
}
|
|
2405
|
-
function resolveVersion(remoteEntry, external) {
|
|
2406
|
-
if (external.version && ports.versionCheck.isValidSemver(external.version)) {
|
|
2407
|
-
return external.version;
|
|
2408
|
-
}
|
|
2409
|
-
const errorMsg = `[${remoteEntry.name}][${external.packageName}] Version '${external.version}' is not a valid version.`;
|
|
2410
|
-
if (config.strict.strictExternalVersion) {
|
|
2411
|
-
config.log.error(logStep, errorMsg);
|
|
2412
|
-
throw new NFError(`Could not process remote '${remoteEntry.name}'`);
|
|
2413
|
-
}
|
|
2414
|
-
if (config.profile.skipInvalidExternalVersions) {
|
|
2415
|
-
config.log.warn(logStep, `${errorMsg} Skipping external.`);
|
|
2416
|
-
return null;
|
|
2417
|
-
}
|
|
2418
|
-
config.log.warn(logStep, errorMsg);
|
|
2419
|
-
return ports.versionCheck.smallestVersion(external.requiredVersion);
|
|
2420
|
-
}
|
|
2421
|
-
function sharedExternalContext(remoteEntry, sharedInfo, tag) {
|
|
2422
|
-
const scopeType = ports.sharedExternalsRepo.scopeType(sharedInfo.shareScope);
|
|
2423
|
-
const remote = {
|
|
2424
|
-
name: remoteEntry.name,
|
|
2425
|
-
bundle: sharedInfo.bundle,
|
|
2426
|
-
strictVersion: sharedInfo.strictVersion,
|
|
2427
|
-
cached: false,
|
|
2428
|
-
requiredVersion: scopeType === "strict" ? tag : sharedInfo.requiredVersion || tag,
|
|
2429
|
-
...sharedInfo.pool?.trim() ? { pool: sharedInfo.pool } : {},
|
|
2430
|
-
entries: sharedInfo.entries
|
|
2431
|
-
};
|
|
2432
|
-
let stored;
|
|
2433
|
-
const readRecord = () => stored ??= ports.sharedExternalsRepo.tryGet(sharedInfo.packageName, sharedInfo.shareScope).get() ?? { dirty: false, versions: [] };
|
|
2434
|
-
return {
|
|
2435
|
-
tag,
|
|
2436
|
-
remote,
|
|
2437
|
-
readRecord,
|
|
2438
|
-
scopeType,
|
|
2439
|
-
assertSameVersionCompatibility(matchingVersion) {
|
|
2440
|
-
if (!remote.strictVersion) return;
|
|
2441
|
-
if (matchingVersion.remotes[0].requiredVersion === remote.requiredVersion) return;
|
|
2442
|
-
const errorMsg = `[${remoteEntry.name}][${sharedInfo.packageName}@${sharedInfo.version}] Required version-range '${remote.requiredVersion}' does not match cached version-range '${matchingVersion.remotes[0].requiredVersion}'`;
|
|
2443
|
-
if (config.strict.strictExternalSameVersionCompatibility) {
|
|
2444
|
-
config.log.error(logStep, errorMsg);
|
|
2445
|
-
throw new NFError(`Could not process remote '${remoteEntry.name}'`);
|
|
2446
|
-
}
|
|
2447
|
-
config.log.warn(logStep, errorMsg);
|
|
2448
|
-
},
|
|
2449
|
-
write() {
|
|
2450
|
-
ports.sharedExternalsRepo.addOrUpdate(
|
|
2451
|
-
sharedInfo.packageName,
|
|
2452
|
-
{
|
|
2453
|
-
...readRecord(),
|
|
2454
|
-
versions: readRecord().versions.sort((a, b) => ports.versionCheck.compare(b.tag, a.tag))
|
|
2455
|
-
},
|
|
2456
|
-
sharedInfo.shareScope
|
|
2457
|
-
);
|
|
2458
|
-
}
|
|
2459
|
-
};
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
|
|
2463
2865
|
// src/lib/core/2.app/steps/process-remote-entries.ts
|
|
2464
2866
|
function createProcessRemoteEntries(config, ports) {
|
|
2465
2867
|
const storeRemoteEntry = createStoreRemoteEntry(config, ports, 2);
|
|
@@ -2505,7 +2907,12 @@ function createProcessRemoteEntries(config, ports) {
|
|
|
2505
2907
|
const matchingVersion = findVersionForTag(cached2.versions, tag);
|
|
2506
2908
|
if (matchingVersion) {
|
|
2507
2909
|
assertSameVersionCompatibility(matchingVersion);
|
|
2508
|
-
addRemoteToVersion(
|
|
2910
|
+
addRemoteToVersion(
|
|
2911
|
+
matchingVersion,
|
|
2912
|
+
remote,
|
|
2913
|
+
!matchingVersion.host && !!remoteEntry?.host,
|
|
2914
|
+
config.profile.enableDebugging
|
|
2915
|
+
);
|
|
2509
2916
|
} else {
|
|
2510
2917
|
cached2.versions.push({
|
|
2511
2918
|
tag,
|
|
@@ -2623,6 +3030,7 @@ function createDetermineSharedExternals(config, ports) {
|
|
|
2623
3030
|
if (!sharedVersion) {
|
|
2624
3031
|
let leastExtraDownloads = Number.MAX_VALUE;
|
|
2625
3032
|
let leastTears = Number.MAX_VALUE;
|
|
3033
|
+
let leaderShared = false;
|
|
2626
3034
|
const selfServing = new Map(
|
|
2627
3035
|
external.versions.map((v) => {
|
|
2628
3036
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -2645,16 +3053,19 @@ function createDetermineSharedExternals(config, ports) {
|
|
|
2645
3053
|
);
|
|
2646
3054
|
external.versions.forEach((vA) => {
|
|
2647
3055
|
const extraDownloads = external.versions.reduce((sum, vB) => sum + costOf(vB, vA.tag), 0);
|
|
3056
|
+
const alreadyShared = vA.action === "share" && !!vA.remotes[0]?.cached;
|
|
2648
3057
|
if (extraDownloads < leastExtraDownloads) {
|
|
2649
3058
|
leastExtraDownloads = extraDownloads;
|
|
2650
3059
|
leastTears = uncoveredTears(external, vA, accepts);
|
|
3060
|
+
leaderShared = alreadyShared;
|
|
2651
3061
|
sharedVersion = vA;
|
|
2652
3062
|
return;
|
|
2653
3063
|
}
|
|
2654
|
-
if (extraDownloads > leastExtraDownloads) return;
|
|
3064
|
+
if (extraDownloads > leastExtraDownloads || leaderShared) return;
|
|
2655
3065
|
const tears = uncoveredTears(external, vA, accepts);
|
|
2656
|
-
if (tears < leastTears) {
|
|
3066
|
+
if (alreadyShared || tears < leastTears) {
|
|
2657
3067
|
leastTears = tears;
|
|
3068
|
+
leaderShared = alreadyShared;
|
|
2658
3069
|
sharedVersion = vA;
|
|
2659
3070
|
}
|
|
2660
3071
|
});
|
|
@@ -2666,28 +3077,81 @@ function createDetermineSharedExternals(config, ports) {
|
|
|
2666
3077
|
}
|
|
2667
3078
|
}
|
|
2668
3079
|
|
|
3080
|
+
// src/lib/utils/union-find.ts
|
|
3081
|
+
function unionFind() {
|
|
3082
|
+
const parent = /* @__PURE__ */ new Map();
|
|
3083
|
+
const find = (node) => {
|
|
3084
|
+
for (let up = parent.get(node); up !== void 0; up = parent.get(node)) {
|
|
3085
|
+
const grand = parent.get(up);
|
|
3086
|
+
if (grand === void 0) return up;
|
|
3087
|
+
parent.set(node, grand);
|
|
3088
|
+
node = grand;
|
|
3089
|
+
}
|
|
3090
|
+
return node;
|
|
3091
|
+
};
|
|
3092
|
+
const union = (a, b) => {
|
|
3093
|
+
const rootA = find(a);
|
|
3094
|
+
const rootB = find(b);
|
|
3095
|
+
if (rootA !== rootB) parent.set(rootB, rootA);
|
|
3096
|
+
};
|
|
3097
|
+
return { find, union };
|
|
3098
|
+
}
|
|
3099
|
+
|
|
2669
3100
|
// src/lib/core/1.domain/externals/specifier.ts
|
|
2670
|
-
function
|
|
3101
|
+
function npmPackageOf(name) {
|
|
2671
3102
|
const depth = name.startsWith("@") ? 2 : 1;
|
|
2672
3103
|
let cut = -1;
|
|
2673
3104
|
for (let seen = 0; seen < depth; seen++) {
|
|
2674
3105
|
cut = name.indexOf("/", cut + 1);
|
|
2675
|
-
if (cut === -1) return
|
|
3106
|
+
if (cut === -1) return name;
|
|
2676
3107
|
}
|
|
2677
3108
|
return name.slice(0, cut);
|
|
2678
3109
|
}
|
|
2679
|
-
|
|
3110
|
+
function packageOfIn(scope, loading = []) {
|
|
3111
|
+
if (!declaresLibrary(scope, loading)) return npmPackageOf;
|
|
3112
|
+
const { find, union } = unionFind();
|
|
3113
|
+
const shortest = /* @__PURE__ */ new Map();
|
|
3114
|
+
for (const [name, copy] of copiesIn(scope, loading)) {
|
|
3115
|
+
const anchor = anchorOf(name, copy);
|
|
3116
|
+
for (const specifier in copy.entries) {
|
|
3117
|
+
const best = shorter(
|
|
3118
|
+
shortest.get(find(anchor)) ?? anchor,
|
|
3119
|
+
shortest.get(find(specifier)) ?? specifier
|
|
3120
|
+
);
|
|
3121
|
+
union(anchor, specifier);
|
|
3122
|
+
shortest.set(find(anchor), best);
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3125
|
+
return (specifier) => {
|
|
3126
|
+
const npm = npmPackageOf(specifier);
|
|
3127
|
+
return shortest.get(find(specifier)) ?? shortest.get(find(npm)) ?? npm;
|
|
3128
|
+
};
|
|
3129
|
+
}
|
|
3130
|
+
var shorter = (a, b) => b.length < a.length || b.length === a.length && compareStrings(b, a) < 0 ? b : a;
|
|
3131
|
+
function declaresLibrary(scope, loading) {
|
|
3132
|
+
const isLibrary = (name, copies) => npmPackageOf(name) !== name && copies.some((copy) => copy.dense);
|
|
3133
|
+
return loading.some(([name, copy]) => isLibrary(name, [copy])) || Object.entries(scope).some(
|
|
3134
|
+
([name, external]) => external.versions.some((version) => isLibrary(name, version.remotes))
|
|
3135
|
+
);
|
|
3136
|
+
}
|
|
3137
|
+
var anchorOf = (name, copy) => copy.dense ? name : npmPackageOf(name);
|
|
3138
|
+
function* copiesIn(scope, loading) {
|
|
3139
|
+
yield* loading;
|
|
3140
|
+
for (const [name, external] of Object.entries(scope))
|
|
3141
|
+
for (const version of external.versions) for (const copy of version.remotes) yield [name, copy];
|
|
3142
|
+
}
|
|
2680
3143
|
var SpecifierTags = class extends Map {
|
|
2681
|
-
|
|
2682
|
-
constructor(entries = []) {
|
|
3144
|
+
constructor(packageOf, entries = []) {
|
|
2683
3145
|
super();
|
|
3146
|
+
this.packageOf = packageOf;
|
|
2684
3147
|
for (const [specifier, tag] of entries) this.set(specifier, tag);
|
|
2685
3148
|
}
|
|
3149
|
+
packageOf;
|
|
3150
|
+
packages = /* @__PURE__ */ new Map();
|
|
2686
3151
|
set(specifier, tag) {
|
|
2687
3152
|
super.set(specifier, tag);
|
|
2688
|
-
const pkg =
|
|
2689
|
-
if (pkg ===
|
|
2690
|
-
else if (!this.packages.has(pkg)) this.packages.set(pkg, tag);
|
|
3153
|
+
const pkg = this.packageOf(specifier);
|
|
3154
|
+
if (pkg === specifier || !this.packages.has(pkg)) this.packages.set(pkg, tag);
|
|
2691
3155
|
return this;
|
|
2692
3156
|
}
|
|
2693
3157
|
clear() {
|
|
@@ -2695,10 +3159,10 @@ var SpecifierTags = class extends Map {
|
|
|
2695
3159
|
this.packages.clear();
|
|
2696
3160
|
}
|
|
2697
3161
|
pinnedTag(specifier) {
|
|
2698
|
-
return this.get(specifier) ?? this.packages.get(
|
|
3162
|
+
return this.get(specifier) ?? this.packages.get(this.packageOf(specifier));
|
|
2699
3163
|
}
|
|
2700
3164
|
};
|
|
2701
|
-
function groupByPackage(items, nameOf) {
|
|
3165
|
+
function groupByPackage(items, nameOf, packageOf) {
|
|
2702
3166
|
const packages = /* @__PURE__ */ new Map();
|
|
2703
3167
|
for (const item of items) {
|
|
2704
3168
|
const pkg = packageOf(nameOf(item));
|
|
@@ -2712,14 +3176,11 @@ function groupByPackage(items, nameOf) {
|
|
|
2712
3176
|
// src/lib/core/1.domain/pooling/builds.ts
|
|
2713
3177
|
function copiesByRemote(members) {
|
|
2714
3178
|
const shipped = /* @__PURE__ */ new Map();
|
|
2715
|
-
for (const member of members)
|
|
2716
|
-
const
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
seen.add(meta.name);
|
|
2721
|
-
let copies = shipped.get(meta.name);
|
|
2722
|
-
if (!copies) shipped.set(meta.name, copies = []);
|
|
3179
|
+
for (const member of members)
|
|
3180
|
+
for (const [remote, records] of recordsByRemote(member)) {
|
|
3181
|
+
let copies = shipped.get(remote);
|
|
3182
|
+
if (!copies) shipped.set(remote, copies = []);
|
|
3183
|
+
for (const { version, meta } of records)
|
|
2723
3184
|
copies.push({
|
|
2724
3185
|
member: member.name,
|
|
2725
3186
|
tag: version.tag,
|
|
@@ -2728,13 +3189,22 @@ function copiesByRemote(members) {
|
|
|
2728
3189
|
host: version.host && meta === version.remotes[0],
|
|
2729
3190
|
specifiers: Object.keys(meta.entries)
|
|
2730
3191
|
});
|
|
2731
|
-
|
|
2732
|
-
}
|
|
3192
|
+
}
|
|
2733
3193
|
return shipped;
|
|
2734
3194
|
}
|
|
3195
|
+
function recordsByRemote(member) {
|
|
3196
|
+
const records = /* @__PURE__ */ new Map();
|
|
3197
|
+
for (const version of member.external.versions)
|
|
3198
|
+
for (const meta of version.remotes) {
|
|
3199
|
+
const mine = records.get(meta.name);
|
|
3200
|
+
if (!mine) records.set(meta.name, [{ version, meta }]);
|
|
3201
|
+
else if (mine[0].version.tag === version.tag) mine.push({ version, meta });
|
|
3202
|
+
}
|
|
3203
|
+
return records;
|
|
3204
|
+
}
|
|
2735
3205
|
var specifierCount = (copies) => copies.reduce((n, copy) => n + copy.specifiers.length, 0);
|
|
2736
|
-
function buildOf(owner, copies) {
|
|
2737
|
-
const tags = new SpecifierTags();
|
|
3206
|
+
function buildOf(owner, copies, packageOf) {
|
|
3207
|
+
const tags = new SpecifierTags(packageOf);
|
|
2738
3208
|
const tagByMember = /* @__PURE__ */ new Map();
|
|
2739
3209
|
for (const copy of copies) {
|
|
2740
3210
|
for (const specifier of copy.specifiers)
|
|
@@ -2776,12 +3246,14 @@ function unwitnessedGap(copies, tags, builds) {
|
|
|
2776
3246
|
function elect(input) {
|
|
2777
3247
|
const shipped = copiesByRemote(input.members);
|
|
2778
3248
|
const builds = /* @__PURE__ */ new Map();
|
|
2779
|
-
for (const [owner, copies] of shipped) builds.set(owner, buildOf(owner, copies));
|
|
3249
|
+
for (const [owner, copies] of shipped) builds.set(owner, buildOf(owner, copies, input.packageOf));
|
|
2780
3250
|
const pool = {
|
|
2781
3251
|
...input,
|
|
2782
3252
|
shipped,
|
|
2783
3253
|
builds,
|
|
2784
|
-
packages: new Map(
|
|
3254
|
+
packages: new Map(
|
|
3255
|
+
[...shipped].map(([owner, copies]) => [owner, packageCopies(owner, copies, input.packageOf)])
|
|
3256
|
+
),
|
|
2785
3257
|
remotes: [...shipped.keys()],
|
|
2786
3258
|
servesAt: (remote, tags) => serves(shipped.get(remote), tags, input.acceptsTag),
|
|
2787
3259
|
agreesAt: (remote, tags) => agrees(shipped.get(remote), tags)
|
|
@@ -2844,7 +3316,7 @@ function roundOne(pool, hostRemote) {
|
|
|
2844
3316
|
(c) => c.build.owner === pool.previousWinner ? 1 : 0
|
|
2845
3317
|
]);
|
|
2846
3318
|
const winner = round1Winner.build.owner;
|
|
2847
|
-
const globalTags = new SpecifierTags(round1Winner.build.tags);
|
|
3319
|
+
const globalTags = new SpecifierTags(pool.packageOf, round1Winner.build.tags);
|
|
2848
3320
|
const globalRemotes = /* @__PURE__ */ new Set([winner, ...round1Winner.served]);
|
|
2849
3321
|
const pending = remotes.filter((r) => !globalRemotes.has(r));
|
|
2850
3322
|
return { winner, globalTags, globalRemotes, extensions: /* @__PURE__ */ new Set(), subpools: [], pending };
|
|
@@ -2901,7 +3373,7 @@ function addExtensions(pool, state) {
|
|
|
2901
3373
|
for (const s of offer.specifiers) globalTags.set(s, offer.tag);
|
|
2902
3374
|
}
|
|
2903
3375
|
}
|
|
2904
|
-
function packageCopies(owner, copies) {
|
|
3376
|
+
function packageCopies(owner, copies, packageOf) {
|
|
2905
3377
|
const packages = /* @__PURE__ */ new Map();
|
|
2906
3378
|
for (const copy of copies)
|
|
2907
3379
|
for (const s of copy.specifiers) {
|
|
@@ -2943,7 +3415,7 @@ function settle(pool, state) {
|
|
|
2943
3415
|
const dropped = new Set([...extensions].filter((pkg) => !publishedWhole(pool, state, pkg)));
|
|
2944
3416
|
if (dropped.size === 0) return demoted;
|
|
2945
3417
|
for (const pkg of dropped) extensions.delete(pkg);
|
|
2946
|
-
const kept = [...globalTags].filter(([s]) => !dropped.has(packageOf(s)));
|
|
3418
|
+
const kept = [...globalTags].filter(([s]) => !dropped.has(pool.packageOf(s)));
|
|
2947
3419
|
globalTags.clear();
|
|
2948
3420
|
for (const [s, tag] of kept) globalTags.set(s, tag);
|
|
2949
3421
|
for (const remote of globalRemotes)
|
|
@@ -2959,7 +3431,7 @@ function settle(pool, state) {
|
|
|
2959
3431
|
}
|
|
2960
3432
|
}
|
|
2961
3433
|
function publishedWhole(pool, state, pkg) {
|
|
2962
|
-
const published = new Set([...state.globalTags.keys()].filter((s) => packageOf(s) === pkg));
|
|
3434
|
+
const published = new Set([...state.globalTags.keys()].filter((s) => pool.packageOf(s) === pkg));
|
|
2963
3435
|
const tag = state.globalTags.pinnedTag(pkg);
|
|
2964
3436
|
return [...state.globalRemotes].some((remote) => {
|
|
2965
3437
|
const copy = pool.packages.get(remote).get(pkg);
|
|
@@ -3008,24 +3480,6 @@ function placeRemotes(globalRemotes, subpools, self, missOf2) {
|
|
|
3008
3480
|
}
|
|
3009
3481
|
|
|
3010
3482
|
// src/lib/core/1.domain/pooling/membership.ts
|
|
3011
|
-
function unionFind() {
|
|
3012
|
-
const parent = /* @__PURE__ */ new Map();
|
|
3013
|
-
const find = (node) => {
|
|
3014
|
-
for (let up = parent.get(node); up !== void 0; up = parent.get(node)) {
|
|
3015
|
-
const grand = parent.get(up);
|
|
3016
|
-
if (grand === void 0) return up;
|
|
3017
|
-
parent.set(node, grand);
|
|
3018
|
-
node = grand;
|
|
3019
|
-
}
|
|
3020
|
-
return node;
|
|
3021
|
-
};
|
|
3022
|
-
const union = (a, b) => {
|
|
3023
|
-
const rootA = find(a);
|
|
3024
|
-
const rootB = find(b);
|
|
3025
|
-
if (rootA !== rootB) parent.set(rootB, rootA);
|
|
3026
|
-
};
|
|
3027
|
-
return { find, union };
|
|
3028
|
-
}
|
|
3029
3483
|
var extNode = (name) => `ext\0${name}`;
|
|
3030
3484
|
var labelNode = (label) => `label\0${label}`;
|
|
3031
3485
|
var labelOf = (pool) => pool?.trim() || void 0;
|
|
@@ -3038,13 +3492,13 @@ function labelsIn(sharedExternals) {
|
|
|
3038
3492
|
);
|
|
3039
3493
|
return labelsOf;
|
|
3040
3494
|
}
|
|
3041
|
-
function labelledComponents(labelsOf) {
|
|
3495
|
+
function labelledComponents(labelsOf, packageOf) {
|
|
3042
3496
|
const { find, union } = unionFind();
|
|
3043
3497
|
for (const [name, labels] of labelsOf)
|
|
3044
3498
|
for (const label of labels) union(extNode(name), labelNode(label));
|
|
3045
3499
|
for (const name of labelsOf.keys()) {
|
|
3046
|
-
const owner =
|
|
3047
|
-
if (owner !==
|
|
3500
|
+
const owner = packageOf(name);
|
|
3501
|
+
if (owner !== name) union(extNode(name), extNode(owner));
|
|
3048
3502
|
}
|
|
3049
3503
|
const byComponent = /* @__PURE__ */ new Map();
|
|
3050
3504
|
for (const name of labelsOf.keys()) {
|
|
@@ -3054,11 +3508,11 @@ function labelledComponents(labelsOf) {
|
|
|
3054
3508
|
}
|
|
3055
3509
|
return [...byComponent.values()].filter((names) => names.some((n) => labelsOf.get(n).length > 0));
|
|
3056
3510
|
}
|
|
3057
|
-
function buildPools(sharedExternals) {
|
|
3511
|
+
function buildPools(sharedExternals, packageOf = packageOfIn(sharedExternals)) {
|
|
3058
3512
|
const labelsOf = labelsIn(sharedExternals);
|
|
3059
3513
|
const pools = /* @__PURE__ */ new Map();
|
|
3060
3514
|
const labelledAlone = [];
|
|
3061
|
-
for (const names of labelledComponents(labelsOf)) {
|
|
3515
|
+
for (const names of labelledComponents(labelsOf, packageOf)) {
|
|
3062
3516
|
if (names.length < 2) labelledAlone.push(names[0]);
|
|
3063
3517
|
else {
|
|
3064
3518
|
const members = names.map((name) => ({ name, external: sharedExternals[name] }));
|
|
@@ -3068,9 +3522,9 @@ function buildPools(sharedExternals) {
|
|
|
3068
3522
|
);
|
|
3069
3523
|
}
|
|
3070
3524
|
}
|
|
3071
|
-
return { pools, labelledAlone };
|
|
3525
|
+
return { pools, labelledAlone, packageOf };
|
|
3072
3526
|
}
|
|
3073
|
-
function pooledPackagesWith(sharedExternals, copies) {
|
|
3527
|
+
function pooledPackagesWith(sharedExternals, copies, packageOf) {
|
|
3074
3528
|
const labelsOf = labelsIn(sharedExternals);
|
|
3075
3529
|
for (const { name, pool } of copies) {
|
|
3076
3530
|
const labels = labelsOf.get(name) ?? [];
|
|
@@ -3078,7 +3532,7 @@ function pooledPackagesWith(sharedExternals, copies) {
|
|
|
3078
3532
|
labelsOf.set(name, label === void 0 ? labels : [...labels, label]);
|
|
3079
3533
|
}
|
|
3080
3534
|
return new Set(
|
|
3081
|
-
labelledComponents(labelsOf).filter((names) => names.length > 1).flatMap((names) => names.map(packageOf))
|
|
3535
|
+
labelledComponents(labelsOf, packageOf).filter((names) => names.length > 1).flatMap((names) => names.map(packageOf))
|
|
3082
3536
|
);
|
|
3083
3537
|
}
|
|
3084
3538
|
function mostDeclaredLabel(members, labelsOf) {
|
|
@@ -3124,7 +3578,7 @@ function memberRecord(member, pool, compare) {
|
|
|
3124
3578
|
const row = { tag, host: false, action, remotes: [meta] };
|
|
3125
3579
|
placed.push(row);
|
|
3126
3580
|
if (meta.name !== pool.winner) return;
|
|
3127
|
-
winnerRow
|
|
3581
|
+
winnerRow ??= row;
|
|
3128
3582
|
row.host = pool.winnerIsHost;
|
|
3129
3583
|
};
|
|
3130
3584
|
for (const version of member.external.versions)
|
|
@@ -3138,9 +3592,9 @@ function memberRecord(member, pool, compare) {
|
|
|
3138
3592
|
place(version.tag, "skip", { ...meta, servedBy: placement.owner });
|
|
3139
3593
|
else place(version.tag, "scope", { ...meta, poolCause: placement.cause });
|
|
3140
3594
|
}
|
|
3595
|
+
const rank2 = (name) => name === pool.winner ? 0 : claimsGlobally(name) ? 1 : 2;
|
|
3141
3596
|
const rows = mergeRows(placed, winnerRow);
|
|
3142
|
-
for (const row of rows)
|
|
3143
|
-
row.remotes.sort((a, b) => Number(!claimsGlobally(a.name)) - Number(!claimsGlobally(b.name)));
|
|
3597
|
+
for (const row of rows) row.remotes.sort((a, b) => rank2(a.name) - rank2(b.name));
|
|
3144
3598
|
const order = { share: 0, skip: 1, scope: 2 };
|
|
3145
3599
|
const newest = byTag(compare);
|
|
3146
3600
|
const versions = rows.sort((a, b) => newest(a, b) || order[a.action] - order[b.action]);
|
|
@@ -3161,14 +3615,16 @@ function moveCopy(external, remote, move, compare) {
|
|
|
3161
3615
|
if ("fromMap" in move) return recordFromMap(external, remote);
|
|
3162
3616
|
const moved = [];
|
|
3163
3617
|
const versions = external.versions.map((v) => {
|
|
3164
|
-
const
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
return { ...v, remotes: v.remotes.
|
|
3618
|
+
const replaced = /* @__PURE__ */ new Map();
|
|
3619
|
+
for (const copy of v.remotes) {
|
|
3620
|
+
if (copy.name !== remote) continue;
|
|
3621
|
+
const { servedBy: _servedBy, ...rest } = copy;
|
|
3622
|
+
replaced.set(copy, { ...rest, cached: true, poolCause: move.cause });
|
|
3623
|
+
}
|
|
3624
|
+
if (replaced.size === 0) return v;
|
|
3625
|
+
if (v.action === "scope") return { ...v, remotes: v.remotes.map((r) => replaced.get(r) ?? r) };
|
|
3626
|
+
for (const meta of replaced.values()) moved.push({ tag: v.tag, meta });
|
|
3627
|
+
return { ...v, remotes: v.remotes.filter((r) => !replaced.has(r)) };
|
|
3172
3628
|
}).filter((v) => v.remotes.length > 0);
|
|
3173
3629
|
for (const { tag, meta } of moved) {
|
|
3174
3630
|
const scoped = rowAt(versions, tag, "scope");
|
|
@@ -3181,10 +3637,10 @@ function recordFromMap(external, remote) {
|
|
|
3181
3637
|
const opened = external.versions.find(
|
|
3182
3638
|
(v) => v.action !== "skip" && v.remotes.some((r) => r.name === remote)
|
|
3183
3639
|
);
|
|
3184
|
-
const meta = { ...opened.remotes.find((r) => r.name === remote), cached: false };
|
|
3185
3640
|
const joined = rowAt(external.versions, opened.tag, "skip");
|
|
3186
3641
|
const into = joined ? { ...joined, remotes: [...joined.remotes] } : { ...opened, action: "skip", remotes: [] };
|
|
3187
|
-
|
|
3642
|
+
for (const copy of opened.remotes)
|
|
3643
|
+
if (copy.name === remote) addRemoteToVersion(into, { ...copy, cached: false });
|
|
3188
3644
|
const versions = external.versions.flatMap((v) => {
|
|
3189
3645
|
if (v === joined) return [into];
|
|
3190
3646
|
if (v !== opened) return [v];
|
|
@@ -3214,14 +3670,14 @@ function renamedRecords(scope, pools) {
|
|
|
3214
3670
|
// src/lib/core/1.domain/pooling/plan.ts
|
|
3215
3671
|
function planElection(scope, poolable) {
|
|
3216
3672
|
if (!poolable || !Object.values(scope).some((external) => external.dirty) || !scopeHasPoolState(scope))
|
|
3217
|
-
return { pools: /* @__PURE__ */ new Map(), stripped: /* @__PURE__ */ new Map(), labelledAlone: [] };
|
|
3218
|
-
const { pools, labelledAlone } = buildPools(scope);
|
|
3673
|
+
return { pools: /* @__PURE__ */ new Map(), stripped: /* @__PURE__ */ new Map(), labelledAlone: [], packageOf: npmPackageOf };
|
|
3674
|
+
const { pools, labelledAlone, packageOf } = buildPools(scope);
|
|
3219
3675
|
const pooled = new Set([...pools.values()].flatMap((members) => members.map((m) => m.name)));
|
|
3220
3676
|
const stripped = /* @__PURE__ */ new Map();
|
|
3221
3677
|
for (const [name, external] of Object.entries(scope))
|
|
3222
3678
|
if (!pooled.has(name) && hasPoolResults(external))
|
|
3223
3679
|
stripped.set(name, { ...withoutPoolResults(external), dirty: true });
|
|
3224
|
-
return { pools, stripped, labelledAlone };
|
|
3680
|
+
return { pools, stripped, labelledAlone, packageOf };
|
|
3225
3681
|
}
|
|
3226
3682
|
|
|
3227
3683
|
// src/lib/core/2.app/steps/pooling/pool-shared-externals.ts
|
|
@@ -3235,7 +3691,7 @@ function createPoolSharedExternals(config, ports) {
|
|
|
3235
3691
|
const plan = planElection(sharedExternals, repo.scopeType(scope) !== "strict");
|
|
3236
3692
|
logPlan(plan, sharedExternals, scope);
|
|
3237
3693
|
for (const [poolName, members] of plan.pools)
|
|
3238
|
-
for (const [name, record] of poolRecords(poolName, members, scope))
|
|
3694
|
+
for (const [name, record] of poolRecords(poolName, members, plan.packageOf, scope))
|
|
3239
3695
|
repo.addOrUpdate(name, record, scope);
|
|
3240
3696
|
for (const [name, external] of plan.stripped) repo.addOrUpdate(name, external, scope);
|
|
3241
3697
|
} catch (error) {
|
|
@@ -3270,9 +3726,10 @@ function createPoolSharedExternals(config, ports) {
|
|
|
3270
3726
|
`[${scope}] '${name}' has a 'pool' label that joins no other external; likely a typo or a missing sibling.`
|
|
3271
3727
|
);
|
|
3272
3728
|
}
|
|
3273
|
-
function poolRecords(poolName, members, scope) {
|
|
3729
|
+
function poolRecords(poolName, members, packageOf, scope) {
|
|
3274
3730
|
const election = elect({
|
|
3275
3731
|
members,
|
|
3732
|
+
packageOf,
|
|
3276
3733
|
acceptsTag: createAcceptsTag(ports.versionCheck.isCompatible, compare),
|
|
3277
3734
|
compare,
|
|
3278
3735
|
previousWinner: previousWinner(members),
|
|
@@ -3333,12 +3790,13 @@ function missWarning(remote, miss, placed, counts) {
|
|
|
3333
3790
|
|
|
3334
3791
|
// src/lib/core/1.domain/externals/serving.ts
|
|
3335
3792
|
var byServingRank = (a, b) => Number(b.host) - Number(a.host) || a.downloads - b.downloads || a.fallbacks - b.fallbacks || Number(b.rootBasis) - Number(a.rootBasis) || compareStrings(a.remote, b.remote);
|
|
3336
|
-
var packagesOf = (scope) => groupByPackage(Object.keys(scope), (name) => name);
|
|
3793
|
+
var packagesOf = (scope) => groupByPackage(Object.keys(scope), (name) => name, packageOfIn(scope));
|
|
3337
3794
|
var isPooled = (externals) => externals.some(([, e]) => e.poolName !== void 0);
|
|
3338
|
-
function servingBuildOf(externals, accepts) {
|
|
3795
|
+
function servingBuildOf(pkg, externals, accepts) {
|
|
3339
3796
|
if (externals.length === 0) return void 0;
|
|
3340
|
-
const
|
|
3341
|
-
|
|
3797
|
+
const rootRows = shareRows(externals.find(([name]) => name === pkg)?.[1]).filter(
|
|
3798
|
+
(row) => row.remotes.some((copy) => pkg in copy.entries)
|
|
3799
|
+
);
|
|
3342
3800
|
const rows = rootRows.length > 0 ? rootRows : externals.flatMap(([, e]) => shareRows(e));
|
|
3343
3801
|
if (isPooled(externals)) return pooledBuild(externals, rows);
|
|
3344
3802
|
const consumers = consumersOf(externals);
|
|
@@ -3367,11 +3825,12 @@ function cheapestBuild(field, costOf) {
|
|
|
3367
3825
|
}
|
|
3368
3826
|
function shareServingCopies(external, serving) {
|
|
3369
3827
|
for (const row of external.versions) {
|
|
3370
|
-
|
|
3371
|
-
|
|
3828
|
+
if (row.action !== "skip" || rowAt(external.versions, row.tag, "share")) continue;
|
|
3829
|
+
const own = row.remotes.filter((c) => c.name === serving.remote);
|
|
3830
|
+
if (own.length === 0) continue;
|
|
3372
3831
|
row.action = "share";
|
|
3373
|
-
if (row.remotes[0] !==
|
|
3374
|
-
row.remotes = [
|
|
3832
|
+
if (row.remotes[0] !== own[0]) row.host = false;
|
|
3833
|
+
row.remotes = [...own, ...row.remotes.filter((c) => c.name !== serving.remote)];
|
|
3375
3834
|
}
|
|
3376
3835
|
}
|
|
3377
3836
|
function followServingBuild(external, serving, accepts) {
|
|
@@ -3416,20 +3875,20 @@ function shareRows(external) {
|
|
|
3416
3875
|
return external?.versions.filter((v) => v.action === "share") ?? [];
|
|
3417
3876
|
}
|
|
3418
3877
|
function buildsOf(rows, rootRows, consumers) {
|
|
3419
|
-
const
|
|
3878
|
+
const builds = /* @__PURE__ */ new Map();
|
|
3420
3879
|
for (const row of rows)
|
|
3421
3880
|
for (const copy of row.remotes) {
|
|
3422
3881
|
const key = `${row.tag}|${copy.name}`;
|
|
3423
|
-
if (copy.servedBy ||
|
|
3882
|
+
if (copy.servedBy || builds.has(key) || shipsTwoTags(consumers.get(copy.name))) continue;
|
|
3424
3883
|
const basis = copy === row.remotes[0];
|
|
3425
|
-
|
|
3884
|
+
builds.set(key, {
|
|
3426
3885
|
remote: copy.name,
|
|
3427
3886
|
tag: row.tag,
|
|
3428
3887
|
host: basis && row.host,
|
|
3429
3888
|
rootBasis: basis && rootRows.includes(row)
|
|
3430
3889
|
});
|
|
3431
3890
|
}
|
|
3432
|
-
return [...
|
|
3891
|
+
return [...builds.values()];
|
|
3433
3892
|
}
|
|
3434
3893
|
function pooledBuild(externals, rows) {
|
|
3435
3894
|
const winner = externals.find(([, e]) => e.poolWinner !== void 0)?.[1].poolWinner;
|
|
@@ -3438,10 +3897,7 @@ function pooledBuild(externals, rows) {
|
|
|
3438
3897
|
);
|
|
3439
3898
|
const own = shipped.find((c) => c.remote === winner);
|
|
3440
3899
|
if (own) return own;
|
|
3441
|
-
const width = ({ remote, tag }) => externals.
|
|
3442
|
-
const copy = shareRows(e).find((row) => row.tag === tag)?.remotes.find((c) => c.name === remote);
|
|
3443
|
-
return n + Object.keys(copy?.entries ?? {}).length;
|
|
3444
|
-
}, 0);
|
|
3900
|
+
const width = ({ remote, tag }) => externals.flatMap(([, e]) => shareRows(e).find((row) => row.tag === tag)?.remotes ?? []).filter((copy) => copy.name === remote).reduce((n, copy) => n + Object.keys(copy.entries).length, 0);
|
|
3445
3901
|
return shipped.map((c) => ({ c, width: width(c) })).sort((a, b) => b.width - a.width || compareStrings(a.c.remote, b.c.remote))[0]?.c;
|
|
3446
3902
|
}
|
|
3447
3903
|
function consumersOf(externals) {
|
|
@@ -3539,8 +3995,8 @@ function splitsPackage(placed, surface, tag, accepts) {
|
|
|
3539
3995
|
});
|
|
3540
3996
|
return placed.some(onMap) && (shipsTwoTags(placed) || placed.some((p) => !onMap(p) || uncovered(p)));
|
|
3541
3997
|
}
|
|
3542
|
-
function loadSplitsPackage(copies, claims, accepts) {
|
|
3543
|
-
const root = claims.find(([specifier]) => specifier ===
|
|
3998
|
+
function loadSplitsPackage(pkg, copies, claims, accepts) {
|
|
3999
|
+
const root = claims.find(([specifier]) => specifier === pkg)?.[1];
|
|
3544
4000
|
const servingTag = root?.tag ?? claims[0][1].tag;
|
|
3545
4001
|
const surface = new Map(
|
|
3546
4002
|
claims.map(([specifier, { tag }]) => [specifier, root ? tag : servingTag])
|
|
@@ -3586,7 +4042,7 @@ function createDecideServingBuilds(config, ports) {
|
|
|
3586
4042
|
}
|
|
3587
4043
|
};
|
|
3588
4044
|
function decidePackage(shareScope, pkg, externals, accepts) {
|
|
3589
|
-
const serving = servingBuildOf(externals, accepts);
|
|
4045
|
+
const serving = servingBuildOf(pkg, externals, accepts);
|
|
3590
4046
|
const before = externals.map(([, external]) => shapeOf(external));
|
|
3591
4047
|
const pooled = isPooled(externals);
|
|
3592
4048
|
const toFollow = pooled ? void 0 : serving;
|
|
@@ -3672,7 +4128,6 @@ function committedClaims(externals, { shareScope, without }) {
|
|
|
3672
4128
|
const publishes = (copy) => copy.name !== without && (shareScope !== GLOBAL_SCOPE || copy.cached);
|
|
3673
4129
|
return claimTable(externals, publishes).claims;
|
|
3674
4130
|
}
|
|
3675
|
-
var claimsByPackage = (claims) => groupByPackage(claims, ([specifier]) => specifier);
|
|
3676
4131
|
function versionClaims(version, servingBuild) {
|
|
3677
4132
|
const claims = /* @__PURE__ */ new Map();
|
|
3678
4133
|
const claim = (specifier, copy) => {
|
|
@@ -3683,16 +4138,6 @@ function versionClaims(version, servingBuild) {
|
|
|
3683
4138
|
return claims;
|
|
3684
4139
|
}
|
|
3685
4140
|
|
|
3686
|
-
// node_modules/.pnpm/@softarc+native-federation@4.8.0/node_modules/@softarc/native-federation/dist/lib/domain/core/chunk.js
|
|
3687
|
-
var CHUNK_PREFIX = "@nf-internal";
|
|
3688
|
-
function toChunkImport(fileName) {
|
|
3689
|
-
if (fileName.startsWith("./")) {
|
|
3690
|
-
fileName = fileName.slice(2);
|
|
3691
|
-
}
|
|
3692
|
-
const packageName = fileName.replace(/.(m|c)?js$/, "");
|
|
3693
|
-
return CHUNK_PREFIX + "/" + packageName;
|
|
3694
|
-
}
|
|
3695
|
-
|
|
3696
4141
|
// src/lib/core/2.app/steps/generate-import-map.ts
|
|
3697
4142
|
function createGenerateImportMap(config, ports) {
|
|
3698
4143
|
return () => {
|
|
@@ -4079,16 +4524,99 @@ function shipsOnly(version, served) {
|
|
|
4079
4524
|
return only;
|
|
4080
4525
|
}
|
|
4081
4526
|
|
|
4527
|
+
// src/lib/core/2.app/steps/preload-hint.ts
|
|
4528
|
+
function createPreloadHint(log, browser, logStep) {
|
|
4529
|
+
const ignore = (error) => log.debug(logStep, "Ignored a failing preload hint.", error);
|
|
4530
|
+
return (collectUrls) => {
|
|
4531
|
+
if (!browser.preloadModules) return;
|
|
4532
|
+
try {
|
|
4533
|
+
const urls = collectUrls();
|
|
4534
|
+
if (urls.length === 0) return;
|
|
4535
|
+
void Promise.resolve(browser.preloadModules(urls)).catch(ignore);
|
|
4536
|
+
} catch (error) {
|
|
4537
|
+
ignore(error);
|
|
4538
|
+
}
|
|
4539
|
+
};
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
// src/lib/core/1.domain/import-map/eager-preloads.ts
|
|
4543
|
+
function eagerPreloadUrls(importMap, candidates) {
|
|
4544
|
+
let mapped;
|
|
4545
|
+
const urls = /* @__PURE__ */ new Set();
|
|
4546
|
+
const bundlesAdded = /* @__PURE__ */ new Set();
|
|
4547
|
+
for (const { scopeUrl, entryFiles, bundle } of candidates) {
|
|
4548
|
+
mapped ??= mappedUrls(importMap);
|
|
4549
|
+
const entryUrls = entryFiles.map((file) => join(scopeUrl, file));
|
|
4550
|
+
const served = entryUrls.length > 0 && entryUrls.every((url) => mapped.has(url));
|
|
4551
|
+
if (!served) continue;
|
|
4552
|
+
entryUrls.forEach((url) => urls.add(url));
|
|
4553
|
+
if (!bundle) continue;
|
|
4554
|
+
const bundleKey = `${scopeUrl}
|
|
4555
|
+
${bundle.name}`;
|
|
4556
|
+
if (bundlesAdded.has(bundleKey)) continue;
|
|
4557
|
+
bundlesAdded.add(bundleKey);
|
|
4558
|
+
bundle.chunkFiles.forEach((file) => urls.add(join(scopeUrl, file)));
|
|
4559
|
+
}
|
|
4560
|
+
return [...urls];
|
|
4561
|
+
}
|
|
4562
|
+
var mappedUrls = (importMap) => /* @__PURE__ */ new Set([
|
|
4563
|
+
...Object.values(importMap.imports),
|
|
4564
|
+
...Object.values(importMap.scopes ?? {}).flatMap((scope) => Object.values(scope))
|
|
4565
|
+
]);
|
|
4566
|
+
|
|
4567
|
+
// src/lib/core/2.app/steps/collect-eager-preloads.ts
|
|
4568
|
+
function createCollectEagerPreloads(ports) {
|
|
4569
|
+
return (importMap) => eagerPreloadUrls(importMap, candidates());
|
|
4570
|
+
function* candidates() {
|
|
4571
|
+
for (const [remoteName, copy] of storedCopies()) {
|
|
4572
|
+
if (!copy.preload) continue;
|
|
4573
|
+
const scopeUrl = ports.remoteInfoRepo.tryGet(remoteName).get()?.scopeUrl;
|
|
4574
|
+
if (!scopeUrl) continue;
|
|
4575
|
+
yield {
|
|
4576
|
+
scopeUrl,
|
|
4577
|
+
entryFiles: Object.values(copy.entries),
|
|
4578
|
+
...copy.bundle && {
|
|
4579
|
+
bundle: {
|
|
4580
|
+
name: copy.bundle,
|
|
4581
|
+
chunkFiles: ports.sharedChunksRepo.tryGet(remoteName, copy.bundle).orElse([])
|
|
4582
|
+
}
|
|
4583
|
+
}
|
|
4584
|
+
};
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
function* storedCopies() {
|
|
4588
|
+
const shared = ports.sharedExternalsRepo;
|
|
4589
|
+
for (const shareScope of shared.getScopes())
|
|
4590
|
+
for (const external of Object.values(shared.getFromScope(shareScope)))
|
|
4591
|
+
for (const version of external.versions)
|
|
4592
|
+
for (const copy of version.remotes) yield [copy.name, copy];
|
|
4593
|
+
for (const [remoteName, externals] of Object.entries(ports.scopedExternalsRepo.getAll()))
|
|
4594
|
+
for (const copy of Object.values(externals)) yield [remoteName, copy];
|
|
4595
|
+
}
|
|
4596
|
+
}
|
|
4597
|
+
|
|
4082
4598
|
// src/lib/core/2.app/steps/commit-changes.ts
|
|
4083
4599
|
function createCommitChanges(config, ports) {
|
|
4084
|
-
|
|
4600
|
+
const preload = createPreloadHint(config.log, ports.browser, 5);
|
|
4601
|
+
const collectEagerPreloads = createCollectEagerPreloads(ports);
|
|
4602
|
+
return (importMap, { markUndecided = false, ...browserOpts } = {}) => Promise.resolve(importMap).then((map) => addToBrowser(map, browserOpts)).then((added) => {
|
|
4085
4603
|
if (markUndecided) markUndecidedScopes();
|
|
4086
4604
|
persistRepositoryChanges();
|
|
4605
|
+
preloadOnceAdded(added, importMap);
|
|
4087
4606
|
});
|
|
4088
4607
|
function addToBrowser(importMap, opts) {
|
|
4089
|
-
ports.browser.setImportMapFn(importMap, opts);
|
|
4608
|
+
const added = ports.browser.setImportMapFn(importMap, opts);
|
|
4090
4609
|
config.log.debug(5, "Added import map to browser.", importMap);
|
|
4091
|
-
return
|
|
4610
|
+
return { added };
|
|
4611
|
+
}
|
|
4612
|
+
function preloadOnceAdded({ added }, importMap) {
|
|
4613
|
+
Promise.resolve(added).then(
|
|
4614
|
+
() => preload(() => collectEagerPreloads(importMap)),
|
|
4615
|
+
(error) => {
|
|
4616
|
+
config.log.error(5, "Could not add the import map.", error);
|
|
4617
|
+
return Promise.reject(error);
|
|
4618
|
+
}
|
|
4619
|
+
);
|
|
4092
4620
|
}
|
|
4093
4621
|
function markUndecidedScopes() {
|
|
4094
4622
|
const repo = ports.sharedExternalsRepo;
|
|
@@ -4129,6 +4657,7 @@ function createRollbackChanges(config, ports) {
|
|
|
4129
4657
|
|
|
4130
4658
|
// src/lib/core/2.app/steps/expose-module-loader.ts
|
|
4131
4659
|
function createExposeModuleLoader(config, ports) {
|
|
4660
|
+
const preload = createPreloadHint(config.log, ports.browser, 6);
|
|
4132
4661
|
const loadRemoteModule = (remoteName, exposedModule) => {
|
|
4133
4662
|
try {
|
|
4134
4663
|
if (!ports.remoteInfoRepo.contains(remoteName)) {
|
|
@@ -4140,6 +4669,7 @@ function createExposeModuleLoader(config, ports) {
|
|
|
4140
4669
|
)
|
|
4141
4670
|
);
|
|
4142
4671
|
config.log.debug(6, `Loading initialized module '${remoteModuleUrl}'`);
|
|
4672
|
+
preload(() => ports.remoteInfoRepo.getModuleChunkUrls(remoteName, exposedModule));
|
|
4143
4673
|
return ports.browser.importModule(remoteModuleUrl);
|
|
4144
4674
|
} catch (error) {
|
|
4145
4675
|
config.log.error(6, `Failed to load module ${join(remoteName, exposedModule)}: `, {
|
|
@@ -4150,7 +4680,15 @@ function createExposeModuleLoader(config, ports) {
|
|
|
4150
4680
|
);
|
|
4151
4681
|
}
|
|
4152
4682
|
};
|
|
4153
|
-
|
|
4683
|
+
const preloadRemoteModule = (remoteName, exposedModule) => preload(() => {
|
|
4684
|
+
const url = ports.remoteInfoRepo.tryGetModule(remoteName, exposedModule);
|
|
4685
|
+
if (!url.isPresent()) {
|
|
4686
|
+
config.log.debug(6, `Nothing to preload for '${remoteName}/${exposedModule}'.`);
|
|
4687
|
+
return [];
|
|
4688
|
+
}
|
|
4689
|
+
return [url.get(), ...ports.remoteInfoRepo.getModuleChunkUrls(remoteName, exposedModule)];
|
|
4690
|
+
});
|
|
4691
|
+
return () => Promise.resolve({ loadRemoteModule, preloadRemoteModule });
|
|
4154
4692
|
}
|
|
4155
4693
|
|
|
4156
4694
|
// src/lib/core/2.app/steps/get-remote-entry.ts
|
|
@@ -4251,18 +4789,19 @@ function createUpdateCache(config, ports) {
|
|
|
4251
4789
|
function decidePackages(remoteEntry, pending) {
|
|
4252
4790
|
const decisions = /* @__PURE__ */ new Map();
|
|
4253
4791
|
const viewOf = loadViewOf(remoteEntry, pending);
|
|
4254
|
-
for (const group of pendingPerPackage(pending)) {
|
|
4792
|
+
for (const group of pendingPerPackage(pending, viewOf)) {
|
|
4255
4793
|
const decision = group[0].ctx.scopeType === "strict" ? { action: "share" } : decidePackage(remoteEntry, group, viewOf(group[0].external.shareScope));
|
|
4256
4794
|
for (const item of group) decisions.set(item, decision);
|
|
4257
4795
|
}
|
|
4258
4796
|
scopeOpenedPackages(decisions);
|
|
4259
4797
|
return decisions;
|
|
4260
4798
|
}
|
|
4261
|
-
function pendingPerPackage(pending) {
|
|
4799
|
+
function pendingPerPackage(pending, viewOf) {
|
|
4262
4800
|
const packages = /* @__PURE__ */ new Map();
|
|
4263
4801
|
for (const item of pending) {
|
|
4264
4802
|
const { shareScope, packageName } = item.external;
|
|
4265
|
-
const
|
|
4803
|
+
const pkg = item.ctx.scopeType === "strict" ? packageName : viewOf(shareScope).packageOf(packageName);
|
|
4804
|
+
const key = `${shareScope ?? GLOBAL_SCOPE}\0${pkg}`;
|
|
4266
4805
|
const group = packages.get(key);
|
|
4267
4806
|
if (group) group.push(item);
|
|
4268
4807
|
else packages.set(key, [item]);
|
|
@@ -4280,20 +4819,34 @@ function createUpdateCache(config, ports) {
|
|
|
4280
4819
|
shareScope: scope,
|
|
4281
4820
|
without: remoteEntry.name
|
|
4282
4821
|
});
|
|
4283
|
-
const
|
|
4822
|
+
const packageOf = packageOfIn(record, loadingIn(pending, scope));
|
|
4823
|
+
const claimsIn = groupByPackage(claims, ([specifier]) => specifier, packageOf);
|
|
4284
4824
|
let pooled;
|
|
4285
4825
|
view = {
|
|
4826
|
+
packageOf,
|
|
4286
4827
|
claims,
|
|
4287
4828
|
claimsOf: (pkg) => claimsIn.get(pkg) ?? [],
|
|
4288
|
-
inPool: (pkg) =>
|
|
4829
|
+
inPool: (pkg) => {
|
|
4830
|
+
pooled ??= pooledPackagesWith(record, labelledCopiesIn(pending, scope), packageOf);
|
|
4831
|
+
return pooled.has(pkg);
|
|
4832
|
+
}
|
|
4289
4833
|
};
|
|
4290
4834
|
views.set(scope, view);
|
|
4291
4835
|
}
|
|
4292
4836
|
return view;
|
|
4293
4837
|
};
|
|
4294
4838
|
}
|
|
4295
|
-
function
|
|
4296
|
-
return pending.filter(({ external }) => (external.shareScope ?? GLOBAL_SCOPE) === scope)
|
|
4839
|
+
function inScope(pending, scope) {
|
|
4840
|
+
return pending.filter(({ external }) => (external.shareScope ?? GLOBAL_SCOPE) === scope);
|
|
4841
|
+
}
|
|
4842
|
+
function loadingIn(pending, scope) {
|
|
4843
|
+
return inScope(pending, scope).map(({ external, ctx }) => [external.packageName, ctx.remote]);
|
|
4844
|
+
}
|
|
4845
|
+
function labelledCopiesIn(pending, scope) {
|
|
4846
|
+
return inScope(pending, scope).map(({ external, ctx }) => ({
|
|
4847
|
+
name: external.packageName,
|
|
4848
|
+
pool: ctx.remote.pool
|
|
4849
|
+
}));
|
|
4297
4850
|
}
|
|
4298
4851
|
function scopeOpenedPackages(decisions) {
|
|
4299
4852
|
if (![...decisions.values()].some((d) => d.action === "scope" && d.partlyServed)) return;
|
|
@@ -4302,15 +4855,16 @@ function createUpdateCache(config, ports) {
|
|
|
4302
4855
|
decisions.set(item, { action: "scope", partlyServed: false });
|
|
4303
4856
|
}
|
|
4304
4857
|
function decidePackage(remoteEntry, group, view) {
|
|
4305
|
-
const pkg = packageOf(group[0].external.packageName);
|
|
4858
|
+
const pkg = view.packageOf(group[0].external.packageName);
|
|
4306
4859
|
const claims = view.claimsOf(pkg);
|
|
4307
4860
|
if (claims.length === 0) return { action: "share" };
|
|
4308
4861
|
const specifiers = group.flatMap(({ external }) => Object.keys(external.entries));
|
|
4309
4862
|
const builds = specifiers.every((specifier) => view.claims.has(specifier)) ? new Set(specifiers.map((specifier) => view.claims.get(specifier).copy.name)) : void 0;
|
|
4310
4863
|
const rejections = group.flatMap((item) => rejectionsOf(item, view.claims));
|
|
4311
4864
|
if (rejections.length > 0) {
|
|
4312
|
-
const
|
|
4313
|
-
|
|
4865
|
+
const copies = group.map(({ ctx }) => ({ tag: ctx.tag, copy: ctx.remote }));
|
|
4866
|
+
const splits = builds !== void 0 && builds.size > 1 || loadSplitsPackage(pkg, copies, claims, accepts);
|
|
4867
|
+
for (const rejection of refused(rejections, splits, view.inPool(pkg)))
|
|
4314
4868
|
reportIncompatible(remoteEntry, rejection);
|
|
4315
4869
|
return { action: "scope", partlyServed: false };
|
|
4316
4870
|
}
|
|
@@ -4331,9 +4885,7 @@ function createUpdateCache(config, ports) {
|
|
|
4331
4885
|
return claim && !accepts(claim.tag, ctx.tag, ctx.remote.requiredVersion) ? [{ item, specifier, claim }] : [];
|
|
4332
4886
|
});
|
|
4333
4887
|
}
|
|
4334
|
-
function refused(
|
|
4335
|
-
const copies = group.map(({ ctx }) => ({ tag: ctx.tag, copy: ctx.remote }));
|
|
4336
|
-
const splits = fromTwoBuilds || loadSplitsPackage(copies, claims, accepts);
|
|
4888
|
+
function refused(rejections, splits, pooled) {
|
|
4337
4889
|
const first = /* @__PURE__ */ new Map();
|
|
4338
4890
|
for (const rejection of rejections)
|
|
4339
4891
|
if (!first.has(rejection.item) && (pooled || !splits || electionKeeps(rejection)))
|
|
@@ -4410,16 +4962,25 @@ function createUpdateCache(config, ports) {
|
|
|
4410
4962
|
}
|
|
4411
4963
|
|
|
4412
4964
|
// src/lib/core/1.domain/pooling/gate.ts
|
|
4413
|
-
function committedView(members, shipped, recordOrder, {
|
|
4965
|
+
function committedView(members, shipped, recordOrder, {
|
|
4966
|
+
shareScope,
|
|
4967
|
+
without,
|
|
4968
|
+
packageOf
|
|
4969
|
+
}) {
|
|
4414
4970
|
const global = /* @__PURE__ */ new Map();
|
|
4415
4971
|
const claims = committedClaims(inRecordOrder(members, recordOrder), { shareScope, without });
|
|
4416
4972
|
for (const [specifier, { tag, copy }] of claims)
|
|
4417
4973
|
global.set(specifier, { tag, remote: copy.name, file: copy.entries[specifier] });
|
|
4418
4974
|
const builds = /* @__PURE__ */ new Map();
|
|
4419
4975
|
for (const [owner, copies] of shipped)
|
|
4420
|
-
if (owner !== without) builds.set(owner, buildOf(owner, copies));
|
|
4976
|
+
if (owner !== without) builds.set(owner, buildOf(owner, copies, packageOf));
|
|
4421
4977
|
const fileOf = subpoolFilesOf(members);
|
|
4422
|
-
return {
|
|
4978
|
+
return {
|
|
4979
|
+
packageOf,
|
|
4980
|
+
builds,
|
|
4981
|
+
global,
|
|
4982
|
+
runsOffMap: runsOffMapOf(members, global, builds, fileOf)
|
|
4983
|
+
};
|
|
4423
4984
|
}
|
|
4424
4985
|
function subpoolFilesOf(members) {
|
|
4425
4986
|
const subpoolOwners = /* @__PURE__ */ new Set();
|
|
@@ -4462,45 +5023,65 @@ function runsOffMapOf(members, global, builds, fileOf) {
|
|
|
4462
5023
|
function judgeRemote(copies, view, accepts) {
|
|
4463
5024
|
const { rejected, missing } = scan(copies, view, accepts);
|
|
4464
5025
|
if (rejected) return { cause: "incompatible", ...rejected };
|
|
4465
|
-
const globalTags = new SpecifierTags(
|
|
5026
|
+
const globalTags = new SpecifierTags(
|
|
5027
|
+
view.packageOf,
|
|
5028
|
+
[...view.global].map(([s, { tag }]) => [s, tag])
|
|
5029
|
+
);
|
|
4466
5030
|
const binding = offMapBinding(copies, view, globalTags);
|
|
4467
5031
|
if (binding) return { cause: "uncovered", ...binding };
|
|
5032
|
+
if (servedSplit(copies, view)) return { cause: "uncovered", unshipped: true };
|
|
4468
5033
|
if (agrees(copies, globalTags)) return "global";
|
|
4469
5034
|
if (missing !== void 0) return { cause: "uncovered", specifier: missing };
|
|
4470
5035
|
if (unwitnessedGap(copies, globalTags, view.builds.values()) === void 0) return "global";
|
|
4471
5036
|
return { cause: "uncovered", unshipped: true };
|
|
4472
5037
|
}
|
|
5038
|
+
function servedSplit(copies, view) {
|
|
5039
|
+
const loaded = new Set(copies.flatMap((copy) => copy.specifiers.map(view.packageOf)));
|
|
5040
|
+
const servedBy = /* @__PURE__ */ new Map();
|
|
5041
|
+
for (const [specifier, { remote }] of view.global) {
|
|
5042
|
+
const pkg = view.packageOf(specifier);
|
|
5043
|
+
if (!loaded.has(pkg)) continue;
|
|
5044
|
+
const first = servedBy.get(pkg);
|
|
5045
|
+
if (first === void 0) servedBy.set(pkg, remote);
|
|
5046
|
+
else if (first !== remote) return true;
|
|
5047
|
+
}
|
|
5048
|
+
return false;
|
|
5049
|
+
}
|
|
4473
5050
|
function coverFromMap(remote, mine, view, actions, policy) {
|
|
4474
5051
|
const files = [];
|
|
4475
5052
|
for (const member of mine) {
|
|
4476
5053
|
const action = actions[member.name];
|
|
4477
|
-
const
|
|
4478
|
-
if (!
|
|
4479
|
-
const
|
|
5054
|
+
const copies = recordsByRemote(member).get(remote);
|
|
5055
|
+
if (!copies) continue;
|
|
5056
|
+
const entries = {};
|
|
5057
|
+
for (const { meta } of copies)
|
|
5058
|
+
for (const [specifier, file] of Object.entries(meta.entries)) entries[specifier] ??= file;
|
|
5059
|
+
const inShareRow = copies.some(({ version }) => version.action === "share");
|
|
5060
|
+
const mapped = mapFiles(entries, view, policy, action);
|
|
4480
5061
|
if ("unmapped" in mapped) return mapped;
|
|
4481
|
-
files.push({ member, action,
|
|
5062
|
+
files.push({ member, action, entries, inShareRow, ...mapped });
|
|
4482
5063
|
}
|
|
4483
5064
|
const reaches = reachesOf(remote, files, view);
|
|
4484
5065
|
const bound = boundByFile(reaches, view);
|
|
4485
5066
|
if (bound !== void 0) return { bound };
|
|
4486
|
-
const servedPackages = new Set([...view.global.keys()].map(packageOf));
|
|
4487
|
-
const gap = files.map((file) => gapOf(file, servedPackages)).find((specifier) => specifier !== void 0);
|
|
5067
|
+
const servedPackages = new Set([...view.global.keys()].map(view.packageOf));
|
|
5068
|
+
const gap = files.map((file) => gapOf(file, servedPackages, view.packageOf)).find((specifier) => specifier !== void 0);
|
|
4488
5069
|
if (gap !== void 0) return { gap };
|
|
4489
5070
|
return { covers: files.filter(covering).map(coverOf) };
|
|
4490
5071
|
}
|
|
4491
|
-
function gapOf({
|
|
4492
|
-
const entrypoints = Object.keys(
|
|
5072
|
+
function gapOf({ entries, covered }, servedPackages, packageOf) {
|
|
5073
|
+
const entrypoints = Object.keys(entries);
|
|
4493
5074
|
const missing = entrypoints.filter((specifier) => !covered.has(specifier));
|
|
4494
5075
|
if (missing.length < entrypoints.length) return missing[0];
|
|
4495
5076
|
return missing.find((specifier) => servedPackages.has(packageOf(specifier)));
|
|
4496
5077
|
}
|
|
4497
|
-
function covering({ action,
|
|
5078
|
+
function covering({ action, entries, covered }) {
|
|
4498
5079
|
if (action.action === "skip") return true;
|
|
4499
|
-
const entrypoints = Object.keys(
|
|
5080
|
+
const entrypoints = Object.keys(entries);
|
|
4500
5081
|
return entrypoints.length > 0 && entrypoints.every((specifier) => covered.has(specifier));
|
|
4501
5082
|
}
|
|
4502
|
-
function coverOf({ member, action,
|
|
4503
|
-
const toSkip = action.action !== "skip" || covered.size > action.covered.length &&
|
|
5083
|
+
function coverOf({ member, action, inShareRow, covered, override }) {
|
|
5084
|
+
const toSkip = action.action !== "skip" || covered.size > action.covered.length && inShareRow;
|
|
4504
5085
|
return { name: member.name, toSkip, override };
|
|
4505
5086
|
}
|
|
4506
5087
|
function reachesOf(remote, files, view) {
|
|
@@ -4511,7 +5092,7 @@ function reachesOf(remote, files, view) {
|
|
|
4511
5092
|
};
|
|
4512
5093
|
for (const file of files) {
|
|
4513
5094
|
const takesMap = covering(file);
|
|
4514
|
-
for (const [specifier, own] of Object.entries(file.
|
|
5095
|
+
for (const [specifier, own] of Object.entries(file.entries)) {
|
|
4515
5096
|
if (!takesMap || !file.covered.has(specifier)) reaches.set(specifier, { remote, file: own });
|
|
4516
5097
|
else {
|
|
4517
5098
|
const reach = fromMap(specifier);
|
|
@@ -4538,10 +5119,10 @@ function boundByFile(reaches, view) {
|
|
|
4538
5119
|
}
|
|
4539
5120
|
return void 0;
|
|
4540
5121
|
}
|
|
4541
|
-
function mapFiles(
|
|
5122
|
+
function mapFiles(entries, view, policy, action) {
|
|
4542
5123
|
const covered = new Set(action.covered);
|
|
4543
5124
|
const override = { ...action.override };
|
|
4544
|
-
for (const specifier in
|
|
5125
|
+
for (const specifier in entries) {
|
|
4545
5126
|
const source = view.global.get(specifier);
|
|
4546
5127
|
if (!source) continue;
|
|
4547
5128
|
if (policy.shareScope !== GLOBAL_SCOPE) {
|
|
@@ -4566,14 +5147,17 @@ function scan(copies, view, accepts) {
|
|
|
4566
5147
|
return { rejected, missing };
|
|
4567
5148
|
}
|
|
4568
5149
|
function offMapBinding(copies, view, globalTags) {
|
|
4569
|
-
const own = new SpecifierTags(
|
|
5150
|
+
const own = new SpecifierTags(
|
|
5151
|
+
view.packageOf,
|
|
5152
|
+
copies.flatMap((c) => c.specifiers.map((s) => [s, c.tag]))
|
|
5153
|
+
);
|
|
4570
5154
|
const servers = /* @__PURE__ */ new Set();
|
|
4571
5155
|
for (const copy of copies)
|
|
4572
5156
|
for (const specifier of copy.specifiers) {
|
|
4573
5157
|
const build = view.global.get(specifier)?.remote;
|
|
4574
5158
|
if (build !== void 0) servers.add(build);
|
|
4575
5159
|
}
|
|
4576
|
-
const firstRun = new SpecifierTags();
|
|
5160
|
+
const firstRun = new SpecifierTags(view.packageOf);
|
|
4577
5161
|
for (const build of servers)
|
|
4578
5162
|
for (const [specifier, { tag }] of view.runsOffMap.get(build) ?? []) {
|
|
4579
5163
|
const reached = globalTags.pinnedTag(specifier) ?? own.pinnedTag(specifier) ?? firstRun.pinnedTag(specifier);
|
|
@@ -4598,13 +5182,21 @@ function createPoolDynamicExternals(config, ports) {
|
|
|
4598
5182
|
for (const [scope, names] of poolableNames(entry, actions)) {
|
|
4599
5183
|
const committed = ports.sharedExternalsRepo.getFromScope(scope);
|
|
4600
5184
|
if (!scopeHasPoolState(committed)) continue;
|
|
4601
|
-
const { pools } = buildPools(committed);
|
|
4602
|
-
const moves = judgeScope(
|
|
5185
|
+
const { pools, packageOf } = buildPools(committed);
|
|
5186
|
+
const moves = judgeScope(
|
|
5187
|
+
entry.name,
|
|
5188
|
+
names,
|
|
5189
|
+
actions,
|
|
5190
|
+
pools,
|
|
5191
|
+
packageOf,
|
|
5192
|
+
Object.keys(committed),
|
|
5193
|
+
scope
|
|
5194
|
+
);
|
|
4603
5195
|
writeMoves(entry.name, names, moves, committed, pools, scope);
|
|
4604
5196
|
}
|
|
4605
5197
|
return Promise.resolve({ entry, actions: publicActions(actions) });
|
|
4606
5198
|
};
|
|
4607
|
-
function judgeScope(remote, names, actions, pools, recordOrder, scope) {
|
|
5199
|
+
function judgeScope(remote, names, actions, pools, packageOf, recordOrder, scope) {
|
|
4608
5200
|
const policy = { shareScope: scope, scopeUrlOf };
|
|
4609
5201
|
const moves = /* @__PURE__ */ new Map();
|
|
4610
5202
|
const selfServe = (members, cause) => {
|
|
@@ -4620,7 +5212,8 @@ function createPoolDynamicExternals(config, ports) {
|
|
|
4620
5212
|
const shipped = copiesByRemote(pool);
|
|
4621
5213
|
const view = committedView(pool, shipped, recordOrder, {
|
|
4622
5214
|
shareScope: scope,
|
|
4623
|
-
without: remote
|
|
5215
|
+
without: remote,
|
|
5216
|
+
packageOf
|
|
4624
5217
|
});
|
|
4625
5218
|
const own = shipped.get(remote) ?? [];
|
|
4626
5219
|
const verdict = judgeRemote(own, view, accepts);
|
|
@@ -4853,6 +5446,9 @@ var createFederationResult = ({
|
|
|
4853
5446
|
config,
|
|
4854
5447
|
adapters,
|
|
4855
5448
|
loadRemoteModule,
|
|
5449
|
+
// A host composing init by hand may not pass it.
|
|
5450
|
+
preloadRemoteModule = () => {
|
|
5451
|
+
},
|
|
4856
5452
|
initRemoteEntryFlow,
|
|
4857
5453
|
afterInitRemoteEntry
|
|
4858
5454
|
}) => {
|
|
@@ -4868,6 +5464,7 @@ var createFederationResult = ({
|
|
|
4868
5464
|
adapters,
|
|
4869
5465
|
loadRemoteModule,
|
|
4870
5466
|
load: loadRemoteModule,
|
|
5467
|
+
preloadRemoteModule,
|
|
4871
5468
|
as: () => ({
|
|
4872
5469
|
loadRemoteModule,
|
|
4873
5470
|
load: loadRemoteModule
|
|
@@ -4981,7 +5578,9 @@ var useNodeImportMap = () => {
|
|
|
4981
5578
|
setImportMapFn: (importMap) => nodeLoader.setMap(importMap).then(() => importMap),
|
|
4982
5579
|
setHostInstancesFn: (keys) => nodeLoader.setHostInstances(keys).then(() => keys),
|
|
4983
5580
|
reloadBrowserFn: () => {
|
|
4984
|
-
}
|
|
5581
|
+
},
|
|
5582
|
+
// import() would evaluate the module, and the loader thread reads a module only once it is imported.
|
|
5583
|
+
preloadModulesFn: noPreload
|
|
4985
5584
|
};
|
|
4986
5585
|
};
|
|
4987
5586
|
|
|
@@ -5005,7 +5604,9 @@ var resolveHostInstances = async (option, deps) => {
|
|
|
5005
5604
|
const entry = await deps.remoteEntryProvider.provide(url, { integrity });
|
|
5006
5605
|
const load = auto.load ?? ((specifier) => import(specifier));
|
|
5007
5606
|
const specifiers = [
|
|
5008
|
-
...new Set(
|
|
5607
|
+
...new Set(
|
|
5608
|
+
(entry.shared ?? []).filter((s) => s.singleton).flatMap((s) => Object.keys(s.entries))
|
|
5609
|
+
)
|
|
5009
5610
|
].filter((s) => auto.include ? matches(s, auto.include) : true).filter((s) => auto.exclude ? !matches(s, auto.exclude) : true);
|
|
5010
5611
|
const map = {};
|
|
5011
5612
|
for (const specifier of specifiers) {
|
|
@@ -5041,7 +5642,7 @@ var HOST_INSTANCES_GLOBAL = "__NF_HOST_INSTANCES__";
|
|
|
5041
5642
|
var buildNodeAdapters = (config) => ({
|
|
5042
5643
|
versionCheck: createVersionCheck(),
|
|
5043
5644
|
manifestProvider: createFsManifestProvider(),
|
|
5044
|
-
remoteEntryProvider: createFsRemoteEntryProvider(),
|
|
5645
|
+
remoteEntryProvider: createFsRemoteEntryProvider(config),
|
|
5045
5646
|
remoteInfoRepo: createRemoteInfoRepository(config),
|
|
5046
5647
|
scopedExternalsRepo: createScopedExternalsRepository(config),
|
|
5047
5648
|
sharedExternalsRepo: createSharedExternalsRepository(config),
|
|
@@ -5058,6 +5659,7 @@ var initNodeFederation = (remotesOrManifestUrl, options = {}) => {
|
|
|
5058
5659
|
loadModuleFn: options.loadModuleFn ?? nodeConfig.loadModuleFn,
|
|
5059
5660
|
setImportMapFn: options.setImportMapFn ?? nodeConfig.setImportMapFn,
|
|
5060
5661
|
reloadBrowserFn: options.reloadBrowserFn ?? nodeConfig.reloadBrowserFn,
|
|
5662
|
+
preloadModulesFn: options.preloadModulesFn ?? nodeConfig.preloadModulesFn,
|
|
5061
5663
|
sse: false
|
|
5062
5664
|
});
|
|
5063
5665
|
const adapters = buildNodeAdapters(config);
|
|
@@ -5081,11 +5683,11 @@ var initNodeFederation = (remotesOrManifestUrl, options = {}) => {
|
|
|
5081
5683
|
const factory = INIT_FLOW_FACTORY({ adapters, config });
|
|
5082
5684
|
const initFlow = createInitFlow(factory);
|
|
5083
5685
|
const initRemoteEntryFlow = createInitRemoteEntryFlow(factory);
|
|
5084
|
-
return hostInstancesReady.then(() => initFlow(remotesOrManifestUrl)).then((
|
|
5085
|
-
(
|
|
5686
|
+
return hostInstancesReady.then(() => initFlow(remotesOrManifestUrl)).then((access) => nodeConfig.nodeLoader.ready().then(() => access)).then(
|
|
5687
|
+
(access) => createFederationResult({
|
|
5086
5688
|
config,
|
|
5087
5689
|
adapters,
|
|
5088
|
-
|
|
5690
|
+
...access,
|
|
5089
5691
|
initRemoteEntryFlow,
|
|
5090
5692
|
afterInitRemoteEntry: () => nodeConfig.nodeLoader.ready()
|
|
5091
5693
|
})
|