Open
Conversation
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`!
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ConfigSchematype, but this type is not exported. Currently, trying to extract theConfigSchematype usingNonNullable<Parameters<typeof cva>[1]>['variants']results innever, 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?
Before submitting the PR, please make sure you do the following
fixes #123).