Skip to content

Commit 63de414

Browse files
committed
⬆️ (package.json): upgrade dependencies to latest versions
♻️ (src/utils/config.ts): update zod schema for outputFormat to use z.enum instead of z.nativeEnum and improve error message for invalid enum values
1 parent 3125b23 commit 63de414

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
"release": "bun run test:all && bun run publish"
5353
},
5454
"devDependencies": {
55-
"@types/bun": "^1.2.20",
55+
"@types/bun": "^1.2.21",
5656
"@types/node": "^24.3.0",
57-
"@typescript-eslint/eslint-plugin": "^8.40.0",
58-
"@typescript-eslint/parser": "^8.40.0",
57+
"@typescript-eslint/eslint-plugin": "^8.41.0",
58+
"@typescript-eslint/parser": "^8.41.0",
5959
"concurrently": "^9.2.1",
60-
"eslint": "^9.33.0",
60+
"eslint": "^9.34.0",
6161
"prettier": "^3.6.2",
6262
"prisma": "^6.14.0",
6363
"tsc-alias": "^1.8.16",
@@ -80,6 +80,6 @@
8080
"ts-morph": "^26.0.0",
8181
"ts-pattern": "^5.8.0",
8282
"type-graphql": "^2.0.0-rc.2",
83-
"zod": "3.25.76"
83+
"zod": "4.1.3"
8484
}
8585
}

src/utils/config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const optionDefinitions = {
9090
default: undefined,
9191
},
9292
outputFormat: {
93-
schema: z.nativeEnum(OutputFormat),
93+
schema: z.enum(OutputFormat),
9494
default: OutputFormat.GRAPHQL,
9595
},
9696
}
@@ -150,8 +150,12 @@ export function validateOptions(options: PluginOptions = {}): NormalizedOptions
150150
if (issue.code === 'invalid_type') {
151151
return `Ensure ${path} is of type ${issue.expected}`
152152
}
153-
if (issue.code === 'invalid_enum_value' && 'options' in issue) {
154-
return `${path} must be one of: ${issue.options.join(', ')}`
153+
if (issue.code === 'invalid_value' && 'values' in issue) {
154+
const values = (issue as any).values
155+
if (Array.isArray(values)) {
156+
return `${path} must be one of: ${values.join(', ')}`
157+
}
158+
return `Check the ${path} option value`
155159
}
156160
if (issue.code === 'custom' && path.includes('scalarTypes')) {
157161
return `Use valid GraphQL scalar types: Standard types are ${VALID_SCALAR_VALUES.join(', ')}. Custom types must start with an uppercase letter or underscore and contain only letters, numbers, and underscores.`

0 commit comments

Comments
 (0)