Would Sanity accept PRs to add proper TypeScript types to defineType/defineField?

18 replies
Last updated: Nov 29, 2025
Hey! I built
@sanity-typed/types
(link ) in an effort to get proper sanity types out of
defineType
,
defineField
, and
defineArrayMember
. I'd like to merge my changes as much as possible into sanity itself. My question is, would I just start making PRs to the repo? To get some of these changes in, I'd have to make some big changes and I'm hoping to get some confirmation that this is the direction sanity wants to go before I invest the time to do that.
AI Update

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 main branch
  • The Sanity team prefers squash + merge for most PRs
  • Make sure changes are tested and production-ready before submitting

Since you mentioned needing to make "big changes" to get your improvements into Sanity, here's what I'd suggest:

  1. 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/types repo so they can see what you've built.

  2. 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.

  3. 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.

  4. 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!

Show original thread
18 replies

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.

Was this answer helpful?