@code-pushup/cli 0.2.0 → 0.3.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 +10 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -24,6 +24,11 @@ import { z as z2 } from "zod";
|
|
|
24
24
|
import { z } from "zod";
|
|
25
25
|
import { MATERIAL_ICONS } from "@code-pushup/portal-client";
|
|
26
26
|
|
|
27
|
+
// packages/models/src/lib/implementation/limits.ts
|
|
28
|
+
var MAX_SLUG_LENGTH = 128;
|
|
29
|
+
var MAX_TITLE_LENGTH = 256;
|
|
30
|
+
var MAX_DESCRIPTION_LENGTH = 65536;
|
|
31
|
+
|
|
27
32
|
// packages/models/src/lib/implementation/utils.ts
|
|
28
33
|
var slugRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
29
34
|
var filenameRegex = /^(?!.*[ \\/:*?"<>|]).+$/;
|
|
@@ -59,12 +64,12 @@ function executionMetaSchema(options2 = {
|
|
|
59
64
|
function slugSchema(description = "Unique ID (human-readable, URL-safe)") {
|
|
60
65
|
return z.string({ description }).regex(slugRegex, {
|
|
61
66
|
message: "The slug has to follow the pattern [0-9a-z] followed by multiple optional groups of -[0-9a-z]. e.g. my-slug"
|
|
62
|
-
}).max(
|
|
63
|
-
message:
|
|
67
|
+
}).max(MAX_SLUG_LENGTH, {
|
|
68
|
+
message: `slug can be max ${MAX_SLUG_LENGTH} characters long`
|
|
64
69
|
});
|
|
65
70
|
}
|
|
66
71
|
function descriptionSchema(description = "Description (markdown)") {
|
|
67
|
-
return z.string({ description }).max(
|
|
72
|
+
return z.string({ description }).max(MAX_DESCRIPTION_LENGTH).optional();
|
|
68
73
|
}
|
|
69
74
|
function docsUrlSchema(description = "Documentation site") {
|
|
70
75
|
return urlSchema(description).optional().or(z.string().max(0));
|
|
@@ -73,7 +78,7 @@ function urlSchema(description) {
|
|
|
73
78
|
return z.string({ description }).url();
|
|
74
79
|
}
|
|
75
80
|
function titleSchema(description = "Descriptive name") {
|
|
76
|
-
return z.string({ description }).max(
|
|
81
|
+
return z.string({ description }).max(MAX_TITLE_LENGTH);
|
|
77
82
|
}
|
|
78
83
|
function metaSchema(options2) {
|
|
79
84
|
const {
|
|
@@ -1596,7 +1601,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1596
1601
|
|
|
1597
1602
|
// packages/core/package.json
|
|
1598
1603
|
var name = "@code-pushup/core";
|
|
1599
|
-
var version = "0.
|
|
1604
|
+
var version = "0.3.0";
|
|
1600
1605
|
|
|
1601
1606
|
// packages/core/src/lib/implementation/collect.ts
|
|
1602
1607
|
async function collect(options2) {
|