Skip to content

Wrong import when adding component. - Shadcn Plugin #352

@RestfuI

Description

@RestfuI

When running the command nx add-component shadcn-ui button, no errors are displayed; however, the generated import for the cn function in the component is incorrect.

Generated Button.tsx:

import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "@myproject-mono/lib/utils";

...

Expected Import:

import { cn } from "@myproject-mono/shadcn-ui-utils";

Note: The library names provided during plugin usage were shadcn-ui and shadcn-ui-utils.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions