Skip to content
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

Add schema type defintions #2331

Closed
wants to merge 5 commits into from

Conversation

andyrichardson
Copy link
Contributor

About

This would require a fair amount of more work but I thought this could be good as an initial example.

This would add type safety and improve DX.

Note: There are limitations in TS which prevent us from getting more precise types (e.g. Exclude<string, 'array'> == string )

Screenshots

Screenshot 2021-02-24 at 16 21 37

Screenshot 2021-02-24 at 16 41 12

rexxars and others added 5 commits February 23, 2021 20:00
* feat(core): add --mock-browser-env flag to `sanity exec` command (sanity-io#2319)

* feat(cli): load `.env` files before running any command (sanity-io#2320)

* feat(base): add z-offset values for `paneHeader` and `paneFooter`

* fix(desk-tool): improve z-offsets

* Make sure the pane header and footer are always on top of pane content

* feat(base): add `fullscreen` to z-offset values

* fix(desk-tool): use `fullscreen` z-offset for InspectDialog

* refactor(base): improve organization of z-offset API

Co-authored-by: Espen Hovlandsdal <espen@hovlandsdal.com>
@vercel
Copy link

vercel bot commented Feb 24, 2021

@andyrichardson is attempting to deploy a commit to the Sanity Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Feb 24, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

perf-studio – ./

🔍 Inspect: https://vercel.com/sanity-io/perf-studio/EvLMY4bcMwXPpPjhUSS6m942JnFY
✅ Preview: https://perf-studio-git-fork-andyrichardson-patch-1.sanity.build

@rexxars
Copy link
Member

rexxars commented Feb 24, 2021

Thanks Andy! We've already started some of this work over in the @sanity/types module, but from a "compiled schema type" perspective (which differs slightly from the raw schema definition). It would be ideal to keep the definitions there and find a way to share the common properties/interfaces for both the compiled and uncompiled versions

@andyrichardson
Copy link
Contributor Author

Thanks for the response @rexxars!

I'll close this for now as it was more of a proposal than anything else. It's not something I have a lot of time to work on atm 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants