Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some of the command-line options are confusing with unexpected results #1578

Open
1 task done
u84six opened this issue Dec 25, 2024 · 0 comments
Open
1 task done

Some of the command-line options are confusing with unexpected results #1578

u84six opened this issue Dec 25, 2024 · 0 comments
Labels
type: feature Introduction of new functionality to the application

Comments

@u84six
Copy link

u84six commented Dec 25, 2024

Prerequisites

  • This feature already exists in shadcn/ui - if not, it won't be considered here so don't continue with your issue.

Describe the feature

When setting the components and utils path (alias), the results are different. Let's say I want to put all shadcn-svelte/ui components under $lib/components/shad so that a project has a path to the shadcn e.g. Button: $lib/components/shad/ui/Button.svelte, it works when running the cli interactively but not when you use the --components-alias feature. It will fail stating that the path doesn't exist.

The utils path behaves completely different. When I run cli interactively, and change the default: $lib/components/utils to something like $lib/utils/shad, it will work and put a shadcn utils file in $lib/utils/shad.ts. I'm not sure why it does it like that, but I can accept it. However, if I use the same path using the --utils-alias $lib/utils/shad switch, it fails with an error stating that the alias in not defined in tsconfig.js. Why does it work interactively but not when you use the switch? I guess I'm a bit confused by these 2 switches. I'm assuming that they just point to where I want shadcn cli to put components and utils, because it definitely generates files in those locations. When using interactively, it creates a shad.ts file under $lib/utils. Strange behavior but maybe my lack of understanding

@u84six u84six added the type: feature Introduction of new functionality to the application label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

1 participant