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

feat: add __internalApplicationType to tool spec #235

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

joshuaellis
Copy link
Member

Adds the __internalApplicationType property to the configuration of the tool as part of the CoreUI project. More information can be seen here – sanity-io/sanity#7980 – we added this parameter to many of the common tools sanity provides.

TLDR; this helps us identify & group tools across studio manifests to be used for the CoreUI menus etc. We see it as a temporary measure of using a studio manifest (similar to create) and this will be replaced in the ✨ future ✨.

component: Tool
component: Tool,
// @ts-expect-error TS doesn't know about this internal field see https://github.com/sanity-io/sanity/pull/7980
__internalApplicationType: 'sanity/media'
} satisfies SanityTool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative approach to avoid @ts-expect-error would be to extend the satisfies clause to the following:

satisfies SanityTool & {__internalApplicationType: 'sanity/media'}

That way, the __internalApplicationType property with its value will be expected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this but then i thought:

  1. it might fail the plugin type check below since it's not a SanityTool anymore?
  2. it's meant to be internal I felt augmenting the type was probably misleading.

But valid point for sure!

@joshuaellis joshuaellis merged commit 602145b into main Jan 8, 2025
10 checks passed
@joshuaellis joshuaellis deleted the feat/add-internal-application-type branch January 8, 2025 15:23
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.

2 participants