@code-pushup/core 0.7.0 → 0.8.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/index.js +22 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1448,6 +1448,22 @@ var verboseUtils = (verbose) => ({
|
|
|
1448
1448
|
exec: getExecVerbose(verbose)
|
|
1449
1449
|
});
|
|
1450
1450
|
|
|
1451
|
+
// packages/utils/src/lib/group-by-status.ts
|
|
1452
|
+
function groupByStatus(results) {
|
|
1453
|
+
return results.reduce(
|
|
1454
|
+
(acc, result) => {
|
|
1455
|
+
if (result.status === "fulfilled") {
|
|
1456
|
+
return { ...acc, fulfilled: [...acc.fulfilled, result] };
|
|
1457
|
+
}
|
|
1458
|
+
if (result.status === "rejected") {
|
|
1459
|
+
return { ...acc, rejected: [...acc.rejected, result] };
|
|
1460
|
+
}
|
|
1461
|
+
return acc;
|
|
1462
|
+
},
|
|
1463
|
+
{ fulfilled: [], rejected: [] }
|
|
1464
|
+
);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1451
1467
|
// packages/core/src/lib/implementation/persist.ts
|
|
1452
1468
|
var PersistDirError = class extends Error {
|
|
1453
1469
|
constructor(outputDir) {
|
|
@@ -1598,14 +1614,14 @@ async function executePlugins(plugins, options) {
|
|
|
1598
1614
|
const errorsCallback = ({ reason }) => console.error(reason);
|
|
1599
1615
|
const results = await Promise.allSettled(pluginsResult);
|
|
1600
1616
|
logMultipleResults(results, "Plugins", void 0, errorsCallback);
|
|
1601
|
-
const
|
|
1602
|
-
if (
|
|
1603
|
-
const errorMessages =
|
|
1617
|
+
const { fulfilled, rejected } = groupByStatus(results);
|
|
1618
|
+
if (rejected.length) {
|
|
1619
|
+
const errorMessages = rejected.map(({ reason }) => reason).join(", ");
|
|
1604
1620
|
throw new Error(
|
|
1605
|
-
`Plugins failed: ${
|
|
1621
|
+
`Plugins failed: ${rejected.length} errors: ${errorMessages}`
|
|
1606
1622
|
);
|
|
1607
1623
|
}
|
|
1608
|
-
return
|
|
1624
|
+
return fulfilled.map((result) => result.value);
|
|
1609
1625
|
}
|
|
1610
1626
|
function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits) {
|
|
1611
1627
|
auditOutputs.forEach((auditOutput) => {
|
|
@@ -1620,7 +1636,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1620
1636
|
|
|
1621
1637
|
// packages/core/package.json
|
|
1622
1638
|
var name = "@code-pushup/core";
|
|
1623
|
-
var version = "0.
|
|
1639
|
+
var version = "0.8.0";
|
|
1624
1640
|
|
|
1625
1641
|
// packages/core/src/lib/implementation/collect.ts
|
|
1626
1642
|
async function collect(options) {
|