-
Notifications
You must be signed in to change notification settings - Fork 501
fix(typegen): preserve non-identifier keys in generated types #11736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(typegen): preserve non-identifier keys in generated types #11736
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
🧪 E2E Preview environment🔑 Environment Variables for Local TestingThis is the preview URL for the E2E tests: https://e2e-studio-j7nmga3xr.sanity.dev To run the E2E tests locally, you can use the following environment variables, then run 💬 Remember to build the project first with |
📊 Playwright Test ReportThis report contains test results, including videos of failing tests. |
sgulseth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
⚡️ Editor Performance ReportDeploying studio and running performance tests… |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
kbrabrand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
aa3404f to
f48041b
Compare
f48041b to
f1cc467
Compare
f1cc467 to
730afd9
Compare
Summary
TypeGen now preserves non-identifier property keys by quoting them instead of transforming them to camelCase.
Before:
"my-field"in GROQ →myFieldin generated types (didn't match runtime)After:
"my-field"in GROQ →"my-field"in generated types (matches runtime)Valid JavaScript identifiers remain unquoted:
Property keys that aren't valid JS identifiers (kebab-case, spaces, leading digits, etc.) are now quoted instead of transformed to camelCase. Generated types now match runtime data.
Users accessing kebab-cased keys via camelCase will get type errors:
Test plan