@code-pushup/core 0.8.6 → 0.8.8
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 +27 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// packages/core/src/lib/implementation/persist.ts
|
|
2
|
-
import { existsSync, mkdirSync } from "fs";
|
|
3
|
-
import { stat as stat2, writeFile } from "fs/promises";
|
|
4
|
-
import { join as join2 } from "path";
|
|
2
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { stat as stat2, writeFile } from "node:fs/promises";
|
|
4
|
+
import { join as join2 } from "node:path";
|
|
5
5
|
|
|
6
6
|
// packages/utils/src/lib/execute-process.ts
|
|
7
|
-
import { spawn } from "child_process";
|
|
7
|
+
import { spawn } from "node:child_process";
|
|
8
8
|
|
|
9
9
|
// packages/utils/src/lib/report.ts
|
|
10
|
-
import { join } from "path";
|
|
10
|
+
import { join } from "node:path";
|
|
11
11
|
|
|
12
12
|
// packages/models/src/lib/audit.ts
|
|
13
13
|
import { z as z2 } from "zod";
|
|
@@ -20,6 +20,7 @@ import { MATERIAL_ICONS } from "@code-pushup/portal-client";
|
|
|
20
20
|
var MAX_SLUG_LENGTH = 128;
|
|
21
21
|
var MAX_TITLE_LENGTH = 256;
|
|
22
22
|
var MAX_DESCRIPTION_LENGTH = 65536;
|
|
23
|
+
var MAX_ISSUE_MESSAGE_LENGTH = 1024;
|
|
23
24
|
|
|
24
25
|
// packages/models/src/lib/implementation/utils.ts
|
|
25
26
|
var slugRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
@@ -200,7 +201,7 @@ var issueSeveritySchema = z3.enum(["info", "warning", "error"], {
|
|
|
200
201
|
});
|
|
201
202
|
var issueSchema = z3.object(
|
|
202
203
|
{
|
|
203
|
-
message: z3.string({ description: "Descriptive error message" }).max(
|
|
204
|
+
message: z3.string({ description: "Descriptive error message" }).max(MAX_ISSUE_MESSAGE_LENGTH),
|
|
204
205
|
severity: issueSeveritySchema,
|
|
205
206
|
source: sourceFileLocationSchema.optional()
|
|
206
207
|
},
|
|
@@ -550,11 +551,11 @@ var SCORE_COLOR_RANGE = {
|
|
|
550
551
|
// packages/utils/src/lib/file-system.ts
|
|
551
552
|
import { bundleRequire } from "bundle-require";
|
|
552
553
|
import chalk from "chalk";
|
|
553
|
-
import { mkdir, readFile, readdir, stat } from "fs/promises";
|
|
554
|
+
import { mkdir, readFile, readdir, stat } from "node:fs/promises";
|
|
554
555
|
|
|
555
556
|
// packages/utils/src/lib/formatting.ts
|
|
556
557
|
function slugify(text) {
|
|
557
|
-
return text.trim().toLowerCase().replace(/\s+|\//g, "-").replace(/[^a-
|
|
558
|
+
return text.trim().toLowerCase().replace(/\s+|\//g, "-").replace(/[^a-z\d-]/g, "");
|
|
558
559
|
}
|
|
559
560
|
function formatBytes(bytes, decimals = 2) {
|
|
560
561
|
bytes = Math.max(bytes, 0);
|
|
@@ -939,6 +940,22 @@ async function getLatestCommit() {
|
|
|
939
940
|
return log?.latest;
|
|
940
941
|
}
|
|
941
942
|
|
|
943
|
+
// packages/utils/src/lib/group-by-status.ts
|
|
944
|
+
function groupByStatus(results) {
|
|
945
|
+
return results.reduce(
|
|
946
|
+
(acc, result) => {
|
|
947
|
+
if (result.status === "fulfilled") {
|
|
948
|
+
return { ...acc, fulfilled: [...acc.fulfilled, result] };
|
|
949
|
+
}
|
|
950
|
+
if (result.status === "rejected") {
|
|
951
|
+
return { ...acc, rejected: [...acc.rejected, result] };
|
|
952
|
+
}
|
|
953
|
+
return acc;
|
|
954
|
+
},
|
|
955
|
+
{ fulfilled: [], rejected: [] }
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
|
|
942
959
|
// packages/utils/src/lib/md/details.ts
|
|
943
960
|
function details(title, content, cfg = { open: false }) {
|
|
944
961
|
return `<details${cfg.open ? " open" : ""}>
|
|
@@ -1445,22 +1462,6 @@ var verboseUtils = (verbose) => ({
|
|
|
1445
1462
|
exec: getExecVerbose(verbose)
|
|
1446
1463
|
});
|
|
1447
1464
|
|
|
1448
|
-
// packages/utils/src/lib/group-by-status.ts
|
|
1449
|
-
function groupByStatus(results) {
|
|
1450
|
-
return results.reduce(
|
|
1451
|
-
(acc, result) => {
|
|
1452
|
-
if (result.status === "fulfilled") {
|
|
1453
|
-
return { ...acc, fulfilled: [...acc.fulfilled, result] };
|
|
1454
|
-
}
|
|
1455
|
-
if (result.status === "rejected") {
|
|
1456
|
-
return { ...acc, rejected: [...acc.rejected, result] };
|
|
1457
|
-
}
|
|
1458
|
-
return acc;
|
|
1459
|
-
},
|
|
1460
|
-
{ fulfilled: [], rejected: [] }
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
1465
|
// packages/core/src/lib/implementation/persist.ts
|
|
1465
1466
|
var PersistDirError = class extends Error {
|
|
1466
1467
|
constructor(outputDir) {
|
|
@@ -1522,7 +1523,7 @@ function validateCommitData(commitData) {
|
|
|
1522
1523
|
import chalk4 from "chalk";
|
|
1523
1524
|
|
|
1524
1525
|
// packages/core/src/lib/implementation/runner.ts
|
|
1525
|
-
import { join as join3 } from "path";
|
|
1526
|
+
import { join as join3 } from "node:path";
|
|
1526
1527
|
async function executeRunnerConfig(cfg, onProgress) {
|
|
1527
1528
|
const { args, command, outputFile, outputTransform } = cfg;
|
|
1528
1529
|
const { duration, date } = await executeProcess({
|
|
@@ -1633,7 +1634,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1633
1634
|
|
|
1634
1635
|
// packages/core/package.json
|
|
1635
1636
|
var name = "@code-pushup/core";
|
|
1636
|
-
var version = "0.8.
|
|
1637
|
+
var version = "0.8.8";
|
|
1637
1638
|
|
|
1638
1639
|
// packages/core/src/lib/implementation/collect.ts
|
|
1639
1640
|
async function collect(options) {
|