Skip to content

fix: Update file extension handling in toAliasedImport function #7549

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

damien-schneider
Copy link

#7548 fix

This pull request refines the toAliasedImport function in update-files.ts to handle multi-dot filenames more robustly. The key change ensures that the file extension is correctly identified even for filenames with multiple dots.

Improvements to file extension handling:

  • packages/shadcn/src/utils/updaters/update-files.ts: Updated the logic to determine the file extension by using lastIndexOf('.'), ensuring that multi-dot filenames (e.g., message-demo.const.tsx) are split correctly on the final dot. This change also adjusts how the remaining portion of the filename is calculated.

Copy link

vercel bot commented Jun 6, 2025

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

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant