@softarc/native-federation-orchestrator 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/fesm2022/@softarc/native-federation-orchestrator.mjs +74 -64
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +4 -4
- package/fesm2022/node.mjs +1 -1
- package/fesm2022/node.mjs.map +1 -1
- package/fesm2022/sdk.mjs +1 -63
- package/fesm2022/sdk.mjs.map +3 -3
- package/package.json +1 -1
- package/quickstart.mjs +12 -12
- package/types/lib/core/1.domain/remote-entry/remote-entry.contract.d.ts +1 -3
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Get up and running in under 2 minutes:
|
|
|
70
70
|
</script>
|
|
71
71
|
|
|
72
72
|
<!-- Include the orchestrator runtime -->
|
|
73
|
-
<script src="https://unpkg.com/@softarc/native-federation-orchestrator@4.5.
|
|
73
|
+
<script src="https://unpkg.com/@softarc/native-federation-orchestrator@4.5.1/quickstart.mjs"></script>
|
|
74
74
|
</head>
|
|
75
75
|
<body>
|
|
76
76
|
<!-- Use your loaded components -->
|
|
@@ -88,7 +88,7 @@ Your micro frontends are now loaded and ready to use. The runtime handles the wh
|
|
|
88
88
|
|
|
89
89
|
```html
|
|
90
90
|
<!-- Development and quick testing -->
|
|
91
|
-
<script src="https://unpkg.com/@softarc/native-federation-orchestrator@4.5.
|
|
91
|
+
<script src="https://unpkg.com/@softarc/native-federation-orchestrator@4.5.1/quickstart.mjs"></script>
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
## Advanced Usage
|
|
@@ -1578,66 +1578,6 @@ function createProcessRemoteEntries(config, ports) {
|
|
|
1578
1578
|
var GLOBAL_SCOPE = "__GLOBAL__";
|
|
1579
1579
|
var STRICT_SCOPE = "strict";
|
|
1580
1580
|
|
|
1581
|
-
// src/lib/core/1.domain/remote-entry/remote-entry.contract.ts
|
|
1582
|
-
var CHUNK_PREFIX = "@nf-internal";
|
|
1583
|
-
function toDenseSharedInfoFormat(shared) {
|
|
1584
|
-
return shared.map((external) => {
|
|
1585
|
-
if ("entries" in external) return external;
|
|
1586
|
-
const { outFileName, ...baseSharedInfoProps } = external;
|
|
1587
|
-
return {
|
|
1588
|
-
...baseSharedInfoProps,
|
|
1589
|
-
entries: { [external.packageName]: outFileName }
|
|
1590
|
-
};
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
1593
|
-
function inferPackageFromSecondary(secondary) {
|
|
1594
|
-
const parts = secondary.split("/");
|
|
1595
|
-
if (secondary.startsWith("@") && parts.length >= 2) {
|
|
1596
|
-
return parts[0] + "/" + parts[1];
|
|
1597
|
-
}
|
|
1598
|
-
return parts[0] ?? secondary;
|
|
1599
|
-
}
|
|
1600
|
-
function densifyExternals(shared) {
|
|
1601
|
-
const result = [];
|
|
1602
|
-
const groupIndex = /* @__PURE__ */ new Map();
|
|
1603
|
-
for (const entry of shared) {
|
|
1604
|
-
const isDense = "entries" in entry;
|
|
1605
|
-
const isChunk = entry.packageName.startsWith(CHUNK_PREFIX + "/");
|
|
1606
|
-
if (isDense || isChunk) {
|
|
1607
|
-
result.push(entry);
|
|
1608
|
-
continue;
|
|
1609
|
-
}
|
|
1610
|
-
const parent = inferPackageFromSecondary(entry.packageName);
|
|
1611
|
-
const sig = JSON.stringify({
|
|
1612
|
-
singleton: entry.singleton,
|
|
1613
|
-
strictVersion: entry.strictVersion,
|
|
1614
|
-
requiredVersion: entry.requiredVersion,
|
|
1615
|
-
version: entry.version,
|
|
1616
|
-
shareScope: entry.shareScope
|
|
1617
|
-
});
|
|
1618
|
-
const key = parent + " " + sig;
|
|
1619
|
-
const existing = groupIndex.get(key);
|
|
1620
|
-
if (existing === void 0) {
|
|
1621
|
-
const dense = {
|
|
1622
|
-
singleton: entry.singleton,
|
|
1623
|
-
strictVersion: entry.strictVersion,
|
|
1624
|
-
requiredVersion: entry.requiredVersion,
|
|
1625
|
-
packageName: parent,
|
|
1626
|
-
entries: { [entry.packageName]: entry.outFileName }
|
|
1627
|
-
};
|
|
1628
|
-
if (entry.version !== void 0) dense.version = entry.version;
|
|
1629
|
-
if (entry.shareScope !== void 0) dense.shareScope = entry.shareScope;
|
|
1630
|
-
if (entry.bundle !== void 0) dense.bundle = entry.bundle;
|
|
1631
|
-
if (entry.dev !== void 0) dense.dev = entry.dev;
|
|
1632
|
-
groupIndex.set(key, result.length);
|
|
1633
|
-
result.push(dense);
|
|
1634
|
-
} else {
|
|
1635
|
-
result[existing].entries[entry.packageName] = entry.outFileName;
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
return result;
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
1581
|
// src/lib/core/2.app/steps/determine-shared-externals.ts
|
|
1642
1582
|
function createDetermineSharedExternals(config, ports) {
|
|
1643
1583
|
return () => {
|
|
@@ -1998,7 +1938,7 @@ function createPoolSharedExternals(config, ports) {
|
|
|
1998
1938
|
}
|
|
1999
1939
|
}
|
|
2000
1940
|
|
|
2001
|
-
// node_modules/.pnpm/@softarc+native-federation@4.3.
|
|
1941
|
+
// node_modules/.pnpm/@softarc+native-federation@4.3.1_typescript@6.0.3/node_modules/@softarc/native-federation/dist/lib/domain/core/build-notification-options.contract.js
|
|
2002
1942
|
var BuildNotificationType = /* @__PURE__ */ ((BuildNotificationType2) => {
|
|
2003
1943
|
BuildNotificationType2["COMPLETED"] = "federation-rebuild-complete";
|
|
2004
1944
|
BuildNotificationType2["ERROR"] = "federation-rebuild-error";
|
|
@@ -2006,14 +1946,14 @@ var BuildNotificationType = /* @__PURE__ */ ((BuildNotificationType2) => {
|
|
|
2006
1946
|
return BuildNotificationType2;
|
|
2007
1947
|
})(BuildNotificationType || {});
|
|
2008
1948
|
|
|
2009
|
-
// node_modules/.pnpm/@softarc+native-federation@4.3.
|
|
2010
|
-
var
|
|
1949
|
+
// node_modules/.pnpm/@softarc+native-federation@4.3.1_typescript@6.0.3/node_modules/@softarc/native-federation/dist/lib/domain/core/chunk.js
|
|
1950
|
+
var CHUNK_PREFIX = "@nf-internal";
|
|
2011
1951
|
function toChunkImport(fileName) {
|
|
2012
1952
|
if (fileName.startsWith("./")) {
|
|
2013
1953
|
fileName = fileName.slice(2);
|
|
2014
1954
|
}
|
|
2015
1955
|
const packageName = fileName.replace(/.(m|c)?js$/, "");
|
|
2016
|
-
return
|
|
1956
|
+
return CHUNK_PREFIX + "/" + packageName;
|
|
2017
1957
|
}
|
|
2018
1958
|
|
|
2019
1959
|
// src/lib/core/2.app/steps/generate-import-map.ts
|
|
@@ -2758,6 +2698,76 @@ var createManifestProvider = () => {
|
|
|
2758
2698
|
};
|
|
2759
2699
|
};
|
|
2760
2700
|
|
|
2701
|
+
// node_modules/.pnpm/@softarc+native-federation@4.3.1_typescript@6.0.3/node_modules/@softarc/native-federation/dist/lib/utils/normalize.js
|
|
2702
|
+
function inferPackageFromSecondary(secondary) {
|
|
2703
|
+
const parts = secondary.split("/");
|
|
2704
|
+
if (secondary.startsWith("@") && parts.length >= 2) {
|
|
2705
|
+
return parts[0] + "/" + parts[1];
|
|
2706
|
+
}
|
|
2707
|
+
return parts[0];
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
// node_modules/.pnpm/@softarc+native-federation@4.3.1_typescript@6.0.3/node_modules/@softarc/native-federation/dist/lib/core/output/densify-externals.js
|
|
2711
|
+
function isDense(entry) {
|
|
2712
|
+
return "entries" in entry;
|
|
2713
|
+
}
|
|
2714
|
+
function isFlatChunk(entry) {
|
|
2715
|
+
return entry.packageName.startsWith(CHUNK_PREFIX);
|
|
2716
|
+
}
|
|
2717
|
+
function densifyExternals(shared) {
|
|
2718
|
+
const result = [];
|
|
2719
|
+
const groupIndex = /* @__PURE__ */ new Map();
|
|
2720
|
+
for (const entry of shared) {
|
|
2721
|
+
if (isDense(entry)) {
|
|
2722
|
+
result.push(entry);
|
|
2723
|
+
continue;
|
|
2724
|
+
}
|
|
2725
|
+
if (isFlatChunk(entry)) {
|
|
2726
|
+
const { outFileName, ...rest } = entry;
|
|
2727
|
+
result.push({ ...rest, entries: { [entry.packageName]: outFileName } });
|
|
2728
|
+
continue;
|
|
2729
|
+
}
|
|
2730
|
+
const parent = inferPackageFromSecondary(entry.packageName);
|
|
2731
|
+
const sig = JSON.stringify({
|
|
2732
|
+
singleton: entry.singleton,
|
|
2733
|
+
strictVersion: entry.strictVersion,
|
|
2734
|
+
requiredVersion: entry.requiredVersion,
|
|
2735
|
+
version: entry.version,
|
|
2736
|
+
shareScope: entry.shareScope
|
|
2737
|
+
});
|
|
2738
|
+
const key = parent + " " + sig;
|
|
2739
|
+
const existing = groupIndex.get(key);
|
|
2740
|
+
if (existing === void 0) {
|
|
2741
|
+
const dense = {
|
|
2742
|
+
singleton: entry.singleton,
|
|
2743
|
+
strictVersion: entry.strictVersion,
|
|
2744
|
+
requiredVersion: entry.requiredVersion,
|
|
2745
|
+
packageName: parent,
|
|
2746
|
+
entries: { [entry.packageName]: entry.outFileName }
|
|
2747
|
+
};
|
|
2748
|
+
if (entry.version !== void 0) dense.version = entry.version;
|
|
2749
|
+
if (entry.shareScope !== void 0) dense.shareScope = entry.shareScope;
|
|
2750
|
+
if (entry.bundle !== void 0) dense.bundle = entry.bundle;
|
|
2751
|
+
if (entry.dev !== void 0) dense.dev = entry.dev;
|
|
2752
|
+
groupIndex.set(key, result.length);
|
|
2753
|
+
result.push(dense);
|
|
2754
|
+
} else {
|
|
2755
|
+
result[existing].entries[entry.packageName] = entry.outFileName;
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
return result;
|
|
2759
|
+
}
|
|
2760
|
+
function toDenseSharedInfoFormat(shared) {
|
|
2761
|
+
return shared.map((external) => {
|
|
2762
|
+
if ("entries" in external) return external;
|
|
2763
|
+
const { outFileName, ...baseSharedInfoProps } = external;
|
|
2764
|
+
return {
|
|
2765
|
+
...baseSharedInfoProps,
|
|
2766
|
+
entries: { [external.packageName]: outFileName }
|
|
2767
|
+
};
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2761
2771
|
// src/lib/core/3.adapters/http/remote-entry-provider.ts
|
|
2762
2772
|
var createRemoteEntryProvider = (config) => {
|
|
2763
2773
|
const ensureOk = (response) => {
|