@code-pushup/core 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
|
@@ -16,6 +16,11 @@ import { z as z2 } from "zod";
|
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
import { MATERIAL_ICONS } from "@code-pushup/portal-client";
|
|
18
18
|
|
|
19
|
+
// packages/models/src/lib/implementation/limits.ts
|
|
20
|
+
var MAX_SLUG_LENGTH = 128;
|
|
21
|
+
var MAX_TITLE_LENGTH = 256;
|
|
22
|
+
var MAX_DESCRIPTION_LENGTH = 65536;
|
|
23
|
+
|
|
19
24
|
// packages/models/src/lib/implementation/utils.ts
|
|
20
25
|
var slugRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
21
26
|
var filenameRegex = /^(?!.*[ \\/:*?"<>|]).+$/;
|
|
@@ -51,12 +56,12 @@ function executionMetaSchema(options = {
|
|
|
51
56
|
function slugSchema(description = "Unique ID (human-readable, URL-safe)") {
|
|
52
57
|
return z.string({ description }).regex(slugRegex, {
|
|
53
58
|
message: "The slug has to follow the pattern [0-9a-z] followed by multiple optional groups of -[0-9a-z]. e.g. my-slug"
|
|
54
|
-
}).max(
|
|
55
|
-
message:
|
|
59
|
+
}).max(MAX_SLUG_LENGTH, {
|
|
60
|
+
message: `slug can be max ${MAX_SLUG_LENGTH} characters long`
|
|
56
61
|
});
|
|
57
62
|
}
|
|
58
63
|
function descriptionSchema(description = "Description (markdown)") {
|
|
59
|
-
return z.string({ description }).max(
|
|
64
|
+
return z.string({ description }).max(MAX_DESCRIPTION_LENGTH).optional();
|
|
60
65
|
}
|
|
61
66
|
function docsUrlSchema(description = "Documentation site") {
|
|
62
67
|
return urlSchema(description).optional().or(z.string().max(0));
|
|
@@ -65,7 +70,7 @@ function urlSchema(description) {
|
|
|
65
70
|
return z.string({ description }).url();
|
|
66
71
|
}
|
|
67
72
|
function titleSchema(description = "Descriptive name") {
|
|
68
|
-
return z.string({ description }).max(
|
|
73
|
+
return z.string({ description }).max(MAX_TITLE_LENGTH);
|
|
69
74
|
}
|
|
70
75
|
function metaSchema(options) {
|
|
71
76
|
const {
|
|
@@ -1588,7 +1593,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1588
1593
|
|
|
1589
1594
|
// packages/core/package.json
|
|
1590
1595
|
var name = "@code-pushup/core";
|
|
1591
|
-
var version = "0.
|
|
1596
|
+
var version = "0.3.0";
|
|
1592
1597
|
|
|
1593
1598
|
// packages/core/src/lib/implementation/collect.ts
|
|
1594
1599
|
async function collect(options) {
|