@code-pushup/eslint-plugin 0.19.0 → 0.20.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/bin.js +57 -69
- package/index.js +58 -70
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -79,25 +79,15 @@ function executionMetaSchema(options = {
|
|
|
79
79
|
duration: z.number({ description: options.descriptionDuration })
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
function docsUrlSchema(description = "Documentation site") {
|
|
93
|
-
return urlSchema(description).optional().or(z.string().max(0));
|
|
94
|
-
}
|
|
95
|
-
function urlSchema(description) {
|
|
96
|
-
return z.string({ description }).url();
|
|
97
|
-
}
|
|
98
|
-
function titleSchema(description = "Descriptive name") {
|
|
99
|
-
return z.string({ description }).max(MAX_TITLE_LENGTH);
|
|
100
|
-
}
|
|
82
|
+
var slugSchema = z.string({ description: "Unique ID (human-readable, URL-safe)" }).regex(slugRegex, {
|
|
83
|
+
message: "The slug has to follow the pattern [0-9a-z] followed by multiple optional groups of -[0-9a-z]. e.g. my-slug"
|
|
84
|
+
}).max(MAX_SLUG_LENGTH, {
|
|
85
|
+
message: `slug can be max ${MAX_SLUG_LENGTH} characters long`
|
|
86
|
+
});
|
|
87
|
+
var descriptionSchema = z.string({ description: "Description (markdown)" }).max(MAX_DESCRIPTION_LENGTH).optional();
|
|
88
|
+
var urlSchema = z.string().url();
|
|
89
|
+
var docsUrlSchema = urlSchema.optional().or(z.literal("")).describe("Documentation site");
|
|
90
|
+
var titleSchema = z.string({ description: "Descriptive name" }).max(MAX_TITLE_LENGTH);
|
|
101
91
|
function metaSchema(options) {
|
|
102
92
|
const {
|
|
103
93
|
descriptionDescription,
|
|
@@ -107,24 +97,19 @@ function metaSchema(options) {
|
|
|
107
97
|
} = options ?? {};
|
|
108
98
|
return z.object(
|
|
109
99
|
{
|
|
110
|
-
title: titleSchema(titleDescription),
|
|
111
|
-
description: descriptionSchema(descriptionDescription),
|
|
112
|
-
docsUrl: docsUrlSchema(docsUrlDescription)
|
|
100
|
+
title: titleDescription ? titleSchema.describe(titleDescription) : titleSchema,
|
|
101
|
+
description: descriptionDescription ? descriptionSchema.describe(descriptionDescription) : descriptionSchema,
|
|
102
|
+
docsUrl: docsUrlDescription ? docsUrlSchema.describe(docsUrlDescription) : docsUrlSchema
|
|
113
103
|
},
|
|
114
104
|
{ description }
|
|
115
105
|
);
|
|
116
106
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}).min(1, { message: "file name is invalid" });
|
|
124
|
-
}
|
|
125
|
-
function positiveIntSchema(description) {
|
|
126
|
-
return z.number({ description }).int().nonnegative();
|
|
127
|
-
}
|
|
107
|
+
var filePathSchema = z.string().trim().min(1, { message: "path is invalid" });
|
|
108
|
+
var fileNameSchema = z.string().trim().regex(filenameRegex, {
|
|
109
|
+
message: `The filename has to be valid`
|
|
110
|
+
}).min(1, { message: "file name is invalid" });
|
|
111
|
+
var positiveIntSchema = z.number().int().positive();
|
|
112
|
+
var nonnegativeIntSchema = z.number().int().nonnegative();
|
|
128
113
|
function packageVersionSchema(options) {
|
|
129
114
|
const { versionDescription = "NPM version of the package", required } = options ?? {};
|
|
130
115
|
const packageSchema = z.string({ description: "NPM package name" });
|
|
@@ -137,14 +122,14 @@ function packageVersionSchema(options) {
|
|
|
137
122
|
{ description: "NPM package name and version of a published package" }
|
|
138
123
|
);
|
|
139
124
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
125
|
+
var weightSchema = nonnegativeIntSchema.describe(
|
|
126
|
+
"Coefficient for the given score (use weight 0 if only for display)"
|
|
127
|
+
);
|
|
143
128
|
function weightedRefSchema(description, slugDescription) {
|
|
144
129
|
return z.object(
|
|
145
130
|
{
|
|
146
|
-
slug: slugSchema(slugDescription),
|
|
147
|
-
weight: weightSchema("Weight used to calculate score")
|
|
131
|
+
slug: slugSchema.describe(slugDescription),
|
|
132
|
+
weight: weightSchema.describe("Weight used to calculate score")
|
|
148
133
|
},
|
|
149
134
|
{ description }
|
|
150
135
|
);
|
|
@@ -152,14 +137,14 @@ function weightedRefSchema(description, slugDescription) {
|
|
|
152
137
|
function scorableSchema(description, refSchema, duplicateCheckFn, duplicateMessageFn) {
|
|
153
138
|
return z.object(
|
|
154
139
|
{
|
|
155
|
-
slug: slugSchema('Human-readable unique ID, e.g. "performance"'),
|
|
140
|
+
slug: slugSchema.describe('Human-readable unique ID, e.g. "performance"'),
|
|
156
141
|
refs: z.array(refSchema).min(1).refine(
|
|
157
142
|
(refs) => !duplicateCheckFn(refs),
|
|
158
143
|
(refs) => ({
|
|
159
144
|
message: duplicateMessageFn(refs)
|
|
160
145
|
})
|
|
161
|
-
).refine(
|
|
162
|
-
message:
|
|
146
|
+
).refine(hasNonZeroWeightedRef, () => ({
|
|
147
|
+
message: "In a category there has to be at least one ref with weight > 0"
|
|
163
148
|
}))
|
|
164
149
|
},
|
|
165
150
|
{ description }
|
|
@@ -168,13 +153,13 @@ function scorableSchema(description, refSchema, duplicateCheckFn, duplicateMessa
|
|
|
168
153
|
var materialIconSchema = z.enum(MATERIAL_ICONS, {
|
|
169
154
|
description: "Icon from VSCode Material Icons extension"
|
|
170
155
|
});
|
|
171
|
-
function
|
|
172
|
-
return
|
|
156
|
+
function hasNonZeroWeightedRef(refs) {
|
|
157
|
+
return refs.reduce((acc, { weight }) => weight + acc, 0) !== 0;
|
|
173
158
|
}
|
|
174
159
|
|
|
175
160
|
// packages/models/src/lib/audit.ts
|
|
176
161
|
var auditSchema = z2.object({
|
|
177
|
-
slug: slugSchema("ID (unique within plugin)")
|
|
162
|
+
slug: slugSchema.describe("ID (unique within plugin)")
|
|
178
163
|
}).merge(
|
|
179
164
|
metaSchema({
|
|
180
165
|
titleDescription: "Descriptive name",
|
|
@@ -201,17 +186,20 @@ function getDuplicateSlugsInAudits(audits) {
|
|
|
201
186
|
return hasDuplicateStrings(audits.map(({ slug }) => slug));
|
|
202
187
|
}
|
|
203
188
|
|
|
204
|
-
// packages/models/src/lib/audit-
|
|
189
|
+
// packages/models/src/lib/audit-output.ts
|
|
190
|
+
import { z as z4 } from "zod";
|
|
191
|
+
|
|
192
|
+
// packages/models/src/lib/issue.ts
|
|
205
193
|
import { z as z3 } from "zod";
|
|
206
194
|
var sourceFileLocationSchema = z3.object(
|
|
207
195
|
{
|
|
208
|
-
file: filePathSchema("Relative path to source file in Git repo"),
|
|
196
|
+
file: filePathSchema.describe("Relative path to source file in Git repo"),
|
|
209
197
|
position: z3.object(
|
|
210
198
|
{
|
|
211
|
-
startLine: positiveIntSchema("Start line"),
|
|
212
|
-
startColumn: positiveIntSchema("Start column").optional(),
|
|
213
|
-
endLine: positiveIntSchema("End line").optional(),
|
|
214
|
-
endColumn: positiveIntSchema("End column").optional()
|
|
199
|
+
startLine: positiveIntSchema.describe("Start line"),
|
|
200
|
+
startColumn: positiveIntSchema.describe("Start column").optional(),
|
|
201
|
+
endLine: positiveIntSchema.describe("End line").optional(),
|
|
202
|
+
endColumn: positiveIntSchema.describe("End column").optional()
|
|
215
203
|
},
|
|
216
204
|
{ description: "Location in file" }
|
|
217
205
|
).optional()
|
|
@@ -231,21 +219,21 @@ var issueSchema = z3.object(
|
|
|
231
219
|
);
|
|
232
220
|
|
|
233
221
|
// packages/models/src/lib/audit-output.ts
|
|
234
|
-
|
|
222
|
+
var auditDetailsSchema = z4.object(
|
|
223
|
+
{
|
|
224
|
+
issues: z4.array(issueSchema, { description: "List of findings" })
|
|
225
|
+
},
|
|
226
|
+
{ description: "Detailed information" }
|
|
227
|
+
);
|
|
235
228
|
var auditOutputSchema = z4.object(
|
|
236
229
|
{
|
|
237
|
-
slug: slugSchema("Reference to audit"),
|
|
230
|
+
slug: slugSchema.describe("Reference to audit"),
|
|
238
231
|
displayValue: z4.string({ description: "Formatted value (e.g. '0.9 s', '2.1 MB')" }).optional(),
|
|
239
|
-
value:
|
|
232
|
+
value: nonnegativeIntSchema.describe("Raw numeric value"),
|
|
240
233
|
score: z4.number({
|
|
241
234
|
description: "Value between 0 and 1"
|
|
242
235
|
}).min(0).max(1),
|
|
243
|
-
details:
|
|
244
|
-
{
|
|
245
|
-
issues: z4.array(issueSchema, { description: "List of findings" })
|
|
246
|
-
},
|
|
247
|
-
{ description: "Detailed information" }
|
|
248
|
-
).optional()
|
|
236
|
+
details: auditDetailsSchema.optional()
|
|
249
237
|
},
|
|
250
238
|
{ description: "Audit information" }
|
|
251
239
|
);
|
|
@@ -275,7 +263,7 @@ var categoryRefSchema = weightedRefSchema(
|
|
|
275
263
|
type: z5.enum(["audit", "group"], {
|
|
276
264
|
description: "Discriminant for reference kind, affects where `slug` is looked up"
|
|
277
265
|
}),
|
|
278
|
-
plugin: slugSchema(
|
|
266
|
+
plugin: slugSchema.describe(
|
|
279
267
|
"Plugin slug (plugin should contain referenced audit or group)"
|
|
280
268
|
)
|
|
281
269
|
})
|
|
@@ -335,10 +323,8 @@ import { z as z11 } from "zod";
|
|
|
335
323
|
import { z as z6 } from "zod";
|
|
336
324
|
var formatSchema = z6.enum(["json", "md"]);
|
|
337
325
|
var persistConfigSchema = z6.object({
|
|
338
|
-
outputDir: filePathSchema("Artifacts folder").optional(),
|
|
339
|
-
filename: fileNameSchema(
|
|
340
|
-
"Artifacts file name (without extension)"
|
|
341
|
-
).optional(),
|
|
326
|
+
outputDir: filePathSchema.describe("Artifacts folder").optional(),
|
|
327
|
+
filename: fileNameSchema.describe("Artifacts file name (without extension)").optional(),
|
|
342
328
|
format: z6.array(formatSchema).optional()
|
|
343
329
|
});
|
|
344
330
|
|
|
@@ -399,7 +385,7 @@ var runnerConfigSchema = z8.object(
|
|
|
399
385
|
description: "Shell command to execute"
|
|
400
386
|
}),
|
|
401
387
|
args: z8.array(z8.string({ description: "Command arguments" })).optional(),
|
|
402
|
-
outputFile: filePathSchema("Output path"),
|
|
388
|
+
outputFile: filePathSchema.describe("Output path"),
|
|
403
389
|
outputTransform: outputTransformSchema.optional()
|
|
404
390
|
},
|
|
405
391
|
{
|
|
@@ -419,7 +405,7 @@ var pluginMetaSchema = packageVersionSchema().merge(
|
|
|
419
405
|
})
|
|
420
406
|
).merge(
|
|
421
407
|
z9.object({
|
|
422
|
-
slug: slugSchema("Unique plugin slug within core config"),
|
|
408
|
+
slug: slugSchema.describe("Unique plugin slug within core config"),
|
|
423
409
|
icon: materialIconSchema
|
|
424
410
|
})
|
|
425
411
|
);
|
|
@@ -452,12 +438,14 @@ function getMissingRefsFromGroups(pluginCfg) {
|
|
|
452
438
|
// packages/models/src/lib/upload-config.ts
|
|
453
439
|
import { z as z10 } from "zod";
|
|
454
440
|
var uploadConfigSchema = z10.object({
|
|
455
|
-
server: urlSchema("URL of deployed portal API"),
|
|
441
|
+
server: urlSchema.describe("URL of deployed portal API"),
|
|
456
442
|
apiKey: z10.string({
|
|
457
443
|
description: "API key with write access to portal (use `process.env` for security)"
|
|
458
444
|
}),
|
|
459
|
-
organization: slugSchema(
|
|
460
|
-
|
|
445
|
+
organization: slugSchema.describe(
|
|
446
|
+
"Organization slug from Code PushUp portal"
|
|
447
|
+
),
|
|
448
|
+
project: slugSchema.describe("Project slug from Code PushUp portal"),
|
|
461
449
|
timeout: z10.number({ description: "Request timeout in minutes (default is 5)" }).positive().int().optional()
|
|
462
450
|
});
|
|
463
451
|
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
|
|
6
6
|
// packages/plugin-eslint/package.json
|
|
7
7
|
var name = "@code-pushup/eslint-plugin";
|
|
8
|
-
var version = "0.
|
|
8
|
+
var version = "0.20.0";
|
|
9
9
|
|
|
10
10
|
// packages/plugin-eslint/src/lib/config.ts
|
|
11
11
|
import { z } from "zod";
|
|
@@ -101,25 +101,15 @@ function executionMetaSchema(options = {
|
|
|
101
101
|
duration: z2.number({ description: options.descriptionDuration })
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
function docsUrlSchema(description = "Documentation site") {
|
|
115
|
-
return urlSchema(description).optional().or(z2.string().max(0));
|
|
116
|
-
}
|
|
117
|
-
function urlSchema(description) {
|
|
118
|
-
return z2.string({ description }).url();
|
|
119
|
-
}
|
|
120
|
-
function titleSchema(description = "Descriptive name") {
|
|
121
|
-
return z2.string({ description }).max(MAX_TITLE_LENGTH);
|
|
122
|
-
}
|
|
104
|
+
var slugSchema = z2.string({ description: "Unique ID (human-readable, URL-safe)" }).regex(slugRegex, {
|
|
105
|
+
message: "The slug has to follow the pattern [0-9a-z] followed by multiple optional groups of -[0-9a-z]. e.g. my-slug"
|
|
106
|
+
}).max(MAX_SLUG_LENGTH, {
|
|
107
|
+
message: `slug can be max ${MAX_SLUG_LENGTH} characters long`
|
|
108
|
+
});
|
|
109
|
+
var descriptionSchema = z2.string({ description: "Description (markdown)" }).max(MAX_DESCRIPTION_LENGTH).optional();
|
|
110
|
+
var urlSchema = z2.string().url();
|
|
111
|
+
var docsUrlSchema = urlSchema.optional().or(z2.literal("")).describe("Documentation site");
|
|
112
|
+
var titleSchema = z2.string({ description: "Descriptive name" }).max(MAX_TITLE_LENGTH);
|
|
123
113
|
function metaSchema(options) {
|
|
124
114
|
const {
|
|
125
115
|
descriptionDescription,
|
|
@@ -129,24 +119,19 @@ function metaSchema(options) {
|
|
|
129
119
|
} = options ?? {};
|
|
130
120
|
return z2.object(
|
|
131
121
|
{
|
|
132
|
-
title: titleSchema(titleDescription),
|
|
133
|
-
description: descriptionSchema(descriptionDescription),
|
|
134
|
-
docsUrl: docsUrlSchema(docsUrlDescription)
|
|
122
|
+
title: titleDescription ? titleSchema.describe(titleDescription) : titleSchema,
|
|
123
|
+
description: descriptionDescription ? descriptionSchema.describe(descriptionDescription) : descriptionSchema,
|
|
124
|
+
docsUrl: docsUrlDescription ? docsUrlSchema.describe(docsUrlDescription) : docsUrlSchema
|
|
135
125
|
},
|
|
136
126
|
{ description }
|
|
137
127
|
);
|
|
138
128
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}).min(1, { message: "file name is invalid" });
|
|
146
|
-
}
|
|
147
|
-
function positiveIntSchema(description) {
|
|
148
|
-
return z2.number({ description }).int().nonnegative();
|
|
149
|
-
}
|
|
129
|
+
var filePathSchema = z2.string().trim().min(1, { message: "path is invalid" });
|
|
130
|
+
var fileNameSchema = z2.string().trim().regex(filenameRegex, {
|
|
131
|
+
message: `The filename has to be valid`
|
|
132
|
+
}).min(1, { message: "file name is invalid" });
|
|
133
|
+
var positiveIntSchema = z2.number().int().positive();
|
|
134
|
+
var nonnegativeIntSchema = z2.number().int().nonnegative();
|
|
150
135
|
function packageVersionSchema(options) {
|
|
151
136
|
const { versionDescription = "NPM version of the package", required } = options ?? {};
|
|
152
137
|
const packageSchema = z2.string({ description: "NPM package name" });
|
|
@@ -159,14 +144,14 @@ function packageVersionSchema(options) {
|
|
|
159
144
|
{ description: "NPM package name and version of a published package" }
|
|
160
145
|
);
|
|
161
146
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
147
|
+
var weightSchema = nonnegativeIntSchema.describe(
|
|
148
|
+
"Coefficient for the given score (use weight 0 if only for display)"
|
|
149
|
+
);
|
|
165
150
|
function weightedRefSchema(description, slugDescription) {
|
|
166
151
|
return z2.object(
|
|
167
152
|
{
|
|
168
|
-
slug: slugSchema(slugDescription),
|
|
169
|
-
weight: weightSchema("Weight used to calculate score")
|
|
153
|
+
slug: slugSchema.describe(slugDescription),
|
|
154
|
+
weight: weightSchema.describe("Weight used to calculate score")
|
|
170
155
|
},
|
|
171
156
|
{ description }
|
|
172
157
|
);
|
|
@@ -174,14 +159,14 @@ function weightedRefSchema(description, slugDescription) {
|
|
|
174
159
|
function scorableSchema(description, refSchema, duplicateCheckFn, duplicateMessageFn) {
|
|
175
160
|
return z2.object(
|
|
176
161
|
{
|
|
177
|
-
slug: slugSchema('Human-readable unique ID, e.g. "performance"'),
|
|
162
|
+
slug: slugSchema.describe('Human-readable unique ID, e.g. "performance"'),
|
|
178
163
|
refs: z2.array(refSchema).min(1).refine(
|
|
179
164
|
(refs) => !duplicateCheckFn(refs),
|
|
180
165
|
(refs) => ({
|
|
181
166
|
message: duplicateMessageFn(refs)
|
|
182
167
|
})
|
|
183
|
-
).refine(
|
|
184
|
-
message:
|
|
168
|
+
).refine(hasNonZeroWeightedRef, () => ({
|
|
169
|
+
message: "In a category there has to be at least one ref with weight > 0"
|
|
185
170
|
}))
|
|
186
171
|
},
|
|
187
172
|
{ description }
|
|
@@ -190,13 +175,13 @@ function scorableSchema(description, refSchema, duplicateCheckFn, duplicateMessa
|
|
|
190
175
|
var materialIconSchema = z2.enum(MATERIAL_ICONS, {
|
|
191
176
|
description: "Icon from VSCode Material Icons extension"
|
|
192
177
|
});
|
|
193
|
-
function
|
|
194
|
-
return
|
|
178
|
+
function hasNonZeroWeightedRef(refs) {
|
|
179
|
+
return refs.reduce((acc, { weight }) => weight + acc, 0) !== 0;
|
|
195
180
|
}
|
|
196
181
|
|
|
197
182
|
// packages/models/src/lib/audit.ts
|
|
198
183
|
var auditSchema = z3.object({
|
|
199
|
-
slug: slugSchema("ID (unique within plugin)")
|
|
184
|
+
slug: slugSchema.describe("ID (unique within plugin)")
|
|
200
185
|
}).merge(
|
|
201
186
|
metaSchema({
|
|
202
187
|
titleDescription: "Descriptive name",
|
|
@@ -223,17 +208,20 @@ function getDuplicateSlugsInAudits(audits) {
|
|
|
223
208
|
return hasDuplicateStrings(audits.map(({ slug }) => slug));
|
|
224
209
|
}
|
|
225
210
|
|
|
226
|
-
// packages/models/src/lib/audit-
|
|
211
|
+
// packages/models/src/lib/audit-output.ts
|
|
212
|
+
import { z as z5 } from "zod";
|
|
213
|
+
|
|
214
|
+
// packages/models/src/lib/issue.ts
|
|
227
215
|
import { z as z4 } from "zod";
|
|
228
216
|
var sourceFileLocationSchema = z4.object(
|
|
229
217
|
{
|
|
230
|
-
file: filePathSchema("Relative path to source file in Git repo"),
|
|
218
|
+
file: filePathSchema.describe("Relative path to source file in Git repo"),
|
|
231
219
|
position: z4.object(
|
|
232
220
|
{
|
|
233
|
-
startLine: positiveIntSchema("Start line"),
|
|
234
|
-
startColumn: positiveIntSchema("Start column").optional(),
|
|
235
|
-
endLine: positiveIntSchema("End line").optional(),
|
|
236
|
-
endColumn: positiveIntSchema("End column").optional()
|
|
221
|
+
startLine: positiveIntSchema.describe("Start line"),
|
|
222
|
+
startColumn: positiveIntSchema.describe("Start column").optional(),
|
|
223
|
+
endLine: positiveIntSchema.describe("End line").optional(),
|
|
224
|
+
endColumn: positiveIntSchema.describe("End column").optional()
|
|
237
225
|
},
|
|
238
226
|
{ description: "Location in file" }
|
|
239
227
|
).optional()
|
|
@@ -253,21 +241,21 @@ var issueSchema = z4.object(
|
|
|
253
241
|
);
|
|
254
242
|
|
|
255
243
|
// packages/models/src/lib/audit-output.ts
|
|
256
|
-
|
|
244
|
+
var auditDetailsSchema = z5.object(
|
|
245
|
+
{
|
|
246
|
+
issues: z5.array(issueSchema, { description: "List of findings" })
|
|
247
|
+
},
|
|
248
|
+
{ description: "Detailed information" }
|
|
249
|
+
);
|
|
257
250
|
var auditOutputSchema = z5.object(
|
|
258
251
|
{
|
|
259
|
-
slug: slugSchema("Reference to audit"),
|
|
252
|
+
slug: slugSchema.describe("Reference to audit"),
|
|
260
253
|
displayValue: z5.string({ description: "Formatted value (e.g. '0.9 s', '2.1 MB')" }).optional(),
|
|
261
|
-
value:
|
|
254
|
+
value: nonnegativeIntSchema.describe("Raw numeric value"),
|
|
262
255
|
score: z5.number({
|
|
263
256
|
description: "Value between 0 and 1"
|
|
264
257
|
}).min(0).max(1),
|
|
265
|
-
details:
|
|
266
|
-
{
|
|
267
|
-
issues: z5.array(issueSchema, { description: "List of findings" })
|
|
268
|
-
},
|
|
269
|
-
{ description: "Detailed information" }
|
|
270
|
-
).optional()
|
|
258
|
+
details: auditDetailsSchema.optional()
|
|
271
259
|
},
|
|
272
260
|
{ description: "Audit information" }
|
|
273
261
|
);
|
|
@@ -297,7 +285,7 @@ var categoryRefSchema = weightedRefSchema(
|
|
|
297
285
|
type: z6.enum(["audit", "group"], {
|
|
298
286
|
description: "Discriminant for reference kind, affects where `slug` is looked up"
|
|
299
287
|
}),
|
|
300
|
-
plugin: slugSchema(
|
|
288
|
+
plugin: slugSchema.describe(
|
|
301
289
|
"Plugin slug (plugin should contain referenced audit or group)"
|
|
302
290
|
)
|
|
303
291
|
})
|
|
@@ -357,10 +345,8 @@ import { z as z12 } from "zod";
|
|
|
357
345
|
import { z as z7 } from "zod";
|
|
358
346
|
var formatSchema = z7.enum(["json", "md"]);
|
|
359
347
|
var persistConfigSchema = z7.object({
|
|
360
|
-
outputDir: filePathSchema("Artifacts folder").optional(),
|
|
361
|
-
filename: fileNameSchema(
|
|
362
|
-
"Artifacts file name (without extension)"
|
|
363
|
-
).optional(),
|
|
348
|
+
outputDir: filePathSchema.describe("Artifacts folder").optional(),
|
|
349
|
+
filename: fileNameSchema.describe("Artifacts file name (without extension)").optional(),
|
|
364
350
|
format: z7.array(formatSchema).optional()
|
|
365
351
|
});
|
|
366
352
|
|
|
@@ -421,7 +407,7 @@ var runnerConfigSchema = z9.object(
|
|
|
421
407
|
description: "Shell command to execute"
|
|
422
408
|
}),
|
|
423
409
|
args: z9.array(z9.string({ description: "Command arguments" })).optional(),
|
|
424
|
-
outputFile: filePathSchema("Output path"),
|
|
410
|
+
outputFile: filePathSchema.describe("Output path"),
|
|
425
411
|
outputTransform: outputTransformSchema.optional()
|
|
426
412
|
},
|
|
427
413
|
{
|
|
@@ -441,7 +427,7 @@ var pluginMetaSchema = packageVersionSchema().merge(
|
|
|
441
427
|
})
|
|
442
428
|
).merge(
|
|
443
429
|
z10.object({
|
|
444
|
-
slug: slugSchema("Unique plugin slug within core config"),
|
|
430
|
+
slug: slugSchema.describe("Unique plugin slug within core config"),
|
|
445
431
|
icon: materialIconSchema
|
|
446
432
|
})
|
|
447
433
|
);
|
|
@@ -474,12 +460,14 @@ function getMissingRefsFromGroups(pluginCfg) {
|
|
|
474
460
|
// packages/models/src/lib/upload-config.ts
|
|
475
461
|
import { z as z11 } from "zod";
|
|
476
462
|
var uploadConfigSchema = z11.object({
|
|
477
|
-
server: urlSchema("URL of deployed portal API"),
|
|
463
|
+
server: urlSchema.describe("URL of deployed portal API"),
|
|
478
464
|
apiKey: z11.string({
|
|
479
465
|
description: "API key with write access to portal (use `process.env` for security)"
|
|
480
466
|
}),
|
|
481
|
-
organization: slugSchema(
|
|
482
|
-
|
|
467
|
+
organization: slugSchema.describe(
|
|
468
|
+
"Organization slug from Code PushUp portal"
|
|
469
|
+
),
|
|
470
|
+
project: slugSchema.describe("Project slug from Code PushUp portal"),
|
|
483
471
|
timeout: z11.number({ description: "Request timeout in minutes (default is 5)" }).positive().int().optional()
|
|
484
472
|
});
|
|
485
473
|
|