Discussion about merging changes to @sanity-typed/types into Sanity.io and improving dev story for custom types.
That's awesome that you built @sanity-typed/types! Contributing improved TypeScript types to Sanity would be a great addition to the project. Here's how to approach this:
Start with the Contributing Guidelines
Before diving into PRs, definitely check out the CONTRIBUTING.md in the Sanity repo. The key points are:
- Open a discussion first for significant changes - Before investing time in big refactors, it's best to get buy-in from the team
- Pull requests should be made against the
mainbranch - The Sanity team prefers squash + merge for most PRs
- Make sure changes are tested and production-ready before submitting
Recommended Approach for Large Changes
Since you mentioned needing to make "big changes" to get your improvements into Sanity, here's what I'd suggest:
Open a GitHub Discussion or Issue first - Head to the Sanity GitHub repo and either:
- Start a Discussion to propose your TypeScript improvements
- Open an Issue describing what you'd like to improve and why
Explain what improvements your library provides and how they'd benefit the core library. Link to your
@sanity-typed/typesrepo so they can see what you've built.Join the Sanity Community Slack - The Sanity Community is very active and helpful. You can connect with core maintainers there to discuss your proposal informally before investing significant time.
Start small if possible - If you can break your changes into smaller, incremental PRs rather than one massive change, that's usually easier to review and merge. Even if the end goal requires big changes, see if there's a path to get there incrementally.
Reference existing patterns - Look at recent TypeScript-related PRs in the repo to understand their code style and testing expectations.
Why This Matters
Getting alignment upfront is crucial because:
- The team may have specific architectural reasons for current type implementations
- They might be working on similar improvements already
- There could be breaking change considerations for the API
- They'll want to ensure your approach fits their long-term vision
The Sanity team is generally very open to community contributions, but for architectural changes to core types, they'll definitely want to discuss the approach before you invest weeks of work. Starting the conversation now will save you time and increase the chances of your work being merged!
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.