Skip to content

[Bug]: cli example command doesnt respect components.json #120

@btc-echo-ben

Description

@btc-echo-ben

Prerequisites

  • I have searched existing issues to ensure this bug hasn't been reported already
  • I have tested this with the latest version of the components

Bug description

Running ❯ pnpx untitledui@latest example legal-pages/01 does not respect the components.json file. It asks me for the location of the example pages :/

❯ pnpx untitledui@latest example legal-pages/01
✔ Which color would you like to use as the brand color? › brand


✖ Following files already exist in the directory.
- /Users/********/Documents/live-btcecho-v1/packages/ui/postcss.config.mjs
- /Users/********/Documents/live-btcecho-v1/packages/ui/src/styles/globals.css
✔ Do you want to overwrite the existing files? … no
Use --overwrite or -o to overwrite existing files, or refer to the documentation https://www.untitled.com/docs for manual installation. The rest of the files are added.
Import following file to your main file:

styles/globals.css
✔ Dependencies are installed
? Where would you like to add the legal-pages/01 example? › src/pages

Steps to reproduce

  1. Create turbo monorepo
  2. Add a workspace ./packages/ui
  3. In this workspace, place a components.json somthing like this:
{
  "aliases": {
    "components": "@workspace/ui/untitled-ui",
    "utils": "@workspace/ui/utils",
    "styles": "@workspace/ui/styles/untitled-ui",
    "hooks": "@workspace/ui/hooks"
  },
  "examples": "./src/untitled-ui/examples"
}
  1. cd packages/ui and run pnpx untitledui@latest example legal-pages/01

Expected behavior

The dialog should not ask me for the path of example pages or at least give the default value from the components.json

Actual behavior

The dialog places files in the wrong places / asks for the correct location

Code example

Browser

No response

Device type

No response

Component version

No response

Environment details

No response

Screenshots/Videos

No response

Console errors

Additional context

No response

Accessibility impact

  • This bug affects keyboard navigation
  • This bug affects screen reader users
  • This bug affects focus management
  • This bug affects color contrast or visual accessibility

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