@code-pushup/core 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
@@ -461,7 +461,8 @@ var uploadConfigSchema = z10.object({
461
461
  description: "API key with write access to portal (use `process.env` for security)"
462
462
  }),
463
463
  organization: slugSchema("Organization slug from Code PushUp portal"),
464
- project: slugSchema("Project slug from Code PushUp portal")
464
+ project: slugSchema("Project slug from Code PushUp portal"),
465
+ timeout: z10.number({ description: "Request timeout in minutes (default is 5)" }).positive().int().optional()
465
466
  });
466
467
 
467
468
  // packages/models/src/lib/core-config.ts
@@ -581,6 +582,18 @@ function formatDuration(duration) {
581
582
  }
582
583
  return `${(duration / 1e3).toFixed(2)} s`;
583
584
  }
585
+ function formatDate(date) {
586
+ const locale = "en-US";
587
+ return date.toLocaleString(locale, {
588
+ weekday: "short",
589
+ month: "short",
590
+ day: "numeric",
591
+ year: "numeric",
592
+ hour: "numeric",
593
+ minute: "2-digit",
594
+ timeZoneName: "short"
595
+ }).replace(/\u202F/g, " ");
596
+ }
584
597
 
585
598
  // packages/utils/src/lib/guards.ts
586
599
  function isPromiseFulfilledResult(result) {
@@ -1214,7 +1227,7 @@ function reportToDetailsSection(audit) {
1214
1227
  return details(detailsTitle, detailsTable);
1215
1228
  }
1216
1229
  function reportToAboutSection(report, commitData) {
1217
- const date = (/* @__PURE__ */ new Date()).toString();
1230
+ const date = formatDate(/* @__PURE__ */ new Date());
1218
1231
  const { duration, version: version2, plugins, categories } = report;
1219
1232
  const commitInfo = commitData ? `${commitData.message} (${commitData.hash.slice(0, 7)})` : "N/A";
1220
1233
  const reportMetaTable = [
@@ -1667,7 +1680,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
1667
1680
 
1668
1681
  // packages/core/package.json
1669
1682
  var name = "@code-pushup/core";
1670
- var version = "0.8.25";
1683
+ var version = "0.10.0";
1671
1684
 
1672
1685
  // packages/core/src/lib/implementation/collect.ts
1673
1686
  async function collect(options) {
@@ -1788,7 +1801,7 @@ async function upload(options, uploadFn = uploadToPortal) {
1788
1801
  if (!options.upload) {
1789
1802
  throw new Error("upload config must be set");
1790
1803
  }
1791
- const { apiKey, server, organization, project } = options.upload;
1804
+ const { apiKey, server, organization, project, timeout } = options.upload;
1792
1805
  const report = await loadReport({
1793
1806
  ...persist,
1794
1807
  format: "json"
@@ -1803,7 +1816,7 @@ async function upload(options, uploadFn = uploadToPortal) {
1803
1816
  commit: commitData.hash,
1804
1817
  ...jsonReportToGql(report)
1805
1818
  };
1806
- return uploadFn({ apiKey, server, data });
1819
+ return uploadFn({ apiKey, server, data, timeout });
1807
1820
  }
1808
1821
 
1809
1822
  // packages/core/src/lib/collect-and-persist.ts
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@code-pushup/core",
3
- "version": "0.8.25",
3
+ "version": "0.10.0",
4
4
  "dependencies": {
5
5
  "@code-pushup/models": "*",
6
6
  "@code-pushup/utils": "*",
7
- "@code-pushup/portal-client": "^0.3.0",
7
+ "@code-pushup/portal-client": "^0.4.0",
8
8
  "chalk": "^5.3.0"
9
9
  },
10
10
  "type": "module",
@@ -2,7 +2,7 @@ import { uploadToPortal } from '@code-pushup/portal-client';
2
2
  import { PersistConfig, UploadConfig } from '@code-pushup/models';
3
3
  import { GlobalOptions } from './types';
4
4
  export type UploadOptions = {
5
- upload: Required<UploadConfig>;
5
+ upload: UploadConfig;
6
6
  } & {
7
7
  persist: Required<PersistConfig>;
8
8
  } & GlobalOptions;