@code-pushup/core 0.14.3 → 0.15.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 +19 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -967,6 +967,19 @@ async function getLatestCommit() {
|
|
|
967
967
|
});
|
|
968
968
|
return log.latest;
|
|
969
969
|
}
|
|
970
|
+
function validateCommitData(commitData, options = {}) {
|
|
971
|
+
const { throwError = false } = options;
|
|
972
|
+
if (!commitData) {
|
|
973
|
+
const msg = "no commit data available";
|
|
974
|
+
if (throwError) {
|
|
975
|
+
throw new Error(msg);
|
|
976
|
+
} else {
|
|
977
|
+
console.warn(msg);
|
|
978
|
+
return false;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
return true;
|
|
982
|
+
}
|
|
970
983
|
|
|
971
984
|
// packages/utils/src/lib/group-by-status.ts
|
|
972
985
|
function groupByStatus(results) {
|
|
@@ -1528,12 +1541,15 @@ var verboseUtils = (verbose = false) => ({
|
|
|
1528
1541
|
exec: getExecVerbose(verbose)
|
|
1529
1542
|
});
|
|
1530
1543
|
|
|
1544
|
+
// packages/utils/src/lib/logging.ts
|
|
1545
|
+
import chalk4 from "chalk";
|
|
1546
|
+
|
|
1531
1547
|
// packages/core/package.json
|
|
1532
1548
|
var name = "@code-pushup/core";
|
|
1533
|
-
var version = "0.
|
|
1549
|
+
var version = "0.15.0";
|
|
1534
1550
|
|
|
1535
1551
|
// packages/core/src/lib/implementation/execute-plugin.ts
|
|
1536
|
-
import
|
|
1552
|
+
import chalk5 from "chalk";
|
|
1537
1553
|
|
|
1538
1554
|
// packages/core/src/lib/implementation/runner.ts
|
|
1539
1555
|
import { join as join2 } from "node:path";
|
|
@@ -1603,7 +1619,7 @@ async function executePlugins(plugins, options) {
|
|
|
1603
1619
|
const { progress = false } = options ?? {};
|
|
1604
1620
|
const progressBar = progress ? getProgressBar("Run plugins") : null;
|
|
1605
1621
|
const pluginsResult = await plugins.reduce(async (acc, pluginCfg) => {
|
|
1606
|
-
progressBar?.updateTitle(`Executing ${
|
|
1622
|
+
progressBar?.updateTitle(`Executing ${chalk5.bold(pluginCfg.title)}`);
|
|
1607
1623
|
try {
|
|
1608
1624
|
const pluginReport = await executePlugin(pluginCfg);
|
|
1609
1625
|
progressBar?.incrementInSteps(plugins.length);
|
|
@@ -1710,11 +1726,6 @@ async function persistReport(report, options) {
|
|
|
1710
1726
|
)
|
|
1711
1727
|
);
|
|
1712
1728
|
}
|
|
1713
|
-
function validateCommitData(commitData) {
|
|
1714
|
-
if (!commitData) {
|
|
1715
|
-
console.warn("no commit data available");
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
1729
|
async function persistResult(reportPath, content) {
|
|
1719
1730
|
return writeFile(reportPath, content).then(() => stat2(reportPath)).then((stats) => [reportPath, stats.size]).catch((error) => {
|
|
1720
1731
|
console.warn(error);
|