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

feat: build a valid config depending on file extension #942

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

juliusmarminge
Copy link

@juliusmarminge juliusmarminge commented Jul 16, 2023

This PR makes sure that the content of the built tailwind config always matches what "mode" we're in.

  • for .ts configs, we import type as well as export default {} satisfies Config
  • for .cjs configs, we do the current behavior (type import via jsdoc and module.exports = config
  • for .mjs configs, we do the current behavior but with export default config

for .js configs, we check if we're in a module. if yes, use a ESM config, else use a CJS config

Closes #406

@vercel
Copy link

vercel bot commented Jul 16, 2023

@juliusmarminge is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jul 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2024 9:07am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-template ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2024 9:07am

@juliusmarminge
Copy link
Author

juliusmarminge commented Sep 14, 2023

Yo @shadcn want me to get this up to date and ship?

create-next-app now also generates a .ts file

@juliusmarminge
Copy link
Author

hey @shadcn I know you merged #1247 for ts support but this one also supports esm js config for those using that in their projects so i'll keep it open

@shadcn
Copy link
Collaborator

shadcn commented Jan 28, 2024

@juliusmarminge Yes. I was going to comment that I like your esm config approach here. Let's keep this open. I'll review and merge.

@shadcn shadcn added area: cli area: roadmap This looks great. We'll add it to the roadmap, review and merge. labels Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli area: roadmap This looks great. We'll add it to the roadmap, review and merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command is not working with t3 app
2 participants