-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
fix(transform): Support aliases that are longer than one character #5678
Conversation
@Tobbe is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
…hadcn-ui#5678) * fix(transform): Support aliases that are longer than one character * feat(shadcn): update handling of aliases * chore: add changeset --------- Co-authored-by: shadcn <[email protected]>
// We fix the alias an return. | ||
const alias = config.aliases.components.charAt(0) | ||
// We fix the alias and return. | ||
const alias = config.aliases.components.split("/")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has caused a regression where the import of cn
is messed up in monorepos.
It results in
import { cn } from "@my-custom-repo/lib/utils"
instead of
import { cn } from "@my-custom-repo/ui/lib/utils"
Although it works fine for the default initialized workspace - @workspace/ui/lib/utils
CC: @shadcn
Trying to add a component generated by v0 I noticed that my import aliases were wrong. This PR fixes that for me.
This is the json that v0 gave me
Without fix:
import DocLayout from "@/components/doc-layout"
With fix:
import DocLayout from "@shad/components/doc-layout"