@code-pushup/cli 0.8.25 → 0.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/index.js
CHANGED
|
@@ -469,7 +469,8 @@ var uploadConfigSchema = z10.object({
|
|
|
469
469
|
description: "API key with write access to portal (use `process.env` for security)"
|
|
470
470
|
}),
|
|
471
471
|
organization: slugSchema("Organization slug from Code PushUp portal"),
|
|
472
|
-
project: slugSchema("Project slug from Code PushUp portal")
|
|
472
|
+
project: slugSchema("Project slug from Code PushUp portal"),
|
|
473
|
+
timeout: z10.number({ description: "Request timeout in minutes (default is 5)" }).positive().int().optional()
|
|
473
474
|
});
|
|
474
475
|
|
|
475
476
|
// packages/models/src/lib/core-config.ts
|
|
@@ -589,6 +590,18 @@ function formatDuration(duration) {
|
|
|
589
590
|
}
|
|
590
591
|
return `${(duration / 1e3).toFixed(2)} s`;
|
|
591
592
|
}
|
|
593
|
+
function formatDate(date) {
|
|
594
|
+
const locale = "en-US";
|
|
595
|
+
return date.toLocaleString(locale, {
|
|
596
|
+
weekday: "short",
|
|
597
|
+
month: "short",
|
|
598
|
+
day: "numeric",
|
|
599
|
+
year: "numeric",
|
|
600
|
+
hour: "numeric",
|
|
601
|
+
minute: "2-digit",
|
|
602
|
+
timeZoneName: "short"
|
|
603
|
+
}).replace(/\u202F/g, " ");
|
|
604
|
+
}
|
|
592
605
|
|
|
593
606
|
// packages/utils/src/lib/guards.ts
|
|
594
607
|
function isPromiseFulfilledResult(result) {
|
|
@@ -1222,7 +1235,7 @@ function reportToDetailsSection(audit) {
|
|
|
1222
1235
|
return details(detailsTitle, detailsTable);
|
|
1223
1236
|
}
|
|
1224
1237
|
function reportToAboutSection(report, commitData) {
|
|
1225
|
-
const date = (/* @__PURE__ */ new Date())
|
|
1238
|
+
const date = formatDate(/* @__PURE__ */ new Date());
|
|
1226
1239
|
const { duration, version: version2, plugins, categories } = report;
|
|
1227
1240
|
const commitInfo = commitData ? `${commitData.message} (${commitData.hash.slice(0, 7)})` : "N/A";
|
|
1228
1241
|
const reportMetaTable = [
|
|
@@ -1675,7 +1688,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1675
1688
|
|
|
1676
1689
|
// packages/core/package.json
|
|
1677
1690
|
var name = "@code-pushup/core";
|
|
1678
|
-
var version = "0.
|
|
1691
|
+
var version = "0.10.0";
|
|
1679
1692
|
|
|
1680
1693
|
// packages/core/src/lib/implementation/collect.ts
|
|
1681
1694
|
async function collect(options2) {
|
|
@@ -1796,7 +1809,7 @@ async function upload(options2, uploadFn = uploadToPortal) {
|
|
|
1796
1809
|
if (!options2.upload) {
|
|
1797
1810
|
throw new Error("upload config must be set");
|
|
1798
1811
|
}
|
|
1799
|
-
const { apiKey, server, organization, project } = options2.upload;
|
|
1812
|
+
const { apiKey, server, organization, project, timeout } = options2.upload;
|
|
1800
1813
|
const report = await loadReport({
|
|
1801
1814
|
...persist,
|
|
1802
1815
|
format: "json"
|
|
@@ -1811,7 +1824,7 @@ async function upload(options2, uploadFn = uploadToPortal) {
|
|
|
1811
1824
|
commit: commitData.hash,
|
|
1812
1825
|
...jsonReportToGql(report)
|
|
1813
1826
|
};
|
|
1814
|
-
return uploadFn({ apiKey, server, data });
|
|
1827
|
+
return uploadFn({ apiKey, server, data, timeout });
|
|
1815
1828
|
}
|
|
1816
1829
|
|
|
1817
1830
|
// packages/core/src/lib/collect-and-persist.ts
|
package/package.json
CHANGED