fix: export constant component types #2001
Merged
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.
The builds provide a
reka-ui/constant
export but at the moment those give an error in TS becausedist/constant.d.ts
only has an empty export.This was caused due to the
constant/
folder being outside thesrc/
folder which was the only folder being included in the TS build config.The
as const
's are ensuring that the TS exports do not fallback tostring[]
--edit--
Due to build error also simplified the nuxt module and remove the
flat()
and function usage. Flat causes a new array to be created which just isn't needed if we use a for loop as in this pr.With these changes it's also possible to support a per component configuration. Currently you can only add all components in a group, but extending
ModuleOptions.components
with the following type would allow users to toggle individual components. Let me know if you want me to add that.--edit--
The two config types can be combined for even more flexiblity ofc