Skip to content

Commit 5de9f72

Browse files
ochafikclaude
andcommitted
fix: use PascalCase schema names and add comparison tests
- Change getSchemaName to use PascalCase (ProgressTokenSchema) to match existing types.ts convention - Add test/generated/spec.schemas.compare.test.ts with 79 tests verifying generated schemas match manual types.ts schemas - Document known limitation: ts-to-zod generates `z.any()` for `typeof` expressions (e.g., JSONRPC_VERSION), while manual schemas use literals 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c5d28e9 commit 5de9f72

File tree

4 files changed

+1231
-1695
lines changed

4 files changed

+1231
-1695
lines changed

scripts/generate-schemas.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ async function main() {
6060
sourceText,
6161
keepComments: true,
6262
skipParseJSDoc: false,
63-
// Keep camelCase naming for backward compatibility
64-
// e.g., ProgressToken → progressTokenSchema
65-
getSchemaName: (typeName: string) => `${typeName.charAt(0).toLowerCase()}${typeName.slice(1)}Schema`,
63+
// Use PascalCase naming to match existing types.ts convention
64+
// e.g., ProgressToken → ProgressTokenSchema
65+
getSchemaName: (typeName: string) => `${typeName}Schema`,
6666
});
6767

6868
if (result.errors.length > 0) {

0 commit comments

Comments
 (0)