You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the latest cli update I've been working on a component registry that leverages the new updates. Currently I've copy/pasted the registry schemas to ensure that our build process generates registry files that work with the new cli, but it would be awesome if there was a way to directly extend from the zod schemas already defined.
Based on todos in the project, it feels like Proposal 1 would be the preferred path. I'd be happy to put together a PR with a first pass if there is interest in the change!
Proposal 1 - New package
Seems like this idea has already been on the radar. If there is an interest in having this be shared across the monorepo, it would be awesome to publish this as well for external registry builders to leverage as well.
import{z}from'zod'import{registryItemSchema}from'shadcn-registry'// Extend for custom needs while ensuring the structure follows what is expected in the cliexportconstmyCustomRegistry=registryItemSchema.extend({meta: z.object({foo: z.string()})})
Proposal 2 - Expose entry in shadcn package
Seeing how the schema is already defined in the shadcn package, this path could potentially be bundled and exported in the current package. While it would avoid having to expose a new package, it would mean that there is still a dupe entry in apps/www
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
Since the latest cli update I've been working on a component registry that leverages the new updates. Currently I've copy/pasted the registry schemas to ensure that our build process generates registry files that work with the new cli, but it would be awesome if there was a way to directly extend from the zod schemas already defined.
Based on todos in the project, it feels like Proposal 1 would be the preferred path. I'd be happy to put together a PR with a first pass if there is interest in the change!
Proposal 1 - New package
Seems like this idea has already been on the radar. If there is an interest in having this be shared across the monorepo, it would be awesome to publish this as well for external registry builders to leverage as well.
Proposal 2 - Expose entry in
shadcn
packageSeeing how the schema is already defined in the
shadcn
package, this path could potentially be bundled and exported in the current package. While it would avoid having to expose a new package, it would mean that there is still a dupe entry inapps/www
Beta Was this translation helpful? Give feedback.
All reactions