Skip to content

Commit fa9c18f

Browse files
committed
feat(plugin-js-packages): update to zod v4
1 parent 39febf5 commit fa9c18f

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

packages/plugin-js-packages/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
"build-md": "^0.4.1",
4343
"semver": "^7.6.0",
4444
"yargs": "^17.7.2",
45-
"zod": "^3.22.4"
45+
"zod": "^4.0.5"
4646
}
4747
}

packages/plugin-js-packages/src/lib/config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ export function fillAuditLevelMapping(
5353

5454
export const jsPackagesPluginConfigSchema = z.object({
5555
checks: z
56-
.array(packageCommandSchema, {
57-
description:
58-
'Package manager commands to be run. Defaults to both audit and outdated.',
59-
})
56+
.array(packageCommandSchema)
6057
.min(1)
61-
.default(['audit', 'outdated']),
58+
.default(['audit', 'outdated'])
59+
.describe(
60+
'Package manager commands to be run. Defaults to both audit and outdated.',
61+
),
6262
packageManager: packageManagerIdSchema
6363
.describe('Package manager to be used.')
6464
.optional(),
@@ -67,12 +67,12 @@ export const jsPackagesPluginConfigSchema = z.object({
6767
.min(1)
6868
.default(['prod', 'dev']),
6969
auditLevelMapping: z
70-
.record(packageAuditLevelSchema, issueSeveritySchema, {
71-
description:
72-
'Mapping of audit levels to issue severity. Custom mapping or overrides may be entered manually, otherwise has a default preset.',
73-
})
70+
.partialRecord(packageAuditLevelSchema, issueSeveritySchema)
7471
.default(defaultAuditLevelMapping)
75-
.transform(fillAuditLevelMapping),
72+
.transform(fillAuditLevelMapping)
73+
.describe(
74+
'Mapping of audit levels to issue severity. Custom mapping or overrides may be entered manually, otherwise has a default preset.',
75+
),
7676
packageJsonPath: packageJsonPathSchema,
7777
});
7878

0 commit comments

Comments
 (0)