shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
68.64k stars 4.07k forks source link

CLI: create the right tailwind.config after selecting typescript #1620

Closed schmanat closed 6 months ago

schmanat commented 11 months ago

First of all, i love your UI its awesome, thanks for that.

If I installed the UI with the CLI, it would be great to create the tailwind.config.js based on the decision if the project uses JavaScript or Typescript. So in my opinion it the tailwind config file should (if typescript is selected) be created as tailwind.config.ts (instead of tailwind.config.js)

wadefletch commented 11 months ago

This seems doable from a technical perspective, so I suspect there's a philosophical reason it's been avoided.

You'd have to add new typescript templates for the tailwind config in packages/cli/src/utils/templates.ts, ideally following the format of appending _JS to the existing non-typescript versions, and adding new templates with the current name.

Relevant Tailwind CSS Docs

You'd then have to tie in the new templates based on the config.tsx flag to this logic:

https://github.com/shadcn-ui/ui/blob/1f16cf47288c445ff54b41740fd89d35473ac46c/packages/cli/src/commands/init.ts#L232-L238

shadcn commented 6 months ago

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.