Skip to content

[Bug]: a folder for a component isn't created when using CLI #1537

@Esensats

Description

@Esensats

Reproduction

  1. Use the following components.json:
{
  "$schema": "https://shadcn-vue.com/schema.json",
  "style": "new-york",
  "typescript": true,
  "tailwind": {
    "config": "",
    "css": "src/ui/styles/index.css",
    "baseColor": "neutral",
    "cssVariables": true,
    "prefix": ""
  },
  "aliases": {
    "components": "@/ui/components",
    "composables": "@/ui/composables",
    "utils": "@/shared/utils/cn",
    "ui": "@/ui/components/shadcn",
    "lib": "@/shared"
  },
  "iconLibrary": "lucide"
}
  1. Install the Select component using npx shadcn-vue@latest add select

Describe the bug

Observe the resulting directory structure:

.
├── components.json
├── package.json
├── package-lock.json
├── src
│   ├── main.ts
│   ├── shared
│   │   └── utils
│   │       └── cn.ts
│   └── ui
│       └── components
│           └── shadcn
│               ├── index.ts
│               ├── SelectContent.vue
│               ├── SelectGroup.vue
│               ├── SelectItemText.vue
│               ├── SelectItem.vue
│               ├── SelectLabel.vue
│               ├── SelectScrollDownButton.vue
│               ├── SelectScrollUpButton.vue
│               ├── SelectSeparator.vue
│               ├── SelectTrigger.vue
│               ├── SelectValue.vue
│               └── Select.vue
└── tsconfig.json

Expected behavior:

The CLI should've created a select/ directory inside of shadcn/ and put everything there.

System Info

System:
    OS: Linux 6.16 EndeavourOS
    CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics
    Memory: 18.02 GB / 30.67 GB
    Container: Yes
    Shell: 5.3.3 - /bin/bash
  Binaries:
    Node: 22.16.0 - /home/username/.asdf/installs/nodejs/lts/bin/node
    npm: 10.9.2 - /home/username/.asdf/plugins/nodejs/shims/npm
    Deno: 2.5.1 - /usr/bin/deno
  Browsers:
    Firefox: 143.0.1
    Firefox Developer Edition: 143.0.1
  npmPackages:
    @vueuse/core: ^13.9.0 => 13.9.0 
    reka-ui: ^2.6.0 => 2.6.0 
    vue: ^3.5.18 => 3.5.21

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions