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

Shadcx CLI doesn't work in an Nx monorepo. #3779

Closed
DreamwareDevelopment opened this issue Nov 17, 2024 · 4 comments
Closed

Shadcx CLI doesn't work in an Nx monorepo. #3779

DreamwareDevelopment opened this issue Nov 17, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@DreamwareDevelopment
Copy link

Description

I've been using shadcn CLI in my Nx project thanks to the tsconfig.json workaround suggested here and it works. However, I'm getting the same issue I was before that fix with the shadcx CLI. If it's based off shadcn CLI maybe that version just needs to be bumped? Easy to reproduce.

Reproduction URL

https://github.com/anteqkois/shadcn-nx-nextjs-boilerplate

Reproduction steps

1. Clone this [boilerplate](https://github.com/anteqkois/shadcn-nx-nextjs-boilerplate) 
2. Test that shadcn CLI works
3. Reproduce that shadcx does not work
4. See error

Plate version

N/a

Slate React version

N/a

Screenshots

No response

Logs

We could not detect a supported framework at /Users/zander/Documents/Code/test/shadcn-nx-nextjs-boilerplate.
Visit https://ui.shadcn.com/docs/installation/manual to manually configure your project.
Once configured, you can use the cli to add components.

Browsers

No response

@DreamwareDevelopment DreamwareDevelopment added the bug Something isn't working label Nov 17, 2024
@zbeyens
Copy link
Member

zbeyens commented Nov 17, 2024

Will sync shadcx next.

@DreamwareDevelopment
Copy link
Author

DreamwareDevelopment commented Nov 20, 2024

I was able to workaround this by manually installing. The shadcx cli works for adding components

@DreamwareDevelopment
Copy link
Author

DreamwareDevelopment commented Nov 20, 2024

One issue. Shadcx is ignoring the aliases in my components.json. It installs components to ${ROOT}/components/plate-ui. Here is my components.json:

{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "default",
  "rsc": true,
  "tsx": true,
  "tailwind": {
    "config": "apps/my-app/tailwind.config.js",
    "css": "apps/my-app/src/app/global.css",
    "baseColor": "zinc",
    "cssVariables": true
  },
  "aliases": {
    "components": "@/libs/ui-components/src/components",
    "ui": "@/libs/ui-components/src/components/ui",
    "utils": "@/libs/ui-components/src/utils",
    "hooks": "@/libs/ui-components/src/hooks",
    "lib": "@/libs/ui-components/src/lib"
  },
  "registries": {
    "plate": {
      "aliases": {
        "ui": "@/libs/ui-components/src/components/plate-ui"
      },
      "url": "https://platejs.org/r"
    }
  }
}

@zbeyens
Copy link
Member

zbeyens commented Nov 24, 2024

Fixed in 0.1.0 shadcn-ui/ui#5678

@zbeyens zbeyens closed this as completed Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants