Skip to content

Export ConfigSchema type#354

Open
amitbeck wants to merge 1 commit intojoe-bell:mainfrom
amitbeck:patch-1
Open

Export ConfigSchema type#354
amitbeck wants to merge 1 commit intojoe-bell:mainfrom
amitbeck:patch-1

Conversation

@amitbeck
Copy link
Copy Markdown

@amitbeck amitbeck commented Dec 11, 2025

Description

In light of #146, I want to extract the config to use in documentation (e.g. Storybook). Until #333 is merged, the only workaround is to declare the config separately to reuse the variants. However, by doing so we lose the type safety of the config.
I'd like to be able to verify that the variants config satisfies the expected ConfigSchema type, but this type is not exported. Currently, trying to extract the ConfigSchema type using NonNullable<Parameters<typeof cva>[1]>['variants'] results in never, therefore rendering it impossible to achieve type safety in this workaround.

Additional context

Somewhat related to #271


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Follow the Style Guide.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).

In light of joe-bell#146, I want to extract the config to a variable to be able to use in documentation (i.e. Storybook). Until joe-bell#33 is merged, there's no other way to reuse the variants. However, by doing so we lose the type safety of the config. I'd like to be able to verify that the variants config satisfies the expected config schema, and by exporting `ConfigSchema` it'll be as easy as `satisfies ConfigSchema`!
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 11, 2025

@amitbeck is attempting to deploy a commit to the Joe Bell OSS Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant