Commit e9d8bc1
feat: use ts-morph for robust AST-based schema post-processing
Replace fragile regex-based post-processing with ts-morph AST transforms:
- Add ts-morph dependency for TypeScript AST manipulation
- Refactor all transforms to collect nodes first, then modify (prevents infinite loops)
- Add field-level validation overrides via configuration:
- AnnotationsSchema.lastModified: z.iso.datetime({ offset: true })
- RootSchema.uri: z.string().startsWith("file://")
- Improve union-to-enum transform to handle all cases including chained methods
Re-export AnnotationsSchema and RootSchema from generated (now have proper validation).
Total schemas re-exported: 22
Lines saved: ~202 (2600 → 2398)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5b48124 commit e9d8bc1
File tree
5 files changed
+347
-236
lines changed- scripts
- src
- generated
5 files changed
+347
-236
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
0 commit comments