Replies: 1 comment
-
The reason for this design is, I suppose, to keep the npm package lightweight. In this approach, not all the component files need to be pushed to the npm registry along with the CLI. The remote fetch call to the registry is primarily used for obtaining the code necessary for file system operations; including many files as regular imports in the package would make it heavier. This way, when you use the CLI, it can efficiently copy the necessary files to your project directory without making the CLI package itself excessively large. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a question about the CLI code. Asking because I'm curious. Not because it matters to how I use the CLI.
Why does the CLI make a remote fetch call to https://ui.shadcn.com/registry. Why not use a regular import in the CLI code?
Code: https://github.com/shadcn-ui/ui/blob/main/packages/cli/src/utils/registry/index.ts#L136-L152
Beta Was this translation helpful? Give feedback.
All reactions