@code-pushup/cli 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
|
@@ -1459,6 +1459,22 @@ var verboseUtils = (verbose) => ({
|
|
|
1459
1459
|
exec: getExecVerbose(verbose)
|
|
1460
1460
|
});
|
|
1461
1461
|
|
|
1462
|
+
// packages/utils/src/lib/group-by-status.ts
|
|
1463
|
+
function groupByStatus(results) {
|
|
1464
|
+
return results.reduce(
|
|
1465
|
+
(acc, result) => {
|
|
1466
|
+
if (result.status === "fulfilled") {
|
|
1467
|
+
return { ...acc, fulfilled: [...acc.fulfilled, result] };
|
|
1468
|
+
}
|
|
1469
|
+
if (result.status === "rejected") {
|
|
1470
|
+
return { ...acc, rejected: [...acc.rejected, result] };
|
|
1471
|
+
}
|
|
1472
|
+
return acc;
|
|
1473
|
+
},
|
|
1474
|
+
{ fulfilled: [], rejected: [] }
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1462
1478
|
// packages/core/src/lib/implementation/persist.ts
|
|
1463
1479
|
var PersistDirError = class extends Error {
|
|
1464
1480
|
constructor(outputDir) {
|
|
@@ -1609,14 +1625,14 @@ async function executePlugins(plugins, options2) {
|
|
|
1609
1625
|
const errorsCallback = ({ reason }) => console.error(reason);
|
|
1610
1626
|
const results = await Promise.allSettled(pluginsResult);
|
|
1611
1627
|
logMultipleResults(results, "Plugins", void 0, errorsCallback);
|
|
1612
|
-
const
|
|
1613
|
-
if (
|
|
1614
|
-
const errorMessages =
|
|
1628
|
+
const { fulfilled, rejected } = groupByStatus(results);
|
|
1629
|
+
if (rejected.length) {
|
|
1630
|
+
const errorMessages = rejected.map(({ reason }) => reason).join(", ");
|
|
1615
1631
|
throw new Error(
|
|
1616
|
-
`Plugins failed: ${
|
|
1632
|
+
`Plugins failed: ${rejected.length} errors: ${errorMessages}`
|
|
1617
1633
|
);
|
|
1618
1634
|
}
|
|
1619
|
-
return
|
|
1635
|
+
return fulfilled.map((result) => result.value);
|
|
1620
1636
|
}
|
|
1621
1637
|
function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits) {
|
|
1622
1638
|
auditOutputs.forEach((auditOutput) => {
|
|
@@ -1631,7 +1647,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1631
1647
|
|
|
1632
1648
|
// packages/core/package.json
|
|
1633
1649
|
var name = "@code-pushup/core";
|
|
1634
|
-
var version = "0.
|
|
1650
|
+
var version = "0.8.0";
|
|
1635
1651
|
|
|
1636
1652
|
// packages/core/src/lib/implementation/collect.ts
|
|
1637
1653
|
async function collect(options2) {
|